通过系统级广播接收器接收配置更新通知

serial
BlueMatthew 1 year ago
parent bafde5aec0
commit 255978cd1b

@ -170,6 +170,7 @@ public class MicroPhotoService extends Service {
mAlarmReceiver = new AlarmReceiver(this); mAlarmReceiver = new AlarmReceiver(this);
IntentFilter intentFilter = new IntentFilter(ACTION_HEARTBEAT); IntentFilter intentFilter = new IntentFilter(ACTION_HEARTBEAT);
intentFilter.addAction(ACTION_TAKE_PHOTO); intentFilter.addAction(ACTION_TAKE_PHOTO);
intentFilter.addAction(ACTION_UPDATE_CONFIGS);
// intentFilter.addAction(ACTION_TAKE_PHOTO_MANUALLY); // intentFilter.addAction(ACTION_TAKE_PHOTO_MANUALLY);
// intentFilter.addAction(ACTION_HEARTBEAT_MANUALLY); // intentFilter.addAction(ACTION_HEARTBEAT_MANUALLY);
// intentFilter.addAction(ACTION_MSG_BROADCAST); // intentFilter.addAction(ACTION_MSG_BROADCAST);
@ -407,7 +408,7 @@ public class MicroPhotoService extends Service {
} }
} else if (TextUtils.equals(ACTION_UPDATE_CONFIGS, action)) { } else if (TextUtils.equals(ACTION_UPDATE_CONFIGS, action)) {
int restart = intent.getIntExtra("restart", 0); int restart = intent.getIntExtra("restart", 0);
Log.i(TAG, "UPD CFG Fired ACTION=" + action + " restart" + restart); Log.i(TAG, "UPD CFG Fired ACTION=" + action + " restart=" + restart);
if (restart != 0) { if (restart != 0) {
MicroPhotoService.restartApp(context, context.getPackageName()); MicroPhotoService.restartApp(context, context.getPackageName());
} else if (mService.mNativeHandle != 0) { } else if (mService.mNativeHandle != 0) {

Loading…
Cancel
Save