summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTomasz Wasilczyk2018-06-05 12:10:39 -0500
committerScott Randolph2018-06-07 17:19:27 -0500
commitb557e0b748f874a5abe4282d244cb696fa626811 (patch)
treed7f6298035725a3d09d28d8e9ec0f3b4501c0d90
parent62fd03d8e64f368fadce4a972ead88404f94b21d (diff)
downloadplatform-hardware-interfaces-b557e0b748f874a5abe4282d244cb696fa626811.tar.gz
platform-hardware-interfaces-b557e0b748f874a5abe4282d244cb696fa626811.tar.xz
platform-hardware-interfaces-b557e0b748f874a5abe4282d244cb696fa626811.zip
Fix comments and internal names about SEEK operation.
Legacy radio HAL named it SCAN and the name slipped through HAL 1.x into HAL 2.0. I finally noticed it after HAL 2.0 was locked down. Bug: 109740376 Test: build ow Change-Id: I5ca4147227a7dd0c32248a279f03fb632d97258e
-rw-r--r--broadcastradio/2.0/ITunerCallback.hal3
-rw-r--r--broadcastradio/2.0/ITunerSession.hal21
-rw-r--r--broadcastradio/2.0/default/TunerSession.cpp10
-rw-r--r--broadcastradio/2.0/default/VirtualProgram.h4
-rw-r--r--broadcastradio/2.0/types.hal17
-rw-r--r--broadcastradio/2.0/vts/functional/VtsHalBroadcastradioV2_0TargetTest.cpp12
-rw-r--r--current.txt8
7 files changed, 42 insertions, 33 deletions
diff --git a/broadcastradio/2.0/ITunerCallback.hal b/broadcastradio/2.0/ITunerCallback.hal
index b20a0b2d..a174c9ce 100644
--- a/broadcastradio/2.0/ITunerCallback.hal
+++ b/broadcastradio/2.0/ITunerCallback.hal
@@ -18,7 +18,8 @@ package android.hardware.broadcastradio@2.0;
18interface ITunerCallback { 18interface ITunerCallback {
19 /** 19 /**
20 * Method called by the HAL when a tuning operation fails asynchronously 20 * Method called by the HAL when a tuning operation fails asynchronously
21 * following a step(), scan() or tune() command. 21 * following ITunerSession::tune(), ITunerSession::scan() or
22 * ITunerSession::step().
22 * 23 *
23 * This callback is only called when the step(), scan() or tune() command 24 * This callback is only called when the step(), scan() or tune() command
24 * returned OK at first. 25 * returned OK at first.
diff --git a/broadcastradio/2.0/ITunerSession.hal b/broadcastradio/2.0/ITunerSession.hal
index e891a234..3c27246f 100644
--- a/broadcastradio/2.0/ITunerSession.hal
+++ b/broadcastradio/2.0/ITunerSession.hal
@@ -19,7 +19,7 @@ interface ITunerSession {
19 /** 19 /**
20 * Tune to a specified program. 20 * Tune to a specified program.
21 * 21 *
22 * Automatically cancels pending scan, step or tune. 22 * Automatically cancels pending tune(), scan() or step().
23 * If the method returns OK, tuneFailed or currentProgramInfoChanged 23 * If the method returns OK, tuneFailed or currentProgramInfoChanged
24 * callback must be called. 24 * callback must be called.
25 * 25 *
@@ -33,9 +33,16 @@ interface ITunerSession {
33 tune(ProgramSelector program) generates (Result result); 33 tune(ProgramSelector program) generates (Result result);
34 34
35 /** 35 /**
36 * Tune to the next valid program. 36 * Tune (seek) to the next valid program on the "air".
37 * 37 *
38 * Automatically cancels pending scan, step or tune. 38 * This might more naturally be called "seek" but for legacy reasons, the
39 * entry point remains "scan". This should not be confused with the actual
40 * scan operation (where the radio seeks through programs in a loop until
41 * user chooses to stay on one of them) nor background scan operation (that
42 * a tuner may do in order to locate all available programs. This function
43 * is meant to advance to the next detected program and stay there.
44 *
45 * Automatically cancels pending tune(), scan() or step().
39 * If the method returns OK, tuneFailed or currentProgramInfoChanged 46 * If the method returns OK, tuneFailed or currentProgramInfoChanged
40 * callback must be called. 47 * callback must be called.
41 * 48 *
@@ -44,20 +51,20 @@ interface ITunerSession {
44 * - DAB secondary service. 51 * - DAB secondary service.
45 * 52 *
46 * As an implementation detail, the HAL has the option to perform an actual 53 * As an implementation detail, the HAL has the option to perform an actual
47 * scan or select the next program from the list retrieved in the 54 * seek or select the next program from the list retrieved in the
48 * background, if one is not stale. 55 * background, if one is not stale.
49 * 56 *
50 * @param directionUp True to change towards higher numeric values 57 * @param directionUp True to change towards higher numeric values
51 * (frequency, channel number), false towards lower. 58 * (frequency, channel number), false towards lower.
52 * @param skipSubChannel Don't tune to subchannels. 59 * @param skipSubChannel Don't tune to subchannels.
53 * @return result OK if the scan has successfully started. 60 * @return result OK if the operation has successfully started.
54 */ 61 */
55 scan(bool directionUp, bool skipSubChannel) generates (Result result); 62 scan(bool directionUp, bool skipSubChannel) generates (Result result);
56 63
57 /** 64 /**
58 * Tune to the adjacent channel, which may not be occupied by any program. 65 * Tune to the adjacent channel, which may not be occupied by any program.
59 * 66 *
60 * Automatically cancels pending scan, step or tune. 67 * Automatically cancels pending tune(), scan() or step().
61 * If the method returns OK, tuneFailed or currentProgramInfoChanged 68 * If the method returns OK, tuneFailed or currentProgramInfoChanged
62 * callback must be called. 69 * callback must be called.
63 * 70 *
@@ -70,7 +77,7 @@ interface ITunerSession {
70 step(bool directionUp) generates (Result result); 77 step(bool directionUp) generates (Result result);
71 78
72 /** 79 /**
73 * Cancel a scan, step or tune operation. 80 * Cancel a pending tune(), scan() or step().
74 * 81 *
75 * If there is no such operation running, the call must be ignored. 82 * If there is no such operation running, the call must be ignored.
76 */ 83 */
diff --git a/broadcastradio/2.0/default/TunerSession.cpp b/broadcastradio/2.0/default/TunerSession.cpp
index 56a35087..da975620 100644
--- a/broadcastradio/2.0/default/TunerSession.cpp
+++ b/broadcastradio/2.0/default/TunerSession.cpp
@@ -42,7 +42,7 @@ using std::vector;
42 42
43namespace delay { 43namespace delay {
44 44
45static constexpr auto scan = 200ms; 45static constexpr auto seek = 200ms;
46static constexpr auto step = 100ms; 46static constexpr auto step = 100ms;
47static constexpr auto tune = 150ms; 47static constexpr auto tune = 150ms;
48static constexpr auto list = 1s; 48static constexpr auto list = 1s;
@@ -131,11 +131,11 @@ Return<Result> TunerSession::scan(bool directionUp, bool /* skipSubChannel */) {
131 if (list.empty()) { 131 if (list.empty()) {
132 mIsTuneCompleted = false; 132 mIsTuneCompleted = false;
133 auto task = [this, directionUp]() { 133 auto task = [this, directionUp]() {
134 ALOGI("Performing failed scan up=%d", directionUp); 134 ALOGI("Performing failed seek up=%d", directionUp);
135 135
136 mCallback->onTuneFailed(Result::TIMEOUT, {}); 136 mCallback->onTuneFailed(Result::TIMEOUT, {});
137 }; 137 };
138 mThread.schedule(task, delay::scan); 138 mThread.schedule(task, delay::seek);
139 139
140 return Result::OK; 140 return Result::OK;
141 } 141 }
@@ -162,12 +162,12 @@ Return<Result> TunerSession::scan(bool directionUp, bool /* skipSubChannel */) {
162 162
163 mIsTuneCompleted = false; 163 mIsTuneCompleted = false;
164 auto task = [this, tuneTo, directionUp]() { 164 auto task = [this, tuneTo, directionUp]() {
165 ALOGI("Performing scan up=%d", directionUp); 165 ALOGI("Performing seek up=%d", directionUp);
166 166
167 lock_guard<mutex> lk(mMut); 167 lock_guard<mutex> lk(mMut);
168 tuneInternalLocked(tuneTo); 168 tuneInternalLocked(tuneTo);
169 }; 169 };
170 mThread.schedule(task, delay::scan); 170 mThread.schedule(task, delay::seek);
171 171
172 return Result::OK; 172 return Result::OK;
173} 173}
diff --git a/broadcastradio/2.0/default/VirtualProgram.h b/broadcastradio/2.0/default/VirtualProgram.h
index e1c4f759..65026164 100644
--- a/broadcastradio/2.0/default/VirtualProgram.h
+++ b/broadcastradio/2.0/default/VirtualProgram.h
@@ -40,8 +40,8 @@ struct VirtualProgram {
40 operator ProgramInfo() const; 40 operator ProgramInfo() const;
41 41
42 /** 42 /**
43 * Defines order on how virtual programs appear on the "air" with 43 * Defines order in which virtual programs appear on the "air" with
44 * ITunerSession::scan operation. 44 * ITunerSession::scan().
45 * 45 *
46 * It's for default implementation purposes, may not be complete or correct. 46 * It's for default implementation purposes, may not be complete or correct.
47 */ 47 */
diff --git a/broadcastradio/2.0/types.hal b/broadcastradio/2.0/types.hal
index 1ce61dfe..987572a4 100644
--- a/broadcastradio/2.0/types.hal
+++ b/broadcastradio/2.0/types.hal
@@ -184,18 +184,20 @@ struct AmFmRegionConfig {
184 * lowerBound + channelNumber * spacing, up to upperBound. 184 * lowerBound + channelNumber * spacing, up to upperBound.
185 */ 185 */
186struct AmFmBandRange { 186struct AmFmBandRange {
187 /** The frequency of the first channel within the range. */ 187 /** The frequency (in kHz) of the first channel within the range. */
188 uint32_t lowerBound; 188 uint32_t lowerBound;
189 189
190 /** The frequency of the last channel within the range. */ 190 /** The frequency (in kHz) of the last channel within the range. */
191 uint32_t upperBound; 191 uint32_t upperBound;
192 192
193 /** Channel grid resolution, how far apart are the channels. */ 193 /** Channel grid resolution (in kHz), how far apart are the channels. */
194 uint32_t spacing; 194 uint32_t spacing;
195 195
196 /** 196 /**
197 * Spacing used when scanning for channels. It's a multiply of spacing and 197 * Channel spacing (in kHz) used to speed up seeking to the next station
198 * allows to skip some channels when scanning to make it faster. 198 * via the ITunerSession::scan() operation.
199 *
200 * It must be a multiple of channel grid resolution.
199 * 201 *
200 * Tuner may first quickly check every n-th channel and if it detects echo 202 * Tuner may first quickly check every n-th channel and if it detects echo
201 * from a station, it fine-tunes to find the exact frequency. 203 * from a station, it fine-tunes to find the exact frequency.
@@ -415,9 +417,10 @@ enum ProgramInfoFlags : uint32_t {
415 TRAFFIC_ANNOUNCEMENT = 1 << 3, 417 TRAFFIC_ANNOUNCEMENT = 1 << 3,
416 418
417 /** 419 /**
418 * Tuned to a program (not playing a static). 420 * Tuned to a program (not playing static).
419 * 421 *
420 * It's the same condition that would stop scan() operation. 422 * It's the same condition that would stop a seek operation
423 * (ie: ITunerSession::scan()).
421 * 424 *
422 * By definition, this flag must be set for all items on the program list. 425 * By definition, this flag must be set for all items on the program list.
423 */ 426 */
diff --git a/broadcastradio/2.0/vts/functional/VtsHalBroadcastradioV2_0TargetTest.cpp b/broadcastradio/2.0/vts/functional/VtsHalBroadcastradioV2_0TargetTest.cpp
index 62b00379..3d7039dc 100644
--- a/broadcastradio/2.0/vts/functional/VtsHalBroadcastradioV2_0TargetTest.cpp
+++ b/broadcastradio/2.0/vts/functional/VtsHalBroadcastradioV2_0TargetTest.cpp
@@ -308,7 +308,7 @@ static bool supportsFM(const AmFmRegionConfig& config) {
308 * - there is at least one AM/FM band configured; 308 * - there is at least one AM/FM band configured;
309 * - FM Deemphasis and RDS are correctly configured for FM-capable radio; 309 * - FM Deemphasis and RDS are correctly configured for FM-capable radio;
310 * - all channel grids (frequency ranges and spacings) are valid; 310 * - all channel grids (frequency ranges and spacings) are valid;
311 * - scan spacing is a multiply of manual spacing value. 311 * - seek spacing is a multiple of the manual spacing value.
312 */ 312 */
313TEST_F(BroadcastRadioHalTest, GetAmFmRegionConfig) { 313TEST_F(BroadcastRadioHalTest, GetAmFmRegionConfig) {
314 AmFmRegionConfig config; 314 AmFmRegionConfig config;
@@ -341,7 +341,7 @@ TEST_F(BroadcastRadioHalTest, GetAmFmRegionConfig) {
341 * - there is at least one AM/FM range supported; 341 * - there is at least one AM/FM range supported;
342 * - there is at least one de-emphasis filter mode supported for FM-capable radio; 342 * - there is at least one de-emphasis filter mode supported for FM-capable radio;
343 * - all channel grids (frequency ranges and spacings) are valid; 343 * - all channel grids (frequency ranges and spacings) are valid;
344 * - scan spacing is not set. 344 * - seek spacing is not set.
345 */ 345 */
346TEST_F(BroadcastRadioHalTest, GetAmFmRegionConfigCapabilities) { 346TEST_F(BroadcastRadioHalTest, GetAmFmRegionConfigCapabilities) {
347 AmFmRegionConfig config; 347 AmFmRegionConfig config;
@@ -501,14 +501,14 @@ TEST_F(BroadcastRadioHalTest, TuneFailsWithEmpty) {
501} 501}
502 502
503/** 503/**
504 * Test scanning to next/prev station. 504 * Test seeking to next/prev station via ITunerSession::scan().
505 * 505 *
506 * Verifies that: 506 * Verifies that:
507 * - the method succeeds; 507 * - the method succeeds;
508 * - the program info is changed within timeout::tune; 508 * - the program info is changed within timeout::tune;
509 * - works both directions and with or without skipping sub-channel. 509 * - works both directions and with or without skipping sub-channel.
510 */ 510 */
511TEST_F(BroadcastRadioHalTest, Scan) { 511TEST_F(BroadcastRadioHalTest, Seek) {
512 ASSERT_TRUE(openSession()); 512 ASSERT_TRUE(openSession());
513 513
514 // TODO(b/69958777): see FmTune workaround 514 // TODO(b/69958777): see FmTune workaround
@@ -564,8 +564,8 @@ TEST_F(BroadcastRadioHalTest, Cancel) {
564 ASSERT_TRUE(openSession()); 564 ASSERT_TRUE(openSession());
565 565
566 for (int i = 0; i < 10; i++) { 566 for (int i = 0; i < 10; i++) {
567 auto scanResult = mSession->scan(true /* up */, true /* skip subchannel */); 567 auto result = mSession->scan(true /* up */, true /* skip subchannel */);
568 ASSERT_EQ(Result::OK, scanResult); 568 ASSERT_EQ(Result::OK, result);
569 569
570 auto cancelResult = mSession->cancel(); 570 auto cancelResult = mSession->cancel();
571 ASSERT_TRUE(cancelResult.isOk()); 571 ASSERT_TRUE(cancelResult.isOk());
diff --git a/current.txt b/current.txt
index 05e8a1fd..81cdb661 100644
--- a/current.txt
+++ b/current.txt
@@ -251,8 +251,6 @@ c8bc853546dd55584611def2a9fa1d99f657e3366c976d2f60fe6b8aa6d2cb87 android.hardwar
251 251
252# ABI preserving changes to HALs during Android P 252# ABI preserving changes to HALs during Android P
2539e7a0b650d0e461ece2cfec0e1072abf8676f592b41a7fb48f01e88fc3c8f780 android.hardware.broadcastradio@1.0::types 2539e7a0b650d0e461ece2cfec0e1072abf8676f592b41a7fb48f01e88fc3c8f780 android.hardware.broadcastradio@1.0::types
254eaeb3e4f3237430a7fdc206bffdf844713f5682990b2d49ea24392e15b5d343f android.hardware.broadcastradio@2.0::ITunerCallback
2552804120c1f8522ad15feb7695fe5eece527d399b406c671ea99618194118c316 android.hardware.broadcastradio@2.0::types
256cf72ff5a52bfa4d08e9e1000cf3ab5952a2d280c7f13cdad5ab7905c08050766 android.hardware.camera.metadata@3.2::types 254cf72ff5a52bfa4d08e9e1000cf3ab5952a2d280c7f13cdad5ab7905c08050766 android.hardware.camera.metadata@3.2::types
2573902efc42097cba55f0655aa389e052ea70164e99ced1a6d1ef53dafc13f7650 android.hardware.camera.provider@2.4::ICameraProvider 2553902efc42097cba55f0655aa389e052ea70164e99ced1a6d1ef53dafc13f7650 android.hardware.camera.provider@2.4::ICameraProvider
2586fa9804a17a8bb7923a56bd10493a5483c20007e4c9026fd04287bee7c945a8c android.hardware.gnss@1.0::IGnssCallback 2566fa9804a17a8bb7923a56bd10493a5483c20007e4c9026fd04287bee7c945a8c android.hardware.gnss@1.0::IGnssCallback
@@ -308,9 +306,9 @@ ff4be64d7992f8bec97dff37f35450e79b3430c61f85f54322ce45bef229dc3b android.hardwar
3083d8ed67d807e9f15d0708390a416bee00920f6a22196c104cc9e443c8d217df8 android.hardware.broadcastradio@2.0::IAnnouncementListener 3063d8ed67d807e9f15d0708390a416bee00920f6a22196c104cc9e443c8d217df8 android.hardware.broadcastradio@2.0::IAnnouncementListener
30944017c42e6f4d8cb30f07eb1da04540a98736a336ac28c7e0ed2e69e1589f8d1 android.hardware.broadcastradio@2.0::IBroadcastRadio 30744017c42e6f4d8cb30f07eb1da04540a98736a336ac28c7e0ed2e69e1589f8d1 android.hardware.broadcastradio@2.0::IBroadcastRadio
310e5f4960290b4f3089163dd43251e1a032c81e9bdb796e75a87fc7c5810c262b3 android.hardware.broadcastradio@2.0::ICloseHandle 308e5f4960290b4f3089163dd43251e1a032c81e9bdb796e75a87fc7c5810c262b3 android.hardware.broadcastradio@2.0::ICloseHandle
3117357516e8f4585e211b9b6f271af6fb82d6e9cc208df01851e63118404621e6d android.hardware.broadcastradio@2.0::ITunerCallback 309af24b87ca8b8f02fcde205e47db6a9609fc7e9d77d73e694ec8f9c508ca19575 android.hardware.broadcastradio@2.0::ITunerCallback
312eacf4e7491fc52c4db90898faddf25ec7bc72501b07ae8737434c47cb845128c android.hardware.broadcastradio@2.0::ITunerSession 310d70464c517a4a1b5167730843775a97f455102919e945b04f717b9da390c0f39 android.hardware.broadcastradio@2.0::ITunerSession
31334fe4601072aa5051eb8e41d776a9f6d43f716687de3f5c0031a12e7912ff3d6 android.hardware.broadcastradio@2.0::types 3112afa59ebf8145e7fbc090cf49605c27280c07d4178d47cd7f9d82b3b95a47af0 android.hardware.broadcastradio@2.0::types
3144fb0725c36ed4f77a42b42e3f18d8b5f7919cb62b90098b23143a555aa7dd96d android.hardware.camera.device@3.4::ICameraDeviceCallback 3124fb0725c36ed4f77a42b42e3f18d8b5f7919cb62b90098b23143a555aa7dd96d android.hardware.camera.device@3.4::ICameraDeviceCallback
315812fa66aa10ba0cba27cfddc2fd7f0ee27a8ab65a1f15aa79fdad97d403e6a14 android.hardware.camera.device@3.4::ICameraDeviceSession 313812fa66aa10ba0cba27cfddc2fd7f0ee27a8ab65a1f15aa79fdad97d403e6a14 android.hardware.camera.device@3.4::ICameraDeviceSession
316cc288f1f78d1e643eb3d3dbc16e1401d44033d8e6856761f5156814a29986ec7 android.hardware.camera.device@3.4::types 314cc288f1f78d1e643eb3d3dbc16e1401d44033d8e6856761f5156814a29986ec7 android.hardware.camera.device@3.4::types