Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,6 @@ final class ImageReaderSurfaceProducer
// Flip when debugging to see verbose logs.
private static final boolean VERBOSE_LOGS = false;

// If we cleanup the ImageReaders on memory pressure it breaks VirtualDisplay
// backed platform views. Disable for now as this is only necessary to work
// around a Samsung-specific Android 14 bug.
private static final boolean CLEANUP_ON_MEMORY_PRESSURE = false;

private final long id;

private boolean released;
Expand Down Expand Up @@ -654,9 +649,6 @@ PerImage dequeueImage() {

@Override
public void onTrimMemory(int level) {
if (!CLEANUP_ON_MEMORY_PRESSURE) {
return;
}
cleanup();
createNewReader = true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -648,12 +648,11 @@ public void ImageReaderSurfaceProducerTrimMemoryCallback() {
assertEquals(1, texture.numImages());

// Invoke the onTrimMemory callback.
// This should do nothing.
texture.onTrimMemory(0);
shadowOf(Looper.getMainLooper()).idle();

assertEquals(1, texture.numImageReaders());
assertEquals(1, texture.numImages());
assertEquals(0, texture.numImageReaders());
assertEquals(0, texture.numImages());
}

// A 0x0 ImageReader is a runtime error.
Expand Down