Merge "Catch a permission exception"
This commit is contained in:
commit
e6125db98d
1 changed files with 7 additions and 1 deletions
|
@ -376,8 +376,14 @@ public final class BinaryDictionaryFileDumper {
|
||||||
*/
|
*/
|
||||||
public static void cacheWordListsFromContentProvider(final Locale locale,
|
public static void cacheWordListsFromContentProvider(final Locale locale,
|
||||||
final Context context, final boolean hasDefaultWordList) {
|
final Context context, final boolean hasDefaultWordList) {
|
||||||
final ContentProviderClient providerClient = context.getContentResolver().
|
final ContentProviderClient providerClient;
|
||||||
|
try {
|
||||||
|
providerClient = context.getContentResolver().
|
||||||
acquireContentProviderClient(getProviderUriBuilder("").build());
|
acquireContentProviderClient(getProviderUriBuilder("").build());
|
||||||
|
} catch (final SecurityException e) {
|
||||||
|
Log.e(TAG, "No permission to communicate with the dictionary provider", e);
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (null == providerClient) {
|
if (null == providerClient) {
|
||||||
Log.e(TAG, "Can't establish communication with the dictionary provider");
|
Log.e(TAG, "Can't establish communication with the dictionary provider");
|
||||||
return;
|
return;
|
||||||
|
|
Loading…
Reference in a new issue