Skip to content

Instantly share code, notes, and snippets.

@anayw2001
Created October 14, 2020 04:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anayw2001/2e0c9e1d56923c46191e27ea9dd9f512 to your computer and use it in GitHub Desktop.
Save anayw2001/2e0c9e1d56923c46191e27ea9dd9f512 to your computer and use it in GitHub Desktop.
Keyguard lock icon dismissal patch
From e42cef46c99b458ae828d0f60518c2469c0f4e07 Mon Sep 17 00:00:00 2001
From: Dil3mm4 <dil3mm4.dev@gmail.com>
Date: Sat, 19 Oct 2019 03:55:08 -0400
Subject: [PATCH] Keyguard: Lock icon improvements
There was a ~300ms delay (I think) between the actual dismissal of the lock icon from keyguard locked to unlocked (only with no security method activated).
So, mKeyguardIndicationController.setVisible(false) has been moved to KeyguardgoingAway() to anticipate the icon dismissal with a small setAlpha hack in KeyguardIndicationController.
Change-Id: Ia926cd27e96bb450ed8f5ed9c686556fd647fa45
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
index a1444532bd5..9eb1136f67c 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/KeyguardIndicationController.java
@@ -289,9 +289,11 @@ public class KeyguardIndicationController implements StateListener,
hideTransientIndication();
}
updateIndication(false);
+ mLockIconController.getView().setAlpha(255);
} else if (!visible) {
// If we unlock and return to keyguard quickly, previous error should not be shown
hideTransientIndication();
+ mLockIconController.getView().setAlpha(0);
}
}
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
index a5cc1a83fc8..9c8da22b089 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/StatusBar.java
@@ -3362,6 +3362,7 @@ public class StatusBar extends SystemUI implements DemoMode,
public void keyguardGoingAway() {
// Treat Keyguard exit animation as an app transition to achieve nice transition for status
// bar.
+ mKeyguardIndicationController.setVisible(false);
mKeyguardStateController.notifyKeyguardGoingAway(true);
mCommandQueue.appTransitionPending(mDisplayId, true /* forced */);
}
@@ -3540,7 +3541,6 @@ public class StatusBar extends SystemUI implements DemoMode,
mAmbientIndicationContainer.setVisibility(View.VISIBLE);
}
} else {
- mKeyguardIndicationController.setVisible(false);
if (mKeyguardUserSwitcher != null) {
mKeyguardUserSwitcher.setKeyguard(false,
mStatusBarStateController.goingToFullShade() ||
--
2.20.1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment