修复切换simcard的bug

serial
Matthew 1 year ago
parent 8e7dad3fd2
commit 5dec910926

@ -229,7 +229,7 @@ public class MicroPhotoContext {
public static MasterConfig getMasterConfig(Context context) { public static MasterConfig getMasterConfig(Context context) {
MasterConfig masterConfig = new MasterConfig(); MasterConfig masterConfig = new MasterConfig();
String appPath = buildAppDir(context); String appPath = buildMasterAppDir(context);
try { try {
String content = readTextFile(appPath + "data/Master.json"); String content = readTextFile(appPath + "data/Master.json");

@ -131,6 +131,7 @@ public class AppMaster {
NetworkInfo ni = connectivityManager.getNetworkInfo(nw); NetworkInfo ni = connectivityManager.getNetworkInfo(nw);
if (ni.getType() == 0) { if (ni.getType() == 0) {
connected = true;
break; break;
} }
} }

@ -122,6 +122,8 @@ public class MpMasterService extends Service {
public void onCreate() { public void onCreate() {
super.onCreate(); super.onCreate();
loadConfig();
try { try {
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
mSerialNo = Build.getSerial(); mSerialNo = Build.getSerial();
@ -216,6 +218,7 @@ public class MpMasterService extends Service {
mUsingAbsHbTime = masterConfig.usingAbsHbTime != 0; mUsingAbsHbTime = masterConfig.usingAbsHbTime != 0;
mHeartbeatDuration = masterConfig.heartbeat * 10; // minute to second mHeartbeatDuration = masterConfig.heartbeat * 10; // minute to second
mAbsHeartbeatTimes = masterConfig.absHeartbeats; mAbsHeartbeatTimes = masterConfig.absHeartbeats;
mSeparateNetwork = masterConfig.separateNetwork != 0;
} }
// public boolean useSeparater // public boolean useSeparater

Loading…
Cancel
Save