Skip to content

Use FOREGROUND_SERVICE_TYPE_SHORT_SERVICE for adb pairing#56

Merged
TheZ3ro merged 1 commit into
osservatorionessuno:mainfrom
rocodes:use-short-service
Dec 4, 2025
Merged

Use FOREGROUND_SERVICE_TYPE_SHORT_SERVICE for adb pairing#56
TheZ3ro merged 1 commit into
osservatorionessuno:mainfrom
rocodes:use-short-service

Conversation

@rocodes
Copy link
Copy Markdown
Contributor

@rocodes rocodes commented Nov 24, 2025

Instead of FOREGROUND_SERVICE_TYPE_SPECIAL_USE, which requires an additional permission and special explanation in the manifest, use FOREGROUND_SERVICE_TYPE_SHORT_SERVICE for adb pairing. More info: https://developer.android.com/reference/android/content/pm/ServiceInfo#FOREGROUND_SERVICE_TYPE_SHORT_SERVICE

Tested briefly on an EOL (pre-API 34) Android device, and pairing is still successful. I have not tested the pairing and full acquisition workflow, so a diligent test plan would include that, but it should not be affected--the only foregrounded service is the pairing service.

Testing:

  • visual review
  • Successful pairing and acquisition
  • Graceful timeout behaviour: on an android api >= 34 device, start the pairing service, then let the device sit idle for 3+ min. The pairing notification should be killed but no crashes should be present
  • Pairing: compatibility with android API < 34

@TheZ3ro
Copy link
Copy Markdown
Member

TheZ3ro commented Dec 4, 2025

Tested it and everything seems to be working fine.
LGTM!

@TheZ3ro TheZ3ro merged commit 6b6aaed into osservatorionessuno:main Dec 4, 2025
5 checks passed
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.

2 participants