Loading services/core/java/com/android/server/LocationManagerService.java +21 −9 Original line number Diff line number Diff line Loading @@ -323,16 +323,24 @@ public class LocationManagerService extends ILocationManager.Stub { }); mPackageManager.addOnPermissionsChangeListener( uid -> { // listener invoked on ui thread, move to our thread to reduce risk of blocking // ui thread mHandler.post(() -> { synchronized (mLock) { onPermissionsChangedLocked(); } }); }); mActivityManager.addOnUidImportanceListener( (uid, importance) -> { // listener invoked on ui thread, move to our thread to reduce risk of blocking // ui thread mHandler.post(() -> { synchronized (mLock) { onUidImportanceChangedLocked(uid, importance); } }); }, FOREGROUND_IMPORTANCE_CUTOFF); mContext.getContentResolver().registerContentObserver( Loading Loading @@ -394,10 +402,14 @@ public class LocationManagerService extends ILocationManager.Stub { LocalServices.getService(PowerManagerInternal.class); localPowerManager.registerLowPowerModeObserver(ServiceType.LOCATION, state -> { // listener invoked on ui thread, move to our thread to reduce risk of blocking // ui thread mHandler.post(() -> { synchronized (mLock) { onBatterySaverModeChangedLocked(state.locationMode); } }); }); new PackageMonitor() { @Override Loading Loading
services/core/java/com/android/server/LocationManagerService.java +21 −9 Original line number Diff line number Diff line Loading @@ -323,16 +323,24 @@ public class LocationManagerService extends ILocationManager.Stub { }); mPackageManager.addOnPermissionsChangeListener( uid -> { // listener invoked on ui thread, move to our thread to reduce risk of blocking // ui thread mHandler.post(() -> { synchronized (mLock) { onPermissionsChangedLocked(); } }); }); mActivityManager.addOnUidImportanceListener( (uid, importance) -> { // listener invoked on ui thread, move to our thread to reduce risk of blocking // ui thread mHandler.post(() -> { synchronized (mLock) { onUidImportanceChangedLocked(uid, importance); } }); }, FOREGROUND_IMPORTANCE_CUTOFF); mContext.getContentResolver().registerContentObserver( Loading Loading @@ -394,10 +402,14 @@ public class LocationManagerService extends ILocationManager.Stub { LocalServices.getService(PowerManagerInternal.class); localPowerManager.registerLowPowerModeObserver(ServiceType.LOCATION, state -> { // listener invoked on ui thread, move to our thread to reduce risk of blocking // ui thread mHandler.post(() -> { synchronized (mLock) { onBatterySaverModeChangedLocked(state.locationMode); } }); }); new PackageMonitor() { @Override Loading