Expand uninstallForAll to Admins

Currently, user 0 can uninstall other users' apps. It really has that
ability by virtue of it being an Admin user. But non-user-0 Admins don't
currently have this ability, so we expand that here. This also allows
this ability on HSUM, where human Admin users aren't user 0.

Bug: 384514936
Test: manual confirmation that overflow appears on HSUM device
Test: atest SettingsSpaUnitTests:com.android.settings.spa.app.appinfo.AppInfoSettingsMoreOptionsTest
Flag: EXEMPT bugfix
Change-Id: I976bb63ecced3c128f8109c63c85067f4a0cdf9b
This commit is contained in:
Adam Bookatz
2024-12-16 10:48:31 -08:00
parent b345f4b006
commit 49d3e34810
3 changed files with 22 additions and 2 deletions

View File

@@ -572,7 +572,7 @@ public class AppInfoDashboardFragment extends DashboardFragment
showIt = false;
} else if (mPackageInfo == null || mDpm.packageHasActiveAdmins(mPackageInfo.packageName)) {
showIt = false;
} else if (UserHandle.myUserId() != 0) {
} else if (!mUserManager.isAdminUser()) {
showIt = false;
} else if (mUserManager.getUsers().size() < 2) {
showIt = false;