Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileDataController.java +10 −4 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ import android.net.NetworkStatsHistory; import android.net.NetworkTemplate; import android.os.RemoteException; import android.os.ServiceManager; import android.provider.Settings; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.text.format.DateUtils; import android.text.format.Time; Loading Loading @@ -189,7 +191,8 @@ public class MobileDataController { } public void setMobileDataEnabled(boolean enabled) { mTelephonyManager.setDataEnabled(enabled); mTelephonyManager.setDataEnabledUsingSubId( SubscriptionManager.getDefaultDataSubId(), enabled); if (mCallback != null) { mCallback.onMobileDataEnabled(enabled); } Loading @@ -198,16 +201,19 @@ public class MobileDataController { public boolean isMobileDataSupported() { // require both supported network and ready SIM return mConnectivityManager.isNetworkSupported(TYPE_MOBILE) && mTelephonyManager.getSimState() == SIM_STATE_READY; && mTelephonyManager.getSimState( SubscriptionManager.getDefaultDataPhoneId()) == SIM_STATE_READY; } public boolean isMobileDataEnabled() { return mTelephonyManager.getDataEnabled(); return Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.MOBILE_DATA + SubscriptionManager.getDefaultDataPhoneId(), 0) != 0; } private static String getActiveSubscriberId(Context context) { final TelephonyManager tele = TelephonyManager.from(context); final String actualSubscriberId = tele.getSubscriberId(); final String actualSubscriberId = tele.getSubscriberId(SubscriptionManager.getDefaultDataSubId()); return actualSubscriberId; } Loading Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileDataController.java +10 −4 Original line number Diff line number Diff line Loading @@ -33,6 +33,8 @@ import android.net.NetworkStatsHistory; import android.net.NetworkTemplate; import android.os.RemoteException; import android.os.ServiceManager; import android.provider.Settings; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.text.format.DateUtils; import android.text.format.Time; Loading Loading @@ -189,7 +191,8 @@ public class MobileDataController { } public void setMobileDataEnabled(boolean enabled) { mTelephonyManager.setDataEnabled(enabled); mTelephonyManager.setDataEnabledUsingSubId( SubscriptionManager.getDefaultDataSubId(), enabled); if (mCallback != null) { mCallback.onMobileDataEnabled(enabled); } Loading @@ -198,16 +201,19 @@ public class MobileDataController { public boolean isMobileDataSupported() { // require both supported network and ready SIM return mConnectivityManager.isNetworkSupported(TYPE_MOBILE) && mTelephonyManager.getSimState() == SIM_STATE_READY; && mTelephonyManager.getSimState( SubscriptionManager.getDefaultDataPhoneId()) == SIM_STATE_READY; } public boolean isMobileDataEnabled() { return mTelephonyManager.getDataEnabled(); return Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.MOBILE_DATA + SubscriptionManager.getDefaultDataPhoneId(), 0) != 0; } private static String getActiveSubscriberId(Context context) { final TelephonyManager tele = TelephonyManager.from(context); final String actualSubscriberId = tele.getSubscriberId(); final String actualSubscriberId = tele.getSubscriberId(SubscriptionManager.getDefaultDataSubId()); return actualSubscriberId; } Loading