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

Commit aec62ad8 authored by Automerger Merge Worker's avatar Automerger Merge Worker Committed by Android (Google) Code Review
Browse files

Merge "Merge "Set shortcut info even if metadata doesn't have shortcut id"...

Merge "Merge "Set shortcut info even if metadata doesn't have shortcut id" into rvc-dev am: a5ac201a am: 87ee1802 am: 23c2510f" into rvc-qpr-dev-plus-aosp
parents b5e78021 b2da839e
Loading
Loading
Loading
Loading
+12 −3
Original line number Diff line number Diff line
@@ -71,6 +71,7 @@ class Bubble implements BubbleViewProvider {
    // Items that are typically loaded later
    private String mAppName;
    private ShortcutInfo mShortcutInfo;
    private String mMetadataShortcutId;
    private BadgedImageView mIconView;
    private BubbleExpandedView mExpandedView;

@@ -218,6 +219,14 @@ class Bubble implements BubbleViewProvider {
        return mTitle;
    }

    String getMetadataShortcutId() {
        return mMetadataShortcutId;
    }

    boolean hasMetadataShortcutId() {
        return (mMetadataShortcutId != null && !mMetadataShortcutId.isEmpty());
    }

    /**
     * Call when the views should be removed, ensure this is called to clean up ActivityView
     * content.
@@ -350,9 +359,9 @@ class Bubble implements BubbleViewProvider {
        mAppUid = entry.getSbn().getUid();
        mInstanceId = entry.getSbn().getInstanceId();
        mFlyoutMessage = BubbleViewInfoTask.extractFlyoutMessage(entry);
        mShortcutInfo = (entry.getBubbleMetadata() != null
                && entry.getBubbleMetadata().getShortcutId() != null
                && entry.getRanking() != null) ? entry.getRanking().getShortcutInfo() : null;
        mShortcutInfo = (entry.getRanking() != null ? entry.getRanking().getShortcutInfo() : null);
        mMetadataShortcutId = (entry.getBubbleMetadata() != null
                ? entry.getBubbleMetadata().getShortcutId() : null);
        if (entry.getRanking() != null) {
            mIsVisuallyInterruptive = entry.getRanking().visuallyInterruptive();
        }
+1 −1
Original line number Diff line number Diff line
@@ -77,7 +77,7 @@ internal class BubbleDataRepository @Inject constructor(
            BubbleEntity(
                    userId,
                    b.packageName,
                    b.shortcutInfo?.id ?: return@mapNotNull null,
                    b.metadataShortcutId ?: return@mapNotNull null,
                    b.key,
                    b.rawDesiredHeight,
                    b.rawDesiredHeightResId,
+4 −3
Original line number Diff line number Diff line
@@ -173,7 +173,8 @@ public class BubbleExpandedView extends LinearLayout {
                            return;
                        }
                        try {
                            if (!mIsOverflow && mBubble.getShortcutInfo() != null) {
                            if (!mIsOverflow && mBubble.hasMetadataShortcutId()
                                    && mBubble.getShortcutInfo() != null) {
                                options.setApplyActivityFlagsForBubbles(true);
                                mActivityView.startShortcutActivity(mBubble.getShortcutInfo(),
                                        options, null /* sourceBounds */);
@@ -616,7 +617,7 @@ public class BubbleExpandedView extends LinearLayout {

            if (isNew) {
                mPendingIntent = mBubble.getBubbleIntent();
                if (mPendingIntent != null || mBubble.getShortcutInfo() != null) {
                if (mPendingIntent != null || mBubble.hasMetadataShortcutId()) {
                    setContentVisibility(false);
                    mActivityView.setVisibility(VISIBLE);
                }
@@ -788,7 +789,7 @@ public class BubbleExpandedView extends LinearLayout {
    }

    private boolean usingActivityView() {
        return (mPendingIntent != null || mBubble.getShortcutInfo() != null)
        return (mPendingIntent != null || mBubble.hasMetadataShortcutId())
                && mActivityView != null;
    }