summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--services/core/java/com/android/server/wm/TaskSnapshotPersister.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/services/core/java/com/android/server/wm/TaskSnapshotPersister.java b/services/core/java/com/android/server/wm/TaskSnapshotPersister.java
index 1252aee14964..a2c9283a9b1e 100644
--- a/services/core/java/com/android/server/wm/TaskSnapshotPersister.java
+++ b/services/core/java/com/android/server/wm/TaskSnapshotPersister.java
@@ -333,7 +333,6 @@ class TaskSnapshotPersister {
}
boolean writeBuffer() {
- final File file = getBitmapFile(mTaskId, mUserId);
final Bitmap bitmap = Bitmap.createHardwareBitmap(mSnapshot.getSnapshot());
if (bitmap == null) {
Slog.e(TAG, "Invalid task snapshot hw bitmap");
@@ -361,6 +360,7 @@ class TaskSnapshotPersister {
return true;
}
+ final File file = getBitmapFile(mTaskId, mUserId);
try {
FileOutputStream fos = new FileOutputStream(file);
swBitmap.compress(JPEG, QUALITY, fos);