Loading services/contentsuggestions/java/com/android/server/contentsuggestions/ContentSuggestionsPerUserService.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -98,7 +98,7 @@ public final class ContentSuggestionsPerUserService extends RemoteContentSuggestionsService service = getRemoteServiceLocked(); RemoteContentSuggestionsService service = getRemoteServiceLocked(); if (service != null) { if (service != null) { ActivityManager.TaskSnapshot snapshot = ActivityManager.TaskSnapshot snapshot = mActivityTaskManagerInternal.getTaskSnapshot(taskId, false); mActivityTaskManagerInternal.getTaskSnapshotNoRestore(taskId, false); GraphicBuffer snapshotBuffer = null; GraphicBuffer snapshotBuffer = null; int colorSpaceId = 0; int colorSpaceId = 0; if (snapshot != null) { if (snapshot != null) { Loading services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -553,7 +553,7 @@ public abstract class ActivityTaskManagerInternal { /** /** * Gets bitmap snapshot of the provided task id. * Gets bitmap snapshot of the provided task id. */ */ public abstract ActivityManager.TaskSnapshot getTaskSnapshot(int taskId, public abstract ActivityManager.TaskSnapshot getTaskSnapshotNoRestore(int taskId, boolean reducedResolution); boolean reducedResolution); /** Returns true if uid is considered foreground for activity start purposes. */ /** Returns true if uid is considered foreground for activity start purposes. */ Loading services/core/java/com/android/server/wm/ActivityTaskManagerService.java +20 −15 Original line number Original line Diff line number Diff line Loading @@ -4521,6 +4521,14 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { enforceCallerIsRecentsOrHasPermission(READ_FRAME_BUFFER, "getTaskSnapshot()"); enforceCallerIsRecentsOrHasPermission(READ_FRAME_BUFFER, "getTaskSnapshot()"); final long ident = Binder.clearCallingIdentity(); final long ident = Binder.clearCallingIdentity(); try { try { return getTaskSnapshot(taskId, reducedResolution, true /* restoreFromDisk */); } finally { Binder.restoreCallingIdentity(ident); } } private ActivityManager.TaskSnapshot getTaskSnapshot(int taskId, boolean reducedResolution, boolean restoreFromDisk) { final TaskRecord task; final TaskRecord task; synchronized (mGlobalLock) { synchronized (mGlobalLock) { task = mRootActivityContainer.anyTaskForId(taskId, task = mRootActivityContainer.anyTaskForId(taskId, Loading @@ -4531,10 +4539,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } } } // Don't call this while holding the lock as this operation might hit the disk. // Don't call this while holding the lock as this operation might hit the disk. return task.getSnapshot(reducedResolution); return task.getSnapshot(reducedResolution, restoreFromDisk); } finally { Binder.restoreCallingIdentity(ident); } } } @Override @Override Loading Loading @@ -7413,10 +7418,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } @Override @Override public ActivityManager.TaskSnapshot getTaskSnapshot(int taskId, boolean reducedResolution) { public ActivityManager.TaskSnapshot getTaskSnapshotNoRestore(int taskId, synchronized (mGlobalLock) { boolean reducedResolution) { return ActivityTaskManagerService.this.getTaskSnapshot(taskId, reducedResolution); return ActivityTaskManagerService.this.getTaskSnapshot(taskId, reducedResolution, } false /* restoreFromDisk */); } } @Override @Override Loading services/core/java/com/android/server/wm/TaskRecord.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -851,11 +851,12 @@ class TaskRecord extends ConfigurationContainer { /** /** * DO NOT HOLD THE ACTIVITY MANAGER LOCK WHEN CALLING THIS METHOD! * DO NOT HOLD THE ACTIVITY MANAGER LOCK WHEN CALLING THIS METHOD! */ */ TaskSnapshot getSnapshot(boolean reducedResolution) { TaskSnapshot getSnapshot(boolean reducedResolution, boolean restoreFromDisk) { // TODO: Move this to {@link TaskWindowContainerController} once recent tasks are more // TODO: Move this to {@link TaskWindowContainerController} once recent tasks are more // synchronized between AM and WM. // synchronized between AM and WM. return mService.mWindowManager.getTaskSnapshot(taskId, userId, reducedResolution); return mService.mWindowManager.getTaskSnapshot(taskId, userId, reducedResolution, restoreFromDisk); } } void touchActiveTime() { void touchActiveTime() { Loading services/core/java/com/android/server/wm/WindowManagerService.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -3551,8 +3551,9 @@ public class WindowManagerService extends IWindowManager.Stub return true; return true; } } public TaskSnapshot getTaskSnapshot(int taskId, int userId, boolean reducedResolution) { public TaskSnapshot getTaskSnapshot(int taskId, int userId, boolean reducedResolution, return mTaskSnapshotController.getSnapshot(taskId, userId, true /* restoreFromDisk */, boolean restoreFromDisk) { return mTaskSnapshotController.getSnapshot(taskId, userId, restoreFromDisk, reducedResolution); reducedResolution); } } Loading Loading
services/contentsuggestions/java/com/android/server/contentsuggestions/ContentSuggestionsPerUserService.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -98,7 +98,7 @@ public final class ContentSuggestionsPerUserService extends RemoteContentSuggestionsService service = getRemoteServiceLocked(); RemoteContentSuggestionsService service = getRemoteServiceLocked(); if (service != null) { if (service != null) { ActivityManager.TaskSnapshot snapshot = ActivityManager.TaskSnapshot snapshot = mActivityTaskManagerInternal.getTaskSnapshot(taskId, false); mActivityTaskManagerInternal.getTaskSnapshotNoRestore(taskId, false); GraphicBuffer snapshotBuffer = null; GraphicBuffer snapshotBuffer = null; int colorSpaceId = 0; int colorSpaceId = 0; if (snapshot != null) { if (snapshot != null) { Loading
services/core/java/com/android/server/wm/ActivityTaskManagerInternal.java +1 −1 Original line number Original line Diff line number Diff line Loading @@ -553,7 +553,7 @@ public abstract class ActivityTaskManagerInternal { /** /** * Gets bitmap snapshot of the provided task id. * Gets bitmap snapshot of the provided task id. */ */ public abstract ActivityManager.TaskSnapshot getTaskSnapshot(int taskId, public abstract ActivityManager.TaskSnapshot getTaskSnapshotNoRestore(int taskId, boolean reducedResolution); boolean reducedResolution); /** Returns true if uid is considered foreground for activity start purposes. */ /** Returns true if uid is considered foreground for activity start purposes. */ Loading
services/core/java/com/android/server/wm/ActivityTaskManagerService.java +20 −15 Original line number Original line Diff line number Diff line Loading @@ -4521,6 +4521,14 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { enforceCallerIsRecentsOrHasPermission(READ_FRAME_BUFFER, "getTaskSnapshot()"); enforceCallerIsRecentsOrHasPermission(READ_FRAME_BUFFER, "getTaskSnapshot()"); final long ident = Binder.clearCallingIdentity(); final long ident = Binder.clearCallingIdentity(); try { try { return getTaskSnapshot(taskId, reducedResolution, true /* restoreFromDisk */); } finally { Binder.restoreCallingIdentity(ident); } } private ActivityManager.TaskSnapshot getTaskSnapshot(int taskId, boolean reducedResolution, boolean restoreFromDisk) { final TaskRecord task; final TaskRecord task; synchronized (mGlobalLock) { synchronized (mGlobalLock) { task = mRootActivityContainer.anyTaskForId(taskId, task = mRootActivityContainer.anyTaskForId(taskId, Loading @@ -4531,10 +4539,7 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } } } // Don't call this while holding the lock as this operation might hit the disk. // Don't call this while holding the lock as this operation might hit the disk. return task.getSnapshot(reducedResolution); return task.getSnapshot(reducedResolution, restoreFromDisk); } finally { Binder.restoreCallingIdentity(ident); } } } @Override @Override Loading Loading @@ -7413,10 +7418,10 @@ public class ActivityTaskManagerService extends IActivityTaskManager.Stub { } } @Override @Override public ActivityManager.TaskSnapshot getTaskSnapshot(int taskId, boolean reducedResolution) { public ActivityManager.TaskSnapshot getTaskSnapshotNoRestore(int taskId, synchronized (mGlobalLock) { boolean reducedResolution) { return ActivityTaskManagerService.this.getTaskSnapshot(taskId, reducedResolution); return ActivityTaskManagerService.this.getTaskSnapshot(taskId, reducedResolution, } false /* restoreFromDisk */); } } @Override @Override Loading
services/core/java/com/android/server/wm/TaskRecord.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -851,11 +851,12 @@ class TaskRecord extends ConfigurationContainer { /** /** * DO NOT HOLD THE ACTIVITY MANAGER LOCK WHEN CALLING THIS METHOD! * DO NOT HOLD THE ACTIVITY MANAGER LOCK WHEN CALLING THIS METHOD! */ */ TaskSnapshot getSnapshot(boolean reducedResolution) { TaskSnapshot getSnapshot(boolean reducedResolution, boolean restoreFromDisk) { // TODO: Move this to {@link TaskWindowContainerController} once recent tasks are more // TODO: Move this to {@link TaskWindowContainerController} once recent tasks are more // synchronized between AM and WM. // synchronized between AM and WM. return mService.mWindowManager.getTaskSnapshot(taskId, userId, reducedResolution); return mService.mWindowManager.getTaskSnapshot(taskId, userId, reducedResolution, restoreFromDisk); } } void touchActiveTime() { void touchActiveTime() { Loading
services/core/java/com/android/server/wm/WindowManagerService.java +3 −2 Original line number Original line Diff line number Diff line Loading @@ -3551,8 +3551,9 @@ public class WindowManagerService extends IWindowManager.Stub return true; return true; } } public TaskSnapshot getTaskSnapshot(int taskId, int userId, boolean reducedResolution) { public TaskSnapshot getTaskSnapshot(int taskId, int userId, boolean reducedResolution, return mTaskSnapshotController.getSnapshot(taskId, userId, true /* restoreFromDisk */, boolean restoreFromDisk) { return mTaskSnapshotController.getSnapshot(taskId, userId, restoreFromDisk, reducedResolution); reducedResolution); } } Loading