Merge "Use new API to load mapper" into main am: 6a5da15033 am: 52e9ebfa91
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2960862
Change-Id: I42b3f655502f96e3b84518a666fd5b28353b98bd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/audio/aidl/default/SoundDose.cpp b/audio/aidl/default/SoundDose.cpp
index 1c9e081..6c3a067 100644
--- a/audio/aidl/default/SoundDose.cpp
+++ b/audio/aidl/default/SoundDose.cpp
@@ -119,7 +119,8 @@
void SoundDose::MelCallback::onNewMelValues(const std::vector<float>& mels, size_t offset,
size_t length,
audio_port_handle_t deviceId
- __attribute__((__unused__))) const {
+ __attribute__((__unused__)),
+ bool attenuated __attribute__((__unused__))) const {
mSoundDose.onNewMelValues(mels, offset, length, deviceId);
}
diff --git a/audio/aidl/default/include/core-impl/SoundDose.h b/audio/aidl/default/include/core-impl/SoundDose.h
index 82c1077..f58e541 100644
--- a/audio/aidl/default/include/core-impl/SoundDose.h
+++ b/audio/aidl/default/include/core-impl/SoundDose.h
@@ -64,7 +64,7 @@
// ------------------------------------ MelCallback ----------------------------------------
void onNewMelValues(const std::vector<float>& mels, size_t offset, size_t length,
- audio_port_handle_t deviceId) const override;
+ audio_port_handle_t deviceId, bool attenuated) const override;
void onMomentaryExposure(float currentMel, audio_port_handle_t deviceId) const override;
SoundDose& mSoundDose; // must outlive MelCallback, not owning
diff --git a/automotive/audiocontrol/aidl/default/Android.bp b/automotive/audiocontrol/aidl/default/Android.bp
index 435c2d6..a48d228 100644
--- a/automotive/audiocontrol/aidl/default/Android.bp
+++ b/automotive/audiocontrol/aidl/default/Android.bp
@@ -27,11 +27,13 @@
init_rc: ["audiocontrol-default.rc"],
vintf_fragments: ["audiocontrol-default.xml"],
vendor: true,
+ defaults: [
+ "latest_android_hardware_audio_common_ndk_shared",
+ "latest_android_hardware_automotive_audiocontrol_ndk_shared",
+ ],
shared_libs: [
"android.hardware.audio.common@7.0-enums",
- "android.hardware.audio.common-V1-ndk",
"android.frameworks.automotive.powerpolicy-V2-ndk",
- "android.hardware.automotive.audiocontrol-V3-ndk",
"libbase",
"libbinder_ndk",
"libcutils",
diff --git a/automotive/can/aidl/default/tools/configurator/canprototools.cpp b/automotive/can/aidl/default/tools/configurator/canprototools.cpp
index 84edd94..ead53c1 100644
--- a/automotive/can/aidl/default/tools/configurator/canprototools.cpp
+++ b/automotive/can/aidl/default/tools/configurator/canprototools.cpp
@@ -48,23 +48,18 @@
char buff[n];
auto got = s.read(buff, n).gcount();
if (!s.good() && !s.eof()) return std::nullopt;
- return std::string(buff, 0, std::min(n, got));
+ return std::string(buff, got);
}
-/*
- parseConfigFile *used to* contain the body of parseConfigStream. However, it seems there's some
- sort of odd behavior with IstreamInputStream and/or TextFormat::Parse, which causes HW Address
- Sanitizer to flag a "tag-mismatch" in this function. Having the ifstream defined in a wrapper
- function seems to solve this problem. The exact cause of this problem is yet unknown, but probably
- lies somewhere in the protobuf implementation.
-*/
-static __attribute__((noinline)) std::optional<CanBusConfig> parseConfigStream(
- std::ifstream& cfg_stream) {
+std::optional<CanBusConfig> parseConfigFile(const std::string& filepath) {
+ std::ifstream cfg_stream(filepath);
+
+ // text headers that would be present in a plaintext proto config file.
static const std::array<std::string, 3> text_headers = {"buses", "#", "controller"};
auto cfg_file_snippet = readString(cfg_stream, 10);
if (!cfg_file_snippet.has_value()) {
- LOG(ERROR) << "Can't read config from stream (maybe failed to open file?)";
+ LOG(ERROR) << "Can't open " << filepath << " for reading";
return std::nullopt;
}
cfg_stream.seekg(0);
@@ -82,25 +77,16 @@
if (text_format) {
google::protobuf::io::IstreamInputStream pb_stream(&cfg_stream);
if (!google::protobuf::TextFormat::Parse(&pb_stream, &config)) {
- LOG(ERROR) << "Parsing text format config failed";
+ LOG(ERROR) << "Failed to parse (text format) " << filepath;
return std::nullopt;
}
} else if (!config.ParseFromIstream(&cfg_stream)) {
- LOG(ERROR) << "Parsing binary format config failed";
+ LOG(ERROR) << "Failed to parse (binary format) " << filepath;
return std::nullopt;
}
return config;
}
-std::optional<CanBusConfig> parseConfigFile(const std::string& filepath) {
- std::ifstream cfg_stream(filepath);
- auto cfg_maybe = parseConfigStream(cfg_stream);
- if (!cfg_maybe.has_value()) {
- LOG(ERROR) << "Failed to parse " << filepath;
- }
- return cfg_maybe;
-}
-
std::optional<BusConfig> fromPbBus(const Bus& pb_bus) {
BusConfig bus_cfg = {};
bus_cfg.name = pb_bus.name();
diff --git a/automotive/evs/aidl/impl/default/src/EvsVideoEmulatedCamera.cpp b/automotive/evs/aidl/impl/default/src/EvsVideoEmulatedCamera.cpp
index 8181e47..e3f7b5e 100644
--- a/automotive/evs/aidl/impl/default/src/EvsVideoEmulatedCamera.cpp
+++ b/automotive/evs/aidl/impl/default/src/EvsVideoEmulatedCamera.cpp
@@ -222,10 +222,9 @@
// Lock our output buffer for writing
uint8_t* pixels = nullptr;
- int32_t bytesPerStride = 0;
auto& mapper = ::android::GraphicBufferMapper::get();
mapper.lock(renderBufferHandle, GRALLOC_USAGE_SW_WRITE_OFTEN | GRALLOC_USAGE_SW_READ_NEVER,
- ::android::Rect(mWidth, mHeight), (void**)&pixels, nullptr, &bytesPerStride);
+ ::android::Rect(mWidth, mHeight), (void**)&pixels);
// If we failed to lock the pixel buffer, we're about to crash, but log it first
if (!pixels) {
@@ -247,13 +246,6 @@
*(pixels++) = *(v_head++);
}
- const auto status =
- AMediaCodec_releaseOutputBuffer(mVideoCodec.get(), index, /* render = */ false);
- if (status != AMEDIA_OK) {
- LOG(ERROR) << __func__
- << ": Received error in releasing output buffer. Error code: " << status;
- }
-
// Release our output buffer
mapper.unlock(renderBufferHandle);
@@ -306,6 +298,12 @@
return;
}
onCodecOutputAvailable(codecOutputputBufferIdx, info);
+ const auto release_status = AMediaCodec_releaseOutputBuffer(
+ mVideoCodec.get(), codecOutputputBufferIdx, /* render = */ false);
+ if (release_status != AMEDIA_OK) {
+ LOG(ERROR) << __func__
+ << ": Received error in releasing output buffer. Error code: " << release_status;
+ }
}
void EvsVideoEmulatedCamera::initializeParameters() {
diff --git a/automotive/remoteaccess/TEST_MAPPING b/automotive/remoteaccess/TEST_MAPPING
new file mode 100644
index 0000000..81c16c1
--- /dev/null
+++ b/automotive/remoteaccess/TEST_MAPPING
@@ -0,0 +1,7 @@
+{
+ "auto-presubmit": [
+ {
+ "name": "VtsHalAutomotiveRemoteAccess_TargetTest"
+ }
+ ]
+}
diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
index ccfa22d..5c5917b 100644
--- a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
+++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
@@ -41,9 +41,10 @@
void clearRemoteTaskCallback();
void notifyApStateChange(in android.hardware.automotive.remoteaccess.ApState state);
boolean isTaskScheduleSupported();
+ android.hardware.automotive.remoteaccess.TaskType[] getSupportedTaskTypesForScheduling();
void scheduleTask(in android.hardware.automotive.remoteaccess.ScheduleInfo scheduleInfo);
void unscheduleTask(String clientId, String scheduleId);
void unscheduleAllTasks(String clientId);
boolean isTaskScheduled(String clientId, String scheduleId);
- List<android.hardware.automotive.remoteaccess.ScheduleInfo> getAllScheduledTasks(String clientId);
+ List<android.hardware.automotive.remoteaccess.ScheduleInfo> getAllPendingScheduledTasks(String clientId);
}
diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
index a929e10..ec8733a 100644
--- a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
+++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
@@ -36,8 +36,10 @@
parcelable ScheduleInfo {
String clientId;
String scheduleId;
+ android.hardware.automotive.remoteaccess.TaskType taskType;
byte[] taskData;
int count;
long startTimeInEpochSeconds;
long periodicInSeconds;
+ const int MAX_TASK_DATA_SIZE_IN_BYTES = 10240;
}
diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/TaskType.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/TaskType.aidl
new file mode 100644
index 0000000..da70626
--- /dev/null
+++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/TaskType.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.automotive.remoteaccess;
+@Backing(type="int") @VintfStability
+enum TaskType {
+ CUSTOM = 0,
+ ENTER_GARAGE_MODE = 1,
+}
diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
index 4912651..f0468c4 100644
--- a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
+++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
@@ -19,12 +19,39 @@
import android.hardware.automotive.remoteaccess.ApState;
import android.hardware.automotive.remoteaccess.IRemoteTaskCallback;
import android.hardware.automotive.remoteaccess.ScheduleInfo;
+import android.hardware.automotive.remoteaccess.TaskType;
/**
- * Interface representing a remote wakeup client.
+ * The remote access HAL.
*
- * A wakeup client is a binary outside Android framework that communicates with
- * a wakeup server and receives wake up command.
+ * <p>This HAL represents an external system that is always on even when Android
+ * is powered off. It is capable of wakeing up and notifying Android when a
+ * remote task arrives.
+ *
+ * <p>For cloud-based remote access, a cloud server will issue the remote task
+ * to the external system, which will then be forwarded to Android. The client
+ * is expected to call {@code setRemoteTaskCallback} to register the remote
+ * task callback and uses the information returned from {@code getVehicleId},
+ * {@code getWakeupServiceName} and {@code getProcessorId} to register with
+ * a remote server.
+ *
+ * <p>For serverless remote access, the remote task comes from the external
+ * system alone and no server is involved. The external system may support
+ * scheduling a remote task to executed later through {@code scheduleTask}.
+ *
+ * <p>For both cloud-based and serverless remote access, the ideal use case
+ * is to wake up Android when the vehicle is not in use and then shutdown
+ * Android after the task is complete. However, user may access the vehicle
+ * during this period, and Android must not be shutdown if this happens.
+ *
+ * <p>If this interface is implemented, then VHAL property
+ * {@code VEHICLE_IN_USE} must be supported to represent whether the vehicle is
+ * currently in use. Android will check this before sending the shutdown
+ * request.
+ *
+ * <p>The external power controller system must also check whether vehicle is
+ * in use upon receiving the shutdown request and makes sure that an
+ * user-unexpected shutdown must not happen.
*/
@VintfStability
interface IRemoteAccess {
@@ -110,6 +137,17 @@
boolean isTaskScheduleSupported();
/**
+ * Returns the supported task types for scheduling.
+ *
+ * <p>If task scheduling is not supported, this returns an empty array.
+ *
+ * <p>Otherwise, at least {@code TaskType.CUSTOM} must be supported.
+ *
+ * @return An array of supported task types.
+ */
+ TaskType[] getSupportedTaskTypesForScheduling();
+
+ /**
* Schedules a task to be executed later even when the vehicle is off.
*
* <p>If {@link isTaskScheduleSupported} returns {@code false}. This is no-op.
@@ -127,6 +165,11 @@
*
* <p>Must return {@code EX_ILLEGAL_ARGUMENT} if a pending schedule with the same
* {@code scheduleId} for this client exists.
+ *
+ * <p>Must return {@code EX_ILLEGAL_ARGUMENT} if the task type is not supported.
+ *
+ * <p>Must return {@code EX_ILLEGLA_ARGUMENT} if the scheduleInfo is not valid (e.g. count is
+ * a negative number).
*/
void scheduleTask(in ScheduleInfo scheduleInfo);
@@ -161,5 +204,5 @@
*
* <p>The finished scheduled tasks will not be included.
*/
- List<ScheduleInfo> getAllScheduledTasks(String clientId);
+ List<ScheduleInfo> getAllPendingScheduledTasks(String clientId);
}
diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.aidl
index 2cd7a5d..ee6f900 100644
--- a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.aidl
+++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.aidl
@@ -22,7 +22,7 @@
@VintfStability
interface IRemoteTaskCallback {
/**
- * A callback that is called when a remote task is requested.
+ * A callback that is called when a custom type remote task is requested.
*
* The data is passed down from the remote server to the remote task client
* which is an Android application, and is not interpreted/parsed by the
diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
index cf1437b..4f2537c 100644
--- a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
+++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
@@ -16,9 +16,12 @@
package android.hardware.automotive.remoteaccess;
+import android.hardware.automotive.remoteaccess.TaskType;
+
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable ScheduleInfo {
+ const int MAX_TASK_DATA_SIZE_IN_BYTES = 10240;
/**
* The ID used to identify the client this schedule is for. This must be one of the
* preconfigured remote access serverless client ID defined in car service resource
@@ -31,8 +34,16 @@
*/
String scheduleId;
/**
+ * The type for the task.
+ */
+ TaskType taskType;
+ /**
* The opaque task data that will be sent back to the remote task client app when the task is
* executed. It is not interpreted/parsed by the Android system.
+ *
+ * <p>This is only used for {@code TaskType.CUSTOM}.
+ *
+ * <p>The data size must be less than {@link MAX_TASK_DATA_SIZE_IN_BYTES}.
*/
byte[] taskData;
/**
diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/TaskType.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/TaskType.aidl
new file mode 100644
index 0000000..761eb15
--- /dev/null
+++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/TaskType.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2023 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.automotive.remoteaccess;
+
+@VintfStability
+@Backing(type="int")
+enum TaskType {
+ /**
+ * A custom task that is opaque to anyone other than the remote task client app.
+ *
+ * <p>The opaque task data in the {@code ScheduleInfo} will be sent back to the app when the
+ * task is to be executed.
+ */
+ CUSTOM = 0,
+ /**
+ * Enters the garage mode if allowed.
+ *
+ * <p>Make the Android system enters garage mode if vehicle is currently not in use and
+ * entering garage mode is allowed (e.g. battery level is high enough).
+ *
+ * <p>This is based on best-effort and it is not guaranteed.
+ *
+ * <p>If allowed, the external system should set {@code AP_POWER_BOOTUP_REASON} to
+ * {@code SYSTEM_ENTER_GARAGE_MODE} and then boot up (or resume) the head unit.
+ */
+ ENTER_GARAGE_MODE = 1,
+}
diff --git a/automotive/remoteaccess/hal/default/Android.bp b/automotive/remoteaccess/hal/default/Android.bp
index 97ed2c1..be6a425 100644
--- a/automotive/remoteaccess/hal/default/Android.bp
+++ b/automotive/remoteaccess/hal/default/Android.bp
@@ -53,7 +53,9 @@
vintf_fragments: ["remoteaccess-default-service.xml"],
init_rc: ["remoteaccess-default-service.rc"],
cflags: [
- "-DGRPC_SERVICE_ADDRESS=\"10.0.2.2:50051\"",
+ // Uncomment this if running on emulator and connecting to a local grpc server
+ // running on host 127.0.0.1:50051 (TestWakeupClientServerHost)
+ // "-DGRPC_SERVICE_ADDRESS=\"10.0.2.2:50051\"",
],
}
diff --git a/automotive/remoteaccess/hal/default/fuzzer/fuzzer.cpp b/automotive/remoteaccess/hal/default/fuzzer/fuzzer.cpp
index 9224ebc..7707ee6 100644
--- a/automotive/remoteaccess/hal/default/fuzzer/fuzzer.cpp
+++ b/automotive/remoteaccess/hal/default/fuzzer/fuzzer.cpp
@@ -75,8 +75,9 @@
return Status::OK;
}
- Status GetAllScheduledTasks(ClientContext* context, const GetAllScheduledTasksRequest& request,
- GetAllScheduledTasksResponse* response) {
+ Status GetAllPendingScheduledTasks(ClientContext* context,
+ const GetAllPendingScheduledTasksRequest& request,
+ GetAllPendingScheduledTasksResponse* response) {
return Status::OK;
}
@@ -165,17 +166,19 @@
return nullptr;
}
- ClientAsyncResponseReaderInterface<GetAllScheduledTasksResponse>* AsyncGetAllScheduledTasksRaw(
+ ClientAsyncResponseReaderInterface<GetAllPendingScheduledTasksResponse>*
+ AsyncGetAllPendingScheduledTasksRaw(
[[maybe_unused]] ClientContext* context,
- [[maybe_unused]] const GetAllScheduledTasksRequest& request,
+ [[maybe_unused]] const GetAllPendingScheduledTasksRequest& request,
[[maybe_unused]] CompletionQueue* cq) {
return nullptr;
}
- ClientAsyncResponseReaderInterface<GetAllScheduledTasksResponse>*
- PrepareAsyncGetAllScheduledTasksRaw([[maybe_unused]] ClientContext* context,
- [[maybe_unused]] const GetAllScheduledTasksRequest& request,
- [[maybe_unused]] CompletionQueue* c) {
+ ClientAsyncResponseReaderInterface<GetAllPendingScheduledTasksResponse>*
+ PrepareAsyncGetAllPendingScheduledTasksRaw(
+ [[maybe_unused]] ClientContext* context,
+ [[maybe_unused]] const GetAllPendingScheduledTasksRequest& request,
+ [[maybe_unused]] CompletionQueue* c) {
return nullptr;
}
};
diff --git a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
index 1fc4037..8716e48 100644
--- a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
+++ b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
@@ -81,6 +81,9 @@
ndk::ScopedAStatus isTaskScheduleSupported(bool* out) override;
+ ndk::ScopedAStatus getSupportedTaskTypesForScheduling(
+ std::vector<aidl::android::hardware::automotive::remoteaccess::TaskType>* out) override;
+
ndk::ScopedAStatus scheduleTask(
const aidl::android::hardware::automotive::remoteaccess::ScheduleInfo& scheduleInfo)
override;
@@ -93,7 +96,7 @@
ndk::ScopedAStatus isTaskScheduled(const std::string& clientId, const std::string& scheduleId,
bool* out) override;
- ndk::ScopedAStatus getAllScheduledTasks(
+ ndk::ScopedAStatus getAllPendingScheduledTasks(
const std::string& clientId,
std::vector<aidl::android::hardware::automotive::remoteaccess::ScheduleInfo>* out)
override;
@@ -108,6 +111,8 @@
WakeupClient::StubInterface* mGrpcStub;
std::thread mThread;
+ // Whether the GRPC server exists. Only checked and set during init.
+ bool mGrpcServerExist = false;
std::mutex mLock;
std::condition_variable mCv;
std::shared_ptr<aidl::android::hardware::automotive::remoteaccess::IRemoteTaskCallback>
@@ -118,7 +123,7 @@
// A mutex to make sure startTaskLoop does not overlap with stopTaskLoop.
std::mutex mStartStopTaskLoopLock;
bool mTaskLoopRunning GUARDED_BY(mStartStopTaskLoopLock) = false;
- bool mGrpcConnected GUARDED_BY(mLock) = false;
+ bool mGrpcReadChannelOpen GUARDED_BY(mLock) = false;
std::unordered_map<std::string, size_t> mClientIdToTaskCount GUARDED_BY(mLock);
// Default wait time before retry connecting to remote access client is 10s.
@@ -140,9 +145,10 @@
void debugInjectTask(int fd, std::string_view clientId, std::string_view taskData);
void debugInjectTaskNextReboot(int fd, std::string_view clientId, std::string_view taskData,
const char* latencyInSecStr);
- void updateGrpcConnected(bool connected);
+ void updateGrpcReadChannelOpen(bool grpcReadChannelOpen);
android::base::Result<void> deliverRemoteTaskThroughCallback(const std::string& clientId,
std::string_view taskData);
+ bool isTaskScheduleSupported();
};
} // namespace remoteaccess
diff --git a/automotive/remoteaccess/hal/default/proto/wakeup_client.proto b/automotive/remoteaccess/hal/default/proto/wakeup_client.proto
index e061016..14ba0a5 100644
--- a/automotive/remoteaccess/hal/default/proto/wakeup_client.proto
+++ b/automotive/remoteaccess/hal/default/proto/wakeup_client.proto
@@ -99,7 +99,8 @@
*
* <p>The finished scheduled tasks will not be included.
*/
- rpc GetAllScheduledTasks(GetAllScheduledTasksRequest) returns (GetAllScheduledTasksResponse) {}
+ rpc GetAllPendingScheduledTasks(GetAllPendingScheduledTasksRequest)
+ returns (GetAllPendingScheduledTasksResponse) {}
}
message GetRemoteTasksRequest {}
@@ -154,10 +155,10 @@
bool isTaskScheduled = 1;
}
-message GetAllScheduledTasksRequest {
+message GetAllPendingScheduledTasksRequest {
string clientId = 1;
}
-message GetAllScheduledTasksResponse {
+message GetAllPendingScheduledTasksResponse {
repeated GrpcScheduleInfo allScheduledTasks = 1;
}
diff --git a/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp b/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp
index d4ba864..28c5cd5 100644
--- a/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp
+++ b/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp
@@ -30,10 +30,9 @@
constexpr char SERVICE_NAME[] = "android.hardware.automotive.remoteaccess.IRemoteAccess/default";
int main(int /* argc */, char* /* argv */[]) {
-#ifndef GRPC_SERVICE_ADDRESS
- LOG(ERROR) << "GRPC_SERVICE_ADDRESS is not defined, exiting";
- exit(1);
-#endif
+ android::hardware::automotive::remoteaccess::WakeupClient::StubInterface* grpcStub = nullptr;
+
+#ifdef GRPC_SERVICE_ADDRESS
LOG(INFO) << "Registering RemoteAccessService as service, server: " << GRPC_SERVICE_ADDRESS
<< "...";
grpc::ChannelArguments grpcargs = {};
@@ -47,11 +46,18 @@
android::netdevice::waitFor({GRPC_SERVICE_IFNAME},
android::netdevice::WaitCondition::PRESENT_AND_UP);
LOG(INFO) << "Waiting for interface: " << GRPC_SERVICE_IFNAME << " done";
-#endif
+#endif // #ifdef GRPC_SERVICE_IFNAME
auto channel = grpc::CreateChannel(GRPC_SERVICE_ADDRESS, grpc::InsecureChannelCredentials());
auto clientStub = android::hardware::automotive::remoteaccess::WakeupClient::NewStub(channel);
+
+ grpcStub = clientStub.get();
+
+#else
+ LOG(INFO) << "GRPC_SERVICE_ADDRESS is not defined, work in fake mode";
+#endif // #ifdef GRPC_SERVICE_ADDRESS
+
auto service = ndk::SharedRefBase::make<
- android::hardware::automotive::remoteaccess::RemoteAccessService>(clientStub.get());
+ android::hardware::automotive::remoteaccess::RemoteAccessService>(grpcStub);
binder_exception_t err = AServiceManager_addService(service->asBinder().get(), SERVICE_NAME);
if (err != EX_NONE) {
diff --git a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
index 0944d86..dbd5bed 100644
--- a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
+++ b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
@@ -40,6 +40,7 @@
using ::aidl::android::hardware::automotive::remoteaccess::ApState;
using ::aidl::android::hardware::automotive::remoteaccess::IRemoteTaskCallback;
using ::aidl::android::hardware::automotive::remoteaccess::ScheduleInfo;
+using ::aidl::android::hardware::automotive::remoteaccess::TaskType;
using ::aidl::android::hardware::automotive::vehicle::VehicleProperty;
using ::android::base::Error;
using ::android::base::ParseInt;
@@ -102,6 +103,10 @@
RemoteAccessService::RemoteAccessService(WakeupClient::StubInterface* grpcStub)
: mGrpcStub(grpcStub) {
+ if (mGrpcStub != nullptr) {
+ mGrpcServerExist = true;
+ }
+
std::ifstream debugTaskFile;
debugTaskFile.open(DEBUG_TASK_FILE, std::ios::in);
if (!debugTaskFile.is_open()) {
@@ -176,9 +181,9 @@
mTaskLoopRunning = false;
}
-void RemoteAccessService::updateGrpcConnected(bool connected) {
+void RemoteAccessService::updateGrpcReadChannelOpen(bool grpcReadChannelOpen) {
std::lock_guard<std::mutex> lockGuard(mLock);
- mGrpcConnected = connected;
+ mGrpcReadChannelOpen = grpcReadChannelOpen;
}
Result<void> RemoteAccessService::deliverRemoteTaskThroughCallback(const std::string& clientId,
@@ -212,7 +217,7 @@
mGetRemoteTasksContext.reset(new ClientContext());
reader = mGrpcStub->GetRemoteTasks(mGetRemoteTasksContext.get(), request);
}
- updateGrpcConnected(true);
+ updateGrpcReadChannelOpen(true);
GetRemoteTasksResponse response;
while (reader->Read(&response)) {
ALOGI("Receiving one task from remote task client");
@@ -224,7 +229,7 @@
continue;
}
}
- updateGrpcConnected(false);
+ updateGrpcReadChannelOpen(false);
Status status = reader->Finish();
mGetRemoteTasksContext.reset();
@@ -297,6 +302,11 @@
}
ScopedAStatus RemoteAccessService::notifyApStateChange(const ApState& newState) {
+ if (!mGrpcServerExist) {
+ ALOGW("GRPC server does not exist, do nothing");
+ return ScopedAStatus::ok();
+ }
+
ClientContext context;
NotifyWakeupRequiredRequest request = {};
request.set_iswakeuprequired(newState.isWakeupRequired);
@@ -314,15 +324,61 @@
return ScopedAStatus::ok();
}
+bool RemoteAccessService::isTaskScheduleSupported() {
+ if (!mGrpcServerExist) {
+ ALOGW("GRPC server does not exist, task scheduling not supported");
+ return false;
+ }
+
+ return true;
+}
+
ScopedAStatus RemoteAccessService::isTaskScheduleSupported(bool* out) {
- *out = true;
+ *out = isTaskScheduleSupported();
+ return ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus RemoteAccessService::getSupportedTaskTypesForScheduling(
+ std::vector<TaskType>* out) {
+ out->clear();
+ if (!isTaskScheduleSupported()) {
+ ALOGW("Task scheduleing is not supported, return empty task types");
+ return ScopedAStatus::ok();
+ }
+
+ // TODO(b/316233421): support ENTER_GARAGE_MODE type.
+ out->push_back(TaskType::CUSTOM);
return ScopedAStatus::ok();
}
ScopedAStatus RemoteAccessService::scheduleTask(const ScheduleInfo& scheduleInfo) {
+ if (!isTaskScheduleSupported()) {
+ ALOGW("Task scheduleing is not supported, return exception");
+ return ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+ "task scheduling is not supported");
+ }
+
ClientContext context;
ScheduleTaskRequest request = {};
ScheduleTaskResponse response = {};
+
+ if (scheduleInfo.count < 0) {
+ return ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+ "count must be >= 0");
+ }
+ if (scheduleInfo.startTimeInEpochSeconds < 0) {
+ return ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+ "startTimeInEpochSeconds must be >= 0");
+ }
+ if (scheduleInfo.periodicInSeconds < 0) {
+ return ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+ "periodicInSeconds must be >= 0");
+ }
+ if (scheduleInfo.taskData.size() > scheduleInfo.MAX_TASK_DATA_SIZE_IN_BYTES) {
+ return ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+ "task data too big");
+ }
+
request.mutable_scheduleinfo()->set_clientid(scheduleInfo.clientId);
request.mutable_scheduleinfo()->set_scheduleid(scheduleInfo.scheduleId);
request.mutable_scheduleinfo()->set_data(scheduleInfo.taskData.data(),
@@ -340,7 +396,8 @@
case ErrorCode::OK:
return ScopedAStatus::ok();
case ErrorCode::INVALID_ARG:
- return ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
+ return ScopedAStatus::fromExceptionCodeWithMessage(
+ EX_ILLEGAL_ARGUMENT, "received invalid_arg from grpc server");
default:
// Should not happen.
return ScopedAStatus::fromServiceSpecificErrorWithMessage(
@@ -352,6 +409,11 @@
ScopedAStatus RemoteAccessService::unscheduleTask(const std::string& clientId,
const std::string& scheduleId) {
+ if (!isTaskScheduleSupported()) {
+ ALOGW("Task scheduleing is not supported, do nothing");
+ return ScopedAStatus::ok();
+ }
+
ClientContext context;
UnscheduleTaskRequest request = {};
UnscheduleTaskResponse response = {};
@@ -365,6 +427,11 @@
}
ScopedAStatus RemoteAccessService::unscheduleAllTasks(const std::string& clientId) {
+ if (!isTaskScheduleSupported()) {
+ ALOGW("Task scheduleing is not supported, do nothing");
+ return ScopedAStatus::ok();
+ }
+
ClientContext context;
UnscheduleAllTasksRequest request = {};
UnscheduleAllTasksResponse response = {};
@@ -378,6 +445,12 @@
ScopedAStatus RemoteAccessService::isTaskScheduled(const std::string& clientId,
const std::string& scheduleId, bool* out) {
+ if (!isTaskScheduleSupported()) {
+ ALOGW("Task scheduleing is not supported, return false");
+ *out = false;
+ return ScopedAStatus::ok();
+ }
+
ClientContext context;
IsTaskScheduledRequest request = {};
IsTaskScheduledResponse response = {};
@@ -391,13 +464,19 @@
return ScopedAStatus::ok();
}
-ScopedAStatus RemoteAccessService::getAllScheduledTasks(const std::string& clientId,
- std::vector<ScheduleInfo>* out) {
+ScopedAStatus RemoteAccessService::getAllPendingScheduledTasks(const std::string& clientId,
+ std::vector<ScheduleInfo>* out) {
+ if (!isTaskScheduleSupported()) {
+ ALOGW("Task scheduleing is not supported, return empty array");
+ out->clear();
+ return ScopedAStatus::ok();
+ }
+
ClientContext context;
- GetAllScheduledTasksRequest request = {};
- GetAllScheduledTasksResponse response = {};
+ GetAllPendingScheduledTasksRequest request = {};
+ GetAllPendingScheduledTasksResponse response = {};
request.set_clientid(clientId);
- Status status = mGrpcStub->GetAllScheduledTasks(&context, request, &response);
+ Status status = mGrpcStub->GetAllPendingScheduledTasks(&context, request, &response);
if (!status.ok()) {
return rpcStatusToScopedAStatus(status, "Failed to call isTaskScheduled");
}
@@ -533,9 +612,11 @@
dprintf(fd,
"\nRemoteAccess HAL status \n"
"Remote task callback registered: %s\n"
- "Task receiving GRPC connection established: %s\n"
+ "GRPC server exist: %s\n"
+ "GRPC read channel for receiving tasks open: %s\n"
"Received task count by clientId: \n%s\n",
- boolToString(mRemoteTaskCallback.get()).c_str(), boolToString(mGrpcConnected).c_str(),
+ boolToString(mRemoteTaskCallback.get()).c_str(), boolToString(mGrpcServerExist).c_str(),
+ boolToString(mGrpcReadChannelOpen).c_str(),
clientIdToTaskCountToStringLocked().c_str());
}
diff --git a/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp b/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp
index c0038c2..7992a50 100644
--- a/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp
+++ b/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp
@@ -48,6 +48,7 @@
using ::aidl::android::hardware::automotive::remoteaccess::ApState;
using ::aidl::android::hardware::automotive::remoteaccess::BnRemoteTaskCallback;
using ::aidl::android::hardware::automotive::remoteaccess::ScheduleInfo;
+using ::aidl::android::hardware::automotive::remoteaccess::TaskType;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue;
using ::grpc::ClientAsyncReaderInterface;
@@ -61,6 +62,7 @@
using ::ndk::ScopedAStatus;
using ::testing::_;
using ::testing::DoAll;
+using ::testing::ElementsAre;
using ::testing::Return;
using ::testing::SetArgPointee;
@@ -93,9 +95,9 @@
MOCK_METHOD(Status, IsTaskScheduled,
(ClientContext * context, const IsTaskScheduledRequest& request,
IsTaskScheduledResponse* response));
- MOCK_METHOD(Status, GetAllScheduledTasks,
- (ClientContext * context, const GetAllScheduledTasksRequest& request,
- GetAllScheduledTasksResponse* response));
+ MOCK_METHOD(Status, GetAllPendingScheduledTasks,
+ (ClientContext * context, const GetAllPendingScheduledTasksRequest& request,
+ GetAllPendingScheduledTasksResponse* response));
// Async methods which we do not care.
MOCK_METHOD(ClientAsyncReaderInterface<GetRemoteTasksResponse>*, AsyncGetRemoteTasksRaw,
(ClientContext * context, const GetRemoteTasksRequest& request, CompletionQueue* cq,
@@ -139,13 +141,13 @@
PrepareAsyncIsTaskScheduledRaw,
(ClientContext * context, const IsTaskScheduledRequest& request,
CompletionQueue* cq));
- MOCK_METHOD(ClientAsyncResponseReaderInterface<GetAllScheduledTasksResponse>*,
- AsyncGetAllScheduledTasksRaw,
- (ClientContext * context, const GetAllScheduledTasksRequest& request,
+ MOCK_METHOD(ClientAsyncResponseReaderInterface<GetAllPendingScheduledTasksResponse>*,
+ AsyncGetAllPendingScheduledTasksRaw,
+ (ClientContext * context, const GetAllPendingScheduledTasksRequest& request,
CompletionQueue* cq));
- MOCK_METHOD(ClientAsyncResponseReaderInterface<GetAllScheduledTasksResponse>*,
- PrepareAsyncGetAllScheduledTasksRaw,
- (ClientContext * context, const GetAllScheduledTasksRequest& request,
+ MOCK_METHOD(ClientAsyncResponseReaderInterface<GetAllPendingScheduledTasksResponse>*,
+ PrepareAsyncGetAllPendingScheduledTasksRaw,
+ (ClientContext * context, const GetAllPendingScheduledTasksRequest& request,
CompletionQueue* cq));
};
@@ -434,6 +436,14 @@
EXPECT_TRUE(out);
}
+TEST_F(RemoteAccessServiceUnitTest, TestGetSupportedTaskTypesForScheduling) {
+ std::vector<TaskType> out;
+ ScopedAStatus status = getService()->getSupportedTaskTypesForScheduling(&out);
+
+ EXPECT_TRUE(status.isOk());
+ EXPECT_THAT(out, ElementsAre(TaskType::CUSTOM));
+}
+
TEST_F(RemoteAccessServiceUnitTest, TestScheduleTask) {
ScheduleTaskRequest grpcRequest = {};
EXPECT_CALL(*getGrpcWakeupClientStub(), ScheduleTask)
@@ -463,7 +473,71 @@
EXPECT_EQ(grpcRequest.scheduleinfo().periodicinseconds(), kTestPeriodicInSeconds);
}
-TEST_F(RemoteAccessServiceUnitTest, TestScheduleTask_InvalidArg) {
+TEST_F(RemoteAccessServiceUnitTest, TestScheduleTask_InvalidCount) {
+ ScheduleInfo scheduleInfo = {
+ .clientId = kTestClientId,
+ .scheduleId = kTestScheduleId,
+ .taskData = kTestData,
+ .count = -1,
+ .startTimeInEpochSeconds = kTestStartTimeInEpochSeconds,
+ .periodicInSeconds = kTestPeriodicInSeconds,
+ };
+
+ ScopedAStatus status = getService()->scheduleTask(scheduleInfo);
+
+ ASSERT_FALSE(status.isOk());
+ ASSERT_EQ(status.getExceptionCode(), EX_ILLEGAL_ARGUMENT);
+}
+
+TEST_F(RemoteAccessServiceUnitTest, TestScheduleTask_InvalidStartTimeInEpochSeconds) {
+ ScheduleInfo scheduleInfo = {
+ .clientId = kTestClientId,
+ .scheduleId = kTestScheduleId,
+ .taskData = kTestData,
+ .count = kTestCount,
+ .startTimeInEpochSeconds = -1,
+ .periodicInSeconds = kTestPeriodicInSeconds,
+ };
+
+ ScopedAStatus status = getService()->scheduleTask(scheduleInfo);
+
+ ASSERT_FALSE(status.isOk());
+ ASSERT_EQ(status.getExceptionCode(), EX_ILLEGAL_ARGUMENT);
+}
+
+TEST_F(RemoteAccessServiceUnitTest, TestScheduleTask_InvalidPeriodicInSeconds) {
+ ScheduleInfo scheduleInfo = {
+ .clientId = kTestClientId,
+ .scheduleId = kTestScheduleId,
+ .taskData = kTestData,
+ .count = kTestCount,
+ .startTimeInEpochSeconds = kTestStartTimeInEpochSeconds,
+ .periodicInSeconds = -1,
+ };
+
+ ScopedAStatus status = getService()->scheduleTask(scheduleInfo);
+
+ ASSERT_FALSE(status.isOk());
+ ASSERT_EQ(status.getExceptionCode(), EX_ILLEGAL_ARGUMENT);
+}
+
+TEST_F(RemoteAccessServiceUnitTest, TestScheduleTask_TaskDataTooLarge) {
+ ScheduleInfo scheduleInfo = {
+ .clientId = kTestClientId,
+ .scheduleId = kTestScheduleId,
+ .taskData = std::vector<uint8_t>(ScheduleInfo::MAX_TASK_DATA_SIZE_IN_BYTES + 1),
+ .count = kTestCount,
+ .startTimeInEpochSeconds = kTestStartTimeInEpochSeconds,
+ .periodicInSeconds = kTestPeriodicInSeconds,
+ };
+
+ ScopedAStatus status = getService()->scheduleTask(scheduleInfo);
+
+ ASSERT_FALSE(status.isOk());
+ ASSERT_EQ(status.getExceptionCode(), EX_ILLEGAL_ARGUMENT);
+}
+
+TEST_F(RemoteAccessServiceUnitTest, TestScheduleTask_InvalidArgFromGrpcServer) {
EXPECT_CALL(*getGrpcWakeupClientStub(), ScheduleTask)
.WillOnce([]([[maybe_unused]] ClientContext* context,
[[maybe_unused]] const ScheduleTaskRequest& request,
@@ -563,13 +637,13 @@
EXPECT_EQ(grpcRequest.scheduleid(), kTestScheduleId);
}
-TEST_F(RemoteAccessServiceUnitTest, testGetAllScheduledTasks) {
+TEST_F(RemoteAccessServiceUnitTest, testGetAllPendingScheduledTasks) {
std::vector<ScheduleInfo> result;
- GetAllScheduledTasksRequest grpcRequest = {};
- EXPECT_CALL(*getGrpcWakeupClientStub(), GetAllScheduledTasks)
+ GetAllPendingScheduledTasksRequest grpcRequest = {};
+ EXPECT_CALL(*getGrpcWakeupClientStub(), GetAllPendingScheduledTasks)
.WillOnce([&grpcRequest]([[maybe_unused]] ClientContext* context,
- const GetAllScheduledTasksRequest& request,
- GetAllScheduledTasksResponse* response) {
+ const GetAllPendingScheduledTasksRequest& request,
+ GetAllPendingScheduledTasksResponse* response) {
grpcRequest = request;
GrpcScheduleInfo* newInfo = response->add_allscheduledtasks();
newInfo->set_clientid(kTestClientId);
@@ -581,7 +655,7 @@
return Status();
});
- ScopedAStatus status = getService()->getAllScheduledTasks(kTestClientId, &result);
+ ScopedAStatus status = getService()->getAllPendingScheduledTasks(kTestClientId, &result);
ASSERT_TRUE(status.isOk());
EXPECT_EQ(grpcRequest.clientid(), kTestClientId);
diff --git a/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h b/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h
index 2aab904..41cc5d0 100644
--- a/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h
+++ b/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h
@@ -78,6 +78,7 @@
void waitForTask();
void stopWait();
bool isEmpty();
+ bool isStopped();
private:
friend class TaskTimeoutMessageHandler;
@@ -87,7 +88,7 @@
GUARDED_BY(mLock);
// A variable to notify mTasks is not empty.
std::condition_variable mTasksNotEmptyCv;
- std::atomic<bool> mStopped;
+ std::atomic<bool> mStopped = false;
android::sp<Looper> mLooper;
android::sp<TaskTimeoutMessageHandler> mTaskTimeoutMessageHandler;
std::atomic<int> mTaskIdCounter = 0;
@@ -138,9 +139,9 @@
const IsTaskScheduledRequest* request,
IsTaskScheduledResponse* response) override;
- grpc::Status GetAllScheduledTasks(grpc::ServerContext* context,
- const GetAllScheduledTasksRequest* request,
- GetAllScheduledTasksResponse* response) override;
+ grpc::Status GetAllPendingScheduledTasks(
+ grpc::ServerContext* context, const GetAllPendingScheduledTasksRequest* request,
+ GetAllPendingScheduledTasksResponse* response) override;
/**
* Starts generating fake tasks for the specific client repeatedly.
@@ -214,7 +215,7 @@
std::atomic<bool> mRemoteTaskConnectionAlive = false;
std::mutex mLock;
bool mGeneratingFakeTask GUARDED_BY(mLock);
- std::atomic<bool> mServerStopped;
+ std::atomic<bool> mServerStopped = false;
std::unordered_map<std::string, std::unordered_map<std::string, ScheduleInfo>>
mInfoByScheduleIdByClientId GUARDED_BY(mLock);
diff --git a/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp b/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp
index 1db991c..eed3495 100644
--- a/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp
+++ b/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp
@@ -105,6 +105,10 @@
});
}
+bool TaskQueue::isStopped() {
+ return mStopped;
+}
+
void TaskQueue::stopWait() {
mStopped = true;
{
@@ -241,7 +245,7 @@
while (true) {
mTaskQueue->waitForTask();
- if (mServerStopped) {
+ if (mTaskQueue->isStopped()) {
// Server stopped, exit the loop.
printf("Server stopped exit loop\n");
break;
@@ -250,11 +254,13 @@
while (true) {
auto maybeTask = mTaskQueue->maybePopOne();
if (!maybeTask.has_value()) {
+ printf("no task left\n");
// No task left, loop again and wait for another task(s).
break;
}
// Loop through all the task in the queue but obtain lock for each element so we don't
// hold lock while writing the response.
+ printf("Sending one remote task\n");
const GetRemoteTasksResponse& response = maybeTask.value();
if (!writer->Write(response)) {
// Broken stream, maybe the client is shutting down.
@@ -469,11 +475,11 @@
return Status::OK;
}
-Status TestWakeupClientServiceImpl::GetAllScheduledTasks(ServerContext* context,
- const GetAllScheduledTasksRequest* request,
- GetAllScheduledTasksResponse* response) {
+Status TestWakeupClientServiceImpl::GetAllPendingScheduledTasks(
+ ServerContext* context, const GetAllPendingScheduledTasksRequest* request,
+ GetAllPendingScheduledTasksResponse* response) {
const std::string& clientId = request->clientid();
- printf("GetAllScheduledTasks called with client Id: %s\n", clientId.c_str());
+ printf("GetAllPendingScheduledTasks called with client Id: %s\n", clientId.c_str());
response->clear_allscheduledtasks();
{
std::unique_lock lk(mLock);
diff --git a/automotive/remoteaccess/test_grpc_server/impl/test/TestWakeupClientServiceImplUnitTest.cpp b/automotive/remoteaccess/test_grpc_server/impl/test/TestWakeupClientServiceImplUnitTest.cpp
index 960020d..63458ae 100644
--- a/automotive/remoteaccess/test_grpc_server/impl/test/TestWakeupClientServiceImplUnitTest.cpp
+++ b/automotive/remoteaccess/test_grpc_server/impl/test/TestWakeupClientServiceImplUnitTest.cpp
@@ -280,7 +280,7 @@
EXPECT_EQ(getRemoteTaskResponses().size(), 0);
}
-TEST_F(TestWakeupClientServiceImplUnitTest, TestGetAllScheduledTasks) {
+TEST_F(TestWakeupClientServiceImplUnitTest, TestGetAllPendingScheduledTasks) {
std::string scheduleId1 = "scheduleId1";
std::string scheduleId2 = "scheduleId2";
int64_t time1 = getNow();
@@ -296,19 +296,19 @@
ASSERT_TRUE(status.ok());
ClientContext context;
- GetAllScheduledTasksRequest request;
- GetAllScheduledTasksResponse response;
+ GetAllPendingScheduledTasksRequest request;
+ GetAllPendingScheduledTasksResponse response;
request.set_clientid("invalid client Id");
- status = getStub()->GetAllScheduledTasks(&context, request, &response);
+ status = getStub()->GetAllPendingScheduledTasks(&context, request, &response);
ASSERT_TRUE(status.ok());
EXPECT_EQ(response.allscheduledtasks_size(), 0);
ClientContext context2;
- GetAllScheduledTasksRequest request2;
- GetAllScheduledTasksResponse response2;
+ GetAllPendingScheduledTasksRequest request2;
+ GetAllPendingScheduledTasksResponse response2;
request2.set_clientid(kTestClientId);
- status = getStub()->GetAllScheduledTasks(&context2, request2, &response2);
+ status = getStub()->GetAllPendingScheduledTasks(&context2, request2, &response2);
ASSERT_TRUE(status.ok());
ASSERT_EQ(response2.allscheduledtasks_size(), 2);
diff --git a/automotive/remoteaccess/vts/Android.bp b/automotive/remoteaccess/vts/Android.bp
new file mode 100644
index 0000000..8acd6a1
--- /dev/null
+++ b/automotive/remoteaccess/vts/Android.bp
@@ -0,0 +1,50 @@
+/*
+ * Copyright (C) 2023 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 {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_test {
+ name: "VtsHalAutomotiveRemoteAccess_TargetTest",
+ srcs: [
+ "src/*.cpp",
+ ],
+ static_libs: [
+ "android.hardware.automotive.remoteaccess-V2-ndk",
+ "libgtest",
+ "libgmock",
+ ],
+ shared_libs: [
+ "libbinder_ndk",
+ ],
+ test_suites: [
+ "general-tests",
+ "vts",
+ "automotive-tests",
+ "automotive-general-tests",
+ ],
+ defaults: [
+ "use_libaidlvintf_gtest_helper_static",
+ ],
+ require_root: true,
+ disable_framework: true,
+}
diff --git a/automotive/remoteaccess/vts/src/VtsHalAutomotiveRemoteAccess_TargetTest.cpp b/automotive/remoteaccess/vts/src/VtsHalAutomotiveRemoteAccess_TargetTest.cpp
new file mode 100644
index 0000000..0fb743e
--- /dev/null
+++ b/automotive/remoteaccess/vts/src/VtsHalAutomotiveRemoteAccess_TargetTest.cpp
@@ -0,0 +1,453 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+#define LOG_TAG "VtsHalAutomotiveRemoteAccess"
+
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/automotive/remoteaccess/ApState.h>
+#include <aidl/android/hardware/automotive/remoteaccess/BnRemoteTaskCallback.h>
+#include <aidl/android/hardware/automotive/remoteaccess/IRemoteAccess.h>
+#include <aidl/android/hardware/automotive/remoteaccess/ScheduleInfo.h>
+#include <aidl/android/hardware/automotive/remoteaccess/TaskType.h>
+#include <android-base/thread_annotations.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <gmock/gmock.h>
+#include <gtest/gtest.h>
+
+#include <algorithm>
+#include <chrono>
+#include <string>
+#include <thread>
+#include <vector>
+
+using ::aidl::android::hardware::automotive::remoteaccess::ApState;
+using ::aidl::android::hardware::automotive::remoteaccess::BnRemoteTaskCallback;
+using ::aidl::android::hardware::automotive::remoteaccess::IRemoteAccess;
+using ::aidl::android::hardware::automotive::remoteaccess::ScheduleInfo;
+using ::aidl::android::hardware::automotive::remoteaccess::TaskType;
+using ::android::getAidlHalInstanceNames;
+using ::android::PrintInstanceNameToString;
+using ::android::base::ScopedLockAssertion;
+using ::ndk::ScopedAStatus;
+using ::ndk::SharedRefBase;
+using ::ndk::SpAIBinder;
+using ::testing::UnorderedElementsAre;
+
+namespace {
+
+const std::string TEST_CLIENT_ID = "TEST CLIENT ID";
+const std::string TEST_SCHEDULE_ID = "TEST SCHEDULE ID";
+const std::string TEST_SCHEDULE_ID_1 = "TEST SCHEDULE ID 1";
+const std::string TEST_SCHEDULE_ID_2 = "TEST SCHEDULE ID 2";
+const std::vector<uint8_t> TEST_TASK_DATA =
+ std::vector<uint8_t>({static_cast<uint8_t>(0xde), static_cast<uint8_t>(0xad),
+ static_cast<uint8_t>(0xbe), static_cast<uint8_t>(0xef)});
+const int32_t JOB_DELAY_IN_SECONDS = 5;
+
+} // namespace
+
+class VtsHalAutomotiveRemoteAccessTargetTest : public testing::TestWithParam<std::string> {
+ public:
+ virtual void SetUp() override {
+ const std::string& name = GetParam();
+ mHal = IRemoteAccess::fromBinder(SpAIBinder(AServiceManager_waitForService(name.c_str())));
+ ASSERT_NE(mHal, nullptr) << "Failed to connect to remote access HAL: " << name;
+ }
+
+ virtual void TearDown() override {
+ if (mHal != nullptr) {
+ mHal->clearRemoteTaskCallback();
+ mHal->unscheduleAllTasks(TEST_CLIENT_ID);
+ }
+ }
+
+ protected:
+ std::shared_ptr<IRemoteAccess> mHal;
+
+ bool isTaskScheduleSupported();
+ int32_t getInterfaceVersion();
+ ScheduleInfo getTestScheduleInfo(int32_t delayInSeconds, int32_t count,
+ int32_t periodicInSeconds);
+ void setTaskCallbackAndReadyForTask(std::shared_ptr<BnRemoteTaskCallback> testCallback);
+};
+
+class TestRemoteTaskCallback final : public BnRemoteTaskCallback {
+ public:
+ ScopedAStatus onRemoteTaskRequested(const std::string& clientId,
+ const std::vector<uint8_t>& data) override {
+ {
+ std::unique_lock<std::mutex> lockGuard(mLock);
+ mClientIds.push_back(clientId);
+ mDataList.push_back(data);
+ }
+ mCv.notify_one();
+ return ScopedAStatus::ok();
+ }
+
+ const std::vector<std::string> getCalledClientIds() {
+ std::lock_guard<std::mutex> lockGuard(mLock);
+ return mClientIds;
+ }
+
+ const std::vector<std::vector<uint8_t>> getCalledDataList() {
+ std::lock_guard<std::mutex> lockGuard(mLock);
+ return mDataList;
+ }
+
+ bool waitForCallbacks(size_t count, int32_t timeoutInSeconds) {
+ std::unique_lock lk(mLock);
+ return mCv.wait_for(lk, std::chrono::seconds(timeoutInSeconds), [this, count] {
+ ScopedLockAssertion lockAssertion(mLock);
+ return mClientIds.size() >= count;
+ });
+ }
+
+ private:
+ std::mutex mLock;
+ std::vector<std::string> mClientIds GUARDED_BY(mLock);
+ std::vector<std::vector<uint8_t>> mDataList GUARDED_BY(mLock);
+ std::condition_variable mCv;
+};
+
+TEST_P(VtsHalAutomotiveRemoteAccessTargetTest, testGetVehicleId) {
+ std::string vehicleId;
+
+ ScopedAStatus status = mHal->getVehicleId(&vehicleId);
+
+ ASSERT_TRUE(status.isOk()) << "Failed to call getVehicleId";
+ ASSERT_FALSE(vehicleId.empty()) << "Vehicle ID must not be empty";
+}
+
+TEST_P(VtsHalAutomotiveRemoteAccessTargetTest, testGetWakeupServiceName) {
+ std::string wakeupServiceName;
+
+ ScopedAStatus status = mHal->getWakeupServiceName(&wakeupServiceName);
+
+ ASSERT_TRUE(status.isOk()) << "Failed to call getWakeupServiceName";
+ ASSERT_FALSE(wakeupServiceName.empty()) << "Wakeup service name must not be empty";
+}
+
+TEST_P(VtsHalAutomotiveRemoteAccessTargetTest, testGetProcessorId) {
+ std::string processorId;
+
+ ScopedAStatus status = mHal->getProcessorId(&processorId);
+
+ ASSERT_TRUE(status.isOk()) << "Failed to call getProcessorId";
+}
+
+TEST_P(VtsHalAutomotiveRemoteAccessTargetTest, testSetClearRemoteTaskCallback) {
+ std::shared_ptr<TestRemoteTaskCallback> testCallback =
+ SharedRefBase::make<TestRemoteTaskCallback>();
+
+ ScopedAStatus status = mHal->setRemoteTaskCallback(testCallback);
+
+ ASSERT_TRUE(status.isOk()) << "Failed to call setRemoteTaskCallback";
+
+ status = mHal->clearRemoteTaskCallback();
+
+ ASSERT_TRUE(status.isOk()) << "Failed to call clearRemoteTaskCallback";
+}
+
+TEST_P(VtsHalAutomotiveRemoteAccessTargetTest, testNotifyApStateChange) {
+ ApState apState = ApState{
+ .isReadyForRemoteTask = false,
+ .isWakeupRequired = false,
+ };
+
+ ScopedAStatus status = mHal->notifyApStateChange(apState);
+
+ ASSERT_TRUE(status.isOk()) << "Failed to call notifyApStateChange with state: "
+ << apState.toString();
+
+ apState = ApState{
+ .isReadyForRemoteTask = true,
+ .isWakeupRequired = false,
+ };
+
+ ASSERT_TRUE(status.isOk()) << "Failed to call notifyApStateChange with state: "
+ << apState.toString();
+}
+
+int32_t VtsHalAutomotiveRemoteAccessTargetTest::getInterfaceVersion() {
+ int32_t interfaceVersion = 0;
+ mHal->getInterfaceVersion(&interfaceVersion);
+ return interfaceVersion;
+}
+
+TEST_P(VtsHalAutomotiveRemoteAccessTargetTest, testIsTaskScheduleSupported) {
+ if (getInterfaceVersion() < 2) {
+ GTEST_SKIP() << "Require RemoteAccess HAL v2";
+ }
+
+ bool supported;
+
+ ScopedAStatus status = mHal->isTaskScheduleSupported(&supported);
+
+ ASSERT_TRUE(status.isOk()) << "Failed to call isTaskScheduleSupported";
+}
+
+bool VtsHalAutomotiveRemoteAccessTargetTest::isTaskScheduleSupported() {
+ bool supported = false;
+ mHal->isTaskScheduleSupported(&supported);
+ return supported;
+}
+
+TEST_P(VtsHalAutomotiveRemoteAccessTargetTest, testGetSupportedTaskTypesForScheduling) {
+ if (getInterfaceVersion() < 2) {
+ GTEST_SKIP() << "Require RemoteAccess HAL v2";
+ }
+
+ std::vector<TaskType> supportedTaskTypes;
+
+ ScopedAStatus status = mHal->getSupportedTaskTypesForScheduling(&supportedTaskTypes);
+
+ ASSERT_TRUE(status.isOk()) << "Failed to call getSupportedTaskTypesForScheduling";
+
+ if (!isTaskScheduleSupported()) {
+ ASSERT_TRUE(supportedTaskTypes.empty())
+ << "getSupportedTaskTypesForScheduling must return empty array "
+ << "if isTaskScheduleSupported is false";
+ return;
+ }
+
+ ASSERT_TRUE(std::find(supportedTaskTypes.begin(), supportedTaskTypes.end(), TaskType::CUSTOM) !=
+ supportedTaskTypes.end())
+ << "getSupportedTaskTypesForScheduling must contain TaskType::CUSTOM";
+}
+
+ScheduleInfo VtsHalAutomotiveRemoteAccessTargetTest::getTestScheduleInfo(
+ int32_t delayInSeconds, int32_t count, int32_t periodicInSeconds) {
+ auto nowInEpochSeconds = std::chrono::duration_cast<std::chrono::seconds>(
+ std::chrono::system_clock::now().time_since_epoch())
+ .count();
+
+ return ScheduleInfo{
+ .clientId = TEST_CLIENT_ID,
+ .scheduleId = TEST_SCHEDULE_ID,
+ .taskType = TaskType::CUSTOM,
+ .taskData = TEST_TASK_DATA,
+ .count = count,
+ .startTimeInEpochSeconds = nowInEpochSeconds + delayInSeconds,
+ .periodicInSeconds = periodicInSeconds,
+ };
+}
+
+void VtsHalAutomotiveRemoteAccessTargetTest::setTaskCallbackAndReadyForTask(
+ std::shared_ptr<BnRemoteTaskCallback> testCallback) {
+ mHal->setRemoteTaskCallback(testCallback);
+ // Notify isReadForRemoteTask to be true.
+ mHal->notifyApStateChange(ApState{
+ .isReadyForRemoteTask = true,
+ .isWakeupRequired = false,
+ });
+}
+
+TEST_P(VtsHalAutomotiveRemoteAccessTargetTest, testScheduleTask) {
+ if (getInterfaceVersion() < 2) {
+ GTEST_SKIP() << "Require RemoteAccess HAL v2";
+ }
+
+ std::shared_ptr<TestRemoteTaskCallback> testCallback =
+ SharedRefBase::make<TestRemoteTaskCallback>();
+ setTaskCallbackAndReadyForTask(testCallback);
+
+ int32_t count = 2;
+ ScheduleInfo scheduleInfo = getTestScheduleInfo(
+ /*delayInSeconds=*/JOB_DELAY_IN_SECONDS, count, /*periodicInSeconds=*/1);
+ ScopedAStatus status = mHal->scheduleTask(scheduleInfo);
+
+ if (!isTaskScheduleSupported()) {
+ ASSERT_FALSE(status.isOk()) << "scheduleTask must return EX_ILLEGAL_ARGUMENT "
+ << "if isTaskScheduleSupported is false";
+ ASSERT_EQ(status.getExceptionCode(), EX_ILLEGAL_ARGUMENT)
+ << "scheduleTask must return EX_ILLEGAL_ARGUMENT "
+ << "if isTaskScheduleSupported is false";
+ return;
+ }
+
+ ASSERT_TRUE(status.isOk()) << "Failed to call scheduleTask with scheduleInfo: "
+ << scheduleInfo.toString();
+
+ int32_t timeoutInSeconds = JOB_DELAY_IN_SECONDS + 5;
+ bool gotCallbacks = testCallback->waitForCallbacks(count, timeoutInSeconds);
+ // unschedule the task before checking the result.
+ mHal->unscheduleTask(TEST_CLIENT_ID, TEST_SCHEDULE_ID);
+
+ ASSERT_TRUE(gotCallbacks) << "Callbacks is not called enough times before timeout: "
+ << timeoutInSeconds << "s";
+ std::vector<std::vector<uint8_t>> dataList = testCallback->getCalledDataList();
+ std::vector<std::string> clientIds = testCallback->getCalledClientIds();
+
+ for (size_t i = 0; i < dataList.size(); i++) {
+ EXPECT_EQ(dataList[i], TEST_TASK_DATA) << "Must receive expected task data";
+ EXPECT_EQ(clientIds[i], TEST_CLIENT_ID) << "Must receive expected client id";
+ }
+}
+
+TEST_P(VtsHalAutomotiveRemoteAccessTargetTest, testUnscheduleTask) {
+ if (getInterfaceVersion() < 2) {
+ GTEST_SKIP() << "Require RemoteAccess HAL v2";
+ }
+
+ std::shared_ptr<TestRemoteTaskCallback> testCallback =
+ SharedRefBase::make<TestRemoteTaskCallback>();
+ setTaskCallbackAndReadyForTask(testCallback);
+
+ ScheduleInfo scheduleInfo = getTestScheduleInfo(
+ /*delayInSeconds=*/JOB_DELAY_IN_SECONDS, /*count=*/1, /*periodicInSeconds=*/0);
+ mHal->scheduleTask(scheduleInfo);
+ ScopedAStatus status = mHal->unscheduleTask(TEST_CLIENT_ID, TEST_SCHEDULE_ID);
+
+ ASSERT_TRUE(status.isOk()) << "Failed to call unscheduleTask";
+
+ // If not cancelled, should be called in 5s, wait for 6s and make sure no task arrives.
+ std::this_thread::sleep_for(std::chrono::seconds(JOB_DELAY_IN_SECONDS + 1));
+
+ ASSERT_TRUE(testCallback->getCalledClientIds().empty())
+ << "Remote task callback must not be called if the task is cancelled";
+}
+
+TEST_P(VtsHalAutomotiveRemoteAccessTargetTest, testUnscheduleAllTasks) {
+ if (getInterfaceVersion() < 2) {
+ GTEST_SKIP() << "Require RemoteAccess HAL v2";
+ }
+
+ std::shared_ptr<TestRemoteTaskCallback> testCallback =
+ SharedRefBase::make<TestRemoteTaskCallback>();
+ setTaskCallbackAndReadyForTask(testCallback);
+
+ ScheduleInfo scheduleInfo = getTestScheduleInfo(
+ /*delayInSeconds=*/JOB_DELAY_IN_SECONDS, /*count=*/1, /*periodicInSeconds=*/0);
+ mHal->scheduleTask(scheduleInfo);
+ ScopedAStatus status = mHal->unscheduleAllTasks(TEST_CLIENT_ID);
+
+ ASSERT_TRUE(status.isOk()) << "Failed to call unscheduleAllTasks";
+
+ // If not cancelled, should be called in 5s, wait for 6s and make sure no task arrives.
+ std::this_thread::sleep_for(std::chrono::seconds(JOB_DELAY_IN_SECONDS + 1));
+
+ ASSERT_TRUE(testCallback->getCalledClientIds().empty())
+ << "Remote task callback must not be called if the task is cancelled";
+}
+
+TEST_P(VtsHalAutomotiveRemoteAccessTargetTest, testIsTaskScheduled) {
+ if (getInterfaceVersion() < 2) {
+ GTEST_SKIP() << "Require RemoteAccess HAL v2";
+ }
+
+ std::shared_ptr<TestRemoteTaskCallback> testCallback =
+ SharedRefBase::make<TestRemoteTaskCallback>();
+ setTaskCallbackAndReadyForTask(testCallback);
+
+ ScheduleInfo scheduleInfo = getTestScheduleInfo(
+ /*delayInSeconds=*/JOB_DELAY_IN_SECONDS, /*count=*/1, /*periodicInSeconds=*/0);
+ mHal->scheduleTask(scheduleInfo);
+
+ bool scheduled;
+ ScopedAStatus status = mHal->isTaskScheduled(TEST_CLIENT_ID, TEST_SCHEDULE_ID, &scheduled);
+
+ ASSERT_TRUE(status.isOk()) << "Failed to call unscheduleTask";
+
+ if (!isTaskScheduleSupported()) {
+ ASSERT_FALSE(scheduled) << "isTaskScheduled must return false "
+ << "if isTaskScheduleSupported is false";
+ return;
+ }
+
+ ASSERT_TRUE(scheduled) << "isTaskScheduled must return true if the task is scheduled";
+
+ mHal->unscheduleAllTasks(TEST_CLIENT_ID);
+ status = mHal->isTaskScheduled(TEST_CLIENT_ID, TEST_SCHEDULE_ID, &scheduled);
+
+ ASSERT_TRUE(status.isOk()) << "Failed to call unscheduleTask";
+ ASSERT_FALSE(scheduled) << "isTaskScheduled must return false if the task is not scheduled";
+}
+
+TEST_P(VtsHalAutomotiveRemoteAccessTargetTest, testGetAllPendingScheduledTasks) {
+ if (getInterfaceVersion() < 2) {
+ GTEST_SKIP() << "Require RemoteAccess HAL v2";
+ }
+
+ std::shared_ptr<TestRemoteTaskCallback> testCallback =
+ SharedRefBase::make<TestRemoteTaskCallback>();
+ setTaskCallbackAndReadyForTask(testCallback);
+
+ auto nowInEpochSeconds = std::chrono::duration_cast<std::chrono::seconds>(
+ std::chrono::system_clock::now().time_since_epoch())
+ .count();
+
+ ScheduleInfo scheduleInfo1 = ScheduleInfo{
+ .clientId = TEST_CLIENT_ID,
+ .scheduleId = TEST_SCHEDULE_ID_1,
+ .taskType = TaskType::CUSTOM,
+ .taskData = TEST_TASK_DATA,
+ .count = 1,
+ .startTimeInEpochSeconds = nowInEpochSeconds + 5,
+ .periodicInSeconds = 0,
+ };
+ ScheduleInfo scheduleInfo2 = ScheduleInfo{
+ .clientId = TEST_CLIENT_ID,
+ .scheduleId = TEST_SCHEDULE_ID_2,
+ .taskType = TaskType::CUSTOM,
+ .taskData = TEST_TASK_DATA,
+ .count = 10,
+ .startTimeInEpochSeconds = nowInEpochSeconds + 10,
+ .periodicInSeconds = 1,
+ };
+ mHal->scheduleTask(scheduleInfo1);
+ mHal->scheduleTask(scheduleInfo2);
+
+ std::vector<ScheduleInfo> outScheduleInfo;
+ ScopedAStatus status = mHal->getAllPendingScheduledTasks(TEST_CLIENT_ID, &outScheduleInfo);
+
+ ASSERT_TRUE(status.isOk()) << "Failed to call getAllPendingScheduledTasks";
+
+ if (!isTaskScheduleSupported()) {
+ ASSERT_TRUE(outScheduleInfo.empty())
+ << "Must return empty array for getAllPendingScheduledTasks "
+ << "if isTaskScheduleSupported is false";
+ return;
+ }
+
+ ASSERT_THAT(outScheduleInfo, UnorderedElementsAre(scheduleInfo1, scheduleInfo2))
+ << "expected all pending schedule info mismatch";
+
+ mHal->unscheduleTask(TEST_CLIENT_ID, TEST_SCHEDULE_ID_1);
+
+ status = mHal->getAllPendingScheduledTasks(TEST_CLIENT_ID, &outScheduleInfo);
+
+ ASSERT_TRUE(status.isOk()) << "Failed to call getAllPendingScheduledTasks";
+
+ ASSERT_THAT(outScheduleInfo, UnorderedElementsAre(scheduleInfo2))
+ << "expected all pending schedule info mismatch";
+}
+
+// It is possible that no remote access HAL is registered.
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(VtsHalAutomotiveRemoteAccessTargetTest);
+
+INSTANTIATE_TEST_SUITE_P(PerInstance, VtsHalAutomotiveRemoteAccessTargetTest,
+ testing::ValuesIn(getAidlHalInstanceNames(IRemoteAccess::descriptor)),
+ PrintInstanceNameToString);
+
+int main(int argc, char** argv) {
+ ::testing::InitGoogleTest(&argc, argv);
+ // Starts a process pool for callbacks.
+ ABinderProcess_setThreadPoolMaxThreadCount(1);
+ ABinderProcess_startThreadPool();
+ return RUN_ALL_TESTS();
+}
diff --git a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp
index b56a190..82e357f 100644
--- a/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp
+++ b/automotive/vehicle/2.0/default/impl/vhal_v2_0/DefaultVehicleHal.cpp
@@ -494,7 +494,11 @@
}
for (int areaId : areaIds) {
- auto v = pool.obtain(*mPropStore->refreshTimestamp(property, areaId));
+ auto refreshedProp = mPropStore->refreshTimestamp(property, areaId);
+ VehiclePropValuePtr v = nullptr;
+ if (refreshedProp != nullptr) {
+ v = pool.obtain(*refreshedProp);
+ }
if (v.get()) {
events.push_back(std::move(v));
}
diff --git a/automotive/vehicle/Android.bp b/automotive/vehicle/Android.bp
index 3549519..e614937 100644
--- a/automotive/vehicle/Android.bp
+++ b/automotive/vehicle/Android.bp
@@ -25,3 +25,11 @@
"android.hardware.automotive.vehicle.property-V3-ndk",
],
}
+
+rust_defaults {
+ name: "VehicleHalInterfaceRustDefaults",
+ rustlibs: [
+ "android.hardware.automotive.vehicle-V3-rust",
+ "android.hardware.automotive.vehicle.property-V3-rust",
+ ],
+}
diff --git a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl
index 69f6190..14469b5 100644
--- a/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl
+++ b/automotive/vehicle/aidl/android/hardware/automotive/vehicle/SubscribeOptions.aidl
@@ -45,8 +45,8 @@
*
* This value indicates the resolution at which continuous property updates should be sent to
* the platform. For example, if resolution is 0.01, the subscribed property value should be
- * rounded to two decimal places. If the incoming resolution value is not an integer multiple of
- * 10, VHAL should return a StatusCode::INVALID_ARG.
+ * rounded to two decimal places. If the incoming resolution value is not an integer power of
+ * 10 (i.e. 10^-2, 10^-1, 10^2, etc.), VHAL should return a StatusCode::INVALID_ARG.
*/
float resolution = 0.0f;
diff --git a/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json b/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
index 235bf43..c00e64c 100644
--- a/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
+++ b/automotive/vehicle/aidl/emu_metadata/android.hardware.automotive.vehicle-types-meta.json
@@ -16,7 +16,7 @@
"value": 286261506
},
{
- "name": "Model year of vehicle.",
+ "name": "INFO_MODEL_YEAR",
"value": 289407235
},
{
@@ -441,6 +441,10 @@
"value": 287312389
},
{
+ "name": "Head up display (HUD) enabled",
+ "value": 354421254
+ },
+ {
"name": "HW_KEY_INPUT",
"value": 289475088
},
@@ -774,7 +778,7 @@
},
{
"name": "ULTRASONICS_SENSOR_ORIENTATION",
- "value": 406916129
+ "value": 409013281
},
{
"name": "ULTRASONICS_SENSOR_FIELD_OF_VIEW",
@@ -789,6 +793,10 @@
"value": 406916132
},
{
+ "name": "ULTRASONICS_SENSOR_MEASURED_DISTANCE",
+ "value": 406916133
+ },
+ {
"name": "OBD2 Live Sensor Data",
"value": 299896064
},
@@ -1360,6 +1368,19 @@
"ErrorState"
],
"data_enum": "CrossTrafficMonitoringWarningState"
+ },
+ {
+ "name": "LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_ENABLED",
+ "value": 287313957
+ },
+ {
+ "name": "LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE",
+ "value": 289411110,
+ "data_enums": [
+ "LowSpeedAutomaticEmergencyBrakingState",
+ "ErrorState"
+ ],
+ "data_enum": "LowSpeedAutomaticEmergencyBrakingState"
}
]
},
@@ -2352,6 +2373,28 @@
]
},
{
+ "name": "LowSpeedAutomaticEmergencyBrakingState",
+ "package": "android.hardware.automotive.vehicle",
+ "values": [
+ {
+ "name": "OTHER",
+ "value": 0
+ },
+ {
+ "name": "ENABLED",
+ "value": 1
+ },
+ {
+ "name": "ACTIVATED",
+ "value": 2
+ },
+ {
+ "name": "USER_OVERRIDE",
+ "value": 3
+ }
+ ]
+ },
+ {
"name": "LaneCenteringAssistState",
"package": "android.hardware.automotive.vehicle",
"values": [
diff --git a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h
index e7d4464..15056e2 100644
--- a/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h
+++ b/automotive/vehicle/aidl/generated_lib/cpp/AccessForVehicleProperty.h
@@ -22,8 +22,7 @@
// clang-format off
-#ifndef android_hardware_automotive_vehicle_aidl_generated_lib_AccessForVehicleProperty_H_
-#define android_hardware_automotive_vehicle_aidl_generated_lib_AccessForVehicleProperty_H_
+#pragma once
#include <aidl/android/hardware/automotive/vehicle/VehicleProperty.h>
#include <aidl/android/hardware/automotive/vehicle/VehiclePropertyAccess.h>
@@ -125,6 +124,7 @@
{VehicleProperty::DISPLAY_BRIGHTNESS, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::PER_DISPLAY_BRIGHTNESS, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::VALET_MODE_ENABLED, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::HEAD_UP_DISPLAY_ENABLED, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::HW_KEY_INPUT, VehiclePropertyAccess::READ},
{VehicleProperty::HW_KEY_INPUT_V2, VehiclePropertyAccess::READ},
{VehicleProperty::HW_MOTION_INPUT, VehiclePropertyAccess::READ},
@@ -204,6 +204,7 @@
{VehicleProperty::ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyAccess::READ},
{VehicleProperty::ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyAccess::READ},
{VehicleProperty::ULTRASONICS_SENSOR_SUPPORTED_RANGES, VehiclePropertyAccess::READ},
+ {VehicleProperty::ULTRASONICS_SENSOR_MEASURED_DISTANCE, VehiclePropertyAccess::READ},
{VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyAccess::READ},
{VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyAccess::READ},
{VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess::READ},
@@ -298,6 +299,8 @@
{VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyAccess::READ},
{VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyAccess::READ_WRITE},
{VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE, VehiclePropertyAccess::READ},
+ {VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyAccess::READ_WRITE},
+ {VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess::READ},
};
} // namespace vehicle
@@ -305,5 +308,3 @@
} // namespace hardware
} // namespace android
} // aidl
-
-#endif // android_hardware_automotive_vehicle_aidl_generated_lib_AccessForVehicleProperty_H_
diff --git a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h
index 3a46a92..d3f97e3 100644
--- a/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h
+++ b/automotive/vehicle/aidl/generated_lib/cpp/ChangeModeForVehicleProperty.h
@@ -22,8 +22,7 @@
// clang-format off
-#ifndef android_hardware_automotive_vehicle_aidl_generated_lib_ChangeModeForVehicleProperty_H_
-#define android_hardware_automotive_vehicle_aidl_generated_lib_ChangeModeForVehicleProperty_H_
+#pragma once
#include <aidl/android/hardware/automotive/vehicle/VehicleProperty.h>
#include <aidl/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.h>
@@ -125,6 +124,7 @@
{VehicleProperty::DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::PER_DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::VALET_MODE_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::HEAD_UP_DISPLAY_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::HW_KEY_INPUT, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::HW_KEY_INPUT_V2, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::HW_MOTION_INPUT, VehiclePropertyChangeMode::ON_CHANGE},
@@ -204,6 +204,7 @@
{VehicleProperty::ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyChangeMode::STATIC},
{VehicleProperty::ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyChangeMode::STATIC},
{VehicleProperty::ULTRASONICS_SENSOR_SUPPORTED_RANGES, VehiclePropertyChangeMode::STATIC},
+ {VehicleProperty::ULTRASONICS_SENSOR_MEASURED_DISTANCE, VehiclePropertyChangeMode::CONTINUOUS},
{VehicleProperty::OBD2_LIVE_FRAME, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::OBD2_FREEZE_FRAME, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::OBD2_FREEZE_FRAME_INFO, VehiclePropertyChangeMode::ON_CHANGE},
@@ -298,6 +299,8 @@
{VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
{VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyChangeMode::ON_CHANGE},
+ {VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyChangeMode::ON_CHANGE},
};
} // namespace vehicle
@@ -305,5 +308,3 @@
} // namespace hardware
} // namespace android
} // aidl
-
-#endif // android_hardware_automotive_vehicle_aidl_generated_lib_ChangeModeForVehicleProperty_H_
diff --git a/automotive/vehicle/aidl/generated_lib/cpp/VersionForVehicleProperty.h b/automotive/vehicle/aidl/generated_lib/cpp/VersionForVehicleProperty.h
new file mode 100644
index 0000000..70c914d
--- /dev/null
+++ b/automotive/vehicle/aidl/generated_lib/cpp/VersionForVehicleProperty.h
@@ -0,0 +1,309 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+
+/**
+ * DO NOT EDIT MANUALLY!!!
+ *
+ * Generated by tools/generate_annotation_enums.py.
+ */
+
+// clang-format off
+
+#pragma once
+
+#include <aidl/android/hardware/automotive/vehicle/VehicleProperty.h>
+
+#include <unordered_map>
+
+namespace aidl {
+namespace android {
+namespace hardware {
+namespace automotive {
+namespace vehicle {
+
+std::unordered_map<VehicleProperty, int32_t> VersionForVehicleProperty = {
+ {VehicleProperty::INFO_VIN, 2},
+ {VehicleProperty::INFO_MAKE, 2},
+ {VehicleProperty::INFO_MODEL, 2},
+ {VehicleProperty::INFO_MODEL_YEAR, 2},
+ {VehicleProperty::INFO_FUEL_CAPACITY, 2},
+ {VehicleProperty::INFO_FUEL_TYPE, 2},
+ {VehicleProperty::INFO_EV_BATTERY_CAPACITY, 2},
+ {VehicleProperty::INFO_EV_CONNECTOR_TYPE, 2},
+ {VehicleProperty::INFO_FUEL_DOOR_LOCATION, 2},
+ {VehicleProperty::INFO_EV_PORT_LOCATION, 2},
+ {VehicleProperty::INFO_DRIVER_SEAT, 2},
+ {VehicleProperty::INFO_EXTERIOR_DIMENSIONS, 2},
+ {VehicleProperty::INFO_MULTI_EV_PORT_LOCATIONS, 2},
+ {VehicleProperty::PERF_ODOMETER, 2},
+ {VehicleProperty::PERF_VEHICLE_SPEED, 2},
+ {VehicleProperty::PERF_VEHICLE_SPEED_DISPLAY, 2},
+ {VehicleProperty::PERF_STEERING_ANGLE, 2},
+ {VehicleProperty::PERF_REAR_STEERING_ANGLE, 2},
+ {VehicleProperty::ENGINE_COOLANT_TEMP, 2},
+ {VehicleProperty::ENGINE_OIL_LEVEL, 2},
+ {VehicleProperty::ENGINE_OIL_TEMP, 2},
+ {VehicleProperty::ENGINE_RPM, 2},
+ {VehicleProperty::WHEEL_TICK, 2},
+ {VehicleProperty::FUEL_LEVEL, 2},
+ {VehicleProperty::FUEL_DOOR_OPEN, 2},
+ {VehicleProperty::EV_BATTERY_LEVEL, 2},
+ {VehicleProperty::EV_CURRENT_BATTERY_CAPACITY, 2},
+ {VehicleProperty::EV_CHARGE_PORT_OPEN, 2},
+ {VehicleProperty::EV_CHARGE_PORT_CONNECTED, 2},
+ {VehicleProperty::EV_BATTERY_INSTANTANEOUS_CHARGE_RATE, 2},
+ {VehicleProperty::RANGE_REMAINING, 2},
+ {VehicleProperty::EV_BATTERY_AVERAGE_TEMPERATURE, 3},
+ {VehicleProperty::TIRE_PRESSURE, 2},
+ {VehicleProperty::CRITICALLY_LOW_TIRE_PRESSURE, 2},
+ {VehicleProperty::ENGINE_IDLE_AUTO_STOP_ENABLED, 2},
+ {VehicleProperty::IMPACT_DETECTED, 3},
+ {VehicleProperty::GEAR_SELECTION, 2},
+ {VehicleProperty::CURRENT_GEAR, 2},
+ {VehicleProperty::PARKING_BRAKE_ON, 2},
+ {VehicleProperty::PARKING_BRAKE_AUTO_APPLY, 2},
+ {VehicleProperty::EV_BRAKE_REGENERATION_LEVEL, 2},
+ {VehicleProperty::FUEL_LEVEL_LOW, 2},
+ {VehicleProperty::NIGHT_MODE, 2},
+ {VehicleProperty::TURN_SIGNAL_STATE, 2},
+ {VehicleProperty::IGNITION_STATE, 2},
+ {VehicleProperty::ABS_ACTIVE, 2},
+ {VehicleProperty::TRACTION_CONTROL_ACTIVE, 2},
+ {VehicleProperty::EV_STOPPING_MODE, 2},
+ {VehicleProperty::ELECTRONIC_STABILITY_CONTROL_ENABLED, 3},
+ {VehicleProperty::ELECTRONIC_STABILITY_CONTROL_STATE, 2},
+ {VehicleProperty::HVAC_FAN_SPEED, 2},
+ {VehicleProperty::HVAC_FAN_DIRECTION, 2},
+ {VehicleProperty::HVAC_TEMPERATURE_CURRENT, 2},
+ {VehicleProperty::HVAC_TEMPERATURE_SET, 2},
+ {VehicleProperty::HVAC_DEFROSTER, 2},
+ {VehicleProperty::HVAC_AC_ON, 2},
+ {VehicleProperty::HVAC_MAX_AC_ON, 2},
+ {VehicleProperty::HVAC_MAX_DEFROST_ON, 2},
+ {VehicleProperty::HVAC_RECIRC_ON, 2},
+ {VehicleProperty::HVAC_DUAL_ON, 2},
+ {VehicleProperty::HVAC_AUTO_ON, 2},
+ {VehicleProperty::HVAC_SEAT_TEMPERATURE, 2},
+ {VehicleProperty::HVAC_SIDE_MIRROR_HEAT, 2},
+ {VehicleProperty::HVAC_STEERING_WHEEL_HEAT, 2},
+ {VehicleProperty::HVAC_TEMPERATURE_DISPLAY_UNITS, 2},
+ {VehicleProperty::HVAC_ACTUAL_FAN_SPEED_RPM, 2},
+ {VehicleProperty::HVAC_POWER_ON, 2},
+ {VehicleProperty::HVAC_FAN_DIRECTION_AVAILABLE, 2},
+ {VehicleProperty::HVAC_AUTO_RECIRC_ON, 2},
+ {VehicleProperty::HVAC_SEAT_VENTILATION, 2},
+ {VehicleProperty::HVAC_ELECTRIC_DEFROSTER_ON, 2},
+ {VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION, 2},
+ {VehicleProperty::DISTANCE_DISPLAY_UNITS, 2},
+ {VehicleProperty::FUEL_VOLUME_DISPLAY_UNITS, 2},
+ {VehicleProperty::TIRE_PRESSURE_DISPLAY_UNITS, 2},
+ {VehicleProperty::EV_BATTERY_DISPLAY_UNITS, 2},
+ {VehicleProperty::FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME, 2},
+ {VehicleProperty::VEHICLE_SPEED_DISPLAY_UNITS, 2},
+ {VehicleProperty::EXTERNAL_CAR_TIME, 2},
+ {VehicleProperty::ANDROID_EPOCH_TIME, 2},
+ {VehicleProperty::STORAGE_ENCRYPTION_BINDING_SEED, 2},
+ {VehicleProperty::ENV_OUTSIDE_TEMPERATURE, 2},
+ {VehicleProperty::AP_POWER_STATE_REQ, 2},
+ {VehicleProperty::AP_POWER_STATE_REPORT, 2},
+ {VehicleProperty::AP_POWER_BOOTUP_REASON, 2},
+ {VehicleProperty::DISPLAY_BRIGHTNESS, 2},
+ {VehicleProperty::PER_DISPLAY_BRIGHTNESS, 2},
+ {VehicleProperty::VALET_MODE_ENABLED, 3},
+ {VehicleProperty::HEAD_UP_DISPLAY_ENABLED, 3},
+ {VehicleProperty::HW_KEY_INPUT, 2},
+ {VehicleProperty::HW_KEY_INPUT_V2, 2},
+ {VehicleProperty::HW_MOTION_INPUT, 2},
+ {VehicleProperty::HW_ROTARY_INPUT, 2},
+ {VehicleProperty::HW_CUSTOM_INPUT, 2},
+ {VehicleProperty::DOOR_POS, 2},
+ {VehicleProperty::DOOR_MOVE, 2},
+ {VehicleProperty::DOOR_LOCK, 2},
+ {VehicleProperty::DOOR_CHILD_LOCK_ENABLED, 2},
+ {VehicleProperty::MIRROR_Z_POS, 2},
+ {VehicleProperty::MIRROR_Z_MOVE, 2},
+ {VehicleProperty::MIRROR_Y_POS, 2},
+ {VehicleProperty::MIRROR_Y_MOVE, 2},
+ {VehicleProperty::MIRROR_LOCK, 2},
+ {VehicleProperty::MIRROR_FOLD, 2},
+ {VehicleProperty::MIRROR_AUTO_FOLD_ENABLED, 2},
+ {VehicleProperty::MIRROR_AUTO_TILT_ENABLED, 2},
+ {VehicleProperty::SEAT_MEMORY_SELECT, 2},
+ {VehicleProperty::SEAT_MEMORY_SET, 2},
+ {VehicleProperty::SEAT_BELT_BUCKLED, 2},
+ {VehicleProperty::SEAT_BELT_HEIGHT_POS, 2},
+ {VehicleProperty::SEAT_BELT_HEIGHT_MOVE, 2},
+ {VehicleProperty::SEAT_FORE_AFT_POS, 2},
+ {VehicleProperty::SEAT_FORE_AFT_MOVE, 2},
+ {VehicleProperty::SEAT_BACKREST_ANGLE_1_POS, 2},
+ {VehicleProperty::SEAT_BACKREST_ANGLE_1_MOVE, 2},
+ {VehicleProperty::SEAT_BACKREST_ANGLE_2_POS, 2},
+ {VehicleProperty::SEAT_BACKREST_ANGLE_2_MOVE, 2},
+ {VehicleProperty::SEAT_HEIGHT_POS, 2},
+ {VehicleProperty::SEAT_HEIGHT_MOVE, 2},
+ {VehicleProperty::SEAT_DEPTH_POS, 2},
+ {VehicleProperty::SEAT_DEPTH_MOVE, 2},
+ {VehicleProperty::SEAT_TILT_POS, 2},
+ {VehicleProperty::SEAT_TILT_MOVE, 2},
+ {VehicleProperty::SEAT_LUMBAR_FORE_AFT_POS, 2},
+ {VehicleProperty::SEAT_LUMBAR_FORE_AFT_MOVE, 2},
+ {VehicleProperty::SEAT_LUMBAR_SIDE_SUPPORT_POS, 2},
+ {VehicleProperty::SEAT_LUMBAR_SIDE_SUPPORT_MOVE, 2},
+ {VehicleProperty::SEAT_HEADREST_HEIGHT_POS, 2},
+ {VehicleProperty::SEAT_HEADREST_HEIGHT_POS_V2, 2},
+ {VehicleProperty::SEAT_HEADREST_HEIGHT_MOVE, 2},
+ {VehicleProperty::SEAT_HEADREST_ANGLE_POS, 2},
+ {VehicleProperty::SEAT_HEADREST_ANGLE_MOVE, 2},
+ {VehicleProperty::SEAT_HEADREST_FORE_AFT_POS, 2},
+ {VehicleProperty::SEAT_HEADREST_FORE_AFT_MOVE, 2},
+ {VehicleProperty::SEAT_FOOTWELL_LIGHTS_STATE, 2},
+ {VehicleProperty::SEAT_FOOTWELL_LIGHTS_SWITCH, 2},
+ {VehicleProperty::SEAT_EASY_ACCESS_ENABLED, 2},
+ {VehicleProperty::SEAT_AIRBAG_ENABLED, 3},
+ {VehicleProperty::SEAT_AIRBAGS_DEPLOYED, 2},
+ {VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_POS, 2},
+ {VehicleProperty::SEAT_CUSHION_SIDE_SUPPORT_MOVE, 2},
+ {VehicleProperty::SEAT_LUMBAR_VERTICAL_POS, 2},
+ {VehicleProperty::SEAT_LUMBAR_VERTICAL_MOVE, 2},
+ {VehicleProperty::SEAT_WALK_IN_POS, 2},
+ {VehicleProperty::SEAT_BELT_PRETENSIONER_DEPLOYED, 3},
+ {VehicleProperty::SEAT_OCCUPANCY, 2},
+ {VehicleProperty::WINDOW_POS, 2},
+ {VehicleProperty::WINDOW_MOVE, 2},
+ {VehicleProperty::WINDOW_LOCK, 2},
+ {VehicleProperty::WINDSHIELD_WIPERS_PERIOD, 2},
+ {VehicleProperty::WINDSHIELD_WIPERS_STATE, 2},
+ {VehicleProperty::WINDSHIELD_WIPERS_SWITCH, 2},
+ {VehicleProperty::STEERING_WHEEL_DEPTH_POS, 2},
+ {VehicleProperty::STEERING_WHEEL_DEPTH_MOVE, 2},
+ {VehicleProperty::STEERING_WHEEL_HEIGHT_POS, 2},
+ {VehicleProperty::STEERING_WHEEL_HEIGHT_MOVE, 2},
+ {VehicleProperty::STEERING_WHEEL_THEFT_LOCK_ENABLED, 2},
+ {VehicleProperty::STEERING_WHEEL_LOCKED, 2},
+ {VehicleProperty::STEERING_WHEEL_EASY_ACCESS_ENABLED, 2},
+ {VehicleProperty::GLOVE_BOX_DOOR_POS, 2},
+ {VehicleProperty::GLOVE_BOX_LOCKED, 2},
+ {VehicleProperty::VEHICLE_MAP_SERVICE, 2},
+ {VehicleProperty::LOCATION_CHARACTERIZATION, 2},
+ {VehicleProperty::ULTRASONICS_SENSOR_POSITION, 3},
+ {VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION, 3},
+ {VehicleProperty::ULTRASONICS_SENSOR_FIELD_OF_VIEW, 3},
+ {VehicleProperty::ULTRASONICS_SENSOR_DETECTION_RANGE, 3},
+ {VehicleProperty::ULTRASONICS_SENSOR_SUPPORTED_RANGES, 3},
+ {VehicleProperty::ULTRASONICS_SENSOR_MEASURED_DISTANCE, 3},
+ {VehicleProperty::OBD2_LIVE_FRAME, 2},
+ {VehicleProperty::OBD2_FREEZE_FRAME, 2},
+ {VehicleProperty::OBD2_FREEZE_FRAME_INFO, 2},
+ {VehicleProperty::OBD2_FREEZE_FRAME_CLEAR, 2},
+ {VehicleProperty::HEADLIGHTS_STATE, 2},
+ {VehicleProperty::HIGH_BEAM_LIGHTS_STATE, 2},
+ {VehicleProperty::FOG_LIGHTS_STATE, 2},
+ {VehicleProperty::HAZARD_LIGHTS_STATE, 2},
+ {VehicleProperty::HEADLIGHTS_SWITCH, 2},
+ {VehicleProperty::HIGH_BEAM_LIGHTS_SWITCH, 2},
+ {VehicleProperty::FOG_LIGHTS_SWITCH, 2},
+ {VehicleProperty::HAZARD_LIGHTS_SWITCH, 2},
+ {VehicleProperty::CABIN_LIGHTS_STATE, 2},
+ {VehicleProperty::CABIN_LIGHTS_SWITCH, 2},
+ {VehicleProperty::READING_LIGHTS_STATE, 2},
+ {VehicleProperty::READING_LIGHTS_SWITCH, 2},
+ {VehicleProperty::STEERING_WHEEL_LIGHTS_STATE, 2},
+ {VehicleProperty::STEERING_WHEEL_LIGHTS_SWITCH, 2},
+ {VehicleProperty::SUPPORT_CUSTOMIZE_VENDOR_PERMISSION, 2},
+ {VehicleProperty::DISABLED_OPTIONAL_FEATURES, 2},
+ {VehicleProperty::INITIAL_USER_INFO, 2},
+ {VehicleProperty::SWITCH_USER, 2},
+ {VehicleProperty::CREATE_USER, 2},
+ {VehicleProperty::REMOVE_USER, 2},
+ {VehicleProperty::USER_IDENTIFICATION_ASSOCIATION, 2},
+ {VehicleProperty::EVS_SERVICE_REQUEST, 2},
+ {VehicleProperty::POWER_POLICY_REQ, 2},
+ {VehicleProperty::POWER_POLICY_GROUP_REQ, 2},
+ {VehicleProperty::CURRENT_POWER_POLICY, 2},
+ {VehicleProperty::WATCHDOG_ALIVE, 2},
+ {VehicleProperty::WATCHDOG_TERMINATED_PROCESS, 2},
+ {VehicleProperty::VHAL_HEARTBEAT, 2},
+ {VehicleProperty::CLUSTER_SWITCH_UI, 2},
+ {VehicleProperty::CLUSTER_DISPLAY_STATE, 2},
+ {VehicleProperty::CLUSTER_REPORT_STATE, 2},
+ {VehicleProperty::CLUSTER_REQUEST_DISPLAY, 2},
+ {VehicleProperty::CLUSTER_NAVIGATION_STATE, 2},
+ {VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_TYPE, 2},
+ {VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_STATUS, 2},
+ {VehicleProperty::FRONT_FOG_LIGHTS_STATE, 2},
+ {VehicleProperty::FRONT_FOG_LIGHTS_SWITCH, 2},
+ {VehicleProperty::REAR_FOG_LIGHTS_STATE, 2},
+ {VehicleProperty::REAR_FOG_LIGHTS_SWITCH, 2},
+ {VehicleProperty::EV_CHARGE_CURRENT_DRAW_LIMIT, 2},
+ {VehicleProperty::EV_CHARGE_PERCENT_LIMIT, 2},
+ {VehicleProperty::EV_CHARGE_STATE, 2},
+ {VehicleProperty::EV_CHARGE_SWITCH, 2},
+ {VehicleProperty::EV_CHARGE_TIME_REMAINING, 2},
+ {VehicleProperty::EV_REGENERATIVE_BRAKING_STATE, 2},
+ {VehicleProperty::TRAILER_PRESENT, 2},
+ {VehicleProperty::VEHICLE_CURB_WEIGHT, 2},
+ {VehicleProperty::GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT, 2},
+ {VehicleProperty::SUPPORTED_PROPERTY_IDS, 2},
+ {VehicleProperty::SHUTDOWN_REQUEST, 2},
+ {VehicleProperty::VEHICLE_IN_USE, 2},
+ {VehicleProperty::CLUSTER_HEARTBEAT, 3},
+ {VehicleProperty::VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL, 3},
+ {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_ENABLED, 2},
+ {VehicleProperty::AUTOMATIC_EMERGENCY_BRAKING_STATE, 2},
+ {VehicleProperty::FORWARD_COLLISION_WARNING_ENABLED, 2},
+ {VehicleProperty::FORWARD_COLLISION_WARNING_STATE, 2},
+ {VehicleProperty::BLIND_SPOT_WARNING_ENABLED, 2},
+ {VehicleProperty::BLIND_SPOT_WARNING_STATE, 2},
+ {VehicleProperty::LANE_DEPARTURE_WARNING_ENABLED, 2},
+ {VehicleProperty::LANE_DEPARTURE_WARNING_STATE, 2},
+ {VehicleProperty::LANE_KEEP_ASSIST_ENABLED, 2},
+ {VehicleProperty::LANE_KEEP_ASSIST_STATE, 2},
+ {VehicleProperty::LANE_CENTERING_ASSIST_ENABLED, 2},
+ {VehicleProperty::LANE_CENTERING_ASSIST_COMMAND, 2},
+ {VehicleProperty::LANE_CENTERING_ASSIST_STATE, 2},
+ {VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED, 2},
+ {VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_STATE, 2},
+ {VehicleProperty::CRUISE_CONTROL_ENABLED, 2},
+ {VehicleProperty::CRUISE_CONTROL_TYPE, 2},
+ {VehicleProperty::CRUISE_CONTROL_STATE, 2},
+ {VehicleProperty::CRUISE_CONTROL_COMMAND, 2},
+ {VehicleProperty::CRUISE_CONTROL_TARGET_SPEED, 2},
+ {VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP, 2},
+ {VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE, 2},
+ {VehicleProperty::HANDS_ON_DETECTION_ENABLED, 2},
+ {VehicleProperty::HANDS_ON_DETECTION_DRIVER_STATE, 2},
+ {VehicleProperty::HANDS_ON_DETECTION_WARNING, 2},
+ {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED, 3},
+ {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_STATE, 3},
+ {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED, 3},
+ {VehicleProperty::DRIVER_DROWSINESS_ATTENTION_WARNING, 3},
+ {VehicleProperty::DRIVER_DISTRACTION_SYSTEM_ENABLED, 3},
+ {VehicleProperty::DRIVER_DISTRACTION_STATE, 3},
+ {VehicleProperty::DRIVER_DISTRACTION_WARNING_ENABLED, 2},
+ {VehicleProperty::DRIVER_DISTRACTION_WARNING, 3},
+ {VehicleProperty::LOW_SPEED_COLLISION_WARNING_ENABLED, 3},
+ {VehicleProperty::LOW_SPEED_COLLISION_WARNING_STATE, 3},
+ {VehicleProperty::CROSS_TRAFFIC_MONITORING_ENABLED, 3},
+ {VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE, 3},
+ {VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_ENABLED, 3},
+ {VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE, 3},
+};
+
+} // namespace vehicle
+} // namespace automotive
+} // namespace hardware
+} // namespace android
+} // aidl
diff --git a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java
index 7b5412f..e55f4dc 100644
--- a/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/java/AccessForVehicleProperty.java
@@ -117,6 +117,7 @@
Map.entry(VehicleProperty.DISPLAY_BRIGHTNESS, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.PER_DISPLAY_BRIGHTNESS, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.VALET_MODE_ENABLED, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.HEAD_UP_DISPLAY_ENABLED, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.HW_KEY_INPUT, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.HW_KEY_INPUT_V2, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.HW_MOTION_INPUT, VehiclePropertyAccess.READ),
@@ -196,6 +197,7 @@
Map.entry(VehicleProperty.ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.ULTRASONICS_SENSOR_SUPPORTED_RANGES, VehiclePropertyAccess.READ),
+ Map.entry(VehicleProperty.ULTRASONICS_SENSOR_MEASURED_DISTANCE, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, VehiclePropertyAccess.READ),
@@ -289,7 +291,9 @@
Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyAccess.READ_WRITE),
Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyAccess.READ),
Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyAccess.READ_WRITE),
- Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_WARNING_STATE, VehiclePropertyAccess.READ)
+ Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_WARNING_STATE, VehiclePropertyAccess.READ),
+ Map.entry(VehicleProperty.LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyAccess.READ_WRITE),
+ Map.entry(VehicleProperty.LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyAccess.READ)
);
}
diff --git a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java
index 4fe45ef..e351a3f 100644
--- a/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/java/ChangeModeForVehicleProperty.java
@@ -117,6 +117,7 @@
Map.entry(VehicleProperty.DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.PER_DISPLAY_BRIGHTNESS, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.VALET_MODE_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.HEAD_UP_DISPLAY_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.HW_KEY_INPUT, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.HW_KEY_INPUT_V2, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.HW_MOTION_INPUT, VehiclePropertyChangeMode.ON_CHANGE),
@@ -196,6 +197,7 @@
Map.entry(VehicleProperty.ULTRASONICS_SENSOR_FIELD_OF_VIEW, VehiclePropertyChangeMode.STATIC),
Map.entry(VehicleProperty.ULTRASONICS_SENSOR_DETECTION_RANGE, VehiclePropertyChangeMode.STATIC),
Map.entry(VehicleProperty.ULTRASONICS_SENSOR_SUPPORTED_RANGES, VehiclePropertyChangeMode.STATIC),
+ Map.entry(VehicleProperty.ULTRASONICS_SENSOR_MEASURED_DISTANCE, VehiclePropertyChangeMode.CONTINUOUS),
Map.entry(VehicleProperty.OBD2_LIVE_FRAME, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.OBD2_FREEZE_FRAME, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.OBD2_FREEZE_FRAME_INFO, VehiclePropertyChangeMode.ON_CHANGE),
@@ -289,7 +291,9 @@
Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE),
Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
- Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE)
+ Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_WARNING_STATE, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_ENABLED, VehiclePropertyChangeMode.ON_CHANGE),
+ Map.entry(VehicleProperty.LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE, VehiclePropertyChangeMode.ON_CHANGE)
);
}
diff --git a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java
index b4f24a6..4b8060f 100644
--- a/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java
+++ b/automotive/vehicle/aidl/generated_lib/java/EnumForVehicleProperty.java
@@ -103,7 +103,8 @@
Map.entry(VehicleProperty.DRIVER_DISTRACTION_STATE, List.of(DriverDistractionState.class, ErrorState.class)),
Map.entry(VehicleProperty.DRIVER_DISTRACTION_WARNING, List.of(DriverDistractionWarning.class, ErrorState.class)),
Map.entry(VehicleProperty.LOW_SPEED_COLLISION_WARNING_STATE, List.of(LowSpeedCollisionWarningState.class, ErrorState.class)),
- Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_WARNING_STATE, List.of(CrossTrafficMonitoringWarningState.class, ErrorState.class))
+ Map.entry(VehicleProperty.CROSS_TRAFFIC_MONITORING_WARNING_STATE, List.of(CrossTrafficMonitoringWarningState.class, ErrorState.class)),
+ Map.entry(VehicleProperty.LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE, List.of(LowSpeedAutomaticEmergencyBrakingState.class, ErrorState.class))
);
}
diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/include/JsonConfigLoader.h b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/include/JsonConfigLoader.h
index f3bdbd2..82e5860 100644
--- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/include/JsonConfigLoader.h
+++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/include/JsonConfigLoader.h
@@ -130,12 +130,9 @@
std::vector<T>* outPtr, std::vector<std::string>* errors);
// Parses a JSON field to VehiclePropertyAccess or VehiclePropertyChangeMode.
template <class T>
- void parseAccessChangeMode(
- const Json::Value& parentJsonNode, const std::string& fieldName, int propId,
- const std::string& propStr,
- const std::unordered_map<aidl::android::hardware::automotive::vehicle::VehicleProperty,
- T>& defaultMap,
- T* outPtr, std::vector<std::string>* errors);
+ void parseAccessChangeMode(const Json::Value& parentJsonNode, const std::string& fieldName,
+ const std::string& propStr, const T* defaultAccessChangeModePtr,
+ T* outPtr, std::vector<std::string>* errors);
// Parses a JSON field to RawPropValues.
//
@@ -145,8 +142,10 @@
std::vector<std::string>* errors);
// Prase a JSON field as an array of area configs.
- void parseAreas(const Json::Value& parentJsonNode, const std::string& fieldName,
- ConfigDeclaration* outPtr, std::vector<std::string>* errors);
+ void parseAreas(
+ const Json::Value& parentJsonNode, const std::string& fieldName,
+ ConfigDeclaration* outPtr, std::vector<std::string>* errors,
+ aidl::android::hardware::automotive::vehicle::VehiclePropertyAccess defaultAccess);
};
} // namespace jsonconfigloader_impl
diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
index 146da69..76db891 100644
--- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
+++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
@@ -63,6 +63,7 @@
using ::aidl::android::hardware::automotive::vehicle::LaneDepartureWarningState;
using ::aidl::android::hardware::automotive::vehicle::LaneKeepAssistState;
using ::aidl::android::hardware::automotive::vehicle::LocationCharacterization;
+using ::aidl::android::hardware::automotive::vehicle::LowSpeedAutomaticEmergencyBrakingState;
using ::aidl::android::hardware::automotive::vehicle::LowSpeedCollisionWarningState;
using ::aidl::android::hardware::automotive::vehicle::RawPropValues;
using ::aidl::android::hardware::automotive::vehicle::VehicleAirbagLocation;
@@ -297,6 +298,8 @@
std::make_unique<ConstantParser<ElectronicStabilityControlState>>();
mConstantParsersByType["CrossTrafficMonitoringWarningState"] =
std::make_unique<ConstantParser<CrossTrafficMonitoringWarningState>>();
+ mConstantParsersByType["LowSpeedAutomaticEmergencyBrakingState"] =
+ std::make_unique<ConstantParser<LowSpeedAutomaticEmergencyBrakingState>>();
mConstantParsersByType["Constants"] = std::make_unique<LocalVariableParser>();
#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES
mConstantParsersByType["TestVendorProperty"] =
@@ -484,10 +487,11 @@
}
template <class T>
-void JsonConfigParser::parseAccessChangeMode(
- const Json::Value& parentJsonNode, const std::string& fieldName, int propId,
- const std::string& propStr, const std::unordered_map<VehicleProperty, T>& defaultMap,
- T* outPtr, std::vector<std::string>* errors) {
+void JsonConfigParser::parseAccessChangeMode(const Json::Value& parentJsonNode,
+ const std::string& fieldName,
+ const std::string& propStr,
+ const T* defaultAccessChangeModeValuePtr, T* outPtr,
+ std::vector<std::string>* errors) {
if (!parentJsonNode.isObject()) {
errors->push_back("Node: " + parentJsonNode.toStyledString() + " is not an object");
return;
@@ -501,12 +505,11 @@
*outPtr = static_cast<T>(result.value());
return;
}
- auto it = defaultMap.find(static_cast<VehicleProperty>(propId));
- if (it == defaultMap.end()) {
+ if (defaultAccessChangeModeValuePtr == NULL) {
errors->push_back("No " + fieldName + " specified for property: " + propStr);
return;
}
- *outPtr = it->second;
+ *outPtr = *defaultAccessChangeModeValuePtr;
return;
}
@@ -535,7 +538,8 @@
}
void JsonConfigParser::parseAreas(const Json::Value& parentJsonNode, const std::string& fieldName,
- ConfigDeclaration* config, std::vector<std::string>* errors) {
+ ConfigDeclaration* config, std::vector<std::string>* errors,
+ VehiclePropertyAccess defaultAccess) {
if (!parentJsonNode.isObject()) {
errors->push_back("Node: " + parentJsonNode.toStyledString() + " is not an object");
return;
@@ -543,6 +547,7 @@
if (!parentJsonNode.isMember(fieldName)) {
return;
}
+ std::string propStr = parentJsonNode["property"].toStyledString();
const Json::Value& jsonValue = parentJsonNode[fieldName];
if (!jsonValue.isArray()) {
@@ -558,6 +563,8 @@
}
VehicleAreaConfig areaConfig = {};
areaConfig.areaId = areaId;
+ parseAccessChangeMode(jsonAreaConfig, "access", propStr, &defaultAccess, &areaConfig.access,
+ errors);
tryParseJsonValueToVariable(jsonAreaConfig, "minInt32Value", /*optional=*/true,
&areaConfig.minInt32Value, errors);
tryParseJsonValueToVariable(jsonAreaConfig, "maxInt32Value", /*optional=*/true,
@@ -605,12 +612,21 @@
configDecl.config.prop = propId;
std::string propStr = propJsonValue["property"].toStyledString();
+ VehiclePropertyAccess* defaultAccessMode = NULL;
+ auto itAccess = AccessForVehicleProperty.find(static_cast<VehicleProperty>(propId));
+ if (itAccess != AccessForVehicleProperty.end()) {
+ defaultAccessMode = &itAccess->second;
+ }
+ VehiclePropertyChangeMode* defaultChangeMode = NULL;
+ auto itChangeMode = ChangeModeForVehicleProperty.find(static_cast<VehicleProperty>(propId));
+ if (itChangeMode != ChangeModeForVehicleProperty.end()) {
+ defaultChangeMode = &itChangeMode->second;
+ }
+ VehiclePropertyAccess access = VehiclePropertyAccess::NONE;
+ parseAccessChangeMode(propJsonValue, "access", propStr, defaultAccessMode, &access, errors);
- parseAccessChangeMode(propJsonValue, "access", propId, propStr, AccessForVehicleProperty,
- &configDecl.config.access, errors);
-
- parseAccessChangeMode(propJsonValue, "changeMode", propId, propStr,
- ChangeModeForVehicleProperty, &configDecl.config.changeMode, errors);
+ parseAccessChangeMode(propJsonValue, "changeMode", propStr, defaultChangeMode,
+ &configDecl.config.changeMode, errors);
tryParseJsonValueToVariable(propJsonValue, "configString", /*optional=*/true,
&configDecl.config.configString, errors);
@@ -626,21 +642,23 @@
tryParseJsonValueToVariable(propJsonValue, "maxSampleRate", /*optional=*/true,
&configDecl.config.maxSampleRate, errors);
- parseAreas(propJsonValue, "areas", &configDecl, errors);
-
- if (errors->size() != initialErrorCount) {
- return std::nullopt;
- }
+ parseAreas(propJsonValue, "areas", &configDecl, errors, access);
// If there is no area config, by default we allow variable update rate, so we have to add
// a global area config.
if (configDecl.config.areaConfigs.size() == 0) {
VehicleAreaConfig areaConfig = {
.areaId = 0,
+ .access = access,
.supportVariableUpdateRate = true,
};
configDecl.config.areaConfigs.push_back(std::move(areaConfig));
}
+
+ if (errors->size() != initialErrorCount) {
+ return std::nullopt;
+ }
+
return configDecl;
}
diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/test/JsonConfigLoaderUnitTest.cpp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/test/JsonConfigLoaderUnitTest.cpp
index 9882653..a13d3df 100644
--- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/test/JsonConfigLoaderUnitTest.cpp
+++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/test/JsonConfigLoaderUnitTest.cpp
@@ -286,7 +286,8 @@
ASSERT_EQ(configs.size(), 1u);
const VehiclePropConfig& propConfig = configs.begin()->second.config;
- ASSERT_EQ(propConfig.access, VehiclePropertyAccess::READ);
+ ASSERT_EQ(propConfig.access, VehiclePropertyAccess::NONE);
+ ASSERT_EQ(propConfig.areaConfigs[0].access, VehiclePropertyAccess::READ);
ASSERT_EQ(propConfig.changeMode, VehiclePropertyChangeMode::STATIC);
}
@@ -307,7 +308,8 @@
ASSERT_EQ(configs.size(), 1u);
const VehiclePropConfig& propConfig = configs.begin()->second.config;
- ASSERT_EQ(propConfig.access, VehiclePropertyAccess::WRITE);
+ ASSERT_EQ(propConfig.access, VehiclePropertyAccess::NONE);
+ ASSERT_EQ(propConfig.areaConfigs[0].access, VehiclePropertyAccess::WRITE);
ASSERT_EQ(propConfig.changeMode, VehiclePropertyChangeMode::STATIC);
}
@@ -328,7 +330,8 @@
ASSERT_EQ(configs.size(), 1u);
const VehiclePropConfig& propConfig = configs.begin()->second.config;
- ASSERT_EQ(propConfig.access, VehiclePropertyAccess::READ);
+ ASSERT_EQ(propConfig.access, VehiclePropertyAccess::NONE);
+ ASSERT_EQ(propConfig.areaConfigs[0].access, VehiclePropertyAccess::READ);
ASSERT_EQ(propConfig.changeMode, VehiclePropertyChangeMode::ON_CHANGE);
}
@@ -350,7 +353,8 @@
ASSERT_EQ(configs.size(), 1u);
const VehiclePropConfig& propConfig = configs.begin()->second.config;
- ASSERT_EQ(propConfig.access, VehiclePropertyAccess::WRITE);
+ ASSERT_EQ(propConfig.access, VehiclePropertyAccess::NONE);
+ ASSERT_EQ(propConfig.areaConfigs[0].access, VehiclePropertyAccess::WRITE);
ASSERT_EQ(propConfig.changeMode, VehiclePropertyChangeMode::ON_CHANGE);
}
@@ -550,10 +554,12 @@
ASSERT_EQ(configs.size(), 1u);
const VehiclePropConfig& config = configs.begin()->second.config;
+ ASSERT_EQ(config.access, VehiclePropertyAccess::NONE);
ASSERT_EQ(config.areaConfigs.size(), 1u);
const VehicleAreaConfig& areaConfig = config.areaConfigs[0];
ASSERT_EQ(areaConfig.minInt32Value, 1);
ASSERT_EQ(areaConfig.maxInt32Value, 7);
+ ASSERT_EQ(areaConfig.access, VehiclePropertyAccess::READ);
ASSERT_EQ(areaConfig.areaId, HVAC_ALL);
}
@@ -635,9 +641,11 @@
ASSERT_EQ(configs.size(), 1u);
const VehiclePropConfig& config = configs.begin()->second.config;
+ ASSERT_EQ(config.access, VehiclePropertyAccess::NONE);
ASSERT_EQ(config.areaConfigs.size(), 1u);
const VehicleAreaConfig& areaConfig = config.areaConfigs[0];
+ ASSERT_EQ(areaConfig.access, VehiclePropertyAccess::READ);
ASSERT_EQ(areaConfig.areaId, 0);
ASSERT_FALSE(areaConfig.supportedEnumValues);
}
@@ -662,9 +670,11 @@
ASSERT_EQ(configs.size(), 1u);
const VehiclePropConfig& config = configs.begin()->second.config;
+ ASSERT_EQ(config.access, VehiclePropertyAccess::NONE);
ASSERT_EQ(config.areaConfigs.size(), 1u);
const VehicleAreaConfig& areaConfig = config.areaConfigs[0];
+ ASSERT_EQ(areaConfig.access, VehiclePropertyAccess::READ);
ASSERT_EQ(areaConfig.areaId, 0);
ASSERT_TRUE(areaConfig.supportedEnumValues);
ASSERT_EQ(areaConfig.supportedEnumValues.value().size(), 2u);
@@ -692,13 +702,107 @@
ASSERT_EQ(configs.size(), 1u);
const VehiclePropConfig& config = configs.begin()->second.config;
+ ASSERT_EQ(config.access, VehiclePropertyAccess::NONE);
ASSERT_EQ(config.areaConfigs.size(), 1u);
const VehicleAreaConfig& areaConfig = config.areaConfigs[0];
+ ASSERT_EQ(areaConfig.access, VehiclePropertyAccess::READ);
ASSERT_EQ(areaConfig.areaId, 0);
ASSERT_FALSE(areaConfig.supportedEnumValues);
}
+TEST_F(JsonConfigLoaderUnitTest, testAccess_areaOverrideGlobalDefault) {
+ std::istringstream iss(R"(
+ {
+ "properties": [{
+ "property": "VehicleProperty::CABIN_LIGHTS_SWITCH",
+ "areas": [{
+ "access": "VehiclePropertyAccess::READ",
+ "areaId": 0
+ }]
+ }]
+ }
+ )");
+
+ auto result = mLoader.loadPropConfig(iss);
+ ASSERT_TRUE(result.ok());
+
+ auto configs = result.value();
+ ASSERT_EQ(configs.size(), 1u);
+
+ const VehiclePropConfig& config = configs.begin()->second.config;
+ ASSERT_EQ(config.access, VehiclePropertyAccess::NONE);
+ ASSERT_EQ(config.areaConfigs.size(), 1u);
+
+ const VehicleAreaConfig& areaConfig = config.areaConfigs[0];
+ ASSERT_EQ(areaConfig.access, VehiclePropertyAccess::READ);
+ ASSERT_EQ(areaConfig.areaId, 0);
+}
+
+TEST_F(JsonConfigLoaderUnitTest, testAccess_globalOverrideDefault) {
+ std::istringstream iss(R"(
+ {
+ "properties": [{
+ "property": "VehicleProperty::CABIN_LIGHTS_SWITCH",
+ "areas": [{
+ "areaId": 0
+ }],
+ "access": "VehiclePropertyAccess::READ"
+ }]
+ }
+ )");
+
+ auto result = mLoader.loadPropConfig(iss);
+ ASSERT_TRUE(result.ok());
+
+ auto configs = result.value();
+ ASSERT_EQ(configs.size(), 1u);
+
+ const VehiclePropConfig& config = configs.begin()->second.config;
+ ASSERT_EQ(config.access, VehiclePropertyAccess::NONE);
+ ASSERT_EQ(config.areaConfigs.size(), 1u);
+
+ const VehicleAreaConfig& areaConfig = config.areaConfigs[0];
+ ASSERT_EQ(areaConfig.access, VehiclePropertyAccess::READ);
+ ASSERT_EQ(areaConfig.areaId, 0);
+}
+
+TEST_F(JsonConfigLoaderUnitTest, testAccess_areaOverrideGlobal) {
+ std::istringstream iss(R"(
+ {
+ "properties": [{
+ "property": "VehicleProperty::CABIN_LIGHTS_SWITCH",
+ "areas": [{
+ "access": "VehiclePropertyAccess::WRITE",
+ "areaId": 0
+ },
+ {
+ "areaId": 1
+ }],
+ "access": "VehiclePropertyAccess::READ",
+ }]
+ }
+ )");
+
+ auto result = mLoader.loadPropConfig(iss);
+ ASSERT_TRUE(result.ok());
+
+ auto configs = result.value();
+ ASSERT_EQ(configs.size(), 1u);
+
+ const VehiclePropConfig& config = configs.begin()->second.config;
+ ASSERT_EQ(config.access, VehiclePropertyAccess::NONE);
+ ASSERT_EQ(config.areaConfigs.size(), 2u);
+
+ const VehicleAreaConfig& areaConfig1 = config.areaConfigs[0];
+ ASSERT_EQ(areaConfig1.access, VehiclePropertyAccess::WRITE);
+ ASSERT_EQ(areaConfig1.areaId, 0);
+
+ const VehicleAreaConfig& areaConfig2 = config.areaConfigs[1];
+ ASSERT_EQ(areaConfig2.access, VehiclePropertyAccess::READ);
+ ASSERT_EQ(areaConfig2.areaId, 1);
+}
+
} // namespace vehicle
} // namespace automotive
} // namespace hardware
diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json
index 665c10e..590eff9 100644
--- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json
+++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json
@@ -3219,6 +3219,19 @@
}
},
{
+ "property": "VehicleProperty::HEAD_UP_DISPLAY_ENABLED",
+ "defaultValue": {
+ "int32Values": [
+ 0
+ ]
+ },
+ "areas": [
+ {
+ "areaId": "Constants::SEAT_1_LEFT"
+ }
+ ]
+ },
+ {
"property": "VehicleProperty::OBD2_LIVE_FRAME",
"configArray": [
0,
@@ -3443,6 +3456,839 @@
}
},
{
+ "property": "VehicleProperty::ULTRASONICS_SENSOR_POSITION",
+ "comment":
+ "Default values for 12 individual ultrasonic sensors installed on the vehicle. Six sensors on the front bumper. Six sensors on the back bumper.",
+ "areas": [
+ {
+ "defaultValue": {
+ "int32Values": [
+ -1000,
+ 3900,
+ 0
+ ]
+ },
+ "areaId": 1,
+ "comment": "Rough numbers representing front left most sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ -600,
+ 4000,
+ 0
+ ]
+ },
+ "areaId": 2,
+ "comment": "Rough numbers representing front 2nd to the left sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ -200,
+ 4000,
+ 0
+ ]
+ },
+ "areaId": 4,
+ "comment": "Rough numbers representing front 3rd to the left sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 200,
+ 4000,
+ 0
+ ]
+ },
+ "areaId": 8,
+ "comment": "Rough numbers representing front 3rd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 600,
+ 4000,
+ 0
+ ]
+ },
+ "areaId": 16,
+ "comment": "Rough numbers representing front 2nd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 1000,
+ 3900,
+ 0
+ ]
+ },
+ "areaId": 32,
+ "comment": "Rough numbers representing front right most sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ -1000,
+ -900,
+ 0
+ ]
+ },
+ "areaId": 64,
+ "comment": "Rough numbers representing back left most sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ -600,
+ -1000,
+ 0
+ ]
+ },
+ "areaId": 128,
+ "comment": "Rough numbers representing back 2nd to the left sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ -200,
+ -1000,
+ 0
+ ]
+ },
+ "areaId": 256,
+ "comment": "Rough numbers representing back 3rd to the left sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 200,
+ -1000,
+ 0
+ ]
+ },
+ "areaId": 512,
+ "comment": "Rough numbers representing back 3rd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 600,
+ -1000,
+ 0
+ ]
+ },
+ "areaId": 1024,
+ "comment": "Rough numbers representing back 2nd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 1000,
+ -900,
+ 0
+ ]
+ },
+ "areaId": 2048,
+ "comment": "Rough numbers representing back right most sensor."
+ }
+ ]
+ },
+ {
+ "property": "VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION",
+ "comment":
+ "Default values for 12 individual ultrasonic sensors installed on the vehicle. Six sensors on the front bumper. Six sensors on the back bumper.",
+ "areas": [
+ {
+ "defaultValue": {
+ "floatValues": [
+ 0.924,
+ 0,
+ 0,
+ 0.383
+ ]
+ },
+ "areaId": 1,
+ "comment":
+ "Rough quaternion values [w, x, y, z] representing front left most sensor rotated 45 degrees counter-clockwise."
+ },
+ {
+ "defaultValue": {
+ "floatValues": [
+ 1,
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "areaId": 2,
+ "comment":
+ "Rough quaternion values [w, x, y, z] representing front 2nd to the left sensor rotated 0 degrees"
+ },
+ {
+ "defaultValue": {
+ "floatValues": [
+ 1,
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "areaId": 4,
+ "comment":
+ "Rough quaternion values [w, x, y, z] representing front 3rd to the left sensor rotated 0 degrees"
+ },
+ {
+ "defaultValue": {
+ "floatValues": [
+ 1,
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "areaId": 8,
+ "comment":
+ "Rough quaternion values [w, x, y, z] representing front 3rd to the right sensor rotated 0 degrees"
+ },
+ {
+ "defaultValue": {
+ "floatValues": [
+ 1,
+ 0,
+ 0,
+ 0
+ ]
+ },
+ "areaId": 16,
+ "comment":
+ "Rough quaternion values [w, x, y, z] representing front 2nd to the right sensor rotated 0 degrees"
+ },
+ {
+ "defaultValue": {
+ "floatValues": [
+ 0.924,
+ 0,
+ 0,
+ -0.383
+ ]
+ },
+ "areaId": 32,
+ "comment":
+ "Rough quaternion values [w, x, y, z] representing front right most sensor rotated 45 degrees clockwise."
+ },
+ {
+ "defaultValue": {
+ "floatValues": [
+ 60,
+ 61,
+ 62,
+ 63
+ ]
+ },
+ "areaId": 64,
+ "comment":
+ "Rough quaternion values [w, x, y, z] representing back left most sensor rotated 45 degrees counter-clockwise."
+ },
+ {
+ "defaultValue": {
+ "floatValues": [
+ 70,
+ 71,
+ 72,
+ 73
+ ]
+ },
+ "areaId": 128,
+ "comment":
+ "Rough quaternion values [w, x, y, z] representing back 2nd to the left sensor rotated 0 degrees"
+ },
+ {
+ "defaultValue": {
+ "floatValues": [
+ 81,
+ 82,
+ 83,
+ 84
+ ]
+ },
+ "areaId": 256,
+ "comment":
+ "Rough quaternion values [w, x, y, z] representing back 3rd to the right sensor rotated 0 degrees"
+ },
+ {
+ "defaultValue": {
+ "floatValues": [
+ 90,
+ 91,
+ 92,
+ 93
+ ]
+ },
+ "areaId": 512,
+ "comment":
+ "Rough quaternion values [w, x, y, z] representing back 3rd to the right sensor rotated 0 degrees"
+ },
+ {
+ "defaultValue": {
+ "floatValues": [
+ 100,
+ 101,
+ 102,
+ 103
+ ]
+ },
+ "areaId": 1024,
+ "comment":
+ "Rough quaternion values [w, x, y, z] representing back 2nd to the right sensor rotated 0 degrees"
+ },
+ {
+ "defaultValue": {
+ "floatValues": [
+ 110,
+ 111,
+ 112,
+ 113
+ ]
+ },
+ "areaId": 2048,
+ "comment":
+ "Rough quaternion values [w, x, y, z] representing back right most sensor rotated 45 degrees clockwise."
+ }
+ ]
+ },
+ {
+ "property": "VehicleProperty::ULTRASONICS_SENSOR_FIELD_OF_VIEW",
+ "comment":
+ "Default values for 12 individual ultrasonic sensors installed on the vehicle. Six sensors on the front bumper. Six sensors on the back bumper.",
+ "areas": [
+ {
+ "defaultValue": {
+ "int32Values": [
+ 85,
+ 45
+ ]
+ },
+ "areaId": 1,
+ "comment": "Rough values representing front left most sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 75,
+ 45
+ ]
+ },
+ "areaId": 2,
+ "comment": "Rough values representing front 2nd to the left sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 75,
+ 45
+ ]
+ },
+ "areaId": 4,
+ "comment": "Rough values representing front 3rd to the left sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 75,
+ 45
+ ]
+ },
+ "areaId": 8,
+ "comment": "Rough values representing front 3rd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 75,
+ 45
+ ]
+ },
+ "areaId": 16,
+ "comment": "Rough values representing front 2nd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 85,
+ 45
+ ]
+ },
+ "areaId": 32,
+ "comment": "Rough values representing front right most sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 85,
+ 45
+ ]
+ },
+ "areaId": 64,
+ "comment": "Rough values representing back left most sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 75,
+ 45
+ ]
+ },
+ "areaId": 128,
+ "comment": "Rough values representing back 2nd to the left sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 75,
+ 45
+ ]
+ },
+ "areaId": 256,
+ "comment": "Rough values representing back 3rd to the left sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 75,
+ 45
+ ]
+ },
+ "areaId": 512,
+ "comment": "Rough values representing back 3rd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 75,
+ 45
+ ]
+ },
+ "areaId": 1024,
+ "comment": "Rough values representing back 2nd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 85,
+ 45
+ ]
+ },
+ "areaId": 2048,
+ "comment": "Rough values representing back right most sensor."
+ }
+ ]
+ },
+ {
+ "property": "VehicleProperty::ULTRASONICS_SENSOR_DETECTION_RANGE",
+ "areas": [
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 4000
+ ]
+ },
+ "areaId": 1,
+ "comment": "Rough values representing front left most sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 3000
+ ]
+ },
+ "areaId": 2,
+ "comment": "Rough values representing front 2nd to the left sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 3000
+ ]
+ },
+ "areaId": 4,
+ "comment": "Rough values representing front 3rd to the left sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 3000
+ ]
+ },
+ "areaId": 8,
+ "comment": "Rough values representing front 3rd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 3000
+ ]
+ },
+ "areaId": 16,
+ "comment": "Rough values representing front 2nd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 4000
+ ]
+ },
+ "areaId": 32,
+ "comment": "Rough values representing front right most sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 4000
+ ]
+ },
+ "areaId": 64,
+ "comment": "Rough values representing back left most sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 3000
+ ]
+ },
+ "areaId": 128,
+ "comment": "Rough values representing back 2nd to the left sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 3000
+ ]
+ },
+ "areaId": 256,
+ "comment": "Rough values representing back 3rd to the left sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 3000
+ ]
+ },
+ "areaId": 512,
+ "comment": "Rough values representing back 3rd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 3000
+ ]
+ },
+ "areaId": 1024,
+ "comment": "Rough values representing back 2nd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 4000
+ ]
+ },
+ "areaId": 2048,
+ "comment": "Rough values representing back right most sensor."
+ }
+ ]
+ },
+ {
+ "property": "VehicleProperty::ULTRASONICS_SENSOR_SUPPORTED_RANGES",
+ "areas": [
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 999,
+ 1000,
+ 1999,
+ 2000,
+ 4000
+ ]
+ },
+ "areaId": 1,
+ "comment": "Rough values representing front left most sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 999,
+ 1000,
+ 1999,
+ 2000,
+ 3000
+ ]
+ },
+ "areaId": 2,
+ "comment": "Rough values representing front 2nd to the left sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 999,
+ 1000,
+ 1999,
+ 2000,
+ 3000
+ ]
+ },
+ "areaId": 4,
+ "comment": "Rough values representing front 3rd to the left sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 999,
+ 1000,
+ 1999,
+ 2000,
+ 3000
+ ]
+ },
+ "areaId": 8,
+ "comment": "Rough values representing front 3rd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 999,
+ 1000,
+ 1999,
+ 2000,
+ 3000
+ ]
+ },
+ "areaId": 16,
+ "comment": "Rough values representing front 2nd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 999,
+ 1000,
+ 1999,
+ 2000,
+ 4000
+ ]
+ },
+ "areaId": 32,
+ "comment": "Rough values representing front right most sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 999,
+ 1000,
+ 1999,
+ 2000,
+ 4000
+ ]
+ },
+ "areaId": 64,
+ "comment": "Rough values representing back left most sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 999,
+ 1000,
+ 1999,
+ 2000,
+ 3000
+ ]
+ },
+ "areaId": 128,
+ "comment": "Rough values representing back 2nd to the left sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 999,
+ 1000,
+ 3000
+ ]
+ },
+ "areaId": 256,
+ "comment": "Rough values representing back 3rd to the left sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 999,
+ 1000,
+ 3000
+ ]
+ },
+ "areaId": 512,
+ "comment": "Rough values representing back 3rd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 999,
+ 1000,
+ 1999,
+ 2000,
+ 3000
+ ]
+ },
+ "areaId": 1024,
+ "comment": "Rough values representing back 2nd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 150,
+ 999,
+ 1000,
+ 1999,
+ 2000,
+ 4000
+ ]
+ },
+ "areaId": 2048,
+ "comment": "Rough values representing back right most sensor."
+ }
+ ]
+ },
+ {
+ "property": "VehicleProperty::ULTRASONICS_SENSOR_MEASURED_DISTANCE",
+ "areas": [
+ {
+ "defaultValue": {
+ "int32Values": [
+ 2000,
+ 10
+ ]
+ },
+ "areaId": 1,
+ "comment": "Rough values representing front left most sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": []
+ },
+ "areaId": 2,
+ "comment":
+ "Rough values representing front 2nd to the left sensor. Nothing detected."
+ },
+ {
+ "defaultValue": {
+ "int32Values": []
+ },
+ "areaId": 4,
+ "comment":
+ "Rough values representing front 3rd to the left sensor. Nothing detected."
+ },
+ {
+ "defaultValue": {
+ "int32Values": []
+ },
+ "areaId": 8,
+ "comment":
+ "Rough values representing front 3rd to the right sensor. Nothing detected."
+ },
+ {
+ "defaultValue": {
+ "int32Values": []
+ },
+ "areaId": 16,
+ "comment":
+ "Rough values representing front 2nd to the right sensor. Nothing detected."
+ },
+ {
+ "defaultValue": {
+ "int32Values": []
+ },
+ "areaId": 32,
+ "comment":
+ "Rough values representing front right most sensor. Nothing detected."
+ },
+ {
+ "defaultValue": {
+ "int32Values": []
+ },
+ "areaId": 64,
+ "comment": "Rough values representing back left most sensor. Nothing detected."
+ },
+ {
+ "defaultValue": {
+ "int32Values": []
+ },
+ "areaId": 128,
+ "comment":
+ "Rough values representing back 2nd to the left sensor. Nothing detected."
+ },
+ {
+ "defaultValue": {
+ "int32Values": []
+ },
+ "areaId": 256,
+ "comment":
+ "Rough values representing back 3rd to the left sensor. Nothing detected."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 1000
+ ]
+ },
+ "areaId": 512,
+ "comment":
+ "Rough values representing back 3rd to the right sensor. Nothing detected."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 2000,
+ 50
+ ]
+ },
+ "areaId": 1024,
+ "comment": "Rough values representing back 2nd to the right sensor."
+ },
+ {
+ "defaultValue": {
+ "int32Values": [
+ 2000
+ ]
+ },
+ "areaId": 2048,
+ "comment":
+ "Rough values representing back right most sensor. No distance error."
+ }
+ ],
+ "maxSampleRate": 10.0,
+ "minSampleRate": 1.0
+ },
+ {
"property": "VehicleProperty::ELECTRONIC_TOLL_COLLECTION_CARD_TYPE",
"defaultValue": {
"int32Values": [
@@ -4191,6 +5037,36 @@
]
}
]
+ },
+ {
+ "property": "VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_ENABLED",
+ "defaultValue": {
+ "int32Values": [
+ 1
+ ]
+ }
+ },
+ {
+ "property": "VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE",
+ "defaultValue": {
+ "int32Values": [
+ "LowSpeedAutomaticEmergencyBrakingState::ENABLED"
+ ]
+ },
+ "areas": [
+ {
+ "areaId": 0,
+ "supportedEnumValues": [
+ "ErrorState::NOT_AVAILABLE_SAFETY",
+ "ErrorState::NOT_AVAILABLE_POOR_VISIBILITY",
+ "ErrorState::NOT_AVAILABLE_SPEED_HIGH",
+ "ErrorState::NOT_AVAILABLE_DISABLED",
+ "LowSpeedAutomaticEmergencyBrakingState::ENABLED",
+ "LowSpeedAutomaticEmergencyBrakingState::ACTIVATED",
+ "LowSpeedAutomaticEmergencyBrakingState::USER_OVERRIDE"
+ ]
+ }
+ ]
}
]
}
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h
index 8cd92b3..1153217 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h
@@ -256,6 +256,7 @@
std::string dumpSaveProperty(const std::vector<std::string>& options);
std::string dumpRestoreProperty(const std::vector<std::string>& options);
std::string dumpInjectEvent(const std::vector<std::string>& options);
+ std::string dumpSubscriptions();
template <typename T>
android::base::Result<T> safelyParseInt(int index, const std::string& s) {
@@ -294,7 +295,7 @@
void registerRefreshLocked(PropIdAreaId propIdAreaId, VehiclePropertyStore::EventMode eventMode,
float sampleRateHz) REQUIRES(mLock);
void unregisterRefreshLocked(PropIdAreaId propIdAreaId) REQUIRES(mLock);
- void refreshTimeStampForInterval(int64_t intervalInNanos) EXCLUDES(mLock);
+ void refreshTimestampForInterval(int64_t intervalInNanos) EXCLUDES(mLock);
static aidl::android::hardware::automotive::vehicle::VehiclePropValue createHwInputKeyProp(
aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction action,
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
index dced624..bcc765c 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
@@ -51,6 +51,8 @@
namespace {
+#define PROP_ID_TO_CSTR(A) (propIdToString(A).c_str())
+
using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand;
using ::aidl::android::hardware::automotive::vehicle::CruiseControlType;
using ::aidl::android::hardware::automotive::vehicle::DriverDistractionState;
@@ -246,6 +248,13 @@
toInt(VehicleProperty::CROSS_TRAFFIC_MONITORING_WARNING_STATE),
},
},
+ // LSAEB
+ {
+ toInt(VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_ENABLED),
+ {
+ toInt(VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE),
+ },
+ },
};
} // namespace
@@ -718,7 +727,7 @@
FakeVehicleHardware::ValueResultType FakeVehicleHardware::getUserHalProp(
const VehiclePropValue& value) const {
auto propId = value.prop;
- ALOGI("get(): getting value for prop %d from User HAL", propId);
+ ALOGI("get(): getting value for prop %s from User HAL", PROP_ID_TO_CSTR(propId));
auto result = mFakeUserHal->onGetProperty(value);
if (!result.ok()) {
@@ -1081,7 +1090,7 @@
const std::vector<SetValueRequest>& requests) {
for (auto& request : requests) {
if (FAKE_VEHICLEHARDWARE_DEBUG) {
- ALOGD("Set value for property ID: %d", request.value.prop);
+ ALOGD("Set value for property ID: %s", PROP_ID_TO_CSTR(request.value.prop));
}
// In a real VHAL implementation, you could either send the setValue request to vehicle bus
@@ -1102,9 +1111,9 @@
auto setSpecialValueResult = maybeSetSpecialValue(value, &isSpecialValue);
if (isSpecialValue) {
if (!setSpecialValueResult.ok()) {
- return StatusError(getErrorCode(setSpecialValueResult))
- << StringPrintf("failed to set special value for property ID: %d, error: %s",
- value.prop, getErrorMsg(setSpecialValueResult).c_str());
+ return StatusError(getErrorCode(setSpecialValueResult)) << StringPrintf(
+ "failed to set special value for property ID: %s, error: %s",
+ PROP_ID_TO_CSTR(value.prop), getErrorMsg(setSpecialValueResult).c_str());
}
return {};
}
@@ -1143,7 +1152,7 @@
const std::vector<GetValueRequest>& requests) const {
for (auto& request : requests) {
if (FAKE_VEHICLEHARDWARE_DEBUG) {
- ALOGD("getValues(%d)", request.prop.prop);
+ ALOGD("getValues(%s)", PROP_ID_TO_CSTR(request.prop.prop));
}
// In a real VHAL implementation, you could either send the getValue request to vehicle bus
@@ -1182,8 +1191,8 @@
if (isSpecialValue) {
if (!result.ok()) {
return StatusError(getErrorCode(result))
- << StringPrintf("failed to get special value: %d, error: %s", value.prop,
- getErrorMsg(result).c_str());
+ << StringPrintf("failed to get special value: %s, error: %s",
+ PROP_ID_TO_CSTR(value.prop), getErrorMsg(result).c_str());
} else {
return result;
}
@@ -1242,6 +1251,8 @@
mAddExtraTestVendorConfigs = false;
result.refreshPropertyConfigs = true;
result.buffer = "successfully restored vendor configs";
+ } else if (EqualsIgnoreCase(option, "--dumpSub")) {
+ result.buffer = dumpSubscriptions();
} else {
result.buffer = StringPrintf("Invalid option: %s\n", option.c_str());
}
@@ -1373,7 +1384,8 @@
if (mGeneratorHub->unregisterGenerator(propId)) {
return "Linear event generator stopped successfully";
}
- return StringPrintf("No linear event generator found for property: %d", propId);
+ return StringPrintf("No linear event generator found for property: %s",
+ PROP_ID_TO_CSTR(propId));
} else if (command == "--startjson") {
// --genfakedata --startjson --path path repetition
// or
@@ -1643,6 +1655,26 @@
mServerSidePropStore->writeValue(mValuePool->obtain(value));
}
+std::string FakeVehicleHardware::dumpSubscriptions() {
+ std::scoped_lock<std::mutex> lockGuard(mLock);
+ std::string result = "Subscriptions: \n";
+ for (const auto& [interval, actionForInterval] : mActionByIntervalInNanos) {
+ for (const auto& propIdAreaId : actionForInterval.propIdAreaIdsToRefresh) {
+ const auto& refreshInfo = mRefreshInfoByPropIdAreaId[propIdAreaId];
+ bool vur = (refreshInfo.eventMode == VehiclePropertyStore::EventMode::ON_VALUE_CHANGE);
+ float sampleRateHz = 1'000'000'000. / refreshInfo.intervalInNanos;
+ result += StringPrintf("Continuous{property: %s, areaId: %d, rate: %lf hz, vur: %b}\n",
+ PROP_ID_TO_CSTR(propIdAreaId.propId), propIdAreaId.areaId,
+ sampleRateHz, vur);
+ }
+ }
+ for (const auto& propIdAreaId : mSubOnChangePropIdAreaIds) {
+ result += StringPrintf("OnChange{property: %s, areaId: %d}\n",
+ PROP_ID_TO_CSTR(propIdAreaId.propId), propIdAreaId.areaId);
+ }
+ return result;
+}
+
std::string FakeVehicleHardware::dumpHelp() {
return "Usage: \n\n"
"[no args]: dumps (id and value) all supported properties \n"
@@ -1710,8 +1742,9 @@
result = mServerSidePropStore->readValue(value);
}
if (!result.ok()) {
- return StringPrintf("failed to read property value: %d, error: %s, code: %d\n", propId,
- getErrorMsg(result).c_str(), getIntErrorCode(result));
+ return StringPrintf("failed to read property value: %s, error: %s, code: %d\n",
+ PROP_ID_TO_CSTR(propId), getErrorMsg(result).c_str(),
+ getIntErrorCode(result));
} else {
return result.value()->toString() + "\n";
@@ -1726,7 +1759,7 @@
int rowNumber = 1;
std::string msg = StringPrintf("listing %zu properties\n", configs.size());
for (const auto& config : configs) {
- msg += StringPrintf("%d: %d\n", rowNumber++, config.prop);
+ msg += StringPrintf("%d: %s\n", rowNumber++, PROP_ID_TO_CSTR(config.prop));
}
return msg;
}
@@ -1759,7 +1792,7 @@
int32_t prop = propResult.value();
auto result = mServerSidePropStore->getPropConfig(prop);
if (!result.ok()) {
- msg += StringPrintf("No property %d\n", prop);
+ msg += StringPrintf("No property %s\n", PROP_ID_TO_CSTR(prop));
continue;
}
msg += dumpOnePropertyByConfig(rowNumber++, result.value());
@@ -1945,8 +1978,9 @@
}
if (!result.ok()) {
- return StringPrintf("failed to read property value: %d, error: %s, code: %d\n", prop.prop,
- getErrorMsg(result).c_str(), getIntErrorCode(result));
+ return StringPrintf("failed to read property value: %s, error: %s, code: %d\n",
+ PROP_ID_TO_CSTR(prop.prop), getErrorMsg(result).c_str(),
+ getIntErrorCode(result));
}
return StringPrintf("Get property result: %s\n", result.value()->toString().c_str());
}
@@ -2039,7 +2073,7 @@
eventFromVehicleBus(prop);
- return StringPrintf("Event for property: %d injected", prop.prop);
+ return StringPrintf("Event for property: %s injected", PROP_ID_TO_CSTR(prop.prop));
}
StatusCode FakeVehicleHardware::checkHealth() {
@@ -2102,7 +2136,7 @@
return false;
}
-void FakeVehicleHardware::refreshTimeStampForInterval(int64_t intervalInNanos) {
+void FakeVehicleHardware::refreshTimestampForInterval(int64_t intervalInNanos) {
std::unordered_map<PropIdAreaId, VehiclePropertyStore::EventMode, PropIdAreaIdHash>
eventModeByPropIdAreaId;
@@ -2152,7 +2186,7 @@
// This is the first action for the interval, register a timer callback for that interval.
auto action = std::make_shared<RecurrentTimer::Callback>(
- [this, intervalInNanos] { refreshTimeStampForInterval(intervalInNanos); });
+ [this, intervalInNanos] { refreshTimestampForInterval(intervalInNanos); });
mActionByIntervalInNanos[intervalInNanos] = ActionForInterval{
.propIdAreaIdsToRefresh = {propIdAreaId},
.recurrentAction = action,
@@ -2194,7 +2228,7 @@
case VehiclePropertyChangeMode::CONTINUOUS:
if (sampleRateHz == 0.f) {
ALOGE("Must not use sample rate 0 for a continuous property");
- return StatusCode::INTERNAL_ERROR;
+ return StatusCode::INVALID_ARG;
}
// For continuous properties, we must generate a new onPropertyChange event
// periodically according to the sample rate.
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
index 6d2efd5..90643aa 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
@@ -2617,8 +2617,8 @@
DumpResult result = getHardware()->dump(options);
ASSERT_FALSE(result.callerShouldDumpState);
ASSERT_NE(result.buffer, "");
- ASSERT_THAT(result.buffer, ContainsRegex(StringPrintf("1:.*prop: %s.*\nNo property %d\n",
- prop1.c_str(), INVALID_PROP_ID)));
+ ASSERT_THAT(result.buffer, ContainsRegex(StringPrintf("1:.*prop: %s.*\nNo property INVALID\n",
+ prop1.c_str())));
}
TEST_F(FakeVehicleHardwareTest, testDumpSpecificPropertiesNoArg) {
@@ -2701,8 +2701,7 @@
{"--inject-event", propIdStr, "-i", "1234", "-t", std::to_string(timestamp)});
ASSERT_FALSE(result.callerShouldDumpState);
- ASSERT_THAT(result.buffer,
- ContainsRegex(StringPrintf("Event for property: %d injected", prop)));
+ ASSERT_THAT(result.buffer, ContainsRegex("Event for property: ENGINE_OIL_LEVEL injected"));
ASSERT_TRUE(waitForChangedProperties(prop, 0, /*count=*/1, milliseconds(1000)))
<< "No changed event received for injected event from vehicle bus";
auto events = getChangedProperties();
@@ -3444,6 +3443,14 @@
<< "must not receive on change events if the propId, areaId is unsubscribed";
}
+TEST_F(FakeVehicleHardwareTest, testSubscribeContinuous_rate0_mustReturnInvalidArg) {
+ int32_t propSpeed = toInt(VehicleProperty::PERF_VEHICLE_SPEED);
+ int32_t areaId = 0;
+ auto status = getHardware()->subscribe(newSubscribeOptions(propSpeed, areaId, 0));
+
+ ASSERT_EQ(status, StatusCode::INVALID_ARG);
+}
+
TEST_F(FakeVehicleHardwareTest, testSetHvacTemperatureValueSuggestion) {
float CELSIUS = static_cast<float>(toInt(VehicleUnit::CELSIUS));
float FAHRENHEIT = static_cast<float>(toInt(VehicleUnit::FAHRENHEIT));
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h
index bbd88da..0c8ebbd 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleHalTypes.h
@@ -50,6 +50,7 @@
#include <aidl/android/hardware/automotive/vehicle/LaneDepartureWarningState.h>
#include <aidl/android/hardware/automotive/vehicle/LaneKeepAssistState.h>
#include <aidl/android/hardware/automotive/vehicle/LocationCharacterization.h>
+#include <aidl/android/hardware/automotive/vehicle/LowSpeedAutomaticEmergencyBrakingState.h>
#include <aidl/android/hardware/automotive/vehicle/LowSpeedCollisionWarningState.h>
#include <aidl/android/hardware/automotive/vehicle/Obd2CommonIgnitionMonitors.h>
#include <aidl/android/hardware/automotive/vehicle/Obd2FuelSystemStatus.h>
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h
index 6e812d1..501ce40 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleObjectPool.h
@@ -235,7 +235,7 @@
bool isDisposable(aidl::android::hardware::automotive::vehicle::VehiclePropertyType type,
size_t vectorSize) const {
- return vectorSize > mMaxRecyclableVectorSize || isComplexType(type);
+ return vectorSize == 0 || vectorSize > mMaxRecyclableVectorSize || isComplexType(type);
}
RecyclableType obtainDisposable(
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h
index 546421e..523cac5 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/VehicleUtils.h
@@ -124,7 +124,6 @@
break; // Valid, but nothing to do.
default:
ALOGE("createVehiclePropValue: unknown type: %d", toInt(type));
- val.reset(nullptr);
}
return val;
}
diff --git a/automotive/vehicle/aidl/impl/utils/common/src/VehicleObjectPool.cpp b/automotive/vehicle/aidl/impl/utils/common/src/VehicleObjectPool.cpp
index 2480a73..7e02767 100644
--- a/automotive/vehicle/aidl/impl/utils/common/src/VehicleObjectPool.cpp
+++ b/automotive/vehicle/aidl/impl/utils/common/src/VehicleObjectPool.cpp
@@ -55,13 +55,6 @@
int propId = src.prop;
VehiclePropertyType type = getPropType(propId);
size_t vectorSize = getVehicleRawValueVectorSize(src.value, type);
- if (vectorSize == 0 && !isComplexType(type)) {
- ALOGW("empty vehicle prop value, contains no content");
- ALOGW("empty vehicle prop value, contains no content, prop: %d", propId);
- // Return any empty VehiclePropValue.
- return RecyclableType{new VehiclePropValue{}, mDisposableDeleter};
- }
-
auto dest = obtain(type, vectorSize);
dest->prop = propId;
diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehicleObjectPoolTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehicleObjectPoolTest.cpp
index a62532c..6226e89 100644
--- a/automotive/vehicle/aidl/impl/utils/common/test/VehicleObjectPoolTest.cpp
+++ b/automotive/vehicle/aidl/impl/utils/common/test/VehicleObjectPoolTest.cpp
@@ -267,6 +267,20 @@
ASSERT_EQ(*gotValue, prop);
}
+TEST_F(VehicleObjectPoolTest, testObtainCopyInt32ValuesEmptyArray) {
+ VehiclePropValue prop{
+ // INT32_VEC property.
+ .prop = toInt(VehicleProperty::INFO_FUEL_TYPE),
+ .areaId = 2,
+ .timestamp = 3,
+ .value = {.int32Values = {}},
+ };
+ auto gotValue = mValuePool->obtain(prop);
+
+ ASSERT_NE(gotValue, nullptr);
+ ASSERT_EQ(*gotValue, prop);
+}
+
TEST_F(VehicleObjectPoolTest, testObtainCopyInt64Values) {
VehiclePropValue prop{
// INT64_VEC property.
diff --git a/automotive/vehicle/aidl/impl/vhal/Android.bp b/automotive/vehicle/aidl/impl/vhal/Android.bp
index 39295aa..aa30f80 100644
--- a/automotive/vehicle/aidl/impl/vhal/Android.bp
+++ b/automotive/vehicle/aidl/impl/vhal/Android.bp
@@ -65,6 +65,7 @@
],
header_libs: [
"IVehicleHardware",
+ "IVehicleGeneratedHeaders",
],
shared_libs: [
"libbinder_ndk",
diff --git a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h
index f7a71b4..250b30c 100644
--- a/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h
+++ b/automotive/vehicle/aidl/impl/vhal/include/DefaultVehicleHal.h
@@ -49,6 +49,9 @@
explicit DefaultVehicleHal(std::unique_ptr<IVehicleHardware> hardware);
+ // Test-only
+ DefaultVehicleHal(std::unique_ptr<IVehicleHardware> hardware, int32_t testInterfaceVersion);
+
~DefaultVehicleHal();
ndk::ScopedAStatus getAllPropConfigs(
@@ -153,6 +156,8 @@
mPropertyChangeEventsBatchingConsumer;
// Only set once during initialization.
std::chrono::nanoseconds mEventBatchingWindow;
+ // Only used for testing.
+ int32_t mTestInterfaceVersion = 0;
std::mutex mLock;
std::unordered_map<const AIBinder*, std::unique_ptr<OnBinderDiedContext>> mOnBinderDiedContexts
@@ -227,6 +232,8 @@
std::vector<aidl::android::hardware::automotive::vehicle::VehiclePropValue>&&
batchedEvents);
+ int32_t getVhalInterfaceVersion();
+
// Puts the property change events into a queue so that they can handled in batch.
static void batchPropertyChangeEvent(
const std::weak_ptr<ConcurrentQueue<
diff --git a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp
index 76d2f31..cc5edcc 100644
--- a/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/src/DefaultVehicleHal.cpp
@@ -22,6 +22,7 @@
#include <LargeParcelableBase.h>
#include <VehicleHalTypes.h>
#include <VehicleUtils.h>
+#include <VersionForVehicleProperty.h>
#include <android-base/result.h>
#include <android-base/stringprintf.h>
@@ -61,6 +62,7 @@
using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyChangeMode;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue;
+using ::aidl::android::hardware::automotive::vehicle::VersionForVehicleProperty;
using ::android::automotive::car_binder_lib::LargeParcelableBase;
using ::android::base::Error;
using ::android::base::expected;
@@ -94,8 +96,13 @@
} // namespace
DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr<IVehicleHardware> vehicleHardware)
+ : DefaultVehicleHal(std::move(vehicleHardware), /* testInterfaceVersion= */ 0){};
+
+DefaultVehicleHal::DefaultVehicleHal(std::unique_ptr<IVehicleHardware> vehicleHardware,
+ int32_t testInterfaceVersion)
: mVehicleHardware(std::move(vehicleHardware)),
- mPendingRequestPool(std::make_shared<PendingRequestPool>(TIMEOUT_IN_NANO)) {
+ mPendingRequestPool(std::make_shared<PendingRequestPool>(TIMEOUT_IN_NANO)),
+ mTestInterfaceVersion(testInterfaceVersion) {
if (!getAllPropConfigsFromHardware()) {
return;
}
@@ -312,13 +319,46 @@
mPendingRequestPool = std::make_unique<PendingRequestPool>(timeoutInNano);
}
+int32_t DefaultVehicleHal::getVhalInterfaceVersion() {
+ if (mTestInterfaceVersion != 0) {
+ return mTestInterfaceVersion;
+ }
+ int32_t myVersion = 0;
+ getInterfaceVersion(&myVersion);
+ return myVersion;
+}
+
bool DefaultVehicleHal::getAllPropConfigsFromHardware() {
auto configs = mVehicleHardware->getAllPropertyConfigs();
+ std::vector<VehiclePropConfig> filteredConfigs;
+ int32_t myVersion = getVhalInterfaceVersion();
for (auto& config : configs) {
+ if (!isSystemProp(config.prop)) {
+ filteredConfigs.push_back(std::move(config));
+ continue;
+ }
+ VehicleProperty property = static_cast<VehicleProperty>(config.prop);
+ std::string propertyName = aidl::android::hardware::automotive::vehicle::toString(property);
+ auto it = VersionForVehicleProperty.find(property);
+ if (it == VersionForVehicleProperty.end()) {
+ ALOGE("The property: %s is not a supported system property, ignore",
+ propertyName.c_str());
+ continue;
+ }
+ int requiredVersion = it->second;
+ if (myVersion < requiredVersion) {
+ ALOGE("The property: %s is not supported for current client VHAL version, "
+ "require %d, current version: %d, ignore",
+ propertyName.c_str(), requiredVersion, myVersion);
+ continue;
+ }
+ filteredConfigs.push_back(std::move(config));
+ }
+ for (auto& config : filteredConfigs) {
mConfigsByPropId[config.prop] = config;
}
VehiclePropConfigs vehiclePropConfigs;
- vehiclePropConfigs.payloads = std::move(configs);
+ vehiclePropConfigs.payloads = std::move(filteredConfigs);
auto result = LargeParcelableBase::parcelableToStableLargeParcelable(vehiclePropConfigs);
if (!result.ok()) {
ALOGE("failed to convert configs to shared memory file, error: %s, code: %d",
@@ -413,9 +453,9 @@
.status = getErrorCode(result),
.prop = {},
});
- } else {
- hardwareRequests.push_back(request);
+ continue;
}
+ hardwareRequests.push_back(request);
}
// The set of request Ids that we would send to hardware.
@@ -816,6 +856,7 @@
if (!result.ok()) {
return StatusError(StatusCode::INVALID_ARG) << getErrorMsg(result);
}
+
const VehiclePropConfig* config = result.value();
const VehicleAreaConfig* areaConfig = getAreaConfig(value, *config);
@@ -900,6 +941,7 @@
dprintf(fd, "Vehicle HAL State: \n");
{
std::scoped_lock<std::mutex> lockGuard(mLock);
+ dprintf(fd, "Interface version: %" PRId32 "\n", getVhalInterfaceVersion());
dprintf(fd, "Containing %zu property configs\n", mConfigsByPropId.size());
dprintf(fd, "Currently have %zu getValues clients\n", mGetValuesClients.size());
dprintf(fd, "Currently have %zu setValues clients\n", mSetValuesClients.size());
diff --git a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
index a63cb84..bb82108 100644
--- a/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
+++ b/automotive/vehicle/aidl/impl/vhal/test/DefaultVehicleHalTest.cpp
@@ -79,36 +79,37 @@
using ::ndk::SpAIBinder;
using ::testing::ContainsRegex;
+using ::testing::ElementsAre;
using ::testing::Eq;
using ::testing::UnorderedElementsAre;
using ::testing::UnorderedElementsAreArray;
using ::testing::WhenSortedBy;
constexpr int32_t INVALID_PROP_ID = 0;
-// VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32
-constexpr int32_t INT32_WINDOW_PROP = 10001 + 0x10000000 + 0x03000000 + 0x00400000;
-// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
-constexpr int32_t GLOBAL_ON_CHANGE_PROP = 10002 + 0x10000000 + 0x01000000 + 0x00400000;
-// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
-constexpr int32_t GLOBAL_CONTINUOUS_PROP = 10003 + 0x10000000 + 0x01000000 + 0x00400000;
-// VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32
-constexpr int32_t AREA_ON_CHANGE_PROP = 10004 + 0x10000000 + 0x03000000 + 0x00400000;
-// VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32
-constexpr int32_t AREA_CONTINUOUS_PROP = 10005 + 0x10000000 + 0x03000000 + 0x00400000;
-// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
-constexpr int32_t READ_ONLY_PROP = 10006 + 0x10000000 + 0x01000000 + 0x00400000;
-// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
-constexpr int32_t WRITE_ONLY_PROP = 10007 + 0x10000000 + 0x01000000 + 0x00400000;
-// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
-constexpr int32_t GLOBAL_CONTINUOUS_PROP_NO_VUR = 10008 + 0x10000000 + 0x01000000 + 0x00400000;
-// VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
-constexpr int32_t GLOBAL_NONE_ACCESS_PROP = 10009 + 0x10000000 + 0x01000000 + 0x00400000;
-// VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32
-constexpr int32_t AREA_NONE_ACCESS_PROP = 10010 + 0x10000000 + 0x03000000 + 0x00400000;
+// VehiclePropertyGroup:VENDOR,VehicleArea:WINDOW,VehiclePropertyType:INT32
+constexpr int32_t INT32_WINDOW_PROP = 10001 + 0x20000000 + 0x03000000 + 0x00400000;
+// VehiclePropertyGroup:VENDOR,VehicleArea:GLOBAL,VehiclePropertyType:INT32
+constexpr int32_t GLOBAL_ON_CHANGE_PROP = 10002 + 0x20000000 + 0x01000000 + 0x00400000;
+// VehiclePropertyGroup:VENDOR,VehicleArea:GLOBAL,VehiclePropertyType:INT32
+constexpr int32_t GLOBAL_CONTINUOUS_PROP = 10003 + 0x20000000 + 0x01000000 + 0x00400000;
+// VehiclePropertyGroup:VENDOR,VehicleArea:WINDOW,VehiclePropertyType:INT32
+constexpr int32_t AREA_ON_CHANGE_PROP = 10004 + 0x20000000 + 0x03000000 + 0x00400000;
+// VehiclePropertyGroup:VENDOR,VehicleArea:WINDOW,VehiclePropertyType:INT32
+constexpr int32_t AREA_CONTINUOUS_PROP = 10005 + 0x20000000 + 0x03000000 + 0x00400000;
+// VehiclePropertyGroup:VENDOR,VehicleArea:GLOBAL,VehiclePropertyType:INT32
+constexpr int32_t READ_ONLY_PROP = 10006 + 0x20000000 + 0x01000000 + 0x00400000;
+// VehiclePropertyGroup:VENDOR,VehicleArea:GLOBAL,VehiclePropertyType:INT32
+constexpr int32_t WRITE_ONLY_PROP = 10007 + 0x20000000 + 0x01000000 + 0x00400000;
+// VehiclePropertyGroup:VENDOR,VehicleArea:GLOBAL,VehiclePropertyType:INT32
+constexpr int32_t GLOBAL_CONTINUOUS_PROP_NO_VUR = 10008 + 0x20000000 + 0x01000000 + 0x00400000;
+// VehiclePropertyGroup:VENDOR,VehicleArea:GLOBAL,VehiclePropertyType:INT32
+constexpr int32_t GLOBAL_NONE_ACCESS_PROP = 10009 + 0x20000000 + 0x01000000 + 0x00400000;
+// VehiclePropertyGroup:VENDOR,VehicleArea:WINDOW,VehiclePropertyType:INT32
+constexpr int32_t AREA_NONE_ACCESS_PROP = 10010 + 0x20000000 + 0x03000000 + 0x00400000;
int32_t testInt32VecProp(size_t i) {
- // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
- return static_cast<int32_t>(i) + 0x10000000 + 0x01000000 + 0x00410000;
+ // VehiclePropertyGroup:VENDOR,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
+ return static_cast<int32_t>(i) + 0x20000000 + 0x01000000 + 0x00410000;
}
std::string toString(const std::vector<SubscribeOptions>& options) {
@@ -556,10 +557,10 @@
TEST_F(DefaultVehicleHalTest, testGetAllPropConfigsSmall) {
auto testConfigs = std::vector<VehiclePropConfig>({
VehiclePropConfig{
- .prop = 1,
+ .prop = testInt32VecProp(1),
},
VehiclePropConfig{
- .prop = 2,
+ .prop = testInt32VecProp(2),
},
});
@@ -580,7 +581,7 @@
// 5000 VehiclePropConfig exceeds 4k memory limit, so it would be sent through shared memory.
for (size_t i = 0; i < 5000; i++) {
testConfigs.push_back(VehiclePropConfig{
- .prop = static_cast<int32_t>(i),
+ .prop = testInt32VecProp(i),
});
}
@@ -600,13 +601,42 @@
ASSERT_EQ(result.value().getObject()->payloads, testConfigs);
}
+TEST_F(DefaultVehicleHalTest, testGetAllPropConfigsFilterOutUnsupportedPropIdsForThisVersion) {
+ auto testConfigs = std::vector<VehiclePropConfig>({
+ // This is supported from V2.
+ VehiclePropConfig{
+ .prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED),
+ },
+ // This is supported from V3
+ VehiclePropConfig{
+ .prop = toInt(VehicleProperty::ULTRASONICS_SENSOR_POSITION),
+ },
+ });
+
+ auto hardware = std::make_unique<MockVehicleHardware>();
+ hardware->setPropertyConfigs(testConfigs);
+ auto vhal = ndk::SharedRefBase::make<DefaultVehicleHal>(std::move(hardware),
+ /* testInterfaceVersion= */ 2);
+ std::shared_ptr<IVehicle> client = IVehicle::fromBinder(vhal->asBinder());
+
+ VehiclePropConfigs output;
+ auto status = client->getAllPropConfigs(&output);
+
+ ASSERT_TRUE(status.isOk()) << "getAllPropConfigs failed: " << status.getMessage();
+ ASSERT_THAT(output.payloads, ElementsAre(VehiclePropConfig{
+ .prop = toInt(VehicleProperty::PERF_VEHICLE_SPEED),
+ }));
+}
+
TEST_F(DefaultVehicleHalTest, testGetPropConfigs) {
+ int32_t propId1 = testInt32VecProp(1);
+ int32_t propId2 = testInt32VecProp(2);
auto testConfigs = std::vector<VehiclePropConfig>({
VehiclePropConfig{
- .prop = 1,
+ .prop = propId1,
},
VehiclePropConfig{
- .prop = 2,
+ .prop = propId2,
},
});
@@ -616,7 +646,7 @@
std::shared_ptr<IVehicle> client = IVehicle::fromBinder(vhal->asBinder());
VehiclePropConfigs output;
- auto status = client->getPropConfigs(std::vector<int32_t>({1, 2}), &output);
+ auto status = client->getPropConfigs(std::vector<int32_t>({propId1, propId2}), &output);
ASSERT_TRUE(status.isOk()) << "getPropConfigs failed: " << status.getMessage();
ASSERT_EQ(output.payloads, testConfigs);
@@ -625,10 +655,10 @@
TEST_F(DefaultVehicleHalTest, testGetPropConfigsInvalidArg) {
auto testConfigs = std::vector<VehiclePropConfig>({
VehiclePropConfig{
- .prop = 1,
+ .prop = testInt32VecProp(1),
},
VehiclePropConfig{
- .prop = 2,
+ .prop = testInt32VecProp(2),
},
});
@@ -638,7 +668,9 @@
std::shared_ptr<IVehicle> client = IVehicle::fromBinder(vhal->asBinder());
VehiclePropConfigs output;
- auto status = client->getPropConfigs(std::vector<int32_t>({1, 2, 3}), &output);
+ auto status = client->getPropConfigs(
+ std::vector<int32_t>({testInt32VecProp(1), testInt32VecProp(2), testInt32VecProp(3)}),
+ &output);
ASSERT_FALSE(status.isOk()) << "getPropConfigs must fail with invalid prop ID";
ASSERT_EQ(status.getServiceSpecificError(), toInt(StatusCode::INVALID_ARG));
diff --git a/automotive/vehicle/aidl/impl/vhal/vhal-default-service.xml b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.xml
index 9834cdb..b0c6ae7 100644
--- a/automotive/vehicle/aidl/impl/vhal/vhal-default-service.xml
+++ b/automotive/vehicle/aidl/impl/vhal/vhal-default-service.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.automotive.vehicle</name>
- <version>2</version>
+ <version>3</version>
<fqname>IVehicle/default</fqname>
</hal>
</manifest>
diff --git a/automotive/vehicle/aidl/rust_impl/README.md b/automotive/vehicle/aidl/rust_impl/README.md
new file mode 100644
index 0000000..33f996b
--- /dev/null
+++ b/automotive/vehicle/aidl/rust_impl/README.md
@@ -0,0 +1,12 @@
+# Rust Skeleton VHAL implementation.
+
+WARNING: This is not a reference VHAL implementation and does not contain
+any actual implementation.
+
+This folder contains a skeleton VHAL implementation in Rust to demonstrate
+how vendor may implement a Rust VHAL. To run this VHAL, include
+`android.hardware.automotive.vehicle-V3-rust-service` in your image.
+
+This implementation returns `StatusCode::UNKNOWN_ERROR` for all operations
+and does not pass VTS/CTS. Vendor must replace the logic in
+`default_vehicle_hal.rs` with the actual implementation.
diff --git a/automotive/vehicle/aidl/rust_impl/vhal/Android.bp b/automotive/vehicle/aidl/rust_impl/vhal/Android.bp
new file mode 100644
index 0000000..46f37d8
--- /dev/null
+++ b/automotive/vehicle/aidl/rust_impl/vhal/Android.bp
@@ -0,0 +1,29 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+
+rust_binary {
+ name: "android.hardware.automotive.vehicle-V3-rust-service",
+ relative_install_path: "hw",
+ vendor: true,
+ srcs: ["src/*.rs"],
+ crate_root: "src/main.rs",
+ defaults: ["VehicleHalInterfaceRustDefaults"],
+ vintf_fragments: ["vhal-rust-service.xml"],
+ init_rc: ["vhal-rust-service.rc"],
+ rustlibs: [
+ "libbinder_rs",
+ ],
+}
diff --git a/automotive/vehicle/aidl/rust_impl/vhal/src/default_vehicle_hal.rs b/automotive/vehicle/aidl/rust_impl/vhal/src/default_vehicle_hal.rs
new file mode 100644
index 0000000..1f5dc95
--- /dev/null
+++ b/automotive/vehicle/aidl/rust_impl/vhal/src/default_vehicle_hal.rs
@@ -0,0 +1,55 @@
+use android_hardware_automotive_vehicle::aidl::android::hardware::automotive::vehicle::{
+ IVehicle::IVehicle,
+ IVehicleCallback::IVehicleCallback,
+ VehiclePropConfigs::VehiclePropConfigs,
+ GetValueRequests::GetValueRequests,
+ SetValueRequests::SetValueRequests,
+ SubscribeOptions::SubscribeOptions,
+};
+use binder::{Interface, Result as BinderResult, StatusCode, Strong};
+
+/// This struct is defined to implement IVehicle AIDL interface.
+pub struct DefaultVehicleHal;
+
+impl Interface for DefaultVehicleHal {}
+
+impl IVehicle for DefaultVehicleHal {
+ fn getAllPropConfigs(&self) -> BinderResult<VehiclePropConfigs> {
+ Err(StatusCode::UNKNOWN_ERROR.into())
+ }
+
+ fn getPropConfigs(&self, _props: &[i32]) -> BinderResult<VehiclePropConfigs> {
+ Err(StatusCode::UNKNOWN_ERROR.into())
+ }
+
+ fn getValues(
+ &self, _callback: &Strong<dyn IVehicleCallback>, _requests: &GetValueRequests
+ ) -> BinderResult<()> {
+ Err(StatusCode::UNKNOWN_ERROR.into())
+ }
+
+ fn setValues(
+ &self, _callback: &Strong<dyn IVehicleCallback>, _requests: &SetValueRequests
+ ) -> BinderResult<()> {
+ Err(StatusCode::UNKNOWN_ERROR.into())
+ }
+
+ fn subscribe(
+ &self, _callback: &Strong<dyn IVehicleCallback>, _options: &[SubscribeOptions],
+ _max_shared_memory_file_count: i32
+ ) -> BinderResult<()> {
+ Err(StatusCode::UNKNOWN_ERROR.into())
+ }
+
+ fn unsubscribe(
+ &self, _callback: &Strong<dyn IVehicleCallback>, _prop_ids: &[i32]
+ ) -> BinderResult<()> {
+ Err(StatusCode::UNKNOWN_ERROR.into())
+ }
+
+ fn returnSharedMemory(
+ &self, _callback: &Strong<dyn IVehicleCallback>, _shared_memory_id: i64
+ ) -> BinderResult<()> {
+ Err(StatusCode::UNKNOWN_ERROR.into())
+ }
+}
diff --git a/automotive/vehicle/aidl/rust_impl/vhal/src/main.rs b/automotive/vehicle/aidl/rust_impl/vhal/src/main.rs
new file mode 100644
index 0000000..59b248d
--- /dev/null
+++ b/automotive/vehicle/aidl/rust_impl/vhal/src/main.rs
@@ -0,0 +1,18 @@
+mod default_vehicle_hal;
+
+use android_hardware_automotive_vehicle::aidl::android::hardware::automotive::vehicle::IVehicle::BnVehicle;
+use crate::default_vehicle_hal::DefaultVehicleHal;
+
+fn main() {
+ binder::ProcessState::start_thread_pool();
+ let my_service = DefaultVehicleHal;
+ let service_name = "android.hardware.automotive.vehicle.IVehicle/default";
+ let my_service_binder = BnVehicle::new_binder(
+ my_service,
+ binder::BinderFeatures::default(),
+ );
+ binder::add_service(service_name, my_service_binder.as_binder())
+ .expect(format!("Failed to register {}?", service_name).as_str());
+ // Does not return.
+ binder::ProcessState::join_thread_pool()
+}
diff --git a/automotive/vehicle/aidl/rust_impl/vhal/vhal-rust-service.rc b/automotive/vehicle/aidl/rust_impl/vhal/vhal-rust-service.rc
new file mode 100644
index 0000000..dff9894
--- /dev/null
+++ b/automotive/vehicle/aidl/rust_impl/vhal/vhal-rust-service.rc
@@ -0,0 +1,4 @@
+service vendor.vehicle-hal-default /vendor/bin/hw/android.hardware.automotive.vehicle-V3-rust-service
+ class early_hal
+ user vehicle_network
+ group system inet
diff --git a/automotive/vehicle/aidl/rust_impl/vhal/vhal-rust-service.xml b/automotive/vehicle/aidl/rust_impl/vhal/vhal-rust-service.xml
new file mode 100644
index 0000000..b0c6ae7
--- /dev/null
+++ b/automotive/vehicle/aidl/rust_impl/vhal/vhal-rust-service.xml
@@ -0,0 +1,7 @@
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.automotive.vehicle</name>
+ <version>3</version>
+ <fqname>IVehicle/default</fqname>
+ </hal>
+</manifest>
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LowSpeedAutomaticEmergencyBrakingState.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LowSpeedAutomaticEmergencyBrakingState.aidl
new file mode 100644
index 0000000..70014e1
--- /dev/null
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/LowSpeedAutomaticEmergencyBrakingState.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.automotive.vehicle;
+@Backing(type="int") @VintfStability
+enum LowSpeedAutomaticEmergencyBrakingState {
+ OTHER = 0,
+ ENABLED = 1,
+ ACTIVATED = 2,
+ USER_OVERRIDE = 3,
+}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
index 9720aca..55af2ab 100644
--- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
@@ -37,4 +37,5 @@
USER_POWER_ON = 0,
SYSTEM_USER_DETECTION = 1,
SYSTEM_REMOTE_ACCESS = 2,
+ SYSTEM_ENTER_GARAGE_MODE = 3,
}
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl
index efae92f..2e25466 100644
--- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleProperty.aidl
@@ -123,6 +123,7 @@
DISPLAY_BRIGHTNESS = (((0x0A03 + 0x10000000) + 0x01000000) + 0x00400000) /* 289409539 */,
PER_DISPLAY_BRIGHTNESS = (((0x0A04 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475076 */,
VALET_MODE_ENABLED = (((0x0A05 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287312389 */,
+ HEAD_UP_DISPLAY_ENABLED = (((0x0A06 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 354421254 */,
HW_KEY_INPUT = (((0x0A10 + 0x10000000) + 0x01000000) + 0x00410000) /* 289475088 */,
HW_KEY_INPUT_V2 = (((0x0A11 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.MIXED) /* 367004177 */,
HW_MOTION_INPUT = (((0x0A12 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.SEAT) + android.hardware.automotive.vehicle.VehiclePropertyType.MIXED) /* 367004178 */,
@@ -198,10 +199,11 @@
VEHICLE_MAP_SERVICE = (((0x0C00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299895808 */,
LOCATION_CHARACTERIZATION = (((0x0C10 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289410064 */,
ULTRASONICS_SENSOR_POSITION = (((0x0C20 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916128 */,
- ULTRASONICS_SENSOR_ORIENTATION = (((0x0C21 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916129 */,
+ ULTRASONICS_SENSOR_ORIENTATION = (((0x0C21 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.FLOAT_VEC) /* 409013281 */,
ULTRASONICS_SENSOR_FIELD_OF_VIEW = (((0x0C22 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916130 */,
ULTRASONICS_SENSOR_DETECTION_RANGE = (((0x0C23 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916131 */,
ULTRASONICS_SENSOR_SUPPORTED_RANGES = (((0x0C24 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916132 */,
+ ULTRASONICS_SENSOR_MEASURED_DISTANCE = (((0x0C25 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.VENDOR) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32_VEC) /* 406916133 */,
OBD2_LIVE_FRAME = (((0x0D00 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896064 */,
OBD2_FREEZE_FRAME = (((0x0D01 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896065 */,
OBD2_FREEZE_FRAME_INFO = (((0x0D02 + 0x10000000) + 0x01000000) + 0x00e00000) /* 299896066 */,
@@ -296,4 +298,6 @@
LOW_SPEED_COLLISION_WARNING_STATE = (((0x1022 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411106 */,
CROSS_TRAFFIC_MONITORING_ENABLED = (((0x1023 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313955 */,
CROSS_TRAFFIC_MONITORING_WARNING_STATE = (((0x1024 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411108 */,
+ LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_ENABLED = (((0x1025 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.BOOLEAN) /* 287313957 */,
+ LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE = (((0x1026 + android.hardware.automotive.vehicle.VehiclePropertyGroup.SYSTEM) + android.hardware.automotive.vehicle.VehicleArea.GLOBAL) + android.hardware.automotive.vehicle.VehiclePropertyType.INT32) /* 289411110 */,
}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LowSpeedAutomaticEmergencyBrakingState.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LowSpeedAutomaticEmergencyBrakingState.aidl
new file mode 100644
index 0000000..978da25
--- /dev/null
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/LowSpeedAutomaticEmergencyBrakingState.aidl
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2023 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.automotive.vehicle;
+
+/**
+ * Used to enumerate the state of Low Speed Automatic Emergency Braking.
+ */
+@VintfStability
+@Backing(type="int")
+enum LowSpeedAutomaticEmergencyBrakingState {
+
+ /**
+ * This state is used as an alternative to any LowSpeedAutomaticEmergencyBrakingState value that
+ * is not defined in the platform. Ideally, implementations of
+ * VehicleProperty#LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE should not use this state. The
+ * framework can use this field to remain backwards compatible if
+ * LowSpeedAutomaticEmergencyBrakingState is extended to include additional states.
+ */
+ OTHER = 0,
+ /**
+ * Low Speed Automatic Emergency Braking is enabled and monitoring safety, but brakes are not
+ * activated.
+ */
+ ENABLED = 1,
+ /**
+ * Low Speed Automatic Emergency Braking is enabled and currently has the brakes applied for the
+ * vehicle.
+ */
+ ACTIVATED = 2,
+ /**
+ * Many Low Speed Automatic Emergency Braking implementations allow the driver to override Low
+ * Speed Automatic Emergency Braking. This means that the car has determined it should brake,
+ * but a user decides to take over and do something else. This is often done for safety reasons
+ * and to ensure that the driver can always take control of the vehicle. This state should be
+ * set when the user is actively overriding the low speed automatic emergency braking system.
+ */
+ USER_OVERRIDE = 3,
+}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
index e325b38..8c8c2da 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
@@ -34,7 +34,24 @@
SYSTEM_USER_DETECTION = 1,
/**
* Automatic power on to execute a remote task. This is triggered by
- * receiving a wakeup message from TCU wakeup client.
+ * receiving a wakeup message from an external system in the vehicle.
*/
SYSTEM_REMOTE_ACCESS = 2,
+ /**
+ * Automatic power on to enter garage mode. This is triggered by
+ * receiving a wakeup message from an external system in the vehicle.
+ *
+ * Note that this does not necessarily mean Android will enter
+ * the garage mode since user may enter the vehicle after this is set.
+ * The system will only enter garage mode if VEHICLE_IN_USE is not true
+ * upon check.
+ *
+ * To consider the Time-Of-Check-Time-Of-Use issue, there is a slight chance
+ * that the vehicle become in-use after car service does the VEHICLE_IN_USE
+ * check. The external power controller must also check whether the vehicle
+ * is in use upon receiving the SHUTDOWN_REQUEST, before sending out
+ * SHUTDOWN_PREPARE, to make sure the system does not enter garage mode or
+ * shutdown if the vehicle is currently in use.
+ */
+ SYSTEM_ENTER_GARAGE_MODE = 3,
}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
index 923d42a..538b905 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.aidl
@@ -20,33 +20,39 @@
@Backing(type="int")
enum VehicleApPowerStateShutdownParam {
/**
- * AP must shutdown immediately. Postponing is not allowed.
+ * AP must shutdown without Garage mode.
+ * If AP need to shutdown as soon as possible, EMERGENCY_SHUTDOWN shall be used.
*/
SHUTDOWN_IMMEDIATELY = 1,
/**
* AP can enter deep sleep instead of shutting down completely.
+ * AP can postpone entering deep sleep to run Garage mode.
*/
CAN_SLEEP = 2,
/**
- * AP can only shutdown with postponing allowed.
+ * AP can only shutdown.
+ * AP can postpone shutdown to run Garage mode.
*/
SHUTDOWN_ONLY = 3,
/**
- * AP may enter deep sleep, but must either sleep or shut down immediately.
- * Postponing is not allowed.
+ * AP can enter deep sleep, without Garage mode.
+ * Depending on the actual implementation, it may shut down immediately
*/
SLEEP_IMMEDIATELY = 4,
/**
- * AP must hibernate (suspend to disk) immediately. Postponing is not allowed.
- * Depending on the actual implementation, it may shut down immediately
+ * AP can hibernate (suspend to disk) without Garage mode.
+ * Depending on the actual implementation, it may shut down immediately.
*/
HIBERNATE_IMMEDIATELY = 5,
/**
* AP can enter hibernation (suspend to disk) instead of shutting down completely.
+ * AP can postpone hibernation to run Garage mode.
*/
CAN_HIBERNATE = 6,
/**
- * AP must shutdown (gracefully) without a delay.
+ * AP must shutdown (gracefully) without a delay. AP cannot run Garage mode.
+ * This type must be used only in critical situations when AP must shutdown as soon as possible.
+ * CarService will only notify listeners, but will not wait for completion reports.
*/
EMERGENCY_SHUTDOWN = 7,
}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
index acb6aeb..97e7847 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
@@ -52,6 +52,7 @@
*
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
INFO_VIN = 0x0100 + 0x10000000 + 0x01000000
+ 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING
@@ -60,6 +61,7 @@
*
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
INFO_MAKE = 0x0101 + 0x10000000 + 0x01000000
+ 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING
@@ -68,15 +70,17 @@
*
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
INFO_MODEL = 0x0102 + 0x10000000 + 0x01000000
+ 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING
/**
- * Model year of vehicle.
+ * Model year of vehicle in YYYY format based on the Gregorian calendar.
*
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:YEAR
+ * @version 2
*/
INFO_MODEL_YEAR = 0x0103 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -86,6 +90,7 @@
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:MILLILITER
+ * @version 2
*/
INFO_FUEL_CAPACITY = 0x0104 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -105,6 +110,7 @@
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
* @data_enum FuelType
+ * @version 2
*/
INFO_FUEL_TYPE = 0x0105 + 0x10000000 + 0x01000000
+ 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
@@ -119,6 +125,7 @@
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:WH
+ * @version 2
*/
INFO_EV_BATTERY_CAPACITY = 0x0106 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -128,6 +135,7 @@
* @change_mode VehiclePropertyChangeMode.STATIC
* @data_enum EvConnectorType
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
INFO_EV_CONNECTOR_TYPE = 0x0107 + 0x10000000 + 0x01000000
+ 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
@@ -137,6 +145,7 @@
* @change_mode VehiclePropertyChangeMode.STATIC
* @data_enum PortLocationType
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
INFO_FUEL_DOOR_LOCATION = 0x0108 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -146,6 +155,7 @@
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
* @data_enum PortLocationType
+ * @version 2
*/
INFO_EV_PORT_LOCATION = 0x0109 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -156,6 +166,7 @@
* @change_mode VehiclePropertyChangeMode.STATIC
* @data_enum VehicleAreaSeat
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
INFO_DRIVER_SEAT = 0x010A + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -174,6 +185,7 @@
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:MILLIMETER
+ * @version 2
*/
INFO_EXTERIOR_DIMENSIONS = 0x010B + 0x10000000 + 0x01000000
+ 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
@@ -189,6 +201,7 @@
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
* @data_enum PortLocationType
+ * @version 2
*/
INFO_MULTI_EV_PORT_LOCATIONS = 0x010C + 0x10000000 + 0x01000000
+ 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
@@ -198,6 +211,7 @@
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:KILOMETER
+ * @version 2
*/
PERF_ODOMETER = 0x0204 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -213,6 +227,7 @@
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:METER_PER_SEC
+ * @version 2
*/
PERF_VEHICLE_SPEED = 0x0207 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -225,6 +240,7 @@
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:METER_PER_SEC
+ * @version 2
*/
PERF_VEHICLE_SPEED_DISPLAY = 0x0208 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -236,6 +252,7 @@
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:DEGREES
+ * @version 2
*/
PERF_STEERING_ANGLE = 0x0209 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -247,6 +264,7 @@
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:DEGREES
+ * @version 2
*/
PERF_REAR_STEERING_ANGLE = 0x0210 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -256,6 +274,7 @@
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:CELSIUS
+ * @version 2
*/
ENGINE_COOLANT_TEMP = 0x0301 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -265,6 +284,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleOilLevel
+ * @version 2
*/
ENGINE_OIL_LEVEL = 0x0303 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -274,6 +294,7 @@
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:CELSIUS
+ * @version 2
*/
ENGINE_OIL_TEMP = 0x0304 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -283,6 +304,7 @@
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:RPM
+ * @version 2
*/
ENGINE_RPM = 0x0305 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -323,6 +345,7 @@
*
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
WHEEL_TICK = 0x0306 + 0x10000000 + 0x01000000
+ 0x00510000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT64_VEC
@@ -334,6 +357,7 @@
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:MILLILITER
+ * @version 2
*/
FUEL_LEVEL = 0x0307 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -346,6 +370,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
FUEL_DOOR_OPEN = 0x0308 + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -359,6 +384,7 @@
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:WH
+ * @version 2
*/
EV_BATTERY_LEVEL = 0x0309 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -373,6 +399,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:WH
+ * @version 2
*/
EV_CURRENT_BATTERY_CAPACITY =
0x030D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.FLOAT,
@@ -385,6 +412,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
EV_CHARGE_PORT_OPEN = 0x030A + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -393,6 +421,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
EV_CHARGE_PORT_CONNECTED = 0x030B + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -405,6 +434,7 @@
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:MW
+ * @version 2
*/
EV_BATTERY_INSTANTANEOUS_CHARGE_RATE = 0x030C + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -423,6 +453,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:METER
+ * @version 2
*/
RANGE_REMAINING = 0x0308 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -436,6 +467,7 @@
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:CELSIUS
+ * @version 3
*/
EV_BATTERY_AVERAGE_TEMPERATURE =
0x030E + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.FLOAT,
@@ -463,6 +495,7 @@
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:KILOPASCAL
+ * @version 2
*/
TIRE_PRESSURE = 0x0309 + 0x10000000 + 0x07000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WHEEL,VehiclePropertyType:FLOAT
@@ -478,6 +511,7 @@
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:KILOPASCAL
+ * @version 2
*/
CRITICALLY_LOW_TIRE_PRESSURE = 0x030A + 0x10000000 + 0x07000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WHEEL,VehiclePropertyType:FLOAT
@@ -493,6 +527,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
ENGINE_IDLE_AUTO_STOP_ENABLED =
0x0320 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -509,6 +544,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum ImpactSensorLocation
+ * @version 3
*/
IMPACT_DETECTED =
0x0330 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -529,6 +565,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleGear
+ * @version 2
*/
GEAR_SELECTION = 0x0400 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -548,6 +585,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleGear
+ * @version 2
*/
CURRENT_GEAR = 0x0401 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -559,6 +597,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
PARKING_BRAKE_ON = 0x0402 + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -576,6 +615,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
PARKING_BRAKE_AUTO_APPLY = 0x0403 + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -594,6 +634,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
EV_BRAKE_REGENERATION_LEVEL =
0x040C + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -612,6 +653,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
FUEL_LEVEL_LOW = 0x0405 + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -624,6 +666,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
NIGHT_MODE = 0x0407 + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -633,6 +676,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleTurnSignal
+ * @version 2
*/
TURN_SIGNAL_STATE = 0x0408 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -642,6 +686,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleIgnitionState
+ * @version 2
*/
IGNITION_STATE = 0x0409 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -654,6 +699,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
ABS_ACTIVE = 0x040A + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -666,6 +712,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
TRACTION_CONTROL_ACTIVE = 0x040B + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -684,6 +731,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum EvStoppingMode
+ * @version 2
*/
EV_STOPPING_MODE =
0x040D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -705,6 +753,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 3
*/
ELECTRONIC_STABILITY_CONTROL_ENABLED =
0x040E + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -723,6 +772,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum ElectronicStabilityControlState
* @data_enum ErrorState
+ * @version 2
*/
ELECTRONIC_STABILITY_CONTROL_STATE =
0x040F + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -789,6 +839,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HVAC_FAN_SPEED = 0x0500 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -802,6 +853,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleHvacFanDirection
+ * @version 2
*/
HVAC_FAN_DIRECTION = 0x0501 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -811,6 +863,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:CELSIUS
+ * @version 2
*/
HVAC_TEMPERATURE_CURRENT = 0x0502 + 0x10000000 + 0x05000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:FLOAT
@@ -842,6 +895,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:CELSIUS
+ * @version 2
*/
HVAC_TEMPERATURE_SET = 0x0503 + 0x10000000 + 0x05000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:FLOAT
@@ -854,6 +908,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HVAC_DEFROSTER = 0x0504 + 0x10000000 + 0x03000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN
@@ -867,6 +922,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @config_flags Supported areaIds
+ * @version 2
*/
HVAC_AC_ON = 0x0505 + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -884,6 +940,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HVAC_MAX_AC_ON = 0x0506 + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -907,6 +964,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HVAC_MAX_DEFROST_ON = 0x0507 + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -924,6 +982,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HVAC_RECIRC_ON = 0x0508 + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -963,6 +1022,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HVAC_DUAL_ON = 0x0509 + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -985,6 +1045,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HVAC_AUTO_ON = 0x050A + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -1007,6 +1068,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HVAC_SEAT_TEMPERATURE = 0x050B + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -1030,6 +1092,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HVAC_SIDE_MIRROR_HEAT = 0x050C + 0x10000000 + 0x04000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32
@@ -1053,6 +1116,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HVAC_STEERING_WHEEL_HEAT = 0x050D + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -1079,6 +1143,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleUnit
+ * @version 2
*/
HVAC_TEMPERATURE_DISPLAY_UNITS = 0x050E + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -1087,6 +1152,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HVAC_ACTUAL_FAN_SPEED_RPM = 0x050F + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -1133,6 +1199,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HVAC_POWER_ON = 0x0510 + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -1152,6 +1219,7 @@
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
* @data_enum VehicleHvacFanDirection
+ * @version 2
*/
HVAC_FAN_DIRECTION_AVAILABLE = 0x0511 + 0x10000000 + 0x05000000
+ 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32_VEC
@@ -1168,6 +1236,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HVAC_AUTO_RECIRC_ON = 0x0512 + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -1193,6 +1262,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HVAC_SEAT_VENTILATION = 0x0513 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -1205,6 +1275,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HVAC_ELECTRIC_DEFROSTER_ON = 0x0514 + 0x10000000 + 0x03000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN
@@ -1245,6 +1316,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @version 2
*/
HVAC_TEMPERATURE_VALUE_SUGGESTION = 0x0515 + 0x10000000 + 0x01000000
+ 0x00610000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT_VEC
@@ -1270,6 +1342,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleUnit
+ * @version 2
*/
DISTANCE_DISPLAY_UNITS = 0x0600 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -1294,6 +1367,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleUnit
+ * @version 2
*/
FUEL_VOLUME_DISPLAY_UNITS = 0x0601 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -1319,6 +1393,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleUnit
+ * @version 2
*/
TIRE_PRESSURE_DISPLAY_UNITS = 0x0602 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -1344,6 +1419,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleUnit
+ * @version 2
*/
EV_BATTERY_DISPLAY_UNITS = 0x0603 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -1360,6 +1436,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
FUEL_CONSUMPTION_UNITS_DISTANCE_OVER_VOLUME = 0x0604 + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -1383,6 +1460,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
VEHICLE_SPEED_DISPLAY_UNITS = 0x0605 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -1427,6 +1505,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:MILLI_SECS
+ * @version 2
*/
EXTERNAL_CAR_TIME = 0x0608 + 0x10000000 // VehiclePropertyGroup:SYSTEM
+ 0x01000000 // VehicleArea:GLOBAL
@@ -1456,6 +1535,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.WRITE
* @unit VehicleUnit:MILLI_SECS
+ * @version 2
*/
ANDROID_EPOCH_TIME = 0x0606 + 0x10000000 + 0x01000000
+ 0x00500000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT64
@@ -1470,6 +1550,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @version 2
*/
STORAGE_ENCRYPTION_BINDING_SEED = 0x0607 + 0x10000000 + 0x01000000
+ 0x00700000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BYTES
@@ -1479,6 +1560,7 @@
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:CELSIUS
+ * @version 2
*/
ENV_OUTSIDE_TEMPERATURE = 0x0703 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -1497,6 +1579,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
AP_POWER_STATE_REQ = 0x0A00 + 0x10000000 + 0x01000000
+ 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
@@ -1511,6 +1594,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @version 2
*/
AP_POWER_STATE_REPORT = 0x0A01 + 0x10000000 + 0x01000000
+ 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
@@ -1525,6 +1609,7 @@
*
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
AP_POWER_BOOTUP_REASON = 0x0A02 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -1547,6 +1632,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @version 2
*/
DISPLAY_BRIGHTNESS = 0x0A03 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -1570,6 +1656,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @version 2
*/
PER_DISPLAY_BRIGHTNESS = 0x0A04 + 0x10000000 + 0x01000000
+ 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
@@ -1586,10 +1673,28 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 3
*/
VALET_MODE_ENABLED =
0x0A05 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
/**
+ * Head up display (HUD) enabled
+ *
+ * This property allows the user to turn on/off the HUD for their seat.
+ *
+ * Each HUD in the vehicle should be assigned to the seat that is intended to use it. For
+ * example, if there is a single HUD in the vehicle that is used by the driver so that they no
+ * longer need to continuously look at the instrument cluster, then this property should be
+ * defined with a single area ID equal to the driver's seat area value.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
+ * @version 3
+ */
+ HEAD_UP_DISPLAY_ENABLED =
+ 0x0A06 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN,
+ /**
* Property to feed H/W input events to android
*
* int32Values[0] : action defined by VehicleHwKeyInputAction
@@ -1603,6 +1708,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @config_flags
+ * @version 2
*/
HW_KEY_INPUT = 0x0A10 + 0x10000000 + 0x01000000
+ 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
@@ -1625,6 +1731,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @config_flags
+ * @version 2
*/
HW_KEY_INPUT_V2 =
0x0A11 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.MIXED,
@@ -1659,6 +1766,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @config_flags
+ * @version 2
*/
HW_MOTION_INPUT =
0x0A12 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.MIXED,
@@ -1682,6 +1790,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @data_enum RotaryInputType
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HW_ROTARY_INPUT = 0x0A20 + 0x10000000 + 0x01000000
+ 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
@@ -1705,6 +1814,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @data_enum CustomInputType
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HW_CUSTOM_INPUT = 0X0A30 + 0x10000000 + 0x01000000
+ 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
@@ -1749,6 +1859,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
DOOR_POS = 0x0B00 + 0x10000000 + 0x06000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:INT32
@@ -1774,6 +1885,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
DOOR_MOVE = 0x0B01 + 0x10000000 + 0x06000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:INT32
@@ -1788,6 +1900,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
DOOR_LOCK = 0x0B02 + 0x10000000 + 0x06000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:DOOR,VehiclePropertyType:BOOLEAN
@@ -1804,6 +1917,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
DOOR_CHILD_LOCK_ENABLED =
0x0B03 + VehiclePropertyGroup.SYSTEM + VehicleArea.DOOR + VehiclePropertyType.BOOLEAN,
@@ -1830,6 +1944,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
MIRROR_Z_POS = 0x0B40 + 0x10000000 + 0x04000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32
@@ -1856,6 +1971,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
MIRROR_Z_MOVE = 0x0B41 + 0x10000000 + 0x04000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32
@@ -1882,6 +1998,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
MIRROR_Y_POS = 0x0B42 + 0x10000000 + 0x04000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32
@@ -1907,6 +2024,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
MIRROR_Y_MOVE = 0x0B43 + 0x10000000 + 0x04000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:MIRROR,VehiclePropertyType:INT32
@@ -1921,6 +2039,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
MIRROR_LOCK = 0x0B44 + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -1935,6 +2054,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
MIRROR_FOLD = 0x0B45 + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -1952,6 +2072,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
MIRROR_AUTO_FOLD_ENABLED =
@@ -1970,6 +2091,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
MIRROR_AUTO_TILT_ENABLED =
@@ -1989,6 +2111,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.WRITE
+ * @version 2
*/
SEAT_MEMORY_SELECT = 0x0B80 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2002,6 +2125,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.WRITE
+ * @version 2
*/
SEAT_MEMORY_SET = 0x0B81 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2019,6 +2143,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_BELT_BUCKLED = 0x0B82 + 0x10000000 + 0x05000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:BOOLEAN
@@ -2044,6 +2169,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_BELT_HEIGHT_POS = 0x0B83 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2072,6 +2198,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_BELT_HEIGHT_MOVE = 0x0B84 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2097,6 +2224,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_FORE_AFT_POS = 0x0B85 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2124,6 +2252,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_FORE_AFT_MOVE = 0x0B86 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2151,6 +2280,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_BACKREST_ANGLE_1_POS = 0x0B87 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2178,6 +2308,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_BACKREST_ANGLE_1_MOVE = 0x0B88 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2207,6 +2338,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_BACKREST_ANGLE_2_POS = 0x0B89 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2234,6 +2366,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_BACKREST_ANGLE_2_MOVE = 0x0B8A + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2257,6 +2390,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_HEIGHT_POS = 0x0B8B + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2282,6 +2416,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_HEIGHT_MOVE = 0x0B8C + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2310,6 +2445,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_DEPTH_POS = 0x0B8D + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2336,6 +2472,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_DEPTH_MOVE = 0x0B8E + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2363,6 +2500,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_TILT_POS = 0x0B8F + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2390,6 +2528,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_TILT_MOVE = 0x0B90 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2415,6 +2554,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_LUMBAR_FORE_AFT_POS = 0x0B91 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2443,6 +2583,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_LUMBAR_FORE_AFT_MOVE = 0x0B92 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2468,6 +2609,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_LUMBAR_SIDE_SUPPORT_POS = 0x0B93 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2496,6 +2638,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_LUMBAR_SIDE_SUPPORT_MOVE = 0x0B94 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2516,6 +2659,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_HEADREST_HEIGHT_POS = 0x0B95 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -2543,6 +2687,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_HEADREST_HEIGHT_POS_V2 =
0x0BA4 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
@@ -2572,6 +2717,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_HEADREST_HEIGHT_MOVE = 0x0B96 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2595,6 +2741,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_HEADREST_ANGLE_POS = 0x0B97 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2623,6 +2770,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_HEADREST_ANGLE_MOVE = 0x0B98 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2646,6 +2794,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_HEADREST_FORE_AFT_POS = 0x0B99 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2674,6 +2823,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_HEADREST_FORE_AFT_MOVE = 0x0B9A + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2695,6 +2845,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightState
+ * @version 2
*/
SEAT_FOOTWELL_LIGHTS_STATE =
0x0B9B + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
@@ -2720,6 +2871,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
+ * @version 2
*/
SEAT_FOOTWELL_LIGHTS_SWITCH =
0x0B9C + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
@@ -2736,6 +2888,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_EASY_ACCESS_ENABLED =
0x0B9D + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN,
@@ -2756,6 +2909,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 3
*/
SEAT_AIRBAG_ENABLED =
0x0B9E + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN,
@@ -2778,6 +2932,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleAirbagLocation
+ * @version 2
*/
SEAT_AIRBAGS_DEPLOYED =
0x0BA5 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
@@ -2803,6 +2958,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_CUSHION_SIDE_SUPPORT_POS =
0x0B9F + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
@@ -2831,6 +2987,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_CUSHION_SIDE_SUPPORT_MOVE =
0x0BA0 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
@@ -2854,6 +3011,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_LUMBAR_VERTICAL_POS =
0x0BA1 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
@@ -2880,6 +3038,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_LUMBAR_VERTICAL_MOVE =
0x0BA2 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
@@ -2906,6 +3065,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SEAT_WALK_IN_POS =
0x0BA3 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
@@ -2924,6 +3084,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 3
*/
SEAT_BELT_PRETENSIONER_DEPLOYED =
0x0BA6 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN,
@@ -2936,6 +3097,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleSeatOccupancyState
+ * @version 2
*/
SEAT_OCCUPANCY = 0x0BB0 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -2972,6 +3134,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
WINDOW_POS = 0x0BC0 + 0x10000000 + 0x03000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32
@@ -3014,6 +3177,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
WINDOW_MOVE = 0x0BC1 + 0x10000000 + 0x03000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:INT32
@@ -3028,6 +3192,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
WINDOW_LOCK = 0x0BC4 + 0x10000000 + 0x03000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:WINDOW,VehiclePropertyType:BOOLEAN
@@ -3048,6 +3213,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:MILLI_SECS
+ * @version 2
*/
WINDSHIELD_WIPERS_PERIOD =
0x0BC5 + VehiclePropertyGroup.SYSTEM + VehicleArea.WINDOW + VehiclePropertyType.INT32,
@@ -3069,6 +3235,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum WindshieldWipersState
+ * @version 2
*/
WINDSHIELD_WIPERS_STATE =
0x0BC6 + VehiclePropertyGroup.SYSTEM + VehicleArea.WINDOW + VehiclePropertyType.INT32,
@@ -3095,6 +3262,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum WindshieldWipersSwitch
+ * @version 2
*/
WINDSHIELD_WIPERS_SWITCH =
0x0BC7 + VehiclePropertyGroup.SYSTEM + VehicleArea.WINDOW + VehiclePropertyType.INT32,
@@ -3121,6 +3289,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
STEERING_WHEEL_DEPTH_POS =
0x0BE0 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -3147,6 +3316,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
STEERING_WHEEL_DEPTH_MOVE =
0x0BE1 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -3170,6 +3340,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
STEERING_WHEEL_HEIGHT_POS =
0x0BE2 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -3196,6 +3367,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
STEERING_WHEEL_HEIGHT_MOVE =
0x0BE3 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -3211,6 +3383,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
STEERING_WHEEL_THEFT_LOCK_ENABLED =
0x0BE4 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -3225,6 +3398,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
STEERING_WHEEL_LOCKED =
0x0BE5 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -3240,6 +3414,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
STEERING_WHEEL_EASY_ACCESS_ENABLED =
0x0BE6 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -3267,6 +3442,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
GLOVE_BOX_DOOR_POS =
0x0BF0 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.INT32,
@@ -3286,6 +3462,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
GLOVE_BOX_LOCKED =
0x0BF1 + VehiclePropertyGroup.SYSTEM + VehicleArea.SEAT + VehiclePropertyType.BOOLEAN,
@@ -3305,6 +3482,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @version 2
*/
VEHICLE_MAP_SERVICE = 0x0C00 + 0x10000000 + 0x01000000
+ 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED
@@ -3324,6 +3502,7 @@
*
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
LOCATION_CHARACTERIZATION =
0x0C10 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -3347,6 +3526,7 @@
*
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
+ * @version 3
*/
ULTRASONICS_SENSOR_POSITION = 0x0C20 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR
+ VehiclePropertyType.INT32_VEC,
@@ -3378,9 +3558,10 @@
*
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
+ * @version 3
*/
ULTRASONICS_SENSOR_ORIENTATION = 0x0C21 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR
- + VehiclePropertyType.INT32_VEC,
+ + VehiclePropertyType.FLOAT_VEC,
/**
* Static data for the field of view of each ultrasonic sensor in degrees.
@@ -3401,6 +3582,7 @@
*
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
+ * @version 3
*/
ULTRASONICS_SENSOR_FIELD_OF_VIEW = 0x0C22 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR
+ VehiclePropertyType.INT32_VEC,
@@ -3422,6 +3604,7 @@
*
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
+ * @version 3
*/
ULTRASONICS_SENSOR_DETECTION_RANGE = 0x0C23 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR
+ VehiclePropertyType.INT32_VEC,
@@ -3468,11 +3651,39 @@
*
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
+ * @version 3
*/
ULTRASONICS_SENSOR_SUPPORTED_RANGES = 0x0C24 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR
+ VehiclePropertyType.INT32_VEC,
/**
+ * The distance reading of the nearest detected object per sensor in millimeters.
+ *
+ * Each individual sensor is identified by its VehicleAreaConfig#areaId and returns the sensor's
+ * measured distance formatted as [distance, distance_error] where:
+ *
+ * int32Values[0] = distance, the measured distance of the nearest object in millimeters.
+ * If only a range is supported, this value must be set to the minimum
+ * supported distance in the detected range as specified in
+ * ULTRASONICS_SENSOR_SUPPORTED_RANGES.
+ * int32Values[1] = distance_error, the error of the measured distance value in
+ * millimeters.
+ *
+ * If no object is detected, an empty vector must be returned. If distance_error is not
+ * available then an array of only the measured distance must be returned.
+ *
+ * If the data is aggregated by another ECU, then OEMs have the option of reporting the same
+ * reading across all included sensors or reporting a virtual representation of all the included
+ * sensors as if they were one sensor.
+ *
+ * @change_mode VehiclePropertyChangeMode.CONTINUOUS
+ * @access VehiclePropertyAccess.READ
+ * @version 3
+ */
+ ULTRASONICS_SENSOR_MEASURED_DISTANCE = 0x0C25 + VehiclePropertyGroup.SYSTEM + VehicleArea.VENDOR
+ + VehiclePropertyType.INT32_VEC,
+
+ /**
* OBD2 Live Sensor Data
*
* Reports a snapshot of the current (live) values of the OBD2 sensors available.
@@ -3512,6 +3723,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
OBD2_LIVE_FRAME = 0x0D00 + 0x10000000 + 0x01000000
+ 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED
@@ -3538,6 +3750,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
OBD2_FREEZE_FRAME = 0x0D01 + 0x10000000 + 0x01000000
+ 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED
@@ -3555,6 +3768,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
OBD2_FREEZE_FRAME_INFO = 0x0D02 + 0x10000000 + 0x01000000
+ 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED
@@ -3577,6 +3791,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.WRITE
+ * @version 2
*/
OBD2_FREEZE_FRAME_CLEAR = 0x0D03 + 0x10000000 + 0x01000000
+ 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED
@@ -3588,6 +3803,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightState
+ * @version 2
*/
HEADLIGHTS_STATE = 0x0E00 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -3599,6 +3815,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightState
+ * @version 2
*/
HIGH_BEAM_LIGHTS_STATE = 0x0E01 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -3626,6 +3843,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightState
+ * @version 2
*/
FOG_LIGHTS_STATE = 0x0E02 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -3637,6 +3855,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightState
+ * @version 2
*/
HAZARD_LIGHTS_STATE = 0x0E03 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -3652,6 +3871,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
+ * @version 2
*/
HEADLIGHTS_SWITCH = 0x0E10 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -3667,6 +3887,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
+ * @version 2
*/
HIGH_BEAM_LIGHTS_SWITCH = 0x0E11 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -3698,6 +3919,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
+ * @version 2
*/
FOG_LIGHTS_SWITCH = 0x0E12 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -3713,6 +3935,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
+ * @version 2
*/
HAZARD_LIGHTS_SWITCH = 0x0E13 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -3724,6 +3947,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightState
+ * @version 2
*/
CABIN_LIGHTS_STATE = 0x0F01 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -3742,6 +3966,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
+ * @version 2
*/
CABIN_LIGHTS_SWITCH = 0x0F02 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -3753,6 +3978,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightState
+ * @version 2
*/
READING_LIGHTS_STATE = 0x0F03 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -3771,6 +3997,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
+ * @version 2
*/
READING_LIGHTS_SWITCH = 0x0F04 + 0x10000000 + 0x05000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:SEAT,VehiclePropertyType:INT32
@@ -3792,6 +4019,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightState
+ * @version 2
*/
STEERING_WHEEL_LIGHTS_STATE =
0x0F0C + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -3817,6 +4045,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
+ * @version 2
*/
STEERING_WHEEL_LIGHTS_SWITCH =
0x0F0D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -3845,6 +4074,7 @@
*
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SUPPORT_CUSTOMIZE_VENDOR_PERMISSION = 0x0F05 + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -3861,6 +4091,7 @@
* ex) "com.android.car.user.CarUserNoticeService,storage_monitoring"
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
DISABLED_OPTIONAL_FEATURES = 0x0F06 + 0x10000000 + 0x01000000
+ 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING
@@ -3911,6 +4142,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @version 2
*/
INITIAL_USER_INFO = 0x0F07 + 0x10000000 + 0x01000000
+ 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED
@@ -4077,6 +4309,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @version 2
*/
SWITCH_USER = 0x0F08 + 0x10000000 + 0x01000000
+ 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED
@@ -4123,6 +4356,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @version 2
*/
CREATE_USER = 0x0F09 + 0x10000000 + 0x01000000
+ 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED
@@ -4154,6 +4388,7 @@
*
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.WRITE
+ * @version 2
*/
REMOVE_USER = 0x0F0A + 0x10000000 + 0x01000000
+ 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED
@@ -4229,6 +4464,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @version 2
*/
USER_IDENTIFICATION_ASSOCIATION = 0x0F0B + 0x10000000 + 0x01000000
+ 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED
@@ -4248,6 +4484,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
EVS_SERVICE_REQUEST = 0x0F10 + 0x10000000 + 0x01000000
+ 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
@@ -4265,6 +4502,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
POWER_POLICY_REQ = 0x0F21 + 0x10000000 + 0x01000000
+ 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING
@@ -4284,6 +4522,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
POWER_POLICY_GROUP_REQ = 0x0F22 + 0x10000000 + 0x01000000
+ 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING
@@ -4296,6 +4535,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
+ * @version 2
*/
CURRENT_POWER_POLICY = 0x0F23 + 0x10000000 + 0x01000000
+ 0x00100000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:STRING
@@ -4307,6 +4547,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.WRITE
+ * @version 2
*/
WATCHDOG_ALIVE = 0xF31 + 0x10000000 + 0x01000000
+ 0x00500000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT64
@@ -4318,6 +4559,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.WRITE
+ * @version 2
*/
WATCHDOG_TERMINATED_PROCESS = 0x0F32 + 0x10000000 + 0x01000000
+ 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED
@@ -4333,6 +4575,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
VHAL_HEARTBEAT = 0x0F33 + 0x10000000 + 0x01000000
+ 0x00500000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT64
@@ -4346,6 +4589,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
CLUSTER_SWITCH_UI = 0x0F34 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -4370,6 +4614,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
CLUSTER_DISPLAY_STATE = 0x0F35 + 0x10000000 + 0x01000000
+ 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
@@ -4405,6 +4650,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.WRITE
+ * @version 2
*/
CLUSTER_REPORT_STATE = 0x0F36 + 0x10000000 + 0x01000000
+ 0x00e00000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:MIXED
@@ -4419,6 +4665,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.WRITE
+ * @version 2
*/
CLUSTER_REQUEST_DISPLAY = 0x0F37 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -4429,6 +4676,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.WRITE
+ * @version 2
*/
CLUSTER_NAVIGATION_STATE = 0x0F38 + 0x10000000 + 0x01000000
+ 0x00700000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BYTES
@@ -4442,6 +4690,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum ElectronicTollCollectionCardType
+ * @version 2
*/
ELECTRONIC_TOLL_COLLECTION_CARD_TYPE = 0x0F39 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -4456,6 +4705,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum ElectronicTollCollectionCardStatus
+ * @version 2
*/
ELECTRONIC_TOLL_COLLECTION_CARD_STATUS = 0x0F3A + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -4469,6 +4719,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightState
+ * @version 2
*/
FRONT_FOG_LIGHTS_STATE = 0x0F3B + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -4487,6 +4738,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
+ * @version 2
*/
FRONT_FOG_LIGHTS_SWITCH = 0x0F3C + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -4501,6 +4753,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightState
+ * @version 2
*/
REAR_FOG_LIGHTS_STATE = 0x0F3D + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -4519,6 +4772,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleLightSwitch
+ * @version 2
*/
REAR_FOG_LIGHTS_SWITCH = 0x0F3E + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -4536,6 +4790,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:AMPERE
+ * @version 2
*/
EV_CHARGE_CURRENT_DRAW_LIMIT = 0x0F3F + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -4557,6 +4812,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
EV_CHARGE_PERCENT_LIMIT = 0x0F40 + 0x10000000 + 0x01000000
+ 0x00600000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:FLOAT
@@ -4569,6 +4825,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum EvChargeState
+ * @version 2
*/
EV_CHARGE_STATE = 0x0F41 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -4585,6 +4842,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
EV_CHARGE_SWITCH = 0x0F42 + 0x10000000 + 0x01000000
+ 0x00200000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:BOOLEAN
@@ -4597,6 +4855,7 @@
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:SECS
+ * @version 2
*/
EV_CHARGE_TIME_REMAINING = 0x0F43 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -4610,6 +4869,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum EvRegenerativeBrakingState
+ * @version 2
*/
EV_REGENERATIVE_BRAKING_STATE = 0x0F44 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -4622,6 +4882,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum TrailerState
+ * @version 2
*/
TRAILER_PRESENT = 0x0F45 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -4645,6 +4906,7 @@
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:KILOGRAM
+ * @version 2
*/
VEHICLE_CURB_WEIGHT = 0x0F46 + 0x10000000 + 0x01000000
@@ -4659,6 +4921,7 @@
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
* @data_enum GsrComplianceRequirementType
+ * @version 2
*/
GENERAL_SAFETY_REGULATION_COMPLIANCE_REQUIREMENT = 0x0F47 + 0x10000000 + 0x01000000
+ 0x00400000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32
@@ -4683,6 +4946,7 @@
*
* @change_mode VehiclePropertyChangeMode.STATIC
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
SUPPORTED_PROPERTY_IDS = 0x0F48 + 0x10000000 + 0x01000000
+ 0x00410000, // VehiclePropertyGroup:SYSTEM,VehicleArea:GLOBAL,VehiclePropertyType:INT32_VEC
@@ -4690,12 +4954,22 @@
/**
* Request the head unit to be shutdown.
*
+ * <p>This is required for executing a task when the head unit is powered off (remote task
+ * feature). After the head unit is powered-on to execute the task, the head unit should
+ * be shutdown. The head unit will send this message once the task is finished.
+ *
+ * <p>This is not for the case when a user wants to shutdown the head unit.
+ *
* <p>This usually involves telling a separate system outside the head unit (e.g. a power
* controller) to prepare shutting down the head unit.
*
- * <p>This does not mean the head unit will shutdown immediately.
+ * <p>Note that the external system must validate whether this request is valid by checking
+ * whether the vehicle is currently in use. If a user enters the vehicle after a
+ * SHUTDOWN_REQUEST is sent, then the system must ignore this request. It
+ * is recommended to store a VehicleInUse property in the power controller and exposes it
+ * through VEHICLE_IN_USE property. A shutdown request must be ignored if VehicleInUse is true.
*
- * <p>This means that another system will start sending a shutdown signal to the head unit,
+ * <p>If allowed, the external system will start sending a shutdown signal to the head unit,
* which will cause VHAL to send SHUTDOWN_PREPARE message to Android. Android will then start
* the shut down process by handling the message.
*
@@ -4720,6 +4994,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.WRITE
* @data_enum VehicleApPowerStateShutdownParam
+ * @version 2
*/
SHUTDOWN_REQUEST =
0x0F49 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -4752,6 +5027,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
VEHICLE_IN_USE =
0x0F4A + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -4766,6 +5042,7 @@
*
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.WRITE
+ * @version 3
*/
CLUSTER_HEARTBEAT =
0x0F4B + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.MIXED,
@@ -4785,6 +5062,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @data_enum VehicleAutonomousState
+ * @version 3
*/
VEHICLE_DRIVING_AUTOMATION_CURRENT_LEVEL =
0x0F4C + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -4799,7 +5077,9 @@
* Enable or disable Automatic Emergency Braking (AEB).
*
* Set true to enable AEB and false to disable AEB. When AEB is enabled, the ADAS system in the
- * vehicle should be turned on and monitoring to avoid potential collisions.
+ * vehicle should be turned on and monitoring to avoid potential collisions. This property
+ * should apply for higher speed applications only. For enabling low speed automatic emergency
+ * braking, LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_ENABLED should be used.
*
* In general, AUTOMATIC_EMERGENCY_BRAKING_ENABLED should always return true or false. If the
* feature is not available due to some temporary state, such as the vehicle speed being too
@@ -4812,6 +5092,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
AUTOMATIC_EMERGENCY_BRAKING_ENABLED =
0x1000 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -4821,7 +5102,9 @@
*
* Returns the current state of AEB. This property must always return a valid state defined in
* AutomaticEmergencyBrakingState or ErrorState. It must not surface errors through StatusCode
- * and must use the supported error states instead.
+ * and must use the supported error states instead. This property should apply for higher speed
+ * applications only. For representing the state of the low speed automatic emergency braking
+ * system, LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE should be used.
*
* If AEB includes forward collision warnings before activating the brakes, those warnings must
* be surfaced through the Forward Collision Warning (FCW) properties.
@@ -4834,6 +5117,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum AutomaticEmergencyBrakingState
* @data_enum ErrorState
+ * @version 2
*/
AUTOMATIC_EMERGENCY_BRAKING_STATE =
0x1001 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -4855,6 +5139,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
FORWARD_COLLISION_WARNING_ENABLED =
0x1002 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -4874,6 +5159,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum ForwardCollisionWarningState
* @data_enum ErrorState
+ * @version 2
*/
FORWARD_COLLISION_WARNING_STATE =
0x1003 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -4895,6 +5181,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
BLIND_SPOT_WARNING_ENABLED =
0x1004 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -4914,6 +5201,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum BlindSpotWarningState
* @data_enum ErrorState
+ * @version 2
*/
BLIND_SPOT_WARNING_STATE =
0x1005 + VehiclePropertyGroup.SYSTEM + VehicleArea.MIRROR + VehiclePropertyType.INT32,
@@ -4936,6 +5224,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
LANE_DEPARTURE_WARNING_ENABLED =
0x1006 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -4955,6 +5244,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum LaneDepartureWarningState
* @data_enum ErrorState
+ * @version 2
*/
LANE_DEPARTURE_WARNING_STATE =
0x1007 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -4981,6 +5271,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
LANE_KEEP_ASSIST_ENABLED =
0x1008 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -5003,6 +5294,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum LaneKeepAssistState
* @data_enum ErrorState
+ * @version 2
*/
LANE_KEEP_ASSIST_STATE =
0x1009 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -5030,6 +5322,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
LANE_CENTERING_ASSIST_ENABLED =
0x100A + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -5060,6 +5353,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.WRITE
* @data_enum LaneCenteringAssistCommand
+ * @version 2
*/
LANE_CENTERING_ASSIST_COMMAND =
0x100B + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -5082,6 +5376,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum LaneCenteringAssistState
* @data_enum ErrorState
+ * @version 2
*/
LANE_CENTERING_ASSIST_STATE =
0x100C + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -5105,6 +5400,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
EMERGENCY_LANE_KEEP_ASSIST_ENABLED =
0x100D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -5125,6 +5421,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum EmergencyLaneKeepAssistState
* @data_enum ErrorState
+ * @version 2
*/
EMERGENCY_LANE_KEEP_ASSIST_STATE =
0x100E + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -5149,6 +5446,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
CRUISE_CONTROL_ENABLED =
0x100F + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -5177,6 +5475,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum CruiseControlType
* @data_enum ErrorState
+ * @version 2
*/
CRUISE_CONTROL_TYPE =
0x1010 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -5197,6 +5496,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum CruiseControlState
* @data_enum ErrorState
+ * @version 2
*/
CRUISE_CONTROL_STATE =
0x1011 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -5220,6 +5520,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.WRITE
* @data_enum CruiseControlCommand
+ * @version 2
*/
CRUISE_CONTROL_COMMAND =
0x1012 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -5243,6 +5544,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:METER_PER_SEC
+ * @version 2
*/
CRUISE_CONTROL_TARGET_SPEED =
0x1013 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.FLOAT,
@@ -5274,6 +5576,7 @@
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:MILLI_SECS
+ * @version 2
*/
ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP =
0x1014 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -5304,6 +5607,7 @@
* @change_mode VehiclePropertyChangeMode.CONTINUOUS
* @access VehiclePropertyAccess.READ
* @unit VehicleUnit:MILLIMETER
+ * @version 2
*/
ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE =
0x1015 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -5325,6 +5629,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
HANDS_ON_DETECTION_ENABLED =
0x1016 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -5349,6 +5654,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum HandsOnDetectionDriverState
* @data_enum ErrorState
+ * @version 2
*/
HANDS_ON_DETECTION_DRIVER_STATE =
0x1017 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -5371,6 +5677,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum HandsOnDetectionWarning
* @data_enum ErrorState
+ * @version 2
*/
HANDS_ON_DETECTION_WARNING =
0x1018 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -5393,6 +5700,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 3
*/
DRIVER_DROWSINESS_ATTENTION_SYSTEM_ENABLED =
0x1019 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -5419,6 +5727,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum DriverDrowsinessAttentionState
* @data_enum ErrorState
+ * @version 3
*/
DRIVER_DROWSINESS_ATTENTION_STATE =
0x101A + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -5443,6 +5752,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 3
*/
DRIVER_DROWSINESS_ATTENTION_WARNING_ENABLED =
0x101B + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -5464,6 +5774,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum DriverDrowsinessAttentionWarning
* @data_enum ErrorState
+ * @version 3
*/
DRIVER_DROWSINESS_ATTENTION_WARNING =
0x101C + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -5486,6 +5797,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 3
*/
DRIVER_DISTRACTION_SYSTEM_ENABLED =
0x101D + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -5510,6 +5822,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum DriverDistractionState
* @data_enum ErrorState
+ * @version 3
*/
DRIVER_DISTRACTION_STATE =
0x101E + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -5533,6 +5846,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 2
*/
DRIVER_DISTRACTION_WARNING_ENABLED =
0x101F + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -5554,6 +5868,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum DriverDistractionWarning
* @data_enum ErrorState
+ * @version 3
*/
DRIVER_DISTRACTION_WARNING =
0x1020 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -5579,6 +5894,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 3
*/
LOW_SPEED_COLLISION_WARNING_ENABLED =
0x1021 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -5601,6 +5917,7 @@
* @access VehiclePropertyAccess.READ
* @data_enum LowSpeedCollisionWarningState
* @data_enum ErrorState
+ * @version 3
*/
LOW_SPEED_COLLISION_WARNING_STATE =
0x1022 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
@@ -5623,6 +5940,7 @@
* @change_mode VehiclePropertyChangeMode.ON_CHANGE
* @access VehiclePropertyAccess.READ_WRITE
* @access VehiclePropertyAccess.READ
+ * @version 3
*/
CROSS_TRAFFIC_MONITORING_ENABLED =
0x1023 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
@@ -5642,10 +5960,65 @@
* @access VehiclePropertyAccess.READ
* @data_enum CrossTrafficMonitoringWarningState
* @data_enum ErrorState
+ * @version 3
*/
CROSS_TRAFFIC_MONITORING_WARNING_STATE =
0x1024 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
+ /**
+ * Enable or disable Low Speed Automatic Emergency Braking.
+ *
+ * Set true to enable Low Speed Automatic Emergency Braking or false to disable Low Speed
+ * Automatic Emergency Braking. When Low Speed Automatic Emergency Braking is enabled, the ADAS
+ * system in the vehicle should be turned on and monitoring to avoid potential collisions in low
+ * speed conditions. This property is different from the pre-existing
+ * AUTOMATIC_EMERGENCY_BRAKING_ENABLED, which should apply to higher speed applications only. If
+ * the vehicle doesn't have a separate collision avoidance system for low speed environments,
+ * this property should not be implemented.
+ *
+ * In general, LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_ENABLED should always return true or false.
+ * If the feature is not available due to some temporary state, such as the vehicle speed being
+ * too low, that information must be conveyed through the ErrorState values in the
+ * LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE property.
+ *
+ * This property is defined as VehiclePropertyAccess.READ_WRITE, but OEMs have the option to
+ * implement it as VehiclePropertyAccess.READ only.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ_WRITE
+ * @access VehiclePropertyAccess.READ
+ * @version 3
+ */
+ LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_ENABLED =
+ 0x1025 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.BOOLEAN,
+
+ /**
+ * Low Speed Automatic Emergency Braking state.
+ *
+ * Returns the current state of Low Speed Automatic Emergency Braking. This property must always
+ * return a valid state defined in LowSpeedAutomaticEmergencyBrakingState or ErrorState. It must
+ * not surface errors through StatusCode and must use the supported error states instead. This
+ * property is different from the pre-existing AUTOMATIC_EMERGENCY_BRAKING_STATE, which should
+ * apply to higher speed applications only. If the vehicle doesn't have a separate collision
+ * avoidance system for low speed environments, this property should not be implemented.
+ *
+ * If Low Speed Automatic Emergency Braking includes collision warnings before activating the
+ * brakes, those warnings must be surfaced through use of LOW_SPEED_COLLISION_WARNING_ENABLED
+ * and LOW_SPEED_COLLISION_WARNING_STATE.
+ *
+ * For the global area ID (0), the VehicleAreaConfig#supportedEnumValues array must be defined
+ * unless all states of both LowSpeedAutomaticEmergencyBrakingState (including OTHER, which is
+ * not recommended) and ErrorState are supported.
+ *
+ * @change_mode VehiclePropertyChangeMode.ON_CHANGE
+ * @access VehiclePropertyAccess.READ
+ * @data_enum LowSpeedAutomaticEmergencyBrakingState
+ * @data_enum ErrorState
+ * @version 3
+ */
+ LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE =
+ 0x1026 + VehiclePropertyGroup.SYSTEM + VehicleArea.GLOBAL + VehiclePropertyType.INT32,
+
/***************************************************************************
* End of ADAS Properties
**************************************************************************/
diff --git a/automotive/vehicle/tools/generate_annotation_enums.py b/automotive/vehicle/tools/generate_annotation_enums.py
index 05fc99a..93d408e 100755
--- a/automotive/vehicle/tools/generate_annotation_enums.py
+++ b/automotive/vehicle/tools/generate_annotation_enums.py
@@ -42,6 +42,8 @@
'AccessForVehicleProperty.java')
ENUM_JAVA_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/java/' +
'EnumForVehicleProperty.java')
+VERSION_CPP_FILE_PATH = ('hardware/interfaces/automotive/vehicle/aidl/generated_lib/cpp/' +
+ 'VersionForVehicleProperty.h')
SCRIPT_PATH = 'hardware/interfaces/automotive/vehicle/tools/generate_annotation_enums.py'
TAB = ' '
@@ -50,6 +52,7 @@
RE_COMMENT_BEGIN = re.compile('\s*\/\*\*?')
RE_COMMENT_END = re.compile('\s*\*\/')
RE_CHANGE_MODE = re.compile('\s*\* @change_mode (\S+)\s*')
+RE_VERSION = re.compile('\s*\* @version (\S+)\s*')
RE_ACCESS = re.compile('\s*\* @access (\S+)\s*')
RE_DATA_ENUM = re.compile('\s*\* @data_enum (\S+)\s*')
RE_UNIT = re.compile('\s*\* @unit (\S+)\s+')
@@ -81,8 +84,7 @@
"""
-CHANGE_MODE_CPP_HEADER = """#ifndef android_hardware_automotive_vehicle_aidl_generated_lib_ChangeModeForVehicleProperty_H_
-#define android_hardware_automotive_vehicle_aidl_generated_lib_ChangeModeForVehicleProperty_H_
+CHANGE_MODE_CPP_HEADER = """#pragma once
#include <aidl/android/hardware/automotive/vehicle/VehicleProperty.h>
#include <aidl/android/hardware/automotive/vehicle/VehiclePropertyChangeMode.h>
@@ -98,7 +100,7 @@
std::unordered_map<VehicleProperty, VehiclePropertyChangeMode> ChangeModeForVehicleProperty = {
"""
-CHANGE_MODE_CPP_FOOTER = """
+CPP_FOOTER = """
};
} // namespace vehicle
@@ -106,12 +108,9 @@
} // namespace hardware
} // namespace android
} // aidl
-
-#endif // android_hardware_automotive_vehicle_aidl_generated_lib_ChangeModeForVehicleProperty_H_
"""
-ACCESS_CPP_HEADER = """#ifndef android_hardware_automotive_vehicle_aidl_generated_lib_AccessForVehicleProperty_H_
-#define android_hardware_automotive_vehicle_aidl_generated_lib_AccessForVehicleProperty_H_
+ACCESS_CPP_HEADER = """#pragma once
#include <aidl/android/hardware/automotive/vehicle/VehicleProperty.h>
#include <aidl/android/hardware/automotive/vehicle/VehiclePropertyAccess.h>
@@ -127,16 +126,19 @@
std::unordered_map<VehicleProperty, VehiclePropertyAccess> AccessForVehicleProperty = {
"""
-ACCESS_CPP_FOOTER = """
-};
+VERSION_CPP_HEADER = """#pragma once
-} // namespace vehicle
-} // namespace automotive
-} // namespace hardware
-} // namespace android
-} // aidl
+#include <aidl/android/hardware/automotive/vehicle/VehicleProperty.h>
-#endif // android_hardware_automotive_vehicle_aidl_generated_lib_AccessForVehicleProperty_H_
+#include <unordered_map>
+
+namespace aidl {
+namespace android {
+namespace hardware {
+namespace automotive {
+namespace vehicle {
+
+std::unordered_map<VehicleProperty, int32_t> VersionForVehicleProperty = {
"""
CHANGE_MODE_JAVA_HEADER = """package android.hardware.automotive.vehicle;
@@ -148,7 +150,7 @@
public static final Map<Integer, Integer> values = Map.ofEntries(
"""
-CHANGE_MODE_JAVA_FOOTER = """
+JAVA_FOOTER = """
);
}
@@ -163,12 +165,6 @@
public static final Map<Integer, Integer> values = Map.ofEntries(
"""
-ACCESS_JAVA_FOOTER = """
- );
-
-}
-"""
-
ENUM_JAVA_HEADER = """package android.hardware.automotive.vehicle;
import java.util.List;
@@ -179,12 +175,6 @@
public static final Map<Integer, List<Class<?>>> values = Map.ofEntries(
"""
-ENUM_JAVA_FOOTER = """
- );
-
-}
-"""
-
class PropertyConfig:
"""Represents one VHAL property definition in VehicleProperty.aidl."""
@@ -192,10 +182,12 @@
def __init__(self):
self.name = None
self.description = None
+ self.comment = None
self.change_mode = None
self.access_modes = []
self.enum_types = []
self.unit_type = None
+ self.version = None
def __repr__(self):
return self.__str__()
@@ -203,8 +195,9 @@
def __str__(self):
return ('PropertyConfig{{' +
'name: {}, description: {}, change_mode: {}, access_modes: {}, enum_types: {}' +
- ', unit_type: {}}}').format(self.name, self.description, self.change_mode,
- self.access_modes, self.enum_types, self.unit_type)
+ ', unit_type: {}, version: {}, comment: {}}}').format(self.name, self.description,
+ self.change_mode, self.access_modes, self.enum_types, self.unit_type,
+ self.version, self.comment)
class FileParser:
@@ -230,34 +223,59 @@
in_comment = True
config = PropertyConfig()
description = ''
+ continue
+
if RE_COMMENT_END.match(line):
in_comment = False
if in_comment:
- if not config.description:
- sline = line.strip()
- # Skip the first line of comment
- if sline.startswith('*'):
- # Remove the '*'.
- sline = sline[1:].strip()
- # We reach an empty line of comment, the description part is ending.
- if sline == '':
- config.description = description
- else:
- if description != '':
- description += ' '
- description += sline
match = RE_CHANGE_MODE.match(line)
if match:
config.change_mode = match.group(1).replace('VehiclePropertyChangeMode.', '')
+ continue
match = RE_ACCESS.match(line)
if match:
config.access_modes.append(match.group(1).replace('VehiclePropertyAccess.', ''))
+ continue
match = RE_UNIT.match(line)
if match:
config.unit_type = match.group(1)
+ continue
match = RE_DATA_ENUM.match(line)
if match:
config.enum_types.append(match.group(1))
+ continue
+ match = RE_VERSION.match(line)
+ if match:
+ if config.version != None:
+ raise Exception('Duplicate version annotation for property: ' + prop_name)
+ config.version = match.group(1)
+ continue
+
+ sline = line.strip()
+ if sline.startswith('*'):
+ # Remove the '*'.
+ sline = sline[1:].strip()
+
+ if not config.description:
+ # We reach an empty line of comment, the description part is ending.
+ if sline == '':
+ config.description = description
+ else:
+ if description != '':
+ description += ' '
+ description += sline
+ else:
+ if not config.comment:
+ if sline != '':
+ # This is the first line for comment.
+ config.comment = sline
+ else:
+ if sline != '':
+ # Concat this line with the previous line's comment with a space.
+ config.comment += ' ' + sline
+ else:
+ # Treat empty line comment as a new line.
+ config.comment += '\n'
else:
match = RE_VALUE.match(line)
if match:
@@ -270,6 +288,9 @@
if not config.access_modes:
raise Exception(
'No access_mode annotation for property: ' + prop_name)
+ if not config.version:
+ raise Exception(
+ 'no version annotation for property: ' + prop_name)
config.name = prop_name
configs.append(config)
@@ -295,6 +316,9 @@
continue;
if not cpp:
annotation = "List.of(" + ', '.join([class_name + ".class" for class_name in config.enum_types]) + ")"
+ elif field == 'version':
+ if cpp:
+ annotation = config.version
else:
raise Exception('Unknown field: ' + field)
if counter != 0:
@@ -317,7 +341,7 @@
f.write(content)
def outputAsCsv(self, output):
- content = 'name,description,change mode,access mode,enum type,unit type\n'
+ content = 'name,description,change mode,access mode,enum type,unit type,comment\n'
for config in self.configs:
enum_types = None
if not config.enum_types:
@@ -328,14 +352,18 @@
if not unit_type:
unit_type = '/'
access_modes = ''
- content += '"{}","{}","{}","{}","{}","{}"\n'.format(
+ comment = config.comment
+ if not comment:
+ comment = ''
+ content += '"{}","{}","{}","{}","{}","{}", "{}"\n'.format(
config.name,
# Need to escape quote as double quote.
config.description.replace('"', '""'),
config.change_mode,
'/'.join(config.access_modes),
enum_types,
- unit_type)
+ unit_type,
+ comment.replace('"', '""'))
with open(output, 'w+') as f:
f.write(content)
@@ -347,6 +375,69 @@
return f.name
+class GeneratedFile:
+
+ def __init__(self, type):
+ self.type = type
+ self.cpp_file_path = None
+ self.java_file_path = None
+ self.cpp_header = None
+ self.java_header = None
+ self.cpp_footer = None
+ self.java_footer = None
+ self.cpp_output_file = None
+ self.java_output_file = None
+
+ def setCppFilePath(self, cpp_file_path):
+ self.cpp_file_path = cpp_file_path
+
+ def setJavaFilePath(self, java_file_path):
+ self.java_file_path = java_file_path
+
+ def setCppHeader(self, cpp_header):
+ self.cpp_header = cpp_header
+
+ def setCppFooter(self, cpp_footer):
+ self.cpp_footer = cpp_footer
+
+ def setJavaHeader(self, java_header):
+ self.java_header = java_header
+
+ def setJavaFooter(self, java_footer):
+ self.java_footer = java_footer
+
+ def convert(self, file_parser, check_only, temp_files):
+ if self.cpp_file_path:
+ output_file = GeneratedFile._getOutputFile(self.cpp_file_path, check_only, temp_files)
+ file_parser.convert(output_file, self.cpp_header, self.cpp_footer, True, self.type)
+ self.cpp_output_file = output_file
+
+ if self.java_file_path:
+ output_file = GeneratedFile._getOutputFile(self.java_file_path, check_only, temp_files)
+ file_parser.convert(output_file, self.java_header, self.java_footer, False, self.type)
+ self.java_output_file = output_file
+
+ def cmp(self):
+ if self.cpp_file_path:
+ if not filecmp.cmp(self.cpp_output_file, self.cpp_file_path):
+ return False
+
+ if self.java_file_path:
+ if not filecmp.cmp(self.java_output_file, self.java_file_path):
+ return False
+
+ return True
+
+ @staticmethod
+ def _getOutputFile(file_path, check_only, temp_files):
+ if not check_only:
+ return file_path
+
+ temp_file = createTempFile()
+ temp_files.append(temp_file)
+ return temp_file
+
+
def main():
parser = argparse.ArgumentParser(
description='Generate Java and C++ enums based on annotations in VehicleProperty.aidl')
@@ -382,51 +473,52 @@
f.outputAsCsv(args.output_csv)
return
- change_mode_cpp_file = os.path.join(android_top, CHANGE_MODE_CPP_FILE_PATH);
- access_cpp_file = os.path.join(android_top, ACCESS_CPP_FILE_PATH);
- change_mode_java_file = os.path.join(android_top, CHANGE_MODE_JAVA_FILE_PATH);
- access_java_file = os.path.join(android_top, ACCESS_JAVA_FILE_PATH);
- enum_java_file = os.path.join(android_top, ENUM_JAVA_FILE_PATH);
+ generated_files = []
+
+ change_mode = GeneratedFile('change_mode')
+ change_mode.setCppFilePath(os.path.join(android_top, CHANGE_MODE_CPP_FILE_PATH))
+ change_mode.setJavaFilePath(os.path.join(android_top, CHANGE_MODE_JAVA_FILE_PATH))
+ change_mode.setCppHeader(CHANGE_MODE_CPP_HEADER)
+ change_mode.setCppFooter(CPP_FOOTER)
+ change_mode.setJavaHeader(CHANGE_MODE_JAVA_HEADER)
+ change_mode.setJavaFooter(JAVA_FOOTER)
+ generated_files.append(change_mode)
+
+ access_mode = GeneratedFile('access_mode')
+ access_mode.setCppFilePath(os.path.join(android_top, ACCESS_CPP_FILE_PATH))
+ access_mode.setJavaFilePath(os.path.join(android_top, ACCESS_JAVA_FILE_PATH))
+ access_mode.setCppHeader(ACCESS_CPP_HEADER)
+ access_mode.setCppFooter(CPP_FOOTER)
+ access_mode.setJavaHeader(ACCESS_JAVA_HEADER)
+ access_mode.setJavaFooter(JAVA_FOOTER)
+ generated_files.append(access_mode)
+
+ enum_types = GeneratedFile('enum_types')
+ enum_types.setJavaFilePath(os.path.join(android_top, ENUM_JAVA_FILE_PATH))
+ enum_types.setJavaHeader(ENUM_JAVA_HEADER)
+ enum_types.setJavaFooter(JAVA_FOOTER)
+ generated_files.append(enum_types)
+
+ version = GeneratedFile('version')
+ version.setCppFilePath(os.path.join(android_top, VERSION_CPP_FILE_PATH))
+ version.setCppHeader(VERSION_CPP_HEADER)
+ version.setCppFooter(CPP_FOOTER)
+ generated_files.append(version)
+
temp_files = []
- if not args.check_only:
- change_mode_cpp_output = change_mode_cpp_file
- access_cpp_output = access_cpp_file
- change_mode_java_output = change_mode_java_file
- access_java_output = access_java_file
- enum_java_output = enum_java_file
- else:
- change_mode_cpp_output = createTempFile()
- temp_files.append(change_mode_cpp_output)
- access_cpp_output = createTempFile()
- temp_files.append(access_cpp_output)
- change_mode_java_output = createTempFile()
- temp_files.append(change_mode_java_output)
- access_java_output = createTempFile()
- temp_files.append(access_java_output)
- enum_java_output = createTempFile()
- temp_files.append(enum_java_output)
-
try:
- f.convert(change_mode_cpp_output, CHANGE_MODE_CPP_HEADER, CHANGE_MODE_CPP_FOOTER,
- True, 'change_mode')
- f.convert(change_mode_java_output, CHANGE_MODE_JAVA_HEADER,
- CHANGE_MODE_JAVA_FOOTER, False, 'change_mode')
- f.convert(access_cpp_output, ACCESS_CPP_HEADER, ACCESS_CPP_FOOTER, True, 'access_mode')
- f.convert(access_java_output, ACCESS_JAVA_HEADER, ACCESS_JAVA_FOOTER, False, 'access_mode')
- f.convert(enum_java_output, ENUM_JAVA_HEADER, ENUM_JAVA_FOOTER, False, 'enum_types')
+ for generated_file in generated_files:
+ generated_file.convert(f, args.check_only, temp_files)
if not args.check_only:
return
- if ((not filecmp.cmp(change_mode_cpp_output, change_mode_cpp_file)) or
- (not filecmp.cmp(change_mode_java_output, change_mode_java_file)) or
- (not filecmp.cmp(access_cpp_output, access_cpp_file)) or
- (not filecmp.cmp(access_java_output, access_java_file)) or
- (not filecmp.cmp(enum_java_output, enum_java_file))):
- print('The generated enum files for VehicleProperty.aidl requires update, ')
- print('Run \npython ' + android_top + '/' + SCRIPT_PATH)
- sys.exit(1)
+ for generated_file in generated_files:
+ if not generated_file.cmp():
+ print('The generated enum files for VehicleProperty.aidl requires update, ')
+ print('Run \npython ' + android_top + '/' + SCRIPT_PATH)
+ sys.exit(1)
except Exception as e:
print('Error parsing VehicleProperty.aidl')
print(e)
diff --git a/automotive/vehicle/vts/Android.bp b/automotive/vehicle/vts/Android.bp
index 736787b..67d0d34 100644
--- a/automotive/vehicle/vts/Android.bp
+++ b/automotive/vehicle/vts/Android.bp
@@ -30,6 +30,7 @@
],
static_libs: [
"libgtest",
+ "libgmock",
"libvhalclient",
],
shared_libs: [
@@ -41,6 +42,9 @@
"use_libaidlvintf_gtest_helper_static",
"vhalclient_defaults",
],
+ header_libs: [
+ "IVehicleGeneratedHeaders",
+ ],
test_suites: [
"general-tests",
"vts",
diff --git a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
index 65cea26..0fd1cc6 100644
--- a/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
+++ b/automotive/vehicle/vts/src/VtsHalAutomotiveVehicle_TargetTest.cpp
@@ -19,6 +19,7 @@
#include <IVhalClient.h>
#include <VehicleHalTypes.h>
#include <VehicleUtils.h>
+#include <VersionForVehicleProperty.h>
#include <aidl/Gtest.h>
#include <aidl/Vintf.h>
#include <aidl/android/hardware/automotive/vehicle/IVehicle.h>
@@ -26,6 +27,7 @@
#include <android-base/thread_annotations.h>
#include <android/binder_process.h>
#include <android/hardware/automotive/vehicle/2.0/IVehicle.h>
+#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include <hidl/GtestPrinter.h>
#include <hidl/ServiceManagement.h>
@@ -35,12 +37,12 @@
#include <chrono>
#include <mutex>
-#include <thread>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using ::aidl::android::hardware::automotive::vehicle::IVehicle;
+using ::aidl::android::hardware::automotive::vehicle::StatusCode;
using ::aidl::android::hardware::automotive::vehicle::SubscribeOptions;
using ::aidl::android::hardware::automotive::vehicle::VehicleArea;
using ::aidl::android::hardware::automotive::vehicle::VehicleProperty;
@@ -49,6 +51,7 @@
using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyStatus;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType;
+using ::aidl::android::hardware::automotive::vehicle::VersionForVehicleProperty;
using ::android::getAidlHalInstanceNames;
using ::android::uptimeMillis;
using ::android::base::ScopedLockAssertion;
@@ -62,7 +65,10 @@
using ::android::frameworks::automotive::vhal::VhalClientResult;
using ::android::hardware::getAllHalInstanceNames;
using ::android::hardware::Sanitize;
+using ::android::hardware::automotive::vehicle::isSystemProp;
+using ::android::hardware::automotive::vehicle::propIdToString;
using ::android::hardware::automotive::vehicle::toInt;
+using ::testing::Ge;
constexpr int32_t kInvalidProp = 0x31600207;
// The timeout for retrying getting prop value after setting prop value.
@@ -123,12 +129,13 @@
class VtsHalAutomotiveVehicleTargetTest : public testing::TestWithParam<ServiceDescriptor> {
protected:
bool checkIsSupported(int32_t propertyId);
- VehiclePropertyStatus getStatus(const IHalPropValue& halPropValue);
- bool isUnavailable(const VhalClientResult<std::unique_ptr<IHalPropValue>>& result);
- bool isResultOkayWithValue(const VhalClientResult<std::unique_ptr<IHalPropValue>>& result,
- int32_t value);
+
+ static bool isUnavailable(const VhalClientResult<std::unique_ptr<IHalPropValue>>& result);
+ static bool isResultOkayWithValue(
+ const VhalClientResult<std::unique_ptr<IHalPropValue>>& result, int32_t value);
public:
+ void verifyAccessMode(int actualAccess, int expectedAccess);
void verifyProperty(VehicleProperty propId, VehiclePropertyAccess access,
VehiclePropertyChangeMode changeMode, VehiclePropertyGroup group,
VehicleArea area, VehiclePropertyType propertyType);
@@ -212,6 +219,41 @@
ASSERT_NE(result.error().message(), "") << "Expect error message not to be empty";
}
+// Test system property IDs returned by getPropConfigs() are defined in the VHAL property interface.
+TEST_P(VtsHalAutomotiveVehicleTargetTest, testPropConfigs_onlyDefinedSystemPropertyIdsReturned) {
+ if (!mVhalClient->isAidlVhal()) {
+ GTEST_SKIP() << "Skip for HIDL VHAL because HAL interface run-time version is only"
+ << "introduced for AIDL";
+ }
+
+ auto result = mVhalClient->getAllPropConfigs();
+ ASSERT_TRUE(result.ok()) << "Failed to get all property configs, error: "
+ << result.error().message();
+
+ int32_t vhalVersion = mVhalClient->getRemoteInterfaceVersion();
+ const auto& configs = result.value();
+ for (size_t i = 0; i < configs.size(); i++) {
+ int32_t propId = configs[i]->getPropId();
+ if (!isSystemProp(propId)) {
+ continue;
+ }
+
+ std::string propName = propIdToString(propId);
+ auto it = VersionForVehicleProperty.find(static_cast<VehicleProperty>(propId));
+ bool found = (it != VersionForVehicleProperty.end());
+ EXPECT_TRUE(found) << "System Property: " << propName
+ << " is not defined in VHAL property interface";
+ if (!found) {
+ continue;
+ }
+ int32_t requiredVersion = it->second;
+ EXPECT_THAT(vhalVersion, Ge(requiredVersion))
+ << "System Property: " << propName << " requires VHAL version: " << requiredVersion
+ << ", but the current VHAL version"
+ << " is " << vhalVersion << ", must not be supported";
+ }
+}
+
// Test get() return current value for properties.
TEST_P(VtsHalAutomotiveVehicleTargetTest, get) {
ALOGD("VtsHalAutomotiveVehicleTargetTest::get");
@@ -238,24 +280,10 @@
"Expect failure to get property for invalid prop: %" PRId32, kInvalidProp);
}
-VehiclePropertyStatus VtsHalAutomotiveVehicleTargetTest::getStatus(
- const IHalPropValue& halPropValue) {
- if (mVhalClient->isAidlVhal()) {
- return reinterpret_cast<
- const aidl::android::hardware::automotive::vehicle::VehiclePropValue*>(
- halPropValue.toVehiclePropValue())
- ->status;
- }
- return static_cast<VehiclePropertyStatus>(
- reinterpret_cast<const android::hardware::automotive::vehicle::V2_0::VehiclePropValue*>(
- halPropValue.toVehiclePropValue())
- ->status);
-}
-
bool VtsHalAutomotiveVehicleTargetTest::isResultOkayWithValue(
const VhalClientResult<std::unique_ptr<IHalPropValue>>& result, int32_t value) {
return result.ok() && result.value() != nullptr &&
- getStatus(*(result.value())) == VehiclePropertyStatus::AVAILABLE &&
+ result.value()->getStatus() == VehiclePropertyStatus::AVAILABLE &&
result.value()->getInt32Values().size() == 1 &&
result.value()->getInt32Values()[0] == value;
}
@@ -266,7 +294,7 @@
return result.error().code() == ErrorCode::NOT_AVAILABLE_FROM_VHAL;
}
if (result.value() != nullptr &&
- getStatus(*(result.value())) == VehiclePropertyStatus::UNAVAILABLE) {
+ result.value()->getStatus() == VehiclePropertyStatus::UNAVAILABLE) {
return true;
}
@@ -295,8 +323,13 @@
const IHalPropConfig& cfg = *cfgPtr;
int32_t propId = cfg.getPropId();
// test on boolean and writable property
- if (cfg.getAccess() == toInt(VehiclePropertyAccess::READ_WRITE) &&
- isBooleanGlobalProp(propId) && !hvacProps.count(propId)) {
+ bool isReadWrite = (cfg.getAccess() == toInt(VehiclePropertyAccess::READ_WRITE));
+ if (cfg.getAreaConfigSize() != 0 &&
+ cfg.getAreaConfigs()[0]->getAccess() != toInt(VehiclePropertyAccess::NONE)) {
+ isReadWrite = (cfg.getAreaConfigs()[0]->getAccess() ==
+ toInt(VehiclePropertyAccess::READ_WRITE));
+ }
+ if (isReadWrite && isBooleanGlobalProp(propId) && !hvacProps.count(propId)) {
auto propToGet = mVhalClient->createHalPropValue(propId);
auto getValueResult = mVhalClient->getValueSync(*propToGet);
@@ -553,6 +586,53 @@
}
}
+// Test that access mode is populated in exclusively one of the VehiclePropConfig or the
+// VehicleAreaConfigs. Either VehiclePropConfig.access must be populated, or all the
+// VehicleAreaConfig.access fields should be populated.
+TEST_P(VtsHalAutomotiveVehicleTargetTest, testAccessModeExclusivityAIDL) {
+ if (!mVhalClient->isAidlVhal()) {
+ GTEST_SKIP() << "Skip checking access mode for HIDL because the access mode field is only "
+ "present for AIDL";
+ }
+
+ auto result = mVhalClient->getAllPropConfigs();
+ ASSERT_TRUE(result.ok());
+ for (const auto& cfgPtr : result.value()) {
+ const IHalPropConfig& cfg = *cfgPtr;
+
+ bool propAccessIsSet = (cfg.getAccess() != toInt(VehiclePropertyAccess::NONE));
+ bool unsetAreaAccessExists = false;
+ bool setAreaAccessExists = false;
+
+ for (const auto& areaConfig : cfg.getAreaConfigs()) {
+ if (areaConfig->getAccess() == toInt(VehiclePropertyAccess::NONE)) {
+ unsetAreaAccessExists = true;
+ } else {
+ setAreaAccessExists = true;
+ }
+ }
+
+ ASSERT_FALSE(propAccessIsSet && setAreaAccessExists) << StringPrintf(
+ "Both prop and area config access is set for propertyId %d", cfg.getPropId());
+ ASSERT_FALSE(!propAccessIsSet && !setAreaAccessExists) << StringPrintf(
+ "Neither prop and area config access is set for propertyId %d", cfg.getPropId());
+ ASSERT_FALSE(unsetAreaAccessExists && setAreaAccessExists) << StringPrintf(
+ "Area access is only set in some configs for propertyId %d", cfg.getPropId());
+ }
+}
+
+void VtsHalAutomotiveVehicleTargetTest::verifyAccessMode(int actualAccess, int expectedAccess) {
+ if (expectedAccess == toInt(VehiclePropertyAccess::READ_WRITE)) {
+ ASSERT_TRUE(actualAccess == expectedAccess ||
+ actualAccess == toInt(VehiclePropertyAccess::READ))
+ << StringPrintf("Expect to get VehiclePropertyAccess: %i or %i, got %i",
+ expectedAccess, toInt(VehiclePropertyAccess::READ), actualAccess);
+ return;
+ }
+ ASSERT_EQ(actualAccess, expectedAccess) << StringPrintf(
+ "Expect to get VehiclePropertyAccess: %i, got %i", expectedAccess, actualAccess);
+}
+
// Helper function to compare actual vs expected property config
void VtsHalAutomotiveVehicleTargetTest::verifyProperty(VehicleProperty propId,
VehiclePropertyAccess access,
@@ -595,7 +675,6 @@
const auto& config = result.value().at(0);
int actualPropId = config->getPropId();
- int actualAccess = config->getAccess();
int actualChangeMode = config->getChangeMode();
int actualGroup = actualPropId & toInt(VehiclePropertyGroup::MASK);
int actualArea = actualPropId & toInt(VehicleArea::MASK);
@@ -604,14 +683,17 @@
ASSERT_EQ(actualPropId, expectedPropId)
<< StringPrintf("Expect to get property ID: %i, got %i", expectedPropId, actualPropId);
- if (expectedAccess == toInt(VehiclePropertyAccess::READ_WRITE)) {
- ASSERT_TRUE(actualAccess == expectedAccess ||
- actualAccess == toInt(VehiclePropertyAccess::READ))
- << StringPrintf("Expect to get VehiclePropertyAccess: %i or %i, got %i",
- expectedAccess, toInt(VehiclePropertyAccess::READ), actualAccess);
+ int globalAccess = config->getAccess();
+ if (config->getAreaConfigSize() == 0) {
+ verifyAccessMode(globalAccess, expectedAccess);
} else {
- ASSERT_EQ(actualAccess, expectedAccess) << StringPrintf(
- "Expect to get VehiclePropertyAccess: %i, got %i", expectedAccess, actualAccess);
+ for (const auto& areaConfig : config->getAreaConfigs()) {
+ int areaConfigAccess = areaConfig->getAccess();
+ int actualAccess = (areaConfigAccess != toInt(VehiclePropertyAccess::NONE))
+ ? areaConfigAccess
+ : globalAccess;
+ verifyAccessMode(actualAccess, expectedAccess);
+ }
}
ASSERT_EQ(actualChangeMode, expectedChangeMode)
@@ -641,7 +723,7 @@
TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorOrientationConfig) {
verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_ORIENTATION, VehiclePropertyAccess::READ,
VehiclePropertyChangeMode::STATIC, VehiclePropertyGroup::SYSTEM,
- VehicleArea::VENDOR, VehiclePropertyType::INT32_VEC);
+ VehicleArea::VENDOR, VehiclePropertyType::FLOAT_VEC);
}
TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorFieldOfViewConfig) {
@@ -663,6 +745,13 @@
VehiclePropertyType::INT32_VEC);
}
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyUltrasonicsSensorMeasuredDistanceConfig) {
+ verifyProperty(VehicleProperty::ULTRASONICS_SENSOR_MEASURED_DISTANCE,
+ VehiclePropertyAccess::READ, VehiclePropertyChangeMode::CONTINUOUS,
+ VehiclePropertyGroup::SYSTEM, VehicleArea::VENDOR,
+ VehiclePropertyType::INT32_VEC);
+}
+
TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyEmergencyLaneKeepAssistEnabledConfig) {
verifyProperty(VehicleProperty::EMERGENCY_LANE_KEEP_ASSIST_ENABLED,
VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
@@ -1126,6 +1215,24 @@
VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32);
}
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyHeadUpDisplayEnabledConfig) {
+ verifyProperty(VehicleProperty::HEAD_UP_DISPLAY_ENABLED, VehiclePropertyAccess::READ_WRITE,
+ VehiclePropertyChangeMode::ON_CHANGE, VehiclePropertyGroup::SYSTEM,
+ VehicleArea::SEAT, VehiclePropertyType::BOOLEAN);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLowSpeedAutomaticEmergencyBrakingEnabledConfig) {
+ verifyProperty(VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_ENABLED,
+ VehiclePropertyAccess::READ_WRITE, VehiclePropertyChangeMode::ON_CHANGE,
+ VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::BOOLEAN);
+}
+
+TEST_P(VtsHalAutomotiveVehicleTargetTest, verifyLowSpeedAutomaticEmergencyBrakingStateConfig) {
+ verifyProperty(VehicleProperty::LOW_SPEED_AUTOMATIC_EMERGENCY_BRAKING_STATE,
+ VehiclePropertyAccess::READ, VehiclePropertyChangeMode::ON_CHANGE,
+ VehiclePropertyGroup::SYSTEM, VehicleArea::GLOBAL, VehiclePropertyType::INT32);
+}
+
bool VtsHalAutomotiveVehicleTargetTest::checkIsSupported(int32_t propertyId) {
auto result = mVhalClient->getPropConfigs({propertyId});
return result.ok();
diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl
index 42c305a..8d913c8 100644
--- a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl
+++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationContext.aidl
@@ -46,4 +46,5 @@
android.hardware.biometrics.common.DisplayState displayState = android.hardware.biometrics.common.DisplayState.UNKNOWN;
@nullable android.hardware.biometrics.common.AuthenticateReason authenticateReason;
android.hardware.biometrics.common.FoldState foldState = android.hardware.biometrics.common.FoldState.UNKNOWN;
+ @nullable android.hardware.biometrics.common.OperationState operationState;
}
diff --git a/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationState.aidl b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationState.aidl
new file mode 100644
index 0000000..fca9525
--- /dev/null
+++ b/biometrics/common/aidl/aidl_api/android.hardware.biometrics.common/current/android/hardware/biometrics/common/OperationState.aidl
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.biometrics.common;
+/* @hide */
+@VintfStability
+union OperationState {
+ android.hardware.biometrics.common.OperationState.FingerprintOperationState fingerprintOperationState;
+ android.hardware.biometrics.common.OperationState.FaceOperationState faceOperationState;
+ @VintfStability
+ parcelable FingerprintOperationState {
+ ParcelableHolder extension;
+ boolean isHardwareIgnoringTouches = false;
+ }
+ @VintfStability
+ parcelable FaceOperationState {
+ ParcelableHolder extension;
+ }
+}
diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl
index 584057d..5f9844f 100644
--- a/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl
+++ b/biometrics/common/aidl/android/hardware/biometrics/common/OperationContext.aidl
@@ -20,6 +20,7 @@
import android.hardware.biometrics.common.DisplayState;
import android.hardware.biometrics.common.FoldState;
import android.hardware.biometrics.common.OperationReason;
+import android.hardware.biometrics.common.OperationState;
import android.hardware.biometrics.common.WakeReason;
/**
@@ -75,4 +76,7 @@
/** The current fold/unfold state. */
FoldState foldState = FoldState.UNKNOWN;
+
+ /** An associated operation state for this operation. */
+ @nullable OperationState operationState;
}
diff --git a/biometrics/common/aidl/android/hardware/biometrics/common/OperationState.aidl b/biometrics/common/aidl/android/hardware/biometrics/common/OperationState.aidl
new file mode 100644
index 0000000..40cf589
--- /dev/null
+++ b/biometrics/common/aidl/android/hardware/biometrics/common/OperationState.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.biometrics.common;
+
+/**
+ * Additional state associated with an operation
+ *
+ * @hide
+ */
+@VintfStability
+union OperationState {
+ /** Operation state related to fingerprint*/
+ @VintfStability
+ parcelable FingerprintOperationState {
+ ParcelableHolder extension;
+
+ /** Flag indicating if the HAL should ignore touches on the fingerprint sensor */
+ boolean isHardwareIgnoringTouches = false;
+ }
+
+ /** Operation state related to face*/
+ @VintfStability
+ parcelable FaceOperationState {
+ ParcelableHolder extension;
+ }
+
+ OperationState.FingerprintOperationState fingerprintOperationState;
+ OperationState.FaceOperationState faceOperationState;
+}
diff --git a/biometrics/face/aidl/default/Face.cpp b/biometrics/face/aidl/default/Face.cpp
index 652a7e1..5ae0df6 100644
--- a/biometrics/face/aidl/default/Face.cpp
+++ b/biometrics/face/aidl/default/Face.cpp
@@ -14,11 +14,23 @@
* limitations under the License.
*/
+#undef LOG_TAG
+#define LOG_TAG "FaceVirtualHal"
+
#include "Face.h"
#include "Session.h"
#include "FakeFaceEngine.h"
+#include <android-base/properties.h>
+#include <face.sysprop.h>
+
+#include <android-base/file.h>
+#include <android-base/logging.h>
+#include <android-base/stringprintf.h>
+
+using namespace ::android::face::virt;
+
namespace aidl::android::hardware::biometrics::face {
const int kSensorId = 4;
@@ -68,11 +80,105 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus Face::createSession(int32_t /*sensorId*/, int32_t /*userId*/,
+ndk::ScopedAStatus Face::createSession(int32_t sensorId, int32_t userId,
const std::shared_ptr<ISessionCallback>& cb,
std::shared_ptr<ISession>* return_val) {
- *return_val = SharedRefBase::make<Session>(std::make_unique<FakeFaceEngine>(), cb);
+ mSession = SharedRefBase::make<Session>(std::make_unique<FakeFaceEngine>(), cb);
+ *return_val = mSession;
+
+ mSession->linkToDeath(cb->asBinder().get());
+
+ LOG(INFO) << __func__ << ": sensorId:" << sensorId << " userId:" << userId;
return ndk::ScopedAStatus::ok();
}
+binder_status_t Face::dump(int fd, const char** /*args*/, uint32_t numArgs) {
+ if (fd < 0) {
+ LOG(ERROR) << __func__ << "fd invalid: " << fd;
+ return STATUS_BAD_VALUE;
+ } else {
+ LOG(INFO) << __func__ << " fd:" << fd << "numArgs:" << numArgs;
+ }
+
+ dprintf(fd, "----- FaceVirtualHal::dump -----\n");
+ std::vector<SensorProps> sps(1);
+ getSensorProps(&sps);
+ for (auto& sp : sps) {
+ ::android::base::WriteStringToFd(sp.toString(), fd);
+ }
+ if (mSession != nullptr) {
+ ::android::base::WriteStringToFd(mSession->toString(), fd);
+ } else {
+ dprintf(fd, "\nWARNING: no ISession found\n");
+ }
+
+ fsync(fd);
+ return STATUS_OK;
+}
+
+binder_status_t Face::handleShellCommand(int in, int out, int err, const char** args,
+ uint32_t numArgs) {
+ LOG(INFO) << __func__ << " in:" << in << " out:" << out << " err:" << err
+ << " numArgs:" << numArgs;
+
+ if (numArgs == 0) {
+ LOG(INFO) << __func__ << ": available commands";
+ onHelp(out);
+ return STATUS_OK;
+ }
+
+ for (auto&& str : std::vector<std::string_view>(args, args + numArgs)) {
+ std::string option = str.data();
+ if (option.find("clearconfig") != std::string::npos ||
+ option.find("resetconfig") != std::string::npos) {
+ resetConfigToDefault();
+ }
+ if (option.find("help") != std::string::npos) {
+ onHelp(out);
+ }
+ }
+
+ return STATUS_OK;
+}
+
+void Face::onHelp(int fd) {
+ dprintf(fd, "Virtual Face HAL commands:\n");
+ dprintf(fd, " help: print this help\n");
+ dprintf(fd, " resetconfig: reset all configuration to default\n");
+ dprintf(fd, "\n");
+ fsync(fd);
+}
+
+void Face::resetConfigToDefault() {
+ LOG(INFO) << __func__ << ": reset virtual Face HAL configuration to default";
+#define RESET_CONFIG_O(__NAME__) \
+ if (FaceHalProperties::__NAME__()) FaceHalProperties::__NAME__(std::nullopt)
+#define RESET_CONFIG_V(__NAME__) \
+ if (!FaceHalProperties::__NAME__().empty()) FaceHalProperties::__NAME__({std::nullopt})
+
+ RESET_CONFIG_O(type);
+ RESET_CONFIG_O(strength);
+ RESET_CONFIG_V(enrollments);
+ RESET_CONFIG_O(enrollment_hit);
+ RESET_CONFIG_V(features);
+ RESET_CONFIG_O(next_enrollment);
+ RESET_CONFIG_O(authenticator_id);
+ RESET_CONFIG_O(challenge);
+ RESET_CONFIG_O(lockout);
+ RESET_CONFIG_O(operation_authenticate_fails);
+ RESET_CONFIG_O(operation_detect_interaction_fails);
+ RESET_CONFIG_O(operation_enroll_fails);
+ RESET_CONFIG_V(operation_authenticate_latency);
+ RESET_CONFIG_V(operation_detect_interaction_latency);
+ RESET_CONFIG_V(operation_enroll_latency);
+ RESET_CONFIG_O(operation_authenticate_duration);
+ RESET_CONFIG_O(operation_authenticate_error);
+ RESET_CONFIG_O(operation_authenticate_acquired);
+ RESET_CONFIG_O(lockout_enable);
+ RESET_CONFIG_O(lockout_timed_enable);
+ RESET_CONFIG_O(lockout_timed_threshold);
+ RESET_CONFIG_O(lockout_timed_duration);
+ RESET_CONFIG_O(lockout_permanent_threshold);
+}
+
} // namespace aidl::android::hardware::biometrics::face
diff --git a/biometrics/face/aidl/default/Face.h b/biometrics/face/aidl/default/Face.h
index 786b4f8..93fddb0 100644
--- a/biometrics/face/aidl/default/Face.h
+++ b/biometrics/face/aidl/default/Face.h
@@ -17,16 +17,26 @@
#pragma once
#include <aidl/android/hardware/biometrics/face/BnFace.h>
+#include "Session.h"
namespace aidl::android::hardware::biometrics::face {
class Face : public BnFace {
public:
+ Face() : mSession(nullptr) {}
ndk::ScopedAStatus getSensorProps(std::vector<SensorProps>* _aidl_return) override;
ndk::ScopedAStatus createSession(int32_t sensorId, int32_t userId,
const std::shared_ptr<ISessionCallback>& cb,
std::shared_ptr<ISession>* _aidl_return) override;
+
+ binder_status_t dump(int fd, const char** args, uint32_t numArgs);
+ binder_status_t handleShellCommand(int in, int out, int err, const char** argv, uint32_t argc);
+
+ private:
+ std::shared_ptr<Session> mSession;
+ void resetConfigToDefault();
+ void onHelp(int);
};
} // namespace aidl::android::hardware::biometrics::face
diff --git a/biometrics/face/aidl/default/FakeFaceEngine.cpp b/biometrics/face/aidl/default/FakeFaceEngine.cpp
index 7380611..bf75874 100644
--- a/biometrics/face/aidl/default/FakeFaceEngine.cpp
+++ b/biometrics/face/aidl/default/FakeFaceEngine.cpp
@@ -14,6 +14,7 @@
* limitations under the License.
*/
+#undef LOG_TAG
#define LOG_TAG "FaceVirtualHalEngine"
#include "FakeFaceEngine.h"
@@ -70,7 +71,7 @@
EnrollmentType /*enrollmentType*/,
const std::vector<Feature>& /*features*/,
const std::future<void>& cancel) {
- BEGIN_OP(FaceHalProperties::operation_start_enroll_latency().value_or(0));
+ BEGIN_OP(getLatency(FaceHalProperties::operation_enroll_latency()));
// Do proper HAT verification in the real implementation.
if (hat.mac.empty()) {
@@ -158,7 +159,7 @@
void FakeFaceEngine::authenticateImpl(ISessionCallback* cb, int64_t /*operationId*/,
const std::future<void>& cancel) {
- BEGIN_OP(FaceHalProperties::operation_authenticate_latency().value_or(0));
+ BEGIN_OP(getLatency(FaceHalProperties::operation_authenticate_latency()));
auto id = FaceHalProperties::enrollment_hit().value_or(0);
auto enrolls = FaceHalProperties::enrollments();
@@ -291,7 +292,7 @@
}
void FakeFaceEngine::detectInteractionImpl(ISessionCallback* cb, const std::future<void>& cancel) {
- BEGIN_OP(FaceHalProperties::operation_detect_interaction_latency().value_or(0));
+ BEGIN_OP(getLatency(FaceHalProperties::operation_detect_interaction_latency()));
if (FaceHalProperties::operation_detect_interaction_fails().value_or(false)) {
LOG(ERROR) << "Fail: operation_detect_interaction_fails";
@@ -418,4 +419,33 @@
cb->onLockoutCleared();
}
+int32_t FakeFaceEngine::getRandomInRange(int32_t bound1, int32_t bound2) {
+ std::uniform_int_distribution<int32_t> dist(std::min(bound1, bound2), std::max(bound1, bound2));
+ return dist(mRandom);
+}
+
+int32_t FakeFaceEngine::getLatency(const std::vector<std::optional<std::int32_t>>& latencyIn) {
+ int32_t res = DEFAULT_LATENCY;
+
+ std::vector<int32_t> latency;
+ for (auto x : latencyIn)
+ if (x.has_value()) latency.push_back(*x);
+
+ switch (latency.size()) {
+ case 0:
+ break;
+ case 1:
+ res = latency[0];
+ break;
+ case 2:
+ res = getRandomInRange(latency[0], latency[1]);
+ break;
+ default:
+ LOG(ERROR) << "ERROR: unexpected input of size " << latency.size();
+ break;
+ }
+
+ return res;
+}
+
} // namespace aidl::android::hardware::biometrics::face
diff --git a/biometrics/face/aidl/default/FakeFaceEngine.h b/biometrics/face/aidl/default/FakeFaceEngine.h
index 8d9303c..b1e1388 100644
--- a/biometrics/face/aidl/default/FakeFaceEngine.h
+++ b/biometrics/face/aidl/default/FakeFaceEngine.h
@@ -60,6 +60,7 @@
void getAuthenticatorIdImpl(ISessionCallback* cb);
void invalidateAuthenticatorIdImpl(ISessionCallback* cb);
void resetLockoutImpl(ISessionCallback* cb, const keymaster::HardwareAuthToken& /*hat*/);
+ int32_t getLatency(const std::vector<std::optional<std::int32_t>>& latencyVec);
virtual std::string toString() const {
std::ostringstream os;
@@ -71,6 +72,7 @@
std::mt19937 mRandom;
private:
+ int32_t getRandomInRange(int32_t bound1, int32_t bound2);
static constexpr int32_t FACE_ACQUIRED_VENDOR_BASE = 1000;
static constexpr int32_t FACE_ERROR_VENDOR_BASE = 1000;
std::pair<AcquiredInfo, int32_t> convertAcquiredInfo(int32_t code);
diff --git a/biometrics/face/aidl/default/FakeLockoutTracker.h b/biometrics/face/aidl/default/FakeLockoutTracker.h
index f2d38f3..82cc313 100644
--- a/biometrics/face/aidl/default/FakeLockoutTracker.h
+++ b/biometrics/face/aidl/default/FakeLockoutTracker.h
@@ -28,7 +28,9 @@
public:
FakeLockoutTracker()
: mFailedCount(0),
+ mTimedFailedCount(0),
mLastFailedTime(0),
+ mCurrentMode(LockoutMode::kNone),
mIsLockoutTimerStarted(false),
mIsLockoutTimerAborted(false) {}
~FakeLockoutTracker() {}
diff --git a/biometrics/face/aidl/default/Session.cpp b/biometrics/face/aidl/default/Session.cpp
index 6f3f2fc..673d879 100644
--- a/biometrics/face/aidl/default/Session.cpp
+++ b/biometrics/face/aidl/default/Session.cpp
@@ -14,20 +14,38 @@
* limitations under the License.
*/
+#undef LOG_TAG
+#define LOG_TAG "FaceVirtualHalSession"
+
#include <android-base/logging.h>
#include "Session.h"
-#undef LOG_TAG
-#define LOG_TAG "FaceVirtualHalSession"
-
namespace aidl::android::hardware::biometrics::face {
constexpr size_t MAX_WORKER_QUEUE_SIZE = 5;
+void onClientDeath(void* cookie) {
+ LOG(INFO) << "FaceService has died";
+ Session* session = static_cast<Session*>(cookie);
+ if (session && !session->isClosed()) {
+ session->close();
+ }
+}
+
Session::Session(std::unique_ptr<FakeFaceEngine> engine, std::shared_ptr<ISessionCallback> cb)
- : mEngine(std::move(engine)), mCb(std::move(cb)), mRandom(std::mt19937::default_seed) {
+ : mEngine(std::move(engine)),
+ mCb(std::move(cb)),
+ mRandom(std::mt19937::default_seed),
+ mStateClosed(false) {
+ CHECK(mEngine);
+ CHECK(mCb);
mThread = std::make_unique<WorkerThread>(MAX_WORKER_QUEUE_SIZE);
+ mDeathRecipient = AIBinder_DeathRecipient_new(onClientDeath);
+}
+
+binder_status_t Session::linkToDeath(AIBinder* binder) {
+ return AIBinder_linkToDeath(binder, mDeathRecipient, this);
}
ndk::ScopedAStatus Session::generateChallenge() {
@@ -144,9 +162,12 @@
}
ndk::ScopedAStatus Session::close() {
+ LOG(INFO) << "close";
if (mCb) {
mCb->onSessionClosed();
}
+ AIBinder_DeathRecipient_delete(mDeathRecipient);
+ mStateClosed = true;
return ndk::ScopedAStatus::ok();
}
diff --git a/biometrics/face/aidl/default/Session.h b/biometrics/face/aidl/default/Session.h
index ce6e7f1..f79ad00 100644
--- a/biometrics/face/aidl/default/Session.h
+++ b/biometrics/face/aidl/default/Session.h
@@ -33,6 +33,11 @@
using aidl::android::hardware::common::NativeHandle;
+enum class SessionState {
+ IDLING,
+ CLOSED,
+};
+
class Session : public BnSession {
public:
explicit Session(std::unique_ptr<FakeFaceEngine> engine, std::shared_ptr<ISessionCallback> cb);
@@ -93,12 +98,28 @@
const FaceEnrollOptions& options,
std::shared_ptr<common::ICancellationSignal>* out) override;
+ binder_status_t linkToDeath(AIBinder* binder);
+
+ virtual std::string toString() const {
+ std::ostringstream os;
+ os << std::endl << "----- Face::Session:: -----" << std::endl;
+ os << "mStateClosed:" << mStateClosed << std::endl;
+ os << mEngine->toString();
+
+ return os.str();
+ }
+
+ bool isClosed() { return mStateClosed; }
+
private:
std::unique_ptr<FakeFaceEngine> mEngine;
std::shared_ptr<ISessionCallback> mCb;
std::mt19937 mRandom;
std::unique_ptr<WorkerThread> mThread;
- std::shared_ptr<CancellationSignal> mCancellationSignal;
+
+ // Binder death handler.
+ AIBinder_DeathRecipient* mDeathRecipient;
+ bool mStateClosed;
};
} // namespace aidl::android::hardware::biometrics::face
diff --git a/biometrics/face/aidl/default/api/android.hardware.biometrics.face.VirtualProps-current.txt b/biometrics/face/aidl/default/api/android.hardware.biometrics.face.VirtualProps-current.txt
index 9548920..e69de29 100644
--- a/biometrics/face/aidl/default/api/android.hardware.biometrics.face.VirtualProps-current.txt
+++ b/biometrics/face/aidl/default/api/android.hardware.biometrics.face.VirtualProps-current.txt
@@ -1,98 +0,0 @@
-props {
- owner: Vendor
- module: "android.face.virt.FaceHalProperties"
- prop {
- api_name: "authenticator_id"
- type: Long
- access: ReadWrite
- prop_name: "vendor.face.virtual.authenticator_id"
- }
- prop {
- api_name: "challenge"
- type: Long
- access: ReadWrite
- prop_name: "vendor.face.virtual.challenge"
- }
- prop {
- api_name: "enrollment_hit"
- type: Integer
- access: ReadWrite
- prop_name: "vendor.face.virtual.enrollment_hit"
- }
- prop {
- api_name: "enrollments"
- type: IntegerList
- access: ReadWrite
- prop_name: "persist.vendor.face.virtual.enrollments"
- }
- prop {
- api_name: "features"
- type: IntegerList
- access: ReadWrite
- prop_name: "persist.vendor.face.virtual.features"
- }
- prop {
- api_name: "lockout"
- access: ReadWrite
- prop_name: "vendor.face.virtual.lockout"
- }
- prop {
- api_name: "next_enrollment"
- type: String
- access: ReadWrite
- prop_name: "vendor.face.virtual.next_enrollment"
- }
- prop {
- api_name: "operation_authenticate_duration"
- type: Integer
- access: ReadWrite
- prop_name: "vendor.face.virtual.operation_authenticate_duration"
- }
- prop {
- api_name: "operation_authenticate_fails"
- access: ReadWrite
- prop_name: "vendor.face.virtual.operation_authenticate_fails"
- }
- prop {
- api_name: "operation_authenticate_latency"
- type: Integer
- access: ReadWrite
- prop_name: "vendor.face.virtual.operation_authenticate_latency"
- }
- prop {
- api_name: "operation_detect_interaction_fails"
- access: ReadWrite
- prop_name: "vendor.face.virtual.operation_detect_interaction_fails"
- }
- prop {
- api_name: "operation_detect_interaction_latency"
- type: Integer
- access: ReadWrite
- prop_name: "vendor.face.virtual.operation_detect_interaction_latency"
- }
- prop {
- api_name: "operation_enroll_fails"
- access: ReadWrite
- prop_name: "vendor.face.virtual.operation_enroll_fails"
- }
- prop {
- api_name: "operation_start_enroll_latency"
- type: Integer
- access: ReadWrite
- prop_name: "vendor.face.virtual.operation_start_enroll_latency"
- }
- prop {
- api_name: "strength"
- type: String
- access: ReadWrite
- prop_name: "persist.vendor.face.virtual.strength"
- enum_values: "convenience|weak|strong"
- }
- prop {
- api_name: "type"
- type: String
- access: ReadWrite
- prop_name: "persist.vendor.face.virtual.type"
- enum_values: "IR|RGB"
- }
-}
diff --git a/biometrics/face/aidl/default/face.sysprop b/biometrics/face/aidl/default/face.sysprop
index 95b0b43..997fd67 100644
--- a/biometrics/face/aidl/default/face.sysprop
+++ b/biometrics/face/aidl/default/face.sysprop
@@ -7,7 +7,7 @@
prop {
prop_name: "persist.vendor.face.virtual.type"
type: String
- scope: Public
+ scope: Internal
access: ReadWrite
enum_values: "IR|RGB"
api_name: "type"
@@ -17,7 +17,7 @@
prop {
prop_name: "persist.vendor.face.virtual.strength"
type: String
- scope: Public
+ scope: Internal
access: ReadWrite
enum_values: "convenience|weak|strong"
api_name: "strength"
@@ -27,7 +27,7 @@
prop {
prop_name: "persist.vendor.face.virtual.enrollments"
type: IntegerList
- scope: Public
+ scope: Internal
access: ReadWrite
api_name: "enrollments"
}
@@ -36,7 +36,7 @@
prop {
prop_name: "persist.vendor.face.virtual.features"
type: IntegerList
- scope: Public
+ scope: Internal
access: ReadWrite
api_name: "features"
}
@@ -46,20 +46,11 @@
prop {
prop_name: "vendor.face.virtual.enrollment_hit"
type: Integer
- scope: Public
+ scope: Internal
access: ReadWrite
api_name: "enrollment_hit"
}
-# The initial latency for enrollment
-prop {
- prop_name: "vendor.face.virtual.operation_start_enroll_latency"
- type: Integer
- scope: Public
- access: ReadWrite
- api_name: "operation_start_enroll_latency"
-}
-
# the next enrollment in the format:
# "<id>,<bucket_id>:<delay>:<succeeds>,<bucket_id>..."
# for example: "0:1,0:100:1,1:200:1" indicating that bucket 0 took
@@ -69,7 +60,7 @@
prop {
prop_name: "vendor.face.virtual.next_enrollment"
type: String
- scope: Public
+ scope: Internal
access: ReadWrite
api_name: "next_enrollment"
}
@@ -78,7 +69,7 @@
prop {
prop_name: "vendor.face.virtual.authenticator_id"
type: Long
- scope: Public
+ scope: Internal
access: ReadWrite
api_name: "authenticator_id"
}
@@ -87,7 +78,7 @@
prop {
prop_name: "vendor.face.virtual.challenge"
type: Long
- scope: Public
+ scope: Internal
access: ReadWrite
api_name: "challenge"
}
@@ -96,7 +87,7 @@
prop {
prop_name: "vendor.face.virtual.lockout"
type: Boolean
- scope: Public
+ scope: Internal
access: ReadWrite
api_name: "lockout"
}
@@ -105,7 +96,7 @@
prop {
prop_name: "vendor.face.virtual.operation_authenticate_fails"
type: Boolean
- scope: Public
+ scope: Internal
access: ReadWrite
api_name: "operation_authenticate_fails"
}
@@ -114,7 +105,7 @@
prop {
prop_name: "vendor.face.virtual.operation_detect_interaction_fails"
type: Boolean
- scope: Public
+ scope: Internal
access: ReadWrite
api_name: "operation_detect_interaction_fails"
}
@@ -123,7 +114,7 @@
prop {
prop_name: "vendor.face.virtual.operation_enroll_fails"
type: Boolean
- scope: Public
+ scope: Internal
access: ReadWrite
api_name: "operation_enroll_fails"
}
@@ -133,8 +124,8 @@
# the HAL will send AcquiredInfo::START and AcquiredInfo::FIRST_FRAME_RECEIVED
prop {
prop_name: "vendor.face.virtual.operation_authenticate_latency"
- type: Integer
- scope: Public
+ type: IntegerList
+ scope: Internal
access: ReadWrite
api_name: "operation_authenticate_latency"
}
@@ -142,18 +133,27 @@
# add a latency to detectInteraction operations
prop {
prop_name: "vendor.face.virtual.operation_detect_interaction_latency"
- type: Integer
- scope: Public
+ type: IntegerList
+ scope: Internal
access: ReadWrite
api_name: "operation_detect_interaction_latency"
}
+# add a latency to enroll operations
+prop {
+ prop_name: "vendor.face.virtual.operation_enroll_latency"
+ type: IntegerList
+ scope: Internal
+ access: ReadWrite
+ api_name: "operation_enroll_latency"
+}
+
# millisecond duration for authenticate operations
# (waits for changes to enrollment_hit)
prop {
prop_name: "vendor.face.virtual.operation_authenticate_duration"
type: Integer
- scope: Public
+ scope: Internal
access: ReadWrite
api_name: "operation_authenticate_duration"
}
diff --git a/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp b/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp
index 69c9bf4..8c39b58 100644
--- a/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp
+++ b/biometrics/face/aidl/default/tests/FakeFaceEngineTest.cpp
@@ -22,6 +22,7 @@
#include <android-base/logging.h>
#include "FakeFaceEngine.h"
+#include "util/Util.h"
using namespace ::android::face::virt;
using namespace ::aidl::android::hardware::biometrics::face;
@@ -137,11 +138,15 @@
void SetUp() override {
LOG(ERROR) << "JRM SETUP";
mCallback = ndk::SharedRefBase::make<TestSessionCallback>();
+ }
+
+ void TearDown() override {
FaceHalProperties::enrollments({});
FaceHalProperties::challenge({});
FaceHalProperties::features({});
FaceHalProperties::authenticator_id({});
FaceHalProperties::strength("");
+ FaceHalProperties::operation_detect_interaction_latency({});
}
FakeFaceEngine mEngine;
@@ -383,4 +388,26 @@
ASSERT_FALSE(mCallback->mAuthenticateFailed);
}
+TEST_F(FakeFaceEngineTest, LatencyDefault) {
+ FaceHalProperties::operation_detect_interaction_latency({});
+ ASSERT_EQ(DEFAULT_LATENCY,
+ mEngine.getLatency(FaceHalProperties::operation_detect_interaction_latency()));
+}
+
+TEST_F(FakeFaceEngineTest, LatencyFixed) {
+ FaceHalProperties::operation_detect_interaction_latency({10});
+ ASSERT_EQ(10, mEngine.getLatency(FaceHalProperties::operation_detect_interaction_latency()));
+}
+
+TEST_F(FakeFaceEngineTest, LatencyRandom) {
+ FaceHalProperties::operation_detect_interaction_latency({1, 1000});
+ std::set<int32_t> latencySet;
+ for (int i = 0; i < 100; i++) {
+ auto x = mEngine.getLatency(FaceHalProperties::operation_detect_interaction_latency());
+ ASSERT_TRUE(x >= 1 && x <= 1000);
+ latencySet.insert(x);
+ }
+ ASSERT_TRUE(latencySet.size() > 95); // unique values
+}
+
} // namespace aidl::android::hardware::biometrics::face
diff --git a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl
index 4fdcefc..feb6ba3 100644
--- a/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl
+++ b/biometrics/fingerprint/aidl/aidl_api/android.hardware.biometrics.fingerprint/current/android/hardware/biometrics/fingerprint/ISession.aidl
@@ -62,5 +62,8 @@
void onPointerUpWithContext(in android.hardware.biometrics.fingerprint.PointerContext context);
void onContextChanged(in android.hardware.biometrics.common.OperationContext context);
void onPointerCancelWithContext(in android.hardware.biometrics.fingerprint.PointerContext context);
+ /**
+ * @deprecated use isHardwareIgnoringTouches in OperationContext from onContextChanged instead
+ */
void setIgnoreDisplayTouches(in boolean shouldIgnore);
}
diff --git a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl
index 83e7bbc..07e22c2 100644
--- a/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl
+++ b/biometrics/fingerprint/aidl/android/hardware/biometrics/fingerprint/ISession.aidl
@@ -544,6 +544,8 @@
* whenever it's appropriate.
*
* @param shouldIgnore whether the display touches should be ignored.
+
+ * @deprecated use isHardwareIgnoringTouches in OperationContext from onContextChanged instead
*/
void setIgnoreDisplayTouches(in boolean shouldIgnore);
}
diff --git a/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp b/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp
index 4e80052..a7acf3d 100644
--- a/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp
+++ b/biometrics/fingerprint/aidl/default/FakeFingerprintEngine.cpp
@@ -62,12 +62,17 @@
return;
}
+ waitForFingerDown(cb, cancel);
+
updateContext(WorkMode::kEnroll, cb, const_cast<std::future<void>&>(cancel), 0, hat);
}
void FakeFingerprintEngine::authenticateImpl(ISessionCallback* cb, int64_t operationId,
const std::future<void>& cancel) {
BEGIN_OP(0);
+
+ waitForFingerDown(cb, cancel);
+
updateContext(WorkMode::kAuthenticate, cb, const_cast<std::future<void>&>(cancel), operationId,
keymaster::HardwareAuthToken());
}
@@ -84,6 +89,8 @@
return;
}
+ waitForFingerDown(cb, cancel);
+
updateContext(WorkMode::kDetectInteract, cb, const_cast<std::future<void>&>(cancel), 0,
keymaster::HardwareAuthToken());
}
@@ -398,6 +405,7 @@
ndk::ScopedAStatus FakeFingerprintEngine::onPointerUpImpl(int32_t /*pointerId*/) {
BEGIN_OP(0);
+ mFingerIsDown = false;
return ndk::ScopedAStatus::ok();
}
@@ -533,4 +541,17 @@
isLockoutTimerStarted = false;
isLockoutTimerAborted = false;
}
+
+void FakeFingerprintEngine::waitForFingerDown(ISessionCallback* cb,
+ const std::future<void>& cancel) {
+ while (!mFingerIsDown) {
+ if (shouldCancel(cancel)) {
+ LOG(ERROR) << "waitForFingerDown, Fail: cancel";
+ cb->onError(Error::CANCELED, 0 /* vendorCode */);
+ return;
+ }
+ SLEEP_MS(10);
+ }
+}
+
} // namespace aidl::android::hardware::biometrics::fingerprint
diff --git a/biometrics/fingerprint/aidl/default/Session.cpp b/biometrics/fingerprint/aidl/default/Session.cpp
index c06c931..0dd6603 100644
--- a/biometrics/fingerprint/aidl/default/Session.cpp
+++ b/biometrics/fingerprint/aidl/default/Session.cpp
@@ -249,6 +249,7 @@
ndk::ScopedAStatus Session::onPointerDown(int32_t pointerId, int32_t x, int32_t y, float minor,
float major) {
LOG(INFO) << "onPointerDown";
+ mEngine->notifyFingerdown();
mWorker->schedule(Callable::from([this, pointerId, x, y, minor, major] {
mEngine->onPointerDownImpl(pointerId, x, y, minor, major);
enterIdling();
diff --git a/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngine.h b/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngine.h
index 15d8360..0d53575 100644
--- a/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngine.h
+++ b/biometrics/fingerprint/aidl/default/include/FakeFingerprintEngine.h
@@ -75,6 +75,7 @@
enum class WorkMode : int8_t { kIdle = 0, kAuthenticate, kEnroll, kDetectInteract };
WorkMode getWorkMode() { return mWorkMode; }
+ void notifyFingerdown() { mFingerIsDown = true; }
virtual std::string toString() const {
std::ostringstream os;
@@ -100,6 +101,7 @@
keymaster::HardwareAuthToken mHat;
std::future<void> mCancel;
int64_t mOperationId;
+ bool mFingerIsDown;
private:
static constexpr int32_t FINGERPRINT_ACQUIRED_VENDOR_BASE = 1000;
@@ -109,6 +111,7 @@
int32_t getRandomInRange(int32_t bound1, int32_t bound2);
bool checkSensorLockout(ISessionCallback*);
void clearLockout(ISessionCallback* cb);
+ void waitForFingerDown(ISessionCallback* cb, const std::future<void>& cancel);
FakeLockoutTracker mLockoutTracker;
diff --git a/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp b/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp
index eedcae1..8b06c8e 100644
--- a/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp
+++ b/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineTest.cpp
@@ -185,6 +185,7 @@
FingerprintHalProperties::enrollments({});
FingerprintHalProperties::next_enrollment("4:0,0:true");
keymaster::HardwareAuthToken hat{.mac = {2, 4}};
+ mEngine.notifyFingerdown();
mEngine.enrollImpl(mCallback.get(), hat, mCancel.get_future());
ASSERT_EQ(mEngine.getWorkMode(), FakeFingerprintEngine::WorkMode::kEnroll);
mEngine.fingerDownAction();
@@ -202,6 +203,7 @@
FingerprintHalProperties::next_enrollment(next);
keymaster::HardwareAuthToken hat{.mac = {2, 4}};
mCancel.set_value();
+ mEngine.notifyFingerdown();
mEngine.enrollImpl(mCallback.get(), hat, mCancel.get_future());
mEngine.fingerDownAction();
ASSERT_EQ(Error::CANCELED, mCallback->mError);
@@ -215,6 +217,7 @@
auto next = "2:0,0:false";
FingerprintHalProperties::next_enrollment(next);
keymaster::HardwareAuthToken hat{.mac = {2, 4}};
+ mEngine.notifyFingerdown();
mEngine.enrollImpl(mCallback.get(), hat, mCancel.get_future());
mEngine.fingerDownAction();
ASSERT_EQ(Error::UNABLE_TO_PROCESS, mCallback->mError);
@@ -228,6 +231,7 @@
FingerprintHalProperties::next_enrollment("4:0,5-[12,1013]:true");
keymaster::HardwareAuthToken hat{.mac = {2, 4}};
int32_t prevCnt = mCallback->mLastAcquiredCount;
+ mEngine.notifyFingerdown();
mEngine.enrollImpl(mCallback.get(), hat, mCancel.get_future());
mEngine.fingerDownAction();
ASSERT_FALSE(FingerprintHalProperties::next_enrollment().has_value());
@@ -242,6 +246,7 @@
TEST_F(FakeFingerprintEngineTest, Authenticate) {
FingerprintHalProperties::enrollments({1, 2});
FingerprintHalProperties::enrollment_hit(2);
+ mEngine.notifyFingerdown();
mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future());
ASSERT_EQ(mEngine.getWorkMode(), FakeFingerprintEngine::WorkMode::kAuthenticate);
mEngine.fingerDownAction();
@@ -255,6 +260,7 @@
FingerprintHalProperties::enrollments({2});
FingerprintHalProperties::enrollment_hit(2);
mCancel.set_value();
+ mEngine.notifyFingerdown();
mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future());
mEngine.fingerDownAction();
ASSERT_EQ(Error::CANCELED, mCallback->mError);
@@ -264,6 +270,7 @@
TEST_F(FakeFingerprintEngineTest, AuthenticateNotSet) {
FingerprintHalProperties::enrollments({1, 2});
FingerprintHalProperties::enrollment_hit({});
+ mEngine.notifyFingerdown();
mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future());
mEngine.fingerDownAction();
ASSERT_TRUE(mCallback->mAuthenticateFailed);
@@ -272,6 +279,7 @@
TEST_F(FakeFingerprintEngineTest, AuthenticateNotEnrolled) {
FingerprintHalProperties::enrollments({1, 2});
FingerprintHalProperties::enrollment_hit(3);
+ mEngine.notifyFingerdown();
mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future());
mEngine.fingerDownAction();
ASSERT_TRUE(mCallback->mAuthenticateFailed);
@@ -282,6 +290,7 @@
FingerprintHalProperties::enrollments({22, 2});
FingerprintHalProperties::enrollment_hit(2);
FingerprintHalProperties::lockout(true);
+ mEngine.notifyFingerdown();
mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future());
mEngine.fingerDownAction();
ASSERT_TRUE(mCallback->mLockoutPermanent);
@@ -290,6 +299,7 @@
TEST_F(FakeFingerprintEngineTest, AuthenticateError8) {
FingerprintHalProperties::operation_authenticate_error(8);
+ mEngine.notifyFingerdown();
mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future());
mEngine.fingerDownAction();
ASSERT_EQ(mCallback->mError, (Error)8);
@@ -298,6 +308,7 @@
TEST_F(FakeFingerprintEngineTest, AuthenticateError9) {
FingerprintHalProperties::operation_authenticate_error(1009);
+ mEngine.notifyFingerdown();
mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future());
mEngine.fingerDownAction();
ASSERT_EQ(mCallback->mError, (Error)7);
@@ -306,6 +317,7 @@
TEST_F(FakeFingerprintEngineTest, AuthenticateFails) {
FingerprintHalProperties::operation_authenticate_fails(true);
+ mEngine.notifyFingerdown();
mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future());
mEngine.fingerDownAction();
ASSERT_TRUE(mCallback->mAuthenticateFailed);
@@ -318,6 +330,7 @@
FingerprintHalProperties::enrollment_hit(2);
FingerprintHalProperties::operation_authenticate_acquired("4,1009");
int32_t prevCount = mCallback->mLastAcquiredCount;
+ mEngine.notifyFingerdown();
mEngine.authenticateImpl(mCallback.get(), 0, mCancel.get_future());
mEngine.fingerDownAction();
ASSERT_FALSE(mCallback->mAuthenticateFailed);
@@ -332,6 +345,7 @@
FingerprintHalProperties::enrollments({1, 2});
FingerprintHalProperties::enrollment_hit(2);
FingerprintHalProperties::operation_detect_interaction_acquired("");
+ mEngine.notifyFingerdown();
mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future());
ASSERT_EQ(mEngine.getWorkMode(), FakeFingerprintEngine::WorkMode::kDetectInteract);
mEngine.fingerDownAction();
@@ -345,6 +359,7 @@
FingerprintHalProperties::enrollments({1, 2});
FingerprintHalProperties::enrollment_hit(2);
mCancel.set_value();
+ mEngine.notifyFingerdown();
mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future());
mEngine.fingerDownAction();
ASSERT_EQ(Error::CANCELED, mCallback->mError);
@@ -355,6 +370,7 @@
FingerprintHalProperties::detect_interaction(true);
FingerprintHalProperties::enrollments({1, 2});
FingerprintHalProperties::enrollment_hit({});
+ mEngine.notifyFingerdown();
mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future());
mEngine.fingerDownAction();
ASSERT_EQ(1, mCallback->mInteractionDetectedCount);
@@ -363,6 +379,7 @@
TEST_F(FakeFingerprintEngineTest, InteractionDetectNotEnrolled) {
FingerprintHalProperties::enrollments({1, 2});
FingerprintHalProperties::enrollment_hit(25);
+ mEngine.notifyFingerdown();
mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future());
mEngine.fingerDownAction();
ASSERT_EQ(1, mCallback->mInteractionDetectedCount);
@@ -371,6 +388,7 @@
TEST_F(FakeFingerprintEngineTest, InteractionDetectError) {
FingerprintHalProperties::detect_interaction(true);
FingerprintHalProperties::operation_detect_interaction_error(8);
+ mEngine.notifyFingerdown();
mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future());
mEngine.fingerDownAction();
ASSERT_EQ(0, mCallback->mInteractionDetectedCount);
@@ -384,6 +402,7 @@
FingerprintHalProperties::enrollment_hit(2);
FingerprintHalProperties::operation_detect_interaction_acquired("4,1013");
int32_t prevCount = mCallback->mLastAcquiredCount;
+ mEngine.notifyFingerdown();
mEngine.detectInteractionImpl(mCallback.get(), mCancel.get_future());
mEngine.fingerDownAction();
ASSERT_EQ(1, mCallback->mInteractionDetectedCount);
diff --git a/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineUdfpsTest.cpp b/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineUdfpsTest.cpp
index f551899..5a30db1 100644
--- a/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineUdfpsTest.cpp
+++ b/biometrics/fingerprint/aidl/default/tests/FakeFingerprintEngineUdfpsTest.cpp
@@ -145,6 +145,7 @@
TEST_F(FakeFingerprintEngineUdfpsTest, authenticate) {
std::shared_ptr<TestSessionCallback> cb = ndk::SharedRefBase::make<TestSessionCallback>();
std::promise<void> cancel;
+ mEngine.notifyFingerdown();
mEngine.authenticateImpl(cb.get(), 1, cancel.get_future());
ASSERT_TRUE(mEngine.getWorkMode() == FakeFingerprintEngineUdfps::WorkMode::kAuthenticate);
mEngine.onPointerDownImpl(1, 2, 3, 4.0, 5.0);
@@ -158,6 +159,7 @@
std::promise<void> cancel;
keymaster::HardwareAuthToken hat{.mac = {5, 6}};
FingerprintHalProperties::next_enrollment("5:0,0:true");
+ mEngine.notifyFingerdown();
mEngine.enrollImpl(cb.get(), hat, cancel.get_future());
ASSERT_TRUE(mEngine.getWorkMode() == FakeFingerprintEngineUdfps::WorkMode::kEnroll);
mEngine.onPointerDownImpl(1, 2, 3, 4.0, 5.0);
@@ -173,6 +175,7 @@
FingerprintHalProperties::operation_detect_interaction_acquired("");
std::shared_ptr<TestSessionCallback> cb = ndk::SharedRefBase::make<TestSessionCallback>();
std::promise<void> cancel;
+ mEngine.notifyFingerdown();
mEngine.detectInteractionImpl(cb.get(), cancel.get_future());
ASSERT_TRUE(mEngine.getWorkMode() == FakeFingerprintEngineUdfps::WorkMode::kDetectInteract);
mEngine.onPointerDownImpl(1, 2, 3, 4.0, 5.0);
diff --git a/broadcastradio/TEST_MAPPING b/broadcastradio/TEST_MAPPING
new file mode 100644
index 0000000..2604fb3
--- /dev/null
+++ b/broadcastradio/TEST_MAPPING
@@ -0,0 +1,18 @@
+{
+ "presubmit": [
+ {
+ "name": "broadcastradio_utils_aidl_test"
+ },
+ {
+ "name": "DefaultBroadcastRadioHalTestCase"
+ },
+ {
+ "name": "android.hardware.broadcastradio@common-utils-tests"
+ }
+ ],
+ "auto-presubmit": [
+ {
+ "name": "VtsHalBroadcastradioAidlTargetTest"
+ }
+ ]
+}
diff --git a/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl b/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl
index 0ce967f..f1800dc 100644
--- a/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl
+++ b/broadcastradio/aidl/android/hardware/broadcastradio/Metadata.aidl
@@ -86,7 +86,7 @@
/**
* DAB ensemble name abbreviated (string).
*
- * <p>Note: The string must be up to 8 characters long.
+ * <p>Note: The string should be <= 8 characters.
*
* <p>Note: If the short variant is present, the long ({@link Metadata#dabEnsembleName})
* one must be present as well.
@@ -101,7 +101,7 @@
/**
* DAB service name abbreviated (string)
*
- * <p>Note: The string must be up to 8 characters long.
+ * <p>Note: The string should be <= 8 characters.
*/
String dabServiceNameShort;
@@ -113,7 +113,7 @@
/**
* DAB component name abbreviated (string)
*
- * <p>Note: The string must be up to 8 characters long.
+ * <p>Note: The string should be <= 8 characters.
*/
String dabComponentNameShort;
@@ -161,7 +161,7 @@
/**
* HD short station name or HD universal short station name
*
- * <p>It can be up to 12 characters (see SY_IDD_1020s for more info).
+ * <p>It can be <= 12 characters (see SY_IDD_1020s for more info).
*/
String hdStationNameShort;
diff --git a/broadcastradio/aidl/default/Android.bp b/broadcastradio/aidl/default/Android.bp
index 743365a..d7bb751 100644
--- a/broadcastradio/aidl/default/Android.bp
+++ b/broadcastradio/aidl/default/Android.bp
@@ -26,11 +26,11 @@
cc_defaults {
name: "BroadcastRadioHalDefaults",
static_libs: [
+ "android.hardware.broadcastradio-V2-ndk",
"android.hardware.broadcastradio@common-utils-aidl-lib-V2",
"android.hardware.broadcastradio@common-utils-lib",
],
shared_libs: [
- "android.hardware.broadcastradio-V2-ndk",
"libbase",
"libbinder_ndk",
"liblog",
diff --git a/broadcastradio/aidl/default/test/Android.bp b/broadcastradio/aidl/default/test/Android.bp
new file mode 100644
index 0000000..a33fb70
--- /dev/null
+++ b/broadcastradio/aidl/default/test/Android.bp
@@ -0,0 +1,44 @@
+/*
+ * Copyright (C) 2024 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 {
+ default_team: "trendy_team_aaos_framework",
+ default_applicable_licenses: ["Android-Apache-2.0"],
+}
+
+cc_test {
+ name: "DefaultBroadcastRadioHalTestCase",
+ vendor: true,
+ srcs: ["*.cpp"],
+ static_libs: [
+ "DefaultBroadcastRadioHal",
+ "libgtest",
+ "libgmock",
+ ],
+ shared_libs: [
+ "libbase",
+ "libbinder_ndk",
+ "liblog",
+ "libutils",
+ ],
+ header_libs: [
+ "IVehicleHardware",
+ ],
+ defaults: [
+ "BroadcastRadioHalDefaults",
+ ],
+ test_suites: ["device-tests"],
+}
diff --git a/broadcastradio/aidl/default/test/DefaultBroadcastRadioHalTest.cpp b/broadcastradio/aidl/default/test/DefaultBroadcastRadioHalTest.cpp
new file mode 100644
index 0000000..cca4b8c
--- /dev/null
+++ b/broadcastradio/aidl/default/test/DefaultBroadcastRadioHalTest.cpp
@@ -0,0 +1,485 @@
+/*
+ * Copyright (C) 2023 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 "MockBroadcastRadioCallback.h"
+
+#include <BroadcastRadio.h>
+#include <VirtualRadio.h>
+#include <broadcastradio-utils-aidl/Utils.h>
+
+#include <android-base/logging.h>
+#include <gtest/gtest.h>
+
+namespace aidl::android::hardware::broadcastradio {
+
+namespace {
+using ::std::vector;
+
+constexpr uint32_t kAmFreq1 = 560u;
+constexpr uint32_t kAmFreq2 = 680u;
+constexpr uint32_t kAmHdFreq = 1170u;
+constexpr uint64_t kAmHdSid = 0xB0000001u;
+constexpr uint32_t kFmFreq1 = 94900u;
+constexpr uint64_t kFmHdSid1 = 0xA0000001u;
+constexpr uint64_t kFmHdSid2 = 0xA0000002u;
+constexpr uint32_t kFmHdFreq1 = 98500u;
+constexpr uint32_t kFmHdSubChannel0 = 0u;
+constexpr uint32_t kFmHdSubChannel1 = 1u;
+constexpr uint32_t kFmFreq2 = 99100u;
+constexpr uint32_t kFmHdFreq2 = 101100u;
+
+const ProgramSelector kAmSel1 = utils::makeSelectorAmfm(kAmFreq1);
+const ProgramSelector kAmSel2 = utils::makeSelectorAmfm(kAmFreq2);
+const ProgramSelector kAmHdSel = utils::makeSelectorHd(kAmHdSid, kFmHdSubChannel0, kAmHdFreq);
+const ProgramSelector kFmSel1 = utils::makeSelectorAmfm(kFmFreq1);
+const ProgramSelector kFmSel2 = utils::makeSelectorAmfm(kFmFreq2);
+const ProgramSelector kFmHdFreq1Sel1 =
+ utils::makeSelectorHd(kFmHdSid1, kFmHdSubChannel0, kFmHdFreq1);
+const ProgramSelector kFmHdFreq1Sel2 =
+ utils::makeSelectorHd(kFmHdSid1, kFmHdSubChannel1, kFmHdFreq1);
+const ProgramSelector kFmHdFreq2Sel1 =
+ utils::makeSelectorHd(kFmHdSid2, kFmHdSubChannel0, kFmHdFreq2);
+const ProgramSelector kFmHdFreq2Sel2 =
+ utils::makeSelectorHd(kFmHdSid2, kFmHdSubChannel1, kFmHdFreq2);
+
+const VirtualRadio& getAmFmMockTestRadio() {
+ static VirtualRadio amFmRadioMockTestRadio(
+ "AM/FM radio mock for test",
+ {
+ {kAmSel1, "ProgramAm1", "ArtistAm1", "TitleAm1"},
+ {kAmSel2, "ProgramAm2", "ArtistAm2", "TitleAm2"},
+ {kFmSel1, "ProgramFm1", "ArtistFm1", "TitleFm1"},
+ {kFmSel2, "ProgramFm2", "ArtistFm2", "TitleFm2"},
+ {kAmHdSel, "ProgramAmHd1", "ArtistAmHd1", "TitleAmHd1"},
+ {kFmHdFreq1Sel1, "ProgramFmHd1", "ArtistFmHd1", "TitleFmHd1"},
+ {kFmHdFreq1Sel2, "ProgramFmHd2", "ArtistFmHd2", "TitleFmHd2"},
+ {kFmHdFreq2Sel1, "ProgramFmHd3", "ArtistFmHd3", "TitleFmHd3"},
+ {kFmHdFreq2Sel2, "ProgramFmHd4", "ArtistFmHd4", "TitleFmHd4"},
+ });
+ return amFmRadioMockTestRadio;
+}
+
+int getSignalAcquisitionFlags(const ProgramInfo& info) {
+ return (info.infoFlags &
+ (ProgramInfo::FLAG_SIGNAL_ACQUISITION | ProgramInfo::FLAG_HD_SIS_ACQUISITION |
+ ProgramInfo::FLAG_HD_AUDIO_ACQUISITION)) >>
+ 6;
+}
+
+} // namespace
+
+class DefaultBroadcastRadioHalTest : public testing::Test {
+ public:
+ void SetUp() override {
+ ::android::base::SetDefaultTag("BcRadioAidlDef.test");
+ const VirtualRadio& amFmRadioMockTest = getAmFmMockTestRadio();
+ mBroadcastRadioHal = ::ndk::SharedRefBase::make<BroadcastRadio>(amFmRadioMockTest);
+ mTunerCallback = ndk::SharedRefBase::make<MockBroadcastRadioCallback>();
+ }
+
+ void TearDown() override {
+ mBroadcastRadioHal->unsetTunerCallback();
+ EXPECT_FALSE(mTunerCallback->isTunerFailed());
+ }
+
+ void verifyUpdatedProgramInfo(const ProgramSelector& sel) {
+ ASSERT_TRUE(mTunerCallback->waitOnCurrentProgramInfoChangedCallback());
+ ProgramInfo infoCb1 = mTunerCallback->getCurrentProgramInfo();
+ mTunerCallback->reset();
+ if (sel.primaryId.type == IdentifierType::HD_STATION_ID_EXT) {
+ EXPECT_TRUE(mTunerCallback->waitOnCurrentProgramInfoChangedCallback());
+ ProgramInfo infoCb2 = mTunerCallback->getCurrentProgramInfo();
+ mTunerCallback->reset();
+ EXPECT_TRUE(mTunerCallback->waitOnCurrentProgramInfoChangedCallback());
+ ProgramInfo infoCb3 = mTunerCallback->getCurrentProgramInfo();
+ mTunerCallback->reset();
+ EXPECT_EQ(infoCb1.selector, sel);
+ EXPECT_EQ(getSignalAcquisitionFlags(infoCb1), 0b001);
+ EXPECT_EQ(infoCb2.selector, sel);
+ EXPECT_EQ(getSignalAcquisitionFlags(infoCb2), 0b011);
+ EXPECT_EQ(infoCb3.selector, sel);
+ EXPECT_EQ(getSignalAcquisitionFlags(infoCb3), 0b111);
+ } else {
+ EXPECT_EQ(infoCb1.selector, sel);
+ }
+ }
+
+ bool getAmFmBandRange(utils::FrequencyBand band, AmFmBandRange* res) {
+ AmFmRegionConfig config;
+ auto halResult = mBroadcastRadioHal->getAmFmRegionConfig(/* full= */ false, &config);
+ if (!halResult.isOk()) {
+ return false;
+ }
+ for (const auto& range : config.ranges) {
+ if (utils::getBand(range.lowerBound) == band) {
+ *res = range;
+ return true;
+ }
+ }
+ return false;
+ }
+
+ std::optional<utils::ProgramInfoSet> getProgramList() {
+ ProgramFilter emptyFilter = {};
+ return getProgramList(emptyFilter);
+ }
+
+ std::optional<utils::ProgramInfoSet> getProgramList(const ProgramFilter& filter) {
+ mTunerCallback->reset();
+
+ auto startResult = mBroadcastRadioHal->startProgramListUpdates(filter);
+
+ EXPECT_TRUE(startResult.isOk());
+
+ if (!startResult.isOk()) {
+ return std::nullopt;
+ }
+ EXPECT_TRUE(mTunerCallback->waitProgramReady());
+
+ auto stopResult = mBroadcastRadioHal->stopProgramListUpdates();
+
+ EXPECT_TRUE(stopResult.isOk());
+
+ return mTunerCallback->getProgramList();
+ }
+
+ void switchToFmBand() {
+ ASSERT_TRUE(mBroadcastRadioHal->setTunerCallback(mTunerCallback).isOk());
+ mTunerCallback->reset();
+ ASSERT_TRUE(mBroadcastRadioHal->tune(kFmSel1).isOk());
+ verifyUpdatedProgramInfo(kFmSel1);
+ }
+
+ std::shared_ptr<BroadcastRadio> mBroadcastRadioHal;
+ std::shared_ptr<MockBroadcastRadioCallback> mTunerCallback;
+};
+
+TEST_F(DefaultBroadcastRadioHalTest, GetAmFmRegionConfig) {
+ AmFmRegionConfig config;
+
+ auto halResult = mBroadcastRadioHal->getAmFmRegionConfig(/* full= */ false, &config);
+
+ ASSERT_TRUE(halResult.isOk());
+ EXPECT_EQ(config.fmDeemphasis, AmFmRegionConfig::DEEMPHASIS_D50);
+ EXPECT_EQ(config.fmRds, AmFmRegionConfig::RDS);
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, GetAmFmRegionConfigWithFullBand) {
+ AmFmRegionConfig config;
+
+ auto halResult = mBroadcastRadioHal->getAmFmRegionConfig(/* full= */ true, &config);
+
+ ASSERT_TRUE(halResult.isOk());
+ EXPECT_EQ(config.fmDeemphasis,
+ AmFmRegionConfig::DEEMPHASIS_D50 | AmFmRegionConfig::DEEMPHASIS_D75);
+ EXPECT_EQ(config.fmRds, AmFmRegionConfig::RDS | AmFmRegionConfig::RBDS);
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, GetDabRegionConfig) {
+ vector<DabTableEntry> config;
+
+ auto halResult = mBroadcastRadioHal->getDabRegionConfig(&config);
+
+ ASSERT_TRUE(halResult.isOk());
+ ASSERT_FALSE(config.empty());
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, GetImage) {
+ vector<uint8_t> img;
+
+ auto halResult = mBroadcastRadioHal->getImage(BroadcastRadio::INVALID_IMAGE, &img);
+
+ ASSERT_TRUE(halResult.isOk());
+ ASSERT_TRUE(img.empty());
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, GetProperties) {
+ vector<VirtualProgram> mockPrograms = getAmFmMockTestRadio().getProgramList();
+ Properties prop;
+
+ auto halResult = mBroadcastRadioHal->getProperties(&prop);
+
+ ASSERT_TRUE(halResult.isOk());
+ ASSERT_FALSE(prop.supportedIdentifierTypes.empty());
+ std::unordered_set<IdentifierType> supportedTypeSet;
+ for (const auto& supportedType : prop.supportedIdentifierTypes) {
+ supportedTypeSet.insert(supportedType);
+ }
+ for (const auto& program : mockPrograms) {
+ EXPECT_NE(supportedTypeSet.find(program.selector.primaryId.type), supportedTypeSet.end());
+ }
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, SetTunerCallback) {
+ auto halResult = mBroadcastRadioHal->setTunerCallback(mTunerCallback);
+
+ ASSERT_TRUE(halResult.isOk());
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, SetTunerCallbackWithNull) {
+ auto halResult = mBroadcastRadioHal->setTunerCallback(nullptr);
+
+ ASSERT_EQ(halResult.getServiceSpecificError(), utils::resultToInt(Result::INVALID_ARGUMENTS));
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, UnsetTunerCallbackWithNull) {
+ ASSERT_TRUE(mBroadcastRadioHal->setTunerCallback(mTunerCallback).isOk());
+
+ auto halResult = mBroadcastRadioHal->unsetTunerCallback();
+
+ ASSERT_TRUE(halResult.isOk());
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, TuneWithAmFmSelectorInProgramList) {
+ ASSERT_TRUE(mBroadcastRadioHal->setTunerCallback(mTunerCallback).isOk());
+ mTunerCallback->reset();
+
+ auto halResult = mBroadcastRadioHal->tune(kFmSel1);
+
+ ASSERT_TRUE(halResult.isOk());
+ ASSERT_TRUE(mTunerCallback->waitOnCurrentProgramInfoChangedCallback());
+ ProgramInfo infoCb = mTunerCallback->getCurrentProgramInfo();
+ EXPECT_EQ(infoCb.selector, kFmSel1);
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, TuneWithHdSelectorInProgramList) {
+ ASSERT_TRUE(mBroadcastRadioHal->setTunerCallback(mTunerCallback).isOk());
+ mTunerCallback->reset();
+
+ auto halResult = mBroadcastRadioHal->tune(kFmHdFreq1Sel2);
+
+ ASSERT_TRUE(halResult.isOk());
+ verifyUpdatedProgramInfo(kFmHdFreq1Sel2);
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, TuneWitFrequencyOfHdProgramInProgramList) {
+ ASSERT_TRUE(mBroadcastRadioHal->setTunerCallback(mTunerCallback).isOk());
+ mTunerCallback->reset();
+
+ auto halResult = mBroadcastRadioHal->tune(
+ utils::makeSelectorAmfm(utils::getHdFrequency(kFmHdFreq1Sel1)));
+
+ ASSERT_TRUE(halResult.isOk());
+ verifyUpdatedProgramInfo(kFmHdFreq1Sel1);
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, TuneWithInvalidSelector) {
+ ASSERT_TRUE(mBroadcastRadioHal->setTunerCallback(mTunerCallback).isOk());
+ ProgramSelector invalidSelector = {utils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, 0),
+ {}};
+
+ auto halResult = mBroadcastRadioHal->tune(invalidSelector);
+
+ ASSERT_EQ(halResult.getServiceSpecificError(), utils::resultToInt(Result::INVALID_ARGUMENTS));
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, TuneWithoutTunerCallback) {
+ auto halResult = mBroadcastRadioHal->tune(kFmSel1);
+
+ ASSERT_EQ(halResult.getServiceSpecificError(), utils::resultToInt(Result::INVALID_STATE));
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, StepUp) {
+ AmFmBandRange fmRange;
+ ASSERT_TRUE(getAmFmBandRange(utils::FrequencyBand::FM, &fmRange));
+ ProgramSelector nextChannelSel =
+ utils::makeSelectorAmfm(kFmSel1.primaryId.value + fmRange.spacing);
+ ASSERT_TRUE(mBroadcastRadioHal->setTunerCallback(mTunerCallback).isOk());
+ mTunerCallback->reset();
+ ASSERT_TRUE(mBroadcastRadioHal->tune(kFmSel1).isOk());
+ verifyUpdatedProgramInfo(kFmSel1);
+
+ auto halResult = mBroadcastRadioHal->step(/* in_directionUp= */ true);
+
+ ASSERT_TRUE(halResult.isOk());
+ verifyUpdatedProgramInfo(nextChannelSel);
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, StepUpFromUpperBound) {
+ AmFmBandRange fmRange;
+ ASSERT_TRUE(getAmFmBandRange(utils::FrequencyBand::FM, &fmRange));
+ ProgramSelector upperBoundSel = utils::makeSelectorAmfm(fmRange.upperBound);
+ ProgramSelector lowerBoundSel = utils::makeSelectorAmfm(fmRange.lowerBound);
+ ASSERT_TRUE(mBroadcastRadioHal->setTunerCallback(mTunerCallback).isOk());
+ mTunerCallback->reset();
+ ASSERT_TRUE(mBroadcastRadioHal->tune(upperBoundSel).isOk());
+ verifyUpdatedProgramInfo(upperBoundSel);
+
+ auto halResult = mBroadcastRadioHal->step(/* in_directionUp= */ true);
+
+ ASSERT_TRUE(halResult.isOk());
+ verifyUpdatedProgramInfo(lowerBoundSel);
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, StepDown) {
+ AmFmBandRange fmRange;
+ ASSERT_TRUE(getAmFmBandRange(utils::FrequencyBand::FM, &fmRange));
+ ProgramSelector nextChannelSel =
+ utils::makeSelectorAmfm(kFmSel1.primaryId.value - fmRange.spacing);
+ ASSERT_TRUE(mBroadcastRadioHal->setTunerCallback(mTunerCallback).isOk());
+ mTunerCallback->reset();
+ ASSERT_TRUE(mBroadcastRadioHal->tune(kFmSel1).isOk());
+ verifyUpdatedProgramInfo(kFmSel1);
+
+ auto halResult = mBroadcastRadioHal->step(/* directionUp= */ false);
+
+ ASSERT_TRUE(halResult.isOk());
+ verifyUpdatedProgramInfo(nextChannelSel);
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, StepDownFromLowerBound) {
+ AmFmBandRange fmRange;
+ ASSERT_TRUE(getAmFmBandRange(utils::FrequencyBand::FM, &fmRange));
+ ProgramSelector upperBoundSel = utils::makeSelectorAmfm(fmRange.upperBound);
+ ProgramSelector lowerBoundSel = utils::makeSelectorAmfm(fmRange.lowerBound);
+ ASSERT_TRUE(mBroadcastRadioHal->setTunerCallback(mTunerCallback).isOk());
+ mTunerCallback->reset();
+ ASSERT_TRUE(mBroadcastRadioHal->tune(lowerBoundSel).isOk());
+ verifyUpdatedProgramInfo(lowerBoundSel);
+
+ auto halResult = mBroadcastRadioHal->step(/* directionUp= */ false);
+
+ ASSERT_TRUE(halResult.isOk());
+ verifyUpdatedProgramInfo(upperBoundSel);
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, StepWithoutTunerCallback) {
+ switchToFmBand();
+ mBroadcastRadioHal->unsetTunerCallback();
+
+ auto halResult = mBroadcastRadioHal->step(/* directionUp= */ false);
+
+ ASSERT_EQ(halResult.getServiceSpecificError(), utils::resultToInt(Result::INVALID_STATE));
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, SeekUpWithoutSkipSubchannel) {
+ ASSERT_TRUE(mBroadcastRadioHal->setTunerCallback(mTunerCallback).isOk());
+ mTunerCallback->reset();
+ ASSERT_TRUE(mBroadcastRadioHal->tune(kFmHdFreq1Sel1).isOk());
+ verifyUpdatedProgramInfo(kFmHdFreq1Sel1);
+
+ auto halResult = mBroadcastRadioHal->seek(/* directionUp= */ true, /* skipSubChannel= */ false);
+
+ ASSERT_TRUE(halResult.isOk());
+ verifyUpdatedProgramInfo(kFmHdFreq1Sel2);
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, SeekUpWithSkipSubchannel) {
+ ASSERT_TRUE(mBroadcastRadioHal->setTunerCallback(mTunerCallback).isOk());
+ mTunerCallback->reset();
+ ASSERT_TRUE(mBroadcastRadioHal->tune(kFmHdFreq1Sel1).isOk());
+ verifyUpdatedProgramInfo(kFmHdFreq1Sel1);
+
+ auto halResult = mBroadcastRadioHal->seek(/* directionUp= */ true, /* skipSubChannel= */ true);
+
+ ASSERT_TRUE(halResult.isOk());
+ verifyUpdatedProgramInfo(kFmSel2);
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, SeekUpFromLastProgramInProgramList) {
+ ASSERT_TRUE(mBroadcastRadioHal->setTunerCallback(mTunerCallback).isOk());
+ mTunerCallback->reset();
+ ASSERT_TRUE(mBroadcastRadioHal->tune(kFmHdFreq2Sel1).isOk());
+ verifyUpdatedProgramInfo(kFmHdFreq2Sel1);
+
+ auto halResult = mBroadcastRadioHal->seek(/* directionUp= */ true, /* skipSubChannel= */ true);
+
+ ASSERT_TRUE(halResult.isOk());
+ verifyUpdatedProgramInfo(kFmSel1);
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, SeekDownWithoutSkipSubchannel) {
+ ASSERT_TRUE(mBroadcastRadioHal->setTunerCallback(mTunerCallback).isOk());
+ mTunerCallback->reset();
+ ASSERT_TRUE(mBroadcastRadioHal->tune(kFmHdFreq1Sel2).isOk());
+ verifyUpdatedProgramInfo(kFmHdFreq1Sel2);
+
+ auto halResult =
+ mBroadcastRadioHal->seek(/* directionUp= */ false, /* skipSubChannel= */ false);
+
+ ASSERT_TRUE(halResult.isOk());
+ verifyUpdatedProgramInfo(kFmHdFreq1Sel1);
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, SeekDownWithSkipSubchannel) {
+ ASSERT_TRUE(mBroadcastRadioHal->setTunerCallback(mTunerCallback).isOk());
+ mTunerCallback->reset();
+ ASSERT_TRUE(mBroadcastRadioHal->tune(kFmHdFreq1Sel2).isOk());
+ verifyUpdatedProgramInfo(kFmHdFreq1Sel2);
+
+ auto halResult = mBroadcastRadioHal->seek(/* directionUp= */ false, /* skipSubChannel= */ true);
+
+ ASSERT_TRUE(halResult.isOk());
+ verifyUpdatedProgramInfo(kFmSel1);
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, SeekDownWithFirstProgramInProgramList) {
+ switchToFmBand();
+
+ auto halResult = mBroadcastRadioHal->seek(/* directionUp= */ false, /* skipSubChannel= */ true);
+
+ ASSERT_TRUE(halResult.isOk());
+ verifyUpdatedProgramInfo(kFmHdFreq2Sel1);
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, SeekWithoutTunerCallback) {
+ switchToFmBand();
+ mBroadcastRadioHal->unsetTunerCallback();
+
+ auto halResult = mBroadcastRadioHal->seek(/* directionUp= */ false, /* skipSubChannel= */ true);
+
+ ASSERT_EQ(halResult.getServiceSpecificError(), utils::resultToInt(Result::INVALID_STATE));
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, Cancel) {
+ ASSERT_TRUE(mBroadcastRadioHal->setTunerCallback(mTunerCallback).isOk());
+ mTunerCallback->reset();
+ ASSERT_TRUE(mBroadcastRadioHal->tune(kFmSel1).isOk());
+
+ auto halResult = mBroadcastRadioHal->cancel();
+
+ ASSERT_TRUE(halResult.isOk());
+ mTunerCallback->reset();
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, StartProgramListUpdatesWithEmptyFilter) {
+ switchToFmBand();
+
+ auto programList = getProgramList();
+
+ ASSERT_TRUE(programList.has_value());
+ for (auto it = programList->begin(); it != programList->end(); it++) {
+ EXPECT_EQ(utils::getBand(utils::getAmFmFrequency(it->selector)), utils::FrequencyBand::FM);
+ }
+}
+
+TEST_F(DefaultBroadcastRadioHalTest, StartProgramListUpdatesWithAmFmFilter) {
+ ProgramFilter amFmFilter = {.identifierTypes = {IdentifierType::AMFM_FREQUENCY_KHZ},
+ .identifiers = {},
+ .includeCategories = false,
+ .excludeModifications = false};
+ switchToFmBand();
+
+ auto programList = getProgramList(amFmFilter);
+
+ ASSERT_TRUE(programList.has_value());
+ for (auto it = programList->begin(); it != programList->end(); it++) {
+ EXPECT_TRUE(utils::hasId(it->selector, IdentifierType::AMFM_FREQUENCY_KHZ));
+ EXPECT_EQ(utils::getBand(utils::getAmFmFrequency(it->selector)), utils::FrequencyBand::FM);
+ }
+}
+
+} // namespace aidl::android::hardware::broadcastradio
diff --git a/broadcastradio/aidl/default/test/MockBroadcastRadioCallback.cpp b/broadcastradio/aidl/default/test/MockBroadcastRadioCallback.cpp
new file mode 100644
index 0000000..963f8bf
--- /dev/null
+++ b/broadcastradio/aidl/default/test/MockBroadcastRadioCallback.cpp
@@ -0,0 +1,111 @@
+/*
+ * Copyright (C) 2024 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 "MockBroadcastRadioCallback.h"
+
+#include <android-base/logging.h>
+
+namespace aidl::android::hardware::broadcastradio {
+
+namespace {
+using std::vector;
+}
+
+MockBroadcastRadioCallback::MockBroadcastRadioCallback() {
+ mAntennaConnectionState = true;
+}
+
+ScopedAStatus MockBroadcastRadioCallback::onTuneFailed(Result result,
+ const ProgramSelector& selector) {
+ LOG(DEBUG) << "onTuneFailed with result with " << selector.toString().c_str();
+ if (result != Result::CANCELED) {
+ std::lock_guard<std::mutex> lk(mLock);
+ tunerFailed = true;
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ScopedAStatus MockBroadcastRadioCallback::onCurrentProgramInfoChanged(const ProgramInfo& info) {
+ LOG(DEBUG) << "onCurrentProgramInfoChanged with " << info.toString().c_str();
+ {
+ std::lock_guard<std::mutex> lk(mLock);
+ mCurrentProgramInfo = info;
+ }
+
+ mOnCurrentProgramInfoChangedFlag.notify();
+ return ndk::ScopedAStatus::ok();
+}
+
+ScopedAStatus MockBroadcastRadioCallback::onProgramListUpdated(const ProgramListChunk& chunk) {
+ {
+ std::lock_guard<std::mutex> lk(mLock);
+ updateProgramList(chunk, &mProgramList);
+ }
+
+ if (chunk.complete) {
+ mOnProgramListReadyFlag.notify();
+ }
+
+ return ndk::ScopedAStatus::ok();
+}
+
+ScopedAStatus MockBroadcastRadioCallback::onParametersUpdated(
+ [[maybe_unused]] const vector<VendorKeyValue>& parameters) {
+ return ndk::ScopedAStatus::ok();
+}
+
+ScopedAStatus MockBroadcastRadioCallback::onAntennaStateChange(bool connected) {
+ if (!connected) {
+ std::lock_guard<std::mutex> lk(mLock);
+ mAntennaConnectionState = false;
+ }
+ return ndk::ScopedAStatus::ok();
+}
+
+ScopedAStatus MockBroadcastRadioCallback::onConfigFlagUpdated([[maybe_unused]] ConfigFlag in_flag,
+ [[maybe_unused]] bool in_value) {
+ return ndk::ScopedAStatus::ok();
+}
+
+bool MockBroadcastRadioCallback::waitOnCurrentProgramInfoChangedCallback() {
+ return mOnCurrentProgramInfoChangedFlag.wait();
+}
+
+bool MockBroadcastRadioCallback::waitProgramReady() {
+ return mOnProgramListReadyFlag.wait();
+}
+
+void MockBroadcastRadioCallback::reset() {
+ mOnCurrentProgramInfoChangedFlag.reset();
+ mOnProgramListReadyFlag.reset();
+}
+
+bool MockBroadcastRadioCallback::isTunerFailed() {
+ std::lock_guard<std::mutex> lk(mLock);
+ return tunerFailed;
+}
+
+ProgramInfo MockBroadcastRadioCallback::getCurrentProgramInfo() {
+ std::lock_guard<std::mutex> lk(mLock);
+ return mCurrentProgramInfo;
+}
+
+utils::ProgramInfoSet MockBroadcastRadioCallback::getProgramList() {
+ std::lock_guard<std::mutex> lk(mLock);
+ return mProgramList;
+}
+
+} // namespace aidl::android::hardware::broadcastradio
diff --git a/broadcastradio/aidl/default/test/MockBroadcastRadioCallback.h b/broadcastradio/aidl/default/test/MockBroadcastRadioCallback.h
new file mode 100644
index 0000000..4415842
--- /dev/null
+++ b/broadcastradio/aidl/default/test/MockBroadcastRadioCallback.h
@@ -0,0 +1,106 @@
+/*
+ * Copyright (C) 2024 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/broadcastradio/BnTunerCallback.h>
+#include <aidl/android/hardware/broadcastradio/ConfigFlag.h>
+#include <aidl/android/hardware/broadcastradio/IBroadcastRadio.h>
+#include <aidl/android/hardware/broadcastradio/ProgramInfo.h>
+#include <aidl/android/hardware/broadcastradio/ProgramListChunk.h>
+#include <aidl/android/hardware/broadcastradio/ProgramSelector.h>
+#include <aidl/android/hardware/broadcastradio/Result.h>
+#include <aidl/android/hardware/broadcastradio/VendorKeyValue.h>
+
+#include <android-base/thread_annotations.h>
+
+#include <broadcastradio-utils-aidl/Utils.h>
+
+#include <condition_variable>
+
+namespace aidl::android::hardware::broadcastradio {
+
+namespace {
+using ::ndk::ScopedAStatus;
+
+} // namespace
+
+class MockBroadcastRadioCallback final : public BnTunerCallback {
+ public:
+ explicit MockBroadcastRadioCallback();
+ ScopedAStatus onTuneFailed(Result result, const ProgramSelector& selector) override;
+ ScopedAStatus onCurrentProgramInfoChanged(const ProgramInfo& info) override;
+ ScopedAStatus onProgramListUpdated(const ProgramListChunk& chunk) override;
+ ScopedAStatus onParametersUpdated(const std::vector<VendorKeyValue>& parameters) override;
+ ScopedAStatus onAntennaStateChange(bool connected) override;
+ ScopedAStatus onConfigFlagUpdated(ConfigFlag in_flag, bool in_value) override;
+
+ bool waitOnCurrentProgramInfoChangedCallback();
+ bool waitProgramReady();
+ bool isTunerFailed();
+ void reset();
+
+ ProgramInfo getCurrentProgramInfo();
+ utils::ProgramInfoSet getProgramList();
+
+ private:
+ class CallbackFlag final {
+ public:
+ CallbackFlag(int timeoutMs) { mTimeoutMs = timeoutMs; }
+ /**
+ * Notify that the callback is called.
+ */
+ void notify() {
+ std::unique_lock<std::mutex> lock(mMutex);
+ mCalled = true;
+ lock.unlock();
+ mCv.notify_all();
+ };
+
+ /**
+ * Wait for the timeout passed into the constructor.
+ */
+ bool wait() {
+ std::unique_lock<std::mutex> lock(mMutex);
+ return mCv.wait_for(lock, std::chrono::milliseconds(mTimeoutMs),
+ [this] { return mCalled; });
+ };
+
+ /**
+ * Reset the callback to not called.
+ */
+ void reset() {
+ std::unique_lock<std::mutex> lock(mMutex);
+ mCalled = false;
+ }
+
+ private:
+ std::mutex mMutex;
+ bool mCalled GUARDED_BY(mMutex) = false;
+ std::condition_variable mCv;
+ int mTimeoutMs;
+ };
+
+ std::mutex mLock;
+ bool mAntennaConnectionState GUARDED_BY(mLock);
+ bool tunerFailed GUARDED_BY(mLock) = false;
+ ProgramInfo mCurrentProgramInfo GUARDED_BY(mLock);
+ utils::ProgramInfoSet mProgramList GUARDED_BY(mLock);
+ CallbackFlag mOnCurrentProgramInfoChangedFlag = CallbackFlag(IBroadcastRadio::TUNER_TIMEOUT_MS);
+ CallbackFlag mOnProgramListReadyFlag = CallbackFlag(IBroadcastRadio::LIST_COMPLETE_TIMEOUT_MS);
+};
+
+} // namespace aidl::android::hardware::broadcastradio
diff --git a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp
index 2668a97..9633ebb 100644
--- a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp
+++ b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp
@@ -35,6 +35,7 @@
#include <broadcastradio-utils-aidl/UtilsV2.h>
#include <cutils/bitops.h>
#include <gmock/gmock.h>
+#include <gtest/gtest.h>
#include <chrono>
#include <condition_variable>
@@ -76,12 +77,6 @@
constexpr int32_t kAidlVersion1 = 1;
constexpr int32_t kAidlVersion2 = 2;
-void printSkipped(const std::string& msg) {
- const auto testInfo = testing::UnitTest::GetInstance()->current_test_info();
- LOG(INFO) << "[ SKIPPED ] " << testInfo->test_case_name() << "." << testInfo->name()
- << " with message: " << msg;
-}
-
bool isValidAmFmFreq(int64_t freq, int aidlVersion) {
ProgramIdentifier id = bcutils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, freq);
if (aidlVersion == kAidlVersion1) {
@@ -255,6 +250,16 @@
}
}
+ for (const auto& metadataItem : info.metadata) {
+ bool validMetadata = false;
+ if (mCallbackAidlVersion == kAidlVersion1) {
+ validMetadata = bcutils::isValidMetadata(metadataItem);
+ } else {
+ validMetadata = bcutils::isValidMetadataV2(metadataItem);
+ }
+ EXPECT_TRUE(validMetadata) << "Invalid metadata " << metadataItem.toString().c_str();
+ }
+
{
std::lock_guard<std::mutex> lk(mLock);
mCurrentProgramInfo = info;
@@ -385,7 +390,7 @@
auto startResult = mModule->startProgramListUpdates(filter);
if (startResult.getServiceSpecificError() == resultToInt(Result::NOT_SUPPORTED)) {
- printSkipped("Program list not supported");
+ LOG(WARNING) << "Program list not supported";
return std::nullopt;
}
EXPECT_TRUE(startResult.isOk());
@@ -430,8 +435,7 @@
bool supported = getAmFmRegionConfig(/* full= */ false, &config);
if (!supported) {
- printSkipped("AM/FM not supported");
- return;
+ GTEST_SKIP() << "AM/FM not supported";
}
EXPECT_LE(popcountll(static_cast<unsigned long long>(config.fmDeemphasis)), 1);
@@ -459,8 +463,7 @@
bool supported = getAmFmRegionConfig(/* full= */ false, &config);
if (!supported) {
- printSkipped("AM/FM not supported");
- return;
+ GTEST_SKIP() << "AM/FM not supported";
}
EXPECT_GT(config.ranges.size(), 0u);
@@ -488,7 +491,7 @@
if (supported && supportsFM(config)) {
EXPECT_GE(popcountll(static_cast<unsigned long long>(config.fmDeemphasis)), 1);
} else {
- printSkipped("FM not supported");
+ GTEST_SKIP() << "FM not supported";
}
}
@@ -509,8 +512,7 @@
bool supported = getAmFmRegionConfig(/* full= */ true, &config);
if (!supported) {
- printSkipped("AM/FM not supported");
- return;
+ GTEST_SKIP() << "AM/FM not supported";
}
EXPECT_GT(config.ranges.size(), 0u);
@@ -536,8 +538,7 @@
auto halResult = mModule->getDabRegionConfig(&config);
if (halResult.getServiceSpecificError() == resultToInt(Result::NOT_SUPPORTED)) {
- printSkipped("DAB not supported");
- return;
+ GTEST_SKIP() << "DAB not supported";
}
ASSERT_TRUE(halResult.isOk());
@@ -671,7 +672,7 @@
* - if it is supported, the method succeeds;
* - after a successful tune call, onCurrentProgramInfoChanged callback is
* invoked carrying a proper selector;
- * - program changes exactly to what was requested.
+ * - program changes to a program info with the program selector requested.
*/
TEST_P(BroadcastRadioHalTest, FmTune) {
LOG(DEBUG) << "FmTune Test";
@@ -715,8 +716,7 @@
LOG(DEBUG) << "HdTune Test";
auto programList = getProgramList();
if (!programList) {
- printSkipped("Empty station list, tune cannot be performed");
- return;
+ GTEST_SKIP() << "Empty station list, tune cannot be performed";
}
ProgramSelector hdSel = {};
ProgramIdentifier physicallyTunedToExpected = {};
@@ -732,8 +732,7 @@
break;
}
if (!hdStationPresent) {
- printSkipped("No HD stations in the list, tune cannot be performed");
- return;
+ GTEST_SKIP() << "No HD stations in the list, tune cannot be performed";
}
// try tuning
@@ -762,7 +761,7 @@
* - if it is supported, the method succeeds;
* - after a successful tune call, onCurrentProgramInfoChanged callback is
* invoked carrying a proper selector;
- * - program changes exactly to what was requested.
+ * - program changes to a program info with the program selector requested.
*/
TEST_P(BroadcastRadioHalTest, DabTune) {
LOG(DEBUG) << "DabTune Test";
@@ -771,8 +770,7 @@
auto halResult = mModule->getDabRegionConfig(&config);
if (halResult.getServiceSpecificError() == resultToInt(Result::NOT_SUPPORTED)) {
- printSkipped("DAB not supported");
- return;
+ GTEST_SKIP() << "DAB not supported";
}
ASSERT_TRUE(halResult.isOk());
ASSERT_NE(config.size(), 0U);
@@ -780,8 +778,7 @@
auto programList = getProgramList();
if (!programList) {
- printSkipped("Empty DAB station list, tune cannot be performed");
- return;
+ GTEST_SKIP() << "Empty DAB station list, tune cannot be performed";
}
ProgramSelector sel = {};
@@ -811,8 +808,7 @@
}
if (!dabStationPresent) {
- printSkipped("No DAB stations in the list, tune cannot be performed");
- return;
+ GTEST_SKIP() << "No DAB stations in the list, tune cannot be performed";
}
// try tuning
@@ -844,7 +840,7 @@
* Verifies that:
* - the method succeeds;
* - the program info is changed within kTuneTimeoutMs;
- * - works both directions and with or without skipping sub-channel.
+ * - works both directions and with or without ing sub-channel.
*/
TEST_P(BroadcastRadioHalTest, Seek) {
LOG(DEBUG) << "Seek Test";
@@ -854,8 +850,7 @@
auto result = mModule->seek(/* in_directionUp= */ true, /* in_skipSubChannel= */ true);
if (result.getServiceSpecificError() == resultToInt(Result::NOT_SUPPORTED)) {
- printSkipped("Seek not supported");
- return;
+ GTEST_SKIP() << "Seek not supported";
}
EXPECT_TRUE(result.isOk());
@@ -905,8 +900,7 @@
auto result = mModule->step(/* in_directionUp= */ true);
if (result.getServiceSpecificError() == resultToInt(Result::NOT_SUPPORTED)) {
- printSkipped("Step not supported");
- return;
+ GTEST_SKIP() << "Step not supported";
}
EXPECT_TRUE(result.isOk());
EXPECT_TRUE(mCallback->waitOnCurrentProgramInfoChangedCallback());
@@ -957,8 +951,7 @@
auto result = mModule->seek(/* in_directionUp= */ true, /* in_skipSubChannel= */ true);
if (result.getServiceSpecificError() == notSupportedError) {
- printSkipped("Cancel is skipped because of seek not supported");
- return;
+ GTEST_SKIP() << "Cancel is skipped because of seek not supported";
}
EXPECT_TRUE(result.isOk());
@@ -1152,8 +1145,7 @@
std::optional<bcutils::ProgramInfoSet> completeList = getProgramList();
if (!completeList) {
- printSkipped("No program list available");
- return;
+ GTEST_SKIP() << "No program list available";
}
ProgramFilter amfmFilter = {};
@@ -1178,8 +1170,7 @@
}
if (expectedResultSize == 0) {
- printSkipped("No Am/FM programs available");
- return;
+ GTEST_SKIP() << "No Am/FM programs available";
}
std::optional<bcutils::ProgramInfoSet> amfmList = getProgramList(amfmFilter);
ASSERT_EQ(amfmList->size(), expectedResultSize) << "amfm filter result size is wrong";
@@ -1200,8 +1191,7 @@
std::optional<bcutils::ProgramInfoSet> completeList = getProgramList();
if (!completeList) {
- printSkipped("No program list available");
- return;
+ GTEST_SKIP() << "No program list available";
}
ProgramFilter dabFilter = {};
@@ -1225,8 +1215,7 @@
}
if (expectedResultSize == 0) {
- printSkipped("No DAB programs available");
- return;
+ GTEST_SKIP() << "No DAB programs available";
}
std::optional<bcutils::ProgramInfoSet> dabList = getProgramList(dabFilter);
ASSERT_EQ(dabList->size(), expectedResultSize) << "dab filter result size is wrong";
@@ -1245,8 +1234,7 @@
std::optional<bcutils::ProgramInfoSet> list = getProgramList();
if (!list) {
- printSkipped("No program list");
- return;
+ GTEST_SKIP() << "No program list";
}
for (const auto& program : *list) {
@@ -1297,8 +1285,7 @@
if (halResult.getServiceSpecificError() == resultToInt(Result::NOT_SUPPORTED)) {
ASSERT_EQ(closeHandle.get(), nullptr);
- printSkipped("Announcements not supported");
- return;
+ GTEST_SKIP() << "Announcements not supported";
}
ASSERT_TRUE(halResult.isOk());
diff --git a/broadcastradio/common/tests/Android.bp b/broadcastradio/common/tests/Android.bp
index 0a6a3a2..1ea4e85 100644
--- a/broadcastradio/common/tests/Android.bp
+++ b/broadcastradio/common/tests/Android.bp
@@ -86,4 +86,7 @@
],
static_libs: ["android.hardware.broadcastradio@common-utils-lib"],
test_suites: ["general-tests"],
+ shared_libs: [
+ "libbase",
+ ],
}
diff --git a/broadcastradio/common/utils/WorkerThread.cpp b/broadcastradio/common/utils/WorkerThread.cpp
index 43fd04a..5c8e59c 100644
--- a/broadcastradio/common/utils/WorkerThread.cpp
+++ b/broadcastradio/common/utils/WorkerThread.cpp
@@ -69,8 +69,11 @@
}
void WorkerThread::threadLoop() {
- while (!mIsTerminating) {
+ while (true) {
unique_lock<mutex> lk(mMut);
+ if (mIsTerminating) {
+ return;
+ }
if (mTasks.empty()) {
mCond.wait(lk);
continue;
diff --git a/broadcastradio/common/utils/include/broadcastradio-utils/WorkerThread.h b/broadcastradio/common/utils/include/broadcastradio-utils/WorkerThread.h
index 457b57e..e381f5a 100644
--- a/broadcastradio/common/utils/include/broadcastradio-utils/WorkerThread.h
+++ b/broadcastradio/common/utils/include/broadcastradio-utils/WorkerThread.h
@@ -20,6 +20,8 @@
#include <queue>
#include <thread>
+#include <android-base/thread_annotations.h>
+
namespace android {
class WorkerThread {
@@ -40,11 +42,11 @@
};
friend bool operator<(const Task& lhs, const Task& rhs);
- std::atomic<bool> mIsTerminating;
std::mutex mMut;
- std::condition_variable mCond;
+ bool mIsTerminating GUARDED_BY(mMut);
+ std::condition_variable mCond GUARDED_BY(mMut);
std::thread mThread;
- std::priority_queue<Task> mTasks;
+ std::priority_queue<Task> mTasks GUARDED_BY(mMut);
void threadLoop();
};
diff --git a/broadcastradio/common/utilsaidl/Android.bp b/broadcastradio/common/utilsaidl/Android.bp
index 4ec635b..e3bdfdd 100644
--- a/broadcastradio/common/utilsaidl/Android.bp
+++ b/broadcastradio/common/utilsaidl/Android.bp
@@ -20,13 +20,14 @@
// all of the 'license_kinds' from "hardware_interfaces_license"
// to get the below license kinds:
// SPDX-license-identifier-Apache-2.0
+ default_team: "trendy_team_aaos_framework",
default_applicable_licenses: ["hardware_interfaces_license"],
}
cc_library_static {
name: "android.hardware.broadcastradio@common-utils-aidl-lib",
defaults: [
- "VtsBroadcastRadioDefaults",
+ "BroadcastRadioUtilsDefaults",
],
shared_libs: [
"android.hardware.broadcastradio-V1-ndk",
@@ -36,7 +37,7 @@
cc_library_static {
name: "android.hardware.broadcastradio@common-utils-aidl-lib-V2",
defaults: [
- "VtsBroadcastRadioDefaults",
+ "BroadcastRadioUtilsDefaults",
],
srcs: [
"src/UtilsV2.cpp",
@@ -46,8 +47,23 @@
],
}
+cc_test {
+ name: "broadcastradio_utils_aidl_test",
+ defaults: [
+ "BroadcastRadioUtilsDefaults",
+ ],
+ srcs: [
+ "test/*.cpp",
+ ],
+ static_libs: [
+ "android.hardware.broadcastradio@common-utils-aidl-lib-V2",
+ "android.hardware.broadcastradio-V2-ndk",
+ ],
+ test_suites: ["general-tests"],
+}
+
cc_defaults {
- name: "VtsBroadcastRadioDefaults",
+ name: "BroadcastRadioUtilsDefaults",
vendor_available: true,
relative_install_path: "hw",
cflags: [
diff --git a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h
index 3ced685..25c96d0 100644
--- a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h
+++ b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/Utils.h
@@ -143,6 +143,8 @@
bool satisfies(const ProgramFilter& filter, const ProgramSelector& sel);
+bool isValidMetadata(const Metadata& metadata);
+
struct ProgramSelectorComparator {
bool operator()(const ProgramSelector& lhs, const ProgramSelector& rhs) const;
};
diff --git a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/UtilsV2.h b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/UtilsV2.h
index e411aa4..734758d 100644
--- a/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/UtilsV2.h
+++ b/broadcastradio/common/utilsaidl/include/broadcastradio-utils-aidl/UtilsV2.h
@@ -28,6 +28,7 @@
bool isValidV2(const ProgramIdentifier& id);
bool isValidV2(const ProgramSelector& sel);
+bool isValidMetadataV2(const Metadata& metadata);
std::optional<std::string> getMetadataStringV2(const ProgramInfo& info, const Metadata::Tag& tag);
} // namespace utils
diff --git a/broadcastradio/common/utilsaidl/src/Utils.cpp b/broadcastradio/common/utilsaidl/src/Utils.cpp
index b647442..ddc5b8d 100644
--- a/broadcastradio/common/utilsaidl/src/Utils.cpp
+++ b/broadcastradio/common/utilsaidl/src/Utils.cpp
@@ -442,9 +442,9 @@
}
std::optional<std::string> getMetadataString(const ProgramInfo& info, const Metadata::Tag& tag) {
- auto isRdsPs = [tag](const Metadata& item) { return item.getTag() == tag; };
+ auto hasMetadataType = [tag](const Metadata& item) { return item.getTag() == tag; };
- auto it = std::find_if(info.metadata.begin(), info.metadata.end(), isRdsPs);
+ auto it = std::find_if(info.metadata.begin(), info.metadata.end(), hasMetadataType);
if (it == info.metadata.end()) {
return std::nullopt;
}
@@ -579,6 +579,45 @@
return getHdFrequency(sel);
}
+bool isValidMetadata(const Metadata& metadata) {
+ bool valid = true;
+
+ auto expect = [&valid](bool condition, const std::string& message) {
+ if (!condition) {
+ valid = false;
+ LOG(ERROR) << "metadata not valid, expected " << message;
+ }
+ };
+
+ switch (metadata.getTag()) {
+ case Metadata::rdsPty:
+ expect(metadata.get<Metadata::rdsPty>() >= 0, "RDS PTY >= 0");
+ expect(metadata.get<Metadata::rdsPty>() <= std::numeric_limits<uint8_t>::max(),
+ "8bit RDS PTY");
+ break;
+ case Metadata::rbdsPty:
+ expect(metadata.get<Metadata::rbdsPty>() >= 0, "RBDS PTY >= 0");
+ expect(metadata.get<Metadata::rbdsPty>() <= std::numeric_limits<uint8_t>::max(),
+ "8bit RBDS PTY");
+ break;
+ case Metadata::dabEnsembleNameShort:
+ expect(metadata.get<Metadata::dabEnsembleNameShort>().size() <= 8,
+ "Dab ensemble name abbreviated length <= 8");
+ break;
+ case Metadata::dabServiceNameShort:
+ expect(metadata.get<Metadata::dabServiceNameShort>().size() <= 8,
+ "Dab component name abbreviated length <= 8");
+ break;
+ case Metadata::dabComponentNameShort:
+ expect(metadata.get<Metadata::dabComponentNameShort>().size() <= 8,
+ "Dab component name abbreviated length <= 8");
+ break;
+ default:
+ break;
+ }
+ return valid;
+}
+
bool parseArgInt(const std::string& s, int* out) {
return ::android::base::ParseInt(s, out);
}
diff --git a/broadcastradio/common/utilsaidl/src/UtilsV2.cpp b/broadcastradio/common/utilsaidl/src/UtilsV2.cpp
index ef739df..6c75759 100644
--- a/broadcastradio/common/utilsaidl/src/UtilsV2.cpp
+++ b/broadcastradio/common/utilsaidl/src/UtilsV2.cpp
@@ -17,6 +17,7 @@
#define LOG_TAG "BcRadioAidlDef.utilsV2"
#include "broadcastradio-utils-aidl/UtilsV2.h"
+#include "broadcastradio-utils-aidl/Utils.h"
#include <android-base/logging.h>
#include <android-base/strings.h>
@@ -137,10 +138,33 @@
return isValidV2(sel.primaryId);
}
-std::optional<std::string> getMetadataStringV2(const ProgramInfo& info, const Metadata::Tag& tag) {
- auto isRdsPs = [tag](const Metadata& item) { return item.getTag() == tag; };
+bool isValidMetadataV2(const Metadata& metadata) {
+ if (!isValidMetadata(metadata)) {
+ return false;
+ }
- auto it = std::find_if(info.metadata.begin(), info.metadata.end(), isRdsPs);
+ if (metadata.getTag() == Metadata::hdStationNameShort) {
+ if (metadata.get<Metadata::hdStationNameShort>().size() > 12) {
+ LOG(ERROR) << "metadata not valid, expected HD short name length <= 12";
+ return false;
+ }
+ } else if (metadata.getTag() == Metadata::hdSubChannelsAvailable) {
+ if (metadata.get<Metadata::hdSubChannelsAvailable>() < 0) {
+ LOG(ERROR) << "metadata not valid, expected HD subchannels available >= 0";
+ return false;
+ } else if (metadata.get<Metadata::hdSubChannelsAvailable>() >
+ std::numeric_limits<uint8_t>::max()) {
+ LOG(ERROR) << "metadata not valid, expected 8bit HD subchannels available";
+ return false;
+ }
+ }
+ return true;
+}
+
+std::optional<std::string> getMetadataStringV2(const ProgramInfo& info, const Metadata::Tag& tag) {
+ auto hasMetadataType = [tag](const Metadata& item) { return item.getTag() == tag; };
+
+ auto it = std::find_if(info.metadata.begin(), info.metadata.end(), hasMetadataType);
if (it == info.metadata.end()) {
return std::nullopt;
}
diff --git a/broadcastradio/common/utilsaidl/test/BroadcastRadioUtilsTest.cpp b/broadcastradio/common/utilsaidl/test/BroadcastRadioUtilsTest.cpp
new file mode 100644
index 0000000..a5c9073
--- /dev/null
+++ b/broadcastradio/common/utilsaidl/test/BroadcastRadioUtilsTest.cpp
@@ -0,0 +1,811 @@
+/*
+ * Copyright (C) 2024 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 <broadcastradio-utils-aidl/Utils.h>
+#include <gtest/gtest.h>
+
+namespace aidl::android::hardware::broadcastradio {
+
+namespace {
+constexpr int64_t kFmFrequencyKHz = 97900;
+constexpr uint32_t kDabSid = 0x0000C221u;
+constexpr int kDabEccCode = 0xE1u;
+constexpr int kDabSCIdS = 0x1u;
+constexpr uint64_t kDabSidExt = static_cast<uint64_t>(kDabSid) |
+ (static_cast<uint64_t>(kDabEccCode) << 32) |
+ (static_cast<uint64_t>(kDabSCIdS) << 40);
+constexpr uint32_t kDabEnsemble = 0xCE15u;
+constexpr uint64_t kDabFrequencyKhz = 225648u;
+constexpr uint64_t kHdStationId = 0xA0000001u;
+constexpr uint64_t kHdSubChannel = 1u;
+constexpr uint64_t kHdFrequency = 97700u;
+constexpr int64_t kRdsValue = 0xBEEF;
+
+const Properties kAmFmTunerProp = {
+ .maker = "makerTest",
+ .product = "productTest",
+ .supportedIdentifierTypes = {IdentifierType::AMFM_FREQUENCY_KHZ, IdentifierType::RDS_PI,
+ IdentifierType::HD_STATION_ID_EXT}};
+
+struct GetBandTestCase {
+ std::string name;
+ int64_t frequency;
+ utils::FrequencyBand bandResult;
+};
+
+std::vector<GetBandTestCase> getBandTestCases() {
+ return std::vector<GetBandTestCase>(
+ {GetBandTestCase{.name = "unknown_low_band",
+ .frequency = 0,
+ .bandResult = utils::FrequencyBand::UNKNOWN},
+ GetBandTestCase{.name = "am_lw_band",
+ .frequency = 30,
+ .bandResult = utils::FrequencyBand::AM_LW},
+ GetBandTestCase{.name = "am_mw_band",
+ .frequency = 700,
+ .bandResult = utils::FrequencyBand::AM_MW},
+ GetBandTestCase{.name = "am_sw_band",
+ .frequency = 2000,
+ .bandResult = utils::FrequencyBand::AM_SW},
+ GetBandTestCase{
+ .name = "fm_band", .frequency = 97900, .bandResult = utils::FrequencyBand::FM},
+ GetBandTestCase{.name = "unknown_high_band",
+ .frequency = 110000,
+ .bandResult = utils::FrequencyBand::UNKNOWN}});
+}
+
+struct IsValidIdentifierTestCase {
+ std::string name;
+ ProgramIdentifier id;
+ bool valid;
+};
+
+std::vector<IsValidIdentifierTestCase> getIsValidIdentifierTestCases() {
+ return std::vector<IsValidIdentifierTestCase>({
+ IsValidIdentifierTestCase{.name = "invalid_id_type",
+ .id = utils::makeIdentifier(IdentifierType::INVALID, 0),
+ .valid = false},
+ IsValidIdentifierTestCase{
+ .name = "invalid_dab_frequency_high",
+ .id = utils::makeIdentifier(IdentifierType::DAB_FREQUENCY_KHZ, 10000000u),
+ .valid = false},
+ IsValidIdentifierTestCase{
+ .name = "invalid_dab_frequency_low",
+ .id = utils::makeIdentifier(IdentifierType::DAB_FREQUENCY_KHZ, 100000u),
+ .valid = false},
+ IsValidIdentifierTestCase{
+ .name = "valid_dab_frequency",
+ .id = utils::makeIdentifier(IdentifierType::DAB_FREQUENCY_KHZ, 1000000u),
+ .valid = true},
+ IsValidIdentifierTestCase{
+ .name = "invalid_am_fm_frequency_high",
+ .id = utils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, 10000000u),
+ .valid = false},
+ IsValidIdentifierTestCase{
+ .name = "invalid_am_fm_frequency_low",
+ .id = utils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, 100u),
+ .valid = false},
+ IsValidIdentifierTestCase{.name = "valid_am_fm_frequency",
+ .id = utils::makeIdentifier(
+ IdentifierType::AMFM_FREQUENCY_KHZ, kFmFrequencyKHz),
+ .valid = true},
+ IsValidIdentifierTestCase{
+ .name = "drmo_frequency_high",
+ .id = utils::makeIdentifier(IdentifierType::DRMO_FREQUENCY_KHZ, 10000000u),
+ .valid = false},
+ IsValidIdentifierTestCase{
+ .name = "drmo_frequency_low",
+ .id = utils::makeIdentifier(IdentifierType::DRMO_FREQUENCY_KHZ, 100u),
+ .valid = false},
+ IsValidIdentifierTestCase{.name = "valid_drmo_frequency",
+ .id = utils::makeIdentifier(
+ IdentifierType::DRMO_FREQUENCY_KHZ, kFmFrequencyKHz),
+ .valid = true},
+ IsValidIdentifierTestCase{.name = "invalid_rds_low",
+ .id = utils::makeIdentifier(IdentifierType::RDS_PI, 0x0),
+ .valid = false},
+ IsValidIdentifierTestCase{.name = "invalid_rds_high",
+ .id = utils::makeIdentifier(IdentifierType::RDS_PI, 0x10000),
+ .valid = false},
+ IsValidIdentifierTestCase{.name = "valid_rds",
+ .id = utils::makeIdentifier(IdentifierType::RDS_PI, 0x1000),
+ .valid = true},
+ IsValidIdentifierTestCase{
+ .name = "invalid_hd_id_zero",
+ .id = utils::makeSelectorHd(/* stationId= */ 0u, kHdSubChannel, kHdFrequency)
+ .primaryId,
+ .valid = false},
+ IsValidIdentifierTestCase{
+ .name = "invalid_hd_suchannel",
+ .id = utils::makeSelectorHd(kHdStationId, /* subChannel= */ 8u, kHdFrequency)
+ .primaryId,
+ .valid = false},
+ IsValidIdentifierTestCase{
+ .name = "invalid_hd_frequency_low",
+ .id = utils::makeSelectorHd(kHdStationId, kHdSubChannel, /* frequency= */ 100u)
+ .primaryId,
+ .valid = false},
+ IsValidIdentifierTestCase{
+ .name = "valid_hd_id",
+ .id = utils::makeSelectorHd(kHdStationId, kHdSubChannel, kHdFrequency)
+ .primaryId,
+ .valid = true},
+ IsValidIdentifierTestCase{
+ .name = "invalid_hd_station_name",
+ .id = utils::makeIdentifier(IdentifierType::HD_STATION_NAME, 0x41422D464D),
+ .valid = false},
+ IsValidIdentifierTestCase{
+ .name = "valid_hd_station_name",
+ .id = utils::makeIdentifier(IdentifierType::HD_STATION_NAME, 0x414231464D),
+ .valid = true},
+ IsValidIdentifierTestCase{
+ .name = "invalid_dab_sid",
+ .id = utils::makeIdentifier(IdentifierType::DAB_SID_EXT, 0x0E100000000u),
+ .valid = false},
+ IsValidIdentifierTestCase{
+ .name = "invalid_dab_ecc_low",
+ .id = utils::makeIdentifier(IdentifierType::DAB_SID_EXT, 0x0F700000221u),
+ .valid = false},
+ IsValidIdentifierTestCase{
+ .name = "invalid_dab_ecc_high",
+ .id = utils::makeIdentifier(IdentifierType::DAB_SID_EXT, 0x09900000221u),
+ .valid = false},
+ IsValidIdentifierTestCase{
+ .name = "valid_dab_sid_ext",
+ .id = utils::makeIdentifier(IdentifierType::DAB_SID_EXT, kDabSidExt),
+ .valid = true},
+ IsValidIdentifierTestCase{
+ .name = "invalid_dab_ensemble_zero",
+ .id = utils::makeIdentifier(IdentifierType::DAB_ENSEMBLE, 0x0),
+ .valid = false},
+ IsValidIdentifierTestCase{
+ .name = "invalid_dab_ensemble_high",
+ .id = utils::makeIdentifier(IdentifierType::DAB_ENSEMBLE, 0x10000),
+ .valid = false},
+ IsValidIdentifierTestCase{
+ .name = "valid_dab_ensemble",
+ .id = utils::makeIdentifier(IdentifierType::DAB_ENSEMBLE, kDabEnsemble),
+ .valid = true},
+ IsValidIdentifierTestCase{.name = "invalid_dab_scid_low",
+ .id = utils::makeIdentifier(IdentifierType::DAB_SCID, 0xF),
+ .valid = false},
+ IsValidIdentifierTestCase{.name = "invalid_dab_scid_high",
+ .id = utils::makeIdentifier(IdentifierType::DAB_SCID, 0x1000),
+ .valid = false},
+ IsValidIdentifierTestCase{.name = "valid_dab_scid",
+ .id = utils::makeIdentifier(IdentifierType::DAB_SCID, 0x100),
+ .valid = true},
+ IsValidIdentifierTestCase{
+ .name = "invalid_drmo_id_zero",
+ .id = utils::makeIdentifier(IdentifierType::DRMO_SERVICE_ID, 0x0),
+ .valid = false},
+ IsValidIdentifierTestCase{
+ .name = "invalid_drmo_id_high",
+ .id = utils::makeIdentifier(IdentifierType::DRMO_SERVICE_ID, 0x1000000),
+ .valid = false},
+ IsValidIdentifierTestCase{
+ .name = "valid_drmo_id",
+ .id = utils::makeIdentifier(IdentifierType::DRMO_SERVICE_ID, 0x100000),
+ .valid = true},
+ });
+}
+
+struct IsValidSelectorTestCase {
+ std::string name;
+ ProgramSelector sel;
+ bool valid;
+};
+
+std::vector<IsValidSelectorTestCase> getIsValidSelectorTestCases() {
+ return std::vector<IsValidSelectorTestCase>({
+ IsValidSelectorTestCase{.name = "valid_am_fm_selector",
+ .sel = utils::makeSelectorAmfm(kFmFrequencyKHz),
+ .valid = true},
+ IsValidSelectorTestCase{
+ .name = "valid_hd_selector",
+ .sel = utils::makeSelectorHd(kHdStationId, kHdSubChannel, kHdFrequency),
+ .valid = true},
+ IsValidSelectorTestCase{
+ .name = "valid_dab_selector",
+ .sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz),
+ .valid = true},
+ IsValidSelectorTestCase{.name = "valid_rds_selector",
+ .sel = ProgramSelector{.primaryId = utils::makeIdentifier(
+ IdentifierType::RDS_PI, 0x1000)},
+ .valid = true},
+ IsValidSelectorTestCase{.name = "selector_with_invalid_id",
+ .sel = utils::makeSelectorHd(kHdStationId, kHdSubChannel,
+ /* frequency= */ 100u),
+ .valid = false},
+ IsValidSelectorTestCase{
+ .name = "selector_with_invalid_primary_id_type",
+ .sel = ProgramSelector{.primaryId = utils::makeIdentifier(
+ IdentifierType::DAB_ENSEMBLE, kDabEnsemble)},
+ .valid = false},
+ });
+}
+
+struct IsValidMetadataTestCase {
+ std::string name;
+ Metadata metadata;
+ bool valid;
+};
+
+std::vector<IsValidMetadataTestCase> getIsValidMetadataTestCases() {
+ return std::vector<IsValidMetadataTestCase>({
+ IsValidMetadataTestCase{.name = "valid_rds_pty",
+ .metadata = Metadata::make<Metadata::rdsPty>(1),
+ .valid = true},
+ IsValidMetadataTestCase{.name = "negative_rds_pty",
+ .metadata = Metadata::make<Metadata::rdsPty>(-1),
+ .valid = false},
+ IsValidMetadataTestCase{.name = "large_rds_pty",
+ .metadata = Metadata::make<Metadata::rdsPty>(256),
+ .valid = false},
+ IsValidMetadataTestCase{.name = "valid_rbds_pty",
+ .metadata = Metadata::make<Metadata::rbdsPty>(1),
+ .valid = true},
+ IsValidMetadataTestCase{.name = "negative_rbds_pty",
+ .metadata = Metadata::make<Metadata::rbdsPty>(-1),
+ .valid = false},
+ IsValidMetadataTestCase{.name = "large_rbds_pty",
+ .metadata = Metadata::make<Metadata::rbdsPty>(256),
+ .valid = false},
+ IsValidMetadataTestCase{
+ .name = "valid_dab_ensemble_name_short",
+ .metadata = Metadata::make<Metadata::dabEnsembleNameShort>("name"),
+ .valid = true},
+ IsValidMetadataTestCase{
+ .name = "too_long_dab_ensemble_name_short",
+ .metadata = Metadata::make<Metadata::dabEnsembleNameShort>("name_long"),
+ .valid = false},
+ IsValidMetadataTestCase{
+ .name = "valid_dab_service_name_short",
+ .metadata = Metadata::make<Metadata::dabServiceNameShort>("name"),
+ .valid = true},
+ IsValidMetadataTestCase{
+ .name = "too_long_dab_service_name_short",
+ .metadata = Metadata::make<Metadata::dabServiceNameShort>("name_long"),
+ .valid = false},
+ IsValidMetadataTestCase{
+ .name = "valid_dab_component_name_short",
+ .metadata = Metadata::make<Metadata::dabComponentNameShort>("name"),
+ .valid = true},
+ IsValidMetadataTestCase{
+ .name = "too_long_dab_component_name_short",
+ .metadata = Metadata::make<Metadata::dabComponentNameShort>("name_long"),
+ .valid = false},
+ });
+}
+} // namespace
+
+class GetBandTest : public testing::TestWithParam<GetBandTestCase> {};
+
+INSTANTIATE_TEST_SUITE_P(GetBandTests, GetBandTest, testing::ValuesIn(getBandTestCases()),
+ [](const testing::TestParamInfo<GetBandTest::ParamType>& info) {
+ return info.param.name;
+ });
+
+TEST_P(GetBandTest, GetBand) {
+ GetBandTestCase testcase = GetParam();
+
+ ASSERT_EQ(utils::getBand(testcase.frequency), testcase.bandResult);
+}
+
+class IsValidMetadataTest : public testing::TestWithParam<IsValidMetadataTestCase> {};
+
+INSTANTIATE_TEST_SUITE_P(IsValidMetadataTests, IsValidMetadataTest,
+ testing::ValuesIn(getIsValidMetadataTestCases()),
+ [](const testing::TestParamInfo<IsValidMetadataTest::ParamType>& info) {
+ return info.param.name;
+ });
+
+TEST_P(IsValidMetadataTest, IsValidMetadata) {
+ IsValidMetadataTestCase testParam = GetParam();
+
+ ASSERT_EQ(utils::isValidMetadata(testParam.metadata), testParam.valid);
+}
+
+class IsValidIdentifierTest : public testing::TestWithParam<IsValidIdentifierTestCase> {};
+
+INSTANTIATE_TEST_SUITE_P(IsValidIdentifierTests, IsValidIdentifierTest,
+ testing::ValuesIn(getIsValidIdentifierTestCases()),
+ [](const testing::TestParamInfo<IsValidIdentifierTest::ParamType>& info) {
+ return info.param.name;
+ });
+
+TEST_P(IsValidIdentifierTest, IsValid) {
+ IsValidIdentifierTestCase testcase = GetParam();
+
+ ASSERT_EQ(utils::isValid(testcase.id), testcase.valid);
+}
+
+class IsValidSelectorTest : public testing::TestWithParam<IsValidSelectorTestCase> {};
+
+INSTANTIATE_TEST_SUITE_P(IsValidSelectorTests, IsValidSelectorTest,
+ testing::ValuesIn(getIsValidSelectorTestCases()),
+ [](const testing::TestParamInfo<IsValidSelectorTest::ParamType>& info) {
+ return info.param.name;
+ });
+
+TEST_P(IsValidSelectorTest, IsValid) {
+ IsValidSelectorTestCase testcase = GetParam();
+
+ ASSERT_EQ(utils::isValid(testcase.sel), testcase.valid);
+}
+
+TEST(BroadcastRadioUtilsTest, IdentifierIteratorBegin) {
+ ProgramSelector sel = {
+ .primaryId = utils::makeIdentifier(IdentifierType::RDS_PI, kRdsValue),
+ .secondaryIds = {
+ utils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, kFmFrequencyKHz),
+ utils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ,
+ kFmFrequencyKHz + 200)}};
+
+ utils::IdentifierIterator it = begin(sel);
+
+ utils::IdentifierIterator selEnd = end(sel);
+ ASSERT_NE(selEnd, it);
+ EXPECT_EQ(sel.primaryId, *it);
+}
+
+TEST(BroadcastRadioUtilsTest, IdentifierIteratorIncrement) {
+ ProgramSelector sel = {
+ .primaryId = utils::makeIdentifier(IdentifierType::RDS_PI, kRdsValue),
+ .secondaryIds = {
+ utils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, kFmFrequencyKHz),
+ utils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ,
+ kFmFrequencyKHz + 200)}};
+ utils::IdentifierIterator it = begin(sel);
+ utils::IdentifierIterator selEnd = end(sel);
+
+ ASSERT_NE(selEnd, ++it);
+ EXPECT_EQ(sel.secondaryIds[0], *it);
+ ASSERT_NE(selEnd, ++it);
+ EXPECT_EQ(sel.secondaryIds[1], *it);
+ ASSERT_EQ(selEnd, ++it);
+}
+
+TEST(BroadcastRadioUtilsTest, IdentifierIteratorIncrementWithValue) {
+ ProgramSelector sel = {
+ .primaryId = utils::makeIdentifier(IdentifierType::RDS_PI, kRdsValue),
+ .secondaryIds = {
+ utils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, kFmFrequencyKHz),
+ utils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ,
+ kFmFrequencyKHz + 200)}};
+ utils::IdentifierIterator it1 = begin(sel);
+ utils::IdentifierIterator it2 = it1;
+ it2++;
+ it2++;
+
+ ASSERT_EQ(it1 + 2, it2);
+}
+
+TEST(BroadcastRadioUtilsTest, IdentifierIteratorBeginEndWithoutSecondaryIds) {
+ ProgramSelector sel = {.primaryId = utils::makeIdentifier(IdentifierType::RDS_PI, kRdsValue)};
+
+ utils::IdentifierIterator it = begin(sel);
+ utils::IdentifierIterator selEnd = end(sel);
+
+ ASSERT_EQ(selEnd, ++it);
+}
+
+TEST(BroadcastRadioUtilsTest, IdentifierIteratorBeginEndWithDifferentObjects) {
+ ProgramSelector sel1 = utils::makeSelectorAmfm(kFmFrequencyKHz);
+ ProgramSelector sel2 = utils::makeSelectorAmfm(kFmFrequencyKHz);
+
+ utils::IdentifierIterator it1 = begin(sel1);
+ utils::IdentifierIterator it2 = begin(sel2);
+ utils::IdentifierIterator end1 = end(sel1);
+ utils::IdentifierIterator end2 = end(sel2);
+
+ ASSERT_NE(it1, it2);
+ ASSERT_NE(end1, end2);
+}
+
+TEST(BroadcastRadioUtilsTest, IdentifierIteratorBeginEndWithTheSameObject) {
+ ProgramSelector sel = utils::makeSelectorAmfm(kFmFrequencyKHz);
+
+ utils::IdentifierIterator it1 = begin(sel);
+ utils::IdentifierIterator it2 = begin(sel);
+ utils::IdentifierIterator end1 = end(sel);
+ utils::IdentifierIterator end2 = end(sel);
+
+ ASSERT_EQ(it1, it2);
+ ASSERT_EQ(end1, end2);
+}
+
+TEST(BroadcastRadioUtilsTest, IsSupportedWithSupportedSelector) {
+ ProgramSelector sel = utils::makeSelectorAmfm(kFmFrequencyKHz);
+
+ ASSERT_TRUE(utils::isSupported(kAmFmTunerProp, sel));
+}
+
+TEST(BroadcastRadioUtilsTest, IsSupportedWithUnsupportedSelector) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_FALSE(utils::isSupported(kAmFmTunerProp, sel));
+}
+
+TEST(BroadcastRadioUtilsTest, GetBandWithFmFrequency) {
+ ProgramSelector sel = utils::makeSelectorAmfm(kFmFrequencyKHz);
+
+ ASSERT_TRUE(utils::hasId(sel, IdentifierType::AMFM_FREQUENCY_KHZ));
+}
+
+TEST(BroadcastRadioUtilsTest, HasIdWithPrimaryIdType) {
+ ProgramSelector sel = utils::makeSelectorAmfm(kFmFrequencyKHz);
+
+ ASSERT_TRUE(utils::hasId(sel, IdentifierType::AMFM_FREQUENCY_KHZ));
+}
+
+TEST(BroadcastRadioUtilsTest, HasIdWithSecondaryIdType) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_TRUE(utils::hasId(sel, IdentifierType::DAB_FREQUENCY_KHZ));
+}
+
+TEST(BroadcastRadioUtilsTest, HasIdWithIdNotInSelector) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_FALSE(utils::hasId(sel, IdentifierType::AMFM_FREQUENCY_KHZ));
+}
+
+TEST(BroadcastRadioUtilsTest, GetIdWithPrimaryIdType) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_EQ(utils::getId(sel, IdentifierType::DAB_SID_EXT), static_cast<int64_t>(kDabSidExt));
+}
+
+TEST(BroadcastRadioUtilsTest, GetIdWithSecondaryIdType) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_EQ(utils::getId(sel, IdentifierType::DAB_ENSEMBLE), static_cast<int64_t>(kDabEnsemble));
+}
+
+TEST(BroadcastRadioUtilsTest, GetIdWithIdNotFound) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_EQ(utils::getId(sel, IdentifierType::AMFM_FREQUENCY_KHZ), 0);
+}
+
+TEST(BroadcastRadioUtilsTest, GetIdWithIdFoundAndDefaultValue) {
+ int64_t defaultValue = 0x0E10000C222u;
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_EQ(utils::getId(sel, IdentifierType::DAB_SID_EXT, defaultValue),
+ static_cast<int64_t>(kDabSidExt));
+}
+
+TEST(BroadcastRadioUtilsTest, GetIdWithIdNotFoundAndDefaultValue) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_EQ(utils::getId(sel, IdentifierType::AMFM_FREQUENCY_KHZ, kFmFrequencyKHz),
+ static_cast<int64_t>(kFmFrequencyKHz));
+}
+
+TEST(BroadcastRadioUtilsTest, GetAllIdsWithAvailableIds) {
+ int64_t secondaryFrequencyKHz = kFmFrequencyKHz + 200;
+ ProgramSelector sel = utils::makeSelectorAmfm(kFmFrequencyKHz);
+ sel.secondaryIds.push_back(
+ utils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, secondaryFrequencyKHz));
+
+ std::vector<int> allIds = utils::getAllIds(sel, IdentifierType::AMFM_FREQUENCY_KHZ);
+
+ ASSERT_EQ(allIds.size(), 2u);
+ EXPECT_NE(std::find(allIds.begin(), allIds.end(), kFmFrequencyKHz), allIds.end());
+ EXPECT_NE(std::find(allIds.begin(), allIds.end(), secondaryFrequencyKHz), allIds.end());
+}
+
+TEST(BroadcastRadioUtilsTest, GetAllIdsWithIdNotFound) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_TRUE(utils::getAllIds(sel, IdentifierType::AMFM_FREQUENCY_KHZ).empty());
+}
+
+TEST(BroadcastRadioUtilsTest, MakeIdentifier) {
+ ProgramIdentifier id =
+ utils::makeIdentifier(IdentifierType::AMFM_FREQUENCY_KHZ, kFmFrequencyKHz);
+
+ EXPECT_EQ(id.type, IdentifierType::AMFM_FREQUENCY_KHZ);
+ EXPECT_EQ(id.value, kFmFrequencyKHz);
+}
+
+TEST(BroadcastRadioUtilsTest, MakeSelectorAmfm) {
+ ProgramSelector sel = utils::makeSelectorAmfm(kFmFrequencyKHz);
+
+ EXPECT_EQ(sel.primaryId.type, IdentifierType::AMFM_FREQUENCY_KHZ);
+ EXPECT_EQ(sel.primaryId.value, kFmFrequencyKHz);
+ EXPECT_TRUE(sel.secondaryIds.empty());
+}
+
+TEST(BroadcastRadioUtilsTest, MakeSelectorHd) {
+ ProgramSelector sel = utils::makeSelectorHd(kHdStationId, kHdSubChannel, kHdFrequency);
+
+ EXPECT_EQ(sel.primaryId.type, IdentifierType::HD_STATION_ID_EXT);
+ EXPECT_TRUE(sel.secondaryIds.empty());
+ EXPECT_EQ(utils::getHdSubchannel(sel), static_cast<int>(kHdSubChannel));
+ EXPECT_EQ(utils::getHdFrequency(sel), static_cast<uint32_t>(kHdFrequency));
+}
+
+TEST(BroadcastRadioUtilsTest, MakeHdRadioStationName) {
+ std::string stationName = "aB1-FM";
+ int64_t expectedIdValue = 0x4D46314241;
+
+ ProgramIdentifier stationNameId = utils::makeHdRadioStationName(stationName);
+
+ EXPECT_EQ(stationNameId.type, IdentifierType::HD_STATION_NAME);
+ EXPECT_EQ(stationNameId.value, expectedIdValue);
+}
+
+TEST(BroadcastRadioUtilsTest, GetHdFrequencyWithoutHdId) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_EQ(utils::getHdFrequency(sel), 0u);
+}
+
+TEST(BroadcastRadioUtilsTest, HasAmFmFrequencyWithAmFmSelector) {
+ ProgramSelector sel = utils::makeSelectorAmfm(kFmFrequencyKHz);
+
+ ASSERT_TRUE(utils::hasAmFmFrequency(sel));
+}
+
+TEST(BroadcastRadioUtilsTest, HasAmFmFrequencyWithHdSelector) {
+ ProgramSelector sel = utils::makeSelectorHd(kHdStationId, kHdSubChannel, kHdFrequency);
+
+ ASSERT_TRUE(utils::hasAmFmFrequency(sel));
+}
+
+TEST(BroadcastRadioUtilsTest, HasAmFmFrequencyWithNonAmFmHdSelector) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_FALSE(utils::hasAmFmFrequency(sel));
+}
+
+TEST(BroadcastRadioUtilsTest, GetAmFmFrequencyWithAmFmSelector) {
+ ProgramSelector sel = utils::makeSelectorAmfm(kFmFrequencyKHz);
+
+ ASSERT_EQ(utils::getAmFmFrequency(sel), static_cast<uint32_t>(kFmFrequencyKHz));
+}
+
+TEST(BroadcastRadioUtilsTest, GetAmFmFrequencyWithHdSelector) {
+ ProgramSelector sel = utils::makeSelectorHd(kHdStationId, kHdSubChannel, kHdFrequency);
+
+ ASSERT_EQ(utils::getAmFmFrequency(sel), static_cast<uint32_t>(kHdFrequency));
+}
+
+TEST(BroadcastRadioUtilsTest, GetAmFmFrequencyWithNonAmFmHdSelector) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_EQ(utils::getAmFmFrequency(sel), 0u);
+}
+
+TEST(BroadcastRadioUtilsTest, MakeSelectorDabWithOnlySidExt) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt);
+
+ EXPECT_EQ(sel.primaryId.type, IdentifierType::DAB_SID_EXT);
+ EXPECT_EQ(sel.primaryId.value, static_cast<int64_t>(kDabSidExt));
+ EXPECT_TRUE(sel.secondaryIds.empty());
+}
+
+TEST(BroadcastRadioUtilsTest, MakeSelectorDab) {
+ ProgramIdentifier ensembleIdExpected =
+ utils::makeIdentifier(IdentifierType::DAB_ENSEMBLE, kDabEnsemble);
+ ProgramIdentifier frequencyIdExpected =
+ utils::makeIdentifier(IdentifierType::DAB_FREQUENCY_KHZ, kDabFrequencyKhz);
+
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ EXPECT_EQ(sel.primaryId.type, IdentifierType::DAB_SID_EXT);
+ EXPECT_EQ(sel.primaryId.value, static_cast<int64_t>(kDabSidExt));
+ EXPECT_EQ(sel.secondaryIds.size(), 2u);
+ EXPECT_NE(std::find(sel.secondaryIds.begin(), sel.secondaryIds.end(), ensembleIdExpected),
+ sel.secondaryIds.end());
+ EXPECT_NE(std::find(sel.secondaryIds.begin(), sel.secondaryIds.end(), frequencyIdExpected),
+ sel.secondaryIds.end());
+}
+
+TEST(BroadcastRadioUtilsTest, GetDabSId) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_EQ(utils::getDabSId(sel), kDabSid);
+}
+
+TEST(BroadcastRadioUtilsTest, GetDabEccCode) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_EQ(utils::getDabEccCode(sel), kDabEccCode);
+}
+
+TEST(BroadcastRadioUtilsTest, GetDabSCIdS) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_EQ(utils::getDabSCIdS(sel), kDabSCIdS);
+}
+
+TEST(BroadcastRadioUtilsTest, TunesToWithTheSameHdSelector) {
+ ProgramSelector sel = utils::makeSelectorHd(kHdStationId, kHdSubChannel, kHdFrequency);
+ ProgramSelector selTarget = utils::makeSelectorHd(kHdStationId, kHdSubChannel, kHdFrequency);
+
+ ASSERT_TRUE(utils::tunesTo(sel, selTarget));
+}
+
+TEST(BroadcastRadioUtilsTest, TunesToAmFmSelectorWithDifferentSubChannels) {
+ ProgramSelector sel = utils::makeSelectorHd(kHdStationId, kHdSubChannel, kHdFrequency);
+ ProgramSelector selTarget = utils::makeSelectorAmfm(kHdFrequency);
+
+ ASSERT_FALSE(utils::tunesTo(sel, selTarget));
+}
+
+TEST(BroadcastRadioUtilsTest, TunesToMainHdChannelWithDifferentSubChannels) {
+ ProgramSelector sel = utils::makeSelectorAmfm(kHdFrequency);
+ ProgramSelector selTarget =
+ utils::makeSelectorHd(kHdStationId, /* subChannel= */ 0, kHdFrequency);
+
+ ASSERT_TRUE(utils::tunesTo(sel, selTarget));
+}
+
+TEST(BroadcastRadioUtilsTest, TunesToWithTheSameAmFmSelector) {
+ ProgramSelector sel = utils::makeSelectorAmfm(kFmFrequencyKHz);
+ ProgramSelector selTarget = utils::makeSelectorAmfm(kFmFrequencyKHz);
+
+ ASSERT_TRUE(utils::tunesTo(sel, selTarget));
+}
+
+TEST(BroadcastRadioUtilsTest, TunesToWithDifferentFrequencies) {
+ ProgramSelector sel = utils::makeSelectorAmfm(kFmFrequencyKHz);
+ ProgramSelector selTarget = utils::makeSelectorAmfm(kFmFrequencyKHz + 200);
+
+ ASSERT_FALSE(utils::tunesTo(sel, selTarget));
+}
+
+TEST(BroadcastRadioUtilsTest, TunesToWithTheSameDabSelector) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+ ProgramSelector selTarget = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_TRUE(utils::tunesTo(sel, selTarget));
+}
+
+TEST(BroadcastRadioUtilsTest, TunesToWithDabSelectorOfDifferentPrimaryIds) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt + 1, kDabEnsemble, kDabFrequencyKhz);
+ ProgramSelector selTarget = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_FALSE(utils::tunesTo(sel, selTarget));
+}
+
+TEST(BroadcastRadioUtilsTest, TunesToWithDabSelectorOfDifferentSecondayIds) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble + 100, kDabFrequencyKhz);
+ ProgramSelector selTarget = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_FALSE(utils::tunesTo(sel, selTarget));
+}
+
+TEST(BroadcastRadioUtilsTest, TunesToWithDabSelectorWithoutSecondaryIds) {
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt);
+ ProgramSelector selTarget = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_TRUE(utils::tunesTo(sel, selTarget));
+}
+
+TEST(BroadcastRadioUtilsTest, SatisfiesWithSatisfiedIdTypesFilter) {
+ ProgramFilter filter = ProgramFilter{.identifierTypes = {IdentifierType::DAB_FREQUENCY_KHZ}};
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_TRUE(utils::satisfies(filter, sel));
+}
+
+TEST(BroadcastRadioUtilsTest, SatisfiesWithUnsatisfiedIdTypesFilter) {
+ ProgramFilter filter = ProgramFilter{.identifierTypes = {IdentifierType::DAB_FREQUENCY_KHZ}};
+ ProgramSelector sel = utils::makeSelectorAmfm(kFmFrequencyKHz);
+
+ ASSERT_FALSE(utils::satisfies(filter, sel));
+}
+
+TEST(BroadcastRadioUtilsTest, SatisfiesWithSatisfiedIdsFilter) {
+ ProgramFilter filter =
+ ProgramFilter{.identifiers = {utils::makeIdentifier(IdentifierType::DAB_FREQUENCY_KHZ,
+ kDabFrequencyKhz)}};
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+
+ ASSERT_TRUE(utils::satisfies(filter, sel));
+}
+
+TEST(BroadcastRadioUtilsTest, SatisfiesWithUnsatisfiedIdsFilter) {
+ ProgramFilter filter =
+ ProgramFilter{.identifiers = {utils::makeIdentifier(IdentifierType::DAB_FREQUENCY_KHZ,
+ kDabFrequencyKhz)}};
+ ProgramSelector sel = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz + 100);
+
+ ASSERT_FALSE(utils::satisfies(filter, sel));
+}
+
+TEST(BroadcastRadioUtilsTest, ProgramSelectorComparatorWithDifferentAmFmFrequencies) {
+ ProgramSelector sel1 = utils::makeSelectorAmfm(kHdFrequency - 200);
+ ProgramSelector sel2 = utils::makeSelectorHd(kHdStationId, kHdSubChannel, kHdFrequency);
+
+ EXPECT_TRUE(utils::ProgramSelectorComparator()(sel1, sel2));
+ EXPECT_FALSE(utils::ProgramSelectorComparator()(sel2, sel1));
+}
+
+TEST(BroadcastRadioUtilsTest, ProgramSelectorComparatorWithDifferentAmFmSubChannels) {
+ ProgramSelector sel1 = utils::makeSelectorHd(kHdStationId, kHdSubChannel, kHdFrequency);
+ ProgramSelector sel2 = utils::makeSelectorHd(kHdStationId, kHdSubChannel + 1, kHdFrequency);
+
+ EXPECT_TRUE(utils::ProgramSelectorComparator()(sel1, sel2));
+ EXPECT_FALSE(utils::ProgramSelectorComparator()(sel2, sel1));
+}
+
+TEST(BroadcastRadioUtilsTest, ProgramSelectorComparatorWithDifferentDabFrequencies) {
+ ProgramSelector sel1 = utils::makeSelectorDab(kDabSidExt + 100, kDabEnsemble, kDabFrequencyKhz);
+ ProgramSelector sel2 = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz + 100);
+
+ EXPECT_TRUE(utils::ProgramSelectorComparator()(sel1, sel2));
+ EXPECT_FALSE(utils::ProgramSelectorComparator()(sel2, sel1));
+}
+
+TEST(BroadcastRadioUtilsTest, ProgramSelectorComparatorWithDifferentDabEccCode) {
+ ProgramSelector sel1 =
+ utils::makeSelectorDab(/* stationId= */ 0x0E10000C221u, kDabEnsemble, kDabFrequencyKhz);
+ ProgramSelector sel2 =
+ utils::makeSelectorDab(/* stationId= */ 0x0E20000C221u, kDabEnsemble, kDabFrequencyKhz);
+
+ EXPECT_TRUE(utils::ProgramSelectorComparator()(sel1, sel2));
+ EXPECT_FALSE(utils::ProgramSelectorComparator()(sel2, sel1));
+}
+
+TEST(BroadcastRadioUtilsTest, ProgramSelectorComparatorWithDifferentDabEnsembles) {
+ ProgramSelector sel1 = utils::makeSelectorDab(kDabSidExt, kDabEnsemble, kDabFrequencyKhz);
+ ProgramSelector sel2 = utils::makeSelectorDab(kDabSidExt, kDabEnsemble + 1, kDabFrequencyKhz);
+
+ EXPECT_TRUE(utils::ProgramSelectorComparator()(sel1, sel2));
+ EXPECT_FALSE(utils::ProgramSelectorComparator()(sel2, sel1));
+}
+
+TEST(BroadcastRadioUtilsTest, ProgramSelectorComparatorWithDifferentDabSid) {
+ ProgramSelector sel1 =
+ utils::makeSelectorDab(/* stationId= */ 0x0E10000C221u, kDabEnsemble, kDabFrequencyKhz);
+ ProgramSelector sel2 =
+ utils::makeSelectorDab(/* stationId= */ 0x0E10000C222u, kDabEnsemble, kDabFrequencyKhz);
+
+ EXPECT_TRUE(utils::ProgramSelectorComparator()(sel1, sel2));
+ EXPECT_FALSE(utils::ProgramSelectorComparator()(sel2, sel1));
+}
+
+TEST(BroadcastRadioUtilsTest, ProgramSelectorComparatorWithDifferentDabSCIdS) {
+ ProgramSelector sel1 =
+ utils::makeSelectorDab(/* stationId= */ 0x0E10000C221u, kDabEnsemble, kDabFrequencyKhz);
+ ProgramSelector sel2 =
+ utils::makeSelectorDab(/* stationId= */ 0x1E10000C221u, kDabEnsemble, kDabFrequencyKhz);
+
+ EXPECT_TRUE(utils::ProgramSelectorComparator()(sel1, sel2));
+ EXPECT_FALSE(utils::ProgramSelectorComparator()(sel2, sel1));
+}
+
+TEST(BroadcastRadioUtilsTest, ProgramInfoComparator) {
+ ProgramSelector sel1 = utils::makeSelectorAmfm(kFmFrequencyKHz);
+ ProgramSelector sel2 = utils::makeSelectorAmfm(kFmFrequencyKHz + 200);
+ ProgramInfo info1 = {.selector = sel1,
+ .logicallyTunedTo = sel1.primaryId,
+ .physicallyTunedTo = sel1.primaryId};
+ ProgramInfo info2 = {.selector = sel2,
+ .logicallyTunedTo = sel2.primaryId,
+ .physicallyTunedTo = sel2.primaryId};
+
+ EXPECT_TRUE(utils::ProgramInfoComparator()(info1, info2));
+ EXPECT_FALSE(utils::ProgramInfoComparator()(info2, info1));
+}
+
+} // namespace aidl::android::hardware::broadcastradio
diff --git a/broadcastradio/common/utilsaidl/test/BroadcastRadioUtilsV2Test.cpp b/broadcastradio/common/utilsaidl/test/BroadcastRadioUtilsV2Test.cpp
new file mode 100644
index 0000000..cf9f9e9
--- /dev/null
+++ b/broadcastradio/common/utilsaidl/test/BroadcastRadioUtilsV2Test.cpp
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2024 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 <broadcastradio-utils-aidl/UtilsV2.h>
+#include <gtest/gtest.h>
+
+namespace aidl::android::hardware::broadcastradio {
+
+namespace {
+struct IsValidMetadataV2TestCase {
+ std::string name;
+ Metadata metadata;
+ bool valid;
+};
+
+std::vector<IsValidMetadataV2TestCase> getIsValidMetadataV2TestCases() {
+ return std::vector<IsValidMetadataV2TestCase>({
+ IsValidMetadataV2TestCase{.name = "valid_rds_pty",
+ .metadata = Metadata::make<Metadata::rdsPty>(1),
+ .valid = true},
+ IsValidMetadataV2TestCase{.name = "negative_rds_pty",
+ .metadata = Metadata::make<Metadata::rdsPty>(-1),
+ .valid = false},
+ IsValidMetadataV2TestCase{
+ .name = "valid_hd_station_name_short",
+ .metadata = Metadata::make<Metadata::hdStationNameShort>("name_short"),
+ .valid = true},
+ IsValidMetadataV2TestCase{
+ .name = "too_long_hd_station_name_short",
+ .metadata = Metadata::make<Metadata::hdStationNameShort>("name_too_long"),
+ .valid = false},
+ IsValidMetadataV2TestCase{
+ .name = "valid_hd_subchannel_available",
+ .metadata = Metadata::make<Metadata::hdSubChannelsAvailable>(1),
+ .valid = true},
+ IsValidMetadataV2TestCase{
+ .name = "negative_subchannel_available",
+ .metadata = Metadata::make<Metadata::hdSubChannelsAvailable>(-1),
+ .valid = false},
+ IsValidMetadataV2TestCase{
+ .name = "large_subchannel_available",
+ .metadata = Metadata::make<Metadata::hdSubChannelsAvailable>(256),
+ .valid = false},
+ });
+}
+} // namespace
+
+class IsValidMetadataV2Test : public testing::TestWithParam<IsValidMetadataV2TestCase> {};
+
+INSTANTIATE_TEST_SUITE_P(IsValidMetadataV2Tests, IsValidMetadataV2Test,
+ testing::ValuesIn(getIsValidMetadataV2TestCases()),
+ [](const testing::TestParamInfo<IsValidMetadataV2Test::ParamType>& info) {
+ return info.param.name;
+ });
+
+TEST_P(IsValidMetadataV2Test, IsValidMetadataV2) {
+ IsValidMetadataV2TestCase testParam = GetParam();
+
+ ASSERT_EQ(utils::isValidMetadataV2(testParam.metadata), testParam.valid);
+}
+
+} // namespace aidl::android::hardware::broadcastradio
diff --git a/camera/device/aidl/Android.bp b/camera/device/aidl/Android.bp
index a156498..e4006e7 100644
--- a/camera/device/aidl/Android.bp
+++ b/camera/device/aidl/Android.bp
@@ -18,7 +18,7 @@
"android.hardware.common-V2",
"android.hardware.common.fmq-V1",
"android.hardware.camera.common-V1",
- "android.hardware.camera.metadata-V2",
+ "android.hardware.camera.metadata-V3",
"android.hardware.graphics.common-V5",
],
backend: {
diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ConfigureStreamsRet.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ConfigureStreamsRet.aidl
index 5535a30..670f7d2 100644
--- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ConfigureStreamsRet.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/ConfigureStreamsRet.aidl
@@ -35,5 +35,4 @@
@VintfStability
parcelable ConfigureStreamsRet {
android.hardware.camera.device.HalStream[] halStreams;
- boolean enableHalBufferManager = false;
}
diff --git a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/HalStream.aidl b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/HalStream.aidl
index a5784bc..3ae261d 100644
--- a/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/HalStream.aidl
+++ b/camera/device/aidl/aidl_api/android.hardware.camera.device/current/android/hardware/camera/device/HalStream.aidl
@@ -42,4 +42,5 @@
android.hardware.graphics.common.Dataspace overrideDataSpace;
String physicalCameraId;
boolean supportOffline;
+ boolean enableHalBufferManager;
}
diff --git a/camera/device/aidl/android/hardware/camera/device/ConfigureStreamsRet.aidl b/camera/device/aidl/android/hardware/camera/device/ConfigureStreamsRet.aidl
index 8f462ec..702901f 100644
--- a/camera/device/aidl/android/hardware/camera/device/ConfigureStreamsRet.aidl
+++ b/camera/device/aidl/android/hardware/camera/device/ConfigureStreamsRet.aidl
@@ -34,9 +34,4 @@
* overridden format, maximum buffers etc.
*/
HalStream[] halStreams;
- /**
- * A boolean informing the camera framework whether the HAL buffer manager
- * must be used for the session configured.
- */
- boolean enableHalBufferManager = false;
}
diff --git a/camera/device/aidl/android/hardware/camera/device/HalStream.aidl b/camera/device/aidl/android/hardware/camera/device/HalStream.aidl
index 25a80bc..fac89e6 100644
--- a/camera/device/aidl/android/hardware/camera/device/HalStream.aidl
+++ b/camera/device/aidl/android/hardware/camera/device/HalStream.aidl
@@ -127,4 +127,24 @@
*
*/
boolean supportOffline;
+
+ /**
+ * Whether the buffers for this stream are HAL buffer managed.
+ *
+ * If ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION is
+ * ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE, this field
+ * must be set by the HAL to inform the camera framework, whether output buffers for this
+ * stream will be HAL buffer managed - i.e. requested through the
+ * ICameraDeviceCallback.requestStreamsBuffers() API. Only the output buffers for the streams
+ * that have this field set to 'true' will be HAL buffer managed. The output buffers for other
+ * streams will be managed by the camera framework.
+ *
+ * If the value of ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION is
+ * ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_AIDL_DEVICE, the camera framework
+ * will ignore this field and assume that all output streams are hal buffer managed.
+ *
+ * If ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION is not set at all, the camera framework
+ * will ignore this field and assume output buffers are managed by the camera framework.
+ */
+ boolean enableHalBufferManager;
}
diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl
index 3a1d762..da3d5df 100644
--- a/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl
+++ b/camera/device/aidl/android/hardware/camera/device/ICameraDevice.aidl
@@ -365,16 +365,20 @@
* isStreamCombinationWithSettingsSupported:
*
* This is the same as isStreamCombinationSupported with below exceptions:
- *
* 1. The input StreamConfiguration parameter may contain session parameters
- * supported by this camera device. When checking if the particular StreamConfiguration
- * is supported, the camera HAL must take the session parameters into consideration.
+ * as well as additional CaptureRequest keys. See the comment
+ * sections below on what additional capture request keys are passed in
+ * StreamConfiguration::sessionParameters for each interface version. When checking if
+ * the particular StreamConfiguration is supported, the camera HAL must take all
+ * the keys in sessionParameters into consideration.
*
* 2. For version 3 of this interface, the camera compliance test will verify that
* isStreamCombinationWithSettingsSupported behaves properly for all combinations of
* below features. This function must return true for all supported combinations,
* and return false for non-supported feature combinations. The list of features
- * required may grow in future versions.
+ * required may grow in future versions. The additional metadata entries in
+ * StreamConfiguration::sessionParameters are {CONTROL_AE_TARGET_FPS_RANGE,
+ * CONTROL_VIDEO_STABILIZATION_MODE}.
*
* - Stream Combinations (a subset of LEGACY device mandatory stream combinations):
* {
@@ -429,7 +433,7 @@
* 4032 x 3024, the camera compliance test will verify both
* {PRIV, 1920 x 1440, JPEG, 4032 x 3024} and {PRIV, 2560 x 1440, JPEG, 4032 x 2268}.
*
- * @param streams The StreamConfiguration to be tested, with optional session parameters.
+ * @param streams The StreamConfiguration to be tested, with optional CaptureRequest parameters.
*
* @return true in case the stream combination is supported, false otherwise.
*
@@ -444,6 +448,7 @@
*
* For Android 15, the characteristics which need to be set are:
* - ANDROID_CONTROL_ZOOM_RATIO_RANGE
+ * - SCALER_AVAILABLE_MAX_DIGITAL_ZOOM
*
* A service specific error will be returned on the following conditions
* INTERNAL_ERROR:
diff --git a/camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl b/camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl
index ffc1a11..62a19cf 100644
--- a/camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl
+++ b/camera/device/aidl/android/hardware/camera/device/ICameraDeviceSession.aidl
@@ -89,12 +89,12 @@
* with processCaptureResult (and its respective releaseFence has been
* signaled) the framework may free or reuse it at any time.
*
- * This method wil only be called by the framework if
+ * This method must only be called by the framework if
* ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION is either not advertised or is
* ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_AIDL. If the value of
* ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION is
* ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE, configureStreamsV2
- * will be called instead.
+ * must be called instead.
*
* ------------------------------------------------------------------------
*
diff --git a/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl b/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl
index 197d9af..0f5bad9 100644
--- a/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl
+++ b/camera/device/aidl/android/hardware/camera/device/StreamConfiguration.aidl
@@ -59,6 +59,14 @@
* pipeline updates. The field is optional, clients can choose to ignore it and avoid
* including any initial settings. If parameters are present, then hal must examine
* their values and configure the internal camera pipeline accordingly.
+ *
+ * A null pointer is equivalent to a valid CameraMetadata object with zero entries.
+ *
+ * For a StreamConfiguration passed to ICameraDevice.isStreamCombinationWithSettingsSupported
+ * or ICameraDevice.getSessionCharacteristics, this variable may also contain keys
+ * that are not session parameters, but are used to specify certain features for a
+ * session. For example, CONTROL_VIDEO_STABILIZATION_MODE may be included even if it's not a
+ * session parameter.
*/
CameraMetadata sessionParams;
diff --git a/camera/device/default/ExternalCameraDevice.cpp b/camera/device/default/ExternalCameraDevice.cpp
index 649bf43..8e84748 100644
--- a/camera/device/default/ExternalCameraDevice.cpp
+++ b/camera/device/default/ExternalCameraDevice.cpp
@@ -497,6 +497,9 @@
const int32_t maxLatency = ANDROID_SYNC_MAX_LATENCY_UNKNOWN;
UPDATE(ANDROID_SYNC_MAX_LATENCY, &maxLatency, 1);
+ const uint8_t sensorReadoutTimestamp = ANDROID_SENSOR_READOUT_TIMESTAMP_NOT_SUPPORTED;
+ UPDATE(ANDROID_SENSOR_READOUT_TIMESTAMP, &sensorReadoutTimestamp, 1);
+
/* Other sensor/RAW related keys:
* android.sensor.info.colorFilterArrangement -> no need if we don't do RAW
* android.sensor.info.physicalSize -> not available
@@ -1002,4 +1005,4 @@
} // namespace device
} // namespace camera
} // namespace hardware
-} // namespace android
\ No newline at end of file
+} // namespace android
diff --git a/camera/device/default/ExternalCameraDeviceSession.cpp b/camera/device/default/ExternalCameraDeviceSession.cpp
index a6ec4c7..91196d4 100644
--- a/camera/device/default/ExternalCameraDeviceSession.cpp
+++ b/camera/device/default/ExternalCameraDeviceSession.cpp
@@ -538,6 +538,19 @@
return Status::INTERNAL_ERROR;
}
+ if (request.outputBuffers.empty()) {
+ ALOGE("%s: No output buffers provided.", __FUNCTION__);
+ return Status::ILLEGAL_ARGUMENT;
+ }
+
+ for (auto& outputBuf : request.outputBuffers) {
+ if (outputBuf.streamId == -1 || mStreamMap.find(outputBuf.streamId) == mStreamMap.end()) {
+ ALOGE("%s: Invalid streamId in CaptureRequest.outputBuffers: %d", __FUNCTION__,
+ outputBuf.streamId);
+ return Status::ILLEGAL_ARGUMENT;
+ }
+ }
+
const camera_metadata_t* rawSettings = nullptr;
bool converted;
CameraMetadata settingsFmq; // settings from FMQ
@@ -572,8 +585,6 @@
return Status::ILLEGAL_ARGUMENT;
}
- std::vector<buffer_handle_t*> allBufPtrs;
- std::vector<int> allFences;
size_t numOutputBufs = request.outputBuffers.size();
if (numOutputBufs == 0) {
@@ -629,11 +640,6 @@
}
}
- status = importRequestLocked(request, allBufPtrs, allFences);
- if (status != Status::OK) {
- return status;
- }
-
nsecs_t shutterTs = 0;
std::unique_ptr<V4L2Frame> frameIn = dequeueV4l2FrameLocked(&shutterTs);
if (frameIn == nullptr) {
@@ -656,8 +662,8 @@
halBuf.height = stream.height;
halBuf.format = stream.format;
halBuf.usage = stream.usage;
- halBuf.bufPtr = allBufPtrs[i];
- halBuf.acquireFence = allFences[i];
+ halBuf.bufPtr = nullptr; // threadloop will request buffer from cameraservice
+ halBuf.acquireFence = 0; // threadloop will request fence from cameraservice
halBuf.fenceTimeout = false;
}
{
@@ -789,8 +795,10 @@
outputBuffer.bufferId = buffer.bufferId;
outputBuffer.status = BufferStatus::ERROR;
if (buffer.acquireFence >= 0) {
- outputBuffer.releaseFence.fds.resize(1);
- outputBuffer.releaseFence.fds.at(0).set(buffer.acquireFence);
+ native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0);
+ handle->data[0] = buffer.acquireFence;
+ outputBuffer.releaseFence = android::dupToAidl(handle);
+ native_handle_delete(handle);
}
} else {
offlineBuffers.push_back(buffer);
@@ -1349,56 +1357,6 @@
return false;
}
-Status ExternalCameraDeviceSession::importRequestLocked(const CaptureRequest& request,
- std::vector<buffer_handle_t*>& allBufPtrs,
- std::vector<int>& allFences) {
- return importRequestLockedImpl(request, allBufPtrs, allFences);
-}
-
-Status ExternalCameraDeviceSession::importRequestLockedImpl(
- const CaptureRequest& request, std::vector<buffer_handle_t*>& allBufPtrs,
- std::vector<int>& allFences) {
- size_t numOutputBufs = request.outputBuffers.size();
- size_t numBufs = numOutputBufs;
- // Validate all I/O buffers
- std::vector<buffer_handle_t> allBufs;
- std::vector<uint64_t> allBufIds;
- allBufs.resize(numBufs);
- allBufIds.resize(numBufs);
- allBufPtrs.resize(numBufs);
- allFences.resize(numBufs);
- std::vector<int32_t> streamIds(numBufs);
-
- for (size_t i = 0; i < numOutputBufs; i++) {
- allBufs[i] = ::android::makeFromAidl(request.outputBuffers[i].buffer);
- allBufIds[i] = request.outputBuffers[i].bufferId;
- allBufPtrs[i] = &allBufs[i];
- streamIds[i] = request.outputBuffers[i].streamId;
- }
-
- {
- Mutex::Autolock _l(mCbsLock);
- for (size_t i = 0; i < numBufs; i++) {
- Status st = importBufferLocked(streamIds[i], allBufIds[i], allBufs[i], &allBufPtrs[i]);
- if (st != Status::OK) {
- // Detailed error logs printed in importBuffer
- return st;
- }
- }
- }
-
- // All buffers are imported. Now validate output buffer acquire fences
- for (size_t i = 0; i < numOutputBufs; i++) {
- if (!sHandleImporter.importFence(
- ::android::makeFromAidl(request.outputBuffers[i].acquireFence), allFences[i])) {
- ALOGE("%s: output buffer %zu acquire fence is invalid", __FUNCTION__, i);
- cleanupInflightFences(allFences, i);
- return Status::INTERNAL_ERROR;
- }
- }
- return Status::OK;
-}
-
Status ExternalCameraDeviceSession::importBuffer(int32_t streamId, uint64_t bufId,
buffer_handle_t buf,
/*out*/ buffer_handle_t** outBufPtr) {
@@ -1768,8 +1726,10 @@
result.outputBuffers[i].bufferId = req->buffers[i].bufferId;
result.outputBuffers[i].status = BufferStatus::ERROR;
if (req->buffers[i].acquireFence >= 0) {
- result.outputBuffers[i].releaseFence.fds.resize(1);
- result.outputBuffers[i].releaseFence.fds.at(0).set(req->buffers[i].acquireFence);
+ // numFds = 0 for error
+ native_handle_t* handle = native_handle_create(/*numFds*/ 0, /*numInts*/ 0);
+ result.outputBuffers[i].releaseFence = android::dupToAidl(handle);
+ native_handle_delete(handle);
}
}
@@ -1813,16 +1773,20 @@
if (req->buffers[i].fenceTimeout) {
result.outputBuffers[i].status = BufferStatus::ERROR;
if (req->buffers[i].acquireFence >= 0) {
- result.outputBuffers[i].releaseFence.fds.resize(1);
- result.outputBuffers[i].releaseFence.fds.at(0).set(req->buffers[i].acquireFence);
+ native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0);
+ handle->data[0] = req->buffers[i].acquireFence;
+ result.outputBuffers[i].releaseFence = android::dupToAidl(handle);
+ native_handle_delete(handle);
}
notifyError(req->frameNumber, req->buffers[i].streamId, ErrorCode::ERROR_BUFFER);
} else {
result.outputBuffers[i].status = BufferStatus::OK;
// TODO: refactor
if (req->buffers[i].acquireFence >= 0) {
- result.outputBuffers[i].releaseFence.fds.resize(1);
- result.outputBuffers[i].releaseFence.fds.at(0).set(req->buffers[i].acquireFence);
+ native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0);
+ handle->data[0] = req->buffers[i].acquireFence;
+ result.outputBuffers[i].releaseFence = android::dupToAidl(handle);
+ native_handle_delete(handle);
}
}
}
@@ -1997,9 +1961,16 @@
std::chrono::milliseconds timeout = std::chrono::milliseconds(kReqProcTimeoutMs);
auto st = mRequestDoneCond.wait_for(lk, timeout);
if (st == std::cv_status::timeout) {
+ mRequestingBuffer = false;
ALOGE("%s: wait for buffer request finish timeout!", __FUNCTION__);
return -1;
}
+
+ if (mPendingReturnBufferReqs.empty()) {
+ mRequestingBuffer = false;
+ ALOGE("%s: cameraservice did not return any buffers!", __FUNCTION__);
+ return -1;
+ }
}
mRequestingBuffer = false;
*outBufReqs = std::move(mPendingReturnBufferReqs);
@@ -2049,6 +2020,8 @@
if (!ret.isOk()) {
ALOGE("%s: Transaction error: %d:%d", __FUNCTION__, ret.getExceptionCode(),
ret.getServiceSpecificError());
+ mBufferReqs.clear();
+ mRequestDoneCond.notify_one();
return false;
}
@@ -2057,17 +2030,24 @@
if (bufRets.size() != mHalBufferReqs.size()) {
ALOGE("%s: expect %zu buffer requests returned, only got %zu", __FUNCTION__,
mHalBufferReqs.size(), bufRets.size());
+ mBufferReqs.clear();
+ lk.unlock();
+ mRequestDoneCond.notify_one();
return false;
}
auto parent = mParent.lock();
if (parent == nullptr) {
ALOGE("%s: session has been disconnected!", __FUNCTION__);
+ mBufferReqs.clear();
+ lk.unlock();
+ mRequestDoneCond.notify_one();
return false;
}
std::vector<int> importedFences;
importedFences.resize(bufRets.size());
+ bool hasError = false;
for (size_t i = 0; i < bufRets.size(); i++) {
int streamId = bufRets[i].streamId;
switch (bufRets[i].val.getTag()) {
@@ -2078,7 +2058,8 @@
bufRets[i].val.get<StreamBuffersVal::Tag::buffers>();
if (hBufs.size() != 1) {
ALOGE("%s: expect 1 buffer returned, got %zu!", __FUNCTION__, hBufs.size());
- return false;
+ hasError = true;
+ break;
}
const StreamBuffer& hBuf = hBufs[0];
@@ -2086,31 +2067,47 @@
// TODO: create a batch import API so we don't need to lock/unlock mCbsLock
// repeatedly?
lk.unlock();
- Status s =
- parent->importBuffer(streamId, hBuf.bufferId, makeFromAidl(hBuf.buffer),
- /*out*/ &mBufferReqs[i].bufPtr);
+ native_handle_t* h = makeFromAidl(hBuf.buffer);
+ Status s = parent->importBuffer(streamId, hBuf.bufferId, h,
+ /*out*/ &mBufferReqs[i].bufPtr);
+ native_handle_delete(h);
lk.lock();
if (s != Status::OK) {
ALOGE("%s: stream %d import buffer failed!", __FUNCTION__, streamId);
cleanupInflightFences(importedFences, i - 1);
- return false;
+ hasError = true;
+ break;
}
- if (!sHandleImporter.importFence(makeFromAidl(hBuf.acquireFence),
- mBufferReqs[i].acquireFence)) {
+ h = makeFromAidl(hBuf.acquireFence);
+ if (!sHandleImporter.importFence(h, mBufferReqs[i].acquireFence)) {
ALOGE("%s: stream %d import fence failed!", __FUNCTION__, streamId);
cleanupInflightFences(importedFences, i - 1);
- return false;
+ native_handle_delete(h);
+ hasError = true;
+ break;
}
+ native_handle_delete(h);
importedFences[i] = mBufferReqs[i].acquireFence;
} break;
default:
ALOGE("%s: Unknown StreamBuffersVal!", __FUNCTION__);
- return false;
+ hasError = true;
+ break;
+ }
+ if (hasError) {
+ mBufferReqs.clear();
+ lk.unlock();
+ mRequestDoneCond.notify_one();
+ return true;
}
}
} else {
ALOGE("%s: requestStreamBuffers call failed!", __FUNCTION__);
+ mBufferReqs.clear();
+ lk.unlock();
+ mRequestDoneCond.notify_one();
+ return true;
}
mPendingReturnBufferReqs = std::move(mBufferReqs);
@@ -2815,6 +2812,11 @@
if (res != 0) {
// For some webcam, the first few V4L2 frames might be malformed...
ALOGE("%s: Convert V4L2 frame to YU12 failed! res %d", __FUNCTION__, res);
+
+ ATRACE_BEGIN("Wait for BufferRequest done");
+ res = waitForBufferRequestDone(&req->buffers);
+ ATRACE_END();
+
lk.unlock();
Status st = parent->processCaptureRequestError(req);
if (st != Status::OK) {
@@ -2830,9 +2832,15 @@
ATRACE_END();
if (res != 0) {
+ // HAL buffer management buffer request can fail
ALOGE("%s: wait for BufferRequest done failed! res %d", __FUNCTION__, res);
lk.unlock();
- return onDeviceError("%s: failed to process buffer request error!", __FUNCTION__);
+ Status st = parent->processCaptureRequestError(req);
+ if (st != Status::OK) {
+ return onDeviceError("%s: failed to process capture request error!", __FUNCTION__);
+ }
+ signalRequestDone();
+ return true;
}
ALOGV("%s processing new request", __FUNCTION__);
diff --git a/camera/device/default/ExternalCameraDeviceSession.h b/camera/device/default/ExternalCameraDeviceSession.h
index 736bfd1..795b589 100644
--- a/camera/device/default/ExternalCameraDeviceSession.h
+++ b/camera/device/default/ExternalCameraDeviceSession.h
@@ -266,15 +266,6 @@
const std::vector<SupportedV4L2Format>& supportedFormats,
const ExternalCameraConfig& cfg);
- // Validate and import request's output buffers and acquire fence
- Status importRequestLocked(const CaptureRequest& request,
- std::vector<buffer_handle_t*>& allBufPtrs,
- std::vector<int>& allFences);
-
- Status importRequestLockedImpl(const CaptureRequest& request,
- std::vector<buffer_handle_t*>& allBufPtrs,
- std::vector<int>& allFences);
-
Status importBufferLocked(int32_t streamId, uint64_t bufId, buffer_handle_t buf,
/*out*/ buffer_handle_t** outBufPtr);
static void cleanupInflightFences(std::vector<int>& allFences, size_t numFences);
diff --git a/camera/device/default/ExternalCameraOfflineSession.cpp b/camera/device/default/ExternalCameraOfflineSession.cpp
index 53bd44f..2d4e2e0 100644
--- a/camera/device/default/ExternalCameraOfflineSession.cpp
+++ b/camera/device/default/ExternalCameraOfflineSession.cpp
@@ -110,7 +110,8 @@
if (req->buffers[i].acquireFence >= 0) {
native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0);
handle->data[0] = req->buffers[i].acquireFence;
- result.outputBuffers[i].releaseFence = android::makeToAidl(handle);
+ result.outputBuffers[i].releaseFence = android::dupToAidl(handle);
+ native_handle_delete(handle);
}
notifyError(req->frameNumber, req->buffers[i].streamId, ErrorCode::ERROR_BUFFER);
} else {
@@ -119,7 +120,8 @@
if (req->buffers[i].acquireFence >= 0) {
native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0);
handle->data[0] = req->buffers[i].acquireFence;
- outputBuffer.releaseFence = android::makeToAidl(handle);
+ outputBuffer.releaseFence = android::dupToAidl(handle);
+ native_handle_delete(handle);
}
}
}
@@ -247,7 +249,8 @@
if (req->buffers[i].acquireFence >= 0) {
native_handle_t* handle = native_handle_create(/*numFds*/ 1, /*numInts*/ 0);
handle->data[0] = req->buffers[i].acquireFence;
- outputBuffer.releaseFence = makeToAidl(handle);
+ outputBuffer.releaseFence = dupToAidl(handle);
+ native_handle_delete(handle);
}
}
diff --git a/camera/device/default/ExternalCameraUtils.cpp b/camera/device/default/ExternalCameraUtils.cpp
index 30c216f..2dc3c77 100644
--- a/camera/device/default/ExternalCameraUtils.cpp
+++ b/camera/device/default/ExternalCameraUtils.cpp
@@ -750,18 +750,12 @@
void freeReleaseFences(std::vector<CaptureResult>& results) {
for (auto& result : results) {
- native_handle_t* inputReleaseFence =
- ::android::makeFromAidl(result.inputBuffer.releaseFence);
- if (inputReleaseFence != nullptr) {
- native_handle_close(inputReleaseFence);
- native_handle_delete(inputReleaseFence);
- }
+ // NativeHandles free fd's on desctruction. Simply delete the objects!
+ result.inputBuffer.releaseFence.fds.clear(); // Implicitly closes fds
+ result.inputBuffer.releaseFence.ints.clear();
for (auto& buf : result.outputBuffers) {
- native_handle_t* outReleaseFence = ::android::makeFromAidl(buf.releaseFence);
- if (outReleaseFence != nullptr) {
- native_handle_close(outReleaseFence);
- native_handle_delete(outReleaseFence);
- }
+ buf.releaseFence.fds.clear(); // Implicitly closes fds
+ buf.releaseFence.ints.clear();
}
}
}
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl
index 542b296..9321ec0 100644
--- a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/CameraMetadataTag.aidl
@@ -246,6 +246,7 @@
ANDROID_SENSOR_OPAQUE_RAW_SIZE_MAXIMUM_RESOLUTION,
ANDROID_SENSOR_PIXEL_MODE,
ANDROID_SENSOR_RAW_BINNING_FACTOR_USED,
+ ANDROID_SENSOR_READOUT_TIMESTAMP,
ANDROID_SENSOR_INFO_ACTIVE_ARRAY_SIZE = android.hardware.camera.metadata.CameraMetadataSectionStart.ANDROID_SENSOR_INFO_START /* 983040 */,
ANDROID_SENSOR_INFO_SENSITIVITY_RANGE,
ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT,
diff --git a/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorReadoutTimestamp.aidl b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorReadoutTimestamp.aidl
new file mode 100644
index 0000000..35dc1a9
--- /dev/null
+++ b/camera/metadata/aidl/aidl_api/android.hardware.camera.metadata/current/android/hardware/camera/metadata/SensorReadoutTimestamp.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2024 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.
+ *//*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.camera.metadata;
+@Backing(type="int") @VintfStability
+enum SensorReadoutTimestamp {
+ ANDROID_SENSOR_READOUT_TIMESTAMP_NOT_SUPPORTED,
+ ANDROID_SENSOR_READOUT_TIMESTAMP_HARDWARE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLensFacing.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLensFacing.aidl
index 8cd2229..19822fc 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLensFacing.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLensFacing.aidl
@@ -25,6 +25,7 @@
/**
* android.automotive.lens.facing enumeration values
* @see ANDROID_AUTOMOTIVE_LENS_FACING
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLocation.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLocation.aidl
index 0ef64b4..6c3edbe 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLocation.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/AutomotiveLocation.aidl
@@ -25,6 +25,7 @@
/**
* android.automotive.location enumeration values
* @see ANDROID_AUTOMOTIVE_LOCATION
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/BlackLevelLock.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/BlackLevelLock.aidl
index 4746cf3..8d3443a 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/BlackLevelLock.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/BlackLevelLock.aidl
@@ -25,6 +25,7 @@
/**
* android.blackLevel.lock enumeration values
* @see ANDROID_BLACK_LEVEL_LOCK
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl
index 03cfba1..f133372 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/CameraMetadataTag.aidl
@@ -1591,6 +1591,13 @@
*/
ANDROID_SENSOR_RAW_BINNING_FACTOR_USED,
/**
+ * android.sensor.readoutTimestamp [static, enum, java_public]
+ *
+ * <p>Whether or not the camera device supports readout timestamp and
+ * {@code onReadoutStarted} callback.</p>
+ */
+ ANDROID_SENSOR_READOUT_TIMESTAMP,
+ /**
* android.sensor.info.activeArraySize [static, int32[], public]
*
* <p>The area of the image sensor which corresponds to active pixels after any geometric
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl
index 890ac0e..a0f6c83 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionAberrationMode.aidl
@@ -25,6 +25,7 @@
/**
* android.colorCorrection.aberrationMode enumeration values
* @see ANDROID_COLOR_CORRECTION_ABERRATION_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionMode.aidl
index 080ca02..2a51bfc 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ColorCorrectionMode.aidl
@@ -25,6 +25,7 @@
/**
* android.colorCorrection.mode enumeration values
* @see ANDROID_COLOR_CORRECTION_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl
index 8a2f501..47f7ebf 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeAntibandingMode.aidl
@@ -25,6 +25,7 @@
/**
* android.control.aeAntibandingMode enumeration values
* @see ANDROID_CONTROL_AE_ANTIBANDING_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLock.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLock.aidl
index ab56fdc..e226ac0 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLock.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLock.aidl
@@ -25,6 +25,7 @@
/**
* android.control.aeLock enumeration values
* @see ANDROID_CONTROL_AE_LOCK
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLockAvailable.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLockAvailable.aidl
index b846fc1..a62cd27 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLockAvailable.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeLockAvailable.aidl
@@ -25,6 +25,7 @@
/**
* android.control.aeLockAvailable enumeration values
* @see ANDROID_CONTROL_AE_LOCK_AVAILABLE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl
index 70174be..9f7aaae 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeMode.aidl
@@ -25,6 +25,7 @@
/**
* android.control.aeMode enumeration values
* @see ANDROID_CONTROL_AE_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl
index 2229712..5275cd1 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAePrecaptureTrigger.aidl
@@ -25,6 +25,7 @@
/**
* android.control.aePrecaptureTrigger enumeration values
* @see ANDROID_CONTROL_AE_PRECAPTURE_TRIGGER
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeState.aidl
index af8c2cf..ffdf7d4 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeState.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAeState.aidl
@@ -25,6 +25,7 @@
/**
* android.control.aeState enumeration values
* @see ANDROID_CONTROL_AE_STATE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfMode.aidl
index 344f2de..cff3a25 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfMode.aidl
@@ -25,6 +25,7 @@
/**
* android.control.afMode enumeration values
* @see ANDROID_CONTROL_AF_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfSceneChange.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfSceneChange.aidl
index 153611a..dce31de 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfSceneChange.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfSceneChange.aidl
@@ -25,6 +25,7 @@
/**
* android.control.afSceneChange enumeration values
* @see ANDROID_CONTROL_AF_SCENE_CHANGE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfState.aidl
index 2c8d602..cbdc28f 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfState.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfState.aidl
@@ -25,6 +25,7 @@
/**
* android.control.afState enumeration values
* @see ANDROID_CONTROL_AF_STATE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfTrigger.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfTrigger.aidl
index b68d4c7..0c82b25 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfTrigger.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAfTrigger.aidl
@@ -25,6 +25,7 @@
/**
* android.control.afTrigger enumeration values
* @see ANDROID_CONTROL_AF_TRIGGER
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframing.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframing.aidl
index 0fef373..ba18491 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframing.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframing.aidl
@@ -25,6 +25,7 @@
/**
* android.control.autoframing enumeration values
* @see ANDROID_CONTROL_AUTOFRAMING
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframingAvailable.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframingAvailable.aidl
index da0d348..fd45647 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframingAvailable.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframingAvailable.aidl
@@ -25,6 +25,7 @@
/**
* android.control.autoframingAvailable enumeration values
* @see ANDROID_CONTROL_AUTOFRAMING_AVAILABLE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframingState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframingState.aidl
index 13183a5..9ac200a 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframingState.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAutoframingState.aidl
@@ -25,6 +25,7 @@
/**
* android.control.autoframingState enumeration values
* @see ANDROID_CONTROL_AUTOFRAMING_STATE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLock.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLock.aidl
index f7229f2..a1e6a79 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLock.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLock.aidl
@@ -25,6 +25,7 @@
/**
* android.control.awbLock enumeration values
* @see ANDROID_CONTROL_AWB_LOCK
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl
index 0cb6ebe..4a69f87 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbLockAvailable.aidl
@@ -25,6 +25,7 @@
/**
* android.control.awbLockAvailable enumeration values
* @see ANDROID_CONTROL_AWB_LOCK_AVAILABLE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbMode.aidl
index 2f9b801..043841a 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbMode.aidl
@@ -25,6 +25,7 @@
/**
* android.control.awbMode enumeration values
* @see ANDROID_CONTROL_AWB_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbState.aidl
index 1a93191..835d299 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbState.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlAwbState.aidl
@@ -25,6 +25,7 @@
/**
* android.control.awbState enumeration values
* @see ANDROID_CONTROL_AWB_STATE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlCaptureIntent.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlCaptureIntent.aidl
index 132d98c..1cd5467 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlCaptureIntent.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlCaptureIntent.aidl
@@ -25,6 +25,7 @@
/**
* android.control.captureIntent enumeration values
* @see ANDROID_CONTROL_CAPTURE_INTENT
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlEffectMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlEffectMode.aidl
index 1668cb3..f4586c2 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlEffectMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlEffectMode.aidl
@@ -25,6 +25,7 @@
/**
* android.control.effectMode enumeration values
* @see ANDROID_CONTROL_EFFECT_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlEnableZsl.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlEnableZsl.aidl
index a83c051..6fffa5e 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlEnableZsl.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlEnableZsl.aidl
@@ -25,6 +25,7 @@
/**
* android.control.enableZsl enumeration values
* @see ANDROID_CONTROL_ENABLE_ZSL
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl
index 2fe66cf..b95a4f5 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlExtendedSceneMode.aidl
@@ -25,6 +25,7 @@
/**
* android.control.extendedSceneMode enumeration values
* @see ANDROID_CONTROL_EXTENDED_SCENE_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlLowLightBoostState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlLowLightBoostState.aidl
index 67591c8..19be8fc 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlLowLightBoostState.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlLowLightBoostState.aidl
@@ -25,6 +25,7 @@
/**
* android.control.lowLightBoostState enumeration values
* @see ANDROID_CONTROL_LOW_LIGHT_BOOST_STATE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlMode.aidl
index d9ab9ab..b964d45 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlMode.aidl
@@ -25,6 +25,7 @@
/**
* android.control.mode enumeration values
* @see ANDROID_CONTROL_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlSceneMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlSceneMode.aidl
index 0f90aaa..f5c0a4a 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlSceneMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlSceneMode.aidl
@@ -25,6 +25,7 @@
/**
* android.control.sceneMode enumeration values
* @see ANDROID_CONTROL_SCENE_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlSettingsOverride.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlSettingsOverride.aidl
index d97f7c8..d0ee992 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlSettingsOverride.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlSettingsOverride.aidl
@@ -25,6 +25,7 @@
/**
* android.control.settingsOverride enumeration values
* @see ANDROID_CONTROL_SETTINGS_OVERRIDE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl
index 497846c..94cc626 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ControlVideoStabilizationMode.aidl
@@ -25,6 +25,7 @@
/**
* android.control.videoStabilizationMode enumeration values
* @see ANDROID_CONTROL_VIDEO_STABILIZATION_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DemosaicMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DemosaicMode.aidl
index 7d8cdcf..0c389aa 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/DemosaicMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DemosaicMode.aidl
@@ -25,6 +25,7 @@
/**
* android.demosaic.mode enumeration values
* @see ANDROID_DEMOSAIC_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl
index 7deb350..3cc882b 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurations.aidl
@@ -25,6 +25,7 @@
/**
* android.depth.availableDepthStreamConfigurations enumeration values
* @see ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl
index 5d06be1..658f3bb 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDepthStreamConfigurationsMaximumResolution.aidl
@@ -25,6 +25,7 @@
/**
* android.depth.availableDepthStreamConfigurationsMaximumResolution enumeration values
* @see ANDROID_DEPTH_AVAILABLE_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl
index 39a99b9..1ec3d11 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurations.aidl
@@ -25,6 +25,7 @@
/**
* android.depth.availableDynamicDepthStreamConfigurations enumeration values
* @see ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl
index 30ea9b7..b0ad00e 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DepthAvailableDynamicDepthStreamConfigurationsMaximumResolution.aidl
@@ -25,6 +25,7 @@
/**
* android.depth.availableDynamicDepthStreamConfigurationsMaximumResolution enumeration values
* @see ANDROID_DEPTH_AVAILABLE_DYNAMIC_DEPTH_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl
index 4af81d9..de31b41 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DepthDepthIsExclusive.aidl
@@ -25,6 +25,7 @@
/**
* android.depth.depthIsExclusive enumeration values
* @see ANDROID_DEPTH_DEPTH_IS_EXCLUSIVE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/DistortionCorrectionMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/DistortionCorrectionMode.aidl
index 3456207..fbf7abb 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/DistortionCorrectionMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/DistortionCorrectionMode.aidl
@@ -25,6 +25,7 @@
/**
* android.distortionCorrection.mode enumeration values
* @see ANDROID_DISTORTION_CORRECTION_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/EdgeMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/EdgeMode.aidl
index 1e15523..81bd04c 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/EdgeMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/EdgeMode.aidl
@@ -25,6 +25,7 @@
/**
* android.edge.mode enumeration values
* @see ANDROID_EDGE_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/FlashInfoAvailable.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/FlashInfoAvailable.aidl
index 0528037..b938d82 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/FlashInfoAvailable.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/FlashInfoAvailable.aidl
@@ -25,6 +25,7 @@
/**
* android.flash.info.available enumeration values
* @see ANDROID_FLASH_INFO_AVAILABLE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/FlashMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/FlashMode.aidl
index e175596..b279c44 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/FlashMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/FlashMode.aidl
@@ -25,6 +25,7 @@
/**
* android.flash.mode enumeration values
* @see ANDROID_FLASH_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/FlashState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/FlashState.aidl
index fc398f8..b029566 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/FlashState.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/FlashState.aidl
@@ -25,6 +25,7 @@
/**
* android.flash.state enumeration values
* @see ANDROID_FLASH_STATE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl
index fc9b6ec..c31cfba 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurations.aidl
@@ -25,6 +25,7 @@
/**
* android.heic.availableHeicStreamConfigurations enumeration values
* @see ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl
index 13b50ab..bf5d92e 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/HeicAvailableHeicStreamConfigurationsMaximumResolution.aidl
@@ -25,6 +25,7 @@
/**
* android.heic.availableHeicStreamConfigurationsMaximumResolution enumeration values
* @see ANDROID_HEIC_AVAILABLE_HEIC_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/HeicInfoSupported.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/HeicInfoSupported.aidl
index c4e04f1..88825e6 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/HeicInfoSupported.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/HeicInfoSupported.aidl
@@ -25,6 +25,7 @@
/**
* android.heic.info.supported enumeration values
* @see ANDROID_HEIC_INFO_SUPPORTED
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/HotPixelMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/HotPixelMode.aidl
index 7b7aa21..bd99569 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/HotPixelMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/HotPixelMode.aidl
@@ -25,6 +25,7 @@
/**
* android.hotPixel.mode enumeration values
* @see ANDROID_HOT_PIXEL_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl
index 964d079..a84f3cc 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedBufferManagementVersion.aidl
@@ -25,6 +25,7 @@
/**
* android.info.supportedBufferManagementVersion enumeration values
* @see ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl
index f242009..0ea6287 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/InfoSupportedHardwareLevel.aidl
@@ -25,6 +25,7 @@
/**
* android.info.supportedHardwareLevel enumeration values
* @see ANDROID_INFO_SUPPORTED_HARDWARE_LEVEL
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/JpegrAvailableJpegRStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/JpegrAvailableJpegRStreamConfigurations.aidl
index 911a062..834ed5d 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/JpegrAvailableJpegRStreamConfigurations.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/JpegrAvailableJpegRStreamConfigurations.aidl
@@ -25,6 +25,7 @@
/**
* android.jpegr.availableJpegRStreamConfigurations enumeration values
* @see ANDROID_JPEGR_AVAILABLE_JPEG_R_STREAM_CONFIGURATIONS
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/JpegrAvailableJpegRStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/JpegrAvailableJpegRStreamConfigurationsMaximumResolution.aidl
index 9e78662..eb0d847 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/JpegrAvailableJpegRStreamConfigurationsMaximumResolution.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/JpegrAvailableJpegRStreamConfigurationsMaximumResolution.aidl
@@ -25,6 +25,7 @@
/**
* android.jpegr.availableJpegRStreamConfigurationsMaximumResolution enumeration values
* @see ANDROID_JPEGR_AVAILABLE_JPEG_R_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LedAvailableLeds.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LedAvailableLeds.aidl
index f26fcde..ba564c4 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/LedAvailableLeds.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/LedAvailableLeds.aidl
@@ -25,6 +25,7 @@
/**
* android.led.availableLeds enumeration values
* @see ANDROID_LED_AVAILABLE_LEDS
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LedTransmit.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LedTransmit.aidl
index 62c9bd7..f8b40ca 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/LedTransmit.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/LedTransmit.aidl
@@ -25,6 +25,7 @@
/**
* android.led.transmit enumeration values
* @see ANDROID_LED_TRANSMIT
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LensFacing.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LensFacing.aidl
index 0677ea9..fa9cb14 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/LensFacing.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/LensFacing.aidl
@@ -25,6 +25,7 @@
/**
* android.lens.facing enumeration values
* @see ANDROID_LENS_FACING
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl
index 1c82bb0..2060e97 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/LensInfoFocusDistanceCalibration.aidl
@@ -25,6 +25,7 @@
/**
* android.lens.info.focusDistanceCalibration enumeration values
* @see ANDROID_LENS_INFO_FOCUS_DISTANCE_CALIBRATION
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl
index e350e15..03f8711 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/LensOpticalStabilizationMode.aidl
@@ -25,6 +25,7 @@
/**
* android.lens.opticalStabilizationMode enumeration values
* @see ANDROID_LENS_OPTICAL_STABILIZATION_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LensPoseReference.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LensPoseReference.aidl
index 3e6034b..124c670 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/LensPoseReference.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/LensPoseReference.aidl
@@ -25,6 +25,7 @@
/**
* android.lens.poseReference enumeration values
* @see ANDROID_LENS_POSE_REFERENCE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LensState.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LensState.aidl
index 0e5a04c..216bfb1 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/LensState.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/LensState.aidl
@@ -25,6 +25,7 @@
/**
* android.lens.state enumeration values
* @see ANDROID_LENS_STATE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl
index 623a15c..ee6a1a0 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/LogicalMultiCameraSensorSyncType.aidl
@@ -25,6 +25,7 @@
/**
* android.logicalMultiCamera.sensorSyncType enumeration values
* @see ANDROID_LOGICAL_MULTI_CAMERA_SENSOR_SYNC_TYPE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/NoiseReductionMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/NoiseReductionMode.aidl
index 947361d..7303512 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/NoiseReductionMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/NoiseReductionMode.aidl
@@ -25,6 +25,7 @@
/**
* android.noiseReduction.mode enumeration values
* @see ANDROID_NOISE_REDUCTION_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/QuirksPartialResult.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/QuirksPartialResult.aidl
index 15a79b0..3af9f85 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/QuirksPartialResult.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/QuirksPartialResult.aidl
@@ -25,6 +25,7 @@
/**
* android.quirks.partialResult enumeration values
* @see ANDROID_QUIRKS_PARTIAL_RESULT
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl
index ebe0b4c..a8e5fe0 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableCapabilities.aidl
@@ -25,6 +25,7 @@
/**
* android.request.availableCapabilities enumeration values
* @see ANDROID_REQUEST_AVAILABLE_CAPABILITIES
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableColorSpaceProfilesMap.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableColorSpaceProfilesMap.aidl
index b397dea..ee36480 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableColorSpaceProfilesMap.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableColorSpaceProfilesMap.aidl
@@ -25,6 +25,7 @@
/**
* android.request.availableColorSpaceProfilesMap enumeration values
* @see ANDROID_REQUEST_AVAILABLE_COLOR_SPACE_PROFILES_MAP
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="long")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl
index f04fae3..d7598d6 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestAvailableDynamicRangeProfilesMap.aidl
@@ -25,6 +25,7 @@
/**
* android.request.availableDynamicRangeProfilesMap enumeration values
* @see ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="long")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestMetadataMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestMetadataMode.aidl
index 37d4095..d526393 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/RequestMetadataMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestMetadataMode.aidl
@@ -25,6 +25,7 @@
/**
* android.request.metadataMode enumeration values
* @see ANDROID_REQUEST_METADATA_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/RequestType.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/RequestType.aidl
index 5010a37..a8c97cb 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/RequestType.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/RequestType.aidl
@@ -25,6 +25,7 @@
/**
* android.request.type enumeration values
* @see ANDROID_REQUEST_TYPE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableFormats.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableFormats.aidl
index a8e67bb..fb42654 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableFormats.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableFormats.aidl
@@ -25,6 +25,7 @@
/**
* android.scaler.availableFormats enumeration values
* @see ANDROID_SCALER_AVAILABLE_FORMATS
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl
index 57c3989..7498abf 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableRecommendedStreamConfigurations.aidl
@@ -25,6 +25,7 @@
/**
* android.scaler.availableRecommendedStreamConfigurations enumeration values
* @see ANDROID_SCALER_AVAILABLE_RECOMMENDED_STREAM_CONFIGURATIONS
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl
index 2b493ae..66599ae 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurations.aidl
@@ -25,6 +25,7 @@
/**
* android.scaler.availableStreamConfigurations enumeration values
* @see ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl
index 4f6cb5e..ec9c5db 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamConfigurationsMaximumResolution.aidl
@@ -25,6 +25,7 @@
/**
* android.scaler.availableStreamConfigurationsMaximumResolution enumeration values
* @see ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS_MAXIMUM_RESOLUTION
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl
index da27a48..eed16fa 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerAvailableStreamUseCases.aidl
@@ -25,6 +25,7 @@
/**
* android.scaler.availableStreamUseCases enumeration values
* @see ANDROID_SCALER_AVAILABLE_STREAM_USE_CASES
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="long")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerCroppingType.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerCroppingType.aidl
index e44eff1..bf3672d 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerCroppingType.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerCroppingType.aidl
@@ -25,6 +25,7 @@
/**
* android.scaler.croppingType enumeration values
* @see ANDROID_SCALER_CROPPING_TYPE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl
index f7cbc0f..d75aa7d 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerMultiResolutionStreamSupported.aidl
@@ -25,6 +25,7 @@
/**
* android.scaler.multiResolutionStreamSupported enumeration values
* @see ANDROID_SCALER_MULTI_RESOLUTION_STREAM_SUPPORTED
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl
index 9427854..c725572 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerPhysicalCameraMultiResolutionStreamConfigurations.aidl
@@ -25,6 +25,7 @@
/**
* android.scaler.physicalCameraMultiResolutionStreamConfigurations enumeration values
* @see ANDROID_SCALER_PHYSICAL_CAMERA_MULTI_RESOLUTION_STREAM_CONFIGURATIONS
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl
index 9050153..b49dec0 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ScalerRotateAndCrop.aidl
@@ -25,6 +25,7 @@
/**
* android.scaler.rotateAndCrop enumeration values
* @see ANDROID_SCALER_ROTATE_AND_CROP
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl
index 59a4038..1d8190c 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoColorFilterArrangement.aidl
@@ -25,6 +25,7 @@
/**
* android.sensor.info.colorFilterArrangement enumeration values
* @see ANDROID_SENSOR_INFO_COLOR_FILTER_ARRANGEMENT
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl
index 8892ad3..c5169af 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoLensShadingApplied.aidl
@@ -25,6 +25,7 @@
/**
* android.sensor.info.lensShadingApplied enumeration values
* @see ANDROID_SENSOR_INFO_LENS_SHADING_APPLIED
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl
index 2a5860b..de65ef7 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorInfoTimestampSource.aidl
@@ -25,6 +25,7 @@
/**
* android.sensor.info.timestampSource enumeration values
* @see ANDROID_SENSOR_INFO_TIMESTAMP_SOURCE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorPixelMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorPixelMode.aidl
index 3dda07b..a76e479 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/SensorPixelMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorPixelMode.aidl
@@ -25,6 +25,7 @@
/**
* android.sensor.pixelMode enumeration values
* @see ANDROID_SENSOR_PIXEL_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl
index 20e92e4..8b421ba 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorRawBinningFactorUsed.aidl
@@ -25,6 +25,7 @@
/**
* android.sensor.rawBinningFactorUsed enumeration values
* @see ANDROID_SENSOR_RAW_BINNING_FACTOR_USED
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorReadoutTimestamp.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorReadoutTimestamp.aidl
new file mode 100644
index 0000000..f5ab369
--- /dev/null
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorReadoutTimestamp.aidl
@@ -0,0 +1,35 @@
+/*
+ * Copyright (C) 2022 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.
+ */
+
+/*
+ * Autogenerated from camera metadata definitions in
+ * /system/media/camera/docs/metadata_definitions.xml
+ * *** DO NOT EDIT BY HAND ***
+ */
+
+package android.hardware.camera.metadata;
+
+/**
+ * android.sensor.readoutTimestamp enumeration values
+ * @see ANDROID_SENSOR_READOUT_TIMESTAMP
+ * See system/media/camera/docs/metadata_definitions.xml for details.
+ */
+@VintfStability
+@Backing(type="int")
+enum SensorReadoutTimestamp {
+ ANDROID_SENSOR_READOUT_TIMESTAMP_NOT_SUPPORTED,
+ ANDROID_SENSOR_READOUT_TIMESTAMP_HARDWARE,
+}
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl
index c8c9216..a0a3a40 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorReferenceIlluminant1.aidl
@@ -25,6 +25,7 @@
/**
* android.sensor.referenceIlluminant1 enumeration values
* @see ANDROID_SENSOR_REFERENCE_ILLUMINANT1
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SensorTestPatternMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SensorTestPatternMode.aidl
index 29aede4..4ad0503 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/SensorTestPatternMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SensorTestPatternMode.aidl
@@ -25,6 +25,7 @@
/**
* android.sensor.testPatternMode enumeration values
* @see ANDROID_SENSOR_TEST_PATTERN_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/ShadingMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/ShadingMode.aidl
index 6939b72..2080195 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/ShadingMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/ShadingMode.aidl
@@ -25,6 +25,7 @@
/**
* android.shading.mode enumeration values
* @see ANDROID_SHADING_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl
index 0d17791..55d79cd 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsFaceDetectMode.aidl
@@ -25,6 +25,7 @@
/**
* android.statistics.faceDetectMode enumeration values
* @see ANDROID_STATISTICS_FACE_DETECT_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHistogramMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHistogramMode.aidl
index a9b6f68..de1cfee 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHistogramMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHistogramMode.aidl
@@ -25,6 +25,7 @@
/**
* android.statistics.histogramMode enumeration values
* @see ANDROID_STATISTICS_HISTOGRAM_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl
index 286291a..b81a7cd 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsHotPixelMapMode.aidl
@@ -25,6 +25,7 @@
/**
* android.statistics.hotPixelMapMode enumeration values
* @see ANDROID_STATISTICS_HOT_PIXEL_MAP_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl
index d21b222..3a91c71 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsLensShadingMapMode.aidl
@@ -25,6 +25,7 @@
/**
* android.statistics.lensShadingMapMode enumeration values
* @see ANDROID_STATISTICS_LENS_SHADING_MAP_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsOisDataMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsOisDataMode.aidl
index afb281f..42801ed 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsOisDataMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsOisDataMode.aidl
@@ -25,6 +25,7 @@
/**
* android.statistics.oisDataMode enumeration values
* @see ANDROID_STATISTICS_OIS_DATA_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl
index da2402af..371e9fb 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSceneFlicker.aidl
@@ -25,6 +25,7 @@
/**
* android.statistics.sceneFlicker enumeration values
* @see ANDROID_STATISTICS_SCENE_FLICKER
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl
index ed6c65c..487e8ac 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/StatisticsSharpnessMapMode.aidl
@@ -25,6 +25,7 @@
/**
* android.statistics.sharpnessMapMode enumeration values
* @see ANDROID_STATISTICS_SHARPNESS_MAP_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SyncFrameNumber.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SyncFrameNumber.aidl
index e33319e..148718d 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/SyncFrameNumber.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SyncFrameNumber.aidl
@@ -25,6 +25,7 @@
/**
* android.sync.frameNumber enumeration values
* @see ANDROID_SYNC_FRAME_NUMBER
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/SyncMaxLatency.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/SyncMaxLatency.aidl
index cb0668f..7df4ff0 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/SyncMaxLatency.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/SyncMaxLatency.aidl
@@ -25,6 +25,7 @@
/**
* android.sync.maxLatency enumeration values
* @see ANDROID_SYNC_MAX_LATENCY
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/TonemapMode.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/TonemapMode.aidl
index d4b7e0eb..ed53060 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/TonemapMode.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/TonemapMode.aidl
@@ -25,6 +25,7 @@
/**
* android.tonemap.mode enumeration values
* @see ANDROID_TONEMAP_MODE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/metadata/aidl/android/hardware/camera/metadata/TonemapPresetCurve.aidl b/camera/metadata/aidl/android/hardware/camera/metadata/TonemapPresetCurve.aidl
index 2da3704..c6fed00 100644
--- a/camera/metadata/aidl/android/hardware/camera/metadata/TonemapPresetCurve.aidl
+++ b/camera/metadata/aidl/android/hardware/camera/metadata/TonemapPresetCurve.aidl
@@ -25,6 +25,7 @@
/**
* android.tonemap.presetCurve enumeration values
* @see ANDROID_TONEMAP_PRESET_CURVE
+ * See system/media/camera/docs/metadata_definitions.xml for details.
*/
@VintfStability
@Backing(type="int")
diff --git a/camera/provider/2.4/default/ExternalCameraProviderImpl_2_4.cpp b/camera/provider/2.4/default/ExternalCameraProviderImpl_2_4.cpp
index 2d919cc..bb76795 100644
--- a/camera/provider/2.4/default/ExternalCameraProviderImpl_2_4.cpp
+++ b/camera/provider/2.4/default/ExternalCameraProviderImpl_2_4.cpp
@@ -95,14 +95,13 @@
Return<Status> ExternalCameraProviderImpl_2_4::setCallback(
const sp<ICameraProviderCallback>& callback) {
- if (callback == nullptr) {
- return Status::ILLEGAL_ARGUMENT;
- }
-
{
Mutex::Autolock _l(mLock);
mCallbacks = callback;
}
+ if (callback == nullptr) {
+ return Status::OK;
+ }
// Send a callback for all devices to initialize
{
for (const auto& pair : mCameraStatusMap) {
diff --git a/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp b/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp
index 07ed689..f039644 100644
--- a/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp
+++ b/camera/provider/2.4/default/LegacyCameraProviderImpl_2_4.cpp
@@ -448,11 +448,11 @@
// Methods from ::android::hardware::camera::provider::V2_4::ICameraProvider follow.
Return<Status> LegacyCameraProviderImpl_2_4::setCallback(
const sp<ICameraProviderCallback>& callback) {
- if (callback == nullptr) {
- return Status::ILLEGAL_ARGUMENT;
- }
Mutex::Autolock _l(mCbLock);
mCallbacks = callback;
+ if (callback == nullptr) {
+ return Status::OK;
+ }
// Add and report all presenting external cameras.
for (auto const& statusPair : mCameraStatusMap) {
int id = std::stoi(statusPair.first);
diff --git a/camera/provider/aidl/vts/Android.bp b/camera/provider/aidl/vts/Android.bp
index aa553ee..6716b8e 100644
--- a/camera/provider/aidl/vts/Android.bp
+++ b/camera/provider/aidl/vts/Android.bp
@@ -62,7 +62,7 @@
"android.hardware.camera.common@1.0-helper",
"android.hardware.camera.common-V1-ndk",
"android.hardware.camera.device-V3-ndk",
- "android.hardware.camera.metadata-V2-ndk",
+ "android.hardware.camera.metadata-V3-ndk",
"android.hardware.camera.provider-V3-ndk",
"android.hidl.allocator@1.0",
"libgrallocusage",
diff --git a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
index e335853..9a5f248 100644
--- a/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
+++ b/camera/provider/aidl/vts/VtsAidlHalCameraProvider_TargetTest.cpp
@@ -283,6 +283,64 @@
}
}
+TEST_P(CameraAidlTest, getSessionCharacteristics) {
+ if (flags::feature_combination_query()) {
+ std::vector<std::string> cameraDeviceNames = getCameraDeviceNames(mProvider);
+
+ for (const auto& name : cameraDeviceNames) {
+ std::shared_ptr<ICameraDevice> device;
+ ALOGI("getSessionCharacteristics: Testing camera device %s", name.c_str());
+ ndk::ScopedAStatus ret = mProvider->getCameraDeviceInterface(name, &device);
+ ALOGI("getCameraDeviceInterface returns: %d:%d", ret.getExceptionCode(),
+ ret.getServiceSpecificError());
+ ASSERT_TRUE(ret.isOk());
+ ASSERT_NE(device, nullptr);
+
+ CameraMetadata meta;
+ openEmptyDeviceSession(name, mProvider, &mSession /*out*/, &meta /*out*/,
+ &device /*out*/);
+
+ std::vector<AvailableStream> outputStreams;
+ camera_metadata_t* staticMeta =
+ reinterpret_cast<camera_metadata_t*>(meta.metadata.data());
+ outputStreams.clear();
+ ASSERT_EQ(Status::OK, getAvailableOutputStreams(staticMeta, outputStreams));
+ ASSERT_NE(0u, outputStreams.size());
+
+ AvailableStream sampleStream = outputStreams[0];
+
+ int32_t streamId = 0;
+ Stream stream = {streamId,
+ StreamType::OUTPUT,
+ sampleStream.width,
+ sampleStream.height,
+ static_cast<PixelFormat>(sampleStream.format),
+ static_cast<aidl::android::hardware::graphics::common::BufferUsage>(
+ GRALLOC1_CONSUMER_USAGE_VIDEO_ENCODER),
+ Dataspace::UNKNOWN,
+ StreamRotation::ROTATION_0,
+ std::string(),
+ /*bufferSize*/ 0,
+ /*groupId*/ -1,
+ {SensorPixelMode::ANDROID_SENSOR_PIXEL_MODE_DEFAULT},
+ RequestAvailableDynamicRangeProfilesMap::
+ ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD};
+
+ std::vector<Stream> streams = {stream};
+ StreamConfiguration config;
+ createStreamConfiguration(streams, StreamConfigurationMode::NORMAL_MODE, &config);
+
+ CameraMetadata chars;
+ ret = device->getSessionCharacteristics(config, &chars);
+ ASSERT_TRUE(ret.isOk());
+ verifySessionCharacteristics(chars);
+ }
+ } else {
+ ALOGI("getSessionCharacteristics: Test skipped.\n");
+ GTEST_SKIP();
+ }
+}
+
// Verify that the torch strength level can be set and retrieved successfully.
TEST_P(CameraAidlTest, turnOnTorchWithStrengthLevel) {
std::vector<std::string> cameraDeviceNames = getCameraDeviceNames(mProvider);
@@ -531,11 +589,7 @@
}
if (ret.isOk()) {
- const camera_metadata_t* metadata = (camera_metadata_t*)rawMetadata.metadata.data();
- size_t expectedSize = rawMetadata.metadata.size();
- int result = validate_camera_metadata_structure(metadata, &expectedSize);
- ASSERT_TRUE((result == 0) || (result == CAMERA_METADATA_VALIDATION_SHIFTED));
- verifyRequestTemplate(metadata, reqTemplate);
+ validateDefaultRequestMetadata(reqTemplate, rawMetadata);
} else {
ASSERT_EQ(0u, rawMetadata.metadata.size());
}
@@ -546,24 +600,12 @@
ndk::ScopedAStatus ret2 =
device->constructDefaultRequestSettings(reqTemplate, &rawMetadata2);
- // TODO: Do not allow OPERATION_NOT_SUPPORTED once HAL
- // implementation is in place.
- if (static_cast<Status>(ret2.getServiceSpecificError()) !=
- Status::OPERATION_NOT_SUPPORTED) {
- ASSERT_EQ(ret.isOk(), ret2.isOk());
- ASSERT_EQ(ret.getStatus(), ret2.getStatus());
+ ASSERT_EQ(ret.isOk(), ret2.isOk());
+ ASSERT_EQ(ret.getStatus(), ret2.getStatus());
- ASSERT_EQ(rawMetadata.metadata.size(), rawMetadata2.metadata.size());
- if (ret2.isOk()) {
- const camera_metadata_t* metadata =
- (camera_metadata_t*)rawMetadata2.metadata.data();
- size_t expectedSize = rawMetadata2.metadata.size();
- int result =
- validate_camera_metadata_structure(metadata, &expectedSize);
- ASSERT_TRUE((result == 0) ||
- (result == CAMERA_METADATA_VALIDATION_SHIFTED));
- verifyRequestTemplate(metadata, reqTemplate);
- }
+ ASSERT_EQ(rawMetadata.metadata.size(), rawMetadata2.metadata.size());
+ if (ret2.isOk()) {
+ validateDefaultRequestMetadata(reqTemplate, rawMetadata2);
}
}
}
@@ -656,7 +698,6 @@
for (const auto& cameraDeviceIds : concurrentDeviceCombinations) {
std::vector<CameraIdAndStreamCombination> cameraIdsAndStreamCombinations;
std::vector<CameraTestInfo> cameraTestInfos;
- size_t i = 0;
for (const auto& id : cameraDeviceIds.combination) {
CameraTestInfo cti;
auto it = idToNameMap.find(id);
@@ -707,7 +748,6 @@
cameraIdAndStreamCombination.cameraId = id;
cameraIdAndStreamCombination.streamConfiguration = cti.config;
cameraIdsAndStreamCombinations.push_back(cameraIdAndStreamCombination);
- i++;
cameraTestInfos.push_back(cti);
}
// Now verify that concurrent streams are supported
@@ -1572,7 +1612,7 @@
std::vector<HalStream> halStreams;
bool supportsPartialResults = false;
- bool useHalBufManager = false;
+ std::set<int32_t> halBufManagedStreamIds;
int32_t partialResultCount = 0;
Stream previewStream;
std::shared_ptr<DeviceCb> cb;
@@ -1580,7 +1620,7 @@
configurePreviewStreams(
name, mProvider, &previewThreshold, physicalIds, &mSession, &previewStream,
&halStreams /*out*/, &supportsPartialResults /*out*/, &partialResultCount /*out*/,
- &useHalBufManager /*out*/, &cb /*out*/, 0 /*streamConfigCounter*/, true);
+ &halBufManagedStreamIds /*out*/, &cb /*out*/, 0 /*streamConfigCounter*/, true);
if (mSession == nullptr) {
// stream combination not supported by HAL, skip test for device
continue;
@@ -1617,7 +1657,9 @@
size_t k = 0;
for (const auto& halStream : halStreams) {
buffer_handle_t buffer_handle;
- if (useHalBufManager) {
+ bool useHalBufManagerForStream =
+ halBufManagedStreamIds.find(halStream.id) != halBufManagedStreamIds.end();
+ if (useHalBufManagerForStream) {
outputBuffers[k] = {halStream.id, /*bufferId*/ 0, NativeHandle(),
BufferStatus::OK, NativeHandle(), NativeHandle()};
} else {
@@ -1721,10 +1763,13 @@
defaultPreviewSettings.unlock(settingsBuffer);
filteredSettings.unlock(filteredSettingsBuffer);
- if (useHalBufManager) {
- std::vector<int32_t> streamIds(halStreams.size());
- for (size_t i = 0; i < streamIds.size(); i++) {
- streamIds[i] = halStreams[i].id;
+ if (halBufManagedStreamIds.size() != 0) {
+ std::vector<int32_t> streamIds;
+ for (size_t i = 0; i < halStreams.size(); i++) {
+ int32_t streamId = halStreams[i].id;
+ if (halBufManagedStreamIds.find(streamId) != halBufManagedStreamIds.end()) {
+ streamIds.emplace_back(streamId);
+ }
}
verifyBuffersReturned(mSession, streamIds, cb);
}
@@ -1788,7 +1833,7 @@
std::vector<HalStream> halStreams;
bool supportsPartialResults = false;
- bool useHalBufManager = false;
+ std::set<int32_t> halBufManagedStreamIds;
int32_t partialResultCount = 0;
Stream previewStream;
std::shared_ptr<DeviceCb> cb;
@@ -1800,8 +1845,8 @@
GRALLOC1_CONSUMER_USAGE_CPU_READ);
previewStream.dataSpace = Dataspace::UNKNOWN;
configureStreams(name, mProvider, format, &mSession, &previewStream, &halStreams,
- &supportsPartialResults, &partialResultCount, &useHalBufManager, &cb,
- 0, /*maxResolution*/ true);
+ &supportsPartialResults, &partialResultCount, &halBufManagedStreamIds,
+ &cb, 0, /*maxResolution*/ true);
ASSERT_NE(mSession, nullptr);
::aidl::android::hardware::common::fmq::MQDescriptor<
@@ -1832,7 +1877,9 @@
size_t k = 0;
for (const auto& halStream : halStreams) {
buffer_handle_t buffer_handle;
- if (useHalBufManager) {
+ bool halBufManagerUsed =
+ halBufManagedStreamIds.find(halStream.id) != halBufManagedStreamIds.end();
+ if (halBufManagerUsed) {
outputBuffers[k] = {halStream.id, 0,
NativeHandle(), BufferStatus::OK,
NativeHandle(), NativeHandle()};
@@ -1884,10 +1931,12 @@
ASSERT_FALSE(inflightReq->errorCodeValid);
ASSERT_NE(inflightReq->resultOutputBuffers.size(), 0u);
}
- if (useHalBufManager) {
- std::vector<int32_t> streamIds(halStreams.size());
- for (size_t i = 0; i < streamIds.size(); i++) {
- streamIds[i] = halStreams[i].id;
+ if (halBufManagedStreamIds.size()) {
+ std::vector<int32_t> streamIds;
+ for (size_t i = 0; i < halStreams.size(); i++) {
+ if (contains(halBufManagedStreamIds, halStreams[i].id)) {
+ streamIds.emplace_back(halStreams[i].id);
+ }
}
verifyBuffersReturned(mSession, streamIds, cb);
}
@@ -1949,7 +1998,7 @@
std::vector<HalStream> halStreams;
bool supportsPartialResults = false;
- bool useHalBufManager = false;
+ std::set<int32_t> halBufManagedStreamIds;
int32_t partialResultCount = 0;
Stream previewStream;
std::shared_ptr<DeviceCb> cb;
@@ -1960,7 +2009,7 @@
previewStream.dataSpace = getDataspace(PixelFormat::IMPLEMENTATION_DEFINED);
configureStreams(name, mProvider, PixelFormat::IMPLEMENTATION_DEFINED, &mSession,
&previewStream, &halStreams, &supportsPartialResults,
- &partialResultCount, &useHalBufManager, &cb, 0,
+ &partialResultCount, &halBufManagedStreamIds, &cb, 0,
/*maxResolution*/ false, profile);
ASSERT_NE(mSession, nullptr);
@@ -1999,7 +2048,7 @@
auto bufferId = requestId + 1; // Buffer id value 0 is not valid
for (const auto& halStream : halStreams) {
buffer_handle_t buffer_handle;
- if (useHalBufManager) {
+ if (contains(halBufManagedStreamIds, halStream.id)) {
outputBuffers[k] = {halStream.id, 0,
NativeHandle(), BufferStatus::OK,
NativeHandle(), NativeHandle()};
@@ -2065,10 +2114,12 @@
verify10BitMetadata(mHandleImporter, *inflightReq, profile);
}
- if (useHalBufManager) {
- std::vector<int32_t> streamIds(halStreams.size());
- for (size_t i = 0; i < streamIds.size(); i++) {
- streamIds[i] = halStreams[i].id;
+ if (halBufManagedStreamIds.size() != 0) {
+ std::vector<int32_t> streamIds;
+ for (size_t i = 0; i < halStreams.size(); i++) {
+ if (contains(halBufManagedStreamIds, halStreams[i].id)) {
+ streamIds.emplace_back(halStreams[i].id);
+ }
}
mSession->signalStreamFlush(streamIds, /*streamConfigCounter*/ 0);
cb->waitForBuffersReturned();
@@ -2400,11 +2451,11 @@
std::vector<HalStream> halStreams;
std::shared_ptr<DeviceCb> cb;
int32_t jpegBufferSize;
- bool useHalBufManager;
+ std::set<int32_t> halBufManagedStreamIds;
configureOfflineStillStream(name, mProvider, &threshold, &mSession /*out*/, &stream /*out*/,
&halStreams /*out*/, &supportsPartialResults /*out*/,
&partialResultCount /*out*/, &cb /*out*/,
- &jpegBufferSize /*out*/, &useHalBufManager /*out*/);
+ &jpegBufferSize /*out*/, &halBufManagedStreamIds /*out*/);
auto ret = mSession->constructDefaultRequestSettings(RequestTemplate::STILL_CAPTURE,
&settings);
@@ -2440,7 +2491,7 @@
StreamBuffer& outputBuffer = outputBuffers[0];
std::unique_lock<std::mutex> l(mLock);
- if (useHalBufManager) {
+ if (contains(halBufManagedStreamIds, halStream.id)) {
outputBuffer = {halStream.id, 0, NativeHandle(), BufferStatus::OK, NativeHandle(),
NativeHandle()};
} else {
diff --git a/camera/provider/aidl/vts/camera_aidl_test.cpp b/camera/provider/aidl/vts/camera_aidl_test.cpp
index f70e93c..ce5b849 100644
--- a/camera/provider/aidl/vts/camera_aidl_test.cpp
+++ b/camera/provider/aidl/vts/camera_aidl_test.cpp
@@ -1909,18 +1909,62 @@
if (supportFeatureCombinationQuery) {
ret = device->isStreamCombinationWithSettingsSupported(config,
&streamCombinationSupported);
- // TODO: Do not allow OPERATION_NOT_SUPPORTED once HAL
- // implementation is in place.
- ASSERT_TRUE(ret.isOk() || static_cast<Status>(ret.getServiceSpecificError()) ==
- Status::OPERATION_NOT_SUPPORTED);
- if (ret.isOk()) {
- ASSERT_EQ(expectedStatus, streamCombinationSupported);
- }
+ ASSERT_TRUE(ret.isOk());
+ ASSERT_EQ(expectedStatus, streamCombinationSupported);
}
}
}
}
+void CameraAidlTest::verifySessionCharacteristics(const CameraMetadata& chars) {
+ if (flags::feature_combination_query()) {
+ const camera_metadata_t* metadata =
+ reinterpret_cast<const camera_metadata_t*>(chars.metadata.data());
+
+ size_t expectedSize = chars.metadata.size();
+ int result = validate_camera_metadata_structure(metadata, &expectedSize);
+ ASSERT_TRUE((result == 0) || (result == CAMERA_METADATA_VALIDATION_SHIFTED));
+ size_t entryCount = get_camera_metadata_entry_count(metadata);
+ ASSERT_GT(entryCount, 0u);
+
+ camera_metadata_ro_entry entry;
+ int retcode = 0;
+ float maxDigitalZoom = 1.0;
+
+ retcode = find_camera_metadata_ro_entry(metadata, ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM,
+ &entry);
+ // ANDROID_SCALER_AVAILABLE_MAX_DIGITAL_ZOOM should always be present.
+ if ((0 == retcode) && (entry.count == 1)) {
+ maxDigitalZoom = entry.data.f[0];
+ } else {
+ ADD_FAILURE() << "Get camera scalerAvailableMaxDigitalZoom failed!";
+ }
+
+ retcode = find_camera_metadata_ro_entry(metadata, ANDROID_CONTROL_ZOOM_RATIO_RANGE, &entry);
+ bool hasZoomRatioRange = (0 == retcode && entry.count == 2);
+ if (!hasZoomRatioRange) {
+ return;
+ }
+ float minZoomRatio = entry.data.f[0];
+ float maxZoomRatio = entry.data.f[1];
+ constexpr float FLOATING_POINT_THRESHOLD = 0.00001f;
+ if (abs(maxDigitalZoom - maxZoomRatio) > FLOATING_POINT_THRESHOLD) {
+ ADD_FAILURE() << "Difference between maximum digital zoom " << maxDigitalZoom
+ << " and maximum zoom ratio " << maxZoomRatio
+ << " is greater than the threshold " << FLOATING_POINT_THRESHOLD << "!";
+ }
+ if (minZoomRatio > maxZoomRatio) {
+ ADD_FAILURE() << "Maximum zoom ratio is less than minimum zoom ratio!";
+ }
+ if (minZoomRatio > 1.0f) {
+ ADD_FAILURE() << "Minimum zoom ratio is more than 1.0!";
+ }
+ if (maxZoomRatio < 1.0f) {
+ ADD_FAILURE() << "Maximum zoom ratio is less than 1.0!";
+ }
+ }
+}
+
std::vector<ConcurrentCameraIdCombination> CameraAidlTest::getConcurrentDeviceCombinations(
std::shared_ptr<ICameraProvider>& provider) {
std::vector<ConcurrentCameraIdCombination> combinations;
@@ -2199,7 +2243,6 @@
int64_t bufferId = 1;
int32_t frameNumber = 1;
CameraMetadata settings;
-
for (const auto& name : cameraDeviceNames) {
Stream testStream;
std::vector<HalStream> halStreams;
@@ -2491,12 +2534,19 @@
ndk::ScopedAStatus CameraAidlTest::configureStreams(std::shared_ptr<ICameraDeviceSession>& session,
const StreamConfiguration& config,
- bool sessionHalBufferManager,
- bool* useHalBufManager,
+ BufferManagerType bufferManagerType,
+ std::set<int32_t>* halBufManagedStreamIds,
std::vector<HalStream>* halStreams) {
auto ret = ndk::ScopedAStatus::ok();
ConfigureStreamsRet aidl_return;
- if (sessionHalBufferManager) {
+ int32_t interfaceVersion = -1;
+ ret = session->getInterfaceVersion(&interfaceVersion);
+ if (!ret.isOk()) {
+ return ret;
+ }
+
+ if (flags::session_hal_buf_manager() &&
+ (bufferManagerType == BufferManagerType::SESSION && interfaceVersion >= 3)) {
ret = session->configureStreamsV2(config, &aidl_return);
} else {
ret = session->configureStreams(config, halStreams);
@@ -2504,10 +2554,16 @@
if (!ret.isOk()) {
return ret;
}
- if (sessionHalBufferManager) {
- *useHalBufManager = aidl_return.enableHalBufferManager;
+ if (flags::session_hal_buf_manager() && bufferManagerType == BufferManagerType::SESSION) {
*halStreams = std::move(aidl_return.halStreams);
}
+ for (const auto& halStream : *halStreams) {
+ if ((flags::session_hal_buf_manager() && bufferManagerType == BufferManagerType::SESSION &&
+ halStream.enableHalBufferManager) ||
+ bufferManagerType == BufferManagerType::HAL) {
+ halBufManagedStreamIds->insert(halStream.id);
+ }
+ }
return ndk::ScopedAStatus::ok();
}
@@ -2564,16 +2620,16 @@
ASSERT_TRUE(ret.isOk());
ASSERT_NE(*session, nullptr);
- *useHalBufManager = false;
- bool sessionHalBufferManager = false;
+ BufferManagerType bufferManagerType = BufferManagerType::FRAMEWORK;
status = find_camera_metadata_ro_entry(
staticMeta, ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION, &entry);
if ((0 == status) && (entry.count == 1)) {
- *useHalBufManager = (entry.data.u8[0] ==
- ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5);
- sessionHalBufferManager =
- (entry.data.u8[0] ==
- ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE);
+ if (entry.data.u8[0] == ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5) {
+ bufferManagerType = BufferManagerType::HAL;
+ } else if (entry.data.u8[0] ==
+ ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE) {
+ bufferManagerType = BufferManagerType::SESSION;
+ }
}
outputPreviewStreams.clear();
@@ -2632,7 +2688,8 @@
ASSERT_EQ(supported, true);
std::vector<HalStream> halConfigs;
- ret = configureStreams(*session, config, sessionHalBufferManager, useHalBufManager,
+ std::set<int32_t> halBufManagedStreamIds;
+ ret = configureStreams(*session, config, bufferManagerType, &halBufManagedStreamIds,
&halConfigs);
ALOGI("configureStreams returns status: %d:%d", ret.getExceptionCode(),
ret.getServiceSpecificError());
@@ -2640,6 +2697,7 @@
ASSERT_EQ(1u, halConfigs.size());
halStreams->clear();
halStreams->push_back(halConfigs[0]);
+ *useHalBufManager = halBufManagedStreamIds.size() != 0;
if (*useHalBufManager) {
std::vector<Stream> ss(1);
std::vector<HalStream> hs(1);
@@ -2766,6 +2824,7 @@
overrideRotateAndCrop(&request.settings);
request.outputBuffers = std::vector<StreamBuffer>(1);
StreamBuffer& outputBuffer = request.outputBuffers[0];
+
if (useHalBufManager) {
outputBuffer = {halStreams[0].id,
/*bufferId*/ 0, NativeHandle(), BufferStatus::OK,
@@ -2884,14 +2943,14 @@
const AvailableStream* previewThreshold, const std::unordered_set<std::string>& physicalIds,
std::shared_ptr<ICameraDeviceSession>* session, Stream* previewStream,
std::vector<HalStream>* halStreams, bool* supportsPartialResults,
- int32_t* partialResultCount, bool* useHalBufManager, std::shared_ptr<DeviceCb>* cb,
- int32_t streamConfigCounter, bool allowUnsupport) {
+ int32_t* partialResultCount, std::set<int32_t>* halBufManagedStreamIds,
+ std::shared_ptr<DeviceCb>* cb, int32_t streamConfigCounter, bool allowUnsupport) {
ASSERT_NE(nullptr, session);
ASSERT_NE(nullptr, halStreams);
ASSERT_NE(nullptr, previewStream);
ASSERT_NE(nullptr, supportsPartialResults);
ASSERT_NE(nullptr, partialResultCount);
- ASSERT_NE(nullptr, useHalBufManager);
+ ASSERT_NE(nullptr, halBufManagedStreamIds);
ASSERT_NE(nullptr, cb);
ASSERT_FALSE(physicalIds.empty());
@@ -2928,16 +2987,16 @@
ASSERT_TRUE(ret.isOk());
ASSERT_NE(*session, nullptr);
- *useHalBufManager = false;
- bool sessionHalBufferManager = false;
+ BufferManagerType bufferManagerType = BufferManagerType::FRAMEWORK;
status = find_camera_metadata_ro_entry(
staticMeta, ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION, &entry);
if ((0 == status) && (entry.count == 1)) {
- *useHalBufManager = (entry.data.u8[0] ==
- ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5);
- sessionHalBufferManager =
- (entry.data.u8[0] ==
- ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE);
+ if (entry.data.u8[0] == ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5) {
+ bufferManagerType = BufferManagerType::HAL;
+ } else if (entry.data.u8[0] ==
+ ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE) {
+ bufferManagerType = BufferManagerType::SESSION;
+ }
}
outputPreviewStreams.clear();
@@ -2992,18 +3051,21 @@
config.streamConfigCounter = streamConfigCounter;
std::vector<HalStream> halConfigs;
- ret = configureStreams(*session, config, sessionHalBufferManager, useHalBufManager,
+ ret = configureStreams(*session, config, bufferManagerType, halBufManagedStreamIds,
&halConfigs);
ASSERT_TRUE(ret.isOk());
ASSERT_EQ(physicalIds.size(), halConfigs.size());
*halStreams = halConfigs;
- if (*useHalBufManager) {
- std::vector<Stream> ss(physicalIds.size());
- std::vector<HalStream> hs(physicalIds.size());
+ if (halBufManagedStreamIds->size() != 0) {
+ // Only include the streams that are HAL buffer managed
+ std::vector<Stream> ss;
+ std::vector<HalStream> hs;
for (size_t i = 0; i < physicalIds.size(); i++) {
- ss[i] = streams[i];
- hs[i] = halConfigs[i];
+ if (contains(*halBufManagedStreamIds, halConfigs[i].id)) {
+ ss.emplace_back(streams[i]);
+ hs.emplace_back(halConfigs[i]);
+ }
}
(*cb)->setCurrentStreamConfig(ss, hs);
}
@@ -3021,22 +3083,20 @@
cb->waitForBuffersReturned();
}
-void CameraAidlTest::configureStreams(const std::string& name,
- const std::shared_ptr<ICameraProvider>& provider,
- PixelFormat format,
- std::shared_ptr<ICameraDeviceSession>* session,
- Stream* previewStream, std::vector<HalStream>* halStreams,
- bool* supportsPartialResults, int32_t* partialResultCount,
- bool* useHalBufManager, std::shared_ptr<DeviceCb>* outCb,
- uint32_t streamConfigCounter, bool maxResolution,
- RequestAvailableDynamicRangeProfilesMap dynamicRangeProf,
- RequestAvailableColorSpaceProfilesMap colorSpaceProf) {
+void CameraAidlTest::configureStreams(
+ const std::string& name, const std::shared_ptr<ICameraProvider>& provider,
+ PixelFormat format, std::shared_ptr<ICameraDeviceSession>* session, Stream* previewStream,
+ std::vector<HalStream>* halStreams, bool* supportsPartialResults,
+ int32_t* partialResultCount, std::set<int32_t>* halBufManagedStreamIds,
+ std::shared_ptr<DeviceCb>* outCb, uint32_t streamConfigCounter, bool maxResolution,
+ RequestAvailableDynamicRangeProfilesMap dynamicRangeProf,
+ RequestAvailableColorSpaceProfilesMap colorSpaceProf) {
ASSERT_NE(nullptr, session);
ASSERT_NE(nullptr, halStreams);
ASSERT_NE(nullptr, previewStream);
ASSERT_NE(nullptr, supportsPartialResults);
ASSERT_NE(nullptr, partialResultCount);
- ASSERT_NE(nullptr, useHalBufManager);
+ ASSERT_NE(nullptr, halBufManagedStreamIds);
ASSERT_NE(nullptr, outCb);
ALOGI("configureStreams: Testing camera device %s", name.c_str());
@@ -3073,16 +3133,16 @@
ASSERT_TRUE(ret.isOk());
ASSERT_NE(*session, nullptr);
- *useHalBufManager = false;
- bool sessionHalBufferManager = false;
+ BufferManagerType bufferManagerType = BufferManagerType::FRAMEWORK;
status = find_camera_metadata_ro_entry(
staticMeta, ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION, &entry);
if ((0 == status) && (entry.count == 1)) {
- *useHalBufManager = (entry.data.u8[0] ==
- ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5);
- sessionHalBufferManager =
- (entry.data.u8[0] ==
- ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE);
+ if (entry.data.u8[0] == ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5) {
+ bufferManagerType = BufferManagerType::HAL;
+ } else if (entry.data.u8[0] ==
+ ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE) {
+ bufferManagerType = BufferManagerType::SESSION;
+ }
}
outputStreams.clear();
@@ -3136,11 +3196,11 @@
ASSERT_TRUE(ret.isOk());
ASSERT_EQ(supported, true);
- ret = configureStreams(*session, config, sessionHalBufferManager, useHalBufManager, halStreams);
+ ret = configureStreams(*session, config, bufferManagerType, halBufManagedStreamIds, halStreams);
ASSERT_TRUE(ret.isOk());
- if (*useHalBufManager) {
+ if (halBufManagedStreamIds->size() != 0) {
std::vector<Stream> ss(1);
std::vector<HalStream> hs(1);
ss[0] = streams[0];
@@ -3500,7 +3560,7 @@
const AvailableStream* threshold, std::shared_ptr<ICameraDeviceSession>* session,
Stream* stream, std::vector<HalStream>* halStreams, bool* supportsPartialResults,
int32_t* partialResultCount, std::shared_ptr<DeviceCb>* outCb, int32_t* jpegBufferSize,
- bool* useHalBufManager) {
+ std::set<int32_t>* halBufManagedStreamIds) {
ASSERT_NE(nullptr, session);
ASSERT_NE(nullptr, halStreams);
ASSERT_NE(nullptr, stream);
@@ -3508,7 +3568,7 @@
ASSERT_NE(nullptr, partialResultCount);
ASSERT_NE(nullptr, outCb);
ASSERT_NE(nullptr, jpegBufferSize);
- ASSERT_NE(nullptr, useHalBufManager);
+ ASSERT_NE(nullptr, halBufManagedStreamIds);
std::vector<AvailableStream> outputStreams;
std::shared_ptr<ICameraDevice> cameraDevice;
@@ -3535,16 +3595,16 @@
*supportsPartialResults = (*partialResultCount > 1);
}
- *useHalBufManager = false;
- bool sessionHalBufferManager = false;
+ BufferManagerType bufferManagerType = BufferManagerType::FRAMEWORK;
status = find_camera_metadata_ro_entry(
staticMeta, ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION, &entry);
if ((0 == status) && (entry.count == 1)) {
- *useHalBufManager = (entry.data.u8[0] ==
- ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5);
- sessionHalBufferManager =
- (entry.data.u8[0] ==
- ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE);
+ if (entry.data.u8[0] == ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_HIDL_DEVICE_3_5) {
+ bufferManagerType = BufferManagerType::HAL;
+ } else if (entry.data.u8[0] ==
+ ANDROID_INFO_SUPPORTED_BUFFER_MANAGEMENT_VERSION_SESSION_CONFIGURABLE) {
+ bufferManagerType = BufferManagerType::SESSION;
+ }
}
auto st = getJpegBufferSize(staticMeta, jpegBufferSize);
@@ -3597,11 +3657,11 @@
StreamConfiguration config = {streams, StreamConfigurationMode::NORMAL_MODE, CameraMetadata()};
- ret = configureStreams(*session, config, sessionHalBufferManager, useHalBufManager, halStreams);
+ ret = configureStreams(*session, config, bufferManagerType, halBufManagedStreamIds, halStreams);
ASSERT_TRUE(ret.isOk());
- if (*useHalBufManager) {
+ if (halBufManagedStreamIds->size() != 0) {
(*outCb)->setCurrentStreamConfig(streams, *halStreams);
}
@@ -3704,7 +3764,7 @@
std::vector<HalStream> halStreams;
bool supportsPartialResults = false;
- bool useHalBufManager = false;
+ std::set<int32_t> halBufManagedStreamIds;
int32_t partialResultCount = 0;
Stream previewStream;
std::shared_ptr<DeviceCb> cb;
@@ -3713,7 +3773,7 @@
GRALLOC1_CONSUMER_USAGE_HWCOMPOSER);
configureStreams(name, mProvider, PixelFormat::IMPLEMENTATION_DEFINED, &mSession,
&previewStream, &halStreams, &supportsPartialResults, &partialResultCount,
- &useHalBufManager, &cb, 0,
+ &halBufManagedStreamIds, &cb, 0,
/*maxResolution*/ false, dynamicRangeProfile, colorSpace);
ASSERT_NE(mSession, nullptr);
@@ -3752,7 +3812,7 @@
auto bufferId = requestId + 1; // Buffer id value 0 is not valid
for (const auto& halStream : halStreams) {
buffer_handle_t buffer_handle;
- if (useHalBufManager) {
+ if (contains(halBufManagedStreamIds, halStream.id)) {
outputBuffers[k] = {halStream.id, 0,
NativeHandle(), BufferStatus::OK,
NativeHandle(), NativeHandle()};
@@ -3819,10 +3879,12 @@
}
}
- if (useHalBufManager) {
- std::vector<int32_t> streamIds(halStreams.size());
+ if (halBufManagedStreamIds.size() != 0) {
+ std::vector<int32_t> streamIds;
for (size_t i = 0; i < streamIds.size(); i++) {
- streamIds[i] = halStreams[i].id;
+ if (contains(halBufManagedStreamIds, halStreams[i].id)) {
+ streamIds.emplace_back(halStreams[i].id);
+ }
}
mSession->signalStreamFlush(streamIds, /*streamConfigCounter*/ 0);
cb->waitForBuffersReturned();
@@ -4033,3 +4095,12 @@
}
}
}
+
+void CameraAidlTest::validateDefaultRequestMetadata(RequestTemplate reqTemplate,
+ const CameraMetadata& rawMetadata) {
+ const camera_metadata_t* metadata = (camera_metadata_t*)rawMetadata.metadata.data();
+ size_t expectedSize = rawMetadata.metadata.size();
+ int result = validate_camera_metadata_structure(metadata, &expectedSize);
+ ASSERT_TRUE((result == 0) || (result == CAMERA_METADATA_VALIDATION_SHIFTED));
+ verifyRequestTemplate(metadata, reqTemplate);
+}
diff --git a/camera/provider/aidl/vts/camera_aidl_test.h b/camera/provider/aidl/vts/camera_aidl_test.h
index cbf74a5..7bcf430 100644
--- a/camera/provider/aidl/vts/camera_aidl_test.h
+++ b/camera/provider/aidl/vts/camera_aidl_test.h
@@ -99,6 +99,11 @@
class DeviceCb; // Forward declare to break circular header dependency
+template <typename T>
+bool contains(const std::set<T>& container, T value) {
+ return container.find(value) != container.end();
+}
+
class CameraAidlTest : public ::testing::TestWithParam<std::string> {
public:
enum SystemCameraKind {
@@ -121,6 +126,8 @@
HIDDEN_SECURE_CAMERA
};
+ enum BufferManagerType { FRAMEWORK = 0, HAL, SESSION };
+
struct AvailableStream {
int32_t width;
int32_t height;
@@ -200,11 +207,12 @@
std::shared_ptr<ICameraDeviceSession>* session /*out*/, Stream* stream /*out*/,
std::vector<HalStream>* halStreams, bool* supportsPartialResults /*out*/,
int32_t* partialResultCount /*out*/, std::shared_ptr<DeviceCb>* outCb /*out*/,
- int32_t* jpegBufferSize /*out*/, bool* useHalBufManager /*out*/);
+ int32_t* jpegBufferSize /*out*/, std::set<int32_t>* halBufManagedStreamIds /*out*/);
ndk::ScopedAStatus configureStreams(std::shared_ptr<ICameraDeviceSession>& session,
const StreamConfiguration& config,
- bool sessionHalBufferManager, bool* useHalBufManager,
+ BufferManagerType bufferManagerType,
+ std::set<int32_t>* halBufManagedStreamIds,
std::vector<HalStream>* halStreams);
void configureStreams(
@@ -212,8 +220,9 @@
PixelFormat format, std::shared_ptr<ICameraDeviceSession>* session /*out*/,
Stream* previewStream /*out*/, std::vector<HalStream>* halStreams /*out*/,
bool* supportsPartialResults /*out*/, int32_t* partialResultCount /*out*/,
- bool* useHalBufManager /*out*/, std::shared_ptr<DeviceCb>* outCb /*out*/,
- uint32_t streamConfigCounter, bool maxResolution,
+ std::set<int32_t>* halBufManagedStreamIds /*out*/,
+ std::shared_ptr<DeviceCb>* outCb /*out*/, uint32_t streamConfigCounter,
+ bool maxResolution,
RequestAvailableDynamicRangeProfilesMap dynamicRangeProf =
RequestAvailableDynamicRangeProfilesMap::
ANDROID_REQUEST_AVAILABLE_DYNAMIC_RANGE_PROFILES_MAP_STANDARD,
@@ -227,7 +236,7 @@
const std::unordered_set<std::string>& physicalIds,
std::shared_ptr<ICameraDeviceSession>* session /*out*/, Stream* previewStream /*out*/,
std::vector<HalStream>* halStreams /*out*/, bool* supportsPartialResults /*out*/,
- int32_t* partialResultCount /*out*/, bool* useHalBufManager /*out*/,
+ int32_t* partialResultCount /*out*/, std::set<int32_t>* halBufManagedStreamIds /*out*/,
std::shared_ptr<DeviceCb>* cb /*out*/, int32_t streamConfigCounter = 0,
bool allowUnsupport = false);
@@ -281,6 +290,8 @@
static void verifyStreamCombination(const std::shared_ptr<ICameraDevice>& device,
const StreamConfiguration& config, bool expectedStatus);
+ static void verifySessionCharacteristics(const CameraMetadata& chars);
+
static void verifyLogicalCameraResult(const camera_metadata_t* staticMetadata,
const std::vector<uint8_t>& resultMetadata);
@@ -589,6 +600,9 @@
static void waitForReleaseFence(
std::vector<InFlightRequest::StreamBufferAndTimestamp>& resultOutputBuffers);
+ static void validateDefaultRequestMetadata(RequestTemplate reqTemplate,
+ const CameraMetadata& rawMetadata);
+
// Map from frame number to the in-flight request state
typedef std::unordered_map<uint32_t, std::shared_ptr<InFlightRequest>> InFlightMap;
diff --git a/compatibility_matrices/compatibility_matrix.202404.xml b/compatibility_matrices/compatibility_matrix.202404.xml
index f6f70e0..cf7de22 100644
--- a/compatibility_matrices/compatibility_matrix.202404.xml
+++ b/compatibility_matrices/compatibility_matrix.202404.xml
@@ -255,15 +255,6 @@
<instance>default</instance>
</interface>
</hal>
- <!-- Either the native or the HIDL mapper HAL must exist on the device -->
- <hal format="hidl">
- <name>android.hardware.graphics.mapper</name>
- <version>4.0</version>
- <interface>
- <name>IMapper</name>
- <instance>default</instance>
- </interface>
- </hal>
<hal format="aidl">
<name>android.hardware.health</name>
<version>3</version>
@@ -581,14 +572,6 @@
</interface>
</hal>
<hal format="aidl">
- <name>android.hardware.threadnetwork</name>
- <version>1</version>
- <interface>
- <name>IThreadChip</name>
- <instance>chip0</instance>
- </interface>
- </hal>
- <hal format="aidl">
<name>android.hardware.tv.hdmi.cec</name>
<version>1</version>
<interface>
@@ -699,7 +682,7 @@
<instance>default</instance>
</interface>
</hal>
- <!-- Either the native or the HIDL mapper HAL must exist on the device -->
+ <!-- The native mapper HAL must exist on the device -->
<hal format="native">
<name>mapper</name>
<version>5.0</version>
diff --git a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
index fd55b80..fa427a5 100644
--- a/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
+++ b/contexthub/aidl/vts/VtsAidlHalContextHubTargetTest.cpp
@@ -421,7 +421,7 @@
return tuples;
}
-TEST_P(ContextHubAidl, TestHostConnection) {
+TEST_P(ContextHubTransactionTest, TestHostConnection) {
constexpr char16_t kHostEndpointId = 1;
HostEndpointInfo hostEndpointInfo;
hostEndpointInfo.type = HostEndpointInfo::Type::NATIVE;
@@ -431,13 +431,13 @@
ASSERT_TRUE(contextHub->onHostEndpointDisconnected(kHostEndpointId).isOk());
}
-TEST_P(ContextHubAidl, TestInvalidHostConnection) {
+TEST_P(ContextHubTransactionTest, TestInvalidHostConnection) {
constexpr char16_t kHostEndpointId = 1;
ASSERT_TRUE(contextHub->onHostEndpointDisconnected(kHostEndpointId).isOk());
}
-TEST_P(ContextHubAidl, TestNanSessionStateChange) {
+TEST_P(ContextHubTransactionTest, TestNanSessionStateChange) {
NanSessionStateUpdate update;
update.state = true;
Status status = contextHub->onNanSessionStateChanged(update);
diff --git a/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl b/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl
index 0200625..522d44e 100644
--- a/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl
+++ b/gnss/aidl/android/hardware/gnss/IGnssCallback.aidl
@@ -136,14 +136,14 @@
*
* - GNSS: 1-32
* - SBAS: 120-151, 183-192
- * - GLONASS: 1-24, the orbital slot number (OSN), if known. Or, if not:
+ * - GLONASS: 1-25, the orbital slot number (OSN), if known. Or, if not:
* 93-106, the frequency channel number (FCN) (-7 to +6) offset by
* + 100
* i.e. report an FCN of -7 as 93, FCN of 0 as 100, and FCN of +6
* as 106.
- * - QZSS: 193-200
+ * - QZSS: 183-206
* - Galileo: 1-36
- * - Beidou: 1-37
+ * - Beidou: 1-63
* - IRNSS: 1-14
*/
int svid;
diff --git a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp
index b67cfc2..a1992b9 100644
--- a/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp
+++ b/graphics/composer/2.1/vts/functional/VtsHalGraphicsComposerV2_1TargetTest.cpp
@@ -315,6 +315,8 @@
* required client targets.
*/
TEST_P(GraphicsComposerHidlTest, GetClientTargetSupport) {
+ ASSERT_NO_FATAL_FAILURE(
+ mComposerClient->setPowerMode(mPrimaryDisplay, IComposerClient::PowerMode::ON));
std::vector<Config> configs = mComposerClient->getDisplayConfigs(mPrimaryDisplay);
for (auto config : configs) {
int32_t width = mComposerClient->getDisplayAttribute(mPrimaryDisplay, config,
diff --git a/graphics/composer/2.2/utils/vts/Android.bp b/graphics/composer/2.2/utils/vts/Android.bp
index 2bd2419..7157862 100644
--- a/graphics/composer/2.2/utils/vts/Android.bp
+++ b/graphics/composer/2.2/utils/vts/Android.bp
@@ -38,6 +38,7 @@
],
shared_libs: [
"libui",
+ "server_configurable_flags",
],
static_libs: [
"android.hardware.graphics.composer@2.1-vts",
@@ -48,6 +49,7 @@
"libnativewindow",
"librenderengine",
"libshaders",
+ "libsurfaceflinger_common",
"libtonemap",
],
export_static_lib_headers: [
diff --git a/graphics/composer/2.2/vts/functional/Android.bp b/graphics/composer/2.2/vts/functional/Android.bp
index dec60df..bda4198 100644
--- a/graphics/composer/2.2/vts/functional/Android.bp
+++ b/graphics/composer/2.2/vts/functional/Android.bp
@@ -54,6 +54,7 @@
"libsync",
"libui",
"android.hardware.common-V2-ndk",
+ "server_configurable_flags",
],
static_libs: [
"android.hardware.graphics.common@1.1",
@@ -66,6 +67,7 @@
"librenderengine",
"libshaders",
"libtonemap",
+ "libsurfaceflinger_common",
],
header_libs: [
"android.hardware.graphics.composer@2.1-command-buffer",
diff --git a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp
index 2bd287b..cd4cb58 100644
--- a/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp
+++ b/graphics/composer/2.2/vts/functional/VtsHalGraphicsComposerV2_2TargetTest.cpp
@@ -256,6 +256,8 @@
* required client targets.
*/
TEST_P(GraphicsComposerHidlTest, GetClientTargetSupport_2_2) {
+ ASSERT_NO_FATAL_FAILURE(
+ mComposerClient->setPowerMode_2_2(mPrimaryDisplay, IComposerClient::PowerMode::ON));
std::vector<Config> configs = mComposerClient->getDisplayConfigs(mPrimaryDisplay);
for (auto config : configs) {
int32_t width = mComposerClient->getDisplayAttribute(mPrimaryDisplay, config,
diff --git a/graphics/composer/2.3/vts/functional/VtsHalGraphicsComposerV2_3TargetTest.cpp b/graphics/composer/2.3/vts/functional/VtsHalGraphicsComposerV2_3TargetTest.cpp
index c072ef0..f99c72d 100644
--- a/graphics/composer/2.3/vts/functional/VtsHalGraphicsComposerV2_3TargetTest.cpp
+++ b/graphics/composer/2.3/vts/functional/VtsHalGraphicsComposerV2_3TargetTest.cpp
@@ -274,6 +274,8 @@
* Test IComposerClient::getClientTargetSupport_2_3
*/
TEST_P(GraphicsComposerHidlTest, GetClientTargetSupport_2_3) {
+ ASSERT_NO_FATAL_FAILURE(
+ mComposerClient->setPowerMode_2_2(mPrimaryDisplay, IComposerClient::PowerMode::ON));
std::vector<V2_1::Config> configs = mComposerClient->getDisplayConfigs(mPrimaryDisplay);
for (auto config : configs) {
int32_t width = mComposerClient->getDisplayAttribute(mPrimaryDisplay, config,
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl
index bb2569f..7377b4b 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/VrrConfig.aidl
@@ -42,7 +42,7 @@
int averageRefreshPeriodNs;
}
parcelable NotifyExpectedPresentConfig {
- int notifyExpectedPresentHeadsUpNs;
- int notifyExpectedPresentTimeoutNs;
+ int headsUpNs;
+ int timeoutNs;
}
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
index 725c947..213e8e9 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -895,9 +895,9 @@
*
* The framework will call this function based on the parameters specified in
* DisplayConfiguration.VrrConfig:
- * - notifyExpectedPresentTimeoutNs specifies the idle time from the previous present command
- * where the framework must send the early hint for the next frame.
- * - notifyExpectedPresentHeadsUpNs specifies minimal time that framework must send
+ * - notifyExpectedPresentConfig.timeoutNs specifies the idle time from the previous
+ * present command where the framework must send the early hint for the next frame.
+ * - notifyExpectedPresentConfig.headsUpNs specifies minimal time that framework must send
* the early hint before the next frame.
*
* The framework can omit calling this API when the next present command matches
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl
index ec2d55f..e619712 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerLifecycleBatchCommandType.aidl
@@ -32,8 +32,8 @@
*/
CREATE = 1,
/**
- * This indicates that the current LayerCommand should also destroyes the layer,
- * after processing the other attributes in the LayerCommand.
+ * This indicates that the current LayerCommand should also destroy the layer,
+ * before processing the other attributes in the LayerCommand.
*/
DESTROY = 2,
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl
index 3b241ba..99c1c62 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl
@@ -45,15 +45,16 @@
* The minimal time in nanoseconds that IComposerClient.notifyExpectedPresent needs to be
* called ahead of an expectedPresentTime provided on a presentDisplay command.
*/
- int notifyExpectedPresentHeadsUpNs;
+ int headsUpNs;
/**
* The time in nanoseconds that represents a timeout from the previous presentDisplay, which
* after this point the display needs a call to IComposerClient.notifyExpectedPresent before
- * sending the next frame. If set to 0, there is no need to call
+ * sending the next frame.
+ * If set to 0, hint is sent for every frame.
* IComposerClient.notifyExpectedPresent for timeout.
*/
- int notifyExpectedPresentTimeoutNs;
+ int timeoutNs;
}
/**
diff --git a/graphics/composer/aidl/vts/Android.bp b/graphics/composer/aidl/vts/Android.bp
index 658e0d5..3464fe9 100644
--- a/graphics/composer/aidl/vts/Android.bp
+++ b/graphics/composer/aidl/vts/Android.bp
@@ -56,6 +56,7 @@
"libhidlbase",
"libprocessgroup",
"libvndksupport",
+ "server_configurable_flags",
],
header_libs: [
"android.hardware.graphics.composer3-command-buffer",
@@ -74,6 +75,7 @@
"libshaders",
"libsync",
"libtonemap",
+ "libsurfaceflinger_common",
],
cflags: [
"-Wconversion",
diff --git a/graphics/composer/aidl/vts/ReadbackVts.cpp b/graphics/composer/aidl/vts/ReadbackVts.cpp
index 8605628..c72ec69 100644
--- a/graphics/composer/aidl/vts/ReadbackVts.cpp
+++ b/graphics/composer/aidl/vts/ReadbackVts.cpp
@@ -293,8 +293,8 @@
TestBufferLayer::TestBufferLayer(const std::shared_ptr<VtsComposerClient>& client,
TestRenderEngine& renderEngine, int64_t display, uint32_t width,
uint32_t height, common::PixelFormat format,
- Composition composition)
- : TestLayer{client, display}, mRenderEngine(renderEngine) {
+ ComposerClientWriter& writer, Composition composition)
+ : TestLayer{client, display, writer}, mRenderEngine(renderEngine) {
mComposition = composition;
mWidth = width;
mHeight = height;
diff --git a/graphics/composer/aidl/vts/ReadbackVts.h b/graphics/composer/aidl/vts/ReadbackVts.h
index ee20573..8ac0f4b 100644
--- a/graphics/composer/aidl/vts/ReadbackVts.h
+++ b/graphics/composer/aidl/vts/ReadbackVts.h
@@ -50,9 +50,10 @@
class TestLayer {
public:
- TestLayer(const std::shared_ptr<VtsComposerClient>& client, int64_t display)
+ TestLayer(const std::shared_ptr<VtsComposerClient>& client, int64_t display,
+ ComposerClientWriter& writer)
: mDisplay(display) {
- const auto& [status, layer] = client->createLayer(display, kBufferSlotCount);
+ const auto& [status, layer] = client->createLayer(display, kBufferSlotCount, &writer);
EXPECT_TRUE(status.isOk());
mLayer = layer;
}
@@ -108,8 +109,9 @@
class TestColorLayer : public TestLayer {
public:
- TestColorLayer(const std::shared_ptr<VtsComposerClient>& client, int64_t display)
- : TestLayer{client, display} {}
+ TestColorLayer(const std::shared_ptr<VtsComposerClient>& client, int64_t display,
+ ComposerClientWriter& writer)
+ : TestLayer{client, display, writer} {}
void write(ComposerClientWriter& writer) override;
@@ -125,7 +127,7 @@
public:
TestBufferLayer(const std::shared_ptr<VtsComposerClient>& client,
TestRenderEngine& renderEngine, int64_t display, uint32_t width,
- uint32_t height, common::PixelFormat format,
+ uint32_t height, common::PixelFormat format, ComposerClientWriter& writer,
Composition composition = Composition::DEVICE);
void write(ComposerClientWriter& writer) override;
diff --git a/graphics/composer/aidl/vts/VtsComposerClient.cpp b/graphics/composer/aidl/vts/VtsComposerClient.cpp
index ac08cd1..89ba2e6 100644
--- a/graphics/composer/aidl/vts/VtsComposerClient.cpp
+++ b/graphics/composer/aidl/vts/VtsComposerClient.cpp
@@ -33,6 +33,14 @@
mComposer = IComposer::fromBinder(binder);
ALOGE_IF(mComposer == nullptr, "Failed to acquire the composer from the binder");
}
+
+ const auto& [status, capabilities] = getCapabilities();
+ EXPECT_TRUE(status.isOk());
+ if (std::any_of(capabilities.begin(), capabilities.end(), [&](const Capability& cap) {
+ return cap == Capability::LAYER_LIFECYCLE_BATCH_COMMAND;
+ })) {
+ mSupportsBatchedCreateLayer = true;
+ }
}
ScopedAStatus VtsComposerClient::createClient() {
@@ -54,12 +62,15 @@
return mComposerClient->registerCallback(mComposerCallback);
}
-bool VtsComposerClient::tearDown() {
- return verifyComposerCallbackParams() && destroyAllLayers();
+bool VtsComposerClient::tearDown(ComposerClientWriter* writer) {
+ return verifyComposerCallbackParams() && destroyAllLayers(writer);
}
std::pair<ScopedAStatus, int32_t> VtsComposerClient::getInterfaceVersion() const {
int32_t version = 1;
+ if (!mComposerClient) {
+ return {ScopedAStatus{nullptr}, version};
+ }
auto status = mComposerClient->getInterfaceVersion(&version);
return {std::move(status), version};
}
@@ -86,7 +97,16 @@
}
std::pair<ScopedAStatus, int64_t> VtsComposerClient::createLayer(int64_t display,
- int32_t bufferSlotCount) {
+ int32_t bufferSlotCount,
+ ComposerClientWriter* writer) {
+ if (mSupportsBatchedCreateLayer) {
+ int64_t layer = mNextLayerHandle++;
+ writer->setLayerLifecycleBatchCommandType(display, layer,
+ LayerLifecycleBatchCommandType::CREATE);
+ writer->setNewBufferSlotCount(display, layer, bufferSlotCount);
+ return {addLayerToDisplayResources(display, layer), layer};
+ }
+
int64_t outLayer;
auto status = mComposerClient->createLayer(display, bufferSlotCount, &outLayer);
@@ -96,14 +116,20 @@
return {addLayerToDisplayResources(display, outLayer), outLayer};
}
-ScopedAStatus VtsComposerClient::destroyLayer(int64_t display, int64_t layer) {
- auto status = mComposerClient->destroyLayer(display, layer);
-
- if (!status.isOk()) {
- return status;
+ScopedAStatus VtsComposerClient::destroyLayer(int64_t display, int64_t layer,
+ ComposerClientWriter* writer) {
+ if (mSupportsBatchedCreateLayer) {
+ writer->setLayerLifecycleBatchCommandType(display, layer,
+ LayerLifecycleBatchCommandType::DESTROY);
+ } else {
+ auto status = mComposerClient->destroyLayer(display, layer);
+ if (!status.isOk()) {
+ return status;
+ }
}
+
removeLayerFromDisplayResources(display, layer);
- return status;
+ return ScopedAStatus::ok();
}
std::pair<ScopedAStatus, int32_t> VtsComposerClient::getActiveConfig(int64_t display) {
@@ -632,7 +658,7 @@
return interfaceVersion >= 3;
}
-bool VtsComposerClient::destroyAllLayers() {
+bool VtsComposerClient::destroyAllLayers(ComposerClientWriter* writer) {
std::unordered_map<int64_t, DisplayResource> physicalDisplays;
while (!mDisplayResources.empty()) {
const auto& it = mDisplayResources.begin();
@@ -640,7 +666,7 @@
while (!resource.layers.empty()) {
auto layer = *resource.layers.begin();
- const auto status = destroyLayer(display, layer);
+ const auto status = destroyLayer(display, layer, writer);
if (!status.isOk()) {
ALOGE("Unable to destroy all the layers, failed at layer %" PRId64 " with error %s",
layer, status.getDescription().c_str());
diff --git a/graphics/composer/aidl/vts/VtsComposerClient.h b/graphics/composer/aidl/vts/VtsComposerClient.h
index 292bc40..fabc82a 100644
--- a/graphics/composer/aidl/vts/VtsComposerClient.h
+++ b/graphics/composer/aidl/vts/VtsComposerClient.h
@@ -25,6 +25,7 @@
#include <android/binder_manager.h>
#include <android/binder_process.h>
#include <android/hardware/graphics/composer3/ComposerClientReader.h>
+#include <android/hardware/graphics/composer3/ComposerClientWriter.h>
#include <binder/ProcessState.h>
#include <gtest/gtest.h>
#include <ui/Fence.h>
@@ -59,7 +60,7 @@
ScopedAStatus createClient();
- bool tearDown();
+ bool tearDown(ComposerClientWriter*);
std::pair<ScopedAStatus, int32_t> getInterfaceVersion() const;
@@ -69,9 +70,10 @@
ScopedAStatus destroyVirtualDisplay(int64_t display);
- std::pair<ScopedAStatus, int64_t> createLayer(int64_t display, int32_t bufferSlotCount);
+ std::pair<ScopedAStatus, int64_t> createLayer(int64_t display, int32_t bufferSlotCount,
+ ComposerClientWriter*);
- ScopedAStatus destroyLayer(int64_t display, int64_t layer);
+ ScopedAStatus destroyLayer(int64_t display, int64_t layer, ComposerClientWriter*);
std::pair<ScopedAStatus, int32_t> getActiveConfig(int64_t display);
@@ -211,7 +213,7 @@
void removeLayerFromDisplayResources(int64_t display, int64_t layer);
- bool destroyAllLayers();
+ bool destroyAllLayers(ComposerClientWriter*);
bool verifyComposerCallbackParams();
@@ -229,6 +231,8 @@
std::shared_ptr<IComposerClient> mComposerClient;
std::shared_ptr<GraphicsComposerCallback> mComposerCallback;
std::unordered_map<int64_t, DisplayResource> mDisplayResources;
+ bool mSupportsBatchedCreateLayer = false;
+ std::atomic<int64_t> mNextLayerHandle = 1;
};
class VtsDisplay {
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp
index 2e3f4df..3f82925 100644
--- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_ReadbackTest.cpp
@@ -85,8 +85,9 @@
}
void TearDown() override {
+ ASSERT_FALSE(mDisplays.empty());
ASSERT_TRUE(mComposerClient->setPowerMode(getPrimaryDisplayId(), PowerMode::OFF).isOk());
- ASSERT_TRUE(mComposerClient->tearDown());
+ ASSERT_TRUE(mComposerClient->tearDown(mWriter.get()));
mComposerClient.reset();
const auto errors = mReader.takeErrors();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -201,7 +202,8 @@
return;
}
- auto layer = std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ auto layer =
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
common::Rect coloredSquare({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setColor(BLUE);
layer->setDisplayFrame(coloredSquare);
@@ -270,7 +272,7 @@
auto layer = std::make_shared<TestBufferLayer>(
mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), common::PixelFormat::RGBA_8888);
+ getDisplayHeight(), common::PixelFormat::RGBA_8888, *mWriter);
layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
@@ -315,7 +317,8 @@
return;
}
- auto layer = std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ auto layer =
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
common::Rect coloredSquare({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setColor(BLUE);
layer->setDisplayFrame(coloredSquare);
@@ -454,9 +457,9 @@
expectedColors, getDisplayWidth(),
{0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, BLUE);
- auto layer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
- getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), PixelFormat::RGBA_FP16);
+ auto layer = std::make_shared<TestBufferLayer>(
+ mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
+ getDisplayHeight(), PixelFormat::RGBA_FP16, *mWriter);
layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
@@ -550,7 +553,7 @@
auto deviceLayer = std::make_shared<TestBufferLayer>(
mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight() / 2, PixelFormat::RGBA_8888);
+ getDisplayHeight() / 2, PixelFormat::RGBA_8888, *mWriter);
std::vector<Color> deviceColors(deviceLayer->getWidth() * deviceLayer->getHeight());
ReadbackHelper::fillColorsArea(deviceColors, static_cast<int32_t>(deviceLayer->getWidth()),
{0, 0, static_cast<int32_t>(deviceLayer->getWidth()),
@@ -574,7 +577,7 @@
auto clientLayer = std::make_shared<TestBufferLayer>(
mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), clientWidth,
- clientHeight, PixelFormat::RGBA_FP16, Composition::DEVICE);
+ clientHeight, PixelFormat::RGBA_FP16, *mWriter, Composition::DEVICE);
common::Rect clientFrame = {0, getDisplayHeight() / 2, getDisplayWidth(),
getDisplayHeight()};
clientLayer->setDisplayFrame(clientFrame);
@@ -643,9 +646,9 @@
static_cast<size_t>(getDisplayWidth() * getDisplayHeight()));
ReadbackHelper::fillColorsArea(expectedColors, getDisplayWidth(), redRect, RED);
- auto layer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
- getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), PixelFormat::RGBA_8888);
+ auto layer = std::make_shared<TestBufferLayer>(
+ mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
+ getDisplayHeight(), PixelFormat::RGBA_8888, *mWriter);
layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
@@ -714,7 +717,8 @@
return;
}
- auto layer = std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ auto layer =
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
layer->setColor(RED);
layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
@@ -774,9 +778,9 @@
expectedColors, getDisplayWidth(),
{0, getDisplayHeight() / 2, getDisplayWidth(), getDisplayHeight()}, BLUE);
- auto layer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
- getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), PixelFormat::RGBA_8888);
+ auto layer = std::make_shared<TestBufferLayer>(
+ mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
+ getDisplayHeight(), PixelFormat::RGBA_8888, *mWriter);
layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
layer->setDataspace(ReadbackHelper::getDataspaceForColorMode(mode));
@@ -828,11 +832,13 @@
common::Rect redRect = {0, 0, getDisplayWidth(), getDisplayHeight() / 2};
common::Rect blueRect = {0, getDisplayHeight() / 4, getDisplayWidth(), getDisplayHeight()};
- auto redLayer = std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ auto redLayer =
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
redLayer->setColor(RED);
redLayer->setDisplayFrame(redRect);
- auto blueLayer = std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ auto blueLayer =
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
blueLayer->setColor(BLUE);
blueLayer->setDisplayFrame(blueRect);
blueLayer->setZOrder(5);
@@ -914,14 +920,14 @@
static constexpr float kMaxBrightnessNits = 300.f;
const auto redLayer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
redLayer->setColor(RED);
redLayer->setDisplayFrame(redRect);
redLayer->setWhitePointNits(kMaxBrightnessNits);
redLayer->setBrightness(1.f);
const auto dimmerRedLayer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
dimmerRedLayer->setColor(RED);
dimmerRedLayer->setDisplayFrame(dimmerRedRect);
// Intentionally use a small dimming ratio as some implementations may be more likely to
@@ -992,14 +998,14 @@
mTopLayerColor);
auto backgroundLayer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
backgroundLayer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
backgroundLayer->setZOrder(0);
backgroundLayer->setColor(mBackgroundColor);
- auto layer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
- getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), PixelFormat::RGBA_8888);
+ auto layer = std::make_shared<TestBufferLayer>(
+ mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
+ getDisplayHeight(), PixelFormat::RGBA_8888, *mWriter);
layer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
layer->setZOrder(10);
layer->setDataspace(Dataspace::UNKNOWN);
@@ -1190,7 +1196,7 @@
GraphicsCompositionTest::SetUp();
auto backgroundLayer =
- std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId());
+ std::make_shared<TestColorLayer>(mComposerClient, getPrimaryDisplayId(), *mWriter);
backgroundLayer->setColor({0.0f, 0.0f, 0.0f, 0.0f});
backgroundLayer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
backgroundLayer->setZOrder(0);
@@ -1202,7 +1208,7 @@
mLayer = std::make_shared<TestBufferLayer>(mComposerClient, *mTestRenderEngine,
getPrimaryDisplayId(), mSideLength, mSideLength,
- PixelFormat::RGBA_8888);
+ PixelFormat::RGBA_8888, *mWriter);
mLayer->setDisplayFrame({0, 0, mSideLength, mSideLength});
mLayer->setZOrder(10);
@@ -1388,7 +1394,7 @@
void makeLayer() {
mLayer = std::make_shared<TestBufferLayer>(
mComposerClient, *mTestRenderEngine, getPrimaryDisplayId(), getDisplayWidth(),
- getDisplayHeight(), common::PixelFormat::RGBA_8888);
+ getDisplayHeight(), common::PixelFormat::RGBA_8888, *mWriter);
mLayer->setDisplayFrame({0, 0, getDisplayWidth(), getDisplayHeight()});
mLayer->setZOrder(10);
mLayer->setAlpha(1.f);
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
index 086d290..5e45fd9 100644
--- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -70,7 +70,7 @@
}
void TearDown() override {
- ASSERT_TRUE(mComposerClient->tearDown());
+ ASSERT_TRUE(mComposerClient->tearDown(nullptr));
mComposerClient.reset();
}
@@ -832,36 +832,58 @@
}
TEST_P(GraphicsComposerAidlTest, CreateLayer) {
+ if (hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "Create layer will be tested in GraphicsComposerAidlBatchedCommandTest";
+ return;
+ }
+
const auto& [status, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, nullptr);
EXPECT_TRUE(status.isOk());
- EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk());
+ EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer, nullptr).isOk());
}
TEST_P(GraphicsComposerAidlTest, CreateLayer_BadDisplay) {
- const auto& [status, _] = mComposerClient->createLayer(getInvalidDisplayId(), kBufferSlotCount);
+ if (hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "Create layer will be tested in GraphicsComposerAidlBatchedCommandTest";
+ return;
+ }
+
+ const auto& [status, _] =
+ mComposerClient->createLayer(getInvalidDisplayId(), kBufferSlotCount, nullptr);
EXPECT_FALSE(status.isOk());
EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_DISPLAY));
}
TEST_P(GraphicsComposerAidlTest, DestroyLayer_BadDisplay) {
+ if (hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "Destroy layer will be tested in GraphicsComposerAidlBatchedCommandTest";
+ return;
+ }
+
const auto& [status, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, nullptr);
EXPECT_TRUE(status.isOk());
- const auto& destroyStatus = mComposerClient->destroyLayer(getInvalidDisplayId(), layer);
+ const auto& destroyStatus =
+ mComposerClient->destroyLayer(getInvalidDisplayId(), layer, nullptr);
EXPECT_FALSE(destroyStatus.isOk());
EXPECT_NO_FATAL_FAILURE(
assertServiceSpecificError(destroyStatus, IComposerClient::EX_BAD_DISPLAY));
- ASSERT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk());
+ ASSERT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer, nullptr).isOk());
}
TEST_P(GraphicsComposerAidlTest, DestroyLayer_BadLayerError) {
+ if (hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "Destroy layer will be tested in GraphicsComposerAidlBatchedCommandTest";
+ return;
+ }
+
// We haven't created any layers yet, so any id should be invalid
- const auto& status = mComposerClient->destroyLayer(getPrimaryDisplayId(), /*layer*/ 1);
+ const auto& status = mComposerClient->destroyLayer(getPrimaryDisplayId(), /*layer*/ 1, nullptr);
EXPECT_FALSE(status.isOk());
EXPECT_NO_FATAL_FAILURE(assertServiceSpecificError(status, IComposerClient::EX_BAD_LAYER));
@@ -1171,6 +1193,12 @@
}
}
+TEST_P(GraphicsComposerAidlTest, LayerLifecycleCapabilityNotSupportedOnOldVersions) {
+ if (hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ EXPECT_GE(getInterfaceVersion(), 3);
+ }
+}
+
class GraphicsComposerAidlV2Test : public GraphicsComposerAidlTest {
protected:
void SetUp() override {
@@ -1275,8 +1303,8 @@
if (vrrConfig.notifyExpectedPresentConfig) {
const auto& notifyExpectedPresentConfig =
*vrrConfig.notifyExpectedPresentConfig;
- EXPECT_GT(0, notifyExpectedPresentConfig.notifyExpectedPresentHeadsUpNs);
- EXPECT_GE(0, notifyExpectedPresentConfig.notifyExpectedPresentTimeoutNs);
+ EXPECT_GE(notifyExpectedPresentConfig.headsUpNs, 0);
+ EXPECT_GE(notifyExpectedPresentConfig.timeoutNs, 0);
}
}
}
@@ -1372,10 +1400,11 @@
class GraphicsComposerAidlCommandTest : public GraphicsComposerAidlTest {
protected:
void TearDown() override {
- const auto errors = mReader.takeErrors();
+ ASSERT_FALSE(mDisplays.empty());
ASSERT_TRUE(mReader.takeErrors().empty());
ASSERT_TRUE(mReader.takeChangedCompositionTypes(getPrimaryDisplayId()).empty());
+ ASSERT_TRUE(mComposerClient->tearDown(&getWriter(getPrimaryDisplayId())));
ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::TearDown());
}
@@ -1463,10 +1492,10 @@
RenderIntent::COLORIMETRIC)
.isOk());
- const auto& [status, layer] =
- mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount);
- EXPECT_TRUE(status.isOk());
auto& writer = getWriter(display.getDisplayId());
+ const auto& [status, layer] =
+ mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount, &writer);
+ EXPECT_TRUE(status.isOk());
{
const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer);
@@ -1506,7 +1535,7 @@
execute();
}
- EXPECT_TRUE(mComposerClient->destroyLayer(display.getDisplayId(), layer).isOk());
+ EXPECT_TRUE(mComposerClient->destroyLayer(display.getDisplayId(), layer, &writer).isOk());
}
sp<::android::Fence> presentAndGetFence(
@@ -1541,15 +1570,16 @@
}
int64_t createOnScreenLayer(Composition composition = Composition::DEVICE) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [status, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(status.isOk());
Rect displayFrame{0, 0, getPrimaryDisplay().getDisplayWidth(),
getPrimaryDisplay().getDisplayHeight()};
FRect cropRect{0, 0, (float)getPrimaryDisplay().getDisplayWidth(),
(float)getPrimaryDisplay().getDisplayHeight()};
configureLayer(getPrimaryDisplay(), layer, composition, displayFrame, cropRect);
- auto& writer = getWriter(getPrimaryDisplayId());
+
writer.setLayerDataspace(getPrimaryDisplayId(), layer, common::Dataspace::UNKNOWN);
return layer;
}
@@ -1758,10 +1788,10 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerColorTransform) {
- const auto& [status, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
- EXPECT_TRUE(status.isOk());
auto& writer = getWriter(getPrimaryDisplayId());
+ const auto& [status, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
+ EXPECT_TRUE(status.isOk());
writer.setLayerColorTransform(getPrimaryDisplayId(), layer, kIdentity.data());
execute();
@@ -1900,7 +1930,7 @@
ASSERT_NE(nullptr, handle);
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
Rect displayFrame{0, 0, getPrimaryDisplay().getDisplayWidth(),
@@ -1937,15 +1967,15 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerCursorPosition) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888);
const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle, /*acquireFence*/ -1);
Rect displayFrame{0, 0, getPrimaryDisplay().getDisplayWidth(),
@@ -1981,19 +2011,19 @@
const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
- const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
- EXPECT_TRUE(layerStatus.isOk());
auto& writer = getWriter(getPrimaryDisplayId());
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
+ EXPECT_TRUE(layerStatus.isOk());
writer.setLayerBuffer(getPrimaryDisplayId(), layer, /*slot*/ 0, handle, /*acquireFence*/ -1);
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerBufferMultipleTimes) {
- const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
- EXPECT_TRUE(layerStatus.isOk());
auto& writer = getWriter(getPrimaryDisplayId());
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
+ EXPECT_TRUE(layerStatus.isOk());
// Setup 3 buffers in the buffer cache, with the last buffer being active. Then, emulate the
// Android platform code that clears all 3 buffer slots by setting all but the active buffer
@@ -2041,14 +2071,14 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerSurfaceDamage) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
Rect empty{0, 0, 0, 0};
Rect unit{0, 0, 1, 1};
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerSurfaceDamage(getPrimaryDisplayId(), layer, std::vector<Rect>(1, empty));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2063,14 +2093,14 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerBlockingRegion) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
Rect empty{0, 0, 0, 0};
Rect unit{0, 0, 1, 1};
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerBlockingRegion(getPrimaryDisplayId(), layer, std::vector<Rect>(1, empty));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2085,11 +2115,11 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerBlendMode) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerBlendMode(getPrimaryDisplayId(), layer, BlendMode::NONE);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2104,11 +2134,11 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerColor) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerColor(getPrimaryDisplayId(), layer, Color{1.0f, 1.0f, 1.0f, 1.0f});
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2119,11 +2149,11 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerCompositionType) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerCompositionType(getPrimaryDisplayId(), layer, Composition::CLIENT);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2142,8 +2172,9 @@
TEST_P(GraphicsComposerAidlCommandTest, DisplayDecoration) {
for (VtsDisplay& display : mDisplays) {
+ auto& writer = getWriter(display.getDisplayId());
const auto [layerStatus, layer] =
- mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(display.getDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
const auto [error, support] =
@@ -2166,8 +2197,7 @@
}
configureLayer(display, layer, Composition::DISPLAY_DECORATION, display.getFrameRect(),
- display.getCrop());
- auto& writer = getWriter(display.getDisplayId());
+ display.getCrop());
writer.setLayerBuffer(display.getDisplayId(), layer, /*slot*/ 0, decorBuffer->handle,
/*acquireFence*/ -1);
writer.validateDisplay(display.getDisplayId(), ComposerClientWriter::kNoTimestamp,
@@ -2184,31 +2214,31 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerDataspace) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerDataspace(getPrimaryDisplayId(), layer, Dataspace::UNKNOWN);
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerDisplayFrame) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerDisplayFrame(getPrimaryDisplayId(), layer, Rect{0, 0, 1, 1});
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerPlaneAlpha) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerPlaneAlpha(getPrimaryDisplayId(), layer, /*alpha*/ 0.0f);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2228,31 +2258,31 @@
const auto handle = buffer->handle;
ASSERT_NE(nullptr, handle);
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerSidebandStream(getPrimaryDisplayId(), layer, handle);
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerSourceCrop) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerSourceCrop(getPrimaryDisplayId(), layer, FRect{0.0f, 0.0f, 1.0f, 1.0f});
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerTransform) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerTransform(getPrimaryDisplayId(), layer, static_cast<Transform>(0));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2291,14 +2321,14 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerVisibleRegion) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
Rect empty{0, 0, 0, 0};
Rect unit{0, 0, 1, 1};
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerVisibleRegion(getPrimaryDisplayId(), layer, std::vector<Rect>(1, empty));
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2313,11 +2343,12 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerZOrder) {
+ auto& writer = getWriter(getPrimaryDisplayId());
+
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
writer.setLayerZOrder(getPrimaryDisplayId(), layer, /*z*/ 10);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2328,8 +2359,9 @@
}
TEST_P(GraphicsComposerAidlCommandTest, SetLayerPerFrameMetadata) {
+ auto& writer = getWriter(getPrimaryDisplayId());
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
/**
@@ -2344,7 +2376,6 @@
* white (D65) 0.3127 0.3290
*/
- auto& writer = getWriter(getPrimaryDisplayId());
std::vector<PerFrameMetadata> aidlMetadata;
aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_RED_PRIMARY_X, 0.680f});
aidlMetadata.push_back({PerFrameMetadataKey::DISPLAY_RED_PRIMARY_Y, 0.320f});
@@ -2364,18 +2395,19 @@
const auto errors = mReader.takeErrors();
if (errors.size() == 1 && errors[0].errorCode == EX_UNSUPPORTED_OPERATION) {
GTEST_SUCCEED() << "SetLayerPerFrameMetadata is not supported";
- EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk());
+ EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer, &writer).isOk());
return;
}
- EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer).isOk());
+ EXPECT_TRUE(mComposerClient->destroyLayer(getPrimaryDisplayId(), layer, &writer).isOk());
}
TEST_P(GraphicsComposerAidlCommandTest, setLayerBrightness) {
- const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
-
auto& writer = getWriter(getPrimaryDisplayId());
+
+ const auto& [layerStatus, layer] =
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
+
writer.setLayerBrightness(getPrimaryDisplayId(), layer, 0.2f);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -2604,12 +2636,12 @@
}
TEST_P(GraphicsComposerAidlCommandV2Test, SetLayerBufferSlotsToClear) {
+ auto& writer = getWriter(getPrimaryDisplayId());
// Older HAL versions use a backwards compatible way of clearing buffer slots
// HAL at version 1 or lower does not have LayerCommand::bufferSlotsToClear
const auto& [layerStatus, layer] =
- mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount);
+ mComposerClient->createLayer(getPrimaryDisplayId(), kBufferSlotCount, &writer);
EXPECT_TRUE(layerStatus.isOk());
- auto& writer = getWriter(getPrimaryDisplayId());
// setup 3 buffers in the buffer cache, with the last buffer being active
// then emulate the Android platform code that clears all 3 buffer slots
@@ -2868,7 +2900,8 @@
EXPECT_TRUE(mComposerClient->setPowerMode(displayId, PowerMode::ON).isOk());
- const auto& [status, layer] = mComposerClient->createLayer(displayId, kBufferSlotCount);
+ const auto& [status, layer] =
+ mComposerClient->createLayer(displayId, kBufferSlotCount, &writer);
const auto buffer = allocate(::android::PIXEL_FORMAT_RGBA_8888);
ASSERT_NE(nullptr, buffer);
ASSERT_EQ(::android::OK, buffer->initCheck());
@@ -2918,7 +2951,8 @@
}
for (auto& [displayId, layer] : layers) {
- EXPECT_TRUE(mComposerClient->destroyLayer(displayId, layer).isOk());
+ auto& writer = getWriter(displayId);
+ EXPECT_TRUE(mComposerClient->destroyLayer(displayId, layer, &writer).isOk());
}
std::lock_guard guard{readersMutex};
@@ -2928,22 +2962,22 @@
}
}
-class GraphicsComposerAidlBatchedCommandTest : public GraphicsComposerAidlCommandTest {
+class GraphicsComposerAidlCommandV3Test : public GraphicsComposerAidlCommandTest {
protected:
void SetUp() override {
- GraphicsComposerAidlCommandTest::SetUp();
+ GraphicsComposerAidlTest::SetUp();
if (getInterfaceVersion() <= 2) {
GTEST_SKIP() << "Device interface version is expected to be >= 3";
}
}
- void TearDown() override {
- const auto errors = mReader.takeErrors();
- ASSERT_TRUE(mReader.takeErrors().empty());
- ASSERT_NO_FATAL_FAILURE(GraphicsComposerAidlTest::TearDown());
- }
};
-TEST_P(GraphicsComposerAidlBatchedCommandTest, CreateBatchedCommand) {
+TEST_P(GraphicsComposerAidlCommandV3Test, CreateBatchedCommand) {
+ if (!hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "LAYER_LIFECYCLE_BATCH_COMMAND not supported by the implementation";
+ return;
+ }
+
auto& writer = getWriter(getPrimaryDisplayId());
int64_t layer = 5;
writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer,
@@ -2955,7 +2989,30 @@
ASSERT_TRUE(mReader.takeErrors().empty());
}
-TEST_P(GraphicsComposerAidlBatchedCommandTest, DestroyBatchedCommand) {
+TEST_P(GraphicsComposerAidlCommandV3Test, CreateBatchedCommand_BadDisplay) {
+ if (!hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "LAYER_LIFECYCLE_BATCH_COMMAND not supported by the implementation";
+ return;
+ }
+
+ auto& writer = getWriter(getPrimaryDisplayId());
+ int64_t layer = 5;
+ writer.setLayerLifecycleBatchCommandType(getInvalidDisplayId(), layer,
+ LayerLifecycleBatchCommandType::CREATE);
+ writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1);
+ writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
+ execute();
+ const auto errors = mReader.takeErrors();
+ ASSERT_TRUE(errors.size() == 1 && errors[0].errorCode == IComposerClient::EX_BAD_DISPLAY);
+}
+
+TEST_P(GraphicsComposerAidlCommandV3Test, DestroyBatchedCommand) {
+ if (!hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "LAYER_LIFECYCLE_BATCH_COMMAND not supported by the implementation";
+ return;
+ }
+
auto& writer = getWriter(getPrimaryDisplayId());
int64_t layer = 5;
writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer,
@@ -2973,10 +3030,42 @@
writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1);
execute();
+ const auto errors = mReader.takeErrors();
+ ASSERT_TRUE(errors.size() == 1 && errors[0].errorCode == IComposerClient::EX_BAD_DISPLAY);
+}
+
+TEST_P(GraphicsComposerAidlCommandV3Test, DestroyBatchedCommand_BadDisplay) {
+ if (!hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "LAYER_LIFECYCLE_BATCH_COMMAND not supported by the implementation";
+ return;
+ }
+
+ auto& writer = getWriter(getPrimaryDisplayId());
+ int64_t layer = 5;
+ writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer,
+ LayerLifecycleBatchCommandType::CREATE);
+ writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1);
+ writer.validateDisplay(getPrimaryDisplayId(), ComposerClientWriter::kNoTimestamp,
+ VtsComposerClient::kNoFrameIntervalNs);
+ execute();
+ ASSERT_TRUE(mReader.takeErrors().empty());
+ writer.setLayerLifecycleBatchCommandType(getInvalidDisplayId(), layer,
+ LayerLifecycleBatchCommandType::DESTROY);
+ layer++;
+ writer.setLayerLifecycleBatchCommandType(getInvalidDisplayId(), layer,
+ LayerLifecycleBatchCommandType::CREATE);
+ writer.setNewBufferSlotCount(getPrimaryDisplayId(), layer, 1);
+
+ execute();
ASSERT_TRUE(mReader.takeErrors().empty());
}
-TEST_P(GraphicsComposerAidlBatchedCommandTest, NoCreateDestroyBatchedCommandIncorrectLayer) {
+TEST_P(GraphicsComposerAidlCommandV3Test, NoCreateDestroyBatchedCommandIncorrectLayer) {
+ if (!hasCapability(Capability::LAYER_LIFECYCLE_BATCH_COMMAND)) {
+ GTEST_SKIP() << "LAYER_LIFECYCLE_BATCH_COMMAND not supported by the implementation";
+ return;
+ }
+
auto& writer = getWriter(getPrimaryDisplayId());
int64_t layer = 5;
writer.setLayerLifecycleBatchCommandType(getPrimaryDisplayId(), layer,
@@ -2986,11 +3075,6 @@
ASSERT_TRUE(errors.size() == 1 && errors[0].errorCode == IComposerClient::EX_BAD_LAYER);
}
-GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlBatchedCommandTest);
-INSTANTIATE_TEST_SUITE_P(
- PerInstance, GraphicsComposerAidlBatchedCommandTest,
- testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)),
- ::android::PrintInstanceNameToString);
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandTest);
INSTANTIATE_TEST_SUITE_P(
PerInstance, GraphicsComposerAidlCommandTest,
@@ -3016,6 +3100,11 @@
PerInstance, GraphicsComposerAidlCommandV2Test,
testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)),
::android::PrintInstanceNameToString);
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandV3Test);
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, GraphicsComposerAidlCommandV3Test,
+ testing::ValuesIn(::android::getAidlHalInstanceNames(IComposer::descriptor)),
+ ::android::PrintInstanceNameToString);
} // namespace aidl::android::hardware::graphics::composer3::vts
int main(int argc, char** argv) {
diff --git a/health/aidl/default/Health.cpp b/health/aidl/default/Health.cpp
index 8174bc8..37662ea 100644
--- a/health/aidl/default/Health.cpp
+++ b/health/aidl/default/Health.cpp
@@ -36,6 +36,11 @@
LinkedCallback* linked = reinterpret_cast<LinkedCallback*>(cookie);
linked->OnCallbackDied();
}
+// Delete the owned cookie.
+void onCallbackUnlinked(void* cookie) {
+ LinkedCallback* linked = reinterpret_cast<LinkedCallback*>(cookie);
+ delete linked;
+}
} // namespace
/*
@@ -57,6 +62,7 @@
: instance_name_(instance_name),
healthd_config_(std::move(config)),
death_recipient_(AIBinder_DeathRecipient_new(&OnCallbackDiedWrapped)) {
+ AIBinder_DeathRecipient_setOnUnlinked(death_recipient_.get(), onCallbackUnlinked);
battery_monitor_.init(healthd_config_.get());
}
@@ -286,7 +292,7 @@
if (!linked_callback_result.ok()) {
return ndk::ScopedAStatus::fromStatus(-linked_callback_result.error().code());
}
- callbacks_.emplace_back(std::move(*linked_callback_result));
+ callbacks_[*linked_callback_result] = callback;
// unlock
}
@@ -314,12 +320,24 @@
std::lock_guard<decltype(callbacks_lock_)> lock(callbacks_lock_);
- auto matches = [callback](const auto& linked) {
- return linked->callback()->asBinder() == callback->asBinder(); // compares binder object
+ auto matches = [callback](const auto& cb) {
+ return cb->asBinder() == callback->asBinder(); // compares binder object
};
- auto it = std::remove_if(callbacks_.begin(), callbacks_.end(), matches);
- bool removed = (it != callbacks_.end());
- callbacks_.erase(it, callbacks_.end()); // calls unlinkToDeath on deleted callbacks.
+ bool removed = false;
+ for (auto it = callbacks_.begin(); it != callbacks_.end();) {
+ if (it->second->asBinder() == callback->asBinder()) {
+ auto status = AIBinder_unlinkToDeath(callback->asBinder().get(), death_recipient_.get(),
+ reinterpret_cast<void*>(it->first));
+ if (status != STATUS_OK && status != STATUS_DEAD_OBJECT) {
+ LOG(WARNING) << __func__
+ << "Cannot unlink to death: " << ::android::statusToString(status);
+ }
+ it = callbacks_.erase(it);
+ removed = true;
+ } else {
+ it++;
+ }
+ }
return removed ? ndk::ScopedAStatus::ok()
: ndk::ScopedAStatus::fromExceptionCode(EX_ILLEGAL_ARGUMENT);
}
@@ -347,8 +365,8 @@
void Health::OnHealthInfoChanged(const HealthInfo& health_info) {
// Notify all callbacks
std::unique_lock<decltype(callbacks_lock_)> lock(callbacks_lock_);
- for (const auto& linked : callbacks_) {
- auto res = linked->callback()->healthInfoChanged(health_info);
+ for (const auto& [_, callback] : callbacks_) {
+ auto res = callback->healthInfoChanged(health_info);
if (!res.isOk()) {
LOG(DEBUG) << "Cannot call healthInfoChanged:" << res.getDescription()
<< ". Do nothing here if callback is dead as it will be cleaned up later.";
diff --git a/health/aidl/default/LinkedCallback.cpp b/health/aidl/default/LinkedCallback.cpp
index 26e99f9..df471a3 100644
--- a/health/aidl/default/LinkedCallback.cpp
+++ b/health/aidl/default/LinkedCallback.cpp
@@ -24,35 +24,24 @@
namespace aidl::android::hardware::health {
-::android::base::Result<std::unique_ptr<LinkedCallback>> LinkedCallback::Make(
+::android::base::Result<LinkedCallback*> LinkedCallback::Make(
std::shared_ptr<Health> service, std::shared_ptr<IHealthInfoCallback> callback) {
- std::unique_ptr<LinkedCallback> ret(new LinkedCallback());
+ LinkedCallback* ret(new LinkedCallback());
+ // pass ownership of this object to the death recipient
binder_status_t linkRet =
AIBinder_linkToDeath(callback->asBinder().get(), service->death_recipient_.get(),
- reinterpret_cast<void*>(ret.get()));
+ reinterpret_cast<void*>(ret));
if (linkRet != ::STATUS_OK) {
LOG(WARNING) << __func__ << "Cannot link to death: " << linkRet;
return ::android::base::Error(-linkRet);
}
ret->service_ = service;
- ret->callback_ = std::move(callback);
+ ret->callback_ = callback;
return ret;
}
LinkedCallback::LinkedCallback() = default;
-LinkedCallback::~LinkedCallback() {
- if (callback_ == nullptr) {
- return;
- }
- auto status =
- AIBinder_unlinkToDeath(callback_->asBinder().get(), service()->death_recipient_.get(),
- reinterpret_cast<void*>(this));
- if (status != STATUS_OK && status != STATUS_DEAD_OBJECT) {
- LOG(WARNING) << __func__ << "Cannot unlink to death: " << ::android::statusToString(status);
- }
-}
-
std::shared_ptr<Health> LinkedCallback::service() {
auto service_sp = service_.lock();
CHECK_NE(nullptr, service_sp);
@@ -60,7 +49,10 @@
}
void LinkedCallback::OnCallbackDied() {
- service()->unregisterCallback(callback_);
+ auto sCb = callback_.lock();
+ if (sCb) {
+ service()->unregisterCallback(sCb);
+ }
}
} // namespace aidl::android::hardware::health
diff --git a/health/aidl/default/LinkedCallback.h b/health/aidl/default/LinkedCallback.h
index da494c9..8c9c997 100644
--- a/health/aidl/default/LinkedCallback.h
+++ b/health/aidl/default/LinkedCallback.h
@@ -32,19 +32,10 @@
class LinkedCallback {
public:
// Automatically linkToDeath upon construction with the returned object as the cookie.
- // service->death_reciepient() should be from CreateDeathRecipient().
- // Not using a strong reference to |service| to avoid circular reference. The lifetime
- // of |service| must be longer than this LinkedCallback object.
- static ::android::base::Result<std::unique_ptr<LinkedCallback>> Make(
+ // The deathRecipient owns the LinkedCallback object and will delete it with
+ // cookie when it's unlinked.
+ static ::android::base::Result<LinkedCallback*> Make(
std::shared_ptr<Health> service, std::shared_ptr<IHealthInfoCallback> callback);
-
- // Automatically unlinkToDeath upon destruction. So, it is always safe to reinterpret_cast
- // the cookie back to the LinkedCallback object.
- ~LinkedCallback();
-
- // The wrapped IHealthInfoCallback object.
- const std::shared_ptr<IHealthInfoCallback>& callback() const { return callback_; }
-
// On callback died, unreigster it from the service.
void OnCallbackDied();
@@ -55,7 +46,7 @@
std::shared_ptr<Health> service();
std::weak_ptr<Health> service_;
- std::shared_ptr<IHealthInfoCallback> callback_;
+ std::weak_ptr<IHealthInfoCallback> callback_;
};
} // namespace aidl::android::hardware::health
diff --git a/health/aidl/default/include/health-impl/Health.h b/health/aidl/default/include/health-impl/Health.h
index dc3a0ef..429ae2a 100644
--- a/health/aidl/default/include/health-impl/Health.h
+++ b/health/aidl/default/include/health-impl/Health.h
@@ -16,6 +16,7 @@
#pragma once
+#include <map>
#include <memory>
#include <optional>
@@ -112,7 +113,7 @@
ndk::ScopedAIBinder_DeathRecipient death_recipient_;
int binder_fd_ = -1;
std::mutex callbacks_lock_;
- std::vector<std::unique_ptr<LinkedCallback>> callbacks_;
+ std::map<LinkedCallback*, std::shared_ptr<IHealthInfoCallback>> callbacks_;
};
} // namespace aidl::android::hardware::health
diff --git a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp
index f24c6d1..9a75e6e 100644
--- a/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp
+++ b/media/omx/1.0/vts/functional/video/VtsHalMediaOmxV1_0TargetVideoEncTest.cpp
@@ -630,10 +630,7 @@
if (error != android::NO_ERROR) return 1;
} else {
void* data;
- int32_t outBytesPerPixel;
- int32_t outBytesPerStride;
- error = gbmapper.lock(buff, buffer->omxBuffer.attr.anwBuffer.usage, rect, &data,
- &outBytesPerPixel, &outBytesPerStride);
+ error = gbmapper.lock(buff, buffer->omxBuffer.attr.anwBuffer.usage, rect, &data);
EXPECT_EQ(error, android::NO_ERROR);
if (error != android::NO_ERROR) return 1;
diff --git a/neuralnetworks/aidl/utils/src/Conversions.cpp b/neuralnetworks/aidl/utils/src/Conversions.cpp
index 47c72b4..9f920bb 100644
--- a/neuralnetworks/aidl/utils/src/Conversions.cpp
+++ b/neuralnetworks/aidl/utils/src/Conversions.cpp
@@ -421,7 +421,7 @@
return createSharedMemoryFromAHWB(ahwb, /*takeOwnership=*/true);
#else // __ANDROID__
- LOG(FATAL) << "GeneralResult<SharedMemory> unvalidatedConvert(const aidl_hal::Memory& "
+ LOG(ERROR) << "GeneralResult<SharedMemory> unvalidatedConvert(const aidl_hal::Memory& "
"memory): Not Available on Host Build";
return NN_ERROR() << "createFromHandle failed";
#endif // __ANDROID__
@@ -732,7 +732,7 @@
};
return Memory::make<Memory::Tag::hardwareBuffer>(std::move(hardwareBuffer));
#else // __ANDROID__
- LOG(FATAL) << "nn::GeneralResult<Memory> unvalidatedConvert(const nn::Memory::HardwareBuffer& "
+ LOG(ERROR) << "nn::GeneralResult<Memory> unvalidatedConvert(const nn::Memory::HardwareBuffer& "
"memory): Not Available on Host Build";
(void)memory;
return (NN_ERROR() << "unvalidatedConvert failed").operator nn::GeneralResult<Memory>();
diff --git a/power/aidl/Android.bp b/power/aidl/Android.bp
index 7643926..8900fb8 100644
--- a/power/aidl/Android.bp
+++ b/power/aidl/Android.bp
@@ -28,11 +28,20 @@
"android/hardware/power/*.aidl",
],
stability: "vintf",
+ imports: [
+ "android.hardware.common.fmq-V1",
+ "android.hardware.common-V2",
+ ],
backend: {
cpp: {
+ enabled: false,
+ },
+ ndk: {
enabled: true,
},
java: {
+ sdk_version: "module_current",
+ enabled: true,
platform_apis: true,
},
},
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/ChannelConfig.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/ChannelConfig.aidl
new file mode 100644
index 0000000..d3caca4
--- /dev/null
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/ChannelConfig.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power;
+@VintfStability
+parcelable ChannelConfig {
+ android.hardware.common.fmq.MQDescriptor<android.hardware.power.ChannelMessage,android.hardware.common.fmq.SynchronizedReadWrite> channelDescriptor;
+ @nullable android.hardware.common.fmq.MQDescriptor<byte,android.hardware.common.fmq.SynchronizedReadWrite> eventFlagDescriptor;
+ int readFlagBitmask;
+ int writeFlagBitmask;
+}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/ChannelMessage.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/ChannelMessage.aidl
new file mode 100644
index 0000000..ab38fcc
--- /dev/null
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/ChannelMessage.aidl
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power;
+@FixedSize @VintfStability
+parcelable ChannelMessage {
+ int sessionID;
+ long timeStampNanos;
+ android.hardware.power.ChannelMessage.ChannelMessageContents data;
+ @FixedSize @VintfStability
+ union ChannelMessageContents {
+ long[16] reserved = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+ long targetDuration;
+ android.hardware.power.SessionHint hint;
+ android.hardware.power.ChannelMessage.ChannelMessageContents.SessionModeSetter mode;
+ android.hardware.power.WorkDurationFixedV1 workDuration;
+ @FixedSize @VintfStability
+ parcelable SessionModeSetter {
+ android.hardware.power.SessionMode modeInt;
+ boolean enabled;
+ }
+ }
+}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPower.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPower.aidl
index ae03313..8acdaf2 100644
--- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPower.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPower.aidl
@@ -40,4 +40,7 @@
boolean isBoostSupported(in android.hardware.power.Boost type);
android.hardware.power.IPowerHintSession createHintSession(in int tgid, in int uid, in int[] threadIds, in long durationNanos);
long getHintSessionPreferredRate();
+ android.hardware.power.IPowerHintSession createHintSessionWithConfig(in int tgid, in int uid, in int[] threadIds, in long durationNanos, in android.hardware.power.SessionTag tag, out android.hardware.power.SessionConfig config);
+ android.hardware.power.ChannelConfig getSessionChannel(in int tgid, in int uid);
+ oneway void closeSessionChannel(in int tgid, in int uid);
}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl
index 6bc663e..010f815 100644
--- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl
@@ -42,4 +42,5 @@
oneway void sendHint(android.hardware.power.SessionHint hint);
void setThreads(in int[] threadIds);
oneway void setMode(android.hardware.power.SessionMode type, boolean enabled);
+ android.hardware.power.SessionConfig getSessionConfig();
}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionConfig.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionConfig.aidl
new file mode 100644
index 0000000..b03cfb2
--- /dev/null
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionConfig.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power;
+@VintfStability
+parcelable SessionConfig {
+ long id;
+}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl
index cb37719..df31618 100644
--- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionHint.aidl
@@ -41,4 +41,5 @@
POWER_EFFICIENCY = 4,
GPU_LOAD_UP = 5,
GPU_LOAD_DOWN = 6,
+ GPU_LOAD_RESET = 7,
}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionTag.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionTag.aidl
new file mode 100644
index 0000000..862fbc5
--- /dev/null
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionTag.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power;
+@Backing(type="int") @VintfStability
+enum SessionTag {
+ OTHER,
+ SURFACEFLINGER,
+ HWUI,
+ GAME,
+ APP,
+}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/WorkDurationFixedV1.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/WorkDurationFixedV1.aidl
new file mode 100644
index 0000000..45310b8
--- /dev/null
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/WorkDurationFixedV1.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power;
+@FixedSize @VintfStability
+parcelable WorkDurationFixedV1 {
+ long durationNanos;
+ long workPeriodStartTimestampNanos;
+ long cpuDurationNanos;
+ long gpuDurationNanos;
+}
diff --git a/power/aidl/android/hardware/power/ChannelConfig.aidl b/power/aidl/android/hardware/power/ChannelConfig.aidl
new file mode 100644
index 0000000..4da292e
--- /dev/null
+++ b/power/aidl/android/hardware/power/ChannelConfig.aidl
@@ -0,0 +1,52 @@
+
+/*
+ * Copyright (C) 2023 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.power;
+
+import android.hardware.common.fmq.MQDescriptor;
+import android.hardware.common.fmq.SynchronizedReadWrite;
+import android.hardware.power.ChannelMessage;
+
+@VintfStability
+parcelable ChannelConfig {
+ /**
+ * The message queue descriptor that provides the information necessary for
+ * a client to write to this channel.
+ */
+ MQDescriptor<ChannelMessage, SynchronizedReadWrite> channelDescriptor;
+
+ /**
+ * A message queue descriptor used to pass an optional event flag to clients,
+ * used to synchronize multiple message queues using the same flag. If not
+ * defined, the flag from the channelDescriptor should be used.
+ */
+ @nullable MQDescriptor<byte, SynchronizedReadWrite> eventFlagDescriptor;
+
+ /**
+ * The read flag bitmask to be used with the event flag, specifying the
+ * bits used by this channel to mark that the buffer has been read from.
+ * If set to 0, the default bitmask will be used.
+ */
+ int readFlagBitmask;
+
+ /**
+ * The write flag bitmask to be used with the event flag, specifying the
+ * bits used by this channel to mark that the buffer has been written to.
+ * If set to 0, the default bitmask will be used.
+ */
+ int writeFlagBitmask;
+}
diff --git a/power/aidl/android/hardware/power/ChannelMessage.aidl b/power/aidl/android/hardware/power/ChannelMessage.aidl
new file mode 100644
index 0000000..fa16911
--- /dev/null
+++ b/power/aidl/android/hardware/power/ChannelMessage.aidl
@@ -0,0 +1,97 @@
+/*
+ * Copyright (C) 2023 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.power;
+
+import android.hardware.power.SessionHint;
+import android.hardware.power.SessionMode;
+import android.hardware.power.WorkDurationFixedV1;
+
+/**
+ * Data sent through the FMQ must follow this structure. It's important to note
+ * that such data may come from the app itself, so the HAL must validate all
+ * data received through this interface, and reject any calls not guaranteed to be
+ * valid. Each of the types defined in the inner union maps to an equivalent call
+ * on IPowerHintSession, and is merely being used to expedite the use of that API
+ * in cases where it is safe to bypass the HintManagerService.
+ */
+@FixedSize
+@VintfStability
+parcelable ChannelMessage {
+ /**
+ * The ID of the specific session sending the hint, used to enable a single
+ * channel to be multiplexed across all sessions in a single process.
+ */
+ int sessionID;
+
+ /**
+ * Timestamp in nanoseconds based on CLOCK_MONOTONIC when the message was sent,
+ * used to ensure all messages can be processed in a coherent order.
+ */
+ long timeStampNanos;
+
+ /**
+ * A union defining the different messages that can be passed through the
+ * channel. Each type corresponds to a different call in IPowerHintSession.
+ */
+ ChannelMessageContents data;
+
+ @FixedSize
+ @VintfStability
+ union ChannelMessageContents {
+ /**
+ * Reserves the maximum fixed size for the ChannelMessage.
+ */
+ long[16] reserved = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
+
+ /**
+ * Setting this field will update the session’s target duration, equivalent
+ * to calling updateTargetWorkDuration(targetDuration).
+ */
+ long targetDuration;
+
+ /**
+ * Setting this field will send a hint to the session, equivalent to
+ * calling sendHint(hint).
+ */
+ SessionHint hint;
+
+ /**
+ * Setting this field will send a hint to the session, equivalent to
+ * calling setMode(mode.modeInt, mode.enabled).
+ */
+ SessionModeSetter mode;
+
+ /**
+ * Setting this field will update the session’s actual duration, equivalent
+ * to calling reportActualWorkDuration([workDuration]). Only one duration
+ * can be passed at a time; this API expects durations to be reported
+ * immediately each frame, since the overhead of this call is much lower.
+ */
+ WorkDurationFixedV1 workDuration;
+
+ /**
+ * This structure is used to fit both the mode and the state within one
+ * entry in the union.
+ */
+ @FixedSize
+ @VintfStability
+ parcelable SessionModeSetter {
+ SessionMode modeInt;
+ boolean enabled;
+ }
+ }
+}
diff --git a/power/aidl/android/hardware/power/IPower.aidl b/power/aidl/android/hardware/power/IPower.aidl
index ee8e5a3..e25714f 100644
--- a/power/aidl/android/hardware/power/IPower.aidl
+++ b/power/aidl/android/hardware/power/IPower.aidl
@@ -17,8 +17,11 @@
package android.hardware.power;
import android.hardware.power.Boost;
+import android.hardware.power.ChannelConfig;
import android.hardware.power.IPowerHintSession;
import android.hardware.power.Mode;
+import android.hardware.power.SessionConfig;
+import android.hardware.power.SessionTag;
@VintfStability
interface IPower {
@@ -103,4 +106,42 @@
* EX_UNSUPPORTED_OPERATION if hint session is not supported.
*/
long getHintSessionPreferredRate();
+
+ /**
+ * A version of createHintSession that returns an additional bundle of session
+ * data, useful to help the session immediately communicate via an FMQ channel
+ * for more efficient updates.
+ *
+ * @return the new session if it is supported on this device, otherwise return
+ * with EX_UNSUPPORTED_OPERATION error if hint session is not
+ * supported on this device.
+ * @param tgid The TGID to be associated with this session.
+ * @param uid The UID to be associated with this session.
+ * @param threadIds The list of threads to be associated with this session.
+ * @param durationNanos The desired duration in nanoseconds for this session.
+ * @param config Extra session metadata to be returned to the caller.
+ */
+ IPowerHintSession createHintSessionWithConfig(in int tgid, in int uid, in int[] threadIds,
+ in long durationNanos, in SessionTag tag, out SessionConfig config);
+
+ /**
+ * Used to get an FMQ channel, per-process. The channel should be unique to
+ * that process, and should return the same ChannelConfig if called multiple
+ * times from that same process.
+ *
+ * @return the channel config if hint sessions are supported on this device,
+ * otherwise return with EX_UNSUPPORTED_OPERATION.
+ * @param tgid The TGID to be associated with this channel.
+ * @param uid The UID to be associated with this channel.
+ */
+ ChannelConfig getSessionChannel(in int tgid, in int uid);
+
+ /**
+ * Used to close a channel once it is no longer needed by a process, or that
+ * process dies.
+ *
+ * @param tgid The TGID to be associated with this channel.
+ * @param uid The UID to be associated with this channel.
+ */
+ oneway void closeSessionChannel(in int tgid, in int uid);
}
diff --git a/power/aidl/android/hardware/power/IPowerHintSession.aidl b/power/aidl/android/hardware/power/IPowerHintSession.aidl
index 62263c8..9dd251f 100644
--- a/power/aidl/android/hardware/power/IPowerHintSession.aidl
+++ b/power/aidl/android/hardware/power/IPowerHintSession.aidl
@@ -16,6 +16,7 @@
package android.hardware.power;
+import android.hardware.power.SessionConfig;
import android.hardware.power.SessionHint;
import android.hardware.power.SessionMode;
import android.hardware.power.WorkDuration;
@@ -91,4 +92,11 @@
* @param enabled True to enable the mode, false to disable it
*/
oneway void setMode(SessionMode type, boolean enabled);
+
+ /**
+ * This method provides direct access to a session's config data.
+ *
+ * @return the config data for this session
+ */
+ SessionConfig getSessionConfig();
}
diff --git a/power/aidl/android/hardware/power/SessionConfig.aidl b/power/aidl/android/hardware/power/SessionConfig.aidl
new file mode 100644
index 0000000..93dc9a2
--- /dev/null
+++ b/power/aidl/android/hardware/power/SessionConfig.aidl
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2023 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.power;
+
+/**
+ * Additional session to be passed to the hint session during creation, or acquired
+ * after creation from the session directly.
+ */
+@VintfStability
+parcelable SessionConfig {
+ /**
+ * The session's unique ID, used to identify the session for debugging and
+ * for multiplexing on the per-process FMQ channel.
+ */
+ long id;
+}
diff --git a/power/aidl/android/hardware/power/SessionHint.aidl b/power/aidl/android/hardware/power/SessionHint.aidl
index ae91061..1a8c505 100644
--- a/power/aidl/android/hardware/power/SessionHint.aidl
+++ b/power/aidl/android/hardware/power/SessionHint.aidl
@@ -65,4 +65,11 @@
* this hint session can reduce GPU resources and still meet the target duration.
*/
GPU_LOAD_DOWN = 6,
+
+ /**
+ * This hint indicates an upcoming GPU workload that is completely changed and
+ * unknown. It means that the hint session should reset GPU resources to a known
+ * baseline to prepare for an arbitrary load, and must wake up if inactive.
+ */
+ GPU_LOAD_RESET = 7,
}
diff --git a/power/aidl/android/hardware/power/SessionTag.aidl b/power/aidl/android/hardware/power/SessionTag.aidl
new file mode 100644
index 0000000..27bf3e3
--- /dev/null
+++ b/power/aidl/android/hardware/power/SessionTag.aidl
@@ -0,0 +1,49 @@
+/*
+ * Copyright (C) 2023 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.power;
+
+@VintfStability
+@Backing(type="int")
+enum SessionTag {
+ /**
+ * This tag is used to mark uncategorized hint sessions.
+ */
+ OTHER,
+
+ /**
+ * This tag is used to mark the SurfaceFlinger hint session.
+ */
+ SURFACEFLINGER,
+
+ /**
+ * This tag is used to mark hint sessions created by HWUI.
+ */
+ HWUI,
+
+ /**
+ * This tag is used to mark hint sessions created by applications that are
+ * categorized as games.
+ */
+ GAME,
+
+ /**
+ * This tag is used to mark the hint session is created by the application.
+ * If an applications is categorized as game, then GAME should be used
+ * instead.
+ */
+ APP,
+}
diff --git a/power/aidl/android/hardware/power/WorkDurationFixedV1.aidl b/power/aidl/android/hardware/power/WorkDurationFixedV1.aidl
new file mode 100644
index 0000000..ef5c755
--- /dev/null
+++ b/power/aidl/android/hardware/power/WorkDurationFixedV1.aidl
@@ -0,0 +1,47 @@
+/*
+ * Copyright (C) 2023 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.power;
+
+@FixedSize
+@VintfStability
+parcelable WorkDurationFixedV1 {
+ /**
+ * Total work duration in nanoseconds.
+ */
+ long durationNanos;
+
+ /**
+ * Timestamp in nanoseconds based on CLOCK_MONOTONIC when the work starts.
+ * The work period start timestamp could be zero if the call is from
+ * the legacy SDK/NDK reportActualWorkDuration API.
+ */
+ long workPeriodStartTimestampNanos;
+
+ /**
+ * CPU work duration in nanoseconds.
+ * The CPU work duration could be the same as the total work duration if
+ * the call is from the legacy SDK/NDK reportActualWorkDuration API.
+ */
+ long cpuDurationNanos;
+
+ /**
+ * GPU work duration in nanoseconds.
+ * The GPU work duration could be zero if the call is from the legacy
+ * SDK/NDK reportActualWorkDuration API.
+ */
+ long gpuDurationNanos;
+}
diff --git a/power/aidl/default/Android.bp b/power/aidl/default/Android.bp
index e3af179..b4ccc7d 100644
--- a/power/aidl/default/Android.bp
+++ b/power/aidl/default/Android.bp
@@ -29,8 +29,12 @@
vintf_fragments: [":android.hardware.power.xml"],
vendor: true,
shared_libs: [
+ "android.hardware.common-V2-ndk",
+ "android.hardware.common.fmq-V1-ndk",
"libbase",
"libbinder_ndk",
+ "libcutils",
+ "libfmq",
],
srcs: [
"main.cpp",
diff --git a/power/aidl/default/Power.cpp b/power/aidl/default/Power.cpp
index 8fe370c..8f15663 100644
--- a/power/aidl/default/Power.cpp
+++ b/power/aidl/default/Power.cpp
@@ -18,6 +18,8 @@
#include "PowerHintSession.h"
#include <android-base/logging.h>
+#include <fmq/AidlMessageQueue.h>
+#include <fmq/EventFlag.h>
namespace aidl {
namespace android {
@@ -27,6 +29,10 @@
namespace example {
using namespace std::chrono_literals;
+using ::aidl::android::hardware::common::fmq::MQDescriptor;
+using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite;
+using ::aidl::android::hardware::power::ChannelMessage;
+using ::android::AidlMessageQueue;
using ndk::ScopedAStatus;
@@ -70,6 +76,27 @@
return ScopedAStatus::ok();
}
+ndk::ScopedAStatus Power::createHintSessionWithConfig(
+ int32_t tgid, int32_t uid, const std::vector<int32_t>& threadIds, int64_t durationNanos,
+ SessionTag, SessionConfig* config, std::shared_ptr<IPowerHintSession>* _aidl_return) {
+ auto out = createHintSession(tgid, uid, threadIds, durationNanos, _aidl_return);
+ static_cast<PowerHintSession*>(_aidl_return->get())->getSessionConfig(config);
+ return out;
+}
+
+ndk::ScopedAStatus Power::getSessionChannel(int32_t, int32_t, ChannelConfig* _aidl_return) {
+ static AidlMessageQueue<ChannelMessage, SynchronizedReadWrite> stubQueue{1, true};
+ _aidl_return->channelDescriptor = stubQueue.dupeDesc();
+ _aidl_return->readFlagBitmask = 0;
+ _aidl_return->writeFlagBitmask = 0;
+ _aidl_return->eventFlagDescriptor = std::nullopt;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Power::closeSessionChannel(int32_t, int32_t) {
+ return ndk::ScopedAStatus::ok();
+}
+
ScopedAStatus Power::getHintSessionPreferredRate(int64_t* outNanoseconds) {
*outNanoseconds = std::chrono::nanoseconds(1ms).count();
return ScopedAStatus::ok();
diff --git a/power/aidl/default/Power.h b/power/aidl/default/Power.h
index 7f8405e..baabaa7 100644
--- a/power/aidl/default/Power.h
+++ b/power/aidl/default/Power.h
@@ -17,6 +17,7 @@
#pragma once
#include <aidl/android/hardware/power/BnPower.h>
+#include "aidl/android/hardware/power/SessionTag.h"
namespace aidl {
namespace android {
@@ -35,7 +36,14 @@
const std::vector<int32_t>& threadIds,
int64_t durationNanos,
std::shared_ptr<IPowerHintSession>* _aidl_return) override;
+ ndk::ScopedAStatus createHintSessionWithConfig(
+ int32_t tgid, int32_t uid, const std::vector<int32_t>& threadIds, int64_t durationNanos,
+ SessionTag tag, SessionConfig* config,
+ std::shared_ptr<IPowerHintSession>* _aidl_return) override;
ndk::ScopedAStatus getHintSessionPreferredRate(int64_t* outNanoseconds) override;
+ ndk::ScopedAStatus getSessionChannel(int32_t tgid, int32_t uid,
+ ChannelConfig* _aidl_return) override;
+ ndk::ScopedAStatus closeSessionChannel(int32_t tgid, int32_t uid) override;
private:
std::vector<std::shared_ptr<IPowerHintSession>> mPowerHintSessions;
diff --git a/power/aidl/default/PowerHintSession.cpp b/power/aidl/default/PowerHintSession.cpp
index 452e435..847a42e 100644
--- a/power/aidl/default/PowerHintSession.cpp
+++ b/power/aidl/default/PowerHintSession.cpp
@@ -17,6 +17,7 @@
#include "PowerHintSession.h"
#include <android-base/logging.h>
+#include "android/binder_auto_utils.h"
namespace aidl::android::hardware::power::impl::example {
@@ -63,4 +64,9 @@
return ScopedAStatus::ok();
}
+ScopedAStatus PowerHintSession::getSessionConfig(SessionConfig* _aidl_return) {
+ _aidl_return->id = 1;
+ return ScopedAStatus::ok();
+}
+
} // namespace aidl::android::hardware::power::impl::example
diff --git a/power/aidl/default/PowerHintSession.h b/power/aidl/default/PowerHintSession.h
index b488bf1..2ed5588 100644
--- a/power/aidl/default/PowerHintSession.h
+++ b/power/aidl/default/PowerHintSession.h
@@ -35,6 +35,7 @@
ndk::ScopedAStatus sendHint(SessionHint hint) override;
ndk::ScopedAStatus setThreads(const std::vector<int32_t>& threadIds) override;
ndk::ScopedAStatus setMode(SessionMode mode, bool enabled) override;
+ ndk::ScopedAStatus getSessionConfig(SessionConfig* _aidl_return) override;
};
} // namespace aidl::android::hardware::power::impl::example
diff --git a/power/aidl/vts/Android.bp b/power/aidl/vts/Android.bp
index eb98b8b..c9285f4 100644
--- a/power/aidl/vts/Android.bp
+++ b/power/aidl/vts/Android.bp
@@ -31,6 +31,11 @@
srcs: ["VtsHalPowerTargetTest.cpp"],
shared_libs: [
"libbinder_ndk",
+ "libfmq",
+ ],
+ static_libs: [
+ "android.hardware.common.fmq-V1-ndk",
+ "android.hardware.common-V2-ndk",
],
test_suites: [
"general-tests",
diff --git a/power/aidl/vts/VtsHalPowerTargetTest.cpp b/power/aidl/vts/VtsHalPowerTargetTest.cpp
index eb28c8c..d8e73bf 100644
--- a/power/aidl/vts/VtsHalPowerTargetTest.cpp
+++ b/power/aidl/vts/VtsHalPowerTargetTest.cpp
@@ -24,12 +24,22 @@
#include <android/binder_process.h>
#include <android/binder_status.h>
+#include <fmq/AidlMessageQueue.h>
+#include <fmq/EventFlag.h>
+
#include <unistd.h>
+#include <cstdint>
+#include "aidl/android/hardware/common/fmq/SynchronizedReadWrite.h"
+#include "fmq/EventFlag.h"
namespace aidl::android::hardware::power {
namespace {
+using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite;
+using ::android::AidlMessageQueue;
using android::hardware::power::Boost;
+using android::hardware::power::ChannelConfig;
+using android::hardware::power::ChannelMessage;
using android::hardware::power::IPower;
using android::hardware::power::IPowerHintSession;
using android::hardware::power::Mode;
@@ -37,6 +47,8 @@
using android::hardware::power::SessionMode;
using android::hardware::power::WorkDuration;
+using SessionMessageQueue = AidlMessageQueue<ChannelMessage, SynchronizedReadWrite>;
+
const std::vector<Boost> kBoosts{ndk::enum_range<Boost>().begin(), ndk::enum_range<Boost>().end()};
const std::vector<Mode> kModes{ndk::enum_range<Mode>().begin(), ndk::enum_range<Mode>().end()};
@@ -188,6 +200,31 @@
ASSERT_GE(rate, 1000000);
}
+TEST_P(PowerAidl, createHintSessionWithConfig) {
+ if (mServiceVersion < 5) {
+ GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond.";
+ }
+ std::shared_ptr<IPowerHintSession> session;
+ SessionConfig config;
+
+ auto status = power->createHintSessionWithConfig(getpid(), getuid(), kSelfTids, 16666666L,
+ SessionTag::OTHER, &config, &session);
+ ASSERT_TRUE(status.isOk());
+ ASSERT_NE(nullptr, session);
+}
+
+TEST_P(PowerAidl, getAndCloseSessionChannel) {
+ if (mServiceVersion < 5) {
+ GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond.";
+ }
+ ChannelConfig config;
+ auto status = power->getSessionChannel(getpid(), getuid(), &config);
+ ASSERT_TRUE(status.isOk());
+ auto messageQueue = std::make_shared<SessionMessageQueue>(config.channelDescriptor, true);
+ ASSERT_TRUE(messageQueue->isValid());
+ ASSERT_TRUE(power->closeSessionChannel(getpid(), getuid()).isOk());
+}
+
TEST_P(HintSessionAidl, createAndCloseHintSession) {
ASSERT_TRUE(mSession->pause().isOk());
ASSERT_TRUE(mSession->resume().isOk());
@@ -250,6 +287,14 @@
}
}
+TEST_P(HintSessionAidl, getSessionConfig) {
+ if (mServiceVersion < 5) {
+ GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond.";
+ }
+ SessionConfig config;
+ ASSERT_TRUE(mSession->getSessionConfig(&config).isOk());
+}
+
// FIXED_PERFORMANCE mode is required for all devices which ship on Android 11
// or later
TEST_P(PowerAidl, hasFixedPerformance) {
diff --git a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
index 38cb33b..e89f4ee 100644
--- a/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
+++ b/radio/1.0/vts/functional/radio_hidl_hal_data.cpp
@@ -16,6 +16,7 @@
#include <android-base/logging.h>
#include <android/hardware/radio/1.2/IRadio.h>
+#include <gtest/gtest.h>
#include <radio_hidl_hal_utils_v1_0.h>
using namespace ::android::hardware::radio::V1_0;
@@ -72,11 +73,16 @@
CellIdentityTdscdma cit = cellIdentities.cellIdentityTdscdma[0];
hidl_mcc = cit.mcc;
hidl_mnc = cit.mnc;
- } else {
+ } else if (cellInfoType == CellInfoType::CDMA) {
// CellIndentityCdma has no mcc and mnc.
EXPECT_EQ(CellInfoType::CDMA, cellInfoType);
EXPECT_EQ(1, cellIdentities.cellIdentityCdma.size());
checkMccMnc = false;
+ } else {
+ // This test can be skipped for newer networks if a new RAT (e.g. 5g) that was not
+ // supported in this version is added to the response from a modem that supports a new
+ // version of this interface.
+ GTEST_SKIP() << "Exempt from 1.0 test: camped on a new network:" << (int)cellInfoType;
}
// Check only one CellIdentity is size 1, and others must be 0.
diff --git a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp
index 2bce2f9..51ca967 100644
--- a/radio/1.2/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.2/vts/functional/radio_hidl_hal_api.cpp
@@ -807,11 +807,16 @@
cellIdentities.cellIdentityTdscdma[0];
hidl_mcc = cit.base.mcc;
hidl_mnc = cit.base.mnc;
- } else {
+ } else if (cellInfoType == CellInfoType::CDMA) {
// CellIndentityCdma has no mcc and mnc.
EXPECT_EQ(CellInfoType::CDMA, cellInfoType);
EXPECT_EQ(1, cellIdentities.cellIdentityCdma.size());
checkMccMnc = false;
+ } else {
+ // This test can be skipped for newer networks if a new RAT (e.g. 5g) that was not
+ // supported in this version is added to the response from a modem that supports a new
+ // version of this interface.
+ GTEST_SKIP() << "Exempt from 1.2 test: camped on a new network:" << (int)cellInfoType;
}
// Check only one CellIdentity is size 1, and others must be 0.
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
index 0f5e7e4..bc1c292 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
@@ -51,4 +51,5 @@
oneway void setPreferredDataModem(in int serial, in byte modemId);
oneway void setResponseFunctions(in android.hardware.radio.config.IRadioConfigResponse radioConfigResponse, in android.hardware.radio.config.IRadioConfigIndication radioConfigIndication);
oneway void setSimSlotsMapping(in int serial, in android.hardware.radio.config.SlotPortMapping[] slotMap);
+ oneway void getSimultaneousCallingSupport(in int serial);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl
index 9189f90..f786373 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl
@@ -36,4 +36,5 @@
@VintfStability
interface IRadioConfigIndication {
oneway void simSlotsStatusChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.config.SimSlotStatus[] slotStatus);
+ oneway void onSimultaneousCallingSupportChanged(in int[] enabledLogicalSlots);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl
index 348aa34..6ff7bd0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl
@@ -42,4 +42,5 @@
oneway void setNumOfLiveModemsResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void setPreferredDataModemResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void setSimSlotsMappingResponse(in android.hardware.radio.RadioResponseInfo info);
+ oneway void getSimultaneousCallingSupportResponse(in android.hardware.radio.RadioResponseInfo info, in int[] enabledLogicalSlots);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl
index 3648866..2c66abd 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl
@@ -39,4 +39,6 @@
byte maxActiveInternetData;
boolean isInternetLingeringSupported;
byte[] logicalModemIds;
+ byte maxActiveVoice = UNKNOWN /* -1 */;
+ const byte UNKNOWN = (-1) /* -1 */;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpReceptionStats.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpReceptionStats.aidl
index 82b798b..216da4c 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpReceptionStats.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims.media/current/android/hardware/radio/ims/media/RtpReceptionStats.aidl
@@ -35,8 +35,8 @@
@VintfStability
parcelable RtpReceptionStats {
int rtpTimestamp;
- int rtpSequenceNumber;
- int timeDurationMs;
+ int rtcpSrTimestamp;
+ long rtcpSrNtpTimestamp;
int jitterBufferMs;
int roundTripTimeMs;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl
index 6dbf09d..9846006 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl
@@ -39,5 +39,5 @@
TRIGGER_PLMN_BLOCK,
TRIGGER_PLMN_BLOCK_WITH_TIMEOUT,
TRIGGER_RAT_BLOCK,
- TRIGGER_CLEAR_RAT_BLOCK,
+ TRIGGER_CLEAR_RAT_BLOCKS,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ConnectionEvent.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ConnectionEvent.aidl
index eedb8ed..1529512 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ConnectionEvent.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/ConnectionEvent.aidl
@@ -42,9 +42,13 @@
NAS_SIGNALLING_LTE = 4,
AS_SIGNALLING_LTE = 5,
VOLTE_SIP = 6,
- VOLTE_RTP = 7,
- NAS_SIGNALLING_5G = 8,
- AS_SIGNALLING_5G = 9,
- VONR_SIP = 10,
- VONR_RTP = 11,
+ VOLTE_SIP_SOS = 7,
+ VOLTE_RTP = 8,
+ VOLTE_RTP_SOS = 9,
+ NAS_SIGNALLING_5G = 10,
+ AS_SIGNALLING_5G = 11,
+ VONR_SIP = 12,
+ VONR_SIP_SOS = 13,
+ VONR_RTP = 14,
+ VONR_RTP_SOS = 15,
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl
index 56f516d..fcc079e 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/RegistrationFailCause.aidl
@@ -50,7 +50,11 @@
ROAMING_NOT_ALLOWED = 13,
GPRS_SERVICES_NOT_ALLOWED_IN_PLMN = 14,
NO_SUITABLE_CELLS = 15,
+ /**
+ * @deprecated MSC_TEMPORARILY_NOT_REACHABLE value is wrong and should not be used. Use MSC_TEMP_NOT_REACHABLE instead.
+ */
MSC_TEMPORARILY_NOT_REACHABLE = 15,
+ MSC_TEMP_NOT_REACHABLE = 16,
NETWORK_FAILURE = 17,
MAC_FAILURE = 20,
SYNC_FAILURE = 21,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithm.aidl b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithm.aidl
index 1664501..c3333bf 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithm.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.network/current/android/hardware/radio/network/SecurityAlgorithm.aidl
@@ -57,6 +57,8 @@
NEA1 = 56,
NEA2 = 57,
NEA3 = 58,
+ SIP_NO_IPSEC_CONFIG = 66,
+ IMS_NULL = 67,
SIP_NULL = 68,
AES_GCM = 69,
AES_GMAC = 70,
@@ -64,9 +66,9 @@
DES_EDE3_CBC = 72,
AES_EDE3_CBC = 73,
HMAC_SHA1_96 = 74,
- HMAC_SHA1_96_null = 75,
- HMAC_MD5_96 = 76,
- HMAC_MD5_96_null = 77,
+ HMAC_MD5_96 = 75,
+ RTP = 85,
+ SRTP_NULL = 86,
SRTP_AES_COUNTER = 87,
SRTP_AES_F8 = 88,
SRTP_HMAC_SHA1 = 89,
diff --git a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierInfo.aidl b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierInfo.aidl
index 5838959..7d4a54b 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierInfo.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.sim/current/android/hardware/radio/sim/CarrierInfo.aidl
@@ -41,7 +41,7 @@
@nullable String gid1;
@nullable String gid2;
@nullable String imsiPrefix;
- @nullable List<android.hardware.radio.sim.Plmn> ephlmn;
+ @nullable List<android.hardware.radio.sim.Plmn> ehplmn;
@nullable String iccid;
@nullable String impi;
}
diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
index 9058d9d..8f4dff4 100644
--- a/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
+++ b/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
@@ -191,4 +191,20 @@
* This is available when android.hardware.telephony.subscription is defined.
*/
void setSimSlotsMapping(in int serial, in SlotPortMapping[] slotMap);
+
+ /**
+ * Get the set of logical slots where simultaneous cellular calling is currently possible. This
+ * does not include simultaneous calling availability over other non-cellular transports, such
+ * as IWLAN.
+ *
+ * Get the set of slots that currently support simultaneous cellular calling. When a new
+ * cellular call is placed/received, if another slot is active and handing a call, both the
+ * active slot and proposed slot must be in this list in order to support simultaneous cellular
+ * calling for both of those slots.
+ *
+ * @param serial Serial number of request
+ *
+ * This is available when android.hardware.telephony is defined.
+ */
+ void getSimultaneousCallingSupport(in int serial);
}
diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl
index ed2366b..9eacb8e 100644
--- a/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl
+++ b/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl
@@ -37,4 +37,15 @@
*/
void simSlotsStatusChanged(
in android.hardware.radio.RadioIndicationType type, in SimSlotStatus[] slotStatus);
+
+ /**
+ * The logical slots supporting simultaneous cellular calling has changed.
+ *
+ * @param enabledLogicalSlots The slots that have simultaneous cellular calling enabled. If
+ * there is a call active on logical slot X, then a simultaneous cellular call is only possible
+ * on logical slot Y if BOTH slot X and slot Y are in enabledLogicalSlots. If simultaneous
+ * cellular calling is not currently supported, the expected value of enabledLogicalSLots is an
+ * empty int array. Sending only one radio slot is not acceptable in any case.
+ */
+ void onSimultaneousCallingSupportChanged(in int[] enabledLogicalSlots);
}
diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl
index df93e3c..33b0ff0 100644
--- a/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl
+++ b/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl
@@ -129,4 +129,27 @@
* RadioError:INVALID_ARGUMENTS
*/
void setSimSlotsMappingResponse(in android.hardware.radio.RadioResponseInfo info);
+
+ /**
+ * Response to the asynchronous
+ * {@link IRadioConfig#getSimultaneousCallingSupport} request.
+ *
+ * @param info Response info struct containing response type, serial no. and error
+ * @param enabledLogicalSlots The slots that have simultaneous cellular calling enabled. If
+ * there is a call active on logical slot X, then a simultaneous cellular call is only possible
+ * on logical slot Y if BOTH slot X and slot Y are in enabledLogicalSlots. If simultaneous
+ * cellular calling is not currently supported, the expected value of enabledLogicalSLots is an
+ * empty int array. Sending only one radio slot is not acceptable in any case.
+ *
+ * Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:MODEM_ERR
+ *
+ * @see IRadioConfig#getSimultaneousCallingSupport for more information.
+ */
+ void getSimultaneousCallingSupportResponse(
+ in android.hardware.radio.RadioResponseInfo info, in int[] enabledLogicalSlots);
}
diff --git a/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl b/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl
index 35d6b5d..7936eb6 100644
--- a/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl
+++ b/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl
@@ -25,6 +25,7 @@
@VintfStability
@JavaDerive(toString=true)
parcelable PhoneCapability {
+ const byte UNKNOWN = -1;
/**
* maxActiveData defines how many logical modems can have
* PS attached simultaneously. For example, for L+L modem it
@@ -47,4 +48,10 @@
* List of logical modem IDs.
*/
byte[] logicalModemIds;
+ /**
+ * maxActiveVoice defines how many logical modems can have
+ * cellular voice calls simultaneously. For example, for cellular DSDA
+ * with simultaneous calling support, it should be 2.
+ */
+ byte maxActiveVoice = UNKNOWN;
}
diff --git a/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl b/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl
index f0e28fc..73c57fa 100644
--- a/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl
+++ b/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl
@@ -37,9 +37,10 @@
TRIGGER_PLMN_BLOCK_WITH_TIMEOUT,
/**
* Indicates that the IMS registration on current RAT failed multiple times.
- * The radio shall block the current RAT and search for other available RATs in the
- * background. If no other RAT is available that meets the carrier requirements, the
- * radio may remain on the current RAT for internet service. The radio clears all
+ * The radio shall block the {@link AccessNetwork} included with this and
+ * search for other available RATs in the background.
+ * If no other RAT is available that meets the carrier requirements, the
+ * radio may remain on the blocked RAT for internet service. The radio clears all
* RATs marked as unavailable if {@link IRadioIms#updateImsRegistrationInfo()} API
* with REGISTERED state is invoked.
*/
@@ -48,5 +49,5 @@
* Indicates that the radio clears all RATs marked as unavailable and tries to find
* an available RAT that meets the carrier requirements.
*/
- TRIGGER_CLEAR_RAT_BLOCK,
+ TRIGGER_CLEAR_RAT_BLOCKS,
}
diff --git a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl
index 0fe6740..69ca780 100644
--- a/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/IImsMediaSession.aidl
@@ -110,8 +110,7 @@
* Adjust the delay in the jitter buffer to synchronize the audio with the time of video
* frames
*
- * @param delayMs The delay to apply to the jitter buffer. If it is positive, the jitter
- * buffer increases the delay, if it is negative, the jitter buffer decreases the delay.
+ * @param delayMs The additional delay to the jitter buffer in milliseconds.
*
* This is available when android.hardware.telephony.ims is defined.
*/
diff --git a/radio/aidl/android/hardware/radio/ims/media/RtpReceptionStats.aidl b/radio/aidl/android/hardware/radio/ims/media/RtpReceptionStats.aidl
index 1239d13..81c0bb2 100644
--- a/radio/aidl/android/hardware/radio/ims/media/RtpReceptionStats.aidl
+++ b/radio/aidl/android/hardware/radio/ims/media/RtpReceptionStats.aidl
@@ -20,12 +20,19 @@
parcelable RtpReceptionStats {
/** The timestamp of the latest RTP packet received */
int rtpTimestamp;
- /** The sequence number of latest RTP packet received */
- int rtpSequenceNumber;
- /** The system clock time in millisecond of latest RTP packet received */
- int timeDurationMs;
- /** The jitter buffer size in millisecond when latest RTP packet received */
+
+ /** The timestamp of the latest RTCP-SR packet received */
+ int rtcpSrTimestamp;
+
+ /** The NTP timestamp of latest RTCP-SR packet received */
+ long rtcpSrNtpTimestamp;
+
+ /**
+ * The mean jitter buffer delay of a media stream from received to playback, measured in
+ * milliseconds, within the reporting interval
+ */
int jitterBufferMs;
+
/** The round trip time delay in millisecond when latest RTP packet received */
int roundTripTimeMs;
}
diff --git a/radio/aidl/android/hardware/radio/network/ConnectionEvent.aidl b/radio/aidl/android/hardware/radio/network/ConnectionEvent.aidl
index 2e39ebf..d5f367f 100644
--- a/radio/aidl/android/hardware/radio/network/ConnectionEvent.aidl
+++ b/radio/aidl/android/hardware/radio/network/ConnectionEvent.aidl
@@ -42,14 +42,20 @@
AS_SIGNALLING_LTE = 5,
// VoLTE
+ // Note: emergency calls could use either normal or SOS (emergency) PDN in practice
VOLTE_SIP = 6,
- VOLTE_RTP = 7,
+ VOLTE_SIP_SOS = 7,
+ VOLTE_RTP = 8,
+ VOLTE_RTP_SOS = 9,
// 5G packet services
- NAS_SIGNALLING_5G = 8,
- AS_SIGNALLING_5G = 9,
+ NAS_SIGNALLING_5G = 10,
+ AS_SIGNALLING_5G = 11,
// VoNR
- VONR_SIP = 10,
- VONR_RTP = 11,
+ // Note: emergency calls could use either normal or SOS (emergency) PDN in practice
+ VONR_SIP = 12,
+ VONR_SIP_SOS = 13,
+ VONR_RTP = 14,
+ VONR_RTP_SOS = 15
}
diff --git a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
index 9c2502d..da82b78 100644
--- a/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
+++ b/radio/aidl/android/hardware/radio/network/IRadioNetworkIndication.aidl
@@ -231,16 +231,24 @@
/*
* Indicates that a new ciphering or integrity algorithm was used for a particular voice,
- * signaling, or data connection attempt for a given PLMN and/or access network. Due to
- * power concerns, once a connection type has been reported on, follow-up reports about that
- * connection type are only generated if there is any change to the previously reported
- * encryption or integrity. Thus the AP is only to be notified when there is new information.
- * List is reset upon rebooting thus info about initial connections is always passed to the
- * AP after a reboot. List is also reset if the SIM is changed or if there has been a change
- * in the access network.
+ * signaling, or data connection for a given PLMN and/or access network. Due to power
+ * concerns, once a connection type has been reported on, follow-up reports about that
+ * connection type are only generated if there is any change to the most-recently reported
+ * encryption or integrity, or if the value of SecurityAlgorithmUpdate#isUnprotectedEmergency
+ * changes. A change only in cell ID should not trigger an update, as the design is intended
+ * to be agnostic to dual connectivity ("secondary serving cells").
*
- * Note: a change only in cell ID should not trigger an update, as the design is intended to
- * be agnostic to dual connectivity ("secondary serving cells").
+ * Sample scenario to further clarify "most-recently reported":
+ *
+ * 1. Modem reports user is connected to a null-ciphered 3G network.
+ * 2. User then moves and connects to a well-ciphered 5G network, and modem reports this.
+ * 3. User returns to original location and reconnects to the null-ciphered 3G network. Modem
+ * should report this as it's different than the most-recently reported data from step (2).
+ *
+ * State is reset when (1) RadioState is transitioned to ON from any other state (e.g. radio
+ * is turned on during device boot, or modem boot), and (2) when CardState is transitioned
+ * to PRESENT from any other state (e.g. when SIM is inserted), or (3) if there is a change in
+ * access network (PLMN).
*
* @param type Type of radio indication
* @param securityAlgorithmUpdate SecurityAlgorithmUpdate encapsulates details of security
diff --git a/radio/aidl/android/hardware/radio/network/RegistrationFailCause.aidl b/radio/aidl/android/hardware/radio/network/RegistrationFailCause.aidl
index 2955f96..11fd8c5 100644
--- a/radio/aidl/android/hardware/radio/network/RegistrationFailCause.aidl
+++ b/radio/aidl/android/hardware/radio/network/RegistrationFailCause.aidl
@@ -86,10 +86,15 @@
*/
NO_SUITABLE_CELLS = 15,
/**
- * 16 - MSC temporarily not reachable
+ * @deprecated MSC_TEMPORARILY_NOT_REACHABLE value is wrong and should not be used.
+ * Use MSC_TEMP_NOT_REACHABLE instead.
*/
MSC_TEMPORARILY_NOT_REACHABLE = 15,
/**
+ * 16 - MSC temporarily not reachable
+ */
+ MSC_TEMP_NOT_REACHABLE = 16,
+ /**
* 17 - Network Failure
*/
NETWORK_FAILURE = 17,
diff --git a/radio/aidl/android/hardware/radio/network/SecurityAlgorithm.aidl b/radio/aidl/android/hardware/radio/network/SecurityAlgorithm.aidl
index 71c654c..01f7327 100644
--- a/radio/aidl/android/hardware/radio/network/SecurityAlgorithm.aidl
+++ b/radio/aidl/android/hardware/radio/network/SecurityAlgorithm.aidl
@@ -59,7 +59,12 @@
NEA2 = 57,
NEA3 = 58,
- // SIP layer security (See 3GPP TS 33.203)
+ // IMS and SIP layer security (See 3GPP TS 33.203)
+ // No IPsec config
+ SIP_NO_IPSEC_CONFIG = 66,
+ IMS_NULL = 67,
+
+ // Has IPsec config
SIP_NULL = 68,
AES_GCM = 69,
AES_GMAC = 70,
@@ -67,16 +72,18 @@
DES_EDE3_CBC = 72,
AES_EDE3_CBC = 73,
HMAC_SHA1_96 = 74,
- HMAC_SHA1_96_null = 75,
- HMAC_MD5_96 = 76,
- HMAC_MD5_96_null = 77,
+ HMAC_MD5_96 = 75,
- // RTP (see 3GPP TS 33.328)
+ // RTP and SRTP (see 3GPP TS 33.328)
+ // When SRTP is not being used
+ RTP = 85,
+ // When SRTP is available and used
+ SRTP_NULL = 86,
SRTP_AES_COUNTER = 87,
SRTP_AES_F8 = 88,
SRTP_HMAC_SHA1 = 89,
- // ePDG (3GPP TS 33.402)
+ // ePDG (3GPP TS 33.402) (reserved for future use)
ENCR_AES_GCM_16 = 99,
ENCR_AES_CBC = 100,
AUTH_HMAC_SHA2_256_128 = 101,
diff --git a/radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl b/radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl
index a890497..74fe31b 100644
--- a/radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl
+++ b/radio/aidl/android/hardware/radio/sim/CarrierInfo.aidl
@@ -56,7 +56,7 @@
* Equivalent HPLMN of the SIM card of the Carrier.
*/
@nullable
- List<Plmn> ephlmn;
+ List<Plmn> ehplmn;
/**
* ICCID (Integrated Circuit Card Identification) of the SIM card.
*/
diff --git a/radio/aidl/compat/libradiocompat/CallbackManager.cpp b/radio/aidl/compat/libradiocompat/CallbackManager.cpp
index c2eaed1..96aaebc 100644
--- a/radio/aidl/compat/libradiocompat/CallbackManager.cpp
+++ b/radio/aidl/compat/libradiocompat/CallbackManager.cpp
@@ -53,6 +53,10 @@
return *mRadioResponse;
}
+RadioIndication& CallbackManager::indication() const {
+ return *mRadioIndication;
+}
+
void CallbackManager::setResponseFunctionsDelayed() {
std::unique_lock<std::mutex> lock(mDelayedSetterGuard);
mDelayedSetterDeadline = std::chrono::steady_clock::now() + kDelayedSetterDelay;
diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp b/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp
index b450418..837c626 100644
--- a/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp
+++ b/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp
@@ -62,6 +62,13 @@
return ok();
}
+ScopedAStatus RadioConfig::getSimultaneousCallingSupport(int32_t serial) {
+ LOG_CALL << serial;
+ LOG(ERROR) << " getSimultaneousCallingSupport is unsupported by HIDL HALs";
+ respond()->getSimultaneousCallingSupportResponse(notSupported(serial), {});
+ return ok();
+}
+
ScopedAStatus RadioConfig::getSimSlotsStatus(int32_t serial) {
LOG_CALL << serial;
mHal1_1->getSimSlotsStatus(serial);
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/CallbackManager.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/CallbackManager.h
index f1a7b49..34ab5d7 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/CallbackManager.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/CallbackManager.h
@@ -46,6 +46,7 @@
~CallbackManager();
RadioResponse& response() const;
+ RadioIndication& indication() const;
template <typename ResponseType, typename IndicationType>
void setResponseFunctions(const std::shared_ptr<ResponseType>& response,
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h
index 89ddea0..17d5985 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h
@@ -42,6 +42,7 @@
::ndk::ScopedAStatus getHalDeviceCapabilities(int32_t serial) override;
::ndk::ScopedAStatus getNumOfLiveModems(int32_t serial) override;
::ndk::ScopedAStatus getPhoneCapability(int32_t serial) override;
+ ::ndk::ScopedAStatus getSimultaneousCallingSupport(int32_t serial) override;
::ndk::ScopedAStatus getSimSlotsStatus(int32_t serial) override;
::ndk::ScopedAStatus setNumOfLiveModems(int32_t serial, int8_t numOfLiveModems) override;
::ndk::ScopedAStatus setPreferredDataModem(int32_t serial, int8_t modemId) override;
diff --git a/radio/aidl/vts/radio_config_indication.cpp b/radio/aidl/vts/radio_config_indication.cpp
index a84c20b..c707663 100644
--- a/radio/aidl/vts/radio_config_indication.cpp
+++ b/radio/aidl/vts/radio_config_indication.cpp
@@ -22,3 +22,8 @@
RadioIndicationType /*type*/, const std::vector<SimSlotStatus>& /*slotStatus*/) {
return ndk::ScopedAStatus::ok();
}
+
+ndk::ScopedAStatus RadioConfigIndication::onSimultaneousCallingSupportChanged(
+ const std::vector<int32_t>& /*enabledLogicalSlots*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_config_response.cpp b/radio/aidl/vts/radio_config_response.cpp
index 7384f87..c532440 100644
--- a/radio/aidl/vts/radio_config_response.cpp
+++ b/radio/aidl/vts/radio_config_response.cpp
@@ -40,6 +40,14 @@
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus RadioConfigResponse::getSimultaneousCallingSupportResponse(
+ const RadioResponseInfo& info, const std::vector<int32_t>& enabledLogicalSlots) {
+ rspInfo = info;
+ currentEnabledLogicalSlots = enabledLogicalSlots;
+ parent_config.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
ndk::ScopedAStatus RadioConfigResponse::setPreferredDataModemResponse(
const RadioResponseInfo& info) {
rspInfo = info;
diff --git a/radio/aidl/vts/radio_config_test.cpp b/radio/aidl/vts/radio_config_test.cpp
index d8c0142..6f18d18 100644
--- a/radio/aidl/vts/radio_config_test.cpp
+++ b/radio/aidl/vts/radio_config_test.cpp
@@ -122,6 +122,48 @@
}
/*
+ * Test IRadioConfig.getSimultaneousCallingSupport() for the response returned.
+ */
+TEST_P(RadioConfigTest, getSimultaneousCallingSupport) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping getSimultaneousCallingSupport "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
+ int32_t aidl_version;
+ ndk::ScopedAStatus aidl_status = radio_config->getInterfaceVersion(&aidl_version);
+ ASSERT_OK(aidl_status);
+ if (aidl_version < 3) {
+ ALOGI("Skipped the test since"
+ " getSimultaneousCallingSupport is not supported on version < 3.");
+ GTEST_SKIP();
+ }
+
+ serial = GetRandomSerialNumber();
+ ndk::ScopedAStatus res = radio_config->getSimultaneousCallingSupport(serial);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_config->rspInfo.serial);
+ ALOGI("getSimultaneousCallingSupport, rspInfo.error = %s\n",
+ toString(radioRsp_config->rspInfo.error).c_str());
+
+ // REQUEST_NOT_SUPPORTED is omitted here because users of the V3 HAL should implement this
+ // method and return at least an empty array
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_config->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR,
+ RadioError::MODEM_ERR}));
+
+ if (radioRsp_config->rspInfo.error == RadioError ::NONE) {
+ // The size of enabledLogicalSLots should be 0 or a positive number:
+ EXPECT_GE(radioRsp_config->currentEnabledLogicalSlots.size(), 0);
+ }
+}
+
+/*
* Test IRadioConfig.setPreferredDataModem() for the response returned.
*/
TEST_P(RadioConfigTest, setPreferredDataModem) {
diff --git a/radio/aidl/vts/radio_config_utils.h b/radio/aidl/vts/radio_config_utils.h
index f79aedb..84c74fc 100644
--- a/radio/aidl/vts/radio_config_utils.h
+++ b/radio/aidl/vts/radio_config_utils.h
@@ -39,6 +39,7 @@
PhoneCapability phoneCap;
bool modemReducedFeatureSet1;
std::vector<SimSlotStatus> simSlotStatus;
+ std::vector<int32_t> currentEnabledLogicalSlots;
virtual ndk::ScopedAStatus getSimSlotsStatusResponse(
const RadioResponseInfo& info, const std::vector<SimSlotStatus>& slotStatus) override;
@@ -48,6 +49,9 @@
virtual ndk::ScopedAStatus getPhoneCapabilityResponse(
const RadioResponseInfo& info, const PhoneCapability& phoneCapability) override;
+ virtual ndk::ScopedAStatus getSimultaneousCallingSupportResponse(
+ const RadioResponseInfo& info, const std::vector<int32_t>& enabledLogicalSlots) override;
+
virtual ndk::ScopedAStatus setPreferredDataModemResponse(
const RadioResponseInfo& info) override;
@@ -71,6 +75,9 @@
virtual ndk::ScopedAStatus simSlotsStatusChanged(
RadioIndicationType type, const std::vector<SimSlotStatus>& slotStatus) override;
+
+ virtual ndk::ScopedAStatus onSimultaneousCallingSupportChanged(
+ const std::vector<int32_t>& /*enabledLogicalSlots*/) override;
};
// The main test class for Radio AIDL Config.
diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp
index 867be04..5cb0158 100644
--- a/radio/aidl/vts/radio_network_test.cpp
+++ b/radio/aidl/vts/radio_network_test.cpp
@@ -237,8 +237,10 @@
{RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_STATE,
RadioError::SIM_ABSENT, RadioError::INTERNAL_ERR, RadioError::NONE});
- ASSERT_TRUE(radioRsp_network->usageSetting == UsageSetting::VOICE_CENTRIC ||
- radioRsp_network->usageSetting == UsageSetting::DATA_CENTRIC);
+ if (radioRsp_network->rspInfo.error == RadioError::NONE) {
+ ASSERT_TRUE(radioRsp_network->usageSetting == UsageSetting::VOICE_CENTRIC ||
+ radioRsp_network->usageSetting == UsageSetting::DATA_CENTRIC);
+ }
}
void RadioNetworkTest::testSetUsageSetting_InvalidValues(std::vector<RadioError> errors) {
@@ -2375,16 +2377,9 @@
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
- if (aidl_version >= 3 && deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
- ASSERT_TRUE(CheckAnyOfErrors(
- radioRsp_network->rspInfo.error,
- {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR}));
- } else {
- // For aidl_version 2, API is optional
- ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
- {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
- RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED}));
- }
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED}));
}
/**
@@ -2416,16 +2411,9 @@
EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
- if (aidl_version >= 3 && deviceSupportsFeature(FEATURE_TELEPHONY_RADIO_ACCESS)) {
- ASSERT_TRUE(CheckAnyOfErrors(
- radioRsp_network->rspInfo.error,
- {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::MODEM_ERR}));
- } else {
- // For aidl_version 2, API is optional
- ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
- {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
- RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED}));
- }
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE,
+ RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED}));
}
TEST_P(RadioNetworkTest, isCellularIdentifierTransparencyEnabled) {
diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h
index 470ee73..ad530eb 100644
--- a/radio/aidl/vts/radio_network_utils.h
+++ b/radio/aidl/vts/radio_network_utils.h
@@ -38,16 +38,16 @@
RadioResponseInfo rspInfo;
std::vector<RadioBandMode> radioBandModes;
std::vector<OperatorInfo> networkInfos;
- bool isNrDualConnectivityEnabled;
- int networkTypeBitmapResponse;
+ bool isNrDualConnectivityEnabled = false;
+ int networkTypeBitmapResponse = 0;
RegStateResult voiceRegResp;
RegStateResult dataRegResp;
CellIdentity barringCellIdentity;
std::vector<BarringInfo> barringInfoList;
UsageSetting usageSetting;
std::vector<RadioAccessSpecifier> specifiers;
- bool isCellularIdentifierTransparencyEnabled;
- bool isSecurityAlgorithmsUpdatedEnabled;
+ bool isCellularIdentifierTransparencyEnabled = false;
+ bool isSecurityAlgorithmsUpdatedEnabled = false;
virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override;
diff --git a/secure_element/1.0/vts/functional/VtsHalSecureElementV1_0TargetTest.cpp b/secure_element/1.0/vts/functional/VtsHalSecureElementV1_0TargetTest.cpp
index 63c2eca..1623960 100644
--- a/secure_element/1.0/vts/functional/VtsHalSecureElementV1_0TargetTest.cpp
+++ b/secure_element/1.0/vts/functional/VtsHalSecureElementV1_0TargetTest.cpp
@@ -75,6 +75,7 @@
se_->init(se_cb_);
auto res = se_cb_->WaitForCallback(kCallbackNameOnStateChange);
EXPECT_TRUE(res.no_timeout);
+ ASSERT_TRUE(res.args);
EXPECT_TRUE(res.args->state_);
}
diff --git a/secure_element/1.1/vts/functional/VtsHalSecureElementV1_1TargetTest.cpp b/secure_element/1.1/vts/functional/VtsHalSecureElementV1_1TargetTest.cpp
index 234c33c..d7e4546 100644
--- a/secure_element/1.1/vts/functional/VtsHalSecureElementV1_1TargetTest.cpp
+++ b/secure_element/1.1/vts/functional/VtsHalSecureElementV1_1TargetTest.cpp
@@ -72,6 +72,7 @@
se_->init_1_1(se_cb_);
auto res = se_cb_->WaitForCallback(kCallbackNameOnStateChange);
EXPECT_TRUE(res.no_timeout);
+ ASSERT_TRUE(res.args);
EXPECT_TRUE(res.args->state_);
EXPECT_NE(res.args->reason_, "");
}
diff --git a/secure_element/1.2/vts/functional/VtsHalSecureElementV1_2TargetTest.cpp b/secure_element/1.2/vts/functional/VtsHalSecureElementV1_2TargetTest.cpp
index 66d581e..26b2ded 100644
--- a/secure_element/1.2/vts/functional/VtsHalSecureElementV1_2TargetTest.cpp
+++ b/secure_element/1.2/vts/functional/VtsHalSecureElementV1_2TargetTest.cpp
@@ -73,6 +73,7 @@
se_->init_1_1(se_cb_);
auto res = se_cb_->WaitForCallback(kCallbackNameOnStateChange);
EXPECT_TRUE(res.no_timeout);
+ ASSERT_TRUE(res.args);
EXPECT_TRUE(res.args->state_);
EXPECT_NE(res.args->reason_, "");
}
@@ -93,10 +94,12 @@
auto res = se_cb_->WaitForCallback(kCallbackNameOnStateChange);
EXPECT_TRUE(res.no_timeout);
+ ASSERT_TRUE(res.args);
EXPECT_FALSE(res.args->state_);
res = se_cb_->WaitForCallback(kCallbackNameOnStateChange);
EXPECT_TRUE(res.no_timeout);
+ ASSERT_TRUE(res.args);
EXPECT_TRUE(res.args->state_);
}
diff --git a/security/rkp/aidl/Android.bp b/security/rkp/aidl/Android.bp
index e9e2021..adc63f6 100644
--- a/security/rkp/aidl/Android.bp
+++ b/security/rkp/aidl/Android.bp
@@ -25,6 +25,9 @@
"//apex_available:platform",
"com.android.rkpd",
],
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
},
rust: {
enabled: true,
diff --git a/security/rkp/aidl/lint-baseline.xml b/security/rkp/aidl/lint-baseline.xml
index d25d383..8e98094 100644
--- a/security/rkp/aidl/lint-baseline.xml
+++ b/security/rkp/aidl/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.0.0-dev" type="baseline" dependencies="true" variant="all" version="8.0.0-dev">
+<issues format="6" by="lint 8.4.0-alpha01" type="baseline" client="" dependencies="true" name="" variant="all" version="8.4.0-alpha01">
<issue
id="NewApi"
@@ -7,8 +7,8 @@
errorLine1=" this.markVintfStability();"
errorLine2=" ~~~~~~~~~~~~~~~~~~">
<location
- file="out/.intermediates/hardware/interfaces/security/rkp/aidl/android.hardware.security.rkp-V1-java-source/gen/android/hardware/security/keymint/IRemotelyProvisionedComponent.java"
- line="50"
+ file="out/soong/.intermediates/hardware/interfaces/security/rkp/aidl/android.hardware.security.rkp-V1-java-source/gen/android/hardware/security/keymint/IRemotelyProvisionedComponent.java"
+ line="52"
column="12"/>
</issue>
@@ -18,8 +18,8 @@
errorLine1=" this.markVintfStability();"
errorLine2=" ~~~~~~~~~~~~~~~~~~">
<location
- file="out/.intermediates/hardware/interfaces/security/rkp/aidl/android.hardware.security.rkp-V2-java-source/gen/android/hardware/security/keymint/IRemotelyProvisionedComponent.java"
- line="50"
+ file="out/soong/.intermediates/hardware/interfaces/security/rkp/aidl/android.hardware.security.rkp-V2-java-source/gen/android/hardware/security/keymint/IRemotelyProvisionedComponent.java"
+ line="52"
column="12"/>
</issue>
@@ -29,8 +29,19 @@
errorLine1=" this.markVintfStability();"
errorLine2=" ~~~~~~~~~~~~~~~~~~">
<location
- file="out/.intermediates/hardware/interfaces/security/rkp/aidl/android.hardware.security.rkp-V3-java-source/gen/android/hardware/security/keymint/IRemotelyProvisionedComponent.java"
- line="495"
+ file="out/soong/.intermediates/hardware/interfaces/security/rkp/aidl/android.hardware.security.rkp-V3-java-source/gen/android/hardware/security/keymint/IRemotelyProvisionedComponent.java"
+ line="56"
+ column="12"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 34 (current min is 33): `android.os.Binder#markVintfStability`"
+ errorLine1=" this.markVintfStability();"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~">
+ <location
+ file="out/soong/.intermediates/hardware/interfaces/security/rkp/aidl/android.hardware.security.rkp-V4-java-source/gen/android/hardware/security/keymint/IRemotelyProvisionedComponent.java"
+ line="257"
column="12"/>
</issue>
diff --git a/tetheroffload/aidl/Android.bp b/tetheroffload/aidl/Android.bp
index 6de27c3..e091c5b 100644
--- a/tetheroffload/aidl/Android.bp
+++ b/tetheroffload/aidl/Android.bp
@@ -18,6 +18,9 @@
],
min_sdk_version: "30",
enabled: true,
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
},
ndk: {
apps_enabled: false,
diff --git a/tetheroffload/aidl/lint-baseline.xml b/tetheroffload/aidl/lint-baseline.xml
new file mode 100644
index 0000000..62924b1
--- /dev/null
+++ b/tetheroffload/aidl/lint-baseline.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<issues format="6" by="lint 8.4.0-alpha01" type="baseline" client="" dependencies="true" name="" variant="all" version="8.4.0-alpha01">
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 31 (current min is 30): `android.os.Binder#markVintfStability`"
+ errorLine1=" this.markVintfStability();"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~">
+ <location
+ file="out/soong/.intermediates/hardware/interfaces/tetheroffload/aidl/android.hardware.tetheroffload-V1-java-source/gen/android/hardware/tetheroffload/IOffload.java"
+ line="64"
+ column="12"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 31 (current min is 30): `android.os.Binder#markVintfStability`"
+ errorLine1=" this.markVintfStability();"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~">
+ <location
+ file="out/soong/.intermediates/hardware/interfaces/tetheroffload/aidl/android.hardware.tetheroffload-V1-java-source/gen/android/hardware/tetheroffload/ITetheringOffloadCallback.java"
+ line="45"
+ column="12"/>
+ </issue>
+
+</issues>
\ No newline at end of file
diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/CoolingDevice.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/CoolingDevice.aidl
index dff3c4c..7e1aed7 100644
--- a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/CoolingDevice.aidl
+++ b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/CoolingDevice.aidl
@@ -38,4 +38,7 @@
android.hardware.thermal.CoolingType type;
String name;
long value;
+ long powerLimitMw;
+ long powerMw;
+ long timeWindowMs;
}
diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/ICoolingDeviceChangedCallback.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/ICoolingDeviceChangedCallback.aidl
new file mode 100644
index 0000000..ea75b1c
--- /dev/null
+++ b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/ICoolingDeviceChangedCallback.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2023 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.thermal;
+/* @hide */
+@VintfStability
+interface ICoolingDeviceChangedCallback {
+ oneway void notifyCoolingDeviceChanged(in android.hardware.thermal.CoolingDevice coolingDevice);
+}
diff --git a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/IThermal.aidl b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/IThermal.aidl
index c9b6cab..904496c 100644
--- a/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/IThermal.aidl
+++ b/thermal/aidl/aidl_api/android.hardware.thermal/current/android/hardware/thermal/IThermal.aidl
@@ -44,4 +44,6 @@
void registerThermalChangedCallback(in android.hardware.thermal.IThermalChangedCallback callback);
void registerThermalChangedCallbackWithType(in android.hardware.thermal.IThermalChangedCallback callback, in android.hardware.thermal.TemperatureType type);
void unregisterThermalChangedCallback(in android.hardware.thermal.IThermalChangedCallback callback);
+ void registerCoolingDeviceChangedCallbackWithType(in android.hardware.thermal.ICoolingDeviceChangedCallback callback, in android.hardware.thermal.CoolingType type);
+ void unregisterCoolingDeviceChangedCallback(in android.hardware.thermal.ICoolingDeviceChangedCallback callback);
}
diff --git a/thermal/aidl/android/hardware/thermal/CoolingDevice.aidl b/thermal/aidl/android/hardware/thermal/CoolingDevice.aidl
index 0c5c17d..406733b 100644
--- a/thermal/aidl/android/hardware/thermal/CoolingDevice.aidl
+++ b/thermal/aidl/android/hardware/thermal/CoolingDevice.aidl
@@ -40,4 +40,16 @@
* means deeper throttling.
*/
long value;
+ /**
+ * Power budget (mW) of the cooling device.
+ */
+ long powerLimitMw;
+ /**
+ * Target cooling device's AVG power for the last time_window_ms.
+ */
+ long powerMw;
+ /**
+ * The time window (millisecond) to calculate the power consumption
+ */
+ long timeWindowMs;
}
diff --git a/thermal/aidl/android/hardware/thermal/ICoolingDeviceChangedCallback.aidl b/thermal/aidl/android/hardware/thermal/ICoolingDeviceChangedCallback.aidl
new file mode 100644
index 0000000..e6bb9fe
--- /dev/null
+++ b/thermal/aidl/android/hardware/thermal/ICoolingDeviceChangedCallback.aidl
@@ -0,0 +1,36 @@
+/*
+ * Copyright (C) 2023 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.thermal;
+
+import android.hardware.thermal.CoolingDevice;
+import android.hardware.thermal.Temperature;
+
+/**
+ * ICoolingDeviceChangedCallback send cooling device change notification to clients.
+ * @hide
+ */
+@VintfStability
+interface ICoolingDeviceChangedCallback {
+ /**
+ * Send a cooling device change event to all ThermalHAL
+ * cooling device event listeners.
+ *
+ * @param cooling_device The cooling device information associated with the
+ * change event.
+ */
+ oneway void notifyCoolingDeviceChanged(in CoolingDevice coolingDevice);
+}
diff --git a/thermal/aidl/android/hardware/thermal/IThermal.aidl b/thermal/aidl/android/hardware/thermal/IThermal.aidl
index c94edcd..4aa4090 100644
--- a/thermal/aidl/android/hardware/thermal/IThermal.aidl
+++ b/thermal/aidl/android/hardware/thermal/IThermal.aidl
@@ -18,6 +18,7 @@
import android.hardware.thermal.CoolingDevice;
import android.hardware.thermal.CoolingType;
+import android.hardware.thermal.ICoolingDeviceChangedCallback;
import android.hardware.thermal.IThermalChangedCallback;
import android.hardware.thermal.Temperature;
import android.hardware.thermal.TemperatureThreshold;
@@ -188,4 +189,40 @@
* getMessage() must be populated with human-readable error message.
*/
void unregisterThermalChangedCallback(in IThermalChangedCallback callback);
+
+ /**
+ * Register an ICoolingDeviceChangedCallback for a given CoolingType, used by
+ * the Thermal HAL to receive CDEV events when cooling device status
+ * changed.
+ * Multiple registrations with different ICoolingDeviceChangedCallback must be allowed.
+ * Multiple registrations with same ICoolingDeviceChangedCallback is not allowed, client
+ * should unregister the given ICoolingDeviceChangedCallback first.
+ *
+ * @param callback the ICoolingChangedCallback to use for receiving
+ * cooling device events. If nullptr callback is given, the status code will be
+ * STATUS_BAD_VALUE and the operation will fail.
+ * @param type the type to be filtered.
+ *
+ * @throws EX_ILLEGAL_ARGUMENT If the callback is given nullptr or already registered. And the
+ * getMessage() must be populated with human-readable error message.
+ * @throws EX_ILLEGAL_STATE If the Thermal HAL is not initialized successfully. And the
+ * getMessage() must be populated with human-readable error message.
+ */
+ void registerCoolingDeviceChangedCallbackWithType(
+ in ICoolingDeviceChangedCallback callback, in CoolingType type);
+
+ /**
+ * Unregister an ICoolingDeviceChangedCallback, used by the Thermal HAL
+ * to receive CDEV events when cooling device status changed.
+ *
+ * @param callback the ICoolingDeviceChangedCallback to use for receiving
+ * cooling device events. if nullptr callback is given, the status code will be
+ * STATUS_BAD_VALUE and the operation will fail.
+ *
+ * @throws EX_ILLEGAL_ARGUMENT If the callback is given nullptr or not previously registered.
+ * And the getMessage() must be populated with human-readable error message.
+ * @throws EX_ILLEGAL_STATE If the Thermal HAL is not initialized successfully. And the
+ * getMessage() must be populated with human-readable error message.
+ */
+ void unregisterCoolingDeviceChangedCallback(in ICoolingDeviceChangedCallback callback);
}
diff --git a/thermal/aidl/default/Thermal.cpp b/thermal/aidl/default/Thermal.cpp
index f643d22..41d0be8 100644
--- a/thermal/aidl/default/Thermal.cpp
+++ b/thermal/aidl/default/Thermal.cpp
@@ -142,4 +142,53 @@
return ScopedAStatus::ok();
}
+ScopedAStatus Thermal::registerCoolingDeviceChangedCallbackWithType(
+ const std::shared_ptr<ICoolingDeviceChangedCallback>& in_callback, CoolingType in_type) {
+ LOG(VERBOSE) << __func__ << " ICoolingDeviceChangedCallback: " << in_callback
+ << ", CoolingType: " << static_cast<int32_t>(in_type);
+ if (in_callback == nullptr) {
+ return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+ "Invalid nullptr callback");
+ }
+ {
+ std::lock_guard<std::mutex> _lock(cdev_callback_mutex_);
+ if (std::any_of(cdev_callbacks_.begin(), cdev_callbacks_.end(),
+ [&](const std::shared_ptr<ICoolingDeviceChangedCallback>& c) {
+ return interfacesEqual(c, in_callback);
+ })) {
+ return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+ "Callback already registered");
+ }
+ cdev_callbacks_.push_back(in_callback);
+ }
+ return ScopedAStatus::ok();
+}
+
+ScopedAStatus Thermal::unregisterCoolingDeviceChangedCallback(
+ const std::shared_ptr<ICoolingDeviceChangedCallback>& in_callback) {
+ LOG(VERBOSE) << __func__ << " ICoolingDeviceChangedCallback: " << in_callback;
+ if (in_callback == nullptr) {
+ return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+ "Invalid nullptr callback");
+ }
+ {
+ std::lock_guard<std::mutex> _lock(cdev_callback_mutex_);
+ bool removed = false;
+ cdev_callbacks_.erase(
+ std::remove_if(cdev_callbacks_.begin(), cdev_callbacks_.end(),
+ [&](const std::shared_ptr<ICoolingDeviceChangedCallback>& c) {
+ if (interfacesEqual(c, in_callback)) {
+ removed = true;
+ return true;
+ }
+ return false;
+ }),
+ cdev_callbacks_.end());
+ if (!removed) {
+ return ndk::ScopedAStatus::fromExceptionCodeWithMessage(EX_ILLEGAL_ARGUMENT,
+ "Callback wasn't registered");
+ }
+ }
+ return ScopedAStatus::ok();
+}
} // namespace aidl::android::hardware::thermal::impl::example
diff --git a/thermal/aidl/default/Thermal.h b/thermal/aidl/default/Thermal.h
index 8885e63..d3d8874 100644
--- a/thermal/aidl/default/Thermal.h
+++ b/thermal/aidl/default/Thermal.h
@@ -46,6 +46,7 @@
ndk::ScopedAStatus registerThermalChangedCallback(
const std::shared_ptr<IThermalChangedCallback>& in_callback) override;
+
ndk::ScopedAStatus registerThermalChangedCallbackWithType(
const std::shared_ptr<IThermalChangedCallback>& in_callback,
TemperatureType in_type) override;
@@ -53,9 +54,18 @@
ndk::ScopedAStatus unregisterThermalChangedCallback(
const std::shared_ptr<IThermalChangedCallback>& in_callback) override;
+ ndk::ScopedAStatus registerCoolingDeviceChangedCallbackWithType(
+ const std::shared_ptr<ICoolingDeviceChangedCallback>& in_callback,
+ CoolingType in_type) override;
+
+ ndk::ScopedAStatus unregisterCoolingDeviceChangedCallback(
+ const std::shared_ptr<ICoolingDeviceChangedCallback>& in_callback) override;
+
private:
std::mutex thermal_callback_mutex_;
std::vector<std::shared_ptr<IThermalChangedCallback>> thermal_callbacks_;
+ std::mutex cdev_callback_mutex_;
+ std::vector<std::shared_ptr<ICoolingDeviceChangedCallback>> cdev_callbacks_;
};
} // namespace example
diff --git a/thermal/aidl/vts/VtsHalThermalTargetTest.cpp b/thermal/aidl/vts/VtsHalThermalTargetTest.cpp
index 4b0eb65..403c6c8 100644
--- a/thermal/aidl/vts/VtsHalThermalTargetTest.cpp
+++ b/thermal/aidl/vts/VtsHalThermalTargetTest.cpp
@@ -26,6 +26,7 @@
#include <aidl/Gtest.h>
#include <aidl/Vintf.h>
+#include <aidl/android/hardware/thermal/BnCoolingDeviceChangedCallback.h>
#include <aidl/android/hardware/thermal/BnThermal.h>
#include <aidl/android/hardware/thermal/BnThermalChangedCallback.h>
#include <android-base/logging.h>
@@ -59,6 +60,15 @@
.throttlingStatus = ThrottlingSeverity::CRITICAL,
};
+static const CoolingDevice kCoolingDevice = {
+ .type = CoolingType::CPU,
+ .name = "test cooling device",
+ .value = 1,
+ .powerLimitMw = 300,
+ .powerMw = 500,
+ .timeWindowMs = 7000,
+};
+
// Callback class for receiving thermal event notifications from main class
class ThermalCallback : public BnThermalChangedCallback {
public:
@@ -85,6 +95,33 @@
bool mInvoke = false;
};
+// Callback class for receiving cooling device event notifications from main class
+class CoolingDeviceCallback : public BnCoolingDeviceChangedCallback {
+ public:
+ ndk::ScopedAStatus notifyCoolingDeviceChanged(const CoolingDevice&) override {
+ {
+ std::lock_guard<std::mutex> lock(mMutex);
+ mInvoke = true;
+ }
+ mNotifyCoolingDeviceChanged.notify_all();
+ return ndk::ScopedAStatus::ok();
+ }
+
+ template <typename R, typename P>
+ [[nodiscard]] bool waitForCallback(std::chrono::duration<R, P> duration) {
+ std::unique_lock<std::mutex> lock(mMutex);
+ bool r = mNotifyCoolingDeviceChanged.wait_for(lock, duration,
+ [this] { return this->mInvoke; });
+ mInvoke = false;
+ return r;
+ }
+
+ private:
+ std::mutex mMutex;
+ std::condition_variable mNotifyCoolingDeviceChanged;
+ bool mInvoke = false;
+};
+
// The main test class for THERMAL HIDL HAL.
class ThermalAidlTest : public testing::TestWithParam<std::string> {
public:
@@ -97,19 +134,42 @@
ASSERT_NE(mThermalCallback, nullptr);
::ndk::ScopedAStatus status = mThermal->registerThermalChangedCallback(mThermalCallback);
ASSERT_TRUE(status.isOk()) << status.getMessage();
+
+ auto ret = mThermal->getInterfaceVersion(&thermal_version);
+ ASSERT_TRUE(ret.isOk()) << ret;
+ if (thermal_version > 1) {
+ mCoolingDeviceCallback = ndk::SharedRefBase::make<CoolingDeviceCallback>();
+ ASSERT_NE(mCoolingDeviceCallback, nullptr);
+ status = mThermal->registerCoolingDeviceChangedCallbackWithType(mCoolingDeviceCallback,
+ kCoolingDevice.type);
+ ASSERT_TRUE(status.isOk()) << status.getMessage();
+ }
}
void TearDown() override {
::ndk::ScopedAStatus status = mThermal->unregisterThermalChangedCallback(mThermalCallback);
ASSERT_TRUE(status.isOk()) << status.getMessage();
+
// Expect to fail if unregister again
status = mThermal->unregisterThermalChangedCallback(mThermalCallback);
ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode());
+
+ auto ret = mThermal->getInterfaceVersion(&thermal_version);
+ ASSERT_TRUE(ret.isOk()) << ret;
+ if (thermal_version > 1) {
+ status = mThermal->unregisterCoolingDeviceChangedCallback(mCoolingDeviceCallback);
+ ASSERT_TRUE(status.isOk()) << status.getMessage();
+ status = mThermal->unregisterCoolingDeviceChangedCallback(mCoolingDeviceCallback);
+ ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode());
+ }
}
+ // Stores thermal version
+ int32_t thermal_version;
protected:
std::shared_ptr<IThermal> mThermal;
std::shared_ptr<ThermalCallback> mThermalCallback;
+ std::shared_ptr<CoolingDeviceCallback> mCoolingDeviceCallback;
};
// Test ThermalChangedCallback::notifyThrottling().
@@ -121,6 +181,21 @@
ASSERT_TRUE(thermalCallback->waitForCallback(200ms));
}
+// Test CoolingDeviceChangedCallback::notifyCoolingDeviceChanged().
+// This just calls into and back from our local CoolingDeviceChangedCallback impl.
+TEST_P(ThermalAidlTest, NotifyCoolingDeviceChangedTest) {
+ auto ret = mThermal->getInterfaceVersion(&thermal_version);
+ ASSERT_TRUE(ret.isOk()) << ret;
+ if (thermal_version < 2) {
+ return;
+ }
+ std::shared_ptr<CoolingDeviceCallback> cdevCallback =
+ ndk::SharedRefBase::make<CoolingDeviceCallback>();
+ ::ndk::ScopedAStatus status = cdevCallback->notifyCoolingDeviceChanged(kCoolingDevice);
+ ASSERT_TRUE(status.isOk()) << status.getMessage();
+ ASSERT_TRUE(cdevCallback->waitForCallback(200ms));
+}
+
// Test Thermal->registerThermalChangedCallback.
TEST_P(ThermalAidlTest, RegisterThermalChangedCallbackTest) {
// Expect to fail with same callback
@@ -169,6 +244,37 @@
|| status.getExceptionCode() == EX_NULL_POINTER);
}
+// Test Thermal->registerCoolingDeviceChangedCallbackWithType.
+TEST_P(ThermalAidlTest, RegisterCoolingDeviceChangedCallbackWithTypeTest) {
+ auto ret = mThermal->getInterfaceVersion(&thermal_version);
+ ASSERT_TRUE(ret.isOk()) << ret;
+ if (thermal_version < 2) {
+ return;
+ }
+
+ // Expect to fail with same callback
+ ::ndk::ScopedAStatus status = mThermal->registerCoolingDeviceChangedCallbackWithType(
+ mCoolingDeviceCallback, CoolingType::CPU);
+ ASSERT_EQ(EX_ILLEGAL_ARGUMENT, status.getExceptionCode());
+ // Expect to fail with null callback
+ status = mThermal->registerCoolingDeviceChangedCallbackWithType(nullptr, CoolingType::CPU);
+ ASSERT_TRUE(status.getExceptionCode() == EX_ILLEGAL_ARGUMENT ||
+ status.getExceptionCode() == EX_NULL_POINTER);
+ std::shared_ptr<CoolingDeviceCallback> localCoolingDeviceCallback =
+ ndk::SharedRefBase::make<CoolingDeviceCallback>();
+ // Expect to succeed with different callback
+ status = mThermal->registerCoolingDeviceChangedCallbackWithType(localCoolingDeviceCallback,
+ CoolingType::CPU);
+ ASSERT_TRUE(status.isOk()) << status.getMessage();
+ // Remove the local callback
+ status = mThermal->unregisterCoolingDeviceChangedCallback(localCoolingDeviceCallback);
+ ASSERT_TRUE(status.isOk()) << status.getMessage();
+ // Expect to fail with null callback
+ status = mThermal->unregisterCoolingDeviceChangedCallback(nullptr);
+ ASSERT_TRUE(status.getExceptionCode() == EX_ILLEGAL_ARGUMENT ||
+ status.getExceptionCode() == EX_NULL_POINTER);
+}
+
// Test Thermal->getCurrentTemperatures().
TEST_P(ThermalAidlTest, TemperatureTest) {
std::vector<Temperature> ret;
diff --git a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp
index 746ae1e..7e095f1 100644
--- a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp
+++ b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.cpp
@@ -14,6 +14,8 @@
* limitations under the License.
*/
+#define LOG_TAG "tv_input_aidl_hal_test"
+
#include "VtsHalTvInputTargetTest.h"
#include <android-base/properties.h>
@@ -181,7 +183,9 @@
ALOGD("OpenAndCloseStreamTest: open stream, device_id=%d, stream_id=%d", device_id,
stream_id);
ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle).isOk());
- ASSERT_TRUE(isValidHandle(handle));
+ if (VERIFY_SIDEBAND_STREAM_HANDLE) {
+ ASSERT_TRUE(isValidHandle(handle));
+ }
ALOGD("OpenAndCloseStreamTest: close stream, device_id=%d, stream_id=%d", device_id,
stream_id);
@@ -283,7 +287,9 @@
ALOGD("OpenAnOpenedStreamsTest: open stream, device_id=%d, stream_id=%d", device_id, stream_id);
ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle).isOk());
- ASSERT_TRUE(isValidHandle(handle));
+ if (VERIFY_SIDEBAND_STREAM_HANDLE) {
+ ASSERT_TRUE(isValidHandle(handle));
+ }
ALOGD("OpenAnOpenedStreamsTest: open stream, device_id=%d, stream_id=%d", device_id, stream_id);
ASSERT_TRUE(tv_input_->openStream(device_id, stream_id, &handle).getServiceSpecificError() ==
diff --git a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h
index 7e66a88..fd98a18 100644
--- a/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h
+++ b/tv/input/aidl/vts/functional/VtsHalTvInputTargetTest.h
@@ -43,6 +43,7 @@
#define WAIT_FOR_EVENT_TIMEOUT 5
#define DEFAULT_ID INT32_MIN
+#define VERIFY_SIDEBAND_STREAM_HANDLE 1
namespace VtsHalTvInputTargetTest {
diff --git a/tv/tuner/aidl/default/Demux.cpp b/tv/tuner/aidl/default/Demux.cpp
index de94467..5eeb36a 100644
--- a/tv/tuner/aidl/default/Demux.cpp
+++ b/tv/tuner/aidl/default/Demux.cpp
@@ -53,9 +53,6 @@
Demux::~Demux() {
ALOGV("%s", __FUNCTION__);
- if (mDemuxIptvReadThread.joinable()) {
- mDemuxIptvReadThread.join();
- }
close();
}
@@ -123,26 +120,43 @@
mIsIptvThreadRunningCv.notify_all();
}
-void Demux::readIptvThreadLoop(dtv_plugin* interface, dtv_streamer* streamer, size_t buf_size,
- int timeout_ms, int buffer_timeout) {
+void Demux::frontendIptvInputThreadLoop(dtv_plugin* interface, dtv_streamer* streamer, void* buf) {
Timer *timer, *fullBufferTimer;
+ bool isTuneBytePushedToDvr = false;
while (true) {
std::unique_lock<std::mutex> lock(mIsIptvThreadRunningMutex);
- mIsIptvThreadRunningCv.wait(lock, [this] { return mIsIptvReadThreadRunning; });
- if (mIsIptvDvrFMQFull && fullBufferTimer->get_elapsed_time_ms() > buffer_timeout) {
- ALOGE("DVR FMQ has not been flushed within timeout of %d ms", buffer_timeout);
+ mIsIptvThreadRunningCv.wait(
+ lock, [this] { return mIsIptvReadThreadRunning || mIsIptvReadThreadTerminated; });
+ if (mIsIptvReadThreadTerminated) {
+ ALOGI("[Demux] IPTV reading thread for playback terminated");
+ break;
+ }
+ if (mIsIptvDvrFMQFull &&
+ fullBufferTimer->get_elapsed_time_ms() > IPTV_PLAYBACK_BUFFER_TIMEOUT) {
+ ALOGE("DVR FMQ has not been flushed within timeout of %d ms",
+ IPTV_PLAYBACK_BUFFER_TIMEOUT);
delete fullBufferTimer;
break;
}
timer = new Timer();
- void* buf = malloc(sizeof(char) * IPTV_BUFFER_SIZE);
- if (buf == nullptr) ALOGI("Buffer allocation failed");
- ssize_t bytes_read = interface->read_stream(streamer, buf, buf_size, timeout_ms);
- if (bytes_read == 0) {
+ ssize_t bytes_read;
+ void* tuneByteBuffer = mFrontend->getTuneByteBuffer();
+ if (!isTuneBytePushedToDvr && tuneByteBuffer != nullptr) {
+ memcpy(buf, tuneByteBuffer, 1);
+ char* offsetBuf = (char*)buf + 1;
+ bytes_read = interface->read_stream(streamer, (void*)offsetBuf, IPTV_BUFFER_SIZE - 1,
+ IPTV_PLAYBACK_TIMEOUT);
+ isTuneBytePushedToDvr = true;
+ } else {
+ bytes_read =
+ interface->read_stream(streamer, buf, IPTV_BUFFER_SIZE, IPTV_PLAYBACK_TIMEOUT);
+ }
+
+ if (bytes_read <= 0) {
double elapsed_time = timer->get_elapsed_time_ms();
- if (elapsed_time > timeout_ms) {
+ if (elapsed_time > IPTV_PLAYBACK_TIMEOUT) {
ALOGE("[Demux] timeout reached - elapsed_time: %f, timeout: %d", elapsed_time,
- timeout_ms);
+ IPTV_PLAYBACK_TIMEOUT);
}
ALOGE("[Demux] Cannot read data from the socket");
delete timer;
@@ -170,8 +184,6 @@
default:
ALOGI("Invalid DVR Status");
}
-
- free(buf);
}
}
@@ -206,32 +218,44 @@
// get plugin interface from frontend
dtv_plugin* interface = mFrontend->getIptvPluginInterface();
+ // if plugin interface is not on frontend, create a new plugin interface
if (interface == nullptr) {
- ALOGE("[Demux] getIptvPluginInterface(): plugin interface is null");
- return ::ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(Result::INVALID_STATE));
+ interface = mFrontend->createIptvPluginInterface();
+ if (interface == nullptr) {
+ ALOGE("[ INFO ] Failed to load plugin.");
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::INVALID_STATE));
+ }
}
- ALOGI("[Demux] getIptvPluginInterface(): plugin interface is not null");
+
+ // get transport description from frontend
+ string transport_desc = mFrontend->getIptvTransportDescription();
+ if (transport_desc.empty()) {
+ string content_url = "rtp://127.0.0.1:12345";
+ transport_desc = "{ \"uri\": \"" + content_url + "\"}";
+ }
+ ALOGI("[Demux] transport_desc: %s", transport_desc.c_str());
// get streamer object from Frontend instance
dtv_streamer* streamer = mFrontend->getIptvPluginStreamer();
if (streamer == nullptr) {
- ALOGE("[Demux] getIptvPluginStreamer(): streamer is null");
+ streamer = mFrontend->createIptvPluginStreamer(interface, transport_desc.c_str());
+ if (streamer == nullptr) {
+ ALOGE("[ INFO ] Failed to open stream");
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::INVALID_STATE));
+ }
+ }
+ stopIptvFrontendInput();
+ mIsIptvReadThreadTerminated = false;
+ void* buf = malloc(sizeof(char) * IPTV_BUFFER_SIZE);
+ if (buf == nullptr) {
+ ALOGE("[Demux] Buffer allocation failed");
return ::ndk::ScopedAStatus::fromServiceSpecificError(
static_cast<int32_t>(Result::INVALID_STATE));
}
- ALOGI("[Demux] getIptvPluginStreamer(): streamer is not null");
-
- // get transport description from frontend
- string transport_desc = mFrontend->getIptvTransportDescription();
- ALOGI("[Demux] getIptvTransportDescription(): transport_desc: %s", transport_desc.c_str());
-
- // call read_stream on the socket to populate the buffer with TS data
- // while thread is alive, keep reading data
- int timeout_ms = 20;
- int buffer_timeout = 10000; // 10s
- mDemuxIptvReadThread = std::thread(&Demux::readIptvThreadLoop, this, interface, streamer,
- IPTV_BUFFER_SIZE, timeout_ms, buffer_timeout);
+ mDemuxIptvReadThread =
+ std::thread(&Demux::frontendIptvInputThreadLoop, this, interface, streamer, buf);
}
return ::ndk::ScopedAStatus::ok();
}
@@ -348,6 +372,7 @@
ALOGV("%s", __FUNCTION__);
stopFrontendInput();
+ stopIptvFrontendInput();
set<int64_t>::iterator it;
for (it = mPlaybackFilterIds.begin(); it != mPlaybackFilterIds.end(); it++) {
@@ -543,6 +568,15 @@
}
}
+void Demux::stopIptvFrontendInput() {
+ ALOGD("[Demux] stop iptv frontend on demux");
+ if (mDemuxIptvReadThread.joinable()) {
+ mIsIptvReadThreadTerminated = true;
+ mIsIptvThreadRunningCv.notify_all();
+ mDemuxIptvReadThread.join();
+ }
+}
+
void Demux::setIsRecording(bool isRecording) {
mIsRecording = isRecording;
}
diff --git a/tv/tuner/aidl/default/Demux.h b/tv/tuner/aidl/default/Demux.h
index ad7b7a7..af040d4 100644
--- a/tv/tuner/aidl/default/Demux.h
+++ b/tv/tuner/aidl/default/Demux.h
@@ -56,6 +56,9 @@
class TimeFilter;
class Tuner;
+const int IPTV_PLAYBACK_TIMEOUT = 20; // ms
+const int IPTV_PLAYBACK_BUFFER_TIMEOUT = 20000; // ms
+
class DvrPlaybackCallback : public BnDvrCallback {
public:
virtual ::ndk::ScopedAStatus onPlaybackStatus(PlaybackStatus status) override {
@@ -103,8 +106,7 @@
void setIsRecording(bool isRecording);
bool isRecording();
void startFrontendInputLoop();
- void readIptvThreadLoop(dtv_plugin* interface, dtv_streamer* streamer, size_t size,
- int timeout_ms, int buffer_timeout);
+ void frontendIptvInputThreadLoop(dtv_plugin* interface, dtv_streamer* streamer, void* buf);
/**
* A dispatcher to read and dispatch input data to all the started filters.
@@ -128,6 +130,10 @@
* Setter for IPTV Reading thread
*/
void setIptvThreadRunning(bool isIptvThreadRunning);
+ /**
+ * Stops IPTV playback reading thread.
+ */
+ void stopIptvFrontendInput();
private:
// Tuner service
@@ -206,7 +212,8 @@
/**
* Controls IPTV reading thread status
*/
- bool mIsIptvReadThreadRunning;
+ bool mIsIptvReadThreadRunning = false;
+ std::atomic<bool> mIsIptvReadThreadTerminated = false;
std::mutex mIsIptvThreadRunningMutex;
std::condition_variable mIsIptvThreadRunningCv;
diff --git a/tv/tuner/aidl/default/Filter.cpp b/tv/tuner/aidl/default/Filter.cpp
index 212d329..5f7a4cd 100644
--- a/tv/tuner/aidl/default/Filter.cpp
+++ b/tv/tuner/aidl/default/Filter.cpp
@@ -366,9 +366,11 @@
::ndk::ScopedAStatus Filter::stop() {
ALOGV("%s", __FUNCTION__);
- mFilterCount -= 1;
- if (mFilterCount == 0) {
- mDemux->setIptvThreadRunning(false);
+ if (mFilterCount > 0) {
+ mFilterCount -= 1;
+ if (mFilterCount.load() == 0) {
+ mDemux->setIptvThreadRunning(false);
+ }
}
mFilterThreadRunning = false;
diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp
index 57ed1ba..1031604 100644
--- a/tv/tuner/aidl/default/Frontend.cpp
+++ b/tv/tuner/aidl/default/Frontend.cpp
@@ -188,6 +188,9 @@
mCallback = nullptr;
mIsLocked = false;
mTuner = nullptr;
+ if (mTuneByteBuffer != nullptr) {
+ free(mTuneByteBuffer);
+ }
}
::ndk::ScopedAStatus Frontend::close() {
@@ -215,19 +218,43 @@
return ::ndk::ScopedAStatus::ok();
}
-void Frontend::readTuneByte(dtv_streamer* streamer, void* buf, size_t buf_size, int timeout_ms) {
- ssize_t bytes_read = mIptvPluginInterface->read_stream(streamer, buf, buf_size, timeout_ms);
+dtv_plugin* Frontend::createIptvPluginInterface() {
+ const char* path = "/vendor/lib/iptv_udp_plugin.so";
+ DtvPlugin* plugin = new DtvPlugin(path);
+ bool plugin_loaded = plugin->load();
+ if (!plugin_loaded) {
+ ALOGE("Failed to load plugin");
+ return nullptr;
+ }
+ return plugin->interface();
+}
+
+dtv_streamer* Frontend::createIptvPluginStreamer(dtv_plugin* interface,
+ const char* transport_desc) {
+ dtv_streamer* streamer = interface->create_streamer();
+ int open_fd = interface->open_stream(streamer, transport_desc);
+ if (open_fd < 0) {
+ return nullptr;
+ }
+ ALOGI("[ INFO ] open_stream successful, open_fd=%d", open_fd);
+ return streamer;
+}
+
+void Frontend::readTuneByte(void* buf) {
+ ssize_t bytes_read = mIptvPluginInterface->read_stream(mIptvPluginStreamer, buf,
+ TUNE_BUFFER_SIZE, TUNE_BUFFER_TIMEOUT);
if (bytes_read <= 0) {
ALOGI("[ ERROR ] Tune byte couldn't be read.");
return;
}
mCallback->onEvent(FrontendEventType::LOCKED);
mIsLocked = true;
+ mTuneByteBuffer = buf;
}
::ndk::ScopedAStatus Frontend::tune(const FrontendSettings& in_settings) {
if (mCallback == nullptr) {
- ALOGW("[ WARN ] Frontend callback is not set for tunin0g");
+ ALOGW("[ WARN ] Frontend callback is not set for tuning");
return ::ndk::ScopedAStatus::fromServiceSpecificError(
static_cast<int32_t>(Result::INVALID_STATE));
}
@@ -242,54 +269,39 @@
ALOGI("[ INFO ] Frontend type is set to IPTV, tag = %d id=%d", in_settings.getTag(),
mId);
- // load udp plugin for reading TS data
- const char* path = "/vendor/lib/iptv_udp_plugin.so";
- DtvPlugin* plugin = new DtvPlugin(path);
- if (!plugin) {
- ALOGE("Failed to create DtvPlugin, plugin_path is invalid");
+ mIptvPluginInterface = createIptvPluginInterface();
+ if (mIptvPluginInterface == nullptr) {
+ ALOGE("[ INFO ] Failed to load plugin.");
return ::ndk::ScopedAStatus::fromServiceSpecificError(
static_cast<int32_t>(Result::INVALID_ARGUMENT));
}
- bool plugin_loaded = plugin->load();
- if (!plugin_loaded) {
- ALOGE("Failed to load plugin");
- return ::ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(Result::INVALID_ARGUMENT));
- }
- mIptvPluginInterface = plugin->interface();
// validate content_url format
std::string content_url = in_settings.get<FrontendSettings::Tag::iptv>()->contentUrl;
- std::string transport_desc = "{ \"uri\": \"" + content_url + "\"}";
- ALOGI("[ INFO ] transport_desc: %s", transport_desc.c_str());
- bool is_transport_desc_valid = plugin->validate(transport_desc.c_str());
+ mIptvTransportDescription = "{ \"uri\": \"" + content_url + "\"}";
+ ALOGI("[ INFO ] transport_desc: %s", mIptvTransportDescription.c_str());
+ bool is_transport_desc_valid =
+ mIptvPluginInterface->validate(mIptvTransportDescription.c_str());
if (!is_transport_desc_valid) { // not of format protocol://ip:port
ALOGE("[ INFO ] transport_desc is not valid");
return ::ndk::ScopedAStatus::fromServiceSpecificError(
static_cast<int32_t>(Result::INVALID_ARGUMENT));
}
- mIptvTransportDescription = transport_desc;
// create a streamer and open it for reading data
- dtv_streamer* streamer = mIptvPluginInterface->create_streamer();
- mIptvPluginStreamer = streamer;
- int open_fd = mIptvPluginInterface->open_stream(streamer, transport_desc.c_str());
- if (open_fd < 0) {
- ALOGE("[ INFO ] could not open stream");
- return ::ndk::ScopedAStatus::fromServiceSpecificError(
- static_cast<int32_t>(Result::INVALID_ARGUMENT));
- }
- ALOGI("[ INFO ] open_stream successful, open_fd=%d", open_fd);
+ mIptvPluginStreamer =
+ createIptvPluginStreamer(mIptvPluginInterface, mIptvTransportDescription.c_str());
- size_t buf_size = 1;
- int timeout_ms = 2000;
- void* buf = malloc(sizeof(char) * buf_size);
- if (buf == nullptr) ALOGI("malloc buf failed [TUNE]");
- ALOGI("[ INFO ] [Tune] Allocated buffer of size %zu", buf_size);
- mIptvFrontendTuneThread =
- std::thread(&Frontend::readTuneByte, this, streamer, buf, buf_size, timeout_ms);
- if (mIptvFrontendTuneThread.joinable()) mIptvFrontendTuneThread.join();
- free(buf);
+ void* buf = malloc(sizeof(char) * TUNE_BUFFER_SIZE);
+ if (buf == nullptr) {
+ ALOGE("Failed to allocate 1 byte buffer for tuning.");
+ return ::ndk::ScopedAStatus::fromServiceSpecificError(
+ static_cast<int32_t>(Result::INVALID_STATE));
+ }
+ mIptvFrontendTuneThread = std::thread(&Frontend::readTuneByte, this, buf);
+ if (mIptvFrontendTuneThread.joinable()) {
+ mIptvFrontendTuneThread.join();
+ }
}
return ::ndk::ScopedAStatus::ok();
diff --git a/tv/tuner/aidl/default/Frontend.h b/tv/tuner/aidl/default/Frontend.h
index 17a1aee..f3f8a87 100644
--- a/tv/tuner/aidl/default/Frontend.h
+++ b/tv/tuner/aidl/default/Frontend.h
@@ -33,6 +33,9 @@
class Tuner;
+const int TUNE_BUFFER_SIZE = 1; // byte
+const int TUNE_BUFFER_TIMEOUT = 2000; // ms
+
class Frontend : public BnFrontend {
public:
Frontend(FrontendType type, int32_t id);
@@ -64,7 +67,10 @@
dtv_plugin* getIptvPluginInterface();
string getIptvTransportDescription();
dtv_streamer* getIptvPluginStreamer();
- void readTuneByte(dtv_streamer* streamer, void* buf, size_t size, int timeout_ms);
+ void readTuneByte(void* buf);
+ void* getTuneByteBuffer() { return mTuneByteBuffer; };
+ dtv_streamer* createIptvPluginStreamer(dtv_plugin* interface, const char* transport_desc);
+ dtv_plugin* createIptvPluginInterface();
bool isLocked();
void getFrontendInfo(FrontendInfo* _aidl_return);
void setTunerService(std::shared_ptr<Tuner> tuner);
@@ -90,6 +96,7 @@
string mIptvTransportDescription;
dtv_streamer* mIptvPluginStreamer;
std::thread mIptvFrontendTuneThread;
+ void* mTuneByteBuffer = nullptr;
};
} // namespace tuner
diff --git a/tv/tuner/aidl/vts/functional/Android.bp b/tv/tuner/aidl/vts/functional/Android.bp
index 513007b..09e63fc 100644
--- a/tv/tuner/aidl/vts/functional/Android.bp
+++ b/tv/tuner/aidl/vts/functional/Android.bp
@@ -37,6 +37,7 @@
"FrontendTests.cpp",
"LnbTests.cpp",
"VtsHalTvTunerTargetTest.cpp",
+ "utils/IpStreamer.cpp",
],
generated_headers: [
"tuner_testing_dynamic_configuration_V1_0_enums",
diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
index b0f614e..b7b0185 100644
--- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp
+++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
@@ -475,6 +475,10 @@
<< "FrontendConfig does not match the frontend info of the given id.";
mIsSoftwareFe = config.isSoftwareFe;
+ std::unique_ptr<IpStreamer> ipThread = std::make_unique<IpStreamer>();
+ if (config.type == FrontendType::IPTV) {
+ ipThread->startIpStream();
+ }
if (mIsSoftwareFe && testWithDemux) {
if (getDvrTests()->openDvrInDemux(mDvrConfig.type, mDvrConfig.bufferSize) != success()) {
ALOGW("[vts] Software frontend dvr configure openDvr failed.");
@@ -494,6 +498,9 @@
getDvrTests()->startDvrPlayback();
}
mFrontendCallback->tuneTestOnLock(mFrontend, config.settings);
+ if (config.type == FrontendType::IPTV) {
+ ipThread->stopIpStream();
+ }
return AssertionResult(true);
}
diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.h b/tv/tuner/aidl/vts/functional/FrontendTests.h
index 1746c8e..9c2ffc0 100644
--- a/tv/tuner/aidl/vts/functional/FrontendTests.h
+++ b/tv/tuner/aidl/vts/functional/FrontendTests.h
@@ -27,6 +27,7 @@
#include "DvrTests.h"
#include "VtsHalTvTunerTestConfigurations.h"
+#include "utils/IpStreamer.h"
#define WAIT_TIMEOUT 3000000000
#define INVALID_ID -1
diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp
index 766814f..2b39bc6 100644
--- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp
+++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp
@@ -1112,6 +1112,10 @@
if (!record.support) {
return;
}
+ // Recording is not currently supported for IPTV frontend
+ if (frontendMap[live.frontendId].type == FrontendType::IPTV) {
+ return;
+ }
auto record_configs = generateRecordConfigurations();
for (auto& configuration : record_configs) {
record = configuration;
@@ -1126,6 +1130,10 @@
if (!record.support) {
return;
}
+ // Recording is not currently supported for IPTV frontend
+ if (frontendMap[live.frontendId].type == FrontendType::IPTV) {
+ return;
+ }
auto record_configs = generateRecordConfigurations();
for (auto& configuration : record_configs) {
record = configuration;
@@ -1158,6 +1166,10 @@
if (!record.support) {
return;
}
+ // Recording is not currently supported for IPTV frontend
+ if (frontendMap[live.frontendId].type == FrontendType::IPTV) {
+ return;
+ }
auto record_configs = generateRecordConfigurations();
for (auto& configuration : record_configs) {
record = configuration;
@@ -1195,6 +1207,10 @@
if (!scan.hasFrontendConnection) {
return;
}
+ // Blind scan is not applicable for IPTV frontend
+ if (frontendMap[live.frontendId].type == FrontendType::IPTV) {
+ return;
+ }
vector<ScanHardwareConnections> scan_configs = generateScanConfigurations();
for (auto& configuration : scan_configs) {
scan = configuration;
@@ -1223,6 +1239,10 @@
if (!scan.hasFrontendConnection) {
return;
}
+ // Blind scan is not application for IPTV frontend
+ if (frontendMap[live.frontendId].type == FrontendType::IPTV) {
+ return;
+ }
vector<ScanHardwareConnections> scan_configs = generateScanConfigurations();
for (auto& configuration : scan_configs) {
scan = configuration;
diff --git a/tv/tuner/aidl/vts/functional/utils/IpStreamer.cpp b/tv/tuner/aidl/vts/functional/utils/IpStreamer.cpp
new file mode 100644
index 0000000..02b2633
--- /dev/null
+++ b/tv/tuner/aidl/vts/functional/utils/IpStreamer.cpp
@@ -0,0 +1,57 @@
+#include "IpStreamer.h"
+
+IpStreamer::IpStreamer() {}
+
+IpStreamer::~IpStreamer() {}
+
+void IpStreamer::startIpStream() {
+ ALOGI("Starting IP Stream thread");
+ mFp = fopen(mFilePath.c_str(), "rb");
+ if (mFp == nullptr) {
+ ALOGE("Failed to open file at path: %s", mFilePath.c_str());
+ return;
+ }
+ mIpStreamerThread = std::thread(&IpStreamer::ipStreamThreadLoop, this, mFp);
+}
+
+void IpStreamer::stopIpStream() {
+ ALOGI("Stopping IP Stream thread");
+ close(mSockfd);
+ if (mFp != nullptr) fclose(mFp);
+ if (mIpStreamerThread.joinable()) {
+ mIpStreamerThread.join();
+ }
+}
+
+void IpStreamer::ipStreamThreadLoop(FILE* fp) {
+ mSockfd = socket(AF_INET, SOCK_DGRAM, 0);
+ if (mSockfd < 0) {
+ ALOGE("IpStreamer::ipStreamThreadLoop: Socket creation failed (%s)", strerror(errno));
+ exit(1);
+ }
+
+ if (mFp == NULL) {
+ ALOGE("IpStreamer::ipStreamThreadLoop: Cannot open file %s: (%s)", mFilePath.c_str(),
+ strerror(errno));
+ exit(1);
+ }
+
+ struct sockaddr_in destaddr;
+ memset(&destaddr, 0, sizeof(destaddr));
+ destaddr.sin_family = mIsIpV4 ? AF_INET : AF_INET6;
+ destaddr.sin_port = htons(mPort);
+ destaddr.sin_addr.s_addr = inet_addr(mIpAddress.c_str());
+
+ char buf[mBufferSize];
+ int n;
+ while (1) {
+ if (fp == nullptr) break;
+ n = fread(buf, 1, mBufferSize, fp);
+ ALOGI("IpStreamer::ipStreamThreadLoop: Bytes read from fread(): %d\n", n);
+ if (n <= 0) {
+ break;
+ }
+ sendto(mSockfd, buf, n, 0, (struct sockaddr*)&destaddr, sizeof(destaddr));
+ sleep(mSleepTime);
+ }
+}
diff --git a/tv/tuner/aidl/vts/functional/utils/IpStreamer.h b/tv/tuner/aidl/vts/functional/utils/IpStreamer.h
new file mode 100644
index 0000000..8ac2ddb
--- /dev/null
+++ b/tv/tuner/aidl/vts/functional/utils/IpStreamer.h
@@ -0,0 +1,48 @@
+#pragma once
+
+#include <arpa/inet.h>
+#include <errno.h>
+#include <log/log.h>
+#include <netinet/in.h>
+#include <stdio.h>
+#include <sys/socket.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <string>
+#include <thread>
+
+/**
+ * IP Streamer class to send TS data to a specified socket for testing IPTV frontend functions
+ * e.g. tuning and playback.
+ */
+
+class IpStreamer {
+ public:
+ // Constructor for IP Streamer object
+ IpStreamer();
+
+ // Destructor for IP Streamer object
+ ~IpStreamer();
+
+ // Starts a thread to read data from a socket
+ void startIpStream();
+
+ // Stops the reading thread started by startIpStream
+ void stopIpStream();
+
+ // Thread function that consumes data from a socket
+ void ipStreamThreadLoop(FILE* fp);
+
+ std::string getFilePath() { return mFilePath; };
+
+ private:
+ int mSockfd = -1;
+ FILE* mFp = nullptr;
+ bool mIsIpV4 = true; // By default, set to IPV4
+ int mPort = 12345; // default port
+ int mBufferSize = 188; // bytes
+ int mSleepTime = 1; // second
+ std::string mIpAddress = "127.0.0.1"; // default IP address
+ std::string mFilePath = "/data/local/tmp/segment000000.ts"; // default path for TS file
+ std::thread mIpStreamerThread;
+};
\ No newline at end of file
diff --git a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp
index c88cb59..6c6846f 100644
--- a/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp
+++ b/vibrator/aidl/vts/VtsHalVibratorTargetTest.cpp
@@ -109,6 +109,11 @@
ASSERT_TRUE(vibrator->getCapabilities(&capabilities).isOk());
}
+ virtual void TearDown() override {
+ // Reset vibrator state between tests.
+ EXPECT_TRUE(vibrator->off().isOk());
+ }
+
sp<IVibrator> vibrator;
int32_t capabilities;
};
@@ -429,189 +434,202 @@
}
TEST_P(VibratorAidl, ComposeValidPrimitives) {
- if (capabilities & IVibrator::CAP_COMPOSE_EFFECTS) {
- std::vector<CompositePrimitive> supported;
- int32_t maxDelay, maxSize;
+ if (!(capabilities & IVibrator::CAP_COMPOSE_EFFECTS)) {
+ GTEST_SKIP() << "CAP_COMPOSE_EFFECTS not supported";
+ }
- ASSERT_TRUE(vibrator->getSupportedPrimitives(&supported).isOk());
- EXPECT_EQ(Status::EX_NONE, vibrator->getCompositionDelayMax(&maxDelay).exceptionCode());
- EXPECT_EQ(Status::EX_NONE, vibrator->getCompositionSizeMax(&maxSize).exceptionCode());
+ std::vector<CompositePrimitive> supported;
+ int32_t maxDelay, maxSize;
- std::vector<CompositeEffect> composite;
+ ASSERT_TRUE(vibrator->getSupportedPrimitives(&supported).isOk());
+ EXPECT_EQ(Status::EX_NONE, vibrator->getCompositionDelayMax(&maxDelay).exceptionCode());
+ EXPECT_EQ(Status::EX_NONE, vibrator->getCompositionSizeMax(&maxSize).exceptionCode());
- for (auto primitive : supported) {
- CompositeEffect effect;
+ std::vector<CompositeEffect> composite;
- effect.delayMs = std::rand() % (maxDelay + 1);
- effect.primitive = primitive;
- effect.scale = static_cast<float>(std::rand()) / static_cast<float>(RAND_MAX);
- composite.emplace_back(effect);
+ for (int i = 0; i < supported.size(); i++) {
+ auto primitive = supported[i];
+ float t = static_cast<float>(i + 1) / supported.size();
+ CompositeEffect effect;
- if (composite.size() == maxSize) {
- EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
- composite.clear();
- vibrator->off();
- }
+ effect.delayMs = maxDelay * t;
+ effect.primitive = primitive;
+ effect.scale = t;
+
+ if (composite.size() == maxSize) {
+ break;
}
+ }
- if (composite.size() != 0) {
- EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
- vibrator->off();
- }
+ if (composite.size() != 0) {
+ EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
+ EXPECT_TRUE(vibrator->off().isOk());
}
}
TEST_P(VibratorAidl, ComposeUnsupportedPrimitives) {
- if (capabilities & IVibrator::CAP_COMPOSE_EFFECTS) {
- auto unsupported = kInvalidPrimitives;
- std::vector<CompositePrimitive> supported;
+ if (!(capabilities & IVibrator::CAP_COMPOSE_EFFECTS)) {
+ GTEST_SKIP() << "CAP_COMPOSE_EFFECTS not supported";
+ }
- ASSERT_TRUE(vibrator->getSupportedPrimitives(&supported).isOk());
+ auto unsupported = kInvalidPrimitives;
+ std::vector<CompositePrimitive> supported;
- for (auto primitive : kCompositePrimitives) {
- bool isPrimitiveSupported =
+ ASSERT_TRUE(vibrator->getSupportedPrimitives(&supported).isOk());
+
+ for (auto primitive : kCompositePrimitives) {
+ bool isPrimitiveSupported =
std::find(supported.begin(), supported.end(), primitive) != supported.end();
- if (!isPrimitiveSupported) {
- unsupported.push_back(primitive);
- }
+ if (!isPrimitiveSupported) {
+ unsupported.push_back(primitive);
}
+ }
- for (auto primitive : unsupported) {
- std::vector<CompositeEffect> composite(1);
+ for (auto primitive : unsupported) {
+ std::vector<CompositeEffect> composite(1);
- for (auto &effect : composite) {
- effect.delayMs = 0;
- effect.primitive = primitive;
- effect.scale = 1.0f;
- }
- Status status = vibrator->compose(composite, nullptr);
- EXPECT_TRUE(isUnknownOrUnsupported(status)) << status;
- vibrator->off();
+ for (auto& effect : composite) {
+ effect.delayMs = 0;
+ effect.primitive = primitive;
+ effect.scale = 1.0f;
}
+ Status status = vibrator->compose(composite, nullptr);
+ EXPECT_TRUE(isUnknownOrUnsupported(status)) << status;
}
}
TEST_P(VibratorAidl, ComposeScaleBoundary) {
- if (capabilities & IVibrator::CAP_COMPOSE_EFFECTS) {
- std::vector<CompositeEffect> composite(1);
- CompositeEffect &effect = composite[0];
-
- effect.delayMs = 0;
- effect.primitive = CompositePrimitive::CLICK;
-
- effect.scale = std::nextafter(0.0f, -1.0f);
- EXPECT_EQ(Status::EX_ILLEGAL_ARGUMENT,
- vibrator->compose(composite, nullptr).exceptionCode());
-
- effect.scale = 0.0f;
- EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
-
- effect.scale = 1.0f;
- EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
-
- effect.scale = std::nextafter(1.0f, 2.0f);
- EXPECT_EQ(Status::EX_ILLEGAL_ARGUMENT,
- vibrator->compose(composite, nullptr).exceptionCode());
-
- vibrator->off();
+ if (!(capabilities & IVibrator::CAP_COMPOSE_EFFECTS)) {
+ GTEST_SKIP() << "CAP_COMPOSE_EFFECTS not supported";
}
+
+ std::vector<CompositeEffect> composite(1);
+ CompositeEffect& effect = composite[0];
+
+ effect.delayMs = 0;
+ effect.primitive = CompositePrimitive::CLICK;
+
+ effect.scale = std::nextafter(0.0f, -1.0f);
+ EXPECT_EQ(Status::EX_ILLEGAL_ARGUMENT, vibrator->compose(composite, nullptr).exceptionCode());
+
+ effect.scale = 0.0f;
+ EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
+ EXPECT_TRUE(vibrator->off().isOk());
+
+ effect.scale = 1.0f;
+ EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
+ EXPECT_TRUE(vibrator->off().isOk());
+
+ effect.scale = std::nextafter(1.0f, 2.0f);
+ EXPECT_EQ(Status::EX_ILLEGAL_ARGUMENT, vibrator->compose(composite, nullptr).exceptionCode());
}
TEST_P(VibratorAidl, ComposeDelayBoundary) {
- if (capabilities & IVibrator::CAP_COMPOSE_EFFECTS) {
- int32_t maxDelay;
-
- EXPECT_EQ(Status::EX_NONE, vibrator->getCompositionDelayMax(&maxDelay).exceptionCode());
-
- std::vector<CompositeEffect> composite(1);
- CompositeEffect effect;
-
- effect.delayMs = 1;
- effect.primitive = CompositePrimitive::CLICK;
- effect.scale = 1.0f;
-
- std::fill(composite.begin(), composite.end(), effect);
- EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
-
- effect.delayMs = maxDelay + 1;
-
- std::fill(composite.begin(), composite.end(), effect);
- EXPECT_EQ(Status::EX_ILLEGAL_ARGUMENT,
- vibrator->compose(composite, nullptr).exceptionCode());
- vibrator->off();
+ if (!(capabilities & IVibrator::CAP_COMPOSE_EFFECTS)) {
+ GTEST_SKIP() << "CAP_COMPOSE_EFFECTS not supported";
}
+
+ int32_t maxDelay;
+
+ EXPECT_EQ(Status::EX_NONE, vibrator->getCompositionDelayMax(&maxDelay).exceptionCode());
+
+ std::vector<CompositeEffect> composite(1);
+ CompositeEffect& effect = composite[0];
+
+ effect.primitive = CompositePrimitive::CLICK;
+ effect.scale = 1.0f;
+
+ effect.delayMs = 0;
+ EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
+ EXPECT_TRUE(vibrator->off().isOk());
+
+ effect.delayMs = 1;
+ EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
+ EXPECT_TRUE(vibrator->off().isOk());
+
+ effect.delayMs = maxDelay;
+ EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
+ EXPECT_TRUE(vibrator->off().isOk());
+
+ effect.delayMs = maxDelay + 1;
+ EXPECT_EQ(Status::EX_ILLEGAL_ARGUMENT, vibrator->compose(composite, nullptr).exceptionCode());
}
TEST_P(VibratorAidl, ComposeSizeBoundary) {
- if (capabilities & IVibrator::CAP_COMPOSE_EFFECTS) {
- int32_t maxSize;
-
- EXPECT_EQ(Status::EX_NONE, vibrator->getCompositionSizeMax(&maxSize).exceptionCode());
-
- std::vector<CompositeEffect> composite(maxSize);
- CompositeEffect effect;
-
- effect.delayMs = 1;
- effect.primitive = CompositePrimitive::CLICK;
- effect.scale = 1.0f;
-
- std::fill(composite.begin(), composite.end(), effect);
- EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
-
- composite.emplace_back(effect);
- EXPECT_EQ(Status::EX_ILLEGAL_ARGUMENT,
- vibrator->compose(composite, nullptr).exceptionCode());
- vibrator->off();
+ if (!(capabilities & IVibrator::CAP_COMPOSE_EFFECTS)) {
+ GTEST_SKIP() << "CAP_COMPOSE_EFFECTS not supported";
}
+
+ int32_t maxSize;
+
+ EXPECT_EQ(Status::EX_NONE, vibrator->getCompositionSizeMax(&maxSize).exceptionCode());
+
+ std::vector<CompositeEffect> composite(maxSize);
+ CompositeEffect effect;
+
+ effect.delayMs = 1;
+ effect.primitive = CompositePrimitive::CLICK;
+ effect.scale = 1.0f;
+
+ std::fill(composite.begin(), composite.end(), effect);
+ EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, nullptr).exceptionCode());
+ EXPECT_TRUE(vibrator->off().isOk());
+
+ composite.emplace_back(effect);
+ EXPECT_EQ(Status::EX_ILLEGAL_ARGUMENT, vibrator->compose(composite, nullptr).exceptionCode());
}
TEST_P(VibratorAidl, ComposeCallback) {
- if (capabilities & IVibrator::CAP_COMPOSE_EFFECTS) {
- std::vector<CompositePrimitive> supported;
+ if (!(capabilities & IVibrator::CAP_COMPOSE_EFFECTS)) {
+ GTEST_SKIP() << "CAP_COMPOSE_EFFECTS not supported";
+ }
- ASSERT_TRUE(vibrator->getSupportedPrimitives(&supported).isOk());
+ std::vector<CompositePrimitive> supported;
- for (auto primitive : supported) {
- if (primitive == CompositePrimitive::NOOP) {
- continue;
- }
+ ASSERT_TRUE(vibrator->getSupportedPrimitives(&supported).isOk());
- std::promise<void> completionPromise;
- std::future<void> completionFuture{completionPromise.get_future()};
- sp<CompletionCallback> callback =
- new CompletionCallback([&completionPromise] { completionPromise.set_value(); });
- CompositeEffect effect;
- std::vector<CompositeEffect> composite;
- int32_t durationMs;
- std::chrono::milliseconds duration;
- std::chrono::time_point<high_resolution_clock> start, end;
- std::chrono::milliseconds elapsed;
-
- effect.delayMs = 0;
- effect.primitive = primitive;
- effect.scale = 1.0f;
- composite.emplace_back(effect);
-
- EXPECT_EQ(Status::EX_NONE,
- vibrator->getPrimitiveDuration(primitive, &durationMs).exceptionCode())
- << toString(primitive);
- duration = std::chrono::milliseconds(durationMs);
-
- start = high_resolution_clock::now();
- EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, callback).exceptionCode())
- << toString(primitive);
-
- // TODO(b/261130361): Investigate why latency from driver and hardware will cause test
- // to fail when wait duration is ~40ms or less.
- EXPECT_EQ(completionFuture.wait_for(duration + std::chrono::milliseconds(50)),
- std::future_status::ready)
- << toString(primitive);
- end = high_resolution_clock::now();
-
- elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
- EXPECT_GE(elapsed.count(), duration.count()) << toString(primitive);
+ for (auto primitive : supported) {
+ if (primitive == CompositePrimitive::NOOP) {
+ continue;
}
+
+ std::promise<void> completionPromise;
+ std::future<void> completionFuture{completionPromise.get_future()};
+ sp<CompletionCallback> callback =
+ new CompletionCallback([&completionPromise] { completionPromise.set_value(); });
+ CompositeEffect effect;
+ std::vector<CompositeEffect> composite;
+ int32_t durationMs;
+ std::chrono::milliseconds duration;
+ std::chrono::time_point<high_resolution_clock> start, end;
+ std::chrono::milliseconds elapsed;
+
+ effect.delayMs = 0;
+ effect.primitive = primitive;
+ effect.scale = 1.0f;
+ composite.emplace_back(effect);
+
+ EXPECT_EQ(Status::EX_NONE,
+ vibrator->getPrimitiveDuration(primitive, &durationMs).exceptionCode())
+ << toString(primitive);
+ duration = std::chrono::milliseconds(durationMs);
+
+ start = high_resolution_clock::now();
+ EXPECT_EQ(Status::EX_NONE, vibrator->compose(composite, callback).exceptionCode())
+ << toString(primitive);
+
+ // TODO(b/261130361): Investigate why latency from driver and hardware will cause test
+ // to fail when wait duration is ~40ms or less.
+ EXPECT_EQ(completionFuture.wait_for(duration + std::chrono::milliseconds(50)),
+ std::future_status::ready)
+ << toString(primitive);
+ end = high_resolution_clock::now();
+
+ elapsed = std::chrono::duration_cast<std::chrono::milliseconds>(end - start);
+ EXPECT_GE(elapsed.count(), duration.count()) << toString(primitive);
+
+ EXPECT_TRUE(vibrator->off().isOk());
}
}
diff --git a/vibrator/bench/benchmark.cpp b/vibrator/bench/benchmark.cpp
index e19dc6f..b96e06d 100644
--- a/vibrator/bench/benchmark.cpp
+++ b/vibrator/bench/benchmark.cpp
@@ -118,6 +118,7 @@
});
if (!supported) {
+ state->SkipWithMessage("performApi returned UNSUPPORTED_OPERATION");
return;
}
@@ -140,16 +141,17 @@
}
};
-#define BENCHMARK_WRAPPER(fixt, test, code) \
- BENCHMARK_DEFINE_F(fixt, test) \
- /* NOLINTNEXTLINE */ \
- (State & state) { \
- if (!mVibrator) { \
- return; \
- } \
- \
- code \
- } \
+#define BENCHMARK_WRAPPER(fixt, test, code) \
+ BENCHMARK_DEFINE_F(fixt, test) \
+ /* NOLINTNEXTLINE */ \
+ (State & state) { \
+ if (!mVibrator) { \
+ state.SkipWithMessage("HAL unavailable"); \
+ return; \
+ } \
+ \
+ code \
+ } \
BENCHMARK_REGISTER_F(fixt, test)->Apply(fixt::DefaultConfig)->Apply(fixt::DefaultArgs)
using VibratorBench_V1_0 = VibratorBench<V1_0::IVibrator>;
@@ -186,6 +188,7 @@
uint8_t amplitude = UINT8_MAX;
if (!mVibrator->supportsAmplitudeControl()) {
+ state.SkipWithMessage("Amplitude control unavailable");
return;
}
@@ -227,6 +230,7 @@
bool enable = true;
if (!mVibrator->supportsExternalControl()) {
+ state.SkipWithMessage("external control unavailable");
return;
}
@@ -240,6 +244,7 @@
BENCHMARK_WRAPPER(VibratorBench_V1_3, supportsExternalAmplitudeControl, {
if (!mVibrator->supportsExternalControl()) {
+ state.SkipWithMessage("external control unavailable");
return;
}
@@ -256,12 +261,14 @@
uint8_t amplitude = UINT8_MAX;
if (!mVibrator->supportsExternalControl()) {
+ state.SkipWithMessage("external control unavailable");
return;
}
mVibrator->setExternalControl(true);
if (!mVibrator->supportsAmplitudeControl()) {
+ state.SkipWithMessage("amplitude control unavailable");
return;
}
@@ -328,6 +335,7 @@
int32_t capabilities = 0;
mVibrator->getCapabilities(&capabilities);
if ((capabilities & Aidl::IVibrator::CAP_AMPLITUDE_CONTROL) == 0) {
+ state.SkipWithMessage("amplitude control unavailable");
return;
}
@@ -345,6 +353,7 @@
int32_t capabilities = 0;
mVibrator->getCapabilities(&capabilities);
if ((capabilities & Aidl::IVibrator::CAP_EXTERNAL_CONTROL) == 0) {
+ state.SkipWithMessage("external control unavailable");
return;
}
@@ -361,6 +370,7 @@
mVibrator->getCapabilities(&capabilities);
if ((capabilities & Aidl::IVibrator::CAP_EXTERNAL_CONTROL) == 0 ||
(capabilities & Aidl::IVibrator::CAP_EXTERNAL_AMPLITUDE_CONTROL) == 0) {
+ state.SkipWithMessage("external amplitude control unavailable");
return;
}
@@ -423,6 +433,7 @@
int32_t capabilities = 0;
mVibrator->getCapabilities(&capabilities);
if ((capabilities & Aidl::IVibrator::CAP_ALWAYS_ON_CONTROL) == 0) {
+ state.SkipWithMessage("always on control unavailable");
return;
}
@@ -433,6 +444,7 @@
std::vector<Aidl::Effect> supported;
mVibrator->getSupportedAlwaysOnEffects(&supported);
if (std::find(supported.begin(), supported.end(), effect) == supported.end()) {
+ state.SkipWithMessage("always on effects unavailable");
return;
}
@@ -448,6 +460,7 @@
int32_t capabilities = 0;
mVibrator->getCapabilities(&capabilities);
if ((capabilities & Aidl::IVibrator::CAP_ALWAYS_ON_CONTROL) == 0) {
+ state.SkipWithMessage("always on control unavailable");
return;
}
@@ -458,6 +471,7 @@
std::vector<Aidl::Effect> supported;
mVibrator->getSupportedAlwaysOnEffects(&supported);
if (std::find(supported.begin(), supported.end(), effect) == supported.end()) {
+ state.SkipWithMessage("always on effects unavailable");
return;
}
@@ -481,6 +495,7 @@
std::vector<Aidl::Effect> supported;
mVibrator->getSupportedEffects(&supported);
if (std::find(supported.begin(), supported.end(), effect) == supported.end()) {
+ state.SkipWithMessage("effects unavailable");
return;
}
@@ -527,6 +542,7 @@
int32_t capabilities = 0;
mVibrator->getCapabilities(&capabilities);
if ((capabilities & Aidl::IVibrator::CAP_COMPOSE_EFFECTS) == 0) {
+ state.SkipWithMessage("compose effects unavailable");
return;
}
@@ -536,6 +552,7 @@
std::vector<Aidl::CompositePrimitive> supported;
mVibrator->getSupportedPrimitives(&supported);
if (std::find(supported.begin(), supported.end(), primitive) == supported.end()) {
+ state.SkipWithMessage("supported primitives unavailable");
return;
}
@@ -548,6 +565,7 @@
int32_t capabilities = 0;
mVibrator->getCapabilities(&capabilities);
if ((capabilities & Aidl::IVibrator::CAP_COMPOSE_EFFECTS) == 0) {
+ state.SkipWithMessage("compose effects unavailable");
return;
}
@@ -559,6 +577,7 @@
std::vector<Aidl::CompositePrimitive> supported;
mVibrator->getSupportedPrimitives(&supported);
if (std::find(supported.begin(), supported.end(), effect.primitive) == supported.end()) {
+ state.SkipWithMessage("supported primitives unavailable");
return;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl
index 56ef2d2..6c64084 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttCapabilities.aidl
@@ -42,9 +42,9 @@
android.hardware.wifi.RttPreamble preambleSupport;
android.hardware.wifi.RttBw bwSupport;
byte mcVersion;
- android.hardware.wifi.RttPreamble azPreambleSupport;
- android.hardware.wifi.RttBw azBwSupport;
+ int azPreambleSupport;
+ int azBwSupport;
boolean ntbInitiatorSupported;
boolean ntbResponderSupported;
- int maxTxLtfRepetitionCount;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttConfig.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttConfig.aidl
index b7830bd..3613616 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttConfig.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttConfig.aidl
@@ -48,7 +48,7 @@
int burstDuration;
android.hardware.wifi.RttPreamble preamble;
android.hardware.wifi.RttBw bw;
- int ntbMinMeasurementTimeMillis;
- int ntbMaxMeasurementTimeMillis;
- int txLtfRepetitionCount;
+ long ntbMinMeasurementTime;
+ long ntbMaxMeasurementTime;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl
index 30f5f58..13202ba 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/RttResult.aidl
@@ -59,7 +59,11 @@
android.hardware.wifi.WifiInformationElement lcr;
int channelFreqMHz;
android.hardware.wifi.RttBw packetBw;
- int txLtfRepetitionCount;
- int ntbMinMeasurementTimeMillis;
- int ntbMaxMeasurementTimeMillis;
+ byte i2rTxLtfRepetitionCount;
+ byte r2iTxLtfRepetitionCount;
+ long ntbMinMeasurementTime;
+ long ntbMaxMeasurementTime;
+ byte numTxSpatialStreams;
+ byte numRxSpatialStreams;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtCapabilities.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtCapabilities.aidl
index d8e73fb..75f3e83 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtCapabilities.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtCapabilities.aidl
@@ -38,8 +38,8 @@
boolean isTwtResponderSupported;
boolean isBroadcastTwtSupported;
boolean isFlexibleTwtScheduleSupported;
- int minWakeDurationMicros;
- int maxWakeDurationMicros;
- int minWakeIntervalMicros;
- int maxWakeIntervalMicros;
+ int minWakeDurationUs;
+ int maxWakeDurationUs;
+ long minWakeIntervalUs;
+ long maxWakeIntervalUs;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtRequest.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtRequest.aidl
index 3051b94..1e1c39a 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtRequest.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtRequest.aidl
@@ -35,8 +35,8 @@
@VintfStability
parcelable TwtRequest {
int mloLinkId;
- int minWakeDurationMicros;
- int maxWakeDurationMicros;
- int minWakeIntervalMicros;
- int maxWakeIntervalMicros;
+ int minWakeDurationUs;
+ int maxWakeDurationUs;
+ long minWakeIntervalUs;
+ long maxWakeIntervalUs;
}
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSession.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSession.aidl
index 92c2533..0b88d8e 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSession.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSession.aidl
@@ -36,8 +36,8 @@
parcelable TwtSession {
int sessionId;
int mloLinkId;
- int wakeDurationMicros;
- int wakeIntervalMicros;
+ int wakeDurationUs;
+ long wakeIntervalUs;
android.hardware.wifi.TwtSession.TwtNegotiationType negotiationType;
boolean isTriggerEnabled;
boolean isAnnounced;
diff --git a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSessionStats.aidl b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSessionStats.aidl
index 528444a..f62b614 100644
--- a/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSessionStats.aidl
+++ b/wifi/aidl/aidl_api/android.hardware.wifi/current/android/hardware/wifi/TwtSessionStats.aidl
@@ -38,6 +38,6 @@
int avgRxPktCount;
int avgTxPktSize;
int avgRxPktSize;
- int avgEospDurationMicros;
+ int avgEospDurationUs;
int eospCount;
}
diff --git a/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl b/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl
index 0352ec8..c193924 100644
--- a/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl
+++ b/wifi/aidl/android/hardware/wifi/RttCapabilities.aidl
@@ -18,6 +18,7 @@
import android.hardware.wifi.RttBw;
import android.hardware.wifi.RttPreamble;
+import android.hardware.wifi.common.OuiKeyedData;
/**
* RTT Capabilities.
@@ -64,12 +65,12 @@
* Bit mask indicating what preamble is supported by IEEE 802.11az initiator.
* Combination of |RttPreamble| values.
*/
- RttPreamble azPreambleSupport;
+ int azPreambleSupport;
/**
* Bit mask indicating what BW is supported by IEEE 802.11az initiator.
* Combination of |RttBw| values.
*/
- RttBw azBwSupport;
+ int azBwSupport;
/**
* Whether the initiator supports IEEE 802.11az Non-Trigger-based (non-TB) measurement.
*/
@@ -79,8 +80,8 @@
*/
boolean ntbResponderSupported;
/**
- * Maximum HE LTF repetitions the IEEE 802.11az initiator is capable of transmitting in the
- * preamble of I2R NDP.
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
*/
- int maxTxLtfRepetitionCount;
+ @nullable OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/android/hardware/wifi/RttConfig.aidl b/wifi/aidl/android/hardware/wifi/RttConfig.aidl
index e970656..496ffd2 100644
--- a/wifi/aidl/android/hardware/wifi/RttConfig.aidl
+++ b/wifi/aidl/android/hardware/wifi/RttConfig.aidl
@@ -21,6 +21,7 @@
import android.hardware.wifi.RttPreamble;
import android.hardware.wifi.RttType;
import android.hardware.wifi.WifiChannelInfo;
+import android.hardware.wifi.common.OuiKeyedData;
/**
* RTT configuration.
@@ -121,16 +122,22 @@
*/
RttBw bw;
/**
- * IEEE 802.11az Non-Trigger-based (non-TB) minimum measurement time in milliseconds.
+ * IEEE 802.11az Non-Trigger-based (non-TB) minimum measurement time in units of 100
+ * microseconds.
+ *
+ * Reference: IEEE Std 802.11az-2022 spec, section 9.4.2.298 Ranging Parameters element.
*/
- int ntbMinMeasurementTimeMillis;
+ long ntbMinMeasurementTime;
/**
- * IEEE 802.11az Non-Trigger-based (non-TB) maximum measurement time in milliseconds.
+ * IEEE 802.11az Non-Trigger-based (non-TB) maximum measurement time in units of 10
+ * milliseconds.
+ *
+ * Reference: IEEE Std 802.11az-2022 spec, section 9.4.2.298 Ranging Parameters element.
*/
- int ntbMaxMeasurementTimeMillis;
+ long ntbMaxMeasurementTime;
/**
- * Multiple transmissions of HE-LTF symbols in an HE Ranging NDP. A value of 1 indicates no
- * repetition.
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
*/
- int txLtfRepetitionCount;
+ @nullable OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/android/hardware/wifi/RttResult.aidl b/wifi/aidl/android/hardware/wifi/RttResult.aidl
index 2cb0afa..2f9aefe 100644
--- a/wifi/aidl/android/hardware/wifi/RttResult.aidl
+++ b/wifi/aidl/android/hardware/wifi/RttResult.aidl
@@ -21,6 +21,7 @@
import android.hardware.wifi.RttType;
import android.hardware.wifi.WifiInformationElement;
import android.hardware.wifi.WifiRateInfo;
+import android.hardware.wifi.common.OuiKeyedData;
/**
* RTT results.
@@ -146,12 +147,22 @@
*/
RttBw packetBw;
/**
- * IEEE 802.11az Transmit LTF repetitions used to get this result.
+ * Multiple transmissions of HE-LTF symbols in an HE (I2R) Ranging NDP. An HE-LTF repetition
+ * value of 1 indicates no repetitions.
+ *
+ * Note: A required field for IEEE 802.11az result.
*/
- int txLtfRepetitionCount;
+ byte i2rTxLtfRepetitionCount;
/**
- * Minimum non-trigger based (non-TB) dynamic measurement time in milliseconds assigned by the
- * IEEE 802.11az responder.
+ * Multiple transmissions of HE-LTF symbols in an HE (R2I) Ranging NDP. An HE-LTF repetition
+ * value of 1 indicates no repetitions.
+ *
+ * Note: A required field for IEEE 802.11az result.
+ */
+ byte r2iTxLtfRepetitionCount;
+ /**
+ * Minimum non-trigger based (non-TB) dynamic measurement time in units of 100 microseconds
+ * assigned by the IEEE 802.11az responder.
*
* After initial non-TB negotiation, if the next ranging request for this peer comes in between
* [ntbMinMeasurementTime, ntbMaxMeasurementTime], vendor software shall do the NDPA sounding
@@ -160,11 +171,15 @@
* If the ranging request for this peer comes sooner than minimum measurement time, vendor
* software shall return the cached result of the last measurement including the time stamp
* |RttResult.timestamp|.
+ *
+ * Reference: IEEE Std 802.11az-2022 spec, section 9.4.2.298 Ranging Parameters element.
+ *
+ * Note: A required field for IEEE 802.11az result.
*/
- int ntbMinMeasurementTimeMillis;
+ long ntbMinMeasurementTime;
/**
- * Maximum non-trigger based (non-TB) dynamic measurement time in milliseconds assigned by the
- * IEEE 802.11az responder.
+ * Maximum non-trigger based (non-TB) dynamic measurement time in units of 10 milliseconds
+ * assigned by the IEEE 802.11az responder.
*
* After initial non-TB negotiation, if the next ranging request for this peer comes in between
* [ntbMinMeasurementTime, ntbMaxMeasurementTime], vendor software shall do the NDPA sounding
@@ -173,6 +188,29 @@
* If the ranging request for this peer comes later than the maximum measurement time, vendor
* software shall clean up any existing IEEE 802.11ax non-TB ranging session and re-do the
* non-TB ranging negotiation.
+ *
+ * Reference: IEEE Std 802.11az-2022 spec, section 9.4.2.298 Ranging Parameters element.
+ *
+ * Note: A required field for IEEE 802.11az result.
*/
- int ntbMaxMeasurementTimeMillis;
+ long ntbMaxMeasurementTime;
+ /**
+ * Number of transmit space-time streams used. Value is in the range 1 to 8.
+ *
+ * Note: Maximum limit is ultimately defined by the number of antennas that can be supported.
+ * A required field for IEEE 802.11az result.
+ */
+ byte numTxSpatialStreams;
+ /**
+ * Number of receive space-time streams used. Value is in the range 1 to 8.
+ *
+ * Note: Maximum limit is ultimately defined by the number of antennas that can be supported.
+ * A required field for IEEE 802.11az result.
+ */
+ byte numRxSpatialStreams;
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
}
diff --git a/wifi/aidl/android/hardware/wifi/TwtCapabilities.aidl b/wifi/aidl/android/hardware/wifi/TwtCapabilities.aidl
index 9007d0e..28d16f0 100644
--- a/wifi/aidl/android/hardware/wifi/TwtCapabilities.aidl
+++ b/wifi/aidl/android/hardware/wifi/TwtCapabilities.aidl
@@ -18,6 +18,14 @@
/**
* Target Wake Time (TWT) Capabilities supported.
+ *
+ * TWT allows Wi-Fi stations to manage activity in a network by scheduling to operate at different
+ * times. This minimizes the contention and reduces the required amount of time that a station
+ * utilizing a power management mode needs to be awake.
+ *
+ * IEEE 802.11ax standard defines two modes of TWT operation:
+ * - Individual TWT (default mode of operation if TWT requester is supported)
+ * - Broadcast TWT
*/
@VintfStability
parcelable TwtCapabilities {
@@ -40,17 +48,17 @@
/**
* Minimum TWT wake duration in microseconds.
*/
- int minWakeDurationMicros;
+ int minWakeDurationUs;
/**
* Maximum TWT wake duration in microseconds.
*/
- int maxWakeDurationMicros;
+ int maxWakeDurationUs;
/**
* Minimum TWT wake interval in microseconds.
*/
- int minWakeIntervalMicros;
+ long minWakeIntervalUs;
/**
* Maximum TWT wake interval in microseconds.
*/
- int maxWakeIntervalMicros;
+ long maxWakeIntervalUs;
}
diff --git a/wifi/aidl/android/hardware/wifi/TwtRequest.aidl b/wifi/aidl/android/hardware/wifi/TwtRequest.aidl
index 5191713..6964a39 100644
--- a/wifi/aidl/android/hardware/wifi/TwtRequest.aidl
+++ b/wifi/aidl/android/hardware/wifi/TwtRequest.aidl
@@ -28,17 +28,23 @@
/**
* Minimum TWT wake duration in microseconds.
*/
- int minWakeDurationMicros;
+ int minWakeDurationUs;
/**
* Maximum TWT wake duration in microseconds.
+ *
+ * As per IEEE 802.11ax spec, section 9.4.2.199 TWT element, the maximum wake duration is
+ * 65280 microseconds.
*/
- int maxWakeDurationMicros;
+ int maxWakeDurationUs;
/**
* Minimum TWT wake interval in microseconds.
*/
- int minWakeIntervalMicros;
+ long minWakeIntervalUs;
/**
* Maximum TWT wake interval in microseconds.
+ *
+ * As per IEEE 802.11ax spec, section 9.4.2.199 TWT element, the maximum wake interval is
+ * 65535 * 2^31 microseconds.
*/
- int maxWakeIntervalMicros;
+ long maxWakeIntervalUs;
}
diff --git a/wifi/aidl/android/hardware/wifi/TwtSession.aidl b/wifi/aidl/android/hardware/wifi/TwtSession.aidl
index 5a7ddb1..2d7e819 100644
--- a/wifi/aidl/android/hardware/wifi/TwtSession.aidl
+++ b/wifi/aidl/android/hardware/wifi/TwtSession.aidl
@@ -41,12 +41,12 @@
/**
* TWT service period in microseconds.
*/
- int wakeDurationMicros;
+ int wakeDurationUs;
/**
* Time interval in microseconds between two successive TWT service periods.
*/
- int wakeIntervalMicros;
+ long wakeIntervalUs;
/**
* TWT negotiation type.
diff --git a/wifi/aidl/android/hardware/wifi/TwtSessionStats.aidl b/wifi/aidl/android/hardware/wifi/TwtSessionStats.aidl
index e2e2d12..ba70426 100644
--- a/wifi/aidl/android/hardware/wifi/TwtSessionStats.aidl
+++ b/wifi/aidl/android/hardware/wifi/TwtSessionStats.aidl
@@ -44,7 +44,7 @@
/**
* Average End of Service period in microseconds.
*/
- int avgEospDurationMicros;
+ int avgEospDurationUs;
/**
* Count of early terminations.
diff --git a/wifi/aidl/default/aidl_struct_util.cpp b/wifi/aidl/default/aidl_struct_util.cpp
index b62b3a0..0f0c77e 100644
--- a/wifi/aidl/default/aidl_struct_util.cpp
+++ b/wifi/aidl/default/aidl_struct_util.cpp
@@ -2741,9 +2741,8 @@
if (!convertAidlRttConfigToLegacy(aidl_config, &(legacy_config->rtt_config))) {
return false;
}
- legacy_config->tx_ltf_repetition_count = aidl_config.txLtfRepetitionCount;
- legacy_config->ntb_min_measurement_time_millis = aidl_config.ntbMinMeasurementTimeMillis;
- legacy_config->ntb_max_measurement_time_millis = aidl_config.ntbMaxMeasurementTimeMillis;
+ legacy_config->ntb_min_measurement_time = aidl_config.ntbMinMeasurementTime;
+ legacy_config->ntb_max_measurement_time = aidl_config.ntbMaxMeasurementTime;
return true;
}
@@ -2887,11 +2886,10 @@
aidl_capabilities->bwSupport = convertLegacyRttBwBitmapToAidl(legacy_capabilities.bw_support);
aidl_capabilities->mcVersion = legacy_capabilities.mc_version;
// Initialize 11az parameters to default
- aidl_capabilities->azPreambleSupport = RttPreamble::INVALID;
- aidl_capabilities->azBwSupport = RttBw::BW_UNSPECIFIED;
+ aidl_capabilities->azPreambleSupport = (int)RttPreamble::INVALID;
+ aidl_capabilities->azBwSupport = (int)RttBw::BW_UNSPECIFIED;
aidl_capabilities->ntbInitiatorSupported = false;
aidl_capabilities->ntbResponderSupported = false;
- aidl_capabilities->maxTxLtfRepetitionCount = 0;
return true;
}
@@ -2914,12 +2912,11 @@
convertLegacyRttBwBitmapToAidl(legacy_capabilities_v3.rtt_capab.bw_support);
aidl_capabilities->mcVersion = legacy_capabilities_v3.rtt_capab.mc_version;
aidl_capabilities->azPreambleSupport =
- convertLegacyRttPreambleBitmapToAidl(legacy_capabilities_v3.az_preamble_support);
+ (int)convertLegacyRttPreambleBitmapToAidl(legacy_capabilities_v3.az_preamble_support);
aidl_capabilities->azBwSupport =
- convertLegacyRttBwBitmapToAidl(legacy_capabilities_v3.az_bw_support);
+ (int)convertLegacyRttBwBitmapToAidl(legacy_capabilities_v3.az_bw_support);
aidl_capabilities->ntbInitiatorSupported = legacy_capabilities_v3.ntb_initiator_supported;
aidl_capabilities->ntbResponderSupported = legacy_capabilities_v3.ntb_responder_supported;
- aidl_capabilities->maxTxLtfRepetitionCount = legacy_capabilities_v3.max_tx_ltf_repetition_count;
return true;
}
@@ -2994,9 +2991,12 @@
}
aidl_result.channelFreqMHz = 0;
aidl_result.packetBw = RttBw::BW_UNSPECIFIED;
- aidl_result.txLtfRepetitionCount = 0;
- aidl_result.ntbMinMeasurementTimeMillis = 0;
- aidl_result.ntbMaxMeasurementTimeMillis = 0;
+ aidl_result.i2rTxLtfRepetitionCount = 0;
+ aidl_result.r2iTxLtfRepetitionCount = 0;
+ aidl_result.ntbMinMeasurementTime = 0;
+ aidl_result.ntbMaxMeasurementTime = 0;
+ aidl_result.numTxSpatialStreams = 0;
+ aidl_result.numRxSpatialStreams = 0;
aidl_results->push_back(aidl_result);
}
return true;
@@ -3017,9 +3017,12 @@
aidl_result.channelFreqMHz =
legacy_result->frequency != UNSPECIFIED ? legacy_result->frequency : 0;
aidl_result.packetBw = convertLegacyRttBwToAidl(legacy_result->packet_bw);
- aidl_result.txLtfRepetitionCount = 0;
- aidl_result.ntbMinMeasurementTimeMillis = 0;
- aidl_result.ntbMaxMeasurementTimeMillis = 0;
+ aidl_result.i2rTxLtfRepetitionCount = 0;
+ aidl_result.r2iTxLtfRepetitionCount = 0;
+ aidl_result.ntbMinMeasurementTime = 0;
+ aidl_result.ntbMaxMeasurementTime = 0;
+ aidl_result.numTxSpatialStreams = 0;
+ aidl_result.numRxSpatialStreams = 0;
aidl_results->push_back(aidl_result);
}
return true;
@@ -3041,9 +3044,12 @@
? legacy_result->rtt_result.frequency
: 0;
aidl_result.packetBw = convertLegacyRttBwToAidl(legacy_result->rtt_result.packet_bw);
- aidl_result.txLtfRepetitionCount = legacy_result->tx_ltf_repetition_count;
- aidl_result.ntbMinMeasurementTimeMillis = legacy_result->ntb_min_measurement_time_millis;
- aidl_result.ntbMaxMeasurementTimeMillis = legacy_result->ntb_max_measurement_time_millis;
+ aidl_result.i2rTxLtfRepetitionCount = legacy_result->i2r_tx_ltf_repetition_count;
+ aidl_result.r2iTxLtfRepetitionCount = legacy_result->r2i_tx_ltf_repetition_count;
+ aidl_result.ntbMinMeasurementTime = legacy_result->ntb_min_measurement_time;
+ aidl_result.ntbMaxMeasurementTime = legacy_result->ntb_max_measurement_time;
+ aidl_result.numTxSpatialStreams = legacy_result->num_tx_sts;
+ aidl_result.numRxSpatialStreams = legacy_result->num_rx_sts;
aidl_results->push_back(aidl_result);
}
return true;
@@ -3587,13 +3593,13 @@
if (legacy_twt_capabs.min_wake_duration_micros > legacy_twt_capabs.max_wake_duration_micros) {
return false;
}
- aidl_twt_capabs->minWakeDurationMicros = legacy_twt_capabs.min_wake_duration_micros;
- aidl_twt_capabs->maxWakeDurationMicros = legacy_twt_capabs.max_wake_duration_micros;
+ aidl_twt_capabs->minWakeDurationUs = legacy_twt_capabs.min_wake_duration_micros;
+ aidl_twt_capabs->maxWakeDurationUs = legacy_twt_capabs.max_wake_duration_micros;
if (legacy_twt_capabs.min_wake_interval_micros > legacy_twt_capabs.max_wake_interval_micros) {
return false;
}
- aidl_twt_capabs->minWakeIntervalMicros = legacy_twt_capabs.min_wake_interval_micros;
- aidl_twt_capabs->maxWakeIntervalMicros = legacy_twt_capabs.max_wake_interval_micros;
+ aidl_twt_capabs->minWakeIntervalUs = legacy_twt_capabs.min_wake_interval_micros;
+ aidl_twt_capabs->maxWakeIntervalUs = legacy_twt_capabs.max_wake_interval_micros;
return true;
}
@@ -3603,16 +3609,16 @@
return false;
}
legacy_twt_request->mlo_link_id = aidl_twt_request.mloLinkId;
- if (aidl_twt_request.minWakeDurationMicros > aidl_twt_request.maxWakeDurationMicros) {
+ if (aidl_twt_request.minWakeDurationUs > aidl_twt_request.maxWakeDurationUs) {
return false;
}
- legacy_twt_request->min_wake_duration_micros = aidl_twt_request.minWakeDurationMicros;
- legacy_twt_request->max_wake_duration_micros = aidl_twt_request.maxWakeDurationMicros;
- if (aidl_twt_request.minWakeIntervalMicros > aidl_twt_request.maxWakeIntervalMicros) {
+ legacy_twt_request->min_wake_duration_micros = aidl_twt_request.minWakeDurationUs;
+ legacy_twt_request->max_wake_duration_micros = aidl_twt_request.maxWakeDurationUs;
+ if (aidl_twt_request.minWakeIntervalUs > aidl_twt_request.maxWakeIntervalUs) {
return false;
}
- legacy_twt_request->min_wake_interval_micros = aidl_twt_request.minWakeIntervalMicros;
- legacy_twt_request->max_wake_interval_micros = aidl_twt_request.maxWakeIntervalMicros;
+ legacy_twt_request->min_wake_interval_micros = aidl_twt_request.minWakeIntervalUs;
+ legacy_twt_request->max_wake_interval_micros = aidl_twt_request.maxWakeIntervalUs;
return true;
}
@@ -3664,8 +3670,8 @@
aidl_twt_session->sessionId = twt_session.session_id;
aidl_twt_session->mloLinkId = twt_session.mlo_link_id;
- aidl_twt_session->wakeDurationMicros = twt_session.wake_duration_micros;
- aidl_twt_session->wakeIntervalMicros = twt_session.wake_interval_micros;
+ aidl_twt_session->wakeDurationUs = twt_session.wake_duration_micros;
+ aidl_twt_session->wakeIntervalUs = twt_session.wake_interval_micros;
switch (twt_session.negotiation_type) {
case WIFI_TWT_NEGO_TYPE_INDIVIDUAL:
aidl_twt_session->negotiationType = TwtSession::TwtNegotiationType::INDIVIDUAL;
@@ -3696,7 +3702,7 @@
aidl_twt_stats->avgRxPktCount = twt_stats.avg_pkt_num_rx;
aidl_twt_stats->avgTxPktSize = twt_stats.avg_tx_pkt_size;
aidl_twt_stats->avgRxPktSize = twt_stats.avg_rx_pkt_size;
- aidl_twt_stats->avgEospDurationMicros = twt_stats.avg_eosp_dur_us;
+ aidl_twt_stats->avgEospDurationUs = twt_stats.avg_eosp_dur_us;
aidl_twt_stats->eospCount = twt_stats.eosp_count;
return true;
diff --git a/wifi/hostapd/aidl/Android.bp b/wifi/hostapd/aidl/Android.bp
index 1daa9bb..94bf9e2 100644
--- a/wifi/hostapd/aidl/Android.bp
+++ b/wifi/hostapd/aidl/Android.bp
@@ -40,6 +40,9 @@
"com.android.wifi",
],
min_sdk_version: "30",
+ lint: {
+ baseline_filename: "lint-baseline.xml",
+ },
},
ndk: {
gen_trace: true,
diff --git a/wifi/hostapd/aidl/lint-baseline.xml b/wifi/hostapd/aidl/lint-baseline.xml
index 657622e..4329e12 100644
--- a/wifi/hostapd/aidl/lint-baseline.xml
+++ b/wifi/hostapd/aidl/lint-baseline.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
-<issues format="6" by="lint 8.0.0-dev" type="baseline" dependencies="true" variant="all" version="8.0.0-dev">
+<issues format="6" by="lint 8.4.0-alpha01" type="baseline" client="" dependencies="true" name="" variant="all" version="8.4.0-alpha01">
<issue
id="NewApi"
@@ -7,8 +7,8 @@
errorLine1=" this.markVintfStability();"
errorLine2=" ~~~~~~~~~~~~~~~~~~">
<location
- file="out/.intermediates/hardware/interfaces/wifi/hostapd/aidl/android.hardware.wifi.hostapd-V1-java-source/gen/android/hardware/wifi/hostapd/IHostapd.java"
- line="55"
+ file="out/soong/.intermediates/hardware/interfaces/wifi/hostapd/aidl/android.hardware.wifi.hostapd-V1-java-source/gen/android/hardware/wifi/hostapd/IHostapd.java"
+ line="57"
column="12"/>
</issue>
@@ -18,8 +18,8 @@
errorLine1=" this.markVintfStability();"
errorLine2=" ~~~~~~~~~~~~~~~~~~">
<location
- file="out/.intermediates/hardware/interfaces/wifi/hostapd/aidl/android.hardware.wifi.hostapd-V1-java-source/gen/android/hardware/wifi/hostapd/IHostapdCallback.java"
- line="46"
+ file="out/soong/.intermediates/hardware/interfaces/wifi/hostapd/aidl/android.hardware.wifi.hostapd-V1-java-source/gen/android/hardware/wifi/hostapd/IHostapdCallback.java"
+ line="48"
column="12"/>
</issue>
@@ -29,8 +29,8 @@
errorLine1=" this.markVintfStability();"
errorLine2=" ~~~~~~~~~~~~~~~~~~">
<location
- file="out/.intermediates/hardware/interfaces/wifi/hostapd/aidl/android.hardware.wifi.hostapd-V2-java-source/gen/android/hardware/wifi/hostapd/IHostapd.java"
- line="117"
+ file="out/soong/.intermediates/hardware/interfaces/wifi/hostapd/aidl/android.hardware.wifi.hostapd-V2-java-source/gen/android/hardware/wifi/hostapd/IHostapd.java"
+ line="119"
column="12"/>
</issue>
@@ -40,9 +40,27 @@
errorLine1=" this.markVintfStability();"
errorLine2=" ~~~~~~~~~~~~~~~~~~">
<location
- file="out/.intermediates/hardware/interfaces/wifi/hostapd/aidl/android.hardware.wifi.hostapd-V2-java-source/gen/android/hardware/wifi/hostapd/IHostapdCallback.java"
- line="62"
+ file="out/soong/.intermediates/hardware/interfaces/wifi/hostapd/aidl/android.hardware.wifi.hostapd-V2-java-source/gen/android/hardware/wifi/hostapd/IHostapdCallback.java"
+ line="64"
column="12"/>
</issue>
+ <issue
+ id="NewApi"
+ message="Call requires API level 31 (current min is 30): `android.os.Binder#markVintfStability`"
+ errorLine1=" this.markVintfStability();"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~">
+ <location
+ file="out/soong/.intermediates/hardware/interfaces/wifi/hostapd/aidl/android.hardware.wifi.hostapd-V3-java-source/gen/android/hardware/wifi/hostapd/IHostapd.java"/>
+ </issue>
+
+ <issue
+ id="NewApi"
+ message="Call requires API level 31 (current min is 30): `android.os.Binder#markVintfStability`"
+ errorLine1=" this.markVintfStability();"
+ errorLine2=" ~~~~~~~~~~~~~~~~~~">
+ <location
+ file="out/soong/.intermediates/hardware/interfaces/wifi/hostapd/aidl/android.hardware.wifi.hostapd-V3-java-source/gen/android/hardware/wifi/hostapd/IHostapdCallback.java"/>
+ </issue>
+
</issues>
\ No newline at end of file
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
index 0729646..0b068e0 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
@@ -35,13 +35,22 @@
@VintfStability
interface ISupplicantP2pIface {
void addBonjourService(in byte[] query, in byte[] response);
+ /**
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use createGroupOwner.
+ */
void addGroup(in boolean persistent, in int persistentNetworkId);
+ /**
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use addGroupWithConfigurationParams.
+ */
void addGroupWithConfig(in byte[] ssid, in String pskPassphrase, in boolean persistent, in int freq, in byte[] peerAddress, in boolean joinExistingGroup);
@PropagateAllowBlocking android.hardware.wifi.supplicant.ISupplicantP2pNetwork addNetwork();
void addUpnpService(in int version, in String serviceName);
void cancelConnect();
void cancelServiceDiscovery(in long identifier);
void cancelWps(in String groupIfName);
+ /**
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use configureExtListenWithParams.
+ */
void configureExtListen(in int periodInMillis, in int intervalInMillis);
/**
* @deprecated This method is deprecated from AIDL v3, newer HALs should use connectWithParams.
@@ -111,4 +120,7 @@
void configureEapolIpAddressAllocationParams(in int ipAddressGo, in int ipAddressMask, in int ipAddressStart, in int ipAddressEnd);
String connectWithParams(in android.hardware.wifi.supplicant.P2pConnectInfo connectInfo);
void findWithParams(in android.hardware.wifi.supplicant.P2pDiscoveryInfo discoveryInfo);
+ void configureExtListenWithParams(in android.hardware.wifi.supplicant.P2pExtListenInfo extListenInfo);
+ void addGroupWithConfigurationParams(in android.hardware.wifi.supplicant.P2pAddGroupConfigurationParams groupConfigurationParams);
+ void createGroupOwner(in android.hardware.wifi.supplicant.P2pCreateGroupOwnerInfo groupOwnerInfo);
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
index 851e851..65ad4c1 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
@@ -35,17 +35,23 @@
@VintfStability
interface ISupplicantP2pIfaceCallback {
/**
- * @deprecated This callback is deprecated from AIDL v2, newer HAL should call onDeviceFoundWithParams.
+ * @deprecated This callback is deprecated from AIDL v3, newer HAL should call onDeviceFoundWithParams.
*/
oneway void onDeviceFound(in byte[] srcAddress, in byte[] p2pDeviceAddress, in byte[] primaryDeviceType, in String deviceName, in android.hardware.wifi.supplicant.WpsConfigMethods configMethods, in byte deviceCapabilities, in android.hardware.wifi.supplicant.P2pGroupCapabilityMask groupCapabilities, in byte[] wfdDeviceInfo);
oneway void onDeviceLost(in byte[] p2pDeviceAddress);
oneway void onFindStopped();
oneway void onGoNegotiationCompleted(in android.hardware.wifi.supplicant.P2pStatusCode status);
+ /**
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use onGoNegotiationRequestWithParams.
+ */
oneway void onGoNegotiationRequest(in byte[] srcAddress, in android.hardware.wifi.supplicant.WpsDevPasswordId passwordId);
oneway void onGroupFormationFailure(in String failureReason);
oneway void onGroupFormationSuccess();
oneway void onGroupRemoved(in String groupIfname, in boolean isGroupOwner);
oneway void onGroupStarted(in String groupIfname, in boolean isGroupOwner, in byte[] ssid, in int frequency, in byte[] psk, in String passphrase, in byte[] goDeviceAddress, in boolean isPersistent);
+ /**
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use onInvitationReceivedWithParams.
+ */
oneway void onInvitationReceived(in byte[] srcAddress, in byte[] goDeviceAddress, in byte[] bssid, in int persistentNetworkId, in int operatingFrequency);
oneway void onInvitationResult(in byte[] bssid, in android.hardware.wifi.supplicant.P2pStatusCode status);
/**
@@ -72,4 +78,6 @@
oneway void onPeerClientDisconnected(in android.hardware.wifi.supplicant.P2pPeerClientDisconnectedEventParams clientDisconnectedEventParams);
oneway void onProvisionDiscoveryCompletedEvent(in android.hardware.wifi.supplicant.P2pProvisionDiscoveryCompletedEventParams provisionDiscoveryCompletedEventParams);
oneway void onDeviceFoundWithParams(in android.hardware.wifi.supplicant.P2pDeviceFoundEventParams deviceFoundEventParams);
+ oneway void onGoNegotiationRequestWithParams(in android.hardware.wifi.supplicant.P2pGoNegotiationReqEventParams params);
+ oneway void onInvitationReceivedWithParams(in android.hardware.wifi.supplicant.P2pInvitationEventParams params);
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
index 898c2d4..9fa8f56 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
@@ -54,7 +54,7 @@
oneway void onExtRadioWorkTimeout(in int id);
oneway void onHs20DeauthImminentNotice(in byte[] bssid, in int reasonCode, in int reAuthDelayInSec, in String url);
/**
- * @deprecated No longer in use.
+ * @deprecated This callback is deprecated from AIDL v3.
*/
oneway void onHs20IconQueryDone(in byte[] bssid, in String fileName, in byte[] data);
oneway void onHs20SubscriptionRemediation(in byte[] bssid, in android.hardware.wifi.supplicant.OsuMethod osuMethod, in String url);
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/KeyMgmtMask.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
index 35d51bc..06c22cb 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
@@ -51,4 +51,5 @@
WAPI_CERT = (1 << 13) /* 8192 */,
FILS_SHA256 = (1 << 18) /* 262144 */,
FILS_SHA384 = (1 << 19) /* 524288 */,
+ PASN = (1 << 25) /* 33554432 */,
}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pAddGroupConfigurationParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pAddGroupConfigurationParams.aidl
new file mode 100644
index 0000000..ff73f84
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pAddGroupConfigurationParams.aidl
@@ -0,0 +1,45 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable P2pAddGroupConfigurationParams {
+ byte[] ssid;
+ String passphrase;
+ boolean isPersistent;
+ int frequencyMHzOrBand;
+ byte[6] goInterfaceAddress;
+ boolean joinExistingGroup;
+ int keyMgmtMask;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pCreateGroupOwnerInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pCreateGroupOwnerInfo.aidl
new file mode 100644
index 0000000..4451fb5
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pCreateGroupOwnerInfo.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable P2pCreateGroupOwnerInfo {
+ boolean persistent;
+ int persistentNetworkId;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pExtListenInfo.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pExtListenInfo.aidl
new file mode 100644
index 0000000..b4d8e9d
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pExtListenInfo.aidl
@@ -0,0 +1,40 @@
+/**
+ * Copyright (C) 2023 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable P2pExtListenInfo {
+ int periodMs;
+ int intervalMs;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGoNegotiationReqEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGoNegotiationReqEventParams.aidl
new file mode 100644
index 0000000..ba10b3e
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pGoNegotiationReqEventParams.aidl
@@ -0,0 +1,40 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable P2pGoNegotiationReqEventParams {
+ byte[6] srcAddress;
+ android.hardware.wifi.supplicant.WpsDevPasswordId passwordId;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pInvitationEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pInvitationEventParams.aidl
new file mode 100644
index 0000000..541ee4f
--- /dev/null
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pInvitationEventParams.aidl
@@ -0,0 +1,43 @@
+/*
+ * Copyright (C) 2024 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.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.wifi.supplicant;
+@VintfStability
+parcelable P2pInvitationEventParams {
+ byte[6] srcAddress;
+ byte[6] goDeviceAddress;
+ byte[6] bssid;
+ int persistentNetworkId;
+ int operatingFrequencyMHz;
+ @nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl
index 0ff0653..46366cc 100644
--- a/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl
+++ b/wifi/supplicant/aidl/aidl_api/android.hardware.wifi.supplicant/current/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl
@@ -37,7 +37,7 @@
byte[6] p2pDeviceAddress;
boolean isRequest;
android.hardware.wifi.supplicant.P2pProvDiscStatusCode status;
- android.hardware.wifi.supplicant.WpsConfigMethods configMethods;
+ int configMethods;
String generatedPin;
String groupInterfaceName;
@nullable android.hardware.wifi.common.OuiKeyedData[] vendorData;
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
index 983ed15..1230793 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIface.aidl
@@ -22,8 +22,11 @@
import android.hardware.wifi.supplicant.ISupplicantP2pNetwork;
import android.hardware.wifi.supplicant.IfaceType;
import android.hardware.wifi.supplicant.MiracastMode;
+import android.hardware.wifi.supplicant.P2pAddGroupConfigurationParams;
import android.hardware.wifi.supplicant.P2pConnectInfo;
+import android.hardware.wifi.supplicant.P2pCreateGroupOwnerInfo;
import android.hardware.wifi.supplicant.P2pDiscoveryInfo;
+import android.hardware.wifi.supplicant.P2pExtListenInfo;
import android.hardware.wifi.supplicant.P2pFrameTypeMask;
import android.hardware.wifi.supplicant.P2pGroupCapabilityMask;
import android.hardware.wifi.supplicant.WpsConfigMethods;
@@ -51,6 +54,9 @@
* negotiation with a specific peer). This is also known as autonomous
* group owner. Optional |persistentNetworkId| may be used to specify
* restart of a persistent group.
+ * <p>
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use
+ * createGroupOwner.
*
* @param persistent Used to request a persistent group to be formed.
* @param persistentNetworkId Used to specify the restart of a persistent
@@ -73,6 +79,9 @@
* whose network name and group owner's MAC address matches the specified SSID
* and peer address without WPS process. If peerAddress is 00:00:00:00:00:00, the first found
* group whose network name matches the specified SSID is joined.
+ * <p>
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use
+ * addGroupWithConfigurationParams.
*
* @param ssid The SSID of this group.
* @param pskPassphrase The passphrase of this group.
@@ -165,6 +174,9 @@
* (with interval obviously having to be larger than or equal to duration).
* If the P2P module is not idle at the time the Extended Listen Timing
* timeout occurs, the Listen State operation must be skipped.
+ * <p>
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use
+ * configureExtListenWithParams.
*
* @param periodInMillis Period in milliseconds.
* @param intervalInMillis Interval in milliseconds.
@@ -882,4 +894,48 @@
* |SupplicantStatusCode.FAILURE_IFACE_DISABLED|
*/
void findWithParams(in P2pDiscoveryInfo discoveryInfo);
+
+ /**
+ * Configure Extended Listen Timing.
+ *
+ * If enabled, listen state must be entered every |intervalMs| for at
+ * least |periodMs|. Both values have acceptable range of 1-65535
+ * (note that the interval must be larger than or equal to the duration).
+ * If the P2P module is not idle at the time the Extended Listen Timing
+ * timeout occurs, the Listen State operation must be skipped.
+ *
+ * @param extListenInfo Parameters to configure extended listening timing.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_ARGS_INVALID|,
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void configureExtListenWithParams(in P2pExtListenInfo extListenInfo);
+
+ /**
+ * Set up a P2P group owner or join a group as a group client with the
+ * specified configuration. The group configurations required to establish
+ * a connection(SSID, password, channel, etc) are shared out of band.
+ * So the connection process doesn't require a P2P provision discovery or
+ * invitation message exchange.
+ *
+ * @param groupConfigurationParams Parameters associated with this add group operation.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void addGroupWithConfigurationParams(
+ in P2pAddGroupConfigurationParams groupConfigurationParams);
+
+ /**
+ * Set up a P2P group owner on this device. This is also known as autonomous
+ * group owner. The connection process requires P2P provision discovery
+ * message or invitation message exchange.
+ *
+ * @param groupOwnerInfo Parameters associated with this create group owner operation.
+ * @throws ServiceSpecificException with one of the following values:
+ * |SupplicantStatusCode.FAILURE_UNKNOWN|,
+ * |SupplicantStatusCode.FAILURE_IFACE_INVALID|
+ */
+ void createGroupOwner(in P2pCreateGroupOwnerInfo groupOwnerInfo);
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
index 11cd867..44a5465 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantP2pIfaceCallback.aidl
@@ -17,8 +17,10 @@
package android.hardware.wifi.supplicant;
import android.hardware.wifi.supplicant.P2pDeviceFoundEventParams;
+import android.hardware.wifi.supplicant.P2pGoNegotiationReqEventParams;
import android.hardware.wifi.supplicant.P2pGroupCapabilityMask;
import android.hardware.wifi.supplicant.P2pGroupStartedEventParams;
+import android.hardware.wifi.supplicant.P2pInvitationEventParams;
import android.hardware.wifi.supplicant.P2pPeerClientDisconnectedEventParams;
import android.hardware.wifi.supplicant.P2pPeerClientJoinedEventParams;
import android.hardware.wifi.supplicant.P2pProvDiscStatusCode;
@@ -40,7 +42,7 @@
/**
* Used to indicate that a P2P device has been found.
* <p>
- * @deprecated This callback is deprecated from AIDL v2, newer HAL should call
+ * @deprecated This callback is deprecated from AIDL v3, newer HAL should call
* onDeviceFoundWithParams.
*
* @param srcAddress MAC address of the device found. This must either
@@ -88,6 +90,10 @@
* @param srcAddress MAC address of the device that initiated the GO
* negotiation request.
* @param passwordId Type of password.
+ *
+ * <p>
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use
+ * onGoNegotiationRequestWithParams.
*/
void onGoNegotiationRequest(in byte[] srcAddress, in WpsDevPasswordId passwordId);
@@ -135,6 +141,9 @@
* @param bssid Bssid of the group.
* @param persistentNetworkId Persistent network Id of the group.
* @param operatingFrequency Frequency on which the invitation was received.
+ * <p>
+ * @deprecated This method is deprecated from AIDL v3, newer HALs should use
+ * onInvitationReceivedWithParams.
*/
void onInvitationReceived(in byte[] srcAddress, in byte[] goDeviceAddress, in byte[] bssid,
in int persistentNetworkId, in int operatingFrequency);
@@ -302,4 +311,18 @@
* @param deviceFoundEventParams Parameters associated with the device found event.
*/
void onDeviceFoundWithParams(in P2pDeviceFoundEventParams deviceFoundEventParams);
+
+ /**
+ * Used to indicate the reception of a P2P Group Owner negotiation request.
+ *
+ * @param params Parameters associated with the GO negotiation request event.
+ */
+ void onGoNegotiationRequestWithParams(in P2pGoNegotiationReqEventParams params);
+
+ /**
+ * Used to indicate the reception of a P2P invitation.
+ *
+ * @param params Parameters associated with the invitation request event.
+ */
+ void onInvitationReceivedWithParams(in P2pInvitationEventParams params);
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
index 58893eb..172fcda 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/ISupplicantStaIfaceCallback.aidl
@@ -198,7 +198,7 @@
/**
* Used to indicate the result of Hotspot 2.0 Icon query.
*
- * @deprecated No longer in use.
+ * @deprecated This callback is deprecated from AIDL v3.
*
* @param bssid BSSID of the access point.
* @param fileName Name of the file that was requested.
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/KeyMgmtMask.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
index f0c3345..8758645 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/KeyMgmtMask.aidl
@@ -71,4 +71,8 @@
* FILS shared key authentication with sha-384
*/
FILS_SHA384 = 1 << 19,
+ /**
+ * Pre-Association Security Negotiation (PASN) Key management
+ */
+ PASN = 1 << 25,
}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pAddGroupConfigurationParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pAddGroupConfigurationParams.aidl
new file mode 100644
index 0000000..15f2733
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pAddGroupConfigurationParams.aidl
@@ -0,0 +1,75 @@
+/*
+ * Copyright (C) 2024 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.wifi.supplicant;
+
+import android.hardware.wifi.common.OuiKeyedData;
+import android.hardware.wifi.supplicant.KeyMgmtMask;
+
+/**
+ * Request parameters used for |ISupplicantP2pIface.addGroupWithConfigurationParams|
+ */
+@VintfStability
+parcelable P2pAddGroupConfigurationParams {
+ /** The SSID of the group. */
+ byte[] ssid;
+
+ /** The passphrase used to secure the group. */
+ String passphrase;
+
+ /** Whether this group is persisted. Only applied on the group owner side */
+ boolean isPersistent;
+
+ /**
+ * The required frequency or band of the group.
+ * Only applied on the group owner side.
+ * The following values are supported:
+ * 0: automatic channel selection,
+ * 2: for 2.4GHz channels
+ * 5: for 5GHz channels
+ * 6: for 6GHz channels
+ * specific frequency in MHz, i.e., 2412, 5500, etc.
+ * If an invalid band or unsupported frequency are specified,
+ * |ISupplicantP2pIface.addGroupWithConfigurationParams| fails
+ */
+ int frequencyMHzOrBand;
+
+ /**
+ * The MAC Address of the P2P interface of the Peer GO device.
+ * This field is valid only for the group client side.
+ * If the MAC is "00:00:00:00:00:00", the device must try to find a peer GO device
+ * whose network name matches the specified SSID.
+ */
+ byte[6] goInterfaceAddress;
+
+ /*
+ * True if join a group as a group client; false to create a group as a group owner
+ */
+ boolean joinExistingGroup;
+
+ /**
+ * The authentication Key management mask for the connection. Combination of |KeyMgmtMask|
+ * values. The supported authentication key management types are WPA_PSK, SAE and PASN.
+ *
+ */
+ int keyMgmtMask;
+
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pCreateGroupOwnerInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pCreateGroupOwnerInfo.aidl
new file mode 100644
index 0000000..51e6ed9
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pCreateGroupOwnerInfo.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2024 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.wifi.supplicant;
+
+import android.hardware.wifi.common.OuiKeyedData;
+
+/**
+ * Parameters used for |ISupplicantP2pIface.createGroupOwner|
+ */
+@VintfStability
+parcelable P2pCreateGroupOwnerInfo {
+ /**
+ * Used to request a persistent group to be formed.
+ */
+ boolean persistent;
+
+ /**
+ * Optional parameter. Used to specify the restart of a persistent
+ * group. Set to UINT32_MAX for a non-persistent group.
+ */
+ int persistentNetworkId;
+
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pExtListenInfo.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pExtListenInfo.aidl
new file mode 100644
index 0000000..1086c94
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pExtListenInfo.aidl
@@ -0,0 +1,39 @@
+/**
+ * Copyright (C) 2023 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.wifi.supplicant;
+
+import android.hardware.wifi.common.OuiKeyedData;
+
+/**
+ * Parameters used to configure the P2P Extended Listen Interval.
+ */
+@VintfStability
+parcelable P2pExtListenInfo {
+ /**
+ * Period in milliseconds.
+ */
+ int periodMs;
+ /**
+ * Interval in milliseconds.
+ */
+ int intervalMs;
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGoNegotiationReqEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGoNegotiationReqEventParams.aidl
new file mode 100644
index 0000000..3480734
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pGoNegotiationReqEventParams.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2024 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.wifi.supplicant;
+
+import android.hardware.wifi.common.OuiKeyedData;
+import android.hardware.wifi.supplicant.WpsDevPasswordId;
+
+/**
+ * Parameters used for |ISupplicantP2pIfaceCallback.onGoNegotiationRequestWithParams|
+ */
+@VintfStability
+parcelable P2pGoNegotiationReqEventParams {
+ /**
+ * MAC address of the device that sent the Go negotiation request.
+ */
+ byte[6] srcAddress;
+
+ /**
+ * Type of password.
+ */
+ WpsDevPasswordId passwordId;
+
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pInvitationEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pInvitationEventParams.aidl
new file mode 100644
index 0000000..4295c40
--- /dev/null
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pInvitationEventParams.aidl
@@ -0,0 +1,56 @@
+/*
+ * Copyright (C) 2024 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.wifi.supplicant;
+
+import android.hardware.wifi.common.OuiKeyedData;
+
+/**
+ * Parameters used for |ISupplicantP2pIfaceCallback.onInvitationReceivedWithParams|
+ */
+@VintfStability
+parcelable P2pInvitationEventParams {
+ /**
+ * MAC address of the device that sent the invitation.
+ */
+ byte[6] srcAddress;
+
+ /**
+ * P2P device MAC Address of the group owner.
+ */
+ byte[6] goDeviceAddress;
+
+ /**
+ * BSSID of the group.
+ */
+ byte[6] bssid;
+
+ /**
+ * Persistent network ID of the group.
+ */
+ int persistentNetworkId;
+
+ /**
+ * Frequency on which the invitation was received.
+ */
+ int operatingFrequencyMHz;
+
+ /**
+ * Optional vendor-specific parameters. Null value indicates
+ * that no vendor data is provided.
+ */
+ @nullable OuiKeyedData[] vendorData;
+}
diff --git a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl
index b559216..05152a9 100644
--- a/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl
+++ b/wifi/supplicant/aidl/android/hardware/wifi/supplicant/P2pProvisionDiscoveryCompletedEventParams.aidl
@@ -18,7 +18,6 @@
import android.hardware.wifi.common.OuiKeyedData;
import android.hardware.wifi.supplicant.P2pProvDiscStatusCode;
-import android.hardware.wifi.supplicant.WpsConfigMethods;
/**
* Parameters passed as a part of P2P provision discovery frame notification.
@@ -34,8 +33,8 @@
boolean isRequest;
/** Status of the provision discovery */
P2pProvDiscStatusCode status;
- /** Mask of WPS configuration methods supported */
- WpsConfigMethods configMethods;
+ /** Mask of |WpsConfigMethods| indicating the supported methods */
+ int configMethods;
/** 8-digit pin generated */
String generatedPin;
/**
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
index 3f96414..82e3128 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_p2p_iface_aidl_test.cpp
@@ -35,14 +35,22 @@
using aidl::android::hardware::wifi::supplicant::ISupplicant;
using aidl::android::hardware::wifi::supplicant::ISupplicantP2pIface;
using aidl::android::hardware::wifi::supplicant::MiracastMode;
+using aidl::android::hardware::wifi::supplicant::P2pAddGroupConfigurationParams;
+using aidl::android::hardware::wifi::supplicant::P2pConnectInfo;
+using aidl::android::hardware::wifi::supplicant::P2pCreateGroupOwnerInfo;
using aidl::android::hardware::wifi::supplicant::P2pDeviceFoundEventParams;
+using aidl::android::hardware::wifi::supplicant::P2pDiscoveryInfo;
+using aidl::android::hardware::wifi::supplicant::P2pExtListenInfo;
using aidl::android::hardware::wifi::supplicant::P2pFrameTypeMask;
+using aidl::android::hardware::wifi::supplicant::P2pGoNegotiationReqEventParams;
using aidl::android::hardware::wifi::supplicant::P2pGroupCapabilityMask;
using aidl::android::hardware::wifi::supplicant::P2pGroupStartedEventParams;
+using aidl::android::hardware::wifi::supplicant::P2pInvitationEventParams;
using aidl::android::hardware::wifi::supplicant::P2pPeerClientDisconnectedEventParams;
using aidl::android::hardware::wifi::supplicant::P2pPeerClientJoinedEventParams;
using aidl::android::hardware::wifi::supplicant::P2pProvDiscStatusCode;
using aidl::android::hardware::wifi::supplicant::P2pProvisionDiscoveryCompletedEventParams;
+using aidl::android::hardware::wifi::supplicant::P2pScanType;
using aidl::android::hardware::wifi::supplicant::P2pStatusCode;
using aidl::android::hardware::wifi::supplicant::SupplicantStatusCode;
using aidl::android::hardware::wifi::supplicant::WpsConfigMethods;
@@ -67,6 +75,7 @@
const uint32_t kTestGroupFreq = 0;
const bool kTestGroupPersistent = false;
const bool kTestGroupIsJoin = false;
+const auto& kTestVendorDataOptional = generateOuiKeyedDataListOptional(5);
} // namespace
@@ -204,6 +213,14 @@
const P2pDeviceFoundEventParams& /* deviceFoundEventParams */) override {
return ndk::ScopedAStatus::ok();
}
+ ::ndk::ScopedAStatus onGoNegotiationRequestWithParams(
+ const P2pGoNegotiationReqEventParams& /* goNegotiationReqEventParams */) override {
+ return ndk::ScopedAStatus::ok();
+ }
+ ::ndk::ScopedAStatus onInvitationReceivedWithParams(
+ const P2pInvitationEventParams& /* invitationEventParams */) override {
+ return ndk::ScopedAStatus::ok();
+ }
};
class SupplicantP2pIfaceAidlTest : public testing::TestWithParam<std::string> {
@@ -212,6 +229,7 @@
initializeService();
supplicant_ = getSupplicant(GetParam().c_str());
ASSERT_NE(supplicant_, nullptr);
+ ASSERT_TRUE(supplicant_->getInterfaceVersion(&interface_version_).isOk());
ASSERT_TRUE(supplicant_
->setDebugParams(DebugLevel::EXCESSIVE,
true, // show timestamps
@@ -237,6 +255,7 @@
protected:
std::shared_ptr<ISupplicant> supplicant_;
std::shared_ptr<ISupplicantP2pIface> p2p_iface_;
+ int interface_version_;
};
/*
@@ -519,6 +538,43 @@
}
/*
+ * CreateGroupOwner
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, CreateGroupOwner) {
+ if (interface_version_ < 3) {
+ GTEST_SKIP() << "createGroupOwner is available as of Supplicant V3";
+ }
+
+ P2pCreateGroupOwnerInfo info;
+ info.persistent = false;
+ info.persistentNetworkId = kTestNetworkId;
+ info.vendorData = kTestVendorDataOptional;
+
+ EXPECT_TRUE(p2p_iface_->createGroupOwner(info).isOk());
+}
+
+/*
+ * AddGroupWithConfigurationParams
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, AddGroupWithConfigurationParams) {
+ if (interface_version_ < 3) {
+ GTEST_SKIP() << "addGroupWithConfigurationParams is available as of Supplicant V3";
+ }
+
+ P2pAddGroupConfigurationParams params;
+ params.ssid = kTestSsid;
+ params.passphrase = kTestPassphrase;
+ params.isPersistent = kTestGroupPersistent;
+ params.frequencyMHzOrBand = kTestGroupFreq;
+ params.goInterfaceAddress = vecToArrayMacAddr(kTestZeroMacAddr);
+ params.joinExistingGroup = kTestGroupIsJoin;
+ params.keyMgmtMask = 0;
+ params.vendorData = kTestVendorDataOptional;
+
+ EXPECT_TRUE(p2p_iface_->addGroupWithConfigurationParams(params).isOk());
+}
+
+/*
* Find
*/
TEST_P(SupplicantP2pIfaceAidlTest, Find) {
@@ -540,6 +596,34 @@
}
/*
+ * FindWithParams
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, FindWithParams) {
+ if (interface_version_ < 3) {
+ GTEST_SKIP() << "findWithParams is available as of Supplicant V3";
+ }
+
+ P2pDiscoveryInfo discoveryParams;
+ discoveryParams.timeoutInSec = kTestFindTimeout;
+ discoveryParams.vendorData = kTestVendorDataOptional;
+
+ discoveryParams.scanType = P2pScanType::FULL;
+ EXPECT_TRUE(p2p_iface_->findWithParams(discoveryParams).isOk());
+ EXPECT_TRUE(p2p_iface_->stopFind().isOk());
+ sleep(1);
+
+ discoveryParams.scanType = P2pScanType::SOCIAL;
+ EXPECT_TRUE(p2p_iface_->findWithParams(discoveryParams).isOk());
+ EXPECT_TRUE(p2p_iface_->stopFind().isOk());
+ sleep(1);
+
+ discoveryParams.scanType = P2pScanType::SPECIFIC_FREQ;
+ discoveryParams.frequencyMhz = 2412;
+ EXPECT_TRUE(p2p_iface_->findWithParams(discoveryParams).isOk());
+ EXPECT_TRUE(p2p_iface_->stopFind().isOk());
+}
+
+/*
* StopFind
*/
TEST_P(SupplicantP2pIfaceAidlTest, StopFind) {
@@ -566,6 +650,27 @@
}
/*
+ * ConnectWithParams
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, ConnectWithParams) {
+ if (interface_version_ < 3) {
+ GTEST_SKIP() << "connectWithParams is available as of Supplicant V3";
+ }
+
+ P2pConnectInfo connectInfo;
+ connectInfo.peerAddress = vecToArrayMacAddr(kTestMacAddr);
+ connectInfo.provisionMethod = WpsProvisionMethod::PBC;
+ connectInfo.preSelectedPin = kTestConnectPin;
+ connectInfo.joinExistingGroup = true;
+ connectInfo.persistent = false;
+ connectInfo.goIntent = kTestConnectGoIntent;
+ connectInfo.vendorData = kTestVendorDataOptional;
+
+ std::string pin;
+ EXPECT_TRUE(p2p_iface_->connectWithParams(connectInfo, &pin).isOk());
+}
+
+/*
* CancelConnect
*/
TEST_P(SupplicantP2pIfaceAidlTest, CancelConnect) {
@@ -625,6 +730,22 @@
}
/*
+ * ConfigureExtListenWithParams
+ */
+TEST_P(SupplicantP2pIfaceAidlTest, ConfigureExtListenWithParams) {
+ if (interface_version_ < 3) {
+ GTEST_SKIP() << "configureExtListenWithParams is available as of Supplicant V3";
+ }
+
+ P2pExtListenInfo info;
+ info.periodMs = 400;
+ info.intervalMs = 400;
+ info.vendorData = kTestVendorDataOptional;
+
+ EXPECT_TRUE(p2p_iface_->configureExtListenWithParams(info).isOk());
+}
+
+/*
* FlushServices
*/
TEST_P(SupplicantP2pIfaceAidlTest, FlushServices) {
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp b/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp
index 7574141..a541f8f 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_sta_network_aidl_test.cpp
@@ -72,6 +72,7 @@
const KeyMgmtMask kTestKeyMgmt =
static_cast<KeyMgmtMask>(static_cast<uint32_t>(KeyMgmtMask::WPA_PSK) |
static_cast<uint32_t>(KeyMgmtMask::WPA_EAP));
+const auto& kTestVendorData = generateOuiKeyedDataList(5);
} // namespace
@@ -110,6 +111,7 @@
initializeService();
supplicant_ = getSupplicant(GetParam().c_str());
ASSERT_NE(supplicant_, nullptr);
+ ASSERT_TRUE(supplicant_->getInterfaceVersion(&interface_version_).isOk());
ASSERT_TRUE(supplicant_
->setDebugParams(DebugLevel::EXCESSIVE,
true, // show timestamps
@@ -131,6 +133,7 @@
std::shared_ptr<ISupplicant> supplicant_;
std::shared_ptr<ISupplicantStaIface> sta_iface_;
std::shared_ptr<ISupplicantStaNetwork> sta_network_;
+ int interface_version_;
void removeNetwork() {
ASSERT_NE(sta_iface_, nullptr);
@@ -826,9 +829,22 @@
* disableEht
*/
TEST_P(SupplicantStaNetworkAidlTest, DisableEht) {
+ if (interface_version_ < 3) {
+ GTEST_SKIP() << "disableEht is available as of Supplicant V3";
+ }
EXPECT_TRUE(sta_network_->disableEht().isOk());
}
+/*
+ * SetVendorData
+ */
+TEST_P(SupplicantStaNetworkAidlTest, SetVendorData) {
+ if (interface_version_ < 3) {
+ GTEST_SKIP() << "setVendorData is available as of Supplicant V3";
+ }
+ EXPECT_TRUE(sta_network_->setVendorData(kTestVendorData).isOk());
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(SupplicantStaNetworkAidlTest);
INSTANTIATE_TEST_SUITE_P(Supplicant, SupplicantStaNetworkAidlTest,
testing::ValuesIn(android::getAidlHalInstanceNames(
diff --git a/wifi/supplicant/aidl/vts/functional/supplicant_test_utils.h b/wifi/supplicant/aidl/vts/functional/supplicant_test_utils.h
index f2cb3f6..51793fd 100644
--- a/wifi/supplicant/aidl/vts/functional/supplicant_test_utils.h
+++ b/wifi/supplicant/aidl/vts/functional/supplicant_test_utils.h
@@ -16,14 +16,18 @@
#pragma once
+#include <android/persistable_bundle_aidl.h>
+
#include "supplicant_aidl_test_utils.h"
#include "supplicant_legacy_test_utils.h"
+using aidl::android::hardware::wifi::common::OuiKeyedData;
using aidl::android::hardware::wifi::supplicant::IfaceInfo;
using aidl::android::hardware::wifi::supplicant::ISupplicant;
using aidl::android::hardware::wifi::supplicant::ISupplicantP2pIface;
using aidl::android::hardware::wifi::supplicant::ISupplicantStaIface;
using aidl::android::hardware::wifi::supplicant::KeyMgmtMask;
+using aidl::android::os::PersistableBundle;
std::string getStaIfaceName() {
std::array<char, PROPERTY_VALUE_MAX> buffer;
@@ -91,3 +95,42 @@
}
return supplicant;
}
+
+std::array<uint8_t, 6> vecToArrayMacAddr(std::vector<uint8_t> vectorAddr) {
+ std::array<uint8_t, 6> arrayAddr;
+ std::copy(vectorAddr.begin(), vectorAddr.begin() + 6, arrayAddr.begin());
+ return arrayAddr;
+}
+
+OuiKeyedData generateOuiKeyedData(int oui) {
+ PersistableBundle bundle;
+ bundle.putString("stringKey", "stringValue");
+ bundle.putInt("intKey", 12345);
+
+ OuiKeyedData data;
+ data.oui = oui;
+ data.vendorData = bundle;
+ return data;
+}
+
+std::vector<OuiKeyedData> generateOuiKeyedDataList(int size) {
+ std::vector<OuiKeyedData> dataList;
+ for (int i = 0; i < size; i++) {
+ dataList.push_back(generateOuiKeyedData(i + 1));
+ }
+ return dataList;
+}
+
+// Wraps generateOuiKeyedData result in std::optional
+std::optional<OuiKeyedData> generateOuiKeyedDataOptional(int oui) {
+ return std::optional<OuiKeyedData>{generateOuiKeyedData(oui)};
+}
+
+// Generate OuiKeyedData list fully wrapped in std::optional
+std::optional<std::vector<std::optional<OuiKeyedData>>> generateOuiKeyedDataListOptional(int size) {
+ std::vector<std::optional<OuiKeyedData>> dataList;
+ for (int i = 0; i < size; i++) {
+ dataList.push_back(generateOuiKeyedDataOptional(i + 1));
+ }
+ return std::optional<std::vector<std::optional<OuiKeyedData>>>{dataList};
+}