Avoid stock statusbar flash when enabling layout

This commit is contained in:
ajp_anton
2026-06-23 12:37:59 +00:00
parent 28f08eb2b2
commit d1160a2d2d
2 changed files with 14 additions and 12 deletions
@@ -153,7 +153,7 @@ final class StockClockController {
}
runtimeContext.getModeStateRepository().addLayoutEnabledListener(enabled -> {
if (enabled) {
restoreAllOwnedClocks();
suspendOwnedClockTickers();
} else {
refreshAllClocks();
}
@@ -212,23 +212,22 @@ final class StockClockController {
}
}
private void removeAllRowOverlays() {
for (TextView clockView : new ArrayList<>(trackedClocks)) {
removeRowOverlay(clockView);
private void suspendOwnedClockTickers() {
for (TextView clockView : new ArrayList<>(ownedClocks)) {
stopTicker(clockView);
}
}
private void restoreAllOwnedClocks() {
for (TextView clockView : new ArrayList<>(trackedClocks)) {
restoreOwnedClock(clockView);
}
removeAllRowOverlays();
}
private void applyClockText(TextView clockView) {
SbtSettings settings = RuntimeSettingsCache.get(clockView.getContext());
boolean layoutEnabled = settings.clockEnabled;
if (layoutEnabled || !hasCustomClockTextEnabled(settings)) {
if (layoutEnabled) {
if (ownedClocks.contains(clockView)) {
stopTicker(clockView);
}
return;
}
if (!hasCustomClockTextEnabled(settings)) {
restoreOwnedClock(clockView);
return;
}
@@ -237,6 +237,9 @@ final class StockUnlockedNotificationIconsController {
}
private boolean shouldManageContainer(View view) {
if (!isFeatureEnabled(view.getContext())) {
return false;
}
if (!isUnlockedScene()) {
return false;
}