Home | History | Annotate | Download | only in media
      1 /*
      2  * Copyright (C) 2016 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.car.media;
     17 
     18 import android.support.annotation.StringDef;
     19 
     20 import java.lang.annotation.Retention;
     21 import java.lang.annotation.RetentionPolicy;
     22 
     23 /**
     24  * Constants shared by SDK and 3rd party media apps.
     25  *
     26  */
     27 
     28 public class MediaConstants {
     29 
     30     /**
     31      * Action along with the media connection broadcast, which contains the current media
     32      * connection status.
     33      */
     34     public static final String ACTION_MEDIA_STATUS = "com.google.android.gms.car.media.STATUS";
     35 
     36     /**
     37      * Key for media connection status in extra.
     38      */
     39     public static final String MEDIA_CONNECTION_STATUS = "media_connection_status";
     40 
     41     @Retention(RetentionPolicy.SOURCE)
     42     @StringDef({MEDIA_CONNECTED, MEDIA_DISCONNECTED})
     43     public @interface ConnectionType {}
     44 
     45     /**
     46      * Type of connection status: current media is connected.
     47      */
     48     public static final String MEDIA_CONNECTED = "media_connected";
     49 
     50     /**
     51      * Type of connection status: current media is disconnected.
     52      */
     53     public static final String MEDIA_DISCONNECTED = "media_disconnected";
     54 
     55     /**
     56      * Key for extra feedback message in extra.
     57      */
     58     public static final String EXTRA_CUSTOM_ACTION_STATUS = "media_custom_action_status";
     59 
     60     /**
     61      * Extra along with playback state, which contains the message shown by toast.
     62      */
     63     public static final String EXTRA_TOAST_MESSAGE = "EXTRA_TOAST_MESSAGE";
     64 
     65     /**
     66      * Extra along with the Media Session, which contains if the slot of the action should be
     67      * always reserved for the queue action.
     68      */
     69     public static final String EXTRA_RESERVED_SLOT_QUEUE =
     70             "com.google.android.gms.car.media.ALWAYS_RESERVE_SPACE_FOR.ACTION_QUEUE";
     71 
     72     /**
     73      * Extra along with the Media Session, which contains if the slot of the action should be
     74      * always reserved for the skip to previous action.
     75      */
     76     public static final String EXTRA_RESERVED_SLOT_SKIP_TO_PREVIOUS =
     77             "com.google.android.gms.car.media.ALWAYS_RESERVE_SPACE_FOR.ACTION_SKIP_TO_PREVIOUS";
     78 
     79     /**
     80      * Extra along with the Media Session, which contains if the slot of the action should be
     81      * always reserved for the skip to next action.
     82      */
     83     public static final String EXTRA_RESERVED_SLOT_SKIP_TO_NEXT =
     84             "com.google.android.gms.car.media.ALWAYS_RESERVE_SPACE_FOR.ACTION_SKIP_TO_NEXT";
     85 
     86     /**
     87      * Extra along with custom action playback state to indicate a repeated action.
     88      */
     89     public static final String EXTRA_REPEATED_CUSTOM_ACTION_BUTTON =
     90             "com.google.android.gms.car.media.CUSTOM_ACTION.REPEATED_ACTIONS";
     91 
     92     /**
     93      * Extra along with custom action playback state to indicate a repeated custom action button
     94      * state.
     95      */
     96     public static final String EXTRA_REPEATED_CUSTOM_ACTION_BUTTON_ON_DOWN =
     97             "com.google.android.gms.car.media.CUSTOM_ACTION.ON_DOWN_EVENT";
     98 }
     99