[Settings] Apply proxy design to data usage
Enable proxy to subscription manager in data usage UI. Bug: 141833767 Test: manual make RunSettingsRoboTests -j ROBOTEST_FILTER=BillingCyclePreferenceTest make RunSettingsRoboTests -j ROBOTEST_FILTER=CellDataPreferenceTest make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageListTest make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageSummaryTest make RunSettingsRoboTests -j ROBOTEST_FILTER=DataUsageUtilsTest make RunSettingsRoboTests -j ROBOTEST_FILTER=MobileDataEnabledListenerTest Change-Id: Id119738dc16ece8767c088b9a0794997e4b0334f
This commit is contained in:
@@ -26,27 +26,39 @@ import androidx.preference.Preference;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.SubSettingLauncher;
|
||||
import com.android.settings.datausage.CellDataPreference.DataStateListener;
|
||||
import com.android.settings.network.MobileDataEnabledListener;
|
||||
|
||||
public class BillingCyclePreference extends Preference implements TemplatePreference {
|
||||
/**
|
||||
* Preference which displays billing cycle of subscription
|
||||
*/
|
||||
public class BillingCyclePreference extends Preference
|
||||
implements TemplatePreference, MobileDataEnabledListener.Client {
|
||||
|
||||
private NetworkTemplate mTemplate;
|
||||
private NetworkServices mServices;
|
||||
private int mSubId;
|
||||
private MobileDataEnabledListener mListener;
|
||||
|
||||
/**
|
||||
* Preference constructor
|
||||
*
|
||||
* @param context Context of preference
|
||||
* @param arrts The attributes of the XML tag that is inflating the preference
|
||||
*/
|
||||
public BillingCyclePreference(Context context, AttributeSet attrs) {
|
||||
super(context, attrs);
|
||||
mListener = new MobileDataEnabledListener(context, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onAttached() {
|
||||
super.onAttached();
|
||||
mListener.setListener(true, mSubId, getContext());
|
||||
mListener.start(mSubId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetached() {
|
||||
mListener.setListener(false, mSubId, getContext());
|
||||
mListener.stop();
|
||||
super.onDetached();
|
||||
}
|
||||
|
||||
@@ -73,7 +85,7 @@ public class BillingCyclePreference extends Preference implements TemplatePrefer
|
||||
|
||||
@Override
|
||||
public Intent getIntent() {
|
||||
Bundle args = new Bundle();
|
||||
final Bundle args = new Bundle();
|
||||
args.putParcelable(DataUsageList.EXTRA_NETWORK_TEMPLATE, mTemplate);
|
||||
return new SubSettingLauncher(getContext())
|
||||
.setDestination(BillingCycleSettings.class.getName())
|
||||
@@ -83,10 +95,10 @@ public class BillingCyclePreference extends Preference implements TemplatePrefer
|
||||
.toIntent();
|
||||
}
|
||||
|
||||
private final DataStateListener mListener = new DataStateListener() {
|
||||
@Override
|
||||
public void onChange(boolean selfChange) {
|
||||
updateEnabled();
|
||||
}
|
||||
};
|
||||
/**
|
||||
* Implementation of MobileDataEnabledListener.Client
|
||||
*/
|
||||
public void onMobileDataEnabledChange() {
|
||||
updateEnabled();
|
||||
}
|
||||
}
|
||||
|
@@ -17,14 +17,9 @@ package com.android.settings.datausage;
|
||||
import android.app.settings.SettingsEnums;
|
||||
import android.content.Context;
|
||||
import android.content.DialogInterface;
|
||||
import android.database.ContentObserver;
|
||||
import android.net.NetworkTemplate;
|
||||
import android.net.Uri;
|
||||
import android.os.Handler;
|
||||
import android.os.Looper;
|
||||
import android.os.Parcel;
|
||||
import android.os.Parcelable;
|
||||
import android.provider.Settings.Global;
|
||||
import android.telephony.SubscriptionInfo;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
@@ -39,33 +34,38 @@ import androidx.core.content.res.TypedArrayUtils;
|
||||
import androidx.preference.PreferenceViewHolder;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.network.MobileDataEnabledListener;
|
||||
import com.android.settings.network.ProxySubscriptionManager;
|
||||
import com.android.settings.overlay.FeatureFactory;
|
||||
import com.android.settingslib.CustomDialogPreferenceCompat;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class CellDataPreference extends CustomDialogPreferenceCompat implements TemplatePreference {
|
||||
/**
|
||||
* Preference of cellular data control within Data Usage
|
||||
*/
|
||||
public class CellDataPreference extends CustomDialogPreferenceCompat
|
||||
implements TemplatePreference, MobileDataEnabledListener.Client {
|
||||
|
||||
private static final String TAG = "CellDataPreference";
|
||||
|
||||
public int mSubId = SubscriptionManager.INVALID_SUBSCRIPTION_ID;
|
||||
public boolean mChecked;
|
||||
public boolean mMultiSimDialog;
|
||||
private TelephonyManager mTelephonyManager;
|
||||
@VisibleForTesting
|
||||
SubscriptionManager mSubscriptionManager;
|
||||
ProxySubscriptionManager mProxySubscriptionMgr;
|
||||
private MobileDataEnabledListener mDataStateListener;
|
||||
|
||||
public CellDataPreference(Context context, AttributeSet attrs) {
|
||||
super(context, attrs, TypedArrayUtils.getAttr(context,
|
||||
androidx.preference.R.attr.switchPreferenceStyle,
|
||||
android.R.attr.switchPreferenceStyle));
|
||||
mProxySubscriptionMgr = ProxySubscriptionManager.getInstance(context);
|
||||
mDataStateListener = new MobileDataEnabledListener(context, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onRestoreInstanceState(Parcelable s) {
|
||||
CellDataState state = (CellDataState) s;
|
||||
final CellDataState state = (CellDataState) s;
|
||||
super.onRestoreInstanceState(state.getSuperState());
|
||||
mTelephonyManager = TelephonyManager.from(getContext());
|
||||
mChecked = state.mChecked;
|
||||
mMultiSimDialog = state.mMultiSimDialog;
|
||||
if (mSubId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||
@@ -77,7 +77,7 @@ public class CellDataPreference extends CustomDialogPreferenceCompat implements
|
||||
|
||||
@Override
|
||||
protected Parcelable onSaveInstanceState() {
|
||||
CellDataState state = new CellDataState(super.onSaveInstanceState());
|
||||
final CellDataState state = new CellDataState(super.onSaveInstanceState());
|
||||
state.mChecked = mChecked;
|
||||
state.mMultiSimDialog = mMultiSimDialog;
|
||||
state.mSubId = mSubId;
|
||||
@@ -87,19 +87,14 @@ public class CellDataPreference extends CustomDialogPreferenceCompat implements
|
||||
@Override
|
||||
public void onAttached() {
|
||||
super.onAttached();
|
||||
mDataStateListener.setListener(true, mSubId, getContext());
|
||||
if (mSubscriptionManager!= null) {
|
||||
mSubscriptionManager.addOnSubscriptionsChangedListener(mOnSubscriptionsChangeListener);
|
||||
}
|
||||
mDataStateListener.start(mSubId);
|
||||
mProxySubscriptionMgr.addActiveSubscriptionsListener(mOnSubscriptionsChangeListener);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDetached() {
|
||||
mDataStateListener.setListener(false, mSubId, getContext());
|
||||
if (mSubscriptionManager!= null) {
|
||||
mSubscriptionManager.removeOnSubscriptionsChangedListener(
|
||||
mOnSubscriptionsChangeListener);
|
||||
}
|
||||
mDataStateListener.stop();
|
||||
mProxySubscriptionMgr.removeActiveSubscriptionsListener(mOnSubscriptionsChangeListener);
|
||||
super.onDetached();
|
||||
}
|
||||
|
||||
@@ -108,10 +103,9 @@ public class CellDataPreference extends CustomDialogPreferenceCompat implements
|
||||
if (subId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||
throw new IllegalArgumentException("CellDataPreference needs a SubscriptionInfo");
|
||||
}
|
||||
mSubscriptionManager = SubscriptionManager.from(getContext());
|
||||
mTelephonyManager = TelephonyManager.from(getContext());
|
||||
|
||||
mSubscriptionManager.addOnSubscriptionsChangedListener(mOnSubscriptionsChangeListener);
|
||||
mProxySubscriptionMgr = ProxySubscriptionManager.getInstance(getContext());
|
||||
mProxySubscriptionMgr.addActiveSubscriptionsListener(mOnSubscriptionsChangeListener);
|
||||
|
||||
if (mSubId == SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||
mSubId = subId;
|
||||
@@ -122,13 +116,13 @@ public class CellDataPreference extends CustomDialogPreferenceCompat implements
|
||||
}
|
||||
|
||||
private void updateChecked() {
|
||||
setChecked(mTelephonyManager.getDataEnabled(mSubId));
|
||||
setChecked(getContext().getSystemService(TelephonyManager.class).getDataEnabled(mSubId));
|
||||
}
|
||||
|
||||
private void updateEnabled() {
|
||||
// If this subscription is not active, for example, SIM card is taken out, we disable
|
||||
// the button.
|
||||
setEnabled(mSubscriptionManager.getActiveSubscriptionInfo(mSubId) != null);
|
||||
setEnabled(mProxySubscriptionMgr.getActiveSubscriptionInfo(mSubId) != null);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -136,9 +130,10 @@ public class CellDataPreference extends CustomDialogPreferenceCompat implements
|
||||
final Context context = getContext();
|
||||
FeatureFactory.getFactory(context).getMetricsFeatureProvider()
|
||||
.action(context, SettingsEnums.ACTION_CELL_DATA_TOGGLE, !mChecked);
|
||||
final SubscriptionInfo currentSir = mSubscriptionManager.getActiveSubscriptionInfo(
|
||||
final SubscriptionInfo currentSir = mProxySubscriptionMgr.getActiveSubscriptionInfo(
|
||||
mSubId);
|
||||
final SubscriptionInfo nextSir = mSubscriptionManager.getDefaultDataSubscriptionInfo();
|
||||
final SubscriptionInfo nextSir = mProxySubscriptionMgr.getActiveSubscriptionInfo(
|
||||
SubscriptionManager.getDefaultDataSubscriptionId());
|
||||
if (mChecked) {
|
||||
setMobileDataEnabled(false);
|
||||
if (nextSir != null && currentSir != null
|
||||
@@ -153,7 +148,7 @@ public class CellDataPreference extends CustomDialogPreferenceCompat implements
|
||||
private void setMobileDataEnabled(boolean enabled) {
|
||||
if (DataUsageSummary.LOGD) Log.d(TAG, "setMobileDataEnabled(" + enabled + ","
|
||||
+ mSubId + ")");
|
||||
mTelephonyManager.setDataEnabled(mSubId, enabled);
|
||||
getContext().getSystemService(TelephonyManager.class).setDataEnabled(mSubId, enabled);
|
||||
setChecked(enabled);
|
||||
}
|
||||
|
||||
@@ -166,7 +161,7 @@ public class CellDataPreference extends CustomDialogPreferenceCompat implements
|
||||
@Override
|
||||
public void onBindViewHolder(PreferenceViewHolder holder) {
|
||||
super.onBindViewHolder(holder);
|
||||
View switchView = holder.findViewById(android.R.id.switch_widget);
|
||||
final View switchView = holder.findViewById(android.R.id.switch_widget);
|
||||
switchView.setClickable(false);
|
||||
((Checkable) switchView).setChecked(mChecked);
|
||||
}
|
||||
@@ -191,8 +186,10 @@ public class CellDataPreference extends CustomDialogPreferenceCompat implements
|
||||
|
||||
private void showMultiSimDialog(Builder builder,
|
||||
DialogInterface.OnClickListener listener) {
|
||||
final SubscriptionInfo currentSir = mSubscriptionManager.getActiveSubscriptionInfo(mSubId);
|
||||
final SubscriptionInfo nextSir = mSubscriptionManager.getDefaultDataSubscriptionInfo();
|
||||
final SubscriptionInfo currentSir = mProxySubscriptionMgr.getActiveSubscriptionInfo(
|
||||
mSubId);
|
||||
final SubscriptionInfo nextSir = mProxySubscriptionMgr.getActiveSubscriptionInfo(
|
||||
SubscriptionManager.getDefaultDataSubscriptionId());
|
||||
|
||||
final String previousName = (nextSir == null)
|
||||
? getContext().getResources().getString(R.string.sim_selection_required_pref)
|
||||
@@ -208,14 +205,10 @@ public class CellDataPreference extends CustomDialogPreferenceCompat implements
|
||||
}
|
||||
|
||||
private void disableDataForOtherSubscriptions(int subId) {
|
||||
List<SubscriptionInfo> subInfoList = mSubscriptionManager
|
||||
.getActiveSubscriptionInfoList(true);
|
||||
if (subInfoList != null) {
|
||||
for (SubscriptionInfo subInfo : subInfoList) {
|
||||
if (subInfo.getSubscriptionId() != subId) {
|
||||
mTelephonyManager.setDataEnabled(subInfo.getSubscriptionId(), false);
|
||||
}
|
||||
}
|
||||
final SubscriptionInfo subInfo = mProxySubscriptionMgr.getActiveSubscriptionInfo(
|
||||
subId);
|
||||
if (subInfo != null) {
|
||||
getContext().getSystemService(TelephonyManager.class).setDataEnabled(subId, false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -225,7 +218,7 @@ public class CellDataPreference extends CustomDialogPreferenceCompat implements
|
||||
return;
|
||||
}
|
||||
if (mMultiSimDialog) {
|
||||
mSubscriptionManager.setDefaultDataSubId(mSubId);
|
||||
mProxySubscriptionMgr.get().setDefaultDataSubId(mSubId);
|
||||
setMobileDataEnabled(true);
|
||||
disableDataForOtherSubscriptions(mSubId);
|
||||
} else {
|
||||
@@ -235,40 +228,23 @@ public class CellDataPreference extends CustomDialogPreferenceCompat implements
|
||||
}
|
||||
|
||||
@VisibleForTesting
|
||||
final SubscriptionManager.OnSubscriptionsChangedListener mOnSubscriptionsChangeListener
|
||||
= new SubscriptionManager.OnSubscriptionsChangedListener() {
|
||||
@Override
|
||||
public void onSubscriptionsChanged() {
|
||||
if (DataUsageSummary.LOGD) {
|
||||
Log.d(TAG, "onSubscriptionsChanged");
|
||||
}
|
||||
updateEnabled();
|
||||
}
|
||||
};
|
||||
|
||||
private final DataStateListener mDataStateListener = new DataStateListener() {
|
||||
@Override
|
||||
public void onChange(boolean selfChange) {
|
||||
updateChecked();
|
||||
}
|
||||
};
|
||||
|
||||
public abstract static class DataStateListener extends ContentObserver {
|
||||
public DataStateListener() {
|
||||
super(new Handler(Looper.getMainLooper()));
|
||||
}
|
||||
|
||||
public void setListener(boolean listening, int subId, Context context) {
|
||||
if (listening) {
|
||||
Uri uri = Global.getUriFor(Global.MOBILE_DATA);
|
||||
if (TelephonyManager.getDefault().getSimCount() != 1) {
|
||||
uri = Global.getUriFor(Global.MOBILE_DATA + subId);
|
||||
final ProxySubscriptionManager.OnActiveSubscriptionChangedListener
|
||||
mOnSubscriptionsChangeListener =
|
||||
new ProxySubscriptionManager.OnActiveSubscriptionChangedListener() {
|
||||
public void onChanged() {
|
||||
if (DataUsageSummary.LOGD) {
|
||||
Log.d(TAG, "onSubscriptionsChanged");
|
||||
}
|
||||
updateEnabled();
|
||||
}
|
||||
context.getContentResolver().registerContentObserver(uri, false, this);
|
||||
} else {
|
||||
context.getContentResolver().unregisterContentObserver(this);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/**
|
||||
* Implementation of MobileDataEnabledListener.Client
|
||||
*/
|
||||
@VisibleForTesting
|
||||
public void onMobileDataEnabledChange() {
|
||||
updateChecked();
|
||||
}
|
||||
|
||||
public static class CellDataState extends BaseSavedState {
|
||||
|
@@ -39,7 +39,6 @@ import android.os.UserManager;
|
||||
import android.provider.Settings;
|
||||
import android.telephony.SubscriptionInfo;
|
||||
import android.telephony.SubscriptionManager;
|
||||
import android.telephony.TelephonyManager;
|
||||
import android.util.Log;
|
||||
import android.util.SparseArray;
|
||||
import android.view.View;
|
||||
@@ -57,6 +56,8 @@ import androidx.preference.PreferenceGroup;
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.core.SubSettingLauncher;
|
||||
import com.android.settings.datausage.CycleAdapter.SpinnerInterface;
|
||||
import com.android.settings.network.MobileDataEnabledListener;
|
||||
import com.android.settings.network.ProxySubscriptionManager;
|
||||
import com.android.settings.widget.LoadingViewController;
|
||||
import com.android.settingslib.AppItem;
|
||||
import com.android.settingslib.net.NetworkCycleChartData;
|
||||
@@ -72,7 +73,8 @@ import java.util.List;
|
||||
* Panel showing data usage history across various networks, including options
|
||||
* to inspect based on usage cycle and control through {@link NetworkPolicy}.
|
||||
*/
|
||||
public class DataUsageList extends DataUsageBaseFragment {
|
||||
public class DataUsageList extends DataUsageBaseFragment
|
||||
implements MobileDataEnabledListener.Client {
|
||||
|
||||
static final String EXTRA_SUB_ID = "sub_id";
|
||||
static final String EXTRA_NETWORK_TEMPLATE = "network_template";
|
||||
@@ -91,13 +93,8 @@ public class DataUsageList extends DataUsageBaseFragment {
|
||||
private static final int LOADER_CHART_DATA = 2;
|
||||
private static final int LOADER_SUMMARY = 3;
|
||||
|
||||
private final CellDataPreference.DataStateListener mDataStateListener =
|
||||
new CellDataPreference.DataStateListener() {
|
||||
@Override
|
||||
public void onChange(boolean selfChange) {
|
||||
updatePolicy();
|
||||
}
|
||||
};
|
||||
@VisibleForTesting
|
||||
MobileDataEnabledListener mDataStateListener;
|
||||
|
||||
@VisibleForTesting
|
||||
NetworkTemplate mTemplate;
|
||||
@@ -111,7 +108,6 @@ public class DataUsageList extends DataUsageBaseFragment {
|
||||
LoadingViewController mLoadingViewController;
|
||||
|
||||
private ChartDataUsagePreference mChart;
|
||||
private TelephonyManager mTelephonyManager;
|
||||
private List<NetworkCycleChartData> mCycleData;
|
||||
private ArrayList<Long> mCycles;
|
||||
private UidDetailProvider mUidDetailProvider;
|
||||
@@ -133,14 +129,15 @@ public class DataUsageList extends DataUsageBaseFragment {
|
||||
if (!isBandwidthControlEnabled()) {
|
||||
Log.w(TAG, "No bandwidth control; leaving");
|
||||
activity.finish();
|
||||
return;
|
||||
}
|
||||
|
||||
mUidDetailProvider = new UidDetailProvider(activity);
|
||||
mTelephonyManager = activity.getSystemService(TelephonyManager.class);
|
||||
mUsageAmount = findPreference(KEY_USAGE_AMOUNT);
|
||||
mChart = findPreference(KEY_CHART_DATA);
|
||||
mApps = findPreference(KEY_APPS_GROUP);
|
||||
processArgument();
|
||||
mDataStateListener = new MobileDataEnabledListener(activity, this);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -190,20 +187,21 @@ public class DataUsageList extends DataUsageBaseFragment {
|
||||
@Override
|
||||
public void onResume() {
|
||||
super.onResume();
|
||||
mDataStateListener.setListener(true, mSubId, getContext());
|
||||
mDataStateListener.start(mSubId);
|
||||
updateBody();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onPause() {
|
||||
super.onPause();
|
||||
mDataStateListener.setListener(false, mSubId, getContext());
|
||||
mDataStateListener.stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onDestroy() {
|
||||
mUidDetailProvider.clearCache();
|
||||
mUidDetailProvider = null;
|
||||
mDataStateListener.stop();
|
||||
|
||||
super.onDestroy();
|
||||
}
|
||||
@@ -233,6 +231,13 @@ public class DataUsageList extends DataUsageBaseFragment {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Implementation of MobileDataEnabledListener.Client
|
||||
*/
|
||||
public void onMobileDataEnabledChange() {
|
||||
updatePolicy();
|
||||
}
|
||||
|
||||
/**
|
||||
* Update body content based on current tab. Loads network cycle data from system, and
|
||||
* binds them to visible controls.
|
||||
@@ -253,7 +258,7 @@ public class DataUsageList extends DataUsageBaseFragment {
|
||||
|
||||
int seriesColor = context.getColor(R.color.sim_noitification);
|
||||
if (mSubId != SubscriptionManager.INVALID_SUBSCRIPTION_ID) {
|
||||
final SubscriptionInfo sir = services.mSubscriptionManager
|
||||
final SubscriptionInfo sir = ProxySubscriptionManager.getInstance(context)
|
||||
.getActiveSubscriptionInfo(mSubId);
|
||||
|
||||
if (sir != null) {
|
||||
@@ -400,7 +405,7 @@ public class DataUsageList extends DataUsageBaseFragment {
|
||||
Collections.sort(items);
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
final int percentTotal = largest != 0 ? (int) (items.get(i).total * 100 / largest) : 0;
|
||||
AppDataUsagePreference preference = new AppDataUsagePreference(getContext(),
|
||||
final AppDataUsagePreference preference = new AppDataUsagePreference(getContext(),
|
||||
items.get(i), percentTotal, mUidDetailProvider);
|
||||
preference.setOnPreferenceClickListener(new Preference.OnPreferenceClickListener() {
|
||||
@Override
|
||||
|
@@ -33,6 +33,7 @@ import androidx.preference.Preference;
|
||||
import androidx.preference.PreferenceScreen;
|
||||
|
||||
import com.android.settings.R;
|
||||
import com.android.settings.network.ProxySubscriptionManager;
|
||||
import com.android.settingslib.NetworkPolicyEditor;
|
||||
import com.android.settingslib.core.AbstractPreferenceController;
|
||||
|
||||
@@ -65,6 +66,7 @@ public class DataUsageSummary extends DataUsageBaseFragment implements DataUsage
|
||||
private DataUsageSummaryPreference mSummaryPreference;
|
||||
private DataUsageSummaryPreferenceController mSummaryController;
|
||||
private NetworkTemplate mDefaultTemplate;
|
||||
private ProxySubscriptionManager mProxySubscriptionMgr;
|
||||
|
||||
@Override
|
||||
public int getHelpResource() {
|
||||
@@ -76,6 +78,11 @@ public class DataUsageSummary extends DataUsageBaseFragment implements DataUsage
|
||||
super.onCreate(icicle);
|
||||
Context context = getContext();
|
||||
|
||||
// enable ProxySubscriptionMgr with Lifecycle support for all controllers
|
||||
// live within this fragment
|
||||
mProxySubscriptionMgr = ProxySubscriptionManager.getInstance(context);
|
||||
mProxySubscriptionMgr.setLifecycle(getLifecycle());
|
||||
|
||||
boolean hasMobileData = DataUsageUtils.hasMobileData(context);
|
||||
|
||||
final int defaultSubId = SubscriptionManager.getDefaultDataSubscriptionId();
|
||||
|
Reference in New Issue
Block a user