summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorRoboErik <epastern@google.com>2014-05-02 20:07:07 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2014-05-02 20:07:07 +0000
commit4f854e0d0b619596752b1874492efe2dabcc092b (patch)
tree4452921cfc09431c95a81836c7bcec730dcd2bc0 /media
parent9529d8f26fc635ed8742ed212a967f069c8e47c7 (diff)
parent66dea73906f24226a6f699759e79040726bde8b5 (diff)
downloadframeworks_base-4f854e0d0b619596752b1874492efe2dabcc092b.zip
frameworks_base-4f854e0d0b619596752b1874492efe2dabcc092b.tar.gz
frameworks_base-4f854e0d0b619596752b1874492efe2dabcc092b.tar.bz2
Merge "Add playback state and metadata to dump"
Diffstat (limited to 'media')
-rw-r--r--media/java/android/media/session/MediaMetadata.java9
-rw-r--r--media/java/android/media/session/PlaybackState.java14
2 files changed, 23 insertions, 0 deletions
diff --git a/media/java/android/media/session/MediaMetadata.java b/media/java/android/media/session/MediaMetadata.java
index 56bdf68..8a8af45 100644
--- a/media/java/android/media/session/MediaMetadata.java
+++ b/media/java/android/media/session/MediaMetadata.java
@@ -295,6 +295,15 @@ public final class MediaMetadata implements Parcelable {
}
/**
+ * Get the number of fields in this metadata.
+ *
+ * @return The number of fields in the metadata.
+ */
+ public int size() {
+ return mBundle.size();
+ }
+
+ /**
* Helper for getting the String key used by {@link MediaMetadata} from the
* integer key that {@link MediaMetadataEditor} uses.
*
diff --git a/media/java/android/media/session/PlaybackState.java b/media/java/android/media/session/PlaybackState.java
index 26eb9c4..3254e5d 100644
--- a/media/java/android/media/session/PlaybackState.java
+++ b/media/java/android/media/session/PlaybackState.java
@@ -225,6 +225,20 @@ public final class PlaybackState implements Parcelable {
}
@Override
+ public String toString() {
+ StringBuilder bob = new StringBuilder("PlaybackState {");
+ bob.append("state=").append(mState);
+ bob.append(", position=").append(mPosition);
+ bob.append(", buffered position=").append(mBufferPosition);
+ bob.append(", rate=").append(mRate);
+ bob.append(", updated=").append(mUpdateTime);
+ bob.append(", actions=").append(mActions);
+ bob.append(", error=").append(mErrorMessage);
+ bob.append("}");
+ return bob.toString();
+ }
+
+ @Override
public int describeContents() {
return 0;
}