Skip to content

Add opt-in ADB wallpaper restriction repair and diagnostics (#70) - #71

Draft
doudar wants to merge 6 commits into
mainfrom
fix/70-wallpaper-adb-repair
Draft

doudar wants to merge 6 commits into
mainfrom
fix/70-wallpaper-adb-repair

Conversation

@doudar

@doudar doudar commented Nov 10, 2026

Copy link
Copy Markdown
Owner

Summary

Refs #70. Adds an experimental, opt-in ADB workaround for the Android wallpaper restriction reported with Lawnchair. This is a standalone source-checkout helper, not a new application UI control or an automatic installer change.

Android exposes two relevant UserManager restrictions:

adb -s YOUR_SERIAL shell pm set-user-restriction --user 0 no_set_wallpaper 0
adb -s YOUR_SERIAL shell pm set-user-restriction --user 0 no_wallpaper 0

These can clear base restrictions when the device supports the command and grants the ADB shell sufficient permission. They do not override a separate device/profile-owner policy and cannot restore an omitted wallpaper service. The helper checks those conditions rather than treating an exit-code-zero command as proof of a fix.

Changes

  • tool/repair_wallpaper.py: standard-library-only Python 3.10+ diagnostics; read-only by default. --apply clears only detected base wallpaper flags, and --open-picker requests android.intent.action.SET_WALLPAPER only after a verified-clear result.
  • Explicit device targeting; active user-0 and non-profile checks; bounded commands; missing-service and unsupported-command handling; Android error-text detection; conservative parsing of unknown/null dumps; post-change verification and restoration commands for observed base changes.
  • No rooting, administrator removal, Peloton package disabling, provisioning changes, factory reset, or unrelated restriction changes.
  • docs/wallpaper-troubleshooting.md: manual commands, limitations, rollback guidance, privacy notes for diagnostic output, Android/AOSP references, and device-validation steps.
  • README troubleshooting entry.
  • 35 offline unit tests, automatically included by the existing workflow's tool/tests/test_*.py discovery.

Validation performed

  • PASS: python -m unittest discover -s tool/tests -p 'test_repair_wallpaper.py' -v — 35 tests.
  • PASS: Python compilation and CLI --help smoke check.
  • Fixtures model AOSP formatting; they are not captured Peloton results.
  • No Flutter runtime code or dependency changes. The full Flutter build/test workflow has not been run locally.

Required hardware validation before declaring #70 resolved

  • Run the read-only helper on an affected Peloton and record Android version, service presence, and the two base/effective restriction states.
  • If eligible, run --apply --open-picker; confirm a custom image actually applies in Lawnchair.
  • Reopen Peloton and reboot; check whether the restriction returns.
  • Confirm normal Peloton functionality remains intact.
  • If policy-enforced, unsupported, or missing service, retain the explicit unresolved result rather than claiming success.

Keeping this PR in draft and using Refs #70 rather than an auto-closing keyword because the reported tablet has not yet been hardware-tested.

Usage

python3 tool/repair_wallpaper.py --serial YOUR_SERIAL
python3 tool/repair_wallpaper.py --serial YOUR_SERIAL --apply --open-picker

Use --adb /path/to/adb for an ADB executable outside PATH; Windows users can use py -3.

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.

1 participant