package com.uiui.sn.manager; import android.annotation.SuppressLint; import android.bluetooth.BluetoothAdapter; import android.content.ContentResolver; import android.content.Context; import android.content.Intent; import android.os.Build; import android.provider.Settings; import android.text.TextUtils; import android.util.Log; import com.google.gson.JsonObject; import com.uiui.sn.bean.SystemSettings; import com.uiui.sn.config.CommonConfig; import com.uiui.sn.utils.ApkUtils; import com.uiui.sn.gson.GsonUtils; import com.uiui.sn.utils.JGYUtils; import com.uiui.sn.utils.SPUtils; import com.uiui.sn.utils.ToastUtil; import java.util.Arrays; import java.util.HashSet; import java.util.function.Predicate; /** * 系统管理处理 * 所有数据 后台1是0否,底层0是1否 * * @author jgy02 */ public class ControlManager { private static final String TAG = ControlManager.class.getSimpleName(); @SuppressLint("StaticFieldLeak") private static ControlManager sInstance; private Context mContext; private ContentResolver mResolver; private ControlManager(Context context) { if (context == null) { throw new RuntimeException("Context is NULL"); } this.mContext = context; this.mResolver = context.getContentResolver(); } public static void init(Context context) { if (sInstance == null) { sInstance = new ControlManager(context); } } public static ControlManager getInstance() { if (sInstance == null) { throw new IllegalStateException("You must be init ControlManager first"); } return sInstance; } private int changeNum(int status) { return status == 0 ? 1 : 0; } public void setSystemSetting(String jsonString) { if (TextUtils.isEmpty(jsonString)) { return; } SystemSettings settings = GsonUtils.toJavaObject(jsonString, SystemSettings.class); if (null != settings) { setUSBstate(settings); setPhoneList(settings); setBluetooth(settings); setHotspot(settings); setBar(settings); setCamera(settings); setTF(settings); setIcon(settings); setCanReset(settings); setDeveloperOptions(jsonString); setSearchTopic(jsonString); setSOSNumber(settings); setAppstoreAdmin(settings); JGYUtils.getInstance().updateForbidList(); } } /** * 关闭所有功能 */ public void setDisableSetting() { Log.e("setDisableSetting", "Close all settings: "); setUSBstate(1); setPhoneList(1); setBluetooth(1); setHotspot(1); setCamera(1); setTF(1); setIcon(1); setWallpaper(0); setCanReset(1); setBrowserInput(1); if (!DeviceManager.isDebugMode()) { setDeveloperOptions(1); } setSearchTopic(0); } /** * usb连接模式管控 * * @param settings */ private void setUSBstate(SystemSettings settings) { //USB数据功能管控 //仅充电:usb_charge //MTP模式:usb_mtp //Midi模式:usb_midi String setting_usb = settings.getSetting_usb(); Log.e("SystemSetting", "setting_usb:" + setting_usb); if (!DeviceManager.isDebugMode()) { try { boolean qch_usb_choose = JGYUtils.putString(mResolver, "qch_usb_choose", setting_usb); Log.e("SystemSetting", "qch_usb_choose:" + qch_usb_choose); String usbStatus = ""; switch (setting_usb) { case "usb_charge": usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE; break; case "usb_mtp": usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MTP; break; // case "usb_midi": // usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MIDI; // break; default: usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE; break; } Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings"); mContext.sendBroadcast(usbIntent); } catch (Exception e) { Log.e(TAG, "setUSBstate: " + e.getMessage()); } } } /** * usb连接模式管控 * * @param state */ public void setUSBstate(int state) { //USB数据功能管控 //仅充电:usb_charge //MTP模式:usb_mtp //Midi模式:usb_midi if (!DeviceManager.isDebugMode()) { try { boolean qch_usb_choose = Settings.System.putString(mResolver, "qch_usb_choose", "usb_charge"); Log.e(TAG, "qch_usb_choose:" + qch_usb_choose); String usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE; Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings"); mContext.sendBroadcast(usbIntent); } catch (Exception e) { Log.e(TAG, "setUSBstate: " + e.getMessage()); } } } private void setPhoneList(SystemSettings settings) { //设置电话功能,电话白名单 int setting_call = changeNum(settings.getSetting_call()); boolean qch_call_forbid = JGYUtils.putInt(mResolver, "qch_call_forbid", setting_call); Log.e("SystemSetting", "qch_call_forbid: " + setting_call); int setting_phone = changeNum(settings.getSetting_phone()); boolean aole_white_list_on = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_WHITE_LIST_ON, setting_phone); Log.e("SystemSetting", "aole_white_list_on: " + setting_phone); String setting_phones = settings.getSetting_phones(); boolean aole_white_list_Array = JGYUtils.putString(mResolver, CommonConfig.AOLE_ACTION_WHITE_LIST_ARRAY, setting_phones); Log.e("SystemSetting", "aole_white_list_Array: " + aole_white_list_Array + "=" + setting_phones); int setting_memory = changeNum(settings.getSetting_memory()); boolean aole_sdcard_forbid_on = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, setting_memory); Log.e("SystemSetting", "aole_sdcard_forbid_on: " + setting_memory); } private void setPhoneList(int state) { try { //设置电话功能,电话白名单 boolean qch_call_forbid = Settings.System.putInt(mResolver, "qch_call_forbid", state); Log.e(TAG, "qch_call_forbid:" + qch_call_forbid); boolean aole_white_list_on = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_WHITE_LIST_ON, state); Log.e(TAG, "aole_white_list_on:" + aole_white_list_on); boolean aole_white_list_Array = Settings.System.putString(mResolver, CommonConfig.AOLE_ACTION_WHITE_LIST_ARRAY, ""); // ToastTool.show("qch_call_forbid::"+setting_call+"----setting_phones::"+setting_phones+"----"+aole_white_list_Array+"---"+qch_call_forbid); Log.e(TAG, "aole_white_list_Array:" + aole_white_list_Array + "---" + aole_white_list_Array); boolean aole_sdcard_forbid_on = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_SDCARD_FORBID_ON, state); Log.e(TAG, "aole_sdcard_forbid_on:" + aole_sdcard_forbid_on); } catch (Exception e) { Log.e(TAG, "setPhoneList: " + e.getMessage()); } } private void setBluetooth(SystemSettings settings) { try { //蓝牙开关 int setting_bht = changeNum(settings.getSetting_bht()); //总开关 int setting_bhtvideo = changeNum(settings.getSetting_bhtvideo()); //蓝牙音频开关 int setting_bluetooth = changeNum(settings.getSetting_bluetooth()); //蓝牙传输开关 boolean aole_bht_forbid_on = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_BHT_FORBID_ON, setting_bht); //写入系统数据库 Log.e("SystemSetting", "aole_bht_forbid_on:" + aole_bht_forbid_on); BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); if (aole_bht_forbid_on) { //成功 if (null == mBluetoothAdapter) { mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); //获取默认蓝牙适配器 } if (setting_bht == 0) { //蓝牙总开关开启 String setting_context = settings.getSetting_context(); if (setting_bhtvideo == 0) { if (null != setting_context && !"".equals(setting_context) && !" ".equals(setting_context) && !"null".equals(setting_context)) { Log.e("SystemSetting", "setting_context:" + setting_context); JGYUtils.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, setting_context); } else { JGYUtils.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty"); } } else if (setting_bhtvideo == 1) { JGYUtils.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty"); } JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_BT_FORBID_ON, setting_bluetooth); } else { mBluetoothAdapter.disable(); //设置关闭时关闭蓝牙 } } } catch (Exception e) { Log.e(TAG, "setBluetooth: " + e.getMessage()); } } private void setBluetooth(int state) { try { boolean aole_bht_forbid_on = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_BHT_FORBID_ON, state); //写入系统数据库 Log.e(TAG, "aole_bht_forbid_on:" + aole_bht_forbid_on); BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); if (aole_bht_forbid_on) { //成功 if (null == mBluetoothAdapter) { mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); //获取默认蓝牙适配器 } //蓝牙总开关开启 Settings.System.putString(mResolver, CommonConfig.AOLE_ACTION_BHTVIDEO_FORBID_ON, "Empty"); Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_BT_FORBID_ON, state); mBluetoothAdapter.disable(); //设置关闭时关闭蓝牙 } } catch (Exception e) { Log.e(TAG, "setBluetooth: " + e.getMessage()); } } private void setHotspot(SystemSettings settings) { try { int setting_hotspot = changeNum(settings.getSetting_hotspot());//热点 if (setting_hotspot == 1) { Intent intent = new Intent(); intent.setAction("qch_hotspot_close"); intent.setPackage("com.android.settings"); mContext.sendStickyBroadcast(intent); } boolean aole_hotspot_forbid_on = JGYUtils.putInt(mResolver, 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()); } } private void setHotspot(int state) { try { Intent intent = new Intent(); intent.setAction("qch_hotspot_close"); intent.setPackage("com.android.settings"); mContext.sendStickyBroadcast(intent); boolean aole_hotspot_forbid_on = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_HOTSPOT_FORBID_ON, state); Log.e(TAG, "aole_hotspot_forbid_on:" + aole_hotspot_forbid_on); } catch (Exception e) { Log.e(TAG, "setHotspot: " + e.getMessage()); } } private void setBar(SystemSettings settings) { //系统导航条显示开关 int setting_navigation = changeNum(settings.getSetting_navigation()); boolean aole_hide_NavigationBar = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR, setting_navigation); Log.e("SystemSetting", "aole_hide_NavigationBar:" + aole_hide_NavigationBar); String navigationStatus = ""; switch (setting_navigation) { case 0: navigationStatus = CommonConfig.AOLE_ACTION_SHOW_NAVIGATION_BAR; break; case 1: navigationStatus = CommonConfig.AOLE_ACTION_HIDE_NAVIGATION_BAR; break; default: } Intent navIntent = new Intent(navigationStatus).setPackage("com.android.systemui"); mContext.sendBroadcast(navIntent); //状态栏显示开关 int setting_statusbar = changeNum(settings.getSetting_statusbar()); int oldNum = JGYUtils.getInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, 0); if (oldNum != setting_statusbar) { boolean aole_hide_statusBar = JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR, setting_statusbar); Log.e("SystemSetting", "aole_hide_statusBar:" + aole_hide_statusBar); String statusbarStatus = ""; switch (setting_statusbar) { case 0: statusbarStatus = CommonConfig.AOLE_ACTION_SHOW_STATUS_BAR; break; case 1: statusbarStatus = CommonConfig.AOLE_ACTION_HIDE_STATUS_BAR; break; default: } Intent statusIntent = new Intent(statusbarStatus).setPackage("com.android.systemui"); mContext.sendBroadcast(statusIntent); } } private void setCamera(SystemSettings settings) { try { //摄像头开关 int setting_camera = changeNum(settings.getSetting_camera()); JGYUtils.putInt(mResolver, "qch_app_camera", setting_camera); // ApkUtils.hideSystemSettingAPP(mContext, "com.mediatek.camera"); Log.e("SystemSetting", "setting_camera:" + setting_camera); String cameraStatus = ""; switch (setting_camera) { case 0: cameraStatus = "qch_camera_open"; break; case 1: cameraStatus = "qch_camera_forbid"; break; } Intent cameraIntent = new Intent(cameraStatus).setPackage("com.android.settings"); mContext.sendBroadcast(cameraIntent); } catch (Exception e) { Log.e(TAG, "setCamera: " + e.getMessage()); } } private void setCamera(int state) { try { //摄像头开关 boolean qch_app_camera = Settings.System.putInt(mResolver, "qch_app_camera", state); Log.e(TAG, "qch_app_camera1:" + state); // ApkUtils.hideSystemSettingAPP(mContext, "com.mediatek.camera"); Log.e(TAG, "setting_camera---------" + qch_app_camera); String cameraStatus = "qch_camera_forbid"; switch (state) { case 0: cameraStatus = "qch_camera_open"; break; case 1: cameraStatus = "qch_camera_forbid"; break; } Intent cameraIntent = new Intent(cameraStatus).setPackage("com.android.settings"); mContext.sendBroadcast(cameraIntent); } catch (Exception e) { Log.e(TAG, "setCamera: " + e.getMessage()); } } @SuppressLint("NewApi") private void setTF(SystemSettings settings) { //tfmedia开关 int setting_tfmedia = changeNum(settings.getSetting_tfmedia()); boolean qch_tfmedia_forbid = JGYUtils.putInt(mResolver, "qch_tfmedia_forbid", setting_tfmedia); Log.e("SystemSetting", "setting_tfmedia:" + qch_tfmedia_forbid); String tfmediaStatus = ""; switch (setting_tfmedia) { case 0: tfmediaStatus = "qch_tfmedia_open"; break; case 1: tfmediaStatus = "qch_tfmedia_forbid"; break; default: break; } Intent tfmediaIntent = new Intent(tfmediaStatus).setPackage("com.android.settings"); mContext.sendBroadcast(tfmediaIntent); if (setting_tfmedia == 1) { String qch_tfmedia_filetypes = settings.getSetting_tfmedia_format(); if (TextUtils.isEmpty(qch_tfmedia_filetypes)) { JGYUtils.putString(mResolver, "qch_tfmedia_filetypes", "");//影音管控 } else { HashSet types = new HashSet<>(Arrays.asList(qch_tfmedia_filetypes.split(","))); types.removeIf(new Predicate() { @Override public boolean test(String s) { return TextUtils.isEmpty(s); } }); String typesString = String.join(",", types); JGYUtils.putString(mResolver, "qch_tfmedia_filetypes", typesString);//影音管控 Log.e("SystemSetting", "qch_tfmedia_filetypes :" + typesString); } } else { JGYUtils.putInt(mResolver, "qch_tfmedia_forbid", 0); } } private void setTF(int state) { try { //tfmedia开关 // int setting_tfmedia = 1; boolean qch_tfmedia_forbid = Settings.System.putInt(mResolver, "qch_tfmedia_forbid", state); Log.e(TAG, "setting_tfmedia---------" + qch_tfmedia_forbid); String tfmediaStatus = ""; switch (state) { case 0: tfmediaStatus = "qch_tfmedia_open"; break; case 1: tfmediaStatus = "qch_tfmedia_forbid"; break; } Intent tfmediaIntent = new Intent(tfmediaStatus).setPackage("com.android.settings"); mContext.sendBroadcast(tfmediaIntent); if (state == 1) { boolean qch_tfmedia_filetypes = Settings.System.putString(mResolver, "qch_tfmedia_filetypes", "Empty");//影音管控 Log.e(TAG, "qch_tfmedia_filetypes:" + qch_tfmedia_filetypes); } else { Settings.System.putInt(mResolver, "qch_tfmedia_forbid", 0); } } catch (Exception e) { Log.e(TAG, "setTF: " + e.getMessage()); } } private void setIcon(SystemSettings settings) { try { //added:2019.12.6 //设置5个app的开关 //时钟 int deskclock = changeNum(settings.getSetting_clock()); JGYUtils.putInt(mResolver, "qch_app_deskclock", deskclock); ApkUtils.hideSystemSettingAPP(mContext, "com.android.deskclock"); Log.e("SystemSetting", "qch_app_deskclock:" + deskclock); //录音机 int soundrecorder = changeNum(settings.getSetting_recording()); JGYUtils.putInt(mResolver, "qch_app_soundrecorder", soundrecorder); ApkUtils.hideSystemSettingAPP(mContext, "com.android.soundrecorder"); Log.e("SystemSetting", "qch_app_soundrecorder:" + soundrecorder); //音乐 int music = changeNum(settings.getSetting_music()); JGYUtils.putInt(mResolver, "qch_app_music", music); ApkUtils.hideSystemSettingAPP(mContext, "com.android.music"); Log.e("SystemSetting", "qch_app_music:" + music); //图库 int gallery = changeNum(settings.getSetting_picture()); JGYUtils.putInt(mResolver, "qch_app_gallery", gallery); ApkUtils.hideSystemSettingAPP(mContext, "com.android.gallery3d"); Log.e("SystemSetting", "qch_app_gallery:" + gallery); //壁纸 int wallpaper = changeNum(settings.getSetting_wallpaper()); JGYUtils.putInt(mResolver, "qch_app_wallpaper", wallpaper); Log.e("SystemSetting", "qch_app_wallpaper:" + wallpaper); //文件管理器 int filemanager = changeNum(settings.getSetting_file()); JGYUtils.putInt(mResolver, "qch_app_filemanager", filemanager); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { ApkUtils.hideSystemSettingAPP(mContext, "com.mediatek.filemanager"); } else { ApkUtils.hideSystemSettingAPP(mContext, "com.android.documentsui"); } Log.e("SystemSetting", "qch_app_filemanager:" + filemanager); //浏览器 int browser = changeNum(settings.getSetting_browser()); JGYUtils.putInt(mResolver, "qch_app_browser", browser); Log.e(TAG, "qch_app_browser" + browser); } catch (Exception e) { Log.e(TAG, "setIcon: " + e.getMessage()); } } private void setIcon(int state) { try { //added:2019.12.6 //设置5个app的开关 //时钟 // int deskclock = 1; Settings.System.putInt(mResolver, "qch_app_deskclock", state); ApkUtils.hideSystemSettingAPP(mContext, "com.android.deskclock"); Log.e(TAG, "qch_app_deskclock" + state); //录音机 // int soundrecorder = 1; Settings.System.putInt(mResolver, "qch_app_soundrecorder", state); ApkUtils.hideSystemSettingAPP(mContext, "com.android.soundrecorder"); Log.e(TAG, "qch_app_soundrecorder" + state); //音乐 // int music = 1; Settings.System.putInt(mResolver, "qch_app_music", state); ApkUtils.hideSystemSettingAPP(mContext, "com.android.music"); Log.e(TAG, "qch_app_music" + state); //图库 // int gallery = 1; Settings.System.putInt(mResolver, "qch_app_gallery", state); ApkUtils.hideSystemSettingAPP(mContext, "com.android.gallery3d"); Log.e(TAG, "qch_app_gallery" + state); //文件管理器 // int filemanager = 1; Settings.System.putInt(mResolver, "qch_app_filemanager", state); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.O) { ApkUtils.hideSystemSettingAPP(mContext, "com.mediatek.filemanager"); } else { ApkUtils.hideSystemSettingAPP(mContext, "com.android.documentsui"); } Log.e(TAG, "qch_app_filemanager" + state); //浏览器 Settings.System.putInt(mResolver, "qch_app_browser", state); Log.e(TAG, "qch_app_browser" + state); } catch (Exception e) { Log.e(TAG, "setIcon: " + e.getMessage()); } } private void setWallpaper(int state) { //壁纸 // int wallpaper = 1; Settings.System.putInt(mResolver, "qch_app_wallpaper", state); Log.e(TAG, "qch_app_wallpaper" + state); } private void setCanReset(SystemSettings settings) { int mode = settings.getQch_restore(); if (mode == 1) { Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 0); } else { Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 1); } Log.e(TAG, "aole_restore_forbid_on:" + mode); } private void setCanReset(int state) { boolean aole_restore_forbid_on = Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_RESTORE_FORBID_ON, 0); Log.e(TAG, "aole_restore_forbid_on:" + aole_restore_forbid_on); //默认打开 } /** * 置浏览器禁止输入,默认打开 * * @param state */ private void setBrowserInput(int state) { Settings.System.putInt(mResolver, "qch_Browser_input", 0); } public void setDeveloperOptions(String jsonString) { JsonObject jsonObject = GsonUtils.getJsonObject(jsonString); int dev_mode = changeNum(jsonObject.get("dev_mode").getAsInt()); Log.e(TAG, "getDeveloper: " + dev_mode); if (!DeviceManager.isDebugMode()) { JGYUtils.putInt(mResolver, CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, dev_mode); if (dev_mode == 1) { Intent intent = new Intent(); intent.setAction("qch_developeroptions_close"); intent.setPackage("com.android.settings"); mContext.sendBroadcast(intent); Log.e(TAG, "getDeveloper: " + "关闭开发者模式"); ToastUtil.debugShow("关闭开发者模式"); } else { Log.e(TAG, "getDeveloper: " + "打开开发者模式"); ToastUtil.debugShow("打开开发者模式"); } } } public void setDeveloperOptions(int state) { Log.e(TAG, "getDeveloper: " + state); if (!DeviceManager.isDebugMode()) { Settings.System.putInt(mResolver, CommonConfig.AOLE_ACTION_DEVELOPER_OPTIONS, state); if (state == 1) { Intent intent = new Intent(); intent.setAction("qch_developeroptions_close"); intent.setPackage("com.android.settings"); mContext.sendBroadcast(intent); Log.e(TAG, "getDeveloper: " + "关闭开发者模式"); } else { Log.e(TAG, "getDeveloper: " + "打开开发者模式"); // ToastUtil.show("打开开发者模式"); } } } public void setSearchTopic(String jsonString) { JsonObject jsonObject = GsonUtils.getJsonObject(jsonString); if (jsonObject.get("search_topic") == null) return; int mode = jsonObject.get("search_topic").getAsInt(); SPUtils.put(mContext, "search_topic", mode); Log.e(TAG, "search_topic:" + mode); } public void setSearchTopic(int state) { SPUtils.put(mContext, "search_topic", state); Log.e(TAG, "search_topic:" + state); } /** * 开机管控usb */ public void setDefaultUSBstate() { //USB数据功能管控 //仅充电:usb_charge //MTP模式:usb_mtp //Midi模式:usb_midi String setting_usb = JGYUtils.getString(mResolver, "qch_usb_choose"); Log.e("SystemSetting", "setting_usb:" + setting_usb); String usbStatus = ""; if (TextUtils.isEmpty(setting_usb)) { usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE; } else { if (!DeviceManager.isDebugMode()) { switch (setting_usb) { case "usb_charge": usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE; break; case "usb_mtp": usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MTP; break; // case "usb_midi": // usbStatus = CommonConfig.AOLE_ACTION_USB_USB_MIDI; // break; default: usbStatus = CommonConfig.AOLE_ACTION_USB_USB_CHARGE; break; } } } Intent usbIntent = new Intent(usbStatus).setPackage("com.android.settings"); mContext.sendBroadcast(usbIntent); } private void setSOSNumber(SystemSettings settings) { String setting_sos = settings.getSetting_sos(); Settings.System.putString(mResolver, "setting_sos", setting_sos); Intent intent = new Intent("setting_sos"); intent.putExtra("setting_sos", setting_sos); intent.setPackage("com.uiui.os"); mContext.sendBroadcast(intent); } private void setAppstoreAdmin(SystemSettings settings) { int setting_admin_app = settings.getSetting_admin_app(); Settings.System.putInt(mResolver, "setting_admin_app", setting_admin_app); } private void setSetting(SystemSettings settings) { int setting_volume = settings.getSetting_volume(); int setting_luminance = settings.getSetting_luminance(); String setting_typeface = settings.getSetting_typeface(); } private void setScreenShared(SystemSettings settings) { int projection_screen = settings.getProjection_screen(); setScreenShared(projection_screen); } private void setScreenShared(int state) { Settings.System.putInt(mResolver, "projection_screen", state); } private void setHotPoint(SystemSettings settings) { int hot_point = settings.getHot_point(); setScreenShared(hot_point); } private void setHotPoint(int state) { Settings.System.putInt(mResolver, "hot_point", state); } private void setDefaultApp(SystemSettings settings) { String desktop_app = settings.getDesktop_app(); String browser_app = settings.getBrowser_app(); String typewriting_app = settings.getTypewriting_app(); } private void setIsControl(SystemSettings settings) { int is_control = settings.getIs_control(); setIsControl(is_control); } private void setIsControl(int state) { Settings.System.putInt(mResolver, "is_control", state); } }