summaryrefslogtreecommitdiffstats
path: root/nfc
diff options
context:
space:
mode:
authorRuchi Kandoi <kandoiruchi@google.com>2017-03-31 16:32:15 -0700
committerRuchi Kandoi <kandoiruchi@google.com>2017-04-03 22:44:21 +0000
commit915002507640bd5c0daba045c9e584656f071608 (patch)
tree860624e928329c0eb6dbd3af16635be5ddc10df1 /nfc
parent177171f305253ea3b20470c7f711fe68bb7e88c2 (diff)
downloadandroid_hardware_interfaces-915002507640bd5c0daba045c9e584656f071608.tar.gz
android_hardware_interfaces-915002507640bd5c0daba045c9e584656f071608.tar.bz2
android_hardware_interfaces-915002507640bd5c0daba045c9e584656f071608.zip
nfc: vts: Correct parameters going for CoreInitialized
Core Initialized with parameters 1-3 leads the device into recovery mode. Which causes the test to fail. Bug: 36751759 Test: Test passes Change-Id: I1375546cc66c147f26c315a042ca0afb49f0ce06
Diffstat (limited to 'nfc')
-rw-r--r--nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp b/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
index 9da58e2b2..cf9f66ed1 100644
--- a/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
+++ b/nfc/1.0/vts/functional/VtsHalNfcV1_0TargetTest.cpp
@@ -337,17 +337,16 @@ TEST_F(NfcHidlTest, PowerCycleAfterClose) {
TEST_F(NfcHidlTest, CoreInitialized) {
NfcData data;
data.resize(1);
- NfcEvent last_event_;
- for (int i = 0; i <= 6; i++) {
+ // These parameters might lead to device specific proprietary behavior
+ // Using > 10 values should result in predictable and common results for
+ // most devices.
+ for (int i = 10; i <= 16; i++) {
data[0] = i;
EXPECT_EQ(NfcStatus::OK, nfc_->coreInitialized(data));
// Wait for NfcEvent.POST_INIT_CPLT
- auto res = nfc_cb_->WaitForCallbackAny();
- if (res.name.compare(kCallbackNameSendEvent) == 0) {
- last_event_ = res.args->last_event_;
- }
+ auto res = nfc_cb_->WaitForCallback(kCallbackNameSendEvent);
EXPECT_TRUE(res.no_timeout);
- EXPECT_EQ(NfcEvent::POST_INIT_CPLT, last_event_);
+ EXPECT_EQ(NfcEvent::POST_INIT_CPLT, res.args->last_event_);
}
}