diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 1a67edd19..3fee9013c 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -18,7 +18,6 @@ coreApp="true" package="org.dslul.openboard.inputmethod.latin"> - diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/latin/LatinIME.java b/app/src/main/java/org/dslul/openboard/inputmethod/latin/LatinIME.java index 5f5455caf..13e5b0afa 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/latin/LatinIME.java +++ b/app/src/main/java/org/dslul/openboard/inputmethod/latin/LatinIME.java @@ -83,7 +83,6 @@ import org.dslul.openboard.inputmethod.latin.suggestions.SuggestionStripViewAcce import org.dslul.openboard.inputmethod.latin.touchinputconsumer.GestureConsumer; import org.dslul.openboard.inputmethod.latin.utils.ApplicationUtils; import org.dslul.openboard.inputmethod.latin.utils.DialogUtils; -import org.dslul.openboard.inputmethod.latin.utils.ImportantNoticeUtils; import org.dslul.openboard.inputmethod.latin.utils.IntentUtils; import org.dslul.openboard.inputmethod.latin.utils.JniUtils; import org.dslul.openboard.inputmethod.latin.utils.LeakGuardHandlerWrapper; @@ -703,7 +702,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen private void resetDictionaryFacilitator(final Locale locale) { final SettingsValues settingsValues = mSettings.getCurrent(); mDictionaryFacilitator.resetDictionaries(this /* context */, locale, - settingsValues.mUseContactsDict, settingsValues.mUsePersonalizedDicts, + false, settingsValues.mUsePersonalizedDicts, false /* forceReloadMainDictionary */, settingsValues.mAccount, "" /* dictNamePrefix */, this /* DictionaryInitializationListener */); @@ -720,7 +719,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen /* package private */ void resetSuggestMainDict() { final SettingsValues settingsValues = mSettings.getCurrent(); mDictionaryFacilitator.resetDictionaries(this /* context */, - mDictionaryFacilitator.getLocale(), settingsValues.mUseContactsDict, + mDictionaryFacilitator.getLocale(), false, settingsValues.mUsePersonalizedDicts, true /* forceReloadMainDictionary */, settingsValues.mAccount, "" /* dictNamePrefix */, @@ -1316,18 +1315,8 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen return keyboard.getCoordinates(codePoints); } - // Callback for the {@link SuggestionStripView}, to call when the important notice strip is - // pressed. - @Override - public void showImportantNoticeContents() { - PermissionsManager.get(this).requestPermissions( - this /* PermissionsResultCallback */, - null /* activity */, permission.READ_CONTACTS); - } - @Override public void onRequestPermissionsResult(boolean allGranted) { - ImportantNoticeUtils.updateContactsNoticeShown(this /* context */); setNeutralSuggestionStrip(); } @@ -1560,13 +1549,10 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen return; } - final boolean shouldShowImportantNotice = - ImportantNoticeUtils.shouldShowImportantNotice(this, currentSettingsValues); final boolean shouldShowSuggestionCandidates = currentSettingsValues.mInputAttributes.mShouldShowSuggestions && currentSettingsValues.isSuggestionsEnabledPerUserSettings(); - final boolean shouldShowSuggestionsStripUnlessPassword = shouldShowImportantNotice - || currentSettingsValues.mShowsVoiceInputKey + final boolean shouldShowSuggestionsStripUnlessPassword = currentSettingsValues.mShowsVoiceInputKey || shouldShowSuggestionCandidates || currentSettingsValues.isApplicationSpecifiedCompletionsOn(); final boolean shouldShowSuggestionsStrip = shouldShowSuggestionsStripUnlessPassword @@ -1586,11 +1572,6 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen == SuggestedWords.INPUT_STYLE_BEGINNING_OF_SENTENCE_PREDICTION); final boolean noSuggestionsToOverrideImportantNotice = noSuggestionsFromDictionaries || isBeginningOfSentencePrediction; - if (shouldShowImportantNotice && noSuggestionsToOverrideImportantNotice) { - if (mSuggestionStripView.maybeShowImportantNoticeTitle()) { - return; - } - } if (currentSettingsValues.isSuggestionsEnabledPerUserSettings() || currentSettingsValues.isApplicationSpecifiedCompletionsOn() @@ -1900,7 +1881,7 @@ public class LatinIME extends InputMethodService implements KeyboardActionListen void replaceDictionariesForTest(final Locale locale) { final SettingsValues settingsValues = mSettings.getCurrent(); mDictionaryFacilitator.resetDictionaries(this, locale, - settingsValues.mUseContactsDict, settingsValues.mUsePersonalizedDicts, + false, settingsValues.mUsePersonalizedDicts, false /* forceReloadMainDictionary */, settingsValues.mAccount, "", /* dictionaryNamePrefix */ this /* DictionaryInitializationListener */); diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/CorrectionSettingsFragment.java b/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/CorrectionSettingsFragment.java index 4dd43cffa..3ba15d1a6 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/CorrectionSettingsFragment.java +++ b/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/CorrectionSettingsFragment.java @@ -50,15 +50,12 @@ import java.util.TreeSet; * - Next-word suggestions */ public final class CorrectionSettingsFragment extends SubScreenFragment - implements SharedPreferences.OnSharedPreferenceChangeListener, - PermissionsManager.PermissionsResultCallback { + implements SharedPreferences.OnSharedPreferenceChangeListener { private static final boolean DBG_USE_INTERNAL_PERSONAL_DICTIONARY_SETTINGS = false; private static final boolean USE_INTERNAL_PERSONAL_DICTIONARY_SETTINGS = DBG_USE_INTERNAL_PERSONAL_DICTIONARY_SETTINGS; - private SwitchPreference mUseContactsPreference; - @Override public void onCreate(final Bundle icicle) { super.onCreate(icicle); @@ -76,9 +73,6 @@ public final class CorrectionSettingsFragment extends SubScreenFragment if (ri == null) { overwriteUserDictionaryPreference(editPersonalDictionary); } - - mUseContactsPreference = (SwitchPreference) findPreference(Settings.PREF_KEY_USE_CONTACTS_DICT); - turnOffUseContactsIfNoPermission(); } private void overwriteUserDictionaryPreference(final Preference userDictionaryPreference) { @@ -105,37 +99,4 @@ public final class CorrectionSettingsFragment extends SubScreenFragment } } - @Override - public void onSharedPreferenceChanged(final SharedPreferences sharedPreferences, final String key) { - if (!TextUtils.equals(key, Settings.PREF_KEY_USE_CONTACTS_DICT)) { - return; - } - if (!sharedPreferences.getBoolean(key, false)) { - // don't care if the preference is turned off. - return; - } - - // Check for permissions. - if (PermissionsUtil.checkAllPermissionsGranted( - getActivity() /* context */, Manifest.permission.READ_CONTACTS)) { - return; // all permissions granted, no need to request permissions. - } - - PermissionsManager.get(getActivity() /* context */).requestPermissions( - this /* PermissionsResultCallback */, - getActivity() /* activity */, - Manifest.permission.READ_CONTACTS); - } - - @Override - public void onRequestPermissionsResult(boolean allGranted) { - turnOffUseContactsIfNoPermission(); - } - - private void turnOffUseContactsIfNoPermission() { - if (!PermissionsUtil.checkAllPermissionsGranted( - getActivity(), Manifest.permission.READ_CONTACTS)) { - mUseContactsPreference.setChecked(false); - } - } } diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/Settings.java b/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/Settings.java index cf04461aa..0941476ac 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/Settings.java +++ b/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/Settings.java @@ -64,7 +64,6 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang // PREF_SHOW_SUGGESTIONS_SETTING_OBSOLETE is obsolete. Use PREF_SHOW_SUGGESTIONS instead. public static final String PREF_SHOW_SUGGESTIONS_SETTING_OBSOLETE = "show_suggestions_setting"; public static final String PREF_SHOW_SUGGESTIONS = "show_suggestions"; - public static final String PREF_KEY_USE_CONTACTS_DICT = "pref_key_use_contacts_dict"; public static final String PREF_KEY_USE_PERSONALIZED_DICTS = "pref_key_use_personalized_dicts"; public static final String PREF_KEY_USE_DOUBLE_SPACE_PERIOD = "pref_key_use_double_space_period"; diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/SettingsValues.java b/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/SettingsValues.java index 7b1649f38..a87b780df 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/SettingsValues.java +++ b/app/src/main/java/org/dslul/openboard/inputmethod/latin/settings/SettingsValues.java @@ -71,7 +71,6 @@ public class SettingsValues { public final boolean mIncludesOtherImesInLanguageSwitchList; public final boolean mShowsNumberRow; public final boolean mShowsLanguageSwitchKey; - public final boolean mUseContactsDict; public final boolean mUsePersonalizedDicts; public final boolean mUseDoubleSpacePeriod; public final boolean mBlockPotentiallyOffensive; @@ -146,7 +145,6 @@ public class SettingsValues { mIncludesOtherImesInLanguageSwitchList = !Settings.ENABLE_SHOW_LANGUAGE_SWITCH_KEY_SETTINGS || prefs.getBoolean(Settings.PREF_INCLUDE_OTHER_IMES_IN_LANGUAGE_SWITCH_LIST, false) /* forcibly */; mShowsNumberRow = prefs.getBoolean(Settings.PREF_SHOW_NUMBER_ROW, false); mShowsLanguageSwitchKey = prefs.getBoolean(Settings.PREF_SHOW_LANGUAGE_SWITCH_KEY, false); - mUseContactsDict = prefs.getBoolean(Settings.PREF_KEY_USE_CONTACTS_DICT, true); mUsePersonalizedDicts = prefs.getBoolean(Settings.PREF_KEY_USE_PERSONALIZED_DICTS, true); mUseDoubleSpacePeriod = prefs.getBoolean(Settings.PREF_KEY_USE_DOUBLE_SPACE_PERIOD, true) && inputAttributes.mIsGeneralTextInput; @@ -382,8 +380,6 @@ public class SettingsValues { sb.append("" + mIncludesOtherImesInLanguageSwitchList); sb.append("\n mShowsLanguageSwitchKey = "); sb.append("" + mShowsLanguageSwitchKey); - sb.append("\n mUseContactsDict = "); - sb.append("" + mUseContactsDict); sb.append("\n mUsePersonalizedDicts = "); sb.append("" + mUsePersonalizedDicts); sb.append("\n mUseDoubleSpacePeriod = "); diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java b/app/src/main/java/org/dslul/openboard/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java index 396e93f93..402b70a98 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java +++ b/app/src/main/java/org/dslul/openboard/inputmethod/latin/suggestions/SuggestionStripLayoutHelper.java @@ -544,18 +544,6 @@ final class SuggestionStripLayoutHelper { return countInStrip; } - public void layoutImportantNotice(final View importantNoticeStrip, - final String importantNoticeTitle) { - final TextView titleView = importantNoticeStrip.findViewById( - R.id.important_notice_title); - final int width = titleView.getWidth() - titleView.getPaddingLeft() - - titleView.getPaddingRight(); - titleView.setTextColor(mColorAutoCorrect); - titleView.setText(importantNoticeTitle); // TextView.setText() resets text scale x to 1.0. - final float titleScaleX = getTextScaleX(importantNoticeTitle, width, titleView.getPaint()); - titleView.setTextScaleX(titleScaleX); - } - static void setLayoutWeight(final View v, final float weight, final int height) { final ViewGroup.LayoutParams lp = v.getLayoutParams(); if (lp instanceof LinearLayout.LayoutParams) { diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/latin/suggestions/SuggestionStripView.java b/app/src/main/java/org/dslul/openboard/inputmethod/latin/suggestions/SuggestionStripView.java index 636fcbd37..2f2400de8 100644 --- a/app/src/main/java/org/dslul/openboard/inputmethod/latin/suggestions/SuggestionStripView.java +++ b/app/src/main/java/org/dslul/openboard/inputmethod/latin/suggestions/SuggestionStripView.java @@ -21,7 +21,6 @@ import android.content.res.Resources; import android.content.res.TypedArray; import android.graphics.Color; import android.graphics.drawable.Drawable; -import android.text.TextUtils; import android.util.AttributeSet; import android.util.TypedValue; import android.view.GestureDetector; @@ -50,7 +49,6 @@ import org.dslul.openboard.inputmethod.latin.define.DebugFlags; import org.dslul.openboard.inputmethod.latin.settings.Settings; import org.dslul.openboard.inputmethod.latin.settings.SettingsValues; import org.dslul.openboard.inputmethod.latin.suggestions.MoreSuggestionsView.MoreSuggestionsListener; -import org.dslul.openboard.inputmethod.latin.utils.ImportantNoticeUtils; import java.util.ArrayList; @@ -59,7 +57,6 @@ import androidx.core.view.ViewCompat; public final class SuggestionStripView extends RelativeLayout implements OnClickListener, OnLongClickListener { public interface Listener { - void showImportantNoticeContents(); void pickSuggestionManually(SuggestedWordInfo word); void onCodeInput(int primaryCode, int x, int y, boolean isKeyRepeat); } @@ -70,7 +67,6 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick private final ViewGroup mSuggestionsStrip; private final ImageButton mVoiceKey; private final ImageButton mOtherKey; - private final View mImportantNoticeStrip; MainKeyboardView mMainKeyboardView; private final View mMoreSuggestionsContainer; @@ -91,13 +87,11 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick private static class StripVisibilityGroup { private final View mSuggestionStripView; private final View mSuggestionsStrip; - private final View mImportantNoticeStrip; public StripVisibilityGroup(final View suggestionStripView, - final ViewGroup suggestionsStrip, final View importantNoticeStrip) { + final ViewGroup suggestionsStrip) { mSuggestionStripView = suggestionStripView; mSuggestionsStrip = suggestionsStrip; - mImportantNoticeStrip = importantNoticeStrip; showSuggestionsStrip(); } @@ -106,22 +100,12 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick : ViewCompat.LAYOUT_DIRECTION_LTR; ViewCompat.setLayoutDirection(mSuggestionStripView, layoutDirection); ViewCompat.setLayoutDirection(mSuggestionsStrip, layoutDirection); - ViewCompat.setLayoutDirection(mImportantNoticeStrip, layoutDirection); } public void showSuggestionsStrip() { mSuggestionsStrip.setVisibility(VISIBLE); - mImportantNoticeStrip.setVisibility(INVISIBLE); } - public void showImportantNoticeStrip() { - mSuggestionsStrip.setVisibility(INVISIBLE); - mImportantNoticeStrip.setVisibility(VISIBLE); - } - - public boolean isShowingImportantNoticeStrip() { - return mImportantNoticeStrip.getVisibility() == VISIBLE; - } } /** @@ -143,9 +127,7 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick mSuggestionsStrip = findViewById(R.id.suggestions_strip); mVoiceKey = findViewById(R.id.suggestions_strip_voice_key); mOtherKey = findViewById(R.id.suggestions_strip_other_key); - mImportantNoticeStrip = findViewById(R.id.important_notice_strip); - mStripVisibilityGroup = new StripVisibilityGroup(this, mSuggestionsStrip, - mImportantNoticeStrip); + mStripVisibilityGroup = new StripVisibilityGroup(this, mSuggestionsStrip); for (int pos = 0; pos < SuggestedWords.MAX_SUGGESTIONS; pos++) { final TextView word = new TextView(context, null, R.attr.suggestionWordStyle); @@ -216,31 +198,6 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick mLayoutHelper.setMoreSuggestionsHeight(remainingHeight); } - // This method checks if we should show the important notice (checks on permanent storage if - // it has been shown once already or not, and if in the setup wizard). If applicable, it shows - // the notice. In all cases, it returns true if it was shown, false otherwise. - public boolean maybeShowImportantNoticeTitle() { - final SettingsValues currentSettingsValues = Settings.getInstance().getCurrent(); - if (!ImportantNoticeUtils.shouldShowImportantNotice(getContext(), currentSettingsValues)) { - return false; - } - if (getWidth() <= 0) { - return false; - } - final String importantNoticeTitle = ImportantNoticeUtils.getSuggestContactsNoticeTitle( - getContext()); - if (TextUtils.isEmpty(importantNoticeTitle)) { - return false; - } - if (isShowingMoreSuggestionPanel()) { - dismissMoreSuggestionsPanel(); - } - mLayoutHelper.layoutImportantNotice(mImportantNoticeStrip, importantNoticeTitle); - mStripVisibilityGroup.showImportantNoticeStrip(); - mImportantNoticeStrip.setOnClickListener(this); - return true; - } - public void clear() { mSuggestionsStrip.removeAllViews(); removeAllDebugInfoViews(); @@ -360,9 +317,6 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick @Override public boolean onInterceptTouchEvent(final MotionEvent me) { - if (mStripVisibilityGroup.isShowingImportantNoticeStrip()) { - return false; - } // Detecting sliding up finger to show {@link MoreSuggestionsView}. if (!mMoreSuggestionsView.isShowingInParent()) { mLastX = (int)me.getX(); @@ -453,10 +407,6 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick public void onClick(final View view) { AudioAndHapticFeedbackManager.getInstance().performHapticAndAudioFeedback( Constants.CODE_UNSPECIFIED, this); - if (view == mImportantNoticeStrip) { - mListener.showImportantNoticeContents(); - return; - } if (view == mVoiceKey) { mListener.onCodeInput(Constants.CODE_SHORTCUT, Constants.SUGGESTION_STRIP_COORDINATE, Constants.SUGGESTION_STRIP_COORDINATE, @@ -488,8 +438,5 @@ public final class SuggestionStripView extends RelativeLayout implements OnClick protected void onSizeChanged(final int w, final int h, final int oldw, final int oldh) { // Called by the framework when the size is known. Show the important notice if applicable. // This may be overriden by showing suggestions later, if applicable. - if (oldw <= 0 && w > 0) { - maybeShowImportantNoticeTitle(); - } } } diff --git a/app/src/main/java/org/dslul/openboard/inputmethod/latin/utils/ImportantNoticeUtils.java b/app/src/main/java/org/dslul/openboard/inputmethod/latin/utils/ImportantNoticeUtils.java deleted file mode 100644 index 595a104ba..000000000 --- a/app/src/main/java/org/dslul/openboard/inputmethod/latin/utils/ImportantNoticeUtils.java +++ /dev/null @@ -1,140 +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 org.dslul.openboard.inputmethod.latin.utils; - -import android.Manifest; -import android.content.Context; -import android.content.SharedPreferences; -import android.provider.Settings; -import android.provider.Settings.SettingNotFoundException; -import android.text.TextUtils; -import android.util.Log; - -import org.dslul.openboard.inputmethod.annotations.UsedForTesting; -import org.dslul.openboard.inputmethod.latin.R; -import org.dslul.openboard.inputmethod.latin.permissions.PermissionsUtil; -import org.dslul.openboard.inputmethod.latin.settings.SettingsValues; - -import java.util.concurrent.TimeUnit; - -public final class ImportantNoticeUtils { - private static final String TAG = ImportantNoticeUtils.class.getSimpleName(); - - // {@link SharedPreferences} name to save the last important notice version that has been - // displayed to users. - private static final String PREFERENCE_NAME = "important_notice_pref"; - - private static final String KEY_SUGGEST_CONTACTS_NOTICE = "important_notice_suggest_contacts"; - - @UsedForTesting - static final String KEY_TIMESTAMP_OF_CONTACTS_NOTICE = "timestamp_of_suggest_contacts_notice"; - - @UsedForTesting - static final long TIMEOUT_OF_IMPORTANT_NOTICE = TimeUnit.HOURS.toMillis(23); - - // Copy of the hidden {@link Settings.Secure#USER_SETUP_COMPLETE} settings key. - // The value is zero until each multiuser completes system setup wizard. - // Caveat: This is a hidden API. - private static final String Settings_Secure_USER_SETUP_COMPLETE = "user_setup_complete"; - private static final int USER_SETUP_IS_NOT_COMPLETE = 0; - - private ImportantNoticeUtils() { - // This utility class is not publicly instantiable. - } - - @UsedForTesting - static boolean isInSystemSetupWizard(final Context context) { - try { - final int userSetupComplete = Settings.Secure.getInt( - context.getContentResolver(), Settings_Secure_USER_SETUP_COMPLETE); - return userSetupComplete == USER_SETUP_IS_NOT_COMPLETE; - } catch (final SettingNotFoundException e) { - Log.w(TAG, "Can't find settings in Settings.Secure: key=" - + Settings_Secure_USER_SETUP_COMPLETE); - return false; - } - } - - @UsedForTesting - static SharedPreferences getImportantNoticePreferences(final Context context) { - return context.getSharedPreferences(PREFERENCE_NAME, Context.MODE_PRIVATE); - } - - @UsedForTesting - static boolean hasContactsNoticeShown(final Context context) { - return getImportantNoticePreferences(context).getBoolean( - KEY_SUGGEST_CONTACTS_NOTICE, false); - } - - public static boolean shouldShowImportantNotice(final Context context, - final SettingsValues settingsValues) { - // Check to see whether "Use Contacts" is enabled by the user. - if (!settingsValues.mUseContactsDict) { - return false; - } - - if (hasContactsNoticeShown(context)) { - return false; - } - - // Don't show the dialog if we have all the permissions. - if (PermissionsUtil.checkAllPermissionsGranted( - context, Manifest.permission.READ_CONTACTS)) { - return false; - } - - final String importantNoticeTitle = getSuggestContactsNoticeTitle(context); - if (TextUtils.isEmpty(importantNoticeTitle)) { - return false; - } - if (isInSystemSetupWizard(context)) { - return false; - } - if (hasContactsNoticeTimeoutPassed(context, System.currentTimeMillis())) { - updateContactsNoticeShown(context); - return false; - } - return true; - } - - public static String getSuggestContactsNoticeTitle(final Context context) { - return context.getResources().getString(R.string.important_notice_suggest_contact_names); - } - - @UsedForTesting - static boolean hasContactsNoticeTimeoutPassed( - final Context context, final long currentTimeInMillis) { - final SharedPreferences prefs = getImportantNoticePreferences(context); - if (!prefs.contains(KEY_TIMESTAMP_OF_CONTACTS_NOTICE)) { - prefs.edit() - .putLong(KEY_TIMESTAMP_OF_CONTACTS_NOTICE, currentTimeInMillis) - .apply(); - } - final long firstDisplayTimeInMillis = prefs.getLong( - KEY_TIMESTAMP_OF_CONTACTS_NOTICE, currentTimeInMillis); - final long elapsedTime = currentTimeInMillis - firstDisplayTimeInMillis; - return elapsedTime >= TIMEOUT_OF_IMPORTANT_NOTICE; - } - - public static void updateContactsNoticeShown(final Context context) { - getImportantNoticePreferences(context) - .edit() - .putBoolean(KEY_SUGGEST_CONTACTS_NOTICE, true) - .remove(KEY_TIMESTAMP_OF_CONTACTS_NOTICE) - .apply(); - } -} diff --git a/app/src/main/res/layout/download_over_metered.xml b/app/src/main/res/layout/download_over_metered.xml deleted file mode 100644 index dcde5edbd..000000000 --- a/app/src/main/res/layout/download_over_metered.xml +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - - - - - - - - -