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

Commit 5bd90853 authored by Tyler Gunn's avatar Tyler Gunn
Browse files

Add support for network identified emergency calls.

Add support for the IMS call profile to indicate that a call is an
emergency call.
Add supporting connection and call properties so that this can be
propagated to Telecom and ultimately the Dialer app.
Add System API to determine if the device is in a network IDed or dialed
emergency call (used in Telephony).

Test: Manual test using test intents and ecclist property.
Test: Added new telecom unit tests.
Bug: 77565333
Change-Id: I769e7b5000b10662c08fe53c91ef99edc685d2b1
parent 7cba8a7f
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -40925,6 +40925,7 @@ package android.telecom {
    field public static final int PROPERTY_HAS_CDMA_VOICE_PRIVACY = 128; // 0x80
    field public static final int PROPERTY_HIGH_DEF_AUDIO = 16; // 0x10
    field public static final int PROPERTY_IS_EXTERNAL_CALL = 64; // 0x40
    field public static final int PROPERTY_NETWORK_IDENTIFIED_EMERGENCY_CALL = 2048; // 0x800
    field public static final int PROPERTY_RTT = 1024; // 0x400
    field public static final int PROPERTY_SELF_MANAGED = 256; // 0x100
    field public static final int PROPERTY_WIFI = 8; // 0x8
+2 −0
Original line number Diff line number Diff line
@@ -5048,6 +5048,7 @@ package android.telecom {
    method public deprecated android.content.ComponentName getDefaultPhoneApp();
    method public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsForPackage();
    method public java.util.List<android.telecom.PhoneAccountHandle> getPhoneAccountsSupportingScheme(java.lang.String);
    method public boolean isInEmergencyCall();
    method public boolean isRinging();
    method public boolean isTtySupported();
    field public static final java.lang.String EXTRA_CALL_BACK_INTENT = "android.telecom.extra.CALL_BACK_INTENT";
@@ -5632,6 +5633,7 @@ package android.telephony.ims {
    field public static final java.lang.String EXTRA_CODEC = "Codec";
    field public static final java.lang.String EXTRA_DIALSTRING = "dialstring";
    field public static final java.lang.String EXTRA_DISPLAY_TEXT = "DisplayText";
    field public static final java.lang.String EXTRA_E_CALL = "e_call";
    field public static final java.lang.String EXTRA_IS_CALL_PULL = "CallPull";
    field public static final java.lang.String EXTRA_OI = "oi";
    field public static final java.lang.String EXTRA_OIR = "oir";
+11 −1
Original line number Diff line number Diff line
@@ -434,8 +434,15 @@ public final class Call {
         */
        public static final int PROPERTY_RTT = 0x00000400;

        /**
         * Indicates that the call has been identified as the network as an emergency call. This
         * property may be set for both incoming and outgoing calls which the network identifies as
         * emergency calls.
         */
        public static final int PROPERTY_NETWORK_IDENTIFIED_EMERGENCY_CALL = 0x00000800;

        //******************************************************************************************
        // Next PROPERTY value: 0x00000800
        // Next PROPERTY value: 0x00001000
        //******************************************************************************************

        private final String mTelecomCallId;
@@ -601,6 +608,9 @@ public final class Call {
            if(hasProperty(properties, PROPERTY_ASSISTED_DIALING_USED)) {
                builder.append(" PROPERTY_ASSISTED_DIALING_USED");
            }
            if (hasProperty(properties, PROPERTY_NETWORK_IDENTIFIED_EMERGENCY_CALL)) {
                builder.append(" PROPERTY_NETWORK_IDENTIFIED_EMERGENCY_CALL");
            }
            builder.append("]");
            return builder.toString();
        }
+11 −0
Original line number Diff line number Diff line
@@ -411,6 +411,13 @@ public abstract class Connection extends Conferenceable {
     */
    public static final int PROPERTY_ASSISTED_DIALING_USED = 1 << 9;

    /**
     * Set by the framework to indicate that the network has identified a Connection as an emergency
     * call.
     * @hide
     */
    public static final int PROPERTY_NETWORK_IDENTIFIED_EMERGENCY_CALL = 1 << 10;

    //**********************************************************************************************
    // Next PROPERTY value: 1<<10
    //**********************************************************************************************
@@ -800,6 +807,10 @@ public abstract class Connection extends Conferenceable {
            builder.append(isLong ? " PROPERTY_IS_RTT" : " rtt");
        }

        if (can(properties, PROPERTY_NETWORK_IDENTIFIED_EMERGENCY_CALL)) {
            builder.append(isLong ? " PROPERTY_NETWORK_IDENTIFIED_EMERGENCY_CALL" : " ecall");
        }

        builder.append("]");
        return builder.toString();
    }
+21 −0
Original line number Diff line number Diff line
@@ -1875,6 +1875,27 @@ public class TelecomManager {
        }
    }

    /**
     * Determines if there is an ongoing emergency call.  This can be either an outgoing emergency
     * call, as identified by the dialed number, or because a call was identified by the network
     * as an emergency call.
     * @return {@code true} if there is an ongoing emergency call, {@code false} otherwise.
     * @hide
     */
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
    public boolean isInEmergencyCall() {
        try {
            if (isServiceConnected()) {
                return getTelecomService().isInEmergencyCall();
            }
        } catch (RemoteException e) {
            Log.e(TAG, "RemoteException isInEmergencyCall: " + e);
            return false;
        }
        return false;
    }

    private ITelecomService getTelecomService() {
        if (mTelecomServiceOverride != null) {
            return mTelecomServiceOverride;
Loading