增加远程获取sn,台电设备适配

This commit is contained in:
2022-06-13 21:42:42 +08:00
parent 0d324c17a4
commit 7e95fd1181
14 changed files with 256 additions and 197 deletions

View File

@@ -816,16 +816,16 @@ public class MessageReceiver extends XGPushBaseReceiver {
// String usbStatus = "";
// switch (setting_usb) {
// case "usb_charge":
// usbStatus = "qch_action_usb_usb_charge";
// usbStatus = AOLE_ACTION_USB_USB_CHARGE;
// break;
// case "usb_mtp":
// usbStatus = "qch_action_usb_usb_mtp";
// usbStatus = AOLE_ACTION_USB_USB_MTP;
// break;
//// case "usb_midi":
//// usbStatus = "qch_action_usb_usb_midi";
//// usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MIDI;
//// break;
// default:
// usbStatus = "qch_action_usb_usb_charge";
// usbStatus = AOLE_ACTION_USB_USB_CHARGE;
// break;
// }
// Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
@@ -839,9 +839,9 @@ public class MessageReceiver extends XGPushBaseReceiver {
if (!TextUtils.isEmpty(jsonString)) {
JSONObject extra = JSON.parseObject(jsonString);
int is_tf = extra.getIntValue("setting_memory");
boolean qch_sdcard_forbid_on = JGYUtils.putInt(context.getContentResolver(), "qch_sdcard_forbid_on", changeNum(is_tf));
if (qch_sdcard_forbid_on) {
Log.e("setTfcardState:", JGYUtils.getString(context.getContentResolver(), "qch_sdcard_forbid_on"));
boolean aole_sdcard_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, changeNum(is_tf));
if (aole_sdcard_forbid_on) {
Log.e("setTfcardState:", JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON));
} else {
ToastUtil.debugShow("setTfcardState failed,state:" + is_tf);
}
@@ -859,21 +859,21 @@ public class MessageReceiver extends XGPushBaseReceiver {
}
JSONObject extra = JSON.parseObject(jsonString);
int is_bluetooth = changeNum(extra.getIntValue("setting_bluetooth"));
Log.e(TAG, "qch_bht_forbid_on:" + is_bluetooth);
Log.e(TAG, "aole_bht_forbid_on: " + is_bluetooth);
try {
//写入系统数据库
boolean qch_bht_forbid_on = JGYUtils.putInt(context.getContentResolver(), "qch_bht_forbid_on", is_bluetooth);
Log.e(TAG, "qch_bht_forbid_on:" + qch_bht_forbid_on);
boolean aole_bht_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHT_FORBID_ON, is_bluetooth);
Log.e(TAG, "aole_bht_forbid_on: " + aole_bht_forbid_on);
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
if (qch_bht_forbid_on) {
if (aole_bht_forbid_on) {
//成功
if (null == mBluetoothAdapter) {
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
//获取默认蓝牙适配器
}
//蓝牙总开关开启
JGYUtils.putString(context.getContentResolver(), "qch_bhtvideo_forbid_on", "Empty");
JGYUtils.putInt(context.getContentResolver(), "qch_bt_forbid_on", is_bluetooth);
JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty");
JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_BT_FORBID_ON, is_bluetooth);
//设置关闭时关闭蓝牙
mBluetoothAdapter.disable();
}
@@ -891,18 +891,18 @@ public class MessageReceiver extends XGPushBaseReceiver {
String package0 = extra.getString("package0");
String package1 = extra.getString("package1");
if (package0.length() != 0) {
boolean qch_jgy_network_allow = JGYUtils.putString(context.getContentResolver(), "qch_jgy_network_allow", package0);
Log.e("fht", "qch_jgy_network_allow::" + qch_jgy_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), "qch_jgy_network_allow"));
boolean aole_network_allow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW, package0);
Log.e("fht", "aole_network_allow::" + aole_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW));
} else {
boolean qch_jgy_network_allow = JGYUtils.putString(context.getContentResolver(), "qch_jgy_network_allow", "invalid");
Log.e("fht", "qch_jgy_network_allow::" + qch_jgy_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), "qch_jgy_network_allow"));
boolean aole_network_allow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "invalid");
Log.e("fht", "aole_network_allow::" + aole_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW));
}
if (package1.length() != 0) {
boolean qch_jgy_network_disallow = JGYUtils.putString(context.getContentResolver(), "qch_jgy_network_disallow", package1);
Log.e("fht", "qch_jgy_network_disallow::" + qch_jgy_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), "qch_jgy_network_disallow"));
boolean aole_network_disallow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, package1);
Log.e("fht", "aole_network_disallow::" + aole_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW));
} else {
boolean qch_jgy_network_disallow = JGYUtils.putString(context.getContentResolver(), "qch_jgy_network_disallow", "invalid");
Log.e("fht", "qch_jgy_network_disallow::" + qch_jgy_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), "qch_jgy_network_disallow"));
boolean aole_network_disallow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "invalid");
Log.e("fht", "aole_network_disallow::" + aole_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW));
}
} else {
ToastUtil.debugShow("setAppNetworkstate jsonString is NULL");
@@ -1112,7 +1112,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
JSONObject jsonObject = JSON.parseObject(jsonString);
String is_upgrade = jsonObject.getString("is_upgrade");
String packageName = jsonObject.getString("package");
String nowApplist = JGYUtils.getString(context.getContentResolver(), CommonConfig.QCH_APP_FORBID);
String nowApplist = JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
List<String> applist = new ArrayList<>(Arrays.asList(nowApplist.split(",")));
if ("0".equals(is_upgrade)) {
if (applist.contains(packageName)) {
@@ -1125,8 +1125,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
applist.add(packageName);
}
}
JGYUtils.putString(context.getContentResolver(), CommonConfig.QCH_APP_FORBID, String.join(",", applist));
Log.e("setAppUpdate", JGYUtils.getString(context.getContentResolver(), CommonConfig.QCH_APP_FORBID));
JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, String.join(",", applist));
Log.e("setAppUpdate", JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID));
}
private void setLock_screen(Context context, String jsonString) {
@@ -1287,9 +1287,9 @@ public class MessageReceiver extends XGPushBaseReceiver {
intent.setPackage("com.android.settings");
context.sendStickyBroadcast(intent);
}
boolean qch_hotspot_forbid_on = JGYUtils.putInt(context.getContentResolver(), "qch_hotspot_forbid_on", setting_hotspot);
Log.e("SystemSetting", "qch_hotspot_forbid_on---------" + setting_hotspot);
Log.e("SystemSetting", "qch_hotspot_forbid_on---------" + qch_hotspot_forbid_on);
boolean aole_hotspot_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_HOTSPOT_FORBID_ON, setting_hotspot);
Log.e("SystemSetting", "aole_hotspot_forbid_on---------" + setting_hotspot);
Log.e("SystemSetting", "aole_hotspot_forbid_on---------" + aole_hotspot_forbid_on);
} catch (Exception e) {
Log.e(TAG, "setHotspot: " + e.getMessage());
}
@@ -1298,8 +1298,8 @@ public class MessageReceiver extends XGPushBaseReceiver {
private void setRestore(Context context, String jsonString) {
JSONObject jsonObject = JSON.parseObject(jsonString);
int mode = jsonObject.getIntValue("qch_restore");
boolean qch_restore_forbid_on = JGYUtils.putInt(context.getContentResolver(), "qch_restore_forbid_on", changeNum(mode));
Log.e(TAG, "qch_restore_forbid_on:" + qch_restore_forbid_on);
boolean aole_restore_forbid_on = JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, changeNum(mode));
Log.e(TAG, "aole_restore_forbid_on:" + aole_restore_forbid_on);
}
private void setBrowserInput(Context context, String jsonString) {
@@ -1313,7 +1313,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
int dev_mode = changeNum(jsonObject.getIntValue("dev_mode"));
Log.e(TAG, "getDeveloper: " + dev_mode);
if (!DeviceManager.isDebugMode()) {
JGYUtils.putInt(context.getContentResolver(), "qch_Developeroptions", dev_mode);
JGYUtils.putInt(context.getContentResolver(), CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, dev_mode);
if (dev_mode == 1) {
Intent intent = new Intent();
intent.setAction("qch_developeroptions_close");