Loading services/core/java/com/android/server/policy/keyguard/KeyguardStateMonitor.java +15 −7 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ public class KeyguardStateMonitor extends IKeyguardStateCallback.Stub { private final LockPatternUtils mLockPatternUtils; private final StateCallback mCallback; private IUsbRestrict mUsbRestrictor; private IUsbRestrict mUsbRestrictor = null; private ContentResolver mContentResolver; IKeystoreService mKeystoreService; Loading @@ -77,12 +77,6 @@ public class KeyguardStateMonitor extends IKeyguardStateCallback.Stub { } catch (RemoteException e) { Slog.w(TAG, "Remote Exception", e); } try { mUsbRestrictor = IUsbRestrict.getService(); } catch (NoSuchElementException | RemoteException ignored) { // Ignore, the hal is not available } } public boolean isShowing() { Loading Loading @@ -116,6 +110,20 @@ public class KeyguardStateMonitor extends IKeyguardStateCallback.Stub { Slog.e(TAG, "Error informing keystore of screen lock", e); } if (mUsbRestrictor == null) { try { mUsbRestrictor = IUsbRestrict.getService(); } catch (NoSuchElementException | RemoteException ignored) { // Ignore, the hal is not available return; } } if (mUsbRestrictor == null) { // Return for now and retry on next time return; } boolean shouldRestrictUsb = LineageSettings.Secure.getInt(mContentResolver, LineageSettings.Secure.TRUST_RESTRICT_USB_KEYGUARD, 0) == 1; if (shouldRestrictUsb) { Loading Loading
services/core/java/com/android/server/policy/keyguard/KeyguardStateMonitor.java +15 −7 Original line number Diff line number Diff line Loading @@ -58,7 +58,7 @@ public class KeyguardStateMonitor extends IKeyguardStateCallback.Stub { private final LockPatternUtils mLockPatternUtils; private final StateCallback mCallback; private IUsbRestrict mUsbRestrictor; private IUsbRestrict mUsbRestrictor = null; private ContentResolver mContentResolver; IKeystoreService mKeystoreService; Loading @@ -77,12 +77,6 @@ public class KeyguardStateMonitor extends IKeyguardStateCallback.Stub { } catch (RemoteException e) { Slog.w(TAG, "Remote Exception", e); } try { mUsbRestrictor = IUsbRestrict.getService(); } catch (NoSuchElementException | RemoteException ignored) { // Ignore, the hal is not available } } public boolean isShowing() { Loading Loading @@ -116,6 +110,20 @@ public class KeyguardStateMonitor extends IKeyguardStateCallback.Stub { Slog.e(TAG, "Error informing keystore of screen lock", e); } if (mUsbRestrictor == null) { try { mUsbRestrictor = IUsbRestrict.getService(); } catch (NoSuchElementException | RemoteException ignored) { // Ignore, the hal is not available return; } } if (mUsbRestrictor == null) { // Return for now and retry on next time return; } boolean shouldRestrictUsb = LineageSettings.Secure.getInt(mContentResolver, LineageSettings.Secure.TRUST_RESTRICT_USB_KEYGUARD, 0) == 1; if (shouldRestrictUsb) { Loading