Android Oreo tweaks ()

* display notifications on Android 8.0 Oreo and higher using required notification channels
* fix daemon background service implementation for Android Oreo
This commit is contained in:
Akinwale Ariwodola 2018-08-06 11:51:55 +01:00 committed by GitHub
parent 338cd20132
commit 88fdc1b503
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
17 changed files with 1466 additions and 1376 deletions
src/main/java/io/lbry/browser

View file

@ -51,6 +51,8 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
public static final String DEVICE_ID_KEY = "deviceId";
public static final String SETTING_KEEP_DAEMON_RUNNING = "keepDaemonRunning";
/**
* Flag which indicates whether or not the service is running. Will be updated in the
* onResume method.
@ -218,7 +220,7 @@ public class MainActivity extends Activity implements DefaultHardwareBackBtnHand
protected void onDestroy() {
// check service running setting and end it here
SharedPreferences sp = getSharedPreferences(SHARED_PREFERENCES_NAME, Context.MODE_PRIVATE);
boolean shouldKeepDaemonRunning = sp.getBoolean("keepDaemonRunning", true);
boolean shouldKeepDaemonRunning = sp.getBoolean(SETTING_KEEP_DAEMON_RUNNING, true);
if (!shouldKeepDaemonRunning) {
serviceRunning = isServiceRunning(LbrynetService.class);
if (serviceRunning) {