setCellInfoListRate on specific sub
Bug: 242144387
test: CtsTelephonyTestCases, Sanity Check
Change-Id: I60aba9c2e7de1b3a9f37a616642be7406361c318
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 4122dfe..0750c34 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -3278,13 +3278,18 @@
}
@Override
- public void setCellInfoListRate(int rateInMillis) {
+ public void setCellInfoListRate(int rateInMillis, int subId) {
enforceModifyPermission();
WorkSource workSource = getWorkSource(Binder.getCallingUid());
final long identity = Binder.clearCallingIdentity();
try {
- getDefaultPhone().setCellInfoListRate(rateInMillis, workSource);
+ Phone phone = getPhone(subId);
+ if (phone == null) {
+ getDefaultPhone().setCellInfoListRate(rateInMillis, workSource);
+ } else {
+ phone.setCellInfoListRate(rateInMillis, workSource);
+ }
} finally {
Binder.restoreCallingIdentity(identity);
}
diff --git a/src/com/android/phone/settings/RadioInfo.java b/src/com/android/phone/settings/RadioInfo.java
index 2058d2d..75a8bc5 100644
--- a/src/com/android/phone/settings/RadioInfo.java
+++ b/src/com/android/phone/settings/RadioInfo.java
@@ -417,7 +417,7 @@
private void updatePhoneIndex(int phoneIndex, int subId) {
// unregister listeners on the old subId
unregisterPhoneStateListener();
- mTelephonyManager.setCellInfoListRate(sCellInfoListRateDisabled);
+ mTelephonyManager.setCellInfoListRate(sCellInfoListRateDisabled, mPhone.getSubId());
// update the subId
mTelephonyManager = mTelephonyManager.createForSubscriptionId(subId);
@@ -680,7 +680,8 @@
//set selection after registering listener to force update
mCellInfoRefreshRateSpinner.setSelection(mCellInfoRefreshRateIndex);
// Request cell information update from RIL.
- mTelephonyManager.setCellInfoListRate(CELL_INFO_REFRESH_RATES[mCellInfoRefreshRateIndex]);
+ mTelephonyManager.setCellInfoListRate(CELL_INFO_REFRESH_RATES[mCellInfoRefreshRateIndex],
+ mPhone.getSubId());
//set selection before registering to prevent update
mPreferredNetworkType.setSelection(mPreferredNetworkTypeResult, true);
@@ -725,7 +726,7 @@
log("onPause: unregister phone & data intents");
mTelephonyManager.unregisterTelephonyCallback(mTelephonyCallback);
- mTelephonyManager.setCellInfoListRate(sCellInfoListRateDisabled);
+ mTelephonyManager.setCellInfoListRate(sCellInfoListRateDisabled, mPhone.getSubId());
mConnectivityManager.unregisterNetworkCallback(mNetworkCallback);
}
@@ -1795,7 +1796,7 @@
public void onItemSelected(AdapterView parent, View v, int pos, long id) {
mCellInfoRefreshRateIndex = pos;
- mTelephonyManager.setCellInfoListRate(CELL_INFO_REFRESH_RATES[pos]);
+ mTelephonyManager.setCellInfoListRate(CELL_INFO_REFRESH_RATES[pos], mPhone.getSubId());
updateAllCellInfo();
}