version:1.4
update:2021-10-21 10:14:40 fix: add:增加浏览器桌面检测升级,修复重复请求
This commit is contained in:
@@ -8,6 +8,7 @@ import android.content.Intent;
|
||||
import android.os.Build;
|
||||
import android.provider.Settings;
|
||||
import android.text.TextUtils;
|
||||
import android.util.Log;
|
||||
|
||||
import com.alibaba.fastjson.JSON;
|
||||
import com.alibaba.fastjson.JSONArray;
|
||||
@@ -55,7 +56,7 @@ public class SysSettingUtils {
|
||||
setBrowserInput(context, jsonObject);
|
||||
//otg开关
|
||||
// int setting_otg = changeNum(jsonObject.getInteger("setting_otg"));
|
||||
// Logutils.e(TAG, "setting_otg---------" + setting_otg);
|
||||
// Log.e(TAG, "setting_otg---------" + setting_otg);
|
||||
// String otgStatus = "";
|
||||
// switch (setting_otg) {
|
||||
// case 0:
|
||||
@@ -74,7 +75,7 @@ public class SysSettingUtils {
|
||||
*/
|
||||
public static void setDisableSetting(Context context) {
|
||||
ToastUtil.betaShow("关闭所有功能");
|
||||
Logutils.e("setDisableSetting", "Close all settings: ");
|
||||
Log.e("setDisableSetting", "Close all settings: ");
|
||||
setPhoneList(context, 1);
|
||||
setUSBstate(context, 1);
|
||||
setBluetooth(context, 1);
|
||||
@@ -117,19 +118,19 @@ public class SysSettingUtils {
|
||||
try {
|
||||
//设置电话功能,电话白名单
|
||||
boolean qch_call_forbid = Settings.System.putInt(context.getContentResolver(), "qch_call_forbid", state);
|
||||
Logutils.e(TAG, "qch_call_forbid:" + qch_call_forbid);
|
||||
Log.e(TAG, "qch_call_forbid:" + qch_call_forbid);
|
||||
|
||||
boolean qch_white_list_on = Settings.System.putInt(context.getContentResolver(), "qch_white_list_on", state);
|
||||
Logutils.e(TAG, "qch_white_list_on:" + qch_white_list_on);
|
||||
Log.e(TAG, "qch_white_list_on:" + qch_white_list_on);
|
||||
|
||||
boolean qch_white_list_Array = Settings.System.putString(context.getContentResolver(), "qch_white_list_Array", "");
|
||||
// ToastTool.show("qch_call_forbid::"+setting_call+"----setting_phones::"+setting_phones+"----"+qch_white_list_Array+"---"+qch_call_forbid);
|
||||
Logutils.e(TAG, "qch_white_list_Array:" + qch_white_list_Array + "---" + qch_white_list_Array);
|
||||
Log.e(TAG, "qch_white_list_Array:" + qch_white_list_Array + "---" + qch_white_list_Array);
|
||||
|
||||
boolean qch_sdcard_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_sdcard_forbid_on", state);
|
||||
Logutils.e(TAG, "qch_sdcard_forbid_on:" + qch_sdcard_forbid_on);
|
||||
Log.e(TAG, "qch_sdcard_forbid_on:" + qch_sdcard_forbid_on);
|
||||
} catch (Exception e) {
|
||||
Logutils.e(TAG, "setPhoneList: " + e.getMessage());
|
||||
Log.e(TAG, "setPhoneList: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -139,28 +140,28 @@ public class SysSettingUtils {
|
||||
//电话通话开关
|
||||
int setting_call = changeNum(jsonObject.getInteger("setting_call"));
|
||||
boolean qch_call_forbid = Settings.System.putInt(context.getContentResolver(), "qch_call_forbid", setting_call);
|
||||
Logutils.e(TAG, "qch_call_forbid:" + qch_call_forbid);
|
||||
Log.e(TAG, "qch_call_forbid:" + qch_call_forbid);
|
||||
//电话白名单开关
|
||||
int setting_phone = changeNum(jsonObject.getInteger("setting_phone"));
|
||||
boolean qch_white_list_on = Settings.System.putInt(context.getContentResolver(), "qch_white_list_on", setting_phone);
|
||||
Logutils.e(TAG, "qch_white_list_on:" + qch_white_list_on);
|
||||
Log.e(TAG, "qch_white_list_on:" + qch_white_list_on);
|
||||
//白名单列表
|
||||
if (setting_phone == 1) {
|
||||
boolean qch_white_list_Array = Settings.System.putString(context.getContentResolver(), "qch_white_list_Array", "empty");
|
||||
// ToastTool.show("qch_call_forbid::"+setting_call+"----setting_phones::"+setting_phones+"----"+qch_white_list_Array+"---"+qch_call_forbid);
|
||||
Logutils.e(TAG, "qch_white_list_Array:" + qch_white_list_Array);
|
||||
Log.e(TAG, "qch_white_list_Array:" + qch_white_list_Array);
|
||||
} else {
|
||||
String setting_phones = jsonObject.getString("setting_phones");
|
||||
boolean qch_white_list_Array = Settings.System.putString(context.getContentResolver(), "qch_white_list_Array", setting_phones);
|
||||
// ToastTool.show("qch_call_forbid::"+setting_call+"----setting_phones::"+setting_phones+"----"+qch_white_list_Array+"---"+qch_call_forbid);
|
||||
Logutils.e(TAG, "qch_white_list_Array:" + qch_white_list_Array + "---" + setting_phones);
|
||||
Log.e(TAG, "qch_white_list_Array:" + qch_white_list_Array + "---" + setting_phones);
|
||||
}
|
||||
//存储卡
|
||||
int setting_memory = changeNum(jsonObject.getInteger("setting_memory"));
|
||||
boolean qch_sdcard_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_sdcard_forbid_on", setting_memory);
|
||||
Logutils.e(TAG, "qch_sdcard_forbid_on:" + qch_sdcard_forbid_on);
|
||||
Log.e(TAG, "qch_sdcard_forbid_on:" + qch_sdcard_forbid_on);
|
||||
} catch (Exception e) {
|
||||
Logutils.e(TAG, "setPhoneList: " + e.getMessage());
|
||||
Log.e(TAG, "setPhoneList: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -172,12 +173,12 @@ public class SysSettingUtils {
|
||||
if (!BuildConfig.DEBUG) {
|
||||
try {
|
||||
boolean qch_usb_choose = Settings.System.putString(context.getContentResolver(), "qch_usb_choose", "usb_charge");
|
||||
Logutils.e(TAG, "qch_usb_choose:" + qch_usb_choose);
|
||||
Log.e(TAG, "qch_usb_choose:" + qch_usb_choose);
|
||||
String usbStatus = "qch_action_usb_usb_charge";
|
||||
Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
|
||||
context.sendBroadcast(usbIntent);
|
||||
} catch (Exception e) {
|
||||
Logutils.e(TAG, "setUSBstate: " + e.getMessage());
|
||||
Log.e(TAG, "setUSBstate: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -191,7 +192,7 @@ public class SysSettingUtils {
|
||||
if (!BuildConfig.DEBUG) {
|
||||
try {
|
||||
boolean qch_usb_choose = Settings.System.putString(context.getContentResolver(), "qch_usb_choose", setting_usb);
|
||||
Logutils.e(TAG, "qch_usb_choose---------" + qch_usb_choose);
|
||||
Log.e(TAG, "qch_usb_choose---------" + qch_usb_choose);
|
||||
String usbStatus = "";
|
||||
switch (setting_usb) {
|
||||
case "usb_charge":
|
||||
@@ -208,7 +209,7 @@ public class SysSettingUtils {
|
||||
Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings");
|
||||
context.sendBroadcast(usbIntent);
|
||||
} catch (Exception e) {
|
||||
Logutils.e(TAG, "setUSBstate: " + e.getMessage());
|
||||
Log.e(TAG, "setUSBstate: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -217,7 +218,7 @@ public class SysSettingUtils {
|
||||
try {
|
||||
boolean qch_bht_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_bht_forbid_on", state);
|
||||
//写入系统数据库
|
||||
Logutils.e(TAG, "qch_bht_forbid_on:" + qch_bht_forbid_on);
|
||||
Log.e(TAG, "qch_bht_forbid_on:" + qch_bht_forbid_on);
|
||||
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||
if (qch_bht_forbid_on) {
|
||||
//成功
|
||||
@@ -232,7 +233,7 @@ public class SysSettingUtils {
|
||||
//设置关闭时关闭蓝牙
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logutils.e(TAG, "setBluetooth: " + e.getMessage());
|
||||
Log.e(TAG, "setBluetooth: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -247,7 +248,7 @@ public class SysSettingUtils {
|
||||
//蓝牙传输开关
|
||||
boolean qch_bht_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_bht_forbid_on", setting_bht);
|
||||
|
||||
Logutils.e(TAG, "qch_bht_forbid_on:" + qch_bht_forbid_on);
|
||||
Log.e(TAG, "qch_bht_forbid_on:" + qch_bht_forbid_on);
|
||||
BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
|
||||
if (qch_bht_forbid_on) {
|
||||
//成功
|
||||
@@ -260,7 +261,7 @@ public class SysSettingUtils {
|
||||
String setting_context = jsonObject.getString("setting_context");
|
||||
if (setting_bhtvideo == 0) {
|
||||
if (null != setting_context && !setting_context.equals("") && !setting_context.equals(" ") && !setting_context.equals("null")) {
|
||||
Logutils.e(TAG, "setting_context:" + setting_context);
|
||||
Log.e(TAG, "setting_context:" + setting_context);
|
||||
Settings.System.putString(context.getContentResolver(), "qch_bhtvideo_forbid_on", setting_context);
|
||||
} else {
|
||||
Settings.System.putString(context.getContentResolver(), "qch_bhtvideo_forbid_on", "Empty");
|
||||
@@ -275,7 +276,7 @@ public class SysSettingUtils {
|
||||
}
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logutils.e(TAG, "setBluetooth: " + e.getMessage());
|
||||
Log.e(TAG, "setBluetooth: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -286,9 +287,9 @@ public class SysSettingUtils {
|
||||
intent.setPackage("com.android.settings");
|
||||
context.sendStickyBroadcast(intent);
|
||||
boolean qch_hotspot_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_hotspot_forbid_on", state);
|
||||
Logutils.e(TAG, "qch_hotspot_forbid_on:" + qch_hotspot_forbid_on);
|
||||
Log.e(TAG, "qch_hotspot_forbid_on:" + qch_hotspot_forbid_on);
|
||||
} catch (Exception e) {
|
||||
Logutils.e(TAG, "setHotspot: " + e.getMessage());
|
||||
Log.e(TAG, "setHotspot: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -302,10 +303,10 @@ public class SysSettingUtils {
|
||||
context.sendStickyBroadcast(intent);
|
||||
}
|
||||
boolean qch_hotspot_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_hotspot_forbid_on", setting_hotspot);
|
||||
Logutils.e(TAG, "qch_hotspot_forbid_on---------" + setting_hotspot);
|
||||
Logutils.e(TAG, "qch_hotspot_forbid_on---------" + qch_hotspot_forbid_on);
|
||||
Log.e(TAG, "qch_hotspot_forbid_on---------" + setting_hotspot);
|
||||
Log.e(TAG, "qch_hotspot_forbid_on---------" + qch_hotspot_forbid_on);
|
||||
} catch (Exception e) {
|
||||
Logutils.e(TAG, "setHotspot: " + e.getMessage());
|
||||
Log.e(TAG, "setHotspot: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,7 +315,7 @@ public class SysSettingUtils {
|
||||
int setting_navigation = 0;
|
||||
//写入到系统不涉及任何管控,因为之前调用会频繁隐藏显示
|
||||
boolean qch_hide_navigationBar = Settings.System.putInt(context.getContentResolver(), "qch_hide_NavigationBar", setting_navigation);
|
||||
Logutils.e(TAG, "qch_hide_navigationBar---------" + qch_hide_navigationBar);
|
||||
Log.e(TAG, "qch_hide_navigationBar---------" + qch_hide_navigationBar);
|
||||
|
||||
String navigationStatus = "";
|
||||
switch (setting_navigation) {
|
||||
@@ -336,7 +337,7 @@ public class SysSettingUtils {
|
||||
if (oldNum != setting_statusbar) {
|
||||
//写入到系统不涉及任何管控,因为之前调用会频繁隐藏显示
|
||||
boolean qch_hide_statusBar = Settings.System.putInt(context.getContentResolver(), "qch_hide_statusBar", setting_statusbar);
|
||||
Logutils.e(TAG, "qch_hide_statusBar---------" + qch_hide_statusBar);
|
||||
Log.e(TAG, "qch_hide_statusBar---------" + qch_hide_statusBar);
|
||||
String statusbarStatus = "";
|
||||
switch (setting_statusbar) {
|
||||
case 0:
|
||||
@@ -356,7 +357,7 @@ public class SysSettingUtils {
|
||||
int setting_navigation = changeNum(jsonObject.getInteger("setting_navigation"));
|
||||
//写入到系统不涉及任何管控,因为之前调用会频繁隐藏显示
|
||||
boolean qch_hide_navigationBar = Settings.System.putInt(context.getContentResolver(), "qch_hide_NavigationBar", setting_navigation);
|
||||
Logutils.e(TAG, "qch_hide_navigationBar---------" + qch_hide_navigationBar);
|
||||
Log.e(TAG, "qch_hide_navigationBar---------" + qch_hide_navigationBar);
|
||||
|
||||
String navigationStatus = "";
|
||||
switch (setting_navigation) {
|
||||
@@ -377,7 +378,7 @@ public class SysSettingUtils {
|
||||
if (oldNum != setting_statusbar) {
|
||||
//写入到系统不涉及任何管控,因为之前调用会频繁隐藏显示
|
||||
boolean qch_hide_statusBar = Settings.System.putInt(context.getContentResolver(), "qch_hide_statusBar", setting_statusbar);
|
||||
Logutils.e(TAG, "qch_hide_statusBar---------" + qch_hide_statusBar);
|
||||
Log.e(TAG, "qch_hide_statusBar---------" + qch_hide_statusBar);
|
||||
String statusbarStatus = "";
|
||||
switch (setting_statusbar) {
|
||||
case 0:
|
||||
@@ -396,9 +397,9 @@ public class SysSettingUtils {
|
||||
try {
|
||||
//摄像头开关
|
||||
boolean qch_app_camera = Settings.System.putInt(context.getContentResolver(), "qch_app_camera", state);
|
||||
Logutils.e(TAG, "qch_app_camera1:" + state);
|
||||
Log.e(TAG, "qch_app_camera1:" + state);
|
||||
// ApkUtils.hideSystemSettingAPP(context, "com.mediatek.camera");
|
||||
Logutils.e(TAG, "setting_camera---------" + qch_app_camera);
|
||||
Log.e(TAG, "setting_camera---------" + qch_app_camera);
|
||||
String cameraStatus = "qch_camera_forbid";
|
||||
switch (state) {
|
||||
case 0:
|
||||
@@ -411,7 +412,7 @@ public class SysSettingUtils {
|
||||
Intent cameraIntent = new Intent(cameraStatus).setPackage("com.android.settings");
|
||||
context.sendBroadcast(cameraIntent);
|
||||
} catch (Exception e) {
|
||||
Logutils.e(TAG, "setCamera: " + e.getMessage());
|
||||
Log.e(TAG, "setCamera: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -420,9 +421,9 @@ public class SysSettingUtils {
|
||||
//摄像头开关
|
||||
int setting_camera = changeNum(jsonObject.getInteger("setting_camera"));
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_camera", setting_camera);
|
||||
Logutils.e(TAG, "qch_app_camera2:" + setting_camera);
|
||||
Log.e(TAG, "qch_app_camera2:" + setting_camera);
|
||||
// ApkUtils.hideSystemSettingAPP(context, "com.mediatek.camera");
|
||||
Logutils.e(TAG, "setting_camera---------" + setting_camera);
|
||||
Log.e(TAG, "setting_camera---------" + setting_camera);
|
||||
String cameraStatus = "";
|
||||
switch (setting_camera) {
|
||||
case 0:
|
||||
@@ -435,7 +436,7 @@ public class SysSettingUtils {
|
||||
Intent cameraIntent = new Intent(cameraStatus).setPackage("com.android.settings");
|
||||
context.sendBroadcast(cameraIntent);
|
||||
} catch (Exception e) {
|
||||
Logutils.e(TAG, "setCamera: " + e.getMessage());
|
||||
Log.e(TAG, "setCamera: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -444,7 +445,7 @@ public class SysSettingUtils {
|
||||
//tfmedia开关
|
||||
// int setting_tfmedia = 1;
|
||||
boolean qch_tfmedia_forbid = Settings.System.putInt(context.getContentResolver(), "qch_tfmedia_forbid", state);
|
||||
Logutils.e(TAG, "setting_tfmedia---------" + qch_tfmedia_forbid);
|
||||
Log.e(TAG, "setting_tfmedia---------" + qch_tfmedia_forbid);
|
||||
String tfmediaStatus = "";
|
||||
switch (state) {
|
||||
case 0:
|
||||
@@ -458,12 +459,12 @@ public class SysSettingUtils {
|
||||
context.sendBroadcast(tfmediaIntent);
|
||||
if (state == 1) {
|
||||
boolean qch_tfmedia_filetypes = Settings.System.putString(context.getContentResolver(), "qch_tfmedia_filetypes", "Empty");//影音管控
|
||||
Logutils.e(TAG, "qch_tfmedia_filetypes:" + qch_tfmedia_filetypes);
|
||||
Log.e(TAG, "qch_tfmedia_filetypes:" + qch_tfmedia_filetypes);
|
||||
} else {
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_tfmedia_forbid", 0);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logutils.e(TAG, "setTF: " + e.getMessage());
|
||||
Log.e(TAG, "setTF: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -479,15 +480,15 @@ public class SysSettingUtils {
|
||||
// }
|
||||
boolean qch_tfmedia_forbid = Settings.System.putInt(context.getContentResolver(),
|
||||
"qch_tfmedia_forbid", setting_tfmedia);
|
||||
Logutils.e(TAG, "setting_tfmedia---------" + qch_tfmedia_forbid);
|
||||
Log.e(TAG, "setting_tfmedia---------" + qch_tfmedia_forbid);
|
||||
String tfmediaStatus = "";
|
||||
switch (setting_tfmedia) {
|
||||
case 0:
|
||||
Logutils.e(TAG, "setting_tfmedia: " + "打开");
|
||||
Log.e(TAG, "setting_tfmedia: " + "打开");
|
||||
tfmediaStatus = "qch_tfmedia_open";
|
||||
break;
|
||||
case 1:
|
||||
Logutils.e(TAG, "setting_tfmedia: " + "禁止");
|
||||
Log.e(TAG, "setting_tfmedia: " + "禁止");
|
||||
tfmediaStatus = "qch_tfmedia_forbid";
|
||||
break;
|
||||
}
|
||||
@@ -504,12 +505,12 @@ public class SysSettingUtils {
|
||||
}
|
||||
stringBuffer.deleteCharAt(stringBuffer.length() - 1);
|
||||
Settings.System.putString(context.getContentResolver(), "qch_tfmedia_filetypes", stringBuffer.toString());//影音管控
|
||||
Logutils.e(TAG, "qch_tfmedia_filetypes---------" + stringBuffer.toString());
|
||||
Log.e(TAG, "qch_tfmedia_filetypes---------" + stringBuffer.toString());
|
||||
} else {
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_tfmedia_forbid", 0);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logutils.e(TAG, "setTF: " + e.getMessage());
|
||||
Log.e(TAG, "setTF: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -521,22 +522,22 @@ public class SysSettingUtils {
|
||||
// int deskclock = 1;
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_deskclock", state);
|
||||
ApkUtils.hideSystemSettingAPP(context, "com.android.deskclock");
|
||||
Logutils.e(TAG, "qch_app_deskclock" + state);
|
||||
Log.e(TAG, "qch_app_deskclock" + state);
|
||||
//录音机
|
||||
// int soundrecorder = 1;
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_soundrecorder", state);
|
||||
ApkUtils.hideSystemSettingAPP(context, "com.android.soundrecorder");
|
||||
Logutils.e(TAG, "qch_app_soundrecorder" + state);
|
||||
Log.e(TAG, "qch_app_soundrecorder" + state);
|
||||
//音乐
|
||||
// int music = 1;
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_music", state);
|
||||
ApkUtils.hideSystemSettingAPP(context, "com.android.music");
|
||||
Logutils.e(TAG, "qch_app_music" + state);
|
||||
Log.e(TAG, "qch_app_music" + state);
|
||||
//图库
|
||||
// int gallery = 1;
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_gallery", state);
|
||||
ApkUtils.hideSystemSettingAPP(context, "com.android.gallery3d");
|
||||
Logutils.e(TAG, "qch_app_gallery" + state);
|
||||
Log.e(TAG, "qch_app_gallery" + state);
|
||||
//文件管理器
|
||||
// int filemanager = 1;
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_filemanager", state);
|
||||
@@ -545,12 +546,12 @@ public class SysSettingUtils {
|
||||
} else {
|
||||
ApkUtils.hideSystemSettingAPP(context, "com.android.documentsui");
|
||||
}
|
||||
Logutils.e(TAG, "qch_app_filemanager" + state);
|
||||
Log.e(TAG, "qch_app_filemanager" + state);
|
||||
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_browser", state);
|
||||
Logutils.e(TAG, "qch_app_browser" + state);
|
||||
Log.e(TAG, "qch_app_browser" + state);
|
||||
} catch (Exception e) {
|
||||
Logutils.e(TAG, "setIcon: " + e.getMessage());
|
||||
Log.e(TAG, "setIcon: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -562,22 +563,22 @@ public class SysSettingUtils {
|
||||
int deskclock = changeNum(jsonObject.getInteger("setting_clock"));
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_deskclock", deskclock);
|
||||
ApkUtils.hideSystemSettingAPP(context, "com.android.deskclock");
|
||||
Logutils.e(TAG, "qch_app_deskclock" + deskclock);
|
||||
Log.e(TAG, "qch_app_deskclock" + deskclock);
|
||||
//录音机
|
||||
int soundrecorder = changeNum(jsonObject.getInteger("setting_recording"));
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_soundrecorder", soundrecorder);
|
||||
ApkUtils.hideSystemSettingAPP(context, "com.android.soundrecorder");
|
||||
Logutils.e(TAG, "qch_app_soundrecorder" + soundrecorder);
|
||||
Log.e(TAG, "qch_app_soundrecorder" + soundrecorder);
|
||||
//音乐
|
||||
int music = changeNum(jsonObject.getInteger("setting_music"));
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_music", music);
|
||||
ApkUtils.hideSystemSettingAPP(context, "com.android.music");
|
||||
Logutils.e(TAG, "qch_app_music" + music);
|
||||
Log.e(TAG, "qch_app_music" + music);
|
||||
//图库
|
||||
int gallery = changeNum(jsonObject.getInteger("setting_picture"));
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_gallery", gallery);
|
||||
ApkUtils.hideSystemSettingAPP(context, "com.android.gallery3d");
|
||||
Logutils.e(TAG, "qch_app_gallery" + gallery);
|
||||
Log.e(TAG, "qch_app_gallery" + gallery);
|
||||
//壁纸
|
||||
int wallpaper = changeNum(jsonObject.getInteger("setting_wallpaper"));
|
||||
setWallpaper(context, wallpaper);
|
||||
@@ -589,14 +590,14 @@ public class SysSettingUtils {
|
||||
} else {
|
||||
ApkUtils.hideSystemSettingAPP(context, "com.android.documentsui");
|
||||
}
|
||||
Logutils.e(TAG, "qch_app_filemanager" + filemanager);
|
||||
Log.e(TAG, "qch_app_filemanager" + filemanager);
|
||||
//浏览器
|
||||
int browser = changeNum(jsonObject.getInteger("setting_browser"));
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_browser", browser);
|
||||
Logutils.e(TAG, "qch_app_browser" + browser);
|
||||
Log.e(TAG, "qch_app_browser" + browser);
|
||||
|
||||
} catch (Exception e) {
|
||||
Logutils.e(TAG, "setIcon: " + e.getMessage());
|
||||
Log.e(TAG, "setIcon: " + e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -604,12 +605,12 @@ public class SysSettingUtils {
|
||||
//壁纸
|
||||
// int wallpaper = 1;
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_app_wallpaper", state);
|
||||
Logutils.e(TAG, "qch_app_wallpaper" + state);
|
||||
Log.e(TAG, "qch_app_wallpaper" + state);
|
||||
}
|
||||
|
||||
private static void setCanReset(Context context, int state) {
|
||||
boolean qch_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_restore_forbid_on", 0);
|
||||
Logutils.e(TAG, "qch_restore_forbid_on:" + qch_restore_forbid_on);
|
||||
Log.e(TAG, "qch_restore_forbid_on:" + qch_restore_forbid_on);
|
||||
//默认打开
|
||||
}
|
||||
|
||||
@@ -619,10 +620,10 @@ public class SysSettingUtils {
|
||||
int mode = jsonObject.getInteger("qch_restore");
|
||||
if (mode == 1) {
|
||||
boolean qch_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_restore_forbid_on", 0);
|
||||
Logutils.e(TAG, "qch_restore_forbid_on:" + qch_restore_forbid_on);
|
||||
Log.e(TAG, "qch_restore_forbid_on:" + qch_restore_forbid_on);
|
||||
} else {
|
||||
boolean qch_restore_forbid_on = Settings.System.putInt(context.getContentResolver(), "qch_restore_forbid_on", 1);
|
||||
Logutils.e(TAG, "qch_restore_forbid_on:" + qch_restore_forbid_on);
|
||||
Log.e(TAG, "qch_restore_forbid_on:" + qch_restore_forbid_on);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -664,7 +665,7 @@ public class SysSettingUtils {
|
||||
break;
|
||||
}
|
||||
}
|
||||
Logutils.e(TAG, "setAutoTime: " + "action=" + action);
|
||||
Log.e(TAG, "setAutoTime: " + "action=" + action);
|
||||
Intent intent = new Intent();
|
||||
intent.setAction(action);
|
||||
intent.setPackage("com.android.settings");
|
||||
@@ -672,7 +673,7 @@ public class SysSettingUtils {
|
||||
}
|
||||
|
||||
private static void setAutoTime(Context context, int state) {
|
||||
Logutils.e(TAG, "setAutoTime: " + "default");
|
||||
Log.e(TAG, "setAutoTime: " + "default");
|
||||
Intent intent = new Intent();
|
||||
intent.setAction("qch_autotime_network");
|
||||
intent.setPackage("com.android.settings");
|
||||
@@ -681,7 +682,7 @@ public class SysSettingUtils {
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
public static void setStatusBar(Context context, JSONObject jsonObject) {
|
||||
Logutils.e(TAG, "setStatusBar: " + jsonObject.toJSONString());
|
||||
Log.e(TAG, "setStatusBar: " + jsonObject.toJSONString());
|
||||
if (null != jsonObject) {
|
||||
int whole = jsonObject.getInteger("whole");
|
||||
if (whole == 1) {
|
||||
@@ -715,7 +716,7 @@ public class SysSettingUtils {
|
||||
|
||||
@SuppressLint("NewApi")
|
||||
private static void setStatusBar(Context context, int state) {
|
||||
Logutils.e(TAG, "setStatusBar: " + "default");
|
||||
Log.e(TAG, "setStatusBar: " + "default");
|
||||
StatusBarManager mStatusBarManager = (StatusBarManager) context.getSystemService(Context.STATUS_BAR_SERVICE);
|
||||
mStatusBarManager.disable(StatusBarManager.DISABLE_BACK | StatusBarManager.DISABLE_RECENT | StatusBarManager.DISABLE_HOME);
|
||||
mStatusBarManager.disable(StatusBarManager.DISABLE_NONE);//显示隐藏的虚拟按键
|
||||
@@ -731,15 +732,15 @@ public class SysSettingUtils {
|
||||
int state = 1;
|
||||
try {
|
||||
state = jsonObject.getInteger("setting_browserInput");
|
||||
Logutils.e(TAG, "setBrowserInput: " + state);
|
||||
Log.e(TAG, "setBrowserInput: " + state);
|
||||
String json = jsonObject.getString("setting_browserInput");
|
||||
if (TextUtils.isEmpty(json)) {
|
||||
state = 1;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
Logutils.e(TAG, "setBrowserInput: e: " + e.getMessage());
|
||||
Log.e(TAG, "setBrowserInput: e: " + e.getMessage());
|
||||
}
|
||||
Logutils.e(TAG, "setBrowserInput: " + state);
|
||||
Log.e(TAG, "setBrowserInput: " + state);
|
||||
//后台没有这个选项默认打开
|
||||
if (state == 0) {
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_Browser_input", 1);
|
||||
|
||||
Reference in New Issue
Block a user