Skip to content

Commit f20b916

Browse files
author
Sailesh Nepal
committed
Override StatusHints.equals
Bug: 16979621 Change-Id: I858a4718a8815be18214400d3bc1d9054b99434e
1 parent bab0111 commit f20b916

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

telecomm/java/android/telecomm/StatusHints.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import android.util.DisplayMetrics;
2828

2929
import java.util.MissingResourceException;
30+
import java.util.Objects;
3031

3132
/**
3233
* Contains status label and icon displayed in the in-call UI.
@@ -127,4 +128,22 @@ private Drawable getIcon(Context context, int resId) {
127128
return null;
128129
}
129130
}
131+
132+
@Override
133+
public boolean equals(Object other) {
134+
if (other != null && other instanceof StatusHints) {
135+
StatusHints otherHints = (StatusHints) other;
136+
return Objects.equals(otherHints.getComponentName(), getComponentName()) &&
137+
Objects.equals(otherHints.getLabel(), getLabel()) &&
138+
otherHints.getIconId() == getIconId() &&
139+
Objects.equals(otherHints.getExtras(), getExtras());
140+
}
141+
return false;
142+
}
143+
144+
@Override
145+
public int hashCode() {
146+
return Objects.hashCode(mComponentName) + Objects.hashCode(mLabel) + mIconId +
147+
Objects.hashCode(mExtras);
148+
}
130149
}

0 commit comments

Comments
 (0)