From: snickersun Date: Mon, 7 Sep 2020 13:06:41 +0000 (+0800) Subject: release V605 X-Git-Url: http://git.snicker.com.cn/sitemap.xml?a=commitdiff_plain;h=a3c489c686dae2aa6d1cd6212374f32b707678ae;p=protocol_srv.git release V605 修正A9 剪断消息提示问题。把表带【剪断(解锁)、链接(锁定)】 和 【佩戴、脱落 】两种事件区分开来。 --- diff --git a/app/app.iml b/app/app.iml index 2b170498..e442bebb 100644 --- a/app/app.iml +++ b/app/app.iml @@ -1,4 +1,4 @@ - + @@ -18,8 +18,8 @@ @@ -101,15 +101,15 @@ - - - - - - - - - + + + + + + + + + diff --git a/app/release/ICSer_V605_2009072103_release.apk b/app/release/ICSer_V605_2009072103_release.apk new file mode 100644 index 00000000..12ead55c Binary files /dev/null and b/app/release/ICSer_V605_2009072103_release.apk differ diff --git a/app/src/main/java/com/enqualcomm/support/Config.java b/app/src/main/java/com/enqualcomm/support/Config.java index cc039bdc..9fec9a41 100644 --- a/app/src/main/java/com/enqualcomm/support/Config.java +++ b/app/src/main/java/com/enqualcomm/support/Config.java @@ -346,7 +346,7 @@ public class Config { public static boolean do_broadCast_message_no_indication=false; public static boolean needAllwaysAlarmFenceOut=false; - public static boolean needAllwaysAlarmAntiOff=false; + public static boolean needAllwaysAlarmCutOff=false; public static boolean needTemperature_abnormal_alarm=false; public static boolean A9_noBroadCastActionStrip=false; public static boolean L004_BroadCastActionStrip=false; @@ -393,7 +393,7 @@ public class Config { noSMSNotifyDialog=true; noVoiceNotifyDialog=true; needBroadcastAntiAlarm=true; - needAllwaysAlarmAntiOff=false; + needAllwaysAlarmCutOff=false; needAllwaysAlarmFenceOut=false; needTemperature_abnormal_alarm=false; noPPGSensor=false; @@ -404,7 +404,7 @@ public class Config { noSMSNotifyDialog=true; noVoiceNotifyDialog=true; needBroadcastAntiAlarm=true; - needAllwaysAlarmAntiOff=true; + needAllwaysAlarmCutOff=true; needAllwaysAlarmFenceOut=true; needTemperature_abnormal_alarm=true; noPPGSensor=false; diff --git a/app/src/main/java/com/enqualcomm/support/CoreService.java b/app/src/main/java/com/enqualcomm/support/CoreService.java index 680803a5..5178136c 100644 --- a/app/src/main/java/com/enqualcomm/support/CoreService.java +++ b/app/src/main/java/com/enqualcomm/support/CoreService.java @@ -741,13 +741,15 @@ public class CoreService extends Service { WakeLockUtil.ScreenOnWakeLockTemperary(runtime.getContextProxy().context); runtime.getContextProxy().sendMsgBroadcast(runtime.getContextProxy().context.getResources().getString(R.string.alarm_out_wall),2); } - if(runtime.Anti_off_flag>0 && Config.needAllwaysAlarmAntiOff){ - runtime.Anti_off_flag++; - WakeLockUtil.ScreenOnWakeLockTemperary(runtime.getContextProxy().context); - if (runtime.getAntioffStatus()) { - runtime.getContextProxy().sendMsgBroadcast(runtime.getContextProxy().context.getResources().getString(R.string.alarm_Illegal_unlock), 2); - }else{ - runtime.getContextProxy().sendMsgBroadcast(runtime.getContextProxy().context.getResources().getString(R.string.alarm_wristband_off), 2); + if(runtime.Cut_off_flag>0 && Config.needAllwaysAlarmCutOff){ + runtime.Cut_off_flag++; +// WakeLockUtil.ScreenOnWakeLockTemperary(runtime.getContextProxy().context); + + if (Config.A9_noBroadCastActionStrip) { + if(Config.needBroadcastAntiAlarm) { + antiservice.send_cutoff_event_broadcast(1); + } + } } diff --git a/app/src/main/java/com/enqualcomm/support/GPSActivity.java b/app/src/main/java/com/enqualcomm/support/GPSActivity.java index dc49c21c..7eec8db2 100644 --- a/app/src/main/java/com/enqualcomm/support/GPSActivity.java +++ b/app/src/main/java/com/enqualcomm/support/GPSActivity.java @@ -9,6 +9,7 @@ import android.support.v7.app.AppCompatActivity; import android.support.v7.widget.LinearLayoutManager; import android.support.v7.widget.RecyclerView; import android.view.View; +import android.view.WindowManager; import android.widget.TextView; import com.enqualcomm.support.NMEAListener.location_callback; @@ -51,6 +52,7 @@ public class GPSActivity extends Activity implements location_callback { mStar.setText("0 in 0/ inMap 0"); mHoop.setText("0.0ç±³"); mSearchCount.setText("0秒"); + getWindow().addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON); } @Override @@ -104,25 +106,18 @@ public class GPSActivity extends Activity implements location_callback { } return entity; } - PowerManager.WakeLock screenOnWakelock=null; + @Override protected void onResume() { super.onResume(); NMEAListener.set_callback(this); - if (screenOnWakelock==null) - screenOnWakelock = WakeLockUtil.getScreenOnWakeLock(this,GPSActivity.class.getSimpleName()); + } @Override protected void onPause() { super.onPause(); showmessage=false; - if(screenOnWakelock!=null) { - if (screenOnWakelock.isHeld()) { - screenOnWakelock.release(); - } - screenOnWakelock=null; - } } } 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 20b7ac66..8addf48a 100644 --- a/app/src/main/java/com/enqualcomm/support/bean/Runtime.java +++ b/app/src/main/java/com/enqualcomm/support/bean/Runtime.java @@ -89,8 +89,7 @@ public class Runtime { public boolean isAirMode=false; - private boolean isNeedAntioff; - + private String key = "867155030001063"; public String lacByAt; @@ -159,7 +158,8 @@ public class Runtime { public int Fence_Warning_flag=0; //0 代表佩戴,如果脱腕则置1,每次报警再加1 - public int Anti_off_flag=0; + public int Anti_off_flag=0; + public int Cut_off_flag=0; public enum AlarmType{ ALARM_SOS, @@ -342,8 +342,19 @@ public class Runtime { public boolean isNoTurnOffWifiOnScreenOff(){ return noTurnOffWifiOnScreenOff; } + + private boolean isNeedAntioff; public boolean getAntioffStatus() { return this.isNeedAntioff; } - + public void setAntioffStatus(boolean paramBoolean) { this.isNeedAntioff = paramBoolean; } + + private boolean isNeedReportcutoff=false; + public boolean needReportCutoff(){ + return this.isNeedReportcutoff; + } + + public void setNeddReportCutoff(boolean needreport){ + this.isNeedReportcutoff=needreport; + } public String getBattery() { return this.battery; } public int getBatteryVotage(){ return this.batteryVoltage;} @@ -414,8 +425,7 @@ public class Runtime { public boolean isShutdown() { return this.shutdown; } - public void setAntioffStatus(boolean paramBoolean) { this.isNeedAntioff = paramBoolean; } - + public void setBattery(String paramString) { this.battery = paramString; } public void setBatteryLow(boolean paramBoolean) { this.batteryLow = paramBoolean; } 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 e13f78e5..17ce616d 100644 --- a/app/src/main/java/com/enqualcomm/support/service/AntiMonitorService.java +++ b/app/src/main/java/com/enqualcomm/support/service/AntiMonitorService.java @@ -86,46 +86,87 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { ICLogger.i("佩戴状态未变,skip!"); return; } - if (current_anti_status==0){ - //佩戴 - if(Config.needBroadcastAntiAlarm) { - // play_notify(); - send_anti_event_broadcast(0); - } - mRuntime.Anti_off_flag=0; - mRuntime.setAlarmType(Runtime.AlarmType.ALARM_WEARED); - StringMessage msg=protocolAPIHelper.getWarningMSG(mRuntime); - Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! + + //current_anti_status == 0 表示表带 锁定 , ==10 表示表带非法解锁 + //current_anti_status == 2 表示佩戴 ==12 表示脱腕 + + switch(current_anti_status){ + case 0: + //锁定 + { + if (Config.needBroadcastAntiAlarm) { + // play_notify(); + send_cutoff_event_broadcast(0); + } + mRuntime.Cut_off_flag = 0; + mRuntime.setAlarmType(Runtime.AlarmType.ALARM_LOCK_WATCH); + StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime); + Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! // try { // sleep(1000); // } catch (InterruptedException e) { // e.printStackTrace(); // } + } + break; + case 10: + { + //非法解锁 + if(Config.needBroadcastAntiAlarm) { - }else{ - //脱腕 - if(Config.needBroadcastAntiAlarm) { - play_notify(); - VibrateUtil.getInstance(mContext).VibrateOnOnce(true); - screen_on(); - try { - sleep(1000); - } catch (InterruptedException e) { - e.printStackTrace(); - }//delay一会儿再发消息,以屏没有来得急亮起,免界面不响应。 - send_anti_event_broadcast(1); - } - mRuntime.Anti_off_flag=1; - mRuntime.setAlarmType(Runtime.AlarmType.ALARM_ANTIOFF); - StringMessage msg=protocolAPIHelper.getWarningMSG(mRuntime); - Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! + send_cutoff_event_broadcast(1); + } + mRuntime.Cut_off_flag=1; + mRuntime.setAlarmType(Runtime.AlarmType.ALARM_CUTOFF); + StringMessage msg=protocolAPIHelper.getWarningMSG(mRuntime); + Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! // try { // sleep(1000); // } catch (InterruptedException e) { // e.printStackTrace(); // } + } + break; + case 2: + //佩戴 + { + if (Config.needBroadcastAntiAlarm) { + // play_notify(); + send_anti_event_broadcast(0); + } + mRuntime.Anti_off_flag = 0; + mRuntime.setAlarmType(Runtime.AlarmType.ALARM_WEARED); + StringMessage msg = protocolAPIHelper.getWarningMSG(mRuntime); + Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! +// try { +// sleep(1000); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } + } + break; + case 12: + { + //脱腕 + if(Config.needBroadcastAntiAlarm) { + + send_anti_event_broadcast(1); + } + mRuntime.Anti_off_flag=1; + mRuntime.setAlarmType(Runtime.AlarmType.ALARM_ANTIOFF); + StringMessage msg=protocolAPIHelper.getWarningMSG(mRuntime); + Deliver.sendLocationMSG(msg); //消息很重要,所以利用带buffer的对列来发送! +// try { +// sleep(1000); +// } catch (InterruptedException e) { +// e.printStackTrace(); +// } + } + break; + default: + break; } last_send_antoff_event=current_anti_status; @@ -179,6 +220,73 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { } + + public void send_cutoff_event_broadcast(int antioff){ + + Intent intent=new Intent(); + intent.setAction(ACTION_ANTI_OFF); + intent.putExtra(KEY_ANTI_EVENT,antioff); + if (antioff==0) { + + if (Config.A9_noBroadCastActionStrip) { + if (mRuntime.needReportCutoff() == true) { + Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_lock_success)); + } + }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{ + intent.putExtra(KEY_ANTI_TXT, ""); + mContext.sendBroadcast(intent); + } + + }else{ + + if (Config.A9_noBroadCastActionStrip) { + + if (mRuntime.needReportCutoff() == true) { + 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 if (Config.L004_BroadCastActionStrip) { + + play_notify(); + VibrateUtil.getInstance(mContext).VibrateOnOnce(true); + screen_on(); + try { + sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + }//delay一会儿再发消息,以屏没有来得急亮起,免界面不响应。 + intent.putExtra(KEY_ANTI_TXT, mContext.getResources().getString(R.string.alarm_wristband_off)); + mContext.sendBroadcast(intent); + }else{ + play_notify(); + VibrateUtil.getInstance(mContext).VibrateOnOnce(true); + screen_on(); + try { + sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + }//delay一会儿再发消息,以屏没有来得急亮起,免界面不响应。 + if (mRuntime.getAntioffStatus()){ + intent.putExtra(KEY_ANTI_TXT, mContext.getResources().getString(R.string.alarm_wristband_off)); + } + mContext.sendBroadcast(intent); + } + + } + + } public void send_anti_event_broadcast(int antioff){ Intent intent=new Intent(); @@ -186,11 +294,13 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { intent.putExtra(KEY_ANTI_EVENT,antioff); if (antioff==0) { - if(Config.A9_noBroadCastActionStrip) { - Util.ShowToast(mRuntime,mContext.getResources().getString(R.string.alarm_wristband_on)); - // mRuntime.getContextProxy().sendMsgBroadcast(mContext.getResources().getString(R.string.alarm_wristband_on),0); //佩戴 + if (Config.A9_noBroadCastActionStrip) { + if (mRuntime.needReportCutoff() == true) { + Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_lock_success)); + } }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{ @@ -202,15 +312,38 @@ public class AntiMonitorService extends AbstractInvokeHandlerService { if (Config.A9_noBroadCastActionStrip) { - if (mRuntime.getAntioffStatus() == true) { + if (mRuntime.needReportCutoff() == true) { + 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 { - Util.ShowToast(mRuntime, mContext.getResources().getString(R.string.alarm_wristband_off)); } - }else { - if (mRuntime.getAntioffStatus() == true) { - intent.putExtra(KEY_ANTI_TXT, mContext.getResources().getString(R.string.alarm_Illegal_unlock)); - } else { + }else if (Config.L004_BroadCastActionStrip) { + play_notify(); + VibrateUtil.getInstance(mContext).VibrateOnOnce(true); + screen_on(); + try { + sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + }//delay一会儿再发消息,以屏没有来得急亮起,免界面不响应。 + intent.putExtra(KEY_ANTI_TXT, mContext.getResources().getString(R.string.alarm_wristband_off)); + mContext.sendBroadcast(intent); + }else{ + play_notify(); + VibrateUtil.getInstance(mContext).VibrateOnOnce(true); + screen_on(); + try { + sleep(1000); + } catch (InterruptedException e) { + e.printStackTrace(); + }//delay一会儿再发消息,以屏没有来得急亮起,免界面不响应。 + if (mRuntime.getAntioffStatus()){ intent.putExtra(KEY_ANTI_TXT, mContext.getResources().getString(R.string.alarm_wristband_off)); } mContext.sendBroadcast(intent); diff --git a/app/src/main/java/com/ic/protocols/protocol_ic.java b/app/src/main/java/com/ic/protocols/protocol_ic.java index 2220ae60..2166cabc 100644 --- a/app/src/main/java/com/ic/protocols/protocol_ic.java +++ b/app/src/main/java/com/ic/protocols/protocol_ic.java @@ -2215,7 +2215,7 @@ public class protocol_ic { if (cdd.equals("1")) { //delay 启动 - Context context = mRuntime.getContextProxy().context.getApplicationContext(); +// Context context = mRuntime.getContextProxy().context.getApplicationContext(); CoreService.getInstance().DevliverStringMessage("StartMonitor",tmp); } }else{ diff --git a/app/version_code.properties b/app/version_code.properties index ed990bc9..de527b27 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Sat Sep 05 01:13:16 CST 2020 -VERSION_CODE=604 +#Mon Sep 07 21:03:09 CST 2020 +VERSION_CODE=605