Support AOSP lockscreen layout roots
This commit is contained in:
+22
-8
@@ -2283,27 +2283,25 @@ final class StockLayoutCanvasController {
|
||||
Context context = root.getContext();
|
||||
SbtSettings settings = RuntimeSettingsCache.get(context);
|
||||
boolean layoutEnabled = settings.clockEnabled;
|
||||
boolean statusBarRoot = isUnlockedStatusBarRoot(root);
|
||||
runtimeContext.getModeStateRepository().setLayoutEnabled(layoutEnabled);
|
||||
updateActiveScene(root, context);
|
||||
SceneKey activeScene = runtimeContext.getModeStateRepository().getActiveScene();
|
||||
boolean statusBarRoot = isStatusBarLayoutRoot(root, activeScene);
|
||||
markDirtyIfSettingsChanged(root, settings, statusBarRoot);
|
||||
markDirtyIfClockTimeChanged(root, settings, statusBarRoot);
|
||||
runtimeContext.getModeStateRepository().setLayoutEnabled(layoutEnabled);
|
||||
if (!layoutEnabled) {
|
||||
updateActiveScene(root, context);
|
||||
SceneKey activeScene = runtimeContext.getModeStateRepository().getActiveScene();
|
||||
statusIconModelTracker.updateActiveSlots(false, activeScene);
|
||||
applyLayoutOffRoot(root, settings, statusBarRoot, activeScene);
|
||||
return;
|
||||
}
|
||||
installPendingPluginClassLoaderHooks();
|
||||
layoutOffCleanedRoots.remove(root);
|
||||
updateActiveScene(root, context);
|
||||
if (statusIconModelTracker.updateActiveSlots(
|
||||
true,
|
||||
runtimeContext.getModeStateRepository().getActiveScene())) {
|
||||
activeScene)) {
|
||||
unlockedIconRenderController.clearRoot(root);
|
||||
dirtyUnlockedLayoutRoots.add(root);
|
||||
}
|
||||
SceneKey activeScene = runtimeContext.getModeStateRepository().getActiveScene();
|
||||
boolean unlockedScene = activeScene != null && activeScene.isUnlocked();
|
||||
boolean aodScene = activeScene != null && activeScene.isAod();
|
||||
boolean rootDirty = dirtyUnlockedLayoutRoots.remove(root);
|
||||
@@ -4964,7 +4962,7 @@ final class StockLayoutCanvasController {
|
||||
View root,
|
||||
SceneKey activeScene
|
||||
) {
|
||||
if (!isUnlockedStatusBarRoot(root)
|
||||
if (!isStatusBarLayoutRoot(root, activeScene)
|
||||
&& !(activeScene != null && activeScene.isAod() && isAodLayoutRoot(root))) {
|
||||
return null;
|
||||
}
|
||||
@@ -5021,11 +5019,27 @@ final class StockLayoutCanvasController {
|
||||
|| className.contains("StatusBarWindowView");
|
||||
}
|
||||
|
||||
private boolean isStatusBarLayoutRoot(View root, SceneKey activeScene) {
|
||||
return isUnlockedStatusBarRoot(root)
|
||||
|| (activeScene != null
|
||||
&& activeScene.isLockscreen()
|
||||
&& isNotificationShadeWindowRoot(root));
|
||||
}
|
||||
|
||||
private void updateActiveScene(View root, Context context) {
|
||||
if (root == null) {
|
||||
return;
|
||||
}
|
||||
if (runtimeContext.getModeStateRepository().hasSystemUiStatusBarState()) {
|
||||
if (isNotificationShadeWindowRoot(root) && isKeyguardLocked(context)) {
|
||||
NotificationDisplayStyle notificationStyle =
|
||||
SystemNotificationDisplayStyleDetector.read(context);
|
||||
if (isInteractive(context)) {
|
||||
runtimeContext.getModeStateRepository().setLockscreen(notificationStyle);
|
||||
} else {
|
||||
runtimeContext.getModeStateRepository().setAod(notificationStyle);
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
NotificationDisplayStyle notificationStyle =
|
||||
|
||||
Reference in New Issue
Block a user