Skip to content

fix: let Receive request the advertise permission - #2231

Open
pwltr wants to merge 12 commits into
masterfrom
fix/receive-requests-advertise-permission
Open

pwltr wants to merge 12 commits into
masterfrom
fix/receive-requests-advertise-permission

Conversation

@pwltr

@pwltr pwltr commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Twin: synonymdev/bitkit-ios#1571
Dependency: synonymdev/bitkit-e2e-tests#322 (grants runtime permissions on reinstall; without it Receive's new dialog breaks the local e2e shards, so merge it first)
Source: qa, @pwltr

This PR fixes Receive not offering its request over Bluetooth when the wallet had allowed Bluetooth for a hardware wallet first.

Description

  • Fixes Receive skipping Bluetooth when only part of the "Nearby devices" group was granted, because a wallet could hold scan and connect without advertise (the hardware wallet screens ask for those two only) and nothing ever asked for the rest.
  • Adds a request from the scanner for the whole Nearby devices group when scanning is already allowed but advertising is not, because its Bluetooth button only shows when scanning permissions are missing.
  • Adds a request from Receive for the whole Nearby devices group when advertising is not allowed, while it has a request to offer and Nearby payments is on, so allowing it there also lets the scanner scan; Android grants it without a dialog when part of the group is already allowed.
  • Asks again when the screen resumes if Android dropped the request because another permission dialog, such as the scanner's camera prompt, was open.

Found while testing the 3.2.0 release: a Pixel 8 had BLUETOOTH_SCAN and BLUETOOTH_CONNECT granted and BLUETOOTH_ADVERTISE not, so its Receive never advertised (empty GATT advertiser map) while "Scan or tap to pay" stayed up because of NFC. Granting the permission made an iPhone read the request at once.

Out of Scope

  • Receive: "Scan or tap to pay" still shows while only NFC is active, so it does not say whether Bluetooth works.
  • Scanner: a request read over Bluetooth for another network is dropped without a message, and the log calls it "not a payment".
  • Scanner: the "Enable Bluetooth" label reads as if the phone's Bluetooth were off when only Bitkit's permission is missing.
  • Settings: the Nearby payments toggle has no design; where it lives is still open.

Design

N/A — no design available. The only new UI is the system "Nearby devices" dialog, shown from Receive.

Preview

QA Notes

Setup

  • Dev build of this branch (to.bitkit.dev) on an Android 12+ emulator or device with Bluetooth on and Nearby payments on, against regtest (local bitkit-docker or staging Electrum).
  • For J1, turn NFC off (adb shell svc nfc disable) and remove Nearby devices: adb shell pm revoke to.bitkit.dev android.permission.BLUETOOTH_SCAN, and the same for BLUETOOTH_CONNECT and BLUETOOTH_ADVERTISE.

Journeys

  • J1: new receive-requests-nearby-permission.xml — Receive asks for Nearby devices and advertises over Bluetooth after Allow

Manual Tests

  • 1. Two phones, iPhone pays this Android: Android Receive open → iPhone scanner held next to it → Send review opens with the Android request — two Bluetooth devices not in Capabilities

Automated Checks

  • added NearbyAdvertisePermissionTest.kt — scan and connect granted without advertise leaves the scanner working but Receive needing permission, so both the scanner and Receive ask; granting advertise lets Receive advertise

Evidence

  • J1 passed at 7406bfc on emulator medium_phone (Android 16), local regtest: Receive showed the Nearby devices dialog, "Scan or tap to pay" after Allow, and no dialog on reopening; one ongoing advertisement afterwards. Recorded locally.
  • Commit 3548b3e, emulator medium_phone (Android 16), local regtest: with all three Bluetooth permissions revoked, opening Receive showed the "Nearby devices" dialog; after Allow, BLUETOOTH_ADVERTISE and BLUETOOTH_CONNECT read granted=true, dumpsys bluetooth_manager listed one ongoing advertisement and "Scan or tap to pay" showed. Screenshots and a recording were taken locally.
  • Before the fix, on a Pixel 8 (GrapheneOS, release 3.2.0) with scan and connect granted but not advertise, Receive never advertised; adb shell pm grant ... BLUETOOTH_ADVERTISE alone made an iPhone scanner find it at -34 to -66 dBm and read the request (case 1 equivalent, run on the release build plus a manual grant).
  • Pixel 8 (GrapheneOS), dev build of this branch: after pm revoke ... BLUETOOTH_ADVERTISE with scan and connect still granted, Receive and the scanner kept working, i.e. the advertise permission was granted again without a dialog (reported by the author).
  • At 7e3148f on the emulator: all three revoked → Receive → Allow granted scan, connect and advertise, and the Send scanner read "Scanning QR & Bluetooth"; with scan and connect granted and advertise and camera revoked, Send → camera Allow → advertise granted on the same visit.
  • just compile, just test and just lint passed locally.

Gaps

  • Case 1 was not run with this branch's build on a device.

Models used

  • Planning/scoping: claude-opus-5-5 (reasoning: medium)
  • Implementation: claude-opus-5-5 (reasoning: medium)
  • Review: Not performed

🤖 Generated with Claude Code

Receive advertised only when the scanner had already been granted the
whole "Nearby devices" group. The hardware wallet screens asked for scan
and connect only, so a wallet that allowed Bluetooth there could scan but
never advertise, and nothing asked for the missing permission: Receive
skipped Bluetooth without a sign while NFC kept "Scan or tap to pay" up.

Every Bluetooth prompt now asks for the whole group, and Receive asks
for the advertise permissions it lacks while it has a request to offer.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@github-actions

github-actions Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Regtest APK

Built from 82ce322 (run).

Download bitkit-dev-debug universal APK (expires in 30 days).

pwltr and others added 4 commits December 1, 2026 19:39
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A wallet with scan and connect but not advertise never saw the scanner's
Bluetooth button, so the scanner now asks for the missing advertise
permission too; Android grants it without a dialog in that case.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pwltr
pwltr marked this pull request as ready for review December 1, 2026 19:26
@greptile-apps

greptile-apps Bot commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor

Confidence Score: 4/5RetriggerView in Greptile

[Medium impact] The changes affect Android nearby-payment and hardware-wallet Bluetooth permission flows.

The PR appears safe to merge, with a non-blocking suggestion to make the Bluetooth journey catch advertising failures.

Findings

  1. P2 NFC can hide Bluetooth failures ▶

Summary

Receive now requests missing Bluetooth advertising permissions when it has a request to offer and Nearby payments is on.

  • Receive and the payment scanner ask for missing Bluetooth permissions.
  • Hardware-wallet screens ask for the full Nearby devices group.

Reviews (1) · Last reviewed commit: "docs: describe the receive permission jo..." · Reviewed by Greptile

@ovitrif ovitrif added this to the 3.2.0 milestone Dec 1, 2026
@ovitrif

ovitrif commented Dec 1, 2026

Copy link
Copy Markdown
Collaborator

Milestone 3.2.0: without this, Receive never offers its request over Bluetooth for some wallets, so nearby payments silently fail for them in a feature new in 3.2.0. That makes it an RC blocker (raised in the 3.2.0 release thread). This PR closes no issue, so it carries the milestone itself.

@talosmachina talosmachina left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No findings. Makes every Bluetooth prompt (hardware sheet, Trezor screen) ask for the whole Nearby devices group, and has Receive and the scanner request BLUETOOTH_ADVERTISE when a wallet holds scan and connect without it. Reviewed 7406bfc, full tier.

What I checked, and 5 candidates I ruled out

Read in full: NearbyEffects.kt, NearbyScanSources.kt, the changed parts of HardwareSheet.kt and TrezorScreen.kt, NearbyAdvertisePermissionTest.kt
Call sites traced: offerPaymentNearby (ReceiveQrScreen, UsdtReceiveContent), rememberNearbyScanSources (QrScanningScreen, SendRecipientScreen), isNearbyPaymentsEnabled (defaults to false until the store loads)
CI: build-and-test, lint, detekt, build-local green; the red build gate belongs to a cancelled run at the same head (BUILD_RESULT: cancelled); compose-ui and the e2e shards were still pending
Build: not built here; Android PRs are reviewed from the code and CI

Ruled out

  • Dialog over the PIN screen or while offline: nearbyOfferUri returns null while isNearbyPaused(), so shouldRequestAdvertisePermission is false there.
  • Prompt before Android 12: advertisePermissions is empty there, so bluetoothState(ADVERTISE) never reads NEEDS_PERMISSION and nothing launches.
  • Prompt for a wallet that opted out: both predicates require isNearbyEnabled, whose initial value is false, so nothing asks before the saved setting loads.
  • Hardware flow regressing for wallets granted in part: allPermissionsGranted now fails on the missing advertise permission, so requestBleAccess launches a request the system grants without a dialog, then enableBleScanning runs as before.
  • Scanner request colliding with the camera prompt on first open: if Android drops it, the scanner only skips the backfill; Receive still asks on its own, so the fix does not depend on it.

Merge confidence: 4/5, no findings, but the two request effects are covered only through their predicates and CI had not finished compose-ui and e2e.

Reviewer model: claude-opus-5-5
Reasoning effort: Not exposed (the run metadata available to this reviewer names the model only)

NFC alone also shows "Scan or tap to pay", so the journey turns NFC off
and checks for an active Bluetooth advertisement.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Hardware wallet discovery does not advertise, and requiring the advertise
permission there could stop discovery on a device that keeps it denied.
Receive and the scanner already request what they lack, so the hardware
screens go back to scan and connect. Narrows the permission list test to
what it checks: the scanner button's request.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passed on Galaxy S22 at 072f7504580d, using the universal regtest APK from CI run 46743708456 and a physical iPhone 13 on twin 5b9c20265feb. NFC was off on the Galaxy.

  • Started with scan and connect granted and advertise denied. Opening Receive recovered the advertise grant and showed the QR and Tap to Pay.
  • Revoked all three Bluetooth permissions. Receive displayed the Android Nearby devices dialog. After Allow, connect and advertise were granted and scan stayed ungranted. Receive showed the QR and Tap to Pay, including on reopen without a second prompt. The app’s Bluetooth log recorded onServiceAdded ... status=0 and onAdvertisingSetStarted(2, -15, 0).
  • With the phones’ top corners touching, the iPhone opened Send review for the Galaxy’s 1,000-sat invoice. The full invoice in Review matched the Galaxy QR (SHA-256 fb8a29df1d2b…). The same test also passed on the earlier Android commit 269b7728fa5f. Both runs stopped at review.
  • Placement mattered on the earlier Android commit. With the phones side by side the iPhone stayed on the scanner. In a separate diagnostic capture, all 156 valid samples were below the iPhone build’s −60 dBm cutoff (−71 to −62 dBm). Bringing the corners together opened review on the original build. iPhone device results
  • In the other direction, the Galaxy scanner read a fresh 1,000-sat iPhone Receive invoice over Bluetooth. Its full Review URI matched the iPhone QR (SHA-256 6e4e6c583ec4…). The Galaxy log recorded Read nearby request and suppressed QuickPay. No payment was submitted.

Any app's advertisement satisfied the journey's advertising check, and
the label can show before Bitkit's advertising has started, so the step
now looks for Bitkit's nearby service UUID. Drops a test that only
restated the permission list.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@pwltr
pwltr requested review from ovitrif and piotr-iohk December 1, 2026 21:36

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA review

Scope: full PR diff against its merge base, at a85975cb.

2 actionable findings — resolve or provide an evidence-backed rebuttal.

Compared against twin synonymdev/bitkit-ios#1571 at 5b9c2026 and compatibility-checked against dependency synonymdev/bitkit-e2e-tests#322 at 4b3a2090 (only the Android reinstall permission-grant contract in test/helpers/setup.ts was checked, not a full review of #322).

  • Parity with twin iOS PR: on iOS, granting Bluetooth from Receive grants the single system Bluetooth permission so both Receive and the payment scanner work immediately. On Android, Receive requests only advertisePermissions (BLUETOOTH_ADVERTISE + BLUETOOTH_CONNECT), leaving BLUETOOTH_SCAN ungranted and creating the symmetric partial-grant issue on the scanner (F1).
  • E2E dependency: synonymdev/bitkit-e2e-tests#322 updates reinstallApp and reinstallAppFromPath to install with grantPermissions: true on Android, matching this PR's new Receive permission dialog; the remaining direct driver.installApp(getNativeAppPath()) calls in migration.e2e.ts and native-migration.ts do not open native Receive in their checked flows. Because #322 is still an open draft on a differently named branch (fix/grant-permissions-on-reinstall), e2e-tests-local on #2231 currently resolves bitkit-e2e-tests@main and #322 needs to merge first as noted in the PR header.
  • External review reconciliation: Greptile's unresolved thread (discussion_r4759730720, submitted at 7406bfcc) about NFC hiding Bluetooth failures in receive-requests-nearby-permission.xml is fixed at a85975cb (the journey now disables NFC and verifies service UUID cb0e128 via dumpsys bluetooth_manager), though the GitHub thread itself remains unresolved.
  • CI at a85975cb: build-and-test, lint, detekt, and build-local passed; compose-ui / ui-tests and the seven e2e-tests-local shards (run 46748842591) were still in progress at review time.

Recommended before device testing

  • Address F1 so allowing "Nearby devices" from Receive also grants BLUETOOTH_SCAN (or lets the scanner recover BLUETOOTH_SCAN when advertising is already granted), and optionally address F2 for the scanner/camera permission race.
  • Merge synonymdev/bitkit-e2e-tests#322 and verify compose-ui and the e2e-tests-local shards pass against the updated head.

Device testing: not performed in this review. Separately, @piotr-iohk reported a physical Galaxy S22 + iPhone 13 device pass at earlier commit 072f7504 (review 6140339719; only receive-requests-nearby-permission.xml and NearbyAdvertisePermissionTest.kt changed between 072f7504 and a85975cb), which also observed that BLUETOOTH_SCAN remained ungranted after allowing the Nearby devices dialog from Receive.

Suggested additional test cases

  • Android (Receive-first -> Scanner): On Android 12+ with Bluetooth and Nearby payments on and BLUETOOTH_SCAN, BLUETOOTH_CONNECT, and BLUETOOTH_ADVERTISE all revoked, open Receive and tap "Allow" on the Nearby devices dialog, then close Receive and open Send (with Camera allowed). Expected: the scanner immediately starts Bluetooth scanning (ScannerStatus reads "Scanning QR & Bluetooth") and does not show ScannerEnableBluetooth.
  • Android (Hardware-wallet partial grant -> first-time Send): On Android 12+ with BLUETOOTH_SCAN and BLUETOOTH_CONNECT granted and BLUETOOTH_ADVERTISE and CAMERA revoked, open Send and tap "Allow" on the Camera permission dialog. Expected: BLUETOOTH_ADVERTISE is also granted by the scanner recovery without reopening Send.

Findings

  • [MEDIUM] Requesting only advertisePermissions from Receive leaves BLUETOOTH_SCAN denied for the scanner — inline at app/src/main/java/to/bitkit/ui/shared/effects/NearbyEffects.kt:279.
  • [LOW] Scanner's advertise-permission request collides with the ON_START camera permission request — inline at app/src/main/java/to/bitkit/ui/screens/scanner/NearbyScanSources.kt:110.

Reviewer model: gemini-4-neon
Reasoning effort: high

Receive asked for advertise and connect only, so allowing the Nearby
devices dialog there left scan denied and the scanner still needed its
Bluetooth button. Both automatic requests now ask for the whole group.

Android drops a permission request while another dialog is open, such
as the scanner's camera request, and returns no results; that request no
longer counts as made, so it is asked again when the screen resumes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: ⛔️ Request changes — the scanner’s advertise-permission backfill fails when the camera prompt is open.

The PR moved to 7e3148f after this run; these results are for a85975c.

Tested a85975c; the PR advanced to 7e3148f after these checks. The new head is not assessed in this report.

Review: full diff, 5 files at a85975c.

Findings:

  • LOW, existing: app/src/main/java/to/bitkit/ui/screens/scanner/NearbyScanSources.kt:110 — the camera request cancels the concurrent advertise request, and the scanner does not retry it after camera access is allowed. Existing finding, now reproduced. Bluetooth scanning remains usable, and opening Receive recovers advertising. Defer the backfill until the camera request completes.

QA for a85975c:

Built from a85975c and tested on Android 16 emulators, against staging regtest.

Receive requests Bluetooth access and advertises after Allow ✅ Nearby devices appears, advertising starts, and reopening does not prompt again.

J1 passed with NFC unavailable and all three Bluetooth permissions initially revoked. Allow granted advertise/connect; Android’s Bluetooth diagnostics showed Bitkit’s service UUID in an ongoing connectable advertisement. Closing Receive stopped it, and reopening started it again. The screenshot records the system permission dialog.

receive-journey-2x.2x.mp4

Partial Bluetooth grants recover Receive and scanner access ✅ The focused permission unit tests pass.

NearbyAdvertisePermissionTest.kt passed at a85975c, covering partial scan/connect grants, scanner backfill eligibility, missing scan permission, and advertising readiness after permission is granted.

Scanner recovers access after Receive granted Bluetooth ✅ Enable Bluetooth silently grants scan and starts scanning.

After allowing Nearby devices from Receive, Send initially showed “Scanning QR” and its existing Enable Bluetooth control. One tap changed it to “Scanning QR & Bluetooth” without another permission dialog. Package permissions and Bluetooth diagnostics confirmed the scan grant and Bitkit’s active service-filtered scan. This verifies the recovery path discussed in the Receive-first finding.

receive-first-scanner-2x.2x.mp4

Scanner backfills advertise while asking for camera access ❌ Advertise stays denied after camera access is allowed.

With scan/connect granted and advertise/camera revoked, Send showed the camera prompt. Android’s permission diagnostics and Activity warning confirmed that the concurrent advertise request was cancelled and advertise stayed denied after allowing camera. Scanning continued; opening Receive then silently granted advertise and started Bitkit’s advertisement. This reproduces the existing LOW finding without a duplicate inline comment.

scanner-camera-2x.2x.mp4

Manual case 1 was not repeated: @piotr-iohk’s physical Galaxy S22 and iPhone 13 report passed Bluetooth reads in both directions at 072f750. Only the unit test and journey changed between that head and a85975c; the tested runtime code is unchanged.

Twin: synonymdev/bitkit-ios#1571 matches the Receive permission behavior, adapted to iOS’s single Bluetooth permission.

The full PR diff was reviewed. Device cases drove Receive and Send; the separate QR scanner caller and USDT Receive caller were checked in code. The focused unit test was run locally; the full unit suite and lint were not rerun here, and their CI jobs passed at a85975c. The declared synonymdev/bitkit-e2e-tests#322 dependency remains separate from these results.


Reviewed by gpt-6.1-sol-high

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA review

Scope: Follow-up changes since a85975cb, including affected Receive and scanner paths, at 7e3148f. Unchanged request eligibility and caller coverage carry forward from the completed baseline.

2 actionable findings — resolve or provide an evidence-backed rebuttal.

J1 needs to reset prior permission denials and look beyond the first advertiser record. The Robolectric tests cover permission eligibility and post-grant state. The actual launcher arguments and retry after a competing permission request remain untested by those assertions. The local unit test attempt stopped at GitHub Packages authentication. GitHub Actions reported a successful build and unit test step for the pinned PR revision. CI build and unit tests

The iOS comparison at 5b9c202 covered first-use Bluetooth consent from Receive, foreground advertising and the shared service UUID. For Android #2231, e2e compatibility at 4b3a209 was limited to reinstall permission grants, Receive selectors and CI ref selection. The matching test branch supplies the grant fix to PR CI. Merge the dependency first so runs using e2e main also get it. E2E dependency · Android e2e run

Device testing was not performed in this review. The author’s J1 and two-phone case 1 remain in the runtime plan. QA Notes

Suggested additional test cases

  • On Android 12+, grant Scan and Connect while leaving Advertise and Camera revoked. Open Send and allow Camera. Verify Advertise is granted on the same visit.
  • On Android 12+ with NFC off and Nearby devices permissions reset, dismiss the first Receive permission prompt. Verify the QR remains usable, the Bluetooth tap-to-pay label stays hidden and the prompt stays closed for that visit.

Earlier findings reconciled at this revision: 3 verified fixed.

Findings

  • [LOW] Clear prior Nearby devices denials in J1 setup — inline at journeys/receive/receive-requests-nearby-permission.xml:7.
  • [LOW] Search the whole active advertiser section in J1 — inline at journeys/receive/receive-requests-nearby-permission.xml:15.

Reviewer model: gpt-6.2-sol
Reasoning effort: high

Clears earlier Nearby devices denials in the setup, since Android keeps
user-fixed after a revoke and would suppress the dialog, and searches the
whole active advertiser section for Bitkit's service UUID.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: ✅ Approve

Reaudit: diff, 1 file, plus the earlier permission findings.

Findings:

  • LOW: journeys/receive/receive-requests-nearby-permission.xml:8 — both new <NAME> placeholders are unescaped XML elements, so the journey fails XML parsing. Use &lt;NAME&gt; or a placeholder without angle brackets in both commands.

QA for 21439c1:

Built from 21439c1 and tested on an Android 16 emulator (Pixel 9 Pro XL), against staging regtest with NFC unavailable.

Receive asks for Nearby devices and advertises after Allow ✅ J1 passes; permission and advertising state were checked with Android diagnostics.

The revised reset cleared prior fixed-denial flags. Allow granted scan, connect and advertise; the revised command found Bitkit’s active service UUID. Receive showed “Scan or tap to pay” and reopened without another prompt. The journey steps were driven manually despite the XML syntax defect.

receive-journey-2x.2x.mp4

Receive permission also enables Bluetooth scanning ✅ Send starts Bluetooth scanning without an extra permission tap.

After allowing Nearby devices from Receive, Send immediately showed “Scanning QR & Bluetooth” without Enable Bluetooth. Camera was already allowed.

receive-first-scanner-2x.2x.mp4

Scanner recovers advertise after the camera prompt ✅ Advertise is granted on the same visit, confirmed through Android permission diagnostics.

Starting with scan/connect granted and advertise/camera revoked, Send showed the camera prompt. After Allow, advertise was granted and Bluetooth scanning stayed active. Diagnostics confirmed the first nearby request was dropped and then retried.

scanner-camera-2x.2x.mp4

Denying Nearby devices leaves Receive usable ✅ The QR remains visible and the prompt stays closed for that visit.

After Don’t allow, QR and Copy remained available, “Scan or tap to pay” stayed hidden, and the same visit did not prompt again. Android diagnostics confirmed all three Bluetooth permissions stayed denied.

receive-denied-2x.2x.mp4

Partial Bluetooth permission state tests ✅ The focused unit tests pass.

NearbyAdvertisePermissionTest.kt passed at 21439c1, including both roles being ON after granting the group.

Manual case 1 was not repeated: two physical Bluetooth devices are required. @piotr-iohk’s Galaxy S22/iPhone 13 report proves request reads in both directions at 072f750. Bluetooth transport is unchanged since that head; the changed permission paths were retested here.

Twin: synonymdev/bitkit-ios#1571 matches the permission behavior, adapted to iOS’s single Bluetooth permission.

The delta and earlier open findings were reviewed. Receive and Send were driven; the shared QR scanner and USDT Receive callers were checked in code. The full unit suite and lint were not rerun here; their CI jobs passed at 21439c1. Compose UI and e2e jobs were still running. The declared synonymdev/bitkit-e2e-tests#322 dependency remains open.


Reviewed by gpt-6.1-sol-high

The <NAME> placeholders parsed as XML elements.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@ovi-reviewer ovi-reviewer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict: ✅ Approve

Findings: None. The previous XML parsing defect is fixed: both permission placeholders are plain text.

QA for 82ce322:

Check: Receive permission journey loads as XML ✅ All journey XML files pass parsing.

xmllint --noout passes for all 209 journey files. J1's description contains no nested XML elements and its five actions remain intact. The same parser check reproduces the defect at 21439c1.

Check: Permission placeholder correction preserves behavior ✅ Only the description placeholders changed; `git diff --check` passes.

J1 still names all three Bluetooth permissions and clears user-set and user-fixed. The journey actions, app code and unit tests are unchanged from 21439c1.

No new build or device run: this delta only fixes journey prose. The passing review at 21439c1 still covers J1, Receive-first scanning, retry after the camera prompt, denied Receive and the focused permission unit tests. @piotr-iohk's physical-device report at 072f750 covers manual case 1; the Bluetooth transport is unchanged.

Twin: synonymdev/bitkit-ios#1571 still matches the Receive permission behavior, adapted to iOS's single Bluetooth permission; this correction is Android-specific.

Reviewed the contiguous delta 21439c1..82ce322 and the earlier open XML finding. The declared synonymdev/bitkit-e2e-tests#322 dependency remains open and should merge first, as the PR specifies.


Reviewed by gpt-6.1-sol-high

@piotr-iohk piotr-iohk left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

QA review

Scope: changes since 7e3148f, including affected code paths and prior findings, at 82ce322. Baseline: previous QA review.

1 actionable finding — resolve or provide an evidence-backed rebuttal.

J1's new precondition runs pm clear-permission-flags, which Android 12's package manager does not implement. The wider dumpsys window matches the Android 14–16 GattService dump: ongoing advertising is printed before GATT Client Map, and the redacted service UUID still contains cb0e128.

The pinned iOS twin journey at 5b9c20265feb9768b8626779fea108a539c34978 keeps one system Bluetooth prompt and does not use these adb commands. The pinned e2e dependency at 4b3a2090a1e29f3eee78939182a2440dbba61e07 was checked only for the reinstall grant: Android reinstall still passes grantPermissions, so this journey edit does not change that contract.

Device testing: not performed in this review. The author reports J1 passed at 7406bfcca on an Android 16 emulator; that revision is before this journey edit. XML parsing and git diff --check passed for the journey change.

Earlier findings reconciled at this revision: 4 verified fixed.

Findings

  • [LOW] Limit the Nearby devices flag reset to Android 13+ — inline at journeys/receive/receive-requests-nearby-permission.xml:9.

Reviewer model: grok-4.7
Reasoning effort: xhigh

Precondition: onboarded dev build wallet on Android 12 or later, Bluetooth on, Nearby payments on, and
Nearby devices not allowed and not blocked by earlier denials: for each PERMISSION in BLUETOOTH_SCAN, BLUETOOTH_CONNECT
and BLUETOOTH_ADVERTISE run `adb shell pm revoke to.bitkit.dev android.permission.PERMISSION` and
`adb shell pm clear-permission-flags to.bitkit.dev android.permission.PERMISSION user-set user-fixed`. NFC off (`adb shell svc nfc disable`; emulators have none),

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[LOW] Limit the Nearby devices flag reset to Android 13+

J1's precondition, on an Android 12 device, runs adb shell pm clear-permission-flags to.bitkit.dev android.permission.BLUETOOTH_SCAN user-set user-fixed and the same command for BLUETOOTH_CONNECT and BLUETOOTH_ADVERTISE.

Android 12's PackageManagerShellCommand has no clear-permission-flags case (android-12.1.0_r1). The shell falls through to the default handler, prints Unknown command: clear-permission-flags, and returns -1 (BasicShellCommandHandler.handleDefaultCommands). The command exists from Android 13 (android-13.0.0_r1), where one invocation accepts both user-set and user-fixed.

A runner that executes the journey as written cannot finish the new "not blocked by earlier denials" setup on Android 12, the first release whose Nearby devices permission this journey covers. pm revoke still runs; the flag clear does not.

On Android 12, keep the precondition to pm revoke. Run pm clear-permission-flags only on Android 13 and later. Clearing a permanent denial on Android 12 requires reinstalling the app.

Evidence basis: source analysis of the journey at 82ce322 and of AOSP PackageManagerShellCommand / BasicShellCommandHandler. This review did not run the command on a device. A focused issue search for clear-permission-flags in synonymdev/bitkit-android found no matching issue.

This branch has not been deployed

No deployments
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.

4 participants