Recycle original screenshot after rotation.

After copying the Bitmap to a new Bitmap, there is no need to keep
the original pixels.

This may help memory pressure when running automated tests and taking
lots of screenshots, although it does not fix the main source of the
problem.

BUG:15454296
Change-Id: I7e61886fbb46a8068db3e8dfa1fcb0afd88ea430
This commit is contained in:
Leon Scroggins III
2014-07-02 17:09:34 -04:00
parent 3ff3db5f5c
commit b101ebe8a6

View File

@@ -673,6 +673,7 @@ public final class UiAutomation {
canvas.translate(- screenshotWidth / 2, - screenshotHeight / 2);
canvas.drawBitmap(screenShot, 0, 0, null);
canvas.setBitmap(null);
screenShot.recycle();
screenShot = unrotatedScreenShot;
}