-[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":907,"versionName":"2110191550","enabled":true,"outputFile":"ICSer_V907_2110191550_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V907_2110191550_release.apk","properties":{}}]
\ No newline at end of file
+[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":914,"versionName":"2110201057","enabled":true,"outputFile":"ICSer_V914_2110201057_release.apk","fullName":"release","baseName":"release"},"path":"ICSer_V914_2110201057_release.apk","properties":{}}]
\ No newline at end of file
}
public String getMqttGPSData() {
-
-/***
- * A,22.570733,N,113.8626083,E,0.00,249.5,0.0,6
- * A,gps 定位有效
- * 22.570733,纬度 N,
- * 113.8626083,经度 E,
- * 0.00,速度
- * 249.5,方向
- * 0.0,海拔
- * 6,卫星个数
- */
+ /***
+ * A,22.570733,N,113.8626083,E,0.00,249.5,0.0,6
+ * A,gps 定位有效
+ * 22.570733,纬度 N,
+ * 113.8626083,经度 E,
+ * 0.00,速度
+ * 249.5,方向
+ * 0.0,海拔
+ * 6,卫星个数
+ */
StringBuilder sb = new StringBuilder();
int speedi = (int) gpsp.getLocation().speed;
int speedl = (int) ((gpsp.getLocation().speed - speedi) * 100);
String latname = gpsp.getLocation().lat_name;
String lonname = gpsp.getLocation().lon_name;
ICLogger.i(" UD isfixed " + isGPSFixed() + " is in area " + bleInfo.is_in_area);
- if (bleInfo.is_in_area == true) {
+ if (bleInfo.is_in_area) {
latStr = bleInfo.gps_n;
lonStr = bleInfo.gps_e;
latname = (latStr.trim().startsWith("-")) ? "S" : "N";
public String getFZDGPSData() {
-/***
- * A,22.570733,N,113.8626083,E,0.00,249.5,0.0,6
- * A,gps 定位有效
- * 22.570733,纬度 N,
- * 113.8626083,经度 E,
- * 0.00,速度
- * 249.5,方向
- * 0.0,海拔
- * 6,卫星个数
- */
+ /***
+ * A,22.570733,N,113.8626083,E,0.00,249.5,0.0,6
+ * A,gps 定位有效
+ * 22.570733,纬度 N,
+ * 113.8626083,经度 E,
+ * 0.00,速度
+ * 249.5,方向
+ * 0.0,海拔
+ * 6,卫星个数
+ */
StringBuilder sb = new StringBuilder();
int speedi = (int) gpsp.getLocation().speed;
int speedl = (int) ((gpsp.getLocation().speed - speedi) * 100);
if (isGPSFixed()) {
String gpsStr = String.format(",%s,%s,%s,%s,%d.%02d,%s,0.0,%d", latStr, latname, lonStr, lonname, speedi, speedl, heading, starcount);
sb.append("A").append(gpsStr);
-
} else {
String gpsStr = String.format(",0.000,N,0.000,E,0.0,0.0,0.0,0");
sb.append("V").append(gpsStr);
}
-
-
return sb.toString();
}
if (mRuntime.check_stat_do_temp_test()) {
TemperatureUtil.getInstance().DoTempTest(FROM_SERVER);
}
-
Util.mSleep(5000);
//开启测量PPG
if (mRuntime.check_stat_do_ppg_test()) {
HeartRateManager.getInstance().triggerPPGTest(FROM_SERVER);
}
}
-
CoreService.getInstance().getConnection().DeliverCMDMessageToSystem("SentVoicePacket", "");
}
return true;
Util.ShowToast(paramRuntime, "Do poweroff!");
}
VibrateUtil.getInstance(paramRuntime.getContextProxy().context).
- vibrate(new long[]{1000, 500, 1000, 500, 1000}, -1);
- mSendMSGHandler.postDelayed(new Runnable() {
- @Override
- public void run() {
- Util.shutdown();
- }
- }, 2000);
+ vibrate(new long[]{0, 1000, 500, 1000}, -1);
+ mSendMSGHandler.postDelayed(Util::shutdown, 500);
return true;
} else if ("FactoryResetCheckSim".equals(paramStringMessage.cmd())) {
public class BatteryUtil {
private BroadcastReceiver batteryChangedReceiver = new BroadcastReceiver() {
public void onReceive(Context param1Context, Intent intent) {
+ int batLevel = intent.getIntExtra(EXTRA_LEVEL, 0) * 100 / intent.getIntExtra(EXTRA_SCALE, 100);
+ // 当前电池电压
+ handleBatteryLevelVibrate(batLevel);
if (Intent.ACTION_BATTERY_CHANGED.equals(intent.getAction())) {
int extra_status = intent.getIntExtra(EXTRA_STATUS, BATTERY_STATUS_UNKNOWN);
StringBuilder msg = new StringBuilder("EXTRA_STATUS = ");
case BATTERY_STATUS_NOT_CHARGING:
msg.append("BATTERY_STATUS_NOT_CHARGING ");
break;
-
}
msg.append("; ");
if (extra_status == BATTERY_STATUS_CHARGING) {
}
mRuntime.setBatterychanging(false);
}
- int batLevel = intent.getIntExtra(EXTRA_LEVEL, 0) * 100 / intent.getIntExtra(EXTRA_SCALE, 100);
- // 当前电池电压
int batteryVolt = intent.getIntExtra(EXTRA_VOLTAGE, -1);
mRuntime.setBatteryVoltage(batteryVolt);
msg.append("BatteryLevel " + batLevel + " BatteryVotage " + batteryVolt + "; ");
ICLogger.i(msg.toString());
//处理电压
process_battery_level(param1Context, batLevel);
-
} 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);
//trigger AP10 报警定位
// connection.send(protocolAPIHelper.genStringMessage("AP10",protocolAPIHelper.getWarningMSG(mRuntime)));
-
} else if (Intent.ACTION_BATTERY_OKAY.equals(intent.getAction())) {
ICLogger.i("Battery OKAY !");
if (Config.LOG_TOFILE) ICLogger.logToFile("Battery", "Battery OKAY !");
if (Config.isL03Tracker) {
LedUtil.setRedLedOn(true);
}
-
} else if (Intent.ACTION_POWER_DISCONNECTED.equals(intent.getAction())) {
ICLogger.i("ACTION_POWER_DISCONNECTED!");
mRuntime.setPowerConnected(false);
if (Config.LOG_TOFILE) ICLogger.logToFile("Battery", "ACTION_POWER_DISCONNECTED !");
-
if (Config.isL03Tracker) {
LedUtil.setRedLedOn(false);
}
private int lowBatteryWarningFlag = 1;
private void handleBatteryLevelVibrate(int lev) {
+ if (lev == 0) {
+ return;
+ }
boolean haveBatteryChange = isPowerConnected(mRuntime.getContextProxy().context);
ICLogger.d("haveBatteryChange ==> " + haveBatteryChange);
if (haveBatteryChange) {
lowBatteryWarningFlag = 0;
+ VibrateUtil.getInstance(mRuntime.getContextProxy().context).vibrateOn(false);
return;
}
+ ICLogger.d("lowBatteryWarningFlag ==> " + lowBatteryWarningFlag);
+ ICLogger.d("lev ==> " + lev);
boolean shouldVibrate = false;
if (lev <= 30 && lev > 20) {
//不为4表示这个段不有震动
shouldVibrate = lowBatteryWarningFlag != 1;
lowBatteryWarningFlag = 1;
}
+ ICLogger.d("shouldVibrate==> " + shouldVibrate);
//1515 添加低电震动提醒
//百分之30的时候会震动(没有charge的时候)
//百分之20的时候会震动(没有charge的时候)
//获得ServiceManager类
Class ServiceManager = Class
.forName("android.os.ServiceManager");
-
//获得ServiceManager的getService方法
Method getService = ServiceManager.getMethod("getService", java.lang.String.class);
-
//调用getService获取RemoteService
Object oRemoteService = getService.invoke(null, Context.POWER_SERVICE);
-
//获得IPowerManager.Stub类
- Class cStub = Class
- .forName("android.os.IPowerManager$Stub");
+ Class cStub = Class.forName("android.os.IPowerManager$Stub");
//获得asInterface方法
Method asInterface = cStub.getMethod("asInterface", android.os.IBinder.class);
//调用asInterface方法获取IPowerManager对象
Method shutdown = oIPowerManager.getClass().getMethod("shutdown", boolean.class, boolean.class);
//调用shutdown()方法
shutdown.invoke(oIPowerManager, false, true);
-
} catch (Exception e) {
e.printStackTrace();
ICLogger.e(e.getMessage(), e);
\r
public class VibrateUtil {\r
\r
+ private VibrateUtil() {\r
+ //设置监听\r
+ IntentFilter intentFilter = new IntentFilter();\r
+ intentFilter.addAction("com.ic.action.POWER_CLICK");\r
+ BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {\r
+ @Override\r
+ public void onReceive(Context context, Intent intent) {\r
+ String action = intent.getAction();\r
+ ICLogger.d("action is ==> " + action + " cancel vibrate...");\r
+ vibrator.cancel();\r
+ }\r
+ };\r
+ mContext.registerReceiver(broadcastReceiver, intentFilter);\r
+ }\r
+\r
private static Context mContext = null;\r
\r
public static VibrateUtil getInstance(Context context) {\r
- if (mContext == null)\r
+ if (mContext == null) {\r
mContext = context;\r
- if (vibrator == null)\r
+ }\r
+ if (vibrator == null) {\r
vibrator = (Vibrator) mContext.getSystemService(VIBRATOR_SERVICE);\r
- vibrateUtil = new VibrateUtil();\r
+ }\r
+ if (vibrateUtil == null) {\r
+ vibrateUtil = new VibrateUtil();\r
+ }\r
return vibrateUtil;\r
}\r
\r
}\r
\r
public void vibrateOnForBattery() {\r
+ ICLogger.d("vibrateOnForBattery...");\r
//不断地震动,并且监听屏幕变化,当屏幕开,或者关的时候,停止震动,取消监听\r
- //设置监听\r
- IntentFilter intentFilter = new IntentFilter();\r
- intentFilter.addAction(Intent.ACTION_SCREEN_ON);\r
- intentFilter.addAction(Intent.ACTION_SCREEN_OFF);\r
- mContext.registerReceiver(broadcastReceiver, intentFilter);\r
- vibrator.vibrate(1000 * 60 * 60);//不循环\r
+ long[] pattern = {0, 1000};\r
+ vibrator.vibrate(pattern, 0);\r
}\r
\r
- private final BroadcastReceiver broadcastReceiver = new BroadcastReceiver() {\r
- @Override\r
- public void onReceive(Context context, Intent intent) {\r
- vibrator.cancel();\r
- mContext.unregisterReceiver(this);\r
- }\r
- };\r
-\r
public void vibrateOn(boolean on) {\r
+ ICLogger.d("vibrateOn==> " + on);\r
if (vibrator != null) {\r
if (on)\r
vibrator.vibrate(1000);//不循环\r
// 460,0,9520,3671,
// Home|74-DE-2B-44-88-8C|97& Home1|74-DE-2B-44-88-8C|97&Home2|74-DE-2B-44-88-8C|97& Home3|74-DE-2B-44-88-8C|97#
// IWAP01191230A2232.9807N11404.9355E000.1161320000.0006000910000000,460,00,9520,3671,#
- return genStringMessage(cmdMap.get(CMD_TYPE.AP01), new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.AP01)).append(TimeUtil.getShortDate())
- .append(ds.getGPSData()).append(TimeUtil.getShortTime()).append(ds.getGPSHeading()).append(String.format("%03d", abs(ds.getSignalStrength())))
+ return genStringMessage(cmdMap.get(CMD_TYPE.AP01),
+ new StringBuffer(CMDHEADER).append(cmdMap.get(CMD_TYPE.AP01)).append(TimeUtil.getShortDate())
+ .append(ds.getGPSData())
+ .append(TimeUtil.getShortTime()).append(ds.getGPSHeading()).append(String.format("%03d", abs(ds.getSignalStrength())))
.append(ds.getGPSLocationStarNums()).append(ds.getBattery()).append("0")
.append(ds.getProtection()).append(ds.getWorkModeStr()).append(CMDSPLIT)
.append(ds.getLBSData()).append(CMDSPLIT).append(ds.getWifiInfo()).append(CMDEND).toString());
-#Tue Oct 19 15:50:37 CST 2021\r
-VERSION_CODE=907\r
+#Wed Oct 20 10:57:06 CST 2021\r
+VERSION_CODE=914\r