From 2c46504b364415dd87da788c74de7e3c7de47121 Mon Sep 17 00:00:00 2001 From: Matthew Date: Tue, 4 Mar 2025 15:29:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=87=E5=9B=9E=E5=8D=A11=E6=97=B6=EF=BC=8C?= =?UTF-8?q?=E4=B8=BB=E5=8A=A8=E5=8F=91=E8=B5=B7=E4=B8=80=E6=AC=A1=E5=BF=83?= =?UTF-8?q?=E8=B7=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/xypower/mpmaster/MpMasterService.java | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java b/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java index bab3c046..6087ba31 100644 --- a/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java +++ b/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java @@ -81,6 +81,7 @@ public class MpMasterService extends Service { private static final String ACTION_HEARTBEAT = "com.xypower.mpmaster.ACT_HB"; private static final String ACTION_TAKE_PHOTO = "com.xypower.mpapp.ACT_TP"; + private static final String ACTION_MP_HEARTBEAT_MANUALLY = "com.xypower.mpapp.ACT_HB_M"; public static final String ACTION_MP_RESTART = "com.xypower.mpapp.ACT_RESTART"; public static final String ACTION_IMP_PUBKRY = "com.xypower.mpapp.ACT_IMP_PUBKEY"; @@ -1192,6 +1193,20 @@ public class MpMasterService extends Service { } else { SysApi.selectSimCard4Data(context, num); } + + if (num == 1) { + // If it's back to card 1, let MpAPP send heartbeat manully after 10s + mHander.postDelayed(new Runnable() { + @Override + public void run() { + Intent intent = new Intent(); + intent.setAction(ACTION_MP_HEARTBEAT_MANUALLY); + intent.setPackage(MicroPhotoContext.PACKAGE_NAME_MPAPP); + sendBroadcast(intent); + } + }, 10000); + + } } private void setDefaultDataSubId(int subId) {