Merge "setCellInfoListRate on specific sub"
diff --git a/src/com/android/phone/PhoneInterfaceManager.java b/src/com/android/phone/PhoneInterfaceManager.java
index 0ab3fad..06564cd 100755
--- a/src/com/android/phone/PhoneInterfaceManager.java
+++ b/src/com/android/phone/PhoneInterfaceManager.java
@@ -3367,13 +3367,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 d4367ca..288d543 100644
--- a/src/com/android/phone/settings/RadioInfo.java
+++ b/src/com/android/phone/settings/RadioInfo.java
@@ -410,7 +410,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);
@@ -675,7 +675,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);
@@ -720,7 +721,7 @@
log("onPause: unregister phone & data intents");
mTelephonyManager.unregisterTelephonyCallback(mTelephonyCallback);
- mTelephonyManager.setCellInfoListRate(sCellInfoListRateDisabled);
+ mTelephonyManager.setCellInfoListRate(sCellInfoListRateDisabled, mPhone.getSubId());
mConnectivityManager.unregisterNetworkCallback(mNetworkCallback);
}
@@ -1880,7 +1881,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();
}