version:6.4.3
fix: update:增加白名单开关和应用管控分类和开关
This commit is contained in:
@@ -16,6 +16,7 @@ import com.aoleyun.sn.comm.CommonConfig;
|
||||
import com.aoleyun.sn.comm.JGYActions;
|
||||
import com.aoleyun.sn.gson.GsonUtils;
|
||||
import com.google.gson.JsonArray;
|
||||
import com.google.gson.JsonElement;
|
||||
import com.google.gson.JsonObject;
|
||||
import com.google.gson.JsonParser;
|
||||
|
||||
@@ -59,6 +60,7 @@ public class SysSettingUtils {
|
||||
setBrowserInput(context, jsonObject);
|
||||
// TODO: 2022/4/11 不是酷比定制的会报错,无法抛出异常
|
||||
setUSBstate(context, jsonObject);
|
||||
setAdminApp(context, jsonObject);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -83,6 +85,7 @@ public class SysSettingUtils {
|
||||
JGYUtils.getInstance().setDeveloperOptions(1);
|
||||
}
|
||||
setStatusBar(context, 1);
|
||||
setAdminApp(context, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -104,6 +107,7 @@ public class SysSettingUtils {
|
||||
setBrowserInput(context, 0);
|
||||
JGYUtils.getInstance().setDeveloperOptions(0);
|
||||
setStatusBar(context, 0);
|
||||
setAdminApp(context, 0);
|
||||
}
|
||||
|
||||
private static void setPhoneList(Context context, int state) {
|
||||
@@ -796,4 +800,37 @@ public class SysSettingUtils {
|
||||
Settings.System.putInt(context.getContentResolver(), "qch_Browser_input", 0);
|
||||
Settings.Global.putInt(context.getContentResolver(), "is_browser_network", changeNum(state));
|
||||
}
|
||||
|
||||
private static void setAdminApp(Context context, JsonObject jsonObject) {
|
||||
JsonElement appInstall = jsonObject.get("is_app_install");
|
||||
if (appInstall != null) {
|
||||
int is_app_install = appInstall.getAsInt();
|
||||
Log.e(TAG, "setAdminApp: is_admin_app = " + is_app_install);
|
||||
Settings.System.putInt(context.getContentResolver(), "aole_app_allow_install", changeNum(is_app_install));
|
||||
} else {
|
||||
Settings.System.putInt(context.getContentResolver(), "aole_app_allow_install", 1);
|
||||
}
|
||||
|
||||
JsonElement adminApp = jsonObject.get("is_admin_app");
|
||||
if (adminApp != null) {
|
||||
int is_admin_app = adminApp.getAsInt();
|
||||
Log.e(TAG, "setAdminApp: is_admin_app = " + is_admin_app);
|
||||
Settings.Global.putInt(context.getContentResolver(), "is_admin_app", is_admin_app);
|
||||
} else {
|
||||
Settings.Global.putInt(context.getContentResolver(), "is_admin_app", 0);
|
||||
}
|
||||
JsonElement appCategory = jsonObject.get("admin_app_category");
|
||||
if (appCategory != null && !appCategory.isJsonNull()) {
|
||||
String admin_app_category = appCategory.getAsString();
|
||||
Settings.Global.putString(context.getContentResolver(), "admin_app_category", admin_app_category);
|
||||
} else {
|
||||
Settings.Global.putString(context.getContentResolver(), "admin_app_category", "");
|
||||
}
|
||||
}
|
||||
|
||||
private static void setAdminApp(Context context, int state) {
|
||||
Log.e(TAG, "setAdminApp: state = " + state);
|
||||
Settings.Global.putInt(context.getContentResolver(), "is_admin_app", state);
|
||||
Settings.System.putInt(context.getContentResolver(), "aole_app_allow_install", changeNum(state));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user