优化代码

hdrplus
Matthew 1 year ago
parent 59022ea296
commit c1438cc3d8

@ -941,7 +941,9 @@ public class MpMasterService extends Service {
Method method = subscriptionManager.getClass().getDeclaredMethod("setDefaultDataSubId", int.class);
method.invoke(subscriptionManager, subId);
TelephonyManager telephonyManager = (TelephonyManager) getSystemService(Context.TELEPHONY_SERVICE);
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
telephonyManager.setDataEnabled(true);
}
Method method1 = telephonyManager.getClass().getDeclaredMethod("setDataEnabled", boolean.class);
method1.invoke(telephonyManager, true);
} catch (Exception e) {

Loading…
Cancel
Save