Skip to content

Commit 56e675b

Browse files
author
Victoria Lease
committed
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
1 parent 0f4d5df commit 56e675b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

services/java/com/android/server/LocationManagerService.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1351,6 +1351,11 @@ public void requestGeofence(LocationRequest request, Geofence geofence, PendingI
13511351

13521352
// geo-fence manager uses the public location API, need to clear identity
13531353
int uid = Binder.getCallingUid();
1354+
if (UserHandle.getUserId(uid) != UserHandle.USER_OWNER) {
1355+
// temporary measure until geofences work for secondary users
1356+
Log.w(TAG, "proximity alerts are currently available only to the primary user");
1357+
return;
1358+
}
13541359
long identity = Binder.clearCallingIdentity();
13551360
try {
13561361
mGeofenceManager.addFence(sanitizedRequest, geofence, intent, uid, packageName);

0 commit comments

Comments
 (0)