summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-04-03 09:34:37 +0000
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-04-03 09:34:37 +0000
commit70f8b9a0d8eaebbad3e2cce088854ca33fabaa0e (patch)
tree2fb1f9aa70d04c1ff01f81e0ffb95be06172ad33
parent39e5bc5ad6492b7653af5e9f4baeaf9d345d1c62 (diff)
parent3bc1165100a5c6cccb7e68a8cd44e09fdffae5a0 (diff)
downloadUserDictionaryProvider-70f8b9a0d8eaebbad3e2cce088854ca33fabaa0e.tar.gz
Snap for 4696223 from 3bc1165100a5c6cccb7e68a8cd44e09fdffae5a0 to qt-release
Change-Id: I98efd3e94aee88124da0055a0ab720308bb86718
-rw-r--r--src/com/android/providers/userdictionary/UserDictionaryProvider.java30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/com/android/providers/userdictionary/UserDictionaryProvider.java b/src/com/android/providers/userdictionary/UserDictionaryProvider.java
index c0f67e9..5abeefa 100644
--- a/src/com/android/providers/userdictionary/UserDictionaryProvider.java
+++ b/src/com/android/providers/userdictionary/UserDictionaryProvider.java
@@ -152,6 +152,11 @@ public class UserDictionaryProvider extends ContentProvider {
@Override
public Cursor query(Uri uri, String[] projection, String selection, String[] selectionArgs,
String sortOrder) {
+ // Only the enabled IMEs and spell checkers can access this provider.
+ if (!canCallerAccessUserDictionary()) {
+ return getEmptyCursorOrThrow(projection);
+ }
+
SQLiteQueryBuilder qb = new SQLiteQueryBuilder();
switch (sUriMatcher.match(uri)) {
@@ -170,11 +175,6 @@ public class UserDictionaryProvider extends ContentProvider {
throw new IllegalArgumentException("Unknown URI " + uri);
}
- // Only the enabled IMEs and spell checkers can access this provider.
- if (!canCallerAccessUserDictionary()) {
- return getEmptyCursorOrThrow(projection);
- }
-
// If no sort order is specified use the default
String orderBy;
if (TextUtils.isEmpty(sortOrder)) {
@@ -257,6 +257,11 @@ public class UserDictionaryProvider extends ContentProvider {
@Override
public int delete(Uri uri, String where, String[] whereArgs) {
+ // Only the enabled IMEs and spell checkers can access this provider.
+ if (!canCallerAccessUserDictionary()) {
+ return 0;
+ }
+
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
int count;
switch (sUriMatcher.match(uri)) {
@@ -274,11 +279,6 @@ public class UserDictionaryProvider extends ContentProvider {
throw new IllegalArgumentException("Unknown URI " + uri);
}
- // Only the enabled IMEs and spell checkers can access this provider.
- if (!canCallerAccessUserDictionary()) {
- return 0;
- }
-
getContext().getContentResolver().notifyChange(uri, null);
mBackupManager.dataChanged();
return count;
@@ -286,6 +286,11 @@ public class UserDictionaryProvider extends ContentProvider {
@Override
public int update(Uri uri, ContentValues values, String where, String[] whereArgs) {
+ // Only the enabled IMEs and spell checkers can access this provider.
+ if (!canCallerAccessUserDictionary()) {
+ return 0;
+ }
+
SQLiteDatabase db = mOpenHelper.getWritableDatabase();
int count;
switch (sUriMatcher.match(uri)) {
@@ -303,11 +308,6 @@ public class UserDictionaryProvider extends ContentProvider {
throw new IllegalArgumentException("Unknown URI " + uri);
}
- // Only the enabled IMEs and spell checkers can access this provider.
- if (!canCallerAccessUserDictionary()) {
- return 0;
- }
-
getContext().getContentResolver().notifyChange(uri, null);
mBackupManager.dataChanged();
return count;