diff options
author | TreeHugger Robot <treehugger-gerrit@google.com> | 2017-07-18 20:08:58 +0000 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2017-07-18 20:08:58 +0000 |
commit | bc907cf9a8eb3dab10086a758f6202bf10215999 (patch) | |
tree | 76e2592ab1cbc2c1a2c3e6232ba501d41fbd3a29 /tests/Internal | |
parent | d3320766365ed1fa74ebc5f751884fc28093e893 (diff) | |
parent | 42acf6009ade4314f3cd782d68db6ab7ad4c8da3 (diff) |
Merge "Don't recycle bitmaps we don't own" into oc-dr1-dev
Diffstat (limited to 'tests/Internal')
-rw-r--r-- | tests/Internal/src/android/app/WallpaperColorsTest.java | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/tests/Internal/src/android/app/WallpaperColorsTest.java b/tests/Internal/src/android/app/WallpaperColorsTest.java index 5bbd82bea3de..fb529b936e5c 100644 --- a/tests/Internal/src/android/app/WallpaperColorsTest.java +++ b/tests/Internal/src/android/app/WallpaperColorsTest.java @@ -77,4 +77,16 @@ public class WallpaperColorsTest { Assert.assertFalse("Light surface shouldn't support dark text " + "when it contains dark pixels", supportsDarkText); } + + /** + * WallpaperColors should not recycle bitmaps that it didn't create. + */ + @Test + public void wallpaperRecycleBitmapTest() { + Bitmap image = Bitmap.createBitmap(300, 300, Bitmap.Config.ARGB_8888); + WallpaperColors.fromBitmap(image); + Canvas canvas = new Canvas(); + // This would crash: + canvas.drawBitmap(image, 0, 0, new Paint()); + } } |