diff options
6 files changed, 44 insertions, 99 deletions
diff --git a/config/hiddenapi-greylist.txt b/config/hiddenapi-greylist.txt index b8d758da5e21..0c561e683307 100644 --- a/config/hiddenapi-greylist.txt +++ b/config/hiddenapi-greylist.txt @@ -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 diff --git a/services/core/java/com/android/server/TelephonyRegistry.java b/services/core/java/com/android/server/TelephonyRegistry.java index 190e99f7b221..6d10632a08cd 100644 --- a/services/core/java/com/android/server/TelephonyRegistry.java +++ b/services/core/java/com/android/server/TelephonyRegistry.java @@ -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, - networkCapabilities, networkType, roaming); + 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,17 +1911,15 @@ 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); } private void broadcastPreciseCallStateChanged(int ringingCallState, int foregroundCallState, - int backgroundCallState) { + int backgroundCallState) { Intent intent = new Intent(TelephonyManager.ACTION_PRECISE_CALL_STATE_CHANGED); intent.putExtra(TelephonyManager.EXTRA_RINGING_CALL_STATE, ringingCallState); intent.putExtra(TelephonyManager.EXTRA_FOREGROUND_CALL_STATE, foregroundCallState); @@ -1936,16 +1929,16 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub { } private void broadcastPreciseDataConnectionStateChanged(int state, int networkType, - String apnType, String apn, String reason, LinkProperties linkProperties, - String failCause) { + 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) { - intent.putExtra(PhoneConstants.DATA_LINK_PROPERTIES_KEY,linkProperties); + intent.putExtra(PhoneConstants.DATA_LINK_PROPERTIES_KEY, linkProperties); } if (failCause != null) intent.putExtra(PhoneConstants.DATA_FAILURE_CAUSE_KEY, failCause); diff --git a/telephony/java/android/telephony/PreciseDataConnectionState.java b/telephony/java/android/telephony/PreciseDataConnectionState.java index b258f52d58ec..83738997a067 100644 --- a/telephony/java/android/telephony/PreciseDataConnectionState.java +++ b/telephony/java/android/telephony/PreciseDataConnectionState.java @@ -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, - LinkProperties linkProperties, String failCause) { + 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(); } @@ -144,14 +140,6 @@ public class PreciseDataConnectionState implements Parcelable { } /** - * Get data connection change reason. - */ - @UnsupportedAppUsage - public String getDataConnectionChangeReason() { - return mReason; - } - - /** * Get the properties of the network link. */ @UnsupportedAppUsage @@ -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); diff --git a/telephony/java/android/telephony/TelephonyManager.java b/telephony/java/android/telephony/TelephonyManager.java index 2286ce29b4d3..739c80fd9d97 100644 --- a/telephony/java/android/telephony/TelephonyManager.java +++ b/telephony/java/android/telephony/TelephonyManager.java @@ -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 @@ -872,18 +870,6 @@ public class TelephonyManager { /** * 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. * * <p class="note"> diff --git a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl index d9f5c3f6d0fa..02a6f311c1da 100644 --- a/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl +++ b/telephony/java/com/android/internal/telephony/ITelephonyRegistry.aidl @@ -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); diff --git a/telephony/java/com/android/internal/telephony/PhoneConstants.java b/telephony/java/com/android/internal/telephony/PhoneConstants.java index 21f3b92c6c4f..e87d28c6f9e9 100644 --- a/telephony/java/com/android/internal/telephony/PhoneConstants.java +++ b/telephony/java/com/android/internal/telephony/PhoneConstants.java @@ -79,8 +79,6 @@ public class PhoneConstants { public static final int SIM_ACTIVATION_TYPE_DATA = 1; public static final String PHONE_NAME_KEY = "phoneName"; - public static final String FAILURE_REASON_KEY = "reason"; - public static final String STATE_CHANGE_REASON_KEY = "reason"; public static final String DATA_NETWORK_TYPE_KEY = "networkType"; public static final String DATA_FAILURE_CAUSE_KEY = "failCause"; public static final String DATA_APN_TYPE_KEY = "apnType"; |