107c7077c54717dbbf2c401ea32d00fa6df6d77c6RoboErik/* 207c7077c54717dbbf2c401ea32d00fa6df6d77c6RoboErik * Copyright (C) 2014 The Android Open Source Project 307c7077c54717dbbf2c401ea32d00fa6df6d77c6RoboErik * 407c7077c54717dbbf2c401ea32d00fa6df6d77c6RoboErik * Licensed under the Apache License, Version 2.0 (the "License"); 507c7077c54717dbbf2c401ea32d00fa6df6d77c6RoboErik * you may not use this file except in compliance with the License. 607c7077c54717dbbf2c401ea32d00fa6df6d77c6RoboErik * You may obtain a copy of the License at 707c7077c54717dbbf2c401ea32d00fa6df6d77c6RoboErik * 807c7077c54717dbbf2c401ea32d00fa6df6d77c6RoboErik * http://www.apache.org/licenses/LICENSE-2.0 907c7077c54717dbbf2c401ea32d00fa6df6d77c6RoboErik * 1007c7077c54717dbbf2c401ea32d00fa6df6d77c6RoboErik * Unless required by applicable law or agreed to in writing, software 1107c7077c54717dbbf2c401ea32d00fa6df6d77c6RoboErik * distributed under the License is distributed on an "AS IS" BASIS, 1207c7077c54717dbbf2c401ea32d00fa6df6d77c6RoboErik * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1307c7077c54717dbbf2c401ea32d00fa6df6d77c6RoboErik * See the License for the specific language governing permissions and 1407c7077c54717dbbf2c401ea32d00fa6df6d77c6RoboErik * limitations under the License. 1507c7077c54717dbbf2c401ea32d00fa6df6d77c6RoboErik */ 16bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErikpackage com.android.onemedia.playback; 17bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik 18bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErikimport android.os.Bundle; 19bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik 20bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErikimport java.util.HashMap; 21bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErikimport java.util.Map; 22bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik 23bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik/** 24bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik * TODO: Insert description here. (generated by epastern) 25bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik */ 26bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErikpublic class RequestUtils { 27bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik public static final String ACTION_SET_CONTENT = "set_content"; 28bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik public static final String ACTION_SET_NEXT_CONTENT = "set_next_content"; 2945f7ee8201efbda59b57b1fe637a1b9ffef25bb6Daniel Sandler public static final String ACTION_PAUSE = "com.android.onemedia.pause"; 3045f7ee8201efbda59b57b1fe637a1b9ffef25bb6Daniel Sandler public static final String ACTION_PLAY = "com.android.onemedia.play"; 3145f7ee8201efbda59b57b1fe637a1b9ffef25bb6Daniel Sandler public static final String ACTION_REW = "com.android.onemedia.rew"; 3245f7ee8201efbda59b57b1fe637a1b9ffef25bb6Daniel Sandler public static final String ACTION_FFWD = "com.android.onemedia.ffwd"; 3345f7ee8201efbda59b57b1fe637a1b9ffef25bb6Daniel Sandler public static final String ACTION_PREV = "com.android.onemedia.prev"; 3445f7ee8201efbda59b57b1fe637a1b9ffef25bb6Daniel Sandler public static final String ACTION_NEXT = "com.android.onemedia.next"; 35bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik 36bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik public static final String EXTRA_KEY_SOURCE = "source"; 37bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik public static final String EXTRA_KEY_METADATA = "metadata"; 38bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik public static final String EXTRA_KEY_HEADERS = "headers"; 39bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik 40bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik private RequestUtils() { 41bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik } 42bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik 43bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik public static class ContentBuilder { 44bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik private Bundle mBundle; 45bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik 46bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik public ContentBuilder() { 47bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik mBundle = new Bundle(); 48bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik } 49bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik 50bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik public ContentBuilder setSource(String source) { 51bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik mBundle.putString(EXTRA_KEY_SOURCE, source); 52bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik return this; 53bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik } 54bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik 55bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik /** 56bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik * @see MediaItemMetadata 57bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik * @param metadata The metadata for this item 58bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik */ 59bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik public ContentBuilder setMetadata(Bundle metadata) { 60bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik mBundle.putBundle(EXTRA_KEY_METADATA, metadata); 61bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik return this; 62bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik } 63bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik 64bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik public ContentBuilder setHeaders(HashMap<String, String> headers) { 65bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik mBundle.putSerializable(EXTRA_KEY_HEADERS, headers); 66bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik return this; 67bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik } 68bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik 69bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik public Bundle build() { 70bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik return mBundle; 71bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik } 72bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik } 73bfa153b64b4e8c2faa39a15e87fc9f0300335f20RoboErik} 74