|
|
|
@ -549,8 +549,10 @@ public class MpMasterService extends Service {
|
|
|
|
|
private void registerHeartbeatTimer() {
|
|
|
|
|
|
|
|
|
|
long timeout = mHeartbeatDuration;
|
|
|
|
|
if (mMntnMode && mQuickHbMode) {
|
|
|
|
|
if (mMntnMode) {
|
|
|
|
|
if (mQuickHbMode) {
|
|
|
|
|
timeout = mQuickHeartbeatDuration;
|
|
|
|
|
}
|
|
|
|
|
registerHeartbeatTimer(System.currentTimeMillis() + timeout * 1000);
|
|
|
|
|
} else {
|
|
|
|
|
long closestTime = -1;
|
|
|
|
@ -645,7 +647,7 @@ public class MpMasterService extends Service {
|
|
|
|
|
mCmdid = cmdid;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Log.i(TAG, "AppPath=" + appPath + " cmdid=" + cmdid);
|
|
|
|
|
logger.info("AppPath=" + appPath + " cmdid=" + cmdid);
|
|
|
|
|
|
|
|
|
|
// startMaster(false);
|
|
|
|
|
mHander.postDelayed(new Runnable() {
|
|
|
|
@ -655,6 +657,10 @@ public class MpMasterService extends Service {
|
|
|
|
|
}
|
|
|
|
|
}, 5000);
|
|
|
|
|
|
|
|
|
|
// Reset Data Network
|
|
|
|
|
logger.info("Switch to Simcard 1");
|
|
|
|
|
SysApi.selectSimCard4Data(getApplicationContext(), 1);
|
|
|
|
|
|
|
|
|
|
registerHeartbeatTimer();
|
|
|
|
|
|
|
|
|
|
startMaster(false);
|
|
|
|
@ -802,6 +808,36 @@ public class MpMasterService extends Service {
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static int getSignalLevel(int num) {
|
|
|
|
|
String result = getSystemProperty("vendor.ril.nw.signalstrength.lte." + Integer.toString(num));
|
|
|
|
|
if (TextUtils.isEmpty(result)) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
String[] items = result.split(",");
|
|
|
|
|
int rsrp = -140;
|
|
|
|
|
|
|
|
|
|
if (items != null && items.length > 0) {
|
|
|
|
|
try {
|
|
|
|
|
rsrp = Integer.parseInt(items[0]);
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
int signalLevel = 0;
|
|
|
|
|
if (rsrp >= -97) {
|
|
|
|
|
signalLevel = 4;
|
|
|
|
|
} else if (rsrp >= -107) {
|
|
|
|
|
signalLevel = 3;
|
|
|
|
|
} else if (rsrp >= -117) {
|
|
|
|
|
signalLevel = 2;
|
|
|
|
|
} else if (rsrp >= -125) {
|
|
|
|
|
signalLevel = 1;
|
|
|
|
|
} else if (rsrp >= -140) {
|
|
|
|
|
signalLevel = 0;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return signalLevel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void downloadAndInstall(final String url) {
|
|
|
|
|
|
|
|
|
|
final Context context = getApplicationContext();
|
|
|
|
|