You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 08c0666
Browse filesBrowse the repository at this point in the historyBrowse files
Check other users before removing foreground-user app data. Fail closed when installation ownership cannot be verified, and report retained signing conflicts without attempting broader uninstall.
Copy file name to clipboardExpand all lines: AGENTS.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -105,6 +105,7 @@ Avoid blocking work on latency-sensitive threads, unnecessary polling, duplicate
105
105
-**Measurement tools:** profile build + simpleperf ([docs/PROFILING.md](docs/PROFILING.md)); pin a preset with `adb shell setprop debug.projectmtv.preset '<name prefix>'` and clear it afterwards (`debug.projectmtv.update_from` also exists); `tools/tv-diagnostics.sh <tv-ip>:5555 --sweep` ([docs/DIAGNOSTICS.md](docs/DIAGNOSTICS.md); profile builds require `--package nl.neerdael.projectmtv.profile` with a matching `--apk` or `--no-install`; build/`--release` modes reject alternate package IDs before connecting); Preset Lab for offline rendering comparisons (desktop timings do not establish TV performance).
106
106
-**Documented device coverage:** NVIDIA SHIELD TV 2019 (`sif`, 2 GB, 32-bit) and SHIELD TV Pro 2019 (`mdarcy`, 3 GB), Android 11; Ugoos AM6 (Amlogic S922X, Mali-G52 MP6, Android 9). No emulator configuration is committed.
107
107
- **The notification listener restarts the app after `am force-stop`** (within about a second, verified on the AM6, Android 9, and the AM9 Pro, Android 14): a stop/start is warm, and the process reads `projectm_settings` at that restart. A process that reads the file mid-write saves its migration flags over it. Resolve `am get-current-user` once; use that numeric ID for settings/listener commands, permission grants, installation and `am force-stop`/`am start`. Filter `ps -A -o UID,PID,NAME` by exact process name and `UID / 100000` for that user; `pidof` includes other users. Failed/malformed queries must not mean "no process". Write `/data/user/<userId>/<package>/shared_prefs/projectm_settings.xml`, not user 0's `/data/data` alias. Disallow the listener only if that user enabled it, restore the same user's access, and check `surface=` in its STATS lines ([docs/PROFILING.md](docs/PROFILING.md)); `tv-diagnostics.sh` uses this scope for its cold start and records the user. Command support was checked in Android 9/14 sources; older releases remain unverified.
108
+
-**Diagnostics signing conflicts:**`--allow-uninstall` attempts removal only for the captured Android user. Before removing data, inspect `pm list users` and exact package results from `pm list packages --user <userId>` for every other user, including stopped users; refuse if another user has the package or a query fails/is malformed. Shared or preinstalled package code can retain the incompatible signing key. A retained conflict fails explicitly after the scoped retry; never broaden to all-user uninstall. Use `--no-install` or a matching-key APK instead ([docs/DIAGNOSTICS.md](docs/DIAGNOSTICS.md)).
108
109
-**Measured lessons (ARCHITECTURE §5):** listing ~10k assets took 8.4 s and blocked UI inflation → the worker reads `presets.idx`; GL linking at switches froze the picture 0.5–1.9 s → background prewarm and program caches; tile-based GPUs paid for render-target loads → patches 0009–0016.
|`tools/check-patch-series.sh`| full series applies to a clean export of the submodule's `HEAD` (so the submodule must be at the pinned commit) | Verified: "all 29 patches apply" on `main`; the 32-patch series was verified with the same steps against `e0b0a967`; "all 35 patches apply" on 2026-10-04 with 0033–0035; 37 patches verified after integrating the parser fix for the random-binding task |
195
196
|`tools/projectm-host-tests.sh [--gtest_filter=…]`| patched projectM GTest suite (build in `build/projectm-host`); needs CMake, Ninja, C++ compiler, Homebrew googletest | Verified on macOS: 179/179 on `main`, 204/204 with 0030–0032, 222/222 with 0001–0035 (configured with `-DCMAKE_DISABLE_FIND_PACKAGE_FLEX=ON -DCMAKE_DISABLE_FIND_PACKAGE_BISON=ON` to match the Android build's pre-generated parser) |
|`python3 -m unittest discover -s tools -p test_tv_diagnostics.py -v`| diagnostics package/APK-source options; user-scoped cold start, process filtering and fail-safe queries; isolated fake adb, no TV/build/network | Run by Android CI; see task validation for the current revision |
198
+
|`python3 -m unittest discover -s tools -p test_tv_diagnostics.py -v`| diagnostics package/APK-source options; user-scoped cold start, process filtering, fail-safe queries and signing-conflict recovery; isolated fake adb, no TV/build/network | Run by Android CI; see task validation for the current revision |
198
199
|`core/src/test/native/run_native_tests.sh`| engine tests, GL fade overlay, patched-projectM regressions (ASan/UBSan); needs a C++17 compiler, JDK (`jni.h`), CMake, EGL/GLES dev libs on Linux (macOS uses OpenGL) | Verified on macOS 2026-10-04 (JDK 21): engine tests and projectm-regressions pass; GL fade overlay skipped without EGL/GLES; CI runs all on Linux |
|`./gradlew assembleRelease` / `./gradlew :core:assembleDebug` / `./gradlew assembleProfile`| APK + AAR; patch application through CMake; profile build | CI runs `assembleRelease`; verified 2026-10-04: `:app:assembleProfile :core:assembleRelease`, and `:core:assembleDebug` from a fresh recursive clone (CMake applied the series); a new worktree needs `local.properties` copied from the primary checkout |
Copy file name to clipboardExpand all lines: docs/DIAGNOSTICS.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -22,7 +22,7 @@ The first connection shows an *Allow debugging?* prompt on the TV; accept it wit
22
22
|`--apk PATH`| Installs the supplied APK; its application ID must match `--package` (or the default ID) |
23
23
|`--no-install`| Tests the version that is already installed |
24
24
|`--package ID`| Application ID to test (default `nl.neerdael.projectmtv`). Alternate IDs require a matching `--apk` or `--no-install`; building and `--release` only support the default ID |
25
-
|`--allow-uninstall`|If the installed app has a different signing key, uninstall it first (resets app settings) |
25
+
|`--allow-uninstall`|Attempts signing-key recovery by uninstalling only for the captured Android user (resets that user's app settings); refuses if another user has the same package or that state cannot be verified|
26
26
|`--sweep`| Also measures each fixed resolution (720p, 1080p, …), driving the menu with key events |
27
27
|`--duration SEC`| Observation time (default 180) |
To install a newly built profile APK instead, replace `--no-install` with `--apk app/build/outputs/apk/profile/app-profile.apk`. The script does not inspect supplied APKs to verify their application ID; supply an APK that matches the package being tested. Incompatible build/`--release` and package combinations fail before connecting to the TV, building, downloading or installing anything. If multiple APK-source options are supplied, the last one selects the mode; the package check uses that final mode regardless of option order.
36
36
37
+
On a signing-key conflict, `--allow-uninstall` checks `pm list users` and each other user's `pm list packages --user <userId>` before removing any app data. Another user's installation, including a stopped user's, retains shared package code and its signing key; the script refuses recovery in that case. Failed or malformed queries also stop before uninstalling. Use `--no-install` to measure the existing app or supply an APK signed with its installed key. If Android still retains an incompatible package after an allowed user-scoped uninstall (for example a preinstalled package), the retry fails explicitly; the script never broadens removal to all users.
log "Installed app has a different signing key; uninstalling it (--allow-uninstall)"
200
-
a uninstall --user "$ANDROID_USER""$PKG">/dev/null 2>&1
219
+
OTHER_PACKAGE_USERS="$(other_package_users)"|| die "cannot verify other users' package installations; refusing --allow-uninstall and preserving this user's app data. Use --no-install or an APK with the installed signing key"
220
+
[ -z"$OTHER_PACKAGE_USERS" ] || die "signing conflict: $PKG is installed for another Android user ($OTHER_PACKAGE_USERS). Refusing --allow-uninstall; no app data was removed. Use --no-install or an APK with the installed signing key"
221
+
log "Installed app has a different signing key; uninstalling for Android user $ANDROID_USER (--allow-uninstall)"
222
+
uninstall_result="$(a uninstall --user "$ANDROID_USER""$PKG"2>&1)"|| die "uninstall for Android user $ANDROID_USER failed: $uninstall_result"
223
+
printf'%s\n'"$uninstall_result"| tr -d '\r'| grep -qxF "Success"|| die "uninstall for Android user $ANDROID_USER failed: $uninstall_result"
die "signing conflict remains after removing this user's installation; Android still retains the incompatible package. No broader uninstall will be attempted. Use an APK with the installed signing key"
227
+
fi
202
228
APK_SOURCE="$APK_SOURCE (previous install removed: different signing key)"
203
229
else
204
-
die "installed app is signed with a different key. Re-run with --allow-uninstall (resets app settings) or use --no-install"
230
+
die "installed app is signed with a different key. Use --no-install or a matching-key APK; --allow-uninstall resets this user's settings only when no other user has the app"
205
231
fi
206
232
fi
207
233
printf'%s'"$result"| grep -q "Success"|| die "install failed: $result"
0 commit comments