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

Commit 88363e9b authored by yuanjiahsu's avatar yuanjiahsu
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: 113539598
Change-Id: Ie38f4657bfd76d8386ce2a075f4ec5d0038f5c3d
parent 4be14198
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -11339,14 +11339,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
@@ -33,6 +33,7 @@ public class FeatureFlagUtils {

    public static final String FFLAG_PREFIX = "sys.fflag.";
    public static final String FFLAG_OVERRIDE_PREFIX = FFLAG_PREFIX + "override.";
    public static final String EMERGENCY_DIAL_SHORTCUTS = "settings_emergency_dial_shortcuts";

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

    /**
+0 −1
Original line number Diff line number Diff line
@@ -238,7 +238,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;
@@ -317,8 +318,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)) {