运维的MCU重启命令修改

lowmem
liuguijing 2 months ago
parent e59f6fbbea
commit 8c3103eef6

@ -61,6 +61,7 @@ public class AppMaster {
public static final String CMD_REBOOT_APP = "cmd_reboot_app";
public static final String CMD_REBOOT_MASTER = "cmd_reboot_mpmaster";
public static final String CMD_REBOOT_DEV = "yw_cmd_android_reboot";
public static final String CMD_REBOOT_MCU_DEV = "yw_cmd_mcu_reboot";
public static final String CMD_UPGRADE = "upgrade";
public static final String CMD_UPLOAD_LOGS = "yw_cmd_upload_i1_zip_log";
public static final String CMD_SET_CMA = "i1_cmd_set_i1_server_ip_port";
@ -566,11 +567,13 @@ public class AppMaster {
private void processCmd(long cid, JSONObject jsonObject) {
String cmd = jsonObject.optString("cmd", "");
if (TextUtils.equals(cmd, CMD_REBOOT_DEV)) {
mService.logger.warning("Recv Reset Cmd");
MpMasterService.rebootDevice();
// SysApi.reboot(mService.getApplicationContext());
} else if (TextUtils.equals(cmd, CMD_REBOOT_MCU_DEV)) {
mService.logger.warning("Recv Reset MCU Cmd");
SysApi.reboot(mService.getApplicationContext());
} else if (TextUtils.equals(cmd, CMD_UPLOAD_LOGS)) {
String url = jsonObject.optString("url", null);
mService.logger.warning("Recv Upload Log " + url);

@ -12,8 +12,6 @@ import android.util.Log;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.Level;
import java.util.logging.Logger;
/**
* 广
@ -26,11 +24,8 @@ public class SmsReceiver extends BroadcastReceiver {
public static long mLastSmsTime = 0;
private static final SimpleDateFormat mSimpleDateFormat = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
@Override
public void onReceive(Context context, Intent intent) {
Logger logger = Logger.getLogger("com.xypower.mpmaster.logger");
logger.setLevel(Level.ALL);
try {
if (intent.getAction().equals(Telephony.Sms.Intents.SMS_RECEIVED_ACTION)) {
SmsMessage[] smsMessages = Telephony.Sms.Intents.getMessagesFromIntent(intent);
@ -40,7 +35,7 @@ public class SmsReceiver extends BroadcastReceiver {
if (mLastSmsTime!= 0 &&smsMessage.getTimestampMillis() < mLastSmsTime) {
Date dt = new Date(smsMessage.getTimestampMillis());
logger.info("MSG @" + mSimpleDateFormat.format(dt) + " Dropped: " + smsMessage.getMessageBody()+" mLastSmsTime:"+mLastSmsTime+" "+mSimpleDateFormat.format(mLastSmsTime));
Log.e("SMS", "MSG @" + mSimpleDateFormat.format(dt) + " Dropped: " + smsMessage.getMessageBody()+" mLastSmsTime:"+mLastSmsTime+" "+mSimpleDateFormat.format(mLastSmsTime));
SimUtil.setSmsMessageRead(context, smsMessage);
continue;
}

Loading…
Cancel
Save