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

Commit fb56e4ac authored by Varun Shah's avatar Varun Shah
Browse files

Fix incorrect message being sent for all intents.

Only send the CHECK_PACKAGE_IDLE_STATE message for
ACTION_PACKAGE_CHANGED and not for ACTION_PACKAGE_ADDED.

Bug: 214580000
Test: atest UsageStatsDatabaseTest
Test: manually verify buckets are restored
Change-Id: Iac1433b9b7e3904eb7f753cd0617ac64ab6f7944
(cherry picked from commit 69f86a64)
parent 5bd31e03
Loading
Loading
Loading
Loading
+4 −2
Original line number Original line Diff line number Diff line
@@ -2116,9 +2116,11 @@ public class AppStandbyController
                }
                }
                // component-level enable/disable can affect bucketing, so we always
                // component-level enable/disable can affect bucketing, so we always
                // reevaluate that for any PACKAGE_CHANGED
                // reevaluate that for any PACKAGE_CHANGED
                if (Intent.ACTION_PACKAGE_CHANGED.equals(action)) {
                    mHandler.obtainMessage(MSG_CHECK_PACKAGE_IDLE_STATE, userId, -1, pkgName)
                    mHandler.obtainMessage(MSG_CHECK_PACKAGE_IDLE_STATE, userId, -1, pkgName)
                            .sendToTarget();
                            .sendToTarget();
                }
                }
            }
            if ((Intent.ACTION_PACKAGE_REMOVED.equals(action) ||
            if ((Intent.ACTION_PACKAGE_REMOVED.equals(action) ||
                    Intent.ACTION_PACKAGE_ADDED.equals(action))) {
                    Intent.ACTION_PACKAGE_ADDED.equals(action))) {
                if (intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) {
                if (intent.getBooleanExtra(Intent.EXTRA_REPLACING, false)) {