mirror of
https://github.com/Helium314/HeliBoard.git
synced 2025-04-25 09:06:22 +00:00
disable app icon toggle also for android 10
This commit is contained in:
parent
f699d16d10
commit
8a7a41764c
3 changed files with 4 additions and 3 deletions
|
@ -12,6 +12,7 @@ import android.content.Context;
|
||||||
import android.content.Intent;
|
import android.content.Intent;
|
||||||
import android.content.SharedPreferences;
|
import android.content.SharedPreferences;
|
||||||
import android.content.pm.PackageManager;
|
import android.content.pm.PackageManager;
|
||||||
|
import android.os.Build;
|
||||||
import android.os.Process;
|
import android.os.Process;
|
||||||
import org.dslul.openboard.inputmethod.latin.utils.Log;
|
import org.dslul.openboard.inputmethod.latin.utils.Log;
|
||||||
import android.view.inputmethod.InputMethodManager;
|
import android.view.inputmethod.InputMethodManager;
|
||||||
|
@ -83,6 +84,8 @@ public final class SystemBroadcastReceiver extends BroadcastReceiver {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void toggleAppIcon(final Context context) {
|
public static void toggleAppIcon(final Context context) {
|
||||||
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q)
|
||||||
|
return; // can't change visibility in Android 10 and above
|
||||||
final SharedPreferences prefs = DeviceProtectedUtils.getSharedPreferences(context);
|
final SharedPreferences prefs = DeviceProtectedUtils.getSharedPreferences(context);
|
||||||
context.getPackageManager().setComponentEnabledSetting(
|
context.getPackageManager().setComponentEnabledSetting(
|
||||||
new ComponentName(context, SetupActivity.class),
|
new ComponentName(context, SetupActivity.class),
|
||||||
|
|
|
@ -90,7 +90,7 @@ class AdvancedSettingsFragment : SubScreenFragment() {
|
||||||
// singleton and utility classes may not have been initialized. We have to call
|
// singleton and utility classes may not have been initialized. We have to call
|
||||||
// initialization method of these classes here. See {@link LatinIME#onCreate()}.
|
// initialization method of these classes here. See {@link LatinIME#onCreate()}.
|
||||||
AudioAndHapticFeedbackManager.init(context)
|
AudioAndHapticFeedbackManager.init(context)
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.R) {
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
|
||||||
removePreference(Settings.PREF_SHOW_SETUP_WIZARD_ICON)
|
removePreference(Settings.PREF_SHOW_SETUP_WIZARD_ICON)
|
||||||
}
|
}
|
||||||
setupKeyLongpressTimeoutSettings()
|
setupKeyLongpressTimeoutSettings()
|
||||||
|
|
|
@ -96,7 +96,6 @@ public class SettingsValues {
|
||||||
public final boolean mSlidingKeyInputPreviewEnabled;
|
public final boolean mSlidingKeyInputPreviewEnabled;
|
||||||
public final int mKeyLongpressTimeout;
|
public final int mKeyLongpressTimeout;
|
||||||
public final boolean mEnableEmojiAltPhysicalKey;
|
public final boolean mEnableEmojiAltPhysicalKey;
|
||||||
public final boolean mIsShowAppIconSettingInPreferences;
|
|
||||||
public final boolean mIsSplitKeyboardEnabled;
|
public final boolean mIsSplitKeyboardEnabled;
|
||||||
public final float mSplitKeyboardSpacerRelativeWidth;
|
public final float mSplitKeyboardSpacerRelativeWidth;
|
||||||
public final int mScreenMetrics;
|
public final int mScreenMetrics;
|
||||||
|
@ -186,7 +185,6 @@ public class SettingsValues {
|
||||||
mKeypressVibrationDuration = Settings.readKeypressVibrationDuration(prefs, res);
|
mKeypressVibrationDuration = Settings.readKeypressVibrationDuration(prefs, res);
|
||||||
mKeypressSoundVolume = Settings.readKeypressSoundVolume(prefs, res);
|
mKeypressSoundVolume = Settings.readKeypressSoundVolume(prefs, res);
|
||||||
mEnableEmojiAltPhysicalKey = prefs.getBoolean(Settings.PREF_ENABLE_EMOJI_ALT_PHYSICAL_KEY, true);
|
mEnableEmojiAltPhysicalKey = prefs.getBoolean(Settings.PREF_ENABLE_EMOJI_ALT_PHYSICAL_KEY, true);
|
||||||
mIsShowAppIconSettingInPreferences = prefs.contains(Settings.PREF_SHOW_SETUP_WIZARD_ICON);
|
|
||||||
mGestureInputEnabled = Settings.readGestureInputEnabled(prefs);
|
mGestureInputEnabled = Settings.readGestureInputEnabled(prefs);
|
||||||
mGestureTrailEnabled = prefs.getBoolean(Settings.PREF_GESTURE_PREVIEW_TRAIL, true);
|
mGestureTrailEnabled = prefs.getBoolean(Settings.PREF_GESTURE_PREVIEW_TRAIL, true);
|
||||||
mAccount = null; // remove? or can it be useful somewhere?
|
mAccount = null; // remove? or can it be useful somewhere?
|
||||||
|
|
Loading…
Add table
Reference in a new issue