diff options
| -rw-r--r-- | packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java index 7c2d50c9a3a3..9abc494e56e6 100644 --- a/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java +++ b/packages/SystemUI/src/com/android/systemui/qs/tileimpl/QSTileImpl.java @@ -71,6 +71,7 @@ import com.android.systemui.qs.SideLabelTileLayout; import com.android.systemui.qs.logging.QSLogger; import java.io.PrintWriter; +import java.util.Objects; /** * Base quick-settings tile, extend this to create a new tile. @@ -668,6 +669,18 @@ public abstract class QSTileImpl<TState extends State> implements QSTile, Lifecy public String toString() { return "DrawableIcon"; } + + @Override + public boolean equals(@Nullable Object other) { + // No need to compare equality of the mInvisibleDrawable as that's generated from + // mDrawable's constant state. + return other instanceof DrawableIcon && ((DrawableIcon) other).mDrawable == mDrawable; + } + + @Override + public int hashCode() { + return Objects.hash(mDrawable); + } } public static class DrawableIconWithRes extends DrawableIcon { |