Loading services/core/java/com/android/server/am/TaskPersister.java +93 −84 Original line number Diff line number Diff line Loading @@ -679,6 +679,16 @@ public class TaskPersister { } writeTaskIdsFiles(); processNextItem(); } } private void processNextItem() { // This part is extracted into a method so that the GC can clearly see the end of the // scope of the variable 'item'. If this part was in the loop above, the last item // it processed would always "leak". // See https://b.corp.google.com/issues/64438652#comment7 // If mNextWriteTime, then don't delay between each call to saveToXml(). final WriteQueueItem item; synchronized (TaskPersister.this) { Loading Loading @@ -725,7 +735,7 @@ public class TaskPersister { final String filePath = imageWriteQueueItem.mFilePath; if (!createParentDirectory(filePath)) { Slog.e(TAG, "Error while creating images directory for file: " + filePath); continue; return; } final Bitmap bitmap = imageWriteQueueItem.mImage; if (DEBUG) Slog.d(TAG, "writing bitmap: filename=" + filePath); Loading Loading @@ -778,4 +788,3 @@ public class TaskPersister { } } } } Loading
services/core/java/com/android/server/am/TaskPersister.java +93 −84 Original line number Diff line number Diff line Loading @@ -679,6 +679,16 @@ public class TaskPersister { } writeTaskIdsFiles(); processNextItem(); } } private void processNextItem() { // This part is extracted into a method so that the GC can clearly see the end of the // scope of the variable 'item'. If this part was in the loop above, the last item // it processed would always "leak". // See https://b.corp.google.com/issues/64438652#comment7 // If mNextWriteTime, then don't delay between each call to saveToXml(). final WriteQueueItem item; synchronized (TaskPersister.this) { Loading Loading @@ -725,7 +735,7 @@ public class TaskPersister { final String filePath = imageWriteQueueItem.mFilePath; if (!createParentDirectory(filePath)) { Slog.e(TAG, "Error while creating images directory for file: " + filePath); continue; return; } final Bitmap bitmap = imageWriteQueueItem.mImage; if (DEBUG) Slog.d(TAG, "writing bitmap: filename=" + filePath); Loading Loading @@ -778,4 +788,3 @@ public class TaskPersister { } } } }