diff options
author | 2013-10-10 14:02:09 +0800 | |
---|---|---|
committer | 2014-03-13 09:09:22 +0800 | |
commit | d5c69462c6ebc71d13e353f179c7549bb75d1dc5 (patch) | |
tree | 40684a0bdf8c4e1b09967793c976cdb2b11cff3b | |
parent | 792f38ddd9e8d25b2c8bf0d67363dbfa56550636 (diff) |
remove unnecessary switchUser call
If userId doesn't change, no need to do switchuser.or it will
introduce some tweak for gps modules in quick off/on because
they need cost time in off/on.
Change-Id: Ie5e408dc8be69c8a63a18bcb2cfe478cef4d70e6
Signed-off-by: Jianzheng Zhou <jianzheng.zhou@freescale.com>
-rw-r--r-- | services/java/com/android/server/LocationManagerService.java | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java index 8f480ddbf514..b4a982e2ab89 100644 --- a/services/java/com/android/server/LocationManagerService.java +++ b/services/java/com/android/server/LocationManagerService.java @@ -452,6 +452,9 @@ public class LocationManagerService extends ILocationManager.Stub { * @param userId the new active user's UserId */ private void switchUser(int userId) { + if (mCurrentUserId == userId) { + return; + } mBlacklist.switchUser(userId); mLocationHandler.removeMessages(MSG_LOCATION_CHANGED); synchronized (mLock) { |