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

Commit a4119e36 authored by Rambo Wang's avatar Rambo Wang Committed by Android (Google) Code Review
Browse files

Merge "resolve merge conflicts of 5a104286 to master"

parents 8e7540eb 4083e594
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -46540,7 +46540,7 @@ package android.telephony {
    field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_IMS_CALL_DISCONNECT_CAUSES = 134217728; // 0x8000000
    field public static final int LISTEN_MESSAGE_WAITING_INDICATOR = 4; // 0x4
    field public static final int LISTEN_NONE = 0; // 0x0
    field @RequiresPermission("android.permission.MODIFY_PHONE_STATE") public static final int LISTEN_PRECISE_DATA_CONNECTION_STATE = 4096; // 0x1000
    field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_PRECISE_DATA_CONNECTION_STATE = 4096; // 0x1000
    field @RequiresPermission(android.Manifest.permission.READ_PHONE_STATE) public static final int LISTEN_REGISTRATION_FAILURE = 1073741824; // 0x40000000
    field public static final int LISTEN_SERVICE_STATE = 1; // 0x1
    field @Deprecated public static final int LISTEN_SIGNAL_STRENGTH = 2; // 0x2
+1 −1
Original line number Diff line number Diff line
@@ -11393,7 +11393,7 @@ package android.telephony {
    method public void onSrvccStateChanged(int);
    method public void onVoiceActivationStateChanged(int);
    field @RequiresPermission(android.Manifest.permission.LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH) public static final int LISTEN_ALWAYS_REPORTED_SIGNAL_STRENGTH = 512; // 0x200
    field public static final int LISTEN_CALL_ATTRIBUTES_CHANGED = 67108864; // 0x4000000
    field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_CALL_ATTRIBUTES_CHANGED = 67108864; // 0x4000000
    field @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public static final int LISTEN_OUTGOING_EMERGENCY_CALL = 268435456; // 0x10000000
    field @RequiresPermission(android.Manifest.permission.READ_ACTIVE_EMERGENCY_SESSION) public static final int LISTEN_OUTGOING_EMERGENCY_SMS = 536870912; // 0x20000000
    field @RequiresPermission("android.permission.READ_PRECISE_PHONE_STATE") public static final int LISTEN_PRECISE_CALL_STATE = 2048; // 0x800
+19 −5
Original line number Diff line number Diff line
@@ -188,6 +188,10 @@ public class PhoneStateListener {
     * Listen for {@link android.telephony.Annotation.PreciseCallStates} of ringing,
     * background and foreground calls.
     *
     * <p>Requires permission {@link android.Manifest.permission#READ_PRECISE_PHONE_STATE}
     * or the calling app has carrier privileges
     * (see {@link TelephonyManager#hasCarrierPrivileges}).
     *
     * @hide
     */
    @RequiresPermission((android.Manifest.permission.READ_PRECISE_PHONE_STATE))
@@ -197,13 +201,13 @@ public class PhoneStateListener {
    /**
     * Listen for {@link PreciseDataConnectionState} on the data connection (cellular).
     *
     * <p>Requires permission {@link android.Manifest.permission#MODIFY_PHONE_STATE}
     * <p>Requires permission {@link android.Manifest.permission#READ_PRECISE_PHONE_STATE}
     * or the calling app has carrier privileges
     * (see {@link TelephonyManager#hasCarrierPrivileges}).
     *
     * @see #onPreciseDataConnectionStateChanged
     */
    @RequiresPermission((android.Manifest.permission.MODIFY_PHONE_STATE))
    @RequiresPermission((android.Manifest.permission.READ_PRECISE_PHONE_STATE))
    public static final int LISTEN_PRECISE_DATA_CONNECTION_STATE            = 0x00001000;

    /**
@@ -328,26 +332,36 @@ public class PhoneStateListener {
     * Listen for call disconnect causes which contains {@link DisconnectCause} and
     * {@link PreciseDisconnectCause}.
     *
     * <p>Requires permission {@link android.Manifest.permission#READ_PRECISE_PHONE_STATE}
     * or the calling app has carrier privileges
     * (see {@link TelephonyManager#hasCarrierPrivileges}).
     *
     */
    @RequiresPermission((android.Manifest.permission.READ_PRECISE_PHONE_STATE))
    public static final int LISTEN_CALL_DISCONNECT_CAUSES                  = 0x02000000;

    /**
     * Listen for changes to the call attributes of a currently active call.
     * {@more}
     * Requires Permission: {@link android.Manifest.permission#READ_PRECISE_PHONE_STATE
     * READ_PRECISE_PHONE_STATE}
     *
     * <p>Requires permission {@link android.Manifest.permission#READ_PRECISE_PHONE_STATE}
     * or the calling app has carrier privileges
     * (see {@link TelephonyManager#hasCarrierPrivileges}).
     *
     * @see #onCallAttributesChanged
     * @hide
     */
    @SystemApi
    @RequiresPermission((android.Manifest.permission.READ_PRECISE_PHONE_STATE))
    public static final int LISTEN_CALL_ATTRIBUTES_CHANGED                 = 0x04000000;

    /**
     * Listen for IMS call disconnect causes which contains
     * {@link android.telephony.ims.ImsReasonInfo}
     *
     * <p>Requires permission {@link android.Manifest.permission#READ_PRECISE_PHONE_STATE}
     * or the calling app has carrier privileges
     * (see {@link TelephonyManager#hasCarrierPrivileges}).
     *
     * @see #onImsCallDisconnectCauseChanged(ImsReasonInfo)
     */
    @RequiresPermission((android.Manifest.permission.READ_PRECISE_PHONE_STATE))
+12 −18
Original line number Diff line number Diff line
@@ -289,7 +289,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {

    static final int PRECISE_PHONE_STATE_PERMISSION_MASK =
                PhoneStateListener.LISTEN_PRECISE_CALL_STATE
                | PhoneStateListener.LISTEN_PRECISE_DATA_CONNECTION_STATE;
                | PhoneStateListener.LISTEN_PRECISE_DATA_CONNECTION_STATE
                | PhoneStateListener.LISTEN_CALL_DISCONNECT_CAUSES
                | PhoneStateListener.LISTEN_CALL_ATTRIBUTES_CHANGED
                | PhoneStateListener.LISTEN_IMS_CALL_DISCONNECT_CAUSES;

    static final int READ_ACTIVE_EMERGENCY_SESSION_PERMISSION_MASK =
            PhoneStateListener.LISTEN_OUTGOING_EMERGENCY_CALL
@@ -2518,8 +2521,14 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
        }

        if ((events & PRECISE_PHONE_STATE_PERMISSION_MASK) != 0) {
            // check if calling app has either permission READ_PRECISE_PHONE_STATE
            // or with carrier privileges
            try {
                mContext.enforceCallingOrSelfPermission(
                        android.Manifest.permission.READ_PRECISE_PHONE_STATE, null);
            } catch (SecurityException se) {
                TelephonyPermissions.enforceCallingOrSelfCarrierPrivilege(mContext, subId, message);
            }
        }

        if ((events & READ_ACTIVE_EMERGENCY_SESSION_PERMISSION_MASK) != 0) {
@@ -2542,16 +2551,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
                    android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, null);
        }

        if ((events & PhoneStateListener.LISTEN_CALL_DISCONNECT_CAUSES) != 0) {
            mContext.enforceCallingOrSelfPermission(
                    android.Manifest.permission.READ_PRECISE_PHONE_STATE, null);
        }

        if ((events & PhoneStateListener.LISTEN_CALL_ATTRIBUTES_CHANGED) != 0) {
            mContext.enforceCallingOrSelfPermission(
                    android.Manifest.permission.READ_PRECISE_PHONE_STATE, null);
        }

        if ((events & PhoneStateListener.LISTEN_RADIO_POWER_STATE_CHANGED) != 0) {
            mContext.enforceCallingOrSelfPermission(
                    android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, null);
@@ -2562,11 +2561,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
                    android.Manifest.permission.READ_PRIVILEGED_PHONE_STATE, null);
        }

        if ((events & PhoneStateListener.LISTEN_IMS_CALL_DISCONNECT_CAUSES) != 0) {
            mContext.enforceCallingOrSelfPermission(
                    android.Manifest.permission.READ_PRECISE_PHONE_STATE, null);
        }

        return true;
    }