Don't depend on LockPatternUtils to get DevicePolicyManager
This fixes a crash where LockPatternUtils hasn't been set yet and keyguard attempts to get the device policy for widgets. This change breaks the dependency by getting a handle to DPM directly. Bug:7109723 Change-Id: Iecae91474358821ebd30456648377253864c35cf
This commit is contained in:
@@ -582,7 +582,9 @@ public class KeyguardHostView extends KeyguardViewBase {
|
||||
}
|
||||
|
||||
private void maybePopulateWidgets() {
|
||||
if (mLockPatternUtils.getDevicePolicyManager().getKeyguardWidgetsDisabled(null)
|
||||
DevicePolicyManager dpm =
|
||||
(DevicePolicyManager) mContext.getSystemService(Context.DEVICE_POLICY_SERVICE);
|
||||
if (dpm != null && dpm.getKeyguardWidgetsDisabled(null)
|
||||
!= DevicePolicyManager.KEYGUARD_DISABLE_WIDGETS_NONE) {
|
||||
Log.v(TAG, "Keyguard widgets disabled because of device policy admin");
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user