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

Commit f7346fc3 authored by Pinyao Ting's avatar Pinyao Ting Committed by Automerger Merge Worker
Browse files

Merge "Restrict number of shortcuts can be added through addDynamicShortcuts"...

Merge "Restrict number of shortcuts can be added through addDynamicShortcuts" into sc-dev am: 110f1d8b am: ab7d63a7 am: fb370205 am: ebab9abb am: 74d48a21 am: 229d5594 am: 19e4d074

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/23623415



Change-Id: Ifae14d778073a6624afdbebbf6ef76d92cdfb9ed
Signed-off-by: default avatarAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
parents eb004b86 19e4d074
Loading
Loading
Loading
Loading
+1 −1
Original line number Original line Diff line number Diff line
@@ -372,6 +372,7 @@ class ShortcutPackage extends ShortcutPackageItem {
        // Extract Icon and update the icon res ID and the bitmap path.
        // Extract Icon and update the icon res ID and the bitmap path.
        s.saveIconAndFixUpShortcutLocked(this, newShortcut);
        s.saveIconAndFixUpShortcutLocked(this, newShortcut);
        s.fixUpShortcutResourceNamesAndValues(newShortcut);
        s.fixUpShortcutResourceNamesAndValues(newShortcut);
        ensureShortcutCountBeforePush();
        saveShortcut(newShortcut);
        saveShortcut(newShortcut);
    }
    }


@@ -426,7 +427,6 @@ class ShortcutPackage extends ShortcutPackageItem {
            @NonNull List<ShortcutInfo> changedShortcuts) {
            @NonNull List<ShortcutInfo> changedShortcuts) {
        Preconditions.checkArgument(newShortcut.isEnabled(),
        Preconditions.checkArgument(newShortcut.isEnabled(),
                "pushDynamicShortcuts() cannot publish disabled shortcuts");
                "pushDynamicShortcuts() cannot publish disabled shortcuts");
        ensureShortcutCountBeforePush();


        newShortcut.addFlags(ShortcutInfo.FLAG_DYNAMIC);
        newShortcut.addFlags(ShortcutInfo.FLAG_DYNAMIC);