OSDN Git Service

Keeping only running users recents in memory
authorSuprabh Shukla <suprabh@google.com>
Wed, 2 Dec 2015 22:36:31 +0000 (14:36 -0800)
committerSuprabh Shukla <suprabh@google.com>
Sat, 16 Jan 2016 01:45:35 +0000 (17:45 -0800)
commit09a88f5f3e7d4a3bbfce04ac06594ac590c67d27
tree2f7d4a849e55b24e230e8927a9f8ce5069b8bbe9
parent477e26cf931290f6b3353fab43a05406eea223f9
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
12 files changed:
services/core/java/com/android/server/am/ActivityManagerService.java
services/core/java/com/android/server/am/ActivityManagerShellCommand.java
services/core/java/com/android/server/am/ActivityRecord.java
services/core/java/com/android/server/am/ActivityStack.java
services/core/java/com/android/server/am/ActivityStackSupervisor.java
services/core/java/com/android/server/am/ActivityStarter.java
services/core/java/com/android/server/am/RecentTasks.java
services/core/java/com/android/server/am/TaskPersister.java
services/core/java/com/android/server/am/TaskRecord.java
services/core/java/com/android/server/am/UserController.java
services/tests/servicestests/AndroidManifest.xml
services/tests/servicestests/src/com/android/server/am/ActivityManagerTest.java [new file with mode: 0644]