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

Commit aa8b94aa authored by Makoto Onuki's avatar Makoto Onuki
Browse files

Improve ShortcutSrvice

- Delayed save
- Reset logic update

Bug 27548047

Change-Id: Ibd52f90a7986991974301b7ff1f1d8520f9ef0d9
parent 0ee05b3c
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -160,7 +160,8 @@ public class LauncherApps {
         * as defined in {@link #hasShortcutHostPermission()}, will receive it.
         *
         * @param packageName The name of the package that has the shortcuts.
         * @param shortcuts all shortcuts from the package (dynamic and/or pinned).
         * @param shortcuts all shortcuts from the package (dynamic and/or pinned).  Only "key"
         *    information will be provided, as defined in {@link ShortcutInfo#hasKeyFieldsOnly()}.
         * @param user The UserHandle of the profile that generated the change.
         */
        public void onShortcutsChanged(@NonNull String packageName,
+0 −2
Original line number Diff line number Diff line
@@ -46,8 +46,6 @@ import java.lang.annotation.RetentionPolicy;
 *   if necessary, and persisted.
 *
 *   We will disallow byte[] icons, because they can easily go over binder size limit.
 *
 * TODO Move save/load to this class
 */
public class ShortcutInfo implements Parcelable {
    /* @hide */
+2 −2
Original line number Diff line number Diff line
@@ -537,7 +537,7 @@ public class LauncherAppsService extends SystemService {
            }
        }

        void postToPackageMonitor(Runnable r) {
        void postToPackageMonitorHandler(Runnable r) {
            mPackageMonitor.getRegisteredHandler().post(r);
        }

@@ -681,7 +681,7 @@ public class LauncherAppsService extends SystemService {
            @Override
            public void onShortcutChanged(@NonNull String packageName,
                    @UserIdInt int userId) {
                postToPackageMonitor(() -> onShortcutChangedInner(packageName, userId));
                postToPackageMonitorHandler(() -> onShortcutChangedInner(packageName, userId));
            }

            private void onShortcutChangedInner(@NonNull String packageName,
+176 −108

File changed.

Preview size limit exceeded, changes collapsed.

+72 −8

File changed.

Preview size limit exceeded, changes collapsed.