Android Oreo tweaks (#217)
* 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:
parent
338cd20132
commit
88fdc1b503
17 changed files with 1466 additions and 1376 deletions
src/main/java/io/lbry/browser
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue