Merge changes from topic "avrcp_cherry_picks"
* changes: Bluetooth: Add AVRCP 1.3 as a developer option for AVRCP version (1/2) Add equal overloads to some MediaDescription and MediaQueue objects (2/3)
This commit is contained in:
@@ -219,6 +219,33 @@ public class MediaDescription implements Parcelable {
|
||||
dest.writeParcelable(mMediaUri, flags);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(o instanceof MediaDescription)){
|
||||
return false;
|
||||
}
|
||||
|
||||
final MediaDescription d = (MediaDescription) o;
|
||||
|
||||
if (!String.valueOf(mTitle).equals(String.valueOf(d.mTitle))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!String.valueOf(mSubtitle).equals(String.valueOf(d.mSubtitle))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!String.valueOf(mDescription).equals(String.valueOf(d.mDescription))) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return mTitle + ", " + mSubtitle + ", " + mDescription;
|
||||
|
||||
@@ -48,6 +48,7 @@ import java.lang.annotation.Retention;
|
||||
import java.lang.annotation.RetentionPolicy;
|
||||
import java.lang.ref.WeakReference;
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
|
||||
/**
|
||||
* Allows interaction with media controllers, volume keys, media buttons, and
|
||||
@@ -1256,6 +1257,28 @@ public final class MediaSession {
|
||||
"Description=" + mDescription +
|
||||
", Id=" + mId + " }";
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (o == null) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!(o instanceof QueueItem)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
final QueueItem item = (QueueItem) o;
|
||||
if (mId != item.mId) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (!Objects.equals(mDescription, item.mDescription)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
private static final class Command {
|
||||
|
||||
@@ -105,6 +105,7 @@
|
||||
<!-- Titles for Bluetooth AVRCP Versions -->
|
||||
<string-array name="bluetooth_avrcp_versions">
|
||||
<item>AVRCP 1.4 (Default)</item>
|
||||
<item>AVRCP 1.3</item>
|
||||
<item>AVRCP 1.5</item>
|
||||
<item>AVRCP 1.6</item>
|
||||
</string-array>
|
||||
@@ -112,6 +113,7 @@
|
||||
<!-- Values for Bluetooth AVRCP Versions -->
|
||||
<string-array name="bluetooth_avrcp_version_values">
|
||||
<item>avrcp14</item>
|
||||
<item>avrcp13</item>
|
||||
<item>avrcp15</item>
|
||||
<item>avrcp16</item>
|
||||
</string-array>
|
||||
|
||||
Reference in New Issue
Block a user