[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
This commit is contained in:
@@ -20,6 +20,7 @@ import android.content.Intent;
|
|||||||
import android.net.NetworkTemplate;
|
import android.net.NetworkTemplate;
|
||||||
import android.os.Bundle;
|
import android.os.Bundle;
|
||||||
import android.os.RemoteException;
|
import android.os.RemoteException;
|
||||||
|
import android.telephony.TelephonyManager;
|
||||||
import android.telephony.data.ApnSetting;
|
import android.telephony.data.ApnSetting;
|
||||||
import android.util.AttributeSet;
|
import android.util.AttributeSet;
|
||||||
|
|
||||||
@@ -78,7 +79,7 @@ public class BillingCyclePreference extends Preference
|
|||||||
try {
|
try {
|
||||||
setEnabled(mServices.mNetworkService.isBandwidthControlEnabled()
|
setEnabled(mServices.mNetworkService.isBandwidthControlEnabled()
|
||||||
&& mServices.mTelephonyManager.createForSubscriptionId(mSubId)
|
&& mServices.mTelephonyManager.createForSubscriptionId(mSubId)
|
||||||
.isDataEnabledForApn(ApnSetting.TYPE_DEFAULT)
|
.isDataEnabledForReason(TelephonyManager.DATA_ENABLED_REASON_USER)
|
||||||
&& mServices.mUserManager.isAdminUser());
|
&& mServices.mUserManager.isAdminUser());
|
||||||
} catch (RemoteException e) {
|
} catch (RemoteException e) {
|
||||||
setEnabled(false);
|
setEnabled(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user