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

Commit 36cbfa69 authored by Pinyao Ting's avatar Pinyao Ting
Browse files

Include logging to analyze package broacast handling

Bug: 336787184
Flag: NONE
Test: manual
Change-Id: Ib39c34820e25e5e761f1bc840c1fb1018d33f501
parent e726406a
Loading
Loading
Loading
Loading
+14 −2
Original line number Diff line number Diff line
@@ -174,7 +174,7 @@ public class ShortcutService extends IShortcutService.Stub {
    static final boolean DEBUG = false; // STOPSHIP if true
    static final boolean DEBUG_LOAD = false; // STOPSHIP if true
    static final boolean DEBUG_PROCSTATE = false; // STOPSHIP if true
    static final boolean DEBUG_REBOOT = false; // STOPSHIP if true
    static final boolean DEBUG_REBOOT = true;

    @VisibleForTesting
    static final long DEFAULT_RESET_INTERVAL_SEC = 24 * 60 * 60; // 1 day
@@ -3783,24 +3783,36 @@ public class ShortcutService extends IShortcutService.Stub {
                final boolean replacing = intent.getBooleanExtra(Intent.EXTRA_REPLACING, false);
                final boolean archival = intent.getBooleanExtra(Intent.EXTRA_ARCHIVAL, false);

                Slog.d(TAG, "received package broadcast intent: " + intent);
                switch (action) {
                    case Intent.ACTION_PACKAGE_ADDED:
                        if (replacing) {
                            Slog.d(TAG, "replacing package: " + packageName + " userId" + userId);
                            handlePackageUpdateFinished(packageName, userId);
                        } else {
                            Slog.d(TAG, "adding package: " + packageName + " userId" + userId);
                            handlePackageAdded(packageName, userId);
                        }
                        break;
                    case Intent.ACTION_PACKAGE_REMOVED:
                        if (!replacing || (replacing && archival)) {
                            if (!replacing) {
                                Slog.d(TAG, "removing package: "
                                        + packageName + " userId" + userId);
                            } else if (archival) {
                                Slog.d(TAG, "archiving package: "
                                        + packageName + " userId" + userId);
                            }
                            handlePackageRemoved(packageName, userId);
                        }
                        break;
                    case Intent.ACTION_PACKAGE_CHANGED:
                        Slog.d(TAG, "changing package: " + packageName + " userId" + userId);
                        handlePackageChanged(packageName, userId);

                        break;
                    case Intent.ACTION_PACKAGE_DATA_CLEARED:
                        Slog.d(TAG, "clearing data for package: "
                                + packageName + " userId" + userId);
                        handlePackageDataCleared(packageName, userId);
                        break;
                }