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

Commit 991a6dff authored by Rohit Goyal's avatar Rohit Goyal Committed by Cherrypicker Worker
Browse files

Bugfix: Allow shortcut and widget services to update shortcuts and widgets...

Bugfix: Allow shortcut and widget services to update shortcuts and widgets across all launchers during archival.

* In case of a package removed event, when delete_keep_data is set and archival is also set, allow shortcut service to remove all the corresponding shortcuts and widgets across all the launcher apps.

Test: verified bugfix locally.
Bug: 326567866
(cherry picked from https://googleplex-android-review.googlesource.com/q/commit:c3ba6cb06cd3fd39bb3e43b3794054590266d990)
Merged-In: I6bdfddb889a80e698e9d62bf32022e4f59b0245a
Change-Id: I6bdfddb889a80e698e9d62bf32022e4f59b0245a
parent f90bbd2c
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -476,8 +476,12 @@ class AppWidgetServiceImpl extends IAppWidgetService.Stub implements WidgetBacku
            } else {
                // If the package is being updated, we'll receive a PACKAGE_ADDED
                // shortly, otherwise it is removed permanently.
                final boolean packageRemovedPermanently = (extras == null
                        || !extras.getBoolean(Intent.EXTRA_REPLACING, false));
                boolean isReplacing = extras != null && extras.getBoolean(Intent.EXTRA_REPLACING,
                        false);
                boolean isArchival = extras != null && extras.getBoolean(Intent.EXTRA_ARCHIVAL,
                        false);
                final boolean packageRemovedPermanently =
                        (extras == null || !isReplacing || (isReplacing && isArchival));

                if (packageRemovedPermanently) {
                    for (String pkgName : pkgList) {
+2 −1
Original line number Diff line number Diff line
@@ -3795,6 +3795,7 @@ public class ShortcutService extends IShortcutService.Stub {
                }

                final boolean replacing = intent.getBooleanExtra(Intent.EXTRA_REPLACING, false);
                final boolean archival = intent.getBooleanExtra(Intent.EXTRA_ARCHIVAL, false);

                switch (action) {
                    case Intent.ACTION_PACKAGE_ADDED:
@@ -3805,7 +3806,7 @@ public class ShortcutService extends IShortcutService.Stub {
                        }
                        break;
                    case Intent.ACTION_PACKAGE_REMOVED:
                        if (!replacing) {
                        if (!replacing || (replacing && archival)) {
                            handlePackageRemoved(packageName, userId);
                        }
                        break;