From: kfl_614 Date: Thu, 31 Dec 2020 09:27:32 +0000 (+0800) Subject: fixed some bugs. X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=5b81f15496f7e0d5ecef0e3f715b0497aba694fb;p=protocol_srv.git fixed some bugs. --- diff --git a/app/build.gradle b/app/build.gradle index f3bc2d3f..98b71df9 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -87,7 +87,7 @@ android { } dependencies { compileOnly files ('libs/frameworks-full-debug.jar') - provided files ('libs/telephony_common-full-debug.jar') + compileOnly files ('libs/telephony_common-full-debug.jar') implementation 'com.android.support.constraint:constraint-layout:1.1.3' //compile fileTree(include: ['*.jar', '*.aar'], dir: 'libs') @@ -96,11 +96,11 @@ dependencies { }) implementation 'com.android.support:appcompat-v7:25.1.0' implementation 'com.github.ChestnutPlus:TestModules:v1.0.16' - testCompile 'junit:junit:4.12' + testImplementation 'junit:junit:4.12' implementation 'com.android.support:recyclerview-v7:25.1.0' - compile files ('libs/android-logging-log4j-1.0.3.jar','libs/ftp4j-1.7.2.jar','libs/log4j-1.2.17.jar','libs/okio-2.4.3.jar' ) - compile files ('libs/mail.jar' ) - compile files ('libs/activation.jar','libs/additionnal.jar' ) + implementation files ('libs/android-logging-log4j-1.0.3.jar','libs/ftp4j-1.7.2.jar','libs/log4j-1.2.17.jar','libs/okio-2.4.3.jar' ) + implementation files ('libs/mail.jar' ) + implementation files ('libs/activation.jar','libs/additionnal.jar' ) implementation project(path: ':dNSCache') implementation project(path: ':core') diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index 19d2f544..063fc011 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -44,37 +44,20 @@ - - - - - - - - - - - - - - - - - diff --git a/app/src/main/aidl/com/ic/work/IHeartRateSensorCallback.aidl b/app/src/main/aidl/com/ic/work/IHeartRateSensorCallback.aidl index 0a3b01fe..a7273792 100644 --- a/app/src/main/aidl/com/ic/work/IHeartRateSensorCallback.aidl +++ b/app/src/main/aidl/com/ic/work/IHeartRateSensorCallback.aidl @@ -5,10 +5,12 @@ package com.ic.work; import com.ic.work.domain.HeartRate; interface IHeartRateSensorCallback { - //获取到了数据 - void onHeartRateGet(in HeartRate heartRate); - //正在获取数据 - void onGetData(); - //等待中 - void onWaiting(); + //获取到了数据,最终数据 + void onHeartRateGet(in HeartRate heartRate); + //数据更新中 + void onHeartRateUpdate(in HeartRate heartRate); + //正在获取数据 + void onGettingData(); + //等待中 + void onWaiting(); } \ No newline at end of file diff --git a/app/src/main/aidl/com/ic/work/IHeartRateSensorService.aidl b/app/src/main/aidl/com/ic/work/IHeartRateSensorService.aidl index bc1f7f93..6f63d6e6 100644 --- a/app/src/main/aidl/com/ic/work/IHeartRateSensorService.aidl +++ b/app/src/main/aidl/com/ic/work/IHeartRateSensorService.aidl @@ -3,11 +3,12 @@ package com.ic.work; import com.ic.work.IHeartRateSensorCallback; + interface IHeartRateSensorService { //注册接口 - void registerCallback(in IHeartRateSensorCallback callback); + void registerCallback(in IHeartRateSensorCallback callback,in String callbackTag); //取消接口注册 void unRegisterCallback(in IHeartRateSensorCallback callback); //获取心率相关数据0表示Alarm,1表示客户端用户发出的,3表示服务端发出的单次获取指令 - void getHeartRateInfo(int from); + oneway void getHeartRateInfo(int from,in String callbackTag); } \ No newline at end of file diff --git a/app/src/main/aidl/com/ic/work/ITempSensorCallback.aidl b/app/src/main/aidl/com/ic/work/ITempSensorCallback.aidl index 411f5213..f002d23c 100644 --- a/app/src/main/aidl/com/ic/work/ITempSensorCallback.aidl +++ b/app/src/main/aidl/com/ic/work/ITempSensorCallback.aidl @@ -4,10 +4,12 @@ package com.ic.work; import com.ic.work.domain.Temperature; interface ITempSensorCallback { - //获取到了温度数据 + //获取到了温度数据,这个是最终数据 void onTemperatureGet(in Temperature temperature); + //温度数据更新中 + void onTemperatureUpdating(in Temperature temperature); //正在获取数据 - void onGetData(); + void onGettingData(); //等待中 void onWaiting(); } \ No newline at end of file diff --git a/app/src/main/aidl/com/ic/work/ITempSensorService.aidl b/app/src/main/aidl/com/ic/work/ITempSensorService.aidl index f71b99c7..3d1847ed 100644 --- a/app/src/main/aidl/com/ic/work/ITempSensorService.aidl +++ b/app/src/main/aidl/com/ic/work/ITempSensorService.aidl @@ -4,9 +4,10 @@ import com.ic.work.ITempSensorCallback; interface ITempSensorService { //注册接口 - void registerCallback(in ITempSensorCallback callback); + void registerCallback(in ITempSensorCallback callback,in String callbackTag); //取消接口注册 void unRegisterCallback(in ITempSensorCallback callback); //获取体温:0表示Alarm,1表示客户端用户发出的,3表示服务端发出的单次获取指令 - void getTemperatureInfo(int from); + //callbackTag,可以使用报名+类名的字符串组合 + oneway void getTemperatureInfo(int from,in String callbackTag); } \ No newline at end of file diff --git a/app/src/main/java/com/enqualcomm/support/Constants.java b/app/src/main/java/com/enqualcomm/support/Constants.java index e3e8727a..ac7efc2a 100644 --- a/app/src/main/java/com/enqualcomm/support/Constants.java +++ b/app/src/main/java/com/enqualcomm/support/Constants.java @@ -4,343 +4,343 @@ import android.net.Uri; public interface Constants { - public static final String ACTION_LED = "com.enqualcomm.support.ACTION_LED"; + String ACTION_LED = "com.enqualcomm.support.ACTION_LED"; - public static final String ACTION_SHUTDOWN = "com.ic.action.shutdown"; + String ACTION_SHUTDOWN = "com.ic.action.shutdown"; - public static final String ACTION_PLAYTIME = "com.ic.action.playtime"; + String ACTION_PLAYTIME = "com.ic.action.playtime"; - public static final String ACTION_BROADCAST_PPG = "com.enqualcomm.support.ACTION_BROADCAST_PPG"; - public static final String ACTION_ADDTEST_CONTACTS = "com.enqualcomm.imessage.ACTION_ADDTEST_CONTACTS"; + String ACTION_BROADCAST_PPG = "com.enqualcomm.support.ACTION_BROADCAST_PPG"; + String ACTION_ADDTEST_CONTACTS = "com.enqualcomm.imessage.ACTION_ADDTEST_CONTACTS"; - public static final String ACTION_ALARM_ADD_DATAPOINTS = "com.enqualcomm.support.ADD_DATAPOINTS"; + String ACTION_ALARM_ADD_DATAPOINTS = "com.enqualcomm.support.ADD_DATAPOINTS"; - public static final String ACTION_ALARM_BLE_SCAN = "com.ic.Action.ALarm.bleScan"; - public static final String ACTION_ALARM_CHECK_ANTI = "com.ic.Action.ALarm.CheckAnti"; + String ACTION_ALARM_BLE_SCAN = "com.ic.Action.ALarm.bleScan"; + String ACTION_ALARM_CHECK_ANTI = "com.ic.Action.ALarm.CheckAnti"; - public static final String ACTION_ALARM_ALARM_CHANGE = "com.enqualcomm.support.ACTION_ALARM_ALARM_CHANGE"; + String ACTION_ALARM_ALARM_CHANGE = "com.enqualcomm.support.ACTION_ALARM_ALARM_CHANGE"; - public static final String ACTION_ANTIOFF_ALARM_CHANGE = "com.enqualcomm.support.ACTION_ANTIOFF_ALARM_CHANGE"; + String ACTION_ANTIOFF_ALARM_CHANGE = "com.enqualcomm.support.ACTION_ANTIOFF_ALARM_CHANGE"; - public static final String ACTION_AT_CALLBACK = "com.eqc.intent.action.callback.at"; + String ACTION_AT_CALLBACK = "com.eqc.intent.action.callback.at"; - public static final String ACTION_BATTERY_LOW_MSG = "com.enqualcomm.support.lowbatteryMsg"; + String ACTION_BATTERY_LOW_MSG = "com.enqualcomm.support.lowbatteryMsg"; - public static final String ACTION_CALL_CMCM_SERVICE_INTERFACE = "com.cmcm.interface"; + String ACTION_CALL_CMCM_SERVICE_INTERFACE = "com.cmcm.interface"; - public static final String ACTION_CALL_RING = "com.enqualcomm.support.phone.ring"; + String ACTION_CALL_RING = "com.enqualcomm.support.phone.ring"; - public static final String ACTION_CARE_ALARM = "com.enqualcomm.support.ACTION_CARE_ALARM"; + String ACTION_CARE_ALARM = "com.enqualcomm.support.ACTION_CARE_ALARM"; - public static final String ACTION_CLOSE_UNREAD_MSG = "com.enqualcomm.support.CloseUnreadMsg"; + String ACTION_CLOSE_UNREAD_MSG = "com.enqualcomm.support.CloseUnreadMsg"; - public static final String ACTION_CM_POWERSAVE_MODE = "cmcm.call.eiot.into.powersave"; + String ACTION_CM_POWERSAVE_MODE = "cmcm.call.eiot.into.powersave"; - public static final String ACTION_EQC_ALARM = "com.enqualcomm.support.ACTION_EQC_ALARM"; + String ACTION_EQC_ALARM = "com.enqualcomm.support.ACTION_EQC_ALARM"; - public static final String ACTION_LOCATION_ALARM = "com.enqualcomm.support.ACTION_LOCATION_ALARM"; + String ACTION_LOCATION_ALARM = "com.enqualcomm.support.ACTION_LOCATION_ALARM"; - public static final String ACTION_EXIT_MONITOR_MODE = "com.enqualcomm.support.MONITOR_EXIT"; + String ACTION_EXIT_MONITOR_MODE = "com.enqualcomm.support.MONITOR_EXIT"; - public static final String ACTION_HEART_RATE_RESULT = "com.eqc.heartrate.action.RESULT"; + String ACTION_HEART_RATE_RESULT = "com.eqc.heartrate.action.RESULT"; - public static final String ACTION_HEATR_RATE_START = "com.eqc.heartrate.action.SILENT_START"; - public static final String ACTION_CHECK_ANTIOFF_EVENT = "com.ic.action.CHECK_ANTIOFF_EVENT"; + String ACTION_HEATR_RATE_START = "com.eqc.heartrate.action.SILENT_START"; + String ACTION_CHECK_ANTIOFF_EVENT = "com.ic.action.CHECK_ANTIOFF_EVENT"; - public static final String ACTION_IMESSAGE = "action.message"; + String ACTION_IMESSAGE = "action.message"; - public static final String ACTION_ISCONNECTED = "com.ic.protocol.ACTION_IS_SERVER_CONNECTED"; + String ACTION_ISCONNECTED = "com.ic.protocol.ACTION_IS_SERVER_CONNECTED"; - public static final String ACTION_ISSILENCE = "com.enqualcomm.icare.ACTION_ISSILENCE"; + String ACTION_ISSILENCE = "com.enqualcomm.icare.ACTION_ISSILENCE"; - public static final String ACTION_ISSILENCE2IMESSAGE = "com.enqualcomm.support.ACTION_ISSILENCE2IMESSAGE"; + String ACTION_ISSILENCE2IMESSAGE = "com.enqualcomm.support.ACTION_ISSILENCE2IMESSAGE"; - public static final String ACTION_MISSED_CALL_GET = "com.enqualcomm.support.ACTION_MISSED_CALL_GET"; + String ACTION_MISSED_CALL_GET = "com.enqualcomm.support.ACTION_MISSED_CALL_GET"; - public static final String ACTION_NOTICE_ALARM = "com.enqualcomm.support.ACTION_NOTICE_ALARM"; + String ACTION_NOTICE_ALARM = "com.enqualcomm.support.ACTION_NOTICE_ALARM"; - public static final String ACTION_NOTICE_ALARM_CHANGE = "com.enqualcomm.support.ACTION_NOTICE_ALARM_CHANGE"; + String ACTION_NOTICE_ALARM_CHANGE = "com.enqualcomm.support.ACTION_NOTICE_ALARM_CHANGE"; - public static final String ACTION_PASS_DATA_TO_CM_SERVICES = "com.enqualcomm.support.PASS_DATA"; + String ACTION_PASS_DATA_TO_CM_SERVICES = "com.enqualcomm.support.PASS_DATA"; - public static final String ACTION_REMOTE_CAMERA = "com.enqualcomm.support.ACTION_REMOTE_CAMERA"; + String ACTION_REMOTE_CAMERA = "com.enqualcomm.support.ACTION_REMOTE_CAMERA"; - public static final String ACTION_REMOTE_CAMERA_OSS = "com.enqualcomm.support.ACTION_REMOTE_CAMERA_OSS"; + String ACTION_REMOTE_CAMERA_OSS = "com.enqualcomm.support.ACTION_REMOTE_CAMERA_OSS"; - public static final String ACTION_RESTORE_SYSTEM = "android.intent.action.MASTER_CLEAR"; + String ACTION_RESTORE_SYSTEM = "android.intent.action.MASTER_CLEAR"; - public static final String ACTION_SCANPAIRMESSAGE = "com.enqualcomm.imessage.scanPairMessage"; + String ACTION_SCANPAIRMESSAGE = "com.enqualcomm.imessage.scanPairMessage"; - public static final String ACTION_SEDN_VIDOE_CALL_REQ = "com.enqualcomm.imessage.sendVideoCall"; + String ACTION_SEDN_VIDOE_CALL_REQ = "com.enqualcomm.imessage.sendVideoCall"; - public static final String ACTION_SEND_SOS_MSG = "com.enqualcomm.support.action_send_sos"; + String ACTION_SEND_SOS_MSG = "com.enqualcomm.support.action_send_sos"; - public static final String ACTION_SEND_EMEGENCY_LOCATION_START = "action.emegency.location.start"; - public static final String ACTION_SEND_EMEGENCY_LOCATION_STOP = "action.emegency.location.stop"; - public static final String ACTION_LOCAL_SOS_ACTION = "com.enqualcomm.support.local_sos"; + String ACTION_SEND_EMEGENCY_LOCATION_START = "action.emegency.location.start"; + String ACTION_SEND_EMEGENCY_LOCATION_STOP = "action.emegency.location.stop"; + String ACTION_LOCAL_SOS_ACTION = "com.enqualcomm.support.local_sos"; - public static final String ACTION_SEND_SOS_VIDEO_FILE = "com.enqualcomm.support.action_send_sos_video_file"; + String ACTION_SEND_SOS_VIDEO_FILE = "com.enqualcomm.support.action_send_sos_video_file"; - public static final String ACTION_SEND_VIDEO_FILES = "com.enqualcomm.support.ACTION_SEND_VIDEO_FILES"; + String ACTION_SEND_VIDEO_FILES = "com.enqualcomm.support.ACTION_SEND_VIDEO_FILES"; - public static final String ACTION_SHUTDOWN_MOREINFO = "android.intent.action.ACTION_SHUTDOWN_MOREINFO"; + String ACTION_SHUTDOWN_MOREINFO = "android.intent.action.ACTION_SHUTDOWN_MOREINFO"; - public static final String ACTION_SOS_VIDEO_CHAT = "com.enqualcomm.imessage.ACTION_SOS_VIDEO_CHAT"; + String ACTION_SOS_VIDEO_CHAT = "com.enqualcomm.imessage.ACTION_SOS_VIDEO_CHAT"; - public static final String ACTION_START_DOWNLOAD = "com.enqualcomm.imessage.START_DOWNLOAD_ACTION"; + String ACTION_START_DOWNLOAD = "com.enqualcomm.imessage.START_DOWNLOAD_ACTION"; - public static final String ACTION_STHEART_RATE_ALARM_CHANGE = "com.enqualcomm.support.STHEART_RATE_ALARM_CHANGE"; + String ACTION_STHEART_RATE_ALARM_CHANGE = "com.enqualcomm.support.STHEART_RATE_ALARM_CHANGE"; - public static final String ACTION_SYNC = "SYNC"; + String ACTION_SYNC = "SYNC"; - public static final String ACTION_UNBOUND_TERMINAL = "com.enqualcomm.support.ACTION_UNBOUND_TERMINAL"; + String ACTION_UNBOUND_TERMINAL = "com.enqualcomm.support.ACTION_UNBOUND_TERMINAL"; - public static final String ACTION_UPDATE_ICON = "com.enqualcomm.support.ACTION_UPDATE_ICON"; + String ACTION_UPDATE_ICON = "com.enqualcomm.support.ACTION_UPDATE_ICON"; - public static final String ACTION_UPDATE_SECRET_KEY = "com.enqualcomm.support.UPDATE_SECRET_KEY"; + String ACTION_UPDATE_SECRET_KEY = "com.enqualcomm.support.UPDATE_SECRET_KEY"; - public static final String ACTION_VIDEO_END_CALL = "com.enqualcomm.support.ACTION_VIDEO_END_CALL"; + String ACTION_VIDEO_END_CALL = "com.enqualcomm.support.ACTION_VIDEO_END_CALL"; - public static final String ACTION_VIDEO_LOGIN = "com.enqualcomm.imessage.ACTION_VIDEO_LOGIN"; + String ACTION_VIDEO_LOGIN = "com.enqualcomm.imessage.ACTION_VIDEO_LOGIN"; - public static final String ACTION_VIDEO_LOGOUT = "com.enqualcomm.imessage.ACTION_VIDEO_LOGOUT"; + String ACTION_VIDEO_LOGOUT = "com.enqualcomm.imessage.ACTION_VIDEO_LOGOUT"; - public static final String ACTION_VIDEO_RECEIVE_LOGIN = "com.enqualcomm.imessage.ACTION_VIDEO_RECEIVE_LOGIN"; + String ACTION_VIDEO_RECEIVE_LOGIN = "com.enqualcomm.imessage.ACTION_VIDEO_RECEIVE_LOGIN"; - public static final String ACTION_WAKEUP_ALARM = "com.eqc.deliverWakeupAlarm.action"; + String ACTION_WAKEUP_ALARM = "com.eqc.deliverWakeupAlarm.action"; - public static final String ACTION_YUN_ALARM_CHANGE = "com.eqc.deskclock.YUN_ALARM_CHANGE"; + String ACTION_YUN_ALARM_CHANGE = "com.eqc.deskclock.YUN_ALARM_CHANGE"; - public static final String ACTION_PRACTICE_REPORT_ALARM = "com.enqualcomm.support.PRACTICE_ALARM"; + String ACTION_PRACTICE_REPORT_ALARM = "com.enqualcomm.support.PRACTICE_ALARM"; - public final static String ACTION_START_PRACTISE = "com.ic.action_start_practice"; - public final static String KeyPractice = "cmd"; + public static String ACTION_START_PRACTISE = "com.ic.action_start_practice"; + public static String KeyPractice = "cmd"; - public static final int ALARM_UPDATE_NOTICE = 206; + int ALARM_UPDATE_NOTICE = 206; - public static final int CALL_RECORD_CHANGED = 103; + int CALL_RECORD_CHANGED = 103; - public static final String CMD_ID_CM = "cmdId"; + String CMD_ID_CM = "cmdId"; - public static final Uri CONTACT_URI = Uri.parse("content://com.enqualcomm.support/contact"); + Uri CONTACT_URI = Uri.parse("content://com.enqualcomm.support/contact"); - public static final Uri CM_SERVICE_SETTING = Uri.parse("content://com.cmcm.service/cmsetting"); + Uri CM_SERVICE_SETTING = Uri.parse("content://com.cmcm.service/cmsetting"); - public static final String DIALOG_ACTION = "com.enqualcomm.support.DIALOG"; + String DIALOG_ACTION = "com.enqualcomm.support.DIALOG"; - public static final int ENTER_SILENT_MODE = 212; + int ENTER_SILENT_MODE = 212; - public static final int EXIT_SILENT_MODE = 213; + int EXIT_SILENT_MODE = 213; - public static final String FLAG = "flag"; + String FLAG = "flag"; - public static final String ANTI_ALARM = "com.enqualcomm.support.ANTI_ALARM"; - public static final String TEMP_ALARM = "com.enqualcomm.support.TEMP_ALARM"; - public static final String HEART_ALARM = "com.enqualcomm.support.HEART_ALARM"; + String ANTI_ALARM = "com.enqualcomm.support.ANTI_ALARM"; + String TEMP_ALARM = "com.enqualcomm.support.TEMP_ALARM"; + String HEART_ALARM = "com.enqualcomm.support.HEART_ALARM"; - public static final int IDLE_MODE_CHANGED = 102; + int IDLE_MODE_CHANGED = 102; - public static final int INIT_SERVER_OK = 216; + int INIT_SERVER_OK = 216; - public static final int IN_SILENCE = 600; + int IN_SILENCE = 600; - public static final boolean IS_OVERSEAS = false; + boolean IS_OVERSEAS = false; - public static final int JUFENG_SDK_INIT = 215; + int JUFENG_SDK_INIT = 215; - public static final String KEY_CATEGORY = "category"; + String KEY_CATEGORY = "category"; - public static final String KEY_COMPANY = "KEY_COMPANY"; + String KEY_COMPANY = "KEY_COMPANY"; - public static final String KEY_CONTACT_ID = "contact_id"; + String KEY_CONTACT_ID = "contact_id"; - public static final String KEY_DELETE_FILE_TIME = "KEY_DELETE_FILE_TIME"; + String KEY_DELETE_FILE_TIME = "KEY_DELETE_FILE_TIME"; - public static final String KEY_DEVICE_ID = "key_device_id"; + String KEY_DEVICE_ID = "key_device_id"; - public static final String KEY_DEVICE_KEY = "key_device_key"; + String KEY_DEVICE_KEY = "key_device_key"; - public static final String KEY_FILEPATH = "filepath"; + String KEY_FILEPATH = "filepath"; - public static final String KEY_FILETYPE = "filetype"; + String KEY_FILETYPE = "filetype"; - public static final String KEY_ID = "id"; + String KEY_ID = "id"; - public static final String KEY_ISCONNECTED = "isConnected"; + String KEY_ISCONNECTED = "isConnected"; - public static final String KEY_ISSILENCE = "KEY_ISSILENCE"; + String KEY_ISSILENCE = "KEY_ISSILENCE"; - public static final String KEY_IS_RESUME = "key_is_resume"; + String KEY_IS_RESUME = "key_is_resume"; - public static final String KEY_JUST_TALK = "KEY_JUST_TALK"; + String KEY_JUST_TALK = "KEY_JUST_TALK"; - public static final String KEY_NAME = "name"; + String KEY_NAME = "name"; - public static final String KEY_NET_WORK_TYPE = "NET_WORK_TYPE"; + String KEY_NET_WORK_TYPE = "NET_WORK_TYPE"; - public static final String KEY_NUMBER = "number"; + String KEY_NUMBER = "number"; - public static final String KEY_PAIR_CID = "PAIR_CID"; + String KEY_PAIR_CID = "PAIR_CID"; - public static final String KEY_REMOTE_NUMBER = "key_remote_number"; + String KEY_REMOTE_NUMBER = "key_remote_number"; - public static final String KEY_SAVE_STEP_COUNT = "key_save_step_count"; + String KEY_SAVE_STEP_COUNT = "key_save_step_count"; - public static final String KEY_SOS_FILE_BODY = "key_sos_file_body"; + String KEY_SOS_FILE_BODY = "key_sos_file_body"; - public static final String KEY_SOS_FILE_FILE_TYPE = "key_sos_file_file_type"; + String KEY_SOS_FILE_FILE_TYPE = "key_sos_file_file_type"; - public static final String KEY_STATUS = "key_status"; + String KEY_STATUS = "key_status"; - public static final String KEY_STEP_COUNT = "KEY_STEP_COUNT"; + String KEY_STEP_COUNT = "KEY_STEP_COUNT"; - public static final String KEY_UNBOUND_FLAG = "KEY_UNBOUND_FLAG"; + String KEY_UNBOUND_FLAG = "KEY_UNBOUND_FLAG"; - public static final String KEY_VIDEO_PATH = "KEY_VIDEO_PATH"; + String KEY_VIDEO_PATH = "KEY_VIDEO_PATH"; - public static final int LOCATION_DATA = 217; + int LOCATION_DATA = 217; - public static final int MONITOR_GOIN = 202; + int MONITOR_GOIN = 202; - public static final int MONITOR_GOOUT = 203; + int MONITOR_GOOUT = 203; - public static final int MSG_WHAT_RELOAD_VOICE = 1000; + int MSG_WHAT_RELOAD_VOICE = 1000; - public static final int MSG_WHAT_SEND_OSSFILE = 1006; + int MSG_WHAT_SEND_OSSFILE = 1006; - public static final int MSG_WHAT_SEND_PAIR = 1003; + int MSG_WHAT_SEND_PAIR = 1003; - public static final int MSG_WHAT_SEND_PICTURE = 1002; + int MSG_WHAT_SEND_PICTURE = 1002; - public static final int MSG_WHAT_SEND_VOICE = 1001; + int MSG_WHAT_SEND_VOICE = 1001; - public static final int MSG_WHAT_SILENCE_STATUS = 1005; + int MSG_WHAT_SILENCE_STATUS = 1005; - public static final int MSG_WHAT_VIDEO_CHAT = 1004; + int MSG_WHAT_VIDEO_CHAT = 1004; - public static final int MSG_WHAT_PPG = 1007; - public static final String key_ppg = "ppg"; - public static final String key_bph = "bph"; - public static final String key_bpl = "bpl"; - public static final String key_spo2 = "sp02"; + int MSG_WHAT_PPG = 1007; + String key_ppg = "ppg"; + String key_bph = "bph"; + String key_bpl = "bpl"; + String key_spo2 = "sp02"; - public static final int NEW_MEDIA_PUSH = 100; + int NEW_MEDIA_PUSH = 100; - public static final String ACTION_SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED"; - public static final String OTHER_ALARM_END = "com.enqualcomm.support.OTHER_ALARM_END"; + String ACTION_SMS_RECEIVED = "android.provider.Telephony.SMS_RECEIVED"; + String OTHER_ALARM_END = "com.enqualcomm.support.OTHER_ALARM_END"; - public static final String OTHER_ALARM_START = "com.enqualcomm.support.OTHER_ALARM_START"; + String OTHER_ALARM_START = "com.enqualcomm.support.OTHER_ALARM_START"; - public static final String OTHER_HEARTRATE_ALARM_END = "com.enqualcomm.support.OTHER_HEARTRATE_ALARM_END"; + String OTHER_HEARTRATE_ALARM_END = "com.enqualcomm.support.OTHER_HEARTRATE_ALARM_END"; - public static final String OTHER_HEARTRATE_ALARM_START = "com.enqualcomm.support.OTHER_HEARTRATE_ALARM_START"; + String OTHER_HEARTRATE_ALARM_START = "com.enqualcomm.support.OTHER_HEARTRATE_ALARM_START"; - public static final int OUT_SILENCE = 700; + int OUT_SILENCE = 700; - public static final int PASS_DATA_DIRECTLY = 500; + int PASS_DATA_DIRECTLY = 500; - public static final int PLAY_RECORD_UPDATE = 207; + int PLAY_RECORD_UPDATE = 207; - public static final int REBOOT_SYSTEM = 208; + int REBOOT_SYSTEM = 208; - public static final int RESET_SYSTEM = 210; + int RESET_SYSTEM = 210; - public static final String RESTORE_EXTRA_WIPE_EXTERNAL_STORAGE = "android.intent.extra.WIPE_EXTERNAL_STORAGE"; + String RESTORE_EXTRA_WIPE_EXTERNAL_STORAGE = "android.intent.extra.WIPE_EXTERNAL_STORAGE"; - public static final String RESTORE_REASON = "android.intent.extra.REASON"; + String RESTORE_REASON = "android.intent.extra.REASON"; - public static final String ACTION_START_FOTA_UPDATE = "com.ic.action.startfotaUpdate"; - public static final String ACTION_SMSCMD = "com.enqualcomm.support.SMSCMD"; - public static final String ACTION_SMSCMD_Reply = "com.ic.action.fotaUpdateReply"; - public static final String ACTION_TINTERNAL_TEST = "com.ic.action.internaltest"; + String ACTION_START_FOTA_UPDATE = "com.ic.action.startfotaUpdate"; + String ACTION_SMSCMD = "com.enqualcomm.support.SMSCMD"; + String ACTION_SMSCMD_Reply = "com.ic.action.fotaUpdateReply"; + String ACTION_TINTERNAL_TEST = "com.ic.action.internaltest"; - public static final String KeyReplyData = "reply"; + String KeyReplyData = "reply"; - public static final String ACTION_SMSCMD_TEST = "com.ic.action.internaltest"; + String ACTION_SMSCMD_TEST = "com.ic.action.internaltest"; - public static final int RESULT_ERROR = 500; + int RESULT_ERROR = 500; - public static final int RESULT_OK = 200; + int RESULT_OK = 200; - public static final String RESUME_ACTION = "com.enqualcomm.imessage.RESUME_ACTION"; + String RESUME_ACTION = "com.enqualcomm.imessage.RESUME_ACTION"; - public static final String SERVICE_CLS_NAME = "com.enqualcomm.support.CoreService"; + String SERVICE_CLS_NAME = "com.enqualcomm.support.CoreService"; - public static final String SERVICE_PKG_NAME = "com.enqualcomm.support"; + String SERVICE_PKG_NAME = "com.enqualcomm.support"; - public static final int SHUTDOWN_SYSTM = 209; + int SHUTDOWN_SYSTM = 209; - public static final String SLEEP_ALARM = "com.enqualcomm.support.SLEEP_ALARM"; + String SLEEP_ALARM = "com.enqualcomm.support.SLEEP_ALARM"; - public static final String SOS_ACTION = "com.enqualcomm.imessage.SOS_ACTION"; + String SOS_ACTION = "com.enqualcomm.imessage.SOS_ACTION"; - public static final int SOS_GOIN = 204; + int SOS_GOIN = 204; - public static final int SOS_GOOUT = 205; + int SOS_GOOUT = 205; - public static final String STEP_COUNT_ALARM_ACTION = "com.enqualcomm.support.ACTION_STEP_COUNT_ALARM"; + String STEP_COUNT_ALARM_ACTION = "com.enqualcomm.support.ACTION_STEP_COUNT_ALARM"; - public static final String STRING_CMD_JSON_DATA = "cmdJsonData"; + String STRING_CMD_JSON_DATA = "cmdJsonData"; - public static final String STWORKMODE_ALARM = "com.enqualcomm.support.ACTION_STWORKMODE_ALARM"; + String STWORKMODE_ALARM = "com.enqualcomm.support.ACTION_STWORKMODE_ALARM"; - public static final String VALUE_SETTIING_VERSION = "value_setting_ver"; + String VALUE_SETTIING_VERSION = "value_setting_ver"; - public static final int VIDEO_MESSAGE = 300; + int VIDEO_MESSAGE = 300; - public static final String WAKE_ALARM = "com.enqualcomm.support.WAKE_ALARM"; + String WAKE_ALARM = "com.enqualcomm.support.WAKE_ALARM"; - public static final String WEATHER_ALARM = "com.ic.alarm.ACTION_WEATHER_ALARM"; - public static final String WEATHER_ACTION = "com.ic.action.ACTION_GET_WEATHER"; - public static final String ACTION_QUERY_WEATHER = "com.ic.action_query_weather"; - public static final String ACTION_WEATHER_RECEIVED = "com.ic.action_weather_recveived"; - public static final String KEY_Weather = "weather"; + String WEATHER_ALARM = "com.ic.alarm.ACTION_WEATHER_ALARM"; + String WEATHER_ACTION = "com.ic.action.ACTION_GET_WEATHER"; + String ACTION_QUERY_WEATHER = "com.ic.action_query_weather"; + String ACTION_WEATHER_RECEIVED = "com.ic.action_weather_recveived"; + String KEY_Weather = "weather"; - public static final int WIFI_SET_RESULT = 217; + int WIFI_SET_RESULT = 217; - public static final int WORKMODE_CHANGED = 211; + int WORKMODE_CHANGED = 211; - public static final String contact = "contact"; + String contact = "contact"; - public static final String wechat_contact = "content"; + String wechat_contact = "content"; - public static final String ACTION_CHECK_SERVER_RESPONSE = "com.enqualcomm.support.ACTION_CHECK_SERVER_RESPONSE"; - public static final String ACTION_RETRY_SERVER_CONNECT = "com.enqualcomm.support.ACTION_RETRY_SERVER_CONNECT"; - public static final String ACTION_CHECK_LOCATION_RESULT = "com.enqualcomm.support.ACTION_CHECK_LOCATION_RESULT"; + String ACTION_CHECK_SERVER_RESPONSE = "com.enqualcomm.support.ACTION_CHECK_SERVER_RESPONSE"; + String ACTION_RETRY_SERVER_CONNECT = "com.enqualcomm.support.ACTION_RETRY_SERVER_CONNECT"; + String ACTION_CHECK_LOCATION_RESULT = "com.enqualcomm.support.ACTION_CHECK_LOCATION_RESULT"; - public static final String ACTION_MESSAGE_SENT = "com.ic.action.message_sent"; - public static final String ACTION_MESSAGE_RECEIVED = "com.ic.action.message_received"; - public static final String KEY_MESSAGE_TYPE = "msgType"; // 分为 voice ,pic ,和 text - public static final String KEY_MESSAGE_URL = "msgUrl"; // 消息为 voice和 pic 此纪录为 路径, text消息则直接是消息内容。 utf-8 格式String - public static final String KEY_MESSAGE_FROM = "msgFrom"; // 消息来源(发送者名称),预留,暂时不用。 + String ACTION_MESSAGE_SENT = "com.ic.action.message_sent"; + String ACTION_MESSAGE_RECEIVED = "com.ic.action.message_received"; + String KEY_MESSAGE_TYPE = "msgType"; // 分为 voice ,pic ,和 text + String KEY_MESSAGE_URL = "msgUrl"; // 消息为 voice和 pic 此纪录为 路径, text消息则直接是消息内容。 utf-8 格式String + String KEY_MESSAGE_FROM = "msgFrom"; // 消息来源(发送者名称),预留,暂时不用。 - public static final String ACTION_TEMP_RESULT = "com.ic.action.temp_result"; - public static final String KEY_TEMP_BODY = "body"; // double 体温 - public static final String KEY_TEMP_WRIST = "wrist"; // double 腕温 - public static final String KEY_TEMP_OUT = "out"; // double 腕温 + String ACTION_TEMP_RESULT = "com.ic.action.temp_result"; + String KEY_TEMP_BODY = "body"; // double 体温 + String KEY_TEMP_WRIST = "wrist"; // double 腕温 + String KEY_TEMP_OUT = "out"; // double 腕温 - public static String ACTION_ANTI_OFF0 = "com.ic.ACTION_ANTIOFF"; - public static String ACTION_ANTI_OFF = "com.ic.ACTION_STRIP"; - public static String KEY_ANTI_EVENT = "eventID"; //integer eventID =1 脱落, eventID =0 佩戴 - public static String KEY_ANTI_TXT = "eventTxt"; //String AnitMessage + String ACTION_ANTI_OFF0 = "com.ic.ACTION_ANTIOFF"; + String ACTION_ANTI_OFF = "com.ic.ACTION_STRIP"; + String KEY_ANTI_EVENT = "eventID"; //integer eventID =1 脱落, eventID =0 佩戴 + String KEY_ANTI_TXT = "eventTxt"; //String AnitMessage - public static String ACTION_BATTERYLOW = "com.ic.ACTION_BATTERYLOW"; - public static String KEY_BATTERY_EVENT = "eventID"; //integer eventID =1 battery low, eventID =0 解除 + String ACTION_BATTERYLOW = "com.ic.ACTION_BATTERYLOW"; + String KEY_BATTERY_EVENT = "eventID"; //integer eventID =1 battery low, eventID =0 解除 - public static String PersistFotaServer2Url = "persist.sys.ota.host2"; + String PersistFotaServer2Url = "persist.sys.ota.host2"; //把服务器下发的文本消息作为短信消息存储在短信数据库中,mms.apk会接收此消息并保存到数据库 //persist.sys.pushtxtAsSMS == false的时候mms.apk会忽略此消息,默认事true,所以要关闭要单独设置 - public static String ActionReceivePushTxt = "action.ic.PushTxtToSMSDB"; - public static String ActionSrvPushTxt = "action.ic.srvPushTxt"; + String ActionReceivePushTxt = "action.ic.PushTxtToSMSDB"; + String ActionSrvPushTxt = "action.ic.srvPushTxt"; /** * PreferenceManager.getDefaultSharedPreferences(context) , package name "com.enqualcomm.support" @@ -356,49 +356,49 @@ public interface Constants { * 血氧偏差spo2_adj=5 * 则赋值 2,-2,-3,5 */ - public static String SHAREKEY_SETTING_PPG_ECG_ADJUST = "PpgEcgAdjust"; + String SHAREKEY_SETTING_PPG_ECG_ADJUST = "PpgEcgAdjust"; /** * 睡眠分数 , int */ - public static String SHAREKEY_SETTING_SLEEP_SCORE = "SleepScore"; + String SHAREKEY_SETTING_SLEEP_SCORE = "SleepScore"; /** * 当前睡眠分数的日期 String yyMMddHHmm * 可能时昨天的,算完就是当天的 */ - public static String SHAREKEY_SETTING_SLEEP_SCORE_DATE = "SleepScoreDate"; + String SHAREKEY_SETTING_SLEEP_SCORE_DATE = "SleepScoreDate"; /** * 久坐检测时长,int 分钟为单位,此处为读取方法,可在显示前读取当前设置。 * 设置请采用broadcast方式发给协议层存储 */ - public static String SHAREKEY_SETTING_SIT_ALARM_RANGE_IN_MINUTES = "SIT_RANGE"; + String SHAREKEY_SETTING_SIT_ALARM_RANGE_IN_MINUTES = "SIT_RANGE"; /*** * ACTion 用于 设置久坐时长分钟为单位 */ - public static String ACTION_SET_SIT_RANGE = "com.ic.action.set_sit_range"; + String ACTION_SET_SIT_RANGE = "com.ic.action.set_sit_range"; /** * ACTION_SET_SIT_RANGE 参数 int,分钟数。 */ - public static String KEY_SIT_RANGE = "sit_range"; + String KEY_SIT_RANGE = "sit_range"; /*** * 内部定时器用action alarm */ - public static String ACTION_SIT_ALARM = "com.ic.action.sit_alarm_local"; + String ACTION_SIT_ALARM = "com.ic.action.sit_alarm_local"; /** * 发送给app做显示用 */ - public static String ACTION_KEEPSIT_ALARM = "com.ic.action.keep_sit_alarm"; + String ACTION_KEEPSIT_ALARM = "com.ic.action.keep_sit_alarm"; //获取Sensor数据的请求来源 - public static final int FROM_SERVER = 0; - public static final int FROM_ALARM = 1; - public static final int FROM_CLIENT = 2; + int FROM_SERVER = 0; + int FROM_ALARM = 1; + int FROM_CLIENT = 2; } diff --git a/app/src/main/java/com/enqualcomm/support/CoreService.java b/app/src/main/java/com/enqualcomm/support/CoreService.java index 885f2fe5..a3901e31 100644 --- a/app/src/main/java/com/enqualcomm/support/CoreService.java +++ b/app/src/main/java/com/enqualcomm/support/CoreService.java @@ -79,6 +79,7 @@ import static com.enqualcomm.support.Constants.ACTION_SEND_EMEGENCY_LOCATION_STA import static com.enqualcomm.support.Constants.ACTION_SEND_EMEGENCY_LOCATION_STOP; import static com.enqualcomm.support.Constants.ANTI_ALARM; import static com.enqualcomm.support.Constants.FROM_ALARM; +import static com.enqualcomm.support.Constants.FROM_SERVER; import static com.enqualcomm.support.Constants.HEART_ALARM; import static com.enqualcomm.support.Constants.KEY_SAVE_STEP_COUNT; import static com.enqualcomm.support.Constants.KEY_STEP_COUNT; @@ -936,7 +937,7 @@ public class CoreService extends Service { //设置温度测量间隔时间 - setTempAlarm(); + setTempAlarm(false); //初始化佩戴检测 @@ -1283,7 +1284,7 @@ public class CoreService extends Service { // } } else if (TEMP_ALARM.equals(paramIntent.getAction())) { - setTempAlarm(); + setTempAlarm(false); return Service.START_STICKY; } else if (STEP_COUNT_ALARM_ACTION.equals(paramIntent.getAction())) { @@ -1469,7 +1470,7 @@ public class CoreService extends Service { FileOutputUtil.fileOutput(runtime.getCacheDir(), "alarmCycle", sb.toString()); } - public void setTempAlarm() { + public void setTempAlarm(boolean fromServerCmd) { StringBuilder sb = new StringBuilder(); int cycle = runtime.temp_test_Cycle; @@ -1492,7 +1493,7 @@ public class CoreService extends Service { } else { ICLogger.d("server_starting == > " + server_starting); if (!server_starting) - TemperatureUtil.getInstance().doTempTestInThread(FROM_ALARM); + TemperatureUtil.getInstance().doTempTestInThread(fromServerCmd ? FROM_SERVER : FROM_ALARM); } } diff --git a/app/src/main/java/com/enqualcomm/support/ICApplication.java b/app/src/main/java/com/enqualcomm/support/ICApplication.java index a5354790..815b9406 100644 --- a/app/src/main/java/com/enqualcomm/support/ICApplication.java +++ b/app/src/main/java/com/enqualcomm/support/ICApplication.java @@ -7,7 +7,9 @@ import android.os.Handler; import android.support.multidex.MultiDex; import android.util.SparseArray; +import com.enqualcomm.support.service.HeartRateManager; import com.enqualcomm.support.utils.ICLogger; +import com.enqualcomm.support.utils.TemperatureUtil; import java.util.HashMap; @@ -35,6 +37,9 @@ public class ICApplication extends Application { crashHandler.init(getApplicationContext()); instance = this; sContext = getApplicationContext(); + //一定要在上面这句以后 + TemperatureUtil.getInstance(); + HeartRateManager.getInstance(); } diff --git a/app/src/main/java/com/enqualcomm/support/service/Deliver.java b/app/src/main/java/com/enqualcomm/support/service/Deliver.java index bf109ce9..58aa4539 100644 --- a/app/src/main/java/com/enqualcomm/support/service/Deliver.java +++ b/app/src/main/java/com/enqualcomm/support/service/Deliver.java @@ -449,8 +449,6 @@ public class Deliver extends AbstractConnectionService { Util.parseToVoicePacketSent(voiceContent); //trigger 分包发送 if (CoreService.getInstance().getConnection() != null) { - - //H88 专用功能拍照时检测用户体温心率 if (Util.getSystemProperties("persist.sys.do_check_condition", "false").equals("true")) { //开启测温 diff --git a/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java b/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java index 10f70b8e..d315803c 100644 --- a/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java +++ b/app/src/main/java/com/enqualcomm/support/service/HeartRateManager.java @@ -136,7 +136,7 @@ public class HeartRateManager extends AbstractInvokeHandlerService { ICLogger.d("onServiceConnected..."); heartRateSensorService = IHeartRateSensorService.Stub.asInterface(service); try { - heartRateSensorService.registerCallback(mRemoteCallback); + heartRateSensorService.registerCallback(mRemoteCallback, HeartRateManager.class.getName()); } catch (Exception e) { e.printStackTrace(); } @@ -160,7 +160,12 @@ public class HeartRateManager extends AbstractInvokeHandlerService { } @Override - public void onGetData() { + public void onHeartRateUpdate(HeartRate heartRate) { + //心率更新中 + } + + @Override + public void onGettingData() { ICLogger.d("正在获取心率数据..."); } @@ -293,7 +298,7 @@ public class HeartRateManager extends AbstractInvokeHandlerService { } //开始去测试 try { - heartRateSensorService.getHeartRateInfo(from); + heartRateSensorService.getHeartRateInfo(from, HeartRateManager.class.getName()); } catch (Exception e) { e.printStackTrace(); } diff --git a/app/src/main/java/com/enqualcomm/support/utils/ProcessReceiver.java b/app/src/main/java/com/enqualcomm/support/utils/ProcessReceiver.java index 314a4e3b..25de2ec2 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/ProcessReceiver.java +++ b/app/src/main/java/com/enqualcomm/support/utils/ProcessReceiver.java @@ -18,7 +18,6 @@ import com.enqualcomm.support.CoreService; import com.enqualcomm.support.R; import com.enqualcomm.support.bean.Contact; import com.enqualcomm.support.bean.Runtime; -import com.enqualcomm.support.bean.StringMessage; import com.enqualcomm.support.bean.VoiceContent; import com.enqualcomm.support.service.AudioService; import com.enqualcomm.support.service.Deliver; @@ -33,18 +32,13 @@ import static com.enqualcomm.support.Constants.ACTION_PLAYTIME; import static com.enqualcomm.support.Constants.ACTION_REMOTE_CAMERA; import static com.enqualcomm.support.Constants.ACTION_SET_SIT_RANGE; import static com.enqualcomm.support.Constants.ACTION_SHUTDOWN; -import static com.enqualcomm.support.Constants.ACTION_TEMP_RESULT; import static com.enqualcomm.support.Constants.DIALOG_ACTION; import static com.enqualcomm.support.Constants.FROM_SERVER; import static com.enqualcomm.support.Constants.KEY_MESSAGE_FROM; import static com.enqualcomm.support.Constants.KEY_MESSAGE_TYPE; import static com.enqualcomm.support.Constants.KEY_MESSAGE_URL; -import static com.enqualcomm.support.Constants.KEY_TEMP_BODY; -import static com.enqualcomm.support.Constants.KEY_TEMP_WRIST; import static com.enqualcomm.support.Constants.RESUME_ACTION; import static com.enqualcomm.support.bean.Content.CONTACT_CATEGORY_GROUP; -import static com.enqualcomm.support.utils.TemperatureUtil.KEY_TEMP_BYPROTOCOL; -import static com.enqualcomm.support.utils.TemperatureUtil.KEY_TEMP_OUT; public class ProcessReceiver extends BroadcastReceiver { @@ -481,26 +475,6 @@ public class ProcessReceiver extends BroadcastReceiver { } } - } else if (ACTION_TEMP_RESULT.equals(str)) { - double wrist_temp = paramIntent.getDoubleExtra(KEY_TEMP_WRIST, 0.0f); - double body_temp = paramIntent.getDoubleExtra(KEY_TEMP_BODY, 0.0f); - double tempOut = paramIntent.getDoubleExtra(KEY_TEMP_OUT, 0.0f); - boolean byprotocol = paramIntent.getBooleanExtra(KEY_TEMP_BYPROTOCOL, false); - if (byprotocol == false) { - if (Config.disableWristTemp) { - //ic68 - body_temp = wrist_temp; - } - ICLogger.i("Received Temperature wrist " + wrist_temp + " body " + body_temp); - StringMessage temperatureMsg = protocolAPIHelper.getTemperatureMSG(wrist_temp, body_temp, tempOut, null); - if (temperatureMsg != null) { - ICLogger.i("temp 发送体温测量值 " + temperatureMsg.isFromCache()); - } - Deliver.sendLocationMSG(temperatureMsg); - } else { - ICLogger.i("Skip protocol Temperature wrist " + wrist_temp + " body " + body_temp); - - } } else if (ACTION_SET_SIT_RANGE.equals(str)) { if (paramIntent.hasExtra(Constants.KEY_SIT_RANGE)) { int sitrange = paramIntent.getIntExtra(Constants.KEY_SIT_RANGE, 0); diff --git a/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java b/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java index 370a5163..cfebf21a 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java +++ b/app/src/main/java/com/enqualcomm/support/utils/TemperatureUtil.java @@ -52,7 +52,7 @@ public class TemperatureUtil { //注册回调接口 try { ICLogger.d("registerCallback..."); - temperatureRemoteService.registerCallback(mRemoteCallback); + temperatureRemoteService.registerCallback(mRemoteCallback, TemperatureUtil.class.getName()); } catch (Exception e) { e.printStackTrace(); } @@ -69,12 +69,18 @@ public class TemperatureUtil { private final ITempSensorCallback.Stub mRemoteCallback = new ITempSensorCallback.Stub() { @Override public void onTemperatureGet(Temperature temperature) { + ICLogger.d("on temperature test end..." + temperature); //处理结果 handleTemperature(temperature); } @Override - public void onGetData() { + public void onTemperatureUpdating(Temperature temperature) { + //更新中 + } + + @Override + public void onGettingData() { //数据获取中... ICLogger.d("数据获取中..."); } @@ -107,10 +113,6 @@ public class TemperatureUtil { temperature.getWristTemp(), temperature.getEnvTemp()); - //发送消息给launcher显示 - sendTempBroadcast(temperature.getWristTemp(), - temperature.getBodyTemp(), - temperature.getEnvTemp()); //体温异常报警检测开启的会进行异常报警 if (Config.needTemperature_abnormal_alarm) { @@ -187,7 +189,7 @@ public class TemperatureUtil { try { if (temperatureRemoteService != null) { ICLogger.d("get temperature info..."); - temperatureRemoteService.getTemperatureInfo(from); + temperatureRemoteService.getTemperatureInfo(from, TemperatureUtil.class.getName()); } } catch (Exception e) { e.printStackTrace(); diff --git a/app/src/main/java/com/ic/protocols/protocol_beehome.java b/app/src/main/java/com/ic/protocols/protocol_beehome.java index 804c8cb4..f59f2e1c 100644 --- a/app/src/main/java/com/ic/protocols/protocol_beehome.java +++ b/app/src/main/java/com/ic/protocols/protocol_beehome.java @@ -1663,7 +1663,7 @@ public class protocol_beehome { connection.send(APTE(index, freq)); ICLogger.i("收到服务器指令:测量体温 " + freq + "分钟一次。"); Config.setTemperatureTestCycle(runtime, freq * 60); - CoreService.getInstance().setTempAlarm(); + CoreService.getInstance().setTempAlarm(true); if (runtime.check_stat_do_temp_test()) TemperatureUtil.getInstance().doTempTestInThread(FROM_SERVER); diff --git a/app/src/main/java/com/ic/protocols/protocol_fzd.java b/app/src/main/java/com/ic/protocols/protocol_fzd.java index e3e2aea3..16cfd975 100644 --- a/app/src/main/java/com/ic/protocols/protocol_fzd.java +++ b/app/src/main/java/com/ic/protocols/protocol_fzd.java @@ -1,10 +1,8 @@ package com.ic.protocols; import android.content.ComponentName; -//import android.content.IClipboard; import android.content.Intent; -//import com.android.internal.telephony.uicc.RuimFileHandler; import com.enqualcomm.support.Config; import com.enqualcomm.support.CoreService; import com.enqualcomm.support.bean.Contact; @@ -16,7 +14,6 @@ import com.enqualcomm.support.service.HeartRateManager; import com.enqualcomm.support.utils.Connection; import com.enqualcomm.support.utils.ICLogger; import com.enqualcomm.support.utils.MD5; -import com.enqualcomm.support.utils.TemperatureUtil; import com.enqualcomm.support.utils.TimeUtil; import com.enqualcomm.support.utils.Util; import com.enqualcomm.support.utils.regexUtil; @@ -29,6 +26,9 @@ import static com.enqualcomm.support.Constants.FROM_SERVER; import static com.enqualcomm.support.LocationClient.LOCATION_MODE; import static java.lang.Math.abs; +//import android.content.IClipboard; +//import com.android.internal.telephony.uicc.RuimFileHandler; + public class protocol_fzd { private static final String TAG = "ICSrv." + protocol_fzd.class.getSimpleName(); private static final String PrivKEY = "XMQcHi0lGIdru6xzW7lygBwBT8N0c09P"; @@ -675,10 +675,10 @@ public class protocol_fzd { Config.setTemperatureTestCycle(runtime, freq); - CoreService.getInstance().setTempAlarm(); + CoreService.getInstance().setTempAlarm(true); - if (runtime.check_stat_do_temp_test()) - TemperatureUtil.getInstance().doTempTestInThread(FROM_SERVER); + //if (runtime.check_stat_do_temp_test()) + // TemperatureUtil.getInstance().doTempTestInThread(FROM_SERVER); } catch (Exception e) { ICLogger.e(e.getMessage(), e); } 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 3b970173..a8e89c94 100644 --- a/app/src/main/java/com/ic/protocols/protocol_ic.java +++ b/app/src/main/java/com/ic/protocols/protocol_ic.java @@ -1851,7 +1851,7 @@ public class protocol_ic { connection.send(APTE(index, freq)); ICLogger.i("收到服务器指令:测量体温 " + freq + "分钟一次。"); Config.setTemperatureTestCycle(runtime, freq * 60); - CoreService.getInstance().setTempAlarm(); + CoreService.getInstance().setTempAlarm(true); if (runtime.check_stat_do_temp_test()) TemperatureUtil.getInstance().doTempTestInThread(FROM_SERVER); } catch (Exception e) { diff --git a/app/src/main/java/com/ic/protocols/protocol_mqtt.java b/app/src/main/java/com/ic/protocols/protocol_mqtt.java index db2b09d1..182c7d6e 100644 --- a/app/src/main/java/com/ic/protocols/protocol_mqtt.java +++ b/app/src/main/java/com/ic/protocols/protocol_mqtt.java @@ -573,9 +573,8 @@ public class protocol_mqtt { try { int cycle_int = Integer.parseInt(cycle.trim()); ICLogger.i("收到服务器指令:设置体温上传频率 " + cycle + "秒"); - Config.setTemperatureTestCycle(runtime, cycle_int); - CoreService.getInstance().setTempAlarm(); + CoreService.getInstance().setTempAlarm(true); if (runtime.check_stat_do_temp_test()) TemperatureUtil.getInstance().doTempTestInThread(FROM_SERVER); } catch (Exception e) { diff --git a/app/src/main/java/com/ic/work/domain/Temperature.java b/app/src/main/java/com/ic/work/domain/Temperature.java index 99d8776b..47403241 100644 --- a/app/src/main/java/com/ic/work/domain/Temperature.java +++ b/app/src/main/java/com/ic/work/domain/Temperature.java @@ -19,9 +19,9 @@ public class Temperature implements Parcelable { } protected Temperature(Parcel in) { - bodyTemp = in.readFloat(); - wristTemp = in.readFloat(); - envTemp = in.readFloat(); + bodyTemp = in.readDouble(); + wristTemp = in.readDouble(); + envTemp = in.readDouble(); } public static final Creator CREATOR = new Creator() { @@ -40,7 +40,7 @@ public class Temperature implements Parcelable { return bodyTemp; } - public void setBodyTemp(float bodyTemp) { + public void setBodyTemp(double bodyTemp) { this.bodyTemp = bodyTemp; } @@ -48,7 +48,7 @@ public class Temperature implements Parcelable { return wristTemp; } - public void setWristTemp(float wristTemp) { + public void setWristTemp(double wristTemp) { this.wristTemp = wristTemp; } @@ -56,7 +56,7 @@ public class Temperature implements Parcelable { return envTemp; } - public void setEnvTemp(float envTemp) { + public void setEnvTemp(double envTemp) { this.envTemp = envTemp; }