Skip to content

Commit ad84f7f

Browse files
Victoria LeaseAndroid (Google) Code Review
authored andcommitted
Merge "disable geofences for secondary users" into jb-mr1-dev
2 parents afc5210 + 56e675b commit ad84f7f

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)