commit | c30652a34d1b578905eae330fa03bfd038e09241 | [log] [tgz] |
---|---|---|
author | Hall Liu <hallliu@google.com> | Fri Sep 25 11:16:39 2020 -0700 |
committer | Hall Liu <hallliu@google.com> | Thu Oct 22 01:08:16 2020 +0000 |
tree | 1d05211140e795b005af34b1372f65424b965d87 | |
parent | 81d91e3892a79c57b6fb96c3c039f76cf74c7de3 [diff] |
Replace TelephonyManager methods for mobile data Replace usage of setAlwaysAllowMmsData with a new method. Exempt-From-Owner-Approval: Cherry-picked from internal Bug: 169367013 Test: NA Change-Id: Ide6e74155c9310134a98bd2d7191ecfa7d725c86 Merged-In: Ide6e74155c9310134a98bd2d7191ecfa7d725c86
diff --git a/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyManagerFacade.java b/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyManagerFacade.java index a7988aa..f09d0e2 100644 --- a/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyManagerFacade.java +++ b/Common/src/com/googlecode/android_scripting/facade/telephony/TelephonyManagerFacade.java
@@ -802,7 +802,12 @@ public boolean telephonySetAlwaysAllowMmsData( @RpcParameter(name = "subId") Integer subId, @RpcParameter(name = "alwaysAllow") Boolean alwaysAllow) { - return mTelephonyManager.createForSubscriptionId(subId).setAlwaysAllowMmsData(alwaysAllow); + boolean wasAlwaysAllow = mTelephonyManager.isMobileDataPolicyEnabled( + TelephonyManager.MOBILE_DATA_POLICY_MMS_ALWAYS_ALLOWED); + mTelephonyManager.createForSubscriptionId(subId) + .setMobileDataPolicyEnabledStatus( + TelephonyManager.MOBILE_DATA_POLICY_MMS_ALWAYS_ALLOWED, alwaysAllow); + return wasAlwaysAllow == alwaysAllow; } /**