Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5ab2ffc authored by Nicolas Prevot's avatar Nicolas Prevot
Browse files

Keep intent verification status of system apps when uninstalling them.

When creating a work profile, system apps are uninstalled and then
sometimes reinstalled.
In the process, they lose their intent verification status.

BUG:22943461
Change-Id:I5b008c6de2125f190063b08908076a649067c60d
parent 375c792c
Loading
Loading
Loading
Loading
+3 −2
Original line number Original line Diff line number Diff line
@@ -13054,7 +13054,8 @@ public class PackageManagerService extends IPackageManager.Stub {
                // they have set the special DELETE_SYSTEM_APP which requests different
                // they have set the special DELETE_SYSTEM_APP which requests different
                // semantics than normal for uninstalling system apps.
                // semantics than normal for uninstalling system apps.
                if (DEBUG_REMOVE) Slog.d(TAG, "Only deleting for single user");
                if (DEBUG_REMOVE) Slog.d(TAG, "Only deleting for single user");
                ps.setUserState(user.getIdentifier(),
                final int userId = user.getIdentifier();
                ps.setUserState(userId,
                        COMPONENT_ENABLED_STATE_DEFAULT,
                        COMPONENT_ENABLED_STATE_DEFAULT,
                        false, //installed
                        false, //installed
                        true,  //stopped
                        true,  //stopped
@@ -13062,7 +13063,7 @@ public class PackageManagerService extends IPackageManager.Stub {
                        false, //hidden
                        false, //hidden
                        null, null, null,
                        null, null, null,
                        false, // blockUninstall
                        false, // blockUninstall
                        INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED, 0);
                        ps.readUserState(userId).domainVerificationStatus, 0);
                if (!isSystemApp(ps)) {
                if (!isSystemApp(ps)) {
                    if (ps.isAnyInstalled(sUserManager.getUserIds())) {
                    if (ps.isAnyInstalled(sUserManager.getUserIds())) {
                        // Other user still have this package installed, so all
                        // Other user still have this package installed, so all