Fix package management and user targeting on HSUM

- Use --user current for pm install, adb install, and appops set across
  install_script, adb_pm_install, and test/setup scripts.
- Skip headless user 0 in get_users() on HSUM devices.
- Use --user current in app_notify for non-app UIDs instead of calling
  content call against all users.
- Clear path buffer on each iteration in setup_magisk_env.
- Use --user current for am instrument in app migration tests.

Assisted-by: Gemini 4 Argon
This commit is contained in:
topjohnwu
2026-10-22 14:06:48 -07:00
committed by John Wu
parent c275a4ea30
commit ea16c8141e
9 changed files with 30 additions and 25 deletions
+3 -2
View File
@@ -123,11 +123,12 @@ adb_pm_install() {
local tmp=/data/local/tmp/temp.apk
cp -f "$1" $tmp
chmod 644 $tmp
su 2000 -c pm install -g $tmp || pm install -g $tmp || su 1000 -c pm install -g $tmp
local cmd="pm install --user current -g $tmp"
su 2000 -c $cmd || $cmd || su 1000 -c $cmd
local res=$?
rm -f $tmp
if [ $res = 0 ]; then
appops set "$2" REQUEST_INSTALL_PACKAGES allow
appops set --user current "$2" REQUEST_INSTALL_PACKAGES allow
fi
return $res
}