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

Commit 007a98c5 authored by Sooraj Sasindran's avatar Sooraj Sasindran Committed by Automerger Merge Worker
Browse files

Make sure to handle exceptions for setDataEnabled am: dfaf434b

Original change: https://android-review.googlesource.com/c/platform/frameworks/base/+/1358928

Change-Id: Ic3e13fa7a625533cb03454f13dafa75bff15e8e1
parents 760d5797 dfaf434b
Loading
Loading
Loading
Loading
+21 −4
Original line number Diff line number Diff line
@@ -9178,7 +9178,11 @@ public class TelephonyManager {
    @Deprecated
    @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
    public void setDataEnabled(int subId, boolean enable) {
        try {
            setDataEnabledWithReason(subId, DATA_ENABLED_REASON_USER, enable);
        } catch (RuntimeException e) {
            Log.e(TAG, "Error calling setDataEnabledWithReason e:" + e);
        }
    }
    /**
@@ -9385,7 +9389,12 @@ public class TelephonyManager {
    @Deprecated
    @SystemApi
    public boolean getDataEnabled(int subId) {
        try {
            return isDataEnabledWithReason(DATA_ENABLED_REASON_USER);
        } catch (RuntimeException e) {
            Log.e(TAG, "Error calling isDataEnabledWithReason e:" + e);
        }
        return false;
    }
    /**
@@ -10951,7 +10960,11 @@ public class TelephonyManager {
    @SystemApi
    @RequiresPermission(android.Manifest.permission.MODIFY_PHONE_STATE)
    public void setCarrierDataEnabled(boolean enabled) {
        try {
            setDataEnabledWithReason(DATA_ENABLED_REASON_CARRIER, enabled);
        } catch (RuntimeException e) {
            Log.e(TAG, "Error calling setDataEnabledWithReason e:" + e);
        }
    }
    /**
@@ -11043,7 +11056,11 @@ public class TelephonyManager {
    @Deprecated
    @RequiresPermission(Manifest.permission.MODIFY_PHONE_STATE)
    public void setPolicyDataEnabled(boolean enabled) {
        try {
            setDataEnabledWithReason(DATA_ENABLED_REASON_POLICY, enabled);
        } catch (RuntimeException e) {
            Log.e(TAG, "Error calling setDataEnabledWithReason e:" + e);
        }
    }
    /** @hide */