Merge "Clarify GPU API requirements for BufferUsage" into main
diff --git a/automotive/remoteaccess/hal/default/Android.bp b/automotive/remoteaccess/hal/default/Android.bp
index 0155667..48a7309 100644
--- a/automotive/remoteaccess/hal/default/Android.bp
+++ b/automotive/remoteaccess/hal/default/Android.bp
@@ -53,7 +53,7 @@
vintf_fragments: ["remoteaccess-default-service.xml"],
init_rc: ["remoteaccess-default-service.rc"],
cflags: [
- "-DGRPC_SERVICE_ADDRESS=\"localhost:50051\"",
+ "-DGRPC_SERVICE_ADDRESS=\"10.0.2.2:50051\"",
],
}
diff --git a/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp b/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp
index b091162..d4ba864 100644
--- a/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp
+++ b/automotive/remoteaccess/hal/default/src/RemoteAccessImpl.cpp
@@ -30,12 +30,12 @@
constexpr char SERVICE_NAME[] = "android.hardware.automotive.remoteaccess.IRemoteAccess/default";
int main(int /* argc */, char* /* argv */[]) {
- LOG(INFO) << "Registering RemoteAccessService as service...";
-
#ifndef GRPC_SERVICE_ADDRESS
LOG(ERROR) << "GRPC_SERVICE_ADDRESS is not defined, exiting";
exit(1);
#endif
+ LOG(INFO) << "Registering RemoteAccessService as service, server: " << GRPC_SERVICE_ADDRESS
+ << "...";
grpc::ChannelArguments grpcargs = {};
#ifdef GRPC_SERVICE_IFNAME
@@ -48,8 +48,7 @@
android::netdevice::WaitCondition::PRESENT_AND_UP);
LOG(INFO) << "Waiting for interface: " << GRPC_SERVICE_IFNAME << " done";
#endif
- auto channel = grpc::CreateCustomChannel(GRPC_SERVICE_ADDRESS,
- grpc::InsecureChannelCredentials(), grpcargs);
+ auto channel = grpc::CreateChannel(GRPC_SERVICE_ADDRESS, grpc::InsecureChannelCredentials());
auto clientStub = android::hardware::automotive::remoteaccess::WakeupClient::NewStub(channel);
auto service = ndk::SharedRefBase::make<
android::hardware::automotive::remoteaccess::RemoteAccessService>(clientStub.get());
diff --git a/automotive/remoteaccess/test_grpc_server/impl/Android.bp b/automotive/remoteaccess/test_grpc_server/impl/Android.bp
index 152b528..74c810e 100644
--- a/automotive/remoteaccess/test_grpc_server/impl/Android.bp
+++ b/automotive/remoteaccess/test_grpc_server/impl/Android.bp
@@ -38,6 +38,26 @@
],
cflags: [
"-Wno-unused-parameter",
- "-DGRPC_SERVICE_ADDRESS=\"localhost:50051\"",
+ "-DGRPC_SERVICE_ADDRESS=\"127.0.0.1:50051\"",
+ ],
+}
+
+cc_binary_host {
+ name: "TestWakeupClientServerHost",
+ srcs: ["src/*.cpp"],
+ local_include_dirs: ["include"],
+ shared_libs: [
+ "libbase",
+ "libutils",
+ "libgrpc++",
+ "libprotobuf-cpp-full",
+ ],
+ whole_static_libs: [
+ "wakeup_client_protos",
+ ],
+ cflags: [
+ "-Wno-unused-parameter",
+ "-DGRPC_SERVICE_ADDRESS=\"127.0.0.1:50051\"",
+ "-DHOST",
],
}
diff --git a/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h b/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h
index 6b86b35..4159e83 100644
--- a/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h
+++ b/automotive/remoteaccess/test_grpc_server/impl/include/TestWakeupClientServiceImpl.h
@@ -34,11 +34,9 @@
// implementation, the task should come from remote task server. This class is thread-safe.
class FakeTaskGenerator final {
public:
- GetRemoteTasksResponse generateTask();
+ GetRemoteTasksResponse generateTask(const std::string& clientId);
private:
- // Simulates the client ID for each task.
- std::atomic<int> mCurrentClientId = 0;
constexpr static uint8_t DATA[] = {0xde, 0xad, 0xbe, 0xef};
};
@@ -99,7 +97,7 @@
void waitForTaskWithLock(std::unique_lock<std::mutex>& lock);
};
-class TestWakeupClientServiceImpl final : public WakeupClient::Service {
+class TestWakeupClientServiceImpl : public WakeupClient::Service {
public:
TestWakeupClientServiceImpl();
@@ -112,25 +110,57 @@
const NotifyWakeupRequiredRequest* request,
NotifyWakeupRequiredResponse* response) override;
+ /**
+ * Starts generating fake tasks for the specific client repeatedly.
+ *
+ * The fake task will have {0xDE 0xAD 0xBE 0xEF} as payload. A new fake task will be sent
+ * to the client every 5s.
+ */
+ void startGeneratingFakeTask(const std::string& clientId);
+ /**
+ * stops generating fake tasks.
+ */
+ void stopGeneratingFakeTask();
+ /**
+ * Returns whether we need to wakeup the target device to send remote tasks.
+ */
+ bool isWakeupRequired();
+ /**
+ * Returns whether we have an active connection with the target device.
+ */
+ bool isRemoteTaskConnectionAlive();
+ /**
+ * Injects a fake task with taskData to be sent to the specific client.
+ */
+ void injectTask(const std::string& taskData, const std::string& clientId);
+ /**
+ * Wakes up the target device.
+ *
+ * This must be implemented by child class and contains device specific logic. E.g. this might
+ * be sending QEMU commands for the emulator device.
+ */
+ virtual void wakeupApplicationProcessor() = 0;
+
private:
// This is a thread for communicating with remote wakeup server (via network) and receive tasks
// from it.
std::thread mThread;
// A variable to notify server is stopping.
- std::condition_variable mServerStoppedCv;
+ std::condition_variable mTaskLoopStoppedCv;
// Whether wakeup AP is required for executing tasks.
std::atomic<bool> mWakeupRequired = true;
+ // Whether we currently have an active long-live connection to deliver remote tasks.
+ std::atomic<bool> mRemoteTaskConnectionAlive = false;
std::mutex mLock;
- bool mServerStopped GUARDED_BY(mLock);
+ bool mGeneratingFakeTask GUARDED_BY(mLock);
// Thread-safe. For test impl only.
FakeTaskGenerator mFakeTaskGenerator;
// Thread-sfae.
TaskQueue mTaskQueue;
- void fakeTaskGenerateLoop();
-
- void wakeupApplicationProcessor();
+ void fakeTaskGenerateLoop(const std::string& clientId);
+ void injectTaskResponse(const GetRemoteTasksResponse& response);
};
} // namespace remoteaccess
diff --git a/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp b/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp
index 7dcd31e..eb3871b 100644
--- a/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp
+++ b/automotive/remoteaccess/test_grpc_server/impl/src/TestWakeupClientServiceImpl.cpp
@@ -16,8 +16,6 @@
#include "TestWakeupClientServiceImpl.h"
-#include "ApPowerControl.h"
-
#include <android-base/stringprintf.h>
#include <inttypes.h>
#include <utils/Looper.h>
@@ -44,12 +42,10 @@
} // namespace
-GetRemoteTasksResponse FakeTaskGenerator::generateTask() {
- int clientId = mCurrentClientId++;
+GetRemoteTasksResponse FakeTaskGenerator::generateTask(const std::string& clientId) {
GetRemoteTasksResponse response;
- response.set_data(std::string(reinterpret_cast<const char*>(DATA), sizeof(DATA)));
- std::string clientIdStr = StringPrintf("%d", clientId);
- response.set_clientid(clientIdStr);
+ response.set_data(reinterpret_cast<const char*>(DATA), sizeof(DATA));
+ response.set_clientid(clientId);
return response;
}
@@ -165,38 +161,68 @@
}
}
-TestWakeupClientServiceImpl::TestWakeupClientServiceImpl() {
- mThread = std::thread([this] { fakeTaskGenerateLoop(); });
-}
+TestWakeupClientServiceImpl::TestWakeupClientServiceImpl() {}
TestWakeupClientServiceImpl::~TestWakeupClientServiceImpl() {
+ { std::lock_guard<std::mutex> lockGuard(mLock); }
+ mTaskQueue.stopWait();
+ stopGeneratingFakeTask();
+}
+
+void TestWakeupClientServiceImpl::injectTask(const std::string& taskData,
+ const std::string& clientId) {
+ GetRemoteTasksResponse response;
+ response.set_data(taskData);
+ response.set_clientid(clientId);
+ injectTaskResponse(response);
+}
+
+void TestWakeupClientServiceImpl::injectTaskResponse(const GetRemoteTasksResponse& response) {
+ printf("Received a new task\n");
+ mTaskQueue.add(response);
+ if (mWakeupRequired) {
+ wakeupApplicationProcessor();
+ }
+}
+
+void TestWakeupClientServiceImpl::startGeneratingFakeTask(const std::string& clientId) {
+ std::lock_guard<std::mutex> lockGuard(mLock);
+ if (mGeneratingFakeTask) {
+ printf("Fake task is already being generated\n");
+ return;
+ }
+ mGeneratingFakeTask = true;
+ mThread = std::thread([this, clientId] { fakeTaskGenerateLoop(clientId); });
+ printf("Started generating fake tasks\n");
+}
+
+void TestWakeupClientServiceImpl::stopGeneratingFakeTask() {
{
std::lock_guard<std::mutex> lockGuard(mLock);
- mServerStopped = true;
- mServerStoppedCv.notify_all();
+ if (!mGeneratingFakeTask) {
+ printf("Fake task is not being generated, do nothing\n");
+ return;
+ }
+ mTaskLoopStoppedCv.notify_all();
+ mGeneratingFakeTask = false;
}
- mTaskQueue.stopWait();
if (mThread.joinable()) {
mThread.join();
}
+ printf("Stopped generating fake tasks\n");
}
-void TestWakeupClientServiceImpl::fakeTaskGenerateLoop() {
+void TestWakeupClientServiceImpl::fakeTaskGenerateLoop(const std::string& clientId) {
// In actual implementation, this should communicate with the remote server and receives tasks
// from it. Here we simulate receiving one remote task every {kTaskIntervalInMs}ms.
while (true) {
- mTaskQueue.add(mFakeTaskGenerator.generateTask());
- printf("Received a new task\n");
- if (mWakeupRequired) {
- wakeupApplicationProcessor();
- }
-
+ injectTaskResponse(mFakeTaskGenerator.generateTask(clientId));
printf("Sleeping for %d seconds until next task\n", kTaskIntervalInMs);
std::unique_lock lk(mLock);
- if (mServerStoppedCv.wait_for(lk, std::chrono::milliseconds(kTaskIntervalInMs), [this] {
+ if (mTaskLoopStoppedCv.wait_for(lk, std::chrono::milliseconds(kTaskIntervalInMs), [this] {
ScopedLockAssertion lockAssertion(mLock);
- return mServerStopped;
+ return !mGeneratingFakeTask;
})) {
// If the stopped flag is set, we are quitting, exit the loop.
return;
@@ -208,6 +234,7 @@
const GetRemoteTasksRequest* request,
ServerWriter<GetRemoteTasksResponse>* writer) {
printf("GetRemoteTasks called\n");
+ mRemoteTaskConnectionAlive = true;
while (true) {
mTaskQueue.waitForTask();
@@ -226,16 +253,19 @@
// The task failed to be sent, add it back to the queue. The order might change, but
// it is okay.
mTaskQueue.add(response);
+ mRemoteTaskConnectionAlive = false;
return Status::CANCELLED;
}
}
}
+ mRemoteTaskConnectionAlive = false;
return Status::OK;
}
Status TestWakeupClientServiceImpl::NotifyWakeupRequired(ServerContext* context,
const NotifyWakeupRequiredRequest* request,
NotifyWakeupRequiredResponse* response) {
+ printf("NotifyWakeupRequired called\n");
if (request->iswakeuprequired() && !mWakeupRequired && !mTaskQueue.isEmpty()) {
// If wakeup is now required and previously not required, this means we have finished
// shutting down the device. If there are still pending tasks, try waking up AP again
@@ -243,11 +273,20 @@
wakeupApplicationProcessor();
}
mWakeupRequired = request->iswakeuprequired();
+ if (mWakeupRequired) {
+ // We won't know the connection is down unless we try to send a task over. If wakeup is
+ // required, the connection is very likely already down.
+ mRemoteTaskConnectionAlive = false;
+ }
return Status::OK;
}
-void TestWakeupClientServiceImpl::wakeupApplicationProcessor() {
- wakeupAp();
+bool TestWakeupClientServiceImpl::isWakeupRequired() {
+ return mWakeupRequired;
+}
+
+bool TestWakeupClientServiceImpl::isRemoteTaskConnectionAlive() {
+ return mRemoteTaskConnectionAlive;
}
} // namespace remoteaccess
diff --git a/automotive/remoteaccess/test_grpc_server/impl/src/main.cpp b/automotive/remoteaccess/test_grpc_server/impl/src/main.cpp
index d3f519c..be285a8 100644
--- a/automotive/remoteaccess/test_grpc_server/impl/src/main.cpp
+++ b/automotive/remoteaccess/test_grpc_server/impl/src/main.cpp
@@ -14,7 +14,17 @@
* limitations under the License.
*/
+#include <signal.h>
+#include <stdio.h>
+#include <sys/wait.h>
+#include <iostream>
+#include <sstream>
#include <string>
+#include <thread>
+
+#ifndef HOST
+#include "ApPowerControl.h"
+#endif // #ifndef HOST
#include "TestWakeupClientServiceImpl.h"
@@ -28,10 +38,18 @@
using ::grpc::ServerBuilder;
using ::grpc::ServerWriter;
-void RunServer(const std::string& serviceAddr) {
- std::shared_ptr<TestWakeupClientServiceImpl> service =
- std::make_unique<TestWakeupClientServiceImpl>();
+constexpr int SHUTDOWN_REQUEST = 289410889;
+constexpr int VEHICLE_IN_USE = 287313738;
+const char* COMMAND_RUN_EMU = "source ~/.aae-toolbox/bin/bashrc && aae emulator run";
+const char* COMMAND_SET_VHAL_PROP =
+ "adb -s emulator-5554 wait-for-device && adb -s emulator-5554 root "
+ "&& sleep 1 && adb -s emulator-5554 wait-for-device && adb -s emulator-5554 shell "
+ "dumpsys android.hardware.automotive.vehicle.IVehicle/default --set %d -i %d";
+pid_t emuPid = 0;
+
+void RunServer(const std::string& serviceAddr,
+ std::shared_ptr<TestWakeupClientServiceImpl> service) {
ServerBuilder builder;
builder.AddListeningPort(serviceAddr, grpc::InsecureServerCredentials());
builder.RegisterService(service.get());
@@ -40,11 +58,224 @@
server->Wait();
}
+pid_t runCommand(const char* bashCommand) {
+ pid_t pid = fork();
+ if (pid == 0) {
+ // In child process. Put it into a separate process group so we can kill it.
+ setpgid(0, 0);
+ execl("/bin/bash", "bash", "-c", bashCommand, /*terminateArg=*/nullptr);
+ exit(0);
+ } else {
+ return pid;
+ }
+}
+
+void updateEmuStatus() {
+ if (emuPid == 0) {
+ return;
+ }
+ pid_t pid = waitpid(emuPid, nullptr, WNOHANG);
+ if (pid == emuPid) {
+ // Emu process already exited. If Emu process is still running, pid will be 0.
+ emuPid = 0;
+ }
+}
+
+bool powerOnEmu() {
+ updateEmuStatus();
+ if (emuPid != 0) {
+ printf("The emulator is already running\n");
+ return false;
+ }
+ emuPid = runCommand(COMMAND_RUN_EMU);
+ printf("Emulator started in process: %d\n", emuPid);
+ return true;
+}
+
+bool powerOn() {
+#ifdef HOST
+ return powerOnEmu();
+#else
+ printf("power on is only supported on host\n");
+ return false;
+#endif
+}
+
+const char* getSetPropCommand(int propId) {
+ int size = snprintf(nullptr, 0, COMMAND_SET_VHAL_PROP, propId, 1);
+ char* command = new char[size + 1];
+ snprintf(command, size + 1, COMMAND_SET_VHAL_PROP, propId, 1);
+ return command;
+}
+
+void powerOffEmu() {
+ updateEmuStatus();
+ if (emuPid == 0) {
+ printf("The emulator is not running\n");
+ return;
+ }
+ const char* command = getSetPropCommand(SHUTDOWN_REQUEST);
+ runCommand(command);
+ delete[] command;
+ waitpid(emuPid, nullptr, /*options=*/0);
+ emuPid = 0;
+}
+
+void powerOff() {
+#ifdef HOST
+ powerOffEmu();
+#else
+ printf("power off is only supported on host\n");
+#endif
+}
+
+void setVehicleInUse(bool vehicleInUse) {
+#ifdef HOST
+ printf("Set vehicleInUse to %d\n", vehicleInUse);
+ int value = 0;
+ if (vehicleInUse) {
+ value = 1;
+ }
+ const char* command = getSetPropCommand(VEHICLE_IN_USE);
+ runCommand(command);
+ delete[] command;
+#else
+ printf("set vehicleInUse is only supported on host\n");
+#endif
+}
+
+void help() {
+ std::cout << "Remote Access Host Test Utility" << std::endl
+ << "help:\t"
+ << "Print out this help info" << std::endl
+ << "genFakeTask start [clientID]:\t"
+ << "Start generating a fake task every 5s" << std::endl
+ << "genFakeTask stop:\t"
+ << "Stop the fake task generation" << std::endl
+ << "status:\t"
+ << "Print current status" << std::endl
+ << "power on:\t"
+ << "Power on the emulator, simulate user enters vehicle while AP is off"
+ << " (only supported on host)" << std::endl
+ << "power off:\t"
+ << "Power off the emulator, simulate user leaves vehicle"
+ << " (only supported on host)" << std::endl
+ << "inject task [clientID] [taskData]:\t"
+ << "Inject a remote task" << std::endl
+ << "set vehicleInUse:\t"
+ << "Set vehicle in use, simulate user enter vehicle while boot up for remote task "
+ << "(only supported on host)" << std::endl;
+}
+
+void parseCommand(const std::string& userInput,
+ std::shared_ptr<TestWakeupClientServiceImpl> service) {
+ if (userInput == "") {
+ // ignore empty line.
+ } else if (userInput == "help") {
+ help();
+ } else if (userInput.rfind("genFakeTask start", 0) == 0) {
+ std::string clientId;
+ std::stringstream ss;
+ ss << userInput;
+ int i = 0;
+ while (std::getline(ss, clientId, ' ')) {
+ i++;
+ if (i == 3) {
+ break;
+ }
+ }
+ if (i != 3) {
+ printf("Missing clientId, see 'help'\n");
+ return;
+ }
+ service->startGeneratingFakeTask(clientId);
+ } else if (userInput == "genFakeTask stop") {
+ service->stopGeneratingFakeTask();
+ } else if (userInput == "status") {
+ printf("isWakeupRequired: %B, isRemoteTaskConnectionAlive: %B\n",
+ service->isWakeupRequired(), service->isRemoteTaskConnectionAlive());
+ } else if (userInput == "power on") {
+ powerOn();
+ } else if (userInput == "power off") {
+ powerOff();
+ } else if (userInput.rfind("inject task", 0) == 0) {
+ std::stringstream ss;
+ ss << userInput;
+ std::string data;
+ std::string taskData;
+ std::string clientId;
+ int i = 0;
+ while (std::getline(ss, data, ' ')) {
+ i++;
+ if (i == 3) {
+ clientId = data;
+ }
+ if (i == 4) {
+ taskData = data;
+ }
+ }
+ if (taskData == "" || clientId == "") {
+ printf("Missing taskData or clientId, see 'help'\n");
+ return;
+ }
+ service->injectTask(taskData, clientId);
+ printf("Remote task with client ID: %s, data: %s injected\n", clientId.c_str(),
+ taskData.c_str());
+ } else if (userInput == "set vehicleInUse") {
+ setVehicleInUse(true);
+ } else {
+ printf("Unknown command, see 'help'\n");
+ }
+}
+
+void saHandler(int signum) {
+ if (emuPid != 0) {
+ kill(-emuPid, signum);
+ waitpid(emuPid, nullptr, /*options=*/0);
+ // Sleep for 1 seconds to allow emulator to print out logs.
+ sleep(1);
+ }
+ exit(-1);
+}
+
+class MyTestWakeupClientServiceImpl final : public TestWakeupClientServiceImpl {
+ public:
+ void wakeupApplicationProcessor() override {
+#ifdef HOST
+ if (powerOnEmu()) {
+ // If we wake up AP to execute remote task, vehicle in use should be false.
+ setVehicleInUse(false);
+ }
+#else
+ wakeupAp();
+#endif
+ };
+};
+
int main(int argc, char** argv) {
std::string serviceAddr = GRPC_SERVICE_ADDRESS;
if (argc > 1) {
serviceAddr = argv[1];
}
- RunServer(serviceAddr);
+ // Let the server thread run, we will force kill the server when we exit the program.
+ std::shared_ptr<TestWakeupClientServiceImpl> service =
+ std::make_shared<MyTestWakeupClientServiceImpl>();
+ std::thread serverThread([serviceAddr, service] { RunServer(serviceAddr, service); });
+
+ // Register the signal handler for SIGTERM and SIGINT so that we can stop the emulator before
+ // exit.
+ struct sigaction sa = {};
+ sigemptyset(&sa.sa_mask);
+ sa.sa_handler = saHandler;
+ sigaction(SIGTERM, &sa, nullptr);
+ sigaction(SIGINT, &sa, nullptr);
+
+ // Start processing the user inputs.
+ std::string userInput;
+ while (true) {
+ std::cout << ">>> ";
+ std::getline(std::cin, userInput);
+ parseCommand(userInput, service);
+ }
return 0;
}
diff --git a/automotive/remoteaccess/test_grpc_server/lib/Android.bp b/automotive/remoteaccess/test_grpc_server/lib/Android.bp
index 7e95f53..8391018 100644
--- a/automotive/remoteaccess/test_grpc_server/lib/Android.bp
+++ b/automotive/remoteaccess/test_grpc_server/lib/Android.bp
@@ -26,7 +26,7 @@
cc_library_shared {
name: "ApPowerControlLib",
vendor: true,
- srcs: ["*.cpp"],
+ srcs: ["ApPowerControl.cpp"],
local_include_dirs: ["."],
export_include_dirs: ["."],
}
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/automotive/remoteaccess/test_grpc_server/lib/ApPowerControlHost.cpp
similarity index 66%
copy from automotive/vehicle/aidl/impl/utils/test/Android.bp
copy to automotive/remoteaccess/test_grpc_server/lib/ApPowerControlHost.cpp
index ad9954f..a475b00 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/automotive/remoteaccess/test_grpc_server/lib/ApPowerControlHost.cpp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -14,13 +14,10 @@
* limitations under the License.
*/
-package {
- default_applicable_licenses: ["Android-Apache-2.0"],
-}
+#include "ApPowerControl.h"
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
+#include <cstdio>
+
+void wakeupAp() {
+ printf("Waking up application processor...\n");
}
diff --git a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/Android.bp b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/Android.bp
index 6984d5e..75a3541 100644
--- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/Android.bp
+++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/Android.bp
@@ -35,14 +35,17 @@
cc_library {
name: "VehicleHalJsonConfigLoaderEnableTestProperties",
vendor: true,
- srcs: ["src/*.cpp"],
+ srcs: [
+ "src/*.cpp",
+ ":VhalTestVendorProperties",
+ ],
local_include_dirs: ["include"],
export_include_dirs: ["include"],
defaults: ["VehicleHalDefaults"],
static_libs: ["VehicleHalUtils"],
header_libs: [
- "VehicleHalTestUtilHeaders",
"IVehicleGeneratedHeaders",
+ "libbinder_headers",
],
cflags: ["-DENABLE_VEHICLE_HAL_TEST_PROPERTIES"],
shared_libs: ["libjsoncpp"],
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 0a1f904..39ce10e 100644
--- a/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
+++ b/automotive/vehicle/aidl/impl/default_config/JsonConfigLoader/src/JsonConfigLoader.cpp
@@ -21,7 +21,7 @@
#include <PropertyUtils.h>
#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES
-#include <TestPropertyUtils.h>
+#include <android/hardware/automotive/vehicle/TestVendorProperty.h>
#endif // ENABLE_VEHICLE_HAL_TEST_PROPERTIES
#include <android-base/strings.h>
@@ -91,10 +91,6 @@
{"HVAC_ALL", HVAC_ALL},
{"HVAC_LEFT", HVAC_LEFT},
{"HVAC_RIGHT", HVAC_RIGHT},
- {"VENDOR_EXTENSION_INT_PROPERTY", VENDOR_EXTENSION_INT_PROPERTY},
- {"VENDOR_EXTENSION_BOOLEAN_PROPERTY", VENDOR_EXTENSION_BOOLEAN_PROPERTY},
- {"VENDOR_EXTENSION_STRING_PROPERTY", VENDOR_EXTENSION_STRING_PROPERTY},
- {"VENDOR_EXTENSION_FLOAT_PROPERTY", VENDOR_EXTENSION_FLOAT_PROPERTY},
{"WINDOW_1_LEFT", WINDOW_1_LEFT},
{"WINDOW_1_RIGHT", WINDOW_1_RIGHT},
{"WINDOW_2_LEFT", WINDOW_2_LEFT},
@@ -133,24 +129,9 @@
{"EV_STOPPING_MODE_HOLD", EV_STOPPING_MODE_HOLD},
{"MIRROR_DRIVER_LEFT_RIGHT",
toInt(VehicleAreaMirror::DRIVER_LEFT) | toInt(VehicleAreaMirror::DRIVER_RIGHT)},
-#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES
- // Following are test properties:
- {"ECHO_REVERSE_BYTES", ECHO_REVERSE_BYTES},
- {"VENDOR_PROPERTY_ID", VENDOR_PROPERTY_ID},
- {"kMixedTypePropertyForTest", kMixedTypePropertyForTest},
- {"VENDOR_CLUSTER_NAVIGATION_STATE", VENDOR_CLUSTER_NAVIGATION_STATE},
- {"VENDOR_CLUSTER_REQUEST_DISPLAY", VENDOR_CLUSTER_REQUEST_DISPLAY},
- {"VENDOR_CLUSTER_SWITCH_UI", VENDOR_CLUSTER_SWITCH_UI},
- {"VENDOR_CLUSTER_DISPLAY_STATE", VENDOR_CLUSTER_DISPLAY_STATE},
- {"VENDOR_CLUSTER_REPORT_STATE", VENDOR_CLUSTER_REPORT_STATE},
- {"PLACEHOLDER_PROPERTY_INT", PLACEHOLDER_PROPERTY_INT},
- {"PLACEHOLDER_PROPERTY_FLOAT", PLACEHOLDER_PROPERTY_FLOAT},
- {"PLACEHOLDER_PROPERTY_BOOLEAN", PLACEHOLDER_PROPERTY_BOOLEAN},
- {"PLACEHOLDER_PROPERTY_STRING", PLACEHOLDER_PROPERTY_STRING}
-#endif // ENABLE_VEHICLE_HAL_TEST_PROPERTIES
};
-// A class to parse constant values for type T.
+// A class to parse constant values for type T where T is defined as an enum in NDK AIDL backend.
template <class T>
class ConstantParser final : public ConstantParserInterface {
public:
@@ -181,6 +162,33 @@
std::unordered_map<std::string, int> mValueByName;
};
+#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES
+// A class to parse constant values for type T where T is defined as an enum in CPP AIDL backend.
+template <class T>
+class CppConstantParser final : public ConstantParserInterface {
+ public:
+ CppConstantParser() {
+ for (const T& v : android::enum_range<T>()) {
+ std::string name = android::hardware::automotive::vehicle::toString(v);
+ mValueByName[name] = toInt(v);
+ }
+ }
+
+ ~CppConstantParser() = default;
+
+ Result<int> parseValue(const std::string& name) const override {
+ auto it = mValueByName.find(name);
+ if (it == mValueByName.end()) {
+ return Error() << "Constant name: " << name << " is not defined";
+ }
+ return it->second;
+ }
+
+ private:
+ std::unordered_map<std::string, int> mValueByName;
+};
+#endif
+
// A class to parse constant values defined in CONSTANTS_BY_NAME map.
class LocalVariableParser final : public ConstantParserInterface {
public:
@@ -260,6 +268,10 @@
mConstantParsersByType["LaneCenteringAssistState"] =
std::make_unique<ConstantParser<LaneCenteringAssistState>>();
mConstantParsersByType["Constants"] = std::make_unique<LocalVariableParser>();
+#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES
+ mConstantParsersByType["TestVendorProperty"] =
+ std::make_unique<CppConstantParser<TestVendorProperty>>();
+#endif // ENABLE_VEHICLE_HAL_TEST_PROPERTIES
}
template <>
diff --git a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json
index 0dfb123..b9f784b 100644
--- a/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json
+++ b/automotive/vehicle/aidl/impl/default_config/config/DefaultProperties.json
@@ -3387,7 +3387,7 @@
"property": "VehicleProperty::CRUISE_CONTROL_TYPE",
"defaultValue": {
"int32Values": [
- "CruiseControlType::STANDARD"
+ "CruiseControlType::ADAPTIVE"
]
},
"areas": [
diff --git a/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json b/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json
index fd4b002..73e4d44 100644
--- a/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json
+++ b/automotive/vehicle/aidl/impl/default_config/config/TestProperties.json
@@ -1,7 +1,7 @@
{
"properties": [
{
- "property": "Constants::kMixedTypePropertyForTest",
+ "property": "TestVendorProperty::MIXED_TYPE_PROPERTY_FOR_TEST",
"defaultValue": {
"floatValues": [
4.5
@@ -28,7 +28,7 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::VENDOR_EXTENSION_BOOLEAN_PROPERTY",
+ "property": "TestVendorProperty::VENDOR_EXTENSION_BOOLEAN_PROPERTY",
"areas": [
{
"defaultValue": {
@@ -67,7 +67,7 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::VENDOR_EXTENSION_FLOAT_PROPERTY",
+ "property": "TestVendorProperty::VENDOR_EXTENSION_FLOAT_PROPERTY",
"areas": [
{
"defaultValue": {
@@ -94,7 +94,7 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::VENDOR_EXTENSION_INT_PROPERTY",
+ "property": "TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY",
"areas": [
{
"defaultValue": {
@@ -131,7 +131,7 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::VENDOR_EXTENSION_STRING_PROPERTY",
+ "property": "TestVendorProperty::VENDOR_EXTENSION_STRING_PROPERTY",
"defaultValue": {
"stringValue": "Vendor String Property"
},
@@ -139,7 +139,7 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::PLACEHOLDER_PROPERTY_INT",
+ "property": "TestVendorProperty::PLACEHOLDER_PROPERTY_INT",
"defaultValue": {
"int32Values": [
0
@@ -149,7 +149,7 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::PLACEHOLDER_PROPERTY_FLOAT",
+ "property": "TestVendorProperty::PLACEHOLDER_PROPERTY_FLOAT",
"defaultValue": {
"floatValues": [
0.0
@@ -159,7 +159,7 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::PLACEHOLDER_PROPERTY_BOOLEAN",
+ "property": "TestVendorProperty::PLACEHOLDER_PROPERTY_BOOLEAN",
"defaultValue": {
"int32Values": [
0
@@ -169,7 +169,7 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::PLACEHOLDER_PROPERTY_STRING",
+ "property": "TestVendorProperty::PLACEHOLDER_PROPERTY_STRING",
"defaultValue": {
"stringValue": "Test"
},
@@ -177,12 +177,12 @@
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::ECHO_REVERSE_BYTES",
+ "property": "TestVendorProperty::ECHO_REVERSE_BYTES",
"access": "VehiclePropertyAccess::READ_WRITE",
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::VENDOR_PROPERTY_ID",
+ "property": "TestVendorProperty::VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING",
"access": "VehiclePropertyAccess::READ_WRITE",
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
@@ -194,13 +194,13 @@
]
},
"configArray": [
- "Constants::kMixedTypePropertyForTest",
+ "TestVendorProperty::MIXED_TYPE_PROPERTY_FOR_TEST",
"VehicleVendorPermission::PERMISSION_GET_VENDOR_CATEGORY_INFO",
"VehicleVendorPermission::PERMISSION_SET_VENDOR_CATEGORY_INFO",
- "Constants::VENDOR_EXTENSION_INT_PROPERTY",
+ "TestVendorProperty::VENDOR_EXTENSION_INT_PROPERTY",
"VehicleVendorPermission::PERMISSION_GET_VENDOR_CATEGORY_SEAT",
"VehicleVendorPermission::PERMISSION_NOT_ACCESSIBLE",
- "Constants::VENDOR_EXTENSION_FLOAT_PROPERTY",
+ "TestVendorProperty::VENDOR_EXTENSION_FLOAT_PROPERTY",
"VehicleVendorPermission::PERMISSION_DEFAULT",
"VehicleVendorPermission::PERMISSION_DEFAULT"
]
diff --git a/automotive/vehicle/aidl/impl/default_config/config/VendorClusterTestProperties.json b/automotive/vehicle/aidl/impl/default_config/config/VendorClusterTestProperties.json
index 3a1a783..8c2bc93 100644
--- a/automotive/vehicle/aidl/impl/default_config/config/VendorClusterTestProperties.json
+++ b/automotive/vehicle/aidl/impl/default_config/config/VendorClusterTestProperties.json
@@ -1,17 +1,17 @@
{
"properties": [
{
- "property": "Constants::VENDOR_CLUSTER_SWITCH_UI",
+ "property": "TestVendorProperty::VENDOR_CLUSTER_SWITCH_UI",
"access": "VehiclePropertyAccess::WRITE",
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::VENDOR_CLUSTER_DISPLAY_STATE",
+ "property": "TestVendorProperty::VENDOR_CLUSTER_DISPLAY_STATE",
"access": "VehiclePropertyAccess::WRITE",
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
},
{
- "property": "Constants::VENDOR_CLUSTER_REPORT_STATE",
+ "property": "TestVendorProperty::VENDOR_CLUSTER_REPORT_STATE",
"defaultValue": {
"int32Values": [
0,
@@ -44,7 +44,7 @@
"Value means 0 /* Off */, -1, -1, -1, -1 /* Bounds */, -1, -1, -1, -1 /* Insets */, 0 /* ClusterHome */, -1 /* ClusterNone */"
},
{
- "property": "Constants::VENDOR_CLUSTER_REQUEST_DISPLAY",
+ "property": "TestVendorProperty::VENDOR_CLUSTER_REQUEST_DISPLAY",
"defaultValue": {
"int32Values": [
0
@@ -55,7 +55,7 @@
"comment": "0 means ClusterHome"
},
{
- "property": "Constants::VENDOR_CLUSTER_NAVIGATION_STATE",
+ "property": "TestVendorProperty::VENDOR_CLUSTER_NAVIGATION_STATE",
"access": "VehiclePropertyAccess::READ",
"changeMode": "VehiclePropertyChangeMode::ON_CHANGE"
}
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp
index 4c17cde..e75f648 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/Android.bp
@@ -21,7 +21,10 @@
cc_library {
name: "FakeVehicleHardware",
vendor: true,
- srcs: ["src/*.cpp"],
+ srcs: [
+ "src/*.cpp",
+ ":VhalTestVendorProperties",
+ ],
local_include_dirs: ["include"],
export_include_dirs: ["include"],
cflags: ["-DENABLE_VEHICLE_HAL_TEST_PROPERTIES"],
@@ -35,7 +38,7 @@
name: "FakeVehicleHardwareDefaults",
header_libs: [
"IVehicleHardware",
- "VehicleHalTestUtilHeaders",
+ "libbinder_headers",
],
export_header_lib_headers: ["IVehicleHardware"],
static_libs: [
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 502d957..f130fa4 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/include/FakeVehicleHardware.h
@@ -189,6 +189,7 @@
VhalResult<void> maybeSetSpecialValue(
const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value,
bool* isSpecialValue);
+ VhalResult<bool> isCruiseControlTypeStandard() const;
ValueResultType maybeGetSpecialValue(
const aidl::android::hardware::automotive::vehicle::VehiclePropValue& value,
bool* isSpecialValue) const;
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 4934771..82c3ea0 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/src/FakeVehicleHardware.cpp
@@ -24,7 +24,6 @@
#include <JsonFakeValueGenerator.h>
#include <LinearFakeValueGenerator.h>
#include <PropertyUtils.h>
-#include <TestPropertyUtils.h>
#include <VehicleHalTypes.h>
#include <VehicleUtils.h>
@@ -32,6 +31,7 @@
#include <android-base/parsedouble.h>
#include <android-base/properties.h>
#include <android-base/strings.h>
+#include <android/hardware/automotive/vehicle/TestVendorProperty.h>
#include <utils/Log.h>
#include <utils/SystemClock.h>
#include <utils/Trace.h>
@@ -52,6 +52,8 @@
namespace {
+using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand;
+using ::aidl::android::hardware::automotive::vehicle::CruiseControlType;
using ::aidl::android::hardware::automotive::vehicle::ErrorState;
using ::aidl::android::hardware::automotive::vehicle::GetValueRequest;
using ::aidl::android::hardware::automotive::vehicle::GetValueResult;
@@ -61,6 +63,7 @@
using ::aidl::android::hardware::automotive::vehicle::StatusCode;
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReport;
using ::aidl::android::hardware::automotive::vehicle::VehicleApPowerStateReq;
+using ::aidl::android::hardware::automotive::vehicle::VehicleArea;
using ::aidl::android::hardware::automotive::vehicle::VehicleHwKeyInputAction;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropConfig;
using ::aidl::android::hardware::automotive::vehicle::VehicleProperty;
@@ -85,14 +88,12 @@
// getPropertiesAsync, and setPropertiesAsync.
// 0x21403000
constexpr int32_t STARTING_VENDOR_CODE_PROPERTIES_FOR_TEST =
- 0x3000 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::INT32);
+ 0x3000 | toInt(VehiclePropertyGroup::VENDOR) | toInt(VehicleArea::GLOBAL) |
+ toInt(VehiclePropertyType::INT32);
// 0x21405000
constexpr int32_t ENDING_VENDOR_CODE_PROPERTIES_FOR_TEST =
- 0x5000 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::INT32);
+ 0x5000 | toInt(VehiclePropertyGroup::VENDOR) | toInt(VehicleArea::GLOBAL) |
+ toInt(VehiclePropertyType::INT32);
// The directory for default property configuration file.
// For config file format, see impl/default_config/config/README.md.
constexpr char DEFAULT_CONFIG_DIR[] = "/vendor/etc/automotive/vhalconfig/";
@@ -103,7 +104,7 @@
// overwrite the default configs.
constexpr char OVERRIDE_PROPERTY[] = "persist.vendor.vhal_init_value_override";
constexpr char POWER_STATE_REQ_CONFIG_PROPERTY[] = "ro.vendor.fake_vhal.ap_power_state_req.config";
-// The value to be returned if VENDOR_PROPERTY_ID is set as the property
+// The value to be returned if VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING is set as the property
constexpr int VENDOR_ERROR_CODE = 0x00ab0005;
// A list of supported options for "--set" command.
const std::unordered_set<std::string> SET_PROP_OPTIONS = {
@@ -611,6 +612,18 @@
}
}
+VhalResult<bool> FakeVehicleHardware::isCruiseControlTypeStandard() const {
+ auto isCruiseControlTypeAvailableResult =
+ isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_TYPE));
+ if (!isCruiseControlTypeAvailableResult.ok()) {
+ return isCruiseControlTypeAvailableResult.error();
+ }
+ auto cruiseControlTypeValue =
+ mServerSidePropStore->readValue(toInt(VehicleProperty::CRUISE_CONTROL_TYPE));
+ return cruiseControlTypeValue.value()->value.int32Values[0] ==
+ toInt(CruiseControlType::STANDARD);
+}
+
FakeVehicleHardware::ValueResultType FakeVehicleHardware::maybeGetSpecialValue(
const VehiclePropValue& value, bool* isSpecialValue) const {
*isSpecialValue = false;
@@ -638,6 +651,7 @@
return StatusError(StatusCode::NOT_AVAILABLE_DISABLED) << "hvac not available";
}
+ VhalResult<void> isAdasPropertyAvailableResult;
switch (propId) {
case OBD2_FREEZE_FRAME:
*isSpecialValue = true;
@@ -653,24 +667,41 @@
result.value()->timestamp = elapsedRealtimeNano();
}
return result;
- case ECHO_REVERSE_BYTES:
+ case toInt(TestVendorProperty::ECHO_REVERSE_BYTES):
*isSpecialValue = true;
return getEchoReverseBytes(value);
- case VENDOR_PROPERTY_ID:
+ case toInt(TestVendorProperty::VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING):
*isSpecialValue = true;
return StatusError((StatusCode)VENDOR_ERROR_CODE);
case toInt(VehicleProperty::CRUISE_CONTROL_TARGET_SPEED):
- [[fallthrough]];
- case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP):
- [[fallthrough]];
- case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE): {
- auto isAdasPropertyAvailableResult =
+ isAdasPropertyAvailableResult =
isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_STATE));
if (!isAdasPropertyAvailableResult.ok()) {
*isSpecialValue = true;
return isAdasPropertyAvailableResult.error();
}
return nullptr;
+ case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP):
+ [[fallthrough]];
+ case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE): {
+ isAdasPropertyAvailableResult =
+ isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_STATE));
+ if (!isAdasPropertyAvailableResult.ok()) {
+ *isSpecialValue = true;
+ return isAdasPropertyAvailableResult.error();
+ }
+ auto isCruiseControlTypeStandardResult = isCruiseControlTypeStandard();
+ if (!isCruiseControlTypeStandardResult.ok()) {
+ *isSpecialValue = true;
+ return isCruiseControlTypeStandardResult.error();
+ }
+ if (isCruiseControlTypeStandardResult.value()) {
+ *isSpecialValue = true;
+ return StatusError(StatusCode::NOT_AVAILABLE_DISABLED)
+ << "tried to get target time gap or lead vehicle measured distance value "
+ << "while on a standard CC setting";
+ }
+ return nullptr;
}
default:
// Do nothing.
@@ -730,7 +761,13 @@
}
auto& dependentPropConfig = dependentPropConfigResult.value();
for (auto& areaConfig : dependentPropConfig->areaConfigs) {
- auto propValue = createAdasStateReq(dependentPropId, areaConfig.areaId, state);
+ int32_t hardcoded_state = state;
+ // TODO: restore old/initial values here instead of hardcoded value (b/295542701)
+ if (state == 1 && dependentPropId == toInt(VehicleProperty::CRUISE_CONTROL_TYPE)) {
+ hardcoded_state = toInt(CruiseControlType::ADAPTIVE);
+ }
+ auto propValue =
+ createAdasStateReq(dependentPropId, areaConfig.areaId, hardcoded_state);
// This will trigger a property change event for the current ADAS property value.
mServerSidePropStore->writeValue(std::move(propValue), /*updateStatus=*/true,
VehiclePropertyStore::EventMode::ALWAYS);
@@ -777,6 +814,8 @@
}
}
+ VhalResult<void> isAdasPropertyAvailableResult;
+ VhalResult<bool> isCruiseControlTypeStandardResult;
switch (propId) {
case toInt(VehicleProperty::AP_POWER_STATE_REPORT):
*isSpecialValue = true;
@@ -795,14 +834,14 @@
case OBD2_FREEZE_FRAME_CLEAR:
*isSpecialValue = true;
return mFakeObd2Frame->clearObd2FreezeFrames(value);
- case VENDOR_PROPERTY_ID:
+ case toInt(TestVendorProperty::VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING):
*isSpecialValue = true;
return StatusError((StatusCode)VENDOR_ERROR_CODE);
case toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION):
*isSpecialValue = true;
return setHvacTemperatureValueSuggestion(value);
case toInt(VehicleProperty::LANE_CENTERING_ASSIST_COMMAND): {
- auto isAdasPropertyAvailableResult =
+ isAdasPropertyAvailableResult =
isAdasPropertyAvailable(toInt(VehicleProperty::LANE_CENTERING_ASSIST_STATE));
if (!isAdasPropertyAvailableResult.ok()) {
*isSpecialValue = true;
@@ -810,14 +849,47 @@
return isAdasPropertyAvailableResult;
}
case toInt(VehicleProperty::CRUISE_CONTROL_COMMAND):
- [[fallthrough]];
- case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP): {
- auto isAdasPropertyAvailableResult =
+ isAdasPropertyAvailableResult =
isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_STATE));
if (!isAdasPropertyAvailableResult.ok()) {
*isSpecialValue = true;
+ return isAdasPropertyAvailableResult;
}
- return isAdasPropertyAvailableResult;
+ isCruiseControlTypeStandardResult = isCruiseControlTypeStandard();
+ if (!isCruiseControlTypeStandardResult.ok()) {
+ *isSpecialValue = true;
+ return isCruiseControlTypeStandardResult.error();
+ }
+ if (isCruiseControlTypeStandardResult.value() &&
+ (value.value.int32Values[0] ==
+ toInt(CruiseControlCommand::INCREASE_TARGET_TIME_GAP) ||
+ value.value.int32Values[0] ==
+ toInt(CruiseControlCommand::DECREASE_TARGET_TIME_GAP))) {
+ *isSpecialValue = true;
+ return StatusError(StatusCode::NOT_AVAILABLE_DISABLED)
+ << "tried to use a change target time gap command while on a standard CC "
+ << "setting";
+ }
+ return {};
+ case toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP): {
+ isAdasPropertyAvailableResult =
+ isAdasPropertyAvailable(toInt(VehicleProperty::CRUISE_CONTROL_STATE));
+ if (!isAdasPropertyAvailableResult.ok()) {
+ *isSpecialValue = true;
+ return isAdasPropertyAvailableResult;
+ }
+ isCruiseControlTypeStandardResult = isCruiseControlTypeStandard();
+ if (!isCruiseControlTypeStandardResult.ok()) {
+ *isSpecialValue = true;
+ return isCruiseControlTypeStandardResult.error();
+ }
+ if (isCruiseControlTypeStandardResult.value()) {
+ *isSpecialValue = true;
+ return StatusError(StatusCode::NOT_AVAILABLE_DISABLED)
+ << "tried to set target time gap or lead vehicle measured distance value "
+ << "while on a standard CC setting";
+ }
+ return {};
}
#ifdef ENABLE_VEHICLE_HAL_TEST_PROPERTIES
@@ -827,9 +899,9 @@
[[fallthrough]];
case toInt(VehicleProperty::CLUSTER_NAVIGATION_STATE):
[[fallthrough]];
- case VENDOR_CLUSTER_SWITCH_UI:
+ case toInt(TestVendorProperty::VENDOR_CLUSTER_SWITCH_UI):
[[fallthrough]];
- case VENDOR_CLUSTER_DISPLAY_STATE:
+ case toInt(TestVendorProperty::VENDOR_CLUSTER_DISPLAY_STATE):
*isSpecialValue = true;
updatedValue = mValuePool->obtain(getPropType(value.prop));
updatedValue->prop = value.prop & ~toInt(VehiclePropertyGroup::MASK);
diff --git a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp
index 8d8fcf5..b763d2f 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/Android.bp
@@ -21,11 +21,14 @@
cc_test {
name: "FakeVehicleHardwareTest",
vendor: true,
- srcs: ["*.cpp"],
+ srcs: [
+ "*.cpp",
+ ":VhalTestVendorProperties",
+ ],
cflags: ["-DENABLE_VEHICLE_HAL_TEST_PROPERTIES"],
header_libs: [
"IVehicleHardware",
- "VehicleHalTestUtilHeaders",
+ "libbinder_headers",
],
static_libs: [
"VehicleHalJsonConfigLoaderEnableTestProperties",
@@ -47,7 +50,9 @@
":FakeVehicleHardwareTestOverrideJson",
":FakeVehicleHardwareTestPropJson",
],
- defaults: ["VehicleHalDefaults"],
+ defaults: [
+ "VehicleHalDefaults",
+ ],
test_suites: ["device-tests"],
}
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 ae1c0f6..6cc06bc 100644
--- a/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
+++ b/automotive/vehicle/aidl/impl/fake_impl/hardware/test/FakeVehicleHardwareTest.cpp
@@ -19,9 +19,9 @@
#include <FakeObd2Frame.h>
#include <FakeUserHal.h>
#include <PropertyUtils.h>
-#include <TestPropertyUtils.h>
#include <aidl/android/hardware/automotive/vehicle/VehicleApPowerStateShutdownParam.h>
+#include <android/hardware/automotive/vehicle/TestVendorProperty.h>
#include <android-base/expected.h>
#include <android-base/file.h>
@@ -62,6 +62,8 @@
namespace fake {
namespace {
+using ::aidl::android::hardware::automotive::vehicle::CruiseControlCommand;
+using ::aidl::android::hardware::automotive::vehicle::CruiseControlType;
using ::aidl::android::hardware::automotive::vehicle::ErrorState;
using ::aidl::android::hardware::automotive::vehicle::GetValueRequest;
using ::aidl::android::hardware::automotive::vehicle::GetValueResult;
@@ -427,13 +429,13 @@
continue;
}
- if (propId == ECHO_REVERSE_BYTES) {
+ if (propId == toInt(TestVendorProperty::ECHO_REVERSE_BYTES)) {
// Ignore ECHO_REVERSE_BYTES, it has special logic.
continue;
}
- if (propId == VENDOR_PROPERTY_ID) {
- // Ignore VENDOR_PROPERTY_ID, it has special logic.
+ if (propId == toInt(TestVendorProperty::VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING)) {
+ // Ignore VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING, it has special logic.
continue;
}
@@ -966,7 +968,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = VENDOR_CLUSTER_REPORT_STATE,
+ .prop = toInt(TestVendorProperty::
+ VENDOR_CLUSTER_REPORT_STATE),
.value.int32Values = {1},
},
},
@@ -983,7 +986,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = VENDOR_CLUSTER_REQUEST_DISPLAY,
+ .prop = toInt(TestVendorProperty::
+ VENDOR_CLUSTER_REQUEST_DISPLAY),
.value.int32Values = {1},
},
},
@@ -1001,7 +1005,8 @@
.expectedValuesToGet =
{
VehiclePropValue{
- .prop = VENDOR_CLUSTER_NAVIGATION_STATE,
+ .prop = toInt(TestVendorProperty::
+ VENDOR_CLUSTER_NAVIGATION_STATE),
.value.byteValues = {0x1},
},
},
@@ -1011,7 +1016,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = VENDOR_CLUSTER_SWITCH_UI,
+ .prop = toInt(
+ TestVendorProperty::VENDOR_CLUSTER_SWITCH_UI),
.value.int32Values = {1},
},
},
@@ -1028,7 +1034,8 @@
.valuesToSet =
{
VehiclePropValue{
- .prop = VENDOR_CLUSTER_DISPLAY_STATE,
+ .prop = toInt(TestVendorProperty::
+ VENDOR_CLUSTER_DISPLAY_STATE),
.value.int32Values = {1, 2},
},
},
@@ -1454,7 +1461,7 @@
},
VehiclePropValue{
.prop = toInt(VehicleProperty::CRUISE_CONTROL_TYPE),
- .value.int32Values = {1},
+ .value.int32Values = {2},
},
VehiclePropValue{
.prop = toInt(VehicleProperty::CRUISE_CONTROL_STATE),
@@ -1834,6 +1841,47 @@
}
}
+TEST_F(FakeVehicleHardwareTest, testGetAccPropertiesOnStandardCc) {
+ std::vector<int32_t> ccTypeDependentProperties = {
+ toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP),
+ toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_LEAD_VEHICLE_MEASURED_DISTANCE),
+ };
+
+ StatusCode status =
+ setValue(VehiclePropValue{.prop = toInt(VehicleProperty::CRUISE_CONTROL_TYPE),
+ .value.int32Values = {toInt(CruiseControlType::STANDARD)}});
+ EXPECT_EQ(status, StatusCode::OK);
+
+ for (int32_t dependentProp : ccTypeDependentProperties) {
+ auto getValueResult = getValue(VehiclePropValue{.prop = dependentProp});
+ EXPECT_FALSE(getValueResult.ok());
+ EXPECT_EQ(getValueResult.error(), StatusCode::NOT_AVAILABLE_DISABLED);
+ }
+}
+
+TEST_F(FakeVehicleHardwareTest, testSetAccPropertiesOnStandardCc) {
+ std::vector<VehiclePropValue> testVehiclePropValues = {
+ VehiclePropValue{
+ .prop = toInt(VehicleProperty::ADAPTIVE_CRUISE_CONTROL_TARGET_TIME_GAP),
+ .value.int32Values = {3}},
+ VehiclePropValue{
+ .prop = toInt(VehicleProperty::CRUISE_CONTROL_COMMAND),
+ .value.int32Values = {toInt(CruiseControlCommand::INCREASE_TARGET_TIME_GAP)}},
+ VehiclePropValue{
+ .prop = toInt(VehicleProperty::CRUISE_CONTROL_COMMAND),
+ .value.int32Values = {toInt(CruiseControlCommand::DECREASE_TARGET_TIME_GAP)}}};
+
+ StatusCode status =
+ setValue(VehiclePropValue{.prop = toInt(VehicleProperty::CRUISE_CONTROL_TYPE),
+ .value.int32Values = {toInt(CruiseControlType::STANDARD)}});
+ EXPECT_EQ(status, StatusCode::OK);
+
+ for (auto value : testVehiclePropValues) {
+ status = setValue(value);
+ EXPECT_EQ(status, StatusCode::NOT_AVAILABLE_DISABLED);
+ }
+}
+
TEST_F(FakeVehicleHardwareTest, testSendAdasPropertiesState) {
std::unordered_map<int32_t, std::vector<int32_t>> adasEnabledPropToAdasPropWithErrorState = {
// AEB
@@ -2885,7 +2933,7 @@
TEST_F(FakeVehicleHardwareTest, testGetEchoReverseBytes) {
ASSERT_EQ(setValue(VehiclePropValue{
- .prop = ECHO_REVERSE_BYTES,
+ .prop = toInt(TestVendorProperty::ECHO_REVERSE_BYTES),
.value =
{
.byteValues = {0x01, 0x02, 0x03, 0x04},
@@ -2894,7 +2942,7 @@
StatusCode::OK);
auto result = getValue(VehiclePropValue{
- .prop = ECHO_REVERSE_BYTES,
+ .prop = toInt(TestVendorProperty::ECHO_REVERSE_BYTES),
});
ASSERT_TRUE(result.ok()) << "failed to get ECHO_REVERSE_BYTES value: " << getStatus(result);
diff --git a/automotive/vehicle/aidl/impl/utils/README.md b/automotive/vehicle/aidl/impl/utils/README.md
index 87bb7e3..255131d 100644
--- a/automotive/vehicle/aidl/impl/utils/README.md
+++ b/automotive/vehicle/aidl/impl/utils/README.md
@@ -57,6 +57,6 @@
Defines many useful utility functions.
-## test
+## test_vendor_properties
-Defines utility libraries for test only.
+Contains vendor properties used for testing purpose in reference VHAL.
diff --git a/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h b/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h
index 7275ba3..e41ec30 100644
--- a/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h
+++ b/automotive/vehicle/aidl/impl/utils/common/include/PropertyUtils.h
@@ -77,22 +77,6 @@
constexpr int SEAT_2_LEFT = toInt(propertyutils_impl::VehicleAreaSeat::ROW_2_LEFT);
constexpr int SEAT_2_RIGHT = toInt(propertyutils_impl::VehicleAreaSeat::ROW_2_RIGHT);
constexpr int SEAT_2_CENTER = toInt(propertyutils_impl::VehicleAreaSeat::ROW_2_CENTER);
-constexpr int VENDOR_EXTENSION_BOOLEAN_PROPERTY =
- 0x101 | toInt(propertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(propertyutils_impl::VehiclePropertyType::BOOLEAN) |
- toInt(propertyutils_impl::VehicleArea::DOOR);
-constexpr int VENDOR_EXTENSION_FLOAT_PROPERTY =
- 0x102 | toInt(propertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(propertyutils_impl::VehiclePropertyType::FLOAT) |
- toInt(propertyutils_impl::VehicleArea::SEAT);
-constexpr int VENDOR_EXTENSION_INT_PROPERTY =
- 0x103 | toInt(propertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(propertyutils_impl::VehiclePropertyType::INT32) |
- toInt(propertyutils_impl::VehicleArea::WINDOW);
-constexpr int VENDOR_EXTENSION_STRING_PROPERTY =
- 0x104 | toInt(propertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(propertyutils_impl::VehiclePropertyType::STRING) |
- toInt(propertyutils_impl::VehicleArea::GLOBAL);
constexpr int FUEL_DOOR_REAR_LEFT = toInt(propertyutils_impl::PortLocationType::REAR_LEFT);
constexpr int CHARGE_PORT_FRONT_LEFT = toInt(propertyutils_impl::PortLocationType::FRONT_LEFT);
constexpr int CHARGE_PORT_REAR_LEFT = toInt(propertyutils_impl::PortLocationType::REAR_LEFT);
diff --git a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp
index 250b331..dd43712 100644
--- a/automotive/vehicle/aidl/impl/utils/common/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/utils/common/test/Android.bp
@@ -27,7 +27,6 @@
"libgtest",
"libgmock",
],
- header_libs: ["VehicleHalTestUtilHeaders"],
defaults: ["VehicleHalDefaults"],
test_suites: ["device-tests"],
}
diff --git a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp
index 411539b..9abb2a2 100644
--- a/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp
+++ b/automotive/vehicle/aidl/impl/utils/common/test/VehicleUtilsTest.cpp
@@ -16,7 +16,6 @@
#include <ConcurrentQueue.h>
#include <PropertyUtils.h>
-#include <TestPropertyUtils.h>
#include <VehicleUtils.h>
#include <gtest/gtest.h>
@@ -56,6 +55,9 @@
constexpr int32_t int64VecProp = toInt(VehicleProperty::WHEEL_TICK);
constexpr int32_t floatProp = toInt(VehicleProperty::ENV_OUTSIDE_TEMPERATURE);
constexpr int32_t floatVecProp = toInt(VehicleProperty::HVAC_TEMPERATURE_VALUE_SUGGESTION);
+constexpr int32_t kMixedTypePropertyForTest = 0x1111 | toInt(VehiclePropertyGroup::VENDOR) |
+ toInt(VehicleArea::GLOBAL) |
+ toInt(VehiclePropertyType::MIXED);
std::vector<InvalidPropValueTestCase> getInvalidPropValuesTestCases() {
return std::vector<InvalidPropValueTestCase>(
diff --git a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h b/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h
deleted file mode 100644
index 1400288..0000000
--- a/automotive/vehicle/aidl/impl/utils/test/include/TestPropertyUtils.h
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Copyright (C) 2021 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.
- */
-
-#ifndef android_hardware_automotive_vehicle_utils_test_include_TestPropertyUtils_H_
-#define android_hardware_automotive_vehicle_utils_test_include_TestPropertyUtils_H_
-
-#include <VehicleHalTypes.h>
-#include <VehicleUtils.h>
-
-namespace android {
-namespace hardware {
-namespace automotive {
-namespace vehicle {
-
-namespace testpropertyutils_impl {
-
-// These names are not part of the API since we only expose ints.
-using ::aidl::android::hardware::automotive::vehicle::VehicleArea;
-using ::aidl::android::hardware::automotive::vehicle::VehicleProperty;
-using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyGroup;
-using ::aidl::android::hardware::automotive::vehicle::VehiclePropertyType;
-
-} // namespace testpropertyutils_impl
-
-// Converts the system property to the vendor property.
-// WARNING: This is only for the end-to-end testing, Should NOT include in the user build.
-inline constexpr int32_t toVendor(
- const aidl::android::hardware::automotive::vehicle::VehicleProperty& prop) {
- return (toInt(prop) & ~toInt(testpropertyutils_impl::VehiclePropertyGroup::MASK)) |
- toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR);
-}
-
-// These properties are used for the end-to-end testing of ClusterHomeService.
-constexpr int32_t VENDOR_CLUSTER_SWITCH_UI =
- toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_SWITCH_UI);
-constexpr int32_t VENDOR_CLUSTER_DISPLAY_STATE =
- toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_DISPLAY_STATE);
-constexpr int32_t VENDOR_CLUSTER_REPORT_STATE =
- toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_REPORT_STATE);
-constexpr int32_t VENDOR_CLUSTER_REQUEST_DISPLAY =
- toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_REQUEST_DISPLAY);
-constexpr int32_t VENDOR_CLUSTER_NAVIGATION_STATE =
- toVendor(testpropertyutils_impl::VehicleProperty::CLUSTER_NAVIGATION_STATE);
-
-// These properties are placeholder properties for developers to test new features without
-// implementing a real property.
-constexpr int32_t PLACEHOLDER_PROPERTY_INT =
- 0x2a11 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::INT32);
-constexpr int32_t PLACEHOLDER_PROPERTY_FLOAT =
- 0x2a11 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::FLOAT);
-constexpr int32_t PLACEHOLDER_PROPERTY_BOOLEAN =
- 0x2a11 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::BOOLEAN);
-constexpr int32_t PLACEHOLDER_PROPERTY_STRING =
- 0x2a11 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::STRING);
-
-// This property is used for testing LargeParcelable marshalling/unmarhsalling end to end.
-// It acts as an regular property that stores the property value when setting and return the value
-// when getting, except that all the byteValues used in the setValue response would be filled in
-// the reverse order.
-// 0x21702a12
-constexpr int32_t ECHO_REVERSE_BYTES = 0x2a12 |
- toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::BYTES);
-
-// This property is used for testing vendor error codes end to end.
-// 0x21402a13
-constexpr int32_t VENDOR_PROPERTY_ID = 0x2a13 |
- toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::INT32);
-
-// This property is used for test purpose. End to end tests use this property to test set and get
-// method for MIXED type properties.
-constexpr int32_t kMixedTypePropertyForTest =
- 0x1111 | toInt(testpropertyutils_impl::VehiclePropertyGroup::VENDOR) |
- toInt(testpropertyutils_impl::VehicleArea::GLOBAL) |
- toInt(testpropertyutils_impl::VehiclePropertyType::MIXED);
-} // namespace vehicle
-} // namespace automotive
-} // namespace hardware
-} // namespace android
-
-#endif // android_hardware_automotive_vehicle_utils_test_include_TestPropertyUtils_H_
diff --git a/automotive/vehicle/aidl/impl/utils/test/Android.bp b/automotive/vehicle/aidl/impl/utils/test_vendor_properties/Android.bp
similarity index 68%
rename from automotive/vehicle/aidl/impl/utils/test/Android.bp
rename to automotive/vehicle/aidl/impl/utils/test_vendor_properties/Android.bp
index ad9954f..62c89ac 100644
--- a/automotive/vehicle/aidl/impl/utils/test/Android.bp
+++ b/automotive/vehicle/aidl/impl/utils/test_vendor_properties/Android.bp
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2021 The Android Open Source Project
+ * 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.
@@ -18,9 +18,13 @@
default_applicable_licenses: ["Android-Apache-2.0"],
}
-cc_library_headers {
- name: "VehicleHalTestUtilHeaders",
- vendor: true,
- header_libs: ["VehicleHalUtilHeaders"],
- export_include_dirs: ["include"],
+filegroup {
+ name: "VhalTestVendorProperties",
+ srcs: [
+ "**/*.aidl",
+ ],
+ visibility: [
+ "//hardware/interfaces/automotive/vehicle/aidl:__subpackages__",
+ "//packages/services/Car:__subpackages__",
+ ],
}
diff --git a/automotive/vehicle/aidl/impl/utils/test_vendor_properties/android/hardware/automotive/vehicle/TestVendorProperty.aidl b/automotive/vehicle/aidl/impl/utils/test_vendor_properties/android/hardware/automotive/vehicle/TestVendorProperty.aidl
new file mode 100644
index 0000000..3c877fa
--- /dev/null
+++ b/automotive/vehicle/aidl/impl/utils/test_vendor_properties/android/hardware/automotive/vehicle/TestVendorProperty.aidl
@@ -0,0 +1,145 @@
+/*
+ * 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;
+
+/**
+ * Test vendor properties used in reference VHAL implementation.
+ */
+@Backing(type="int")
+enum TestVendorProperty {
+
+ /**
+ * Vendor version of CLUSTER_SWITCH_UI, used for the end-to-end testing of ClusterHomeService.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.INT32,
+ */
+ VENDOR_CLUSTER_SWITCH_UI = 0x0F34 + 0x20000000 + 0x01000000 + 0x00400000,
+
+ /**
+ * Vendor version of CLUSTER_DISPLAY_STATE, used for the end-to-end testing of
+ * ClusterHomeService.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.INT32_VEC
+ */
+ VENDOR_CLUSTER_DISPLAY_STATE = 0x0F35 + 0x20000000 + 0x01000000 + 0x00410000,
+
+ /**
+ * Vendor version of CLUSTER_REPORT_STATE, used for the end-to-end testing of
+ * ClusterHomeService.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyGroup.MIXED
+ */
+ VENDOR_CLUSTER_REPORT_STATE = 0x0F36 + 0x20000000 + 0x01000000 + 0x00E00000,
+
+ /**
+ * Vendor version of CLUSTER_REQUEST_DISPLAY, used for the end-to-end testing of
+ * ClusterHomeService.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.INT32
+ */
+ VENDOR_CLUSTER_REQUEST_DISPLAY = 0x0F37 + 0x20000000 + 0x01000000 + 0x00400000,
+
+ /**
+ * Vendor version of CLUSTER_NAVIGATION_STATE, used for the end-to-end testing of
+ * ClusterHomeService.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.BYTES
+ */
+ VENDOR_CLUSTER_NAVIGATION_STATE = 0x0F38 + 0x20000000 + 0x01000000 + 0x00700000,
+
+ // These properties are placeholder properties for developers to test new features without
+ // implementing a real property.
+
+ /**
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.INT32
+ */
+ PLACEHOLDER_PROPERTY_INT = 0x2A11 + 0x20000000 + 0x01000000 + 0x00400000,
+
+ /**
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.FLOAT
+ */
+ PLACEHOLDER_PROPERTY_FLOAT = 0x2A11 + 0x20000000 + 0x01000000 + 0x00600000,
+
+ /**
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.BOOLEAN
+ */
+ PLACEHOLDER_PROPERTY_BOOLEAN = 0x2A11 + 0x20000000 + 0x01000000 + 0x00200000,
+
+ /**
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.STRING
+ */
+ PLACEHOLDER_PROPERTY_STRING = 0x2A11 + 0x20000000 + 0x01000000 + 0x00100000,
+
+ /**
+ * This property is used for testing LargeParcelable marshalling/unmarhsalling end to end.
+ * It acts as an regular property that stores the property value when setting and return the
+ * value when getting, except that all the byteValues used in the setValue response would be
+ * filled in the reverse order.
+ *
+ * This is used in {@code VehicleHalLargeParcelableTest}.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.BYTES
+ *
+ * 0x21702a12
+ */
+ ECHO_REVERSE_BYTES = 0x2A12 + 0x20000000 + 0x01000000 + 0x00700000,
+
+ /**
+ * This property is used for testing vendor error codes end to end.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyType.INT32
+ *
+ * 0x21402a13
+ */
+ VENDOR_PROPERTY_FOR_ERROR_CODE_TESTING = 0x2A13 + 0x20000000 + 0x01000000 + 0x00400000,
+
+ /**
+ * This property is used for test purpose. End to end tests use this property to test set and
+ * get method for MIXED type properties.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyGroup.MIXED
+ */
+ MIXED_TYPE_PROPERTY_FOR_TEST = 0x1111 + 0x20000000 + 0x01000000 + 0x00E00000,
+
+ /**
+ * Property used for {@code CarVendorPropertyCustomPermissionTest}.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.DOOR | VehiclePropertyGroup.BOOLEAN
+ */
+ VENDOR_EXTENSION_BOOLEAN_PROPERTY = 0x0101 + 0x20000000 + 0x06000000 + 0x00200000,
+
+ /**
+ * Property used for {@code CarVendorPropertyCustomPermissionTest}.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.SEAT | VehiclePropertyGroup.FLOAT
+ */
+ VENDOR_EXTENSION_FLOAT_PROPERTY = 0x102 + 0x20000000 + 0x05000000 + 0x00600000,
+
+ /**
+ * Property used for {@code CarVendorPropertyCustomPermissionTest}.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.WINDOW | VehiclePropertyGroup.INT32
+ */
+ VENDOR_EXTENSION_INT_PROPERTY = 0x103 + 0x20000000 + 0x03000000 + 0x00400000,
+
+ /**
+ * Property used for {@code CarVendorPropertyCustomPermissionTest}.
+ *
+ * VehiclePropertyGroup.VENDOR | VehicleArea.GLOBAL | VehiclePropertyGroup.STRING
+ */
+ VENDOR_EXTENSION_STRING_PROPERTY = 0x103 + 0x20000000 + 0x01000000 + 0x00100000,
+}
diff --git a/automotive/vehicle/tools/generate_annotation_enums.py b/automotive/vehicle/tools/generate_annotation_enums.py
index c432e9d..fddc55b 100755
--- a/automotive/vehicle/tools/generate_annotation_enums.py
+++ b/automotive/vehicle/tools/generate_annotation_enums.py
@@ -328,7 +328,7 @@
parser = argparse.ArgumentParser(
description='Generate Java and C++ enums based on annotations in VehicleProperty.aidl')
parser.add_argument('--android_build_top', required=False, help='Path to ANDROID_BUILD_TOP')
- parser.add_argument('--preupload_files', nargs='+', required=False, help='modified files')
+ parser.add_argument('--preupload_files', nargs='*', required=False, help='modified files')
parser.add_argument('--check_only', required=False, action='store_true',
help='only check whether the generated files need update')
parser.add_argument('--output_csv', required=False,
diff --git a/bluetooth/aidl/default/Android.bp b/bluetooth/aidl/default/Android.bp
index 32d1a13..3f4ba99 100644
--- a/bluetooth/aidl/default/Android.bp
+++ b/bluetooth/aidl/default/Android.bp
@@ -30,15 +30,8 @@
defaults: ["android.hardware.bluetooth-service-build-defaults"],
srcs: [
"BluetoothHci.cpp",
- ":BluetoothPacketSources",
"net_bluetooth_mgmt.cpp",
],
- generated_headers: [
- "BluetoothGeneratedPackets_h",
- ],
- include_dirs: [
- "packages/modules/Bluetooth/system/gd",
- ],
}
cc_binary {
diff --git a/bluetooth/aidl/default/BluetoothHci.cpp b/bluetooth/aidl/default/BluetoothHci.cpp
index 013ab7f..9862e9e 100644
--- a/bluetooth/aidl/default/BluetoothHci.cpp
+++ b/bluetooth/aidl/default/BluetoothHci.cpp
@@ -29,11 +29,6 @@
#include "log/log.h"
-// TODO: Remove custom logging defines from PDL packets.
-#undef LOG_INFO
-#undef LOG_DEBUG
-#include "hci/hci_packets.h"
-
namespace {
int SetTerminalRaw(int fd) {
termios terminal_settings;
@@ -140,9 +135,7 @@
void BluetoothHci::reset() {
// Send a reset command and wait until the command complete comes back.
- std::vector<uint8_t> reset;
- ::bluetooth::packet::BitInserter bi{reset};
- ::bluetooth::hci::ResetBuilder::Create()->Serialize(bi);
+ std::vector<uint8_t> reset = {0x03, 0x0c, 0x00};
auto resetPromise = std::make_shared<std::promise<void>>();
auto resetFuture = resetPromise->get_future();
@@ -162,13 +155,15 @@
static_cast<int>(raw_sco.size()));
},
[resetPromise](const std::vector<uint8_t>& raw_event) {
- bool valid = ::bluetooth::hci::ResetCompleteView::Create(
- ::bluetooth::hci::CommandCompleteView::Create(
- ::bluetooth::hci::EventView::Create(
- ::bluetooth::hci::PacketView<true>(
- std::make_shared<std::vector<uint8_t>>(
- raw_event)))))
- .IsValid();
+ std::vector<uint8_t> reset_complete = {0x0e, 0x04, 0x01,
+ 0x03, 0x0c, 0x00};
+ bool valid = raw_event.size() == 6 &&
+ raw_event[0] == reset_complete[0] &&
+ raw_event[1] == reset_complete[1] &&
+ // Don't compare the number of packets field.
+ raw_event[3] == reset_complete[3] &&
+ raw_event[4] == reset_complete[4] &&
+ raw_event[5] == reset_complete[5];
if (valid) {
resetPromise->set_value();
} else {
@@ -306,7 +301,8 @@
{
std::lock_guard<std::mutex> guard(mStateMutex);
if (mState != HalState::ONE_CLIENT) {
- ASSERT(mState != HalState::INITIALIZING);
+ LOG_ALWAYS_FATAL_IF(mState == HalState::INITIALIZING,
+ "mState is INITIALIZING");
ALOGI("Already closed");
return ndk::ScopedAStatus::ok();
}
diff --git a/boot/1.0/vts/functional/OWNERS b/boot/1.0/vts/functional/OWNERS
index 36e79be..5aeb4df 100644
--- a/boot/1.0/vts/functional/OWNERS
+++ b/boot/1.0/vts/functional/OWNERS
@@ -1,2 +1,2 @@
-# Bug component: 30545
+# Bug component: 1014951
dvander@google.com
diff --git a/boot/1.1/vts/functional/OWNERS b/boot/1.1/vts/functional/OWNERS
index 36e79be..5aeb4df 100644
--- a/boot/1.1/vts/functional/OWNERS
+++ b/boot/1.1/vts/functional/OWNERS
@@ -1,2 +1,2 @@
-# Bug component: 30545
+# Bug component: 1014951
dvander@google.com
diff --git a/boot/aidl/vts/functional/OWNERS b/boot/aidl/vts/functional/OWNERS
index bc813d8..c67d246 100644
--- a/boot/aidl/vts/functional/OWNERS
+++ b/boot/aidl/vts/functional/OWNERS
@@ -1,2 +1,2 @@
-# Bug component: 30545
+# Bug component: 1014951
zhangkelvin@google.com
diff --git a/cas/1.0/default/CasImpl.cpp b/cas/1.0/default/CasImpl.cpp
index 178020e..98e7593 100644
--- a/cas/1.0/default/CasImpl.cpp
+++ b/cas/1.0/default/CasImpl.cpp
@@ -103,8 +103,7 @@
Return<Status> CasImpl::setSessionPrivateData(
const HidlCasSessionId &sessionId, const HidlCasData& pvtData) {
- ALOGV("%s: sessionId=%s", __FUNCTION__,
- sessionIdToString(sessionId).string());
+ ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
@@ -113,8 +112,7 @@
}
Return<Status> CasImpl::closeSession(const HidlCasSessionId &sessionId) {
- ALOGV("%s: sessionId=%s", __FUNCTION__,
- sessionIdToString(sessionId).string());
+ ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
@@ -124,8 +122,7 @@
Return<Status> CasImpl::processEcm(
const HidlCasSessionId &sessionId, const HidlCasData& ecm) {
- ALOGV("%s: sessionId=%s", __FUNCTION__,
- sessionIdToString(sessionId).string());
+ ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
diff --git a/cas/1.0/default/DescramblerImpl.cpp b/cas/1.0/default/DescramblerImpl.cpp
index f79b32d..6b730eb 100644
--- a/cas/1.0/default/DescramblerImpl.cpp
+++ b/cas/1.0/default/DescramblerImpl.cpp
@@ -62,8 +62,7 @@
}
Return<Status> DescramblerImpl::setMediaCasSession(const HidlCasSessionId& sessionId) {
- ALOGV("%s: sessionId=%s", __FUNCTION__,
- sessionIdToString(sessionId).string());
+ ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<DescramblerPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
diff --git a/cas/1.0/default/FactoryLoader.h b/cas/1.0/default/FactoryLoader.h
index 45e515a..3d49d9e 100644
--- a/cas/1.0/default/FactoryLoader.h
+++ b/cas/1.0/default/FactoryLoader.h
@@ -17,6 +17,7 @@
#ifndef ANDROID_HARDWARE_CAS_V1_0_FACTORY_LOADER_H_
#define ANDROID_HARDWARE_CAS_V1_0_FACTORY_LOADER_H_
+#include <android-base/strings.h>
#include <dirent.h>
#include <dlfcn.h>
#include "SharedLibrary.h"
@@ -98,17 +99,17 @@
String8 dirPath("/vendor/lib/mediacas");
#endif
- DIR* pDir = opendir(dirPath.string());
+ DIR* pDir = opendir(dirPath.c_str());
if (pDir == NULL) {
- ALOGE("Failed to open plugin directory %s", dirPath.string());
+ ALOGE("Failed to open plugin directory %s", dirPath.c_str());
return false;
}
struct dirent* pEntry;
while ((pEntry = readdir(pDir))) {
String8 pluginPath = dirPath + "/" + pEntry->d_name;
- if (pluginPath.getPathExtension() == ".so") {
+ if (base::EndsWith(pluginPath.c_str(), ".so")) {
if (loadFactoryForSchemeFromPath(
pluginPath, CA_system_id, library, factory)) {
mCASystemIdToLibraryPathMap.add(CA_system_id, pluginPath);
@@ -138,10 +139,10 @@
String8 dirPath("/vendor/lib/mediacas");
#endif
- DIR* pDir = opendir(dirPath.string());
+ DIR* pDir = opendir(dirPath.c_str());
if (pDir == NULL) {
- ALOGE("Failed to open plugin directory %s", dirPath.string());
+ ALOGE("Failed to open plugin directory %s", dirPath.c_str());
return false;
}
@@ -150,7 +151,7 @@
struct dirent* pEntry;
while ((pEntry = readdir(pDir))) {
String8 pluginPath = dirPath + "/" + pEntry->d_name;
- if (pluginPath.getPathExtension() == ".so") {
+ if (base::EndsWith(pluginPath.c_str(), ".so")) {
queryPluginsFromPath(pluginPath, results);
}
}
diff --git a/cas/1.0/default/SharedLibrary.cpp b/cas/1.0/default/SharedLibrary.cpp
index 9c7f385..90c84b8 100644
--- a/cas/1.0/default/SharedLibrary.cpp
+++ b/cas/1.0/default/SharedLibrary.cpp
@@ -29,7 +29,7 @@
namespace implementation {
SharedLibrary::SharedLibrary(const String8 &path) {
- mLibHandle = dlopen(path.string(), RTLD_NOW);
+ mLibHandle = dlopen(path.c_str(), RTLD_NOW);
}
SharedLibrary::~SharedLibrary() {
diff --git a/cas/1.1/default/CasImpl.cpp b/cas/1.1/default/CasImpl.cpp
index 4cc6017..105e036 100644
--- a/cas/1.1/default/CasImpl.cpp
+++ b/cas/1.1/default/CasImpl.cpp
@@ -125,7 +125,7 @@
Return<Status> CasImpl::setSessionPrivateData(const HidlCasSessionId& sessionId,
const HidlCasData& pvtData) {
- ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
+ ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
@@ -134,7 +134,7 @@
}
Return<Status> CasImpl::closeSession(const HidlCasSessionId& sessionId) {
- ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
+ ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
@@ -143,7 +143,7 @@
}
Return<Status> CasImpl::processEcm(const HidlCasSessionId& sessionId, const HidlCasData& ecm) {
- ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
+ ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
diff --git a/cas/1.1/default/DescramblerImpl.cpp b/cas/1.1/default/DescramblerImpl.cpp
index 309cd3c..9d2ead7 100644
--- a/cas/1.1/default/DescramblerImpl.cpp
+++ b/cas/1.1/default/DescramblerImpl.cpp
@@ -59,7 +59,7 @@
}
Return<Status> DescramblerImpl::setMediaCasSession(const HidlCasSessionId& sessionId) {
- ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
+ ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<DescramblerPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
diff --git a/cas/1.1/default/FactoryLoader.h b/cas/1.1/default/FactoryLoader.h
index 121f90c..a575df6 100644
--- a/cas/1.1/default/FactoryLoader.h
+++ b/cas/1.1/default/FactoryLoader.h
@@ -17,6 +17,7 @@
#ifndef ANDROID_HARDWARE_CAS_V1_1_FACTORY_LOADER_H_
#define ANDROID_HARDWARE_CAS_V1_1_FACTORY_LOADER_H_
+#include <android-base/strings.h>
#include <dirent.h>
#include <dlfcn.h>
#include <media/cas/CasAPI.h>
@@ -90,17 +91,17 @@
#else
String8 dirPath("/vendor/lib/mediacas");
#endif
- DIR* pDir = opendir(dirPath.string());
+ DIR* pDir = opendir(dirPath.c_str());
if (pDir == NULL) {
- ALOGE("Failed to open plugin directory %s", dirPath.string());
+ ALOGE("Failed to open plugin directory %s", dirPath.c_str());
return false;
}
struct dirent* pEntry;
while ((pEntry = readdir(pDir))) {
String8 pluginPath = dirPath + "/" + pEntry->d_name;
- if (pluginPath.getPathExtension() == ".so") {
+ if (base::EndsWith(pluginPath.c_str(), ".so")) {
if (loadFactoryForSchemeFromPath(pluginPath, CA_system_id, library, factory)) {
mCASystemIdToLibraryPathMap.add(CA_system_id, pluginPath);
closedir(pDir);
@@ -127,10 +128,10 @@
#else
String8 dirPath("/vendor/lib/mediacas");
#endif
- DIR* pDir = opendir(dirPath.string());
+ DIR* pDir = opendir(dirPath.c_str());
if (pDir == NULL) {
- ALOGE("Failed to open plugin directory %s", dirPath.string());
+ ALOGE("Failed to open plugin directory %s", dirPath.c_str());
return false;
}
@@ -139,7 +140,7 @@
struct dirent* pEntry;
while ((pEntry = readdir(pDir))) {
String8 pluginPath = dirPath + "/" + pEntry->d_name;
- if (pluginPath.getPathExtension() == ".so") {
+ if (base::EndsWith(pluginPath.c_str(), ".so")) {
queryPluginsFromPath(pluginPath, results);
}
}
diff --git a/cas/1.1/default/SharedLibrary.cpp b/cas/1.1/default/SharedLibrary.cpp
index ffe4bb9..ac5dbcf 100644
--- a/cas/1.1/default/SharedLibrary.cpp
+++ b/cas/1.1/default/SharedLibrary.cpp
@@ -29,7 +29,7 @@
namespace implementation {
SharedLibrary::SharedLibrary(const String8& path) {
- mLibHandle = dlopen(path.string(), RTLD_NOW);
+ mLibHandle = dlopen(path.c_str(), RTLD_NOW);
}
SharedLibrary::~SharedLibrary() {
diff --git a/cas/1.2/default/CasImpl.cpp b/cas/1.2/default/CasImpl.cpp
index 46dd251..b1038bc 100644
--- a/cas/1.2/default/CasImpl.cpp
+++ b/cas/1.2/default/CasImpl.cpp
@@ -174,7 +174,7 @@
Return<Status> CasImpl::setSessionPrivateData(const HidlCasSessionId& sessionId,
const HidlCasData& pvtData) {
- ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
+ ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
@@ -183,7 +183,7 @@
}
Return<Status> CasImpl::closeSession(const HidlCasSessionId& sessionId) {
- ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
+ ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
@@ -192,7 +192,7 @@
}
Return<Status> CasImpl::processEcm(const HidlCasSessionId& sessionId, const HidlCasData& ecm) {
- ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
+ ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<CasPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
diff --git a/cas/1.2/default/DescramblerImpl.cpp b/cas/1.2/default/DescramblerImpl.cpp
index 309cd3c..9d2ead7 100644
--- a/cas/1.2/default/DescramblerImpl.cpp
+++ b/cas/1.2/default/DescramblerImpl.cpp
@@ -59,7 +59,7 @@
}
Return<Status> DescramblerImpl::setMediaCasSession(const HidlCasSessionId& sessionId) {
- ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
+ ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
std::shared_ptr<DescramblerPlugin> holder = std::atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
diff --git a/cas/1.2/default/FactoryLoader.h b/cas/1.2/default/FactoryLoader.h
index a374b31..0b05bfc 100644
--- a/cas/1.2/default/FactoryLoader.h
+++ b/cas/1.2/default/FactoryLoader.h
@@ -17,6 +17,7 @@
#ifndef ANDROID_HARDWARE_CAS_V1_1_FACTORY_LOADER_H_
#define ANDROID_HARDWARE_CAS_V1_1_FACTORY_LOADER_H_
+#include <android-base/strings.h>
#include <dirent.h>
#include <dlfcn.h>
#include <media/cas/CasAPI.h>
@@ -90,17 +91,17 @@
#else
String8 dirPath("/vendor/lib/mediacas");
#endif
- DIR* pDir = opendir(dirPath.string());
+ DIR* pDir = opendir(dirPath.c_str());
if (pDir == NULL) {
- ALOGE("Failed to open plugin directory %s", dirPath.string());
+ ALOGE("Failed to open plugin directory %s", dirPath.c_str());
return false;
}
struct dirent* pEntry;
while ((pEntry = readdir(pDir))) {
String8 pluginPath = dirPath + "/" + pEntry->d_name;
- if (pluginPath.getPathExtension() == ".so") {
+ if (base::EndsWith(pluginPath.c_str(), ".so")) {
if (loadFactoryForSchemeFromPath(pluginPath, CA_system_id, library, factory)) {
mCASystemIdToLibraryPathMap.add(CA_system_id, pluginPath);
closedir(pDir);
@@ -127,10 +128,10 @@
#else
String8 dirPath("/vendor/lib/mediacas");
#endif
- DIR* pDir = opendir(dirPath.string());
+ DIR* pDir = opendir(dirPath.c_str());
if (pDir == NULL) {
- ALOGE("Failed to open plugin directory %s", dirPath.string());
+ ALOGE("Failed to open plugin directory %s", dirPath.c_str());
return false;
}
@@ -139,7 +140,7 @@
struct dirent* pEntry;
while ((pEntry = readdir(pDir))) {
String8 pluginPath = dirPath + "/" + pEntry->d_name;
- if (pluginPath.getPathExtension() == ".so") {
+ if (base::EndsWith(pluginPath.c_str(), ".so")) {
queryPluginsFromPath(pluginPath, results);
}
}
diff --git a/cas/1.2/default/SharedLibrary.cpp b/cas/1.2/default/SharedLibrary.cpp
index ffe4bb9..ac5dbcf 100644
--- a/cas/1.2/default/SharedLibrary.cpp
+++ b/cas/1.2/default/SharedLibrary.cpp
@@ -29,7 +29,7 @@
namespace implementation {
SharedLibrary::SharedLibrary(const String8& path) {
- mLibHandle = dlopen(path.string(), RTLD_NOW);
+ mLibHandle = dlopen(path.c_str(), RTLD_NOW);
}
SharedLibrary::~SharedLibrary() {
diff --git a/cas/aidl/OWNERS b/cas/aidl/OWNERS
deleted file mode 100755
index 4c55752..0000000
--- a/cas/aidl/OWNERS
+++ /dev/null
@@ -1,3 +0,0 @@
-# Bug component: 1344
-quxiangfang@google.com
-hgchen@google.com
diff --git a/cas/aidl/default/CasImpl.cpp b/cas/aidl/default/CasImpl.cpp
index f08fcc0..9885e16 100644
--- a/cas/aidl/default/CasImpl.cpp
+++ b/cas/aidl/default/CasImpl.cpp
@@ -158,7 +158,7 @@
ScopedAStatus CasImpl::setSessionPrivateData(const vector<uint8_t>& sessionId,
const vector<uint8_t>& pvtData) {
- ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
+ ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
shared_ptr<CasPlugin> holder = atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
@@ -167,7 +167,7 @@
}
ScopedAStatus CasImpl::closeSession(const vector<uint8_t>& sessionId) {
- ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
+ ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
shared_ptr<CasPlugin> holder = atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
@@ -176,7 +176,7 @@
}
ScopedAStatus CasImpl::processEcm(const vector<uint8_t>& sessionId, const vector<uint8_t>& ecm) {
- ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).string());
+ ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(sessionId).c_str());
shared_ptr<CasPlugin> holder = atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
return toStatus(INVALID_OPERATION);
diff --git a/cas/aidl/default/DescramblerImpl.cpp b/cas/aidl/default/DescramblerImpl.cpp
index a96fd46..d658887 100644
--- a/cas/aidl/default/DescramblerImpl.cpp
+++ b/cas/aidl/default/DescramblerImpl.cpp
@@ -54,7 +54,7 @@
}
ScopedAStatus DescramblerImpl::setMediaCasSession(const vector<uint8_t>& in_sessionId) {
- ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(in_sessionId).string());
+ ALOGV("%s: sessionId=%s", __FUNCTION__, sessionIdToString(in_sessionId).c_str());
shared_ptr<DescramblerPlugin> holder = atomic_load(&mPluginHolder);
if (holder.get() == nullptr) {
diff --git a/cas/aidl/default/FactoryLoader.h b/cas/aidl/default/FactoryLoader.h
index 443ea1f..bc3d715 100644
--- a/cas/aidl/default/FactoryLoader.h
+++ b/cas/aidl/default/FactoryLoader.h
@@ -87,10 +87,10 @@
#else
String8 dirPath("/vendor/lib/mediacas");
#endif
- DIR* pDir = opendir(dirPath.string());
+ DIR* pDir = opendir(dirPath.c_str());
if (pDir == NULL) {
- ALOGE("Failed to open plugin directory %s", dirPath.string());
+ ALOGE("Failed to open plugin directory %s", dirPath.c_str());
return false;
}
@@ -124,10 +124,10 @@
#else
String8 dirPath("/vendor/lib/mediacas");
#endif
- DIR* pDir = opendir(dirPath.string());
+ DIR* pDir = opendir(dirPath.c_str());
if (pDir == NULL) {
- ALOGE("Failed to open plugin directory %s", dirPath.string());
+ ALOGE("Failed to open plugin directory %s", dirPath.c_str());
return false;
}
diff --git a/cas/aidl/default/SharedLibrary.cpp b/cas/aidl/default/SharedLibrary.cpp
index e79f383..c12d17d 100644
--- a/cas/aidl/default/SharedLibrary.cpp
+++ b/cas/aidl/default/SharedLibrary.cpp
@@ -26,7 +26,7 @@
namespace cas {
SharedLibrary::SharedLibrary(const String8& path) {
- mLibHandle = dlopen(path.string(), RTLD_NOW);
+ mLibHandle = dlopen(path.c_str(), RTLD_NOW);
}
SharedLibrary::~SharedLibrary() {
diff --git a/compatibility_matrices/compatibility_matrix.8.xml b/compatibility_matrices/compatibility_matrix.8.xml
index 40bd600..9e3b8f9 100644
--- a/compatibility_matrices/compatibility_matrix.8.xml
+++ b/compatibility_matrices/compatibility_matrix.8.xml
@@ -367,7 +367,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="aidl" optional="true">
+ <hal format="aidl" optional="true" updatable-via-apex="true">
<name>android.hardware.neuralnetworks</name>
<version>1-4</version>
<interface>
diff --git a/compatibility_matrices/compatibility_matrix.9.xml b/compatibility_matrices/compatibility_matrix.9.xml
index eb3f74d..9a9af1c 100644
--- a/compatibility_matrices/compatibility_matrix.9.xml
+++ b/compatibility_matrices/compatibility_matrix.9.xml
@@ -216,7 +216,7 @@
</hal>
<hal format="aidl" optional="true">
<name>android.hardware.gnss</name>
- <version>2-3</version>
+ <version>2-4</version>
<interface>
<name>IGnss</name>
<instance>default</instance>
@@ -364,7 +364,7 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="aidl" optional="true">
+ <hal format="aidl" optional="true" updatable-via-apex="true">
<name>android.hardware.neuralnetworks</name>
<version>1-4</version>
<interface>
@@ -567,6 +567,14 @@
<instance>default</instance>
</interface>
</hal>
+ <hal format="aidl" optional="true" updatable-via-apex="true">
+ <name>android.hardware.threadnetwork</name>
+ <version>1</version>
+ <interface>
+ <name>IThreadChip</name>
+ <regex-instance>chip[0-9]+</regex-instance>
+ </interface>
+ </hal>
<hal format="aidl" optional="true">
<name>android.hardware.tv.hdmi.cec</name>
<version>1</version>
@@ -686,12 +694,4 @@
<regex-instance>.*</regex-instance>
</interface>
</hal>
- <hal format="aidl" optional="true" updatable-via-apex="true">
- <name>android.hardware.threadnetwork</name>
- <version>1</version>
- <interface>
- <name>IThreadChip</name>
- <regex-instance>chip[0-9]+</regex-instance>
- </interface>
- </hal>
</compatibility-matrix>
diff --git a/drm/aidl/Android.bp b/drm/aidl/Android.bp
index fb04d84..afcb603 100644
--- a/drm/aidl/Android.bp
+++ b/drm/aidl/Android.bp
@@ -23,7 +23,7 @@
sdk_version: "module_current",
},
ndk: {
- min_sdk_version: "UpsideDownCake",
+ min_sdk_version: "34",
},
},
double_loadable: true,
diff --git a/gnss/1.1/default/Android.bp b/gnss/1.1/default/Android.bp
index 300e8de..697cb91 100644
--- a/gnss/1.1/default/Android.bp
+++ b/gnss/1.1/default/Android.bp
@@ -27,7 +27,7 @@
"android.hardware.gnss@2.0",
"android.hardware.gnss@1.1",
"android.hardware.gnss@1.0",
- "android.hardware.gnss-V3-ndk",
+ "android.hardware.gnss-V4-ndk",
],
static_libs: [
"android.hardware.gnss@common-default-lib",
diff --git a/gnss/1.1/vts/functional/Android.bp b/gnss/1.1/vts/functional/Android.bp
index 2414cbc..f9fcbf1 100644
--- a/gnss/1.1/vts/functional/Android.bp
+++ b/gnss/1.1/vts/functional/Android.bp
@@ -36,7 +36,7 @@
"android.hardware.gnss@1.1",
"android.hardware.gnss@2.0",
"android.hardware.gnss@common-vts-lib",
- "android.hardware.gnss-V3-cpp",
+ "android.hardware.gnss-V4-cpp",
],
shared_libs: [
"android.hardware.gnss.measurement_corrections@1.0",
diff --git a/gnss/2.0/default/Android.bp b/gnss/2.0/default/Android.bp
index 83bc2cc..35c2e37 100644
--- a/gnss/2.0/default/Android.bp
+++ b/gnss/2.0/default/Android.bp
@@ -50,7 +50,7 @@
"android.hardware.gnss@2.0",
"android.hardware.gnss@1.1",
"android.hardware.gnss@1.0",
- "android.hardware.gnss-V3-ndk",
+ "android.hardware.gnss-V4-ndk",
],
static_libs: [
"android.hardware.gnss@common-default-lib",
diff --git a/gnss/2.0/vts/functional/Android.bp b/gnss/2.0/vts/functional/Android.bp
index e8db886..0b54308 100644
--- a/gnss/2.0/vts/functional/Android.bp
+++ b/gnss/2.0/vts/functional/Android.bp
@@ -39,7 +39,7 @@
"android.hardware.gnss@2.0",
"android.hardware.gnss@2.1",
"android.hardware.gnss@common-vts-lib",
- "android.hardware.gnss-V3-cpp",
+ "android.hardware.gnss-V4-cpp",
],
test_suites: [
"general-tests",
diff --git a/gnss/2.1/default/Android.bp b/gnss/2.1/default/Android.bp
index 4a4ce54..1bb7512 100644
--- a/gnss/2.1/default/Android.bp
+++ b/gnss/2.1/default/Android.bp
@@ -44,7 +44,7 @@
"android.hardware.gnss@1.0",
"android.hardware.gnss@1.1",
"android.hardware.gnss@2.0",
- "android.hardware.gnss-V3-ndk",
+ "android.hardware.gnss-V4-ndk",
],
static_libs: [
"android.hardware.gnss@common-default-lib",
diff --git a/gnss/2.1/vts/functional/Android.bp b/gnss/2.1/vts/functional/Android.bp
index 76f9d07..9906b27 100644
--- a/gnss/2.1/vts/functional/Android.bp
+++ b/gnss/2.1/vts/functional/Android.bp
@@ -40,7 +40,7 @@
"android.hardware.gnss@2.0",
"android.hardware.gnss@2.1",
"android.hardware.gnss@common-vts-lib",
- "android.hardware.gnss-V3-cpp",
+ "android.hardware.gnss-V4-cpp",
],
shared_libs: [
"libvintf",
diff --git a/gnss/aidl/Android.bp b/gnss/aidl/Android.bp
index cb2c001..611c7e0 100644
--- a/gnss/aidl/Android.bp
+++ b/gnss/aidl/Android.bp
@@ -52,6 +52,6 @@
},
],
- frozen: true,
+ frozen: false,
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/ElapsedRealtime.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/ElapsedRealtime.aidl
index 559ed29..5d7f51e 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/ElapsedRealtime.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/ElapsedRealtime.aidl
@@ -38,6 +38,6 @@
int flags;
long timestampNs;
double timeUncertaintyNs;
- const int HAS_TIMESTAMP_NS = 1;
- const int HAS_TIME_UNCERTAINTY_NS = 2;
+ const int HAS_TIMESTAMP_NS = (1 << 0) /* 1 */;
+ const int HAS_TIME_UNCERTAINTY_NS = (1 << 1) /* 2 */;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssClock.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssClock.aidl
index a8454dd..63edd44 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssClock.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssClock.aidl
@@ -46,11 +46,11 @@
double driftUncertaintyNsps;
int hwClockDiscontinuityCount;
android.hardware.gnss.GnssSignalType referenceSignalTypeForIsb;
- const int HAS_LEAP_SECOND = 1;
- const int HAS_TIME_UNCERTAINTY = 2;
- const int HAS_FULL_BIAS = 4;
- const int HAS_BIAS = 8;
- const int HAS_BIAS_UNCERTAINTY = 16;
- const int HAS_DRIFT = 32;
- const int HAS_DRIFT_UNCERTAINTY = 64;
+ const int HAS_LEAP_SECOND = (1 << 0) /* 1 */;
+ const int HAS_TIME_UNCERTAINTY = (1 << 1) /* 2 */;
+ const int HAS_FULL_BIAS = (1 << 2) /* 4 */;
+ const int HAS_BIAS = (1 << 3) /* 8 */;
+ const int HAS_BIAS_UNCERTAINTY = (1 << 4) /* 16 */;
+ const int HAS_DRIFT = (1 << 5) /* 32 */;
+ const int HAS_DRIFT_UNCERTAINTY = (1 << 6) /* 64 */;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssLocation.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssLocation.aidl
index ed9dcfa..e64d98a 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssLocation.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssLocation.aidl
@@ -47,12 +47,12 @@
double bearingAccuracyDegrees;
long timestampMillis;
android.hardware.gnss.ElapsedRealtime elapsedRealtime;
- const int HAS_LAT_LONG = 1;
- const int HAS_ALTITUDE = 2;
- const int HAS_SPEED = 4;
- const int HAS_BEARING = 8;
- const int HAS_HORIZONTAL_ACCURACY = 16;
- const int HAS_VERTICAL_ACCURACY = 32;
- const int HAS_SPEED_ACCURACY = 64;
- const int HAS_BEARING_ACCURACY = 128;
+ const int HAS_LAT_LONG = 0x0001;
+ const int HAS_ALTITUDE = 0x0002;
+ const int HAS_SPEED = 0x0004;
+ const int HAS_BEARING = 0x0008;
+ const int HAS_HORIZONTAL_ACCURACY = 0x0010;
+ const int HAS_VERTICAL_ACCURACY = 0x0020;
+ const int HAS_SPEED_ACCURACY = 0x0040;
+ const int HAS_BEARING_ACCURACY = 0x0080;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssMeasurement.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssMeasurement.aidl
index 8a44887..a2594af 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssMeasurement.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssMeasurement.aidl
@@ -61,39 +61,39 @@
double satelliteInterSignalBiasUncertaintyNs;
android.hardware.gnss.SatellitePvt satellitePvt;
android.hardware.gnss.CorrelationVector[] correlationVectors;
- const int HAS_SNR = 1;
- const int HAS_CARRIER_FREQUENCY = 512;
- const int HAS_CARRIER_CYCLES = 1024;
- const int HAS_CARRIER_PHASE = 2048;
- const int HAS_CARRIER_PHASE_UNCERTAINTY = 4096;
- const int HAS_AUTOMATIC_GAIN_CONTROL = 8192;
- const int HAS_FULL_ISB = 65536;
- const int HAS_FULL_ISB_UNCERTAINTY = 131072;
- const int HAS_SATELLITE_ISB = 262144;
- const int HAS_SATELLITE_ISB_UNCERTAINTY = 524288;
- const int HAS_SATELLITE_PVT = 1048576;
- const int HAS_CORRELATION_VECTOR = 2097152;
+ const int HAS_SNR = (1 << 0) /* 1 */;
+ const int HAS_CARRIER_FREQUENCY = (1 << 9) /* 512 */;
+ const int HAS_CARRIER_CYCLES = (1 << 10) /* 1024 */;
+ const int HAS_CARRIER_PHASE = (1 << 11) /* 2048 */;
+ const int HAS_CARRIER_PHASE_UNCERTAINTY = (1 << 12) /* 4096 */;
+ const int HAS_AUTOMATIC_GAIN_CONTROL = (1 << 13) /* 8192 */;
+ const int HAS_FULL_ISB = (1 << 16) /* 65536 */;
+ const int HAS_FULL_ISB_UNCERTAINTY = (1 << 17) /* 131072 */;
+ const int HAS_SATELLITE_ISB = (1 << 18) /* 262144 */;
+ const int HAS_SATELLITE_ISB_UNCERTAINTY = (1 << 19) /* 524288 */;
+ const int HAS_SATELLITE_PVT = (1 << 20) /* 1048576 */;
+ const int HAS_CORRELATION_VECTOR = (1 << 21) /* 2097152 */;
const int STATE_UNKNOWN = 0;
- const int STATE_CODE_LOCK = 1;
- const int STATE_BIT_SYNC = 2;
- const int STATE_SUBFRAME_SYNC = 4;
- const int STATE_TOW_DECODED = 8;
- const int STATE_MSEC_AMBIGUOUS = 16;
- const int STATE_SYMBOL_SYNC = 32;
- const int STATE_GLO_STRING_SYNC = 64;
- const int STATE_GLO_TOD_DECODED = 128;
- const int STATE_BDS_D2_BIT_SYNC = 256;
- const int STATE_BDS_D2_SUBFRAME_SYNC = 512;
- const int STATE_GAL_E1BC_CODE_LOCK = 1024;
- const int STATE_GAL_E1C_2ND_CODE_LOCK = 2048;
- const int STATE_GAL_E1B_PAGE_SYNC = 4096;
- const int STATE_SBAS_SYNC = 8192;
- const int STATE_TOW_KNOWN = 16384;
- const int STATE_GLO_TOD_KNOWN = 32768;
- const int STATE_2ND_CODE_LOCK = 65536;
+ const int STATE_CODE_LOCK = (1 << 0) /* 1 */;
+ const int STATE_BIT_SYNC = (1 << 1) /* 2 */;
+ const int STATE_SUBFRAME_SYNC = (1 << 2) /* 4 */;
+ const int STATE_TOW_DECODED = (1 << 3) /* 8 */;
+ const int STATE_MSEC_AMBIGUOUS = (1 << 4) /* 16 */;
+ const int STATE_SYMBOL_SYNC = (1 << 5) /* 32 */;
+ const int STATE_GLO_STRING_SYNC = (1 << 6) /* 64 */;
+ const int STATE_GLO_TOD_DECODED = (1 << 7) /* 128 */;
+ const int STATE_BDS_D2_BIT_SYNC = (1 << 8) /* 256 */;
+ const int STATE_BDS_D2_SUBFRAME_SYNC = (1 << 9) /* 512 */;
+ const int STATE_GAL_E1BC_CODE_LOCK = (1 << 10) /* 1024 */;
+ const int STATE_GAL_E1C_2ND_CODE_LOCK = (1 << 11) /* 2048 */;
+ const int STATE_GAL_E1B_PAGE_SYNC = (1 << 12) /* 4096 */;
+ const int STATE_SBAS_SYNC = (1 << 13) /* 8192 */;
+ const int STATE_TOW_KNOWN = (1 << 14) /* 16384 */;
+ const int STATE_GLO_TOD_KNOWN = (1 << 15) /* 32768 */;
+ const int STATE_2ND_CODE_LOCK = (1 << 16) /* 65536 */;
const int ADR_STATE_UNKNOWN = 0;
- const int ADR_STATE_VALID = 1;
- const int ADR_STATE_RESET = 2;
- const int ADR_STATE_CYCLE_SLIP = 4;
- const int ADR_STATE_HALF_CYCLE_RESOLVED = 8;
+ const int ADR_STATE_VALID = (1 << 0) /* 1 */;
+ const int ADR_STATE_RESET = (1 << 1) /* 2 */;
+ const int ADR_STATE_CYCLE_SLIP = (1 << 2) /* 4 */;
+ const int ADR_STATE_HALF_CYCLE_RESOLVED = (1 << 3) /* 8 */;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssSignalType.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssSignalType.aidl
index 4a49547..a17f933 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssSignalType.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/GnssSignalType.aidl
@@ -42,6 +42,7 @@
const @utf8InCpp String CODE_TYPE_B = "B";
const @utf8InCpp String CODE_TYPE_C = "C";
const @utf8InCpp String CODE_TYPE_D = "D";
+ const @utf8InCpp String CODE_TYPE_E = "E";
const @utf8InCpp String CODE_TYPE_I = "I";
const @utf8InCpp String CODE_TYPE_L = "L";
const @utf8InCpp String CODE_TYPE_M = "M";
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl
index c782b6f..c8634ec 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IAGnssRil.aidl
@@ -40,8 +40,8 @@
void setSetId(in android.hardware.gnss.IAGnssRil.SetIdType type, in @utf8InCpp String setid);
void updateNetworkState(in android.hardware.gnss.IAGnssRil.NetworkAttributes attributes);
void injectNiSuplMessageData(in byte[] msgData, in int slotIndex);
- const int NETWORK_CAPABILITY_NOT_METERED = 1;
- const int NETWORK_CAPABILITY_NOT_ROAMING = 2;
+ const int NETWORK_CAPABILITY_NOT_METERED = 0x01;
+ const int NETWORK_CAPABILITY_NOT_ROAMING = 0x02;
@Backing(type="int") @VintfStability
enum AGnssRefLocationType {
GSM_CELLID = 1,
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl
index 0e6405e..d1aaf2c 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnss.aidl
@@ -77,19 +77,19 @@
}
@Backing(type="int") @VintfStability
enum GnssAidingData {
- EPHEMERIS = 1,
- ALMANAC = 2,
- POSITION = 4,
- TIME = 8,
- IONO = 16,
- UTC = 32,
- HEALTH = 64,
- SVDIR = 128,
- SVSTEER = 256,
- SADATA = 512,
- RTI = 1024,
- CELLDB_INFO = 32768,
- ALL = 65535,
+ EPHEMERIS = 0x0001,
+ ALMANAC = 0x0002,
+ POSITION = 0x0004,
+ TIME = 0x0008,
+ IONO = 0x0010,
+ UTC = 0x0020,
+ HEALTH = 0x0040,
+ SVDIR = 0x0080,
+ SVSTEER = 0x0100,
+ SADATA = 0x0200,
+ RTI = 0x0400,
+ CELLDB_INFO = 0x8000,
+ ALL = 0xFFFF,
}
@VintfStability
parcelable PositionModeOptions {
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatching.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatching.aidl
index d82aa1f..a021f55 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatching.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssBatching.aidl
@@ -41,7 +41,7 @@
void flush();
void stop();
void cleanup();
- const int WAKEUP_ON_FIFO_FULL = 1;
+ const int WAKEUP_ON_FIFO_FULL = 0x01;
@VintfStability
parcelable Options {
long periodNanos;
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssCallback.aidl
index 0247182..61710d3 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssCallback.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssCallback.aidl
@@ -46,22 +46,22 @@
void gnssRequestTimeCb();
void gnssRequestLocationCb(in boolean independentFromGnss, in boolean isUserEmergency);
void gnssSetSignalTypeCapabilitiesCb(in android.hardware.gnss.GnssSignalType[] gnssSignalTypes);
- const int CAPABILITY_SCHEDULING = 1;
- const int CAPABILITY_MSB = 2;
- const int CAPABILITY_MSA = 4;
- const int CAPABILITY_SINGLE_SHOT = 8;
- const int CAPABILITY_ON_DEMAND_TIME = 16;
- const int CAPABILITY_GEOFENCING = 32;
- const int CAPABILITY_MEASUREMENTS = 64;
- const int CAPABILITY_NAV_MESSAGES = 128;
- const int CAPABILITY_LOW_POWER_MODE = 256;
- const int CAPABILITY_SATELLITE_BLOCKLIST = 512;
- const int CAPABILITY_MEASUREMENT_CORRECTIONS = 1024;
- const int CAPABILITY_ANTENNA_INFO = 2048;
- const int CAPABILITY_CORRELATION_VECTOR = 4096;
- const int CAPABILITY_SATELLITE_PVT = 8192;
- const int CAPABILITY_MEASUREMENT_CORRECTIONS_FOR_DRIVING = 16384;
- const int CAPABILITY_ACCUMULATED_DELTA_RANGE = 32768;
+ const int CAPABILITY_SCHEDULING = (1 << 0) /* 1 */;
+ const int CAPABILITY_MSB = (1 << 1) /* 2 */;
+ const int CAPABILITY_MSA = (1 << 2) /* 4 */;
+ const int CAPABILITY_SINGLE_SHOT = (1 << 3) /* 8 */;
+ const int CAPABILITY_ON_DEMAND_TIME = (1 << 4) /* 16 */;
+ const int CAPABILITY_GEOFENCING = (1 << 5) /* 32 */;
+ const int CAPABILITY_MEASUREMENTS = (1 << 6) /* 64 */;
+ const int CAPABILITY_NAV_MESSAGES = (1 << 7) /* 128 */;
+ const int CAPABILITY_LOW_POWER_MODE = (1 << 8) /* 256 */;
+ const int CAPABILITY_SATELLITE_BLOCKLIST = (1 << 9) /* 512 */;
+ const int CAPABILITY_MEASUREMENT_CORRECTIONS = (1 << 10) /* 1024 */;
+ const int CAPABILITY_ANTENNA_INFO = (1 << 11) /* 2048 */;
+ const int CAPABILITY_CORRELATION_VECTOR = (1 << 12) /* 4096 */;
+ const int CAPABILITY_SATELLITE_PVT = (1 << 13) /* 8192 */;
+ const int CAPABILITY_MEASUREMENT_CORRECTIONS_FOR_DRIVING = (1 << 14) /* 16384 */;
+ const int CAPABILITY_ACCUMULATED_DELTA_RANGE = (1 << 15) /* 32768 */;
@Backing(type="int") @VintfStability
enum GnssStatusValue {
NONE = 0,
@@ -73,10 +73,10 @@
@Backing(type="int") @VintfStability
enum GnssSvFlags {
NONE = 0,
- HAS_EPHEMERIS_DATA = 1,
- HAS_ALMANAC_DATA = 2,
- USED_IN_FIX = 4,
- HAS_CARRIER_FREQUENCY = 8,
+ HAS_EPHEMERIS_DATA = (1 << 0) /* 1 */,
+ HAS_ALMANAC_DATA = (1 << 1) /* 2 */,
+ USED_IN_FIX = (1 << 2) /* 4 */,
+ HAS_CARRIER_FREQUENCY = (1 << 3) /* 8 */,
}
@VintfStability
parcelable GnssSvInfo {
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssConfiguration.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssConfiguration.aidl
index 1d6399e..70df11a 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssConfiguration.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssConfiguration.aidl
@@ -42,11 +42,11 @@
void setEmergencySuplPdn(in boolean enable);
void setEsExtensionSec(in int emergencyExtensionSeconds);
void setBlocklist(in android.hardware.gnss.BlocklistedSource[] blocklist);
- const int SUPL_MODE_MSB = 1;
- const int SUPL_MODE_MSA = 2;
- const int LPP_PROFILE_USER_PLANE = 1;
- const int LPP_PROFILE_CONTROL_PLANE = 2;
- const int GLONASS_POS_PROTOCOL_RRC_CPLANE = 1;
- const int GLONASS_POS_PROTOCOL_RRLP_UPLANE = 2;
- const int GLONASS_POS_PROTOCOL_LPP_UPLANE = 4;
+ const int SUPL_MODE_MSB = 0x01;
+ const int SUPL_MODE_MSA = 0x02;
+ const int LPP_PROFILE_USER_PLANE = 0x01;
+ const int LPP_PROFILE_CONTROL_PLANE = 0x02;
+ const int GLONASS_POS_PROTOCOL_RRC_CPLANE = 0x01;
+ const int GLONASS_POS_PROTOCOL_RRLP_UPLANE = 0x02;
+ const int GLONASS_POS_PROTOCOL_LPP_UPLANE = 0x04;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssGeofenceCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssGeofenceCallback.aidl
index df5dc2d..90f9ebc 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssGeofenceCallback.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssGeofenceCallback.aidl
@@ -41,15 +41,15 @@
void gnssGeofenceRemoveCb(in int geofenceId, in int status);
void gnssGeofencePauseCb(in int geofenceId, in int status);
void gnssGeofenceResumeCb(in int geofenceId, in int status);
- const int ENTERED = 1;
- const int EXITED = 2;
- const int UNCERTAIN = 4;
- const int UNAVAILABLE = 1;
- const int AVAILABLE = 2;
+ const int ENTERED = (1 << 0) /* 1 */;
+ const int EXITED = (1 << 1) /* 2 */;
+ const int UNCERTAIN = (1 << 2) /* 4 */;
+ const int UNAVAILABLE = (1 << 0) /* 1 */;
+ const int AVAILABLE = (1 << 1) /* 2 */;
const int OPERATION_SUCCESS = 0;
- const int ERROR_TOO_MANY_GEOFENCES = -100;
- const int ERROR_ID_EXISTS = -101;
- const int ERROR_ID_UNKNOWN = -102;
- const int ERROR_INVALID_TRANSITION = -103;
- const int ERROR_GENERIC = -149;
+ const int ERROR_TOO_MANY_GEOFENCES = (-100) /* -100 */;
+ const int ERROR_ID_EXISTS = (-101) /* -101 */;
+ const int ERROR_ID_UNKNOWN = (-102) /* -102 */;
+ const int ERROR_INVALID_TRANSITION = (-103) /* -103 */;
+ const int ERROR_GENERIC = (-149) /* -149 */;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl
index c65cff2..57d0e68 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssNavigationMessageCallback.aidl
@@ -44,26 +44,26 @@
int messageId;
int submessageId;
byte[] data;
- const int STATUS_PARITY_PASSED = 1;
- const int STATUS_PARITY_REBUILT = 2;
+ const int STATUS_PARITY_PASSED = (1 << 0) /* 1 */;
+ const int STATUS_PARITY_REBUILT = (1 << 1) /* 2 */;
const int STATUS_UNKNOWN = 0;
@Backing(type="int") @VintfStability
enum GnssNavigationMessageType {
UNKNOWN = 0,
- GPS_L1CA = 257,
- GPS_L2CNAV = 258,
- GPS_L5CNAV = 259,
- SBS = 513,
- GPS_CNAV2 = 260,
- GLO_L1CA = 769,
- QZS_L1CA = 1025,
- BDS_D1 = 1281,
- BDS_D2 = 1282,
- BDS_CNAV1 = 1283,
- BDS_CNAV2 = 1284,
- GAL_I = 1537,
- GAL_F = 1538,
- IRN_L5CA = 1793,
+ GPS_L1CA = 0x0101,
+ GPS_L2CNAV = 0x0102,
+ GPS_L5CNAV = 0x0103,
+ SBS = 0x0201,
+ GPS_CNAV2 = 0x0104,
+ GLO_L1CA = 0x0301,
+ QZS_L1CA = 0x0401,
+ BDS_D1 = 0x0501,
+ BDS_D2 = 0x0502,
+ BDS_CNAV1 = 0x0503,
+ BDS_CNAV2 = 0x0504,
+ GAL_I = 0x0601,
+ GAL_F = 0x0602,
+ IRN_L5CA = 0x0701,
}
}
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPowerIndicationCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPowerIndicationCallback.aidl
index d35c77f..07b10ad 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPowerIndicationCallback.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/IGnssPowerIndicationCallback.aidl
@@ -37,10 +37,10 @@
interface IGnssPowerIndicationCallback {
void setCapabilitiesCb(in int capabilities);
oneway void gnssPowerStatsCb(in android.hardware.gnss.GnssPowerStats gnssPowerStats);
- const int CAPABILITY_TOTAL = 1;
- const int CAPABILITY_SINGLEBAND_TRACKING = 2;
- const int CAPABILITY_MULTIBAND_TRACKING = 4;
- const int CAPABILITY_SINGLEBAND_ACQUISITION = 8;
- const int CAPABILITY_MULTIBAND_ACQUISITION = 16;
- const int CAPABILITY_OTHER_MODES = 32;
+ const int CAPABILITY_TOTAL = (1 << 0) /* 1 */;
+ const int CAPABILITY_SINGLEBAND_TRACKING = (1 << 1) /* 2 */;
+ const int CAPABILITY_MULTIBAND_TRACKING = (1 << 2) /* 4 */;
+ const int CAPABILITY_SINGLEBAND_ACQUISITION = (1 << 3) /* 8 */;
+ const int CAPABILITY_MULTIBAND_ACQUISITION = (1 << 4) /* 16 */;
+ const int CAPABILITY_OTHER_MODES = (1 << 5) /* 32 */;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl
index 5fd411f..ae65f39 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/SatellitePvt.aidl
@@ -46,9 +46,9 @@
long timeOfEphemerisSeconds;
int issueOfDataEphemeris;
android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource ephemerisSource = android.hardware.gnss.SatellitePvt.SatelliteEphemerisSource.OTHER;
- const int HAS_POSITION_VELOCITY_CLOCK_INFO = 1;
- const int HAS_IONO = 2;
- const int HAS_TROPO = 4;
+ const int HAS_POSITION_VELOCITY_CLOCK_INFO = (1 << 0) /* 1 */;
+ const int HAS_IONO = (1 << 1) /* 2 */;
+ const int HAS_TROPO = (1 << 2) /* 4 */;
@Backing(type="int") @VintfStability
enum SatelliteEphemerisSource {
DEMODULATED = 0,
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl
index 4126702..61909d0 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/IMeasurementCorrectionsCallback.aidl
@@ -36,7 +36,7 @@
@VintfStability
interface IMeasurementCorrectionsCallback {
void setCapabilitiesCb(in int capabilities);
- const int CAPABILITY_LOS_SATS = 1;
- const int CAPABILITY_EXCESS_PATH_LENGTH = 2;
- const int CAPABILITY_REFLECTING_PLANE = 4;
+ const int CAPABILITY_LOS_SATS = (1 << 0) /* 1 */;
+ const int CAPABILITY_EXCESS_PATH_LENGTH = (1 << 1) /* 2 */;
+ const int CAPABILITY_REFLECTING_PLANE = (1 << 2) /* 4 */;
}
diff --git a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl
index ebbe684..72d32e4 100644
--- a/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl
+++ b/gnss/aidl/aidl_api/android.hardware.gnss/current/android/hardware/gnss/measurement_corrections/SingleSatCorrection.aidl
@@ -44,10 +44,10 @@
float combinedExcessPathLengthUncertaintyMeters;
float combinedAttenuationDb;
android.hardware.gnss.measurement_corrections.SingleSatCorrection.ExcessPathInfo[] excessPathInfos;
- const int SINGLE_SAT_CORRECTION_HAS_SAT_IS_LOS_PROBABILITY = 1;
- const int SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH = 2;
- const int SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH_UNC = 4;
- const int SINGLE_SAT_CORRECTION_HAS_COMBINED_ATTENUATION = 16;
+ const int SINGLE_SAT_CORRECTION_HAS_SAT_IS_LOS_PROBABILITY = 0x0001;
+ const int SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH = 0x0002;
+ const int SINGLE_SAT_CORRECTION_HAS_COMBINED_EXCESS_PATH_LENGTH_UNC = 0x0004;
+ const int SINGLE_SAT_CORRECTION_HAS_COMBINED_ATTENUATION = 0x0010;
@VintfStability
parcelable ExcessPathInfo {
int excessPathInfoFlags;
@@ -55,9 +55,9 @@
float excessPathLengthUncertaintyMeters;
android.hardware.gnss.measurement_corrections.ReflectingPlane reflectingPlane;
float attenuationDb;
- const int EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH = 1;
- const int EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH_UNC = 2;
- const int EXCESS_PATH_INFO_HAS_REFLECTING_PLANE = 4;
- const int EXCESS_PATH_INFO_HAS_ATTENUATION = 8;
+ const int EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH = 0x0001;
+ const int EXCESS_PATH_INFO_HAS_EXCESS_PATH_LENGTH_UNC = 0x0002;
+ const int EXCESS_PATH_INFO_HAS_REFLECTING_PLANE = 0x0004;
+ const int EXCESS_PATH_INFO_HAS_ATTENUATION = 0x0008;
}
}
diff --git a/gnss/aidl/android/hardware/gnss/GnssSignalType.aidl b/gnss/aidl/android/hardware/gnss/GnssSignalType.aidl
index 241971f..c66d9e8 100644
--- a/gnss/aidl/android/hardware/gnss/GnssSignalType.aidl
+++ b/gnss/aidl/android/hardware/gnss/GnssSignalType.aidl
@@ -46,27 +46,36 @@
double carrierFrequencyHz;
/**
- * GNSS signal code type "A" representing GALILEO E1A, GALILEO E6A, IRNSS L5A, IRNSS SA.
+ * GNSS signal code type "A" representing GALILEO E1A, GALILEO E6A, IRNSS L5A SPS, IRNSS SA SPS,
+ * GLONASS G1a L1OCd, GLONASS G2a L2CSI.
*/
const @utf8InCpp String CODE_TYPE_A = "A";
/**
- * GNSS signal code type "B" representing GALILEO E1B, GALILEO E6B, IRNSS L5B, IRNSS SB.
+ * GNSS signal code type "B" representing GALILEO E1B, GALILEO E6B, IRNSS L5B RS (D),
+ * IRNSS SB RS (D), GLONASS G1a L1OCp, GLONASS G2a L2OCp, QZSS L1Sb.
*/
const @utf8InCpp String CODE_TYPE_B = "B";
/**
* GNSS signal code type "C" representing GPS L1 C/A, GPS L2 C/A, GLONASS G1 C/A,
- * GLONASS G2 C/A, GALILEO E1C, GALILEO E6C, SBAS L1 C/A, QZSS L1 C/A, IRNSS L5C.
+ * GLONASS G2 C/A, GALILEO E1C, GALILEO E6C, SBAS L1 C/A, QZSS L1 C/A, IRNSS L5C RS (P),
+ * IRNSS SC RS (P).
*/
const @utf8InCpp String CODE_TYPE_C = "C";
/**
- * GNSS signal code type "D" representing BDS B1C D.
+ * GNSS signal code type "D" representing GPS L2 (L1(C/A) + (P2-P1) (semi-codeless)),
+ * QZSS L5S(I), BDS B1C Data, BDS B2a Data, BDS B2b Data, BDS B2 (B2a+B2b) Data, BDS B3a Data.
*/
const @utf8InCpp String CODE_TYPE_D = "D";
/**
+ * GNSS signal code type "E" representing QZSS L1 C/B, QZSS L6E.
+ */
+ const @utf8InCpp String CODE_TYPE_E = "E";
+
+ /**
* GNSS signal code type "I" representing GPS L5 I, GLONASS G3 I, GALILEO E5a I, GALILEO E5b I,
* GALILEO E5a+b I, SBAS L5 I, QZSS L5 I, BDS B1 I, BDS B2 I, BDS B3 I.
*/
@@ -74,7 +83,7 @@
/**
* GNSS signal code type "L" representing GPS L1C (P), GPS L2C (L), QZSS L1C (P), QZSS L2C (L),
- * LEX(6) L.
+ * QZSS L6P, BDS B1a Pilot.
*/
const @utf8InCpp String CODE_TYPE_L = "L";
@@ -89,7 +98,9 @@
const @utf8InCpp String CODE_TYPE_N = "N";
/**
- * GNSS signal code type "P" representing GPS L1P, GPS L2P, GLONASS G1P, GLONASS G2P, BDS B1C P.
+ * GNSS signal code type "P" representing GPS L1P, GPS L2P, GLONASS G1P, GLONASS G2P,
+ * BDS B1C Pilot, BDS B2a Pilot, BDS B2b Pilot, BDS B2 (B2a+B2b) Pilot, BDS B3a Pilot,
+ * QZSS L5S(Q).
*/
const @utf8InCpp String CODE_TYPE_P = "P";
@@ -101,7 +112,7 @@
/**
* GNSS signal code type "S" represents GPS L1C (D), GPS L2C (M), QZSS L1C (D), QZSS L2C (M),
- * LEX(6) S.
+ * QZSS L6D, BDS B1a Data.
*/
const @utf8InCpp String CODE_TYPE_S = "S";
@@ -112,9 +123,11 @@
/**
* GNSS signal code type "X" representing GPS L1C (D+P), GPS L2C (M+L), GPS L5 (I+Q),
- * GLONASS G3 (I+Q), GALILEO E1 (B+C), GALILEO E5a (I+Q), GALILEO E5b (I+Q), GALILEO E5a+b(I+Q),
- * GALILEO E6 (B+C), SBAS L5 (I+Q), QZSS L1C (D+P), QZSS L2C (M+L), QZSS L5 (I+Q),
- * LEX(6) (S+L), BDS B1 (I+Q), BDS B1C (D+P), BDS B2 (I+Q), BDS B3 (I+Q), IRNSS L5 (B+C).
+ * GLONASS G1a L1OCd+L1OCp, GLONASS G2a L2CSI+L2OCp, GLONASS G3 (I+Q), GALILEO E1 (B+C),
+ * GALILEO E5a (I+Q), GALILEO E5b (I+Q), GALILEO E5a+b (I+Q), GALILEO E6 (B+C), SBAS L5 (I+Q),
+ * QZSS L1C (D+P), QZSS L2C (M+L), QZSS L5 (I+Q), QZSS L6 (D+P), BDS B1 (I+Q),
+ * BDS B1C Data+Pilot, BDS B2a Data+Pilot, BDS B2 (I+Q), BDS B2 (B2a+B2b) Data+Pilot,
+ * BDS B3 (I+Q), IRNSS L5 (B+C), IRNSS S (B+C).
*/
const @utf8InCpp String CODE_TYPE_X = "X";
@@ -124,7 +137,9 @@
const @utf8InCpp String CODE_TYPE_Y = "Y";
/**
- * GNSS signal code type "Z" representing GALILEO E1 (A+B+C), GALILEO E6 (A+B+C), QZSS L1-SAIF.
+ * GNSS signal code type "Z" representing GALILEO E1 (A+B+C), GALILEO E6 (A+B+C),
+ * QZSS L1S/L1-SAIF, QZSS L5S (I+Q), QZSS L6 (D+E), BDS B1A Data+Pilot, BDS B2b Data+Pilot,
+ * BDS B3a Data+Pilot.
*/
const @utf8InCpp String CODE_TYPE_Z = "Z";
@@ -142,10 +157,11 @@
* The value is one of the constant Strings with prefix CODE_TYPE_ defined in this parcelable.
*
* This is used to specify the observation descriptor defined in GNSS Observation Data File
- * Header Section Description in the RINEX standard (Version 3.XX). In RINEX Version 3.03,
- * in Appendix Table A2 Attributes are listed as uppercase letters (for instance, "A" for
- * "A channel"). In the future, if for instance a code "G" was added in the official RINEX
- * standard, "G" could be specified here.
+ * Header Section Description in the RINEX standard (Version 4.00) e.g., in Tables 9-16 (see
+ * https://igs.org/wg/rinex/#documents-formats). In cases where the code type does not align
+ * with the above listed values, the code type from the most recent version of RINEX should be
+ * used. In the future, if for instance a code "G" was added in the official RINEX standard,
+ * "G" could be specified here.
*/
@utf8InCpp String codeType;
}
diff --git a/gnss/aidl/default/Android.bp b/gnss/aidl/default/Android.bp
index ca5a41f..542796f 100644
--- a/gnss/aidl/default/Android.bp
+++ b/gnss/aidl/default/Android.bp
@@ -50,7 +50,7 @@
"android.hardware.gnss.measurement_corrections@1.1",
"android.hardware.gnss.measurement_corrections@1.0",
"android.hardware.gnss.visibility_control@1.0",
- "android.hardware.gnss-V3-ndk",
+ "android.hardware.gnss-V4-ndk",
],
srcs: [
"AGnssRil.cpp",
diff --git a/gnss/aidl/default/gnss-default.xml b/gnss/aidl/default/gnss-default.xml
index 73b841e..c01069e 100644
--- a/gnss/aidl/default/gnss-default.xml
+++ b/gnss/aidl/default/gnss-default.xml
@@ -1,7 +1,7 @@
<manifest version="1.0" type="device">
<hal format="aidl">
<name>android.hardware.gnss</name>
- <version>3</version>
+ <version>4</version>
<interface>
<name>IGnss</name>
<instance>default</instance>
diff --git a/gnss/aidl/vts/Android.bp b/gnss/aidl/vts/Android.bp
index 2a09a56..fd1d853 100644
--- a/gnss/aidl/vts/Android.bp
+++ b/gnss/aidl/vts/Android.bp
@@ -51,7 +51,7 @@
"libbinder",
],
static_libs: [
- "android.hardware.gnss-V3-cpp",
+ "android.hardware.gnss-V4-cpp",
"android.hardware.gnss@common-vts-lib",
],
test_suites: [
diff --git a/gnss/common/utils/default/Android.bp b/gnss/common/utils/default/Android.bp
index 4cf17a6..208bc59 100644
--- a/gnss/common/utils/default/Android.bp
+++ b/gnss/common/utils/default/Android.bp
@@ -57,6 +57,6 @@
"android.hardware.gnss@2.1",
"android.hardware.gnss.measurement_corrections@1.1",
"android.hardware.gnss.measurement_corrections@1.0",
- "android.hardware.gnss-V3-ndk",
+ "android.hardware.gnss-V4-ndk",
],
}
diff --git a/gnss/common/utils/vts/Android.bp b/gnss/common/utils/vts/Android.bp
index b5325b2..ed5674c 100644
--- a/gnss/common/utils/vts/Android.bp
+++ b/gnss/common/utils/vts/Android.bp
@@ -44,7 +44,7 @@
"android.hardware.gnss@2.1",
"android.hardware.gnss.measurement_corrections@1.0",
"android.hardware.gnss.measurement_corrections@1.1",
- "android.hardware.gnss-V3-cpp",
+ "android.hardware.gnss-V4-cpp",
],
static_libs: [
"libgtest",
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..ec54f2a 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
+ * - timeoutNs 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
+ * - 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/VrrConfig.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl
index 3b241ba..93667e0 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/VrrConfig.aidl
@@ -45,7 +45,7 @@
* 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
@@ -53,7 +53,7 @@
* sending the next frame. If set to 0, there is no need to call
* IComposerClient.notifyExpectedPresent for timeout.
*/
- int notifyExpectedPresentTimeoutNs;
+ int timeoutNs;
}
/**
diff --git a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
index 90944d5..4a8e3b4 100644
--- a/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
+++ b/graphics/composer/aidl/vts/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -1231,13 +1231,20 @@
EXPECT_NE(-1, displayConfig.vsyncPeriod);
EXPECT_NE(-1, displayConfig.configGroup);
if (displayConfig.dpi) {
- EXPECT_NE(-1, displayConfig.dpi->x);
- EXPECT_NE(-1, displayConfig.dpi->y);
+ EXPECT_NE(-1.f, displayConfig.dpi->x);
+ EXPECT_NE(-1.f, displayConfig.dpi->y);
}
if (displayConfig.vrrConfig) {
const auto& vrrConfig = *displayConfig.vrrConfig;
EXPECT_GE(vrrConfig.minFrameIntervalNs, displayConfig.vsyncPeriod);
+ EXPECT_EQ(1, std::count_if(
+ displayConfigurations.cbegin(), displayConfigurations.cend(),
+ [displayConfig](const auto& config) {
+ return config.configGroup == displayConfig.configGroup;
+ }))
+ << "There should be only one VRR mode in one ConfigGroup";
+
const auto verifyFrameIntervalIsDivisorOfVsync = [&](int32_t frameIntervalNs) {
constexpr auto kThreshold = 0.05f; // 5%
const auto ratio =
@@ -1267,8 +1274,8 @@
if (vrrConfig.notifyExpectedPresentConfig) {
const auto& notifyExpectedPresentConfig =
*vrrConfig.notifyExpectedPresentConfig;
- EXPECT_GT(0, notifyExpectedPresentConfig.notifyExpectedPresentHeadsUpNs);
- EXPECT_GE(0, notifyExpectedPresentConfig.notifyExpectedPresentTimeoutNs);
+ EXPECT_GT(0, notifyExpectedPresentConfig.headsUpNs);
+ EXPECT_GE(0, notifyExpectedPresentConfig.timeoutNs);
}
}
}
diff --git a/health/1.0/default/convert.cpp b/health/1.0/default/convert.cpp
index 3680d4d..31b4679 100644
--- a/health/1.0/default/convert.cpp
+++ b/health/1.0/default/convert.cpp
@@ -26,19 +26,18 @@
config.periodicChoresIntervalFast = hc->periodic_chores_interval_fast;
config.periodicChoresIntervalSlow = hc->periodic_chores_interval_slow;
- config.batteryStatusPath = hc->batteryStatusPath.string();
- config.batteryHealthPath = hc->batteryHealthPath.string();
- config.batteryPresentPath = hc->batteryPresentPath.string();
- config.batteryCapacityPath = hc->batteryCapacityPath.string();
- config.batteryVoltagePath = hc->batteryVoltagePath.string();
- config.batteryTemperaturePath = hc->batteryTemperaturePath.string();
- config.batteryTechnologyPath = hc->batteryTechnologyPath.string();
- config.batteryCurrentNowPath = hc->batteryCurrentNowPath.string();
- config.batteryCurrentAvgPath = hc->batteryCurrentAvgPath.string();
- config.batteryChargeCounterPath = hc->batteryChargeCounterPath.string();
- config.batteryFullChargePath = hc->batteryFullChargePath.string();
- config.batteryCycleCountPath = hc->batteryCycleCountPath.string();
-
+ config.batteryStatusPath = hc->batteryStatusPath.c_str();
+ config.batteryHealthPath = hc->batteryHealthPath.c_str();
+ config.batteryPresentPath = hc->batteryPresentPath.c_str();
+ config.batteryCapacityPath = hc->batteryCapacityPath.c_str();
+ config.batteryVoltagePath = hc->batteryVoltagePath.c_str();
+ config.batteryTemperaturePath = hc->batteryTemperaturePath.c_str();
+ config.batteryTechnologyPath = hc->batteryTechnologyPath.c_str();
+ config.batteryCurrentNowPath = hc->batteryCurrentNowPath.c_str();
+ config.batteryCurrentAvgPath = hc->batteryCurrentAvgPath.c_str();
+ config.batteryChargeCounterPath = hc->batteryChargeCounterPath.c_str();
+ config.batteryFullChargePath = hc->batteryFullChargePath.c_str();
+ config.batteryCycleCountPath = hc->batteryCycleCountPath.c_str();
}
void convertFromHealthConfig(const HealthConfig& c, struct healthd_config *hc) {
diff --git a/health/aidl/OWNERS b/health/OWNERS
similarity index 100%
rename from health/aidl/OWNERS
rename to health/OWNERS
diff --git a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponent.aidl b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponent.aidl
index 1af66d0..c7d8a97 100644
--- a/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponent.aidl
+++ b/media/c2/aidl/aidl_api/android.hardware.media.c2/current/android/hardware/media/c2/IComponent.aidl
@@ -35,7 +35,7 @@
@VintfStability
interface IComponent {
android.hardware.common.NativeHandle configureVideoTunnel(in int avSyncHwId);
- android.hardware.media.c2.IComponent.BlockPool createBlockPool(in int allocatorId);
+ android.hardware.media.c2.IComponent.BlockPool createBlockPool(in android.hardware.media.c2.IComponent.BlockPoolAllocator allocator);
void destroyBlockPool(in long blockPoolId);
void drain(in boolean withEos);
android.hardware.media.c2.WorkBundle flush();
@@ -43,11 +43,14 @@
void queue(in android.hardware.media.c2.WorkBundle workBundle);
void release();
void reset();
- void setDecoderOutputAllocator(in android.hardware.media.c2.IGraphicBufferAllocator allocator);
void start();
void stop();
parcelable BlockPool {
long blockPoolId;
android.hardware.media.c2.IConfigurable configurable;
}
+ union BlockPoolAllocator {
+ int allocatorId;
+ android.hardware.media.c2.IGraphicBufferAllocator igba;
+ }
}
diff --git a/media/c2/aidl/android/hardware/media/c2/IComponent.aidl b/media/c2/aidl/android/hardware/media/c2/IComponent.aidl
index c880305..a7d94b1 100644
--- a/media/c2/aidl/android/hardware/media/c2/IComponent.aidl
+++ b/media/c2/aidl/android/hardware/media/c2/IComponent.aidl
@@ -44,6 +44,18 @@
long blockPoolId;
IConfigurable configurable;
}
+
+ /**
+ * Allocator for C2BlockPool.
+ *
+ * C2BlockPool will use a C2Allocator which is specified by an id.
+ * or C2AIDL allocator interface directly.
+ */
+ union BlockPoolAllocator {
+ int allocatorId;
+ IGraphicBufferAllocator igba;
+ }
+
/**
* Configures a component for a tunneled playback mode.
*
@@ -87,7 +99,8 @@
* destroyBlockPool(), reset() or release(). reset() and release() must
* destroy all `C2BlockPool` objects that have been created.
*
- * @param allocatorId Id of a `C2Allocator`.
+ * @param allocator AIDL allocator interface or C2Allocator specifier
+ * for C2BlockPool
* @param out configurable Configuration interface for the created pool. This
* must not be null.
* @return Created block pool information. This could be used to config/query and
@@ -98,7 +111,7 @@
* - `Status::TIMED_OUT` - The operation cannot be finished in a timely manner.
* - `Status::CORRUPTED` - Some unknown error occurred.
*/
- BlockPool createBlockPool(in int allocatorId);
+ BlockPool createBlockPool(in BlockPoolAllocator allocator);
/**
* Destroys a local block pool previously created by createBlockPool().
@@ -233,17 +246,6 @@
void reset();
/**
- * Specify an allocator for decoder output buffer from HAL.
- *
- * The method will be used once during the life-cycle of a codec instance.
- * @param allocator Decoder output buffer allocator from the client
- * @throws ServiceSpecificException with one of the following values
- * - `Status::CANNOT_DO` - The component does not support allocating from the client.
- * - `Status::CORRUPTED` - Some unknown error occurred.
- */
- void setDecoderOutputAllocator(in IGraphicBufferAllocator allocator);
-
- /**
* Starts the component.
*
* This method must be supported in stopped state as well as tripped state.
diff --git a/security/keymint/aidl/android/hardware/security/keymint/Tag.aidl b/security/keymint/aidl/android/hardware/security/keymint/Tag.aidl
index d401247..36f0106 100644
--- a/security/keymint/aidl/android/hardware/security/keymint/Tag.aidl
+++ b/security/keymint/aidl/android/hardware/security/keymint/Tag.aidl
@@ -971,7 +971,9 @@
* Tag::CERTIFICATE_NOT_BEFORE the beginning of the validity of the certificate in UNIX epoch
* time in milliseconds. This value is used when generating attestation or self signed
* certificates. ErrorCode::MISSING_NOT_BEFORE must be returned if this tag is not provided if
- * this tag is not provided to generateKey or importKey.
+ * this tag is not provided to generateKey or importKey. For importWrappedKey, there is no way
+ * to specify the value of this tag for the wrapped key, so a value of 0 must be used for
+ * certificate generation.
*/
CERTIFICATE_NOT_BEFORE = TagType.DATE | 1008,
@@ -979,7 +981,8 @@
* Tag::CERTIFICATE_NOT_AFTER the end of the validity of the certificate in UNIX epoch time in
* milliseconds. This value is used when generating attestation or self signed certificates.
* ErrorCode::MISSING_NOT_AFTER must be returned if this tag is not provided to generateKey or
- * importKey.
+ * importKey. For importWrappedKey, there is no way to specify the value of this tag for the
+ * wrapped key, so a value of 253402300799000 is used for certificate generation.
*/
CERTIFICATE_NOT_AFTER = TagType.DATE | 1009,
diff --git a/threadnetwork/aidl/Android.bp b/threadnetwork/aidl/Android.bp
index 480ac0f..c621b81 100644
--- a/threadnetwork/aidl/Android.bp
+++ b/threadnetwork/aidl/Android.bp
@@ -14,9 +14,12 @@
ndk: {
apex_available: [
"//apex_available:platform",
+ "com.android.tethering",
+ // Keep the threadnetwork apex to make it buildable on udc-mainline-prod.
+ // TODO: remove it after moving ot-daemon into tethering.
"com.android.threadnetwork",
],
- min_sdk_version: "33",
+ min_sdk_version: "30",
},
},
}
diff --git a/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test_utils.cpp b/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test_utils.cpp
index 75d6252..56f285d 100644
--- a/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test_utils.cpp
+++ b/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test_utils.cpp
@@ -41,10 +41,9 @@
using ::android::wifi_system::HostapdManager;
using ::android::wifi_system::SupplicantManager;
-namespace {
// Helper function to initialize the driver and firmware to AP mode
// using the vendor HAL HIDL interface.
-void initilializeDriverAndFirmware(const std::string& wifi_instance_name) {
+void initializeDriverAndFirmware(const std::string& wifi_instance_name) {
if (getWifi(wifi_instance_name) != nullptr) {
sp<IWifiChip> wifi_chip = getWifiChip(wifi_instance_name);
ChipModeId mode_id;
@@ -57,21 +56,20 @@
// Helper function to deinitialize the driver and firmware
// using the vendor HAL HIDL interface.
-void deInitilializeDriverAndFirmware(const std::string& wifi_instance_name) {
+void deInitializeDriverAndFirmware(const std::string& wifi_instance_name) {
if (getWifi(wifi_instance_name) != nullptr) {
stopWifi(wifi_instance_name);
} else {
LOG(WARNING) << __func__ << ": Vendor HAL not supported";
}
}
-} // namespace
void stopSupplicantIfNeeded(const std::string& instance_name) {
SupplicantManager supplicant_manager;
if (supplicant_manager.IsSupplicantRunning()) {
LOG(INFO) << "Supplicant is running, stop supplicant first.";
ASSERT_TRUE(supplicant_manager.StopSupplicant());
- deInitilializeDriverAndFirmware(instance_name);
+ deInitializeDriverAndFirmware(instance_name);
ASSERT_FALSE(supplicant_manager.IsSupplicantRunning());
}
}
@@ -80,13 +78,13 @@
HostapdManager hostapd_manager;
ASSERT_TRUE(hostapd_manager.StopHostapd());
- deInitilializeDriverAndFirmware(instance_name);
+ deInitializeDriverAndFirmware(instance_name);
}
void startHostapdAndWaitForHidlService(
const std::string& wifi_instance_name,
const std::string& hostapd_instance_name) {
- initilializeDriverAndFirmware(wifi_instance_name);
+ initializeDriverAndFirmware(wifi_instance_name);
HostapdManager hostapd_manager;
ASSERT_TRUE(hostapd_manager.StartHostapd());
diff --git a/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test_utils.h b/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test_utils.h
index 5cb4f01..893de1e 100644
--- a/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test_utils.h
+++ b/wifi/hostapd/1.0/vts/functional/hostapd_hidl_test_utils.h
@@ -33,5 +33,9 @@
bool is_1_1(const android::sp<android::hardware::wifi::hostapd::V1_0::IHostapd>&
hostapd);
+// Used to initialize/deinitialize the driver and firmware at the
+// beginning and end of each test.
+void initializeDriverAndFirmware(const std::string& wifi_instance_name);
+void deInitializeDriverAndFirmware(const std::string& wifi_instance_name);
#endif /* HOSTAPD_HIDL_TEST_UTILS_H */
diff --git a/wifi/hostapd/aidl/vts/functional/Android.bp b/wifi/hostapd/aidl/vts/functional/Android.bp
index 33318a4..ff35056 100644
--- a/wifi/hostapd/aidl/vts/functional/Android.bp
+++ b/wifi/hostapd/aidl/vts/functional/Android.bp
@@ -37,6 +37,7 @@
"android.hardware.wifi@1.5",
"android.hardware.wifi@1.6",
"android.hardware.wifi-V1-ndk",
+ "libwifi-system",
"libwifi-system-iface",
"VtsHalWifiTargetTestUtil",
],
diff --git a/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp b/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp
index efd1538..137537d 100644
--- a/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp
+++ b/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp
@@ -32,6 +32,7 @@
#include <wifi_hidl_test_utils_1_5.h>
#include <wifi_hidl_test_utils_1_6.h>
+#include "hostapd_test_utils.h"
#include "wifi_aidl_test_utils.h"
using aidl::android::hardware::wifi::hostapd::BandMask;
@@ -56,10 +57,7 @@
const int kIfaceChannel = 6;
const int kIfaceInvalidChannel = 567;
const std::vector<uint8_t> kTestZeroMacAddr(6, 0x0);
-const Ieee80211ReasonCode kTestDisconnectReasonCode =
- Ieee80211ReasonCode::WLAN_REASON_UNSPECIFIED;
-const std::string kWifiAidlInstanceNameStr = std::string() + IWifi::descriptor + "/default";
-const char* kWifiAidlInstanceName = kWifiAidlInstanceNameStr.c_str();
+const Ieee80211ReasonCode kTestDisconnectReasonCode = Ieee80211ReasonCode::WLAN_REASON_UNSPECIFIED;
inline BandMask operator|(BandMask a, BandMask b) {
return static_cast<BandMask>(static_cast<int32_t>(a) |
@@ -70,10 +68,13 @@
class HostapdAidl : public testing::TestWithParam<std::string> {
public:
virtual void SetUp() override {
- hostapd = IHostapd::fromBinder(ndk::SpAIBinder(
- AServiceManager_waitForService(GetParam().c_str())));
+ disableHalsAndFramework();
+ initializeHostapdAndVendorHal(GetParam());
+
+ hostapd = getHostapd(GetParam());
ASSERT_NE(hostapd, nullptr);
EXPECT_TRUE(hostapd->setDebugParams(DebugLevel::EXCESSIVE).isOk());
+
isAcsSupport = testing::checkSubstringInCommandOutput(
"/system/bin/cmd wifi get-softap-supported-features",
"wifi_softap_acs_supported");
@@ -81,81 +82,23 @@
"/system/bin/cmd wifi get-softap-supported-features",
"wifi_softap_wpa3_sae_supported");
isBridgedSupport = testing::checkSubstringInCommandOutput(
- "/system/bin/cmd wifi get-softap-supported-features",
- "wifi_softap_bridged_ap_supported");
- if (!isAidlServiceAvailable(kWifiAidlInstanceName)) {
- const std::vector<std::string> instances = android::hardware::getAllHalInstanceNames(
- ::android::hardware::wifi::V1_0::IWifi::descriptor);
- EXPECT_NE(0, instances.size());
- wifiHidlInstanceName = instances[0];
- }
+ "/system/bin/cmd wifi get-softap-supported-features",
+ "wifi_softap_bridged_ap_supported");
}
virtual void TearDown() override {
- stopVendorHal();
hostapd->terminate();
// Wait 3 seconds to allow terminate to complete
sleep(3);
+ stopHostapdAndVendorHal();
+ startWifiFramework();
}
std::shared_ptr<IHostapd> hostapd;
- std::string wifiHidlInstanceName;
bool isAcsSupport;
bool isWpa3SaeSupport;
bool isBridgedSupport;
- void stopVendorHal() {
- if (isAidlServiceAvailable(kWifiAidlInstanceName)) {
- // HIDL and AIDL versions of getWifi() take different arguments
- // i.e. const char* vs string
- if (getWifi(kWifiAidlInstanceName) != nullptr) {
- stopWifiService(kWifiAidlInstanceName);
- }
- } else {
- if (getWifi(wifiHidlInstanceName) != nullptr) {
- stopWifi(wifiHidlInstanceName);
- }
- }
- }
-
- std::string setupApIfaceAndGetName(bool isBridged) {
- if (isAidlServiceAvailable(kWifiAidlInstanceName)) {
- return setupApIfaceAndGetNameAidl(isBridged);
- } else {
- return setupApIfaceAndGetNameHidl(isBridged);
- }
- }
-
- std::string setupApIfaceAndGetNameAidl(bool isBridged) {
- std::shared_ptr<IWifiApIface> wifi_ap_iface;
- if (isBridged) {
- wifi_ap_iface = getBridgedWifiApIface(kWifiAidlInstanceName);
- } else {
- wifi_ap_iface = getWifiApIface(kWifiAidlInstanceName);
- }
- EXPECT_NE(nullptr, wifi_ap_iface.get());
-
- std::string ap_iface_name;
- auto status = wifi_ap_iface->getName(&ap_iface_name);
- EXPECT_TRUE(status.isOk());
- return ap_iface_name;
- }
-
- std::string setupApIfaceAndGetNameHidl(bool isBridged) {
- android::sp<::android::hardware::wifi::V1_0::IWifiApIface> wifi_ap_iface;
- if (isBridged) {
- wifi_ap_iface = getBridgedWifiApIface_1_6(wifiHidlInstanceName);
- } else {
- wifi_ap_iface = getWifiApIface_1_5(wifiHidlInstanceName);
- }
- EXPECT_NE(nullptr, wifi_ap_iface.get());
-
- const auto& status_and_name = HIDL_INVOKE(wifi_ap_iface, getName);
- EXPECT_EQ(android::hardware::wifi::V1_0::WifiStatusCode::SUCCESS,
- status_and_name.first.code);
- return status_and_name.second;
- }
-
IfaceParams getIfaceParamsWithoutAcs(std::string iface_name) {
IfaceParams iface_params;
ChannelParams channelParams;
diff --git a/wifi/hostapd/aidl/vts/functional/hostapd_aidl_test_utils.h b/wifi/hostapd/aidl/vts/functional/hostapd_aidl_test_utils.h
new file mode 100644
index 0000000..93540b2
--- /dev/null
+++ b/wifi/hostapd/aidl/vts/functional/hostapd_aidl_test_utils.h
@@ -0,0 +1,80 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/wifi/IWifi.h>
+#include <android-base/logging.h>
+
+#include "wifi_aidl_test_utils.h"
+
+namespace {
+
+const std::string kWifiInstanceNameStr = std::string() + IWifi::descriptor + "/default";
+const char* kWifiInstanceName = kWifiInstanceNameStr.c_str();
+
+} // namespace
+
+namespace HostapdAidlTestUtils {
+
+bool useAidlService() {
+ return isAidlServiceAvailable(kWifiInstanceName);
+}
+
+void startAndConfigureVendorHal() {
+ if (getWifi(kWifiInstanceName) != nullptr) {
+ std::shared_ptr<IWifiChip> wifi_chip = getWifiChip(kWifiInstanceName);
+ int mode_id;
+ EXPECT_TRUE(configureChipToSupportConcurrencyType(wifi_chip, IfaceConcurrencyType::AP,
+ &mode_id));
+ } else {
+ LOG(ERROR) << "Unable to initialize Vendor HAL";
+ }
+}
+
+void stopVendorHal() {
+ if (getWifi(kWifiInstanceName) != nullptr) {
+ stopWifiService(kWifiInstanceName);
+ } else {
+ LOG(ERROR) << "Unable to stop Vendor HAL";
+ }
+}
+
+std::string setupApIfaceAndGetName(bool isBridged) {
+ std::shared_ptr<IWifiApIface> wifi_ap_iface;
+ if (isBridged) {
+ wifi_ap_iface = getBridgedWifiApIface(kWifiInstanceName);
+ } else {
+ wifi_ap_iface = getWifiApIface(kWifiInstanceName);
+ }
+
+ EXPECT_TRUE(wifi_ap_iface.get() != nullptr);
+ if (!wifi_ap_iface.get()) {
+ LOG(ERROR) << "Unable to create iface. isBridged=" << isBridged;
+ return "";
+ }
+
+ std::string ap_iface_name;
+ auto status = wifi_ap_iface->getName(&ap_iface_name);
+ EXPECT_TRUE(status.isOk());
+ if (!status.isOk()) {
+ LOG(ERROR) << "Unable to retrieve iface name. isBridged=" << isBridged;
+ return "";
+ }
+ return ap_iface_name;
+}
+
+} // namespace HostapdAidlTestUtils
diff --git a/wifi/hostapd/aidl/vts/functional/hostapd_legacy_test_utils.h b/wifi/hostapd/aidl/vts/functional/hostapd_legacy_test_utils.h
new file mode 100644
index 0000000..fb59dc2
--- /dev/null
+++ b/wifi/hostapd/aidl/vts/functional/hostapd_legacy_test_utils.h
@@ -0,0 +1,71 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#include <android-base/logging.h>
+
+#include "hostapd_hidl_test_utils.h"
+#include "wifi_hidl_test_utils.h"
+
+using ::android::hardware::wifi::V1_0::WifiStatus;
+
+namespace {
+
+std::string getWifiInstanceName() {
+ const std::vector<std::string> instances = android::hardware::getAllHalInstanceNames(
+ ::android::hardware::wifi::V1_0::IWifi::descriptor);
+ EXPECT_NE(0, instances.size());
+ return instances.size() != 0 ? instances[0] : "";
+}
+
+} // namespace
+
+namespace HostapdLegacyTestUtils {
+
+void startAndConfigureVendorHal() {
+ initializeDriverAndFirmware(getWifiInstanceName());
+}
+
+void stopVendorHal() {
+ deInitializeDriverAndFirmware(getWifiInstanceName());
+}
+
+std::string setupApIfaceAndGetName(bool isBridged) {
+ android::sp<::android::hardware::wifi::V1_0::IWifiApIface> wifi_ap_iface;
+ if (isBridged) {
+ wifi_ap_iface = getBridgedWifiApIface_1_6(getWifiInstanceName());
+ } else {
+ wifi_ap_iface = getWifiApIface_1_5(getWifiInstanceName());
+ }
+
+ EXPECT_TRUE(wifi_ap_iface.get() != nullptr);
+ if (!wifi_ap_iface.get()) {
+ LOG(ERROR) << "Unable to create iface. isBridged=" << isBridged;
+ return "";
+ }
+
+ const auto& status_and_name = HIDL_INVOKE(wifi_ap_iface, getName);
+ EXPECT_TRUE(status_and_name.first.code ==
+ android::hardware::wifi::V1_0::WifiStatusCode::SUCCESS);
+ if (status_and_name.first.code != android::hardware::wifi::V1_0::WifiStatusCode::SUCCESS) {
+ LOG(ERROR) << "Unable to retrieve iface name. isBridged=" << isBridged;
+ return "";
+ }
+ return status_and_name.second;
+}
+
+} // namespace HostapdLegacyTestUtils
diff --git a/wifi/hostapd/aidl/vts/functional/hostapd_test_utils.h b/wifi/hostapd/aidl/vts/functional/hostapd_test_utils.h
new file mode 100644
index 0000000..feee2c8
--- /dev/null
+++ b/wifi/hostapd/aidl/vts/functional/hostapd_test_utils.h
@@ -0,0 +1,122 @@
+/*
+ * 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.
+ */
+
+#pragma once
+
+#include <aidl/android/hardware/wifi/hostapd/BnHostapd.h>
+#include <android-base/logging.h>
+#include <wifi_system/hostapd_manager.h>
+#include <wifi_system/supplicant_manager.h>
+
+#include "hostapd_aidl_test_utils.h"
+#include "hostapd_legacy_test_utils.h"
+
+using aidl::android::hardware::wifi::hostapd::IHostapd;
+using android::wifi_system::HostapdManager;
+using android::wifi_system::SupplicantManager;
+
+namespace {
+
+void startAndConfigureVendorHal() {
+ if (HostapdAidlTestUtils::useAidlService()) {
+ HostapdAidlTestUtils::startAndConfigureVendorHal();
+ } else {
+ HostapdLegacyTestUtils::startAndConfigureVendorHal();
+ }
+}
+
+void stopVendorHal() {
+ if (HostapdAidlTestUtils::useAidlService()) {
+ HostapdAidlTestUtils::stopVendorHal();
+ } else {
+ HostapdLegacyTestUtils::stopVendorHal();
+ }
+}
+
+void stopHostapd() {
+ HostapdManager hostapd_manager;
+ ASSERT_TRUE(hostapd_manager.StopHostapd());
+}
+
+void waitForSupplicantState(bool enable) {
+ SupplicantManager supplicant_manager;
+ int count = 50; // wait at most 5 seconds
+ while (count-- > 0) {
+ if (supplicant_manager.IsSupplicantRunning() == enable) {
+ return;
+ }
+ usleep(100000); // 100 ms
+ }
+ LOG(ERROR) << "Unable to " << (enable ? "start" : "stop") << " supplicant";
+}
+
+void toggleWifiFramework(bool enable) {
+ if (enable) {
+ std::system("svc wifi enable");
+ std::system("cmd wifi set-scan-always-available enabled");
+ waitForSupplicantState(true);
+ } else {
+ std::system("svc wifi disable");
+ std::system("cmd wifi set-scan-always-available disabled");
+ waitForSupplicantState(false);
+ }
+}
+
+} // namespace
+
+std::shared_ptr<IHostapd> getHostapd(const std::string& hostapd_instance_name) {
+ return IHostapd::fromBinder(
+ ndk::SpAIBinder(AServiceManager_waitForService(hostapd_instance_name.c_str())));
+}
+
+/**
+ * Disable the Wifi framework, hostapd, and vendor HAL.
+ *
+ * Note: The framework should be disabled to avoid having
+ * any other clients to the HALs during testing.
+ */
+void disableHalsAndFramework() {
+ toggleWifiFramework(false);
+ stopHostapd();
+ stopVendorHal();
+
+ // Wait for the services to stop.
+ sleep(3);
+}
+
+void initializeHostapdAndVendorHal(const std::string& hostapd_instance_name) {
+ startAndConfigureVendorHal();
+ HostapdManager hostapd_manager;
+ ASSERT_TRUE(hostapd_manager.StartHostapd());
+ getHostapd(hostapd_instance_name);
+}
+
+void stopHostapdAndVendorHal() {
+ stopHostapd();
+ stopVendorHal();
+}
+
+void startWifiFramework() {
+ toggleWifiFramework(true);
+}
+
+std::string setupApIfaceAndGetName(bool isBridged) {
+ if (HostapdAidlTestUtils::useAidlService()) {
+ return HostapdAidlTestUtils::setupApIfaceAndGetName(isBridged);
+ } else {
+ return HostapdLegacyTestUtils::setupApIfaceAndGetName(isBridged);
+ }
+}