|
|
@ -101,7 +101,7 @@ public class MpMasterService extends Service {
|
|
|
|
private String mCmdid = "";
|
|
|
|
private String mCmdid = "";
|
|
|
|
private NotificationManager mNotificationManager;
|
|
|
|
private NotificationManager mNotificationManager;
|
|
|
|
private int mQuickHeartbeatDuration = 60; // Unit: second
|
|
|
|
private int mQuickHeartbeatDuration = 60; // Unit: second
|
|
|
|
private int mHeartbeatDuration = 600; // 10m = 10 * 60s
|
|
|
|
private int mHeartbeatDuration = 600; // Unit: second 10m = 10 * 60s
|
|
|
|
|
|
|
|
|
|
|
|
private long mTimeForKeepingLogs = 86400000 * 15; // 15 days
|
|
|
|
private long mTimeForKeepingLogs = 86400000 * 15; // 15 days
|
|
|
|
|
|
|
|
|
|
|
@ -471,6 +471,9 @@ public class MpMasterService extends Service {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
MicroPhotoContext.AppConfig appConfig = MicroPhotoContext.getMpAppConfig(getApplicationContext());
|
|
|
|
MicroPhotoContext.AppConfig appConfig = MicroPhotoContext.getMpAppConfig(getApplicationContext());
|
|
|
|
|
|
|
|
if (appConfig.heartbeat > 0) {
|
|
|
|
|
|
|
|
mMpHeartbeatDuration = appConfig.heartbeat;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
logger.warning("Start Mntn report: " + masterUrl + " MntnMode=" + (mMntnMode ? "1" : "0") + " QuickHB=" + (mQuickHbMode ? "1" : "0"));
|
|
|
|
logger.warning("Start Mntn report: " + masterUrl + " MntnMode=" + (mMntnMode ? "1" : "0") + " QuickHB=" + (mQuickHbMode ? "1" : "0"));
|
|
|
|
|
|
|
|
|
|
|
@ -631,7 +634,7 @@ public class MpMasterService extends Service {
|
|
|
|
|
|
|
|
|
|
|
|
if (zeroPoint + closestTime * 1000 > currentTimeMs + mMpHeartbeatDuration * 60000) {
|
|
|
|
if (zeroPoint + closestTime * 1000 > currentTimeMs + mMpHeartbeatDuration * 60000) {
|
|
|
|
keepAlive = true;
|
|
|
|
keepAlive = true;
|
|
|
|
registerHeartbeatTimer(currentTimeMs + timeout * 1000, keepAlive);
|
|
|
|
registerHeartbeatTimer(currentTimeMs + mMpHeartbeatDuration * 60000, keepAlive);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
registerHeartbeatTimer(zeroPoint + closestTime * 1000, keepAlive);
|
|
|
|
registerHeartbeatTimer(zeroPoint + closestTime * 1000, keepAlive);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1001,7 +1004,6 @@ public class MpMasterService extends Service {
|
|
|
|
Method method1 = telephonyManager.getClass().getDeclaredMethod("setDataEnabled", boolean.class);
|
|
|
|
Method method1 = telephonyManager.getClass().getDeclaredMethod("setDataEnabled", boolean.class);
|
|
|
|
method1.invoke(telephonyManager, true);
|
|
|
|
method1.invoke(telephonyManager, true);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception e) {
|
|
|
|
// Log.e(TAG, "wjz debug setDefaultDataSubId: error is " + e.getMessage());
|
|
|
|
|
|
|
|
e.printStackTrace();
|
|
|
|
e.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1011,8 +1013,8 @@ public class MpMasterService extends Service {
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Method method = subscriptionManager.getClass().getDeclaredMethod("getDefaultDataSubscriptionId");
|
|
|
|
Method method = subscriptionManager.getClass().getDeclaredMethod("getDefaultDataSubscriptionId");
|
|
|
|
return (int) method.invoke(subscriptionManager);
|
|
|
|
return (int) method.invoke(subscriptionManager);
|
|
|
|
} catch (Exception e) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
Log.e(TAG, "wjz debug getDefaultDataSubId: error is " + e.getMessage());
|
|
|
|
ex.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|