1 /* 2 * Copyright (C) 2021 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package android.car.builtin.util; 18 19 import android.annotation.Nullable; 20 import android.annotation.SystemApi; 21 import android.car.builtin.annotation.AddedIn; 22 import android.car.builtin.annotation.PlatformVersion; 23 import android.util.EventLog; 24 25 /** 26 * Helper for {@link EventLog} 27 * 28 * @hide 29 */ 30 @SystemApi(client = SystemApi.Client.MODULE_LIBRARIES) 31 public final class EventLogHelper { 32 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarHelperStart()33 public static void writeCarHelperStart() { 34 EventLog.writeEvent(EventLogTags.CAR_HELPER_START); 35 } 36 37 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarHelperBootPhase(int phase)38 public static void writeCarHelperBootPhase(int phase) { 39 EventLog.writeEvent(EventLogTags.CAR_HELPER_BOOT_PHASE, phase); 40 } 41 42 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarHelperUserStarting(int userId)43 public static void writeCarHelperUserStarting(int userId) { 44 EventLog.writeEvent(EventLogTags.CAR_HELPER_USER_STARTING, userId); 45 } 46 47 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarHelperUserSwitching(int fromUserId, int toUserId)48 public static void writeCarHelperUserSwitching(int fromUserId, int toUserId) { 49 EventLog.writeEvent(EventLogTags.CAR_HELPER_USER_SWITCHING, fromUserId, toUserId); 50 } 51 52 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarHelperUserUnlocking(int userId)53 public static void writeCarHelperUserUnlocking(int userId) { 54 EventLog.writeEvent(EventLogTags.CAR_HELPER_USER_UNLOCKING, userId); 55 } 56 57 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarHelperUserUnlocked(int userId)58 public static void writeCarHelperUserUnlocked(int userId) { 59 EventLog.writeEvent(EventLogTags.CAR_HELPER_USER_UNLOCKED, userId); 60 } 61 62 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarHelperUserStopping(int userId)63 public static void writeCarHelperUserStopping(int userId) { 64 EventLog.writeEvent(EventLogTags.CAR_HELPER_USER_STOPPING, userId); 65 } 66 67 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarHelperUserStopped(int userId)68 public static void writeCarHelperUserStopped(int userId) { 69 EventLog.writeEvent(EventLogTags.CAR_HELPER_USER_STOPPED, userId); 70 } 71 72 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarHelperServiceConnected()73 public static void writeCarHelperServiceConnected() { 74 EventLog.writeEvent(EventLogTags.CAR_HELPER_SVC_CONNECTED); 75 } 76 77 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarServiceInit(int numberServices)78 public static void writeCarServiceInit(int numberServices) { 79 EventLog.writeEvent(EventLogTags.CAR_SERVICE_INIT, numberServices); 80 } 81 82 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarServiceVhalReconnected(int numberServices)83 public static void writeCarServiceVhalReconnected(int numberServices) { 84 EventLog.writeEvent(EventLogTags.CAR_SERVICE_VHAL_RECONNECTED, numberServices); 85 } 86 87 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarServiceSetCarServiceHelper(int pid)88 public static void writeCarServiceSetCarServiceHelper(int pid) { 89 EventLog.writeEvent(EventLogTags.CAR_SERVICE_SET_CAR_SERVICE_HELPER, pid); 90 } 91 92 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarServiceOnUserLifecycle(int type, int fromUserId, int toUserId)93 public static void writeCarServiceOnUserLifecycle(int type, int fromUserId, int toUserId) { 94 EventLog.writeEvent(EventLogTags.CAR_SERVICE_ON_USER_LIFECYCLE, type, fromUserId, toUserId); 95 } 96 97 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarServiceCreate(boolean hasVhal)98 public static void writeCarServiceCreate(boolean hasVhal) { 99 EventLog.writeEvent(EventLogTags.CAR_SERVICE_CREATE, hasVhal ? 1 : 0); 100 } 101 102 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarServiceConnected(@ullable String interfaceName)103 public static void writeCarServiceConnected(@Nullable String interfaceName) { 104 EventLog.writeEvent(EventLogTags.CAR_SERVICE_CONNECTED, interfaceName); 105 } 106 107 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarServiceDestroy(boolean hasVhal)108 public static void writeCarServiceDestroy(boolean hasVhal) { 109 EventLog.writeEvent(EventLogTags.CAR_SERVICE_DESTROY, hasVhal ? 1 : 0); 110 } 111 112 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarServiceVhalDied(long cookie)113 public static void writeCarServiceVhalDied(long cookie) { 114 EventLog.writeEvent(EventLogTags.CAR_SERVICE_VHAL_DIED, cookie); 115 } 116 117 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarServiceInitBootUser()118 public static void writeCarServiceInitBootUser() { 119 EventLog.writeEvent(EventLogTags.CAR_SERVICE_INIT_BOOT_USER); 120 } 121 122 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarServiceOnUserRemoved(int userId)123 public static void writeCarServiceOnUserRemoved(int userId) { 124 EventLog.writeEvent(EventLogTags.CAR_SERVICE_ON_USER_REMOVED, userId); 125 } 126 127 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceInitialUserInfoReq(int requestType, int timeout, int currentUserId, int currentUserFlags, int numberExistingUsers)128 public static void writeCarUserServiceInitialUserInfoReq(int requestType, int timeout, 129 int currentUserId, int currentUserFlags, int numberExistingUsers) { 130 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_INITIAL_USER_INFO_REQ, requestType, timeout, 131 currentUserId, currentUserFlags, numberExistingUsers); 132 } 133 134 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceInitialUserInfoResp(int status, int action, int userId, int flags, @Nullable String safeName, @Nullable String userLocales)135 public static void writeCarUserServiceInitialUserInfoResp(int status, int action, int userId, 136 int flags, @Nullable String safeName, @Nullable String userLocales) { 137 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_INITIAL_USER_INFO_RESP, status, action, 138 userId, flags, safeName, userLocales); 139 } 140 141 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceSetInitialUser(int userId)142 public static void writeCarUserServiceSetInitialUser(int userId) { 143 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_SET_INITIAL_USER, userId); 144 } 145 146 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceSetLifecycleListener(int uid, @Nullable String packageName)147 public static void writeCarUserServiceSetLifecycleListener(int uid, 148 @Nullable String packageName) { 149 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_SET_LIFECYCLE_LISTENER, uid, packageName); 150 } 151 152 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceResetLifecycleListener(int uid, @Nullable String packageName)153 public static void writeCarUserServiceResetLifecycleListener(int uid, 154 @Nullable String packageName) { 155 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_RESET_LIFECYCLE_LISTENER, uid, packageName); 156 } 157 158 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceSwitchUserReq(int userId, int timeout)159 public static void writeCarUserServiceSwitchUserReq(int userId, int timeout) { 160 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_SWITCH_USER_REQ, userId, timeout); 161 } 162 163 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceSwitchUserResp(int halCallbackStatus, int userSwitchStatus, @Nullable String errorMessage)164 public static void writeCarUserServiceSwitchUserResp(int halCallbackStatus, 165 int userSwitchStatus, @Nullable String errorMessage) { 166 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_SWITCH_USER_RESP, halCallbackStatus, 167 userSwitchStatus, errorMessage); 168 } 169 170 /** 171 * Logs a {@code EventLogTags.CAR_USER_SVC_LOGOUT_USER_REQ} event. 172 */ 173 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceLogoutUserReq(int userId, int timeout)174 public static void writeCarUserServiceLogoutUserReq(int userId, int timeout) { 175 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_LOGOUT_USER_REQ, userId, timeout); 176 } 177 178 /** 179 * Logs a {@code EventLogTags.CAR_USER_SVC_LOGOUT_USER_RESP} event. 180 */ 181 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceLogoutUserResp(int halCallbackStatus, int userSwitchStatus, @Nullable String errorMessage)182 public static void writeCarUserServiceLogoutUserResp(int halCallbackStatus, 183 int userSwitchStatus, @Nullable String errorMessage) { 184 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_LOGOUT_USER_RESP, halCallbackStatus, 185 userSwitchStatus, errorMessage); 186 } 187 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServicePostSwitchUserReq(int targetUserId, int currentUserId)188 public static void writeCarUserServicePostSwitchUserReq(int targetUserId, int currentUserId) { 189 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_POST_SWITCH_USER_REQ, targetUserId, 190 currentUserId); 191 } 192 193 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceGetUserAuthReq(int uid, int userId, int numberTypes)194 public static void writeCarUserServiceGetUserAuthReq(int uid, int userId, int numberTypes) { 195 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_GET_USER_AUTH_REQ, uid, userId, numberTypes); 196 } 197 198 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceGetUserAuthResp(int numberValues)199 public static void writeCarUserServiceGetUserAuthResp(int numberValues) { 200 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_GET_USER_AUTH_RESP, numberValues); 201 } 202 203 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceSwitchUserUiReq(int userId)204 public static void writeCarUserServiceSwitchUserUiReq(int userId) { 205 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_SWITCH_USER_UI_REQ, userId); 206 } 207 208 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceSwitchUserFromHalReq(int requestId, int uid)209 public static void writeCarUserServiceSwitchUserFromHalReq(int requestId, int uid) { 210 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_SWITCH_USER_FROM_HAL_REQ, requestId, uid); 211 } 212 213 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceSetUserAuthReq(int uid, int userId, int numberAssociations)214 public static void writeCarUserServiceSetUserAuthReq(int uid, int userId, 215 int numberAssociations) { 216 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_SET_USER_AUTH_REQ, uid, userId, 217 numberAssociations); 218 } 219 220 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceSetUserAuthResp(int numberValues, @Nullable String errorMessage)221 public static void writeCarUserServiceSetUserAuthResp(int numberValues, 222 @Nullable String errorMessage) { 223 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_SET_USER_AUTH_RESP, numberValues, 224 errorMessage); 225 } 226 227 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceCreateUserReq(@ullable String safeName, @Nullable String userType, int flags, int timeout, int hasCallerRestrictions)228 public static void writeCarUserServiceCreateUserReq(@Nullable String safeName, 229 @Nullable String userType, int flags, int timeout, int hasCallerRestrictions) { 230 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_CREATE_USER_REQ, safeName, userType, flags, 231 timeout, hasCallerRestrictions); 232 } 233 234 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceCreateUserResp(int status, int result, @Nullable String errorMessage)235 public static void writeCarUserServiceCreateUserResp(int status, int result, 236 @Nullable String errorMessage) { 237 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_CREATE_USER_RESP, status, result, 238 errorMessage); 239 } 240 241 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceCreateUserUserCreated(int userId, @Nullable String safeName, @Nullable String userType, int flags)242 public static void writeCarUserServiceCreateUserUserCreated(int userId, 243 @Nullable String safeName, @Nullable String userType, int flags) { 244 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_CREATE_USER_USER_CREATED, userId, safeName, 245 userType, flags); 246 } 247 248 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceCreateUserUserRemoved(int userId, @Nullable String reason)249 public static void writeCarUserServiceCreateUserUserRemoved(int userId, 250 @Nullable String reason) { 251 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_CREATE_USER_USER_REMOVED, userId, reason); 252 } 253 254 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceRemoveUserReq(int userId, int hascallerrestrictions)255 public static void writeCarUserServiceRemoveUserReq(int userId, int hascallerrestrictions) { 256 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_REMOVE_USER_REQ, userId, 257 hascallerrestrictions); 258 } 259 260 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceRemoveUserResp(int userId, int result)261 public static void writeCarUserServiceRemoveUserResp(int userId, int result) { 262 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_REMOVE_USER_RESP, userId, result); 263 } 264 265 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceNotifyAppLifecycleListener(int uid, @Nullable String packageName, int eventType, int fromUserId, int toUserId)266 public static void writeCarUserServiceNotifyAppLifecycleListener(int uid, 267 @Nullable String packageName, int eventType, int fromUserId, int toUserId) { 268 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_NOTIFY_APP_LIFECYCLE_LISTENER, uid, 269 packageName, eventType, fromUserId, toUserId); 270 } 271 272 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceNotifyInternalLifecycleListener( @ullable String listenerName, int eventType, int fromUserId, int toUserId)273 public static void writeCarUserServiceNotifyInternalLifecycleListener( 274 @Nullable String listenerName, int eventType, int fromUserId, int toUserId) { 275 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_NOTIFY_INTERNAL_LIFECYCLE_LISTENER, 276 listenerName, eventType, fromUserId, toUserId); 277 } 278 279 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServicePreCreationRequested(int numberUsers, int numberGuests)280 public static void writeCarUserServicePreCreationRequested(int numberUsers, int numberGuests) { 281 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_PRE_CREATION_REQUESTED, numberUsers, 282 numberGuests); 283 } 284 285 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServicePreCreationStatus(int numberExistingUsers, int numberUsersToAdd, int numberUsersToRemove, int numberExistingGuests, int numberGuestsToAdd, int numberGuestsToRemove, int numberInvalidUsersToRemove)286 public static void writeCarUserServicePreCreationStatus(int numberExistingUsers, 287 int numberUsersToAdd, int numberUsersToRemove, int numberExistingGuests, 288 int numberGuestsToAdd, int numberGuestsToRemove, int numberInvalidUsersToRemove) { 289 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_PRE_CREATION_STATUS, numberExistingUsers, 290 numberUsersToAdd, numberUsersToRemove, numberExistingGuests, numberGuestsToAdd, 291 numberGuestsToRemove, numberInvalidUsersToRemove); 292 } 293 294 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceStartUserInBackgroundReq(int userId)295 public static void writeCarUserServiceStartUserInBackgroundReq(int userId) { 296 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_START_USER_IN_BACKGROUND_REQ, userId); 297 } 298 299 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceStartUserInBackgroundResp(int userId, int result)300 public static void writeCarUserServiceStartUserInBackgroundResp(int userId, int result) { 301 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_START_USER_IN_BACKGROUND_RESP, userId, 302 result); 303 } 304 305 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceStopUserReq(int userId)306 public static void writeCarUserServiceStopUserReq(int userId) { 307 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_STOP_USER_REQ, userId); 308 } 309 310 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceStopUserResp(int userId, int result)311 public static void writeCarUserServiceStopUserResp(int userId, int result) { 312 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_STOP_USER_RESP, userId, result); 313 } 314 315 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserServiceInitialUserInfoReqComplete(int requestType)316 public static void writeCarUserServiceInitialUserInfoReqComplete(int requestType) { 317 EventLog.writeEvent(EventLogTags.CAR_USER_SVC_INITIAL_USER_INFO_REQ_COMPLETE, requestType); 318 } 319 320 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserHalInitialUserInfoReq(int requestId, int requestType, int timeout)321 public static void writeCarUserHalInitialUserInfoReq(int requestId, int requestType, 322 int timeout) { 323 EventLog.writeEvent(EventLogTags.CAR_USER_HAL_INITIAL_USER_INFO_REQ, requestId, requestType, 324 timeout); 325 } 326 327 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserHalInitialUserInfoResp(int requestId, int status, int action, int userId, int flags, @Nullable String safeName, @Nullable String userLocales)328 public static void writeCarUserHalInitialUserInfoResp(int requestId, int status, int action, 329 int userId, int flags, @Nullable String safeName, @Nullable String userLocales) { 330 EventLog.writeEvent(EventLogTags.CAR_USER_HAL_INITIAL_USER_INFO_RESP, requestId, status, 331 action, userId, flags, safeName, userLocales); 332 } 333 334 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserHalSwitchUserReq(int requestId, int userId, int userFlags, int timeout)335 public static void writeCarUserHalSwitchUserReq(int requestId, int userId, int userFlags, 336 int timeout) { 337 EventLog.writeEvent(EventLogTags.CAR_USER_HAL_SWITCH_USER_REQ, requestId, userId, userFlags, 338 timeout); 339 } 340 341 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserHalSwitchUserResp(int requestId, int status, int result, @Nullable String errorMessage)342 public static void writeCarUserHalSwitchUserResp(int requestId, int status, int result, 343 @Nullable String errorMessage) { 344 EventLog.writeEvent(EventLogTags.CAR_USER_HAL_SWITCH_USER_RESP, requestId, status, result, 345 errorMessage); 346 } 347 348 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserHalPostSwitchUserReq(int requestId, int targetUserId, int currentUserId)349 public static void writeCarUserHalPostSwitchUserReq(int requestId, int targetUserId, 350 int currentUserId) { 351 EventLog.writeEvent(EventLogTags.CAR_USER_HAL_POST_SWITCH_USER_REQ, requestId, targetUserId, 352 currentUserId); 353 } 354 355 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserHalGetUserAuthReq(@ullable Object[] int32Values)356 public static void writeCarUserHalGetUserAuthReq(@Nullable Object[] int32Values) { 357 EventLog.writeEvent(EventLogTags.CAR_USER_HAL_GET_USER_AUTH_REQ, int32Values); 358 } 359 360 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserHalGetUserAuthResp(@ullable Object[] valuesAndError)361 public static void writeCarUserHalGetUserAuthResp(@Nullable Object[] valuesAndError) { 362 EventLog.writeEvent(EventLogTags.CAR_USER_HAL_GET_USER_AUTH_RESP, valuesAndError); 363 } 364 365 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserHalLegacySwitchUserReq(int requestId, int targetUserId, int currentUserId)366 public static void writeCarUserHalLegacySwitchUserReq(int requestId, int targetUserId, 367 int currentUserId) { 368 EventLog.writeEvent(EventLogTags.CAR_USER_HAL_LEGACY_SWITCH_USER_REQ, requestId, 369 targetUserId, currentUserId); 370 } 371 372 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserHalSetUserAuthReq(@ullable Object[] int32Values)373 public static void writeCarUserHalSetUserAuthReq(@Nullable Object[] int32Values) { 374 EventLog.writeEvent(EventLogTags.CAR_USER_HAL_SET_USER_AUTH_REQ, int32Values); 375 } 376 377 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserHalSetUserAuthResp(@ullable Object[] valuesAndError)378 public static void writeCarUserHalSetUserAuthResp(@Nullable Object[] valuesAndError) { 379 EventLog.writeEvent(EventLogTags.CAR_USER_HAL_SET_USER_AUTH_RESP, valuesAndError); 380 } 381 382 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserHalOemSwitchUserReq(int requestId, int targetUserId)383 public static void writeCarUserHalOemSwitchUserReq(int requestId, int targetUserId) { 384 EventLog.writeEvent(EventLogTags.CAR_USER_HAL_OEM_SWITCH_USER_REQ, requestId, targetUserId); 385 } 386 387 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserHalCreateUserReq(int requestId, @Nullable String safeName, int flags, int timeout)388 public static void writeCarUserHalCreateUserReq(int requestId, @Nullable String safeName, 389 int flags, int timeout) { 390 EventLog.writeEvent(EventLogTags.CAR_USER_HAL_CREATE_USER_REQ, requestId, safeName, flags, 391 timeout); 392 } 393 394 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserHalCreateUserResp(int requestId, int status, int result, @Nullable String errorMessage)395 public static void writeCarUserHalCreateUserResp(int requestId, int status, int result, 396 @Nullable String errorMessage) { 397 EventLog.writeEvent(EventLogTags.CAR_USER_HAL_CREATE_USER_RESP, requestId, status, result, 398 errorMessage); 399 } 400 401 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserHalRemoveUserReq(int targetUserId, int currentUserId)402 public static void writeCarUserHalRemoveUserReq(int targetUserId, int currentUserId) { 403 EventLog.writeEvent(EventLogTags.CAR_USER_HAL_REMOVE_USER_REQ, targetUserId, currentUserId); 404 } 405 406 /** Logs a {@code EventLogTags.CAR_USER_MGR_ADD_LISTENER} event. */ 407 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerAddListener(int uid, @Nullable String packageName, boolean hasFilter)408 public static void writeCarUserManagerAddListener(int uid, @Nullable String packageName, 409 boolean hasFilter) { 410 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_ADD_LISTENER, uid, packageName, 411 hasFilter ? 1 : 0); 412 } 413 414 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerRemoveListener(int uid, @Nullable String packageName)415 public static void writeCarUserManagerRemoveListener(int uid, @Nullable String packageName) { 416 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_REMOVE_LISTENER, uid, packageName); 417 } 418 419 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerDisconnected(int uid)420 public static void writeCarUserManagerDisconnected(int uid) { 421 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_DISCONNECTED, uid); 422 } 423 424 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerSwitchUserReq(int uid, int userId)425 public static void writeCarUserManagerSwitchUserReq(int uid, int userId) { 426 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_SWITCH_USER_REQ, uid, userId); 427 } 428 429 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerSwitchUserResp(int uid, int status, @Nullable String errorMessage)430 public static void writeCarUserManagerSwitchUserResp(int uid, int status, 431 @Nullable String errorMessage) { 432 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_SWITCH_USER_RESP, uid, status, errorMessage); 433 } 434 435 /** 436 * Logs a {@code EventLogTags.CAR_USER_MGR_LOGOUT_USER_REQ} event. 437 */ 438 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerLogoutUserReq(int uid)439 public static void writeCarUserManagerLogoutUserReq(int uid) { 440 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_LOGOUT_USER_REQ, uid); 441 } 442 443 /** 444 * Logs a {@code EventLogTags.CAR_USER_MGR_LOGOUT_USER_RESP} event. 445 */ 446 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerLogoutUserResp(int uid, int status, @Nullable String errorMessage)447 public static void writeCarUserManagerLogoutUserResp(int uid, int status, 448 @Nullable String errorMessage) { 449 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_LOGOUT_USER_RESP, uid, status, errorMessage); 450 } 451 452 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerGetUserAuthReq(@ullable Object[] types)453 public static void writeCarUserManagerGetUserAuthReq(@Nullable Object[] types) { 454 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_GET_USER_AUTH_REQ, types); 455 } 456 457 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerGetUserAuthResp(@ullable Object[] values)458 public static void writeCarUserManagerGetUserAuthResp(@Nullable Object[] values) { 459 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_GET_USER_AUTH_RESP, values); 460 } 461 462 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerSetUserAuthReq(@ullable Object[] typesAndValuesPairs)463 public static void writeCarUserManagerSetUserAuthReq(@Nullable Object[] typesAndValuesPairs) { 464 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_SET_USER_AUTH_REQ, typesAndValuesPairs); 465 } 466 467 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerSetUserAuthResp(@ullable Object[] values)468 public static void writeCarUserManagerSetUserAuthResp(@Nullable Object[] values) { 469 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_SET_USER_AUTH_RESP, values); 470 } 471 472 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerCreateUserReq(int uid, @Nullable String safeName, @Nullable String userType, int flags)473 public static void writeCarUserManagerCreateUserReq(int uid, @Nullable String safeName, 474 @Nullable String userType, int flags) { 475 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_CREATE_USER_REQ, uid, safeName, userType, 476 flags); 477 } 478 479 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerCreateUserResp(int uid, int status, @Nullable String errorMessage)480 public static void writeCarUserManagerCreateUserResp(int uid, int status, 481 @Nullable String errorMessage) { 482 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_CREATE_USER_RESP, uid, status, errorMessage); 483 } 484 485 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerRemoveUserReq(int uid, int userId)486 public static void writeCarUserManagerRemoveUserReq(int uid, int userId) { 487 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_REMOVE_USER_REQ, uid, userId); 488 } 489 490 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerRemoveUserResp(int uid, int status)491 public static void writeCarUserManagerRemoveUserResp(int uid, int status) { 492 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_REMOVE_USER_RESP, uid, status); 493 } 494 495 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerNotifyLifecycleListener(int numberListeners, int eventType, int fromUserId, int toUserId)496 public static void writeCarUserManagerNotifyLifecycleListener(int numberListeners, 497 int eventType, int fromUserId, int toUserId) { 498 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_NOTIFY_LIFECYCLE_LISTENER, numberListeners, 499 eventType, fromUserId, toUserId); 500 } 501 502 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarUserManagerPreCreateUserReq(int uid)503 public static void writeCarUserManagerPreCreateUserReq(int uid) { 504 EventLog.writeEvent(EventLogTags.CAR_USER_MGR_PRE_CREATE_USER_REQ, uid); 505 } 506 507 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarDevicePolicyManagerRemoveUserReq(int uid, int userId)508 public static void writeCarDevicePolicyManagerRemoveUserReq(int uid, int userId) { 509 EventLog.writeEvent(EventLogTags.CAR_DP_MGR_REMOVE_USER_REQ, uid, userId); 510 } 511 512 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarDevicePolicyManagerRemoveUserResp(int uid, int status)513 public static void writeCarDevicePolicyManagerRemoveUserResp(int uid, int status) { 514 EventLog.writeEvent(EventLogTags.CAR_DP_MGR_REMOVE_USER_RESP, uid, status); 515 } 516 517 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarDevicePolicyManagerCreateUserReq(int uid, @Nullable String safeName, int flags)518 public static void writeCarDevicePolicyManagerCreateUserReq(int uid, @Nullable String safeName, 519 int flags) { 520 EventLog.writeEvent(EventLogTags.CAR_DP_MGR_CREATE_USER_REQ, uid, safeName, flags); 521 } 522 523 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarDevicePolicyManagerCreateUserResp(int uid, int status)524 public static void writeCarDevicePolicyManagerCreateUserResp(int uid, int status) { 525 EventLog.writeEvent(EventLogTags.CAR_DP_MGR_CREATE_USER_RESP, uid, status); 526 } 527 528 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarDevicePolicyManagerStartUserInBackgroundReq(int uid, int userId)529 public static void writeCarDevicePolicyManagerStartUserInBackgroundReq(int uid, int userId) { 530 EventLog.writeEvent(EventLogTags.CAR_DP_MGR_START_USER_IN_BACKGROUND_REQ, uid, userId); 531 } 532 533 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarDevicePolicyManagerStartUserInBackgroundResp(int uid, int status)534 public static void writeCarDevicePolicyManagerStartUserInBackgroundResp(int uid, int status) { 535 EventLog.writeEvent(EventLogTags.CAR_DP_MGR_START_USER_IN_BACKGROUND_RESP, uid, status); 536 } 537 538 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarDevicePolicyManagerStopUserReq(int uid, int userId)539 public static void writeCarDevicePolicyManagerStopUserReq(int uid, int userId) { 540 EventLog.writeEvent(EventLogTags.CAR_DP_MGR_STOP_USER_REQ, uid, userId); 541 } 542 543 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarDevicePolicyManagerStopUserResp(int uid, int status)544 public static void writeCarDevicePolicyManagerStopUserResp(int uid, int status) { 545 EventLog.writeEvent(EventLogTags.CAR_DP_MGR_STOP_USER_RESP, uid, status); 546 } 547 548 @AddedIn(PlatformVersion.TIRAMISU_0) writePowerPolicyChange(String policy)549 public static void writePowerPolicyChange(String policy) { 550 EventLog.writeEvent(EventLogTags.CAR_PWR_MGR_PWR_POLICY_CHANGE, policy); 551 } 552 553 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarPowerManagerStateChange(int state)554 public static void writeCarPowerManagerStateChange(int state) { 555 EventLog.writeEvent(EventLogTags.CAR_PWR_MGR_STATE_CHANGE, state); 556 } 557 558 @AddedIn(PlatformVersion.TIRAMISU_0) writeCarPowerManagerStateRequest(int state, int param)559 public static void writeCarPowerManagerStateRequest(int state, int param) { 560 EventLog.writeEvent(EventLogTags.CAR_PWR_MGR_STATE_REQ, state, param); 561 } 562 563 @AddedIn(PlatformVersion.TIRAMISU_0) writeGarageModeEvent(int status)564 public static void writeGarageModeEvent(int status) { 565 EventLog.writeEvent(EventLogTags.CAR_PWR_MGR_GARAGE_MODE, status); 566 } 567 EventLogHelper()568 private EventLogHelper() { 569 throw new UnsupportedOperationException(); 570 } 571 } 572