|
|
@ -33,7 +33,6 @@ import android.net.NetworkInfo;
|
|
|
|
import android.net.NetworkRequest;
|
|
|
|
import android.net.NetworkRequest;
|
|
|
|
import android.net.Uri;
|
|
|
|
import android.net.Uri;
|
|
|
|
import android.net.wifi.WifiManager;
|
|
|
|
import android.net.wifi.WifiManager;
|
|
|
|
import android.os.BatteryManager;
|
|
|
|
|
|
|
|
import android.os.Build;
|
|
|
|
import android.os.Build;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.Bundle;
|
|
|
|
import android.os.Handler;
|
|
|
|
import android.os.Handler;
|
|
|
@ -79,13 +78,11 @@ import java.io.Reader;
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
import java.net.Inet4Address;
|
|
|
|
import java.net.Inet4Address;
|
|
|
|
import java.net.InetAddress;
|
|
|
|
import java.net.InetAddress;
|
|
|
|
import java.nio.channels.FileLock;
|
|
|
|
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.ArrayList;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.Date;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.HashMap;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.List;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.concurrent.atomic.AtomicInteger;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public class MicroPhotoService extends Service {
|
|
|
|
public class MicroPhotoService extends Service {
|
|
|
|
public static final String TAG = "MPLOG";
|
|
|
|
public static final String TAG = "MPLOG";
|
|
|
@ -502,7 +499,7 @@ public class MicroPhotoService extends Service {
|
|
|
|
boolean mpmstAlive = isMpMasterAlive(context);
|
|
|
|
boolean mpmstAlive = isMpMasterAlive(context);
|
|
|
|
if (!mpmstAlive) {
|
|
|
|
if (!mpmstAlive) {
|
|
|
|
Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(MicroPhotoContext.PACKAGE_NAME_MPMASTER);
|
|
|
|
Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(MicroPhotoContext.PACKAGE_NAME_MPMASTER);
|
|
|
|
// launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
|
launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
|
if (launchIntent != null) {
|
|
|
|
if (launchIntent != null) {
|
|
|
|
context.startActivity(launchIntent);
|
|
|
|
context.startActivity(launchIntent);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -558,6 +555,25 @@ public class MicroPhotoService extends Service {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
} catch (Exception ex) {
|
|
|
|
ex.printStackTrace();
|
|
|
|
ex.printStackTrace();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
boolean mpmstAlive = isMpMasterAlive(context);
|
|
|
|
|
|
|
|
if (!mpmstAlive) {
|
|
|
|
|
|
|
|
if (Build.TIME >= 1744905600000L) {
|
|
|
|
|
|
|
|
int pid = MicroPhotoContext.getProcessIdOfService(context, MicroPhotoContext.PACKAGE_NAME_MPMASTER, MicroPhotoContext.SERVICE_NAME_MPMASTER);
|
|
|
|
|
|
|
|
if (pid != 0) {
|
|
|
|
|
|
|
|
android.os.Process.killProcess(pid);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
Intent launchIntent = context.getPackageManager().getLaunchIntentForPackage(MicroPhotoContext.PACKAGE_NAME_MPMASTER);
|
|
|
|
|
|
|
|
if (launchIntent != null) {
|
|
|
|
|
|
|
|
launchIntent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
|
|
|
|
|
mService.startActivity(launchIntent);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
} catch (Exception ex) {
|
|
|
|
|
|
|
|
ex.printStackTrace();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|