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

Commit b9137796 authored by Mady Mellor's avatar Mady Mellor Committed by Android (Google) Code Review
Browse files

Merge "Bubble API: intent extra for bubbled activities" into sc-dev

parents 06bdb473 1ecb1ccb
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -10980,6 +10980,7 @@ package android.content {
    field public static final String EXTRA_INITIAL_INTENTS = "android.intent.extra.INITIAL_INTENTS";
    field public static final String EXTRA_INSTALLER_PACKAGE_NAME = "android.intent.extra.INSTALLER_PACKAGE_NAME";
    field public static final String EXTRA_INTENT = "android.intent.extra.INTENT";
    field public static final String EXTRA_IS_BUBBLED = "android.intent.extra.IS_BUBBLED";
    field public static final String EXTRA_KEY_EVENT = "android.intent.extra.KEY_EVENT";
    field public static final String EXTRA_LOCAL_ONLY = "android.intent.extra.LOCAL_ONLY";
    field public static final String EXTRA_LOCUS_ID = "android.intent.extra.LOCUS_ID";
+18 −0
Original line number Diff line number Diff line
@@ -9972,6 +9972,15 @@ public class Notification implements Parcelable
             * <p>The shortcut activity will be used when the bubble is expanded. This will display
             * the shortcut activity in a floating window over the existing foreground activity.</p>
             *
             * <p>When the shortcut is displayed in a bubble, there will be an intent
             * extra set on the activity, {@link Intent#EXTRA_IS_BUBBLED}
             * with {@code true}. You may check this in the onCreate of your activity via:
             *
             * <pre class="prettyprint">
             * boolean isBubbled = getIntent().getBooleanExtra(Intent.EXTRA_IS_BUBBLED, false);
             * </pre>
             * </p>
             *
             * <p>If the shortcut has not been published when the bubble notification is sent,
             * no bubble will be produced. If the shortcut is deleted while the bubble is active,
             * the bubble will be removed.</p>
@@ -10000,6 +10009,15 @@ public class Notification implements Parcelable
             * app content in a floating window over the existing foreground activity. The intent
             * should point to a resizable activity. </p>
             *
             * <p>When the activity is displayed in a bubble, there will be an intent
             * extra set on the activity, {@link Intent#EXTRA_IS_BUBBLED}
             * with {@code true}. You may check this in the onCreate of your activity via:
             *
             * <pre class="prettyprint">
             * boolean isBubbled = getIntent().getBooleanExtra(Intent.EXTRA_IS_BUBBLED, false);
             * </pre>
             * </p>
             *
             * @throws NullPointerException if intent is null.
             * @throws NullPointerException if icon is null.
             */
+11 −1
Original line number Diff line number Diff line
@@ -6062,6 +6062,16 @@ public class Intent implements Parcelable, Cloneable {
     */
    public static final String EXTRA_UNSTARTABLE_REASON = "android.intent.extra.UNSTARTABLE_REASON";

    /**
     * A boolean extra indicating whether an activity is bubbled. Set on the shortcut or
     * pending intent provided for the bubble. If the extra is not present or false, then it is not
     * bubbled.
     *
     * @see android.app.Notification.Builder#setBubbleMetadata(Notification.BubbleMetadata)
     * @see android.app.Notification.BubbleMetadata.Builder#Builder(String)
     */
    public static final String EXTRA_IS_BUBBLED = "android.intent.extra.IS_BUBBLED";

    // ---------------------------------------------------------------------
    // ---------------------------------------------------------------------
    // Intent flags (see mFlags variable).
+1 −0
Original line number Diff line number Diff line
@@ -163,6 +163,7 @@ public class BubbleExpandedView extends LinearLayout {
                        // Apply flags to make behaviour match documentLaunchMode=always.
                        fillInIntent.addFlags(FLAG_ACTIVITY_NEW_DOCUMENT);
                        fillInIntent.addFlags(FLAG_ACTIVITY_MULTIPLE_TASK);
                        fillInIntent.putExtra(Intent.EXTRA_IS_BUBBLED, true);
                        if (mBubble != null) {
                            mBubble.setIntentActive();
                        }
+1 −0
Original line number Diff line number Diff line
@@ -929,6 +929,7 @@ public class LauncherAppsService extends SystemService {
                // Flag for bubble to make behaviour match documentLaunchMode=always.
                intents[0].addFlags(FLAG_ACTIVITY_NEW_DOCUMENT);
                intents[0].addFlags(FLAG_ACTIVITY_MULTIPLE_TASK);
                intents[0].putExtra(Intent.EXTRA_IS_BUBBLED, true);
            }

            intents[0].addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);