From 76d5f512f99700a963aa20a02590833e37221bff Mon Sep 17 00:00:00 2001 From: Jean Chalard Date: Thu, 28 Mar 2013 18:59:19 +0900 Subject: Ask the client to make itself known when it's not Upon invoking the settings of the dictionary pack with an unknown client, we now launch an intent to ask the client to make itself known. This change also includes the code that receives this intent and acts upon it. Bug: 8492879 Change-Id: I2c6496dea845646961ecafcf64e282cb93ee91dc --- .../latin/BinaryDictionaryFileDumper.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java') diff --git a/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java b/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java index 4bec99c04..562e1d0b7 100644 --- a/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java +++ b/java/src/com/android/inputmethod/latin/BinaryDictionaryFileDumper.java @@ -450,4 +450,25 @@ public final class BinaryDictionaryFileDumper { info.toContentValues()); } } + + /** + * Initialize a client record with the dictionary content provider. + * + * This merely acquires the content provider and calls + * #reinitializeClientRecordInDictionaryContentProvider. + * + * @param context the context for resources and providers. + * @param clientId the client ID to use. + */ + public static void initializeClientRecordHelper(final Context context, + final String clientId) { + try { + final ContentProviderClient client = context.getContentResolver(). + acquireContentProviderClient(getProviderUriBuilder("").build()); + if (null == client) return; + reinitializeClientRecordInDictionaryContentProvider(context, client, clientId); + } catch (RemoteException e) { + Log.e(TAG, "Cannot contact the dictionary content provider", e); + } + } } -- cgit v1.2.3-83-g751a