Removed hidden mutable APIs from PorterDuffColorFilter

Removed PorterDuffColorFilter#setColor and PorterDuffColorFilter#setMode
as the public facing ColorFilter API is immutable. These framework
internal APIs were causing issues with Drawables as updates to state of
the ColorFilter would not be propagated up to the Drawable to cause an
invalidation.

Fixes: 77723600
Test: Ran atest on SystemUITest and CtsGraphicsTest modules

Change-Id: I935c9e35ffa225735b951bb3b1eb753ea5815a84
This commit is contained in:
Nader Jawad
2018-04-09 09:54:48 -07:00
parent 02adb97ec2
commit 85ff47e3fc
9 changed files with 52 additions and 73 deletions

View File

@@ -106,7 +106,7 @@ public class ColorFiltersMutateActivity extends Activity {
mPorterDuffColor = porterDuffColor;
final PorterDuffColorFilter filter =
(PorterDuffColorFilter) mBlendPaint.getColorFilter();
filter.setColor(mPorterDuffColor);
mBlendPaint.setColorFilter(new PorterDuffColorFilter(porterDuffColor, filter.getMode()));
invalidate();
}