From 737a398e349af533f30ae3bcf856d8d6cb9bc91c Mon Sep 17 00:00:00 2001 From: Administrator <981964879@qq.com> Date: Tue, 29 Sep 2020 16:59:00 +0800 Subject: [PATCH] =?UTF-8?q?version:=20update:2020.09.29=20fix:=E4=BC=98?= =?UTF-8?q?=E5=8C=96=E8=93=9D=E7=89=99=E7=AE=A1=E6=8E=A7=20add:?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/build.gradle | 12 ++++---- .../myappstore/activity/MainActivity.java | 22 +++++++++------ .../myappstore/receiver/MyJPushReceiver.java | 28 ++++++++++--------- .../myappstore/server/InitJpushServer.java | 20 ++++++++----- 4 files changed, 48 insertions(+), 34 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 6542add..a422417 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -38,8 +38,8 @@ android { productFlavors { official { flavorDimensions "default" - versionCode 1024 - versionName "2.0.2.4"// 正式jiaoguanyi.com 双数正式 单数测试 + versionCode 1025 + versionName "2.0.2.5"// 正式jiaoguanyi.com 双数正式 单数测试 /*********************************极光推送************************************/ manifestPlaceholders = [ JPUSH_PKGNAME: "com.jiaoguanyi.appstore", @@ -55,8 +55,8 @@ android { beta { flavorDimensions "default" - versionCode 107 - versionName "3.1.2"//测试jiaoguanyi.cn + versionCode 108 + versionName "3.1.3"//测试jiaoguanyi.cn /*********************************极光推送************************************/ manifestPlaceholders = [ JPUSH_PKGNAME: "com.jiaoguanyi.appstore", @@ -88,8 +88,8 @@ android { } newl { flavorDimensions "default" - versionCode 158 - versionName "1.1.3" + versionCode 159 + versionName "1.1.4" /*********************************极光推送************************************/ manifestPlaceholders = [ JPUSH_PKGNAME: "com.jiaoguanyi.appstore", diff --git a/app/src/main/java/com/mjsheng/myappstore/activity/MainActivity.java b/app/src/main/java/com/mjsheng/myappstore/activity/MainActivity.java index 4e9991f..c53ced4 100644 --- a/app/src/main/java/com/mjsheng/myappstore/activity/MainActivity.java +++ b/app/src/main/java/com/mjsheng/myappstore/activity/MainActivity.java @@ -1694,22 +1694,28 @@ public class MainActivity extends AppCompatActivity implements AMapLocationListe 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); + + 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 (qch_bht_forbid_on) {//成功 if (null == mBluetoothAdapter) { - mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); - } - if (setting_bht == 0) { + mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();//获取默认蓝牙适配器 + } + if (setting_bht == 0) {//蓝牙总开关开启 + String setting_context = data.optString("setting_context");// if (setting_bhtvideo == 0) { - Settings.System.putString(getContentResolver(), "qch_bhtvideo_forbid_on", setting_context); + if (null != setting_context && !setting_context.equals("") && !setting_context.equals(" ")&& !setting_context.equals("null")) { + Log.e("SystemSetting", "setting_context:" + setting_context); + Settings.System.putString(getContentResolver(), "qch_bhtvideo_forbid_on", setting_context); + } else { + Settings.System.putString(getContentResolver(), "qch_bhtvideo_forbid_on", "Empty"); + } } 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(); + mBluetoothAdapter.disable();//设置关闭时关闭蓝牙 } } diff --git a/app/src/main/java/com/mjsheng/myappstore/receiver/MyJPushReceiver.java b/app/src/main/java/com/mjsheng/myappstore/receiver/MyJPushReceiver.java index 6754101..b2c6036 100644 --- a/app/src/main/java/com/mjsheng/myappstore/receiver/MyJPushReceiver.java +++ b/app/src/main/java/com/mjsheng/myappstore/receiver/MyJPushReceiver.java @@ -294,6 +294,7 @@ public class MyJPushReceiver extends BroadcastReceiver { } } + private BluetoothAdapter mBluetoothAdapter; private void SettingSysData(String extras) { @@ -365,30 +366,31 @@ public class MyJPushReceiver extends BroadcastReceiver { 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); + + 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 (qch_bht_forbid_on) {//成功 if (null == mBluetoothAdapter) { - mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); + mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();//获取默认蓝牙适配器 } - if (setting_bht == 0) { + if (setting_bht == 0) {//蓝牙总开关开启 + String setting_context = data.optString("setting_context");// if (setting_bhtvideo == 0) { - Settings.System.putString(this.mContext.getContentResolver(), "qch_bhtvideo_forbid_on", setting_context); + if (null != setting_context && !setting_context.equals("") && !setting_context.equals(" ")&& !setting_context.equals("null")) { + Log.e("SystemSetting", "setting_context:" + setting_context); + Settings.System.putString(this.mContext.getContentResolver(), "qch_bhtvideo_forbid_on", setting_context); + } else { + Settings.System.putString(this.mContext.getContentResolver(), "qch_bhtvideo_forbid_on", "Empty"); + } } 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(); + } 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)); //系统导航条显示开关 int setting_navigation = changeNum(data.optInt("setting_navigation")); diff --git a/app/src/main/java/com/mjsheng/myappstore/server/InitJpushServer.java b/app/src/main/java/com/mjsheng/myappstore/server/InitJpushServer.java index d7683d8..b09a732 100644 --- a/app/src/main/java/com/mjsheng/myappstore/server/InitJpushServer.java +++ b/app/src/main/java/com/mjsheng/myappstore/server/InitJpushServer.java @@ -976,22 +976,28 @@ public class InitJpushServer extends Service { 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); + + 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 (qch_bht_forbid_on) {//成功 if (null == mBluetoothAdapter) { - mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter(); + mBluetoothAdapter = BluetoothAdapter.getDefaultAdapter();//获取默认蓝牙适配器 } - if (setting_bht == 0) { + if (setting_bht == 0) {//蓝牙总开关开启 + String setting_context = data.optString("setting_context");// if (setting_bhtvideo == 0) { - Settings.System.putString(InitJpushServer.this.getContentResolver(), "qch_bhtvideo_forbid_on", setting_context); + if (null != setting_context && !setting_context.equals("") && !setting_context.equals(" ")&& !setting_context.equals("null")) { + Log.e("SystemSetting", "setting_context:" + setting_context); + Settings.System.putString(InitJpushServer.this.getContentResolver(), "qch_bhtvideo_forbid_on", setting_context); + } else { + Settings.System.putString(InitJpushServer.this.getContentResolver(), "qch_bhtvideo_forbid_on", "Empty"); + } } 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(); + mBluetoothAdapter.disable();//设置关闭时关闭蓝牙 } }