Merge "wifi: Report mac address of apIfaceInstance in callback"
diff --git a/automotive/OWNERS b/automotive/OWNERS
index 83ee63c..fb3e3d6 100644
--- a/automotive/OWNERS
+++ b/automotive/OWNERS
@@ -3,3 +3,4 @@
pfg@google.com
gurunagarajan@google.com
keunyoung@google.com
+felipeal@google.com
diff --git a/automotive/can/1.0/default/libnl++/Socket.cpp b/automotive/can/1.0/default/libnl++/Socket.cpp
index 08683ca..514d9bb 100644
--- a/automotive/can/1.0/default/libnl++/Socket.cpp
+++ b/automotive/can/1.0/default/libnl++/Socket.cpp
@@ -153,6 +153,10 @@
return sa.nl_pid;
}
+pollfd Socket::preparePoll(short events) {
+ return {mFd.get(), events, 0};
+}
+
Socket::receive_iterator::receive_iterator(Socket& socket, bool end)
: mSocket(socket), mIsEnd(end) {
if (!end) receive();
diff --git a/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h b/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h
index c69523d..8ea3575 100644
--- a/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h
+++ b/automotive/can/1.0/default/libnl++/include/libnl++/Socket.h
@@ -23,6 +23,7 @@
#include <libnl++/MessageFactory.h>
#include <linux/netlink.h>
+#include <poll.h>
#include <optional>
#include <set>
@@ -174,6 +175,14 @@
std::optional<unsigned> getPid();
/**
+ * Creates a pollfd object for the socket.
+ *
+ * \param events Value for pollfd.events.
+ * \return A populated pollfd object.
+ */
+ pollfd preparePoll(short events = 0);
+
+ /**
* Live iterator continuously receiving messages from Netlink socket.
*
* Iteration ends when socket fails to receive a buffer.
diff --git a/automotive/vehicle/2.0/default/VehicleService.cpp b/automotive/vehicle/2.0/default/VehicleService.cpp
index 47133fd..62a4f20 100644
--- a/automotive/vehicle/2.0/default/VehicleService.cpp
+++ b/automotive/vehicle/2.0/default/VehicleService.cpp
@@ -20,13 +20,10 @@
#include <iostream>
-#include <android/binder_process.h>
-#include <utils/Looper.h>
#include <vhal_v2_0/EmulatedUserHal.h>
#include <vhal_v2_0/EmulatedVehicleConnector.h>
#include <vhal_v2_0/EmulatedVehicleHal.h>
#include <vhal_v2_0/VehicleHalManager.h>
-#include <vhal_v2_0/WatchdogClient.h>
using namespace android;
using namespace android::hardware;
@@ -41,7 +38,7 @@
auto service = std::make_unique<VehicleHalManager>(hal.get());
connector->setValuePool(hal->getValuePool());
- configureRpcThreadpool(4, false /* callerWillJoin */);
+ configureRpcThreadpool(4, true /* callerWillJoin */);
ALOGI("Registering as service...");
status_t status = service->registerAsService();
@@ -51,22 +48,8 @@
return 1;
}
- // Setup a binder thread pool to be a car watchdog client.
- ABinderProcess_setThreadPoolMaxThreadCount(1);
- ABinderProcess_startThreadPool();
- sp<Looper> looper(Looper::prepare(0 /* opts */));
- std::shared_ptr<WatchdogClient> watchdogClient =
- ndk::SharedRefBase::make<WatchdogClient>(looper, service.get());
- // The current health check is done in the main thread, so it falls short of capturing the real
- // situation. Checking through HAL binder thread should be considered.
- if (!watchdogClient->initialize()) {
- ALOGE("Failed to initialize car watchdog client");
- return 1;
- }
ALOGI("Ready");
- while (true) {
- looper->pollAll(-1 /* timeoutMillis */);
- }
+ joinRpcThreadpool();
return 1;
}
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
index 16e1bf7..72df256 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultConfig.h
@@ -688,6 +688,12 @@
.prop = toInt(VehicleProperty::GEAR_SELECTION),
.access = VehiclePropertyAccess::READ,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .configArray = {(int)VehicleGear::GEAR_PARK,
+ (int)VehicleGear::GEAR_NEUTRAL,
+ (int)VehicleGear::GEAR_REVERSE,
+ (int)VehicleGear::GEAR_DRIVE, (int)VehicleGear::GEAR_1,
+ (int)VehicleGear::GEAR_2, (int)VehicleGear::GEAR_3,
+ (int)VehicleGear::GEAR_4, (int)VehicleGear::GEAR_5},
},
.initialValue = {.int32Values = {toInt(VehicleGear::GEAR_PARK)}}},
@@ -1074,6 +1080,30 @@
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
},
},
+ {
+ .config =
+ {
+ .prop = toInt(VehicleProperty::WATCHDOG_ALIVE),
+ .access = VehiclePropertyAccess::WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ },
+ },
+ {
+ .config =
+ {
+ .prop = toInt(VehicleProperty::WATCHDOG_TERMINATED_PROCESS),
+ .access = VehiclePropertyAccess::WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ },
+ },
+ {
+ .config =
+ {
+ .prop = toInt(VehicleProperty::VHAL_HEARTBEAT),
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ },
+ },
};
} // impl
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
index a0b566d..c83e2de 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.cpp
@@ -15,11 +15,13 @@
*/
#define LOG_TAG "DefaultVehicleHal_v2_0"
+#include <android-base/chrono_utils.h>
#include <android-base/macros.h>
#include <android-base/properties.h>
#include <android/log.h>
#include <dirent.h>
#include <sys/system_properties.h>
+#include <utils/SystemClock.h>
#include <fstream>
#include <regex>
@@ -36,6 +38,8 @@
namespace impl {
+static constexpr std::chrono::nanoseconds kHeartBeatIntervalNs = 3s;
+
static std::unique_ptr<Obd2SensorStore> fillDefaultObd2Frame(size_t numVendorIntegerSensors,
size_t numVendorFloatSensors) {
std::unique_ptr<Obd2SensorStore> sensorStore(
@@ -342,6 +346,8 @@
initObd2FreezeFrame(*mPropStore->getConfigOrDie(OBD2_FREEZE_FRAME));
mInEmulator = isInEmulator();
ALOGD("mInEmulator=%s", mInEmulator ? "true" : "false");
+ mRecurrentTimer.registerRecurrentEvent(kHeartBeatIntervalNs,
+ static_cast<int32_t>(VehicleProperty::VHAL_HEARTBEAT));
}
std::vector<VehiclePropConfig> EmulatedVehicleHal::listProperties() {
@@ -359,6 +365,10 @@
if (internalPropValue != nullptr) {
v = pool.obtain(*internalPropValue);
}
+ } else if (property == static_cast<int32_t>(VehicleProperty::VHAL_HEARTBEAT)) {
+ // VHAL_HEARTBEAT is not a continuous value, but it needs to be updated periodically.
+ // So, the update is done through onContinuousPropertyTimer.
+ v = doInternalHealthCheck();
} else {
ALOGE("Unexpected onContinuousPropertyTimer for property: 0x%x", property);
}
@@ -512,6 +522,31 @@
return StatusCode::OK;
}
+VehicleHal::VehiclePropValuePtr EmulatedVehicleHal::doInternalHealthCheck() {
+ VehicleHal::VehiclePropValuePtr v = nullptr;
+
+ // This is an example of very simpe health checking. VHAL is considered healthy if we can read
+ // PERF_VEHICLE_SPEED. The more comprehensive health checking is required.
+ VehiclePropValue propValue = {
+ .prop = static_cast<int32_t>(VehicleProperty::PERF_VEHICLE_SPEED),
+ };
+ auto internalPropValue = mPropStore->readValueOrNull(propValue);
+ if (internalPropValue != nullptr) {
+ v = createVhalHeartBeatProp();
+ } else {
+ ALOGW("VHAL health check failed");
+ }
+ return v;
+}
+
+VehicleHal::VehiclePropValuePtr EmulatedVehicleHal::createVhalHeartBeatProp() {
+ VehicleHal::VehiclePropValuePtr v = getValuePool()->obtainInt64(uptimeMillis());
+ v->prop = static_cast<int32_t>(VehicleProperty::VHAL_HEARTBEAT);
+ v->areaId = 0;
+ v->status = VehiclePropertyStatus::AVAILABLE;
+ return v;
+}
+
} // impl
} // namespace V2_0
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h
index eb38d7d..5c67641 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/EmulatedVehicleHal.h
@@ -82,6 +82,8 @@
VehiclePropValue* outValue);
StatusCode fillObd2DtcInfo(VehiclePropValue* outValue);
StatusCode clearObd2FreezeFrames(const VehiclePropValue& propValue);
+ VehicleHal::VehiclePropValuePtr doInternalHealthCheck();
+ VehicleHal::VehiclePropValuePtr createVhalHeartBeatProp();
/* Private members */
VehiclePropertyStore* mPropStore;
diff --git a/automotive/vehicle/2.0/types.hal b/automotive/vehicle/2.0/types.hal
index f7a42e9..b7c72e4 100644
--- a/automotive/vehicle/2.0/types.hal
+++ b/automotive/vehicle/2.0/types.hal
@@ -2892,6 +2892,52 @@
| VehiclePropertyGroup:SYSTEM
| VehiclePropertyType:MIXED
| VehicleArea:GLOBAL),
+
+ /**
+ * Defines an event that car watchdog updates to tell it's alive.
+ *
+ * Car watchdog sets this property to system uptime in milliseconds at every 3 second.
+ * During the boot, the update may take longer time.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:WRITE
+ */
+ WATCHDOG_ALIVE = (
+ 0xF31
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT64
+ | VehicleArea:GLOBAL),
+
+ /**
+ * Defines a process terminated by car watchdog and the reason of termination.
+ *
+ * int32Values[0]: 1 // ProcessTerminationReason showing why a process is terminated.
+ * string: "/system/bin/log" // Process execution command.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:WRITE
+ */
+ WATCHDOG_TERMINATED_PROCESS = (
+ 0x0F32
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:MIXED
+ | VehicleArea:GLOBAL),
+
+ /**
+ * Defines an event that VHAL signals to the car watchdog as a heartbeat.
+ *
+ * VHAL is supposed to write system uptime to this property at every 3 second.
+ * Car watchdog subscribes to this property and checks if the property is updated at every 3
+ * second. If it isn’t, car watchdog considers VHAL unhealthy and terminates it.
+ *
+ * @change_mode VehiclePropertyChangeMode:ON_CHANGE
+ * @access VehiclePropertyAccess:READ
+ */
+ VHAL_HEARTBEAT = (
+ 0x0F33
+ | VehiclePropertyGroup:SYSTEM
+ | VehiclePropertyType:INT64
+ | VehicleArea:GLOBAL),
};
/**
@@ -4790,3 +4836,23 @@
ROTARY_INPUT_TYPE_AUDIO_VOLUME = 1,
};
+/**
+ * The reason why a process is terminated by car watchdog.
+ * This is used with WATCHDOG_TERMINATED_PROCESS property.
+ */
+enum ProcessTerminationReason : int32_t {
+ /**
+ * A process doesn't respond to car watchdog within the timeout.
+ */
+ NOT_RESPONDING = 1,
+
+ /**
+ * A process uses more IO operations than what is allowed.
+ */
+ IO_OVERUSE = 2,
+
+ /**
+ * A process uses more memory space than what is allowed.
+ */
+ MEMORY_OVERUSE = 3,
+};
diff --git a/biometrics/README.md b/biometrics/README.md
new file mode 100644
index 0000000..8ae1ad6
--- /dev/null
+++ b/biometrics/README.md
@@ -0,0 +1,12 @@
+## Biometric HALs ##
+---
+
+## Overview: ##
+
+The interfaces within the biometrics.* HAL tree are used by the Android Biometric Services
+(e.g. FingerprintService, FaceService) to discover and operate biometric sensors on the device.
+
+More details and versioning information can be found within each particular HAL.
+
+More complete information about the Android Biometric HALs and subsystem can be found at
+[source.android.com](https://source.android.com/security/biometric).
\ No newline at end of file
diff --git a/biometrics/common/aidl/Android.bp b/biometrics/common/aidl/Android.bp
new file mode 100644
index 0000000..f7462e6
--- /dev/null
+++ b/biometrics/common/aidl/Android.bp
@@ -0,0 +1,16 @@
+aidl_interface {
+ name: "android.hardware.biometrics.common",
+ vendor_available: true,
+ srcs: [
+ "android/hardware/biometrics/common/*.aidl",
+ ],
+ stability: "vintf",
+ backend: {
+ java: {
+ platform_apis: true,
+ },
+ cpp: {
+ enabled: false,
+ },
+ }
+}
\ No newline at end of file
diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/CommonProps.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/CommonProps.aidl
new file mode 100644
index 0000000..8dbc149
--- /dev/null
+++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/CommonProps.aidl
@@ -0,0 +1,25 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.common;
+@VintfStability
+parcelable CommonProps {
+ int sensorId;
+ android.hardware.biometrics.common.SensorStrength sensorStrength;
+ int maxEnrollmentsPerUser;
+ android.hardware.biometrics.common.HardwareInfo[] hardwareInfo;
+}
diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/HardwareInfo.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/HardwareInfo.aidl
new file mode 100644
index 0000000..b94b6b0
--- /dev/null
+++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/HardwareInfo.aidl
@@ -0,0 +1,25 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.common;
+@VintfStability
+parcelable HardwareInfo {
+ String deviceName;
+ String hardwareVersion;
+ String firmwareVersion;
+ String serialNumber;
+}
diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/SensorStrength.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/SensorStrength.aidl
new file mode 100644
index 0000000..eaff85d
--- /dev/null
+++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/SensorStrength.aidl
@@ -0,0 +1,24 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.common;
+@Backing(type="byte") @VintfStability
+enum SensorStrength {
+ CONVENIENCE = 0,
+ WEAK = 1,
+ STRONG = 2,
+}
diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/CommonProps.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/CommonProps.aidl
new file mode 100644
index 0000000..8304c95
--- /dev/null
+++ b/biometrics/common/aidl/android/hardware/biometrics/common/CommonProps.aidl
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.common;
+
+import android.hardware.biometrics.common.HardwareInfo;
+import android.hardware.biometrics.common.SensorStrength;
+
+@VintfStability
+parcelable CommonProps {
+ /**
+ * A statically configured unique ID that identifies a single biometric
+ * sensor. IDs must start at zero and increment by one for each unique
+ * sensor. Note that ID allocations are shared between all biometric
+ * modalities (e.g. fingerprint, face, iris), and a single ID must never
+ * be claimed by more than a single sensor.
+ */
+ int sensorId;
+
+ /**
+ * A statically configured strength for this sensor. See the SensorStrength
+ * interface for more information.
+ */
+ SensorStrength sensorStrength;
+
+ /**
+ * The maximum number of enrollments that a single user can have.
+ * Statically configured.
+ */
+ int maxEnrollmentsPerUser;
+
+ /**
+ * A list of hardware information for subsystems that pertain to this
+ * biometric sensor.
+ */
+ HardwareInfo[] hardwareInfo;
+}
\ No newline at end of file
diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/HardwareInfo.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/HardwareInfo.aidl
new file mode 100644
index 0000000..23f0202
--- /dev/null
+++ b/biometrics/common/aidl/android/hardware/biometrics/common/HardwareInfo.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.common;
+
+@VintfStability
+parcelable HardwareInfo {
+ /**
+ * An identifier uniquely identifying a subsystem.
+ */
+ String deviceName;
+
+ /**
+ * The hardware version. For example, <vendor>/<model>/<revision>.
+ */
+ String hardwareVersion;
+
+ /**
+ * The firmware version.
+ */
+ String firmwareVersion;
+
+ /**
+ * The sensor's serial number.
+ */
+ String serialNumber;
+}
\ No newline at end of file
diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/SensorStrength.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/SensorStrength.aidl
new file mode 100644
index 0000000..7460279
--- /dev/null
+++ b/biometrics/common/aidl/android/hardware/biometrics/common/SensorStrength.aidl
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.common;
+
+@VintfStability
+@Backing(type="byte")
+enum SensorStrength {
+ /**
+ * A sensor that meets the requirements for Class 1 biometrics as defined
+ * in the CDD. This does not correspond to a public BiometricManager.Authenticators
+ * constant. Sensors of this strength are not available to applications ia the
+ * public API surface.
+ */
+ CONVENIENCE,
+
+ /**
+ * A sensor that meets the requirements for Class 2 biometrics as defined
+ * in the CDD. Corresponds to BiometricManager.Authenticators.BIOMETRIC_WEAK.
+ */
+ WEAK,
+
+ /**
+ * A sensor that meets the requirements for Class 3 biometrics as defined
+ * in the CDD. Corresponds to BiometricManager.Authenticators.BIOMETRIC_STRONG.
+ *
+ * Notably, this is the only strength that allows generation/verification of
+ * HardwareAuthToken(s).
+ */
+ STRONG,
+}
\ No newline at end of file
diff --git a/biometrics/fingerprint/aidl/Android.bp b/biometrics/fingerprint/aidl/Android.bp
new file mode 100644
index 0000000..6bf2038
--- /dev/null
+++ b/biometrics/fingerprint/aidl/Android.bp
@@ -0,0 +1,20 @@
+aidl_interface {
+ name: "android.hardware.biometrics.fingerprint",
+ vendor_available: true,
+ srcs: [
+ "android/hardware/biometrics/fingerprint/**/*.aidl",
+ ],
+ imports: [
+ "android.hardware.biometrics.common",
+ "android.hardware.keymaster",
+ ],
+ stability: "vintf",
+ backend: {
+ java: {
+ platform_apis: true,
+ },
+ cpp: {
+ enabled: false,
+ },
+ },
+}
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl
new file mode 100644
index 0000000..329a35d
--- /dev/null
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl
@@ -0,0 +1,29 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.fingerprint;
+@Backing(type="byte") @VintfStability
+enum AcquiredInfo {
+ GOOD = 0,
+ PARTIAL = 1,
+ INSUFFICIENT = 2,
+ SENSOR_DIRTY = 3,
+ TOO_SLOW = 4,
+ TOO_FAST = 5,
+ START = 6,
+ VENDOR = 7,
+}
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl
new file mode 100644
index 0000000..0298c12
--- /dev/null
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/Error.aidl
@@ -0,0 +1,30 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.fingerprint;
+@Backing(type="byte") @VintfStability
+enum Error {
+ HW_UNAVAILABLE = 0,
+ UNABLE_TO_PROCESS = 1,
+ TIMEOUT = 2,
+ NO_SPACE = 3,
+ CANCELED = 4,
+ UNABLE_TO_REMOVE = 5,
+ LOCKOUT = 6,
+ LOCKOUT_PERMANENT = 7,
+ VENDOR = 8,
+}
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl
new file mode 100644
index 0000000..14bfece
--- /dev/null
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl
@@ -0,0 +1,27 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.fingerprint;
+@Backing(type="byte") @VintfStability
+enum FingerprintSensorType {
+ UNKNOWN = 0,
+ REAR = 1,
+ UNDER_DISPLAY_ULTRASONIC = 2,
+ UNDER_DISPLAY_OPTICAL = 3,
+ POWER_BUTTON = 4,
+ HOME_BUTTON = 5,
+}
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ICancellationSignal.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ICancellationSignal.aidl
new file mode 100644
index 0000000..6f3d2db
--- /dev/null
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ICancellationSignal.aidl
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.fingerprint;
+@VintfStability
+interface ICancellationSignal {
+ oneway void cancel();
+}
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IFingerprint.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IFingerprint.aidl
new file mode 100644
index 0000000..85d1f57
--- /dev/null
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IFingerprint.aidl
@@ -0,0 +1,26 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.fingerprint;
+@VintfStability
+interface IFingerprint {
+ android.hardware.biometrics.fingerprint.SensorProps[] getSensorProps();
+ android.hardware.biometrics.fingerprint.ISession createSession(in int sensorId, in int userId, in android.hardware.biometrics.fingerprint.ISessionCallback cb);
+ void setResetLockoutCallback(in android.hardware.biometrics.fingerprint.IResetLockoutCallback cb);
+ void generateChallenge(in int sensorId, in int userId, in int timeoutSec, in android.hardware.biometrics.fingerprint.IGenerateChallengeCallback cb);
+ void revokeChallenge(in int sensorId, in int userId, in android.hardware.biometrics.fingerprint.IRevokeChallengeCallback cb);
+}
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IGenerateChallengeCallback.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IGenerateChallengeCallback.aidl
new file mode 100644
index 0000000..eaf27d2
--- /dev/null
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IGenerateChallengeCallback.aidl
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.fingerprint;
+@VintfStability
+interface IGenerateChallengeCallback {
+ oneway void onChallengeGenerated(in int sensorId, in int userId, in long keystoreOperationId, in long challenge);
+}
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IResetLockoutCallback.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IResetLockoutCallback.aidl
new file mode 100644
index 0000000..ac0decd
--- /dev/null
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IResetLockoutCallback.aidl
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.fingerprint;
+@VintfStability
+interface IResetLockoutCallback {
+ oneway void onLockoutReset(in int sensorId, in int userId, in long durationMilli);
+}
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IRevokeChallengeCallback.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IRevokeChallengeCallback.aidl
new file mode 100644
index 0000000..23fc10f
--- /dev/null
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/IRevokeChallengeCallback.aidl
@@ -0,0 +1,22 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.fingerprint;
+@VintfStability
+interface IRevokeChallengeCallback {
+ oneway void onChallengeRevoked(in int sensorId, in int userId, in long challenge);
+}
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl
new file mode 100644
index 0000000..d92ca4f
--- /dev/null
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl
@@ -0,0 +1,32 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.fingerprint;
+@VintfStability
+interface ISession {
+ android.hardware.biometrics.fingerprint.ICancellationSignal enroll(in int cookie, in android.hardware.keymaster.HardwareAuthToken hat);
+ android.hardware.biometrics.fingerprint.ICancellationSignal authenticate(in int cookie, in long keystoreOperationId);
+ android.hardware.biometrics.fingerprint.ICancellationSignal detectInteraction(in int cookie);
+ void enumerateEnrollments(in int cookie);
+ void removeEnrollments(in int cookie, in int[] enrollmentIds);
+ void getAuthenticatorId(in int cookie);
+ void invalidateAuthenticatorId(in int cookie, in android.hardware.keymaster.HardwareAuthToken hat);
+ void resetLockout(in int cookie, in android.hardware.keymaster.HardwareAuthToken hat);
+ void onPointerDown(in int pointerId, in int x, in int y, in float minor, in float major);
+ void onPointerUp(in int pointerId);
+ void onUiReady();
+}
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISessionCallback.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISessionCallback.aidl
new file mode 100644
index 0000000..6140447
--- /dev/null
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISessionCallback.aidl
@@ -0,0 +1,31 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.fingerprint;
+@VintfStability
+interface ISessionCallback {
+ void onStateChanged(in int cookie, in android.hardware.biometrics.fingerprint.SessionState state);
+ void onAcquired(in android.hardware.biometrics.fingerprint.AcquiredInfo info, in int vendorCode);
+ void onError(in android.hardware.biometrics.fingerprint.Error error, in int vendorCode);
+ void onEnrollmentProgress(in int enrollmentId, int remaining, int vendorCode);
+ void onAuthenticated(in int enrollmentId, in android.hardware.keymaster.HardwareAuthToken hat);
+ void onInteractionDetected();
+ void onEnrollmentsEnumerated(in int[] enrollmentIds);
+ void onEnrollmentsRemoved(in int[] enrollmentIds);
+ void onAuthenticatorIdRetrieved(in long authenticatorId);
+ void onAuthenticatorIdInvalidated();
+}
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl
new file mode 100644
index 0000000..9d946a9
--- /dev/null
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SensorProps.aidl
@@ -0,0 +1,27 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.fingerprint;
+@VintfStability
+parcelable SensorProps {
+ android.hardware.biometrics.common.CommonProps commonProps;
+ android.hardware.biometrics.fingerprint.FingerprintSensorType sensorType;
+ int sensorLocationX;
+ int sensorLocationY;
+ int sensorRadius;
+ int displayId;
+}
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SessionState.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SessionState.aidl
new file mode 100644
index 0000000..38ca1e0
--- /dev/null
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/SessionState.aidl
@@ -0,0 +1,29 @@
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL interface (or parcelable). Do not try to
+// edit this file. It looks like you are doing that because you have modified
+// an AIDL interface in a backward-incompatible way, e.g., deleting a function
+// from an interface or a field from a parcelable and it broke the build. That
+// breakage is intended.
+//
+// You must not make a backward incompatible changes to the AIDL files built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.fingerprint;
+@Backing(type="byte") @VintfStability
+enum SessionState {
+ IDLING = 0,
+ ENROLLING = 1,
+ AUTHENTICATING = 2,
+ DETECTING_INTERACTION = 3,
+ ENUMERATING_ENROLLMENTS = 4,
+ REMOVING_ENROLLMENTS = 5,
+ GETTING_AUTHENTICATOR_ID = 6,
+ RESETTING_LOCKOUT = 7,
+}
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl
new file mode 100644
index 0000000..8cb7833
--- /dev/null
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/AcquiredInfo.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.fingerprint;
+
+@VintfStability
+@Backing(type="byte")
+enum AcquiredInfo {
+ GOOD,
+ PARTIAL,
+ INSUFFICIENT,
+ SENSOR_DIRTY,
+ TOO_SLOW,
+ TOO_FAST,
+ START,
+ VENDOR
+}
+
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/Error.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/Error.aidl
new file mode 100644
index 0000000..cc79de7
--- /dev/null
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/Error.aidl
@@ -0,0 +1,32 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.fingerprint;
+
+@VintfStability
+@Backing(type="byte")
+enum Error {
+ HW_UNAVAILABLE,
+ UNABLE_TO_PROCESS,
+ TIMEOUT,
+ NO_SPACE,
+ CANCELED,
+ UNABLE_TO_REMOVE,
+ LOCKOUT,
+ LOCKOUT_PERMANENT,
+ VENDOR
+}
+
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl
new file mode 100644
index 0000000..765a2ed
--- /dev/null
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/FingerprintSensorType.aidl
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.fingerprint;
+
+@VintfStability
+@Backing(type="byte")
+enum FingerprintSensorType {
+ UNKNOWN,
+ REAR,
+ UNDER_DISPLAY_ULTRASONIC,
+ UNDER_DISPLAY_OPTICAL,
+ POWER_BUTTON,
+ HOME_BUTTON
+}
+
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ICancellationSignal.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ICancellationSignal.aidl
new file mode 100644
index 0000000..abfbb2a
--- /dev/null
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ICancellationSignal.aidl
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.fingerprint;
+
+@VintfStability
+oneway interface ICancellationSignal {
+ void cancel();
+}
+
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IFingerprint.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IFingerprint.aidl
new file mode 100644
index 0000000..4709778
--- /dev/null
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IFingerprint.aidl
@@ -0,0 +1,37 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.fingerprint;
+
+import android.hardware.biometrics.fingerprint.IGenerateChallengeCallback;
+import android.hardware.biometrics.fingerprint.IResetLockoutCallback;
+import android.hardware.biometrics.fingerprint.IRevokeChallengeCallback;
+import android.hardware.biometrics.fingerprint.ISession;
+import android.hardware.biometrics.fingerprint.ISessionCallback;
+import android.hardware.biometrics.fingerprint.SensorProps;
+
+@VintfStability
+interface IFingerprint {
+ SensorProps[] getSensorProps();
+
+ ISession createSession(in int sensorId, in int userId, in ISessionCallback cb);
+
+ void setResetLockoutCallback(in IResetLockoutCallback cb);
+
+ void generateChallenge(in int sensorId, in int userId, in int timeoutSec, in IGenerateChallengeCallback cb);
+
+ void revokeChallenge(in int sensorId, in int userId, in IRevokeChallengeCallback cb);
+}
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IGenerateChallengeCallback.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IGenerateChallengeCallback.aidl
new file mode 100644
index 0000000..93a2d7b
--- /dev/null
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IGenerateChallengeCallback.aidl
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.fingerprint;
+
+@VintfStability
+oneway interface IGenerateChallengeCallback {
+ void onChallengeGenerated(in int sensorId, in int userId, in long keystoreOperationId, in long challenge);
+}
+
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IResetLockoutCallback.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IResetLockoutCallback.aidl
new file mode 100644
index 0000000..d97a701
--- /dev/null
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IResetLockoutCallback.aidl
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.fingerprint;
+
+@VintfStability
+oneway interface IResetLockoutCallback {
+ void onLockoutReset(in int sensorId, in int userId, in long durationMilli);
+}
+
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IRevokeChallengeCallback.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IRevokeChallengeCallback.aidl
new file mode 100644
index 0000000..cca3453
--- /dev/null
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/IRevokeChallengeCallback.aidl
@@ -0,0 +1,23 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.fingerprint;
+
+@VintfStability
+oneway interface IRevokeChallengeCallback {
+ void onChallengeRevoked(in int sensorId, in int userId, in long challenge);
+}
+
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl
new file mode 100644
index 0000000..55ea385
--- /dev/null
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl
@@ -0,0 +1,121 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.fingerprint;
+
+import android.hardware.biometrics.fingerprint.ICancellationSignal;
+import android.hardware.keymaster.HardwareAuthToken;
+
+@VintfStability
+interface ISession {
+ /**
+ * Methods applicable to any fingerprint type.
+ */
+
+ ICancellationSignal enroll(in int cookie, in HardwareAuthToken hat);
+
+ ICancellationSignal authenticate(in int cookie, in long keystoreOperationId);
+
+ ICancellationSignal detectInteraction(in int cookie);
+
+ void enumerateEnrollments(in int cookie);
+
+ void removeEnrollments(in int cookie, in int[] enrollmentIds);
+
+ /**
+ * getAuthenticatorId:
+ *
+ * MUST return 0 via ISessionCallback#onAuthenticatorIdRetrieved for
+ * sensors that are configured as SensorStrength::WEAK or
+ * SensorStrength::CONVENIENCE.
+ *
+ * The following only applies to sensors that are configured as
+ * SensorStrength::STRONG.
+ *
+ * The authenticatorId is used during key generation and key import to to
+ * associate a key (in KeyStore / KeyMaster) with the current set of
+ * enrolled fingerprints. For example, the following public Android APIs
+ * allow for keys to be invalidated when the user adds a new enrollment
+ * after the key was created:
+ * KeyGenParameterSpec.Builder.setInvalidatedByBiometricEnrollment and
+ * KeyProtection.Builder.setInvalidatedByBiometricEnrollment.
+ *
+ * In addition, upon successful fingerprint authentication, the signed HAT
+ * that is returned to the framework via ISessionCallback#onAuthenticated
+ * must contain this identifier in the authenticatorId field.
+ *
+ * Returns an entropy-encoded random identifier associated with the current
+ * set of enrollments via ISessionCallback#onAuthenticatorIdRetrieved. The
+ * authenticatorId
+ * 1) MUST change whenever a new fingerprint is enrolled
+ * 2) MUST return 0 if no fingerprints are enrolled
+ * 3) MUST not change if a fingerprint is deleted.
+ * 4) MUST be an entropy-encoded random number
+ *
+ * @param cookie An identifier used to track subsystem operations related
+ * to this call path. The framework will guarantee that it is
+ * unique per ISession.
+ */
+ void getAuthenticatorId(in int cookie);
+
+ /**
+ * invalidateAuthenticatorId:
+ *
+ * This method only applies to sensors that are configured as
+ * SensorStrength::STRONG. If invoked erroneously by the framework for
+ * sensor of other strengths, the HAL should immediately invoke
+ * ISessionCallback#onAuthenticatorIdInvalidated.
+ *
+ * The following only applies to sensors that are configured as
+ * SensorStrength::STRONG.
+ *
+ * When invoked by the framework, the HAL implementation must perform the
+ * following sequence of events:
+ * 1) Verify the authenticity and integrity of the provided HAT
+ * 2) Update the authenticatorId with a new entropy-encoded random number
+ * 3) Persist the new authenticatorId to non-ephemeral storage
+ * 4) Notify the framework that the above is completed, via
+ * ISessionCallback#onAuthenticatorInvalidated
+ *
+ * A practical use case of invalidation would be when the user adds a new
+ * enrollment to a sensor managed by a different HAL instance. The
+ * public android.security.keystore APIs bind keys to "all biometrics"
+ * rather than "fingerprint-only" or "face-only" (see #getAuthenticatorId
+ * for more details). As such, the framework would coordinate invalidation
+ * across multiple biometric HALs as necessary.
+ *
+ * @param cookie An identifier used to track subsystem operations related
+ * to this call path. The framework will guarantee that it is
+ * unique per ISession.
+ * @param hat HardwareAuthToken that must be validated before proceeding
+ * with this operation.
+ */
+ void invalidateAuthenticatorId(in int cookie, in HardwareAuthToken hat);
+
+ void resetLockout(in int cookie, in HardwareAuthToken hat);
+
+
+ /**
+ * Methods for notifying the under-display fingerprint sensor about external events.
+ */
+
+ void onPointerDown(in int pointerId, in int x, in int y, in float minor, in float major);
+
+ void onPointerUp(in int pointerId);
+
+ void onUiReady();
+}
+
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISessionCallback.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISessionCallback.aidl
new file mode 100644
index 0000000..c608d65
--- /dev/null
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISessionCallback.aidl
@@ -0,0 +1,51 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.fingerprint;
+
+import android.hardware.biometrics.fingerprint.AcquiredInfo;
+import android.hardware.biometrics.fingerprint.Error;
+import android.hardware.biometrics.fingerprint.SessionState;
+import android.hardware.keymaster.HardwareAuthToken;
+
+@VintfStability
+interface ISessionCallback {
+ void onStateChanged(in int cookie, in SessionState state);
+
+ void onAcquired(in AcquiredInfo info, in int vendorCode);
+
+ void onError(in Error error, in int vendorCode);
+
+ void onEnrollmentProgress(in int enrollmentId, int remaining, int vendorCode);
+
+ void onAuthenticated(in int enrollmentId, in HardwareAuthToken hat);
+
+ void onInteractionDetected();
+
+ void onEnrollmentsEnumerated(in int[] enrollmentIds);
+
+ void onEnrollmentsRemoved(in int[] enrollmentIds);
+
+ /**
+ * A callback invoked when ISession#getAuthenticatorId is invoked.
+ */
+ void onAuthenticatorIdRetrieved(in long authenticatorId);
+
+ /**
+ * A callback invoked when ISession#invalidateAuthenticatorId has completed.
+ */
+ void onAuthenticatorIdInvalidated();
+}
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl
new file mode 100644
index 0000000..7c1e176
--- /dev/null
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SensorProps.aidl
@@ -0,0 +1,65 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.fingerprint;
+
+import android.hardware.biometrics.common.CommonProps;
+import android.hardware.biometrics.fingerprint.FingerprintSensorType;
+
+@VintfStability
+parcelable SensorProps {
+ /**
+ * Statically configured properties that apply to this fingerprint sensor.
+ */
+ CommonProps commonProps;
+
+ /**
+ * A statically configured sensor type representing this fingerprint
+ * sensor.
+ */
+ FingerprintSensorType sensorType;
+
+ /**
+ * The location of the center of the sensor if applicable. For example,
+ * sensors of FingerprintSensorType::UNDER_DISPLAY_* would report this
+ * value as the distance in pixels, measured from the left edge of the
+ * screen.
+ */
+ int sensorLocationX;
+
+ /**
+ * The location of the center of the sensor if applicable. For example,
+ * sensors of FingerprintSensorType::UNDER_DISPLAY_* would report this
+ * value as the distance in pixels, measured from the top edge of the
+ * screen.
+ */
+ int sensorLocationY;
+
+ /**
+ * The radius of the sensor if applicable. For example, sensors of
+ * FingerprintSensorType::UNDER_DISPLAY_* would report this value as
+ * the radius of the sensor, in pixels.
+ */
+ int sensorRadius;
+
+ /**
+ * For sensors of FingerprintSensorType::UNDER_DISPLAY_*, this must
+ * correspond to the android.hardware.DisplayManager#getDisplay Android
+ * API.
+ */
+ int displayId;
+}
+
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SessionState.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SessionState.aidl
new file mode 100644
index 0000000..3b4ba18
--- /dev/null
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/SessionState.aidl
@@ -0,0 +1,31 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.fingerprint;
+
+@VintfStability
+@Backing(type="byte")
+enum SessionState {
+ IDLING,
+ ENROLLING,
+ AUTHENTICATING,
+ DETECTING_INTERACTION,
+ ENUMERATING_ENROLLMENTS,
+ REMOVING_ENROLLMENTS,
+ GETTING_AUTHENTICATOR_ID,
+ RESETTING_LOCKOUT
+}
+
diff --git a/biometrics/fingerprint/aidl/default/Android.bp b/biometrics/fingerprint/aidl/default/Android.bp
new file mode 100644
index 0000000..f2536d4
--- /dev/null
+++ b/biometrics/fingerprint/aidl/default/Android.bp
@@ -0,0 +1,17 @@
+cc_binary {
+ name: "android.hardware.biometrics.fingerprint-service.example",
+ relative_install_path: "hw",
+ init_rc: ["fingerprint-default.rc"],
+ vintf_fragments: ["fingerprint-default.xml"],
+ vendor: true,
+ shared_libs: [
+ "libbase",
+ "libbinder_ndk",
+ "android.hardware.biometrics.fingerprint-ndk_platform",
+ ],
+ srcs: [
+ "main.cpp",
+ "Fingerprint.cpp",
+ "Session.cpp",
+ ],
+}
diff --git a/biometrics/fingerprint/aidl/default/Fingerprint.cpp b/biometrics/fingerprint/aidl/default/Fingerprint.cpp
new file mode 100644
index 0000000..0ca45f8
--- /dev/null
+++ b/biometrics/fingerprint/aidl/default/Fingerprint.cpp
@@ -0,0 +1,79 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Fingerprint.h"
+#include "Session.h"
+
+namespace aidl::android::hardware::biometrics::fingerprint {
+
+const int kSensorId = 0;
+const common::SensorStrength kSensorStrength = common::SensorStrength::STRONG;
+const int kMaxEnrollmentsPerUser = 5;
+const FingerprintSensorType kSensorType = FingerprintSensorType::REAR;
+const std::string kHwDeviceName = "fingerprintSensor";
+const std::string kHardwareVersion = "vendor/model/revision";
+const std::string kFirmwareVersion = "1.01";
+const std::string kSerialNumber = "00000001";
+
+ndk::ScopedAStatus Fingerprint::getSensorProps(std::vector<SensorProps>* return_val) {
+ *return_val = std::vector<SensorProps>();
+
+ std::vector<common::HardwareInfo> hardwareInfos = std::vector<common::HardwareInfo>();
+ common::HardwareInfo sensorInfo = {kHwDeviceName,
+ kHardwareVersion,
+ kFirmwareVersion,
+ kSerialNumber
+ };
+ hardwareInfos.push_back(sensorInfo);
+ common::CommonProps commonProps = {kSensorId,
+ kSensorStrength,
+ kMaxEnrollmentsPerUser,
+ hardwareInfos};
+ SensorProps props = {commonProps,
+ kSensorType,
+ 0 /* sensorLocationX */,
+ 0 /* sensorLocationY */,
+ 0 /* sensorRadius */,
+ 0 /* displayId */};
+ return_val->push_back(props);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Fingerprint::createSession(int32_t /*sensorId*/, int32_t /*userId*/,
+ const std::shared_ptr<ISessionCallback>& cb,
+ std::shared_ptr<ISession>* return_val) {
+ *return_val = SharedRefBase::make<Session>(cb);
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Fingerprint::setResetLockoutCallback(
+ const std::shared_ptr<IResetLockoutCallback>& /*cb*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Fingerprint::generateChallenge(
+ int32_t /*sensorId*/, int32_t /*userId*/, int32_t /*timeoutSec*/,
+ const std::shared_ptr<IGenerateChallengeCallback>& /*cb*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Fingerprint::revokeChallenge(
+ int32_t /*sensorId*/, int32_t /*userId*/,
+ const std::shared_ptr<IRevokeChallengeCallback>& /*cb*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+} // namespace aidl::android::hardware::biometrics::fingerprint
diff --git a/biometrics/fingerprint/aidl/default/Fingerprint.h b/biometrics/fingerprint/aidl/default/Fingerprint.h
new file mode 100644
index 0000000..b5b09c0
--- /dev/null
+++ b/biometrics/fingerprint/aidl/default/Fingerprint.h
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/biometrics/fingerprint/BnFingerprint.h>
+
+namespace aidl::android::hardware::biometrics::fingerprint {
+
+class Fingerprint : public BnFingerprint {
+ public:
+ ndk::ScopedAStatus getSensorProps(std::vector<SensorProps>* _aidl_return) override;
+
+ ndk::ScopedAStatus createSession(int32_t sensorId, int32_t userId,
+ const std::shared_ptr<ISessionCallback>& cb,
+ std::shared_ptr<ISession>* _aidl_return) override;
+
+ ndk::ScopedAStatus setResetLockoutCallback(
+ const std::shared_ptr<IResetLockoutCallback>& cb) override;
+
+ ndk::ScopedAStatus generateChallenge(
+ int32_t sensorId, int32_t userId, int32_t timeoutSec,
+ const std::shared_ptr<IGenerateChallengeCallback>& cb) override;
+
+ ndk::ScopedAStatus revokeChallenge(
+ int32_t sensorId, int32_t userId,
+ const std::shared_ptr<IRevokeChallengeCallback>& cb) override;
+};
+
+} // namespace aidl::android::hardware::biometrics::fingerprint
diff --git a/biometrics/fingerprint/aidl/default/Session.cpp b/biometrics/fingerprint/aidl/default/Session.cpp
new file mode 100644
index 0000000..a3dd75e
--- /dev/null
+++ b/biometrics/fingerprint/aidl/default/Session.cpp
@@ -0,0 +1,85 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <aidl/android/hardware/biometrics/fingerprint/BnCancellationSignal.h>
+
+#include "Session.h"
+
+namespace aidl::android::hardware::biometrics::fingerprint {
+
+class CancellationSignal : public BnCancellationSignal {
+ public:
+ ndk::ScopedAStatus cancel() override { return ndk::ScopedAStatus::ok(); }
+};
+
+Session::Session(std::shared_ptr<ISessionCallback> cb) : cb_(std::move(cb)) {}
+
+ndk::ScopedAStatus Session::enroll(int32_t /*cookie*/, const keymaster::HardwareAuthToken& /*hat*/,
+ std::shared_ptr<ICancellationSignal>* /*return_val*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Session::authenticate(int32_t /*cookie*/, int64_t /*keystoreOperationId*/,
+ std::shared_ptr<ICancellationSignal>* return_val) {
+ if (cb_) {
+ cb_->onStateChanged(0, SessionState::AUTHENTICATING);
+ }
+ *return_val = SharedRefBase::make<CancellationSignal>();
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Session::detectInteraction(
+ int32_t /*cookie*/, std::shared_ptr<ICancellationSignal>* /*return_val*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Session::enumerateEnrollments(int32_t /*cookie*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Session::removeEnrollments(int32_t /*cookie*/,
+ const std::vector<int32_t>& /*enrollmentIds*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Session::getAuthenticatorId(int32_t /*cookie*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Session::invalidateAuthenticatorId(int32_t /*cookie*/,
+ const keymaster::HardwareAuthToken& /*hat*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Session::resetLockout(int32_t /*cookie*/,
+ const keymaster::HardwareAuthToken& /*hat*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Session::onPointerDown(int32_t /*pointerId*/, int32_t /*x*/, int32_t /*y*/,
+ float /*minor*/, float /*major*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Session::onPointerUp(int32_t /*pointerId*/) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Session::onUiReady() {
+ return ndk::ScopedAStatus::ok();
+}
+
+} // namespace aidl::android::hardware::biometrics::fingerprint
diff --git a/biometrics/fingerprint/aidl/default/Session.h b/biometrics/fingerprint/aidl/default/Session.h
new file mode 100644
index 0000000..781e95a
--- /dev/null
+++ b/biometrics/fingerprint/aidl/default/Session.h
@@ -0,0 +1,63 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/biometrics/fingerprint/BnSession.h>
+#include <aidl/android/hardware/biometrics/fingerprint/ISessionCallback.h>
+
+namespace aidl::android::hardware::biometrics::fingerprint {
+
+namespace aidl::android::hardware::keymaster = keymaster;
+
+class Session : public BnSession {
+ public:
+ explicit Session(std::shared_ptr<ISessionCallback> cb);
+
+ ndk::ScopedAStatus enroll(int32_t cookie, const keymaster::HardwareAuthToken& hat,
+ std::shared_ptr<ICancellationSignal>* return_val) override;
+
+ ndk::ScopedAStatus authenticate(int32_t cookie, int64_t keystoreOperationId,
+ std::shared_ptr<ICancellationSignal>* return_val) override;
+
+ ndk::ScopedAStatus detectInteraction(int32_t cookie,
+ std::shared_ptr<ICancellationSignal>* return_val) override;
+
+ ndk::ScopedAStatus enumerateEnrollments(int32_t cookie) override;
+
+ ndk::ScopedAStatus removeEnrollments(int32_t cookie,
+ const std::vector<int32_t>& enrollmentIds) override;
+
+ ndk::ScopedAStatus getAuthenticatorId(int32_t cookie) override;
+
+ ndk::ScopedAStatus invalidateAuthenticatorId(int32_t cookie,
+ const keymaster::HardwareAuthToken& hat) override;
+
+ ndk::ScopedAStatus resetLockout(int32_t cookie,
+ const keymaster::HardwareAuthToken& hat) override;
+
+ ndk::ScopedAStatus onPointerDown(int32_t pointerId, int32_t x, int32_t y, float minor,
+ float major) override;
+
+ ndk::ScopedAStatus onPointerUp(int32_t pointerId) override;
+
+ ndk::ScopedAStatus onUiReady() override;
+
+ private:
+ std::shared_ptr<ISessionCallback> cb_;
+};
+
+} // namespace aidl::android::hardware::biometrics::fingerprint
diff --git a/biometrics/fingerprint/aidl/default/fingerprint-default.rc b/biometrics/fingerprint/aidl/default/fingerprint-default.rc
new file mode 100644
index 0000000..eb62c56
--- /dev/null
+++ b/biometrics/fingerprint/aidl/default/fingerprint-default.rc
@@ -0,0 +1,5 @@
+service vendor.fingerprint-default /vendor/bin/hw/android.hardware.biometrics.fingerprint-service.example
+ class hal
+ user nobody
+ group nobody
+
diff --git a/biometrics/fingerprint/aidl/default/fingerprint-default.xml b/biometrics/fingerprint/aidl/default/fingerprint-default.xml
new file mode 100644
index 0000000..89da765
--- /dev/null
+++ b/biometrics/fingerprint/aidl/default/fingerprint-default.xml
@@ -0,0 +1,6 @@
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.biometrics.fingerprint</name>
+ <fqname>IFingerprint/default</fqname>
+ </hal>
+</manifest>
diff --git a/biometrics/fingerprint/aidl/default/main.cpp b/biometrics/fingerprint/aidl/default/main.cpp
new file mode 100644
index 0000000..4690d73
--- /dev/null
+++ b/biometrics/fingerprint/aidl/default/main.cpp
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include "Fingerprint.h"
+
+#include <android-base/logging.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+
+using aidl::android::hardware::biometrics::fingerprint::Fingerprint;
+
+int main() {
+ LOG(INFO) << "Fingerprint HAL started";
+ ABinderProcess_setThreadPoolMaxThreadCount(0);
+ std::shared_ptr<Fingerprint> hal = ndk::SharedRefBase::make<Fingerprint>();
+
+ const std::string instance = std::string(Fingerprint::descriptor) + "/default";
+ binder_status_t status = AServiceManager_addService(hal->asBinder().get(), instance.c_str());
+ CHECK(status == STATUS_OK);
+
+ ABinderProcess_joinThreadPool();
+ return EXIT_FAILURE; // should not reach
+}
diff --git a/biometrics/fingerprint/aidl/vts/Android.bp b/biometrics/fingerprint/aidl/vts/Android.bp
new file mode 100644
index 0000000..b441eb3
--- /dev/null
+++ b/biometrics/fingerprint/aidl/vts/Android.bp
@@ -0,0 +1,16 @@
+cc_test {
+ name: "VtsHalBiometricsFingerprintTargetTest",
+ defaults: [
+ "VtsHalTargetTestDefaults",
+ "use_libaidlvintf_gtest_helper_static",
+ ],
+ srcs: ["VtsHalBiometricsFingerprintTargetTest.cpp"],
+ shared_libs: [
+ "libbinder_ndk",
+ "android.hardware.biometrics.fingerprint-ndk_platform",
+ ],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
+}
diff --git a/biometrics/fingerprint/aidl/vts/VtsHalBiometricsFingerprintTargetTest.cpp b/biometrics/fingerprint/aidl/vts/VtsHalBiometricsFingerprintTargetTest.cpp
new file mode 100644
index 0000000..1a39ad4
--- /dev/null
+++ b/biometrics/fingerprint/aidl/vts/VtsHalBiometricsFingerprintTargetTest.cpp
@@ -0,0 +1,141 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/biometrics/fingerprint/BnFingerprint.h>
+#include <aidl/android/hardware/biometrics/fingerprint/BnSessionCallback.h>
+
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+
+#include <future>
+
+namespace aidl::android::hardware::biometrics::fingerprint {
+namespace {
+
+constexpr int kSensorId = 0;
+constexpr int kUserId = 0;
+constexpr auto kCallbackTimeout = std::chrono::seconds(1);
+
+enum class SessionCallbackMethodName {
+ kOnStateChanged,
+};
+
+struct SessionCallbackInvocation {
+ SessionCallbackMethodName method_name;
+ SessionState state;
+};
+
+class SessionCallback : public BnSessionCallback {
+ public:
+ explicit SessionCallback(std::promise<SessionCallbackInvocation> invocation_promise)
+ : invocation_promise_(std::move(invocation_promise)) {}
+
+ ndk::ScopedAStatus onStateChanged(int32_t /*cookie*/, SessionState state) override {
+ SessionCallbackInvocation invocation = {};
+ invocation.method_name = SessionCallbackMethodName::kOnStateChanged;
+ invocation.state = state;
+ invocation_promise_.set_value(invocation);
+ return ndk::ScopedAStatus::ok();
+ }
+
+ ndk::ScopedAStatus onAcquired(AcquiredInfo /*info*/, int32_t /*vendorCode*/) override {
+ return ndk::ScopedAStatus::ok();
+ }
+
+ ndk::ScopedAStatus onError(Error /*error*/, int32_t /*vendorCode*/) override {
+ return ndk::ScopedAStatus::ok();
+ }
+
+ ndk::ScopedAStatus onEnrollmentProgress(int32_t /*enrollmentId*/, int32_t /*remaining*/,
+ int32_t /*vendorCode*/) override {
+ return ndk::ScopedAStatus::ok();
+ }
+
+ ndk::ScopedAStatus onAuthenticated(int32_t /*enrollmentId*/,
+ const keymaster::HardwareAuthToken& /*hat*/) override {
+ return ndk::ScopedAStatus::ok();
+ }
+
+ ndk::ScopedAStatus onInteractionDetected() override { return ndk::ScopedAStatus::ok(); }
+
+ ndk::ScopedAStatus onEnrollmentsEnumerated(
+ const std::vector<int32_t>& /*enrollmentIds*/) override {
+ return ndk::ScopedAStatus::ok();
+ }
+
+ ndk::ScopedAStatus onEnrollmentsRemoved(
+ const std::vector<int32_t>& /*enrollmentIds*/) override {
+ return ndk::ScopedAStatus::ok();
+ }
+
+ ndk::ScopedAStatus onAuthenticatorIdRetrieved(int64_t /*authenticatorId*/) override {
+ return ndk::ScopedAStatus::ok();
+ }
+
+ ndk::ScopedAStatus onAuthenticatorIdInvalidated() override {
+ return ndk::ScopedAStatus::ok();
+ }
+
+ private:
+ std::promise<SessionCallbackInvocation> invocation_promise_;
+};
+
+class Fingerprint : public testing::TestWithParam<std::string> {
+ protected:
+ void SetUp() override {
+ AIBinder* binder = AServiceManager_waitForService(GetParam().c_str());
+ ASSERT_NE(binder, nullptr);
+ hal_ = IFingerprint::fromBinder(ndk::SpAIBinder(binder));
+ }
+
+ std::shared_ptr<IFingerprint> hal_;
+};
+
+TEST_P(Fingerprint, AuthenticateTest) {
+ std::promise<SessionCallbackInvocation> invocation_promise;
+ std::future<SessionCallbackInvocation> invocation_future = invocation_promise.get_future();
+ std::shared_ptr<SessionCallback> session_cb =
+ ndk::SharedRefBase::make<SessionCallback>(std::move(invocation_promise));
+
+ std::shared_ptr<ISession> session;
+ ASSERT_TRUE(hal_->createSession(kSensorId, kUserId, session_cb, &session).isOk());
+
+ std::shared_ptr<ICancellationSignal> cancel_cb;
+ ASSERT_TRUE(session->authenticate(0, 0, &cancel_cb).isOk());
+ ASSERT_EQ(invocation_future.wait_for(kCallbackTimeout), std::future_status::ready);
+
+ SessionCallbackInvocation invocation = invocation_future.get();
+ EXPECT_EQ(invocation.method_name, SessionCallbackMethodName::kOnStateChanged);
+ EXPECT_EQ(invocation.state, SessionState::AUTHENTICATING);
+}
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(Fingerprint);
+INSTANTIATE_TEST_SUITE_P(
+ IFingerprint, Fingerprint,
+ testing::ValuesIn(::android::getAidlHalInstanceNames(IFingerprint::descriptor)),
+ ::android::PrintInstanceNameToString);
+
+} // namespace
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ ABinderProcess_setThreadPoolMaxThreadCount(1);
+ ABinderProcess_startThreadPool();
+ return RUN_ALL_TESTS();
+}
+
+} // namespace aidl::android::hardware::biometrics::fingerprint
diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml
index 089c89a..f4f846b 100644
--- a/compatibility_matrices/compatibility_matrix.current.xml
+++ b/compatibility_matrices/compatibility_matrix.current.xml
@@ -9,7 +9,9 @@
</hal>
<hal format="hidl" optional="false">
<name>android.hardware.audio</name>
+ <!-- TODO(b/142480271): remove 6.0 when implemented on reference device. -->
<version>6.0</version>
+ <version>7.0</version>
<interface>
<name>IDevicesFactory</name>
<instance>default</instance>
@@ -17,7 +19,9 @@
</hal>
<hal format="hidl" optional="false">
<name>android.hardware.audio.effect</name>
+ <!-- TODO(b/142480271): remove 6.0 when implemented on reference device. -->
<version>6.0</version>
+ <version>7.0</version>
<interface>
<name>IEffectsFactory</name>
<instance>default</instance>
@@ -94,12 +98,19 @@
</hal>
<hal format="hidl" optional="true">
<name>android.hardware.biometrics.fingerprint</name>
- <version>2.1-2</version>
+ <version>2.1-3</version>
<interface>
<name>IBiometricsFingerprint</name>
<instance>default</instance>
</interface>
</hal>
+ <hal format="aidl" optional="true">
+ <name>android.hardware.biometrics.fingerprint</name>
+ <interface>
+ <name>IFingerprint</name>
+ <instance>default</instance>
+ </interface>
+ </hal>
<hal format="hidl" optional="true">
<name>android.hardware.bluetooth</name>
<version>1.0-1</version>
diff --git a/compatibility_matrices/exclude/Android.bp b/compatibility_matrices/exclude/Android.bp
new file mode 100644
index 0000000..d7bf635
--- /dev/null
+++ b/compatibility_matrices/exclude/Android.bp
@@ -0,0 +1,30 @@
+// Copyright (C) 2020 The Android Open Source Project
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+
+cc_library_host_static {
+ name: "libvintf_fcm_exclude",
+ cflags: [
+ "-Wall",
+ "-Werror",
+ ],
+ static_libs: [
+ "libbase",
+ ],
+ export_include_dirs: [
+ "include",
+ ],
+ srcs: [
+ "fcm_exclude.cpp",
+ ],
+}
diff --git a/compatibility_matrices/exclude/fcm_exclude.cpp b/compatibility_matrices/exclude/fcm_exclude.cpp
new file mode 100644
index 0000000..074192c
--- /dev/null
+++ b/compatibility_matrices/exclude/fcm_exclude.cpp
@@ -0,0 +1,84 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <string>
+#include <vector>
+
+#include <android-base/strings.h>
+#include <vintf/fcm_exclude.h>
+
+namespace android::vintf::details {
+
+// The predicate to VintfObject::checkMissingHalsInMatrices.
+bool ShouldCheckMissingHalsInFcm(const std::string& package) {
+ using std::placeholders::_1;
+
+ static std::vector<std::string> included_prefixes{
+ // Other AOSP HALs (e.g. android.frameworks.*) are not added because only framework
+ // matrix is checked.
+ "android.hardware.",
+ };
+
+ static std::vector<std::string> excluded_prefixes{
+ // Packages without top level interfaces (including types-only packages) are exempted.
+ "android.hardware.camera.device@",
+ "android.hardware.gnss.measurement_corrections@1.",
+ "android.hardware.graphics.bufferqueue@",
+
+ // Test packages are exempted.
+ "android.hardware.tests.",
+ };
+
+ static std::vector<std::string> excluded_exact{
+ // TODO(b/110261831): reduce items in this list
+ "android.hardware.media.bufferpool@1.0",
+ "android.hardware.media.bufferpool@2.0",
+ "android.hardware.tv.cec@2.0",
+ "android.hardware.tv.tuner@1.0",
+
+ // Packages without top level interfaces (including types-only packages) are exempted.
+ // HIDL
+ "android.hardware.cas.native@1.0",
+ "android.hardware.gnss.visibility_control@1.0",
+ "android.hardware.radio.config@1.2",
+ // AIDL
+ "android.hardware.biometrics.common",
+ "android.hardware.common",
+ "android.hardware.graphics.common",
+ "android.hardware.keymaster",
+
+ // Fastboot HAL is only used by recovery. Recovery is owned by OEM. Framework
+ // does not depend on this HAL, hence it is not declared in any manifests or matrices.
+ "android.hardware.fastboot@1.0",
+ };
+
+ auto package_has_prefix = [&](const std::string& prefix) {
+ return android::base::StartsWith(package, prefix);
+ };
+
+ // Only check packageAndVersions that are in the include list and not in the exclude list.
+ if (!std::any_of(included_prefixes.begin(), included_prefixes.end(), package_has_prefix)) {
+ return false;
+ }
+
+ if (std::find(excluded_exact.begin(), excluded_exact.end(), package) != excluded_exact.end()) {
+ return false;
+ }
+
+ return !std::any_of(excluded_prefixes.begin(), excluded_prefixes.end(), package_has_prefix);
+}
+
+} // namespace android::vintf::details
diff --git a/compatibility_matrices/exclude/include/vintf/fcm_exclude.h b/compatibility_matrices/exclude/include/vintf/fcm_exclude.h
new file mode 100644
index 0000000..f74c217
--- /dev/null
+++ b/compatibility_matrices/exclude/include/vintf/fcm_exclude.h
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2020 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <string>
+#include <vector>
+
+namespace android::vintf::details {
+
+// Determine whether VINTF checks |package| is missing from FCMs.
+// |package| can be a HIDL package and version like
+// "android.hardware.foo@1.0", or an AIDL package name like
+// "android.hardware.foo".
+bool ShouldCheckMissingHalsInFcm(const std::string& package);
+
+} // namespace android::vintf::details
diff --git a/graphics/composer/2.2/vts/functional/Android.bp b/graphics/composer/2.2/vts/functional/Android.bp
index d80845f..16e9138 100644
--- a/graphics/composer/2.2/vts/functional/Android.bp
+++ b/graphics/composer/2.2/vts/functional/Android.bp
@@ -16,7 +16,11 @@
cc_test {
name: "VtsHalGraphicsComposerV2_2TargetTest",
- defaults: ["VtsHalTargetTestDefaults"],
+ defaults: [
+ "VtsHalTargetTestDefaults",
+ // Needed for librenderengine
+ "skia_deps",
+ ],
srcs: [
"VtsHalGraphicsComposerV2_2ReadbackTest.cpp",
"VtsHalGraphicsComposerV2_2TargetTest.cpp",
diff --git a/neuralnetworks/1.2/vts/functional/AndroidTest.xml b/neuralnetworks/1.2/vts/functional/AndroidTest.xml
index 3f91618..5396d85 100644
--- a/neuralnetworks/1.2/vts/functional/AndroidTest.xml
+++ b/neuralnetworks/1.2/vts/functional/AndroidTest.xml
@@ -28,5 +28,6 @@
<test class="com.android.tradefed.testtype.GTest" >
<option name="native-test-device-path" value="/data/local/tmp" />
<option name="module-name" value="VtsHalNeuralnetworksV1_2TargetTest" />
+ <option name="native-test-timeout" value="20m" />
</test>
</configuration>
diff --git a/neuralnetworks/1.2/vts/functional/CompilationCachingTests.cpp b/neuralnetworks/1.2/vts/functional/CompilationCachingTests.cpp
index 70bee35..ede1600 100644
--- a/neuralnetworks/1.2/vts/functional/CompilationCachingTests.cpp
+++ b/neuralnetworks/1.2/vts/functional/CompilationCachingTests.cpp
@@ -1209,6 +1209,7 @@
return gtestCompliantName(getName(namedDevice) + "_" + type);
}
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CompilationCachingTest);
INSTANTIATE_TEST_SUITE_P(TestCompilationCaching, CompilationCachingTest,
testing::Combine(kNamedDeviceChoices, kOperandTypeChoices),
printCompilationCachingTest);
@@ -1365,6 +1366,7 @@
return gtestCompliantName(getName(namedDevice) + "_" + type + "_" + std::to_string(seed));
}
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CompilationCachingSecurityTest);
INSTANTIATE_TEST_SUITE_P(TestCompilationCaching, CompilationCachingSecurityTest,
testing::Combine(kNamedDeviceChoices, kOperandTypeChoices,
testing::Range(0U, 10U)),
diff --git a/neuralnetworks/1.3/vts/functional/AndroidTest.xml b/neuralnetworks/1.3/vts/functional/AndroidTest.xml
index e5acd90..c418aaa 100644
--- a/neuralnetworks/1.3/vts/functional/AndroidTest.xml
+++ b/neuralnetworks/1.3/vts/functional/AndroidTest.xml
@@ -28,5 +28,6 @@
<test class="com.android.tradefed.testtype.GTest" >
<option name="native-test-device-path" value="/data/local/tmp" />
<option name="module-name" value="VtsHalNeuralnetworksV1_3TargetTest" />
+ <option name="native-test-timeout" value="20m" />
</test>
</configuration>
diff --git a/neuralnetworks/1.3/vts/functional/CompilationCachingTests.cpp b/neuralnetworks/1.3/vts/functional/CompilationCachingTests.cpp
index 4003492..edffa22 100644
--- a/neuralnetworks/1.3/vts/functional/CompilationCachingTests.cpp
+++ b/neuralnetworks/1.3/vts/functional/CompilationCachingTests.cpp
@@ -1200,6 +1200,7 @@
return gtestCompliantName(getName(namedDevice) + "_" + type);
}
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CompilationCachingTest);
INSTANTIATE_TEST_SUITE_P(TestCompilationCaching, CompilationCachingTest,
testing::Combine(kNamedDeviceChoices, kOperandTypeChoices),
printCompilationCachingTest);
@@ -1356,6 +1357,7 @@
return gtestCompliantName(getName(namedDevice) + "_" + type + "_" + std::to_string(seed));
}
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(CompilationCachingSecurityTest);
INSTANTIATE_TEST_SUITE_P(TestCompilationCaching, CompilationCachingSecurityTest,
testing::Combine(kNamedDeviceChoices, kOperandTypeChoices,
testing::Range(0U, 10U)),
diff --git a/neuralnetworks/1.3/vts/functional/MemoryDomainTests.cpp b/neuralnetworks/1.3/vts/functional/MemoryDomainTests.cpp
index 0c657e0..5facc5e 100644
--- a/neuralnetworks/1.3/vts/functional/MemoryDomainTests.cpp
+++ b/neuralnetworks/1.3/vts/functional/MemoryDomainTests.cpp
@@ -605,6 +605,7 @@
return gtestCompliantName(getName(namedDevice) + "_" + type);
}
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(MemoryDomainAllocateTest);
INSTANTIATE_TEST_SUITE_P(TestMemoryDomain, MemoryDomainAllocateTest,
testing::Combine(kNamedDeviceChoices, kTestOperandTypeChoices),
printMemoryDomainAllocateTest);
@@ -829,6 +830,7 @@
return gtestCompliantName(getName(namedDevice) + "_" + type);
}
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(MemoryDomainCopyTest);
INSTANTIATE_TEST_SUITE_P(TestMemoryDomain, MemoryDomainCopyTest,
testing::Combine(kNamedDeviceChoices, kTestOperandTypeChoices),
printMemoryDomainCopyTest);
@@ -1195,6 +1197,7 @@
return gtestCompliantName(getName(namedDevice) + "_" + type + "_" + executorStr);
}
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(MemoryDomainExecutionTest);
INSTANTIATE_TEST_SUITE_P(TestMemoryDomain, MemoryDomainExecutionTest,
testing::Combine(kNamedDeviceChoices, kTestOperandTypeChoices,
kExecutorChoices),
diff --git a/radio/1.4/vts/functional/AndroidTest.xml b/radio/1.4/vts/functional/AndroidTest.xml
index 9df8f9c..469e103 100644
--- a/radio/1.4/vts/functional/AndroidTest.xml
+++ b/radio/1.4/vts/functional/AndroidTest.xml
@@ -13,7 +13,7 @@
See the License for the specific language governing permissions and
limitations under the License.
-->
-<configuration description="Runs VtsHalRadioV1_3TargetTest.">
+<configuration description="Runs VtsHalRadioV1_4TargetTest.">
<option name="test-suite-tag" value="apct" />
<option name="test-suite-tag" value="apct-native" />
@@ -24,11 +24,11 @@
<target_preparer class="com.android.tradefed.targetprep.PushFilePreparer">
<option name="cleanup" value="true" />
- <option name="push" value="VtsHalRadioV1_3TargetTest->/data/local/tmp/VtsHalRadioV1_3TargetTest" />
+ <option name="push" value="VtsHalRadioV1_4TargetTest->/data/local/tmp/VtsHalRadioV1_4TargetTest" />
</target_preparer>
<test class="com.android.tradefed.testtype.GTest" >
<option name="native-test-device-path" value="/data/local/tmp" />
- <option name="module-name" value="VtsHalRadioV1_3TargetTest" />
+ <option name="module-name" value="VtsHalRadioV1_4TargetTest" />
</test>
</configuration>
diff --git a/tv/tuner/1.1/Android.bp b/tv/tuner/1.1/Android.bp
index 92769f0..6cf47f5 100644
--- a/tv/tuner/1.1/Android.bp
+++ b/tv/tuner/1.1/Android.bp
@@ -4,7 +4,6 @@
name: "android.hardware.tv.tuner@1.1",
root: "android.hardware",
srcs: [
- "IDemux.hal",
"IFilter.hal",
"IFrontend.hal",
"IFilterCallback.hal",
diff --git a/tv/tuner/1.1/IDemux.hal b/tv/tuner/1.1/IDemux.hal
deleted file mode 100644
index 434ecbd..0000000
--- a/tv/tuner/1.1/IDemux.hal
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright 2020 The Android Open Source Project
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package android.hardware.tv.tuner@1.1;
-
-import @1.0::IDemux;
-import @1.0::IFilter;
-import @1.0::Result;
-
-/**
- * Demultiplexer(Demux) takes a single multiplexed input and splits it into
- * one or more output.
- */
-interface IDemux extends @1.0::IDemux {
- /**
- * Get a 64-bit hardware sync ID for audio and video.
- *
- * It is used by the client to get the hardware sync ID for audio and video.
- *
- * @param filter the v1_1 filter instance.
- * @return result Result status of the operation.
- * SUCCESS if successful,
- * INVALID_ARGUMENT if failed for a wrong filter ID.
- * UNKNOWN_ERROR if failed for other reasons.
- * @return avSyncHwId the id of hardware A/V sync.
- */
- getAvSyncHwId64Bit(IFilter filter) generates (Result result, uint64_t avSyncHwId);
-};
\ No newline at end of file
diff --git a/tv/tuner/1.1/default/Demux.cpp b/tv/tuner/1.1/default/Demux.cpp
index 007d5eb..66c95dc 100644
--- a/tv/tuner/1.1/default/Demux.cpp
+++ b/tv/tuner/1.1/default/Demux.cpp
@@ -34,49 +34,6 @@
Demux::~Demux() {}
-Return<void> Demux::getAvSyncHwId64Bit(const sp<IFilter>& filter, getAvSyncHwId64Bit_cb _hidl_cb) {
- ALOGV("%s", __FUNCTION__);
-
- uint64_t avSyncHwId = -1;
- uint64_t id;
- Result status;
-
- sp<V1_1::IFilter> filter_v1_1 = V1_1::IFilter::castFrom(filter);
- if (filter_v1_1 != NULL) {
- filter_v1_1->getId64Bit([&](Result result, uint64_t filterId) {
- id = filterId;
- status = result;
- });
- } else {
- filter->getId([&](Result result, uint32_t filterId) {
- id = filterId;
- status = result;
- });
- }
-
- if (status != Result::SUCCESS) {
- ALOGE("[Demux] Can't get 64-bit filter Id.");
- _hidl_cb(Result::INVALID_STATE, avSyncHwId);
- return Void();
- }
-
- if (!mFilters[id]->isMediaFilter()) {
- ALOGE("[Demux] Given filter is not a media filter.");
- _hidl_cb(Result::INVALID_ARGUMENT, avSyncHwId);
- return Void();
- }
-
- if (!mPcrFilterIds.empty()) {
- // Return the lowest pcr filter id in the default implementation as the av sync id
- _hidl_cb(Result::SUCCESS, *mPcrFilterIds.begin());
- return Void();
- }
-
- ALOGE("[Demux] No PCR filter opened.");
- _hidl_cb(Result::INVALID_STATE, avSyncHwId);
- return Void();
-}
-
Return<Result> Demux::setFrontendDataSource(uint32_t frontendId) {
ALOGV("%s", __FUNCTION__);
diff --git a/tv/tuner/1.1/default/Demux.h b/tv/tuner/1.1/default/Demux.h
index 3623d0f..5212eae 100644
--- a/tv/tuner/1.1/default/Demux.h
+++ b/tv/tuner/1.1/default/Demux.h
@@ -17,7 +17,6 @@
#ifndef ANDROID_HARDWARE_TV_TUNER_V1_1_DEMUX_H_
#define ANDROID_HARDWARE_TV_TUNER_V1_1_DEMUX_H_
-#include <android/hardware/tv/tuner/1.1/IDemux.h>
#include <fmq/MessageQueue.h>
#include <math.h>
#include <set>
@@ -49,15 +48,12 @@
class TimeFilter;
class Tuner;
-class Demux : public V1_1::IDemux {
+class Demux : public IDemux {
public:
Demux(uint32_t demuxId, sp<Tuner> tuner);
~Demux();
- virtual Return<void> getAvSyncHwId64Bit(const sp<IFilter>& filter,
- getAvSyncHwId64Bit_cb _hidl_cb) override;
-
virtual Return<Result> setFrontendDataSource(uint32_t frontendId) override;
virtual Return<void> openFilter(const DemuxFilterType& type, uint32_t bufferSize,
diff --git a/tv/tuner/1.1/vts/functional/DemuxTests.cpp b/tv/tuner/1.1/vts/functional/DemuxTests.cpp
index e0600b6..b1d8a0a 100644
--- a/tv/tuner/1.1/vts/functional/DemuxTests.cpp
+++ b/tv/tuner/1.1/vts/functional/DemuxTests.cpp
@@ -38,34 +38,4 @@
auto status = mDemux->close();
mDemux = nullptr;
return AssertionResult(status.isOk());
-}
-
-AssertionResult DemuxTests::getAvSyncId_64bit(sp<IFilter> filter, uint64_t& avSyncHwId) {
- EXPECT_TRUE(mDemux) << "Demux is not opened yet.";
- Result status;
-
- sp<android::hardware::tv::tuner::V1_1::IDemux> demux_v1_1 =
- android::hardware::tv::tuner::V1_1::IDemux::castFrom(mDemux);
- if (demux_v1_1 != NULL) {
- demux_v1_1->getAvSyncHwId64Bit(filter, [&](Result result, uint64_t id) {
- status = result;
- avSyncHwId = id;
- });
- } else {
- ALOGW("[vts] Can't cast IDemux into v1_1.");
- return failure();
- }
-
- return AssertionResult(status == Result::SUCCESS);
-}
-
-AssertionResult DemuxTests::getAvSyncTime(uint32_t avSyncId) {
- EXPECT_TRUE(mDemux) << "Demux is not opened yet.";
- Result status;
- uint64_t syncTime;
- mDemux->getAvSyncTime(avSyncId, [&](Result result, uint64_t time) {
- status = result;
- syncTime = time;
- });
- return AssertionResult(status == Result::SUCCESS);
}
\ No newline at end of file
diff --git a/tv/tuner/1.1/vts/functional/DemuxTests.h b/tv/tuner/1.1/vts/functional/DemuxTests.h
index 393757c..c28d6ca 100644
--- a/tv/tuner/1.1/vts/functional/DemuxTests.h
+++ b/tv/tuner/1.1/vts/functional/DemuxTests.h
@@ -17,7 +17,6 @@
#include <android-base/logging.h>
#include <android/hardware/tv/tuner/1.0/IDemux.h>
#include <android/hardware/tv/tuner/1.0/types.h>
-#include <android/hardware/tv/tuner/1.1/IDemux.h>
#include <android/hardware/tv/tuner/1.1/IFilter.h>
#include <android/hardware/tv/tuner/1.1/ITuner.h>
#include <binder/MemoryDealer.h>
@@ -45,8 +44,6 @@
AssertionResult openDemux(sp<IDemux>& demux, uint32_t& demuxId);
AssertionResult setDemuxFrontendDataSource(uint32_t frontendId);
- AssertionResult getAvSyncId_64bit(sp<IFilter> filter, uint64_t& avSyncHwId);
- AssertionResult getAvSyncTime(uint32_t avSyncId);
AssertionResult closeDemux();
protected:
diff --git a/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.cpp b/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.cpp
index c3df078..a5aab96 100644
--- a/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.cpp
+++ b/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.cpp
@@ -86,41 +86,6 @@
ASSERT_TRUE(mFrontendTests.closeFrontend());
}
-TEST_P(TunerDemuxHidlTest, getAvSyncTime) {
- description("Get the A/V sync time from a PCR filter.");
- uint32_t feId;
- uint32_t demuxId;
- sp<IDemux> demux;
- uint64_t mediaFilterId;
- uint64_t pcrFilterId;
- uint64_t avSyncHwId;
- sp<IFilter> mediaFilter;
-
- mFrontendTests.getFrontendIdByType(frontendArray[DVBT].type, feId);
- ASSERT_TRUE(feId != INVALID_ID);
- ASSERT_TRUE(mFrontendTests.openFrontendById(feId));
- ASSERT_TRUE(mFrontendTests.setFrontendCallback());
- ASSERT_TRUE(mDemuxTests.openDemux(demux, demuxId));
- ASSERT_TRUE(mDemuxTests.setDemuxFrontendDataSource(feId));
- mFilterTests.setDemux(demux);
- ASSERT_TRUE(mFilterTests.openFilterInDemux(filterArray[TS_VIDEO1].type,
- filterArray[TS_VIDEO1].bufferSize));
- ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(mediaFilterId));
- ASSERT_TRUE(mFilterTests.configFilter(filterArray[TS_VIDEO1].settings, mediaFilterId));
- mediaFilter = mFilterTests.getFilterById(mediaFilterId);
- ASSERT_TRUE(mFilterTests.openFilterInDemux(filterArray[TS_PCR0].type,
- filterArray[TS_PCR0].bufferSize));
- ASSERT_TRUE(mFilterTests.getNewlyOpenedFilterId_64bit(pcrFilterId));
- ASSERT_TRUE(mFilterTests.configFilter(filterArray[TS_PCR0].settings, pcrFilterId));
- ASSERT_TRUE(mDemuxTests.getAvSyncId_64bit(mediaFilter, avSyncHwId));
- ASSERT_TRUE(pcrFilterId == avSyncHwId);
- ASSERT_TRUE(mDemuxTests.getAvSyncTime(pcrFilterId));
- ASSERT_TRUE(mFilterTests.closeFilter(pcrFilterId));
- ASSERT_TRUE(mFilterTests.closeFilter(mediaFilterId));
- ASSERT_TRUE(mDemuxTests.closeDemux());
- ASSERT_TRUE(mFrontendTests.closeFrontend());
-}
-
TEST_P(TunerFilterHidlTest, StartFilterInDemux) {
description("Open and start a filter in Demux.");
// TODO use parameterized tests
@@ -153,11 +118,6 @@
android::hardware::PrintInstanceNameToString);
INSTANTIATE_TEST_SUITE_P(
- PerInstance, TunerDemuxHidlTest,
- testing::ValuesIn(android::hardware::getAllHalInstanceNames(ITuner::descriptor)),
- android::hardware::PrintInstanceNameToString);
-
-INSTANTIATE_TEST_SUITE_P(
PerInstance, TunerRecordHidlTest,
testing::ValuesIn(android::hardware::getAllHalInstanceNames(ITuner::descriptor)),
android::hardware::PrintInstanceNameToString);
diff --git a/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.h b/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.h
index 505e35a..47004f6 100644
--- a/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.h
+++ b/tv/tuner/1.1/vts/functional/VtsHalTvTunerV1_1TargetTest.h
@@ -53,31 +53,6 @@
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TunerFilterHidlTest);
-class TunerDemuxHidlTest : public testing::TestWithParam<std::string> {
- public:
- virtual void SetUp() override {
- mService = ITuner::getService(GetParam());
- ASSERT_NE(mService, nullptr);
- initConfiguration();
-
- mFrontendTests.setService(mService);
- mDemuxTests.setService(mService);
- mFilterTests.setService(mService);
- }
-
- protected:
- static void description(const std::string& description) {
- RecordProperty("description", description);
- }
-
- sp<ITuner> mService;
- FrontendTests mFrontendTests;
- DemuxTests mDemuxTests;
- FilterTests mFilterTests;
-};
-
-GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(TunerDemuxHidlTest);
-
class TunerRecordHidlTest : public testing::TestWithParam<std::string> {
public:
virtual void SetUp() override {
diff --git a/wifi/hostapd/1.0/vts/functional/hostapd_hidl_call_util.h b/wifi/hostapd/1.0/vts/functional/hostapd_hidl_call_util.h
index ec7ebee..b4b0ea6 100644
--- a/wifi/hostapd/1.0/vts/functional/hostapd_hidl_call_util.h
+++ b/wifi/hostapd/1.0/vts/functional/hostapd_hidl_call_util.h
@@ -95,6 +95,14 @@
EXPECT_TRUE(res.isOk());
return result_buffer.saved_values;
}
+
+// Invokes |void method| on |object| without arguments.
+template <typename MethodT, typename ObjectT>
+void invokeVoidMethodWithoutArguments(MethodT method, ObjectT object) {
+ const auto& res = ((*object).*method)();
+ EXPECT_TRUE(res.isOk());
+}
+
} // namespace detail
} // namespace
@@ -123,3 +131,9 @@
std::remove_reference<decltype(*strong_pointer)>::type::method##_cb>( \
&std::remove_reference<decltype(*strong_pointer)>::type::method, \
strong_pointer, ##__VA_ARGS__))
+
+// Invokes |void method| on |strong_pointer| without arguments.
+#define HIDL_INVOKE_VOID_WITHOUT_ARGUMENTS(strong_pointer, method) \
+ (detail::invokeVoidMethodWithoutArguments( \
+ &std::remove_reference<decltype(*strong_pointer)>::type::method, \
+ strong_pointer))
diff --git a/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp b/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp
index 82c257b..1b4eea6 100644
--- a/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp
+++ b/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test.cpp
@@ -55,7 +55,10 @@
ASSERT_NE(hostapd_.get(), nullptr);
}
- virtual void TearDown() override { stopHostapd(wifi_instance_name_); }
+ virtual void TearDown() override {
+ HIDL_INVOKE_VOID_WITHOUT_ARGUMENTS(hostapd_, terminate);
+ stopHostapd(wifi_instance_name_);
+ }
protected:
std::string getPrimaryWlanIfaceName() {
diff --git a/wifi/hostapd/1.1/vts/functional/hostapd_hidl_test.cpp b/wifi/hostapd/1.1/vts/functional/hostapd_hidl_test.cpp
index 3944a3a..32bbe72 100644
--- a/wifi/hostapd/1.1/vts/functional/hostapd_hidl_test.cpp
+++ b/wifi/hostapd/1.1/vts/functional/hostapd_hidl_test.cpp
@@ -60,7 +60,10 @@
ASSERT_NE(hostapd_.get(), nullptr);
}
- virtual void TearDown() override { stopHostapd(wifi_instance_name_); }
+ virtual void TearDown() override {
+ HIDL_INVOKE_VOID_WITHOUT_ARGUMENTS(hostapd_, terminate);
+ stopHostapd(wifi_instance_name_);
+ }
protected:
std::string getPrimaryWlanIfaceName() {
diff --git a/wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp b/wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp
index 62e3c16..99784a4 100644
--- a/wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp
+++ b/wifi/hostapd/1.2/vts/functional/hostapd_hidl_test.cpp
@@ -72,7 +72,10 @@
"wifi_softap_wpa3_sae_supported");
}
- virtual void TearDown() override { stopHostapd(wifi_instance_name_); }
+ virtual void TearDown() override {
+ HIDL_INVOKE_VOID_WITHOUT_ARGUMENTS(hostapd_, terminate);
+ stopHostapd(wifi_instance_name_);
+ }
protected:
bool isWpa3SaeSupport_ = false;
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
index 5e7a371..da3996b 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.cpp
@@ -52,10 +52,6 @@
// Helper function to initialize the driver and firmware to STA mode
// using the vendor HAL HIDL interface.
void initilializeDriverAndFirmware(const std::string& wifi_instance_name) {
- // Skip if wifi instance is not set.
- if (wifi_instance_name == "") {
- return;
- }
if (getWifi(wifi_instance_name) != nullptr) {
sp<IWifiChip> wifi_chip = getWifiChip(wifi_instance_name);
ChipModeId mode_id;
@@ -69,10 +65,6 @@
// Helper function to deinitialize the driver and firmware
// using the vendor HAL HIDL interface.
void deInitilializeDriverAndFirmware(const std::string& wifi_instance_name) {
- // Skip if wifi instance is not set.
- if (wifi_instance_name == "") {
- return;
- }
if (getWifi(wifi_instance_name) != nullptr) {
stopWifi(wifi_instance_name);
} else {
@@ -283,3 +275,17 @@
});
return !operation_failed;
}
+
+bool waitForFrameworkReady() {
+ int waitCount = 10;
+ do {
+ // Check whether package service is ready or not.
+ if (!testing::checkSubstringInCommandOutput(
+ "/system/bin/service check package", ": not found")) {
+ return true;
+ }
+ LOG(INFO) << "Framework is not ready";
+ sleep(1);
+ } while (waitCount-- > 0);
+ return false;
+}
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h
index 1ccf091..33945cc 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_hidl_test_utils.h
@@ -17,6 +17,8 @@
#ifndef SUPPLICANT_HIDL_TEST_UTILS_H
#define SUPPLICANT_HIDL_TEST_UTILS_H
+#include <VtsCoreUtil.h>
+#include <android-base/logging.h>
#include <android/hardware/wifi/supplicant/1.0/ISupplicant.h>
#include <android/hardware/wifi/supplicant/1.0/ISupplicantP2pIface.h>
#include <android/hardware/wifi/supplicant/1.0/ISupplicantStaIface.h>
@@ -62,4 +64,51 @@
bool turnOnExcessiveLogging();
+bool waitForFrameworkReady();
+
+class SupplicantHidlTestBase
+ : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
+ public:
+ virtual void SetUp() override {
+ // should always be v1.0 wifi
+ wifi_v1_0_instance_name_ = std::get<0>(GetParam());
+ supplicant_instance_name_ = std::get<1>(GetParam());
+ std::system("/system/bin/start");
+ ASSERT_TRUE(waitForFrameworkReady());
+
+ isP2pOn_ =
+ testing::deviceSupportsFeature("android.hardware.wifi.direct");
+ // Stop Framework
+ std::system("/system/bin/stop");
+ stopSupplicant(wifi_v1_0_instance_name_);
+ startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
+ supplicant_instance_name_);
+ LOG(INFO) << "SupplicantHidlTestBase isP2pOn_: " << isP2pOn_;
+ }
+
+ virtual void TearDown() override {
+ stopSupplicant(wifi_v1_0_instance_name_);
+ // Start Framework
+ std::system("/system/bin/start");
+ }
+
+ protected:
+ bool isP2pOn_ = false;
+ std::string wifi_v1_0_instance_name_;
+ std::string supplicant_instance_name_;
+};
+
+class SupplicantHidlTestBaseV1_0 : public SupplicantHidlTestBase {
+ public:
+ virtual void SetUp() override {
+ SupplicantHidlTestBase::SetUp();
+ supplicant_ = getSupplicant(supplicant_instance_name_, isP2pOn_);
+ ASSERT_NE(supplicant_.get(), nullptr);
+ EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ }
+
+ protected:
+ android::sp<android::hardware::wifi::supplicant::V1_0::ISupplicant>
+ supplicant_;
+};
#endif /* SUPPLICANT_HIDL_TEST_UTILS_H */
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp
index 616869b..e74fd59 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_p2p_iface_hidl_test.cpp
@@ -71,21 +71,13 @@
constexpr SupplicantNetworkId kTestNetworkId = 5;
} // namespace
-class SupplicantP2pIfaceHidlTest
- : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
+class SupplicantP2pIfaceHidlTest : public SupplicantHidlTestBaseV1_0 {
public:
virtual void SetUp() override {
- wifi_instance_name_ = std::get<0>(GetParam());
- supplicant_instance_name_ = std::get<1>(GetParam());
- isP2pOn_ =
- testing::deviceSupportsFeature("android.hardware.wifi.direct");
- // Stop Framework
- std::system("/system/bin/stop");
- stopSupplicant(wifi_instance_name_);
- startSupplicantAndWaitForHidlService(wifi_instance_name_,
- supplicant_instance_name_);
- supplicant_ = getSupplicant(supplicant_instance_name_, isP2pOn_);
- EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ SupplicantHidlTestBaseV1_0::SetUp();
+ if (!isP2pOn_) {
+ GTEST_SKIP() << "Wi-Fi Direct is not supported, skip this test.";
+ }
p2p_iface_ = getSupplicantP2pIface(supplicant_);
ASSERT_NE(p2p_iface_.get(), nullptr);
@@ -93,22 +85,11 @@
memcpy(peer_mac_addr_.data(), kTestPeerMacAddr, peer_mac_addr_.size());
}
- virtual void TearDown() override {
- stopSupplicant(wifi_instance_name_);
- // Start Framework
- std::system("/system/bin/start");
- }
-
protected:
- bool isP2pOn_ = false;
- sp<ISupplicant> supplicant_;
- // ISupplicantP2pIface object used for all tests in this fixture.
sp<ISupplicantP2pIface> p2p_iface_;
// MAC address to use for various tests.
std::array<uint8_t, 6> mac_addr_;
std::array<uint8_t, 6> peer_mac_addr_;
- std::string wifi_instance_name_;
- std::string supplicant_instance_name_;
};
class IfaceCallback : public ISupplicantP2pIfaceCallback {
@@ -201,8 +182,8 @@
* successfully created.
*/
TEST_P(SupplicantP2pIfaceHidlTest, Create) {
- stopSupplicant(wifi_instance_name_);
- startSupplicantAndWaitForHidlService(wifi_instance_name_,
+ stopSupplicant(wifi_v1_0_instance_name_);
+ startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
supplicant_instance_name_);
sp<ISupplicantP2pIface> p2p_iface = getSupplicantP2pIface(
getSupplicant(supplicant_instance_name_, isP2pOn_));
@@ -301,8 +282,8 @@
mac_addr_, ISupplicantP2pIface::WpsProvisionMethod::PBC,
kTestConnectPin, false, false, kTestConnectGoIntent,
[](const SupplicantStatus& status, const hidl_string& /* pin */) {
- // This is not going to work with fake values.
- EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ // After enabling auto-join, it will succeed always.
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
});
}
@@ -314,12 +295,12 @@
mac_addr_, ISupplicantP2pIface::WpsProvisionMethod::PBC,
kTestConnectPin, false, false, kTestConnectGoIntent,
[](const SupplicantStatus& status, const hidl_string& /* pin */) {
- // This is not going to work with fake values.
- EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ // After enabling auto-join, it will succeed always.
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
});
p2p_iface_->cancelConnect([](const SupplicantStatus& status) {
- EXPECT_EQ(SupplicantStatusCode::FAILURE_UNKNOWN, status.code);
+ EXPECT_EQ(SupplicantStatusCode::SUCCESS, status.code);
});
}
@@ -655,4 +636,4 @@
android::hardware::getAllHalInstanceNames(IWifi::descriptor)),
testing::ValuesIn(android::hardware::getAllHalInstanceNames(
ISupplicant::descriptor))),
- android::hardware::PrintInstanceTupleNameToString<>);
\ No newline at end of file
+ android::hardware::PrintInstanceTupleNameToString<>);
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp
index e4fe52c..6b85e00 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_sta_iface_hidl_test.cpp
@@ -66,42 +66,22 @@
constexpr uint16_t kTestWpsConfigMethods = 0xffff;
} // namespace
-class SupplicantStaIfaceHidlTest
- : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
+class SupplicantStaIfaceHidlTest : public SupplicantHidlTestBaseV1_0 {
public:
virtual void SetUp() override {
- wifi_instance_name_ = std::get<0>(GetParam());
- supplicant_instance_name_ = std::get<1>(GetParam());
- isP2pOn_ =
- testing::deviceSupportsFeature("android.hardware.wifi.direct");
- // Stop Framework
- std::system("/system/bin/stop");
- stopSupplicant(wifi_instance_name_);
- startSupplicantAndWaitForHidlService(wifi_instance_name_,
- supplicant_instance_name_);
- supplicant_ = getSupplicant(supplicant_instance_name_, isP2pOn_);
- EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ SupplicantHidlTestBaseV1_0::SetUp();
sta_iface_ = getSupplicantStaIface(supplicant_);
ASSERT_NE(sta_iface_.get(), nullptr);
memcpy(mac_addr_.data(), kTestMacAddr, mac_addr_.size());
}
- virtual void TearDown() override {
- stopSupplicant(wifi_instance_name_);
- // Start Framework
- std::system("/system/bin/start");
- }
-
protected:
bool isP2pOn_ = false;
- sp<ISupplicant> supplicant_;
// ISupplicantStaIface object used for all tests in this fixture.
sp<ISupplicantStaIface> sta_iface_;
// MAC address to use for various tests.
std::array<uint8_t, 6> mac_addr_;
- std::string wifi_instance_name_;
- std::string supplicant_instance_name_;
};
class IfaceCallback : public ISupplicantStaIfaceCallback {
@@ -183,8 +163,8 @@
* successfully created.
*/
TEST_P(SupplicantStaIfaceHidlTest, Create) {
- stopSupplicant(wifi_instance_name_);
- startSupplicantAndWaitForHidlService(wifi_instance_name_,
+ stopSupplicant(wifi_v1_0_instance_name_);
+ startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
supplicant_instance_name_);
EXPECT_NE(nullptr, getSupplicantStaIface(
getSupplicant(supplicant_instance_name_, isP2pOn_))
@@ -566,4 +546,4 @@
android::hardware::getAllHalInstanceNames(IWifi::descriptor)),
testing::ValuesIn(android::hardware::getAllHalInstanceNames(
ISupplicant::descriptor))),
- android::hardware::PrintInstanceTupleNameToString<>);
\ No newline at end of file
+ android::hardware::PrintInstanceTupleNameToString<>);
diff --git a/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp b/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
index 7e93c5f..2b4d681 100644
--- a/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
+++ b/wifi/supplicant/1.0/vts/functional/supplicant_sta_network_hidl_test.cpp
@@ -79,21 +79,10 @@
ISupplicantStaNetwork::PairwiseCipherMask::TKIP);
} // namespace
-class SupplicantStaNetworkHidlTest
- : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
+class SupplicantStaNetworkHidlTest : public SupplicantHidlTestBaseV1_0 {
public:
virtual void SetUp() override {
- wifi_instance_name_ = std::get<0>(GetParam());
- supplicant_instance_name_ = std::get<1>(GetParam());
- isP2pOn_ =
- testing::deviceSupportsFeature("android.hardware.wifi.direct");
- // Stop Framework
- std::system("/system/bin/stop");
- stopSupplicant(wifi_instance_name_);
- startSupplicantAndWaitForHidlService(wifi_instance_name_,
- supplicant_instance_name_);
- supplicant_ = getSupplicant(supplicant_instance_name_, isP2pOn_);
- EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ SupplicantHidlTestBaseV1_0::SetUp();
sta_network_ = createSupplicantStaNetwork(supplicant_);
ASSERT_NE(sta_network_.get(), nullptr);
/* variable used to check if the underlying HAL version is 1.3 or
@@ -105,12 +94,6 @@
ssid_.assign(kTestSsidStr, kTestSsidStr + strlen(kTestSsidStr));
}
- virtual void TearDown() override {
- stopSupplicant(wifi_instance_name_);
- // Start Framework
- std::system("/system/bin/start");
- }
-
protected:
void removeNetwork() {
sp<ISupplicantStaIface> sta_iface = getSupplicantStaIface(supplicant_);
@@ -128,14 +111,10 @@
sp<::android::hardware::wifi::supplicant::V1_3::ISupplicantStaNetwork>
v1_3 = nullptr;
- bool isP2pOn_ = false;
- sp<ISupplicant> supplicant_;
// ISupplicantStaNetwork object used for all tests in this fixture.
sp<ISupplicantStaNetwork> sta_network_;
// SSID to use for various tests.
std::vector<uint8_t> ssid_;
- std::string wifi_instance_name_;
- std::string supplicant_instance_name_;
};
class NetworkCallback : public ISupplicantStaNetworkCallback {
@@ -158,8 +137,8 @@
* successfully created.
*/
TEST_P(SupplicantStaNetworkHidlTest, Create) {
- stopSupplicant(wifi_instance_name_);
- startSupplicantAndWaitForHidlService(wifi_instance_name_,
+ stopSupplicant(wifi_v1_0_instance_name_);
+ startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
supplicant_instance_name_);
sp<ISupplicant> supplicant =
getSupplicant(supplicant_instance_name_, isP2pOn_);
diff --git a/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test.cpp b/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test.cpp
index 0e404e7..3c4d06b 100644
--- a/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test.cpp
+++ b/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test.cpp
@@ -35,9 +35,9 @@
using ::android::hardware::wifi::supplicant::V1_1::ISupplicant;
using ::android::sp;
-class SupplicantHidlTest : public SupplicantHidlTestBase {
+class SupplicantHidlTest : public SupplicantHidlTestBaseV1_1 {
public:
- virtual void SetUp() override { SupplicantHidlTestBase::SetUp(); }
+ virtual void SetUp() override { SupplicantHidlTestBaseV1_1::SetUp(); }
protected:
std::string getWlan0IfaceName() {
diff --git a/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.h b/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.h
index 2104794..b6feb41 100644
--- a/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.h
+++ b/wifi/supplicant/1.1/vts/functional/supplicant_hidl_test_utils_1_1.h
@@ -36,34 +36,15 @@
const android::sp<android::hardware::wifi::supplicant::V1_1::ISupplicant>&
supplicant);
-class SupplicantHidlTestBase
- : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
+class SupplicantHidlTestBaseV1_1 : public SupplicantHidlTestBase {
public:
virtual void SetUp() override {
- wifi_v1_0_instance_name_ = std::get<0>(GetParam());
- supplicant_v1_1_instance_name_ = std::get<1>(GetParam());
- isP2pOn_ =
- testing::deviceSupportsFeature("android.hardware.wifi.direct");
- // Stop Framework
- std::system("/system/bin/stop");
- stopSupplicant(wifi_v1_0_instance_name_);
- startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
- supplicant_v1_1_instance_name_);
- supplicant_ =
- getSupplicant_1_1(supplicant_v1_1_instance_name_, isP2pOn_);
+ SupplicantHidlTestBase::SetUp();
+ supplicant_ = getSupplicant_1_1(supplicant_instance_name_, isP2pOn_);
ASSERT_NE(supplicant_.get(), nullptr);
}
- virtual void TearDown() override {
- stopSupplicant(wifi_v1_0_instance_name_);
- // Start Framework
- std::system("/system/bin/start");
- }
-
protected:
android::sp<android::hardware::wifi::supplicant::V1_1::ISupplicant>
supplicant_;
- bool isP2pOn_ = false;
- std::string wifi_v1_0_instance_name_;
- std::string supplicant_v1_1_instance_name_;
};
diff --git a/wifi/supplicant/1.1/vts/functional/supplicant_sta_iface_hidl_test.cpp b/wifi/supplicant/1.1/vts/functional/supplicant_sta_iface_hidl_test.cpp
index 2fade44..db6323c 100644
--- a/wifi/supplicant/1.1/vts/functional/supplicant_sta_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.1/vts/functional/supplicant_sta_iface_hidl_test.cpp
@@ -39,11 +39,10 @@
using ::android::hardware::wifi::supplicant::V1_1::ISupplicantStaIface;
using ::android::hardware::wifi::supplicant::V1_1::ISupplicantStaIfaceCallback;
-class SupplicantStaIfaceHidlTest : public SupplicantHidlTestBase {
+class SupplicantStaIfaceHidlTest : public SupplicantHidlTestBaseV1_1 {
public:
virtual void SetUp() override {
- SupplicantHidlTestBase::SetUp();
- EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ SupplicantHidlTestBaseV1_1::SetUp();
sta_iface_ = getSupplicantStaIface_1_1(supplicant_);
ASSERT_NE(sta_iface_.get(), nullptr);
}
@@ -149,4 +148,4 @@
testing::ValuesIn(android::hardware::getAllHalInstanceNames(
android::hardware::wifi::supplicant::V1_1::ISupplicant::
descriptor))),
- android::hardware::PrintInstanceTupleNameToString<>);
\ No newline at end of file
+ android::hardware::PrintInstanceTupleNameToString<>);
diff --git a/wifi/supplicant/1.1/vts/functional/supplicant_sta_network_hidl_test.cpp b/wifi/supplicant/1.1/vts/functional/supplicant_sta_network_hidl_test.cpp
index bd8a2ab..37641a4 100644
--- a/wifi/supplicant/1.1/vts/functional/supplicant_sta_network_hidl_test.cpp
+++ b/wifi/supplicant/1.1/vts/functional/supplicant_sta_network_hidl_test.cpp
@@ -37,11 +37,10 @@
constexpr uint8_t kTestEncryptedIdentity[] = {0x35, 0x37, 0x58, 0x57, 0x26};
} // namespace
-class SupplicantStaNetworkHidlTest : public SupplicantHidlTestBase {
+class SupplicantStaNetworkHidlTest : public SupplicantHidlTestBaseV1_1 {
public:
virtual void SetUp() override {
- SupplicantHidlTestBase::SetUp();
- EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ SupplicantHidlTestBaseV1_1::SetUp();
sta_network_ = createSupplicantStaNetwork_1_1(supplicant_);
ASSERT_NE(sta_network_.get(), nullptr);
}
@@ -59,9 +58,9 @@
TEST_P(SupplicantStaNetworkHidlTest, Create) {
stopSupplicant(wifi_v1_0_instance_name_);
startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
- supplicant_v1_1_instance_name_);
+ supplicant_instance_name_);
sp<ISupplicant> supplicant =
- getSupplicant_1_1(supplicant_v1_1_instance_name_, isP2pOn_);
+ getSupplicant_1_1(supplicant_instance_name_, isP2pOn_);
EXPECT_NE(nullptr, createSupplicantStaNetwork_1_1(supplicant).get());
}
@@ -102,4 +101,4 @@
testing::ValuesIn(android::hardware::getAllHalInstanceNames(
android::hardware::wifi::supplicant::V1_1::ISupplicant::
descriptor))),
- android::hardware::PrintInstanceTupleNameToString<>);
\ No newline at end of file
+ android::hardware::PrintInstanceTupleNameToString<>);
diff --git a/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.h b/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.h
index 2a432d0..b9c5ade 100644
--- a/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.h
+++ b/wifi/supplicant/1.2/vts/functional/supplicant_hidl_test_utils_1_2.h
@@ -42,35 +42,16 @@
const android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicant>&
supplicant);
-class SupplicantHidlTestBase
- : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
+class SupplicantHidlTestBaseV1_2 : public SupplicantHidlTestBase {
public:
virtual void SetUp() override {
- wifi_v1_0_instance_name_ = std::get<0>(GetParam());
- supplicant_v1_2_instance_name_ = std::get<1>(GetParam());
- isP2pOn_ =
- testing::deviceSupportsFeature("android.hardware.wifi.direct");
- // Stop Framework
- std::system("/system/bin/stop");
- stopSupplicant(wifi_v1_0_instance_name_);
- startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
- supplicant_v1_2_instance_name_);
- supplicant_ =
- getSupplicant_1_2(supplicant_v1_2_instance_name_, isP2pOn_);
+ SupplicantHidlTestBase::SetUp();
+ supplicant_ = getSupplicant_1_2(supplicant_instance_name_, isP2pOn_);
ASSERT_NE(supplicant_.get(), nullptr);
EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
}
- virtual void TearDown() override {
- stopSupplicant(wifi_v1_0_instance_name_);
- // Start Framework
- std::system("/system/bin/start");
- }
-
protected:
android::sp<android::hardware::wifi::supplicant::V1_2::ISupplicant>
supplicant_;
- bool isP2pOn_ = false;
- std::string wifi_v1_0_instance_name_;
- std::string supplicant_v1_2_instance_name_;
};
diff --git a/wifi/supplicant/1.2/vts/functional/supplicant_p2p_iface_hidl_test.cpp b/wifi/supplicant/1.2/vts/functional/supplicant_p2p_iface_hidl_test.cpp
index 75512d7..7884cc6 100644
--- a/wifi/supplicant/1.2/vts/functional/supplicant_p2p_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.2/vts/functional/supplicant_p2p_iface_hidl_test.cpp
@@ -38,11 +38,10 @@
constexpr uint8_t kTestZeroMacAddr[] = {[0 ... 5] = 0x0};
} // namespace
-class SupplicantP2pIfaceHidlTest : public SupplicantHidlTestBase {
+class SupplicantP2pIfaceHidlTest : public SupplicantHidlTestBaseV1_2 {
public:
virtual void SetUp() override {
- SupplicantHidlTestBase::SetUp();
- EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ SupplicantHidlTestBaseV1_2::SetUp();
if (!isP2pOn_) {
GTEST_SKIP() << "Wi-Fi Direct is not supported, skip this test.";
}
diff --git a/wifi/supplicant/1.2/vts/functional/supplicant_sta_iface_hidl_test.cpp b/wifi/supplicant/1.2/vts/functional/supplicant_sta_iface_hidl_test.cpp
index 184543b..cd08468 100644
--- a/wifi/supplicant/1.2/vts/functional/supplicant_sta_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.2/vts/functional/supplicant_sta_iface_hidl_test.cpp
@@ -53,11 +53,10 @@
#define TIMEOUT_PERIOD 60
class IfaceDppCallback;
-class SupplicantStaIfaceHidlTest : public SupplicantHidlTestBase {
+class SupplicantStaIfaceHidlTest : public SupplicantHidlTestBaseV1_2 {
public:
virtual void SetUp() override {
- SupplicantHidlTestBase::SetUp();
- EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ SupplicantHidlTestBaseV1_2::SetUp();
sta_iface_ = getSupplicantStaIface_1_2(supplicant_);
ASSERT_NE(sta_iface_.get(), nullptr);
count_ = 0;
diff --git a/wifi/supplicant/1.2/vts/functional/supplicant_sta_network_hidl_test.cpp b/wifi/supplicant/1.2/vts/functional/supplicant_sta_network_hidl_test.cpp
index 5a2f808..ee5de69 100644
--- a/wifi/supplicant/1.2/vts/functional/supplicant_sta_network_hidl_test.cpp
+++ b/wifi/supplicant/1.2/vts/functional/supplicant_sta_network_hidl_test.cpp
@@ -37,10 +37,10 @@
// constexpr uint8_t kTestEncryptedIdentity[] = {0x35, 0x37, 0x58, 0x57, 0x26};
//} // namespace
-class SupplicantStaNetworkHidlTest : public SupplicantHidlTestBase {
+class SupplicantStaNetworkHidlTest : public SupplicantHidlTestBaseV1_2 {
public:
virtual void SetUp() override {
- SupplicantHidlTestBase::SetUp();
+ SupplicantHidlTestBaseV1_2::SetUp();
sta_network_ = createSupplicantStaNetwork_1_2(supplicant_);
ASSERT_NE(sta_network_.get(), nullptr);
}
diff --git a/wifi/supplicant/1.3/vts/functional/supplicant_hidl_test_utils_1_3.h b/wifi/supplicant/1.3/vts/functional/supplicant_hidl_test_utils_1_3.h
index 69fc598..b28c5a4 100644
--- a/wifi/supplicant/1.3/vts/functional/supplicant_hidl_test_utils_1_3.h
+++ b/wifi/supplicant/1.3/vts/functional/supplicant_hidl_test_utils_1_3.h
@@ -34,4 +34,17 @@
bool isFilsSupported(
android::sp<android::hardware::wifi::supplicant::V1_3::ISupplicantStaIface>
sta_iface);
+
+class SupplicantHidlTestBaseV1_3 : public SupplicantHidlTestBase {
+ public:
+ virtual void SetUp() override {
+ SupplicantHidlTestBase::SetUp();
+ supplicant_ = getSupplicant_1_3(supplicant_instance_name_, isP2pOn_);
+ ASSERT_NE(supplicant_.get(), nullptr);
+ }
+
+ protected:
+ android::sp<android::hardware::wifi::supplicant::V1_3::ISupplicant>
+ supplicant_;
+};
#endif /* SUPPLICANT_HIDL_TEST_UTILS_1_3_H */
diff --git a/wifi/supplicant/1.3/vts/functional/supplicant_sta_iface_hidl_test.cpp b/wifi/supplicant/1.3/vts/functional/supplicant_sta_iface_hidl_test.cpp
index 221c393..6dc267c 100644
--- a/wifi/supplicant/1.3/vts/functional/supplicant_sta_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.3/vts/functional/supplicant_sta_iface_hidl_test.cpp
@@ -55,33 +55,14 @@
#define TIMEOUT_PERIOD 60
class IfaceDppCallback;
-class SupplicantStaIfaceHidlTest
- : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
+class SupplicantStaIfaceHidlTest : public SupplicantHidlTestBaseV1_3 {
public:
virtual void SetUp() override {
- wifi_v1_0_instance_name_ = std::get<0>(GetParam());
- supplicant_v1_3_instance_name_ = std::get<1>(GetParam());
- isP2pOn_ =
- testing::deviceSupportsFeature("android.hardware.wifi.direct");
- // Stop Framework
- std::system("/system/bin/stop");
-
- stopSupplicant(wifi_v1_0_instance_name_);
- startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
- supplicant_v1_3_instance_name_);
- supplicant_ =
- getSupplicant_1_3(supplicant_v1_3_instance_name_, isP2pOn_);
- EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ SupplicantHidlTestBaseV1_3::SetUp();
sta_iface_ = getSupplicantStaIface_1_3(supplicant_);
ASSERT_NE(sta_iface_.get(), nullptr);
}
- virtual void TearDown() override {
- stopSupplicant(wifi_v1_0_instance_name_);
- // Start Framework
- std::system("/system/bin/start");
- }
-
int64_t pmkCacheExpirationTimeInSec;
std::vector<uint8_t> serializedPmkCacheEntry;
@@ -127,10 +108,6 @@
protected:
// ISupplicantStaIface object used for all tests in this fixture.
sp<ISupplicantStaIface> sta_iface_;
- sp<ISupplicant> supplicant_;
- bool isP2pOn_ = false;
- std::string wifi_v1_0_instance_name_;
- std::string supplicant_v1_3_instance_name_;
bool isDppSupported() {
uint32_t keyMgmtMask = 0;
diff --git a/wifi/supplicant/1.3/vts/functional/supplicant_sta_network_hidl_test.cpp b/wifi/supplicant/1.3/vts/functional/supplicant_sta_network_hidl_test.cpp
index 11c55a6..12d8d0d 100644
--- a/wifi/supplicant/1.3/vts/functional/supplicant_sta_network_hidl_test.cpp
+++ b/wifi/supplicant/1.3/vts/functional/supplicant_sta_network_hidl_test.cpp
@@ -43,43 +43,20 @@
constexpr OcspType kTestInvalidOcspType = (OcspType)-1;
} // namespace
-class SupplicantStaNetworkHidlTest
- : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
+class SupplicantStaNetworkHidlTest : public SupplicantHidlTestBaseV1_3 {
public:
virtual void SetUp() override {
- wifi_v1_0_instance_name_ = std::get<0>(GetParam());
- supplicant_v1_3_instance_name_ = std::get<1>(GetParam());
- isP2pOn_ =
- testing::deviceSupportsFeature("android.hardware.wifi.direct");
- // Stop Framework
- std::system("/system/bin/stop");
-
- stopSupplicant(wifi_v1_0_instance_name_);
- startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
- supplicant_v1_3_instance_name_);
- supplicant_ =
- getSupplicant_1_3(supplicant_v1_3_instance_name_, isP2pOn_);
- EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ SupplicantHidlTestBaseV1_3::SetUp();
sta_iface_ = getSupplicantStaIface_1_3(supplicant_);
ASSERT_NE(nullptr, sta_iface_.get());
sta_network_ = createSupplicantStaNetwork_1_3(supplicant_);
ASSERT_NE(sta_network_.get(), nullptr);
}
- virtual void TearDown() override {
- stopSupplicant(wifi_v1_0_instance_name_);
- // Start Framework
- std::system("/system/bin/start");
- }
-
protected:
sp<ISupplicantStaIface> sta_iface_;
// ISupplicantStaNetwork object used for all tests in this fixture.
sp<ISupplicantStaNetwork> sta_network_;
- sp<ISupplicant> supplicant_;
- bool isP2pOn_ = false;
- std::string wifi_v1_0_instance_name_;
- std::string supplicant_v1_3_instance_name_;
bool isWapiSupported() {
uint32_t keyMgmtMask = 0;
diff --git a/wifi/supplicant/1.4/vts/functional/supplicant_hidl_test_utils_1_4.h b/wifi/supplicant/1.4/vts/functional/supplicant_hidl_test_utils_1_4.h
index bea4dc1..60fe1dc 100644
--- a/wifi/supplicant/1.4/vts/functional/supplicant_hidl_test_utils_1_4.h
+++ b/wifi/supplicant/1.4/vts/functional/supplicant_hidl_test_utils_1_4.h
@@ -27,4 +27,17 @@
android::sp<android::hardware::wifi::supplicant::V1_4::ISupplicant>
getSupplicant_1_4(const std::string& supplicant_instance_name, bool isP2pOn);
+class SupplicantHidlTestBaseV1_4 : public SupplicantHidlTestBase {
+ public:
+ virtual void SetUp() override {
+ SupplicantHidlTestBase::SetUp();
+ supplicant_ = getSupplicant_1_4(supplicant_instance_name_, isP2pOn_);
+ ASSERT_NE(supplicant_.get(), nullptr);
+ EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ }
+
+ protected:
+ android::sp<android::hardware::wifi::supplicant::V1_4::ISupplicant>
+ supplicant_;
+};
#endif /* SUPPLICANT_HIDL_TEST_UTILS_1_4_H */
diff --git a/wifi/supplicant/1.4/vts/functional/supplicant_sta_iface_hidl_test.cpp b/wifi/supplicant/1.4/vts/functional/supplicant_sta_iface_hidl_test.cpp
index 0a20455..5b9c750 100644
--- a/wifi/supplicant/1.4/vts/functional/supplicant_sta_iface_hidl_test.cpp
+++ b/wifi/supplicant/1.4/vts/functional/supplicant_sta_iface_hidl_test.cpp
@@ -40,36 +40,17 @@
using ::android::hardware::wifi::supplicant::V1_4::ISupplicant;
using ::android::hardware::wifi::supplicant::V1_4::ISupplicantStaIface;
-class SupplicantStaIfaceHidlTest
- : public ::testing::TestWithParam<std::tuple<std::string, std::string>> {
+class SupplicantStaIfaceHidlTest : public SupplicantHidlTestBaseV1_4 {
public:
virtual void SetUp() override {
- wifi_v1_0_instance_name_ = std::get<0>(GetParam());
- supplicant_v1_4_instance_name_ = std::get<1>(GetParam());
- isP2pOn_ =
- testing::deviceSupportsFeature("android.hardware.wifi.direct");
-
- stopSupplicant(wifi_v1_0_instance_name_);
- startSupplicantAndWaitForHidlService(wifi_v1_0_instance_name_,
- supplicant_v1_4_instance_name_);
- supplicant_ =
- getSupplicant_1_4(supplicant_v1_4_instance_name_, isP2pOn_);
- EXPECT_TRUE(turnOnExcessiveLogging(supplicant_));
+ SupplicantHidlTestBaseV1_4::SetUp();
sta_iface_ = getSupplicantStaIface_1_4(supplicant_);
ASSERT_NE(sta_iface_.get(), nullptr);
}
- virtual void TearDown() override {
- stopSupplicant(wifi_v1_0_instance_name_);
- }
-
protected:
// ISupplicantStaIface object used for all tests in this fixture.
sp<ISupplicantStaIface> sta_iface_;
- sp<ISupplicant> supplicant_;
- bool isP2pOn_ = false;
- std::string wifi_v1_0_instance_name_;
- std::string supplicant_v1_4_instance_name_;
};
/*