Restore switch for showing app icon.
Bug: 20307420 Change-Id: I95969de40936d2ea992669324d0c4df7e8de2bd9main
parent
fece743fee
commit
a2376cd2b4
|
@ -433,6 +433,10 @@ mobile devices. [CHAR LIMIT=25] -->
|
|||
<string name="setup_step3_action">Configure additional languages</string>
|
||||
<!-- The label of the button that finishes the setup wizard. [CHAR_LIMIT=64] -->
|
||||
<string name="setup_finish_action">Finished</string>
|
||||
<!-- Option to show setup wizard icon. [CHAR LIMIT=30]-->
|
||||
<string name="show_setup_wizard_icon">Show app icon</string>
|
||||
<!-- Description for the option to show setup wizard application icon of this IME in the laucher. [CHAR_LIMIT=65] -->
|
||||
<string name="show_setup_wizard_icon_summary">Display application icon in the launcher</string>
|
||||
|
||||
<!-- The dictionary provider application name. Visible in Settings/Applications/Manage applications. -->
|
||||
<string name="app_name">Dictionary Provider</string>
|
||||
|
|
|
@ -43,6 +43,11 @@
|
|||
android:summary="@string/prefs_enable_emoji_alt_physical_key_summary"
|
||||
android:defaultValue="true"
|
||||
android:persistent="true" />
|
||||
<CheckBoxPreference
|
||||
android:key="pref_show_setup_wizard_icon"
|
||||
android:title="@string/show_setup_wizard_icon"
|
||||
android:summary="@string/show_setup_wizard_icon_summary"
|
||||
android:persistent="true" />
|
||||
<PreferenceScreen
|
||||
android:fragment="com.android.inputmethod.latin.settings.DebugSettingsFragment"
|
||||
android:key="screen_debug"
|
||||
|
|
|
@ -20,9 +20,11 @@ import android.content.BroadcastReceiver;
|
|||
import android.content.ComponentName;
|
||||
import android.content.Context;
|
||||
import android.content.Intent;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.pm.PackageManager;
|
||||
import android.os.Process;
|
||||
import android.preference.PreferenceManager;
|
||||
import android.util.Log;
|
||||
import android.view.inputmethod.InputMethodManager;
|
||||
import android.view.inputmethod.InputMethodSubtype;
|
||||
|
@ -30,6 +32,7 @@ import android.view.inputmethod.InputMethodSubtype;
|
|||
import com.android.inputmethod.dictionarypack.CommonPreferences;
|
||||
import com.android.inputmethod.dictionarypack.DictionaryPackConstants;
|
||||
import com.android.inputmethod.keyboard.KeyboardLayoutSet;
|
||||
import com.android.inputmethod.latin.settings.Settings;
|
||||
import com.android.inputmethod.latin.setup.SetupActivity;
|
||||
import com.android.inputmethod.latin.utils.UncachedInputMethodManagerUtils;
|
||||
|
||||
|
@ -112,11 +115,12 @@ public final class SystemBroadcastReceiver extends BroadcastReceiver {
|
|||
if (Log.isLoggable(TAG, Log.INFO)) {
|
||||
Log.i(TAG, "toggleAppIcon() : FLAG_SYSTEM = " + isSystemApp);
|
||||
}
|
||||
final SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
context.getPackageManager().setComponentEnabledSetting(
|
||||
new ComponentName(context, SetupActivity.class),
|
||||
isSystemApp
|
||||
? PackageManager.COMPONENT_ENABLED_STATE_DISABLED
|
||||
: PackageManager.COMPONENT_ENABLED_STATE_ENABLED,
|
||||
Settings.readShowSetupWizardIcon(prefs, context)
|
||||
? PackageManager.COMPONENT_ENABLED_STATE_ENABLED
|
||||
: PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
|
||||
PackageManager.DONT_KILL_APP);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ package com.android.inputmethod.latin.settings;
|
|||
|
||||
import android.content.Context;
|
||||
import android.content.SharedPreferences;
|
||||
import android.content.pm.ApplicationInfo;
|
||||
import android.content.res.Configuration;
|
||||
import android.content.res.Resources;
|
||||
import android.os.Build;
|
||||
|
@ -93,6 +94,7 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
|
|||
public static final String PREF_GESTURE_PREVIEW_TRAIL = "pref_gesture_preview_trail";
|
||||
public static final String PREF_GESTURE_FLOATING_PREVIEW_TEXT =
|
||||
"pref_gesture_floating_preview_text";
|
||||
public static final String PREF_SHOW_SETUP_WIZARD_ICON = "pref_show_setup_wizard_icon";
|
||||
|
||||
public static final String PREF_KEY_IS_INTERNAL = "pref_key_is_internal";
|
||||
|
||||
|
@ -350,6 +352,18 @@ public final class Settings implements SharedPreferences.OnSharedPreferenceChang
|
|||
return res.getBoolean(R.bool.config_use_fullscreen_mode);
|
||||
}
|
||||
|
||||
public static boolean readShowSetupWizardIcon(final SharedPreferences prefs,
|
||||
final Context context) {
|
||||
if (!prefs.contains(PREF_SHOW_SETUP_WIZARD_ICON)) {
|
||||
final ApplicationInfo appInfo = context.getApplicationInfo();
|
||||
final boolean isApplicationInSystemImage =
|
||||
(appInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0;
|
||||
// Default value
|
||||
return !isApplicationInSystemImage;
|
||||
}
|
||||
return prefs.getBoolean(PREF_SHOW_SETUP_WIZARD_ICON, false);
|
||||
}
|
||||
|
||||
public static boolean readHasHardwareKeyboard(final Configuration conf) {
|
||||
// The standard way of finding out whether we have a hardware keyboard. This code is taken
|
||||
// from InputMethodService#onEvaluateInputShown, which canonically determines this.
|
||||
|
|
|
@ -81,6 +81,8 @@ public class SettingsValues {
|
|||
public final boolean mSlidingKeyInputPreviewEnabled;
|
||||
public final int mKeyLongpressTimeout;
|
||||
public final boolean mEnableEmojiAltPhysicalKey;
|
||||
public final boolean mShowAppIcon;
|
||||
public final boolean mIsShowAppIconSettingInPreferences;
|
||||
public final boolean mCloudSyncEnabled;
|
||||
public final boolean mEnableMetricsLogging;
|
||||
public final boolean mShouldShowLxxSuggestionUi;
|
||||
|
@ -168,6 +170,8 @@ public class SettingsValues {
|
|||
mKeyPreviewPopupDismissDelay = Settings.readKeyPreviewPopupDismissDelay(prefs, res);
|
||||
mEnableEmojiAltPhysicalKey = prefs.getBoolean(
|
||||
Settings.PREF_ENABLE_EMOJI_ALT_PHYSICAL_KEY, true);
|
||||
mShowAppIcon = Settings.readShowSetupWizardIcon(prefs, context);
|
||||
mIsShowAppIconSettingInPreferences = prefs.contains(Settings.PREF_SHOW_SETUP_WIZARD_ICON);
|
||||
mAutoCorrectionThreshold = readAutoCorrectionThreshold(res,
|
||||
autoCorrectionThresholdRawValue);
|
||||
mPlausibilityThreshold = Settings.readPlausibilityThreshold(res);
|
||||
|
|
Loading…
Reference in New Issue