update:2020.09.25
fix:增加蓝牙管控
add:
This commit is contained in:
2020-09-25 21:00:10 +08:00
parent 685be9a899
commit 4b563bc484
5 changed files with 84 additions and 14 deletions

View File

@@ -38,8 +38,8 @@ android {
productFlavors {
official {
flavorDimensions "default"
versionCode 1023
versionName "2.0.2.3"// 正式jiaoguanyi.com 双数正式 单数测试
versionCode 1024
versionName "2.0.2.4"// 正式jiaoguanyi.com 双数正式 单数测试
/*********************************极光推送************************************/
manifestPlaceholders = [
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
@@ -55,8 +55,8 @@ android {
beta {
flavorDimensions "default"
versionCode 106
versionName "3.1.1"//测试jiaoguanyi.cn
versionCode 107
versionName "3.1.2"//测试jiaoguanyi.cn
/*********************************极光推送************************************/
manifestPlaceholders = [
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",
@@ -88,8 +88,8 @@ android {
}
newl {
flavorDimensions "default"
versionCode 156
versionName "1.1.1"
versionCode 158
versionName "1.1.3"
/*********************************极光推送************************************/
manifestPlaceholders = [
JPUSH_PKGNAME: "com.jiaoguanyi.appstore",

View File

@@ -17,6 +17,8 @@
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN"/>
<!--静默安装权限-->
<uses-permission
android:name="android.permission.INSTALL_PACKAGES"

View File

@@ -2,6 +2,7 @@ package com.mjsheng.myappstore.activity;
import android.app.ActivityManager;
import android.app.AlertDialog;
import android.bluetooth.BluetoothAdapter;
import android.content.BroadcastReceiver;
import android.content.ComponentName;
import android.content.Context;
@@ -1626,6 +1627,8 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
});
}
private BluetoothAdapter mBluetoothAdapter;
private void SettingSysData(JSONObject data) {
// try {
int setting_call = changeNum(data.optInt("setting_call"));
@@ -1688,10 +1691,28 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe
// 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);
Log.e("SystemSetting", "qch_bt_forbid_on---------" + Settings.System.getInt(getContentResolver(), "qch_bt_forbid_on", 0));
int setting_bht = changeNum(data.optInt("setting_bht"));//总开关
int setting_bhtvideo = changeNum(data.optInt("setting_bhtvideo"));//蓝牙音频开关
int setting_bluetooth = changeNum(data.optInt("setting_bluetooth"));//蓝牙传输开关
String setting_context = data.optString("setting_context");//
boolean qch_bht_forbid_on = Settings.System.putInt(getContentResolver(), "qch_bht_forbid_on", setting_bht);
Log.e("SystemSetting", "qch_bht_forbid_on:" + qch_bht_forbid_on);
if (qch_bht_forbid_on) {
if (null == mBluetoothAdapter) {
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
}
if (setting_bht == 0) {
if (setting_bhtvideo == 0) {
Settings.System.putString(getContentResolver(), "qch_bhtvideo_forbid_on", setting_context);
} else if (setting_bhtvideo == 1) {
Settings.System.putString(getContentResolver(), "qch_bhtvideo_forbid_on", "Empty");
}
Settings.System.putInt(getContentResolver(), "qch_bt_forbid_on", setting_bluetooth);
} else {
mBluetoothAdapter.disable();
}
}
//系统导航条显示开关
int setting_navigation = changeNum(data.optInt("setting_navigation"));

View File

@@ -1,5 +1,6 @@
package com.mjsheng.myappstore.receiver;
import android.bluetooth.BluetoothAdapter;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.ContextWrapper;
@@ -293,6 +294,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
}
}
private BluetoothAdapter mBluetoothAdapter;
private void SettingSysData(String extras) {
try {
@@ -360,8 +362,30 @@ public class MyJPushReceiver extends BroadcastReceiver {
// mContext.sendBroadcast(otgIntent);
//蓝牙开关
int setting_bluetooth = changeNum(data.optInt("setting_bluetooth"));
int setting_bht = changeNum(data.optInt("setting_bht"));//总开关
int setting_bhtvideo = changeNum(data.optInt("setting_bhtvideo"));//蓝牙音频开关
int setting_bluetooth = changeNum(data.optInt("setting_bluetooth"));//蓝牙传输开关
String setting_context = data.optString("setting_context");//
boolean qch_bht_forbid_on = Settings.System.putInt(this.mContext.getContentResolver(), "qch_bht_forbid_on", setting_bht);
Log.e("SystemSetting", "qch_bht_forbid_on:" + qch_bht_forbid_on);
if (qch_bht_forbid_on) {
if (null == mBluetoothAdapter) {
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
}
if (setting_bht == 0) {
if (setting_bhtvideo == 0) {
Settings.System.putString(this.mContext.getContentResolver(), "qch_bhtvideo_forbid_on", setting_context);
} else if (setting_bhtvideo == 1) {
Settings.System.putString(this.mContext.getContentResolver(), "qch_bhtvideo_forbid_on", "Empty");
}
Settings.System.putInt(this.mContext.getContentResolver(), "qch_bt_forbid_on", setting_bluetooth);
}else {
mBluetoothAdapter.disable();
}
}
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);
Log.e("SystemSetting", "qch_bt_forbid_on---------" + qch_bt_forbid_on);
Log.e("SystemSetting", "qch_bt_forbid_on---------" + Settings.System.getInt(mContext.getContentResolver(), "qch_bt_forbid_on", 0));
@@ -487,6 +511,7 @@ public class MyJPushReceiver extends BroadcastReceiver {
ApkUtils.hideSystemSettingAPP(this.mContext, "com.android.documentsui");
}
Log.e("SystemSetting", "qch_app_filemanager" + filemanager);
} catch (Exception e) {
e.printStackTrace();
Log.e("mjhseng", "SettingSysData---3error::" + e.getMessage());

View File

@@ -1,6 +1,7 @@
package com.mjsheng.myappstore.server;
import android.app.Service;
import android.bluetooth.BluetoothAdapter;
import android.content.ContextWrapper;
import android.content.Intent;
import android.content.IntentFilter;
@@ -909,6 +910,8 @@ public class InitJpushServer extends Service {
HTTPInterface.checkUpdate(mHandler, "com.jiaoguanyi.store");
}
private BluetoothAdapter mBluetoothAdapter;
private void SettingSysData(JSONObject data) {
try {
int setting_call = changeNum(data.optInt("setting_call"));
@@ -970,9 +973,28 @@ public class InitJpushServer extends Service {
// sendBroadcast(otgIntent);
//蓝牙开关
int setting_bluetooth = changeNum(data.optInt("setting_bluetooth"));
boolean qch_bt_forbid_on = Settings.System.putInt(InitJpushServer.this.getContentResolver(), "qch_bt_forbid_on", setting_bluetooth);
Log.e("SystemSetting", "qch_bt_forbid_on---------" + qch_bt_forbid_on);
int setting_bht = changeNum(data.optInt("setting_bht"));//总开关
int setting_bhtvideo = changeNum(data.optInt("setting_bhtvideo"));//蓝牙音频开关
int setting_bluetooth = changeNum(data.optInt("setting_bluetooth"));//蓝牙传输开关
String setting_context = data.optString("setting_context");//
boolean qch_bht_forbid_on = Settings.System.putInt(InitJpushServer.this.getContentResolver(), "qch_bht_forbid_on", setting_bht);
Log.e("SystemSetting", "qch_bht_forbid_on:" + qch_bht_forbid_on);
if (qch_bht_forbid_on) {
if (null == mBluetoothAdapter) {
mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();
}
if (setting_bht == 0) {
if (setting_bhtvideo == 0) {
Settings.System.putString(InitJpushServer.this.getContentResolver(), "qch_bhtvideo_forbid_on", setting_context);
} else if (setting_bhtvideo == 1) {
Settings.System.putString(InitJpushServer.this.getContentResolver(), "qch_bhtvideo_forbid_on", "Empty");
}
Settings.System.putInt(InitJpushServer.this.getContentResolver(), "qch_bt_forbid_on", setting_bluetooth);
} else {
mBluetoothAdapter.disable();
}
}
//系统导航条显示开关
int setting_navigation = changeNum(data.optInt("setting_navigation"));