summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Songchun Fan <schfan@google.com> 2020-09-08 18:07:29 +0000
committer Android (Google) Code Review <android-gerrit@google.com> 2020-09-08 18:07:29 +0000
commita20cba89bf36f107cd07573a7b185c7c80c7fd20 (patch)
tree6ba6dda7072711191b676080f88a2b466725a2a3
parentfca876eaf6e1a4f52659ed2abb0ed39a967f6028 (diff)
parent669fc441b6b495c0175edbef68b7f15fdccbf476 (diff)
Merge "[location] system_server should not call non forUser Settings.Secure.get* methods"
-rw-r--r--services/core/java/com/android/server/location/util/SystemSettingsHelper.java9
1 files changed, 6 insertions, 3 deletions
diff --git a/services/core/java/com/android/server/location/util/SystemSettingsHelper.java b/services/core/java/com/android/server/location/util/SystemSettingsHelper.java
index ff4ba914cb9c..39aeaba16579 100644
--- a/services/core/java/com/android/server/location/util/SystemSettingsHelper.java
+++ b/services/core/java/com/android/server/location/util/SystemSettingsHelper.java
@@ -29,6 +29,7 @@ import static com.android.server.location.LocationManagerService.D;
import static com.android.server.location.LocationManagerService.TAG;
import android.app.ActivityManager;
+import android.content.ContentResolver;
import android.content.Context;
import android.database.ContentObserver;
import android.net.Uri;
@@ -330,11 +331,13 @@ public class SystemSettingsHelper extends SettingsHelper {
@Override
public float getCoarseLocationAccuracyM() {
long identity = Binder.clearCallingIdentity();
+ final ContentResolver cr = mContext.getContentResolver();
try {
- return Settings.Secure.getFloat(
- mContext.getContentResolver(),
+ return Settings.Secure.getFloatForUser(
+ cr,
LOCATION_COARSE_ACCURACY_M,
- DEFAULT_COARSE_LOCATION_ACCURACY_M);
+ DEFAULT_COARSE_LOCATION_ACCURACY_M,
+ cr.getUserId());
} finally {
Binder.restoreCallingIdentity(identity);
}