Android-x86
Fork
Donation

  • R/O
  • HTTP
  • SSH
  • HTTPS

frameworks-base: Commit

frameworks/base


Commit MetaInfo

Revision23480d886e51c77f73088507cb0de79be4ad6dfc (tree)
Time2017-08-29 03:42:56
Authorandroid-build-team Robot <android-build-team-robot@goog...>
Commiterandroid-build-team Robot

Log Message

Merge cherrypicks of [2805728, 2805966] into oc-r5-release

Change-Id: I6062dd3859b7db54443bb63c7f2a7641c16b255b

Change Summary

Incremental Difference

--- a/media/java/android/media/MediaDescription.java
+++ b/media/java/android/media/MediaDescription.java
@@ -220,6 +220,33 @@ public class MediaDescription implements Parcelable {
220220 }
221221
222222 @Override
223+ public boolean equals(Object o) {
224+ if (o == null) {
225+ return false;
226+ }
227+
228+ if (!(o instanceof MediaDescription)){
229+ return false;
230+ }
231+
232+ final MediaDescription d = (MediaDescription) o;
233+
234+ if (!String.valueOf(mTitle).equals(String.valueOf(d.mTitle))) {
235+ return false;
236+ }
237+
238+ if (!String.valueOf(mSubtitle).equals(String.valueOf(d.mSubtitle))) {
239+ return false;
240+ }
241+
242+ if (!String.valueOf(mDescription).equals(String.valueOf(d.mDescription))) {
243+ return false;
244+ }
245+
246+ return true;
247+ }
248+
249+ @Override
223250 public String toString() {
224251 return mTitle + ", " + mSubtitle + ", " + mDescription;
225252 }
--- a/media/java/android/media/session/MediaSession.java
+++ b/media/java/android/media/session/MediaSession.java
@@ -48,6 +48,7 @@ import java.lang.annotation.Retention;
4848 import java.lang.annotation.RetentionPolicy;
4949 import java.lang.ref.WeakReference;
5050 import java.util.List;
51+import java.util.Objects;
5152
5253 /**
5354 * Allows interaction with media controllers, volume keys, media buttons, and
@@ -1256,6 +1257,28 @@ public final class MediaSession {
12561257 "Description=" + mDescription +
12571258 ", Id=" + mId + " }";
12581259 }
1260+
1261+ @Override
1262+ public boolean equals(Object o) {
1263+ if (o == null) {
1264+ return false;
1265+ }
1266+
1267+ if (!(o instanceof QueueItem)) {
1268+ return false;
1269+ }
1270+
1271+ final QueueItem item = (QueueItem) o;
1272+ if (mId != item.mId) {
1273+ return false;
1274+ }
1275+
1276+ if (!Objects.equals(mDescription, item.mDescription)) {
1277+ return false;
1278+ }
1279+
1280+ return true;
1281+ }
12591282 }
12601283
12611284 private static final class Command {
Show on old repository browser