summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoshua Mccloskey2018-05-31 13:21:57 -0500
committerAndroid (Google) Code Review2018-05-31 13:21:57 -0500
commita6b49b5324e768e2b1fe23b584137b31545748ed (patch)
treee94e89198cc3a0d79a7e055f881eee95b5f7c140
parent8bac8dcba533d8b50fe4780f072c55554b0f845a (diff)
parent7897d0f57331b6bcb2d3bc8c2fd6d0e862b860e6 (diff)
downloadplatform-hardware-interfaces-a6b49b5324e768e2b1fe23b584137b31545748ed.tar.gz
platform-hardware-interfaces-a6b49b5324e768e2b1fe23b584137b31545748ed.tar.xz
platform-hardware-interfaces-a6b49b5324e768e2b1fe23b584137b31545748ed.zip
Merge "Modified tests to account for different directories being used based on different first API levels" into pi-dev
-rw-r--r--biometrics/fingerprint/2.1/vts/functional/VtsHalBiometricsFingerprintV2_1TargetTest.cpp26
1 files changed, 22 insertions, 4 deletions
diff --git a/biometrics/fingerprint/2.1/vts/functional/VtsHalBiometricsFingerprintV2_1TargetTest.cpp b/biometrics/fingerprint/2.1/vts/functional/VtsHalBiometricsFingerprintV2_1TargetTest.cpp
index a7f40319..9911038a 100644
--- a/biometrics/fingerprint/2.1/vts/functional/VtsHalBiometricsFingerprintV2_1TargetTest.cpp
+++ b/biometrics/fingerprint/2.1/vts/functional/VtsHalBiometricsFingerprintV2_1TargetTest.cpp
@@ -19,6 +19,7 @@
19#include <VtsHalHidlTargetTestBase.h> 19#include <VtsHalHidlTargetTestBase.h>
20#include <VtsHalHidlTargetTestEnvBase.h> 20#include <VtsHalHidlTargetTestEnvBase.h>
21#include <android-base/logging.h> 21#include <android-base/logging.h>
22#include <android-base/properties.h>
22#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h> 23#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
23#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.h> 24#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprintClientCallback.h>
24#include <hidl/HidlSupport.h> 25#include <hidl/HidlSupport.h>
@@ -28,6 +29,7 @@
28#include <future> 29#include <future>
29#include <utility> 30#include <utility>
30 31
32using android::base::GetUintProperty;
31using android::Condition; 33using android::Condition;
32using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint; 34using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
33using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback; 35using android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback;
@@ -44,7 +46,7 @@ namespace {
44static const uint32_t kTimeout = 3; 46static const uint32_t kTimeout = 3;
45static const std::chrono::seconds kTimeoutInSeconds = std::chrono::seconds(kTimeout); 47static const std::chrono::seconds kTimeoutInSeconds = std::chrono::seconds(kTimeout);
46static const uint32_t kGroupId = 99; 48static const uint32_t kGroupId = 99;
47static const std::string kTmpDir = "/data/system/users/0/fpdata/"; 49static std::string kTmpDir = "";
48static const uint32_t kIterations = 1000; 50static const uint32_t kIterations = 1000;
49 51
50// Wait for a callback to occur (signaled by the given future) up to the 52// Wait for a callback to occur (signaled by the given future) up to the
@@ -199,9 +201,25 @@ class FingerprintHidlTest : public ::testing::VtsHalHidlTargetTestBase {
199 FingerprintHidlEnvironment::Instance()->getServiceName<IBiometricsFingerprint>()); 201 FingerprintHidlEnvironment::Instance()->getServiceName<IBiometricsFingerprint>());
200 ASSERT_FALSE(mService == nullptr); 202 ASSERT_FALSE(mService == nullptr);
201 203
202 // Create an active group 204 /*
203 // FP service can only write to /data/system/users/*/fpdata/ due to 205 * Devices shipped from now on will instead store
204 // SELinux Policy and Linux Dir Permissions 206 * fingerprint data under /data/vendor_de/<user-id>/fpdata.
207 * Support for /data/vendor_de and /data/vendor_ce has been added to vold.
208 */
209
210 uint64_t api_level = GetUintProperty<uint64_t>("ro.product.first_api_level", 0);
211 if (api_level == 0) {
212 api_level = GetUintProperty<uint64_t>("ro.build.version.sdk", 0);
213 }
214 ASSERT_TRUE(api_level != 0);
215
216 // 27 is the API number for O-MR1
217 if (api_level <= 27) {
218 kTmpDir = "/data/system/users/0/fpdata/";
219 } else {
220 kTmpDir = "/data/vendor_de/0/fpdata/";
221 }
222
205 Return<RequestStatus> res = mService->setActiveGroup(kGroupId, kTmpDir); 223 Return<RequestStatus> res = mService->setActiveGroup(kGroupId, kTmpDir);
206 ASSERT_EQ(RequestStatus::SYS_OK, static_cast<RequestStatus>(res)); 224 ASSERT_EQ(RequestStatus::SYS_OK, static_cast<RequestStatus>(res));
207 } 225 }