Skip to content
Commit 7ddb3965 authored by Nader Jawad's avatar Nader Jawad
Browse files

Relaxed nullability requirements for setTintMode APIs for

both PorterDuff.Mode and BlendMode

The existing documentation had annotated the PorterDuff.Mode
parameter of Drawable#setTintMode to be @NonNull. However,
some applications were still passing in null as a parameter.
This was fine in previous releases as the default implementation
of Drawable#setTintMode did not read this field. With the
recent changes to introduce the BlendMode API, the nullability
assumption broke for various apps that passed in null, causing
NullPointerExceptions to be thrown.

Instead, update the documentation to be nullable and internally
convert the parameter to the corresponding default for either
PorterDuff.Mode or BlendMode.

Test: Added CTS tests to verify null behavior for each setTintMode
overload
Bug: 129446670

Change-Id: I42a4b03d190e5a64df518b5c768b2c22853abf12
parent dadf251a
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment