update:2019.04.11

fix:修复状态栏管控
add:增加OTG管控
This commit is contained in:
2020-04-11 18:35:38 +08:00
parent a22583da81
commit 800948658c
8 changed files with 325 additions and 64 deletions

View File

@@ -472,7 +472,7 @@ public class MainActivity extends AppCompatActivity implements NetStateChangeObs
Log.e("onSuccess", s);
Log.e("getSerial", Utils.getSerial());
com.alibaba.fastjson.JSONObject msgObject = JSON.parseObject(s);
Log.e("getForceDownload", s);
Log.e("getLockedState", s);
Integer code = (msgObject.getInteger("code"));
if (code == 200) {
com.alibaba.fastjson.JSONObject dataArray = msgObject.getJSONObject("data");
@@ -515,7 +515,7 @@ public class MainActivity extends AppCompatActivity implements NetStateChangeObs
getAppInfo();//上传APP信息
getSystemSetting();//设置系统管控
getNetAndLaunchSetting();//联网管控
Aria.download(this).resumeAllTask();
Aria.download(this).removeAllTask(true);
// getForceDownload();//强制下载apk
resetDevice();//恢复出厂设置
// fromNetToUpdate();
@@ -1079,7 +1079,7 @@ public class MainActivity extends AppCompatActivity implements NetStateChangeObs
.subscribe(new Observer<ForceDownloadBean>() {
@Override
public void onSubscribe(Disposable d) {
Log.e("mjhseng", "forceDownloadApi---onSubscribe");
Log.e("getForceDownload", "forceDownloadApi---onSubscribe");
}
@@ -1096,12 +1096,12 @@ public class MainActivity extends AppCompatActivity implements NetStateChangeObs
@Override
public void onError(Throwable e) {
Log.e("mjsheng", "forceDownloadApi=onError:");
Log.e("getForceDownload", "forceDownloadApi=onError:");
}
@Override
public void onComplete() {
Log.e("mjhseng", "forceDownloadApi---onComplete");
Log.e("getForceDownload", "forceDownloadApi---onComplete");
}
});
}
@@ -1362,6 +1362,23 @@ public class MainActivity extends AppCompatActivity implements NetStateChangeObs
sendBroadcast(usbIntent);
}
//otg开关
int setting_otg = changeNum(data.optInt("setting_otg"));
Log.e("SystemSetting", "setting_otg---------" + setting_otg);
String otgStatus = "";
switch (setting_otg) {
case 0:
otgStatus = "qch_otg_open";
break;
case 1:
otgStatus = "qch_otg_forbid";
break;
}
Intent otgIntent = new Intent(otgStatus);
sendBroadcast(otgIntent);
//蓝牙开关
int setting_bluetooth = changeNum(data.optInt("setting_bluetooth"));
boolean qch_bt_forbid_on = Settings.System.putInt(getContentResolver(), "qch_bt_forbid_on", setting_bluetooth);
Log.e("SystemSetting", "qch_bt_forbid_on---------" + qch_bt_forbid_on);
@@ -1392,7 +1409,19 @@ public class MainActivity extends AppCompatActivity implements NetStateChangeObs
if (oldNum != setting_statusbar) {
boolean qch_hide_statusBar = Settings.System.putInt(mContext.getContentResolver(), "qch_hide_statusBar", setting_statusbar);
Log.e("SystemSetting", "qch_hide_statusBar---------" + qch_hide_statusBar);
String statusbarStatus = "";
switch (setting_statusbar) {
case 0:
statusbarStatus = "qch_show_statusBar";
break;
case 1:
statusbarStatus = "qch_hide_statusBar";
break;
}
Intent statusIntent = new Intent(statusbarStatus);
mContext.sendBroadcast(statusIntent);
}
//摄像头开关
int setting_camera = changeNum(data.optInt("setting_camera"));
Log.e("SystemSetting", "setting_camera---------" + setting_camera);