diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2018-05-08 23:36:42 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2018-05-08 23:36:42 +0000 |
commit | 234b7bf1308a96d458eec0156b0ff265e07c8ca4 (patch) | |
tree | 4dc605fe76a96dc3e99f3a4e712d45f79e854120 | |
parent | 25bbfe3e1979e87278c33194bded2d8543150745 (diff) | |
parent | 3ba9092fd91c58484391ab214ed27ef2e9cefbff (diff) | |
download | UserDictionaryProvider-234b7bf1308a96d458eec0156b0ff265e07c8ca4.tar.gz |
Merge cherrypicks of [4027705, 4027707, 4027735, 4027736, 4026840, 4025434, 4027755, 4025350, 4025351, 4025352, 4027737, 4027738, 4027660, 4027661, 4027663, 4027665, 4027102, 4027103, 4027104, 4027105, 4027106, 4027717, 4027718, 4027756, 4025353, 4027710, 4027711, 4027712, 4027713, 4027714, 4027795, 4027796, 4027797, 4027798, 4027757, 4027758, 4027799, 4027800, 4026842, 4027667, 4027668, 4027669] into sparse-4732990-L09800000171085564android-8.1.0_r30oreo-m2-s3-release
Change-Id: I56520ca991b8f0270d5d4f9cf029f2ce7a43bacc
-rw-r--r-- | src/com/android/providers/userdictionary/UserDictionaryProvider.java | 30 |
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; |