Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: bryanroscoe/shield_optimizer
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.74.1
Choose a base ref
...
head repository: bryanroscoe/shield_optimizer
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.75.0
Choose a head ref
  • 19 commits
  • 4 files changed
  • 2 contributors

Commits on Mar 20, 2026

  1. Use Homebrew Core formula for PowerShell on macOS

    The powershell/tap/powershell tap is broken and throws:
    "Calling `depends_on macos: :high_sierra` is disabled!"
    
    See: PowerShell/Homebrew-Tap#1339
    dannyfallon committed Mar 20, 2026
    Configuration menu
    Copy the full SHA
    a129e1a View commit details
    Browse the repository at this point in the history

Commits on Apr 23, 2026

  1. Merge pull request #10 from dannyfallon/df/fix-homebrew-powershell

    Use Homebrew Core formula for PowerShell on macOS
    bryanroscoe authored Apr 23, 2026
    Configuration menu
    Copy the full SHA
    cce050c View commit details
    Browse the repository at this point in the history

Commits on May 8, 2026

  1. Remove background_process_limit setting

    The setting does not persist across reboots on Nvidia Shield, and the
    optimization flow prompts for a reboot at the end — meaning anything
    set here was always reverted before it took effect.
    
    Removes:
    - $Script:PerfList entry and the Run-Performance prompt block
    - Health Report SETTINGS query, parsing, and "Process Limit" display
    - README feature list mention
    
    Closes #11
    bryanroscoe committed May 8, 2026
    Configuration menu
    Copy the full SHA
    69e83d8 View commit details
    Browse the repository at this point in the history
  2. Document Docker usage for Linux

    Adds an Installation subsection covering how to run the script inside
    Microsoft's official PowerShell container on Linux. Calls out the two
    non-obvious requirements (--network host, iproute2) and notes the
    Docker Desktop limitation on macOS/Windows where host networking is
    unavailable.
    
    Closes #9
    bryanroscoe committed May 8, 2026
    Configuration menu
    Copy the full SHA
    a318054 View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    435c511 View commit details
    Browse the repository at this point in the history
  4. fix launcher selection

    bryanroscoe committed May 8, 2026
    Configuration menu
    Copy the full SHA
    328053b View commit details
    Browse the repository at this point in the history
  5. Merge pull request #12 from bryanroscoe/fix/issue-11-remove-bg-proces…

    …s-limit
    
    Remove background_process_limit setting (closes #11)
    bryanroscoe authored May 8, 2026
    Configuration menu
    Copy the full SHA
    5f2b73d View commit details
    Browse the repository at this point in the history
  6. Merge pull request #13 from bryanroscoe/docs/issue-9-docker-usage

    Document Docker usage in README (closes #9)
    bryanroscoe authored May 8, 2026
    Configuration menu
    Copy the full SHA
    5122f07 View commit details
    Browse the repository at this point in the history
  7. Merge pull request #14 from bryanroscoe/feat/launcher-selection-fix

    Fix launcher selection
    bryanroscoe authored May 8, 2026
    Configuration menu
    Copy the full SHA
    be198dd View commit details
    Browse the repository at this point in the history
  8. Always prefix digit shortcuts in Read-Menu

    Inlining a digit shortcut inside option text that contains other digits
    (IP addresses being the obvious case) made it impossible to tell which
    digit was the keystroke and which was content. The first matching digit
    won — so a row with shortcut "2" and text "192.168.42.196" would render
    as "19[2].168.42.196", highlighting an arbitrary octet character.
    
    Skip the inline search entirely when the shortcut is a digit; fall
    through to the existing "[N] <text>" prefix form. Letter shortcuts
    keep the inline behavior since they're chosen to match meaningful
    content (e.g. "[S]can Network").
    bryanroscoe committed May 8, 2026
    Configuration menu
    Copy the full SHA
    afd6d52 View commit details
    Browse the repository at this point in the history
  9. Snapshot meminfo once for Optimize prompt RAM annotations

    The optimize prompt was silently dropping the "(using X MB RAM)" line
    for some apps, including ones that the Health Report had just shown
    using significant RAM (Plex at ~845 MB in one observed case).
    
    Cause: Get-AppMemoryUsage ran one `dumpsys meminfo $Package | grep
    'TOTAL PSS'` per app, then matched a single regex against the result.
    Format drift between Android versions, multi-process apps where TOTAL
    PSS sits in a different column layout, and grep/adb-shell exit-code
    quirks all caused intermittent miss-then-null returns. The Health
    Report avoids this by parsing system-wide `dumpsys meminfo` output
    client-side from the "Total PSS by process" section.
    
    Replace the per-app function with Get-AppMemoryMap which:
    - Runs `dumpsys meminfo` once per Run-Task invocation
    - Parses the same "Total PSS by process" lines the Health Report uses
    - Sums all processes that share a base package (e.g. com.foo and
      com.foo:worker) so the displayed total matches what users see on
      the Health Report
    - Returns @{} on any failure so callers can lookup safely
    
    Run-Task now snapshots the map once at the top (Optimize mode only)
    and looks up `$memoryMap[$pkg]` in the per-app loop. Net effect:
    fewer ADB roundtrips, consistent numbers between Health Report and
    Optimize prompt, no missing annotations on running apps.
    bryanroscoe committed May 8, 2026
    Configuration menu
    Copy the full SHA
    2e4d885 View commit details
    Browse the repository at this point in the history
  10. Merge pull request #15 from bryanroscoe/fix/menu-digit-shortcut-prefix

    Always prefix digit shortcuts in Read-Menu
    bryanroscoe authored May 8, 2026
    Configuration menu
    Copy the full SHA
    10127c2 View commit details
    Browse the repository at this point in the history
  11. Merge pull request #16 from bryanroscoe/fix/optimize-prompt-memory-di…

    …splay
    
    Snapshot meminfo once for Optimize prompt RAM annotations
    bryanroscoe authored May 8, 2026
    Configuration menu
    Copy the full SHA
    df70dd5 View commit details
    Browse the repository at this point in the history
  12. Use role API when setting the default launcher

    Set-DefaultLauncher only called `cmd package set-home-activity`, which
    is the legacy Android API. On Android 10+ the canonical mechanism is
    the role API (`cmd role add-role-holder android.app.role.HOME <pkg>`)
    and on Android 11+ the legacy command often no-ops silently — leaving
    the launcher installed but not active.
    
    The codebase already has Set-HomeRoleHolder used by the
    Disable-AllStockLaunchers path. Try that first in Set-DefaultLauncher
    and fall through to the legacy command (with the existing common-name
    fallback) if the role API rejects the package. Reproduced on a Shield
    running Android 11 where the wizard reported "Could not set default
    programmatically" even after Projectivy was installed.
    bryanroscoe committed May 8, 2026
    Configuration menu
    Copy the full SHA
    96a3edc View commit details
    Browse the repository at this point in the history
  13. Merge pull request #17 from bryanroscoe/fix/launcher-set-default-role…

    …-api
    
    Use role API when setting the default launcher
    bryanroscoe authored May 8, 2026
    Configuration menu
    Copy the full SHA
    c9c7b3d View commit details
    Browse the repository at this point in the history
  14. Add defunct streaming apps and harden launcher set-default

    Adds Funimation, Stadia, Quibi, and the orphaned HBO Now (pre-Max) to
    the Dead/defunct apps section of CommonAppList. All four are confirmed
    dead services (Funimation: Apr 2024, Stadia: Jan 2023, Quibi: Dec 2020,
    HBO Now: rolled into com.wbd.stream). DefaultOptimize=Y for all so the
    optimize wizard will surface them by default.
    
    Also reworks Set-DefaultLauncher and friends after a real-device repro
    where both the role API and the legacy set-home-activity command
    failed silently on a Shield running Android 11:
    
    - Get-HomeRoleHolder rejects empty/error/usage strings instead of
      greedily matching any identifier-shaped substring.
    - Set-HomeRoleHolder verifies success by reading the role holder back
      rather than trusting the cmd's stdout (some Shield builds silently
      no-op).
    - Set-DefaultLauncher tries: role API → cmd package set-home-activity
      --user 0 → pm set-home-activity --user 0 (with both the dumpsys-
      discovered activity and common-name fallbacks) → HOME-intent kick
      (when other launchers are disabled, system auto-picks the only one
      left). Each attempt is verified by re-querying the active launcher.
    - $Script:LastSetHomeError captures the underlying ADB response so
      Setup-Launcher's WARNING can show *why* it failed instead of a
      generic "manual selection" string.
    bryanroscoe committed May 8, 2026
    Configuration menu
    Copy the full SHA
    9298672 View commit details
    Browse the repository at this point in the history
  15. Force-enable launcher and use query-activities for HOME discovery

    Real-device debug session on a Shield (Android 11) revealed three
    distinct reasons the wizard couldn't set the default launcher:
    
    1. `cmd role` is not supported on the Shield's customized Android 11
       build — it returns "Unknown command: get-role-holders". The previous
       regex matched "Exception|Error|denied|Usage:" but not this phrase,
       so the role API was treated as a transient failure rather than
       universally unavailable.
    2. The chosen launcher was disabled before the wizard ran (a previous
       session disabled it). `set-home-activity` won't promote a disabled
       package to default on every build.
    3. Projectivy's HOME activity is `.ui.home.MainActivity` — deeply
       nested, not at the package root. The dumpsys-based parser missed it
       entirely, falling through to common-name guesses (`.MainActivity`
       etc.) which don't match.
    
    Fixes:
    
    - `Set-DefaultLauncher` now runs `pm enable <pkg>` first, which is a
      no-op for already-enabled packages and unblocks the disabled case.
    - `Get-LauncherActivity` uses
      `cmd package query-activities --components -a android.intent.action.MAIN
      -c android.intent.category.HOME`, which returns the components
      directly in `<pkg>/<activity>` form — verified to find Projectivy's
      `.ui.home.MainActivity` correctly. Dumpsys parser kept as a fallback
      for older Androids.
    - `Get-HomeRoleHolder` and `Set-HomeRoleHolder` recognize
      "Unknown command" and short-circuit, skipping the verification
      round-trip.
    - Each set attempt now uses `--user 0` explicitly and is verified by
      re-resolving the active HOME activity.
    
    End-to-end tested against the user's Shield at 192.168.42.71:
    Set-DefaultLauncher returned True, Projectivy retained as default.
    bryanroscoe committed May 8, 2026
    Configuration menu
    Copy the full SHA
    fec1bf1 View commit details
    Browse the repository at this point in the history
  16. Add Tweaks menu, Display diagnostics, Snapshot/Restore

    Three feature additions in one shot, building on the Set-DefaultLauncher
    fix earlier in this branch.
    
    Tweaks (new device action menu item, shortcut K)
    - New Set-DisplayInputTuning sub-menu shows current values for HDMI-CEC
      (master, auto-wake, auto-off, audio routing), match_content_frame_rate,
      and long_press_timeout, then lets the user toggle each independently.
    - Set-BoolSetting helper centralizes the ON/OFF/Reset/Cancel pattern.
    - Verified the namespace + key choices against a real Shield: hdmi_*
      keys live in `global`, match_content_frame_rate and long_press_timeout
      live in `secure`.
    
    Display diagnostics (added to Run-Report)
    - New Get-DisplayMode parses `dumpsys display` to extract active mode's
      resolution + refresh rate (matched by id from supportedModes table),
      decodes HdrCapabilities mSupportedHdrTypes (1=Dolby Vision, 2=HDR10,
      3=HLG, 4=HDR10+), and pulls audio output device from `dumpsys audio`.
    - Health Report now shows "Display: 3840x2160 / 59.94 Hz / HDR10 / HDMI"
      so users can confirm their TV is actually negotiating 4K@60 instead
      of falling back to 1080p — the most common silent-misconfiguration
      question on Android TV setups.
    
    Snapshot / Restore (new device action menu item, shortcut N)
    - Save-Snapshot captures: full disabled-package list, current launcher,
      and the Tweaks-relevant settings keys (animation triple, HDMI-CEC,
      match_content_frame_rate, long_press_timeout). Writes JSON to
      ./snapshots/<safe-name>_<timestamp>.json.
    - Apply-Snapshot lists existing snapshots, shows what each will do,
      re-disables packages that are currently enabled (skipping missing
      and already-disabled), runs Set-DefaultLauncher with the saved
      launcher, and writes the recorded settings back. Never re-enables a
      package that's currently enabled — that would undo the user's work.
    - Show-SnapshotMenu sub-menu wires Save / Apply / open-folder.
    - Survives factory resets and major OTAs: re-apply after fresh setup
      to get back to your tuned state.
    
    Verified against the user's authorized Shield (192.168.42.71):
    - Get-DisplayMode returns "3840x2160 / 59.94 Hz / HDR10 / HDMI"
    - Snapshot-source queries enumerate 23 disabled packages, current
      launcher, and the captured setting keys correctly.
    bryanroscoe committed May 8, 2026
    Configuration menu
    Copy the full SHA
    0f481cf View commit details
    Browse the repository at this point in the history
  17. Merge pull request #18 from bryanroscoe/feat/cleanup-and-features

    Defunct apps, robust launcher set-default, Tweaks menu, Display diagnostics, Snapshot/Restore
    bryanroscoe authored May 8, 2026
    Configuration menu
    Copy the full SHA
    a046bc5 View commit details
    Browse the repository at this point in the history
Loading