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