File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
scanner/src/main/java/no/nordicsemi/android/support/v18/scanner Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,9 @@ To stop scanning call:
177177 scanner. stopScan(context, pendingIntent);
178178```
179179
180+ ** Note:** Android versions 6 and 7 will not report any advertising packets when in Doze mode.
181+ Read more about it here: https://developer.android.com/training/monitoring-device-state/doze-standby
182+
180183## Background scanning guidelines
181184
182185To save power it is recommended to use as low power settings as possible and and use filters.
Original file line number Diff line number Diff line change @@ -95,7 +95,15 @@ public IBinder onBind(final Intent intent) {
9595 @ Override
9696 public void onTaskRemoved (final Intent rootIntent ) {
9797 super .onTaskRemoved (rootIntent );
98- stopSelf ();
98+ // Stopping self here would cause the service to be killed when user removes the task
99+ // from Recents. This is not the behavior found in Oreo+.
100+ // Related issue: https://github.com/NordicSemiconductor/Android-Scanner-Compat-Library/issues/45
101+
102+ // Even with this line removed, the service will stop receiving devices when the phone
103+ // enters Doze mode.
104+ // Find out more here: https://developer.android.com/training/monitoring-device-state/doze-standby
105+
106+ // stopSelf();
99107 }
100108
101109 @ Override
You can’t perform that action at this time.
0 commit comments