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

Commit 4d3d43d0 authored by Jack Yu's avatar Jack Yu Committed by android-build-merger
Browse files

Merge "Stop exposing reasons through phone state listener" am: 26ebccdc

am: d05f403a

Change-Id: I12080acebc37dc496f9b016784fc8ef6e611f1d4
parents 084b7f51 d05f403a
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -2915,8 +2915,6 @@ Lcom/android/internal/telephony/dataconnection/DcTracker;->mProvisioningSpinner:
Lcom/android/internal/telephony/dataconnection/DcTracker;->mResolver:Landroid/content/ContentResolver;
Lcom/android/internal/telephony/dataconnection/DcTracker;->mState:Lcom/android/internal/telephony/DctConstants$State;
Lcom/android/internal/telephony/dataconnection/DcTracker;->mSubscriptionManager:Landroid/telephony/SubscriptionManager;
Lcom/android/internal/telephony/dataconnection/DcTracker;->notifyDataConnection(Ljava/lang/String;)V
Lcom/android/internal/telephony/dataconnection/DcTracker;->notifyOffApnsOfAvailability(Ljava/lang/String;)V
Lcom/android/internal/telephony/dataconnection/DcTracker;->onActionIntentDataStallAlarm(Landroid/content/Intent;)V
Lcom/android/internal/telephony/dataconnection/DcTracker;->onActionIntentProvisioningApnAlarm(Landroid/content/Intent;)V
Lcom/android/internal/telephony/dataconnection/DcTracker;->onRecordsLoadedOrSubIdChanged()V
@@ -3368,7 +3366,7 @@ Lcom/android/internal/telephony/ITelephonyRegistry$Stub;->asInterface(Landroid/o
Lcom/android/internal/telephony/ITelephonyRegistry;->listen(Ljava/lang/String;Lcom/android/internal/telephony/IPhoneStateListener;IZ)V
Lcom/android/internal/telephony/ITelephonyRegistry;->notifyCallState(ILjava/lang/String;)V
Lcom/android/internal/telephony/ITelephonyRegistry;->notifyCellInfo(Ljava/util/List;)V
Lcom/android/internal/telephony/ITelephonyRegistry;->notifyDataConnectionFailed(Ljava/lang/String;Ljava/lang/String;)V
Lcom/android/internal/telephony/ITelephonyRegistry;->notifyDataConnectionFailed(Ljava/lang/String;)V
Lcom/android/internal/telephony/IWapPushManager$Stub;->asInterface(Landroid/os/IBinder;)Lcom/android/internal/telephony/IWapPushManager;
Lcom/android/internal/telephony/IWapPushManager;->addPackage(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;IZZ)Z
Lcom/android/internal/telephony/IWapPushManager;->deletePackage(Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;)Z
+32 −39
Original line number Diff line number Diff line
@@ -1313,16 +1313,17 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
        }
    }

    public void notifyDataConnection(int state, boolean isDataAllowed,
            String reason, String apn, String apnType, LinkProperties linkProperties,
            NetworkCapabilities networkCapabilities, int networkType, boolean roaming) {
    public void notifyDataConnection(int state, boolean isDataAllowed, String apn, String apnType,
                                     LinkProperties linkProperties,
                                     NetworkCapabilities networkCapabilities, int networkType,
                                     boolean roaming) {
        notifyDataConnectionForSubscriber(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, state,
            isDataAllowed,reason, apn, apnType, linkProperties,
                isDataAllowed, apn, apnType, linkProperties,
                networkCapabilities, networkType, roaming);
    }

    public void notifyDataConnectionForSubscriber(int subId, int state,
            boolean isDataAllowed, String reason, String apn, String apnType,
    public void notifyDataConnectionForSubscriber(int subId, int state, boolean isDataAllowed,
                                                  String apn, String apnType,
            LinkProperties linkProperties, NetworkCapabilities networkCapabilities,
            int networkType, boolean roaming) {
        if (!checkNotifyPermission("notifyDataConnection()" )) {
@@ -1331,7 +1332,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
        if (VDBG) {
            log("notifyDataConnectionForSubscriber: subId=" + subId
                + " state=" + state + " isDataAllowed=" + isDataAllowed
                + " reason='" + reason
                + "' apn='" + apn + "' apnType=" + apnType + " networkType=" + networkType
                + " mRecords.size()=" + mRecords.size());
        }
@@ -1366,7 +1366,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
                    mDataConnectionNetworkType[phoneId] = networkType;
                }
                mPreciseDataConnectionState = new PreciseDataConnectionState(state, networkType,
                        apnType, apn, reason, linkProperties, "");
                        apnType, apn, linkProperties, "");
                for (Record r : mRecords) {
                    if (r.matchPhoneStateListenerEvent(
                            PhoneStateListener.LISTEN_PRECISE_DATA_CONNECTION_STATE)) {
@@ -1381,30 +1381,29 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
            }
            handleRemoveListLocked();
        }
        broadcastDataConnectionStateChanged(state, isDataAllowed, reason, apn,
                apnType, linkProperties, networkCapabilities, roaming, subId);
        broadcastPreciseDataConnectionStateChanged(state, networkType, apnType, apn, reason,
        broadcastDataConnectionStateChanged(state, isDataAllowed, apn, apnType, linkProperties,
                networkCapabilities, roaming, subId);
        broadcastPreciseDataConnectionStateChanged(state, networkType, apnType, apn,
                linkProperties, "");
    }

    public void notifyDataConnectionFailed(String reason, String apnType) {
    public void notifyDataConnectionFailed(String apnType) {
         notifyDataConnectionFailedForSubscriber(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID,
                 reason, apnType);
                 apnType);
    }

    public void notifyDataConnectionFailedForSubscriber(int subId,
            String reason, String apnType) {
    public void notifyDataConnectionFailedForSubscriber(int subId, String apnType) {
        if (!checkNotifyPermission("notifyDataConnectionFailed()")) {
            return;
        }
        if (VDBG) {
            log("notifyDataConnectionFailedForSubscriber: subId=" + subId
                + " reason=" + reason + " apnType=" + apnType);
                    + " apnType=" + apnType);
        }
        synchronized (mRecords) {
            mPreciseDataConnectionState = new PreciseDataConnectionState(
                    TelephonyManager.DATA_UNKNOWN,TelephonyManager.NETWORK_TYPE_UNKNOWN,
                    apnType, "", reason, null, "");
                    apnType, "", null, "");
            for (Record r : mRecords) {
                if (r.matchPhoneStateListenerEvent(
                        PhoneStateListener.LISTEN_PRECISE_DATA_CONNECTION_STATE)) {
@@ -1417,9 +1416,9 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
            }
            handleRemoveListLocked();
        }
        broadcastDataConnectionFailed(reason, apnType, subId);
        broadcastDataConnectionFailed(apnType, subId);
        broadcastPreciseDataConnectionStateChanged(TelephonyManager.DATA_UNKNOWN,
                TelephonyManager.NETWORK_TYPE_UNKNOWN, apnType, "", reason, null, "");
                TelephonyManager.NETWORK_TYPE_UNKNOWN, apnType, "", null, "");
    }

    public void notifyCellLocation(Bundle cellLocation) {
@@ -1529,15 +1528,14 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
        }
    }

    public void notifyPreciseDataConnectionFailed(String reason, String apnType,
            String apn, String failCause) {
    public void notifyPreciseDataConnectionFailed(String apnType, String apn, String failCause) {
        if (!checkNotifyPermission("notifyPreciseDataConnectionFailed()")) {
            return;
        }
        synchronized (mRecords) {
            mPreciseDataConnectionState = new PreciseDataConnectionState(
                    TelephonyManager.DATA_UNKNOWN, TelephonyManager.NETWORK_TYPE_UNKNOWN,
                    apnType, apn, reason, null, failCause);
                    apnType, apn, null, failCause);
            for (Record r : mRecords) {
                if (r.matchPhoneStateListenerEvent(
                        PhoneStateListener.LISTEN_PRECISE_DATA_CONNECTION_STATE)) {
@@ -1551,7 +1549,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
            handleRemoveListLocked();
        }
        broadcastPreciseDataConnectionStateChanged(TelephonyManager.DATA_UNKNOWN,
                TelephonyManager.NETWORK_TYPE_UNKNOWN, apnType, apn, reason, null, failCause);
                TelephonyManager.NETWORK_TYPE_UNKNOWN, apnType, apn, null, failCause);
    }

    @Override
@@ -1882,10 +1880,10 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
                        android.Manifest.permission.READ_CALL_LOG});
    }

    private void broadcastDataConnectionStateChanged(int state,
            boolean isDataAllowed,
            String reason, String apn, String apnType, LinkProperties linkProperties,
            NetworkCapabilities networkCapabilities, boolean roaming, int subId) {
    private void broadcastDataConnectionStateChanged(int state, boolean isDataAllowed, String apn,
                                                     String apnType, LinkProperties linkProperties,
                                                     NetworkCapabilities networkCapabilities,
                                                     boolean roaming, int subId) {
        // Note: not reporting to the battery stats service here, because the
        // status bar takes care of that after taking into account all of the
        // required info.
@@ -1895,9 +1893,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
        if (!isDataAllowed) {
            intent.putExtra(PhoneConstants.NETWORK_UNAVAILABLE_KEY, true);
        }
        if (reason != null) {
            intent.putExtra(PhoneConstants.STATE_CHANGE_REASON_KEY, reason);
        }
        if (linkProperties != null) {
            intent.putExtra(PhoneConstants.DATA_LINK_PROPERTIES_KEY, linkProperties);
            String iface = linkProperties.getInterfaceName();
@@ -1916,10 +1911,8 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
        mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
    }

    private void broadcastDataConnectionFailed(String reason, String apnType,
            int subId) {
    private void broadcastDataConnectionFailed(String apnType, int subId) {
        Intent intent = new Intent(TelephonyIntents.ACTION_DATA_CONNECTION_FAILED);
        intent.putExtra(PhoneConstants.FAILURE_REASON_KEY, reason);
        intent.putExtra(PhoneConstants.DATA_APN_TYPE_KEY, apnType);
        intent.putExtra(PhoneConstants.SUBSCRIPTION_KEY, subId);
        mContext.sendStickyBroadcastAsUser(intent, UserHandle.ALL);
@@ -1936,12 +1929,12 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
    }

    private void broadcastPreciseDataConnectionStateChanged(int state, int networkType,
            String apnType, String apn, String reason, LinkProperties linkProperties,
                                                            String apnType, String apn,
                                                            LinkProperties linkProperties,
                                                            String failCause) {
        Intent intent = new Intent(TelephonyManager.ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED);
        intent.putExtra(PhoneConstants.STATE_KEY, state);
        intent.putExtra(PhoneConstants.DATA_NETWORK_TYPE_KEY, networkType);
        if (reason != null) intent.putExtra(PhoneConstants.STATE_CHANGE_REASON_KEY, reason);
        if (apnType != null) intent.putExtra(PhoneConstants.DATA_APN_TYPE_KEY, apnType);
        if (apn != null) intent.putExtra(PhoneConstants.DATA_APN_KEY, apn);
        if (linkProperties != null) {
+6 −36
Original line number Diff line number Diff line
@@ -17,10 +17,11 @@
package android.telephony;

import android.annotation.UnsupportedAppUsage;
import android.net.LinkProperties;
import android.os.Parcel;
import android.os.Parcelable;
import android.telephony.TelephonyManager;
import android.net.LinkProperties;

import java.util.Objects;

/**
 * Contains precise data connection state.
@@ -32,7 +33,6 @@ import android.net.LinkProperties;
 *   <li>Network type of the connection.
 *   <li>APN type.
 *   <li>APN.
 *   <li>Data connection change reason.
 *   <li>The properties of the network link.
 *   <li>Data connection fail cause.
 * </ul>
@@ -45,7 +45,6 @@ public class PreciseDataConnectionState implements Parcelable {
    private int mNetworkType = TelephonyManager.NETWORK_TYPE_UNKNOWN;
    private String mAPNType = "";
    private String mAPN = "";
    private String mReason = "";
    private LinkProperties mLinkProperties = null;
    private String mFailCause = "";

@@ -55,14 +54,12 @@ public class PreciseDataConnectionState implements Parcelable {
     * @hide
     */
    @UnsupportedAppUsage
    public PreciseDataConnectionState(int state, int networkType,
            String apnType, String apn, String reason,
    public PreciseDataConnectionState(int state, int networkType, String apnType, String apn,
                                      LinkProperties linkProperties, String failCause) {
        mState = state;
        mNetworkType = networkType;
        mAPNType = apnType;
        mAPN = apn;
        mReason = reason;
        mLinkProperties = linkProperties;
        mFailCause = failCause;
    }
@@ -83,7 +80,6 @@ public class PreciseDataConnectionState implements Parcelable {
        mNetworkType = in.readInt();
        mAPNType = in.readString();
        mAPN = in.readString();
        mReason = in.readString();
        mLinkProperties = (LinkProperties)in.readParcelable(null);
        mFailCause = in.readString();
    }
@@ -143,14 +139,6 @@ public class PreciseDataConnectionState implements Parcelable {
        return mAPN;
    }

    /**
     * Get data connection change reason.
     */
    @UnsupportedAppUsage
    public String getDataConnectionChangeReason() {
        return mReason;
    }

    /**
     * Get the properties of the network link.
     */
@@ -178,7 +166,6 @@ public class PreciseDataConnectionState implements Parcelable {
        out.writeInt(mNetworkType);
        out.writeString(mAPNType);
        out.writeString(mAPN);
        out.writeString(mReason);
        out.writeParcelable(mLinkProperties, flags);
        out.writeString(mFailCause);
    }
@@ -197,16 +184,7 @@ public class PreciseDataConnectionState implements Parcelable {

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + mState;
        result = prime * result + mNetworkType;
        result = prime * result + ((mAPNType == null) ? 0 : mAPNType.hashCode());
        result = prime * result + ((mAPN == null) ? 0 : mAPN.hashCode());
        result = prime * result + ((mReason == null) ? 0 : mReason.hashCode());
        result = prime * result + ((mLinkProperties == null) ? 0 : mLinkProperties.hashCode());
        result = prime * result + ((mFailCause == null) ? 0 : mFailCause.hashCode());
        return result;
        return Objects.hash(mState, mNetworkType, mAPNType, mAPN, mLinkProperties, mFailCause);
    }

    @Override
@@ -252,13 +230,6 @@ public class PreciseDataConnectionState implements Parcelable {
        if (mNetworkType != other.mNetworkType) {
            return false;
        }
        if (mReason == null) {
            if (other.mReason != null) {
                return false;
            }
        } else if (!mReason.equals(other.mReason)) {
            return false;
        }
        if (mState != other.mState) {
            return false;
        }
@@ -273,7 +244,6 @@ public class PreciseDataConnectionState implements Parcelable {
        sb.append(", Network type: " + mNetworkType);
        sb.append(", APN type: " + mAPNType);
        sb.append(", APN: " + mAPN);
        sb.append(", Change reason: " + mReason);
        sb.append(", Link properties: " + mLinkProperties);
        sb.append(", Fail cause: " + mFailCause);

+0 −14
Original line number Diff line number Diff line
@@ -772,7 +772,6 @@ public class TelephonyManager {
     * The {@link #EXTRA_DATA_NETWORK_TYPE} extra indicates the connection network type.
     * The {@link #EXTRA_DATA_APN_TYPE} extra indicates the APN type.
     * The {@link #EXTRA_DATA_APN} extra indicates the APN.
     * The {@link #EXTRA_DATA_CHANGE_REASON} extra indicates the connection change reason.
     * The {@link #EXTRA_DATA_IFACE_PROPERTIES} extra indicates the connection interface.
     * The {@link #EXTRA_DATA_FAILURE_CAUSE} extra indicates the connection fail cause.
     *
@@ -783,7 +782,6 @@ public class TelephonyManager {
     * @see #EXTRA_DATA_NETWORK_TYPE
     * @see #EXTRA_DATA_APN_TYPE
     * @see #EXTRA_DATA_APN
     * @see #EXTRA_DATA_CHANGE_REASON
     * @see #EXTRA_DATA_IFACE
     * @see #EXTRA_DATA_FAILURE_CAUSE
     * @hide
@@ -870,18 +868,6 @@ public class TelephonyManager {
     */
    public static final String EXTRA_DATA_APN = PhoneConstants.DATA_APN_KEY;

    /**
     * The lookup key used with the {@link #ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED} broadcast
     * for an String representation of the change reason.
     *
     * <p class="note">
     * Retrieve with
     * {@link android.content.Intent#getStringExtra(String name)}.
     *
     * @hide
     */
    public static final String EXTRA_DATA_CHANGE_REASON = PhoneConstants.STATE_CHANGE_REASON_KEY;

    /**
     * The lookup key used with the {@link #ACTION_PRECISE_DATA_CONNECTION_STATE_CHANGED} broadcast
     * for an String representation of the data interface.
+5 −5
Original line number Diff line number Diff line
@@ -50,13 +50,13 @@ interface ITelephonyRegistry {
    void notifyDataActivity(int state);
    void notifyDataActivityForSubscriber(in int subId, int state);
    void notifyDataConnection(int state, boolean isDataConnectivityPossible,
            String reason, String apn, String apnType, in LinkProperties linkProperties,
            String apn, String apnType, in LinkProperties linkProperties,
            in NetworkCapabilities networkCapabilities, int networkType, boolean roaming);
    void notifyDataConnectionForSubscriber(int subId, int state, boolean isDataConnectivityPossible,
            String reason, String apn, String apnType, in LinkProperties linkProperties,
            String apn, String apnType, in LinkProperties linkProperties,
            in NetworkCapabilities networkCapabilities, int networkType, boolean roaming);
    void notifyDataConnectionFailed(String reason, String apnType);
    void notifyDataConnectionFailedForSubscriber(int subId, String reason, String apnType);
    void notifyDataConnectionFailed(String apnType);
    void notifyDataConnectionFailedForSubscriber(int subId, String apnType);
    void notifyCellLocation(in Bundle cellLocation);
    void notifyCellLocationForSubscriber(in int subId, in Bundle cellLocation);
    void notifyOtaspChanged(in int otaspMode);
@@ -67,7 +67,7 @@ interface ITelephonyRegistry {
    void notifyPreciseCallState(int ringingCallState, int foregroundCallState,
            int backgroundCallState);
    void notifyDisconnectCause(int disconnectCause, int preciseDisconnectCause);
    void notifyPreciseDataConnectionFailed(String reason, String apnType, String apn,
    void notifyPreciseDataConnectionFailed(String apnType, String apn,
            String failCause);
    void notifyCellInfoForSubscriber(in int subId, in List<CellInfo> cellInfo);
    void notifySrvccStateChanged(in int subId, in int lteState);
Loading