Skip to content

Dashboard: Offer the metadata-only device report only where it names something - #44

Merged
d4rken merged 1 commit into
mainfrom
worktree-device-support-gate
Aug 3, 2026
Merged

Dashboard: Offer the metadata-only device report only where it names something#44
d4rken merged 1 commit into
mainfrom
worktree-device-support-gate

Conversation

@d4rken

@d4rken d4rken commented Aug 3, 2026

Copy link
Copy Markdown
Member

What changed

The unsupported-device card offered two ways to contribute: the guided wizard, and a "Just send device info" button that opens a prefilled public issue with the device's non-privileged details and needs no Shizuku.

That second button is now shown only when those details actually name something — a known manufacturer family, a ROM marker, or a battery-protection setting the app could see. On a phone where none of that is present, the report would say nothing beyond "this isn't one of the families I know", which can't be acted on, so the card offers the guided wizard (which can still discover a setting the app doesn't know yet) and email instead.

Closes the gap behind #42.

Technical Context

Why this path was open. #36 gated the wizard's delivery on a report carrying at least one setting. Issue #42 came from the other entry point — UnsupportedDeviceCard's secondary button → DeviceSupportReporter → prefilled issues/new URL — which is metadata-only by design and had no such gate. AdapterRegistry.select()'s catch-all sets contributionWanted = true for any unmatched device, so the card appears identically for a Samsung on an unverified One UI (report is actionable) and for stock-Android hardware with no protection feature at all (report is not).

Why the predicate is wider than matched. The first cut gated on the adapter having matched. That both under- and over-shoots: lab adapters match on manufacturer or a single ROM property, so a rebranded Oplus device with oplusRomVersion set, or a LineageOS derivative that ships the lineagesettings provider without ro.lineage.build.version, lands in the catch-all while still carrying a real lead. ChargingState.hasSupportLead therefore ORs the matched adapter with the marker/key probes themselves. Its truth table is pinned in ChargingStateSupportLeadTest.

No new state field. adapterMatched is a computed adapterId != null rather than a value mirrored from AdapterSupport.matched — the registry returns an adapter exactly when a probe matched and its catch-all is the only null-adapter selection, so a carried flag could only drift. The unsupported dashboard preview gains the adapterId that its contributionWanted = true always implied.

Unchanged: the report format and DeviceSupportReporter itself, the wizard, the email path (a non-actionable report there costs one private reply, not a permanent public issue), and per-row disclosure.

Review guidance: the interesting file is ChargingRepository.kt (the predicate + its rationale); the Compose change is a visibility gate on the button and its dialog.

Verification

testFossDebugUnitTest (797 pass, incl. 10 new across the two suites), assembleGplayDebug, lintVitalFossRelease — all green locally. Reviewed by Codex; its findings on the predicate's width, the ungated dialog, the redundant state field, and an overclaiming KDoc are folded into this commit. Not device-tested: the change is UI visibility driven by pure state, covered by the Robolectric card tests.

…something

The unsupported-device card's "Just send device info" button opens a
prefilled public issue carrying non-privileged device metadata, needing no
Shizuku. It is the right path when the metadata identifies a family: for a
Samsung on an unverified One UI it states the skin, the ROM version and
which keys are present, which is exactly what widening a gate needs.

On a device where every probe came back empty it names nothing. The report
then says only that none of the known families matched, which is not
actionable, and a public issue is the most expensive place to learn it.
The wizard's own delivery already refuses reports carrying no setting, but
that gate never covered this second, unprivileged path.

The button is now gated on the metadata carrying a lead. That is wider than
"an adapter matched", because the family matchers are manufacturer lists and
property checks: a rebranded Oplus device or a LineageOS derivative shipping
the settings provider without the Lineage property reaches the registry's
catch-all while still carrying a real signal, so a ROM marker or a present
protection key counts on its own. Without a lead the card keeps the wizard,
which can still discover a key Amply does not know, and email, where a dead
end costs one reply instead of a public issue.

adapterMatched is derived from the selected adapter rather than mirrored
onto the state: the registry returns an adapter exactly when a probe
matched, so a second field could only drift.
@github-actions github-actions Bot added the enhancement New feature or request label Aug 3, 2026
@d4rken d4rken added bug Something isn't working and removed enhancement New feature or request labels Aug 3, 2026
@d4rken
d4rken merged commit bc55ceb into main Aug 3, 2026
12 checks passed
@d4rken
d4rken deleted the worktree-device-support-gate branch August 3, 2026 11:32
d4rken added a commit that referenced this pull request Aug 3, 2026
#44 landed on the same three files with a related change: the
metadata-only report is now gated on ChargingState.hasSupportLead.

The two interact. #44's fallback without a lead is "the card keeps the
wizard", and this branch withholds the wizard on LineageOS — together
those could have left that card with no contribution path at all. They
do not: hasSupportLead includes adapterMatched (the Lineage lab adapter
matches once detection works) and hasLineageSettingsProvider (verified
present on oriole), so the metadata path stays offered while the wizard
is withheld. Documented on the parameter, with a preview for that
combination since neither existing preview rendered it.

Also corrected hasSupportLead itself: it counted
`device.lineageOsVersion != null` as a lead, which is dead on every real
LineageOS build for exactly the reason this branch exists. Now isLineageOs.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant