diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java index 3e183b657501..cdba24ca205c 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/KeyguardBottomAreaView.java @@ -238,10 +238,12 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL mEnterpriseDisclosure = findViewById( R.id.keyguard_indication_enterprise_disclosure); mIndicationText = findViewById(R.id.keyguard_indication_text); - watchForCameraPolicyChanges(); updateCameraVisibility(); mUnlockMethodCache = UnlockMethodCache.getInstance(getContext()); mUnlockMethodCache.addListener(this); + KeyguardUpdateMonitor updateMonitor = KeyguardUpdateMonitor.getInstance(mContext); + mLockIcon.setScreenOn(updateMonitor.isScreenOn()); + mLockIcon.setDeviceInteractive(updateMonitor.isDeviceInteractive()); mLockIcon.update(); setClipChildren(false); setClipToPadding(false); @@ -278,6 +280,11 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL .withDefault(() -> new DefaultLeftButton()) .withCallback(button -> setLeftButton(button)) .build(); + final IntentFilter filter = new IntentFilter(); + filter.addAction(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED); + getContext().registerReceiverAsUser(mDevicePolicyReceiver, + UserHandle.ALL, filter, null, null); + KeyguardUpdateMonitor.getInstance(mContext).registerCallback(mUpdateMonitorCallback); } @Override @@ -286,6 +293,8 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL mAccessibilityController.removeStateChangedCallback(this); mRightExtension.destroy(); mLeftExtension.destroy(); + getContext().unregisterReceiver(mDevicePolicyReceiver); + KeyguardUpdateMonitor.getInstance(mContext).removeCallback(mUpdateMonitorCallback); } private void initAccessibility() { @@ -401,14 +410,6 @@ public class KeyguardBottomAreaView extends FrameLayout implements View.OnClickL && pm.resolveActivity(PHONE_INTENT, 0) != null; } - private void watchForCameraPolicyChanges() { - final IntentFilter filter = new IntentFilter(); - filter.addAction(DevicePolicyManager.ACTION_DEVICE_POLICY_MANAGER_STATE_CHANGED); - getContext().registerReceiverAsUser(mDevicePolicyReceiver, - UserHandle.ALL, filter, null, null); - KeyguardUpdateMonitor.getInstance(mContext).registerCallback(mUpdateMonitorCallback); - } - @Override public void onStateChanged(boolean accessibilityEnabled, boolean touchExplorationEnabled) { mRightAffordanceView.setClickable(touchExplorationEnabled); |