Loading services/core/java/com/android/server/location/contexthub/ContextHubEndpointBroker.java +18 −0 Original line number Diff line number Diff line Loading @@ -248,6 +248,7 @@ public class ContextHubEndpointBroker extends IContextHubEndpoint.Stub } } mEndpointManager.unregisterEndpoint(mEndpointInfo.getIdentifier().getEndpoint()); releaseWakeLockOnExit(); } @Override Loading Loading @@ -559,6 +560,23 @@ public class ContextHubEndpointBroker extends IContextHubEndpoint.Stub }); } private void releaseWakeLockOnExit() { Binder.withCleanCallingIdentity( () -> { while (mWakeLock.isHeld()) { try { mWakeLock.release(); } catch (RuntimeException e) { Log.e( TAG, "Releasing the wakelock for all acquisitions fails - ", e); break; } } }); } /** * Invokes a callback and acquires a wakelock. * Loading Loading
services/core/java/com/android/server/location/contexthub/ContextHubEndpointBroker.java +18 −0 Original line number Diff line number Diff line Loading @@ -248,6 +248,7 @@ public class ContextHubEndpointBroker extends IContextHubEndpoint.Stub } } mEndpointManager.unregisterEndpoint(mEndpointInfo.getIdentifier().getEndpoint()); releaseWakeLockOnExit(); } @Override Loading Loading @@ -559,6 +560,23 @@ public class ContextHubEndpointBroker extends IContextHubEndpoint.Stub }); } private void releaseWakeLockOnExit() { Binder.withCleanCallingIdentity( () -> { while (mWakeLock.isHeld()) { try { mWakeLock.release(); } catch (RuntimeException e) { Log.e( TAG, "Releasing the wakelock for all acquisitions fails - ", e); break; } } }); } /** * Invokes a callback and acquires a wakelock. * Loading