update:2019.04.11
fix:修复状态栏管控 add:增加OTG管控
This commit is contained in:
@@ -130,6 +130,22 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
mContext.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);
|
||||
mContext.sendBroadcast(otgIntent);
|
||||
|
||||
//蓝牙开关
|
||||
int setting_bluetooth = changeNum(data.optInt("setting_bluetooth"));
|
||||
boolean qch_bt_forbid_on = Settings.System.putInt(mContext.getContentResolver(), "qch_bt_forbid_on", setting_bluetooth);
|
||||
Log.e("SystemSetting", "qch_bt_forbid_on---------" + setting_bluetooth);
|
||||
@@ -162,7 +178,19 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
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);
|
||||
@@ -367,39 +395,45 @@ public class MyJPushReceiver extends BroadcastReceiver {
|
||||
|
||||
|
||||
private void getDeselectID() {
|
||||
Network.getDeselectIDApi().getDeselectIDApi("YTM3YTAxNTJmMmZmNzkyM2E2YzIwZjlhZTc0NzNmMGI=", Utils.getSerial()).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()).subscribe(new Observer<ResponseBody>() {
|
||||
public void onComplete() {
|
||||
}
|
||||
|
||||
public void onError(Throwable param1Throwable) {
|
||||
Log.e("mjsheng", "DeselectIDApi=onError:");
|
||||
}
|
||||
|
||||
public void onNext(ResponseBody param1ResponseBody) {
|
||||
try {
|
||||
String str1;
|
||||
String str2 = param1ResponseBody.string();
|
||||
Log.e("mjsheng", str2);
|
||||
JSONObject jSONObject = new JSONObject(str2);
|
||||
switch (Integer.valueOf(jSONObject.optInt("code")).intValue()) {
|
||||
case 200:
|
||||
str1 = jSONObject.getJSONObject("data").optString("ids");
|
||||
str2 = jSONObject.getJSONObject("data").optString("package");
|
||||
writeDeselectIDtoSystem(str1, str2);
|
||||
return;
|
||||
Network.getDeselectIDApi()
|
||||
.getDeselectIDApi("YTM3YTAxNTJmMmZmNzkyM2E2YzIwZjlhZTc0NzNmMGI=",
|
||||
Utils.getSerial())
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(new Observer<ResponseBody>() {
|
||||
public void onComplete() {
|
||||
}
|
||||
Log.e("mjsheng", "getDeselectID---code is -200");
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
Log.e("mjsheng", "getDeselectID---woring----" + e.getMessage());
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void onSubscribe(Disposable param1Disposable) {
|
||||
}
|
||||
});
|
||||
public void onError(Throwable param1Throwable) {
|
||||
Log.e("mjsheng", "DeselectIDApi=onError:");
|
||||
}
|
||||
|
||||
public void onNext(ResponseBody param1ResponseBody) {
|
||||
try {
|
||||
String str1;
|
||||
String str2 = param1ResponseBody.string();
|
||||
Log.e("mjsheng", str2);
|
||||
JSONObject jSONObject = new JSONObject(str2);
|
||||
switch (Integer.valueOf(jSONObject.optInt("code")).intValue()) {
|
||||
case 200:
|
||||
str1 = jSONObject.getJSONObject("data").optString("ids");
|
||||
str2 = jSONObject.getJSONObject("data").optString("package");
|
||||
writeDeselectIDtoSystem(str1, str2);
|
||||
return;
|
||||
}
|
||||
Log.e("mjsheng", "getDeselectID---code is -200");
|
||||
return;
|
||||
} catch (Exception e) {
|
||||
Log.e("mjsheng", "getDeselectID---woring----" + e.getMessage());
|
||||
e.printStackTrace();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
public void onSubscribe(Disposable param1Disposable) {
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user