Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8f677012 authored by Bonian Chen's avatar Bonian Chen
Browse files

[Settings] Support of DSDS API

Replacing getDataEnabled() by isDataEnabledForApn().

Bug: 143996139
Test: make RunSettingsRoboTests -j ROBOTEST_FILTER=BillingCycleSettingsTest
Change-Id: If36cfcd7c6b44fb89957ebf9f741936041761d9c
parent 90cce123
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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);