[Settings] Support of DSDS API
Replacing getDataEnabled() by isDataEnabledForApn(). Bug: 143996139 Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=BillingCycleSettingsTest Change-Id: If36cfcd7c6b44fb89957ebf9f741936041761d9c
This commit is contained in:
@@ -20,6 +20,7 @@ import android.content.Intent;
|
||||
import android.net.NetworkTemplate;
|
||||
import android.os.Bundle;
|
||||
import android.os.RemoteException;
|
||||
import android.telephony.data.ApnSetting;
|
||||
import android.util.AttributeSet;
|
||||
|
||||
import androidx.preference.Preference;
|
||||
@@ -76,7 +77,8 @@ public class BillingCyclePreference extends Preference
|
||||
private void updateEnabled() {
|
||||
try {
|
||||
setEnabled(mServices.mNetworkService.isBandwidthControlEnabled()
|
||||
&& mServices.mTelephonyManager.getDataEnabled(mSubId)
|
||||
&& mServices.mTelephonyManager.createForSubscriptionId(mSubId)
|
||||
.isDataEnabledForApn(ApnSetting.TYPE_DEFAULT)
|
||||
&& mServices.mUserManager.isAdminUser());
|
||||
} catch (RemoteException e) {
|
||||
setEnabled(false);
|
||||
|
Reference in New Issue
Block a user