Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a80fbaa9 authored by yuanjiahsu's avatar yuanjiahsu Committed by Leo Hsu
Browse files

Add feature flag in Settings.

User can enable/disable faster emergency phone call feature by switching
this flag from Settings, and the old flag switched by adb command was
replaced by this feature flag.

Test: Manually

Bug: 112168722
Bug: 113539598

Change-Id: Ie38f4657bfd76d8386ce2a075f4ec5d0038f5c3d
Merged-In: Ie38f4657bfd76d8386ce2a075f4ec5d0038f5c3d
parent 37768436
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -11235,14 +11235,6 @@ public final class Settings {
         */
        public static final String EMERGENCY_AFFORDANCE_NEEDED = "emergency_affordance_needed";
        /**
         * Enable faster emergency phone call feature.
         * The value is a boolean (1 or 0).
         * @hide
         */
        public static final String FASTER_EMERGENCY_PHONE_CALL_ENABLED =
                "faster_emergency_phone_call_enabled";
        /**
         * See RIL_PreferredNetworkType in ril.h
         * @hide
+2 −0
Original line number Diff line number Diff line
@@ -35,6 +35,7 @@ public class FeatureFlagUtils {
    public static final String FFLAG_OVERRIDE_PREFIX = FFLAG_PREFIX + "override.";
    public static final String PERSIST_PREFIX = "persist." + FFLAG_OVERRIDE_PREFIX;
    public static final String HEARING_AID_SETTINGS = "settings_bluetooth_hearing_aid";
    public static final String EMERGENCY_DIAL_SHORTCUTS = "settings_emergency_dial_shortcuts";

    private static final Map<String, String> DEFAULT_FLAGS;
    static {
@@ -47,6 +48,7 @@ public class FeatureFlagUtils {
        DEFAULT_FLAGS.put("settings_audio_switcher", "true");
        DEFAULT_FLAGS.put("settings_systemui_theme", "true");
        DEFAULT_FLAGS.put(HEARING_AID_SETTINGS, "true");
        DEFAULT_FLAGS.put(EMERGENCY_DIAL_SHORTCUTS, "false");
    }

    /**
+0 −1
Original line number Diff line number Diff line
@@ -237,7 +237,6 @@ public class SettingsBackupTest {
                    Settings.Global.EUICC_SUPPORTED_COUNTRIES,
                    Settings.Global.EUICC_FACTORY_RESET_TIMEOUT_MILLIS,
                    Settings.Global.FANCY_IME_ANIMATIONS,
                    Settings.Global.FASTER_EMERGENCY_PHONE_CALL_ENABLED,
                    Settings.Global.FORCE_ALLOW_ON_EXTERNAL,
                    Settings.Global.FORCED_APP_STANDBY_ENABLED,
                    Settings.Global.FORCED_APP_STANDBY_FOR_SMALL_BATTERY_ENABLED,
+3 −2
Original line number Diff line number Diff line
@@ -55,6 +55,7 @@ import android.telephony.ServiceState;
import android.telephony.TelephonyManager;
import android.text.TextUtils;
import android.util.ArraySet;
import android.util.FeatureFlagUtils;
import android.util.Log;
import android.view.ContextThemeWrapper;
import android.view.LayoutInflater;
@@ -318,8 +319,8 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener,
        ArraySet<String> addedKeys = new ArraySet<String>();
        mHasLogoutButton = false;
        mHasLockdownButton = false;
        mSeparatedEmergencyButtonEnabled = Settings.Global.getInt(mContext.getContentResolver(),
                Settings.Global.FASTER_EMERGENCY_PHONE_CALL_ENABLED, 0) != 0;
        mSeparatedEmergencyButtonEnabled = FeatureFlagUtils
                .isEnabled(mContext, FeatureFlagUtils.EMERGENCY_DIAL_SHORTCUTS);
        for (int i = 0; i < defaultActions.length; i++) {
            String actionKey = defaultActions[i];
            if (addedKeys.contains(actionKey)) {