Skip to content
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

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

omercnet
Copy link

fixes #699

adding an optional parameter that ensures Android will use a pending intent for scan results

@peitschie
Copy link
Collaborator

This looks really good @omercnet

I'll kick the tires on it a bit later in the week. Thanks for the patch!

Copy link
Collaborator

@peitschie peitschie left a 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" />

Copy link
Collaborator

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 "."))
Copy link
Collaborator

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Scanning in background in Android should use a Pending Intent
2 participants