Change from deprecated telephony api

TelephonyManager#setDataEnabled() is deprecated in favor of
TelephonyManager#setDataEnabled(int Reason, boolean enabled). This
change updates the call to the recommended one.

Test: atest SystemUITests
Bug: 238425913
Change-Id: I0b1dd8e715bbaa513d90a31defacf576993c6cc0
This commit is contained in:
Evan Laird
2022-07-08 11:26:18 -04:00
parent 34d2c31e74
commit 615f42de2c

View File

@@ -778,7 +778,8 @@ public class InternetDialogController implements AccessPointController.AccessPoi
return;
}
mTelephonyManager.setDataEnabled(enabled);
mTelephonyManager.setDataEnabledForReason(
TelephonyManager.DATA_ENABLED_REASON_USER, enabled);
if (disableOtherSubscriptions) {
final List<SubscriptionInfo> subInfoList =
mSubscriptionManager.getActiveSubscriptionInfoList();