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

Commit 7e530dda authored by Bonian Chen's avatar Bonian Chen
Browse files

[Settings] Data warning & limit UI should be configuable when running out of limit

Should access API which is irrelated to status of data limit.
Changing from API isDataEnabledForApn(ApnSetting.TYPE_DEFAULT)
into isDataEnabledForReason(TelephonyManager.DATA_ENABLED_REASON_USER).

Bug: 223361190
Change-Id: Iada89de38e9db3706a944c7a5b5f8a3e87d415e5
Test: Manual
parent 563e0e0a
Loading
Loading
Loading
Loading
+2 −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.TelephonyManager;
import android.telephony.data.ApnSetting;
import android.util.AttributeSet;

@@ -78,7 +79,7 @@ public class BillingCyclePreference extends Preference
        try {
            setEnabled(mServices.mNetworkService.isBandwidthControlEnabled()
                    && mServices.mTelephonyManager.createForSubscriptionId(mSubId)
                            .isDataEnabledForApn(ApnSetting.TYPE_DEFAULT)
                            .isDataEnabledForReason(TelephonyManager.DATA_ENABLED_REASON_USER)
                    && mServices.mUserManager.isAdminUser());
        } catch (RemoteException e) {
            setEnabled(false);