diff options
author | 2015-07-15 13:32:50 -0700 | |
---|---|---|
committer | 2015-07-15 22:51:53 +0000 | |
commit | 604158669b407a40cd0f23538fad4dce5d738f24 (patch) | |
tree | 85aab20d4da9aa12bdd409ce04541db25de1e2f4 /java/src/com/android/inputmethod/latin/ImportantNoticeDialog.java | |
parent | 7d5fb3a9430550a3ccf1ed5afd70dbf8cc81574a (diff) | |
download | latinime-604158669b407a40cd0f23538fad4dce5d738f24.tar.gz latinime-604158669b407a40cd0f23538fad4dce5d738f24.tar.xz latinime-604158669b407a40cd0f23538fad4dce5d738f24.zip |
[LatinIME] Support MNC permissions.
This build has been compiled against API 23
This build is approved to go out with the M OTA, but may NOT be released
to the public until the Play Store has enabled API level 23 apps
Version: 4.1.2300x.build_id
1. Replaces the personalization is on information with the suggest
contacts.
2. Enables "Use Contacts" only if the app has permission to read
contacts.
3. Disables the contacts dictionary in the Facilitator.
4. Do not register/read the contacts in the contact observer.
Bug: 22236416
Change-Id: I9674e13d0d0f4a2014c5024fde0178de684c07e7
Diffstat (limited to 'java/src/com/android/inputmethod/latin/ImportantNoticeDialog.java')
-rw-r--r-- | java/src/com/android/inputmethod/latin/ImportantNoticeDialog.java | 78 |
1 files changed, 0 insertions, 78 deletions
diff --git a/java/src/com/android/inputmethod/latin/ImportantNoticeDialog.java b/java/src/com/android/inputmethod/latin/ImportantNoticeDialog.java deleted file mode 100644 index 567087c81..000000000 --- a/java/src/com/android/inputmethod/latin/ImportantNoticeDialog.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (C) 2014 The Android Open Source Project - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ - -package com.android.inputmethod.latin; - -import android.app.AlertDialog; -import android.content.Context; -import android.content.DialogInterface; -import android.content.DialogInterface.OnClickListener; - -import com.android.inputmethod.latin.utils.DialogUtils; -import com.android.inputmethod.latin.utils.ImportantNoticeUtils; - -/** - * The dialog box that shows the important notice contents. - */ -public final class ImportantNoticeDialog extends AlertDialog implements OnClickListener { - public interface ImportantNoticeDialogListener { - public void onUserAcknowledgmentOfImportantNoticeDialog(final int nextVersion); - public void onClickSettingsOfImportantNoticeDialog(final int nextVersion); - } - - private final ImportantNoticeDialogListener mListener; - private final int mNextImportantNoticeVersion; - - public ImportantNoticeDialog( - final Context context, final ImportantNoticeDialogListener listener) { - super(DialogUtils.getPlatformDialogThemeContext(context)); - mListener = listener; - mNextImportantNoticeVersion = ImportantNoticeUtils.getNextImportantNoticeVersion(context); - setMessage(ImportantNoticeUtils.getNextImportantNoticeContents(context)); - // Create buttons and set listeners. - setButton(BUTTON_POSITIVE, context.getString(android.R.string.ok), this); - if (shouldHaveSettingsButton()) { - setButton(BUTTON_NEGATIVE, context.getString(R.string.go_to_settings), this); - } - // This dialog is cancelable by pressing back key. See {@link #onBackPress()}. - setCancelable(true /* cancelable */); - setCanceledOnTouchOutside(false /* cancelable */); - } - - private boolean shouldHaveSettingsButton() { - return mNextImportantNoticeVersion - == ImportantNoticeUtils.VERSION_TO_ENABLE_PERSONALIZED_SUGGESTIONS; - } - - private void userAcknowledged() { - ImportantNoticeUtils.updateLastImportantNoticeVersion(getContext()); - mListener.onUserAcknowledgmentOfImportantNoticeDialog(mNextImportantNoticeVersion); - } - - @Override - public void onClick(final DialogInterface dialog, final int which) { - if (shouldHaveSettingsButton() && which == BUTTON_NEGATIVE) { - mListener.onClickSettingsOfImportantNoticeDialog(mNextImportantNoticeVersion); - } - userAcknowledged(); - } - - @Override - public void onBackPressed() { - super.onBackPressed(); - userAcknowledged(); - } -} |