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.radio.service; 17 18 import com.android.car.radio.service.RadioStation; 19 import com.android.car.radio.service.RadioRds; 20 21 /** 22 * Interface for applications to listen for changes in the current radio state. 23 */ 24 oneway interface IRadioCallback { 25 /** 26 * Called upon successful completion of a switch in radio stations. 27 * 28 * @param station A {@link RadioStation} object that contains the data for the now current radio 29 * station. 30 */ onRadioStationChanged(in RadioStation station)31 void onRadioStationChanged(in RadioStation station); 32 33 /** 34 * Called when only the metadata for the current station has changed. 35 * 36 * @param radioRds A {@link RadioRds} object that contains the updated metadata. 37 */ onRadioMetadataChanged(in RadioRds radioRds)38 void onRadioMetadataChanged(in RadioRds radioRds); 39 40 /** 41 * Called when the current radio band has changed. 42 * 43 * @param radioBand A radio band value from {@link RadioManager}. 44 */ onRadioBandChanged(int radioBand)45 void onRadioBandChanged(int radioBand); 46 47 /** 48 * Called when the mute state of the radio has changed. 49 * 50 * @param isMuted {@code true} if the radio is muted. 51 */ onRadioMuteChanged(boolean isMuted)52 void onRadioMuteChanged(boolean isMuted); 53 54 /** 55 * Called when the radio has encountered an error. 56 * 57 * @param status One of the error states in {@link RadioManager}. For example, 58 * {@link RadioManager#ERROR_HARDWARE_FAILURE}. 59 */ onError(int status)60 void onError(int status); 61 } 62