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

Commit 6d400c73 authored by Tyler Gunn's avatar Tyler Gunn Committed by android-build-merger
Browse files

Merge "Add support for network identified emergency calls."

am: 108349f8

Change-Id: I21ffa931cba06086ca8fd970a0172c282af03b3a
parents 18242e5c 108349f8
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -41035,6 +41035,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";
@@ -5630,6 +5631,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
@@ -414,6 +414,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
    //**********************************************************************************************
@@ -803,6 +810,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
@@ -1884,6 +1884,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