Loading services/core/java/com/android/server/security/authenticationpolicy/SecureLockDeviceService.java +36 −32 Original line number Original line Diff line number Diff line Loading @@ -97,6 +97,7 @@ public class SecureLockDeviceService extends SecureLockDeviceServiceInternal { @Nullable private final FaceManager mFaceManager; @Nullable private final FaceManager mFaceManager; @Nullable private final FingerprintManager mFingerprintManager; @Nullable private final FingerprintManager mFingerprintManager; private final PowerManager mPowerManager; private final PowerManager mPowerManager; @NonNull private final Object mSecureLockDeviceStatusListenerLock = new Object(); @NonNull private final SecureLockDeviceStore mStore; @NonNull private final SecureLockDeviceStore mStore; private final RemoteCallbackList<ISecureLockDeviceStatusListener> private final RemoteCallbackList<ISecureLockDeviceStatusListener> mSecureLockDeviceStatusListeners = new RemoteCallbackList<>(); mSecureLockDeviceStatusListeners = new RemoteCallbackList<>(); Loading Loading @@ -553,6 +554,7 @@ public class SecureLockDeviceService extends SecureLockDeviceServiceInternal { * update. Only listeners registered to this userId will be notified.s * update. Only listeners registered to this userId will be notified.s */ */ private void notifySecureLockDeviceAvailabilityForUser(int userId) { private void notifySecureLockDeviceAvailabilityForUser(int userId) { synchronized (mSecureLockDeviceStatusListenerLock) { final int count = mSecureLockDeviceStatusListeners.beginBroadcast(); final int count = mSecureLockDeviceStatusListeners.beginBroadcast(); try { try { for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) { Loading @@ -577,13 +579,14 @@ public class SecureLockDeviceService extends SecureLockDeviceServiceInternal { + secureLockDeviceAvailability); + secureLockDeviceAvailability); } } try { try { listener.onSecureLockDeviceAvailableStatusChanged(secureLockDeviceAvailability); listener.onSecureLockDeviceAvailableStatusChanged( secureLockDeviceAvailability); } catch (RemoteException e) { } catch (RemoteException e) { Slog.e(TAG, "Failed to notify listener " + listener.asBinder() + " for " Slog.e(TAG, "Failed to notify listener " + listener.asBinder() + "user " + userId + ", RemoteException thrown: ", e); + " for user " + userId + ", RemoteException thrown: ", e); } catch (Exception e) { } catch (Exception e) { Slog.e(TAG, "Exception thrown by listener " + listener.asBinder() + " for " Slog.e(TAG, "Exception thrown by listener " + listener.asBinder() + "user " + userId + " during callback: ", e); + " for user " + userId + " during callback: ", e); mSecureLockDeviceStatusListeners.unregister(listener); mSecureLockDeviceStatusListeners.unregister(listener); } } } } Loading @@ -591,6 +594,7 @@ public class SecureLockDeviceService extends SecureLockDeviceServiceInternal { mSecureLockDeviceStatusListeners.finishBroadcast(); mSecureLockDeviceStatusListeners.finishBroadcast(); } } } } } /** /** * @see AuthenticationPolicyManager#setSecureLockDeviceTestStatus(boolean) * @see AuthenticationPolicyManager#setSecureLockDeviceTestStatus(boolean) Loading Loading
services/core/java/com/android/server/security/authenticationpolicy/SecureLockDeviceService.java +36 −32 Original line number Original line Diff line number Diff line Loading @@ -97,6 +97,7 @@ public class SecureLockDeviceService extends SecureLockDeviceServiceInternal { @Nullable private final FaceManager mFaceManager; @Nullable private final FaceManager mFaceManager; @Nullable private final FingerprintManager mFingerprintManager; @Nullable private final FingerprintManager mFingerprintManager; private final PowerManager mPowerManager; private final PowerManager mPowerManager; @NonNull private final Object mSecureLockDeviceStatusListenerLock = new Object(); @NonNull private final SecureLockDeviceStore mStore; @NonNull private final SecureLockDeviceStore mStore; private final RemoteCallbackList<ISecureLockDeviceStatusListener> private final RemoteCallbackList<ISecureLockDeviceStatusListener> mSecureLockDeviceStatusListeners = new RemoteCallbackList<>(); mSecureLockDeviceStatusListeners = new RemoteCallbackList<>(); Loading Loading @@ -553,6 +554,7 @@ public class SecureLockDeviceService extends SecureLockDeviceServiceInternal { * update. Only listeners registered to this userId will be notified.s * update. Only listeners registered to this userId will be notified.s */ */ private void notifySecureLockDeviceAvailabilityForUser(int userId) { private void notifySecureLockDeviceAvailabilityForUser(int userId) { synchronized (mSecureLockDeviceStatusListenerLock) { final int count = mSecureLockDeviceStatusListeners.beginBroadcast(); final int count = mSecureLockDeviceStatusListeners.beginBroadcast(); try { try { for (int i = 0; i < count; i++) { for (int i = 0; i < count; i++) { Loading @@ -577,13 +579,14 @@ public class SecureLockDeviceService extends SecureLockDeviceServiceInternal { + secureLockDeviceAvailability); + secureLockDeviceAvailability); } } try { try { listener.onSecureLockDeviceAvailableStatusChanged(secureLockDeviceAvailability); listener.onSecureLockDeviceAvailableStatusChanged( secureLockDeviceAvailability); } catch (RemoteException e) { } catch (RemoteException e) { Slog.e(TAG, "Failed to notify listener " + listener.asBinder() + " for " Slog.e(TAG, "Failed to notify listener " + listener.asBinder() + "user " + userId + ", RemoteException thrown: ", e); + " for user " + userId + ", RemoteException thrown: ", e); } catch (Exception e) { } catch (Exception e) { Slog.e(TAG, "Exception thrown by listener " + listener.asBinder() + " for " Slog.e(TAG, "Exception thrown by listener " + listener.asBinder() + "user " + userId + " during callback: ", e); + " for user " + userId + " during callback: ", e); mSecureLockDeviceStatusListeners.unregister(listener); mSecureLockDeviceStatusListeners.unregister(listener); } } } } Loading @@ -591,6 +594,7 @@ public class SecureLockDeviceService extends SecureLockDeviceServiceInternal { mSecureLockDeviceStatusListeners.finishBroadcast(); mSecureLockDeviceStatusListeners.finishBroadcast(); } } } } } /** /** * @see AuthenticationPolicyManager#setSecureLockDeviceTestStatus(boolean) * @see AuthenticationPolicyManager#setSecureLockDeviceTestStatus(boolean) Loading