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

Commit 6e287a57 authored by Treehugger Robot's avatar Treehugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Add equality to DrawableIcon" into main

parents 028cedc3 94246118
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -71,6 +71,7 @@ import com.android.systemui.qs.SideLabelTileLayout;
import com.android.systemui.qs.logging.QSLogger;
import com.android.systemui.qs.logging.QSLogger;


import java.io.PrintWriter;
import java.io.PrintWriter;
import java.util.Objects;


/**
/**
 * Base quick-settings tile, extend this to create a new tile.
 * 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() {
        public String toString() {
            return "DrawableIcon";
            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 {
    public static class DrawableIconWithRes extends DrawableIcon {