android14 默认关闭或开启数据流量
默认关闭或打开数据流量
SYS/vendor/sprd/platform/frameworks/base/telephony/java/com/android/internal/telephony/DataEnableController.java
private boolean getDataEnable() {try {Log.d(TAG, "MOBILE_DATA=" + Settings.Global.getInt(mContext.getContentResolver(),Settings.Global.MOBILE_DATA + SubscriptionManager.MAX_SUBSCRIPTION_ID_VALUE));return Settings.Global.getInt(mContext.getContentResolver(), Settings.Global.MOBILE_DATA+ SubscriptionManager.MAX_SUBSCRIPTION_ID_VALUE) != 0;} catch (SettingNotFoundException e) {int defaultVal = "true".equalsIgnoreCase(SystemProperties.get("ro.com.android.mobiledata", "true")) ? 1 : 0;Settings.Global.putInt(mContext.getContentResolver(),Settings.Global.MOBILE_DATA + SubscriptionManager.MAX_SUBSCRIPTION_ID_VALUE,defaultVal);
- return true;
+ return defaultVal!= 0; }
}
修改后,根据ro.com.android.mobiledata属性配置false为关闭,true为打开