From d990f2ca2204c6cf2494f3e5111de3ab9db217a0 Mon Sep 17 00:00:00 2001 From: Brandon Liu Date: Tue, 7 Feb 2023 01:32:32 +0000 Subject: [PATCH] Replace onUserSwithing() with onUserStarting() to handle updateOverlayForUser() Bug: b/260206944 Test: Verified affected atests pass. For this CL no more tests added for to test OMS since multi user OMS testing is totally a missing thing and I created another feature request to take care. Change-Id: I4790f330fd513ca333ecccb5b53a10f7cdf33a22 --- .../com/android/server/om/OverlayManagerService.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/services/core/java/com/android/server/om/OverlayManagerService.java b/services/core/java/com/android/server/om/OverlayManagerService.java index 062f0fcd09027..d471c8abb1b2b 100644 --- a/services/core/java/com/android/server/om/OverlayManagerService.java +++ b/services/core/java/com/android/server/om/OverlayManagerService.java @@ -301,7 +301,7 @@ public final class OverlayManagerService extends SystemService { && shellPkgName.equals(overlayInfo.packageName)); initIfNeeded(); - onSwitchUser(UserHandle.USER_SYSTEM); + onStartUser(UserHandle.USER_SYSTEM); publishBinderService(Context.OVERLAY_SERVICE, mService); publishLocalService(OverlayManagerService.class, this); @@ -324,7 +324,7 @@ public final class OverlayManagerService extends SystemService { final UserInfo userInfo = users.get(i); if (!userInfo.supportsSwitchTo() && userInfo.id != UserHandle.USER_SYSTEM) { // Initialize any users that can't be switched to, as their state would - // never be setup in onSwitchUser(). We will switch to the system user right + // never be setup in onStartUser(). We will switch to the system user right // after this, and its state will be setup there. updatePackageManagerLocked(mImpl.updateOverlaysForUser(users.get(i).id)); } @@ -333,13 +333,13 @@ public final class OverlayManagerService extends SystemService { } @Override - public void onUserSwitching(@Nullable TargetUser from, @NonNull TargetUser to) { - onSwitchUser(to.getUserIdentifier()); + public void onUserStarting(TargetUser user) { + onStartUser(user.getUserIdentifier()); } - private void onSwitchUser(@UserIdInt int newUserId) { + private void onStartUser(@UserIdInt int newUserId) { try { - traceBegin(TRACE_TAG_RRO, "OMS#onSwitchUser " + newUserId); + traceBegin(TRACE_TAG_RRO, "OMS#onStartUser " + newUserId); // ensure overlays in the settings are up-to-date, and propagate // any asset changes to the rest of the system synchronized (mLock) {