summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAmith Yamasani <yamasani@google.com>2016-04-12 13:54:26 -0700
committerAmith Yamasani <yamasani@google.com>2016-04-12 13:54:26 -0700
commitcb405a3b9153d20bf6595c54d94f87cd2f5b6f80 (patch)
tree7cc123a83e1cbffbd5c208bfbe7d27959f2cec1b /src
parentd90709f3db566f8e7c5f6cc0e691f20267e128e5 (diff)
downloadUserDictionaryProvider-cb405a3b9153d20bf6595c54d94f87cd2f5b6f80.tar.gz
Fix user dictionary permission check
Fix the uid comparison so that it works for secondary users. Bug: 28076644 Change-Id: I2f26d1965d5cbfcbf3f8b669ea7f84c1bf4f8684
Diffstat (limited to 'src')
-rw-r--r--src/com/android/providers/userdictionary/UserDictionaryProvider.java3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/com/android/providers/userdictionary/UserDictionaryProvider.java b/src/com/android/providers/userdictionary/UserDictionaryProvider.java
index e653047..a7a1971 100644
--- a/src/com/android/providers/userdictionary/UserDictionaryProvider.java
+++ b/src/com/android/providers/userdictionary/UserDictionaryProvider.java
@@ -33,6 +33,7 @@ import android.database.sqlite.SQLiteQueryBuilder;
import android.net.Uri;
import android.os.Binder;
import android.os.Process;
+import android.os.UserHandle;
import android.provider.UserDictionary;
import android.provider.UserDictionary.Words;
import android.text.TextUtils;
@@ -311,7 +312,7 @@ public class UserDictionaryProvider extends ContentProvider {
private boolean canCallerAccessUserDictionary() {
final int callingUid = Binder.getCallingUid();
- if (callingUid == Process.SYSTEM_UID
+ if (UserHandle.getAppId(callingUid) == Process.SYSTEM_UID
|| callingUid == Process.ROOT_UID
|| callingUid == Process.myUid()) {
return true;