From: snickersun Date: Wed, 3 Jun 2020 11:15:48 +0000 (+0800) Subject: release 421 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;h=43af770073ef9c477550a20087fb32e857cfee72;p=protocol_srv.git release 421 1、去除 电池报警事件监控,只用电压数据进行验证。 2、添加ACTION_MESSAGE_SENT = "com.ic.action.message_sent"; --- diff --git a/app/release/ICSer_V418_2005201521_release.apk b/app/release/ICSer_V418_2005201521_release.apk deleted file mode 100644 index 57c9fab2..00000000 Binary files a/app/release/ICSer_V418_2005201521_release.apk and /dev/null differ diff --git a/app/release/ICSer_V419_2006030957_release.apk b/app/release/ICSer_V419_2006030957_release.apk deleted file mode 100644 index 1ec6a1e8..00000000 Binary files a/app/release/ICSer_V419_2006030957_release.apk and /dev/null differ diff --git a/app/release/ICSer_V421_2006031908_release.apk b/app/release/ICSer_V421_2006031908_release.apk new file mode 100644 index 00000000..707267dc Binary files /dev/null and b/app/release/ICSer_V421_2006031908_release.apk differ diff --git a/app/src/main/AndroidManifest.xml b/app/src/main/AndroidManifest.xml index c9f87054..d262251e 100644 --- a/app/src/main/AndroidManifest.xml +++ b/app/src/main/AndroidManifest.xml @@ -148,6 +148,7 @@ + diff --git a/app/src/main/java/com/enqualcomm/support/Constants.java b/app/src/main/java/com/enqualcomm/support/Constants.java index 84482119..55278d59 100644 --- a/app/src/main/java/com/enqualcomm/support/Constants.java +++ b/app/src/main/java/com/enqualcomm/support/Constants.java @@ -285,10 +285,12 @@ public interface Constants { public static final 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"; // 消息来源(发送者名称),预留,暂时不用。 + } diff --git a/app/src/main/java/com/enqualcomm/support/CoreService.java b/app/src/main/java/com/enqualcomm/support/CoreService.java index f778fde5..6300ee62 100644 --- a/app/src/main/java/com/enqualcomm/support/CoreService.java +++ b/app/src/main/java/com/enqualcomm/support/CoreService.java @@ -472,6 +472,9 @@ public class CoreService extends Service { public Runtime getRuntime(){ return runtime; } + public NettyConnection getConnection(){ + return connection; + } @Override public void onCreate() { diff --git a/app/src/main/java/com/enqualcomm/support/service/SendChatMessage.java b/app/src/main/java/com/enqualcomm/support/service/SendChatMessage.java index bdaab221..637e3be3 100644 --- a/app/src/main/java/com/enqualcomm/support/service/SendChatMessage.java +++ b/app/src/main/java/com/enqualcomm/support/service/SendChatMessage.java @@ -152,7 +152,7 @@ public class SendChatMessage extends AbstractInvokeHandlerService { // 把voiceContent拆解成1024的分包 - Util.parseToVoicePacketSent(voiceContent, runtime); + Util.parseToVoicePacketSent(voiceContent); //trigger 分包发送 ((NettyConnection) paramConnection).DeliverCMDMessageToSystem("SentVoicePacket", ""); 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 cfeeb881..a39055a9 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/BatteryUtil.java +++ b/app/src/main/java/com/enqualcomm/support/utils/BatteryUtil.java @@ -88,11 +88,11 @@ public class BatteryUtil { } }else if (Intent.ACTION_BATTERY_LOW.equals(intent.getAction())) { - mRuntime.setBatteryLow(true); - if (Config.LOG_TOFILE) ICLogger.logToFile("Battery","BatteryLow !"); - mRuntime.setAlarmType(false,mRuntime.getBatteryLow(),false,false); + // mRuntime.setBatteryLow(true); + // if (Config.LOG_TOFILE) ICLogger.logToFile("Battery","BatteryLow !"); + // mRuntime.setAlarmType(false,mRuntime.getBatteryLow(),false,false); //trigger AP10 报警定位 - connection.send(protocolAPIHelper.genStringMessage("AP10",protocolAPIHelper.getWarningMSG(mRuntime))); + // connection.send(protocolAPIHelper.genStringMessage("AP10",protocolAPIHelper.getWarningMSG(mRuntime))); }else if (Intent.ACTION_BATTERY_OKAY.equals(intent.getAction())){ ICLogger.i("Battery OKAY !"); 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 f7c3c9d0..0c898706 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/ProcessReceiver.java +++ b/app/src/main/java/com/enqualcomm/support/utils/ProcessReceiver.java @@ -10,6 +10,7 @@ import android.content.Intent; import android.media.RingtoneManager; import android.net.Uri; import android.os.Handler; +import android.os.Messenger; import android.os.PowerManager; import android.os.Vibrator; import android.support.v4.app.NotificationCompat; @@ -23,6 +24,7 @@ import com.enqualcomm.support.CoreService; import com.enqualcomm.support.LocationClient; import com.enqualcomm.support.R; import com.enqualcomm.support.bean.NotificationParam; +import com.enqualcomm.support.bean.VoiceContent; import com.ic.jni.ICJniUtils; import com.enqualcomm.support.bean.Contact; import com.enqualcomm.support.service.AudioService; @@ -41,15 +43,20 @@ import static android.os.PowerManager.ACQUIRE_CAUSES_WAKEUP; import static android.os.PowerManager.SCREEN_DIM_WAKE_LOCK; import static com.enqualcomm.support.Constants.ACTION_CLOSE_UNREAD_MSG; import static com.enqualcomm.support.Constants.ACTION_HEATR_RATE_START; +import static com.enqualcomm.support.Constants.ACTION_MESSAGE_SENT; import static com.enqualcomm.support.Constants.ACTION_PLAYTIME; import static com.enqualcomm.support.Constants.ACTION_REMOTE_CAMERA; import static com.enqualcomm.support.Constants.ACTION_SEND_EMEGENCY_LOCATION_START; import static com.enqualcomm.support.Constants.ACTION_SEND_SOS_MSG; import static com.enqualcomm.support.Constants.ACTION_SHUTDOWN; import static com.enqualcomm.support.Constants.DIALOG_ACTION; +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.RESUME_ACTION; import static com.enqualcomm.support.Constants.SOS_ACTION; import static com.enqualcomm.support.Constants.STEP_COUNT_ALARM_ACTION; +import static com.enqualcomm.support.bean.Content.CONTACT_CATEGORY_GROUP; public class ProcessReceiver extends BroadcastReceiver { private static final int MICRO_CHAT = 2; @@ -222,6 +229,23 @@ public class ProcessReceiver extends BroadcastReceiver { if (RESUME_ACTION.equals(str)) { SharPreferenceUtil.setPrefBoolean(paramContext, "key_is_resume", paramIntent.getBooleanExtra("is_resume", false)); return; + }else if (ACTION_MESSAGE_SENT.equals(str)) { + + String msgType=paramIntent.getStringExtra(KEY_MESSAGE_TYPE); + String msgFrom=paramIntent.getStringExtra(KEY_MESSAGE_FROM); + String msgUrl=paramIntent.getStringExtra(KEY_MESSAGE_URL); + ICLogger.i("receive msg to send type="+msgType+", msg from = "+msgFrom+", msgUrl"+msgUrl); + if (msgType.equals("voice")) + { + //创建voiceConent并添加到数据 + final VoiceContent voiceContent = VoiceContent.placeHolderOut(CONTACT_CATEGORY_GROUP, msgFrom, msgUrl); + + // 把voiceContent拆解成1024的分包 + Util.parseToVoicePacketSent(voiceContent); + //trigger 分包发送 + if (CoreService.getInstance().getConnection()!=null) + CoreService.getInstance().getConnection().DeliverCMDMessageToSystem("SentVoicePacket", ""); + } }else if (ACTION_SHUTDOWN.equals(str)) { playshutdownsound(paramContext); diff --git a/app/src/main/java/com/enqualcomm/support/utils/Util.java b/app/src/main/java/com/enqualcomm/support/utils/Util.java index 5dffddec..429ad9b3 100644 --- a/app/src/main/java/com/enqualcomm/support/utils/Util.java +++ b/app/src/main/java/com/enqualcomm/support/utils/Util.java @@ -796,7 +796,7 @@ public class Util { } - public static boolean parseToVoicePacketSent(VoiceContent voiceContent,Runtime runtime){ + public static boolean parseToVoicePacketSent(VoiceContent voiceContent){ long filesize; File voicefile=new File(voiceContent.content); diff --git a/app/version_code.properties b/app/version_code.properties index 1f8304f2..c67cb1a2 100644 --- a/app/version_code.properties +++ b/app/version_code.properties @@ -1,2 +1,2 @@ -#Wed Jun 03 09:57:39 CST 2020 -VERSION_CODE=419 +#Wed Jun 03 19:08:31 CST 2020 +VERSION_CODE=421