Minor tweaks to MediaBrowser

-A swapped the param order on MediaBrowser.MediaItem constructor
-Added a missing aidl file for MediaItem

bug:17205016
Change-Id: I61538d76f76a993ed5a47b881e0d291fef1d8db3
This commit is contained in:
RoboErik
2014-09-05 10:32:20 -07:00
parent 14f717a506
commit 5dfa0a5f7a
5 changed files with 26 additions and 6 deletions

View File

@@ -489,8 +489,11 @@ aidl_files := \
frameworks/base/location/java/android/location/FusedBatchOptions.aidl \
frameworks/base/location/java/com/android/internal/location/ProviderProperties.aidl \
frameworks/base/location/java/com/android/internal/location/ProviderRequest.aidl \
frameworks/base/media/java/android/media/AudioAttributes.aidl \
frameworks/base/media/java/android/media/MediaDescription.aidl \
frameworks/base/media/java/android/media/MediaMetadata.aidl \
frameworks/base/media/java/android/media/Rating.aidl \
frameworks/base/media/java/android/media/browse/MediaBrowser.aidl \
frameworks/base/media/java/android/media/session/MediaSession.aidl \
frameworks/base/media/java/android/media/session/PlaybackState.aidl \
frameworks/base/telephony/java/android/telephony/ServiceState.aidl \

View File

@@ -16275,7 +16275,7 @@ package android.media.browse {
}
public static class MediaBrowser.MediaItem implements android.os.Parcelable {
ctor public MediaBrowser.MediaItem(int, android.media.MediaDescription);
ctor public MediaBrowser.MediaItem(android.media.MediaDescription, int);
method public int describeContents();
method public android.media.MediaDescription getDescription();
method public int getFlags();

View File

@@ -0,0 +1,18 @@
/* Copyright 2014, The Android Open Source Project
**
** Licensed under the Apache License, Version 2.0 (the "License");
** you may not use this file except in compliance with the License.
** You may obtain a copy of the License at
**
** http://www.apache.org/licenses/LICENSE-2.0
**
** Unless required by applicable law or agreed to in writing, software
** distributed under the License is distributed on an "AS IS" BASIS,
** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
** See the License for the specific language governing permissions and
** limitations under the License.
*/
package android.media.browse;
parcelable MediaBrowser.MediaItem;

View File

@@ -544,12 +544,11 @@ public final class MediaBrowser {
/**
* Create a new MediaItem for use in browsing media.
*
* @param flags The flags for this item.
* @param description The description of the media, which must include a
* media id.
* @param flags The flags for this item.
*/
public MediaItem(@Flags int flags, @NonNull MediaDescription description) {
public MediaItem(@NonNull MediaDescription description, @Flags int flags) {
if (description == null) {
throw new IllegalArgumentException("description cannot be null");
}

View File

@@ -134,8 +134,8 @@ public class BrowserService extends MediaBrowserService {
bob.setSubtitle("Summary " + i);
bob.setMediaId(Uri.withAppendedPath(BASE_URI,
Integer.toString(i)).toString());
list.add(new MediaBrowser.MediaItem(MediaBrowser.MediaItem.FLAG_BROWSABLE,
bob.build()));
list.add(new MediaBrowser.MediaItem(bob.build(),
MediaBrowser.MediaItem.FLAG_BROWSABLE));
}
result.sendResult(list);