summaryrefslogtreecommitdiffstats
path: root/core/res
diff options
context:
space:
mode:
authorDianne Hackborn <hackbod@google.com>2014-09-04 22:52:27 -0700
committerDianne Hackborn <hackbod@google.com>2014-09-05 18:43:43 -0700
commita4e102ee580282dc7abeb22f4a025813e53b9431 (patch)
tree879e7632cbe83220696694dbcac3f39e587cd039 /core/res
parentb75dd5cedd5eb83d1f9b86ad4a09a5e6ec3df537 (diff)
downloadframeworks_base-a4e102ee580282dc7abeb22f4a025813e53b9431.zip
frameworks_base-a4e102ee580282dc7abeb22f4a025813e53b9431.tar.gz
frameworks_base-a4e102ee580282dc7abeb22f4a025813e53b9431.tar.bz2
Work on issue #17357238: Recents is often slow if not used in a while
Add a new activity attribute, resumeWhilePausing, that allows an activity specifying it to immediately start running without waiting for the previous activity to pause. The recents activity is updated to use this. The implementation of this is ultimately fairly simple -- if we are in the path of resuming such an activity, and find that we first need to pause the existing activity, then within the activity manager we do the regular pause flow but act like it has immediately finished pausing right then so that we can immediately go on to the resume. To make this clean, we tell the activity when asking it to pause that it should not come back and tell us it is done, because we aren't in any way waiting for it. One potentially important change I needed to make here is the pause callback no longer provides the saved persistent state, because we now can't count on that callback happening. I don't think there was really any utility in this anyway -- all modern apps will have their save state flow happen as part of stopping, not pausing, so we'll only capture that saved state when the stop is reported back anyway. And since we do send the saved state back when stopping, it would always blow away whatever we had gotten at the pause. Finally, update the documentation for AppTask.startActivity(), and fix the implementation handling that to be cleaner -- we need to deal with inTask first before getting in to "oh noes add NEW_TASK if this isn't coming from a calling activity" flow. Change-Id: Ia1da0fac90d7bdbaafdda2e34850d795ce17a39f
Diffstat (limited to 'core/res')
-rw-r--r--core/res/res/values/attrs_manifest.xml12
-rw-r--r--core/res/res/values/public.xml2
2 files changed, 12 insertions, 2 deletions
diff --git a/core/res/res/values/attrs_manifest.xml b/core/res/res/values/attrs_manifest.xml
index e905a3a..10c2518 100644
--- a/core/res/res/values/attrs_manifest.xml
+++ b/core/res/res/values/attrs_manifest.xml
@@ -939,7 +939,7 @@
{@link android.content.Intent#FLAG_ACTIVITY_MULTIPLE_TASK
Intent.FLAG_ACTIVITY_MULTIPLE_TASK}. If the value of
documentLaunchModes is <code>never</code> then any use of
-.........{@link android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT
+ {@link android.content.Intent#FLAG_ACTIVITY_NEW_DOCUMENT
Intent.FLAG_ACTIVITY_NEW_DOCUMENT} to launch this activity will be ignored. -->
<attr name="documentLaunchMode">
<!-- The default mode, which will create a new task only when
@@ -994,6 +994,15 @@
TaskDescription to change labels, colors and icons in the recent task list. -->
<attr name="relinquishTaskIdentity" format="boolean" />
+ <!-- Indicate that it is okay for this activity be resumed while the previous
+ activity is in the process of pausing, without waiting for the previous pause
+ to complete. Use this with caution: your activity can not acquire any exclusive
+ resources (such as opening the camera or recording audio) when it launches, or it
+ may conflict with the previous activity and fail.
+
+ <p>The default value of this attribute is <code>false</code>. -->
+ <attr name="resumeWhilePausing" format="boolean" />
+
<!-- The <code>manifest</code> tag is the root of an
<code>AndroidManifest.xml</code> file,
describing the contents of an Android package (.apk) file. One
@@ -1678,6 +1687,7 @@
<attr name="maxRecents" />
<attr name="autoRemoveFromRecents" />
<attr name="relinquishTaskIdentity" />
+ <attr name="resumeWhilePausing" />
</declare-styleable>
<!-- The <code>activity-alias</code> tag declares a new
diff --git a/core/res/res/values/public.xml b/core/res/res/values/public.xml
index a4c3474..5b047f7 100644
--- a/core/res/res/values/public.xml
+++ b/core/res/res/values/public.xml
@@ -2266,7 +2266,7 @@
<public type="attr" name="windowReenterTransition" />
<public type="attr" name="windowSharedElementReturnTransition" />
<public type="attr" name="windowSharedElementReenterTransition" />
- <public type="attr" name="__removed1" />
+ <public type="attr" name="resumeWhilePausing" />
<public type="attr" name="datePickerMode"/>
<public type="attr" name="timePickerMode"/>
<public type="attr" name="inset" />