PhoneStateListener msim improvement
1. Docuemnt the scope of each callback event either apply to specific
subscriptions or not.
2. TelephonyRegistry store separate state e.g, precisecallstate, callAttribute
for each slot to support msim.
3. Add missing subscription match check when notify callbacks.
Bug: 130423985
Bug: 132181378
Test: atest CtsTelephonyTestCases:PhoneStateListenerTest
Merged-In: I4b014e00528a1f05e0b5f237229c561f8260e2bd
Change-Id: I4b014e00528a1f05e0b5f237229c561f8260e2bd
(cherry picked from commit d5deeb15e9)
This commit is contained in:
@@ -71,5 +71,5 @@ Lcom/android/internal/telephony/IPhoneSubInfo$Stub;-><init>()V
|
||||
Lcom/android/internal/telephony/ITelephonyRegistry;->notifyCallForwardingChanged(Z)V
|
||||
Lcom/android/internal/telephony/ITelephonyRegistry;->notifyCellLocation(Landroid/os/Bundle;)V
|
||||
Lcom/android/internal/telephony/ITelephonyRegistry;->notifyDataActivity(I)V
|
||||
Lcom/android/internal/telephony/ITelephonyRegistry;->notifyOtaspChanged(I)V
|
||||
Lcom/android/internal/telephony/ITelephonyRegistry;->notifyOtaspChanged(II)V
|
||||
Lcom/android/internal/view/BaseIWindow;-><init>()V
|
||||
|
||||
@@ -199,7 +199,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
|
||||
private int[] mDataConnectionNetworkType;
|
||||
|
||||
private int mOtaspMode = TelephonyManager.OTASP_UNKNOWN;
|
||||
private int[] mOtaspMode;
|
||||
|
||||
private ArrayList<List<CellInfo>> mCellInfo = null;
|
||||
|
||||
@@ -207,13 +207,12 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
|
||||
private Map<Integer, List<EmergencyNumber>> mEmergencyNumberList;
|
||||
|
||||
private CallQuality mCallQuality = new CallQuality();
|
||||
private CallQuality[] mCallQuality;
|
||||
|
||||
private CallAttributes mCallAttributes = new CallAttributes(new PreciseCallState(),
|
||||
TelephonyManager.NETWORK_TYPE_UNKNOWN, new CallQuality());
|
||||
private CallAttributes[] mCallAttributes;
|
||||
|
||||
// network type of the call associated with the mCallAttributes and mCallQuality
|
||||
private int mCallNetworkType = TelephonyManager.NETWORK_TYPE_UNKNOWN;
|
||||
private int[] mCallNetworkType;
|
||||
|
||||
private int[] mSrvccState;
|
||||
|
||||
@@ -221,19 +220,19 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
|
||||
private int mDefaultPhoneId = SubscriptionManager.INVALID_PHONE_INDEX;
|
||||
|
||||
private int mRingingCallState = PreciseCallState.PRECISE_CALL_STATE_IDLE;
|
||||
private int[] mRingingCallState;
|
||||
|
||||
private int mForegroundCallState = PreciseCallState.PRECISE_CALL_STATE_IDLE;
|
||||
private int[] mForegroundCallState;
|
||||
|
||||
private int mBackgroundCallState = PreciseCallState.PRECISE_CALL_STATE_IDLE;
|
||||
private int[] mBackgroundCallState;
|
||||
|
||||
private PreciseCallState mPreciseCallState = new PreciseCallState();
|
||||
private PreciseCallState[] mPreciseCallState;
|
||||
|
||||
private int mCallDisconnectCause = DisconnectCause.NOT_VALID;
|
||||
private int[] mCallDisconnectCause;
|
||||
|
||||
private List<ImsReasonInfo> mImsReasonInfo = null;
|
||||
|
||||
private int mCallPreciseDisconnectCause = PreciseDisconnectCause.NOT_VALID;
|
||||
private int[] mCallPreciseDisconnectCause;
|
||||
|
||||
private boolean mCarrierNetworkChangeState = false;
|
||||
|
||||
@@ -250,8 +249,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
|
||||
private final LocalLog mListenLog = new LocalLog(100);
|
||||
|
||||
private PreciseDataConnectionState mPreciseDataConnectionState =
|
||||
new PreciseDataConnectionState();
|
||||
private PreciseDataConnectionState[] mPreciseDataConnectionState;
|
||||
|
||||
// Nothing here yet, but putting it here in case we want to add more in the future.
|
||||
static final int ENFORCE_COARSE_LOCATION_PERMISSION_MASK = 0;
|
||||
@@ -389,10 +387,21 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
mMessageWaiting = new boolean[numPhones];
|
||||
mCallForwarding = new boolean[numPhones];
|
||||
mCellLocation = new Bundle[numPhones];
|
||||
mCellInfo = new ArrayList<List<CellInfo>>();
|
||||
mSrvccState = new int[numPhones];
|
||||
mImsReasonInfo = new ArrayList<ImsReasonInfo>();
|
||||
mPhysicalChannelConfigs = new ArrayList<List<PhysicalChannelConfig>>();
|
||||
mOtaspMode = new int[numPhones];
|
||||
mPreciseCallState = new PreciseCallState[numPhones];
|
||||
mForegroundCallState = new int[numPhones];
|
||||
mBackgroundCallState = new int[numPhones];
|
||||
mRingingCallState = new int[numPhones];
|
||||
mCallDisconnectCause = new int[numPhones];
|
||||
mCallPreciseDisconnectCause = new int[numPhones];
|
||||
mCallQuality = new CallQuality[numPhones];
|
||||
mCallNetworkType = new int[numPhones];
|
||||
mCallAttributes = new CallAttributes[numPhones];
|
||||
mPreciseDataConnectionState = new PreciseDataConnectionState[numPhones];
|
||||
mCellInfo = new ArrayList<>();
|
||||
mImsReasonInfo = new ArrayList<>();
|
||||
mPhysicalChannelConfigs = new ArrayList<>();
|
||||
mEmergencyNumberList = new HashMap<>();
|
||||
for (int i = 0; i < numPhones; i++) {
|
||||
mCallState[i] = TelephonyManager.CALL_STATE_IDLE;
|
||||
@@ -410,7 +419,19 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
mCellInfo.add(i, null);
|
||||
mImsReasonInfo.add(i, null);
|
||||
mSrvccState[i] = TelephonyManager.SRVCC_STATE_HANDOVER_NONE;
|
||||
mPhysicalChannelConfigs.add(i, new ArrayList<PhysicalChannelConfig>());
|
||||
mPhysicalChannelConfigs.add(i, new ArrayList<>());
|
||||
mOtaspMode[i] = TelephonyManager.OTASP_UNKNOWN;
|
||||
mCallDisconnectCause[i] = DisconnectCause.NOT_VALID;
|
||||
mCallPreciseDisconnectCause[i] = PreciseDisconnectCause.NOT_VALID;
|
||||
mCallQuality[i] = new CallQuality();
|
||||
mCallAttributes[i] = new CallAttributes(new PreciseCallState(),
|
||||
TelephonyManager.NETWORK_TYPE_UNKNOWN, new CallQuality());
|
||||
mCallNetworkType[i] = TelephonyManager.NETWORK_TYPE_UNKNOWN;
|
||||
mPreciseCallState[i] = new PreciseCallState();
|
||||
mRingingCallState[i] = PreciseCallState.PRECISE_CALL_STATE_IDLE;
|
||||
mForegroundCallState[i] = PreciseCallState.PRECISE_CALL_STATE_IDLE;
|
||||
mBackgroundCallState[i] = PreciseCallState.PRECISE_CALL_STATE_IDLE;
|
||||
mPreciseDataConnectionState[i] = new PreciseDataConnectionState();
|
||||
}
|
||||
|
||||
// Note that location can be null for non-phone builds like
|
||||
@@ -731,7 +752,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
}
|
||||
if ((events & PhoneStateListener.LISTEN_OTASP_CHANGED) != 0) {
|
||||
try {
|
||||
r.callback.onOtaspChanged(mOtaspMode);
|
||||
r.callback.onOtaspChanged(mOtaspMode[phoneId]);
|
||||
} catch (RemoteException ex) {
|
||||
remove(r.binder);
|
||||
}
|
||||
@@ -749,15 +770,15 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
}
|
||||
if ((events & PhoneStateListener.LISTEN_PRECISE_CALL_STATE) != 0) {
|
||||
try {
|
||||
r.callback.onPreciseCallStateChanged(mPreciseCallState);
|
||||
r.callback.onPreciseCallStateChanged(mPreciseCallState[phoneId]);
|
||||
} catch (RemoteException ex) {
|
||||
remove(r.binder);
|
||||
}
|
||||
}
|
||||
if ((events & PhoneStateListener.LISTEN_CALL_DISCONNECT_CAUSES) != 0) {
|
||||
try {
|
||||
r.callback.onCallDisconnectCauseChanged(mCallDisconnectCause,
|
||||
mCallPreciseDisconnectCause);
|
||||
r.callback.onCallDisconnectCauseChanged(mCallDisconnectCause[phoneId],
|
||||
mCallPreciseDisconnectCause[phoneId]);
|
||||
} catch (RemoteException ex) {
|
||||
remove(r.binder);
|
||||
}
|
||||
@@ -772,7 +793,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
if ((events & PhoneStateListener.LISTEN_PRECISE_DATA_CONNECTION_STATE) != 0) {
|
||||
try {
|
||||
r.callback.onPreciseDataConnectionStateChanged(
|
||||
mPreciseDataConnectionState);
|
||||
mPreciseDataConnectionState[phoneId]);
|
||||
} catch (RemoteException ex) {
|
||||
remove(r.binder);
|
||||
}
|
||||
@@ -854,7 +875,7 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
}
|
||||
if ((events & PhoneStateListener.LISTEN_CALL_ATTRIBUTES_CHANGED) != 0) {
|
||||
try {
|
||||
r.callback.onCallAttributesChanged(mCallAttributes);
|
||||
r.callback.onCallAttributesChanged(mCallAttributes[phoneId]);
|
||||
} catch (RemoteException ex) {
|
||||
remove(r.binder);
|
||||
}
|
||||
@@ -1380,12 +1401,14 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
LinkProperties linkProperties,
|
||||
NetworkCapabilities networkCapabilities, int networkType,
|
||||
boolean roaming) {
|
||||
notifyDataConnectionForSubscriber(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, state,
|
||||
notifyDataConnectionForSubscriber(SubscriptionManager.DEFAULT_PHONE_INDEX,
|
||||
SubscriptionManager.DEFAULT_SUBSCRIPTION_ID, state,
|
||||
isDataAllowed, apn, apnType, linkProperties,
|
||||
networkCapabilities, networkType, roaming);
|
||||
}
|
||||
|
||||
public void notifyDataConnectionForSubscriber(int subId, int state, boolean isDataAllowed,
|
||||
public void notifyDataConnectionForSubscriber(int phoneId, int subId, int state,
|
||||
boolean isDataAllowed,
|
||||
String apn, String apnType,
|
||||
LinkProperties linkProperties, NetworkCapabilities networkCapabilities,
|
||||
int networkType, boolean roaming) {
|
||||
@@ -1398,7 +1421,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
+ "' apn='" + apn + "' apnType=" + apnType + " networkType=" + networkType
|
||||
+ " mRecords.size()=" + mRecords.size());
|
||||
}
|
||||
int phoneId = SubscriptionManager.getPhoneId(subId);
|
||||
synchronized (mRecords) {
|
||||
if (validatePhoneId(phoneId)) {
|
||||
// We only call the callback when the change is for default APN type.
|
||||
@@ -1413,8 +1435,8 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
mLocalLog.log(str);
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(
|
||||
PhoneStateListener.LISTEN_DATA_CONNECTION_STATE) &&
|
||||
idMatch(r.subId, subId, phoneId)) {
|
||||
PhoneStateListener.LISTEN_DATA_CONNECTION_STATE)
|
||||
&& idMatch(r.subId, subId, phoneId)) {
|
||||
try {
|
||||
if (DBG) {
|
||||
log("Notify data connection state changed on sub: " + subId);
|
||||
@@ -1430,15 +1452,17 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
mDataConnectionState[phoneId] = state;
|
||||
mDataConnectionNetworkType[phoneId] = networkType;
|
||||
}
|
||||
mPreciseDataConnectionState = new PreciseDataConnectionState(state, networkType,
|
||||
mPreciseDataConnectionState[phoneId] = new PreciseDataConnectionState(
|
||||
state, networkType,
|
||||
ApnSetting.getApnTypesBitmaskFromString(apnType), apn,
|
||||
linkProperties, DataFailCause.NONE);
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(
|
||||
PhoneStateListener.LISTEN_PRECISE_DATA_CONNECTION_STATE)) {
|
||||
PhoneStateListener.LISTEN_PRECISE_DATA_CONNECTION_STATE)
|
||||
&& idMatch(r.subId, subId, phoneId)) {
|
||||
try {
|
||||
r.callback.onPreciseDataConnectionStateChanged(
|
||||
mPreciseDataConnectionState);
|
||||
mPreciseDataConnectionState[phoneId]);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
}
|
||||
@@ -1454,11 +1478,12 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
}
|
||||
|
||||
public void notifyDataConnectionFailed(String apnType) {
|
||||
notifyDataConnectionFailedForSubscriber(SubscriptionManager.DEFAULT_SUBSCRIPTION_ID,
|
||||
notifyDataConnectionFailedForSubscriber(SubscriptionManager.DEFAULT_PHONE_INDEX,
|
||||
SubscriptionManager.DEFAULT_SUBSCRIPTION_ID,
|
||||
apnType);
|
||||
}
|
||||
|
||||
public void notifyDataConnectionFailedForSubscriber(int subId, String apnType) {
|
||||
public void notifyDataConnectionFailedForSubscriber(int phoneId, int subId, String apnType) {
|
||||
if (!checkNotifyPermission("notifyDataConnectionFailed()")) {
|
||||
return;
|
||||
}
|
||||
@@ -1467,20 +1492,25 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
+ " apnType=" + apnType);
|
||||
}
|
||||
synchronized (mRecords) {
|
||||
mPreciseDataConnectionState = new PreciseDataConnectionState(
|
||||
TelephonyManager.DATA_UNKNOWN,TelephonyManager.NETWORK_TYPE_UNKNOWN,
|
||||
ApnSetting.getApnTypesBitmaskFromString(apnType), null, null,
|
||||
DataFailCause.NONE);
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(
|
||||
PhoneStateListener.LISTEN_PRECISE_DATA_CONNECTION_STATE)) {
|
||||
try {
|
||||
r.callback.onPreciseDataConnectionStateChanged(mPreciseDataConnectionState);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
if (validatePhoneId(phoneId)) {
|
||||
mPreciseDataConnectionState[phoneId] = new PreciseDataConnectionState(
|
||||
TelephonyManager.DATA_UNKNOWN,TelephonyManager.NETWORK_TYPE_UNKNOWN,
|
||||
ApnSetting.getApnTypesBitmaskFromString(apnType), null, null,
|
||||
DataFailCause.NONE);
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(
|
||||
PhoneStateListener.LISTEN_PRECISE_DATA_CONNECTION_STATE)
|
||||
&& idMatch(r.subId, subId, phoneId)) {
|
||||
try {
|
||||
r.callback.onPreciseDataConnectionStateChanged(
|
||||
mPreciseDataConnectionState[phoneId]);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handleRemoveListLocked();
|
||||
}
|
||||
broadcastDataConnectionFailed(apnType, subId);
|
||||
@@ -1527,18 +1557,22 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyOtaspChanged(int otaspMode) {
|
||||
public void notifyOtaspChanged(int subId, int otaspMode) {
|
||||
if (!checkNotifyPermission("notifyOtaspChanged()" )) {
|
||||
return;
|
||||
}
|
||||
int phoneId = SubscriptionManager.getPhoneId(subId);
|
||||
synchronized (mRecords) {
|
||||
mOtaspMode = otaspMode;
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(PhoneStateListener.LISTEN_OTASP_CHANGED)) {
|
||||
try {
|
||||
r.callback.onOtaspChanged(otaspMode);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
if (validatePhoneId(phoneId)) {
|
||||
mOtaspMode[phoneId] = otaspMode;
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(PhoneStateListener.LISTEN_OTASP_CHANGED)
|
||||
&& idMatch(r.subId, subId, phoneId)) {
|
||||
try {
|
||||
r.callback.onOtaspChanged(otaspMode);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1546,49 +1580,55 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyPreciseCallState(int ringingCallState, int foregroundCallState,
|
||||
int backgroundCallState, int phoneId) {
|
||||
public void notifyPreciseCallState(int phoneId, int subId, int ringingCallState,
|
||||
int foregroundCallState, int backgroundCallState) {
|
||||
if (!checkNotifyPermission("notifyPreciseCallState()")) {
|
||||
return;
|
||||
}
|
||||
synchronized (mRecords) {
|
||||
mRingingCallState = ringingCallState;
|
||||
mForegroundCallState = foregroundCallState;
|
||||
mBackgroundCallState = backgroundCallState;
|
||||
mPreciseCallState = new PreciseCallState(ringingCallState, foregroundCallState,
|
||||
backgroundCallState,
|
||||
DisconnectCause.NOT_VALID,
|
||||
PreciseDisconnectCause.NOT_VALID);
|
||||
boolean notifyCallAttributes = true;
|
||||
if (mCallQuality == null) {
|
||||
log("notifyPreciseCallState: mCallQuality is null, skipping call attributes");
|
||||
notifyCallAttributes = false;
|
||||
} else {
|
||||
// If the precise call state is no longer active, reset the call network type and
|
||||
// call quality.
|
||||
if (mPreciseCallState.getForegroundCallState()
|
||||
!= PreciseCallState.PRECISE_CALL_STATE_ACTIVE) {
|
||||
mCallNetworkType = TelephonyManager.NETWORK_TYPE_UNKNOWN;
|
||||
mCallQuality = new CallQuality();
|
||||
}
|
||||
mCallAttributes = new CallAttributes(mPreciseCallState, mCallNetworkType,
|
||||
mCallQuality);
|
||||
}
|
||||
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(PhoneStateListener.LISTEN_PRECISE_CALL_STATE)) {
|
||||
try {
|
||||
r.callback.onPreciseCallStateChanged(mPreciseCallState);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
if (validatePhoneId(phoneId)) {
|
||||
mRingingCallState[phoneId] = ringingCallState;
|
||||
mForegroundCallState[phoneId] = foregroundCallState;
|
||||
mBackgroundCallState[phoneId] = backgroundCallState;
|
||||
mPreciseCallState[phoneId] = new PreciseCallState(
|
||||
ringingCallState, foregroundCallState,
|
||||
backgroundCallState,
|
||||
DisconnectCause.NOT_VALID,
|
||||
PreciseDisconnectCause.NOT_VALID);
|
||||
boolean notifyCallAttributes = true;
|
||||
if (mCallQuality == null) {
|
||||
log("notifyPreciseCallState: mCallQuality is null, "
|
||||
+ "skipping call attributes");
|
||||
notifyCallAttributes = false;
|
||||
} else {
|
||||
// If the precise call state is no longer active, reset the call network type
|
||||
// and call quality.
|
||||
if (mPreciseCallState[phoneId].getForegroundCallState()
|
||||
!= PreciseCallState.PRECISE_CALL_STATE_ACTIVE) {
|
||||
mCallNetworkType[phoneId] = TelephonyManager.NETWORK_TYPE_UNKNOWN;
|
||||
mCallQuality[phoneId] = new CallQuality();
|
||||
}
|
||||
mCallAttributes[phoneId] = new CallAttributes(mPreciseCallState[phoneId],
|
||||
mCallNetworkType[phoneId], mCallQuality[phoneId]);
|
||||
}
|
||||
if (notifyCallAttributes && r.matchPhoneStateListenerEvent(
|
||||
PhoneStateListener.LISTEN_CALL_ATTRIBUTES_CHANGED)) {
|
||||
try {
|
||||
r.callback.onCallAttributesChanged(mCallAttributes);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(PhoneStateListener.LISTEN_PRECISE_CALL_STATE)
|
||||
&& idMatch(r.subId, subId, phoneId)) {
|
||||
try {
|
||||
r.callback.onPreciseCallStateChanged(mPreciseCallState[phoneId]);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
}
|
||||
}
|
||||
if (notifyCallAttributes && r.matchPhoneStateListenerEvent(
|
||||
PhoneStateListener.LISTEN_CALL_ATTRIBUTES_CHANGED)
|
||||
&& idMatch(r.subId, subId, phoneId)) {
|
||||
try {
|
||||
r.callback.onCallAttributesChanged(mCallAttributes[phoneId]);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1598,21 +1638,24 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
backgroundCallState);
|
||||
}
|
||||
|
||||
public void notifyDisconnectCause(int disconnectCause, int preciseDisconnectCause) {
|
||||
public void notifyDisconnectCause(int phoneId, int subId, int disconnectCause,
|
||||
int preciseDisconnectCause) {
|
||||
if (!checkNotifyPermission("notifyDisconnectCause()")) {
|
||||
return;
|
||||
}
|
||||
synchronized (mRecords) {
|
||||
mCallDisconnectCause = disconnectCause;
|
||||
mCallPreciseDisconnectCause = preciseDisconnectCause;
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(PhoneStateListener
|
||||
.LISTEN_CALL_DISCONNECT_CAUSES)) {
|
||||
try {
|
||||
r.callback.onCallDisconnectCauseChanged(mCallDisconnectCause,
|
||||
mCallPreciseDisconnectCause);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
if (validatePhoneId(phoneId)) {
|
||||
mCallDisconnectCause[phoneId] = disconnectCause;
|
||||
mCallPreciseDisconnectCause[phoneId] = preciseDisconnectCause;
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(PhoneStateListener
|
||||
.LISTEN_CALL_DISCONNECT_CAUSES) && idMatch(r.subId, subId, phoneId)) {
|
||||
try {
|
||||
r.callback.onCallDisconnectCauseChanged(mCallDisconnectCause[phoneId],
|
||||
mCallPreciseDisconnectCause[phoneId]);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1648,25 +1691,30 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyPreciseDataConnectionFailed(String apnType,
|
||||
public void notifyPreciseDataConnectionFailed(int phoneId, int subId, String apnType,
|
||||
String apn, @DataFailCause.FailCause int failCause) {
|
||||
if (!checkNotifyPermission("notifyPreciseDataConnectionFailed()")) {
|
||||
return;
|
||||
}
|
||||
synchronized (mRecords) {
|
||||
mPreciseDataConnectionState = new PreciseDataConnectionState(
|
||||
TelephonyManager.DATA_UNKNOWN, TelephonyManager.NETWORK_TYPE_UNKNOWN,
|
||||
ApnSetting.getApnTypesBitmaskFromString(apnType), apn, null, failCause);
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(
|
||||
PhoneStateListener.LISTEN_PRECISE_DATA_CONNECTION_STATE)) {
|
||||
try {
|
||||
r.callback.onPreciseDataConnectionStateChanged(mPreciseDataConnectionState);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
if (validatePhoneId(phoneId)) {
|
||||
mPreciseDataConnectionState[phoneId] = new PreciseDataConnectionState(
|
||||
TelephonyManager.DATA_UNKNOWN, TelephonyManager.NETWORK_TYPE_UNKNOWN,
|
||||
ApnSetting.getApnTypesBitmaskFromString(apnType), apn, null, failCause);
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(
|
||||
PhoneStateListener.LISTEN_PRECISE_DATA_CONNECTION_STATE)
|
||||
&& idMatch(r.subId, subId, phoneId)) {
|
||||
try {
|
||||
r.callback.onPreciseDataConnectionStateChanged(
|
||||
mPreciseDataConnectionState[phoneId]);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handleRemoveListLocked();
|
||||
}
|
||||
broadcastPreciseDataConnectionStateChanged(TelephonyManager.DATA_UNKNOWN,
|
||||
@@ -1704,24 +1752,25 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyOemHookRawEventForSubscriber(int subId, byte[] rawData) {
|
||||
public void notifyOemHookRawEventForSubscriber(int phoneId, int subId, byte[] rawData) {
|
||||
if (!checkNotifyPermission("notifyOemHookRawEventForSubscriber")) {
|
||||
return;
|
||||
}
|
||||
|
||||
synchronized (mRecords) {
|
||||
for (Record r : mRecords) {
|
||||
if (VDBG) {
|
||||
log("notifyOemHookRawEventForSubscriber: r=" + r + " subId=" + subId);
|
||||
}
|
||||
if ((r.matchPhoneStateListenerEvent(
|
||||
PhoneStateListener.LISTEN_OEM_HOOK_RAW_EVENT)) &&
|
||||
((r.subId == subId) ||
|
||||
(r.subId == SubscriptionManager.DEFAULT_SUBSCRIPTION_ID))) {
|
||||
try {
|
||||
r.callback.onOemHookRawEvent(rawData);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
if (validatePhoneId(phoneId)) {
|
||||
for (Record r : mRecords) {
|
||||
if (VDBG) {
|
||||
log("notifyOemHookRawEventForSubscriber: r=" + r + " subId=" + subId);
|
||||
}
|
||||
if ((r.matchPhoneStateListenerEvent(
|
||||
PhoneStateListener.LISTEN_OEM_HOOK_RAW_EVENT))
|
||||
&& idMatch(r.subId, subId, phoneId)) {
|
||||
try {
|
||||
r.callback.onOemHookRawEvent(rawData);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1792,27 +1841,32 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyRadioPowerStateChanged(@TelephonyManager.RadioPowerState int state) {
|
||||
public void notifyRadioPowerStateChanged(int phoneId, int subId,
|
||||
@TelephonyManager.RadioPowerState int state) {
|
||||
if (!checkNotifyPermission("notifyRadioPowerStateChanged()")) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (VDBG) {
|
||||
log("notifyRadioPowerStateChanged: state= " + state);
|
||||
log("notifyRadioPowerStateChanged: state= " + state + " subId=" + subId);
|
||||
}
|
||||
|
||||
synchronized (mRecords) {
|
||||
mRadioPowerState = state;
|
||||
if (validatePhoneId(phoneId)) {
|
||||
mRadioPowerState = state;
|
||||
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(
|
||||
PhoneStateListener.LISTEN_RADIO_POWER_STATE_CHANGED)) {
|
||||
try {
|
||||
r.callback.onRadioPowerStateChanged(state);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(
|
||||
PhoneStateListener.LISTEN_RADIO_POWER_STATE_CHANGED)
|
||||
&& idMatch(r.subId, subId, phoneId)) {
|
||||
try {
|
||||
r.callback.onRadioPowerStateChanged(state);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
handleRemoveListLocked();
|
||||
}
|
||||
@@ -1820,60 +1874,66 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
|
||||
|
||||
@Override
|
||||
public void notifyEmergencyNumberList() {
|
||||
public void notifyEmergencyNumberList(int phoneId, int subId) {
|
||||
if (!checkNotifyPermission("notifyEmergencyNumberList()")) {
|
||||
return;
|
||||
}
|
||||
|
||||
synchronized (mRecords) {
|
||||
TelephonyManager tm = (TelephonyManager) mContext.getSystemService(
|
||||
Context.TELEPHONY_SERVICE);
|
||||
mEmergencyNumberList = tm.getEmergencyNumberList();
|
||||
if (validatePhoneId(phoneId)) {
|
||||
TelephonyManager tm = (TelephonyManager) mContext.getSystemService(
|
||||
Context.TELEPHONY_SERVICE);
|
||||
mEmergencyNumberList = tm.getEmergencyNumberList();
|
||||
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(
|
||||
PhoneStateListener.LISTEN_EMERGENCY_NUMBER_LIST)) {
|
||||
try {
|
||||
r.callback.onEmergencyNumberListChanged(mEmergencyNumberList);
|
||||
if (VDBG) {
|
||||
log("notifyEmergencyNumberList: emergencyNumberList= "
|
||||
+ mEmergencyNumberList);
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(
|
||||
PhoneStateListener.LISTEN_EMERGENCY_NUMBER_LIST)
|
||||
&& idMatch(r.subId, subId, phoneId)) {
|
||||
try {
|
||||
r.callback.onEmergencyNumberListChanged(mEmergencyNumberList);
|
||||
if (VDBG) {
|
||||
log("notifyEmergencyNumberList: emergencyNumberList= "
|
||||
+ mEmergencyNumberList);
|
||||
}
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
}
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handleRemoveListLocked();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void notifyCallQualityChanged(CallQuality callQuality, int phoneId,
|
||||
public void notifyCallQualityChanged(CallQuality callQuality, int phoneId, int subId,
|
||||
int callNetworkType) {
|
||||
if (!checkNotifyPermission("notifyCallQualityChanged()")) {
|
||||
return;
|
||||
}
|
||||
|
||||
// merge CallQuality with PreciseCallState and network type
|
||||
mCallQuality = callQuality;
|
||||
mCallNetworkType = callNetworkType;
|
||||
mCallAttributes = new CallAttributes(mPreciseCallState, callNetworkType, callQuality);
|
||||
|
||||
synchronized (mRecords) {
|
||||
TelephonyManager tm = (TelephonyManager) mContext.getSystemService(
|
||||
Context.TELEPHONY_SERVICE);
|
||||
if (validatePhoneId(phoneId)) {
|
||||
// merge CallQuality with PreciseCallState and network type
|
||||
mCallQuality[phoneId] = callQuality;
|
||||
mCallNetworkType[phoneId] = callNetworkType;
|
||||
mCallAttributes[phoneId] = new CallAttributes(mPreciseCallState[phoneId],
|
||||
callNetworkType, callQuality);
|
||||
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(
|
||||
PhoneStateListener.LISTEN_CALL_ATTRIBUTES_CHANGED)) {
|
||||
try {
|
||||
r.callback.onCallAttributesChanged(mCallAttributes);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
for (Record r : mRecords) {
|
||||
if (r.matchPhoneStateListenerEvent(
|
||||
PhoneStateListener.LISTEN_CALL_ATTRIBUTES_CHANGED)
|
||||
&& idMatch(r.subId, subId, phoneId)) {
|
||||
try {
|
||||
r.callback.onCallAttributesChanged(mCallAttributes[phoneId]);
|
||||
} catch (RemoteException ex) {
|
||||
mRemoveList.add(r.binder);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handleRemoveListLocked();
|
||||
}
|
||||
}
|
||||
@@ -1893,6 +1953,11 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
pw.println("Phone Id=" + i);
|
||||
pw.increaseIndent();
|
||||
pw.println("mCallState=" + mCallState[i]);
|
||||
pw.println("mRingingCallState=" + mRingingCallState[i]);
|
||||
pw.println("mForegroundCallState=" + mForegroundCallState[i]);
|
||||
pw.println("mBackgroundCallState=" + mBackgroundCallState[i]);
|
||||
pw.println("mPreciseCallState=" + mPreciseCallState[i]);
|
||||
pw.println("mCallDisconnectCause=" + mCallDisconnectCause[i]);
|
||||
pw.println("mCallIncomingNumber=" + mCallIncomingNumber[i]);
|
||||
pw.println("mServiceState=" + mServiceState[i]);
|
||||
pw.println("mVoiceActivationState= " + mVoiceActivationState[i]);
|
||||
@@ -1906,24 +1971,21 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
pw.println("mCellLocation=" + mCellLocation[i]);
|
||||
pw.println("mCellInfo=" + mCellInfo.get(i));
|
||||
pw.println("mImsCallDisconnectCause=" + mImsReasonInfo.get(i));
|
||||
pw.println("mSrvccState=" + mSrvccState[i]);
|
||||
pw.println("mOtaspMode=" + mOtaspMode[i]);
|
||||
pw.println("mCallPreciseDisconnectCause=" + mCallPreciseDisconnectCause[i]);
|
||||
pw.println("mCallQuality=" + mCallQuality[i]);
|
||||
pw.println("mCallAttributes=" + mCallAttributes[i]);
|
||||
pw.println("mCallNetworkType=" + mCallNetworkType[i]);
|
||||
pw.println("mPreciseDataConnectionState=" + mPreciseDataConnectionState[i]);
|
||||
pw.decreaseIndent();
|
||||
}
|
||||
pw.println("mCallNetworkType=" + mCallNetworkType);
|
||||
pw.println("mPreciseDataConnectionState=" + mPreciseDataConnectionState);
|
||||
pw.println("mPreciseCallState=" + mPreciseCallState);
|
||||
pw.println("mCallDisconnectCause=" + mCallDisconnectCause);
|
||||
pw.println("mCallPreciseDisconnectCause=" + mCallPreciseDisconnectCause);
|
||||
pw.println("mCarrierNetworkChangeState=" + mCarrierNetworkChangeState);
|
||||
pw.println("mRingingCallState=" + mRingingCallState);
|
||||
pw.println("mForegroundCallState=" + mForegroundCallState);
|
||||
pw.println("mBackgroundCallState=" + mBackgroundCallState);
|
||||
pw.println("mSrvccState=" + mSrvccState);
|
||||
|
||||
pw.println("mPhoneCapability=" + mPhoneCapability);
|
||||
pw.println("mActiveDataSubId=" + mActiveDataSubId);
|
||||
pw.println("mRadioPowerState=" + mRadioPowerState);
|
||||
pw.println("mEmergencyNumberList=" + mEmergencyNumberList);
|
||||
pw.println("mCallQuality=" + mCallQuality);
|
||||
pw.println("mCallAttributes=" + mCallAttributes);
|
||||
pw.println("mDefaultPhoneId=" + mDefaultPhoneId);
|
||||
pw.println("mDefaultSubId=" + mDefaultSubId);
|
||||
|
||||
|
||||
@@ -60,6 +60,8 @@ public class PhoneStateListener {
|
||||
|
||||
/**
|
||||
* Stop listening for updates.
|
||||
*
|
||||
* The PhoneStateListener is not tied to any subscription and unregistered for any update.
|
||||
*/
|
||||
public static final int LISTEN_NONE = 0;
|
||||
|
||||
@@ -433,7 +435,13 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when device service state changes.
|
||||
* Callback invoked when device service state changes on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* @see ServiceState#STATE_EMERGENCY_ONLY
|
||||
* @see ServiceState#STATE_IN_SERVICE
|
||||
@@ -445,7 +453,13 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when network signal strength changes.
|
||||
* Callback invoked when network signal strength changes on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* @see ServiceState#STATE_EMERGENCY_ONLY
|
||||
* @see ServiceState#STATE_IN_SERVICE
|
||||
@@ -459,21 +473,39 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when the message-waiting indicator changes.
|
||||
* Callback invoked when the message-waiting indicator changes on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*/
|
||||
public void onMessageWaitingIndicatorChanged(boolean mwi) {
|
||||
// default implementation empty
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when the call-forwarding indicator changes.
|
||||
* Callback invoked when the call-forwarding indicator changes on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*/
|
||||
public void onCallForwardingIndicatorChanged(boolean cfi) {
|
||||
// default implementation empty
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when device cell location changes.
|
||||
* Callback invoked when device cell location changes on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*/
|
||||
public void onCellLocationChanged(CellLocation location) {
|
||||
// default implementation empty
|
||||
@@ -482,7 +514,14 @@ public class PhoneStateListener {
|
||||
/**
|
||||
* Callback invoked when device call state changes.
|
||||
* <p>
|
||||
* Reports the state of Telephony (mobile) calls on the device.
|
||||
* Reports the state of Telephony (mobile) calls on the device for the registered subscription.
|
||||
* <p>
|
||||
* Note: the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
* <p>
|
||||
* Note: The state returned here may differ from that returned by
|
||||
* {@link TelephonyManager#getCallState()}. Receivers of this callback should be aware that
|
||||
@@ -500,7 +539,13 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when connection state changes.
|
||||
* Callback invoked when connection state changes on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* @see TelephonyManager#DATA_DISCONNECTED
|
||||
* @see TelephonyManager#DATA_CONNECTING
|
||||
@@ -518,7 +563,13 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when data activity state changes.
|
||||
* Callback invoked when data activity state changes on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* @see TelephonyManager#DATA_ACTIVITY_NONE
|
||||
* @see TelephonyManager#DATA_ACTIVITY_IN
|
||||
@@ -531,12 +582,13 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when network signal strengths changes.
|
||||
*
|
||||
* @see ServiceState#STATE_EMERGENCY_ONLY
|
||||
* @see ServiceState#STATE_IN_SERVICE
|
||||
* @see ServiceState#STATE_OUT_OF_SERVICE
|
||||
* @see ServiceState#STATE_POWER_OFF
|
||||
* Callback invoked when network signal strengths changes on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*/
|
||||
public void onSignalStrengthsChanged(SignalStrength signalStrength) {
|
||||
// default implementation empty
|
||||
@@ -544,8 +596,15 @@ public class PhoneStateListener {
|
||||
|
||||
|
||||
/**
|
||||
* The Over The Air Service Provisioning (OTASP) has changed. Requires
|
||||
* the READ_PHONE_STATE permission.
|
||||
* The Over The Air Service Provisioning (OTASP) has changed on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* Requires the READ_PHONE_STATE permission.
|
||||
* @param otaspMode is integer <code>OTASP_UNKNOWN=1<code>
|
||||
* means the value is currently unknown and the system should wait until
|
||||
* <code>OTASP_NEEDED=2<code> or <code>OTASP_NOT_NEEDED=3<code> is received before
|
||||
@@ -559,15 +618,28 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when a observed cell info has changed,
|
||||
* or new cells have been added or removed.
|
||||
* Callback invoked when a observed cell info has changed or new cells have been added
|
||||
* or removed on the registered subscription.
|
||||
* Note, the registration subId s from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* @param cellInfo is the list of currently visible cells.
|
||||
*/
|
||||
public void onCellInfoChanged(List<CellInfo> cellInfo) {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when precise device call state changes.
|
||||
* Callback invoked when precise device call state changes on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
* @param callState {@link PreciseCallState}
|
||||
* @hide
|
||||
*/
|
||||
@@ -578,7 +650,14 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when call disconnect cause changes.
|
||||
* Callback invoked when call disconnect cause changes on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* @param disconnectCause {@link DisconnectCause}.
|
||||
* @param preciseDisconnectCause {@link PreciseDisconnectCause}.
|
||||
*
|
||||
@@ -591,7 +670,14 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when Ims call disconnect cause changes.
|
||||
* Callback invoked when Ims call disconnect cause changes on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* @param imsReasonInfo {@link ImsReasonInfo} contains details on why IMS call failed.
|
||||
*
|
||||
* @hide
|
||||
@@ -603,7 +689,15 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when data connection state changes with precise information.
|
||||
* Callback invoked when data connection state changes with precise information
|
||||
* on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* @param dataConnectionState {@link PreciseDataConnectionState}
|
||||
*
|
||||
* @hide
|
||||
@@ -616,7 +710,13 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when data connection state changes with precise information.
|
||||
* Callback invoked when data connection real time info changes on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@@ -628,7 +728,15 @@ public class PhoneStateListener {
|
||||
|
||||
/**
|
||||
* Callback invoked when there has been a change in the Single Radio Voice Call Continuity
|
||||
* (SRVCC) state for the currently active call.
|
||||
* (SRVCC) state for the currently active call on the registered subscription.
|
||||
*
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
@@ -637,7 +745,15 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when the SIM voice activation state has changed
|
||||
* Callback invoked when the SIM voice activation state has changed on the registered
|
||||
* subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* @param state is the current SIM voice activation state
|
||||
* @hide
|
||||
*/
|
||||
@@ -646,7 +762,15 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when the SIM data activation state has changed
|
||||
* Callback invoked when the SIM data activation state has changed on the registered
|
||||
* subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* @param state is the current SIM data activation state
|
||||
* @hide
|
||||
*/
|
||||
@@ -654,7 +778,14 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when the user mobile data state has changed
|
||||
* Callback invoked when the user mobile data state has changed on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* @param enabled indicates whether the current user mobile data state is enabled or disabled.
|
||||
*/
|
||||
public void onUserMobileDataStateChanged(boolean enabled) {
|
||||
@@ -662,7 +793,14 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when the current physical channel configuration has changed
|
||||
* Callback invoked when the current physical channel configuration has changed on the
|
||||
* registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* @param configs List of the current {@link PhysicalChannelConfig}s
|
||||
* @hide
|
||||
@@ -673,7 +811,14 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when the current emergency number list has changed
|
||||
* Callback invoked when the current emergency number list has changed on the registered
|
||||
* subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* @param emergencyNumberList Map including the key as the active subscription ID
|
||||
* (Note: if there is no active subscription, the key is
|
||||
@@ -688,8 +833,15 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when OEM hook raw event is received. Requires
|
||||
* the READ_PRIVILEGED_PHONE_STATE permission.
|
||||
* Callback invoked when OEM hook raw event is received on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* Requires the READ_PRIVILEGED_PHONE_STATE permission.
|
||||
* @param rawData is the byte array of the OEM hook raw data.
|
||||
* @hide
|
||||
*/
|
||||
@@ -699,8 +851,10 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when phone capability changes. Requires
|
||||
* the READ_PRIVILEGED_PHONE_STATE permission.
|
||||
* Callback invoked when phone capability changes.
|
||||
* Note, this callback triggers regardless of registered subscription.
|
||||
*
|
||||
* Requires the READ_PRIVILEGED_PHONE_STATE permission.
|
||||
* @param capability the new phone capability
|
||||
* @hide
|
||||
*/
|
||||
@@ -709,8 +863,10 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when active data subId changes. Requires
|
||||
* the READ_PHONE_STATE permission.
|
||||
* Callback invoked when active data subId changes.
|
||||
* Note, this callback triggers regardless of registered subscription.
|
||||
*
|
||||
* Requires the READ_PHONE_STATE permission.
|
||||
* @param subId current subscription used to setup Cellular Internet data.
|
||||
* For example, it could be the current active opportunistic subscription in use,
|
||||
* or the subscription user selected as default data subscription in DSDS mode.
|
||||
@@ -720,8 +876,15 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when the call attributes changes. Requires
|
||||
* the READ_PRIVILEGED_PHONE_STATE permission.
|
||||
* Callback invoked when the call attributes changes on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* Requires the READ_PRIVILEGED_PHONE_STATE permission.
|
||||
* @param callAttributes the call attributes
|
||||
* @hide
|
||||
*/
|
||||
@@ -731,7 +894,15 @@ public class PhoneStateListener {
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when modem radio power state changes. Requires
|
||||
* Callback invoked when modem radio power state changes on the registered subscription.
|
||||
* Note, the registration subId comes from {@link TelephonyManager} object which registers
|
||||
* PhoneStateListener by {@link TelephonyManager#listen(PhoneStateListener, int)}.
|
||||
* If this TelephonyManager object was created with
|
||||
* {@link TelephonyManager#createForSubscriptionId(int)}, then the callback applies to the
|
||||
* subId. Otherwise, this callback applies to
|
||||
* {@link SubscriptionManager#getDefaultSubscriptionId()}.
|
||||
*
|
||||
* Requires
|
||||
* the READ_PRIVILEGED_PHONE_STATE permission.
|
||||
* @param state the modem radio power state
|
||||
* @hide
|
||||
@@ -747,6 +918,10 @@ public class PhoneStateListener {
|
||||
* has been requested by an app using
|
||||
* {@link android.telephony.TelephonyManager#notifyCarrierNetworkChange(boolean)}
|
||||
*
|
||||
* Note, this callback is pinned to the registered subscription and will be invoked when
|
||||
* the notifying carrier app has carrier privilege rule on the registered
|
||||
* subscription. {@link android.telephony.TelephonyManager#hasCarrierPrivileges}
|
||||
*
|
||||
* @param active Whether the carrier network change is or shortly
|
||||
* will be active. This value is true to indicate
|
||||
* showing alternative UI and false to stop.
|
||||
|
||||
@@ -56,38 +56,41 @@ interface ITelephonyRegistry {
|
||||
void notifyDataConnection(int state, boolean isDataConnectivityPossible,
|
||||
String apn, String apnType, in LinkProperties linkProperties,
|
||||
in NetworkCapabilities networkCapabilities, int networkType, boolean roaming);
|
||||
void notifyDataConnectionForSubscriber(int subId, int state, boolean isDataConnectivityPossible,
|
||||
void notifyDataConnectionForSubscriber(int phoneId, int subId, int state,
|
||||
boolean isDataConnectivityPossible,
|
||||
String apn, String apnType, in LinkProperties linkProperties,
|
||||
in NetworkCapabilities networkCapabilities, int networkType, boolean roaming);
|
||||
@UnsupportedAppUsage
|
||||
void notifyDataConnectionFailed(String apnType);
|
||||
void notifyDataConnectionFailedForSubscriber(int subId, String apnType);
|
||||
void notifyDataConnectionFailedForSubscriber(int phoneId, int subId, String apnType);
|
||||
void notifyCellLocation(in Bundle cellLocation);
|
||||
void notifyCellLocationForSubscriber(in int subId, in Bundle cellLocation);
|
||||
void notifyOtaspChanged(in int otaspMode);
|
||||
void notifyOtaspChanged(in int subId, in int otaspMode);
|
||||
@UnsupportedAppUsage
|
||||
void notifyCellInfo(in List<CellInfo> cellInfo);
|
||||
void notifyPhysicalChannelConfiguration(in List<PhysicalChannelConfig> configs);
|
||||
void notifyPhysicalChannelConfigurationForSubscriber(in int subId,
|
||||
in List<PhysicalChannelConfig> configs);
|
||||
void notifyPreciseCallState(int ringingCallState, int foregroundCallState,
|
||||
int backgroundCallState, int phoneId);
|
||||
void notifyDisconnectCause(int disconnectCause, int preciseDisconnectCause);
|
||||
void notifyPreciseDataConnectionFailed(String apnType, String apn,
|
||||
void notifyPreciseCallState(int phoneId, int subId, int ringingCallState,
|
||||
int foregroundCallState, int backgroundCallState);
|
||||
void notifyDisconnectCause(int phoneId, int subId, int disconnectCause,
|
||||
int preciseDisconnectCause);
|
||||
void notifyPreciseDataConnectionFailed(int phoneId, int subId, String apnType, String apn,
|
||||
int failCause);
|
||||
void notifyCellInfoForSubscriber(in int subId, in List<CellInfo> cellInfo);
|
||||
void notifySrvccStateChanged(in int subId, in int lteState);
|
||||
void notifySimActivationStateChangedForPhoneId(in int phoneId, in int subId,
|
||||
int activationState, int activationType);
|
||||
void notifyOemHookRawEventForSubscriber(in int subId, in byte[] rawData);
|
||||
void notifyOemHookRawEventForSubscriber(in int phoneId, in int subId, in byte[] rawData);
|
||||
void notifySubscriptionInfoChanged();
|
||||
void notifyOpportunisticSubscriptionInfoChanged();
|
||||
void notifyCarrierNetworkChange(in boolean active);
|
||||
void notifyUserMobileDataStateChangedForPhoneId(in int phoneId, in int subId, in boolean state);
|
||||
void notifyPhoneCapabilityChanged(in PhoneCapability capability);
|
||||
void notifyActiveDataSubIdChanged(int activeDataSubId);
|
||||
void notifyRadioPowerStateChanged(in int state);
|
||||
void notifyEmergencyNumberList();
|
||||
void notifyCallQualityChanged(in CallQuality callQuality, int phoneId, int callNetworkType);
|
||||
void notifyRadioPowerStateChanged(in int phoneId, in int subId, in int state);
|
||||
void notifyEmergencyNumberList(in int phoneId, in int subId);
|
||||
void notifyCallQualityChanged(in CallQuality callQuality, int phoneId, int subId,
|
||||
int callNetworkType);
|
||||
void notifyImsDisconnectCause(int subId, in ImsReasonInfo imsReasonInfo);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user