|
|
@ -444,18 +444,29 @@ public class MpMasterService extends Service {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
long tempduration = mMpHeartbeatDuration;
|
|
|
|
long tempduration = mMpHeartbeatDuration;
|
|
|
|
if (mMpHeartbeatDuration < 600000)
|
|
|
|
if (mMpHeartbeatDuration < 600000) {
|
|
|
|
tempduration = 290000;
|
|
|
|
tempduration = 600000;
|
|
|
|
if (mPreviousMpHbTime <= ts && ts - mPreviousMpHbTime > tempduration * 2) {
|
|
|
|
}
|
|
|
|
|
|
|
|
if (mPreviousMpHbTime <= ts && (ts - mPreviousMpHbTime) > tempduration * 3) {
|
|
|
|
// MpApp is not running
|
|
|
|
// MpApp is not running
|
|
|
|
if (ts - mTimeToStartMpApp >= 1800000) { // 30 minutes 30 * 60 * 1000
|
|
|
|
if (ts - mTimeToStartMpApp >= 1800000) { // 30 minutes 30 * 60 * 1000
|
|
|
|
if (false) {
|
|
|
|
MpMasterService.restartMpApp(context.getApplicationContext(), "MpMST Keep Alive Detection");
|
|
|
|
MpMasterService.restartMpApp(context.getApplicationContext(), "MpMST Keep Alive Detection");
|
|
|
|
|
|
|
|
}
|
|
|
|
String prevMpHBTime = "";
|
|
|
|
|
|
|
|
String prevRestartTime = "";
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
SimpleDateFormat format = new SimpleDateFormat("MM-dd HH:mm:ss");
|
|
|
|
|
|
|
|
Date date = new Date(mPreviousMpHbTime);
|
|
|
|
|
|
|
|
prevMpHBTime = format.format(date);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Date date2 = new Date(mTimeToStartMpApp);
|
|
|
|
|
|
|
|
prevRestartTime = format.format(date2);
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
logger.warning("Restart MpAPP as it is NOT Running Prev MPAPP HB=" +
|
|
|
|
logger.warning("Restart MpAPP as it is NOT Running Prev MPAPP HB=" +
|
|
|
|
Long.toString((ts - mPreviousMpHbTime) / 1000) + " MPAPP HBDuration=" + Long.toString(mMpHeartbeatDuration)
|
|
|
|
Long.toString((ts - mPreviousMpHbTime) / 1000) + " MPAPP HBDuration=" + Long.toString(tempduration)
|
|
|
|
+ " Prev MpRestart Time=" + Long.toString(mTimeToStartMpApp) + " last MPAPPHB =" + (mPreviousMpHbTime / 1000));
|
|
|
|
+ " Prev MpRestart Time=" + prevRestartTime + " last MPAPPHB =" + prevMpHBTime);
|
|
|
|
|
|
|
|
|
|
|
|
mTimeToStartMpApp = ts;
|
|
|
|
mTimeToStartMpApp = ts;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|