f96d6fa4a1
Cherry pick of commit ba41458f5c
plus changes to BitmapUtils.java.
Bug: https://code.google.com/p/android/issues/detail?id=36199
Change-Id: I2effc3f498fb13e66de9a905b9a40ac5688a5850