use of com.android.internal.telephony.Phone in project android_frameworks_opt_telephony by LineageOS.
the class VendorMultiSimSettingController method setUserDataEnabledForGroup.
/**
* Make sure MOBILE_DATA of subscriptions in the same group with the subId
* are synced.
*/
@Override
protected synchronized void setUserDataEnabledForGroup(int subId, boolean enable) {
log("setUserDataEnabledForGroup subId " + subId + " enable " + enable);
List<SubscriptionInfo> infoList = mSubController.getSubscriptionsInGroup(mSubController.getGroupUuid(subId), mContext.getOpPackageName(), null);
if (infoList == null)
return;
for (SubscriptionInfo info : infoList) {
int currentSubId = info.getSubscriptionId();
if (currentSubId == subId)
continue;
// TODO: simplify when setUserDataEnabled becomes singleton
if (mSubController.isActiveSubId(currentSubId)) {
// For active subscription, call setUserDataEnabled through DataEnabledSettings.
Phone phone = PhoneFactory.getPhone(mSubController.getPhoneId(currentSubId));
if (phone != null) {
phone.getDataEnabledSettings().setUserDataEnabled(enable);
}
} else {
// For inactive subscription, directly write into global settings.
GlobalSettingsHelper.setBoolean(mContext, Settings.Global.MOBILE_DATA, currentSubId, enable);
}
}
}
Aggregations