update:2020.06.03
fix: add:增加禁止滑动和隐藏桌面图标功能
This commit is contained in:
@@ -88,6 +88,10 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
|
||||
private final String DISABLE_APPUPDATE = "17";//禁止app升级
|
||||
|
||||
private final String HIDE_DESKTOP_ICON = "18";//隐藏桌面图标
|
||||
|
||||
private final String DISABLE_APP_SLIDE = "19";//隐藏桌面图标
|
||||
|
||||
|
||||
private Context mContext;
|
||||
|
||||
@@ -314,7 +318,8 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
if (!SaveListUtils.isDownLoading(app_url)) {
|
||||
Aria.download(this)
|
||||
.load(app_url)
|
||||
.setFilePath(PathUtils.getExternalDownloadsPath() + "/ygj/" + EncryptUtils.encryptMD5ToString(s) + ".apk").setExtendField(app_package)
|
||||
.setFilePath(PathUtils.getExternalDownloadsPath() + "/ygj/" + EncryptUtils.encryptMD5ToString(s) + ".apk")
|
||||
.setExtendField(app_package)
|
||||
.create();
|
||||
}
|
||||
} else {
|
||||
@@ -328,7 +333,8 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
if (!SaveListUtils.isDownLoading(app_url)) {
|
||||
Aria.download(this)
|
||||
.load(app_url)
|
||||
.setFilePath(PathUtils.getExternalDownloadsPath() + "/ygj/" + EncryptUtils.encryptMD5ToString(s) + ".apk").setExtendField(app_package)
|
||||
.setFilePath(PathUtils.getExternalDownloadsPath() + "/ygj/" + EncryptUtils.encryptMD5ToString(s) + ".apk")
|
||||
.setExtendField(app_package)
|
||||
.create();
|
||||
}
|
||||
}
|
||||
@@ -375,8 +381,9 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
}
|
||||
|
||||
private int getBatteryLevel() {
|
||||
if (Build.VERSION.SDK_INT >= 21)
|
||||
if (Build.VERSION.SDK_INT >= 21) {
|
||||
return ((BatteryManager) this.mContext.getSystemService(Context.BATTERY_SERVICE)).getIntProperty(4);
|
||||
}
|
||||
Intent intent = (new ContextWrapper(this.mContext)).registerReceiver(null, new IntentFilter("android.intent.action.BATTERY_CHANGED"));
|
||||
return intent.getIntExtra("level", -1) * 100 / intent.getIntExtra("scale", -1);
|
||||
}
|
||||
@@ -590,6 +597,33 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
Log.e("fht", extras);
|
||||
setDisableUpdateList(extras);
|
||||
break;
|
||||
case HIDE_DESKTOP_ICON:
|
||||
HTTPInterface.setHideDesktopIcon(context);
|
||||
break;
|
||||
case DISABLE_APP_SLIDE:
|
||||
setDisableSlideList(extras);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
private void setDisableSlideList(String s) {
|
||||
try {
|
||||
JSONObject jSONObject = new JSONObject(s);
|
||||
Log.e("mymjsheng", "jSONObject::" + jSONObject.toString());
|
||||
String strban = jSONObject.optString("ban");
|
||||
String strnot = jSONObject.optString("not");
|
||||
String qch_disable_slide = Settings.System.getString(mContext.getApplicationContext().getContentResolver(), "qch_disable_slide");
|
||||
Log.e("fht", "qch_disable_slide::" + qch_disable_slide);
|
||||
|
||||
if (!strban.equals("")) {
|
||||
Settings.System.putString(mContext.getContentResolver(), "qch_disable_slide", strban);
|
||||
Log.e("fht", "sendban::" + strban);
|
||||
} else {
|
||||
Settings.System.putString(mContext.getContentResolver(), "qch_disable_slide", "invalid");
|
||||
}
|
||||
Log.e("fht", "qch_disable_slide::" + Settings.System.getString(mContext.getApplicationContext().getContentResolver(), "qch_disable_slide"));
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user