diff --git a/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java b/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java index 82ebd947..762adb58 100644 --- a/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java +++ b/mpmaster/src/main/java/com/xypower/mpmaster/MpMasterService.java @@ -82,6 +82,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"; @@ -1194,6 +1195,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) {