Keep unlock transition in unlocked scene

This commit is contained in:
ajp_anton
2026-07-08 03:20:06 +00:00
parent 352b7ab443
commit 18f30fce57
3 changed files with 33 additions and 4 deletions
@@ -5066,7 +5066,9 @@ final class StockLayoutCanvasController {
return;
}
if (runtimeContext.getModeStateRepository().hasSystemUiStatusBarState()) {
if (isNotificationShadeWindowRoot(root) && isKeyguardLocked(context)) {
if (isNotificationShadeWindowRoot(root)
&& isKeyguardLocked(context)
&& !runtimeContext.getModeStateRepository().isKeyguardGoingAway()) {
NotificationDisplayStyle notificationStyle =
SystemNotificationDisplayStyleDetector.read(context);
if (isInteractive(context)) {
@@ -10,6 +10,7 @@ public final class ModeStateRepository {
private SceneKey activeScene = SceneKey.unlocked();
private boolean systemUiStatusBarStateKnown;
private int systemUiStatusBarState;
private boolean keyguardGoingAway;
private boolean layoutEnabled;
private final List<LayoutEnabledListener> layoutEnabledListeners = new ArrayList<>();
private final List<SceneListener> sceneListeners = new ArrayList<>();
@@ -27,6 +28,14 @@ public final class ModeStateRepository {
return systemUiStatusBarStateKnown && systemUiStatusBarState == 2;
}
public synchronized boolean isKeyguardGoingAway() {
return keyguardGoingAway;
}
public synchronized void setKeyguardGoingAway(boolean goingAway) {
keyguardGoingAway = goingAway;
}
public synchronized boolean isLayoutEnabled() {
return layoutEnabled;
}
@@ -23,8 +23,10 @@ public final class SystemUiStatusBarStateFeature implements RuntimeFeature {
"com.android.systemui.statusbar.StatusBarStateControllerImpl";
private static final String CLASS_KEYGUARD_STATE_CONTROLLER =
"com.android.systemui.statusbar.policy.KeyguardStateControllerImpl";
private static final int STATE_SHADE = 0;
private boolean installed;
private boolean keyguardGoingAway;
@Override
public String getName() {
@@ -78,8 +80,14 @@ public final class SystemUiStatusBarStateFeature implements RuntimeFeature {
"notifyKeyguardGoingAway",
chain -> {
Object result = chain.proceed();
if (firstBooleanArg(chain.getArgs())) {
Boolean goingAway = firstBooleanArg(chain.getArgs());
if (Boolean.TRUE.equals(goingAway)) {
keyguardGoingAway = true;
context.getModeStateRepository().setKeyguardGoingAway(true);
context.getModeStateRepository().setUnlocked();
} else if (Boolean.FALSE.equals(goingAway)) {
keyguardGoingAway = false;
context.getModeStateRepository().setKeyguardGoingAway(false);
}
return result;
});
@@ -92,14 +100,24 @@ public final class SystemUiStatusBarStateFeature implements RuntimeFeature {
Object rawState = ReflectionSupport.getFieldValue(controller, "mState");
int state = rawState instanceof Integer integer ? integer : 0;
boolean dozing = ReflectionSupport.getBooleanField(controller, "mIsDozing", false);
if (keyguardGoingAway && !dozing) {
if (state == STATE_SHADE) {
keyguardGoingAway = false;
context.getModeStateRepository().setKeyguardGoingAway(false);
} else {
state = STATE_SHADE;
}
}
context.getModeStateRepository().setSystemUiStatusBarState(
state,
dozing,
SystemNotificationDisplayStyleDetector.read(systemContext(controller)));
}
private boolean firstBooleanArg(List<Object> args) {
return args != null && !args.isEmpty() && Boolean.TRUE.equals(args.get(0));
private Boolean firstBooleanArg(List<Object> args) {
return args != null && !args.isEmpty() && args.get(0) instanceof Boolean bool
? bool
: null;
}
private Context systemContext(Object controller) {