Loading core/java/android/app/ActivityManager.java +9 −4 Original line number Diff line number Diff line Loading @@ -5967,14 +5967,19 @@ public class ActivityManager { } /** * Used by {@link com.android.systemui.theme.ThemeOverlayController} to notify of color * palette readiness. * Used by ThemeOverlayController to notify when color * palette is ready. * * @param userId The ID of the user where ThemeOverlayController is ready. * * @throws RemoteException * * @hide */ @RequiresPermission(Manifest.permission.SET_THEME_OVERLAY_CONTROLLER_READY) public void setThemeOverlayReady(boolean readiness) { public void setThemeOverlayReady(@UserIdInt int userId) { try { getService().setThemeOverlayReady(readiness); getService().setThemeOverlayReady(userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading core/java/android/app/ActivityManagerInternal.java +1 −1 Original line number Diff line number Diff line Loading @@ -1264,5 +1264,5 @@ public abstract class ActivityManagerInternal { * palette readiness. * @hide */ public abstract boolean getThemeOverlayReadiness(); public abstract boolean isThemeOverlayReady(int userId); } core/java/android/app/IActivityManager.aidl +6 −3 Original line number Diff line number Diff line Loading @@ -554,11 +554,14 @@ interface IActivityManager { void bootAnimationComplete(); /** * Used by {@link com.android.systemui.theme.ThemeOverlayController} to notify of color * palette readiness. * Used by {@link com.android.systemui.theme.ThemeOverlayController} to notify when color * palette is ready. * * @param userId The ID of the user where ThemeOverlayController is ready. * * @throws RemoteException */ void setThemeOverlayReady(boolean readiness); void setThemeOverlayReady(int userId); @UnsupportedAppUsage void registerTaskStackListener(in ITaskStackListener listener); Loading packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java +1 −1 Original line number Diff line number Diff line Loading @@ -815,7 +815,7 @@ public class ThemeOverlayController implements CoreStartable, Dumpable { ? () -> {} : () -> { Log.d(TAG, "ThemeHomeDelay: ThemeOverlayController ready"); mActivityManager.setThemeOverlayReady(true); mActivityManager.setThemeOverlayReady(currentUser); }; if (colorSchemeIsApplied(managedProfiles)) { Loading services/core/java/com/android/server/am/ActivityManagerService.java +26 −24 Original line number Diff line number Diff line Loading @@ -930,7 +930,7 @@ public class ActivityManagerService extends IActivityManager.Stub * Tracks all users with computed color resources by ThemeOverlaycvontroller */ @GuardedBy("this") private final Set<Integer> mThemeOverlayReadiness = new HashSet<>(); private final Set<Integer> mThemeOverlayReadyUsers = new HashSet<>(); /** * Tracks association information for a particular package along with debuggability. Loading Loading @@ -2351,7 +2351,7 @@ public class ActivityManagerService extends IActivityManager.Stub mService.startBroadcastObservers(); } else if (phase == PHASE_THIRD_PARTY_APPS_CAN_START) { mService.mPackageWatchdog.onPackagesReady(); mService.setHomeTimeout(); mService.scheduleHomeTimeout(); } } Loading Loading @@ -5327,40 +5327,43 @@ public class ActivityManagerService extends IActivityManager.Stub /** * Starts Home if there is no completion signal from ThemeOverlayController */ private void setHomeTimeout() { private void scheduleHomeTimeout() { if (enableHomeDelay() && mHasHomeDelay.compareAndSet(false, true)) { int userId = mUserController.getCurrentUserId(); mHandler.postDelayed(() -> { if (!getThemeOverlayReadiness()) { if (!isThemeOverlayReady(userId)) { Slog.d(TAG, "ThemeHomeDelay: ThemeOverlayController not responding, launching " + "Home after " + HOME_LAUNCH_TIMEOUT_MS + "ms"); setThemeOverlayReady(true); setThemeOverlayReady(userId); } }, HOME_LAUNCH_TIMEOUT_MS); } } /** * Used by ThemeOverlayController to notify all listeners for * color palette readiness. * Used by ThemeOverlayController to notify when color * palette is ready. * * @param userId The ID of the user where ThemeOverlayController is ready. * * @throws RemoteException * * @hide */ @Override public void setThemeOverlayReady(boolean readiness) { public void setThemeOverlayReady(@UserIdInt int userId) { enforceCallingPermission(Manifest.permission.SET_THEME_OVERLAY_CONTROLLER_READY, "setThemeOverlayReady"); int currentUserId = mUserController.getCurrentUserId(); boolean updateReadiness; synchronized (mThemeOverlayReadiness) { updateReadiness = readiness ? mThemeOverlayReadiness.add(currentUserId) : mThemeOverlayReadiness.remove(currentUserId); boolean updateUser; synchronized (mThemeOverlayReadyUsers) { updateUser = mThemeOverlayReadyUsers.add(userId); } if (updateReadiness && readiness && enableHomeDelay()) { mAtmInternal.startHomeOnAllDisplays(currentUserId, "setThemeOverlayReady"); if (updateUser && enableHomeDelay()) { mAtmInternal.startHomeOnAllDisplays(userId, "setThemeOverlayReady"); } } Loading @@ -5370,10 +5373,9 @@ public class ActivityManagerService extends IActivityManager.Stub * * @hide */ public boolean getThemeOverlayReadiness() { int uid = mUserController.getCurrentUserId(); synchronized (mThemeOverlayReadiness) { return mThemeOverlayReadiness.contains(uid); public boolean isThemeOverlayReady(int userId) { synchronized (mThemeOverlayReadyUsers) { return mThemeOverlayReadyUsers.contains(userId); } } Loading Loading @@ -18114,8 +18116,8 @@ public class ActivityManagerService extends IActivityManager.Stub // Clean up various services by removing the user mBatteryStatsService.onUserRemoved(userId); synchronized (mThemeOverlayReadiness) { mThemeOverlayReadiness.remove(userId); synchronized (mThemeOverlayReadyUsers) { mThemeOverlayReadyUsers.remove(userId); } } Loading Loading @@ -19477,8 +19479,8 @@ public class ActivityManagerService extends IActivityManager.Stub } @Override public boolean getThemeOverlayReadiness() { return ActivityManagerService.this.getThemeOverlayReadiness(); public boolean isThemeOverlayReady(int userId) { return ActivityManagerService.this.isThemeOverlayReady(userId); } } Loading
core/java/android/app/ActivityManager.java +9 −4 Original line number Diff line number Diff line Loading @@ -5967,14 +5967,19 @@ public class ActivityManager { } /** * Used by {@link com.android.systemui.theme.ThemeOverlayController} to notify of color * palette readiness. * Used by ThemeOverlayController to notify when color * palette is ready. * * @param userId The ID of the user where ThemeOverlayController is ready. * * @throws RemoteException * * @hide */ @RequiresPermission(Manifest.permission.SET_THEME_OVERLAY_CONTROLLER_READY) public void setThemeOverlayReady(boolean readiness) { public void setThemeOverlayReady(@UserIdInt int userId) { try { getService().setThemeOverlayReady(readiness); getService().setThemeOverlayReady(userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } Loading
core/java/android/app/ActivityManagerInternal.java +1 −1 Original line number Diff line number Diff line Loading @@ -1264,5 +1264,5 @@ public abstract class ActivityManagerInternal { * palette readiness. * @hide */ public abstract boolean getThemeOverlayReadiness(); public abstract boolean isThemeOverlayReady(int userId); }
core/java/android/app/IActivityManager.aidl +6 −3 Original line number Diff line number Diff line Loading @@ -554,11 +554,14 @@ interface IActivityManager { void bootAnimationComplete(); /** * Used by {@link com.android.systemui.theme.ThemeOverlayController} to notify of color * palette readiness. * Used by {@link com.android.systemui.theme.ThemeOverlayController} to notify when color * palette is ready. * * @param userId The ID of the user where ThemeOverlayController is ready. * * @throws RemoteException */ void setThemeOverlayReady(boolean readiness); void setThemeOverlayReady(int userId); @UnsupportedAppUsage void registerTaskStackListener(in ITaskStackListener listener); Loading
packages/SystemUI/src/com/android/systemui/theme/ThemeOverlayController.java +1 −1 Original line number Diff line number Diff line Loading @@ -815,7 +815,7 @@ public class ThemeOverlayController implements CoreStartable, Dumpable { ? () -> {} : () -> { Log.d(TAG, "ThemeHomeDelay: ThemeOverlayController ready"); mActivityManager.setThemeOverlayReady(true); mActivityManager.setThemeOverlayReady(currentUser); }; if (colorSchemeIsApplied(managedProfiles)) { Loading
services/core/java/com/android/server/am/ActivityManagerService.java +26 −24 Original line number Diff line number Diff line Loading @@ -930,7 +930,7 @@ public class ActivityManagerService extends IActivityManager.Stub * Tracks all users with computed color resources by ThemeOverlaycvontroller */ @GuardedBy("this") private final Set<Integer> mThemeOverlayReadiness = new HashSet<>(); private final Set<Integer> mThemeOverlayReadyUsers = new HashSet<>(); /** * Tracks association information for a particular package along with debuggability. Loading Loading @@ -2351,7 +2351,7 @@ public class ActivityManagerService extends IActivityManager.Stub mService.startBroadcastObservers(); } else if (phase == PHASE_THIRD_PARTY_APPS_CAN_START) { mService.mPackageWatchdog.onPackagesReady(); mService.setHomeTimeout(); mService.scheduleHomeTimeout(); } } Loading Loading @@ -5327,40 +5327,43 @@ public class ActivityManagerService extends IActivityManager.Stub /** * Starts Home if there is no completion signal from ThemeOverlayController */ private void setHomeTimeout() { private void scheduleHomeTimeout() { if (enableHomeDelay() && mHasHomeDelay.compareAndSet(false, true)) { int userId = mUserController.getCurrentUserId(); mHandler.postDelayed(() -> { if (!getThemeOverlayReadiness()) { if (!isThemeOverlayReady(userId)) { Slog.d(TAG, "ThemeHomeDelay: ThemeOverlayController not responding, launching " + "Home after " + HOME_LAUNCH_TIMEOUT_MS + "ms"); setThemeOverlayReady(true); setThemeOverlayReady(userId); } }, HOME_LAUNCH_TIMEOUT_MS); } } /** * Used by ThemeOverlayController to notify all listeners for * color palette readiness. * Used by ThemeOverlayController to notify when color * palette is ready. * * @param userId The ID of the user where ThemeOverlayController is ready. * * @throws RemoteException * * @hide */ @Override public void setThemeOverlayReady(boolean readiness) { public void setThemeOverlayReady(@UserIdInt int userId) { enforceCallingPermission(Manifest.permission.SET_THEME_OVERLAY_CONTROLLER_READY, "setThemeOverlayReady"); int currentUserId = mUserController.getCurrentUserId(); boolean updateReadiness; synchronized (mThemeOverlayReadiness) { updateReadiness = readiness ? mThemeOverlayReadiness.add(currentUserId) : mThemeOverlayReadiness.remove(currentUserId); boolean updateUser; synchronized (mThemeOverlayReadyUsers) { updateUser = mThemeOverlayReadyUsers.add(userId); } if (updateReadiness && readiness && enableHomeDelay()) { mAtmInternal.startHomeOnAllDisplays(currentUserId, "setThemeOverlayReady"); if (updateUser && enableHomeDelay()) { mAtmInternal.startHomeOnAllDisplays(userId, "setThemeOverlayReady"); } } Loading @@ -5370,10 +5373,9 @@ public class ActivityManagerService extends IActivityManager.Stub * * @hide */ public boolean getThemeOverlayReadiness() { int uid = mUserController.getCurrentUserId(); synchronized (mThemeOverlayReadiness) { return mThemeOverlayReadiness.contains(uid); public boolean isThemeOverlayReady(int userId) { synchronized (mThemeOverlayReadyUsers) { return mThemeOverlayReadyUsers.contains(userId); } } Loading Loading @@ -18114,8 +18116,8 @@ public class ActivityManagerService extends IActivityManager.Stub // Clean up various services by removing the user mBatteryStatsService.onUserRemoved(userId); synchronized (mThemeOverlayReadiness) { mThemeOverlayReadiness.remove(userId); synchronized (mThemeOverlayReadyUsers) { mThemeOverlayReadyUsers.remove(userId); } } Loading Loading @@ -19477,8 +19479,8 @@ public class ActivityManagerService extends IActivityManager.Stub } @Override public boolean getThemeOverlayReadiness() { return ActivityManagerService.this.getThemeOverlayReadiness(); public boolean isThemeOverlayReady(int userId) { return ActivityManagerService.this.isThemeOverlayReady(userId); } }