4cb941e18efc9b0cc1bf2ce5bdda1924f29dea67 |
|
31-Mar-2017 |
Daichi Hirono <hirono@google.com> |
Stop restoring tasks added before recent is loaded Previously we can have duplicated tasks sharing the same taskId in RecentTasks due to race condition. 1. A task is created before RecentTasks#loadUserRecentsLocked (e.g. through adb) 2. RecentTasks#notifyTaskPersisterLocked eventually writes the task file to storage (e.g. XX_task.xml) 3. RecentTasks#loadUserRecentsLocked tries to recover XX_task.xml while the task has already been added to RecentTasks. To fix the issue, the CL stops restoring tasks added before recent is loaded. Bug: 36796576 Test: Build and boot Android, check the recent is correctly loaded Change-Id: Ib57977f2a0a63f7bf7db4d3fd70bdcc359e76f7d (cherry picked from commit b8aeb6f12e51e6d3ecf6a5f40c953dc76ff64884)
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
7900beee54d5dd8d5a057c0bd7bef0c2dcf2d599 |
|
10-Mar-2017 |
Winson Chung <winsonc@google.com> |
Fixing issue with TaskRecord lookup. - In ag/1721556, we switched from looking up the task in WM to looking up the task in AM (and using the window container controller). However, AM's call, anyTaskForIdLocked(), will return tasks in the recent tasks list along with the current stacks. The naming of the parameter restoreFromRecents is partly to blame as it does not prevent lookup in the recent tasks and only prevents that task from being restored into the provided stack. As a result, when we removed a task from a stack, we also remove the associated window container controller, but when we query for the task to make a WCC call to it, it finds the one in the recent tasks list and happily uses that one (which crashes because we've the WCC). Instead, we break up the call to explicitly search for tasks in the stacks only, in stacks or recents, and in stacks or recents with restore. All existing calls to anyTaskForIdLocked() that are actually looking up a task for a WCC call (like those in ag/1721556) can use STACK_ONLY, while existing calls will match recents tasks and restore as required. Bug: 35960163 Test: Open up settings > display > brightness dialog, quick switch to another task using overview Change-Id: I835116fa80d47450da8c4de41fe0d54fc70cb43b Signed-off-by: Winson Chung <winsonc@google.com>
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
f9084ecae2e0f042730ab32b9c94204a0e21bb2a |
|
16-Jan-2017 |
Jorim Jaggi <jjaggi@google.com> |
Persist task snapshots to disk So they can be used again after rebooting or when the process gets killed, but the snapshot is still used for recents. Also implement TaskSnapshotLoader, to restore it from disk. The infrastructure around restoring and caching snapshots for recents will be implemented in the next CL. Test: runtest frameworks-services -c com.android.server.wm.TaskSnapshotPersisterLoaderTest Bug: 31339431 Change-Id: Iaec03c4cc92e04b6dd7e623bca755ddc92613bce
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
ae1ff4f85ffd12ab8a14c610b1474a012536888f |
|
11-Nov-2016 |
Matthew Ng <ngmatthew@google.com> |
Split home stack into home and recents stack Refactored functionality of home stack (HOME_STACK_ID) in the code base to home stack and recents stack (RECENTS_STACK_ID). Also changed function and variable names from homeStack to homeOrRecentsStack. Differentiating home and recents stack will allow readablilty and managing logic between home and recents stacks. For example, for multi-window minimized dock state, the home and recents stacks can be set to different rects where the home stack needs to be a fixed large size while the recents stack is hidden and the dock stack is animating to be minimized. Fixes: 32839371 Test: ./run-test android.server.cts and manually tested split and rotation Change-Id: I7603359c2dc20e35924664178634eb761e0367a6
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
625ed0c3027a6e8f3e1b1314f5a6984e8d2e3c65 |
|
18-Oct-2016 |
Wale Ogunwale <ogunwale@google.com> |
Upgrade resize mode setting for home activities when restoring task We need to convert the resize mode of home activities saved before version 1 of the persisted task record if they are marked as RESIZE_MODE_RESIZEABLE to RESIZE_MODE_RESIZEABLE_VIA_SDK_VERSION since we didn't have that differentiation before version 1 and the system didn't resize home activities before then. Bug: 30982291 Bug: 32231084 Test: Verify that a device runnin N upgraded to O doesn't resize the home activity when in split-screen multi-window mode. Change-Id: I3c9dfcc8be2651b06f7ab77abe4edb9653742952
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
02b7a83b97593bc0c0c459272dca15d2e7ef8dd5 |
|
07-Oct-2016 |
Andrii Kulian <akulian@google.com> |
Make stack field private in TaskRecord This is needed to enforce usage of setter - prerequisite for ag/1499587. Change-Id: I194008899d8320a213e82b9106f0589f499941b4 Test: Refactoring only. Manual and existing tests still pass.
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
36f3f0337de86baf8cf8a5fdd67a95e61dff4bcd |
|
09-Sep-2016 |
Winson Chung <winsonc@google.com> |
Revert "Fixing issue with old tasks being visible in Overview" Bug: 28908500 This reverts commit b258f6a4bd685e5efcb36c02d5817f659e10479b. Change-Id: I9b3c04358d6ca693ed3fdcd9220af13f81eb704e
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
b258f6a4bd685e5efcb36c02d5817f659e10479b |
|
26-Aug-2016 |
Winson <winsonc@google.com> |
Fixing issue with old tasks being visible in Overview - This CL does two things, firstly, it ensures that all first & last active times are monotonically increasing and independent of the current system time. This allows us to better keep track of which tasks are historical and should be hidden, and which are not. Secondly, this CL moves the tracking of the last visible active time into the system (per user) where it can be adjusted along with the task active times when they are loaded. - Following this CL, all active times in the future will be adjusted on boot such that old tasks are made relative to the current boot time. It’s not important exactly what time they are, only that they are adjusted along with the last visible task active time so that we always keep track of what is visible. Bug: 28908500 Change-Id: I4f789df3a6bd825517cf3a70e26fb60deff89d06
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
fd0bd4f39deb2efdcc2f01911fc74bd5593cf6b0 |
|
24-Aug-2016 |
Suprabh Shukla <suprabh@google.com> |
Resolving race condition while writing recent taskids There was a race condition, due to which, by the time TaskPersister started writing the taskids to the file, the user was stopped and its data from memory was unloaded, resulting in a NullPointerException Bug: 30944155 Change-Id: Iac3333b7744241c90a7769686983e3f16e6880c1
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
dc4b80dde458ab43cc2bc8670864532023ddd6f2 |
|
21-Apr-2016 |
Suprabh Shukla <suprabh@google.com> |
Removing disk access from startActivity thread Code was checking whether the directory for recent_images existed in many places unnecessarily causing StrictMode violations. Moved the code to only attempt to check and create the directory before actually writing to disk. Bug: b/28195831 Change-Id: I05f77a10f1dafc8cc0b1836b62352d56549ac1ee
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
a09b4d2a611a7606e8fc8c73a24bd941b6fc173f |
|
15-Apr-2016 |
Narayan Kamath <narayan@google.com> |
Remove unnecessary allocation+unboxing of objects. Transforming String->int can be done with 0 allocations using Integer.parseInt. bug: 28078871 Change-Id: I8d9f322d7154728849dde61ef282046032858d60
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
f50b458e7107d23483d8c6ba1121d921773e45c6 |
|
24-Feb-2016 |
Suprabh Shukla <suprabh@google.com> |
Added a unit test for TaskPersister Added a simple unit test which checks the methods used to save and load the set of taskids to file. The test creates a user, adds some task ids to the set of taskids for that user, saves it and loads it to see whether the set loaded is the same as the one that was saved. Change-Id: If92be8abf9a7e3ef90630a3786867f0e1ba12f3e
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
4bccb46554d9fd0d7de44e069d67af970d178a0b |
|
11-Feb-2016 |
Suprabh Shukla <suprabh@google.com> |
Moving recent tasks and images to /data/system_ce Moved user sensitive recents data to the credential encrypted directory /data/system_ce. Since this directory is not available before the user is unlocked, and unavailable task ids are needed to be known before assigning an id to a new task, this change adds a file in /data/system_de for each user, to store the ids of the tasks present in /data/system_ce. Bug: b/24569398 Change-Id: I340d1abe23e2594e2cee4bff89a697bd8dc61fc7
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
09a88f5f3e7d4a3bbfce04ac06594ac590c67d27 |
|
02-Dec-2015 |
Suprabh Shukla <suprabh@google.com> |
Keeping only running users recents in memory Currently, all the users' recent tasks are loaded into memory and kept in sync with the persistent storage. This changes the system so that it loads a users recents into memory lazily (i.e. when getRecentTasks is called for that user) and unloads them from the memory as soon as the user is stopped. This also required bucketizing the taskIds per user, so that the next available taskId can be assigned without having knowledge of all the tasks that are stored away in persistent storage but are not available in memory. Bug-Id: b/24569398 Change-Id: Ia5cb64d9f4ee727225dce34e45ca63e946ac27a8
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
2359314fd41801005993fc8416eeb4fb38dd75a0 |
|
04-Nov-2015 |
Suprabh Shukla <suprabh@google.com> |
Moving recent tasks information to a user directory The directories recent_tasks and recent_images are moved from /data/system/ to /data/system/users/<n>/ Bug: b/24569398 Change-Id: I538969d86ebf14fb2d44257be1e6c0a7ff61ed8d
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
c809cbb92692cf5140fd5a452fc24214a098d937 |
|
02-Nov-2015 |
Winson <winsonc@google.com> |
Saving additional context when taking task screenshots. - Save the original task size and screen orientation. This ensures that we will be able to display the screenshots in the right orientation if we start taking non-square thumbnails. Change-Id: I17ffe1fc05a447f67753149695a4eaf0baa36e8e
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
515d40600e1f11c7cea3a2bfbbb49e7d86ff801f |
|
28-Sep-2015 |
Amith Yamasani <yamasani@google.com> |
Delay cleaning user tasks until user is removed Fixes #24301208 No recent apps shows when switching between users. Instead of cleaning up when stopping a user, we should remove tasks when removing a user, since recents tasks should be persisted across reboots. Reboots are similar to stopping and starting users. Change-Id: I9a250792077cca5f18ae1a10bc36f7b97e8ea867
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
f16c2e8b67e39f4fa49f94d138da02431188d352 |
|
03-Jun-2015 |
Riley Andrews <riandrews@google.com> |
Lower the priority of the LazyTaskWriter thread. This worker thread shouldn't be prioritized at the same level as user tasks, preemptions of ui threads may result. Additionally, if we lower its priority level, it will be scheduled on more efficient cores in big little systems. Change-Id: I49a7df6fb43d6c067aeacf9ff0cbd5477cb42f7d
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
e88d1e5926d3f3e8a4ceaced7dad7bdc8bc61fa4 |
|
18-May-2015 |
Stefan Kuhne <skuhne@google.com> |
Revert "Backup/restore recents task list" Reverts commits 92dd1abef4c0a22db40c5f7bbd100e6b471a1ad3, 18795a2299fefd88ee16393f22324b999ace6ce4, and ac6a3a5e9d90edb533e5b377a4a14ef514be955a which make-up changes required for backing-up and restoring recent tasks from one device to another. The implementation had too many unresolved issues including the ordering of the restored recent tasks which was depending on when the task package is installed on the new device that puts the restored recents list out of order compared to the old device. Bug: 15986349 Bug: 19014377 Bug: 20763296 Change-Id: I06fd35a43036ef0b7260cf4db9c42890df63b95d
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
885e727ab4e55155d1735f78c8a0550f7f180c8a |
|
20-Jan-2015 |
Wale Ogunwale <ogunwale@google.com> |
am f5f54dd6: am 92dd1abe: Update restored task uid to match the package uid on current device. automerge: 7fd985f * commit 'f5f54dd69122bc07ea0a25b8d98b9048cbe4582f': Update restored task uid to match the package uid on current device.
|
92dd1abef4c0a22db40c5f7bbd100e6b471a1ad3 |
|
16-Jan-2015 |
Wale Ogunwale <ogunwale@google.com> |
Update restored task uid to match the package uid on current device. The uid on the task we are restoring from another device are meaningless on the current device. Change updates the uid of any task we restore to match the package uid on the current device. Bug: 19014377 Change-Id: I285fbe9f509cae3d2e9a212a59e88f34b4db20e5
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
c82f2f5f9cb1bd4f5bcbd39a8ddf0d8da84f7104 |
|
09-Dec-2014 |
Wale Ogunwale <ogunwale@google.com> |
Add RecentTasks class to house recent tasks functionality. Cleaned-up ActivityManagerService a little by moving recent tasks functionality to new class RecentTasks. Bug: 18556524 Change-Id: I4c877c9695b63d7fdb1b6b7addb737fd663e86c7
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
18795a2299fefd88ee16393f22324b999ace6ce4 |
|
03-Dec-2014 |
Wale Ogunwale <ogunwale@google.com> |
Add support from restoring recent's backup. Bug: 15986349 Change-Id: I899f81d317fcd5277a75db7ba50ecca14112df26
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
ac6a3a5e9d90edb533e5b377a4a14ef514be955a |
|
18-Nov-2014 |
Christopher Tate <ctate@google.com> |
Recents backup helper Handles backup/restore of recent tasks for the system. Currently the thumbnails are not saved. At restore time the historical task records are placed in a designated separate location rather than directly in the live bookkeeping; this avoids ID duplication issues and makes it easier to deal with lazy adoption of the historical task state as apps are installed on the device post-restore. Bug 17303286 Bug 15986349 Change-Id: Ie156c1e2ab9c9a7e7ac0447b27016fdcef55dded
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
be23ff4949612ecea89d112eff7f5e2c3dbf7685 |
|
22-Oct-2014 |
Wale Ogunwale <ogunwale@google.com> |
Fix issue #17674789: Recents icon resets if persist mode is 'persistNever' Changed TaskPersister worker thread to not delete task information on disk for tasks that are in recents but not persistable. Also, changed logic that writes tasks information (excluding thunmbnail) to disk to not write information for tasks that are not persistable. Bug: 17674789 Change-Id: Iff7c5d24677f8a75157bb6be504fc2d9d6bcc098
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
ce0fd7665f297c5693ee23b3d6daf26baeed4e9d |
|
19-Sep-2014 |
Dianne Hackborn <hackbod@google.com> |
Add new activity dumpsys command to persist all data. Very useful for testing persisting/restoring, to make sure that all pending changes have been written. Change-Id: I0e3b7cd3af8afb0b6e751e086081566ab00b76c9
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
bc3126f859f626938810889cdc58b217c78caef5 |
|
18-Sep-2014 |
Craig Mautner <cmautner@google.com> |
Merge "Remove activity icon bitmaps from system process." into lmp-dev
|
648f69b95ce7fc95f551f6e08a2408d6e57dbab9 |
|
18-Sep-2014 |
Craig Mautner <cmautner@google.com> |
Remove activity icon bitmaps from system process. When a TaskDescription is sent up to the system process, the Bitmap contained in the mIcon member is immediately flushed to disk and the name of the file replaces it in the TaskDescription. Thereby saving mucho RAM for better uses. Fixes bug 17527308. Change-Id: Ifac63ea5d12ed091d1eb03e178b8b847a827f940
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
63f10904a17db79cc8da08ff904d45d6d1cf0862 |
|
17-Sep-2014 |
Craig Mautner <cmautner@google.com> |
Add optimizations to keep TaskPersister queue small. CTS tests cause the TaskPersister queue to fill faster than it can drain. Since it contains screenshots this can consume massive memory. Monkey may also cause the queue to back up. Several optimizations are added to drain the queue when it gets large: - High water mark to recognize when queue gets too deep. Queue is completely drained at this point so that obsolete files can be removed from storage. - Use Thread.yield() to give the TaskPersister write thread some cpu cycles. - Remove images from write queue when TaskRecord is removed from recents. May fix bug 17177273. May fix bug 17381033. Change-Id: If21c03c8f380e5f6816cf4701a40fcfe34ace3f1
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
a5badf06dd818d67a8cdd2d42803e124be929ab8 |
|
11-Sep-2014 |
Craig Mautner <cmautner@google.com> |
Add null check to TaskPersister file list. Ran out of file descriptors and got a null file list. This checks for null file list. Fixes bug 17461213. Change-Id: Ia6d49d0bdb6da98623b76d2b87cd09bc0afa1f27
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
852975d5377bfe5f4abc9d2a28e301aa2fa99994 |
|
23-Aug-2014 |
Dianne Hackborn <hackbod@google.com> |
Fix issue #17179314: Make recents limits consistent The max limit is now 100 (or 50 on svelte devices), and that is what everyone used. Re-arranged things so we have a big expensive "fix the world!" function for recents that we go in to at only select points: when first initializing the system, when external storage comes and goes, and if we detect something wrong with the recents structure. With that, now getRecentTasks() and addRecentTaskLocked() are generally much simpler, doing very little work in most cases. This will help a lot with scaling up to many more recents entries. Change-Id: I7b5ae89edc06568f68c8af54a4420aff7635581c
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
f4f8bb793fe101af770dc974b29c26722bce285f |
|
29-Jul-2014 |
Craig Mautner <cmautner@google.com> |
Eliminate memory leak in TaskPersister Bitmaps added to TaskPersister were piling up in the queue. - The mRecentsChanged flag was being modified without holding the lock. There is no mRecentsChanged flag now. Everything to be written goes into a queue. - TaskPersister now runs until the queue is empty. - Bitmaps being written to the same file were being added to the end of the queue without replacing the earlier bitmap. Now we search the queue for matching tasks and replace the bitmaps if needed. - Method notify() was renamed to wakeup() so IDE could find usages quicker. - Bitmaps that were being requested but were still in the queue are now being fetched from the queue. Fixes bug 16512870. Change-Id: Idca1c712e5d2df8196e93faaf563a54405ee96bf
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
a228ae95ea2f842c0e84f237c64bf032689410dd |
|
09-Jul-2014 |
Craig Mautner <cmautner@google.com> |
Add task affiliation Introduces new flag Intent.FLAG_ACTIVITY_LAUNCH_BEHIND which causes the newly launched task to affiliate with the launching task. (Later this flag will also launch the task behind the current task). This shows up in a new member of the RecentTaskInfo class. This also causes the recents list returned by getRecentsInfo to be rearranged so that affiliated tasks are together. Fixes bug 16157517. Change-Id: Ia1386af50da2f01809278b62d249f05c6a0de951
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
c0ffce5ddd6446f1d46a49cdfaeda4a2ce408e1d |
|
01-Jul-2014 |
Craig Mautner <cmautner@google.com> |
Use cached thumbnails in Recent tasks. The thumbnail returned from ActivityManager.getTaskThumbnail() now contains either a Bitmap or a ParcelFileDescriptor that points to a file containing a compressed Bitmap. The Recent tasks list is now responsible for all thumbnail Bitmap caching as the activity manager keeps only the most recent 5. This also permits low memory devices to have many more tasks in the Recent tasks list. As part of this CL the concept of subtasks is removed eliminating code supporting the TaskAccessInfo and IThumbnailRetriever classes. Fixes bug 15828934. Change-Id: I0fd0320a1a04e3c78d79357899b83a2fff97abf2
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
77b04267c68b86c512937793f7ce563da55a99f3 |
|
28-Jun-2014 |
Craig Mautner <cmautner@google.com> |
Add logging to TaskPersister restore. Solve tasks not being restored. Fixes bug 15935752. Change-Id: Ia3dd50072ac8255bcc37812a0639545b60f5d06f
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
2cb86c723195e24278f983241cd6b1e307acf159 |
|
25-Jun-2014 |
Winson Chung <winsonc@google.com> |
Saving last TaskDescription for TaskRecord. Change-Id: I531e0fc661fdedeb78bee7d5472668de8e9c2104
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
43e52ed32e2d55ef4aee18c4b4bc13b7fdef9cc4 |
|
17-Jun-2014 |
Craig Mautner <cmautner@google.com> |
Fix persistent tasks and expand scope - Fixed missing tag closure on the xml for storing Intent categories. - Shortened timeout for flushing tasks to persistent storage from one minute to ten seconds. - Made persistency the default except for those tasks on the home stack and those tasks that exclude themselves from the recent task list. - Fixed deletion of tasks after restoring. Tasks now survive a second reboot, not just the first reboot. - Fixed sort order so most recent tasks will be restored at front. Fixes bug 15672002. Change-Id: I16d87d58c6fd2e879cfd0c0b18b2694432a79b71
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
ffcfcaadfefec2fb56f67a0a614a54bf4599d62b |
|
05-Jun-2014 |
Craig Mautner <cmautner@google.com> |
Implement maxRecents and fix TaskPersister bug Activities can now set the maximum number of times that they will appear in the recent task lists when using DocCentric mode. The default number is 15, the min 1, and the max 100. Also a bug in TaskPersister that deleted files because it did not properly parse their task ids is fixed. Fixes bug 13736052. Change-Id: I7ccb4e6f89d6202ff31c8577bb7b9d8d1b7e5e8d
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
e0129b3c672f5555deb75366b1a7159f41737874 |
|
26-May-2014 |
Craig Mautner <cmautner@google.com> |
Add more error checking to xml restore Bad files and OS updates can cause the restore to throw an NPE. Rather than bring down the server process over this, just delete the persistent file and keep going. Fixes bug 15219594. Change-Id: Id9cd39988ff93a26def036a05c46209364f2a4c0
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|
21d24a21ea4aaadd78e73de54168e8a8a8973e4d |
|
23-Apr-2014 |
Craig Mautner <cmautner@google.com> |
Add code for persisting tasks and activities to disk DO NOT MERGE Recent tasks that have the persistable flag set are saved to /data/system/recent_tasks/ on shutdown and in the background. Their thumbnails are saved to /data/system/recent_images/. Change-Id: Ifb820a01c412fe1f8c0f6e41aa655fafd89eaa8d
/frameworks/base/services/core/java/com/android/server/am/TaskPersister.java
|