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

Commit 2b2458e0 authored by Fan Zhang's avatar Fan Zhang
Browse files

Introduce telecom api to launch emeregency dialer.

Test: manual
Bug: 136194151
Change-Id: I5c9732062e5123539343843fb9a9ae3ca7111890
Merged-In: I5c9732062e5123539343843fb9a9ae3ca7111890
parent d8513243
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -1559,6 +1559,7 @@ package android.content {
    field public static final String ACTION_CALL_EMERGENCY = "android.intent.action.CALL_EMERGENCY";
    field public static final String ACTION_CALL_PRIVILEGED = "android.intent.action.CALL_PRIVILEGED";
    field public static final String ACTION_DEVICE_CUSTOMIZATION_READY = "android.intent.action.DEVICE_CUSTOMIZATION_READY";
    field public static final String ACTION_DIAL_EMERGENCY = "android.intent.action.DIAL_EMERGENCY";
    field public static final String ACTION_FACTORY_RESET = "android.intent.action.FACTORY_RESET";
    field public static final String ACTION_GLOBAL_BUTTON = "android.intent.action.GLOBAL_BUTTON";
    field public static final String ACTION_INCIDENT_REPORT_READY = "android.intent.action.INCIDENT_REPORT_READY";
@@ -7808,6 +7809,7 @@ package android.telecom {
    method public void addNewUnknownCall(android.telecom.PhoneAccountHandle, android.os.Bundle);
    method @Deprecated public void clearAccounts();
    method public void clearPhoneAccounts();
    method @NonNull public android.content.Intent createLaunchEmergencyDialerIntent(@Nullable String);
    method @RequiresPermission(android.Manifest.permission.DUMP) public android.telecom.TelecomAnalytics dumpAnalytics();
    method @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE) public void enablePhoneAccount(android.telecom.PhoneAccountHandle, boolean);
    method public java.util.List<android.telecom.PhoneAccountHandle> getAllPhoneAccountHandles();
+12 −0
Original line number Diff line number Diff line
@@ -1133,6 +1133,18 @@ public class Intent implements Parcelable, Cloneable {
    @SystemApi
    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_CALL_EMERGENCY = "android.intent.action.CALL_EMERGENCY";
    /**
     * Activity Action: Dial a emergency number specified by the data.  This shows a
     * UI with the number being dialed, allowing the user to explicitly
     * initiate the call.
     * <p>Input: If nothing, an empty emergency dialer is started; else {@link #getData}
     * is a tel: URI of an explicit emergency phone number.
     * <p>Output: nothing.
     * @hide
     */
    @SystemApi
    @SdkConstant(SdkConstantType.ACTIVITY_INTENT_ACTION)
    public static final String ACTION_DIAL_EMERGENCY = "android.intent.action.DIAL_EMERGENCY";
    /**
     * Activity action: Perform a call to any number (emergency or not)
     * specified by the data.
+3 −0
Original line number Diff line number Diff line
@@ -3542,6 +3542,9 @@
    <!-- emergency call number for the emergency affordance -->
    <string name="config_emergency_call_number" translatable="false">112</string>

    <!-- Package name that provides Emergency Dialer -->
    <string name="config_emergency_dialer_package">com.android.phone</string>

    <!-- Do not translate. Mcc codes whose existence trigger the presence of emergency
         affordances-->
    <integer-array name="config_emergency_mcc_codes" translatable="false">
+1 −0
Original line number Diff line number Diff line
@@ -3154,6 +3154,7 @@

  <java-symbol type="string" name="global_action_emergency" />
  <java-symbol type="string" name="config_emergency_call_number" />
  <java-symbol type="string" name="config_emergency_dialer_package" />
  <java-symbol type="array" name="config_emergency_mcc_codes" />

  <java-symbol type="string" name="config_dozeDoubleTapSensorType" />
+23 −0
Original line number Diff line number Diff line
@@ -1959,6 +1959,29 @@ public class TelecomManager {
        return result;
    }


    /**
     * Creates the {@link Intent} which can be used with {@link Context#startActivity(Intent)} to
     * launch the activity for emergency dialer.
     *
     * @param number Optional number to call in emergency dialer
     * @hide
     */
    @SystemApi
    @NonNull
    public Intent createLaunchEmergencyDialerIntent(@Nullable String number) {
        ITelecomService service = getTelecomService();
        Intent result = null;
        if (service != null) {
            try {
                result = service.createLaunchEmergencyDialerIntent(number);
            } catch (RemoteException e) {
                Log.e(TAG, "Error createLaunchEmergencyDialerIntent", e);
            }
        }
        return result;
    }

    /**
     * Determines whether Telecom would permit an incoming call to be added via the
     * {@link #addNewIncomingCall(PhoneAccountHandle, Bundle)} API for the specified
Loading