summaryrefslogtreecommitdiffstats
path: root/packages/SettingsProvider
diff options
context:
space:
mode:
authorChristopher Tate <ctate@google.com>2013-10-15 04:01:45 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2013-10-15 04:01:45 -0700
commit741f01a612a04714e1b4df09c35ab03a964d6686 (patch)
treedc4a171147667cc76d7d7dcd0cad3de018525a41 /packages/SettingsProvider
parent8bca372a4017e237c3379b1033c459fe44f328b8 (diff)
parent6b013b753c40a8d998027b4244883e99be42a3be (diff)
downloadframeworks_base-741f01a612a04714e1b4df09c35ab03a964d6686.zip
frameworks_base-741f01a612a04714e1b4df09c35ab03a964d6686.tar.gz
frameworks_base-741f01a612a04714e1b4df09c35ab03a964d6686.tar.bz2
am 6b013b75: am 5c742333: am b83bba7c: Merge "Log noisily on uid vs user-handle confusion in the settings provider" into klp-dev
* commit '6b013b753c40a8d998027b4244883e99be42a3be': Log noisily on uid vs user-handle confusion in the settings provider
Diffstat (limited to 'packages/SettingsProvider')
-rw-r--r--packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
index bc02b0d..158227f 100644
--- a/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
+++ b/packages/SettingsProvider/src/com/android/providers/settings/SettingsProvider.java
@@ -47,6 +47,7 @@ import android.os.Bundle;
import android.os.DropBoxManager;
import android.os.FileObserver;
import android.os.ParcelFileDescriptor;
+import android.os.Process;
import android.os.SystemProperties;
import android.os.UserHandle;
import android.os.UserManager;
@@ -62,6 +63,8 @@ public class SettingsProvider extends ContentProvider {
private static final String TAG = "SettingsProvider";
private static final boolean LOCAL_LOGV = false;
+ private static final boolean USER_CHECK_THROWS = true;
+
private static final String TABLE_SYSTEM = "system";
private static final String TABLE_SECURE = "secure";
private static final String TABLE_GLOBAL = "global";
@@ -522,6 +525,14 @@ public class SettingsProvider extends ContentProvider {
// Lazy initialize the database helper and caches for this user, if necessary
private DatabaseHelper getOrEstablishDatabase(int callingUser) {
+ if (callingUser >= Process.SYSTEM_UID) {
+ if (USER_CHECK_THROWS) {
+ throw new IllegalArgumentException("Uid rather than user handle: " + callingUser);
+ } else {
+ Slog.wtf(TAG, "establish db for uid rather than user: " + callingUser);
+ }
+ }
+
long oldId = Binder.clearCallingIdentity();
try {
DatabaseHelper dbHelper = mOpenHelpers.get(callingUser);