Add Bluetooth support for WearOS devices#1
Conversation
Currently translated at 95.0% (271 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/ru/ Translated using Weblate (Russian) Currently translated at 100.0% (25 of 25 strings) Translation: microG/play-services-fido: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-fido-core-strings/ru/ Translated using Weblate (Russian) Currently translated at 100.0% (45 of 45 strings) Translation: microG/play-services-location: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-location-core-strings/ru/ Translated using Weblate (Russian) Currently translated at 88.6% (39 of 44 strings) Translation: microG/vending-app Translate-URL: https://hosted.weblate.org/projects/microg/vending-app/ru/
* This is causing them not to be granted at all on newer devices, _potentially_ leading to issues. * They're already declared in play-services-core as well. Bug: microg#2868 Change-Id: I37c1cb2c19006a0373bac6e6d097a2cf39c73117
Co-authored-by: Marvin W <git@larma.de>
Co-authored-by: Lucas <55422065+lucasmz-dev@users.noreply.github.com>
Added translation using Weblate (Indonesian) Added translation using Weblate (Indonesian) Added translation using Weblate (Indonesian) Added translation using Weblate (Indonesian) Translated using Weblate (Indonesian) Currently translated at 75.0% (3 of 4 strings) Translation: microG/play-services-ads-identifier: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-ads-identifier-core-strings/id/ Added translation using Weblate (Indonesian) Added translation using Weblate (Indonesian) Added translation using Weblate (Indonesian) Added translation using Weblate (Indonesian) Added translation using Weblate (Indonesian) Added translation using Weblate (Indonesian) Added translation using Weblate (Indonesian) Translated using Weblate (Indonesian) Currently translated at 100.0% (4 of 4 strings) Translation: microG/play-services-ads-identifier: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-ads-identifier-core-strings/id/ Translated using Weblate (Indonesian) Currently translated at 27.8% (44 of 158 strings) Translation: microG/play-services-core: permissions Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-permissions/id/ Translated using Weblate (Indonesian) Currently translated at 100.0% (3 of 3 strings) Translation: microG/play-services-auth-api-phone: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-auth-api-phone-core-strings/id/ Translated using Weblate (Indonesian) Currently translated at 100.0% (13 of 13 strings) Translation: microG/play-services-base: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-base-core-strings/id/
Currently translated at 97.8% (279 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/it/ Translated using Weblate (Italian) Currently translated at 100.0% (44 of 44 strings) Translation: microG/vending-app Translate-URL: https://hosted.weblate.org/projects/microg/vending-app/it/ Translated using Weblate (Italian) Currently translated at 98.2% (280 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/it/ Translated using Weblate (Italian) Currently translated at 98.9% (282 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/it/
Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/ro/
Currently translated at 96.4% (275 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/ru/
Currently translated at 99.2% (283 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/zh_Hant/ Translated using Weblate (Chinese (Traditional Han script)) Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/zh_Hant/
Currently translated at 90.8% (259 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/nl/
Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (13 of 13 strings) Translation: microG/play-services-base: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-base-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (45 of 45 strings) Translation: microG/play-services-location: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-location-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (59 of 59 strings) Translation: microG/play-services-nearby: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-nearby-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (158 of 158 strings) Translation: microG/play-services-core: permissions Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-permissions/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (45 of 45 strings) Translation: microG/play-services-location: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-location-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (59 of 59 strings) Translation: microG/play-services-nearby: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-nearby-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (45 of 45 strings) Translation: microG/play-services-location: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-location-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (25 of 25 strings) Translation: microG/play-services-fido: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-fido-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (59 of 59 strings) Translation: microG/play-services-nearby: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-nearby-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (45 of 45 strings) Translation: microG/play-services-location: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-location-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (45 of 45 strings) Translation: microG/play-services-location: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-location-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (44 of 44 strings) Translation: microG/vending-app Translate-URL: https://hosted.weblate.org/projects/microg/vending-app/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (59 of 59 strings) Translation: microG/play-services-nearby: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-nearby-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (59 of 59 strings) Translation: microG/play-services-nearby: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-nearby-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (158 of 158 strings) Translation: microG/play-services-core: permissions Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-permissions/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (44 of 44 strings) Translation: microG/vending-app Translate-URL: https://hosted.weblate.org/projects/microg/vending-app/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/pt_BR/ Translated using Weblate (Portuguese (Brazil)) Currently translated at 100.0% (158 of 158 strings) Translation: microG/play-services-core: permissions Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-permissions/pt_BR/
Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/zh_Hans/ Translated using Weblate (Chinese (Simplified Han script)) Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/zh_Hans/
Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/ga/ Translated using Weblate (Irish) Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/ga/
Added translation using Weblate (Persian) Translated using Weblate (Persian) Currently translated at 25.0% (1 of 4 strings) Translation: microG/play-services-ads-identifier: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-ads-identifier-core-strings/fa/ Added translation using Weblate (Persian) Added translation using Weblate (Persian) Translated using Weblate (Persian) Currently translated at 50.0% (2 of 4 strings) Translation: microG/play-services-ads-identifier: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-ads-identifier-core-strings/fa/ Added translation using Weblate (Persian) Added translation using Weblate (Persian) Added translation using Weblate (Persian) Added translation using Weblate (Persian) Added translation using Weblate (Persian) Added translation using Weblate (Persian) Translated using Weblate (Persian) Currently translated at 75.0% (3 of 4 strings) Translation: microG/play-services-ads-identifier: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-ads-identifier-core-strings/fa/ Added translation using Weblate (Persian) Added translation using Weblate (Persian) Translated using Weblate (Persian) Currently translated at 100.0% (4 of 4 strings) Translation: microG/play-services-ads-identifier: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-ads-identifier-core-strings/fa/ Translated using Weblate (Persian) Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/fa/ Translated using Weblate (Persian) Currently translated at 100.0% (4 of 4 strings) Translation: microG/play-services-core: plurals Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-plurals/fa/ Translated using Weblate (Persian) Currently translated at 100.0% (158 of 158 strings) Translation: microG/play-services-core: permissions Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-permissions/fa/ Translated using Weblate (Persian) Currently translated at 100.0% (3 of 3 strings) Translation: microG/play-services-auth-api-phone: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-auth-api-phone-core-strings/fa/ Translated using Weblate (Persian) Currently translated at 100.0% (13 of 13 strings) Translation: microG/play-services-base: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-base-core-strings/fa/ Translated using Weblate (Persian) Currently translated at 100.0% (25 of 25 strings) Translation: microG/play-services-fido: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-fido-core-strings/fa/ Translated using Weblate (Persian) Currently translated at 100.0% (5 of 5 strings) Translation: microG/play-services-droidguard: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-droidguard-core-strings/fa/ Translated using Weblate (Persian) Currently translated at 100.0% (45 of 45 strings) Translation: microG/play-services-location: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-location-core-strings/fa/ Translated using Weblate (Persian) Currently translated at 100.0% (59 of 59 strings) Translation: microG/play-services-nearby: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-nearby-core-strings/fa/ Translated using Weblate (Persian) Currently translated at 100.0% (6 of 6 strings) Translation: microG/play-services-oss-licenses: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-oss-licenses-strings/fa/ Translated using Weblate (Persian) Currently translated at 100.0% (44 of 44 strings) Translation: microG/vending-app Translate-URL: https://hosted.weblate.org/projects/microg/vending-app/fa/
Currently translated at 100.0% (44 of 44 strings) Translation: microG/vending-app Translate-URL: https://hosted.weblate.org/projects/microg/vending-app/ru/ Translated using Weblate (Russian) Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/ru/ Translated using Weblate (Russian) Currently translated at 100.0% (25 of 25 strings) Translation: microG/play-services-fido: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-fido-core-strings/ru/ Translated using Weblate (Russian) Currently translated at 100.0% (45 of 45 strings) Translation: microG/play-services-location: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-location-core-strings/ru/ Translated using Weblate (Russian) Currently translated at 100.0% (44 of 44 strings) Translation: microG/vending-app Translate-URL: https://hosted.weblate.org/projects/microg/vending-app/ru/
Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/pl/
Added translation using Weblate (Latvian) Added translation using Weblate (Latvian) Added translation using Weblate (Latvian) Added translation using Weblate (Latvian) Added translation using Weblate (Latvian) Translated using Weblate (Latvian) Currently translated at 25.0% (1 of 4 strings) Translation: microG/play-services-ads-identifier: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-ads-identifier-core-strings/lv/ Added translation using Weblate (Latvian) Added translation using Weblate (Latvian) Added translation using Weblate (Latvian) Added translation using Weblate (Latvian) Added translation using Weblate (Latvian) Added translation using Weblate (Latvian) Translated using Weblate (Latvian) Currently translated at 100.0% (4 of 4 strings) Translation: microG/play-services-ads-identifier: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-ads-identifier-core-strings/lv/ Translated using Weblate (Latvian) Currently translated at 3.1% (9 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/lv/ Translated using Weblate (Latvian) Currently translated at 66.6% (2 of 3 strings) Translation: microG/play-services-auth-api-phone: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-auth-api-phone-core-strings/lv/ Translated using Weblate (Latvian) Currently translated at 83.3% (5 of 6 strings) Translation: microG/play-services-oss-licenses: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-oss-licenses-strings/lv/
Currently translated at 1.0% (3 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/id/ Translated using Weblate (Indonesian) Currently translated at 75.0% (3 of 4 strings) Translation: microG/play-services-core: plurals Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-plurals/id/ Translated using Weblate (Indonesian) Currently translated at 12.0% (3 of 25 strings) Translation: microG/play-services-fido: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-fido-core-strings/id/ Translated using Weblate (Indonesian) Currently translated at 40.0% (2 of 5 strings) Translation: microG/play-services-droidguard: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-droidguard-core-strings/id/ Translated using Weblate (Indonesian) Currently translated at 6.6% (3 of 45 strings) Translation: microG/play-services-location: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-location-core-strings/id/ Translated using Weblate (Indonesian) Currently translated at 3.3% (2 of 59 strings) Translation: microG/play-services-nearby: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-nearby-core-strings/id/ Translated using Weblate (Indonesian) Currently translated at 33.3% (2 of 6 strings) Translation: microG/play-services-oss-licenses: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-oss-licenses-strings/id/ Translated using Weblate (Indonesian) Currently translated at 2.2% (1 of 44 strings) Translation: microG/vending-app Translate-URL: https://hosted.weblate.org/projects/microg/vending-app/id/
Currently translated at 99.2% (283 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/ug/ Translated using Weblate (Uyghur) Currently translated at 100.0% (25 of 25 strings) Translation: microG/play-services-fido: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-fido-core-strings/ug/ Translated using Weblate (Uyghur) Currently translated at 100.0% (45 of 45 strings) Translation: microG/play-services-location: core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-location-core-strings/ug/ Translated using Weblate (Uyghur) Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/ug/ Translated using Weblate (Uyghur) Currently translated at 100.0% (44 of 44 strings) Translation: microG/vending-app Translate-URL: https://hosted.weblate.org/projects/microg/vending-app/ug/ Translated using Weblate (Uyghur) Currently translated at 100.0% (285 of 285 strings) Translation: microG/play-services-core: strings Translate-URL: https://hosted.weblate.org/projects/microg/play-services-core-strings/ug/
Added explicit permission checks before calling Bluetooth APIs that require BLUETOOTH_CONNECT permission on Android 12+: - WearableImpl.java: Check permission before getBondedDevices() - WearableSettingsActivity.java: Check permission before getBondedDevices() - Added SuppressLint for device.getName() since permission already checked Fixes all MissingPermission lint errors. Build verified with lintDebug.
|
adopted Wearable lib to Wire 4.9.9, but i unable to test it, cuz i dont have compatable device |
|
Thanks @deadYokai for the Wire 4.9.9 update! 🙏 I really appreciate you taking the time to adapt the Wearable library. This will be important for keeping everything compatible with the latest protobuf changes. I don't have a physical WearOS device for testing either at the moment. Would you like me to integrate your changes from your 'wire_upd' branch into this PR? Or would you prefer to submit them separately? Happy to collaborate on getting this working together! |
|
@SBALAVIGNESH123 i already submited PR to microg/Wearable#3 , i'm waiting for approving You can intergrate changes, but as far as PR not merged, can't be compatable with current version of GmsCore / Wearable And also, i'm trying to implement BluetoothGatt protocol, as far i know it's used by WearOS 3+ devices |
|
found UUID in google's gms maybe i make own implementation of bluetooth stuff? |
|
Hey @deadYokai, yes that would be great! |
Also fix some warnings in NetworkLocationService Incorporates work from microg#3210
There was a problem hiding this comment.
This is the final PR Bugbot will review for you during this billing cycle
Your free Bugbot reviews will reset on February 19
Details
You are on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle.
To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.
| if (SDK_INT >= 31 && connectionInfo != null) { | ||
| onWifiDetailsAvailable(listOf(connectionInfo.toWifiDetails())) | ||
| if (SDK_INT >= 31 && connectionInfo != null && connectionInfo.toWifiDetails() != null) { | ||
| onWifiDetailsAvailable(listOfNotNull(connectionInfo.toWifiDetails())) |
There was a problem hiding this comment.
Double call to nullable function creates race condition
The toWifiDetails() function is called twice on the same connectionInfo object - once in the condition check and again in the body. Since WifiInfo.toWifiDetails() can return null when bssid is null, and WiFi state can change between calls, there's a time-of-check to time-of-use issue. If the bssid becomes null between the two calls, the second call returns null, resulting in listOfNotNull producing an empty list and onWifiDetailsAvailable silently doing nothing. The result should be captured in a variable to ensure atomic evaluation.
| .name("Phone") | ||
| .networkId(localId) | ||
| .peerAndroidId(localId) | ||
| .peerAndroidId(0L) |
There was a problem hiding this comment.
Bluetooth handshake sends invalid Android ID
The manual Connect message sent during Bluetooth handshake uses peerAndroidId(0L) instead of the actual device Android ID. This contradicts how MessageHandler is configured, which retrieves the real Android ID from device settings via SettingsContract.CheckIn.ANDROID_ID. Sending a hardcoded zero for the Android ID could cause WearOS devices to reject the connection or fail to properly identify the phone during pairing. The handshake should use the same Android ID that MessageHandler uses for consistency.
Co-authored-by: Marvin W <git@larma.de>
…og#3222) Co-authored-by: Marvin W <git@larma.de>
Co-authored-by: Marvin W <git@larma.de>
Co-authored-by: Marvin W <git@larma.de>
Fixes bug introduced with microg#3222
|
Is this buildable yet? If it is I'll try it out! I have a GW5 I've been wanting to use. |
| performSignOut(context, clientPackageName, it, signInAccount) | ||
| } | ||
| } | ||
| AccountUtils.get(context).removeSelectedAccount(clientPackageName) |
There was a problem hiding this comment.
Sign-out callback invoked before async operations complete
High Severity
The signOut method calls callback.onResult(Status.SUCCESS) at line 147 immediately after launching the coroutine, rather than inside it. This means the callback signals success before the actual sign-out operations (performSignOut, removeSelectedAccount) have completed. Comparing with AuthSignInService.kt which correctly places the callback inside the lifecycleScope.launchWhenStarted block, this callback should be moved inside the lifecycleScope.launch block after the sign-out operations finish. Calling apps will incorrectly believe sign-out is complete when it hasn't actually happened yet.
🔬 Verification Test
Why verification test was not possible: This is an Android service implementation that requires the full Android runtime environment, lifecycle management, and IPC mechanisms to test. The bug is clearly visible from static code analysis - comparing line 147 (callback outside the coroutine) with the similar implementation in AuthSignInService.kt lines 134 (callback inside the coroutine).
| Log.d(TAG, "updateProjectionState: useFastMode: $useFast") | ||
|
|
||
| visibleRegion = projection.visibleRegion | ||
| withoutTiltOrBearing = useFast |
There was a problem hiding this comment.
Projection field never updated causing stale fallback data
Medium Severity
The updateProjectionState method accepts a projection parameter that shadows the class field this.projection. While the method correctly uses the parameter to update cached values like visibleRegion, farLeft, etc., it never updates this.projection itself. The previous implementation included projection = newProjection to update the class field. When the fallback paths are taken in fromScreenLocation (lines 74, 87) and toScreenLocation (lines 100, 113)—which happens when isInvalid() returns true or withoutTiltOrBearing is false—the code uses the stale this.projection from initialization rather than the current projection state, leading to incorrect map coordinates.
🔬 Verification Test
Why verification test was not possible: This requires the Huawei HMS Maps SDK runtime environment and actual map interactions to test. The bug is evident from static analysis: the old code updated this.projection = newProjection (visible in the diff's removed line), but the new code removes this assignment while the fallback paths at lines 74, 87, 100, and 113 still reference this.projection.
| if (data.isNullOrBlank()) return null | ||
| private fun getAuthOptions(packageName: String): Set<String>? { | ||
| val data = preferences.getStringSet(DEFAULT_SIGN_IN_OPTIONS_PREFIX + getPackageNameSuffix(packageName), null) | ||
| if (data.isNullOrEmpty()) return null |
There was a problem hiding this comment.
SharedPreferences type mismatch causes ClassCastException on upgrade
High Severity
The getAuthOptions method calls preferences.getStringSet() directly on a key that was previously stored as a String by the old setDefaultSignInInfo method (using putString). When Android's SharedPreferencesImpl loads a String value and the code attempts to read it as a StringSet, it throws a ClassCastException because the internal map contains a String object that cannot be cast to Set<String>. While setAuthInfo uses runCatching to safely attempt reading old String data during migration, getAuthOptions lacks this protection. Users upgrading from older versions who have existing sign-in options stored will crash when calling sign-out or revoke-access operations that invoke getAuthOptions before any new sign-in triggers the migration path in setAuthInfo.
🔬 Verification Test
Why verification test was not possible: This requires testing against a real Android SharedPreferences implementation with pre-existing String data from an older app version. The bug is evident from comparing the old code (which used putString/getString for options) with the new code (which uses getStringSet without type-safe reading). Android's SharedPreferencesImpl.getStringSet performs an unchecked cast (Set<String>) mMap.get(key) that will fail if the stored value is a String.
- Added full RCS Provisioning backend and UI - Implemented Manual Phone Number Override for spoofing - Fixed multi-module build errors (minSdk, MultiDex) - Optimized multidex-keep.pro for legacy support
b1d1aaa to
118738d
Compare
This pull request adds full Bluetooth transport support for WearOS devices in MicroG, enabling basic wearable functionality without relying on Google Play Services. It introduces a new BluetoothWearableConnection class that implements a Bluetooth Classic RFCOMM transport using the standard SPP UUID and handles length-prefixed protobuf messages. The WearableImpl has been updated with a background ConnectionThread that automatically scans bonded devices at startup, attempts to connect using the new Bluetooth transport, and includes a 10-second reconnection loop while preserving existing TCP/IP handling. The Android manifest now includes the required Bluetooth permissions, including the newer Android 12+ BLUETOOTH_SCAN and BLUETOOTH_CONNECT. In testing, the connection successfully paired with a Pixel Watch and logged stable Bluetooth sessions, working alongside the TCP mechanism. Current limitations include broad connection attempts across all bonded devices and reliance on the general SPP UUID, though this foundation can be expanded with device-specific UUID detection, improved state management, and UI integration. This work closes issue microg#2843, relates to the long-standing issue microg#4, and fulfills the bounty request for foundational WearOS functionality such as notification sync, app communication, and media control within the existing MicroG wearable framework.
Note
BluetoothWearableConnection(RFCOMM SPP) and connection thread inWearableImpl; manifest gainsBLUETOOTH_CONNECT; settings UI lists bonded devices; robust deserialization and permission checks added.IAuthorizationServiceaddsrevokeAccess/clearToken; implementation persists per-app account via newAccountUtils, returns access/id tokens appropriately, and supports token invalidation.UnregisterReceiverwith trusted receiver +PackageIntentOpWorker(WorkManager) to clear GCM/auth data on package changes; GCM broadcast action renamed toCONNECTEDand flow adjusted; UI triggers updated.PLAY_INTEGRITY_APP_LISTsetting,PlayIntegrityDatamodel, and UI in SafetyNet (renamed to Device Attestation) to view/toggle per-app access; vending-side services track/update visit status; integrity/express services enforce enablement and per-app allow list.checkoutv6; add WorkManager (work-runtime-ktx) dependency and version; minor string/localization updates.Written by Cursor Bugbot for commit 7f8a5d0. This will update automatically on new commits. Configure here.