Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c10e3960 authored by Alan Viverette's avatar Alan Viverette
Browse files

Deprecate Resources.getDrawable(int) in favor of the two-arg version

This is a landmine for developers. If they need to obtain an unthemed
drawable, they should be using an explicit null theme.

BUG: 18579576
Change-Id: Ibca6b4c3e8e50dca144571244e035caec6fa91f8
parent 41ec0400
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -744,7 +744,10 @@ public class Resources {
     * @throws NotFoundException Throws NotFoundException if the given ID does
     *         not exist.
     * @see #getDrawable(int, Theme)
     * @deprecated Use {@link #getDrawable(int, Theme)} instead.
     */
    @Deprecated
    @Nullable
    public Drawable getDrawable(int id) throws NotFoundException {
        final Drawable d = getDrawable(id, null);
        if (d != null && d.canApplyTheme()) {
@@ -769,6 +772,7 @@ public class Resources {
     * @throws NotFoundException Throws NotFoundException if the given ID does
     *         not exist.
     */
    @Nullable
    public Drawable getDrawable(int id, @Nullable Theme theme) throws NotFoundException {
        TypedValue value;
        synchronized (mAccessLock) {