Merge "Stop exposing reasons through phone state listener"
This commit is contained in:
committed by
Android (Google) Code Review
commit
86760ea679
@@ -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();
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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
|
||||
@@ -871,18 +869,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.
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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";
|
||||
|
||||
Reference in New Issue
Block a user