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

Commit 5e5d3039 authored by sqian's avatar sqian
Browse files

Populate 'hasKnownUserIntentEmergency'

This is only used to specify when the dialed number is ambiguous,
identified as both emergency number and any other non-emergency number;
e.g. in some situation, 611 could be both an emergency number in a
country and a non-emergency number of a carrier's customer service hotline.

Test: Manual
Bug: 123999640
Change-Id: I7b1a8832ab86b3e7d8f9af24eb4f7bde7d566612
Merged-In: I7b1a8832ab86b3e7d8f9af24eb4f7bde7d566612
(cherry picked from commit 6d9e7457)
parent 6cc4c0c0
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -5492,6 +5492,7 @@ package android.telecom {
    field public static final String EXTRA_CALL_BACK_INTENT = "android.telecom.extra.CALL_BACK_INTENT";
    field public static final String EXTRA_CLEAR_MISSED_CALLS_INTENT = "android.telecom.extra.CLEAR_MISSED_CALLS_INTENT";
    field public static final String EXTRA_CONNECTION_SERVICE = "android.telecom.extra.CONNECTION_SERVICE";
    field public static final String EXTRA_IS_USER_INTENT_EMERGENCY_CALL = "android.telecom.extra.IS_USER_INTENT_EMERGENCY_CALL";
    field public static final int TTY_MODE_FULL = 1; // 0x1
    field public static final int TTY_MODE_HCO = 2; // 0x2
    field public static final int TTY_MODE_OFF = 0; // 0x0
@@ -6753,6 +6754,7 @@ package android.telephony.ims {
    method public int getServiceType();
    method public static int getVideoStateFromCallType(int);
    method public static int getVideoStateFromImsCallProfile(android.telephony.ims.ImsCallProfile);
    method public boolean hasKnownUserIntentEmergency();
    method public boolean isEmergencyCallTesting();
    method public boolean isVideoCall();
    method public boolean isVideoPaused();
@@ -6765,6 +6767,7 @@ package android.telephony.ims {
    method public void setEmergencyCallTesting(boolean);
    method public void setEmergencyServiceCategories(int);
    method public void setEmergencyUrns(java.util.List<java.lang.String>);
    method public void setHasKnownUserIntentEmergency(boolean);
    method public void updateCallExtras(android.telephony.ims.ImsCallProfile);
    method public void updateCallType(android.telephony.ims.ImsCallProfile);
    method public void updateMediaProfile(android.telephony.ims.ImsCallProfile);
+0 −1
Original line number Diff line number Diff line
@@ -2932,7 +2932,6 @@ Lcom/android/internal/telephony/gsm/UsimPhoneBookManager;->reset()V
Lcom/android/internal/telephony/GsmAlphabet$TextEncodingDetails;-><init>()V
Lcom/android/internal/telephony/GsmCdmaCall;->attachFake(Lcom/android/internal/telephony/Connection;Lcom/android/internal/telephony/Call$State;)V
Lcom/android/internal/telephony/GsmCdmaCallTracker;->clearDisconnected()V
Lcom/android/internal/telephony/GsmCdmaCallTracker;->dialThreeWay(Ljava/lang/String;)Lcom/android/internal/telephony/Connection;
Lcom/android/internal/telephony/GsmCdmaCallTracker;->disableDataCallInEmergencyCall(Ljava/lang/String;)V
Lcom/android/internal/telephony/GsmCdmaCallTracker;->fakeHoldForegroundBeforeDial()V
Lcom/android/internal/telephony/GsmCdmaCallTracker;->getPhone()Lcom/android/internal/telephony/GsmCdmaPhone;
+13 −0
Original line number Diff line number Diff line
@@ -288,6 +288,19 @@ public class TelecomManager {
    public static final String EXTRA_OUTGOING_CALL_EXTRAS =
            "android.telecom.extra.OUTGOING_CALL_EXTRAS";

    /**
     * An optional boolean extra on {@link android.content.Intent#ACTION_CALL_EMERGENCY} to tell
     * whether the user's dial intent is emergency; this is required to specify when the dialed
     * number is ambiguous, identified as both emergency number and any other non-emergency number;
     * e.g. in some situation, 611 could be both an emergency number in a country and a
     * non-emergency number of a carrier's customer service hotline.
     *
     * @hide
     */
    @SystemApi
    public static final String EXTRA_IS_USER_INTENT_EMERGENCY_CALL =
            "android.telecom.extra.IS_USER_INTENT_EMERGENCY_CALL";

    /**
     * @hide
     */
+30 −1
Original line number Diff line number Diff line
@@ -350,6 +350,9 @@ public final class ImsCallProfile implements Parcelable {
    /** Indicates if the call is for testing purpose */
    private boolean mEmergencyCallTesting = false;

    /** Indicates if we have known the intent of the user for the call is emergency */
    private boolean mHasKnownUserIntentEmergency = false;

    /**
     * Extras associated with this {@link ImsCallProfile}.
     * <p>
@@ -789,12 +792,13 @@ public final class ImsCallProfile implements Parcelable {
     *
     * @hide
     */
    public void setEmergencyCallInfo(EmergencyNumber num) {
    public void setEmergencyCallInfo(EmergencyNumber num, boolean hasKnownUserIntentEmergency) {
        setEmergencyServiceCategories(num.getEmergencyServiceCategoryBitmaskInternalDial());
        setEmergencyUrns(num.getEmergencyUrns());
        setEmergencyCallRouting(num.getEmergencyCallRouting());
        setEmergencyCallTesting(num.getEmergencyNumberSourceBitmask()
                == EmergencyNumber.EMERGENCY_NUMBER_SOURCE_TEST);
        setHasKnownUserIntentEmergency(hasKnownUserIntentEmergency);
    }

    /**
@@ -859,6 +863,19 @@ public final class ImsCallProfile implements Parcelable {
        mEmergencyCallTesting = isTesting;
    }

    /**
     * Set if we have known the user intent of the call is emergency.
     *
     * This is only used to specify when the dialed number is ambiguous when it can be identified
     * as both emergency number and any other non-emergency number; e.g. in some situation, 611
     * could be both an emergency number in a country and a non-emergency number of a carrier's
     * customer service hotline.
     */
    @VisibleForTesting
    public void setHasKnownUserIntentEmergency(boolean hasKnownUserIntentEmergency) {
        mHasKnownUserIntentEmergency = hasKnownUserIntentEmergency;
    }

    /**
     * Get the emergency service categories, only valid if {@link #getServiceType} returns
     * {@link #SERVICE_TYPE_EMERGENCY}
@@ -916,4 +933,16 @@ public final class ImsCallProfile implements Parcelable {
    public boolean isEmergencyCallTesting() {
        return mEmergencyCallTesting;
    }

    /**
     * Checks if we have known the user intent of the call is emergency.
     *
     * This is only used to specify when the dialed number is ambiguous when it can be identified
     * as both emergency number and any other non-emergency number; e.g. in some situation, 611
     * could be both an emergency number in a country and a non-emergency number of a carrier's
     * customer service hotline.
     */
    public boolean hasKnownUserIntentEmergency() {
        return mHasKnownUserIntentEmergency;
    }
}