File tree Expand file tree Collapse file tree 2 files changed +9
-1
lines changed
policy/src/com/android/internal/policy/impl/keyguard Expand file tree Collapse file tree 2 files changed +9
-1
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,7 @@ public void onPause() {
9393 @ Override
9494 public void onResume () {
9595 if (DEBUG ) Log .d (TAG , "onResume()" );
96+ mIsShowing = KeyguardUpdateMonitor .getInstance (mContext ).isKeyguardVisible ();
9697 maybeStartBiometricUnlock ();
9798 KeyguardUpdateMonitor .getInstance (mContext ).registerCallback (mUpdateCallback );
9899 }
Original file line number Diff line number Diff line change @@ -92,6 +92,7 @@ public class KeyguardUpdateMonitor {
9292 private CharSequence mTelephonySpn ;
9393 private int mRingMode ;
9494 private int mPhoneState ;
95+ private boolean mKeyguardIsVisible ;
9596
9697 // Device provisioning state
9798 private boolean mDeviceProvisioned ;
@@ -566,14 +567,20 @@ private void handleClockVisibilityChanged() {
566567 */
567568 private void handleKeyguardVisibilityChanged (int showing ) {
568569 if (DEBUG ) Log .d (TAG , "handleKeyguardVisibilityChanged(" + showing + ")" );
570+ boolean isShowing = (showing == 1 );
571+ mKeyguardIsVisible = isShowing ;
569572 for (int i = 0 ; i < mCallbacks .size (); i ++) {
570573 KeyguardUpdateMonitorCallback cb = mCallbacks .get (i ).get ();
571574 if (cb != null ) {
572- cb .onKeyguardVisibilityChanged (showing == 1 );
575+ cb .onKeyguardVisibilityChanged (isShowing );
573576 }
574577 }
575578 }
576579
580+ public boolean isKeyguardVisible () {
581+ return mKeyguardIsVisible ;
582+ }
583+
577584 private static boolean isBatteryUpdateInteresting (BatteryStatus old , BatteryStatus current ) {
578585 final boolean nowPluggedIn = current .isPluggedIn ();
579586 final boolean wasPluggedIn = old .isPluggedIn ();
You can’t perform that action at this time.
0 commit comments