Loading core/java/android/net/ConnectivityManager.java +8 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.os.Messenger; import android.os.RemoteException; import android.os.ServiceManager; import android.provider.Settings; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.util.ArrayMap; import android.util.Log; Loading Loading @@ -1295,9 +1296,15 @@ public class ConnectivityManager { if (b != null) { try { ITelephony it = ITelephony.Stub.asInterface(b); return it.getDataEnabled(); int subId = SubscriptionManager.getDefaultDataSubId(); Log.d("ConnectivityManager", "getMobileDataEnabled()+ subId=" + subId); boolean retVal = it.getDataEnabled(subId); Log.d("ConnectivityManager", "getMobileDataEnabled()- subId=" + subId + " retVal=" + retVal); return retVal; } catch (RemoteException e) { } } Log.d("ConnectivityManager", "getMobileDataEnabled()- remote exception retVal=false"); return false; } Loading packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileDataControllerImpl.java +1 −0 Original line number Diff line number Diff line Loading @@ -196,6 +196,7 @@ public class MobileDataControllerImpl implements NetworkController.MobileDataCon } public void setMobileDataEnabled(boolean enabled) { Log.d(TAG, "setMobileDataEnabled: enabled=" + enabled); mTelephonyManager.setDataEnabled(enabled); if (mCallback != null) { mCallback.onMobileDataEnabled(enabled); Loading telephony/java/android/telephony/TelephonyManager.java +19 −3 Original line number Diff line number Diff line Loading @@ -3509,8 +3509,15 @@ public class TelephonyManager { /** @hide */ @SystemApi public void setDataEnabled(boolean enable) { setDataEnabled(SubscriptionManager.getDefaultDataSubId(), enable); } /** @hide */ @SystemApi public void setDataEnabled(int subId, boolean enable) { try { getITelephony().setDataEnabled(enable); Log.d(TAG, "setDataEnabled: enabled=" + enable); getITelephony().setDataEnabled(subId, enable); } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#setDataEnabled", e); } Loading @@ -3519,12 +3526,21 @@ public class TelephonyManager { /** @hide */ @SystemApi public boolean getDataEnabled() { return getDataEnabled(SubscriptionManager.getDefaultDataSubId()); } /** @hide */ @SystemApi public boolean getDataEnabled(int subId) { boolean retVal; try { return getITelephony().getDataEnabled(); retVal = getITelephony().getDataEnabled(subId); } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#getDataEnabled", e); retVal = false; } return false; Log.d(TAG, "getDataEnabled: retVal=" + retVal); return retVal; } /** Loading telephony/java/com/android/internal/telephony/ITelephony.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -679,14 +679,14 @@ interface ITelephony { * * @param enable true to turn on, else false */ void setDataEnabled(boolean enable); void setDataEnabled(int subId, boolean enable); /** * Get the user enabled state of Mobile Data. * * @return true on enabled */ boolean getDataEnabled(); boolean getDataEnabled(int subId); /** * Get P-CSCF address from PCO after data connection is established or modified. Loading Loading
core/java/android/net/ConnectivityManager.java +8 −1 Original line number Diff line number Diff line Loading @@ -37,6 +37,7 @@ import android.os.Messenger; import android.os.RemoteException; import android.os.ServiceManager; import android.provider.Settings; import android.telephony.SubscriptionManager; import android.telephony.TelephonyManager; import android.util.ArrayMap; import android.util.Log; Loading Loading @@ -1295,9 +1296,15 @@ public class ConnectivityManager { if (b != null) { try { ITelephony it = ITelephony.Stub.asInterface(b); return it.getDataEnabled(); int subId = SubscriptionManager.getDefaultDataSubId(); Log.d("ConnectivityManager", "getMobileDataEnabled()+ subId=" + subId); boolean retVal = it.getDataEnabled(subId); Log.d("ConnectivityManager", "getMobileDataEnabled()- subId=" + subId + " retVal=" + retVal); return retVal; } catch (RemoteException e) { } } Log.d("ConnectivityManager", "getMobileDataEnabled()- remote exception retVal=false"); return false; } Loading
packages/SystemUI/src/com/android/systemui/statusbar/policy/MobileDataControllerImpl.java +1 −0 Original line number Diff line number Diff line Loading @@ -196,6 +196,7 @@ public class MobileDataControllerImpl implements NetworkController.MobileDataCon } public void setMobileDataEnabled(boolean enabled) { Log.d(TAG, "setMobileDataEnabled: enabled=" + enabled); mTelephonyManager.setDataEnabled(enabled); if (mCallback != null) { mCallback.onMobileDataEnabled(enabled); Loading
telephony/java/android/telephony/TelephonyManager.java +19 −3 Original line number Diff line number Diff line Loading @@ -3509,8 +3509,15 @@ public class TelephonyManager { /** @hide */ @SystemApi public void setDataEnabled(boolean enable) { setDataEnabled(SubscriptionManager.getDefaultDataSubId(), enable); } /** @hide */ @SystemApi public void setDataEnabled(int subId, boolean enable) { try { getITelephony().setDataEnabled(enable); Log.d(TAG, "setDataEnabled: enabled=" + enable); getITelephony().setDataEnabled(subId, enable); } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#setDataEnabled", e); } Loading @@ -3519,12 +3526,21 @@ public class TelephonyManager { /** @hide */ @SystemApi public boolean getDataEnabled() { return getDataEnabled(SubscriptionManager.getDefaultDataSubId()); } /** @hide */ @SystemApi public boolean getDataEnabled(int subId) { boolean retVal; try { return getITelephony().getDataEnabled(); retVal = getITelephony().getDataEnabled(subId); } catch (RemoteException e) { Log.e(TAG, "Error calling ITelephony#getDataEnabled", e); retVal = false; } return false; Log.d(TAG, "getDataEnabled: retVal=" + retVal); return retVal; } /** Loading
telephony/java/com/android/internal/telephony/ITelephony.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -679,14 +679,14 @@ interface ITelephony { * * @param enable true to turn on, else false */ void setDataEnabled(boolean enable); void setDataEnabled(int subId, boolean enable); /** * Get the user enabled state of Mobile Data. * * @return true on enabled */ boolean getDataEnabled(); boolean getDataEnabled(int subId); /** * Get P-CSCF address from PCO after data connection is established or modified. Loading