-
Notifications
You must be signed in to change notification settings - Fork 87
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(android): use pending intent in background #700
base: main
Are you sure you want to change the base?
Conversation
This looks really good @omercnet I'll kick the tires on it a bit later in the week. Thanks for the patch! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would be useful to get a bit more insight into how you're testing this @omercnet, as I feel like this change alone doesn't impact the scanning behaviour you're wanting.
<uses-permission | ||
android:name="android.permission.BLUETOOTH" | ||
android:maxSdkVersion="30" /> | ||
<uses-permission | ||
android:name="android.permission.BLUETOOTH_ADMIN" | ||
android:maxSdkVersion="30" /> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These permission changes do not seem necessary. Are you able to revert everything other than the new receiver
block?
if (!isScanning) { | ||
setTimeoutForStopScanning() | ||
Logger.debug(TAG, "Start scanning.") | ||
Logger.debug(TAG, "Start scanning" + (if (usePendingIntent) " with pendingIntent!" else ".")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very minor, but it would be better to put this debug log into the if
statement so the log is accurate for Android 7 and lower
fixes #699
adding an optional parameter that ensures Android will use a pending intent for scan results