android: fix exit on background

This commit is contained in:
ardocrat
2023-06-13 23:45:03 +03:00
parent f95645ea81
commit 23712ca361
5 changed files with 83 additions and 36 deletions
@@ -28,8 +28,13 @@ public class BackgroundService extends Service {
NotificationManager manager = getSystemService(NotificationManager.class);
manager.notify(SYNC_STATUS_NOTIFICATION_ID, mNotificationBuilder.build());
if (exitAppAfterNodeStop()) {
sendBroadcast(new Intent(MainActivity.FINISH_ACTIVITY_ACTION));
mStopped = true;
}
if (!mStopped) {
mHandler.postDelayed(this, 500);
mHandler.postDelayed(this, 300);
}
}
};
@@ -127,4 +132,5 @@ public class BackgroundService extends Service {
private native String getSyncStatusText();
private native String getSyncTitle();
private native boolean exitAppAfterNodeStop();
}