|
|
|
@ -419,6 +419,20 @@ public class MicroPhotoService extends Service {
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
private void restartSelfImpl(Context context, String reason) {
|
|
|
|
|
Intent intent = context.getPackageManager().getLaunchIntentForPackage(context.getPackageName());
|
|
|
|
|
int noDelay = 1;
|
|
|
|
|
intent.putExtra("noDelay", noDelay);
|
|
|
|
|
if (!TextUtils.isEmpty(reason)) {
|
|
|
|
|
intent.putExtra("reason", reason);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK | Intent.FLAG_ACTIVITY_CLEAR_TOP);
|
|
|
|
|
context.startActivity(intent);
|
|
|
|
|
Log.i(TAG, "Restart Self");
|
|
|
|
|
System.exit(0);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
public void onReceive(Context context, Intent intent) {
|
|
|
|
|
try {
|
|
|
|
|