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

Commit 195a2c99 authored by Christopher Tate's avatar Christopher Tate
Browse files

Don't drop carrier app cache unnecessarily

Don't rebuild the carrier-app or system-bundled app set caches in
AppStandbyController in response to component enable/disable state
changes: they can only change when whole-package state changes occur.

Bug: 175071071
Bug: 155570933
Test: boot & run normally, swap SIM, etc.
Change-Id: I345d339a211b601e5f65eb35fa66390a4a582964
parent b3bf04dc
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -1770,9 +1770,18 @@ public class AppStandbyController
            final int userId = getSendingUserId();
            if (Intent.ACTION_PACKAGE_ADDED.equals(action)
                    || Intent.ACTION_PACKAGE_CHANGED.equals(action)) {
                final String[] cmpList = intent.getStringArrayExtra(
                        Intent.EXTRA_CHANGED_COMPONENT_NAME_LIST);
                // If this is PACKAGE_ADDED (cmpList == null), or if it's a whole-package
                // enable/disable event (cmpList is just the package name itself), drop
                // our carrier privileged app & system-app caches and let them refresh
                if (cmpList == null
                        || (cmpList.length == 1 && pkgName.equals(cmpList[0]))) {
                    clearCarrierPrivilegedApps();
                // ACTION_PACKAGE_ADDED is called even for system app downgrades.
                    evaluateSystemAppException(pkgName, userId);
                }
                // component-level enable/disable can affect bucketing, so we always
                // reevaluate that for any PACKAGE_CHANGED
                mHandler.obtainMessage(MSG_CHECK_PACKAGE_IDLE_STATE, userId, -1, pkgName)
                    .sendToTarget();
            }