[Provider Model] Fix preference summary not update.
- When activity enter onPause, the status will not update, then sub id of TelephonyManager keep same value after activity go back. - Solution: Everytime update the UI, and always get new TelephonyManager with the latest sub id. Bug: 181196545 Test: atest passed. Test: Manual test passed. Change-Id: I1d65bbc06af66b97b6c85f40bed394da03213d06
This commit is contained in:
@@ -257,9 +257,10 @@ public class SubscriptionsPreferenceController extends AbstractPreferenceControl
|
||||
}
|
||||
|
||||
private CharSequence getMobilePreferenceSummary(int subId) {
|
||||
TelephonyManager tm = mTelephonyManager.createForSubscriptionId(subId);
|
||||
String result = mSubsPrefCtrlInjector.getNetworkType(
|
||||
mContext, mConfig, mTelephonyDisplayInfo, subId);
|
||||
if (!mTelephonyManager.isDataEnabled()) {
|
||||
if (!tm.isDataEnabled()) {
|
||||
return mContext.getString(R.string.mobile_data_off_summary);
|
||||
}
|
||||
if (!result.isEmpty() && mSubsPrefCtrlInjector.isActiveCellularNetwork(mContext)) {
|
||||
|
Reference in New Issue
Block a user