1 /* 2 * Copyright (C) 2014 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 package com.android.onemedia.playback; 17 18 import android.media.MediaMetadata; 19 import android.os.Bundle; 20 import android.os.Parcel; 21 import android.os.Parcelable; 22 23 /** 24 * TODO: Insert description here. (generated by epastern) 25 */ 26 public class MediaItem implements Parcelable { 27 private Bundle mBundle; 28 29 public MediaItem() { 30 31 } 32 33 private MediaItem(Parcel in) { 34 mBundle = in.readBundle(); 35 } 36 37 public String getTitle() { 38 return mBundle.getString(MediaMetadata.METADATA_KEY_TITLE); 39 } 40 41 public String getArtist() { 42 return mBundle.getString(MediaMetadata.METADATA_KEY_ALBUM_ARTIST); 43 } 44 45 /* (non-Javadoc) 46 * @see android.os.Parcelable#describeContents() 47 */ 48 @Override 49 public int describeContents() { 50 // TODO(epastern): Auto-generated method stub 51 return 0; 52 } 53 54 /* 55 * (non-Javadoc) 56 * @see android.os.Parcelable#writeToParcel(android.os.Parcel, int) 57 */ 58 @Override 59 public void writeToParcel(Parcel dest, int flags) { 60 dest.writeBundle(mBundle); 61 } 62 63 public static final Parcelable.Creator<MediaItem> CREATOR 64 = new Parcelable.Creator<MediaItem>() { 65 public MediaItem createFromParcel(Parcel in) { 66 return new MediaItem(in); 67 } 68 69 public MediaItem[] newArray(int size) { 70 return new MediaItem[size]; 71 } 72 }; 73 74 } 75