From 1a37abe6766e54e30b65634cf2df347bb5c4bba5 Mon Sep 17 00:00:00 2001 From: Shuo Qian Date: Thu, 7 Jan 2021 10:54:01 -0800 Subject: [PATCH] Skip emergency dialing VTS if device doesn't support radio Test: vts Bug: 176862267 Change-Id: I9e72ba5cf6cb118cd68f753355f4119d33fe0019 Merged-In: I9e72ba5cf6cb118cd68f753355f4119d33fe0019 (cherry picked from commit 628a335326766921d28220e1a1352cf072e1c61d) --- radio/1.0/vts/functional/vts_test_util.h | 2 ++ radio/1.4/vts/functional/radio_hidl_hal_api.cpp | 9 +++++++++ 2 files changed, 11 insertions(+) diff --git a/radio/1.0/vts/functional/vts_test_util.h b/radio/1.0/vts/functional/vts_test_util.h index fc59eb6ca9..3decd8dbb1 100644 --- a/radio/1.0/vts/functional/vts_test_util.h +++ b/radio/1.0/vts/functional/vts_test_util.h @@ -36,6 +36,8 @@ enum CheckFlag { static constexpr const char* FEATURE_VOICE_CALL = "android.software.connectionservice"; +static constexpr const char* FEATURE_TELEPHONY = "android.hardware.telephony"; + /* * Generate random serial number for radio test */ diff --git a/radio/1.4/vts/functional/radio_hidl_hal_api.cpp b/radio/1.4/vts/functional/radio_hidl_hal_api.cpp index 4a1007618b..5f9191485b 100644 --- a/radio/1.4/vts/functional/radio_hidl_hal_api.cpp +++ b/radio/1.4/vts/functional/radio_hidl_hal_api.cpp @@ -25,6 +25,9 @@ TEST_F(RadioHidlTest_v1_4, emergencyDial) { if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) { ALOGI("Skipping emergencyDial because voice call is not supported in device"); return; + } else if (!deviceSupportsFeature(FEATURE_TELEPHONY)) { + ALOGI("Skipping emergencyDial because telephony radio is not supported in device"); + return; } else { ALOGI("Running emergencyDial because voice call is supported in device"); } @@ -63,6 +66,9 @@ TEST_F(RadioHidlTest_v1_4, emergencyDial_withServices) { if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) { ALOGI("Skipping emergencyDial because voice call is not supported in device"); return; + } else if (!deviceSupportsFeature(FEATURE_TELEPHONY)) { + ALOGI("Skipping emergencyDial because telephony radio is not supported in device"); + return; } else { ALOGI("Running emergencyDial because voice call is supported in device"); } @@ -102,6 +108,9 @@ TEST_F(RadioHidlTest_v1_4, emergencyDial_withEmergencyRouting) { if (!deviceSupportsFeature(FEATURE_VOICE_CALL)) { ALOGI("Skipping emergencyDial because voice call is not supported in device"); return; + } else if (!deviceSupportsFeature(FEATURE_TELEPHONY)) { + ALOGI("Skipping emergencyDial because telephony radio is not supported in device"); + return; } else { ALOGI("Running emergencyDial because voice call is supported in device"); }