//根据电池电压进行低电报警等状态处理
public void process_battery_level(Context param1Context, int batLevel) {
+ //只要是充电了
+ if (mRuntime.getHaveBatteryChange()) {
+ ICLogger.d("充电了,隐藏低电提示.");
+ BatteryLowLevTipsView.getInstance().dismiss();
+ }
if (batLevel >= 100) {
mRuntime.setBattery(String.format("%03d", 100));
mRuntime.setBattery(100);
intent.putExtra("openOrClose", "open");
mRuntime.getContextProxy().sendBroadcast("com.ic.action.TOAST_CHARGE_TIPS", intent);
//以上在Launcher接收,然后弹出
+ ICLogger.d("电量大于10%了,可以隐藏低电提示了.");
BatteryLowLevTipsView.getInstance().dismiss();
ICLogger.d("on lower power please get charge...");
if (Config.LOG_TOFILE) ICLogger.logToFile("Battery", "BatteryLow less than 15%!");
mRuntime.setHaveBatteryChange(true);
mRuntime.setBatteryLow(true);
} else {
- ChargeTipsView.getInstance().dismiss();
- BatteryLowLevTipsView.getInstance().showDialog();
- //这里则会显示可能会关机
- ICLogger.d("on lower then 5 percent..." + batLevel);
- if (Config.LOG_TOFILE) ICLogger.logToFile("Battery", "BatteryLow less than 5% !");
+ //ChargeTipsView.getInstance().dismiss();
+ //如果不有充电,那么就显示
+ //如果已经插上电了就不显示了
+ if (!mRuntime.getHaveBatteryChange()) {
+ BatteryLowLevTipsView.getInstance().showDialog();
+ //这里则会显示可能会关机
+ ICLogger.d("on lower then 5 percent..." + batLevel);
+ if (Config.LOG_TOFILE) ICLogger.logToFile("Battery", "BatteryLow less than 5% !");
+ }
checkAndSendBatteryEvent(param1Context, mRuntime);
mRuntime.setBattery(String.format("%03d", batLevel));
mRuntime.setBattery(batLevel);
warningMsgValues.put(ICDatabaseHelper.warning_msg_create_time, System.currentTimeMillis());
runtime.getContextProxy().getResolver().insert(Uri.parse(WarningItemProvider.WARNING_MSG),
warningMsgValues);
- //TODO:低电的通知
}
//add by TrillGates======end
ICLogger.d("runtime.getBatteryLevel()==> " + runtime.getBatteryLevel());
.append(CMDSPLIT).append(mRuntime.getS123GpsData())
.append(CMDSPLIT).append("wgs84")//原始经纬度
.append(CMDSPLIT).append(mRuntime.getSignalStrength())
- .append(CMDSPLIT).append(mRuntime.getBatteryLevel())
+ .append(CMDSPLIT).append(batteryLev)
.append(CMDSPLIT).append(mRuntime.getLBSData())
.append(CMDSPLIT).append(mRuntime.getWifiInfo())
.append(CMDEND).toString());