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

Commit fe3f81eb authored by Song Hu's avatar Song Hu
Browse files

In getMatchingShareTargets, add callerLauncher to fetch sharesheet marked pin info.

Bug: 210453009
Test: test on the local phone
Change-Id: I8872cdd2917580ff86dcf7a2d7a40a445fbd70b3
(cherry picked from commit 520e7d40)
Merged-In: I8872cdd2917580ff86dcf7a2d7a40a445fbd70b3
parent ec56afe3
Loading
Loading
Loading
Loading
+5 −1
Original line number Original line Diff line number Diff line
@@ -894,8 +894,12 @@ class ShortcutPackage extends ShortcutPackageItem {


        // Get the list of all dynamic shortcuts in this package.
        // Get the list of all dynamic shortcuts in this package.
        final ArrayList<ShortcutInfo> shortcuts = new ArrayList<>();
        final ArrayList<ShortcutInfo> shortcuts = new ArrayList<>();
        // Pass callingLauncher to ensure pinned flag marked by system ui, e.g. ShareSheet, are
        // included in the result
        findAll(shortcuts, ShortcutInfo::isNonManifestVisible,
        findAll(shortcuts, ShortcutInfo::isNonManifestVisible,
                ShortcutInfo.CLONE_REMOVE_FOR_APP_PREDICTION);
                ShortcutInfo.CLONE_REMOVE_FOR_APP_PREDICTION,
                mShortcutUser.mService.mContext.getPackageName(),
                0, /*getPinnedByAnyLauncher=*/ false);


        final List<ShortcutManager.ShareShortcutInfo> result = new ArrayList<>();
        final List<ShortcutManager.ShareShortcutInfo> result = new ArrayList<>();
        for (int i = 0; i < shortcuts.size(); i++) {
        for (int i = 0; i < shortcuts.size(); i++) {
+6 −0
Original line number Original line Diff line number Diff line
@@ -266,6 +266,11 @@ public abstract class BaseShortcutManagerTest extends InstrumentationTestCase {
        public void sendIntentSender(IntentSender intent) {
        public void sendIntentSender(IntentSender intent) {
            // Placeholder for spying.
            // Placeholder for spying.
        }
        }

        @Override
        public String getPackageName() {
            return SYSTEM_PACKAGE_NAME;
        }
    }
    }


    /** ShortcutService with injection override methods. */
    /** ShortcutService with injection override methods. */
@@ -704,6 +709,7 @@ public abstract class BaseShortcutManagerTest extends InstrumentationTestCase {


    protected UriPermissionOwner mUriPermissionOwner;
    protected UriPermissionOwner mUriPermissionOwner;


    protected static final String SYSTEM_PACKAGE_NAME = "android";


    protected static final String CALLING_PACKAGE_1 = "com.android.test.1";
    protected static final String CALLING_PACKAGE_1 = "com.android.test.1";
    protected static final int CALLING_UID_1 = 10001;
    protected static final int CALLING_UID_1 = 10001;