summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWyatt Riley <wyattriley@google.com>2016-08-04 16:10:06 -0700
committergitbuildkicker <android-build@google.com>2016-09-12 14:12:27 -0700
commit81a0e13ebf59f044a26e57aeac190cab82b068c4 (patch)
tree4759341febf6f9b219544201c82fd6aa54a8ab34
parent9725a591ac8f401d5bfdc6fea454287ac7110745 (diff)
downloadbase-nougat-bugfix-release.tar.gz
LocationManager - Handle Shutdown for right Userandroid-7.0.0_r14nougat-bugfix-release
Only process a shutdown when it is for all users (whole system), not a single user Change-Id: Id51b7fb4606460462c2f6749e5ac3984bdd8319f Bug: 30646142 (cherry picked from commit 1b24fb17b8613894d6066dcf408e60caf2a56192) (cherry picked from commit a8037fffd3d95822a186b3008825f71eb8b00344)
-rw-r--r--services/core/java/com/android/server/LocationManagerService.java13
1 files changed, 9 insertions, 4 deletions
diff --git a/services/core/java/com/android/server/LocationManagerService.java b/services/core/java/com/android/server/LocationManagerService.java
index 36ec2eb9a192..64ca2e3eb3de 100644
--- a/services/core/java/com/android/server/LocationManagerService.java
+++ b/services/core/java/com/android/server/LocationManagerService.java
@@ -150,7 +150,7 @@ public class LocationManagerService extends ILocationManager.Stub {
// used internally for synchronization
private final Object mLock = new Object();
- // --- fields below are final after systemReady() ---
+ // --- fields below are final after systemRunning() ---
private LocationFudger mLocationFudger;
private GeofenceManager mGeofenceManager;
private PackageManager mPackageManager;
@@ -168,6 +168,7 @@ public class LocationManagerService extends ILocationManager.Stub {
// --- fields below are protected by mLock ---
// Set of providers that are explicitly enabled
+ // Only used by passive, fused & test. Network & GPS are controlled separately, and not listed.
private final Set<String> mEnabledProviders = new HashSet<String>();
// Set of providers that are explicitly disabled
@@ -236,12 +237,12 @@ public class LocationManagerService extends ILocationManager.Stub {
if (D) Log.d(TAG, "Constructed");
- // most startup is deferred until systemReady()
+ // most startup is deferred until systemRunning()
}
public void systemRunning() {
synchronized (mLock) {
- if (D) Log.d(TAG, "systemReady()");
+ if (D) Log.d(TAG, "systemRunning()");
// fetch package manager
mPackageManager = mContext.getPackageManager();
@@ -321,7 +322,11 @@ public class LocationManagerService extends ILocationManager.Stub {
|| Intent.ACTION_MANAGED_PROFILE_REMOVED.equals(action)) {
updateUserProfiles(mCurrentUserId);
} else if (Intent.ACTION_SHUTDOWN.equals(action)) {
- shutdownComponents();
+ // shutdown only if UserId indicates whole system, not just one user
+ if(D) Log.d(TAG, "Shutdown received with UserId: " + getSendingUserId());
+ if (getSendingUserId() == UserHandle.USER_ALL) {
+ shutdownComponents();
+ }
}
}
}, UserHandle.ALL, intentFilter, null, mLocationHandler);