删除默认空值为Invalid

This commit is contained in:
2022-07-01 10:07:53 +08:00
parent 77d44943c5
commit dbd36adca5
6 changed files with 33 additions and 31 deletions

View File

@@ -151,7 +151,7 @@ public class MainAPresenter implements MainAContact.Presenter {
NetInterfaceManager.getInstance().getForceInstallState(appInfos);
}
} else {
boolean aole_force_app = JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "invalid");
boolean aole_force_app = JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "");
Log.e("getForceInstall", "aole_force_app: invalid: " + aole_force_app);
}
}

View File

@@ -1251,7 +1251,7 @@ public class NetInterfaceManager {
if (!TextUtils.isEmpty(home_page)) {
homepag.putExtra("homepage", home_page);
} else {
homepag.putExtra("homepage", "Invalid");
homepag.putExtra("homepage", "");
}
mContext.sendBroadcast(homepag);
@@ -1265,7 +1265,7 @@ public class NetInterfaceManager {
if (label_page != null && !"".equals(label_page)) {
websiteBookMark.putExtra("websiteBookMark", label_page);
} else {
websiteBookMark.putExtra("websiteBookMark", "Invalid");
websiteBookMark.putExtra("websiteBookMark", "");
}
mContext.sendBroadcast(websiteBookMark);
} else {
@@ -1274,14 +1274,14 @@ public class NetInterfaceManager {
intent1.setPackage("com.android.settings")
.setPackage("com.android.browser");
}
intent1.putExtra("homepage", "Invalid");
intent1.putExtra("homepage", "");
mContext.sendBroadcast(intent1);
Intent intent2 = new Intent("qch_app_brower_website");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
intent2.setPackage("com.android.settings")
.setPackage("com.android.browser");
}
intent2.putExtra("websiteBookMark", "Invalid");
intent2.putExtra("websiteBookMark", "");
mContext.sendBroadcast(intent2);
}
}
@@ -1574,8 +1574,8 @@ public class NetInterfaceManager {
Log.e(TAG, "setAPPIDJump: " + packages);
Log.e(TAG, "setAPPIDJump: " + ids);
if (TextUtils.isEmpty(ids)) {
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, "Invalid");
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, "Invalid");
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, "");
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, "");
} else {
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ID, packages);
JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_FORBID_ARRAY, ids);
@@ -1584,23 +1584,23 @@ public class NetInterfaceManager {
}
public void setInvalid() {
boolean aole_app_power_on = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_POWER_ON, "Invalid");
boolean aole_network_allow = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "Invalid");
boolean aole_network_disallow = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "Invalid");
boolean aole_app_power_on = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_APP_POWER_ON, "");
boolean aole_network_allow = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
boolean aole_network_disallow = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");
boolean writeSucceed = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_DISABLE_SLIDE, "");
}
private void sendAllweb() {
Intent intent = new Intent("qch_app_website")
.setPackage("com.android.settings");
intent.putExtra("package_name", "Invalid");
intent.putExtra("package_name", "");
mContext.sendBroadcast(intent);
}
private void sendwebUrl() {
Intent intent = new Intent("qch_app_inside_website")
.setPackage("com.android.settings");
intent.putExtra("websitelist", "Invalid");
intent.putExtra("websitelist", "");
mContext.sendBroadcast(intent);
}
@@ -1732,8 +1732,8 @@ public class NetInterfaceManager {
}
// JGYUtils.getInstance().deleteOtherApp();
} else {
boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, "invalid");
Log.e(TAG, "aole_force_app:" + aole_force_app + ":" + "invalid");
boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, "");
Log.e(TAG, "aole_force_app:" + aole_force_app + ":" + "");
}
}
@@ -1782,8 +1782,8 @@ public class NetInterfaceManager {
Log.e(TAG, "getForceInstallState: " + packageList);
boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, packageList);
} else {
boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, "invalid");
Log.e(TAG, "getForceInstallState:" + aole_force_app + ":" + "invalid");
boolean aole_force_app = JGYUtils.putString(crv, CommonConfig.AOLE_ACTION_FORCE_APP, "");
Log.e(TAG, "getForceInstallState:" + aole_force_app + ":" + "");
}
}

View File

@@ -151,6 +151,8 @@ public class MainSPresenter implements MainSContact.Presenter {
NetInterfaceManager.getInstance().getAppStart(appInfoList);
}
JGYUtils.getInstance().deleteOtherApp();
}else {
ApkUtils.writeAppPackageList(mContext, "");
}
}
@@ -230,7 +232,7 @@ public class MainSPresenter implements MainSContact.Presenter {
NetInterfaceManager.getInstance().getForceInstallState(appInfos);
}
} else {
boolean aole_force_app = JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "invalid");
boolean aole_force_app = JGYUtils.putString(mContext.getContentResolver(), CommonConfig.AOLE_ACTION_FORCE_APP, "");
Log.e("getForceInstall", "aole_force_app: invalid: " + aole_force_app);
}
}
@@ -315,7 +317,7 @@ public class MainSPresenter implements MainSContact.Presenter {
if (!TextUtils.isEmpty(home_page)) {
homepag.putExtra("homepage", home_page);
} else {
homepag.putExtra("homepage", "Invalid");
homepag.putExtra("homepage", "");
}
mContext.sendBroadcast(homepag);
@@ -329,7 +331,7 @@ public class MainSPresenter implements MainSContact.Presenter {
if (!TextUtils.isEmpty(label_page)) {
websiteBookMark.putExtra("websiteBookMark", label_page);
} else {
websiteBookMark.putExtra("websiteBookMark", "Invalid");
websiteBookMark.putExtra("websiteBookMark", "");
}
mContext.sendBroadcast(websiteBookMark);
} else {
@@ -338,14 +340,14 @@ public class MainSPresenter implements MainSContact.Presenter {
intent1.setPackage("com.android.settings")
.setPackage("com.android.browser");
}
intent1.putExtra("homepage", "Invalid");
intent1.putExtra("homepage", "");
mContext.sendBroadcast(intent1);
Intent intent2 = new Intent("qch_app_brower_website");
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
intent2.setPackage("com.android.settings")
.setPackage("com.android.browser");
}
intent2.putExtra("websiteBookMark", "Invalid");
intent2.putExtra("websiteBookMark", "");
mContext.sendBroadcast(intent2);
}
}

View File

@@ -906,14 +906,14 @@ public class MessageReceiver extends XGPushBaseReceiver {
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 aole_network_allow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "invalid");
boolean aole_network_allow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
Log.e("fht", "aole_network_allow::" + aole_network_allow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_ALLOW));
}
if (package1.length() != 0) {
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 aole_network_disallow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "invalid");
boolean aole_network_disallow = JGYUtils.putString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");
Log.e("fht", "aole_network_disallow::" + aole_network_disallow + ":" + JGYUtils.getString(context.getContentResolver(), CommonConfig.AOLE_ACTION_NETWORK_DISALLOW));
}
} else {
@@ -1302,7 +1302,7 @@ public class MessageReceiver extends XGPushBaseReceiver {
}
Log.e("blackList", JGYUtils.getString(context.getContentResolver(), "qch_webblack_url"));
} else {
boolean setBrowserUrlpath = JGYUtils.putString(context.getContentResolver(), "DeselectBrowserArray", "invalid");
boolean setBrowserUrlpath = JGYUtils.putString(context.getContentResolver(), "DeselectBrowserArray", "");
ToastUtil.debugShow("setBrowserUrlpath jsonString is NULL,set default: " + setBrowserUrlpath);
}
}

View File

@@ -249,14 +249,14 @@ public class JGYUtils {
private void sendAllweb() {
Intent intent = new Intent("qch_app_website")
.setPackage("com.android.settings");
intent.putExtra("package_name", "Invalid");
intent.putExtra("package_name", "");
mContext.sendBroadcast(intent);
}
private void sendwebUrl() {
Intent intent = new Intent("qch_app_inside_website")
.setPackage("com.android.settings");
intent.putExtra("websitelist", "Invalid");
intent.putExtra("websitelist", "");
mContext.sendBroadcast(intent);
}
@@ -710,11 +710,11 @@ public class JGYUtils {
//清除旧数据
if (!TextUtils.isEmpty(dis)) {
Log.e(TAG, "setAppNetwork: dis = " + dis);
Settings.System.putString(resolver, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "Invalid");
Settings.System.putString(resolver, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");
}
if (!TextUtils.isEmpty(not)) {
Log.e(TAG, "setAppNetwork: not = " + not);
Settings.System.putString(resolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "Invalid");
Settings.System.putString(resolver, CommonConfig.AOLE_ACTION_NETWORK_ALLOW, "");
}
String oldBlackList = (String) SPUtils.get(mContext, CommonConfig.AOLE_ACTION_NETWORK_DISALLOW, "");

View File

@@ -45,7 +45,7 @@ public class URLUtils {
Log.e(TAG, "setBrowserList old: " + oldwhiteList);
if (TextUtils.isEmpty(oldwhiteList) && TextUtils.isEmpty(oldHomePage)) {
Log.e(TAG, "getBrowserWhiteList: " + "oldwhiteList is empty");
Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", "Invalid");
Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", "");
} else {
HashSet<String> URLList = new HashSet<>();
if (!TextUtils.isEmpty(oldwhiteList)) {
@@ -59,7 +59,7 @@ public class URLUtils {
URLList.removeIf(s -> TextUtils.isEmpty(s.trim()));
if (URLList.size() == 0) {
Log.e(TAG, "setBrowserWhiteList: URLList set is empty , set Invalid");
Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", "Invalid");
Settings.System.putString(mContext.getContentResolver(), "DeselectBrowserArray", "");
return;
}
Log.e(TAG, "setBrowserList: " + URLList);
@@ -171,7 +171,7 @@ public class URLUtils {
String qch_webblack_url = Settings.System.getString(mContext.getContentResolver(), "qch_webblack_url");
Log.e(TAG, "setBrowserBlackList: qch_webblack_url = " + qch_webblack_url);
if (TextUtils.isEmpty(qch_webblack_url)) {
Settings.System.putString(mContext.getContentResolver(), "qch_webblack_url", "Invalid");
Settings.System.putString(mContext.getContentResolver(), "qch_webblack_url", "");
} else {
String black_ip = (String) SPUtils.get(mContext, "black_ip", "");
if (!TextUtils.isEmpty(black_ip)) {