Merge "graphics: remove duplicated types"
diff --git a/audio/2.0/Android.bp b/audio/2.0/Android.bp
index 2ded34b..254c939 100644
--- a/audio/2.0/Android.bp
+++ b/audio/2.0/Android.bp
@@ -86,18 +86,18 @@
generated_headers: ["android.hardware.audio@2.0_genc++_headers"],
export_generated_headers: ["android.hardware.audio@2.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
"android.hardware.audio.common@2.0",
- "android.hardware.audio.effect@2.0",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"android.hardware.audio.common@2.0",
- "android.hardware.audio.effect@2.0",
],
}
diff --git a/audio/2.0/default/Android.mk b/audio/2.0/default/Android.mk
index a5c0383..5108448 100644
--- a/audio/2.0/default/Android.mk
+++ b/audio/2.0/default/Android.mk
@@ -30,7 +30,8 @@
StreamOut.cpp \
LOCAL_SHARED_LIBRARIES := \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libutils \
libhardware \
@@ -55,7 +56,8 @@
service.cpp
LOCAL_SHARED_LIBRARIES := \
- libhidl \
+ libhidlbase \
+ libhidltransport \
liblog \
libhwbinder \
libutils \
diff --git a/audio/common/2.0/Android.bp b/audio/common/2.0/Android.bp
index 89ce3b6..c539c3c 100644
--- a/audio/common/2.0/Android.bp
+++ b/audio/common/2.0/Android.bp
@@ -30,13 +30,15 @@
generated_headers: ["android.hardware.audio.common@2.0_genc++_headers"],
export_generated_headers: ["android.hardware.audio.common@2.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/audio/common/Android.mk b/audio/common/Android.mk
new file mode 100644
index 0000000..f9e3276
--- /dev/null
+++ b/audio/common/Android.mk
@@ -0,0 +1,19 @@
+#
+# Copyright (C) 2016 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.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(call all-subdir-makefiles)
diff --git a/audio/effect/2.0/Android.bp b/audio/effect/2.0/Android.bp
index 78829be..11ea604 100644
--- a/audio/effect/2.0/Android.bp
+++ b/audio/effect/2.0/Android.bp
@@ -142,14 +142,16 @@
generated_headers: ["android.hardware.audio.effect@2.0_genc++_headers"],
export_generated_headers: ["android.hardware.audio.effect@2.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
"android.hardware.audio.common@2.0",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"android.hardware.audio.common@2.0",
diff --git a/audio/effect/2.0/default/Android.mk b/audio/effect/2.0/default/Android.mk
index 50c4bd6..9b99737 100644
--- a/audio/effect/2.0/default/Android.mk
+++ b/audio/effect/2.0/default/Android.mk
@@ -20,7 +20,8 @@
VisualizerEffect.cpp \
LOCAL_SHARED_LIBRARIES := \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libutils \
libeffects \
diff --git a/audio/effect/2.0/vts/functional/Android.bp b/audio/effect/2.0/vts/functional/Android.bp
index fc198e5..b82d44a 100644
--- a/audio/effect/2.0/vts/functional/Android.bp
+++ b/audio/effect/2.0/vts/functional/Android.bp
@@ -22,7 +22,8 @@
"libbase",
"liblog",
"libcutils",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libnativehelper",
"libutils",
diff --git a/benchmarks/msgq/1.0/Android.bp b/benchmarks/msgq/1.0/Android.bp
index a527b32..06ec3da 100644
--- a/benchmarks/msgq/1.0/Android.bp
+++ b/benchmarks/msgq/1.0/Android.bp
@@ -34,13 +34,15 @@
generated_headers: ["android.hardware.benchmarks.msgq@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.benchmarks.msgq@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/biometrics/fingerprint/2.1/Android.bp b/biometrics/fingerprint/2.1/Android.bp
index 9d2af44..cea7200 100644
--- a/biometrics/fingerprint/2.1/Android.bp
+++ b/biometrics/fingerprint/2.1/Android.bp
@@ -46,13 +46,15 @@
generated_headers: ["android.hardware.biometrics.fingerprint@2.1_genc++_headers"],
export_generated_headers: ["android.hardware.biometrics.fingerprint@2.1_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal b/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal
index b7f8d88..3b24a2c 100644
--- a/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal
+++ b/biometrics/fingerprint/2.1/IBiometricsFingerprint.hal
@@ -25,13 +25,12 @@
* This call must block if the HAL state machine is in busy state until HAL
* leaves the busy state.
*
- * @return isOk indicates if the request is accepted.
- * @return debugErrno is a value the framework logs in case isOk == false.
+ * @return debugErrno is a value the framework logs in case it is not 0.
*/
@callflow(next={"setActiveGroup"})
@entry
setNotify(IBiometricsFingerprintClientCallback clientCallback)
- generates (bool isOk, int32_t debugErrno);
+ generates (RequestStatus debugErrno);
/*
* Fingerprint pre-enroll enroll request:
@@ -62,25 +61,23 @@
* @param gid a framework defined fingerprint set (group) id.
* @param timeoutSec a timeout in seconds.
*
- * @return isOk indicates if the request is accepted.
- * @return debugErrno is a value the framework logs in case isOk == false.
+ * @return debugErrno is a value the framework logs in case it is not 0.
*
* A notify() function may be called with a more detailed error structure.
*/
@callflow(next={"cancel", "enroll", "postEnroll", "remove"})
- enroll(HwAuthToken hat, uint32_t gid, uint32_t timeoutSec)
- generates (bool isOk, int32_t debugErrno);
+ enroll(uint8_t[69] hat, uint32_t gid, uint32_t timeoutSec)
+ generates (RequestStatus debugErrno);
/*
* Finishes the enroll operation and invalidates the preEnroll() generated
* challenge. This must be called at the end of a multi-finger enrollment
* session to indicate that no more fingers may be added.
*
- * @return isOk indicates if the request is accepted.
- * @return debugErrno is a value the framework logs in case isOk == false.
+ * @return debugErrno is a value the framework logs in case it is not 0.
*/
@callflow(next={"authenticate", "setActiveGroup", "enumerate", "remove"})
- postEnroll() generates (bool isOk, int32_t debugErrno);
+ postEnroll() generates (RequestStatus debugErrno);
/*
* getAuthenticatorId:
@@ -99,12 +96,11 @@
* to all running clients. Switches the HAL state machine back to the idle
* state. Unlike enrollDone() doesn't invalidate the preEnroll() challenge.
*
- * @return isOk indicates if the request is accepted.
- * @return debugErrno is a value the framework logs in case isOk == false.
+ * @return debugErrno is a value the framework logs in case it is not 0.
*/
@callflow(next={"authenticate", "enroll", "enumerate", "remove",
"setActiveGroup"})
- cancel() generates (bool isOk, int32_t debugErrno);
+ cancel() generates (RequestStatus debugErrno);
/*
* Enumerate all the fingerprint templates found in the directory set by
@@ -115,11 +111,10 @@
* fingerprintMsg.data.enumerated.remainingTemplates indicating how many more
* enumeration messages to expect.
*
- * @return isOk indicates if the request is accepted.
- * @return debugErrno is a value the framework logs in case isOk == false.
+ * @return debugErrno is a value the framework logs in case it is not 0.
*/
@callflow(next={"remove", "enroll", "authenticate", "setActiveGroup"})
- enumerate() generates (bool isOk, int32_t debugErrno);
+ enumerate() generates (RequestStatus debugErrno);
/*
* Fingerprint remove request:
@@ -135,12 +130,11 @@
* @param fid template id to delete or 0 to delete all templates within the
* current group.
*
- * @return isOk indicates if the request is accepted.
- * @return debugErrno is a value the framework logs in case isOk == false.
+ * @return debugErrno is a value the framework logs in case it is not 0.
*/
@callflow(next={"enumerate", "authenticate", "cancel", "getAuthenticatorId",
"setActiveGroup"})
- remove(uint32_t gid, uint32_t fid) generates (bool isOk, int32_t debugErrno);
+ remove(uint32_t gid, uint32_t fid) generates (RequestStatus debugErrno);
/*
* Restricts the HAL operation to a set of fingerprints belonging to a group
@@ -150,12 +144,11 @@
* @param gid the fingerprint group (set) id.
* @param storePath filesystem path to the template storage directory.
*
- * @return isOk indicates if the request is accepted.
- * @return debugErrno is a value the framework logs in case isOk == false.
+ * @return debugErrno is a value the framework logs in case it is not 0.
*/
@callflow(next={"authenticate", "preEnroll", "enumerate", "remove"})
setActiveGroup(uint32_t gid, string storePath)
- generates (bool isOk, int32_t debugErrno);
+ generates (RequestStatus debugErrno);
/*
* Authenticates an operation identified by operationId
@@ -163,10 +156,9 @@
* @param operationId operation id.
* @param gid fingerprint group id.
*
- * @return isOk indicates if the request is accepted.
- * @return debugErrno is a value the framework logs in case isOk == false.
+ * @return debugErrno is a value the framework logs in case it is not 0.
*/
@callflow(next={"cancel", "preEnroll", "remove"})
authenticate(uint64_t operationId, uint32_t gid)
- generates (bool isOk, int32_t debugErrno);
+ generates (RequestStatus debugErrno);
};
diff --git a/biometrics/fingerprint/2.1/default/Android.mk b/biometrics/fingerprint/2.1/default/Android.mk
index be8bae6..c487c7a 100644
--- a/biometrics/fingerprint/2.1/default/Android.mk
+++ b/biometrics/fingerprint/2.1/default/Android.mk
@@ -8,7 +8,8 @@
LOCAL_SHARED_LIBRARIES := \
liblog \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhardware \
libhwbinder \
libutils \
diff --git a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
index 3ee7836..1316686 100644
--- a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
+++ b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.cpp
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
+#define LOG_TAG "android.hardware.biometrics.fingerprint@2.1-impl"
#include <hardware/hardware.h>
#include <hardware/fingerprint.h>
@@ -25,6 +26,9 @@
namespace V2_1 {
namespace implementation {
+using RequestStatus =
+ android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
+
sp<IBiometricsFingerprintClientCallback>
BiometricsFingerprint::mClientCallback = nullptr;
@@ -46,78 +50,81 @@
mDevice = NULL;
}
-Return<void> BiometricsFingerprint::setNotify(
- const sp<IBiometricsFingerprintClientCallback>& clientCallback,
- setNotify_cb cb) {
+Return<RequestStatus> BiometricsFingerprint::ErrorFilter(int32_t error) {
+ switch(error) {
+ case 0: return RequestStatus::SYS_OK;
+ case -2: return RequestStatus::SYS_ENOENT;
+ case -4: return RequestStatus::SYS_EINTR;
+ case -5: return RequestStatus::SYS_EIO;
+ case -11: return RequestStatus::SYS_EAGAIN;
+ case -12: return RequestStatus::SYS_ENOMEM;
+ case -13: return RequestStatus::SYS_EACCES;
+ case -14: return RequestStatus::SYS_EFAULT;
+ case -16: return RequestStatus::SYS_EBUSY;
+ case -22: return RequestStatus::SYS_EINVAL;
+ case -28: return RequestStatus::SYS_ENOSPC;
+ case -110: return RequestStatus::SYS_ETIMEDOUT;
+ default:
+ ALOGE("An unknown error returned from fingerprint vendor library");
+ return RequestStatus::SYS_UNKNOWN;
+ }
+}
+
+Return<RequestStatus> BiometricsFingerprint::setNotify(
+ const sp<IBiometricsFingerprintClientCallback>& clientCallback) {
mClientCallback = clientCallback;
- int32_t debugErrno = mDevice->set_notify(mDevice, notify);
- cb(debugErrno == 0, debugErrno);
- return Void();
+ return RequestStatus::SYS_OK;
}
Return<uint64_t> BiometricsFingerprint::preEnroll() {
return mDevice->pre_enroll(mDevice);
}
-Return<void> BiometricsFingerprint::enroll(const HwAuthToken& hat, uint32_t gid,
- uint32_t timeoutSec, enroll_cb cb) {
+Return<RequestStatus> BiometricsFingerprint::enroll(const hidl_array<uint8_t, 69>& hat,
+ uint32_t gid, uint32_t timeoutSec) {
const hw_auth_token_t* authToken =
- reinterpret_cast<const hw_auth_token_t*>(&hat);
- int32_t debugErrno = mDevice->enroll(mDevice, authToken, gid, timeoutSec);
- cb(debugErrno == 0, debugErrno);
- return Void();
+ reinterpret_cast<const hw_auth_token_t*>(hat.data());
+ return ErrorFilter(mDevice->enroll(mDevice, authToken, gid, timeoutSec));
}
-Return<void> BiometricsFingerprint::postEnroll(postEnroll_cb cb) {
- int32_t debugErrno = mDevice->post_enroll(mDevice);
- cb(debugErrno == 0, debugErrno);
- return Void();
+Return<RequestStatus> BiometricsFingerprint::postEnroll() {
+ return ErrorFilter(mDevice->post_enroll(mDevice));
}
Return<uint64_t> BiometricsFingerprint::getAuthenticatorId() {
return mDevice->get_authenticator_id(mDevice);
}
-Return<void> BiometricsFingerprint::cancel(cancel_cb cb) {
- int32_t debugErrno = mDevice->cancel(mDevice);
- cb(debugErrno == 0, debugErrno);
- return Void();
+Return<RequestStatus> BiometricsFingerprint::cancel() {
+ return ErrorFilter(mDevice->cancel(mDevice));
}
-Return<void> BiometricsFingerprint::enumerate(enumerate_cb cb) {
- int32_t debugErrno = mDevice->enumerate(mDevice);
- cb(debugErrno == 0, debugErrno);
- return Void();
+Return<RequestStatus> BiometricsFingerprint::enumerate() {
+ return ErrorFilter(mDevice->enumerate(mDevice));
}
-Return<void> BiometricsFingerprint::remove(uint32_t gid, uint32_t fid,
- remove_cb cb) {
- int32_t debugErrno = mDevice->remove(mDevice, gid, fid);
- cb(debugErrno == 0, debugErrno);
- return Void();
+Return<RequestStatus> BiometricsFingerprint::remove(uint32_t gid, uint32_t fid) {
+ return ErrorFilter(mDevice->remove(mDevice, gid, fid));
}
-Return<void> BiometricsFingerprint::setActiveGroup(uint32_t gid,
- const hidl_string& storePath, setActiveGroup_cb cb) {
+Return<RequestStatus> BiometricsFingerprint::setActiveGroup(uint32_t gid,
+ const hidl_string& storePath) {
if (storePath.size() >= PATH_MAX || storePath.size() <= 0) {
ALOGE("Bad path length: %zd", storePath.size());
}
- int32_t debugErrno = mDevice->set_active_group(mDevice, gid,
- storePath.c_str());
- cb(debugErrno == 0, debugErrno);
- return Void();
+ return ErrorFilter(mDevice->set_active_group(mDevice, gid,
+ storePath.c_str()));
}
-Return<void> BiometricsFingerprint::authenticate(uint64_t operationId,
- uint32_t gid, authenticate_cb cb) {
- int32_t debugErrno = mDevice->authenticate(mDevice, operationId, gid);
- cb(debugErrno == 0, debugErrno);
- return Void();
+Return<RequestStatus> BiometricsFingerprint::authenticate(uint64_t operationId,
+ uint32_t gid) {
+ return ErrorFilter(mDevice->authenticate(mDevice, operationId, gid));
}
IBiometricsFingerprint* HIDL_FETCH_IBiometricsFingerprint(const char*) {
int err;
const hw_module_t *hw_mdl = NULL;
+ ALOGE("Opening fingerprint hal library...");
if (0 != (err = hw_get_module(FINGERPRINT_HARDWARE_MODULE_ID, &hw_mdl))) {
ALOGE("Can't open fingerprint HW Module, error: %d", err);
return nullptr;
@@ -141,8 +148,16 @@
return nullptr;
}
- return new BiometricsFingerprint(
- reinterpret_cast<fingerprint_device_t*>(device));
+ fingerprint_device_t* fp_device =
+ reinterpret_cast<fingerprint_device_t*>(device);
+
+ if (0 != (err =
+ fp_device->set_notify(fp_device, BiometricsFingerprint::notify))) {
+ ALOGE("Can't register fingerprint module callback, error: %d", err);
+ return nullptr;
+ }
+
+ return new BiometricsFingerprint(fp_device);
}
} // namespace implementation
diff --git a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
index 4fdc328..de8727b 100644
--- a/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
+++ b/biometrics/fingerprint/2.1/default/BiometricsFingerprint.h
@@ -14,14 +14,14 @@
* limitations under the License.
*/
-#ifndef HIDL_GENERATED_android_hardware_biometrics_fingerprint_V2_1_BiometricsFingerprint_H_
-#define HIDL_GENERATED_android_hardware_biometrics_fingerprint_V2_1_BiometricsFingerprint_H_
+#ifndef ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
+#define ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
#include <utils/Log.h>
+#include <hidl/MQDescriptor.h>
#include <android/hardware/biometrics/fingerprint/2.1/IBiometricsFingerprint.h>
#include <hidl/Status.h>
-#include <hidl/MQDescriptor.h>
namespace android {
namespace hardware {
namespace biometrics {
@@ -29,9 +29,9 @@
namespace V2_1 {
namespace implementation {
-using ::android::hardware::biometrics::fingerprint::V2_1::HwAuthToken;
using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint;
using ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprintClientCallback;
+using ::android::hardware::biometrics::fingerprint::V2_1::RequestStatus;
using ::android::hardware::Return;
using ::android::hardware::Void;
using ::android::hardware::hidl_vec;
@@ -43,16 +43,16 @@
BiometricsFingerprint(fingerprint_device_t *device);
~BiometricsFingerprint();
// Methods from ::android::hardware::biometrics::fingerprint::V2_1::IBiometricsFingerprint follow.
- Return<void> setNotify(const sp<IBiometricsFingerprintClientCallback>& clientCallback, setNotify_cb _hidl_cb) override;
- Return<uint64_t> preEnroll() override;
- Return<void> enroll(const HwAuthToken& hat, uint32_t gid, uint32_t timeoutSec, enroll_cb _hidl_cb) override;
- Return<void> postEnroll(postEnroll_cb _hidl_cb) override;
- Return<uint64_t> getAuthenticatorId() override;
- Return<void> cancel(cancel_cb _hidl_cb) override;
- Return<void> enumerate(enumerate_cb _hidl_cb) override;
- Return<void> remove(uint32_t gid, uint32_t fid, remove_cb _hidl_cb) override;
- Return<void> setActiveGroup(uint32_t gid, const hidl_string& storePath, setActiveGroup_cb _hidl_cb) override;
- Return<void> authenticate(uint64_t operationId, uint32_t gid, authenticate_cb _hidl_cb) override;
+ Return<RequestStatus> setNotify(const sp<IBiometricsFingerprintClientCallback>& clientCallback) override;
+ Return<uint64_t> preEnroll() override;
+ Return<RequestStatus> enroll(const hidl_array<uint8_t, 69>& hat, uint32_t gid, uint32_t timeoutSec) override;
+ Return<RequestStatus> postEnroll() override;
+ Return<uint64_t> getAuthenticatorId() override;
+ Return<RequestStatus> cancel() override;
+ Return<RequestStatus> enumerate() override;
+ Return<RequestStatus> remove(uint32_t gid, uint32_t fid) override;
+ Return<RequestStatus> setActiveGroup(uint32_t gid, const hidl_string& storePath) override;
+ Return<RequestStatus> authenticate(uint64_t operationId, uint32_t gid) override;
static void notify(const fingerprint_msg_t *notify_msg) {
if (mClientCallback == nullptr) {
ALOGE("Receiving callbacks before the client callback is registered.");
@@ -63,6 +63,7 @@
mClientCallback->notify(msg);
}
private:
+ Return<RequestStatus> ErrorFilter(int32_t error);
static sp<IBiometricsFingerprintClientCallback> mClientCallback;
fingerprint_device_t *mDevice;
};
@@ -76,4 +77,4 @@
} // namespace hardware
} // namespace android
-#endif // HIDL_GENERATED_android_hardware_biometrics_fingerprint_V2_1_BiometricsFingerprint_H_
+#endif // ANDROID_HARDWARE_BIOMETRICS_FINGERPRINT_V2_1_BIOMETRICSFINGERPRINT_H
diff --git a/biometrics/fingerprint/2.1/types.hal b/biometrics/fingerprint/2.1/types.hal
index cf68c04..201ec7c 100644
--- a/biometrics/fingerprint/2.1/types.hal
+++ b/biometrics/fingerprint/2.1/types.hal
@@ -17,6 +17,27 @@
package android.hardware.biometrics.fingerprint@2.1;
/*
+ * Request status indicates whether the request is accepted by the vendor
+ * implementation or not. These values are taken from the errno set,
+ * except for the SYS_UNKNOWN
+ */
+enum RequestStatus : int32_t {
+ SYS_UNKNOWN = 1,
+ SYS_OK = 0,
+ SYS_ENOENT = -2,
+ SYS_EINTR = -4,
+ SYS_EIO = -5,
+ SYS_EAGAIN = -11,
+ SYS_ENOMEM = -12,
+ SYS_EACCES = -13,
+ SYS_EFAULT = -14,
+ SYS_EBUSY = -16,
+ SYS_EINVAL = -22,
+ SYS_ENOSPC = -28,
+ SYS_ETIMEDOUT = -110,
+};
+
+/*
* Fingerprint errors are meant to tell the framework to terminate the current
* operation and ask for the user to correct the situation. These will almost
* always result in messaging and user interaction to correct the problem.
@@ -66,25 +87,6 @@
ACQUIRED_VENDOR_BASE = 1000,
};
-/* TODO import from keymaster HIDL when available */
-enum HwAuthenticatorType : uint32_t {
- HW_AUTH_NONE = 0,
- HW_AUTH_PASSWORD = 1,
- HW_AUTH_FINGERPRINT = 2,
- HW_AUTH_ANY = 0xffffffff,
-};
-
-/* TODO import from keymaster HIDL when available */
-struct HwAuthToken {
- uint8_t version;
- uint64_t challenge;
- uint64_t userId;
- uint64_t authenticatorId;
- uint32_t authenticatorType;
- uint64_t timestamp;
- uint8_t[32] hmac;
-};
-
struct FingerprintFingerId {
/* Group ID */
uint32_t gid;
@@ -121,7 +123,7 @@
/* Matched template ID */
FingerprintFingerId finger;
/* Authentication result from the keymaster */
- HwAuthToken hat;
+ uint8_t[69] hat;
};
/* Run time type identification for the notify() call payload. */
@@ -137,12 +139,12 @@
struct FingerprintMsg {
/* Selects the payload below */
FingerprintMsgType type;
- union data {
+ union Data {
FingerprintError error;
FingerprintEnroll enroll;
FingerprintEnumerated enumerated;
FingerprintRemoved removed;
FingerprintAcquired acquired;
FingerprintAuthenticated authenticated;
- };
+ } data;
};
diff --git a/bluetooth/1.0/Android.bp b/bluetooth/1.0/Android.bp
index d8f3ca5..67417fb 100644
--- a/bluetooth/1.0/Android.bp
+++ b/bluetooth/1.0/Android.bp
@@ -46,13 +46,15 @@
generated_headers: ["android.hardware.bluetooth@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.bluetooth@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/boot/1.0/Android.bp b/boot/1.0/Android.bp
index cad7497..835d358 100644
--- a/boot/1.0/Android.bp
+++ b/boot/1.0/Android.bp
@@ -38,13 +38,15 @@
generated_headers: ["android.hardware.boot@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.boot@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/boot/1.0/default/Android.mk b/boot/1.0/default/Android.mk
index 50fd1e4..be67779 100644
--- a/boot/1.0/default/Android.mk
+++ b/boot/1.0/default/Android.mk
@@ -8,7 +8,8 @@
LOCAL_SHARED_LIBRARIES := \
liblog \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libhardware \
libutils \
@@ -27,7 +28,8 @@
liblog \
libhwbinder \
libhardware \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libutils \
android.hardware.boot@1.0 \
diff --git a/boot/1.0/vts/Android.mk b/boot/1.0/vts/Android.mk
index 16b92c1..8a56b27 100644
--- a/boot/1.0/vts/Android.mk
+++ b/boot/1.0/vts/Android.mk
@@ -25,18 +25,14 @@
BootControl.vts \
types.vts \
-LOCAL_C_INCLUDES := \
- android.hardware.boot@1.0\
- system/core/base/include \
- system/core/include \
-
LOCAL_SHARED_LIBRARIES += \
android.hardware.boot@1.0 \
libbase \
libutils \
libcutils \
liblog \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libprotobuf-cpp-full \
libvts_common \
@@ -44,10 +40,6 @@
libvts_measurement \
libvts_multidevice_proto \
-LOCAL_CFLAGS += -DENABLE_TREBLE
-
-LOCAL_STATIC_LIBRARIES := \
-
LOCAL_PROTOC_OPTIMIZE_TYPE := full
LOCAL_MULTILIB := both
@@ -73,7 +65,8 @@
libbase \
libcutils \
liblog \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libprotobuf-cpp-full \
libvts_common \
diff --git a/broadcastradio/1.0/Android.bp b/broadcastradio/1.0/Android.bp
index c337e08..a876ac2 100644
--- a/broadcastradio/1.0/Android.bp
+++ b/broadcastradio/1.0/Android.bp
@@ -62,13 +62,15 @@
generated_headers: ["android.hardware.broadcastradio@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.broadcastradio@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/contexthub/1.0/Android.bp b/contexthub/1.0/Android.bp
index 23c44de..f13ef5b 100644
--- a/contexthub/1.0/Android.bp
+++ b/contexthub/1.0/Android.bp
@@ -46,13 +46,15 @@
generated_headers: ["android.hardware.contexthub@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.contexthub@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/example/extension/light/2.0/Android.bp b/example/extension/light/2.0/Android.bp
index 2a4eddf..ae93a6b 100644
--- a/example/extension/light/2.0/Android.bp
+++ b/example/extension/light/2.0/Android.bp
@@ -38,14 +38,16 @@
generated_headers: ["android.hardware.example.extension.light@2.0_genc++_headers"],
export_generated_headers: ["android.hardware.example.extension.light@2.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
"android.hardware.light@2.0",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"android.hardware.light@2.0",
diff --git a/example/extension/light/2.0/default/Android.mk b/example/extension/light/2.0/default/Android.mk
index fa68787..55c21b9 100644
--- a/example/extension/light/2.0/default/Android.mk
+++ b/example/extension/light/2.0/default/Android.mk
@@ -8,7 +8,8 @@
Light.cpp \
LOCAL_SHARED_LIBRARIES := \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libutils \
android.hardware.light@2.0 \
diff --git a/gnss/1.0/Android.bp b/gnss/1.0/Android.bp
index 1f538ca..f33f1c6 100644
--- a/gnss/1.0/Android.bp
+++ b/gnss/1.0/Android.bp
@@ -166,13 +166,15 @@
generated_headers: ["android.hardware.gnss@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.gnss@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/graphics/allocator/2.0/Android.bp b/graphics/allocator/2.0/Android.bp
index cb37aa2..d6e88a3 100644
--- a/graphics/allocator/2.0/Android.bp
+++ b/graphics/allocator/2.0/Android.bp
@@ -38,14 +38,16 @@
generated_headers: ["android.hardware.graphics.allocator@2.0_genc++_headers"],
export_generated_headers: ["android.hardware.graphics.allocator@2.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
"android.hardware.graphics.common@1.0",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"android.hardware.graphics.common@1.0",
diff --git a/graphics/allocator/2.0/default/Android.bp b/graphics/allocator/2.0/default/Android.bp
index 8eac8f5..994feb3 100644
--- a/graphics/allocator/2.0/default/Android.bp
+++ b/graphics/allocator/2.0/default/Android.bp
@@ -8,7 +8,8 @@
"libbase",
"libcutils",
"libhardware",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"liblog",
"libutils",
@@ -23,7 +24,8 @@
shared_libs: [
"android.hardware.graphics.allocator@2.0",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"liblog",
"libutils",
diff --git a/graphics/common/1.0/Android.bp b/graphics/common/1.0/Android.bp
index fa95ca0..6c6ebbe 100644
--- a/graphics/common/1.0/Android.bp
+++ b/graphics/common/1.0/Android.bp
@@ -30,13 +30,15 @@
generated_headers: ["android.hardware.graphics.common@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.graphics.common@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/graphics/common/1.0/types.hal b/graphics/common/1.0/types.hal
index 395af49..9726c3a 100644
--- a/graphics/common/1.0/types.hal
+++ b/graphics/common/1.0/types.hal
@@ -38,6 +38,12 @@
BGRA_8888 = 5,
/*
+ * The following formats use a 16bit float per color component.
+ */
+ RGBA_FP16 = 0x10,
+ RGBX_FP16 = 0x11,
+
+ /*
* 0x100 - 0x1FF
*
* This range is reserved for pixel formats that are specific to the HAL
@@ -658,6 +664,28 @@
*/
STANDARD_FILM = 9 << STANDARD_SHIFT,
+ /*
+ * SMPTE EG 432-1 and SMPTE RP 431-2. (DCI-P3)
+ * Primaries: x y
+ * green 0.265 0.690
+ * blue 0.150 0.060
+ * red 0.680 0.320
+ * white (D65) 0.3127 0.3290
+ */
+ STANDARD_DCI_P3 = 10 << STANDARD_SHIFT,
+
+ /*
+ * Adobe RGB
+ * Primaries: x y
+ * green 0.210 0.710
+ * blue 0.150 0.060
+ * red 0.640 0.330
+ * white (D65) 0.3127 0.3290
+ */
+ STANDARD_ADOBE_RGB = 11 << STANDARD_SHIFT,
+
+
+
TRANSFER_SHIFT = 22,
/*
@@ -730,6 +758,16 @@
TRANSFER_GAMMA2_2 = 4 << TRANSFER_SHIFT,
/*
+ * display gamma 2.6.
+ *
+ * Transfer characteristic curve:
+ * E = L ^ (1/2.6)
+ * L - luminance of image 0 <= L <= 1 for conventional colorimetry
+ * E - corresponding electrical signal
+ */
+ TRANSFER_GAMMA2_6 = 5 << TRANSFER_SHIFT,
+
+ /*
* display gamma 2.8.
*
* Transfer characteristic curve:
@@ -737,7 +775,7 @@
* L - luminance of image 0 <= L <= 1 for conventional colorimetry
* E - corresponding electrical signal
*/
- TRANSFER_GAMMA2_8 = 5 << TRANSFER_SHIFT,
+ TRANSFER_GAMMA2_8 = 6 << TRANSFER_SHIFT,
/*
* SMPTE ST 2084
@@ -753,7 +791,7 @@
* L = 1 corresponds to 10000 cd/m2
* E - corresponding electrical signal
*/
- TRANSFER_ST2084 = 6 << TRANSFER_SHIFT,
+ TRANSFER_ST2084 = 7 << TRANSFER_SHIFT,
/*
* ARIB STD-B67 Hybrid Log Gamma
@@ -769,7 +807,7 @@
* to reference white level of 100 cd/m2
* E - corresponding electrical signal
*/
- TRANSFER_HLG = 7 << TRANSFER_SHIFT,
+ TRANSFER_HLG = 8 << TRANSFER_SHIFT,
RANGE_SHIFT = 27,
@@ -816,6 +854,15 @@
RANGE_LIMITED = 2 << RANGE_SHIFT,
/*
+ * Extended range is used for scRGB. Intended for use with
+ * floating point pixel formats. [0.0 - 1.0] is the standard
+ * sRGB space. Values outside the range 0.0 - 1.0 can encode
+ * color outside the sRGB gamut.
+ * Used to blend / merge multiple dataspaces on a single display.
+ */
+ RANGE_EXTENDED = 3 << RANGE_SHIFT,
+
+ /*
* Legacy dataspaces
*/
@@ -835,6 +882,21 @@
/*
+ * scRGB linear encoding:
+ *
+ * The red, green, and blue components are stored in extended sRGB space,
+ * but are linear, not gamma-encoded.
+ * The RGB primaries and the white point are the same as BT.709.
+ *
+ * The values are floating point.
+ * A pixel value of 1.0, 1.0, 1.0 corresponds to sRGB white (D65) at 80 nits.
+ * Values beyond the range [0.0 - 1.0] would correspond to other colors
+ * spaces and/or HDR content.
+ */
+ V0_SCRGB_LINEAR = STANDARD_BT709 | TRANSFER_LINEAR | RANGE_EXTENDED,
+
+
+ /*
* sRGB gamma encoding:
*
* The red, green and blue components are stored in sRGB space, and
@@ -853,6 +915,24 @@
/*
+ * scRGB:
+ *
+ * The red, green, and blue components are stored in extended sRGB space,
+ * but are linear, not gamma-encoded.
+ * The RGB primaries and the white point are the same as BT.709.
+ *
+ * The values are floating point.
+ * A pixel value of 1.0, 1.0, 1.0 corresponds to sRGB white (D65) at 80 nits.
+ * Values beyond the range [0.0 - 1.0] would correspond to other colors
+ * spaces and/or HDR content.
+ *
+ * TODO (courtneygo): Will we actually use this? We intend to use FP16
+ * storage for data using scRGB so we can do all work in linear space
+ * and don't have to worry as much about limited precision.
+ */
+ V0_SCRGB = STANDARD_BT709 | TRANSFER_SRGB | RANGE_EXTENDED,
+
+ /*
* YCbCr Colorspaces
* -----------------
*
@@ -908,6 +988,59 @@
V0_BT709 = STANDARD_BT709 | TRANSFER_SMPTE_170M | RANGE_LIMITED,
+
+ /*
+ * SMPTE EG 432-1 and SMPTE RP 431-2.
+ *
+ * Digital Cinema DCI-P3
+ *
+ * Use full range, linear transfer and D65 DCI-P3 standard
+ */
+ DCI_P3_LINEAR = STANDARD_DCI_P3 | TRANSFER_LINEAR | RANGE_FULL,
+
+
+ /*
+ * SMPTE EG 432-1 and SMPTE RP 431-2.
+ *
+ * Digital Cinema DCI-P3
+ *
+ * Use full range, gamma 2.6 transfer and D65 DCI-P3 standard
+ * Note: Application is responsible for gamma encoding the data as
+ * a 2.6 gamma encoding is not supported in HW.
+ */
+ DCI_P3 = STANDARD_DCI_P3 | TRANSFER_GAMMA2_6 | RANGE_FULL,
+
+
+ /*
+ * Adobe RGB
+ *
+ * Use full range, gamma 2.2 transfer and Adobe RGB primaries
+ * Note: Application is responsible for gamma encoding the data as
+ * a 2.2 gamma encoding is not supported in HW.
+ */
+ ADOBE_RGB = STANDARD_ADOBE_RGB | TRANSFER_GAMMA2_2 | RANGE_FULL,
+
+
+ /*
+ * ITU-R Recommendation 2020 (BT.2020)
+ *
+ * Ultra High-definition television
+ *
+ * Use full range, linear transfer and BT2020 standard
+ */
+ BT2020_LINEAR = STANDARD_BT2020 | TRANSFER_LINEAR | RANGE_FULL,
+
+
+ /*
+ * ITU-R Recommendation 2020 (BT.2020)
+ *
+ * Ultra High-definition television
+ *
+ * Use full range, BT.709 transfer and BT2020 standard
+ */
+ BT2020 = STANDARD_BT2020 | TRANSFER_SMPTE_170M | RANGE_FULL,
+
+
/*
* Data spaces for non-color formats
*/
diff --git a/graphics/composer/2.1/Android.bp b/graphics/composer/2.1/Android.bp
index cf416c7..106a821 100644
--- a/graphics/composer/2.1/Android.bp
+++ b/graphics/composer/2.1/Android.bp
@@ -46,14 +46,16 @@
generated_headers: ["android.hardware.graphics.composer@2.1_genc++_headers"],
export_generated_headers: ["android.hardware.graphics.composer@2.1_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
"android.hardware.graphics.common@1.0",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"android.hardware.graphics.common@1.0",
diff --git a/graphics/composer/2.1/default/Android.bp b/graphics/composer/2.1/default/Android.bp
index 6936347..22f4906 100644
--- a/graphics/composer/2.1/default/Android.bp
+++ b/graphics/composer/2.1/default/Android.bp
@@ -8,7 +8,8 @@
"libbase",
"libcutils",
"libhardware",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"liblog",
"libutils",
@@ -29,7 +30,8 @@
"libbinder",
"libcutils",
"libhardware",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"liblog",
"libutils",
diff --git a/graphics/mapper/2.0/default/Android.bp b/graphics/mapper/2.0/default/Android.bp
index b738ae8..7da6eb1 100644
--- a/graphics/mapper/2.0/default/Android.bp
+++ b/graphics/mapper/2.0/default/Android.bp
@@ -21,7 +21,8 @@
shared_libs: [
"android.hardware.graphics.allocator@2.0",
"libhardware",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"liblog",
],
diff --git a/health/1.0/Android.bp b/health/1.0/Android.bp
index fb3d8c0..81793d5 100644
--- a/health/1.0/Android.bp
+++ b/health/1.0/Android.bp
@@ -38,13 +38,15 @@
generated_headers: ["android.hardware.health@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.health@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/health/1.0/default/Android.mk b/health/1.0/default/Android.mk
index 3d9d58a..89d28cb 100644
--- a/health/1.0/default/Android.mk
+++ b/health/1.0/default/Android.mk
@@ -9,7 +9,8 @@
LOCAL_SHARED_LIBRARIES := \
libcutils \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
liblog \
libutils \
@@ -28,7 +29,8 @@
LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)/include
LOCAL_SHARED_LIBRARIES := \
libcutils \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libutils \
android.hardware.health@1.0 \
@@ -48,7 +50,8 @@
libbase \
libutils \
libhwbinder \
- libhidl \
+ libhidlbase \
+ libhidltransport \
android.hardware.health@1.0 \
include $(BUILD_EXECUTABLE)
diff --git a/light/2.0/Android.bp b/light/2.0/Android.bp
index b762cc1..23c7c9c 100644
--- a/light/2.0/Android.bp
+++ b/light/2.0/Android.bp
@@ -38,13 +38,15 @@
generated_headers: ["android.hardware.light@2.0_genc++_headers"],
export_generated_headers: ["android.hardware.light@2.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/light/2.0/default/Android.mk b/light/2.0/default/Android.mk
index 61f4cc9..d14d7c0 100644
--- a/light/2.0/default/Android.mk
+++ b/light/2.0/default/Android.mk
@@ -7,7 +7,8 @@
Light.cpp \
LOCAL_SHARED_LIBRARIES := \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libutils \
liblog \
@@ -37,7 +38,8 @@
LOCAL_SHARED_LIBRARIES += \
libhwbinder \
- libhidl \
+ libhidlbase \
+ libhidltransport \
android.hardware.light@2.0 \
include $(BUILD_EXECUTABLE)
diff --git a/light/2.0/vts/Android.mk b/light/2.0/vts/Android.mk
index a8c8c20..59e8f35 100644
--- a/light/2.0/vts/Android.mk
+++ b/light/2.0/vts/Android.mk
@@ -31,7 +31,8 @@
libutils \
libcutils \
liblog \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libprotobuf-cpp-full \
libvts_common \
@@ -39,8 +40,6 @@
libvts_measurement \
libvts_multidevice_proto
-LOCAL_CFLAGS += -DENABLE_TREBLE
-
LOCAL_PROTOC_OPTIMIZE_TYPE := full
LOCAL_MULTILIB := both
diff --git a/media/1.0/Android.bp b/media/1.0/Android.bp
new file mode 100644
index 0000000..5a63cac
--- /dev/null
+++ b/media/1.0/Android.bp
@@ -0,0 +1,47 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+genrule {
+ name: "android.hardware.media@1.0_genc++",
+ tools: ["hidl-gen"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces android.hardware.media@1.0",
+ srcs: [
+ "types.hal",
+ ],
+ out: [
+ "android/hardware/media/1.0/types.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.media@1.0_genc++_headers",
+ tools: ["hidl-gen"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces android.hardware.media@1.0",
+ srcs: [
+ "types.hal",
+ ],
+ out: [
+ "android/hardware/media/1.0/types.h",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.media@1.0",
+ generated_sources: ["android.hardware.media@1.0_genc++"],
+ generated_headers: ["android.hardware.media@1.0_genc++_headers"],
+ export_generated_headers: ["android.hardware.media@1.0_genc++_headers"],
+ shared_libs: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libutils",
+ "libcutils",
+ "android.hardware.graphics.common@1.0",
+ ],
+ export_shared_lib_headers: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libutils",
+ "android.hardware.graphics.common@1.0",
+ ],
+}
diff --git a/media/1.0/types.hal b/media/1.0/types.hal
new file mode 100644
index 0000000..25931f8
--- /dev/null
+++ b/media/1.0/types.hal
@@ -0,0 +1,77 @@
+/*
+ * Copyright (C) 2016 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.media@1.0;
+
+import android.hardware.graphics.common@1.0::PixelFormat;
+
+/**
+ * Aliases
+ */
+typedef handle FileDescriptor; // This must have no more than one fd.
+typedef FileDescriptor Fence;
+typedef int32_t Status; // TODO: convert to an enum
+typedef vec<uint8_t> Bytes;
+
+/**
+ * Ref: frameworks/native/include/ui/GraphicBuffer.h
+ * Ref: system/core/include/system/window.h
+ */
+
+/**
+ * This struct contains attributes for a gralloc buffer that can be put into a
+ * union.
+ */
+struct GraphicBufferAttributes {
+ uint32_t width;
+ uint32_t height;
+ uint32_t stride;
+ PixelFormat format;
+ uint32_t usage; // TODO: convert to an enum
+ uint32_t generationNumber;
+};
+
+/**
+ * A GraphicBuffer is simply GraphicBufferAttributes plus a native handle.
+ */
+struct GraphicBuffer {
+ handle nativeHandle;
+ GraphicBufferAttributes attr;
+};
+
+/**
+ * Ref: frameworks/native/include/binder/IMemory.h
+ * Ref: frameworks/native/libs/binder/IMemory.cpp
+ */
+
+/**
+ * This struct contains attributes for a shared memory buffer that can be put
+ * into a union.
+ */
+struct SharedMemoryAttributes {
+ uint32_t size;
+ uint32_t flags; // TODO: convert to an enum
+ uint32_t offset;
+};
+
+/**
+ * A SharedMemory is simply SharedMemoryAttributes plus a native handle.
+ */
+struct SharedMemory {
+ handle nativeHandle;
+ SharedMemoryAttributes attr;
+};
+
diff --git a/media/Android.bp b/media/Android.bp
new file mode 100644
index 0000000..f2abc67
--- /dev/null
+++ b/media/Android.bp
@@ -0,0 +1,5 @@
+// This is an autogenerated file, do not edit.
+subdirs = [
+ "1.0",
+ "omx/1.0",
+]
diff --git a/media/omx/1.0/Android.bp b/media/omx/1.0/Android.bp
new file mode 100644
index 0000000..b8afb98
--- /dev/null
+++ b/media/omx/1.0/Android.bp
@@ -0,0 +1,89 @@
+// This file is autogenerated by hidl-gen. Do not edit manually.
+
+genrule {
+ name: "android.hardware.media.omx@1.0_genc++",
+ tools: ["hidl-gen"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces android.hardware.media.omx@1.0",
+ srcs: [
+ "types.hal",
+ "IGraphicBufferSource.hal",
+ "IOmx.hal",
+ "IOmxBufferSource.hal",
+ "IOmxNode.hal",
+ "IOmxObserver.hal",
+ ],
+ out: [
+ "android/hardware/media/omx/1.0/types.cpp",
+ "android/hardware/media/omx/1.0/GraphicBufferSourceAll.cpp",
+ "android/hardware/media/omx/1.0/OmxAll.cpp",
+ "android/hardware/media/omx/1.0/OmxBufferSourceAll.cpp",
+ "android/hardware/media/omx/1.0/OmxNodeAll.cpp",
+ "android/hardware/media/omx/1.0/OmxObserverAll.cpp",
+ ],
+}
+
+genrule {
+ name: "android.hardware.media.omx@1.0_genc++_headers",
+ tools: ["hidl-gen"],
+ cmd: "$(location hidl-gen) -o $(genDir) -Lc++ -randroid.hardware:hardware/interfaces android.hardware.media.omx@1.0",
+ srcs: [
+ "types.hal",
+ "IGraphicBufferSource.hal",
+ "IOmx.hal",
+ "IOmxBufferSource.hal",
+ "IOmxNode.hal",
+ "IOmxObserver.hal",
+ ],
+ out: [
+ "android/hardware/media/omx/1.0/types.h",
+ "android/hardware/media/omx/1.0/IGraphicBufferSource.h",
+ "android/hardware/media/omx/1.0/IHwGraphicBufferSource.h",
+ "android/hardware/media/omx/1.0/BnGraphicBufferSource.h",
+ "android/hardware/media/omx/1.0/BpGraphicBufferSource.h",
+ "android/hardware/media/omx/1.0/BsGraphicBufferSource.h",
+ "android/hardware/media/omx/1.0/IOmx.h",
+ "android/hardware/media/omx/1.0/IHwOmx.h",
+ "android/hardware/media/omx/1.0/BnOmx.h",
+ "android/hardware/media/omx/1.0/BpOmx.h",
+ "android/hardware/media/omx/1.0/BsOmx.h",
+ "android/hardware/media/omx/1.0/IOmxBufferSource.h",
+ "android/hardware/media/omx/1.0/IHwOmxBufferSource.h",
+ "android/hardware/media/omx/1.0/BnOmxBufferSource.h",
+ "android/hardware/media/omx/1.0/BpOmxBufferSource.h",
+ "android/hardware/media/omx/1.0/BsOmxBufferSource.h",
+ "android/hardware/media/omx/1.0/IOmxNode.h",
+ "android/hardware/media/omx/1.0/IHwOmxNode.h",
+ "android/hardware/media/omx/1.0/BnOmxNode.h",
+ "android/hardware/media/omx/1.0/BpOmxNode.h",
+ "android/hardware/media/omx/1.0/BsOmxNode.h",
+ "android/hardware/media/omx/1.0/IOmxObserver.h",
+ "android/hardware/media/omx/1.0/IHwOmxObserver.h",
+ "android/hardware/media/omx/1.0/BnOmxObserver.h",
+ "android/hardware/media/omx/1.0/BpOmxObserver.h",
+ "android/hardware/media/omx/1.0/BsOmxObserver.h",
+ ],
+}
+
+cc_library_shared {
+ name: "android.hardware.media.omx@1.0",
+ generated_sources: ["android.hardware.media.omx@1.0_genc++"],
+ generated_headers: ["android.hardware.media.omx@1.0_genc++_headers"],
+ export_generated_headers: ["android.hardware.media.omx@1.0_genc++_headers"],
+ shared_libs: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libutils",
+ "libcutils",
+ "android.hardware.graphics.common@1.0",
+ "android.hardware.media@1.0",
+ ],
+ export_shared_lib_headers: [
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libutils",
+ "android.hardware.graphics.common@1.0",
+ "android.hardware.media@1.0",
+ ],
+}
diff --git a/media/omx/1.0/IGraphicBufferSource.hal b/media/omx/1.0/IGraphicBufferSource.hal
new file mode 100644
index 0000000..bee57ac
--- /dev/null
+++ b/media/omx/1.0/IGraphicBufferSource.hal
@@ -0,0 +1,60 @@
+/*
+ * Copyright (C) 2016 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.media.omx@1.0;
+
+import android.hardware.graphics.common@1.0::Dataspace;
+
+import android.hardware.media@1.0::types;
+
+import IOmxNode;
+
+/**
+ * Ref: frameworks/av/media/libmedia/aidl/android/IGraphicBufferSource.aidl
+ *
+ * TODO: Add documentations.
+ */
+interface IGraphicBufferSource {
+
+ configure(IOmxNode omxNode, Dataspace dataspace)
+ generates (Status status);
+
+ setSuspend(bool suspend)
+ generates (Status status);
+
+ setRepeatPreviousFrameDelayUs(int64_t repeatAfterUs)
+ generates (Status status);
+
+ setMaxFps(float maxFps)
+ generates (Status status);
+
+ setTimeLapseConfig(int64_t timePerFrameUs, int64_t timePerCaptureUs)
+ generates (Status status);
+
+ setStartTimeUs(int64_t startTimeUs)
+ generates (Status status);
+
+ setColorAspects(uint32_t aspects) // TODO: Maybe break down aspects.
+ generates (Status status);
+
+ setTimeOffsetUs(int64_t timeOffsetUs)
+ generates (Status status);
+
+ signalEndOfInputStream()
+ generates (Status status);
+
+};
+
diff --git a/media/omx/1.0/IOmx.hal b/media/omx/1.0/IOmx.hal
new file mode 100644
index 0000000..e9f0b76
--- /dev/null
+++ b/media/omx/1.0/IOmx.hal
@@ -0,0 +1,69 @@
+/*
+ * Copyright (C) 2016 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.media.omx@1.0;
+
+import android.hardware.media@1.0::types;
+
+import IOmxNode;
+import IOmxObserver;
+
+/**
+ * Ref: frameworks/av/include/media/IOMX.h: IOMX
+ *
+ * IOmx is the main entry point for communicating with OMX components.
+ */
+interface IOmx {
+
+ /**
+ * Information for an IOmxNode component.
+ */
+ struct ComponentInfo {
+ string mName; //< Name of the component.
+ vec<string> mRoles; //< Roles of the component.
+ };
+
+ /**
+ * List available components.
+ *
+ * @param[out] status will be the status of the call.
+ * @param[out] nodeList will be a list of ComponentInfo.
+ */
+ listNodes(
+ ) generates (
+ Status status,
+ vec<ComponentInfo> nodeList
+ );
+
+ /**
+ * Allocate an IOmxNode instance with the specified component name.
+ *
+ * @param[in] name is the name of the component to create.
+ * @param[in] observer is an observer object that will receive messages from
+ * the created instance.
+ * @param[out] status will be the status of the call.
+ * @param[out] omxNode will be the allocated instance of IOmxNode.
+ */
+ allocateNode(
+ string name,
+ IOmxObserver observer
+ ) generates (
+ Status status,
+ IOmxNode omxNode
+ );
+
+};
+
diff --git a/media/omx/1.0/IOmxBufferSource.hal b/media/omx/1.0/IOmxBufferSource.hal
new file mode 100644
index 0000000..94c43fc
--- /dev/null
+++ b/media/omx/1.0/IOmxBufferSource.hal
@@ -0,0 +1,68 @@
+/*
+ * Copyright (C) 2016 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.media.omx@1.0;
+
+import android.hardware.media@1.0::types;
+
+/**
+ * Ref: frameworks/av/media/libmedia/aidl/android/IOMXBufferSource.aidl
+ *
+ * IOmxBufferSource is an interface for a listener for certain events from an
+ * IOmxNode instance. Use IOmxNode::setInputSurface() to attach an
+ * IOmxBufferSource instance to an IOmxNode instance.
+ *
+ * @see OMX_STATETYPE in the OpenMax IL standard.
+ */
+interface IOmxBufferSource {
+
+ /**
+ * onOmxExecuting() is invoked when the node state changes to
+ * OMX_StateExecuting state.
+ */
+ oneway onOmxExecuting();
+
+ /**
+ * onOmxIdle() is invoked when the node transitions from OMX_StateExecuting
+ * to OMX_StateIdle.
+ */
+ oneway onOmxIdle();
+
+ /**
+ * onOmxLoaded() is invoked when the node transitions from OMX_StateIdle or
+ * OMX_StateExecuting to OMX_StateLoaded.
+ */
+ oneway onOmxLoaded();
+
+ /**
+ * onInputBufferAdded() is invoked after a new input buffer is added to the
+ * node. This may happen within IOmxNode::allocateSecureBuffer() or
+ * IOmxNode::useBuffer().
+ *
+ * @param[in] buffer is the id of the added buffer.
+ */
+ oneway onInputBufferAdded(BufferId buffer);
+
+ /**
+ * onInputBufferEmptied() is invoked after an input buffer is emptied. This
+ * may happen within IOmxNode::emptyBuffer().
+ *
+ * @param[in] buffer is the id of the emptied buffer.
+ * @param[in] fence is the fence associated with the buffer.
+ */
+ oneway onInputBufferEmptied(BufferId buffer, Fence fence);
+};
+
diff --git a/media/omx/1.0/IOmxNode.hal b/media/omx/1.0/IOmxNode.hal
new file mode 100644
index 0000000..9483be4
--- /dev/null
+++ b/media/omx/1.0/IOmxNode.hal
@@ -0,0 +1,358 @@
+/*
+ * Copyright (C) 2016 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.media.omx@1.0;
+
+import IOmxBufferSource;
+
+import android.hardware.media@1.0::types;
+
+/**
+ * Ref: frameworks/av/include/media/IOMX.h: IOMXNode
+ * Ref: https://www.khronos.org/registry/omxil/specs/OpenMAX_IL_1_1_2_Specification.pdf
+ */
+
+/**
+ * IOmxNode is an interface for communicating with an OMX component (called
+ * "node" here) that has been previously obtained by calling
+ * IOmx::allocateNode().
+ */
+interface IOmxNode {
+
+ /**
+ * Free the node.
+ *
+ * @param[out] status will be the status of the call.
+ */
+ freeNode(
+ ) generates (
+ Status status
+ );
+
+ /**
+ * Invoke a command on the node.
+ *
+ * @param[in] cmd indicates the type of the command.
+ * @param[in] info holds information about the command.
+ * @param[out] status will be the status of the call.
+ *
+ * @see OMX_SendCommand() in the OpenMax IL standard.
+ */
+ sendCommand(
+ uint32_t cmd,
+ Bytes info // TODO: describe structure better or point at standard
+ ) generates (
+ Status status
+ );
+
+ /**
+ * Retrieve a parameter setting from the node.
+ *
+ * @param[in] index indicates the type of the parameter to retrieve.
+ * @param[in] inParams holds some information about the retrieval.
+ * @param[out] status will be the status of the call.
+ * @param[out] outParams will be the current parameter setting.
+ *
+ * @see OMX_GetParameter() in the OpenMax IL standard.
+ */
+ getParameter(
+ uint32_t index,
+ Bytes inParams // TODO: describe structure better or point at standard
+ ) generates (
+ Status status,
+ Bytes outParams // TODO: describe structure better or point at standard
+ );
+
+ /**
+ * Change a parameter setting of the node.
+ *
+ * @param[in] index indicates the type of the parameter to change.
+ * @param[in] params holds the new parameter setting.
+ * @param[out] status will be the status of the call.
+ *
+ * @see OMX_SetParameter() in the OpenMax IL standard.
+ */
+ setParameter(
+ uint32_t index,
+ Bytes params // TODO: describe structure better or point at standard
+ ) generates (
+ Status status
+ );
+
+ /**
+ * Retrieve a configuration from the node.
+ *
+ * @param[in] index indicates the type of the configuration to retrieve.
+ * @param[in] inConfig holds some information about the retrieval.
+ * @param[out] status will be the status of the call.
+ * @param[out] outConfig will be the current configuration.
+ *
+ * @see OMX_GetConfig() in the OpenMax IL standard.
+ */
+ getConfig(
+ uint32_t index,
+ Bytes inConfig // TODO: describe structure better or point at standard
+ ) generates (
+ Status status,
+ Bytes outConfig // TODO: describe structure better or point at standard
+ );
+
+ /**
+ * Change a configuration of the node.
+ *
+ * @param[in] index indicates the type of the configuration to change.
+ * @param[in] config holds the new configuration.
+ * @param[out] status will be the status of the call.
+ *
+ * @see OMX_SetConfig() in the OpenMax IL standard.
+ */
+ setConfig(
+ uint32_t index,
+ Bytes config // TODO: describe structure better or point at standard
+ ) generates (
+ Status status
+ );
+
+ /**
+ * Set the mode of a port on the node.
+ *
+ * @param[in] portIndex is the index of the port.
+ * @param[in] mode is the target mode on the specified port.
+ */
+ setPortMode(
+ uint32_t portIndex,
+ PortMode mode
+ ) generates (
+ Status status
+ );
+
+ /**
+ * Prepare a port for adaptive playback. This is based on the extension
+ * "OMX.google.android.index.prepareForAdaptivePlayback".
+ *
+ * @param[in] portIndex is the index of the port.
+ * @param[in] enable indicates whether adaptive playback is enabled or not.
+ * @param[in] maxFrameWidth specifies the maximum frame width.
+ * @param[in] maxFrameHeight specifies the maximum frame height.
+ * @param[out] status status will be the status of the call.
+ */
+ prepareForAdaptivePlayback(
+ uint32_t portIndex,
+ bool enable,
+ uint32_t maxFrameWidth,
+ uint32_t maxFrameHeight
+ ) generates (
+ Status status
+ );
+
+ /**
+ * Configure a port for a tunneled playback mode. This is based on the
+ * extension "OMX.google.android.index.configureVideoTunnelMode".
+ *
+ * @param[in] portIndex is the index of the port.
+ * @param[in] tunneled indicates whether the tunneled mode is used or not.
+ * @param[in] audioHwSync is the HW SYNC ID of the audio HAL output stream
+ * to sync the video with.
+ * @param[out] status will be the status of the call.
+ * @param[out] sidebandHandle will contain the codec-allocated sideband
+ * window handle.
+ */
+ configureVideoTunnelMode(
+ uint32_t portIndex,
+ bool tunneled,
+ uint32_t audioHwSync
+ ) generates (
+ Status status,
+ handle sidebandHandle
+ );
+
+ /**
+ * Retrieve the buffer usage on a port. This is based on the extension
+ * "OMX.google.android.index.getAndroidNativeBufferUsage".
+ *
+ * @param[in] portIndex is the index of the port.
+ * @param[out] status will be the status of the call.
+ * @param[out] usage will be the usage.
+ */
+ getGraphicBufferUsage(
+ uint32_t portIndex
+ ) generates (
+ Status status,
+ uint32_t usage // TODO: Ask graphics team to define an enum.
+ );
+
+ /**
+ * Set up a listener to events related to the input surface.
+ *
+ * @param[in] bufferSource is the listener object that implements
+ * IOmxBufferSource.
+ * @param[out] status will be the status of the call.
+ *
+ * @see IOmxBufferSource.
+ */
+ setInputSurface(
+ IOmxBufferSource bufferSource
+ ) generates (
+ Status status
+ );
+
+ /**
+ * Allocate an opaque buffer on a port as a native handle.
+ *
+ * @param[in] portIndex is the index of the port.
+ * @param[in] size is the desired size of the buffer.
+ * @param[out] status will be the status of the call.
+ * @param[out] buffer will be the id of the allocated buffer, which will be
+ * needed in some other buffer-related function calls.
+ * @param[out] nativeHandle will be the native handle of the allocated
+ * buffer.
+ *
+ * @see OMX_AllocateBuffer() in the OpenMax IL standard.
+ */
+ allocateSecureBuffer(
+ uint32_t portIndex,
+ uint64_t size
+ ) generates (
+ Status status,
+ BufferId buffer,
+ handle nativeHandle
+ );
+
+ /**
+ * Assign a buffer to a port.
+ *
+ * @param[in] portIndex is the index of the port.
+ * @param[in] omxBuffer is the buffer to be assigned to the port.
+ * @param[out] status will be the status of the call.
+ * @param[out] buffer will be the id of the assigned buffer, which will be
+ * needed in some other buffer-related function calls.
+ *
+ * @see OMX_UseBuffer() in the OpenMax IL standard.
+ */
+ useBuffer(
+ uint32_t portIndex,
+ CodecBuffer omxBuffer
+ ) generates (
+ Status status,
+ BufferId buffer
+ );
+
+ /**
+ * Free a buffer previously assigned to a port by allocateSecureBuffer() or
+ * useBuffer().
+ *
+ * @param[in] portIndex is the index of the port.
+ * @param[in] buffer is the id of the buffer to be freed.
+ * @param[out] status will be the status of the call.
+ *
+ * @see OMX_FreeBuffer() in the OpenMax IL standard.
+ */
+ freeBuffer(
+ uint32_t portIndex,
+ BufferId buffer
+ ) generates (
+ Status status
+ );
+
+ /**
+ * Pass \p fence to the node if it supports fences. Otherwise, it waits on
+ * \p fence before calling OMX_FillThisBuffer(). The node will take
+ * ownership of the fence even if this call fails.
+ *
+ * If the port is in metadata mode, the buffer will be updated to point to
+ * the new buffer passed in via \p omxBuffer before OMX_FillThisBuffer() is
+ * called. Otherwise, \p omxBuffer is not used.
+ *
+ * @param[in] buffer is the id of the buffer to fill.
+ * @param[in] omxBuffer points to the new buffer in metadata mode.
+ * @param[in] fence is the fence to wait for (if not null).
+ * @param[out] status is the status of the call.
+ *
+ * @see OMX_FillThisBuffer() in the OpenMax IL standard.
+ */
+ fillBuffer(
+ BufferId buffer,
+ CodecBuffer omxBuffer,
+ Fence fence
+ ) generates (
+ Status status
+ );
+
+ /**
+ * Pass \p fence to the node if it supports fences. Otherwise, wait on
+ * \p fence before calling OMX_EmptyThisBuffer(). The node will take
+ * ownership of the fence even if this call fails.
+ *
+ * If the port is in metadata mode, the buffer will be updated to point to
+ * the new buffer passed in via \p omxBuffer before OMX_EmptyThisBuffer() is
+ * called. Otherwise, \p omxBuffer is not used.
+ *
+ * @param[in] buffer is the id of the buffer to fill.
+ * @param[in] omxBuffer points to the new buffer in metadata mode.
+ * @param[in] flags is put into the header information that is passed to
+ * OMX_EmptyBuffer().
+ * @param[in] timestampUs is put into the header information that is passed
+ * to OMX_EmptyBuffer().
+ * @param[in] fence is the fence to wait for (if not null).
+ * @param[out] status is the status of the call.
+ *
+ * @see OMX_EmptyThisBuffer() in the OpenMax IL standard.
+ */
+ emptyBuffer(
+ BufferId buffer,
+ CodecBuffer omxBuffer,
+ uint32_t flags, // TODO: describe structure better or point at standard
+ uint64_t timestampUs,
+ Fence fence
+ ) generates (
+ Status status
+ );
+
+ /**
+ * Request the node to translate an extension string to an index.
+ *
+ * @param[in] parameterName is the requested extension string.
+ * @param[out] status is the status of the call.
+ * @param[out] index is the translated index.
+ *
+ * @see OMX_GetExtensionIndex() in the OpenMax IL standard.
+ */
+ getExtensionIndex(
+ string parameterName
+ ) generates (
+ Status status,
+ uint32_t index
+ );
+
+ /**
+ * Add an OMX message on the node's message queue. The instance of
+ * IOmxObserver that was obtained during the creation of the node will
+ * receive the message in batches by the callback
+ * IOmxObserver::onMessages().
+ *
+ * @param[in] msg is the message to send.
+ * @param[out] status is the status of the call.
+ *
+ * @see IOmxObserver::onMessages().
+ */
+ dispatchMessage(
+ Message msg
+ ) generates (
+ Status status
+ );
+
+};
+
diff --git a/media/omx/1.0/IOmxObserver.hal b/media/omx/1.0/IOmxObserver.hal
new file mode 100644
index 0000000..c26a937
--- /dev/null
+++ b/media/omx/1.0/IOmxObserver.hal
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2016 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.media.omx@1.0;
+
+/**
+ * Ref: frameworks/av/include/media/IOMX.h: IOMXObserver
+ */
+
+/**
+ * IOmxObserver is a listener interface for OMX messages sent from an IOmxNode
+ * stance.
+ */
+interface IOmxObserver {
+
+ /**
+ * Invoked to process messages from an IOmxNode instance. Note that messages
+ * come in batches.
+ */
+ oneway onMessages(vec<Message> messages);
+};
+
diff --git a/media/omx/1.0/types.hal b/media/omx/1.0/types.hal
new file mode 100644
index 0000000..c0350de
--- /dev/null
+++ b/media/omx/1.0/types.hal
@@ -0,0 +1,178 @@
+/*
+ * Copyright (C) 2016 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.media.omx@1.0;
+
+import android.hardware.media@1.0::types;
+
+// Aliases
+typedef uint32_t BufferId;
+
+/**
+ * Ref: frameworks/av/include/media/IOMX.h: omx_message
+ *
+ * Data structure for an OMX message. This is essentially a union of different
+ * message types.
+ */
+struct Message {
+
+ /**
+ * There are four main types of messages.
+ */
+ enum Type : uint32_t {
+ EVENT,
+ EMPTY_BUFFER_DONE,
+ FILL_BUFFER_DONE,
+ FRAME_RENDERED,
+ };
+
+ /**
+ * @see OMX_EVENTTYPE in the OpenMax IL standard.
+ */
+ struct EventData {
+ uint32_t event; // TODO: if there are common core events, convert to an enum or point to std
+ uint32_t data1;
+ uint32_t data2;
+ uint32_t data3;
+ uint32_t data4;
+ };
+
+ struct BufferData {
+ BufferId buffer;
+ };
+
+ struct ExtendedBufferData {
+ BufferId buffer;
+ uint32_t rangeOffset;
+ uint32_t rangeLength;
+ uint32_t flags; // TODO: if common flags exist, define an enum of point to std
+ uint64_t timestampUs;
+ };
+
+ struct RenderData {
+ uint64_t timestampUs;
+ int64_t systemTimeNs;
+ };
+
+ union Data {
+ // if type == EVENT
+ EventData eventData;
+
+ // if type == EMPTY_BUFFER_DONE
+ BufferData bufferData;
+
+ // if type == FILL_BUFFER_DONE
+ ExtendedBufferData extendedBufferData;
+
+ // if type == FRAME_RENDERED
+ RenderData renderData;
+ };
+
+ /**
+ * The type of the message.
+ */
+ Type type;
+
+ /**
+ * The fence associated with the message.
+ */
+ Fence fence;
+
+ /**
+ * The union of data, discriminated by type.
+ */
+ Data data;
+};
+
+/**
+ * Ref: frameworks/native/include/ui/GraphicBuffer.h
+ * Ref: system/core/include/system/window.h
+ * Ref: frameworks/native/include/binder/IMemory.h
+ * Ref: frameworks/native/libs/binder/IMemory.cpp
+ * Ref: frameworks/av/include/media/OMXBuffer.h
+ *
+ * Data structure for buffer information. This is essentially a union of
+ * different buffer types.
+ */
+struct CodecBuffer {
+
+ /**
+ * There are four main types of buffers.
+ */
+ enum Type {
+ INVALID = 0,
+ PRESET,
+ SHARED_MEM,
+ ANW_BUFFER,
+ NATIVE_HANDLE
+ };
+
+ struct PresetAttributes {
+ uint32_t rangeLength;
+ };
+
+ union Attributes {
+ // if bufferType == PRESET
+ PresetAttributes preset;
+
+ // if bufferType == SHARED_MEM
+ SharedMemoryAttributes sharedMem;
+
+ // if bufferType == ANW_BUFFER
+ GraphicBufferAttributes anwBuffer;
+
+ // if bufferType == NATIVE_HANDLE
+ // No additional attributes.
+ };
+
+ /**
+ * Type of the buffer.
+ */
+ Type type;
+
+ /**
+ * Attributes that can be put into a union.
+ */
+ Attributes attr;
+
+ /**
+ * \p nativeHandle is used only for types SHARED_MEM, ANW_BUFFER and
+ * NATIVE_HANDLE.
+ *
+ * (A native handle cannot be put into a union as HIDL currently does not
+ * support discriminated unions.)
+ */
+ handle nativeHandle;
+
+};
+
+/**
+ * Ref: frameworks/av/include/media/IOMX.h
+ *
+ * Enumeration of port modes.
+ */
+enum PortMode {
+ PRESET_START = 0,
+ PRESET_BYTE_BUFFER,
+ PRESET_ANW_BUFFER,
+ PRESET_SECURE_BUFFER,
+ PRESET_END,
+ DYNAMIC_START = 100,
+ DYNAMIC_ANW_BUFFER,
+ DYNAMIC_NATIVE_HANDLE,
+ DYNAMIC_END
+};
+
diff --git a/memtrack/1.0/Android.bp b/memtrack/1.0/Android.bp
index 83c09cf..c5727c1 100644
--- a/memtrack/1.0/Android.bp
+++ b/memtrack/1.0/Android.bp
@@ -38,13 +38,15 @@
generated_headers: ["android.hardware.memtrack@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.memtrack@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/memtrack/1.0/default/Android.bp b/memtrack/1.0/default/Android.bp
index 50d2318..91fa1ea 100644
--- a/memtrack/1.0/default/Android.bp
+++ b/memtrack/1.0/default/Android.bp
@@ -20,7 +20,8 @@
shared_libs: [
"libbase",
"liblog",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhardware",
"libhwbinder",
"libutils",
@@ -41,7 +42,8 @@
"libdl",
"libutils",
"libhardware",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"android.hardware.memtrack@1.0",
],
diff --git a/memtrack/1.0/vts/Android.mk b/memtrack/1.0/vts/Android.mk
index c0fe968..8a5ceb1 100644
--- a/memtrack/1.0/vts/Android.mk
+++ b/memtrack/1.0/vts/Android.mk
@@ -25,18 +25,14 @@
Memtrack.vts \
types.vts \
-LOCAL_C_INCLUDES := \
- android.hardware.memtrack@1.0 \
- system/core/base/include \
- system/core/include \
-
LOCAL_SHARED_LIBRARIES += \
android.hardware.memtrack@1.0 \
libbase \
libutils \
libcutils \
liblog \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libprotobuf-cpp-full \
libvts_common \
@@ -44,10 +40,6 @@
libvts_measurement \
libvts_multidevice_proto \
-LOCAL_CFLAGS += -DENABLE_TREBLE
-
-LOCAL_STATIC_LIBRARIES := \
-
LOCAL_PROTOC_OPTIMIZE_TYPE := full
LOCAL_MULTILIB := both
@@ -73,7 +65,8 @@
libbase \
libcutils \
liblog \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libprotobuf-cpp-full \
libvts_common \
diff --git a/nfc/1.0/Android.bp b/nfc/1.0/Android.bp
index b6e8d08..9584636 100644
--- a/nfc/1.0/Android.bp
+++ b/nfc/1.0/Android.bp
@@ -46,13 +46,15 @@
generated_headers: ["android.hardware.nfc@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.nfc@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/nfc/1.0/default/Android.bp b/nfc/1.0/default/Android.bp
index a8c4c81..b484ba6 100644
--- a/nfc/1.0/default/Android.bp
+++ b/nfc/1.0/default/Android.bp
@@ -10,7 +10,8 @@
"libbase",
"libcutils",
"libutils",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"android.hardware.nfc@1.0",
],
}
diff --git a/nfc/1.0/default/Android.mk b/nfc/1.0/default/Android.mk
index d4e46f8..a6c7d5c 100644
--- a/nfc/1.0/default/Android.mk
+++ b/nfc/1.0/default/Android.mk
@@ -18,7 +18,8 @@
LOCAL_SHARED_LIBRARIES += \
libhwbinder \
- libhidl \
+ libhidlbase \
+ libhidltransport \
android.hardware.nfc@1.0 \
include $(BUILD_EXECUTABLE)
diff --git a/nfc/1.0/vts/Android.mk b/nfc/1.0/vts/Android.mk
index 6f63e03..04884b7 100644
--- a/nfc/1.0/vts/Android.mk
+++ b/nfc/1.0/vts/Android.mk
@@ -26,18 +26,14 @@
NfcClientCallback.vts \
types.vts \
-LOCAL_C_INCLUDES := \
- android.hardware.nfc@1.0 \
- system/core/base/include \
- system/core/include \
-
LOCAL_SHARED_LIBRARIES += \
android.hardware.nfc@1.0 \
libbase \
libutils \
libcutils \
liblog \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libprotobuf-cpp-full \
libvts_common \
@@ -45,10 +41,6 @@
libvts_measurement \
libvts_multidevice_proto \
-LOCAL_CFLAGS += -DENABLE_TREBLE
-
-LOCAL_STATIC_LIBRARIES := \
-
LOCAL_PROTOC_OPTIMIZE_TYPE := full
LOCAL_MULTILIB := both
@@ -74,7 +66,8 @@
libbase \
libcutils \
liblog \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libprotobuf-cpp-full \
libvts_common \
@@ -105,7 +98,8 @@
libbase \
libcutils \
liblog \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libprotobuf-cpp-full \
libvts_common \
diff --git a/nfc/1.0/vts/functional/Android.bp b/nfc/1.0/vts/functional/Android.bp
index 0f1afbd..021f7c1 100644
--- a/nfc/1.0/vts/functional/Android.bp
+++ b/nfc/1.0/vts/functional/Android.bp
@@ -22,7 +22,8 @@
"libbase",
"liblog",
"libcutils",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libnativehelper",
"libutils",
@@ -30,7 +31,11 @@
],
static_libs: ["libgtest"],
cflags: [
+ "--coverage",
"-O0",
"-g",
],
-}
\ No newline at end of file
+ ldflags: [
+ "--coverage"
+ ]
+}
diff --git a/power/1.0/Android.bp b/power/1.0/Android.bp
index a671474..777bb85 100644
--- a/power/1.0/Android.bp
+++ b/power/1.0/Android.bp
@@ -38,13 +38,15 @@
generated_headers: ["android.hardware.power@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.power@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/power/1.0/default/Android.bp b/power/1.0/default/Android.bp
index e573186..1a5a897 100644
--- a/power/1.0/default/Android.bp
+++ b/power/1.0/default/Android.bp
@@ -20,7 +20,8 @@
shared_libs: [
"liblog",
"libhardware",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"android.hardware.power@1.0",
@@ -39,7 +40,8 @@
"libdl",
"libutils",
"libhardware",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"android.hardware.power@1.0",
],
diff --git a/power/1.0/vts/Android.mk b/power/1.0/vts/Android.mk
index 4d5117b..887b6bf 100644
--- a/power/1.0/vts/Android.mk
+++ b/power/1.0/vts/Android.mk
@@ -25,18 +25,14 @@
Power.vts \
types.vts \
-LOCAL_C_INCLUDES := \
- android.hardware.power@1.0 \
- system/core/base/include \
- system/core/include \
-
LOCAL_SHARED_LIBRARIES += \
android.hardware.power@1.0 \
libbase \
libutils \
libcutils \
liblog \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libprotobuf-cpp-full \
libvts_common \
@@ -44,10 +40,6 @@
libvts_measurement \
libvts_multidevice_proto \
-LOCAL_CFLAGS += -DENABLE_TREBLE
-
-LOCAL_STATIC_LIBRARIES := \
-
LOCAL_PROTOC_OPTIMIZE_TYPE := full
LOCAL_MULTILIB := both
@@ -73,7 +65,8 @@
libbase \
libcutils \
liblog \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libprotobuf-cpp-full \
libvts_common \
diff --git a/radio/1.0/Android.bp b/radio/1.0/Android.bp
index 0f89421..1bb8fe5 100644
--- a/radio/1.0/Android.bp
+++ b/radio/1.0/Android.bp
@@ -70,13 +70,15 @@
generated_headers: ["android.hardware.radio@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.radio@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/radio/1.0/IRadio.hal b/radio/1.0/IRadio.hal
index d2ffa82..f29b916 100644
--- a/radio/1.0/IRadio.hal
+++ b/radio/1.0/IRadio.hal
@@ -1556,4 +1556,12 @@
* Response callback is IRadioCallback.getAllowedCarriersResponse()
*/
oneway getAllowedCarriers(int32_t serial);
+
+ /*
+ * When response type received from a radio indication or radio response is
+ * RadioIndicationType:UNSOLICITED_ACK_EXP or RadioResponseType:SOLICITED_ACK_EXP respectively,
+ * acknowledge the receipt of those messages by sending reseponeAcknowledgement().
+ *
+ */
+ oneway responseAcknowledgement();
};
\ No newline at end of file
diff --git a/sensors/1.0/Android.bp b/sensors/1.0/Android.bp
index 2039613..7f25a62 100644
--- a/sensors/1.0/Android.bp
+++ b/sensors/1.0/Android.bp
@@ -38,13 +38,15 @@
generated_headers: ["android.hardware.sensors@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.sensors@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/sensors/1.0/default/Android.bp b/sensors/1.0/default/Android.bp
index d8d0c82..7fbe117 100644
--- a/sensors/1.0/default/Android.bp
+++ b/sensors/1.0/default/Android.bp
@@ -10,7 +10,8 @@
"libbase",
"libcutils",
"libutils",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"android.hardware.sensors@1.0",
],
static_libs: [
@@ -31,7 +32,8 @@
"libbase",
"libcutils",
"libutils",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"android.hardware.sensors@1.0",
],
local_include_dirs: ["include/sensors"],
diff --git a/sensors/1.0/default/Android.mk b/sensors/1.0/default/Android.mk
index 4f418cb..b2b2c60 100644
--- a/sensors/1.0/default/Android.mk
+++ b/sensors/1.0/default/Android.mk
@@ -18,7 +18,8 @@
LOCAL_SHARED_LIBRARIES += \
libhwbinder \
- libhidl \
+ libhidlbase \
+ libhidltransport \
android.hardware.sensors@1.0 \
include $(BUILD_EXECUTABLE)
diff --git a/soundtrigger/2.0/Android.bp b/soundtrigger/2.0/Android.bp
index 79ae797..4eab0bf 100644
--- a/soundtrigger/2.0/Android.bp
+++ b/soundtrigger/2.0/Android.bp
@@ -46,14 +46,16 @@
generated_headers: ["android.hardware.soundtrigger@2.0_genc++_headers"],
export_generated_headers: ["android.hardware.soundtrigger@2.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
"android.hardware.audio.common@2.0",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"android.hardware.audio.common@2.0",
diff --git a/soundtrigger/2.0/default/Android.mk b/soundtrigger/2.0/default/Android.mk
index 4ec64de..498c54f 100644
--- a/soundtrigger/2.0/default/Android.mk
+++ b/soundtrigger/2.0/default/Android.mk
@@ -23,7 +23,8 @@
SoundTriggerHalImpl.cpp
LOCAL_SHARED_LIBRARIES := \
- libhidl \
+ libhidlbase \
+ libhidltransport \
liblog \
libhwbinder \
libutils \
diff --git a/tests/bar/1.0/Android.bp b/tests/bar/1.0/Android.bp
index 97693fb..08947ad 100644
--- a/tests/bar/1.0/Android.bp
+++ b/tests/bar/1.0/Android.bp
@@ -42,14 +42,16 @@
generated_headers: ["android.hardware.tests.bar@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.tests.bar@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
"android.hardware.tests.foo@1.0",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"android.hardware.tests.foo@1.0",
diff --git a/tests/bar/1.0/default/Android.bp b/tests/bar/1.0/default/Android.bp
index c2c2309..7e349c2 100644
--- a/tests/bar/1.0/default/Android.bp
+++ b/tests/bar/1.0/default/Android.bp
@@ -11,7 +11,8 @@
shared_libs: [
"libbase",
"libcutils",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"liblog",
"libutils",
diff --git a/tests/bar/1.0/default/Bar.cpp b/tests/bar/1.0/default/Bar.cpp
index 4ff9e6b..2158cd8 100644
--- a/tests/bar/1.0/default/Bar.cpp
+++ b/tests/bar/1.0/default/Bar.cpp
@@ -154,7 +154,7 @@
}
Return<void> Bar::expectNullHandle(const native_handle_t* h, const Abc& xyz, expectNullHandle_cb _hidl_cb) {
- ALOGI("SERVER(Bar) h = %p, xyz.z = %p", h, xyz.z);
+ ALOGI("SERVER(Bar) h = %p, xyz.z = %p", h, static_cast<void*>(xyz.z));
_hidl_cb(h == nullptr, xyz.z == nullptr);
return Void();
}
diff --git a/tests/baz/1.0/Android.bp b/tests/baz/1.0/Android.bp
index 1a7c300..98d3e84 100644
--- a/tests/baz/1.0/Android.bp
+++ b/tests/baz/1.0/Android.bp
@@ -54,13 +54,15 @@
generated_headers: ["android.hardware.tests.baz@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.tests.baz@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/tests/expression/1.0/Android.bp b/tests/expression/1.0/Android.bp
index 6acb3f9..60754d3 100644
--- a/tests/expression/1.0/Android.bp
+++ b/tests/expression/1.0/Android.bp
@@ -42,13 +42,15 @@
generated_headers: ["android.hardware.tests.expression@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.tests.expression@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/tests/foo/1.0/Android.bp b/tests/foo/1.0/Android.bp
index 7e30fe3..4064e74 100644
--- a/tests/foo/1.0/Android.bp
+++ b/tests/foo/1.0/Android.bp
@@ -70,13 +70,15 @@
generated_headers: ["android.hardware.tests.foo@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.tests.foo@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/tests/foo/1.0/default/Android.bp b/tests/foo/1.0/default/Android.bp
index f2ee521..76a4656 100644
--- a/tests/foo/1.0/default/Android.bp
+++ b/tests/foo/1.0/default/Android.bp
@@ -11,7 +11,8 @@
shared_libs: [
"libbase",
"libcutils",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libfootest",
"libhwbinder",
"liblog",
diff --git a/tests/foo/1.0/default/lib/Android.bp b/tests/foo/1.0/default/lib/Android.bp
index c7ad57e..7873203 100644
--- a/tests/foo/1.0/default/lib/Android.bp
+++ b/tests/foo/1.0/default/lib/Android.bp
@@ -5,7 +5,8 @@
],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"android.hardware.tests.foo@1.0",
],
diff --git a/tests/inheritance/1.0/Android.bp b/tests/inheritance/1.0/Android.bp
index f522ac0..cfd10ac 100644
--- a/tests/inheritance/1.0/Android.bp
+++ b/tests/inheritance/1.0/Android.bp
@@ -58,13 +58,15 @@
generated_headers: ["android.hardware.tests.inheritance@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.tests.inheritance@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/tests/inheritance/1.0/default/Android.bp b/tests/inheritance/1.0/default/Android.bp
index d97bd83..638d3a4 100644
--- a/tests/inheritance/1.0/default/Android.bp
+++ b/tests/inheritance/1.0/default/Android.bp
@@ -11,7 +11,8 @@
shared_libs: [
"libbase",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"liblog",
"libutils",
diff --git a/tests/libhwbinder/1.0/Android.bp b/tests/libhwbinder/1.0/Android.bp
index 2598f30..ca02cc7 100644
--- a/tests/libhwbinder/1.0/Android.bp
+++ b/tests/libhwbinder/1.0/Android.bp
@@ -34,13 +34,15 @@
generated_headers: ["android.hardware.tests.libhwbinder@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.tests.libhwbinder@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/tests/libhwbinder/1.0/default/Android.bp b/tests/libhwbinder/1.0/default/Android.bp
index 91149e8..73dcc61 100644
--- a/tests/libhwbinder/1.0/default/Android.bp
+++ b/tests/libhwbinder/1.0/default/Android.bp
@@ -7,10 +7,11 @@
shared_libs: [
"libbase",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"liblog",
"libutils",
"android.hardware.tests.libhwbinder@1.0",
],
-}
\ No newline at end of file
+}
diff --git a/tests/msgq/1.0/Android.bp b/tests/msgq/1.0/Android.bp
index e685bcc..914c93f 100644
--- a/tests/msgq/1.0/Android.bp
+++ b/tests/msgq/1.0/Android.bp
@@ -34,13 +34,15 @@
generated_headers: ["android.hardware.tests.msgq@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.tests.msgq@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/tests/pointer/1.0/Android.bp b/tests/pointer/1.0/Android.bp
index ad8d014..bbd0eaa 100644
--- a/tests/pointer/1.0/Android.bp
+++ b/tests/pointer/1.0/Android.bp
@@ -42,13 +42,15 @@
generated_headers: ["android.hardware.tests.pointer@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.tests.pointer@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/tests/pointer/1.0/default/Android.bp b/tests/pointer/1.0/default/Android.bp
index 081b7aa..f7180f1 100644
--- a/tests/pointer/1.0/default/Android.bp
+++ b/tests/pointer/1.0/default/Android.bp
@@ -10,7 +10,8 @@
shared_libs: [
"libbase",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libpointertest",
"libhwbinder",
"liblog",
diff --git a/tests/pointer/1.0/default/lib/Android.bp b/tests/pointer/1.0/default/lib/Android.bp
index efc61df..a7203c7 100644
--- a/tests/pointer/1.0/default/lib/Android.bp
+++ b/tests/pointer/1.0/default/lib/Android.bp
@@ -6,7 +6,8 @@
shared_libs: [
"libbase",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"liblog",
"android.hardware.tests.pointer@1.0",
diff --git a/thermal/1.0/Android.bp b/thermal/1.0/Android.bp
index 60f2626..3b6ef06 100644
--- a/thermal/1.0/Android.bp
+++ b/thermal/1.0/Android.bp
@@ -38,13 +38,15 @@
generated_headers: ["android.hardware.thermal@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.thermal@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/thermal/1.0/IThermal.hal b/thermal/1.0/IThermal.hal
index a60bc7d..e5f70cb 100644
--- a/thermal/1.0/IThermal.hal
+++ b/thermal/1.0/IThermal.hal
@@ -32,6 +32,9 @@
* always returns and never removes such temperatures.
*
*/
+ @callflow(next={"*"})
+ @entry
+ @exit
getTemperatures()
generates (ThermalStatus status, vec<Temperature> temperatures);
@@ -47,6 +50,9 @@
* the same regardless the number of calls to this method.
*
*/
+ @callflow(next={"*"})
+ @entry
+ @exit
getCpuUsages() generates (ThermalStatus status, vec<CpuUsage> cpuUsages);
/*
@@ -63,6 +69,9 @@
* the list such cooling devices.
*
*/
+ @callflow(next={"*"})
+ @entry
+ @exit
getCoolingDevices()
generates (ThermalStatus status, vec<CoolingDevice> devices);
diff --git a/thermal/1.0/default/Android.bp b/thermal/1.0/default/Android.bp
index 626dcaf..819f0b1 100644
--- a/thermal/1.0/default/Android.bp
+++ b/thermal/1.0/default/Android.bp
@@ -10,7 +10,8 @@
"libbase",
"libcutils",
"libutils",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"android.hardware.thermal@1.0",
],
}
diff --git a/thermal/1.0/default/Android.mk b/thermal/1.0/default/Android.mk
index fa7414e..9039e9f 100644
--- a/thermal/1.0/default/Android.mk
+++ b/thermal/1.0/default/Android.mk
@@ -33,7 +33,8 @@
LOCAL_SHARED_LIBRARIES += \
libhwbinder \
- libhidl \
+ libhidlbase \
+ libhidltransport \
android.hardware.thermal@1.0 \
include $(BUILD_EXECUTABLE)
diff --git a/thermal/1.0/default/Thermal.cpp b/thermal/1.0/default/Thermal.cpp
index 1b91687..6c2111f 100644
--- a/thermal/1.0/default/Thermal.cpp
+++ b/thermal/1.0/default/Thermal.cpp
@@ -20,6 +20,7 @@
#include <errno.h>
#include <hardware/hardware.h>
#include <hardware/thermal.h>
+#include <vector>
#include "Thermal.h"
@@ -29,173 +30,167 @@
namespace V1_0 {
namespace implementation {
-Thermal::Thermal(thermal_module_t* module) : mModule(module) {
-}
+Thermal::Thermal(thermal_module_t* module) : mModule(module) {}
// Methods from ::android::hardware::thermal::V1_0::IThermal follow.
-Return<void> Thermal::getTemperatures(getTemperatures_cb _hidl_cb) {
- ThermalStatus status;
- status.code = ThermalStatusCode::SUCCESS;
- hidl_vec<Temperature> temperatures;
+Return<void> Thermal::getTemperatures(getTemperatures_cb _hidl_cb) {
+ ThermalStatus status;
+ status.code = ThermalStatusCode::SUCCESS;
+ hidl_vec<Temperature> temperatures;
- if (!mModule || !mModule->getTemperatures) {
- ALOGI("getTemperatures is not implemented in Thermal HAL.");
- _hidl_cb(status, temperatures);
- return Void();
- }
-
- ssize_t list_size = mModule->getTemperatures(mModule, nullptr, 0);
- if (list_size >= 0) {
- temperature_t *list = new temperature_t[list_size];
- ssize_t size = mModule->getTemperatures(mModule, list, list_size);
- if (size >= 0) {
- if (list_size > size) {
- list_size = size;
- }
-
- temperatures.resize(list_size);
- for (ssize_t i = 0; i < list_size; ++i) {
- switch (list[i].type) {
- case DEVICE_TEMPERATURE_UNKNOWN:
- temperatures[i].type = TemperatureType::UNKNOWN;
- break;
- case DEVICE_TEMPERATURE_CPU:
- temperatures[i].type = TemperatureType::CPU;
- break;
- case DEVICE_TEMPERATURE_GPU:
- temperatures[i].type = TemperatureType::GPU;
- break;
- case DEVICE_TEMPERATURE_BATTERY:
- temperatures[i].type = TemperatureType::BATTERY;
- break;
- case DEVICE_TEMPERATURE_SKIN:
- temperatures[i].type = TemperatureType::SKIN;
- break;
- default:
- ALOGE("Unknown temperature %s type", list[i].name);;
- }
- temperatures[i].name = list[i].name;
- temperatures[i].currentValue = list[i].current_value;
- temperatures[i].throttlingThreshold = list[i].throttling_threshold;
- temperatures[i].shutdownThreshold = list[i].shutdown_threshold;
- temperatures[i].vrThrottlingThreshold = list[i].vr_throttling_threshold;
- }
- } else {
- status.code = ThermalStatusCode::FAILURE;
- status.debugMessage = strerror(-size);
- }
- delete[] list;
- } else {
- status.code = ThermalStatusCode::FAILURE;
- status.debugMessage = strerror(-list_size);
- }
+ if (!mModule || !mModule->getTemperatures) {
+ ALOGI("getTemperatures is not implemented in Thermal HAL.");
_hidl_cb(status, temperatures);
return Void();
+ }
+
+ ssize_t size = mModule->getTemperatures(mModule, nullptr, 0);
+ if (size >= 0) {
+ std::vector<temperature_t> list;
+ list.resize(size);
+ size = mModule->getTemperatures(mModule, list.data(), list.size());
+ if (size >= 0) {
+ temperatures.resize(list.size());
+ for (size_t i = 0; i < list.size(); ++i) {
+ switch (list[i].type) {
+ case DEVICE_TEMPERATURE_UNKNOWN:
+ temperatures[i].type = TemperatureType::UNKNOWN;
+ break;
+ case DEVICE_TEMPERATURE_CPU:
+ temperatures[i].type = TemperatureType::CPU;
+ break;
+ case DEVICE_TEMPERATURE_GPU:
+ temperatures[i].type = TemperatureType::GPU;
+ break;
+ case DEVICE_TEMPERATURE_BATTERY:
+ temperatures[i].type = TemperatureType::BATTERY;
+ break;
+ case DEVICE_TEMPERATURE_SKIN:
+ temperatures[i].type = TemperatureType::SKIN;
+ break;
+ default:
+ ALOGE("Unknown temperature %s type", list[i].name);
+ ;
+ }
+ temperatures[i].name = list[i].name;
+ temperatures[i].currentValue = list[i].current_value;
+ temperatures[i].throttlingThreshold = list[i].throttling_threshold;
+ temperatures[i].shutdownThreshold = list[i].shutdown_threshold;
+ temperatures[i].vrThrottlingThreshold = list[i].vr_throttling_threshold;
+ }
+ }
+ }
+ if (size < 0) {
+ status.code = ThermalStatusCode::FAILURE;
+ status.debugMessage = strerror(-size);
+ }
+ _hidl_cb(status, temperatures);
+ return Void();
}
-Return<void> Thermal::getCpuUsages(getCpuUsages_cb _hidl_cb) {
- ThermalStatus status;
- hidl_vec<CpuUsage> cpuUsages;
- status.code = ThermalStatusCode::SUCCESS;
+Return<void> Thermal::getCpuUsages(getCpuUsages_cb _hidl_cb) {
+ ThermalStatus status;
+ hidl_vec<CpuUsage> cpuUsages;
+ status.code = ThermalStatusCode::SUCCESS;
- if (!mModule || !mModule->getCpuUsages) {
- ALOGI("getCpuUsages is not implemented in Thermal HAL");
- _hidl_cb(status, cpuUsages);
- return Void();
- }
-
- ssize_t size = mModule->getCpuUsages(mModule, nullptr);
- if (size >= 0) {
- cpu_usage_t *list = new cpu_usage_t[size];
- size = mModule->getCpuUsages(mModule, list);
- if (size >= 0) {
- cpuUsages.resize(size);
- for (ssize_t i = 0; i < size; ++i) {
- cpuUsages[i].name = list[i].name;
- cpuUsages[i].active = list[i].active;
- cpuUsages[i].total = list[i].total;
- cpuUsages[i].isOnline = list[i].is_online;
- }
- } else {
- status.code = ThermalStatusCode::FAILURE;
- status.debugMessage = strerror(-size);
- }
- delete[] list;
- } else {
- status.code = ThermalStatusCode::FAILURE;
- status.debugMessage = strerror(-size);
- }
+ if (!mModule || !mModule->getCpuUsages) {
+ ALOGI("getCpuUsages is not implemented in Thermal HAL");
_hidl_cb(status, cpuUsages);
return Void();
+ }
+
+ ssize_t size = mModule->getCpuUsages(mModule, nullptr);
+ if (size >= 0) {
+ std::vector<cpu_usage_t> list;
+ list.resize(size);
+ size = mModule->getCpuUsages(mModule, list.data());
+ if (size >= 0) {
+ list.resize(size);
+ cpuUsages.resize(size);
+ for (size_t i = 0; i < list.size(); ++i) {
+ cpuUsages[i].name = list[i].name;
+ cpuUsages[i].active = list[i].active;
+ cpuUsages[i].total = list[i].total;
+ cpuUsages[i].isOnline = list[i].is_online;
+ }
+ } else {
+ status.code = ThermalStatusCode::FAILURE;
+ status.debugMessage = strerror(-size);
+ }
+ }
+ if (size < 0) {
+ status.code = ThermalStatusCode::FAILURE;
+ status.debugMessage = strerror(-size);
+ }
+ _hidl_cb(status, cpuUsages);
+ return Void();
}
-Return<void> Thermal::getCoolingDevices(getCoolingDevices_cb _hidl_cb) {
- ThermalStatus status;
- status.code = ThermalStatusCode::SUCCESS;
- hidl_vec<CoolingDevice> coolingDevices;
+Return<void> Thermal::getCoolingDevices(getCoolingDevices_cb _hidl_cb) {
+ ThermalStatus status;
+ status.code = ThermalStatusCode::SUCCESS;
+ hidl_vec<CoolingDevice> coolingDevices;
- if (!mModule || !mModule->getCoolingDevices) {
- ALOGI("getCoolingDevices is not implemented in Thermal HAL.");
- _hidl_cb(status, coolingDevices);
- return Void();
- }
-
- ssize_t list_size = mModule->getCoolingDevices(mModule, nullptr, 0);
- if (list_size >= 0) {
- cooling_device_t *list = new cooling_device_t[list_size];
- ssize_t size = mModule->getCoolingDevices(mModule, list, list_size);
- if (size >= 0) {
- if (list_size > size) {
- list_size = size;
- }
- coolingDevices.resize(list_size);
- for (ssize_t i = 0; i < list_size; ++i) {
- switch (list[i].type) {
- case FAN_RPM:
- coolingDevices[i].type = CoolingType::FAN_RPM;
- break;
- default:
- ALOGE("Unknown cooling device %s type", list[i].name);
- }
- coolingDevices[i].name = list[i].name;
- coolingDevices[i].currentValue = list[i].current_value;
- }
-
- } else {
- status.code = ThermalStatusCode::FAILURE;
- status.debugMessage = strerror(-size);
- }
- delete[] list;
- } else {
- status.code = ThermalStatusCode::FAILURE;
- status.debugMessage = strerror(-list_size);
- }
+ if (!mModule || !mModule->getCoolingDevices) {
+ ALOGI("getCoolingDevices is not implemented in Thermal HAL.");
_hidl_cb(status, coolingDevices);
return Void();
+ }
+
+ ssize_t size = mModule->getCoolingDevices(mModule, nullptr, 0);
+ if (size >= 0) {
+ std::vector<cooling_device_t> list;
+ list.resize(size);
+ size = mModule->getCoolingDevices(mModule, list.data(), list.size());
+ if (size >= 0) {
+ list.resize(size);
+ coolingDevices.resize(list.size());
+ for (size_t i = 0; i < list.size(); ++i) {
+ switch (list[i].type) {
+ case FAN_RPM:
+ coolingDevices[i].type = CoolingType::FAN_RPM;
+ break;
+ default:
+ ALOGE("Unknown cooling device %s type", list[i].name);
+ }
+ coolingDevices[i].name = list[i].name;
+ coolingDevices[i].currentValue = list[i].current_value;
+ }
+ }
+ }
+ if (size < 0) {
+ status.code = ThermalStatusCode::FAILURE;
+ status.debugMessage = strerror(-size);
+ }
+ _hidl_cb(status, coolingDevices);
+ return Void();
}
IThermal* HIDL_FETCH_IThermal(const char* /* name */) {
- thermal_module_t* module;
- status_t err = hw_get_module(THERMAL_HARDWARE_MODULE_ID,
- const_cast<hw_module_t const**>(reinterpret_cast<hw_module_t**>(&module)));
- if (err || !module) {
- ALOGE("Couldn't load %s module (%s)", THERMAL_HARDWARE_MODULE_ID,
- strerror(-err));
- }
+ thermal_module_t* module;
+ status_t err = hw_get_module(THERMAL_HARDWARE_MODULE_ID,
+ const_cast<hw_module_t const**>(
+ reinterpret_cast<hw_module_t**>(&module)));
+ if (err || !module) {
+ ALOGE("Couldn't load %s module (%s)", THERMAL_HARDWARE_MODULE_ID,
+ strerror(-err));
+ }
- if (err == 0 && module->common.methods->open) {
- struct hw_device_t* device;
- err = module->common.methods->open(&module->common, THERMAL_HARDWARE_MODULE_ID, &device);
- if (err) {
- ALOGE("Couldn't open %s module (%s)", THERMAL_HARDWARE_MODULE_ID, strerror(-err));
- } else {
- return new Thermal(reinterpret_cast<thermal_module_t*>(device));
- }
+ if (err == 0 && module->common.methods->open) {
+ struct hw_device_t* device;
+ err = module->common.methods->open(&module->common,
+ THERMAL_HARDWARE_MODULE_ID, &device);
+ if (err) {
+ ALOGE("Couldn't open %s module (%s)", THERMAL_HARDWARE_MODULE_ID,
+ strerror(-err));
+ } else {
+ return new Thermal(reinterpret_cast<thermal_module_t*>(device));
}
- return new Thermal(module);
+ }
+ return new Thermal(module);
}
-} // namespace implementation
+} // namespace implementation
} // namespace V1_0
} // namespace thermal
} // namespace hardware
diff --git a/thermal/1.0/types.hal b/thermal/1.0/types.hal
index 26a0f6f..8864f43 100644
--- a/thermal/1.0/types.hal
+++ b/thermal/1.0/types.hal
@@ -26,7 +26,7 @@
SKIN = 3,
};
-enum CoolingType : int32_t {
+enum CoolingType : uint32_t {
/** Fan cooling device speed in RPM. */
FAN_RPM = 0,
};
@@ -118,9 +118,9 @@
enum ThermalStatusCode : uint32_t {
/** No errors. */
- SUCCESS,
+ SUCCESS = 0,
/** Unknown failure occured. */
- FAILURE
+ FAILURE = 1
};
/**
diff --git a/thermal/1.0/vts/Android.mk b/thermal/1.0/vts/Android.mk
new file mode 100644
index 0000000..c4655b4
--- /dev/null
+++ b/thermal/1.0/vts/Android.mk
@@ -0,0 +1,86 @@
+#
+# Copyright (C) 2016 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.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+# build VTS driver for Thermal v1.0.
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libvts_driver_hidl_thermal@1.0
+
+LOCAL_SRC_FILES := \
+ Thermal.vts \
+ types.vts \
+
+LOCAL_C_INCLUDES := \
+ android.hardware.thermal@1.0 \
+ system/core/base/include \
+ system/core/include \
+
+LOCAL_SHARED_LIBRARIES += \
+ android.hardware.thermal@1.0 \
+ libbase \
+ libutils \
+ libcutils \
+ liblog \
+ libhidlbase \
+ libhidltransport \
+ libhwbinder \
+ libprotobuf-cpp-full \
+ libvts_common \
+ libvts_datatype \
+ libvts_measurement \
+ libvts_multidevice_proto \
+
+LOCAL_STATIC_LIBRARIES := \
+
+LOCAL_PROTOC_OPTIMIZE_TYPE := full
+
+LOCAL_MULTILIB := both
+
+include $(BUILD_SHARED_LIBRARY)
+
+# build profiler for thermal.
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := libvts_profiler_hidl_thermal@1.0
+
+LOCAL_SRC_FILES := \
+ Thermal.vts \
+ types.vts \
+
+LOCAL_C_INCLUDES += \
+ test/vts/drivers/libprofiling \
+
+LOCAL_VTS_MODE := PROFILER
+
+LOCAL_SHARED_LIBRARIES := \
+ android.hardware.thermal@1.0 \
+ libbase \
+ libcutils \
+ liblog \
+ libhidlbase \
+ libhidltransport \
+ libhwbinder \
+ libprotobuf-cpp-full \
+ libvts_common \
+ libvts_multidevice_proto \
+ libvts_profiling \
+ libutils \
+
+LOCAL_PROTOC_OPTIMIZE_TYPE := full
+
+include $(BUILD_SHARED_LIBRARY)
diff --git a/thermal/1.0/vts/Thermal.vts b/thermal/1.0/vts/Thermal.vts
new file mode 100644
index 0000000..e76d943
--- /dev/null
+++ b/thermal/1.0/vts/Thermal.vts
@@ -0,0 +1,82 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "IThermal"
+
+package: "android.hardware.thermal"
+
+import: "android.hardware.thermal@1.0::types"
+
+interface: {
+ api: {
+ name: "getTemperatures"
+ return_type_hidl: {
+ type: TYPE_STRUCT
+ predefined_type: "::android::hardware::thermal::V1_0::ThermalStatus"
+ }
+ return_type_hidl: {
+ type: TYPE_VECTOR
+ vector_value: {
+ type: TYPE_STRUCT
+ predefined_type: "::android::hardware::thermal::V1_0::Temperature"
+ }
+ }
+ callflow: {
+ next: "*"
+ }
+ callflow: {
+ entry: true
+ }
+ callflow: {
+ exit: true
+ }
+ }
+
+ api: {
+ name: "getCpuUsages"
+ return_type_hidl: {
+ type: TYPE_STRUCT
+ predefined_type: "::android::hardware::thermal::V1_0::ThermalStatus"
+ }
+ return_type_hidl: {
+ type: TYPE_VECTOR
+ vector_value: {
+ type: TYPE_STRUCT
+ predefined_type: "::android::hardware::thermal::V1_0::CpuUsage"
+ }
+ }
+ callflow: {
+ next: "*"
+ }
+ callflow: {
+ entry: true
+ }
+ callflow: {
+ exit: true
+ }
+ }
+
+ api: {
+ name: "getCoolingDevices"
+ return_type_hidl: {
+ type: TYPE_STRUCT
+ predefined_type: "::android::hardware::thermal::V1_0::ThermalStatus"
+ }
+ return_type_hidl: {
+ type: TYPE_VECTOR
+ vector_value: {
+ type: TYPE_STRUCT
+ predefined_type: "::android::hardware::thermal::V1_0::CoolingDevice"
+ }
+ }
+ callflow: {
+ next: "*"
+ }
+ callflow: {
+ entry: true
+ }
+ callflow: {
+ exit: true
+ }
+ }
+
+}
diff --git a/thermal/1.0/vts/functional/Android.bp b/thermal/1.0/vts/functional/Android.bp
new file mode 100644
index 0000000..fedb760
--- /dev/null
+++ b/thermal/1.0/vts/functional/Android.bp
@@ -0,0 +1,38 @@
+//
+// Copyright (C) 2016 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_test {
+ name: "thermal_hidl_hal_test",
+ gtest: true,
+ srcs: ["thermal_hidl_hal_test.cpp"],
+ shared_libs: [
+ "libbase",
+ "liblog",
+ "libcutils",
+ "libhidlbase",
+ "libhidltransport",
+ "libhwbinder",
+ "libnativehelper",
+ "libutils",
+ "android.hardware.thermal@1.0",
+ ],
+ static_libs: ["libgtest"],
+ cflags: [
+ "-O0",
+ "-g",
+ ],
+}
+
diff --git a/thermal/1.0/vts/functional/thermal_hidl_hal_test.cpp b/thermal/1.0/vts/functional/thermal_hidl_hal_test.cpp
new file mode 100644
index 0000000..e3b00ab
--- /dev/null
+++ b/thermal/1.0/vts/functional/thermal_hidl_hal_test.cpp
@@ -0,0 +1,219 @@
+/*
+ * Copyright (C) 2016 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 <algorithm>
+#include <cmath>
+#include <string>
+#include <vector>
+
+#define LOG_TAG "thermal_hidl_hal_test"
+
+#include <android-base/logging.h>
+#include <android/hardware/thermal/1.0/IThermal.h>
+#include <android/hardware/thermal/1.0/types.h>
+#include <gtest/gtest.h>
+#include <unistd.h>
+
+using ::android::hardware::hidl_string;
+using ::android::hardware::hidl_vec;
+using ::android::hardware::thermal::V1_0::CoolingDevice;
+using ::android::hardware::thermal::V1_0::CpuUsage;
+using ::android::hardware::thermal::V1_0::IThermal;
+using ::android::hardware::thermal::V1_0::Temperature;
+using ::android::hardware::thermal::V1_0::TemperatureType;
+using ::android::hardware::thermal::V1_0::ThermalStatus;
+using ::android::hardware::thermal::V1_0::ThermalStatusCode;
+using ::android::hardware::Return;
+using ::android::hardware::Void;
+using ::android::sp;
+
+#define THERMAL_SERVICE_NAME "thermal"
+#define MONITORING_OPERATION_NUMBER 10
+
+#define UNDEFINED_TEMPERATURE (-FLT_MAX)
+
+#define MAX_DEVICE_TEMPERATURE 200
+#define MAX_FAN_SPEED 20000
+
+// The main test class for THERMAL HIDL HAL.
+class ThermalHidlTest : public ::testing::Test {
+ public:
+ virtual void SetUp() override {
+ thermal_ = IThermal::getService(THERMAL_SERVICE_NAME, false);
+ ASSERT_NE(thermal_, nullptr);
+ baseSize_ = 0;
+ names_.clear();
+ }
+
+ virtual void TearDown() override {}
+
+ protected:
+ // Check validity of temperatures returned by Thremal HAL.
+ void checkTemperatures(const hidl_vec<Temperature> temperatures) {
+ size_t size = temperatures.size();
+ EXPECT_LE(baseSize_, size);
+
+ for (size_t i = 0; i < size; ++i) {
+ checkDeviceTemperature(temperatures[i]);
+ if (i < baseSize_) {
+ EXPECT_EQ(names_[i], temperatures[i].name.c_str());
+ } else {
+ // Names must be unique.
+ EXPECT_EQ(names_.end(), std::find(names_.begin(), names_.end(),
+ temperatures[i].name.c_str()));
+ names_.push_back(temperatures[i].name);
+ }
+ }
+ baseSize_ = size;
+ }
+
+ // Check validity of CPU usages returned by Thermal HAL.
+ void checkCpuUsages(const hidl_vec<CpuUsage>& cpuUsages) {
+ size_t size = cpuUsages.size();
+ // A number of CPU's does not change.
+ if (baseSize_ != 0) EXPECT_EQ(baseSize_, size);
+
+ for (size_t i = 0; i < size; ++i) {
+ checkCpuUsage(cpuUsages[i]);
+ if (i < baseSize_) {
+ EXPECT_EQ(names_[i], cpuUsages[i].name.c_str());
+ } else {
+ // Names must be unique.
+ EXPECT_EQ(names_.end(), std::find(names_.begin(), names_.end(),
+ cpuUsages[i].name.c_str()));
+ names_.push_back(cpuUsages[i].name);
+ }
+ }
+ baseSize_ = size;
+ }
+
+ // Check validity of cooling devices information returned by Thermal HAL.
+ void checkCoolingDevices(const hidl_vec<CoolingDevice> coolingDevices) {
+ size_t size = coolingDevices.size();
+ EXPECT_LE(baseSize_, size);
+
+ for (size_t i = 0; i < size; ++i) {
+ checkCoolingDevice(coolingDevices[i]);
+ if (i < baseSize_) {
+ EXPECT_EQ(names_[i], coolingDevices[i].name.c_str());
+ } else {
+ // Names must be unique.
+ EXPECT_EQ(names_.end(), std::find(names_.begin(), names_.end(),
+ coolingDevices[i].name.c_str()));
+ names_.push_back(coolingDevices[i].name);
+ }
+ }
+ baseSize_ = size;
+ }
+
+ sp<IThermal> thermal_;
+
+ private:
+ // Check validity of temperature returned by Thermal HAL.
+ void checkDeviceTemperature(const Temperature& temperature) {
+ // .currentValue of known type is in Celsius and must be reasonable.
+ EXPECT_TRUE(temperature.type == TemperatureType::UNKNOWN ||
+ std::abs(temperature.currentValue) < MAX_DEVICE_TEMPERATURE ||
+ temperature.currentValue == UNDEFINED_TEMPERATURE);
+
+ // .name must not be empty.
+ EXPECT_LT(0u, temperature.name.size());
+
+ // .currentValue must not exceed .shutdwonThreshold if defined.
+ EXPECT_TRUE(temperature.currentValue < temperature.shutdownThreshold ||
+ temperature.currentValue == UNDEFINED_TEMPERATURE ||
+ temperature.shutdownThreshold == UNDEFINED_TEMPERATURE);
+
+ // .throttlingThreshold must not exceed .shutdownThreshold if defined.
+ EXPECT_TRUE(temperature.throttlingThreshold <
+ temperature.shutdownThreshold ||
+ temperature.throttlingThreshold == UNDEFINED_TEMPERATURE ||
+ temperature.shutdownThreshold == UNDEFINED_TEMPERATURE);
+ }
+
+ // Check validity of CPU usage returned by Thermal HAL.
+ void checkCpuUsage(const CpuUsage& cpuUsage) {
+ // .active must be less than .total if CPU is online.
+ EXPECT_TRUE(!cpuUsage.isOnline ||
+ (cpuUsage.active >= 0 && cpuUsage.total >= 0 &&
+ cpuUsage.total >= cpuUsage.active));
+
+ // .name must be not empty.
+ EXPECT_LT(0u, cpuUsage.name.size());
+ }
+
+ // Check validity of a cooling device information returned by Thermal HAL.
+ void checkCoolingDevice(const CoolingDevice& coolingDevice) {
+ EXPECT_LE(0, coolingDevice.currentValue);
+ EXPECT_GT(MAX_FAN_SPEED, coolingDevice.currentValue);
+ EXPECT_LT(0u, coolingDevice.name.size());
+ }
+
+ size_t baseSize_;
+ std::vector<hidl_string> names_;
+};
+
+// Sanity test for Thermal::getTemperatures().
+TEST_F(ThermalHidlTest, TemperatureTest) {
+ hidl_vec<Temperature> passed;
+ for (size_t i = 0; i < MONITORING_OPERATION_NUMBER; ++i) {
+ thermal_->getTemperatures(
+ [&passed](ThermalStatus status, hidl_vec<Temperature> temperatures) {
+ EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code);
+ passed = temperatures;
+ });
+
+ checkTemperatures(passed);
+ sleep(1);
+ }
+}
+
+// Sanity test for Thermal::getCpuUsages().
+TEST_F(ThermalHidlTest, CpuUsageTest) {
+ hidl_vec<CpuUsage> passed;
+ for (size_t i = 0; i < MONITORING_OPERATION_NUMBER; ++i) {
+ thermal_->getCpuUsages(
+ [&passed](ThermalStatus status, hidl_vec<CpuUsage> cpuUsages) {
+ EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code);
+ passed = cpuUsages;
+ });
+
+ checkCpuUsages(passed);
+ sleep(1);
+ }
+}
+
+// Sanity test for Thermal::getCoolingDevices().
+TEST_F(ThermalHidlTest, CoolingDeviceTest) {
+ hidl_vec<CoolingDevice> passed;
+ for (size_t i = 0; i < MONITORING_OPERATION_NUMBER; ++i) {
+ thermal_->getCoolingDevices([&passed](
+ ThermalStatus status, hidl_vec<CoolingDevice> coolingDevices) {
+ EXPECT_EQ(ThermalStatusCode::SUCCESS, status.code);
+ passed = coolingDevices;
+ });
+
+ checkCoolingDevices(passed);
+ sleep(1);
+ }
+}
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ int status = RUN_ALL_TESTS();
+ ALOGI("Test result = %d", status);
+ return status;
+}
diff --git a/thermal/1.0/vts/types.vts b/thermal/1.0/vts/types.vts
new file mode 100644
index 0000000..1e60f48
--- /dev/null
+++ b/thermal/1.0/vts/types.vts
@@ -0,0 +1,157 @@
+component_class: HAL_HIDL
+component_type_version: 1.0
+component_name: "types"
+
+package: "android.hardware.thermal"
+
+
+attribute: {
+ name: "::android::hardware::thermal::V1_0::TemperatureType"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "uint32_t"
+
+ enumerator: "UNKNOWN"
+ scalar_value: {
+ uint32_t: 1000
+ }
+ enumerator: "CPU"
+ scalar_value: {
+ uint32_t: 0
+ }
+ enumerator: "GPU"
+ scalar_value: {
+ uint32_t: 1
+ }
+ enumerator: "BATTERY"
+ scalar_value: {
+ uint32_t: 2
+ }
+ enumerator: "SKIN"
+ scalar_value: {
+ uint32_t: 3
+ }
+ }
+}
+
+attribute: {
+ name: "::android::hardware::thermal::V1_0::CoolingType"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "uint32_t"
+
+ enumerator: "FAN_RPM"
+ scalar_value: {
+ uint32_t: 0
+ }
+ }
+}
+
+attribute: {
+ name: "::android::hardware::thermal::V1_0::Temperature"
+ type: TYPE_STRUCT
+ struct_value: {
+ name: "type"
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::thermal::V1_0::TemperatureType"
+ }
+ struct_value: {
+ name: "name"
+ type: TYPE_STRING
+ }
+ struct_value: {
+ name: "currentValue"
+ type: TYPE_SCALAR
+ scalar_type: "float_t"
+ }
+ struct_value: {
+ name: "throttlingThreshold"
+ type: TYPE_SCALAR
+ scalar_type: "float_t"
+ }
+ struct_value: {
+ name: "shutdownThreshold"
+ type: TYPE_SCALAR
+ scalar_type: "float_t"
+ }
+ struct_value: {
+ name: "vrThrottlingThreshold"
+ type: TYPE_SCALAR
+ scalar_type: "float_t"
+ }
+}
+
+attribute: {
+ name: "::android::hardware::thermal::V1_0::CoolingDevice"
+ type: TYPE_STRUCT
+ struct_value: {
+ name: "type"
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::thermal::V1_0::CoolingType"
+ }
+ struct_value: {
+ name: "name"
+ type: TYPE_STRING
+ }
+ struct_value: {
+ name: "currentValue"
+ type: TYPE_SCALAR
+ scalar_type: "float_t"
+ }
+}
+
+attribute: {
+ name: "::android::hardware::thermal::V1_0::CpuUsage"
+ type: TYPE_STRUCT
+ struct_value: {
+ name: "name"
+ type: TYPE_STRING
+ }
+ struct_value: {
+ name: "active"
+ type: TYPE_SCALAR
+ scalar_type: "uint64_t"
+ }
+ struct_value: {
+ name: "total"
+ type: TYPE_SCALAR
+ scalar_type: "uint64_t"
+ }
+ struct_value: {
+ name: "isOnline"
+ type: TYPE_SCALAR
+ scalar_type: "bool_t"
+ }
+}
+
+attribute: {
+ name: "::android::hardware::thermal::V1_0::ThermalStatusCode"
+ type: TYPE_ENUM
+ enum_value: {
+ scalar_type: "uint32_t"
+
+ enumerator: "SUCCESS"
+ scalar_value: {
+ uint32_t: 0
+ }
+ enumerator: "FAILURE"
+ scalar_value: {
+ uint32_t: 1
+ }
+ }
+}
+
+attribute: {
+ name: "::android::hardware::thermal::V1_0::ThermalStatus"
+ type: TYPE_STRUCT
+ struct_value: {
+ name: "code"
+ type: TYPE_ENUM
+ predefined_type: "::android::hardware::thermal::V1_0::ThermalStatusCode"
+ }
+ struct_value: {
+ name: "debugMessage"
+ type: TYPE_STRING
+ }
+}
+
diff --git a/thermal/Android.bp b/thermal/Android.bp
index ba90f2c..ed19a37 100644
--- a/thermal/Android.bp
+++ b/thermal/Android.bp
@@ -2,4 +2,5 @@
subdirs = [
"1.0",
"1.0/default",
+ "1.0/vts/functional",
]
diff --git a/tv/cec/1.0/Android.bp b/tv/cec/1.0/Android.bp
index bb1ae82..02a4247 100644
--- a/tv/cec/1.0/Android.bp
+++ b/tv/cec/1.0/Android.bp
@@ -46,13 +46,15 @@
generated_headers: ["android.hardware.tv.cec@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.tv.cec@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/tv/cec/1.0/default/Android.mk b/tv/cec/1.0/default/Android.mk
index 3971f6c..492fc8c 100644
--- a/tv/cec/1.0/default/Android.mk
+++ b/tv/cec/1.0/default/Android.mk
@@ -7,7 +7,8 @@
HdmiCec.cpp
LOCAL_SHARED_LIBRARIES := \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
liblog \
libbase \
@@ -36,7 +37,8 @@
LOCAL_SHARED_LIBRARIES += \
libhwbinder \
- libhidl \
+ libhidlbase \
+ libhidltransport \
android.hardware.tv.cec@1.0 \
include $(BUILD_EXECUTABLE)
diff --git a/tv/cec/1.0/default/HdmiCec.h b/tv/cec/1.0/default/HdmiCec.h
index 49237d5..a41a5f0 100644
--- a/tv/cec/1.0/default/HdmiCec.h
+++ b/tv/cec/1.0/default/HdmiCec.h
@@ -63,7 +63,7 @@
Return<void> enableAudioReturnChannel(int32_t portId, bool enable) override;
Return<bool> isConnected(int32_t portId) override;
- static void eventCallback(const hdmi_event_t* event, void* arg) {
+ static void eventCallback(const hdmi_event_t* event, void* /* arg */) {
if (mCallback != nullptr && event != nullptr) {
if (event->type == HDMI_EVENT_CEC_MESSAGE) {
size_t length = std::min(event->cec.length,
diff --git a/tv/input/1.0/Android.bp b/tv/input/1.0/Android.bp
index 512634b..7f9bb7c 100644
--- a/tv/input/1.0/Android.bp
+++ b/tv/input/1.0/Android.bp
@@ -46,14 +46,16 @@
generated_headers: ["android.hardware.tv.input@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.tv.input@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
"android.hardware.audio.common@2.0",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"android.hardware.audio.common@2.0",
diff --git a/tv/input/1.0/default/Android.mk b/tv/input/1.0/default/Android.mk
index 520b0bf..9728015 100644
--- a/tv/input/1.0/default/Android.mk
+++ b/tv/input/1.0/default/Android.mk
@@ -10,7 +10,8 @@
libbase \
liblog \
libhardware \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libutils \
android.hardware.audio.common@2.0 \
@@ -36,7 +37,8 @@
LOCAL_SHARED_LIBRARIES += \
libhwbinder \
- libhidl \
+ libhidlbase \
+ libhidltransport \
android.hardware.audio.common@2.0 \
android.hardware.tv.input@1.0 \
diff --git a/vehicle/2.0/Android.bp b/vehicle/2.0/Android.bp
index d51fe25..09025b9 100644
--- a/vehicle/2.0/Android.bp
+++ b/vehicle/2.0/Android.bp
@@ -46,13 +46,15 @@
generated_headers: ["android.hardware.vehicle@2.0_genc++_headers"],
export_generated_headers: ["android.hardware.vehicle@2.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/vehicle/2.0/IVehicleCallback.hal b/vehicle/2.0/IVehicleCallback.hal
index 504f782..e7e05bf 100644
--- a/vehicle/2.0/IVehicleCallback.hal
+++ b/vehicle/2.0/IVehicleCallback.hal
@@ -32,7 +32,7 @@
oneway onPropertyEvent(vec<VehiclePropValue> propValues);
/*
- * This method gets called if the client was susbscribed to a property using
+ * This method gets called if the client was subscribed to a property using
* SubscribeFlags::SET_CALL flag and IVehicle#set(...) method was called.
*
* These events must be delivered to subscriber immediately without any
diff --git a/vehicle/2.0/default/Android.mk b/vehicle/2.0/default/Android.mk
index ccf18b6..46733e5 100644
--- a/vehicle/2.0/default/Android.mk
+++ b/vehicle/2.0/default/Android.mk
@@ -28,7 +28,8 @@
LOCAL_SHARED_LIBRARIES := \
liblog \
libbinder \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libutils \
$(module_prefix) \
@@ -47,7 +48,8 @@
LOCAL_SHARED_LIBRARIES := \
liblog \
libbinder \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libutils \
$(module_prefix) \
@@ -73,7 +75,8 @@
LOCAL_SHARED_LIBRARIES := \
liblog \
libbinder \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libutils \
$(module_prefix) \
@@ -102,7 +105,8 @@
LOCAL_SHARED_LIBRARIES := \
liblog \
libbinder \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libutils \
android.hardware.vehicle@2.0
diff --git a/vehicle/2.0/default/android.hardware.vehicle@2.0-service.rc b/vehicle/2.0/default/android.hardware.vehicle@2.0-service.rc
index c4a8f83..7c96da6 100644
--- a/vehicle/2.0/default/android.hardware.vehicle@2.0-service.rc
+++ b/vehicle/2.0/default/android.hardware.vehicle@2.0-service.rc
@@ -1,4 +1,4 @@
service vehicle-hal-2.0 /system/bin/hw/android.hardware.vehicle@2.0-service
class hal
user system
- group system readproc
+ group system
diff --git a/vehicle/2.0/default/impl/DefaultConfig.h b/vehicle/2.0/default/impl/DefaultConfig.h
index e620c28..7985737 100644
--- a/vehicle/2.0/default/impl/DefaultConfig.h
+++ b/vehicle/2.0/default/impl/DefaultConfig.h
@@ -18,6 +18,7 @@
#define android_hardware_vehicle_V2_0_impl_DefaultConfig_H_
#include <android/hardware/vehicle/2.0/IVehicle.h>
+#include <vehicle_hal_manager/VehicleUtils.h>
namespace android {
namespace hardware {
@@ -35,23 +36,102 @@
},
{
+ .prop = VehicleProperty::HVAC_POWER_ON,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .permissionModel = VehiclePermissionModel::NO_RESTRICTION,
+ .supportedAreas = toInt(VehicleAreaZone::ROW_1)
+ },
+
+ {
+ .prop = VehicleProperty::HVAC_DEFROSTER,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .permissionModel = VehiclePermissionModel::NO_RESTRICTION,
+ .supportedAreas =
+ VehicleAreaWindow::FRONT_WINDSHIELD
+ | VehicleAreaWindow::REAR_WINDSHIELD
+ },
+
+ {
+ .prop = VehicleProperty::HVAC_RECIRC_ON,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .permissionModel = VehiclePermissionModel::NO_RESTRICTION,
+ .supportedAreas = toInt(VehicleAreaZone::ROW_1)
+ },
+
+ {
+ .prop = VehicleProperty::HVAC_AC_ON,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .permissionModel = VehiclePermissionModel::NO_RESTRICTION,
+ .supportedAreas = toInt(VehicleAreaZone::ROW_1)
+ },
+
+ {
+ .prop = VehicleProperty::HVAC_AUTO_ON,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .permissionModel = VehiclePermissionModel::NO_RESTRICTION,
+ .supportedAreas = toInt(VehicleAreaZone::ROW_1)
+ },
+
+ {
.prop = VehicleProperty::HVAC_FAN_SPEED,
.access = VehiclePropertyAccess::READ_WRITE,
.changeMode = VehiclePropertyChangeMode::ON_CHANGE,
.permissionModel = VehiclePermissionModel::NO_RESTRICTION,
- .supportedAreas = static_cast<int32_t>(
- VehicleAreaZone::ROW_1_LEFT | VehicleAreaZone::ROW_1_RIGHT),
+ .supportedAreas = toInt(VehicleAreaZone::ROW_1),
.areaConfigs = init_hidl_vec({
- VehicleAreaConfig {
- .areaId = toInt(VehicleAreaZone::ROW_2_LEFT),
- .minInt32Value = 1,
- .maxInt32Value = 7},
- VehicleAreaConfig {
- .areaId = toInt(VehicleAreaZone::ROW_1_RIGHT),
- .minInt32Value = 1,
- .maxInt32Value = 5,
- }
- }),
+ VehicleAreaConfig {
+ .areaId = toInt(VehicleAreaZone::ROW_1),
+ .minInt32Value = 1,
+ .maxInt32Value = 7
+ }})
+ },
+
+ {
+ .prop = VehicleProperty::HVAC_FAN_DIRECTION,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .permissionModel = VehiclePermissionModel::NO_RESTRICTION,
+ .supportedAreas = toInt(VehicleAreaZone::ROW_1),
+ },
+
+ {
+ .prop = VehicleProperty::HVAC_TEMPERATURE_SET,
+ .access = VehiclePropertyAccess::READ_WRITE,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .permissionModel = VehiclePermissionModel::NO_RESTRICTION,
+ .supportedAreas =
+ VehicleAreaZone::ROW_1_LEFT
+ | VehicleAreaZone::ROW_1_RIGHT,
+ .areaConfigs = init_hidl_vec({
+ VehicleAreaConfig {
+ .areaId = toInt(VehicleAreaZone::ROW_1_LEFT),
+ .minFloatValue = 16,
+ .maxFloatValue = 32,
+ },
+ VehicleAreaConfig {
+ .areaId = toInt(VehicleAreaZone::ROW_1_RIGHT),
+ .minFloatValue = 16,
+ .maxFloatValue = 32,
+ }})
+ },
+
+ {
+ .prop = VehicleProperty::NIGHT_MODE,
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .permissionModel = VehiclePermissionModel::NO_RESTRICTION,
+ },
+
+ {
+ .prop = VehicleProperty::GEAR_SELECTION,
+ .access = VehiclePropertyAccess::READ,
+ .changeMode = VehiclePropertyChangeMode::ON_CHANGE,
+ .permissionModel = VehiclePermissionModel::NO_RESTRICTION,
},
{
diff --git a/vehicle/2.0/default/impl/DefaultVehicleHal.cpp b/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
index 24d438d..c56248b 100644
--- a/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
+++ b/vehicle/2.0/default/impl/DefaultVehicleHal.cpp
@@ -30,23 +30,56 @@
VehiclePropValuePtr v;
VehicleProperty property = requestedPropValue.prop;
int32_t areaId = requestedPropValue.areaId;
+ auto& pool = *getValuePool();
switch (property) {
case VehicleProperty::INFO_MAKE:
- v = getValuePool()->obtainString("Default Car");
+ v = pool.obtainString("Default Car");
break;
case VehicleProperty::HVAC_FAN_SPEED:
- int32_t value;
- *outStatus = getHvacFanSpeed(areaId, &value);
+ v = pool.obtainInt32(mFanSpeed);
+ break;
+ case VehicleProperty::HVAC_POWER_ON:
+ v = pool.obtainBoolean(mHvacPowerOn);
+ break;
+ case VehicleProperty::HVAC_RECIRC_ON:
+ v = pool.obtainBoolean(mHvacRecircOn);
+ break;
+ case VehicleProperty::HVAC_AC_ON:
+ v = pool.obtainBoolean(mHvacAcOn);
+ break;
+ case VehicleProperty::HVAC_AUTO_ON:
+ v = pool.obtainBoolean(mHvacAutoOn);
+ break;
+ case VehicleProperty::HVAC_FAN_DIRECTION:
+ v = pool.obtainInt32(toInt(mFanDirection));
+ break;
+ case VehicleProperty::HVAC_DEFROSTER:
+ bool defroster;
+ *outStatus = getHvacDefroster(areaId, &defroster);
if (StatusCode::OK == *outStatus) {
- v = getValuePool()->obtainInt32(value);
+ v = pool.obtainBoolean(defroster);
+ }
+ break;
+ case VehicleProperty::HVAC_TEMPERATURE_SET:
+ float value;
+ *outStatus = getHvacTemperature(requestedPropValue.areaId,
+ &value);
+ if (StatusCode::OK == *outStatus) {
+ v = pool.obtainFloat(value);
}
break;
case VehicleProperty::INFO_FUEL_CAPACITY:
- v = getValuePool()->obtainFloat(0.75f);
+ v = pool.obtainFloat(0.75f);
break;
case VehicleProperty::DISPLAY_BRIGHTNESS:
- v = getValuePool()->obtainInt32(brightness);
+ v = pool.obtainInt32(mBrightness);
+ break;
+ case VehicleProperty::NIGHT_MODE:
+ v = pool.obtainBoolean(false);
+ break;
+ case VehicleProperty::GEAR_SELECTION:
+ v = pool.obtainInt32(toInt(VehicleGear::GEAR_PARK));
break;
default:
*outStatus = StatusCode::INVALID_ARG;
@@ -63,16 +96,38 @@
StatusCode DefaultVehicleHal::set(const VehiclePropValue& propValue) {
auto property = propValue.prop;
+ const auto& v = propValue.value;
StatusCode status = StatusCode::OK;
switch (property) {
+ case VehicleProperty::HVAC_POWER_ON:
+ mHvacPowerOn = v.int32Values[0] == 1;
+ break;
+ case VehicleProperty::HVAC_RECIRC_ON:
+ mHvacRecircOn = v.int32Values[0] == 1;
+ break;
+ case VehicleProperty::HVAC_AC_ON:
+ mHvacAcOn = v.int32Values[0] == 1;
+ break;
+ case VehicleProperty::HVAC_AUTO_ON:
+ mHvacAutoOn = v.int32Values[0] == 1;
+ break;
+ case VehicleProperty::HVAC_DEFROSTER:
+ status = setHvacDefroster(propValue.areaId, v.int32Values[0] == 1);
+ break;
+ case VehicleProperty::HVAC_FAN_DIRECTION:
+ mFanDirection =
+ static_cast<VehicleHvacFanDirection>(v.int32Values[0]);
+ break;
case VehicleProperty::HVAC_FAN_SPEED:
- status = setHvacFanSpeed(propValue.areaId,
- propValue.value.int32Values[0]);
+ mFanSpeed = v.int32Values[0];
+ break;
+ case VehicleProperty::HVAC_TEMPERATURE_SET:
+ status = setHvacTemperature(propValue.areaId, v.floatValues[0]);
break;
case VehicleProperty::DISPLAY_BRIGHTNESS:
- brightness = propValue.value.int32Values[0];
+ mBrightness = v.int32Values[0];
break;
default:
status = StatusCode::INVALID_ARG;
@@ -81,23 +136,52 @@
return status;
}
-StatusCode DefaultVehicleHal::getHvacFanSpeed(int32_t areaId,
- int32_t* outValue) {
+StatusCode DefaultVehicleHal::getHvacTemperature(int32_t areaId,
+ float* outValue) {
if (areaId == toInt(VehicleAreaZone::ROW_1_LEFT)) {
- *outValue = fanSpeedRow1Left;
- } else if (areaId == toInt(VehicleAreaZone::ROW_2_RIGHT)) {
- *outValue = fanSpeedRow1Right;
+ *outValue = mRow1LeftHvacTemperatureSet;
+ } else if (areaId == toInt(VehicleAreaZone::ROW_1_RIGHT)) {
+ *outValue = mRow1RightHvacTemperatureSet;
} else {
return StatusCode::INVALID_ARG;
}
return StatusCode::OK;
}
-StatusCode DefaultVehicleHal::setHvacFanSpeed(int32_t areaId, int32_t value) {
+StatusCode DefaultVehicleHal::setHvacTemperature(
+ int32_t areaId, float value) {
if (areaId == toInt(VehicleAreaZone::ROW_1_LEFT)) {
- fanSpeedRow1Left = value;
- } else if (areaId == toInt(VehicleAreaZone::ROW_2_RIGHT)) {
- fanSpeedRow1Right = value;
+ mRow1LeftHvacTemperatureSet = value;
+ } else if (areaId == toInt(VehicleAreaZone::ROW_1_RIGHT)) {
+ mRow1RightHvacTemperatureSet = value;
+ } else {
+ return StatusCode::INVALID_ARG;
+ }
+ return StatusCode::OK;
+}
+
+StatusCode DefaultVehicleHal::getHvacDefroster(int32_t areaId,
+ bool* outValue) {
+ ALOGI("Getting Hvac defroster for area: 0x%x", areaId);
+
+ if (areaId == toInt(VehicleAreaWindow::FRONT_WINDSHIELD)) {
+ *outValue = mFrontDefroster;
+ } else if (areaId == toInt(VehicleAreaWindow::REAR_WINDSHIELD)) {
+ *outValue = mRearDefroster;
+ } else {
+ ALOGE("Unable to get hvac defroster for area: 0x%x", areaId);
+ return StatusCode::INVALID_ARG;
+ }
+
+ ALOGI("Getting Hvac defroster for area: 0x%x, OK", areaId);
+ return StatusCode::OK;
+}
+
+StatusCode DefaultVehicleHal::setHvacDefroster(int32_t areaId, bool value) {
+ if (areaId == toInt(VehicleAreaWindow::FRONT_WINDSHIELD)) {
+ mFrontDefroster = value;
+ } else if (areaId == toInt(VehicleAreaWindow::REAR_WINDSHIELD)) {
+ mRearDefroster = value;
} else {
return StatusCode::INVALID_ARG;
}
diff --git a/vehicle/2.0/default/impl/DefaultVehicleHal.h b/vehicle/2.0/default/impl/DefaultVehicleHal.h
index 4a81da3..231f2b2 100644
--- a/vehicle/2.0/default/impl/DefaultVehicleHal.h
+++ b/vehicle/2.0/default/impl/DefaultVehicleHal.h
@@ -53,12 +53,22 @@
}
private:
- StatusCode getHvacFanSpeed(int32_t areaId, int32_t* outValue);
- StatusCode setHvacFanSpeed(int32_t areaId, int32_t value);
+ StatusCode getHvacTemperature(int32_t areaId, float* outValue);
+ StatusCode setHvacTemperature(int32_t areaId, float value);
+ StatusCode getHvacDefroster(int32_t areaId, bool* outValue);
+ StatusCode setHvacDefroster(int32_t areaId, bool value);
private:
- int32_t fanSpeedRow1Left = 3;
- int32_t fanSpeedRow1Right = 5;
- int32_t brightness = 7;
+ int32_t mFanSpeed = 3;
+ int32_t mBrightness = 7;
+ float mRow1LeftHvacTemperatureSet = 16;
+ float mRow1RightHvacTemperatureSet = 22;
+ bool mFrontDefroster = false;
+ bool mRearDefroster = false;
+ bool mHvacPowerOn = true;
+ bool mHvacRecircOn = true;
+ bool mHvacAcOn = true;
+ bool mHvacAutoOn = true;
+ VehicleHvacFanDirection mFanDirection = VehicleHvacFanDirection::FACE;
};
} // impl
diff --git a/vibrator/1.0/Android.bp b/vibrator/1.0/Android.bp
index faf4341..bd88241 100644
--- a/vibrator/1.0/Android.bp
+++ b/vibrator/1.0/Android.bp
@@ -38,13 +38,15 @@
generated_headers: ["android.hardware.vibrator@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.vibrator@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/vibrator/1.0/default/Android.bp b/vibrator/1.0/default/Android.bp
index 4dd00dd..5e488e6 100644
--- a/vibrator/1.0/default/Android.bp
+++ b/vibrator/1.0/default/Android.bp
@@ -17,7 +17,8 @@
relative_install_path: "hw",
srcs: ["Vibrator.cpp"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"liblog",
"libhwbinder",
"libutils",
diff --git a/vibrator/1.0/default/Android.mk b/vibrator/1.0/default/Android.mk
index 2b168bb..5ba334b 100644
--- a/vibrator/1.0/default/Android.mk
+++ b/vibrator/1.0/default/Android.mk
@@ -24,7 +24,8 @@
service.cpp \
LOCAL_SHARED_LIBRARIES := \
- libhidl \
+ libhidlbase \
+ libhidltransport \
liblog \
libhwbinder \
libutils \
diff --git a/vibrator/1.0/vts/Android.mk b/vibrator/1.0/vts/Android.mk
index bdecb85..2f612d5 100644
--- a/vibrator/1.0/vts/Android.mk
+++ b/vibrator/1.0/vts/Android.mk
@@ -25,18 +25,14 @@
Vibrator.vts \
types.vts \
-LOCAL_C_INCLUDES := \
- android.hardware.vibrator@1.0 \
- system/core/base/include \
- system/core/include \
-
LOCAL_SHARED_LIBRARIES += \
android.hardware.vibrator@1.0 \
libbase \
libutils \
libcutils \
liblog \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libprotobuf-cpp-full \
libvts_common \
@@ -44,10 +40,6 @@
libvts_measurement \
libvts_multidevice_proto \
-LOCAL_CFLAGS += -DENABLE_TREBLE
-
-LOCAL_STATIC_LIBRARIES := \
-
LOCAL_PROTOC_OPTIMIZE_TYPE := full
LOCAL_MULTILIB := both
@@ -73,7 +65,8 @@
libbase \
libcutils \
liblog \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libprotobuf-cpp-full \
libvts_common \
diff --git a/vr/1.0/Android.bp b/vr/1.0/Android.bp
index fc4619f..5cbd333 100644
--- a/vr/1.0/Android.bp
+++ b/vr/1.0/Android.bp
@@ -34,13 +34,15 @@
generated_headers: ["android.hardware.vr@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.vr@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/vr/1.0/default/Android.bp b/vr/1.0/default/Android.bp
index 09b0002..d100570 100644
--- a/vr/1.0/default/Android.bp
+++ b/vr/1.0/default/Android.bp
@@ -10,7 +10,8 @@
"libbase",
"libcutils",
"libutils",
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"android.hardware.vr@1.0",
],
}
diff --git a/vr/1.0/vts/Android.mk b/vr/1.0/vts/Android.mk
index 3c45652..12f0175 100644
--- a/vr/1.0/vts/Android.mk
+++ b/vr/1.0/vts/Android.mk
@@ -24,18 +24,14 @@
LOCAL_SRC_FILES := \
Vr.vts \
-LOCAL_C_INCLUDES := \
- android.hardware.vr@1.0 \
- system/core/base/include \
- system/core/include \
-
LOCAL_SHARED_LIBRARIES += \
android.hardware.vr@1.0 \
libbase \
libutils \
libcutils \
liblog \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libprotobuf-cpp-full \
libvts_common \
@@ -43,10 +39,6 @@
libvts_measurement \
libvts_multidevice_proto \
-LOCAL_CFLAGS += -DENABLE_TREBLE
-
-LOCAL_STATIC_LIBRARIES := \
-
LOCAL_PROTOC_OPTIMIZE_TYPE := full
LOCAL_MULTILIB := both
@@ -71,7 +63,8 @@
libbase \
libcutils \
liblog \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
libprotobuf-cpp-full \
libvts_common \
diff --git a/wifi/1.0/Android.bp b/wifi/1.0/Android.bp
index da9210c..d353e4b 100644
--- a/wifi/1.0/Android.bp
+++ b/wifi/1.0/Android.bp
@@ -134,13 +134,15 @@
generated_headers: ["android.hardware.wifi@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.wifi@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],
diff --git a/wifi/1.0/default/Android.mk b/wifi/1.0/default/Android.mk
index e84124e..646613b 100644
--- a/wifi/1.0/default/Android.mk
+++ b/wifi/1.0/default/Android.mk
@@ -32,7 +32,8 @@
android.hardware.wifi@1.0 \
libbase \
libcutils \
- libhidl \
+ libhidlbase \
+ libhidltransport \
libhwbinder \
liblog \
libnl \
diff --git a/wifi/1.0/default/wifi.cpp b/wifi/1.0/default/wifi.cpp
index fd2cb9c..3475c46 100644
--- a/wifi/1.0/default/wifi.cpp
+++ b/wifi/1.0/default/wifi.cpp
@@ -33,7 +33,8 @@
using hidl_return_util::validateAndCall;
Wifi::Wifi()
- : legacy_hal_(new WifiLegacyHal()), run_state_(RunState::STOPPED) {}
+ : legacy_hal_(new legacy_hal::WifiLegacyHal()),
+ run_state_(RunState::STOPPED) {}
bool Wifi::isValid() {
// This object is always valid.
diff --git a/wifi/1.0/default/wifi.h b/wifi/1.0/default/wifi.h
index c682116..7872303 100644
--- a/wifi/1.0/default/wifi.h
+++ b/wifi/1.0/default/wifi.h
@@ -64,7 +64,7 @@
// Instance is created in this root level |IWifi| HIDL interface object
// and shared with all the child HIDL interface objects.
- std::shared_ptr<WifiLegacyHal> legacy_hal_;
+ std::shared_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
RunState run_state_;
std::vector<sp<IWifiEventCallback>> event_callbacks_;
sp<WifiChip> chip_;
diff --git a/wifi/1.0/default/wifi_ap_iface.cpp b/wifi/1.0/default/wifi_ap_iface.cpp
index 8c38946..b8b7a3a 100644
--- a/wifi/1.0/default/wifi_ap_iface.cpp
+++ b/wifi/1.0/default/wifi_ap_iface.cpp
@@ -27,8 +27,9 @@
namespace implementation {
using hidl_return_util::validateAndCall;
-WifiApIface::WifiApIface(const std::string& ifname,
- const std::weak_ptr<WifiLegacyHal> legacy_hal)
+WifiApIface::WifiApIface(
+ const std::string& ifname,
+ const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal)
: ifname_(ifname), legacy_hal_(legacy_hal), is_valid_(true) {}
void WifiApIface::invalidate() {
diff --git a/wifi/1.0/default/wifi_ap_iface.h b/wifi/1.0/default/wifi_ap_iface.h
index 458bdda..ee5dc56 100644
--- a/wifi/1.0/default/wifi_ap_iface.h
+++ b/wifi/1.0/default/wifi_ap_iface.h
@@ -34,7 +34,7 @@
class WifiApIface : public IWifiApIface {
public:
WifiApIface(const std::string& ifname,
- const std::weak_ptr<WifiLegacyHal> legacy_hal);
+ const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
// Refer to |WifiChip::invalidate()|.
void invalidate();
bool isValid();
@@ -49,7 +49,7 @@
std::pair<WifiStatus, IfaceType> getTypeInternal();
std::string ifname_;
- std::weak_ptr<WifiLegacyHal> legacy_hal_;
+ std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
bool is_valid_;
DISALLOW_COPY_AND_ASSIGN(WifiApIface);
diff --git a/wifi/1.0/default/wifi_chip.cpp b/wifi/1.0/default/wifi_chip.cpp
index 2245288..4d1bce5 100644
--- a/wifi/1.0/default/wifi_chip.cpp
+++ b/wifi/1.0/default/wifi_chip.cpp
@@ -42,7 +42,7 @@
using hidl_return_util::validateAndCall;
WifiChip::WifiChip(ChipId chip_id,
- const std::weak_ptr<WifiLegacyHal> legacy_hal)
+ const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal)
: chip_id_(chip_id), legacy_hal_(legacy_hal), is_valid_(true) {}
void WifiChip::invalidate() {
diff --git a/wifi/1.0/default/wifi_chip.h b/wifi/1.0/default/wifi_chip.h
index 0c8adac..c1a7173 100644
--- a/wifi/1.0/default/wifi_chip.h
+++ b/wifi/1.0/default/wifi_chip.h
@@ -42,7 +42,8 @@
*/
class WifiChip : public IWifiChip {
public:
- WifiChip(ChipId chip_id, const std::weak_ptr<WifiLegacyHal> legacy_hal);
+ WifiChip(ChipId chip_id,
+ const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
// HIDL does not provide a built-in mechanism to let the server invalidate
// a HIDL interface object after creation. If any client process holds onto
// a reference to the object in their context, any method calls on that
@@ -154,7 +155,7 @@
getDebugHostWakeReasonStatsInternal();
ChipId chip_id_;
- std::weak_ptr<WifiLegacyHal> legacy_hal_;
+ std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
std::vector<sp<IWifiChipEventCallback>> event_callbacks_;
sp<WifiApIface> ap_iface_;
sp<WifiNanIface> nan_iface_;
diff --git a/wifi/1.0/default/wifi_legacy_hal.cpp b/wifi/1.0/default/wifi_legacy_hal.cpp
index cb254c3..28b7f9a 100644
--- a/wifi/1.0/default/wifi_legacy_hal.cpp
+++ b/wifi/1.0/default/wifi_legacy_hal.cpp
@@ -16,14 +16,19 @@
#include <array>
-#include "wifi_legacy_hal.h"
-
#include <android-base/logging.h>
#include <cutils/properties.h>
-#include <wifi_system/hal_tool.h>
#include <wifi_system/interface_tool.h>
-namespace {
+#include "wifi_legacy_hal.h"
+
+namespace android {
+namespace hardware {
+namespace wifi {
+namespace V1_0 {
+namespace implementation {
+namespace legacy_hal {
+// Constants used in the class.
static constexpr uint32_t kMaxVersionStringLength = 256;
// Legacy HAL functions accept "C" style function pointers, so use global
@@ -52,13 +57,8 @@
on_firmware_memory_dump_internal_callback(buffer, buffer_size);
}
}
-}
+// End of the free-standing "C" style callbacks.
-namespace android {
-namespace hardware {
-namespace wifi {
-namespace V1_0 {
-namespace implementation {
WifiLegacyHal::WifiLegacyHal()
: global_handle_(nullptr),
wlan_interface_handle_(nullptr),
@@ -69,9 +69,11 @@
CHECK(!global_handle_ && !wlan_interface_handle_ &&
!awaiting_event_loop_termination_);
- android::wifi_system::HalTool hal_tool;
android::wifi_system::InterfaceTool if_tool;
- if (!hal_tool.InitFunctionTable(&global_func_table_)) {
+ // TODO: Add back the HAL Tool if we need to. All we need from the HAL tool
+ // for now is this function call which we can directly call.
+ wifi_error status = init_wifi_vendor_hal_func_table(&global_func_table_);
+ if (status != WIFI_SUCCESS) {
LOG(ERROR) << "Failed to initialize legacy hal function table";
return WIFI_ERROR_UNKNOWN;
}
@@ -81,7 +83,7 @@
}
LOG(INFO) << "Starting legacy HAL";
- wifi_error status = global_func_table_.wifi_initialize(&global_handle_);
+ status = global_func_table_.wifi_initialize(&global_handle_);
if (status != WIFI_SUCCESS || !global_handle_) {
LOG(ERROR) << "Failed to retrieve global handle";
return status;
@@ -141,7 +143,7 @@
buffer.fill(0);
wifi_error status = global_func_table_.wifi_get_driver_version(
wlan_interface_handle_, buffer.data(), buffer.size());
- return std::make_pair(status, buffer.data());
+ return {status, buffer.data()};
}
std::pair<wifi_error, std::string> WifiLegacyHal::getFirmwareVersion() {
@@ -149,7 +151,7 @@
buffer.fill(0);
wifi_error status = global_func_table_.wifi_get_firmware_version(
wlan_interface_handle_, buffer.data(), buffer.size());
- return std::make_pair(status, buffer.data());
+ return {status, buffer.data()};
}
std::pair<wifi_error, std::vector<uint8_t>>
@@ -164,7 +166,7 @@
wifi_error status = global_func_table_.wifi_get_driver_memory_dump(
wlan_interface_handle_, {onDriverMemoryDump});
on_driver_memory_dump_internal_callback = nullptr;
- return std::make_pair(status, std::move(driver_dump));
+ return {status, std::move(driver_dump)};
}
std::pair<wifi_error, std::vector<uint8_t>>
@@ -179,7 +181,29 @@
wifi_error status = global_func_table_.wifi_get_firmware_memory_dump(
wlan_interface_handle_, {onFirmwareMemoryDump});
on_firmware_memory_dump_internal_callback = nullptr;
- return std::make_pair(status, std::move(firmware_dump));
+ return {status, std::move(firmware_dump)};
+}
+
+std::pair<wifi_error, uint32_t> WifiLegacyHal::getSupportedFeatureSet() {
+ feature_set set;
+ static_assert(sizeof(set) == sizeof(uint32_t),
+ "Some features can not be represented in output");
+ wifi_error status = global_func_table_.wifi_get_supported_feature_set(
+ wlan_interface_handle_, &set);
+ return {status, static_cast<uint32_t>(set)};
+}
+
+std::pair<wifi_error, PacketFilterCapabilities>
+WifiLegacyHal::getPacketFilterCapabilities() {
+ PacketFilterCapabilities caps;
+ wifi_error status = global_func_table_.wifi_get_packet_filter_capabilities(
+ wlan_interface_handle_, &caps.version, &caps.max_len);
+ return {status, caps};
+}
+
+wifi_error WifiLegacyHal::setPacketFilter(const std::vector<uint8_t>& program) {
+ return global_func_table_.wifi_set_packet_filter(
+ wlan_interface_handle_, program.data(), program.size());
}
wifi_error WifiLegacyHal::retrieveWlanInterfaceHandle() {
@@ -228,6 +252,8 @@
on_driver_memory_dump_internal_callback = nullptr;
on_firmware_memory_dump_internal_callback = nullptr;
}
+
+} // namespace legacy_hal
} // namespace implementation
} // namespace V1_0
} // namespace wifi
diff --git a/wifi/1.0/default/wifi_legacy_hal.h b/wifi/1.0/default/wifi_legacy_hal.h
index d817184..8bd146a 100644
--- a/wifi/1.0/default/wifi_legacy_hal.h
+++ b/wifi/1.0/default/wifi_legacy_hal.h
@@ -21,13 +21,23 @@
#include <thread>
#include <vector>
-#include <hardware_legacy/wifi_hal.h>
-
namespace android {
namespace hardware {
namespace wifi {
namespace V1_0 {
namespace implementation {
+// This is in a separate namespace to prevent typename conflicts between
+// the legacy HAL types and the HIDL interface types.
+namespace legacy_hal {
+// Wrap all the types defined inside the legacy HAL header files inside this
+// namespace.
+#include <hardware_legacy/wifi_hal.h>
+
+// APF capabilities supported by the iface.
+struct PacketFilterCapabilities {
+ uint32_t version;
+ uint32_t max_len;
+};
/**
* Class that encapsulates all legacy HAL interactions.
@@ -51,6 +61,10 @@
std::pair<wifi_error, std::string> getFirmwareVersion();
std::pair<wifi_error, std::vector<uint8_t>> requestDriverMemoryDump();
std::pair<wifi_error, std::vector<uint8_t>> requestFirmwareMemoryDump();
+ std::pair<wifi_error, uint32_t> getSupportedFeatureSet();
+ // APF functions.
+ std::pair<wifi_error, PacketFilterCapabilities> getPacketFilterCapabilities();
+ wifi_error setPacketFilter(const std::vector<uint8_t>& program);
private:
// Retrieve the interface handle to be used for the "wlan" interface.
@@ -71,6 +85,7 @@
bool awaiting_event_loop_termination_;
};
+} // namespace legacy_hal
} // namespace implementation
} // namespace V1_0
} // namespace wifi
diff --git a/wifi/1.0/default/wifi_nan_iface.cpp b/wifi/1.0/default/wifi_nan_iface.cpp
index a2190a8..48e75a5 100644
--- a/wifi/1.0/default/wifi_nan_iface.cpp
+++ b/wifi/1.0/default/wifi_nan_iface.cpp
@@ -27,8 +27,9 @@
namespace implementation {
using hidl_return_util::validateAndCall;
-WifiNanIface::WifiNanIface(const std::string& ifname,
- const std::weak_ptr<WifiLegacyHal> legacy_hal)
+WifiNanIface::WifiNanIface(
+ const std::string& ifname,
+ const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal)
: ifname_(ifname), legacy_hal_(legacy_hal), is_valid_(true) {}
void WifiNanIface::invalidate() {
diff --git a/wifi/1.0/default/wifi_nan_iface.h b/wifi/1.0/default/wifi_nan_iface.h
index f3c0640..4f89b31 100644
--- a/wifi/1.0/default/wifi_nan_iface.h
+++ b/wifi/1.0/default/wifi_nan_iface.h
@@ -35,7 +35,7 @@
class WifiNanIface : public IWifiNanIface {
public:
WifiNanIface(const std::string& ifname,
- const std::weak_ptr<WifiLegacyHal> legacy_hal);
+ const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
// Refer to |WifiChip::invalidate()|.
void invalidate();
bool isValid();
@@ -135,7 +135,7 @@
WifiStatus dataEndInternal(uint32_t cmd_id, const NanDataPathEndRequest& msg);
std::string ifname_;
- std::weak_ptr<WifiLegacyHal> legacy_hal_;
+ std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
std::vector<sp<IWifiNanIfaceEventCallback>> event_callbacks_;
bool is_valid_;
diff --git a/wifi/1.0/default/wifi_p2p_iface.cpp b/wifi/1.0/default/wifi_p2p_iface.cpp
index 65258ba..0d055f1 100644
--- a/wifi/1.0/default/wifi_p2p_iface.cpp
+++ b/wifi/1.0/default/wifi_p2p_iface.cpp
@@ -27,8 +27,9 @@
namespace implementation {
using hidl_return_util::validateAndCall;
-WifiP2pIface::WifiP2pIface(const std::string& ifname,
- const std::weak_ptr<WifiLegacyHal> legacy_hal)
+WifiP2pIface::WifiP2pIface(
+ const std::string& ifname,
+ const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal)
: ifname_(ifname), legacy_hal_(legacy_hal), is_valid_(true) {}
void WifiP2pIface::invalidate() {
diff --git a/wifi/1.0/default/wifi_p2p_iface.h b/wifi/1.0/default/wifi_p2p_iface.h
index d4656e1..d2982db 100644
--- a/wifi/1.0/default/wifi_p2p_iface.h
+++ b/wifi/1.0/default/wifi_p2p_iface.h
@@ -34,7 +34,7 @@
class WifiP2pIface : public IWifiP2pIface {
public:
WifiP2pIface(const std::string& ifname,
- const std::weak_ptr<WifiLegacyHal> legacy_hal);
+ const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
// Refer to |WifiChip::invalidate()|.
void invalidate();
bool isValid();
@@ -49,7 +49,7 @@
std::pair<WifiStatus, IfaceType> getTypeInternal();
std::string ifname_;
- std::weak_ptr<WifiLegacyHal> legacy_hal_;
+ std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
bool is_valid_;
DISALLOW_COPY_AND_ASSIGN(WifiP2pIface);
diff --git a/wifi/1.0/default/wifi_rtt_controller.cpp b/wifi/1.0/default/wifi_rtt_controller.cpp
index dbe836b..6ac0629 100644
--- a/wifi/1.0/default/wifi_rtt_controller.cpp
+++ b/wifi/1.0/default/wifi_rtt_controller.cpp
@@ -29,7 +29,7 @@
WifiRttController::WifiRttController(
const sp<IWifiIface>& bound_iface,
- const std::weak_ptr<WifiLegacyHal> legacy_hal)
+ const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal)
: bound_iface_(bound_iface), legacy_hal_(legacy_hal), is_valid_(true) {}
void WifiRttController::invalidate() {
diff --git a/wifi/1.0/default/wifi_rtt_controller.h b/wifi/1.0/default/wifi_rtt_controller.h
index 5ebd4bc..3dd5340 100644
--- a/wifi/1.0/default/wifi_rtt_controller.h
+++ b/wifi/1.0/default/wifi_rtt_controller.h
@@ -36,7 +36,7 @@
class WifiRttController : public IWifiRttController {
public:
WifiRttController(const sp<IWifiIface>& bound_iface,
- const std::weak_ptr<WifiLegacyHal> legacy_hal);
+ const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
// Refer to |WifiChip::invalidate()|.
void invalidate();
bool isValid();
@@ -103,7 +103,7 @@
WifiStatus disableResponderInternal(uint32_t cmd_id);
sp<IWifiIface> bound_iface_;
- std::weak_ptr<WifiLegacyHal> legacy_hal_;
+ std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
std::vector<sp<IWifiRttControllerEventCallback>> event_callbacks_;
bool is_valid_;
diff --git a/wifi/1.0/default/wifi_sta_iface.cpp b/wifi/1.0/default/wifi_sta_iface.cpp
index 1f220f3..6365032 100644
--- a/wifi/1.0/default/wifi_sta_iface.cpp
+++ b/wifi/1.0/default/wifi_sta_iface.cpp
@@ -27,8 +27,9 @@
namespace implementation {
using hidl_return_util::validateAndCall;
-WifiStaIface::WifiStaIface(const std::string& ifname,
- const std::weak_ptr<WifiLegacyHal> legacy_hal)
+WifiStaIface::WifiStaIface(
+ const std::string& ifname,
+ const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal)
: ifname_(ifname), legacy_hal_(legacy_hal), is_valid_(true) {}
void WifiStaIface::invalidate() {
diff --git a/wifi/1.0/default/wifi_sta_iface.h b/wifi/1.0/default/wifi_sta_iface.h
index a13feeb..09a883c 100644
--- a/wifi/1.0/default/wifi_sta_iface.h
+++ b/wifi/1.0/default/wifi_sta_iface.h
@@ -35,7 +35,7 @@
class WifiStaIface : public IWifiStaIface {
public:
WifiStaIface(const std::string& ifname,
- const std::weak_ptr<WifiLegacyHal> legacy_hal);
+ const std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal);
// Refer to |WifiChip::invalidate()|.
void invalidate();
bool isValid();
@@ -107,7 +107,7 @@
getDebugRxPacketFatesInternal();
std::string ifname_;
- std::weak_ptr<WifiLegacyHal> legacy_hal_;
+ std::weak_ptr<legacy_hal::WifiLegacyHal> legacy_hal_;
std::vector<sp<IWifiStaIfaceEventCallback>> event_callbacks_;
bool is_valid_;
diff --git a/wifi/supplicant/1.0/Android.bp b/wifi/supplicant/1.0/Android.bp
index 08c6f9a..0f399a0 100644
--- a/wifi/supplicant/1.0/Android.bp
+++ b/wifi/supplicant/1.0/Android.bp
@@ -126,13 +126,15 @@
generated_headers: ["android.hardware.wifi.supplicant@1.0_genc++_headers"],
export_generated_headers: ["android.hardware.wifi.supplicant@1.0_genc++_headers"],
shared_libs: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
"libcutils",
],
export_shared_lib_headers: [
- "libhidl",
+ "libhidlbase",
+ "libhidltransport",
"libhwbinder",
"libutils",
],