切回卡1时,主动发起一次心跳

ptz
Matthew 4 months ago
parent 515864c93d
commit 2c46504b36

@ -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) {

Loading…
Cancel
Save