Tomasz Wasilczyk | 803301a | 2017-03-13 14:30:15 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2017 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 | |
| 17 | package android.hardware.broadcastradio@1.1; |
| 18 | |
| 19 | import @1.0::IBroadcastRadio; |
| 20 | |
| 21 | interface IBroadcastRadio extends @1.0::IBroadcastRadio { |
| 22 | |
Andreas Huber | 40d3a9b | 2017-03-28 16:19:16 -0700 | [diff] [blame] | 23 | /** |
Tomasz Wasilczyk | 803301a | 2017-03-13 14:30:15 -0700 | [diff] [blame] | 24 | * Retrieve implementation properties. |
| 25 | * @return properties A Properties structure containing implementation |
| 26 | * description and capabilities. |
| 27 | */ |
| 28 | getProperties_1_1() generates (Properties properties); |
| 29 | |
Tomasz Wasilczyk | ba3e254 | 2017-07-17 13:59:21 -0700 | [diff] [blame] | 30 | /** |
| 31 | * Fetch image from radio module. |
| 32 | * |
| 33 | * This call is meant to make V1_0::MetaData lightweight - instead of |
Tomasz Wasilczyk | 9214894 | 2017-07-31 15:04:35 -0700 | [diff] [blame] | 34 | * passing an image data blob in the MetadataType.RAW field, the HAL |
| 35 | * implementation only passes the identifier, so the client may cache images |
| 36 | * or even not fetch them. |
Tomasz Wasilczyk | ba3e254 | 2017-07-17 13:59:21 -0700 | [diff] [blame] | 37 | * |
Tomasz Wasilczyk | 9214894 | 2017-07-31 15:04:35 -0700 | [diff] [blame] | 38 | * The identifier may be any arbitrary number - sequential, sha256 prefix, |
Tomasz Wasilczyk | ba3e254 | 2017-07-17 13:59:21 -0700 | [diff] [blame] | 39 | * or any other unique value selected by the vendor. |
| 40 | * |
| 41 | * The data should be a valid PNG, JPEG, GIF or BMP file. |
Tomasz Wasilczyk | 9214894 | 2017-07-31 15:04:35 -0700 | [diff] [blame] | 42 | * Image data with an invalid format must be handled gracefully in the same |
| 43 | * way as a missing image. |
Tomasz Wasilczyk | ba3e254 | 2017-07-17 13:59:21 -0700 | [diff] [blame] | 44 | * |
Tomasz Wasilczyk | b8a2afe | 2017-08-01 10:52:18 -0700 | [diff] [blame] | 45 | * The image identifier may become invalid after some time from passing it |
| 46 | * with metadata struct (due to resource cleanup at the HAL implementation). |
| 47 | * However, it must remain valid for a currently tuned program at least |
| 48 | * until currentProgramInfoChanged or programListChanged is called and |
| 49 | * metadata changes for the current program. |
| 50 | * |
| 51 | * There is still a race condition possible (if the HAL deletes the old |
| 52 | * image immediately after notifying about the new one) between |
| 53 | * currentProgramInfoChanged callback propagating through the framework and |
| 54 | * the HAL implementation removing previous image. In such case, client |
| 55 | * application may expect the new currentProgramInfoChanged callback with |
| 56 | * updated image identifier. |
| 57 | * |
Tomasz Wasilczyk | ba3e254 | 2017-07-17 13:59:21 -0700 | [diff] [blame] | 58 | * @param id Identifier of an image; |
| 59 | * value of 0 is reserved and should be treated as invalid image. |
| 60 | * @return image A binary blob with image data |
Tomasz Wasilczyk | 9214894 | 2017-07-31 15:04:35 -0700 | [diff] [blame] | 61 | * or a zero-length vector if identifier doesn't exist. |
Tomasz Wasilczyk | ba3e254 | 2017-07-17 13:59:21 -0700 | [diff] [blame] | 62 | */ |
| 63 | getImage(int32_t id) generates (vec<uint8_t> image); |
Tomasz Wasilczyk | 803301a | 2017-03-13 14:30:15 -0700 | [diff] [blame] | 64 | }; |