From 56e675b3a1c351de34de68a149762d3ad1b308c5 Mon Sep 17 00:00:00 2001 From: Victoria Lease Date: Mon, 5 Nov 2012 19:25:06 -0800 Subject: [PATCH] disable geofences for secondary users Geofences are broken in multiuser, and need to be fixed before reenabling the feature for secondary users. Change-Id: Ief3008a294deed47760ee25efcf1cdef5371b038 --- services/java/com/android/server/LocationManagerService.java | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/services/java/com/android/server/LocationManagerService.java b/services/java/com/android/server/LocationManagerService.java index 9416b521a5421..229050500b1c8 100644 --- a/services/java/com/android/server/LocationManagerService.java +++ b/services/java/com/android/server/LocationManagerService.java @@ -1351,6 +1351,11 @@ public class LocationManagerService extends ILocationManager.Stub implements Run // geo-fence manager uses the public location API, need to clear identity int uid = Binder.getCallingUid(); + if (UserHandle.getUserId(uid) != UserHandle.USER_OWNER) { + // temporary measure until geofences work for secondary users + Log.w(TAG, "proximity alerts are currently available only to the primary user"); + return; + } long identity = Binder.clearCallingIdentity(); try { mGeofenceManager.addFence(sanitizedRequest, geofence, intent, uid, packageName);