1/* 2 * Copyright (C) 2015 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 17package android.car.hardware.radio; 18 19import android.car.hardware.radio.CarRadioPreset; 20import android.car.hardware.radio.ICarRadioEventListener; 21 22/** @hide */ 23interface ICarRadio { 24 /** 25 * Returns the number of hard presets on the radio unit that may be programmed. 26 */ 27 int getPresetCount() = 0; 28 29 /** 30 * Registers the client for updates to radio changes. 31 */ 32 void registerListener(in ICarRadioEventListener callback) = 1; 33 34 /** 35 * Unregisters the client for updates to radio changes. 36 */ 37 void unregisterListener(in ICarRadioEventListener callback) = 2; 38 39 /** 40 * Gets the preset values stored for a particular preset number. 41 */ 42 CarRadioPreset getPreset(int presetNumber) = 3; 43 44 /** 45 * Sets a specified preset (hard button) in the car. In order to check for success listen to 46 * events using {@link registerOrUpdateRadioListener}. 47 */ 48 boolean setPreset(in CarRadioPreset preset) = 4; 49} 50