Skip to content

Commit

Permalink
Merge pull request #674 from AltBeacon/warn-of-scan-job-disabling-con…
Browse files Browse the repository at this point in the history
…sequences

add warning about disabling scan jobs on Android 8+
  • Loading branch information
davidgyoung authored May 17, 2018
2 parents c590020 + a906104 commit 1b50ab9
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
### 2.14 / 2018-05-17

Enhancements:

- Add warnings about disabling scheduled scan jobs on Android 8+ (#674, David G. Young)
- Add warning about setting short scan periods on Android 8 (#677, David G. Young)
- BeaconTransmitter advertisements may be configured as connectable (#683, Michael Harper)

Bug Fixes:
- Fix crashes of BluetoothMedic caused by Bluetooth being turned off (#675, David g. Young)
- Fix crashes of BluetoothMedic caused by Bluetooth being turned off (#675, David G. Young)

### 2.13.1 / 2018-03-05

Expand Down
9 changes: 9 additions & 0 deletions src/main/java/org/altbeacon/beacon/BeaconManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -553,6 +553,10 @@ public void setBackgroundMode(boolean backgroundMode) {
* otherwise beacon scans may be run only once every 15 minutes in the background, and no low
* power scans may be performed between scanning cycles.
*
* Setting this value to false will disable ScanJobs when the app is run on Android 8+, which
* can prohibit delivery of callbacks when the app is in the background unless the scanning
* process is running in a foreground service.
*
* This method may only be called if bind() has not yet been called, otherwise an
* `IllegalStateException` is thown.
*
Expand All @@ -569,8 +573,13 @@ public void setEnableScheduledScanJobs(boolean enabled) {
" availble prior to Android 5.0");
return;
}
if (enabled && android.os.Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
LogManager.w(TAG, "Disabling ScanJobs on Android 8+ may disable delivery of "+
"beacon callbacks in the background unless a foreground service is active.");
}
mScheduledScanJobsEnabled = enabled;
}

public boolean getScheduledScanJobsEnabled() {
return mScheduledScanJobsEnabled;
}
Expand Down

0 comments on commit 1b50ab9

Please sign in to comment.