|
|
|
@ -99,6 +99,7 @@ public class MpMasterService extends Service {
|
|
|
|
|
private int mHeartbeatDuration = 600; // Unit: second 10m = 10 * 60s
|
|
|
|
|
|
|
|
|
|
private long mTimeForKeepingLogs = 86400000 * 15; // 15 days
|
|
|
|
|
private boolean mSyncTime = false;
|
|
|
|
|
|
|
|
|
|
private AlarmReceiver mAlarmReceiver = null;
|
|
|
|
|
private ScreenActionReceiver mScreenaAtionReceiver = null;
|
|
|
|
@ -310,6 +311,7 @@ public class MpMasterService extends Service {
|
|
|
|
|
if (masterConfig.timeForKeepingLogs > 0) {
|
|
|
|
|
mTimeForKeepingLogs = masterConfig.timeForKeepingLogs * 86400000;
|
|
|
|
|
}
|
|
|
|
|
mSyncTime = masterConfig.syncTime;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void loadIccid() {
|
|
|
|
@ -349,6 +351,8 @@ public class MpMasterService extends Service {
|
|
|
|
|
return mMntnMode;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean shouldSyncTime() { return mSyncTime; }
|
|
|
|
|
|
|
|
|
|
public void startMpApp() {
|
|
|
|
|
try {
|
|
|
|
|
final Context context = getApplicationContext();
|
|
|
|
@ -853,14 +857,6 @@ public class MpMasterService extends Service {
|
|
|
|
|
return JSONUtils.saveJson(path, jsonObject);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public boolean updateTime(long timeInMillis) {
|
|
|
|
|
try {
|
|
|
|
|
SysApi.setSystemTime(getApplicationContext(), timeInMillis);
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public static int getSignalLevel(int num) {
|
|
|
|
|
String result = getSystemProperty("vendor.ril.nw.signalstrength.lte." + Integer.toString(num));
|
|
|
|
|
if (TextUtils.isEmpty(result)) {
|
|
|
|
@ -1023,6 +1019,16 @@ public class MpMasterService extends Service {
|
|
|
|
|
System.exit(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public void updateTime(long ms) {
|
|
|
|
|
Intent intent = new Intent("com.xy.xsetting.action");
|
|
|
|
|
intent.putExtra("cmd", "settime");
|
|
|
|
|
intent.putExtra("timemills", ms);
|
|
|
|
|
|
|
|
|
|
intent.setPackage("com.android.systemui");
|
|
|
|
|
intent.addFlags(Intent.FLAG_RECEIVER_FOREGROUND);
|
|
|
|
|
sendBroadcast(intent);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public native static int getInt(int cmd);
|
|
|
|
|
public native static int setInt(int cmd, int val);
|
|
|
|
|
public native static int[] getStats(long ts);
|
|
|
|
|