-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":893,"versionName":"2107171959","enabled":true,"outputFile":"ICSer_V893_2107171959_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V893_2107171959_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":894,"versionName":"2107192045","enabled":true,"outputFile":"ICSer_V894_2107192045_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V894_2107192045_release.apk","properties":{}}]
\ No newline at end of file
int FROM_ALARM = 1;
int FROM_CLIENT = 2;
+
+ /*警告信息类型*/
+ //1表示环境温度过高,2表示心率异常,3表示血氧异常
+ //4表示血压异常,5表示体温过高,6表示SOS紧急报警,7低电量报警
+ int WARNING_MSG_TYPE_ENV_TEMP = 1;
+ int WARNING_MSG_TYPE_HEART_RATE = 2;
+ int WARNING_MSG_TYPE_BLOOD_OXYGEN = 3;
+ int WARNING_MSG_TYPE_BLOOD_PRESSURE = 4;
+ int WARNING_MSG_TYPE_BODY_TEMP = 5;
+ int WARNING_MSG_TYPE_SOS = 6;
+ int WARNING_MSG_TYPE_POWER_LOW = 7;
}
import android.app.Service;
import android.content.BroadcastReceiver;
import android.content.ContentResolver;
+import android.content.ContentValues;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import com.enqualcomm.support.bean.StringMessage;
import com.enqualcomm.support.bean.heartRateStatus;
import com.enqualcomm.support.provider.ICDatabaseHelper;
+import com.enqualcomm.support.provider.WarningItemProvider;
import com.enqualcomm.support.provider.WeTalkMessageProvider;
import com.enqualcomm.support.service.AntiMonitorService;
import com.enqualcomm.support.service.CheckSIM;
setEmegencyLocationSTOPAlarm(5);
} else if (ACTION_LOCAL_SOS_ACTION.endsWith(param1Intent.getAction())) {
VibrateUtil.getInstance(runtime.getContextProxy().context).vibrateOn(true);
-// if( param1Intent.getIntExtra("type", 1) == 1) {
+ //if( param1Intent.getIntExtra("type", 1) == 1) {
if (needHRSTestOnSOS) {
//触发一次心率检测
ICLogger.d("needHRSTestOnSOS =}}= > setHeartRateDetectAlarm ");
setHeartRateDetectAlarm(1);
}
+ //add by TrillGates=====start
+ //S123的项目需要加警告信息
+ //保存一份到警告信息中
+ ContentValues warningMsgValues = new ContentValues();
+ //设置数据
+ warningMsgValues.put(ICDatabaseHelper.warning_msg_type, Constants.WARNING_MSG_TYPE_SOS);
+ warningMsgValues.put(ICDatabaseHelper.warning_msg_title,
+ runtime.getContextProxy().context.getString(R.string.sos_warning_msg_text));
+ warningMsgValues.put(ICDatabaseHelper.warning_msg_has_read, 1);
+ warningMsgValues.put(ICDatabaseHelper.warning_msg_create_time, System.currentTimeMillis());
+ runtime.getContextProxy().getResolver().insert(Uri.parse(WarningItemProvider.WARNING_MSG),
+ warningMsgValues);
+ //add by TrillGates=====end
runtime.setAlarmType(Runtime.AlarmType.ALARM_SOS);
//trigger AP10 报警定位
ICLogger.i("triggerSOSLocationProcess ");
LocationClient.getInstance().triggerSOSLocationProcess();
-// Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));
-
+ //Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));
//开启紧急定位模式,GPS 优先1分钟一次定位,持续5分钟
runtime.getLocationInstance().setWorkingMod(EMERGNECY_MOD);
setLocationAlarm(runtime.getLocationInstance().getWorkingMod());
-
//SOS模式,心率测试1分钟一次,持续5分钟
if (needHRSTestOnSOS) {
//只触发一次心率检测
mHandler.postDelayed(mTriggerSOSCALLThread, 500);
}
} else if (ACTION_QUERY_WEATHER.equals(param1Intent.getAction())) {
-
ICLogger.i("ACTION_QUERY_WEATHER ");
connection.send(protocolAPIHelper.getWeatherMSG(runtime));
}
//停止自由锻炼,恢复正常
Runtime.practising = false;
Util.setSystemProperties(Config.KeyPractiseState, "false");
-
//最后检测是否还有数据需要发送
if (Runtime.healthInfo.check_info_item_finished()) {
Runtime.healthInfo.appendBuffer(Runtime.healthInfo.getHealthInfoString());
}
if (Runtime.healthInfo.getInfoCount() >= 0) {
//超过30次发送数据给服务器
- ICLogger.i("自由锻炼结束,发送数据给服务器 " + Runtime.healthInfo.getBufferData().length);
+ ICLogger.i("自由锻炼结束,发送数据给服务器 "
+ + Runtime.healthInfo.getBufferData().length);
mHandler.post(mupdatePracticeData);
}
-
}
}
}
import android.os.Message;
import com.enqualcomm.support.Config;
+import com.enqualcomm.support.Constants;
import com.enqualcomm.support.CoreService;
import com.enqualcomm.support.ICApplication;
import com.enqualcomm.support.LocationClient;
import com.enqualcomm.support.provider.ICDatabaseHelper;
import com.enqualcomm.support.provider.ICGlobalSettingsProvider;
import com.enqualcomm.support.provider.ICNotificationProvider;
+import com.enqualcomm.support.provider.WarningItemProvider;
import com.enqualcomm.support.service.base.AbstractInvokeHandlerService;
import com.enqualcomm.support.utils.Connection;
import com.enqualcomm.support.utils.HeartRateOxygenTestType;
int bloodHeightValue = heartRate.getBloodHeight();
int bloodLowValue = heartRate.getBloodLow();
Context context = runtime.getContextProxy().context;
+
if (oxygenValue != 0 && Config.LIMIT_VALUE_OXYGEN != 0 && oxygenValue < Config.LIMIT_VALUE_OXYGEN) {
//发出警告
createWarningNotification(context.getString(R.string.oxygen_exception_tips_text) + oxygenValue + "%)",
- NOTIFICATION_TYPE_BLOOD_OXYGEN);
+ NOTIFICATION_TYPE_BLOOD_OXYGEN, Constants.WARNING_MSG_TYPE_BLOOD_OXYGEN);
}
if (heartRateValue != 0 && Config.LIMIT_VALUE_PPGH != 0 && heartRateValue > Config.LIMIT_VALUE_PPGH) {
//判断是否超出阀值,上限
createWarningNotification(context.getString(R.string.heart_rate_exception_tips_text) + heartRateValue + ")",
- NOTIFICATION_TYPE_HEART_RATE);
+ NOTIFICATION_TYPE_HEART_RATE, Constants.WARNING_MSG_TYPE_HEART_RATE);
}
if (heartRateValue != 0 && Config.LIMIT_VALUE_PPGH != 0 && heartRateValue < Config.LIMIT_VALUE_PPGL) {
//判断是否超出阀值,下限
createWarningNotification(context.getString(R.string.heart_rate_exception_tips_text) + heartRateValue + ")",
- NOTIFICATION_TYPE_HEART_RATE);
+ NOTIFICATION_TYPE_HEART_RATE, Constants.WARNING_MSG_TYPE_HEART_RATE);
}
if (bloodHeightValue != 0 && Config.LIMIT_VALUE_BPH_H != 0 && Config.LIMIT_VALUE_BPH_L != 0) {
if (bloodHeightValue > Config.LIMIT_VALUE_BPH_H || bloodHeightValue < Config.LIMIT_VALUE_BPH_L) {
//警报,血压高值超出范围
createWarningNotification(context.getString(R.string.blood_presure_exception_tips_text) + bloodHeightValue + "/100mmHg)",
- NOTIFICATION_TYPE_BLOOD_PRESSURE);
+ NOTIFICATION_TYPE_BLOOD_PRESSURE, Constants.WARNING_MSG_TYPE_BLOOD_PRESSURE);
}
}
if (bloodHeightValue > Config.LIMIT_VALUE_BPL_H || bloodHeightValue < Config.LIMIT_VALUE_BPL_L) {
//警报,血压低值超出范围
createWarningNotification(context.getString(R.string.blood_presure_exception_tips_text) + bloodHeightValue + "/100mmHg)",
- NOTIFICATION_TYPE_BLOOD_PRESSURE);
+ NOTIFICATION_TYPE_BLOOD_PRESSURE, Constants.WARNING_MSG_TYPE_BLOOD_PRESSURE);
}
}
}
public static final String NOTIFICATION_TYPE_BLOOD_PRESSURE = "blood_pressure";
public static final String NOTIFICATION_TYPE_BLOOD_OXYGEN = "blood_oxygen";
- private void createWarningNotification(String title, String type) {
+ private void createWarningNotification(String title, String type, int typeValue) {
ContentValues contentValues = new ContentValues();
//分类是心率的包名
contentValues.put(ICDatabaseHelper.notification_category, "com.ic.blood");
ContentResolver resolver = runtime.getContextProxy().getResolver();
resolver.insert(Uri.parse(ICNotificationProvider.NOTIFICATIONS), contentValues);
updateSettingsValue();
+ //保存一份到警告信息中
+ ContentValues warningMsgValues = new ContentValues();
+ //设置数据
+ warningMsgValues.put(ICDatabaseHelper.warning_msg_type, typeValue);
+ warningMsgValues.put(ICDatabaseHelper.warning_msg_title, title);
+ warningMsgValues.put(ICDatabaseHelper.warning_msg_has_read, 1);
+ warningMsgValues.put(ICDatabaseHelper.warning_msg_create_time, System.currentTimeMillis());
+ resolver.insert(Uri.parse(WarningItemProvider.WARNING_MSG), warningMsgValues);
}
private void updateSettingsValue() {
}
-
private void uploadResult() {
//只有检测PPG成功,且网络连接中才发送数据
if (this.runtime.getHRS().getHeartrateWorkingStat() == heartRateStatus.HEARTRATE_WORKINGSTAT.HEARTRATE_TEST_SUCCESS) {
package com.enqualcomm.support.utils;
import android.content.BroadcastReceiver;
+import android.content.ContentValues;
import android.content.Context;
import android.content.ContextWrapper;
import android.content.Intent;
import android.content.IntentFilter;
+import android.net.Uri;
import android.os.BatteryManager;
import android.os.Handler;
import android.os.Message;
import android.os.PowerManager;
import com.enqualcomm.support.Config;
+import com.enqualcomm.support.Constants;
import com.enqualcomm.support.CoreService;
import com.enqualcomm.support.LocationClient;
+import com.enqualcomm.support.R;
import com.enqualcomm.support.bean.EventLooperHandlerThread;
import com.enqualcomm.support.bean.Runtime;
+import com.enqualcomm.support.provider.ICDatabaseHelper;
+import com.enqualcomm.support.provider.WarningItemProvider;
import com.enqualcomm.support.service.AntiMonitorService;
import com.enqualcomm.support.service.AudioService;
import com.ic.protocols.protocolAPIHelper;
}
public static void checkAndSendBatteryEvent(Context context, Runtime runtime) {
-
+ //add by TrillGates======start
+ //保存一份到警告信息中
+ ContentValues warningMsgValues = new ContentValues();
+ //设置数据
+ warningMsgValues.put(ICDatabaseHelper.warning_msg_type, Constants.WARNING_MSG_TYPE_POWER_LOW);
+ warningMsgValues.put(ICDatabaseHelper.warning_msg_title, runtime.getContextProxy().context.getString(R.string.low_power_warning_text));
+ warningMsgValues.put(ICDatabaseHelper.warning_msg_has_read, 1);
+ warningMsgValues.put(ICDatabaseHelper.warning_msg_create_time, System.currentTimeMillis());
+ runtime.getContextProxy().getResolver().insert(Uri.parse(WarningItemProvider.WARNING_MSG),
+ warningMsgValues);
+ //add by TrillGates======end
//没有充电,上次电池level > 15% , 上次电池并且不是 低电状态,则报警
- if (runtime.isPowerConnected() == false && runtime.getBatterylevel() <= 15 && runtime.getBatterylevel() > 10 && runtime.getBatteryLow() == false) {
+ if (!runtime.isPowerConnected() && runtime.getBatterylevel() <= 15 && runtime.getBatterylevel() > 10 && !runtime.getBatteryLow()) {
Intent intent = new Intent();
intent.setAction(ACTION_BATTERYLOW);
intent.putExtra(KEY_BATTERY_EVENT, 1);
play_waning_notify(context);
runtime.setAlarmType(Runtime.AlarmType.ALARM_LOWBATTERY);
//trigger AP10 报警定位
-// Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));
+ //Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));
ICLogger.i("triggerSOSLocationProcess ");
LocationClient.getInstance().triggerSOSLocationProcess();
- } else if (runtime.isPowerConnected() == false && runtime.getBatterylevel() <= 10 && runtime.getBatterylevel() > 5 && runtime.getBatteryLow() == false) {
+ } else if (!runtime.isPowerConnected() && runtime.getBatterylevel() <= 10 && runtime.getBatterylevel() > 5 && !runtime.getBatteryLow()) {
//百分之10以内的还不能正常报数,需要后面再优化
Intent intent = new Intent();
intent.setAction(ACTION_BATTERYLOW);
play_waning_notify(context);
runtime.setAlarmType(Runtime.AlarmType.ALARM_LOWBATTERY);
//trigger AP10 报警定位
-// Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));
+ //Deliver.sendLocationMSG(protocolAPIHelper.getWarningMSG(runtime));
ICLogger.i("triggerSOSLocationProcess ");
LocationClient.getInstance().triggerSOSLocationProcess();
- } else if (runtime.isPowerConnected() == false && runtime.getBatterylevel() <= 5) {
+ } else if (!runtime.isPowerConnected() && runtime.getBatterylevel() <= 5) {
//没有充电,上次电池level > 15% , 上次电池并且不是 电池低电状态,则报警
Intent intent = new Intent();
intent.setAction(ACTION_BATTERYLOW);
play_waning_notify(context);
runtime.setAlarmType(Runtime.AlarmType.ALARM_LOWBATTERY);
//trigger AP10 报警定位
-// Deliver.sendLocationMSG( protocolAPIHelper.getWarningMSG(runtime));
+ //Deliver.sendLocationMSG( protocolAPIHelper.getWarningMSG(runtime));
ICLogger.i("triggerSOSLocationProcess ");
LocationClient.getInstance().triggerSOSLocationProcess();
}
import android.os.IBinder;
import com.enqualcomm.support.Config;
+import com.enqualcomm.support.Constants;
import com.enqualcomm.support.CoreService;
import com.enqualcomm.support.ICApplication;
import com.enqualcomm.support.LocationClient;
import com.enqualcomm.support.provider.ICDatabaseHelper;
import com.enqualcomm.support.provider.ICGlobalSettingsProvider;
import com.enqualcomm.support.provider.ICNotificationProvider;
+import com.enqualcomm.support.provider.WarningItemProvider;
import com.enqualcomm.support.service.Deliver;
import com.ic.protocols.protocolAPIHelper;
import com.ic.work.ITempSensorCallback;
ContentResolver resolver = CoreService.getInstance().getRuntime().getContextProxy().getResolver();
resolver.insert(Uri.parse(ICNotificationProvider.NOTIFICATIONS), contentValues);
updateSettingsValue(resolver);
+
+ ContentValues warningMsgValues = new ContentValues();
+ //设置数据
+ warningMsgValues.put(ICDatabaseHelper.warning_msg_type, Constants.WARNING_MSG_TYPE_BODY_TEMP);
+ warningMsgValues.put(ICDatabaseHelper.warning_msg_title, title);
+ warningMsgValues.put(ICDatabaseHelper.warning_msg_has_read, 1);
+ warningMsgValues.put(ICDatabaseHelper.warning_msg_create_time, System.currentTimeMillis());
+ resolver.insert(Uri.parse(WarningItemProvider.WARNING_MSG), warningMsgValues);
}
private void updateSettingsValue(ContentResolver resolver) {
String[] cmdlist = cmd.split(",");
if (cmdlist.length == 4) {
-
-
log("com.ic.work mode " + cmdlist[3]);
try {
int mod = Integer.parseInt(cmdlist[3]);
<string name="body_temperature_exception_tips_text">体温异常(</string>\r
<string name="web_sms_title_text">Web短信提醒</string>\r
<string name="close_tips_text">关闭</string>\r
+ <string name="low_power_warning_text">低电量报警</string>\r
+ <string name="sos_warning_msg_text">SOS紧急报警</string>\r
<!-- 法语,德语,意大利-->\r
</resources>\r
<string name="body_temperature_exception_tips_text">体温异常(</string>\r
<string name="web_sms_title_text">Web短信提醒</string>\r
<string name="close_tips_text">关闭</string>\r
+ <string name="low_power_warning_text">低电量报警</string>\r
+ <string name="sos_warning_msg_text">SOS紧急报警</string>\r
<!-- 法语,德语,意大利-->\r
</resources>\r
<string name="body_temperature_exception_tips_text">体温异常(</string>\r
<string name="web_sms_title_text">Web短信提醒</string>\r
<string name="close_tips_text">关闭</string>\r
+ <string name="low_power_warning_text">低电量报警</string>\r
+ <string name="sos_warning_msg_text">SOS紧急报警</string>\r
<!-- 法语,德语,意大利-->\r
</resources>\r
<string name="body_temperature_exception_tips_text">体温異常(</string>
<string name="web_sms_title_text">SMS通知</string>
<string name="close_tips_text">シャットダウン</string>
+ <string name="low_power_warning_text">低电量报警</string>
+ <string name="sos_warning_msg_text">SOS紧急报警</string>
</resources>
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="close_tips_text">关闭</string>
+ <string name="low_power_warning_text">低电量报警</string>
+ <string name="sos_warning_msg_text">SOS紧急报警</string>
</resources>
\ No newline at end of file
<string name="close_text">关闭</string>
<string name="commit_text">确定</string>
<string name="sport_aim_achieve_tips_text">运动达标!</string>
+ <string name="low_power_warning_text">低电量报警</string>
+ <string name="sos_warning_msg_text">SOS紧急报警</string>
</resources>
<string name="body_temperature_exception_tips_text">体温异常(</string>
<string name="web_sms_title_text">Web短信提醒</string>
<string name="close_tips_text">关闭</string>
+ <string name="low_power_warning_text">低电量报警</string>
+ <string name="sos_warning_msg_text">SOS紧急报警</string>
<!-- 法语,德语,意大利-->
</resources>
-#Sat Jul 17 19:59:31 CST 2021\r
-VERSION_CODE=893\r
+#Mon Jul 19 20:45:07 CST 2021\r
+VERSION_CODE=894\r