Merge "Remove PhoneStateLister#onOtaspChanged"
am: 0d7a5dc2ea
Change-Id: Ide424903fac31549a660ded17d24c14fa4e5db5b
This commit is contained in:
@@ -168,14 +168,6 @@ public class PhoneStateListener {
|
||||
*/
|
||||
public static final int LISTEN_SIGNAL_STRENGTHS = 0x00000100;
|
||||
|
||||
/**
|
||||
* Listen for changes to OTASP mode.
|
||||
*
|
||||
* @see #onOtaspChanged
|
||||
* @hide
|
||||
*/
|
||||
public static final int LISTEN_OTASP_CHANGED = 0x00000200;
|
||||
|
||||
/**
|
||||
* Listen for changes to observed cell info.
|
||||
*
|
||||
@@ -624,29 +616,6 @@ public class PhoneStateListener {
|
||||
// default implementation empty
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 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
|
||||
* making the decision to perform OTASP or not.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
@UnsupportedAppUsage
|
||||
public void onOtaspChanged(int otaspMode) {
|
||||
// default implementation empty
|
||||
}
|
||||
|
||||
/**
|
||||
* Callback invoked when a observed cell info has changed or new cells have been added
|
||||
* or removed on the registered subscription.
|
||||
@@ -1065,14 +1034,6 @@ public class PhoneStateListener {
|
||||
() -> mExecutor.execute(() -> psl.onSignalStrengthsChanged(signalStrength)));
|
||||
}
|
||||
|
||||
public void onOtaspChanged(int otaspMode) {
|
||||
PhoneStateListener psl = mPhoneStateListenerWeakRef.get();
|
||||
if (psl == null) return;
|
||||
|
||||
Binder.withCleanCallingIdentity(
|
||||
() -> mExecutor.execute(() -> psl.onOtaspChanged(otaspMode)));
|
||||
}
|
||||
|
||||
public void onCellInfoChanged(List<CellInfo> cellInfo) {
|
||||
PhoneStateListener psl = mPhoneStateListenerWeakRef.get();
|
||||
if (psl == null) return;
|
||||
|
||||
@@ -607,22 +607,6 @@ public class TelephonyRegistryManager {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify over the air sim provisioning(OTASP) mode changed on certain subscription.
|
||||
*
|
||||
* @param subId for which otasp mode changed.
|
||||
* @param otaspMode latest mode for OTASP e.g, OTASP needed.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
public void notifyOtaspChanged(int subId, int otaspMode) {
|
||||
try {
|
||||
sRegistry.notifyOtaspChanged(subId, otaspMode);
|
||||
} catch (RemoteException ex) {
|
||||
// system process is dead
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Notify precise call state changed on certain subscription, including foreground, background
|
||||
* and ringcall states.
|
||||
|
||||
@@ -43,7 +43,6 @@ oneway interface IPhoneStateListener {
|
||||
void onDataConnectionStateChanged(int state, int networkType);
|
||||
void onDataActivity(int direction);
|
||||
void onSignalStrengthsChanged(in SignalStrength signalStrength);
|
||||
void onOtaspChanged(in int otaspMode);
|
||||
void onCellInfoChanged(in List<CellInfo> cellInfo);
|
||||
void onPreciseCallStateChanged(in PreciseCallState callState);
|
||||
void onPreciseDataConnectionStateChanged(in PreciseDataConnectionState dataConnectionState);
|
||||
|
||||
@@ -67,8 +67,6 @@ interface ITelephonyRegistry {
|
||||
@UnsupportedAppUsage(maxTargetSdk = 28)
|
||||
void notifyCellLocation(in Bundle cellLocation);
|
||||
void notifyCellLocationForSubscriber(in int subId, in Bundle cellLocation);
|
||||
@UnsupportedAppUsage(maxTargetSdk = 28)
|
||||
void notifyOtaspChanged(in int subId, in int otaspMode);
|
||||
@UnsupportedAppUsage
|
||||
void notifyCellInfo(in List<CellInfo> cellInfo);
|
||||
void notifyPreciseCallState(int phoneId, int subId, int ringingCallState,
|
||||
|
||||
@@ -208,8 +208,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
|
||||
private int[] mDataConnectionNetworkType;
|
||||
|
||||
private int[] mOtaspMode;
|
||||
|
||||
private ArrayList<List<CellInfo>> mCellInfo = null;
|
||||
|
||||
private Map<Integer, List<EmergencyNumber>> mEmergencyNumberList;
|
||||
@@ -403,7 +401,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
mCallForwarding = copyOf(mCallForwarding, mNumPhones);
|
||||
mCellLocation = copyOf(mCellLocation, mNumPhones);
|
||||
mSrvccState = copyOf(mSrvccState, mNumPhones);
|
||||
mOtaspMode = copyOf(mOtaspMode, mNumPhones);
|
||||
mPreciseCallState = copyOf(mPreciseCallState, mNumPhones);
|
||||
mForegroundCallState = copyOf(mForegroundCallState, mNumPhones);
|
||||
mBackgroundCallState = copyOf(mBackgroundCallState, mNumPhones);
|
||||
@@ -441,7 +438,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
mCellInfo.add(i, null);
|
||||
mImsReasonInfo.add(i, null);
|
||||
mSrvccState[i] = TelephonyManager.SRVCC_STATE_HANDOVER_NONE;
|
||||
mOtaspMode[i] = TelephonyManager.OTASP_UNKNOWN;
|
||||
mCallDisconnectCause[i] = DisconnectCause.NOT_VALID;
|
||||
mCallPreciseDisconnectCause[i] = PreciseDisconnectCause.NOT_VALID;
|
||||
mCallQuality[i] = createCallQuality();
|
||||
@@ -504,7 +500,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
mCallForwarding = new boolean[numPhones];
|
||||
mCellLocation = new Bundle[numPhones];
|
||||
mSrvccState = new int[numPhones];
|
||||
mOtaspMode = new int[numPhones];
|
||||
mPreciseCallState = new PreciseCallState[numPhones];
|
||||
mForegroundCallState = new int[numPhones];
|
||||
mBackgroundCallState = new int[numPhones];
|
||||
@@ -536,7 +531,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
mCellInfo.add(i, null);
|
||||
mImsReasonInfo.add(i, null);
|
||||
mSrvccState[i] = TelephonyManager.SRVCC_STATE_HANDOVER_NONE;
|
||||
mOtaspMode[i] = TelephonyManager.OTASP_UNKNOWN;
|
||||
mCallDisconnectCause[i] = DisconnectCause.NOT_VALID;
|
||||
mCallPreciseDisconnectCause[i] = PreciseDisconnectCause.NOT_VALID;
|
||||
mCallQuality[i] = createCallQuality();
|
||||
@@ -867,13 +861,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
remove(r.binder);
|
||||
}
|
||||
}
|
||||
if ((events & PhoneStateListener.LISTEN_OTASP_CHANGED) != 0) {
|
||||
try {
|
||||
r.callback.onOtaspChanged(mOtaspMode[phoneId]);
|
||||
} catch (RemoteException ex) {
|
||||
remove(r.binder);
|
||||
}
|
||||
}
|
||||
if (validateEventsAndUserLocked(r, PhoneStateListener.LISTEN_CELL_INFO)) {
|
||||
try {
|
||||
if (DBG_LOC) log("listen: mCellInfo[" + phoneId + "] = "
|
||||
@@ -1637,29 +1624,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyOtaspChanged(int subId, int otaspMode) {
|
||||
if (!checkNotifyPermission("notifyOtaspChanged()" )) {
|
||||
return;
|
||||
}
|
||||
int phoneId = SubscriptionManager.getPhoneId(subId);
|
||||
synchronized (mRecords) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
handleRemoveListLocked();
|
||||
}
|
||||
}
|
||||
|
||||
public void notifyPreciseCallState(int phoneId, int subId, int ringingCallState,
|
||||
int foregroundCallState, int backgroundCallState) {
|
||||
if (!checkNotifyPermission("notifyPreciseCallState()")) {
|
||||
@@ -2084,7 +2048,6 @@ public class TelephonyRegistry extends ITelephonyRegistry.Stub {
|
||||
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]);
|
||||
|
||||
Reference in New Issue
Block a user