fix:
update:优化app霸屏
This commit is contained in:
2022-06-09 20:38:48 +08:00
parent 83159cc584
commit b917401e86
12 changed files with 81 additions and 15 deletions

View File

@@ -10,6 +10,8 @@ import android.provider.Settings;
import android.text.TextUtils;
import android.util.Log;
import com.tencent.mmkv.MMKV;
import java.util.List;
public class ForegroundAppUtil {
@@ -29,7 +31,7 @@ public class ForegroundAppUtil {
}
public static void openTopApp(Context context) {
String topAppName = (String) SPUtils.get(context, ForegroundAppUtil.TOPAPP_KEY, "");
String topAppName = Settings.Global.getString(context.getContentResolver(), ForegroundAppUtil.TOPAPP_KEY);
if (TextUtils.isEmpty(topAppName)) {
return;
}

View File

@@ -1102,8 +1102,8 @@ public class JGYUtils {
pkgSet.removeIf(TextUtils::isEmpty);
String qch_app_forbid = String.join(",", pkgSet);
Log.e(TAG, "writeAppPackageList: " + qch_app_forbid);
boolean b = Settings.System.putString(crv, "qch_app_forbid", qch_app_forbid);
Log.e("writeAppPackageList: ", "qch_app_forbid is :" + b + " " + Settings.System.getString(crv, "qch_app_forbid"));
boolean b = Settings.System.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID, qch_app_forbid);
Log.e("writeAppPackageList: ", "qch_app_forbid is :" + b + " " + Settings.System.getString(crv, CommonConfig.AOLE_ACTION_APP_FORBID));
}
public void checkForceDownload() {
@@ -1314,7 +1314,7 @@ public class JGYUtils {
result_white = only_jgy_shortcut_list.split(",");
}
//获取可以被安装的包名
String qch_app_forbid = Settings.System.getString(crv, "qch_app_forbid");
String qch_app_forbid = Settings.System.getString(crv, CommonConfig.AOLE_ACTION_APP_FORBID);
if (!TextUtils.isEmpty(qch_app_forbid)) {
result_forbid = qch_app_forbid.split(",");
}

View File

@@ -1059,7 +1059,7 @@ public class Utils {
* @return
*/
static synchronized public boolean writeDisableUpdateList(Context context, String[] allowList, String[] disallowList) {
String now = Settings.System.getString(context.getContentResolver(), "qch_app_forbid");
String now = Settings.System.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID);
String[] nowList;
List<String> allList;
if (now == null || "".equalsIgnoreCase(now)) {
@@ -1096,10 +1096,10 @@ public class Utils {
}
list = list.substring(0, list.length() - 1);
Log.e("fht", list);
writeSucceed = Settings.System.putString(context.getContentResolver(), "qch_app_forbid", list);
writeSucceed = Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, list);
Log.e("fht", "qch_app_forbid:" + list);
} else {
writeSucceed = Settings.System.putString(context.getContentResolver(), "qch_app_forbid", "Invalid");
writeSucceed = Settings.System.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_APP_FORBID, "Invalid");
}
return writeSucceed;