From d5c69462c6ebc71d13e353f179c7549bb75d1dc5 Mon Sep 17 00:00:00 2001 From: Jianzheng Zhou Date: Thu, 10 Oct 2013 14:02:09 +0800 Subject: [PATCH] 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 --- services/java/com/android/server/LocationManagerService.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java index 8f480ddbf514c..b4a982e2ab89b 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) {