Loading services/core/java/com/android/server/wm/ActivityStackSupervisor.java +8 −1 Original line number Diff line number Diff line Loading @@ -450,10 +450,17 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { } void onSystemReady() { mPersisterQueue.startPersisting(); mLaunchParamsPersister.onSystemReady(); } void onUserUnlocked(int userId) { // Only start persisting when the first user is unlocked. The method call is // idempotent so there is no side effect to call it again when the second user is // unlocked. mPersisterQueue.startPersisting(); mLaunchParamsPersister.onUnlockUser(userId); } public ActivityMetricsLogger getActivityMetricsLogger() { return mActivityMetricsLogger; } Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -954,7 +954,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { @Override public void onUnlockUser(int userId) { synchronized (mService.getGlobalLock()) { mService.mStackSupervisor.mLaunchParamsPersister.onUnlockUser(userId); mService.mStackSupervisor.onUserUnlocked(userId); } } Loading services/core/java/com/android/server/wm/PersisterQueue.java +2 −8 Original line number Diff line number Diff line Loading @@ -131,10 +131,8 @@ class PersisterQueue { } /** * * @param item * @param flush * @param <T> * Updates the last item found in the queue that matches the given item, or adds it to the end * of the queue if no such item is found. */ synchronized <T extends WriteQueueItem> void updateLastOrAddItem(T item, boolean flush) { final T itemToUpdate = findLastItem(item::matches, (Class<T>) item.getClass()); Loading @@ -149,10 +147,6 @@ class PersisterQueue { /** * Removes all items with which given predicate returns {@code true}. * * @param predicate the predicate * @param clazz * @param <T> */ synchronized <T extends WriteQueueItem> void removeItems(Predicate<T> predicate, Class<T> clazz) { Loading services/core/java/com/android/server/wm/TaskPersister.java +9 −12 Original line number Diff line number Diff line Loading @@ -492,16 +492,8 @@ public class TaskPersister implements PersisterQueue.Listener { return new File(userTaskIdsDir, PERSISTED_TASK_IDS_FILENAME); } static File getUserTasksDir(int userId) { File userTasksDir = new File(Environment.getDataSystemCeDirectory(userId), TASKS_DIRNAME); if (!userTasksDir.exists()) { if (!userTasksDir.mkdir()) { Slog.e(TAG, "Failure creating tasks directory for user " + userId + ": " + userTasksDir); } } return userTasksDir; private static File getUserTasksDir(int userId) { return new File(Environment.getDataSystemCeDirectory(userId), TASKS_DIRNAME); } static File getUserImagesDir(int userId) { Loading Loading @@ -568,8 +560,13 @@ public class TaskPersister implements PersisterQueue.Listener { FileOutputStream file = null; AtomicFile atomicFile = null; try { atomicFile = new AtomicFile(new File( getUserTasksDir(task.userId), File userTasksDir = getUserTasksDir(task.userId); if (!userTasksDir.isDirectory() && !userTasksDir.mkdirs()) { Slog.e(TAG, "Failure creating tasks directory for user " + task.userId + ": " + userTasksDir + " Dropping persistence for task " + task); return; } atomicFile = new AtomicFile(new File(userTasksDir, String.valueOf(task.taskId) + TASK_FILENAME_SUFFIX)); file = atomicFile.startWrite(); file.write(stringWriter.toString().getBytes()); Loading Loading
services/core/java/com/android/server/wm/ActivityStackSupervisor.java +8 −1 Original line number Diff line number Diff line Loading @@ -450,10 +450,17 @@ public class ActivityStackSupervisor implements RecentTasks.Callbacks { } void onSystemReady() { mPersisterQueue.startPersisting(); mLaunchParamsPersister.onSystemReady(); } void onUserUnlocked(int userId) { // Only start persisting when the first user is unlocked. The method call is // idempotent so there is no side effect to call it again when the second user is // unlocked. mPersisterQueue.startPersisting(); mLaunchParamsPersister.onUnlockUser(userId); } public ActivityMetricsLogger getActivityMetricsLogger() { return mActivityMetricsLogger; } Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +1 −1 Original line number Diff line number Diff line Loading @@ -954,7 +954,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { @Override public void onUnlockUser(int userId) { synchronized (mService.getGlobalLock()) { mService.mStackSupervisor.mLaunchParamsPersister.onUnlockUser(userId); mService.mStackSupervisor.onUserUnlocked(userId); } } Loading
services/core/java/com/android/server/wm/PersisterQueue.java +2 −8 Original line number Diff line number Diff line Loading @@ -131,10 +131,8 @@ class PersisterQueue { } /** * * @param item * @param flush * @param <T> * Updates the last item found in the queue that matches the given item, or adds it to the end * of the queue if no such item is found. */ synchronized <T extends WriteQueueItem> void updateLastOrAddItem(T item, boolean flush) { final T itemToUpdate = findLastItem(item::matches, (Class<T>) item.getClass()); Loading @@ -149,10 +147,6 @@ class PersisterQueue { /** * Removes all items with which given predicate returns {@code true}. * * @param predicate the predicate * @param clazz * @param <T> */ synchronized <T extends WriteQueueItem> void removeItems(Predicate<T> predicate, Class<T> clazz) { Loading
services/core/java/com/android/server/wm/TaskPersister.java +9 −12 Original line number Diff line number Diff line Loading @@ -492,16 +492,8 @@ public class TaskPersister implements PersisterQueue.Listener { return new File(userTaskIdsDir, PERSISTED_TASK_IDS_FILENAME); } static File getUserTasksDir(int userId) { File userTasksDir = new File(Environment.getDataSystemCeDirectory(userId), TASKS_DIRNAME); if (!userTasksDir.exists()) { if (!userTasksDir.mkdir()) { Slog.e(TAG, "Failure creating tasks directory for user " + userId + ": " + userTasksDir); } } return userTasksDir; private static File getUserTasksDir(int userId) { return new File(Environment.getDataSystemCeDirectory(userId), TASKS_DIRNAME); } static File getUserImagesDir(int userId) { Loading Loading @@ -568,8 +560,13 @@ public class TaskPersister implements PersisterQueue.Listener { FileOutputStream file = null; AtomicFile atomicFile = null; try { atomicFile = new AtomicFile(new File( getUserTasksDir(task.userId), File userTasksDir = getUserTasksDir(task.userId); if (!userTasksDir.isDirectory() && !userTasksDir.mkdirs()) { Slog.e(TAG, "Failure creating tasks directory for user " + task.userId + ": " + userTasksDir + " Dropping persistence for task " + task); return; } atomicFile = new AtomicFile(new File(userTasksDir, String.valueOf(task.taskId) + TASK_FILENAME_SUFFIX)); file = atomicFile.startWrite(); file.write(stringWriter.toString().getBytes()); Loading