Loading core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -11271,6 +11271,14 @@ 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 Loading core/res/res/values/config.xml +2 −0 Original line number Diff line number Diff line Loading @@ -2576,6 +2576,7 @@ "silent" = silent mode "users" = list of users "restart" = restart device "emergency" = Launch emergency dialer "lockdown" = Lock down device until the user authenticates "logout" = Logout the current user --> Loading @@ -2585,6 +2586,7 @@ <item>lockdown</item> <item>logout</item> <item>bugreport</item> <item>emergency</item> <item>screenshot</item> </string-array> Loading core/tests/coretests/src/android/provider/SettingsBackupTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -236,6 +236,7 @@ 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, Loading packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +33 −0 Original line number Diff line number Diff line Loading @@ -127,6 +127,7 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, private static final String GLOBAL_ACTION_KEY_ASSIST = "assist"; private static final String GLOBAL_ACTION_KEY_RESTART = "restart"; private static final String GLOBAL_ACTION_KEY_LOGOUT = "logout"; private static final String GLOBAL_ACTION_KEY_EMERGENCY = "emergency"; private static final String GLOBAL_ACTION_KEY_SCREENSHOT = "screenshot"; private final Context mContext; Loading Loading @@ -357,6 +358,12 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, mItems.add(getAssistAction()); } else if (GLOBAL_ACTION_KEY_RESTART.equals(actionKey)) { mItems.add(new RestartAction()); } else if (GLOBAL_ACTION_KEY_EMERGENCY.equals(actionKey)) { if (Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.FASTER_EMERGENCY_PHONE_CALL_ENABLED, 0) != 0 && !mEmergencyAffordanceManager.needsEmergencyAffordance()) { mItems.add(new EmergencyAction()); } } else if (GLOBAL_ACTION_KEY_SCREENSHOT.equals(actionKey)) { mItems.add(new ScreenshotAction()); } else if (GLOBAL_ACTION_KEY_LOGOUT.equals(actionKey)) { Loading Loading @@ -441,6 +448,32 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, } } private class EmergencyAction extends SinglePressAction { private static final String ACTION_EMERGENCY_DIALER_DIAL = "com.android.phone.EmergencyDialer.DIAL"; private EmergencyAction() { super(R.drawable.emergency_icon, R.string.global_action_emergency); } @Override public void onPress() { Intent intent = new Intent(ACTION_EMERGENCY_DIALER_DIAL); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); mContext.startActivityAsUser(intent, UserHandle.CURRENT); } @Override public boolean showDuringKeyguard() { return true; } @Override public boolean showBeforeProvisioning() { return true; } } private final class RestartAction extends SinglePressAction implements LongPressAction { private RestartAction() { super(R.drawable.ic_restart, R.string.global_action_restart); Loading Loading
core/java/android/provider/Settings.java +8 −0 Original line number Diff line number Diff line Loading @@ -11271,6 +11271,14 @@ 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 Loading
core/res/res/values/config.xml +2 −0 Original line number Diff line number Diff line Loading @@ -2576,6 +2576,7 @@ "silent" = silent mode "users" = list of users "restart" = restart device "emergency" = Launch emergency dialer "lockdown" = Lock down device until the user authenticates "logout" = Logout the current user --> Loading @@ -2585,6 +2586,7 @@ <item>lockdown</item> <item>logout</item> <item>bugreport</item> <item>emergency</item> <item>screenshot</item> </string-array> Loading
core/tests/coretests/src/android/provider/SettingsBackupTest.java +1 −0 Original line number Diff line number Diff line Loading @@ -236,6 +236,7 @@ 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, Loading
packages/SystemUI/src/com/android/systemui/globalactions/GlobalActionsDialog.java +33 −0 Original line number Diff line number Diff line Loading @@ -127,6 +127,7 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, private static final String GLOBAL_ACTION_KEY_ASSIST = "assist"; private static final String GLOBAL_ACTION_KEY_RESTART = "restart"; private static final String GLOBAL_ACTION_KEY_LOGOUT = "logout"; private static final String GLOBAL_ACTION_KEY_EMERGENCY = "emergency"; private static final String GLOBAL_ACTION_KEY_SCREENSHOT = "screenshot"; private final Context mContext; Loading Loading @@ -357,6 +358,12 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, mItems.add(getAssistAction()); } else if (GLOBAL_ACTION_KEY_RESTART.equals(actionKey)) { mItems.add(new RestartAction()); } else if (GLOBAL_ACTION_KEY_EMERGENCY.equals(actionKey)) { if (Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.FASTER_EMERGENCY_PHONE_CALL_ENABLED, 0) != 0 && !mEmergencyAffordanceManager.needsEmergencyAffordance()) { mItems.add(new EmergencyAction()); } } else if (GLOBAL_ACTION_KEY_SCREENSHOT.equals(actionKey)) { mItems.add(new ScreenshotAction()); } else if (GLOBAL_ACTION_KEY_LOGOUT.equals(actionKey)) { Loading Loading @@ -441,6 +448,32 @@ class GlobalActionsDialog implements DialogInterface.OnDismissListener, } } private class EmergencyAction extends SinglePressAction { private static final String ACTION_EMERGENCY_DIALER_DIAL = "com.android.phone.EmergencyDialer.DIAL"; private EmergencyAction() { super(R.drawable.emergency_icon, R.string.global_action_emergency); } @Override public void onPress() { Intent intent = new Intent(ACTION_EMERGENCY_DIALER_DIAL); intent.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP); mContext.startActivityAsUser(intent, UserHandle.CURRENT); } @Override public boolean showDuringKeyguard() { return true; } @Override public boolean showBeforeProvisioning() { return true; } } private final class RestartAction extends SinglePressAction implements LongPressAction { private RestartAction() { super(R.drawable.ic_restart, R.string.global_action_restart); Loading