Merge "Enable data when user selects default data through popped up dialog."

This commit is contained in:
Xiangyu/Malcolm Chen
2019-02-07 03:34:14 +00:00
committed by Android (Google) Code Review

View File

@@ -118,7 +118,10 @@ public class SimDialogActivity extends Activity {
private static void setDefaultDataSubId(final Context context, final int subId) {
final SubscriptionManager subscriptionManager = SubscriptionManager.from(context);
final TelephonyManager telephonyManager = TelephonyManager.from(context)
.createForSubscriptionId(subId);
subscriptionManager.setDefaultDataSubId(subId);
telephonyManager.setDataEnabled(true);
Toast.makeText(context, R.string.data_switch_started, Toast.LENGTH_LONG).show();
}