From: snickersun Date: Sun, 27 Sep 2020 08:43:49 +0000 (+0800) Subject: release V635 X-Git-Url: http://git.snicker.com.cn/sitemap.xml?a=commitdiff_plain;h=f53fbd42f06dde829adbb03bcd43463af7924bf5;p=protocol_srv.git release V635 1、FZD,MQTT 低电量增加17状态 2、C5 佩戴,剪断事件 修正 3、电池低电 15% , %5 都会上报一次,并且采用 buffer,保证上报成功。 4、处理蓝牙扫描结果为null的状态 --- diff --git a/app/release/ICSer_V634_2009252122_release.apk b/app/release/ICSer_V635_2009271639_release.apk similarity index 78% rename from app/release/ICSer_V634_2009252122_release.apk rename to app/release/ICSer_V635_2009271639_release.apk index 7fba9e58..9c1c00b8 100644 Binary files a/app/release/ICSer_V634_2009252122_release.apk and b/app/release/ICSer_V635_2009271639_release.apk differ diff --git a/app/release/output.json b/app/release/output.json index b3591400..01ed4876 100644 --- a/app/release/output.json +++ b/app/release/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":634,"versionName":"2009252122","enabled":true,"outputFile":"ICSer_V634_2009252122_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V634_2009252122_release.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":635,"versionName":"2009271639","enabled":true,"outputFile":"ICSer_V635_2009271639_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V635_2009271639_release.apk","properties":{}}] \ No newline at end of file diff --git a/app/src/main/java/com/enqualcomm/support/Config.java b/app/src/main/java/com/enqualcomm/support/Config.java index be0f34da..a4045492 100644 --- a/app/src/main/java/com/enqualcomm/support/Config.java +++ b/app/src/main/java/com/enqualcomm/support/Config.java @@ -353,6 +353,7 @@ public class Config { public static boolean needAllwaysAlarmCutOff=false; public static boolean needTemperature_abnormal_alarm=false; public static boolean A9_noBroadCastActionStrip=false; + public static boolean C5_noBroadCastActionStrip=false; public static boolean L004_BroadCastActionStrip=false; public static boolean disable_ntp_server=false; @@ -442,6 +443,18 @@ public class Config { noPPGSensor=false; noTempSensor=false; A9_noBroadCastActionStrip=true; + }else if (custom_name.equals("SGL")) + { + noPushTxtNotifyDialog=false; + noSMSNotifyDialog=false; + noVoiceNotifyDialog=true; + needBroadcastAntiAlarm=true; + needAllwaysAlarmCutOff=true; + needAllwaysAlarmFenceOut=false; + needTemperature_abnormal_alarm=false; + noPPGSensor=false; + noTempSensor=false; + C5_noBroadCastActionStrip=true; } noPPGSensor=(ICJniUtils.isPPGavailable()==0); noTempSensor=(ICJniUtils.isTemperatureDevAvailable()==0); @@ -685,7 +698,7 @@ public class Config { public static void ConfigAlarm(Runtime.AlarmType alarmType,boolean enabled){ AlarmConfiglist.put(alarmType.ordinal(),enabled); } - private static void dumpAlarmConfig(){ + public static void dumpAlarmConfig(){ for (int i=0;i btPairedScanResult, ArrayList btNewScanResult) { - if (btNewScanResult.size() > 0) { + if (btNewScanResult!=null && btNewScanResult.size() > 0) { ICLogger.i("found bt mac " + btNewScanResult.size() + " btMacList " + runtime.bleInfo.btMacList.size()); boolean in_area = false; try { diff --git a/app/src/main/java/com/enqualcomm/support/bean/Runtime.java b/app/src/main/java/com/enqualcomm/support/bean/Runtime.java index c46e8a58..9a9717aa 100644 --- a/app/src/main/java/com/enqualcomm/support/bean/Runtime.java +++ b/app/src/main/java/com/enqualcomm/support/bean/Runtime.java @@ -334,8 +334,10 @@ public class Runtime { if(lowbattery){ fzdDevStatus|=0x00000001; + fzdDevStatus|=0x00020000; }else{ fzdDevStatus&=~0x00000001; + fzdDevStatus&=~0x00020000; } } public void updateFZDDevStatusWeared(boolean weared) { @@ -596,11 +598,16 @@ public class Runtime { public boolean isShutdown() { return this.shutdown; } - - public void setBattery(String paramString) { this.battery = paramString; } - - public void setBatteryLow(boolean paramBoolean) { + + private static int batterylevel=0; + public int getBatterylevel(){ + return batterylevel; + } + public void setBattery(String paramString) { this.battery = paramString; } + public void setBattery(int param) { this.batterylevel = param; } + + public void setBatteryLow(boolean paramBoolean) { this.batteryLow = paramBoolean; updateFZDDevStatusLowbat(batteryLow); //设置batterylow Alarm } diff --git a/app/src/main/java/com/enqualcomm/support/service/AntiMonitorService.java b/app/src/main/java/com/enqualcomm/support/service/AntiMonitorService.java index 911477a4..10306c1c 100644 --- a/app/src/main/java/com/enqualcomm/support/service/AntiMonitorService.java +++ b/app/src/main/java/com/enqualcomm/support/service/AntiMonitorService.java @@ -87,11 +87,11 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { return; } - //current_anti_status == 0 表示表带 锁定 , ==10 表示表带非法解锁 - //current_anti_status == 2 表示佩戴 ==12 表示脱腕 + //current_anti_status == 2 表示表带 锁定 , ==12 表示表带非法解锁 + //current_anti_status == 0 表示佩戴 ==10 表示脱腕 switch(current_anti_status){ - case 0: + case 2: //锁定 { if (Config.needBroadcastAntiAlarm) { @@ -111,7 +111,7 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { // } } break; - case 10: + case 12: { //非法解锁 if(Config.needBroadcastAntiAlarm) { @@ -130,7 +130,7 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { // } } break; - case 2: + case 0: //佩戴 { if (Config.needBroadcastAntiAlarm) { @@ -149,7 +149,7 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { // } } break; - case 12: + case 10: { //脱腕 if(Config.needBroadcastAntiAlarm) { @@ -225,7 +225,7 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { public void send_cutoff_event_broadcast(int antioff){ - + ICLogger.i("send_cutoff_event_broadcast "+antioff); Intent intent=new Intent(); intent.setAction(ACTION_ANTI_OFF); intent.putExtra(KEY_ANTI_EVENT,antioff); @@ -235,11 +235,15 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { if (mRuntime.needReportCutoff() == true) { Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_lock_success)); } - }else if (Config.L004_BroadCastActionStrip){ + }else if (Config.L004_BroadCastActionStrip) { Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_wristband_on)); //下面消息是为了把锁定窗口关掉 intent.putExtra(KEY_ANTI_TXT, ""); mContext.sendBroadcast(intent); + }else if (Config.C5_noBroadCastActionStrip) { + + Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_lock_success)); + }else{ intent.putExtra(KEY_ANTI_TXT, ""); mContext.sendBroadcast(intent); @@ -272,6 +276,19 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { }//delay一会儿再发消息,以屏没有来得急亮起,免界面不响应。 intent.putExtra(KEY_ANTI_TXT, mContext.getResources().getString(R.string.alarm_wristband_off)); mContext.sendBroadcast(intent); + }else if (Config.C5_noBroadCastActionStrip) { + + + play_notify(); + VibrateUtil.getInstance(mContext).VibrateOnOnce(true); + screen_on(); + try { + sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + }//delay一会儿再发消息,以屏没有来得急亮起,免界面不响应。 + Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_Illegal_unlock)); + }else{ play_notify(); VibrateUtil.getInstance(mContext).VibrateOnOnce(true); @@ -293,6 +310,7 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { } public void send_anti_event_broadcast(int antioff){ + ICLogger.i("send_anti_event_broadcast "+antioff); Intent intent=new Intent(); intent.setAction(ACTION_ANTI_OFF); intent.putExtra(KEY_ANTI_EVENT,antioff); @@ -302,11 +320,14 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { if (mRuntime.needReportCutoff() == true) { Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_lock_success)); } - }else if (Config.L004_BroadCastActionStrip){ + }else if (Config.L004_BroadCastActionStrip) { Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_wristband_on)); //下面消息是为了把锁定窗口关掉 intent.putExtra(KEY_ANTI_TXT, ""); mContext.sendBroadcast(intent); + }else if (Config.C5_noBroadCastActionStrip) { + Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_lock_success)); + }else{ intent.putExtra(KEY_ANTI_TXT, ""); mContext.sendBroadcast(intent); @@ -338,6 +359,19 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { }//delay一会儿再发消息,以屏没有来得急亮起,免界面不响应。 intent.putExtra(KEY_ANTI_TXT, mContext.getResources().getString(R.string.alarm_wristband_off)); mContext.sendBroadcast(intent); + + }else if (Config.C5_noBroadCastActionStrip) { + + play_notify(); + VibrateUtil.getInstance(mContext).VibrateOnOnce(true); + screen_on(); + try { + sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + }//delay一会儿再发消息,以屏没有来得急亮起,免界面不响应。 + Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_Illegal_unlock)); + }else{ play_notify(); VibrateUtil.getInstance(mContext).VibrateOnOnce(true); diff --git a/app/src/main/java/com/enqualcomm/support/service/KeepAlive.java b/app/src/main/java/com/enqualcomm/support/service/KeepAlive.java index ddaeeee9..16c4f622 100644 --- a/app/src/main/java/com/enqualcomm/support/service/KeepAlive.java +++ b/app/src/main/java/com/enqualcomm/support/service/KeepAlive.java @@ -409,7 +409,7 @@ public class KeepAlive extends AbstractConnectionService { // if (KeepAlive.this.mRuntime.getBatteryLow()){ // KeepAlive.this.mRuntime.setAlarmType(Runtime.AlarmType.ALARM_LOWBATTERY); KeepAlive.this.mRuntime.setAlarmType(Runtime.AlarmType.ALARM_POWER_OFF); - KeepAlive.this.connection.send(protocolAPIHelper.getWarningMSG(KeepAlive.this.mRuntime)); + Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(KeepAlive.this.mRuntime)); ICLogger.i("Shutdown Received! send AP10 !"); // } diff --git a/app/src/main/java/com/enqualcomm/support/utils/BatteryUtil.java b/app/src/main/java/com/enqualcomm/support/utils/BatteryUtil.java index 518448a7..65410338 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/BatteryUtil.java +++ b/app/src/main/java/com/enqualcomm/support/utils/BatteryUtil.java @@ -15,6 +15,7 @@ import com.enqualcomm.support.Config; import com.enqualcomm.support.CoreService; import com.enqualcomm.support.service.AntiMonitorService; import com.enqualcomm.support.service.AudioService; +import com.enqualcomm.support.service.Deliver; import com.ic.protocols.protocolAPIHelper; import com.enqualcomm.support.bean.Runtime; @@ -75,46 +76,52 @@ public class BatteryUtil { ICLogger.i(msg.toString()); if (batLevel >= 100) { mRuntime.setBattery(String.format("%03d",100)); + mRuntime.setBattery(100); mRuntime.setHaveBatteryChange(false); mRuntime.setBatteryLow(false); } else if (batLevel<100 && batLevel >= 25) { mRuntime.setBattery(String.format("%03d",batLevel)); + mRuntime.setBattery(batLevel); mRuntime.setHaveBatteryChange(false); mRuntime.setBatteryLow(false); } else if (batLevel<25 && batLevel >= 15) { mRuntime.setBattery(String.format("%03d",batLevel)); + mRuntime.setBattery(batLevel); mRuntime.setHaveBatteryChange(true); } else if (batLevel<15 && batLevel >= 5) { - mRuntime.setBattery(String.format("%03d",batLevel)); - mRuntime.setHaveBatteryChange(true); - mRuntime.setBatteryLow(true); + if (Config.LOG_TOFILE) ICLogger.logToFile("Battery","BatteryLow less than 15%!"); - if (mRuntime.isPowerConnected()==false) { + //没有充电,上次电池level > 15% , 上次电池并且不是 低电状态,则报警 + if (mRuntime.isPowerConnected()==false && mRuntime.getBatterylevel()>15 && mRuntime.getBatteryLow()==false) { send_batterylow_event_broadcast(param1Context, 1); play_waning_notify(param1Context); mRuntime.setAlarmType(Runtime.AlarmType.ALARM_LOWBATTERY); //trigger AP10 报警定位 - connection.send(protocolAPIHelper.getWarningMSG(mRuntime)); + Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(mRuntime)); } - } else { mRuntime.setBattery(String.format("%03d",batLevel)); + mRuntime.setBattery(batLevel); mRuntime.setHaveBatteryChange(true); mRuntime.setBatteryLow(true); + } else { if (Config.LOG_TOFILE) ICLogger.logToFile("Battery","BatteryLow less than 5% !"); - - if (mRuntime.isPowerConnected()==false) { + //没有充电,上次电池level > 15% , 上次电池并且不是 电池低电状态,则报警 + if (mRuntime.isPowerConnected()==false && mRuntime.getBatterylevel()>5 ) { send_batterylow_event_broadcast(param1Context, 1); play_waning_notify(param1Context); mRuntime.setAlarmType(Runtime.AlarmType.ALARM_LOWBATTERY); //trigger AP10 报警定位 - connection.send( protocolAPIHelper.getWarningMSG(mRuntime)); - + Deliver.sendLocationMSG( protocolAPIHelper.getWarningMSG(mRuntime)); } + mRuntime.setBattery(String.format("%03d",batLevel)); + mRuntime.setBattery(batLevel); + mRuntime.setHaveBatteryChange(true); + mRuntime.setBatteryLow(true); } }else if (Intent.ACTION_BATTERY_LOW.equals(intent.getAction())) { @@ -173,7 +180,6 @@ public class BatteryUtil { public void handleMessage(Message msg) { super.handleMessage(msg); if (msg.what == 100) { - if (mWakeLock != null && mWakeLock.isHeld()) { mWakeLock.release(); } diff --git a/app/version_code.properties b/app/version_code.properties index 057c765c..a9618b2a 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Fri Sep 25 21:22:18 CST 2020 -VERSION_CODE=634 +#Sun Sep 27 16:39:23 CST 2020 +VERSION_CODE=635