version:3.9
fix:修复系统设置管控失败 update:
This commit is contained in:
@@ -42,7 +42,6 @@ public class SysSettingUtils {
|
||||
}
|
||||
JSONObject jsonObject = JSON.parseObject(jsonObj);
|
||||
setPhoneList(context, jsonObject);
|
||||
setUSBstate(context, jsonObject);
|
||||
setBluetooth(context, jsonObject);
|
||||
setHotspot(context, jsonObject);
|
||||
setBar(context, jsonObject);
|
||||
@@ -55,20 +54,8 @@ public class SysSettingUtils {
|
||||
SPUtils.put(context, JGYActions.ACTION_STATUSBAR_STATUS, jsonObject.getJSONObject("setting_nav").toJSONString());
|
||||
setStatusBar(context, navJson);
|
||||
setBrowserInput(context, jsonObject);
|
||||
//otg开关
|
||||
// int setting_otg = changeNum(jsonObject.getInteger("setting_otg"));
|
||||
// Log.e(TAG, "setting_otg---------" + setting_otg);
|
||||
// String otgStatus = "";
|
||||
// switch (setting_otg) {
|
||||
// case 0:
|
||||
// otgStatus = "qch_otg_open";
|
||||
// break;
|
||||
// case 1:
|
||||
// otgStatus = "qch_otg_forbid";
|
||||
// break;
|
||||
// }
|
||||
// Intent otgIntent = new Intent(otgStatus);
|
||||
// sendBroadcast(otgIntent);
|
||||
// TODO: 2022/4/11 不是酷比定制的会报错,无法抛出异常
|
||||
setUSBstate(context, jsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -194,29 +181,25 @@ public class SysSettingUtils {
|
||||
String setting_usb = jsonObject.getString("setting_usb");
|
||||
if (!BuildConfig.DEBUG) {
|
||||
SuperPower mService = (SuperPower) context.getSystemService("mdm");
|
||||
try {
|
||||
boolean aole_usb_choose = Settings.System.putString(context.getContentResolver(), "aole_usb_choose", setting_usb);
|
||||
Log.e("setUSBstate", "aole_usb_choose---------" + aole_usb_choose);
|
||||
String usbStatus = "";
|
||||
switch (setting_usb) {
|
||||
case "usb_charge":
|
||||
mService.setUSBDataDisabled(true);
|
||||
usbStatus = "aole_action_usb_usb_charge";
|
||||
break;
|
||||
case "usb_mtp":
|
||||
mService.setUSBDataDisabled(false);
|
||||
usbStatus = "aole_action_usb_usb_mtp";
|
||||
break;
|
||||
case "usb_midi":
|
||||
usbStatus = "aole_action_usb_usb_midi";
|
||||
break;
|
||||
boolean aole_usb_choose = Settings.System.putString(context.getContentResolver(), "aole_usb_choose", setting_usb);
|
||||
Log.e("setUSBstate", "aole_usb_choose---------" + aole_usb_choose);
|
||||
String usbStatus = "";
|
||||
switch (setting_usb) {
|
||||
case "usb_charge":
|
||||
mService.setUSBDataDisabled(true);
|
||||
usbStatus = "aole_action_usb_usb_charge";
|
||||
break;
|
||||
case "usb_mtp":
|
||||
mService.setUSBDataDisabled(false);
|
||||
usbStatus = "aole_action_usb_usb_mtp";
|
||||
break;
|
||||
case "usb_midi":
|
||||
usbStatus = "aole_action_usb_usb_midi";
|
||||
break;
|
||||
|
||||
}
|
||||
Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
|
||||
context.sendBroadcast(usbIntent);
|
||||
} catch (Exception e) {
|
||||
Log.e(TAG, "setUSBstate: " + e.getMessage());
|
||||
}
|
||||
Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
|
||||
context.sendBroadcast(usbIntent);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user