Merge "Add Keyguard DPM state change callback" into tm-dev am: 1620daee63
Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/17379563 Change-Id: I96d2263b2cf002bf48df96750044210beaddbe45 Signed-off-by: Automerger Merge Worker
This commit is contained in:
@@ -233,6 +233,13 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
|
|||||||
mSecurityViewFlipperController.reloadColors();
|
mSecurityViewFlipperController.reloadColors();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
private final KeyguardUpdateMonitorCallback mKeyguardUpdateMonitorCallback =
|
||||||
|
new KeyguardUpdateMonitorCallback() {
|
||||||
|
@Override
|
||||||
|
public void onDevicePolicyManagerStateChanged() {
|
||||||
|
showPrimarySecurityScreen(false);
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
private KeyguardSecurityContainerController(KeyguardSecurityContainer view,
|
private KeyguardSecurityContainerController(KeyguardSecurityContainer view,
|
||||||
AdminSecondaryLockScreenController.Factory adminSecondaryLockScreenControllerFactory,
|
AdminSecondaryLockScreenController.Factory adminSecondaryLockScreenControllerFactory,
|
||||||
@@ -279,6 +286,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onViewAttached() {
|
protected void onViewAttached() {
|
||||||
|
mUpdateMonitor.registerCallback(mKeyguardUpdateMonitorCallback);
|
||||||
mView.setSwipeListener(mSwipeListener);
|
mView.setSwipeListener(mSwipeListener);
|
||||||
mView.addMotionEventListener(mGlobalTouchListener);
|
mView.addMotionEventListener(mGlobalTouchListener);
|
||||||
mConfigurationController.addCallback(mConfigurationListener);
|
mConfigurationController.addCallback(mConfigurationListener);
|
||||||
@@ -286,6 +294,7 @@ public class KeyguardSecurityContainerController extends ViewController<Keyguard
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onViewDetached() {
|
protected void onViewDetached() {
|
||||||
|
mUpdateMonitor.removeCallback(mKeyguardUpdateMonitorCallback);
|
||||||
mConfigurationController.removeCallback(mConfigurationListener);
|
mConfigurationController.removeCallback(mConfigurationListener);
|
||||||
mView.removeMotionEventListener(mGlobalTouchListener);
|
mView.removeMotionEventListener(mGlobalTouchListener);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2723,12 +2723,20 @@ public class KeyguardUpdateMonitor implements TrustManager.TrustListener, Dumpab
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Handle {@link #MSG_DPM_STATE_CHANGED}
|
* Handle {@link #MSG_DPM_STATE_CHANGED} which can change primary authentication methods to
|
||||||
|
* pin/pattern/password/none.
|
||||||
*/
|
*/
|
||||||
private void handleDevicePolicyManagerStateChanged(int userId) {
|
private void handleDevicePolicyManagerStateChanged(int userId) {
|
||||||
Assert.isMainThread();
|
Assert.isMainThread();
|
||||||
updateFingerprintListeningState(BIOMETRIC_ACTION_UPDATE);
|
updateFingerprintListeningState(BIOMETRIC_ACTION_UPDATE);
|
||||||
updateSecondaryLockscreenRequirement(userId);
|
updateSecondaryLockscreenRequirement(userId);
|
||||||
|
|
||||||
|
for (int i = 0; i < mCallbacks.size(); i++) {
|
||||||
|
KeyguardUpdateMonitorCallback cb = mCallbacks.get(i).get();
|
||||||
|
if (cb != null) {
|
||||||
|
cb.onDevicePolicyManagerStateChanged();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -299,6 +299,11 @@ public class KeyguardUpdateMonitorCallback {
|
|||||||
*/
|
*/
|
||||||
public void onSecondaryLockscreenRequirementChanged(int userId) { }
|
public void onSecondaryLockscreenRequirementChanged(int userId) { }
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Called when device policy manager state changes.
|
||||||
|
*/
|
||||||
|
public void onDevicePolicyManagerStateChanged() { }
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Called when notifying user to unlock in order to use NFC.
|
* Called when notifying user to unlock in order to use NFC.
|
||||||
*/
|
*/
|
||||||
|
|||||||
Reference in New Issue
Block a user