diff options
author | 2022-02-23 14:58:06 +0800 | |
---|---|---|
committer | 2022-02-23 15:35:18 +0800 | |
commit | 0d93961d858bb0cba234212bcd74dbe537c0529d (patch) | |
tree | 4cc81334f132d3b919b14014ba4f98ab961daeee /java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java | |
parent | 73edbfa25ab8590441a275ee7ebadf150f565ff2 (diff) | |
download | latinime-0d93961d858bb0cba234212bcd74dbe537c0529d.tar.gz latinime-0d93961d858bb0cba234212bcd74dbe537c0529d.tar.xz latinime-0d93961d858bb0cba234212bcd74dbe537c0529d.zip |
Remove unused method for dictionarypack
Remove the showDictionaryAvailableNotification
method since there is no module use it.
Bug: 209479751
Test: presubmit
Change-Id: I4c88b4a2d0cb36761d9102ce35260f93303625d9
Diffstat (limited to '')
-rw-r--r-- | java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java b/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java index 0517bc814..bdea3e919 100644 --- a/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java +++ b/java/src/com/android/inputmethod/dictionarypack/UpdateHandler.java @@ -19,9 +19,6 @@ package com.android.inputmethod.dictionarypack; import android.app.DownloadManager; import android.app.DownloadManager.Query; import android.app.DownloadManager.Request; -import android.app.Notification; -import android.app.NotificationManager; -import android.app.PendingIntent; import android.content.ContentValues; import android.content.Context; import android.content.Intent; @@ -36,10 +33,7 @@ import android.provider.Settings; import android.text.TextUtils; import android.util.Log; -import com.android.inputmethod.compat.ConnectivityManagerCompatUtils; -import com.android.inputmethod.compat.NotificationCompatUtils; import com.android.inputmethod.latin.R; -import com.android.inputmethod.latin.common.LocaleUtils; import com.android.inputmethod.latin.makedict.FormatSpec; import com.android.inputmethod.latin.utils.ApplicationUtils; import com.android.inputmethod.latin.utils.DebugLogUtils; @@ -844,54 +838,6 @@ public final class UpdateHandler { } /** - * Shows the notification that informs the user a dictionary is available. - * - * When this notification is clicked, the dialog for downloading the dictionary - * over a metered connection is shown. - */ - private static void showDictionaryAvailableNotification(final Context context, - final String clientId, final ContentValues installCandidate) { - final String localeString = installCandidate.getAsString(MetadataDbHelper.LOCALE_COLUMN); - final Intent intent = new Intent(); - intent.setClass(context, DownloadOverMeteredDialog.class); - intent.putExtra(DownloadOverMeteredDialog.CLIENT_ID_KEY, clientId); - intent.putExtra(DownloadOverMeteredDialog.WORDLIST_TO_DOWNLOAD_KEY, - installCandidate.getAsString(MetadataDbHelper.WORDLISTID_COLUMN)); - intent.putExtra(DownloadOverMeteredDialog.SIZE_KEY, - installCandidate.getAsInteger(MetadataDbHelper.FILESIZE_COLUMN)); - intent.putExtra(DownloadOverMeteredDialog.LOCALE_KEY, localeString); - intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_EXCLUDE_FROM_RECENTS); - final PendingIntent notificationIntent = PendingIntent.getActivity(context, - 0 /* requestCode */, intent, - PendingIntent.FLAG_UPDATE_CURRENT | PendingIntent.FLAG_ONE_SHOT); - final NotificationManager notificationManager = - (NotificationManager) context.getSystemService(Context.NOTIFICATION_SERVICE); - // None of those are expected to happen, but just in case... - if (null == notificationIntent || null == notificationManager) return; - - final String language = (null == localeString) ? "" - : LocaleUtils.constructLocaleFromString(localeString).getDisplayLanguage(); - final String titleFormat = context.getString(R.string.dict_available_notification_title); - final String notificationTitle = String.format(titleFormat, language); - final Notification.Builder builder = new Notification.Builder(context) - .setAutoCancel(true) - .setContentIntent(notificationIntent) - .setContentTitle(notificationTitle) - .setContentText(context.getString(R.string.dict_available_notification_description)) - .setTicker(notificationTitle) - .setOngoing(false) - .setOnlyAlertOnce(true) - .setSmallIcon(R.drawable.ic_notify_dictionary); - NotificationCompatUtils.setColor(builder, - context.getResources().getColor(R.color.notification_accent_color)); - NotificationCompatUtils.setPriorityToLow(builder); - NotificationCompatUtils.setVisibilityToSecret(builder); - NotificationCompatUtils.setCategoryToRecommendation(builder); - final Notification notification = NotificationCompatUtils.build(builder); - notificationManager.notify(DICT_AVAILABLE_NOTIFICATION_ID, notification); - } - - /** * Installs a word list if it has never been requested. * * This is called when a word list is requested, and is available but not installed. It checks |