Support AOSP lockscreen layout roots

This commit is contained in:
ajp_anton
2026-07-01 13:37:40 +00:00
parent 42449f8c6a
commit 4964b39d01
2 changed files with 26 additions and 12 deletions
+4 -4
View File
@@ -76,9 +76,9 @@ should.
| Module loads in SystemUI | ✅ | Untested | Untested | ✅ | Untested | Untested | Untested | Untested | | Module loads in SystemUI | ✅ | Untested | Untested | ✅ | Untested | Untested | Untested | Untested |
| Settings app opens and writes settings | ✅ | Untested | Untested | ✅ opens; settings provider applies | Untested | Untested | Untested | Untested | | Settings app opens and writes settings | ✅ | Untested | Untested | ✅ opens; settings provider applies | Untested | Untested | Untested | Untested |
| Custom unlocked statusbar layout | ✅ | Untested | Untested | ✅ basic unlocked layout verified | Untested | Untested | Untested | Untested | | Custom unlocked statusbar layout | ✅ | Untested | Untested | ✅ basic unlocked layout verified | Untested | Untested | Untested | Untested |
| Custom lockscreen statusbar layout | ✅ | Untested | Untested | Untested | Untested | Untested | Untested | Untested | | Custom lockscreen statusbar layout | ✅ | Untested | Untested | ✅ basic keyguard layout verified | Untested | Untested | Untested | Untested |
| Custom AOD statusbar layout | ✅ | Untested | Untested | ❌ OneUI AOD hooks only | Untested | Untested | Untested | Untested | | Custom AOD statusbar layout | ✅ | Untested | Untested | ❌ OneUI AOD hooks only | Untested | Untested | Untested | Untested |
| Notification icons mode | ✅ | Untested | Untested | ✅ unlocked icons verified; lockscreen/AOD untested | Untested | Untested | Untested | Untested | | Notification icons mode | ✅ | Untested | Untested | ✅ unlocked and lockscreen hosts verified; AOD unsupported | Untested | Untested | Untested | Untested |
| Notification cards mode | ✅ | Untested | Untested | ❌ OneUI cards mode only | Untested | Untested | Untested | Untested | | Notification cards mode | ✅ | Untested | Untested | ❌ OneUI cards mode only | Untested | Untested | Untested | Untested |
| Notification dot mode and read-state behavior | ✅ | Untested | Untested | Untested; lockscreen/AOD style detection is OneUI-specific | Untested | Untested | Untested | Untested | | Notification dot mode and read-state behavior | ✅ | Untested | Untested | Untested; lockscreen/AOD style detection is OneUI-specific | Untested | Untested | Untested | Untested |
| Hide notification icons by app | ✅ | Untested | Untested | Untested | Untested | Untested | Untested | Untested | | Hide notification icons by app | ✅ | Untested | Untested | Untested | Untested | Untested | Untested | Untested |
@@ -90,14 +90,14 @@ should.
| Custom statusbar clock text | ✅ | Untested | Untested | ✅ layout-on and layout-off clocks verified | Untested | Untested | Untested | Untested | | Custom statusbar clock text | ✅ | Untested | Untested | ✅ layout-on and layout-off clocks verified | Untested | Untested | Untested | Untested |
| Custom drawer clock/date text | ✅ | Untested | Untested | ✅ expanded QS clock/date verified | Untested | Untested | Untested | Untested | | Custom drawer clock/date text | ✅ | Untested | Untested | ✅ expanded QS clock/date verified | Untested | Untested | Untested | Untested |
| Stored clock pattern previews | ✅ | Untested | Untested | Untested | Untested | Untested | Untested | Untested | | Stored clock pattern previews | ✅ | Untested | Untested | Untested | Untested | Untested | Untested | Untested |
| Battery bar: base statusbar modes | ✅ | Untested | Untested | ✅ unlocked verified; lockscreen/AOD untested | Untested | Untested | Untested | Untested | | Battery bar: base statusbar modes | ✅ | Untested | Untested | ✅ unlocked and lockscreen verified; AOD unsupported | Untested | Untested | Untested | Untested |
| Battery bar: fullscreen and transparent statusbar modes | ✅ | Untested | Untested | ✅ fullscreen root verified; transparent untested | Untested | Untested | Untested | Untested | | Battery bar: fullscreen and transparent statusbar modes | ✅ | Untested | Untested | ✅ fullscreen root verified; transparent untested | Untested | Untested | Untested | Untested |
| Battery bar: curved top-edge geometry | ✅ | Untested | Untested | Untested; emulator has no curved screen edge | Untested | Untested | Untested | Untested | | Battery bar: curved top-edge geometry | ✅ | Untested | Untested | Untested; emulator has no curved screen edge | Untested | Untested | Untested | Untested |
| Battery bar threshold colours and colour math | ✅ | Untested | Untested | Untested | Untested | Untested | Untested | Untested | | Battery bar threshold colours and colour math | ✅ | Untested | Untested | Untested | Untested | Untested | Untested | Untested |
| Camera cutout and under-display-camera handling | ✅ | Untested | Untested | Untested; emulator has no cutout/UDC | Untested | Untested | Untested | Untested | | Camera cutout and under-display-camera handling | ✅ | Untested | Untested | Untested; emulator has no cutout/UDC | Untested | Untested | Untested | Untested |
| Rotation and fold/unfold handling | ✅ | Untested | Untested | Untested | Untested | Untested | Untested | Untested | | Rotation and fold/unfold handling | ✅ | Untested | Untested | Untested | Untested | Untested | Untested | Untested |
| Drawer scrolling and background-work performance | ✅ | Untested | Untested | Untested | Untested | Untested | Untested | Untested | | Drawer scrolling and background-work performance | ✅ | Untested | Untested | Untested | Untested | Untested | Untested | Untested |
| Debug visualizers and debug notifications | ✅ | Untested | Untested | ✅ unlocked visualizers verified; debug notifications untested | Untested | Untested | Untested | Untested | | Debug visualizers and debug notifications | ✅ | Untested | Untested | ✅ unlocked and lockscreen visualizers verified; debug notifications untested | Untested | Untested | Untested | Untested |
Current emulator targets use rooted LSPosed snapshots in a local test lab. They Current emulator targets use rooted LSPosed snapshots in a local test lab. They
are useful for compatibility work, but the matrix above is intentionally not are useful for compatibility work, but the matrix above is intentionally not
@@ -2283,27 +2283,25 @@ final class StockLayoutCanvasController {
Context context = root.getContext(); Context context = root.getContext();
SbtSettings settings = RuntimeSettingsCache.get(context); SbtSettings settings = RuntimeSettingsCache.get(context);
boolean layoutEnabled = settings.clockEnabled; boolean layoutEnabled = settings.clockEnabled;
boolean statusBarRoot = isUnlockedStatusBarRoot(root);
markDirtyIfSettingsChanged(root, settings, statusBarRoot);
markDirtyIfClockTimeChanged(root, settings, statusBarRoot);
runtimeContext.getModeStateRepository().setLayoutEnabled(layoutEnabled); runtimeContext.getModeStateRepository().setLayoutEnabled(layoutEnabled);
if (!layoutEnabled) {
updateActiveScene(root, context); updateActiveScene(root, context);
SceneKey activeScene = runtimeContext.getModeStateRepository().getActiveScene(); SceneKey activeScene = runtimeContext.getModeStateRepository().getActiveScene();
boolean statusBarRoot = isStatusBarLayoutRoot(root, activeScene);
markDirtyIfSettingsChanged(root, settings, statusBarRoot);
markDirtyIfClockTimeChanged(root, settings, statusBarRoot);
if (!layoutEnabled) {
statusIconModelTracker.updateActiveSlots(false, activeScene); statusIconModelTracker.updateActiveSlots(false, activeScene);
applyLayoutOffRoot(root, settings, statusBarRoot, activeScene); applyLayoutOffRoot(root, settings, statusBarRoot, activeScene);
return; return;
} }
installPendingPluginClassLoaderHooks(); installPendingPluginClassLoaderHooks();
layoutOffCleanedRoots.remove(root); layoutOffCleanedRoots.remove(root);
updateActiveScene(root, context);
if (statusIconModelTracker.updateActiveSlots( if (statusIconModelTracker.updateActiveSlots(
true, true,
runtimeContext.getModeStateRepository().getActiveScene())) { activeScene)) {
unlockedIconRenderController.clearRoot(root); unlockedIconRenderController.clearRoot(root);
dirtyUnlockedLayoutRoots.add(root); dirtyUnlockedLayoutRoots.add(root);
} }
SceneKey activeScene = runtimeContext.getModeStateRepository().getActiveScene();
boolean unlockedScene = activeScene != null && activeScene.isUnlocked(); boolean unlockedScene = activeScene != null && activeScene.isUnlocked();
boolean aodScene = activeScene != null && activeScene.isAod(); boolean aodScene = activeScene != null && activeScene.isAod();
boolean rootDirty = dirtyUnlockedLayoutRoots.remove(root); boolean rootDirty = dirtyUnlockedLayoutRoots.remove(root);
@@ -4964,7 +4962,7 @@ final class StockLayoutCanvasController {
View root, View root,
SceneKey activeScene SceneKey activeScene
) { ) {
if (!isUnlockedStatusBarRoot(root) if (!isStatusBarLayoutRoot(root, activeScene)
&& !(activeScene != null && activeScene.isAod() && isAodLayoutRoot(root))) { && !(activeScene != null && activeScene.isAod() && isAodLayoutRoot(root))) {
return null; return null;
} }
@@ -5021,11 +5019,27 @@ final class StockLayoutCanvasController {
|| className.contains("StatusBarWindowView"); || 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) { private void updateActiveScene(View root, Context context) {
if (root == null) { if (root == null) {
return; return;
} }
if (runtimeContext.getModeStateRepository().hasSystemUiStatusBarState()) { 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; return;
} }
NotificationDisplayStyle notificationStyle = NotificationDisplayStyle notificationStyle =