Fix isProjected and setAlpha method inside AdaptiveIconDrawable
Test: atest AdaptiveIconDrawableTest (in coretests and cts)
Bug: 119755247
Bug: 118503770
Some contexts regarding why setAlpha was misbehaving before and after
setBounds: mPaint object which is used to setAlpha was shared between
mLayerBitmpa and mMaskBitmap. When bounds changed, mMaskBitmap alpha was
never properly refreshed. To fix this issue AND to optimize memory
footprint, the drawable no longer make use of the mMaskBitmap object.
CtsGraphicsTestCases (21 Tests)
------------------------------
[1/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testInflateNull: PASSED (1ms)
[2/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testSetVisible: PASSED (1ms)
[3/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testDraw: PASSED (1ms)
[4/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testGetOpacity: PASSED (0ms)
[5/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testGetForegroundBackground: PASSED (25ms)
[6/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testGetConstantState: PASSED (0ms)
[7/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testIsStateful: PASSED (0ms)
[8/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testDrawNull: PASSED (1ms)
[9/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testDrawWithoutSetBounds: PASSED (0ms)
[10/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testGetIntrinsicHeight: PASSED (25ms)
[11/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testScheduleDrawable: PASSED (1ms)
[12/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testGetIntrinsicWidth: PASSED (1ms)
[13/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testSetColorFilter: PASSED (1ms)
[14/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testInflate: PASSED (1ms)
[15/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testMutate: PASSED (1ms)
[16/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testGetChangingConfigurations: PASSED (1ms)
[17/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testInvalidateDrawable: PASSED (0ms)
[18/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testUnscheduleDrawable: PASSED (25ms)
[19/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testConstructor: PASSED (0ms)
[20/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testSetAlpha: PASSED (0ms)
[21/21] android.graphics.drawable.cts.AdaptiveIconDrawableTest#testDrawSetBounds: PASSED (478ms)
Summary
-------
CtsGraphicsTestCases: Passed: 21, Failed: 0
FrameworksCoreTests (6 Tests)
----------------------------
[1/6] android.graphics.drawable.AdaptiveIconDrawableTest#testDraw_withBounds: PASSED (454ms)
[2/6] android.graphics.drawable.AdaptiveIconDrawableTest#testDraw_withoutBounds: PASSED (0ms)
[3/6] android.graphics.drawable.AdaptiveIconDrawableTest#testGetIconMaskAfterSetBounds: PASSED (1ms)
[4/6] android.graphics.drawable.AdaptiveIconDrawableTest#testGetIconMask_withoutBounds: PASSED (1ms)
[5/6] android.graphics.drawable.AdaptiveIconDrawableTest#testGetOutline_withBounds: PASSED (0ms)
[6/6] android.graphics.drawable.AdaptiveIconDrawableTest#testSetAlpha: PASSED (0ms)
Summary
-------
FrameworksCoreTests: Passed: 6, Failed: 0
Change-Id: Ie52019f14159e06b957760cb33118cb74f58415e
1 file changed