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

Commit b45a730e authored by Craig Mautner's avatar Craig Mautner Committed by Android (Google) Code Review
Browse files

Merge changes I88865c02,I34cc1310 into lmp-preview-dev

* changes:
  Check for null DO NOT MERGE
  Improve DocCentric documentation. DO NOT MERGE
parents 8aa29921 1f74bad9
Loading
Loading
Loading
Loading
+21 −26
Original line number Original line Diff line number Diff line
@@ -3739,32 +3739,27 @@ public class Intent implements Parcelable, Cloneable {
     */
     */
    public static final int FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET = 0x00080000;
    public static final int FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET = 0x00080000;
    /**
    /**
     * This flag is used to break out "documents" into separate tasks that can
     * This flag is used to open a document into a new task rooted at the activity launched
     * be reached via the Recents mechanism. Such a document is any kind of
     * by this Intent. Through the use of this flag, or its equivalent attribute,
     * item for which an application may want to maintain multiple simultaneous
     * {@link android.R.attr#documentLaunchMode} multiple instances of the same activity
     * instances. Examples might be text files, web pages, spreadsheets, or
     * containing different douments will appear in the recent tasks list.
     * emails. Each such document will be in a separate task in the Recents list.
     *
     *
     * <p>The use of the activity attribute form of this,
     * <p>When set, the activity specified by this Intent will launch into a
     * {@link android.R.attr#documentLaunchMode}, is
     * separate task rooted at that activity. The activity launched must be
     * preferred over the Intent flag described here. The attribute form allows the
     * defined with {@link android.R.attr#launchMode} <code>standard</code>
     * Activity to specify multiple document behavior for all launchers of the Activity
     * or <code>singleTop</code>.
     * whereas using this flag requires each Intent that launches the Activity to specify it.
     *
     *
     * <p>If FLAG_ACTIVITY_NEW_DOCUMENT is used without
     * <p>FLAG_ACTIVITY_NEW_DOCUMENT may be used in conjunction with {@link
     * {@link #FLAG_ACTIVITY_MULTIPLE_TASK} then the activity manager will
     * #FLAG_ACTIVITY_MULTIPLE_TASK}. When used alone it is the
     * search for an existing task with a matching target activity and Intent
     * equivalent of the Activity manifest specifying {@link
     * data URI and relaunch that task, first finishing all activities down to
     * android.R.attr#documentLaunchMode}="intoExisting". When used with
     * the root activity and then calling the root activity's
     * FLAG_ACTIVITY_MULTIPLE_TASK it is the equivalent of the Activity manifest specifying
     * {@link android.app.Activity#onNewIntent(Intent)} method. If no existing
     * {@link android.R.attr#documentLaunchMode}="always".
     * task's root activity matches the Intent's data URI then a new task will
     *
     * be launched with the target activity as root.
     * Refer to {@link android.R.attr#documentLaunchMode} for more information.
     *
     *
     * <p>When paired with {@link #FLAG_ACTIVITY_MULTIPLE_TASK} this will
     * @see android.R.attr#documentLaunchMode
     * always create a new task. Thus the same document may be made to appear
     * more than one time in Recents.
     *
     * <p>This is equivalent to the attribute {@link android.R.attr#documentLaunchMode}.
     *
     * @see #FLAG_ACTIVITY_MULTIPLE_TASK
     * @see #FLAG_ACTIVITY_MULTIPLE_TASK
     */
     */
    public static final int FLAG_ACTIVITY_NEW_DOCUMENT =
    public static final int FLAG_ACTIVITY_NEW_DOCUMENT =
+36 −20
Original line number Original line Diff line number Diff line
@@ -885,41 +885,57 @@
         be passed a persistable Bundle in their Intent.extras. -->
         be passed a persistable Bundle in their Intent.extras. -->
    <attr name="persistable" format="boolean" />
    <attr name="persistable" format="boolean" />


    <!-- Specify whether this activity should always be launched in doc-centric mode. For
    <!-- This attribute specifies that an activity shall become the root activity of a
         values other than <code>none</code> the activity must be defined with
         new task each time it is launched. Using this attribute permits the user to
         have multiple documents from the same applications appear in the recent tasks list.

         <p>Such a document is any kind of item for which an application may want to
         maintain multiple simultaneous instances. Examples might be text files, web
         pages, spreadsheets, or emails. Each such document will be in a separate
         task in the recent taskss list.

         <p>This attribute is equivalent to adding the flag {@link
         android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT} to every Intent used to launch
         the activity.

         <p>The documentLaunchMode attribute may be assigned one of three values, "none",
         "intoExisting" and "always", described in detail below. For values other than
         <code>none</code> the activity must be defined with
         {@link android.R.attr#launchMode} <code>standard</code> or <code>singleTop</code>.
         {@link android.R.attr#launchMode} <code>standard</code> or <code>singleTop</code>.
         This attribute can be overridden by {@link
         If this attribute is not specified, <code>none</code> will be used.
         android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT}.
         Note that <code>none</code> can be overridden at run time if the Intent used

         to launch it contains the flag {@link android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT}.
         <p>If this attribute is not specified, <code>none</code> will be used.
         Similarly <code>intoExisting</code> will be overridden by the flag
         Note that this launch behavior can be changed in some ways at runtime
         {@link android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT} combined with
         through the {@link android.content.Intent} flags
         {@link android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK}. -->
         {@link android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT}. -->
    <attr name="documentLaunchMode">
    <attr name="documentLaunchMode">
        <!-- The default mode, which will create a new task only when
        <!-- The default mode, which will create a new task only when
             {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK
             {@link android.content.Intent#FLAG_ACTIVITY_NEW_TASK
             Intent.FLAG_ACTIVITY_NEW_TASK} is set. -->
             Intent.FLAG_ACTIVITY_NEW_TASK} is set. -->
        <enum name="none" value="0" />
        <enum name="none" value="0" />
        <!-- All tasks will be searched for a matching Intent. If one is found
        <!-- All tasks will be searched for one whose base Intent's ComponentName and
             That task will cleared and restarted with the root activity receiving a call
             data URI match those of the launching Intent. If such a task is found
             that task will be cleared and restarted with the root activity receiving a call
             to {@link android.app.Activity#onNewIntent Activity.onNewIntent}. If no
             to {@link android.app.Activity#onNewIntent Activity.onNewIntent}. If no
             such task is found a new task will be created.
             such task is found a new task will be created.
             This is the equivalent of with {@link
             <p>This is the equivalent of launching an activity with {@link
             android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT Intent.FLAG_ACTIVITY_NEW_DOCUMENT}
             android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT Intent.FLAG_ACTIVITY_NEW_DOCUMENT}
             without {@link android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK
             set and without {@link android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK
             Intent.FLAG_ACTIVITY_MULTIPLE_TASK}. -->
             Intent.FLAG_ACTIVITY_MULTIPLE_TASK} set. -->
        <enum name="intoExisting" value="1" />
        <enum name="intoExisting" value="1" />
        <!-- A new task rooted at this activity will be created.
        <!-- A new task rooted at this activity will be created. This will happen whether or
             This is the equivalent of with {@link
             not there is an existing task whose ComponentName and data URI match
             that of the launcing intent This is the equivalent of launching an activity
             with {@link
             android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT Intent.FLAG_ACTIVITY_NEW_DOCUMENT}
             android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT Intent.FLAG_ACTIVITY_NEW_DOCUMENT}
             paired with {@link android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK
             and {@link android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK
             Intent.FLAG_ACTIVITY_MULTIPLE_TASK}. -->
             Intent.FLAG_ACTIVITY_MULTIPLE_TASK} both set. -->
        <enum name="always" value="2" />
        <enum name="always" value="2" />
    </attr>
    </attr>


    <!-- Tasks launched by activities with this attribute will remain in the recent task
    <!-- Tasks launched by activities with this attribute will remain in the recent tasks
         list until the last activity in the task is completed. When that happens the task
         list until the last activity in the task is completed. When that happens the task
         will be automatically removed from the recent task list.
         will be automatically removed from the recent tasks list.


         This attribute is the equivalent of {@link
         This attribute is the equivalent of {@link
         android.content.Intent#FLAG_ACTIVITY_AUTO_REMOVE_FROM_RECENTS
         android.content.Intent#FLAG_ACTIVITY_AUTO_REMOVE_FROM_RECENTS
+4 −3
Original line number Original line Diff line number Diff line
@@ -3189,6 +3189,7 @@ public class WindowManagerService extends IWindowManager.Stub
            WindowState win = atoken.findMainWindow();
            WindowState win = atoken.findMainWindow();
            Rect containingFrame = new Rect(0, 0, width, height);
            Rect containingFrame = new Rect(0, 0, width, height);
            Rect contentInsets = new Rect();
            Rect contentInsets = new Rect();
            boolean isFullScreen = true;
            if (win != null) {
            if (win != null) {
                if (win.mContainingFrame != null) {
                if (win.mContainingFrame != null) {
                    containingFrame.set(win.mContainingFrame);
                    containingFrame.set(win.mContainingFrame);
@@ -3196,11 +3197,11 @@ public class WindowManagerService extends IWindowManager.Stub
                if (win.mContentInsets != null) {
                if (win.mContentInsets != null) {
                    contentInsets.set(win.mContentInsets);
                    contentInsets.set(win.mContentInsets);
                }
                }
                isFullScreen =
                        ((win.mSystemUiVisibility & SYSTEM_UI_FLAGS_LAYOUT_STABLE_FULLSCREEN) ==
                                SYSTEM_UI_FLAGS_LAYOUT_STABLE_FULLSCREEN);
            }
            }


            boolean isFullScreen =
                    ((win.mSystemUiVisibility & SYSTEM_UI_FLAGS_LAYOUT_STABLE_FULLSCREEN)
                            == SYSTEM_UI_FLAGS_LAYOUT_STABLE_FULLSCREEN);
            Animation a = mAppTransition.loadAnimation(lp, transit, enter, width, height,
            Animation a = mAppTransition.loadAnimation(lp, transit, enter, width, height,
                    mCurConfiguration.orientation, containingFrame, contentInsets, isFullScreen);
                    mCurConfiguration.orientation, containingFrame, contentInsets, isFullScreen);
            if (a != null) {
            if (a != null) {