Merge "Check interface version when running the VTS test for disableEht." into main
diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
index ccfa22d..e6f4808 100644
--- a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
+++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
@@ -41,6 +41,7 @@
void clearRemoteTaskCallback();
void notifyApStateChange(in android.hardware.automotive.remoteaccess.ApState state);
boolean isTaskScheduleSupported();
+ android.hardware.automotive.remoteaccess.TaskType[] getSupportedTaskTypesForScheduling();
void scheduleTask(in android.hardware.automotive.remoteaccess.ScheduleInfo scheduleInfo);
void unscheduleTask(String clientId, String scheduleId);
void unscheduleAllTasks(String clientId);
diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
index a929e10..a5d81cf 100644
--- a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
+++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
@@ -36,6 +36,7 @@
parcelable ScheduleInfo {
String clientId;
String scheduleId;
+ android.hardware.automotive.remoteaccess.TaskType taskType;
byte[] taskData;
int count;
long startTimeInEpochSeconds;
diff --git a/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/TaskType.aidl b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/TaskType.aidl
new file mode 100644
index 0000000..da70626
--- /dev/null
+++ b/automotive/remoteaccess/aidl_api/android.hardware.automotive.remoteaccess/current/android/hardware/automotive/remoteaccess/TaskType.aidl
@@ -0,0 +1,39 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.automotive.remoteaccess;
+@Backing(type="int") @VintfStability
+enum TaskType {
+ CUSTOM = 0,
+ ENTER_GARAGE_MODE = 1,
+}
diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
index 4912651..9863ed7 100644
--- a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
+++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteAccess.aidl
@@ -19,12 +19,39 @@
import android.hardware.automotive.remoteaccess.ApState;
import android.hardware.automotive.remoteaccess.IRemoteTaskCallback;
import android.hardware.automotive.remoteaccess.ScheduleInfo;
+import android.hardware.automotive.remoteaccess.TaskType;
/**
- * Interface representing a remote wakeup client.
+ * The remote access HAL.
*
- * A wakeup client is a binary outside Android framework that communicates with
- * a wakeup server and receives wake up command.
+ * <p>This HAL represents an external system that is always on even when Android
+ * is powered off. It is capable of wakeing up and notifying Android when a
+ * remote task arrives.
+ *
+ * <p>For cloud-based remote access, a cloud server will issue the remote task
+ * to the external system, which will then be forwarded to Android. The client
+ * is expected to call {@code setRemoteTaskCallback} to register the remote
+ * task callback and uses the information returned from {@code getVehicleId},
+ * {@code getWakeupServiceName} and {@code getProcessorId} to register with
+ * a remote server.
+ *
+ * <p>For serverless remote access, the remote task comes from the external
+ * system alone and no server is involved. The external system may support
+ * scheduling a remote task to executed later through {@code scheduleTask}.
+ *
+ * <p>For both cloud-based and serverless remote access, the ideal use case
+ * is to wake up Android when the vehicle is not in use and then shutdown
+ * Android after the task is complete. However, user may access the vehicle
+ * during this period, and Android must not be shutdown if this happens.
+ *
+ * <p>If this interface is implemented, then VHAL property
+ * {@code VEHICLE_IN_USE} must be supported to represent whether the vehicle is
+ * currently in use. Android will check this before sending the shutdown
+ * request.
+ *
+ * <p>The external power controller system must also check whether vehicle is
+ * in use upon receiving the shutdown request and makes sure that an
+ * user-unexpected shutdown must not happen.
*/
@VintfStability
interface IRemoteAccess {
@@ -110,6 +137,17 @@
boolean isTaskScheduleSupported();
/**
+ * Returns the supported task types for scheduling.
+ *
+ * <p>If task scheduling is not supported, this returns an empty array.
+ *
+ * <p>Otherwise, at least {@code TaskType.CUSTOM} must be supported.
+ *
+ * @return An array of supported task types.
+ */
+ TaskType[] getSupportedTaskTypesForScheduling();
+
+ /**
* Schedules a task to be executed later even when the vehicle is off.
*
* <p>If {@link isTaskScheduleSupported} returns {@code false}. This is no-op.
@@ -127,6 +165,8 @@
*
* <p>Must return {@code EX_ILLEGAL_ARGUMENT} if a pending schedule with the same
* {@code scheduleId} for this client exists.
+ *
+ * <p>Must return {@code EX_ILLEGAL_ARGUMENT} if the task type is not supported.
*/
void scheduleTask(in ScheduleInfo scheduleInfo);
diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.aidl
index 2cd7a5d..ee6f900 100644
--- a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.aidl
+++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/IRemoteTaskCallback.aidl
@@ -22,7 +22,7 @@
@VintfStability
interface IRemoteTaskCallback {
/**
- * A callback that is called when a remote task is requested.
+ * A callback that is called when a custom type remote task is requested.
*
* The data is passed down from the remote server to the remote task client
* which is an Android application, and is not interpreted/parsed by the
diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
index cf1437b..40fba6f 100644
--- a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
+++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/ScheduleInfo.aidl
@@ -16,6 +16,8 @@
package android.hardware.automotive.remoteaccess;
+import android.hardware.automotive.remoteaccess.TaskType;
+
@VintfStability
@JavaDerive(equals=true, toString=true)
parcelable ScheduleInfo {
@@ -31,8 +33,14 @@
*/
String scheduleId;
/**
+ * The type for the task.
+ */
+ TaskType taskType;
+ /**
* The opaque task data that will be sent back to the remote task client app when the task is
* executed. It is not interpreted/parsed by the Android system.
+ *
+ * <p>This is only used for {@code TaskType.CUSTOM}.
*/
byte[] taskData;
/**
diff --git a/automotive/remoteaccess/android/hardware/automotive/remoteaccess/TaskType.aidl b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/TaskType.aidl
new file mode 100644
index 0000000..761eb15
--- /dev/null
+++ b/automotive/remoteaccess/android/hardware/automotive/remoteaccess/TaskType.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.automotive.remoteaccess;
+
+@VintfStability
+@Backing(type="int")
+enum TaskType {
+ /**
+ * A custom task that is opaque to anyone other than the remote task client app.
+ *
+ * <p>The opaque task data in the {@code ScheduleInfo} will be sent back to the app when the
+ * task is to be executed.
+ */
+ CUSTOM = 0,
+ /**
+ * Enters the garage mode if allowed.
+ *
+ * <p>Make the Android system enters garage mode if vehicle is currently not in use and
+ * entering garage mode is allowed (e.g. battery level is high enough).
+ *
+ * <p>This is based on best-effort and it is not guaranteed.
+ *
+ * <p>If allowed, the external system should set {@code AP_POWER_BOOTUP_REASON} to
+ * {@code SYSTEM_ENTER_GARAGE_MODE} and then boot up (or resume) the head unit.
+ */
+ ENTER_GARAGE_MODE = 1,
+}
diff --git a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
index 1fc4037..23b4ebe 100644
--- a/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
+++ b/automotive/remoteaccess/hal/default/include/RemoteAccessService.h
@@ -81,6 +81,9 @@
ndk::ScopedAStatus isTaskScheduleSupported(bool* out) override;
+ ndk::ScopedAStatus getSupportedTaskTypesForScheduling(
+ std::vector<aidl::android::hardware::automotive::remoteaccess::TaskType>* out) override;
+
ndk::ScopedAStatus scheduleTask(
const aidl::android::hardware::automotive::remoteaccess::ScheduleInfo& scheduleInfo)
override;
diff --git a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
index 0944d86..5521134 100644
--- a/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
+++ b/automotive/remoteaccess/hal/default/src/RemoteAccessService.cpp
@@ -40,6 +40,7 @@
using ::aidl::android::hardware::automotive::remoteaccess::ApState;
using ::aidl::android::hardware::automotive::remoteaccess::IRemoteTaskCallback;
using ::aidl::android::hardware::automotive::remoteaccess::ScheduleInfo;
+using ::aidl::android::hardware::automotive::remoteaccess::TaskType;
using ::aidl::android::hardware::automotive::vehicle::VehicleProperty;
using ::android::base::Error;
using ::android::base::ParseInt;
@@ -319,6 +320,13 @@
return ScopedAStatus::ok();
}
+ndk::ScopedAStatus RemoteAccessService::getSupportedTaskTypesForScheduling(
+ std::vector<TaskType>* out) {
+ // TODO(b/316233421): support ENTER_GARAGE_MODE type.
+ out->push_back(TaskType::CUSTOM);
+ return ScopedAStatus::ok();
+}
+
ScopedAStatus RemoteAccessService::scheduleTask(const ScheduleInfo& scheduleInfo) {
ClientContext context;
ScheduleTaskRequest request = {};
diff --git a/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp b/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp
index c0038c2..4af0003 100644
--- a/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp
+++ b/automotive/remoteaccess/hal/default/test/RemoteAccessServiceUnitTest.cpp
@@ -48,6 +48,7 @@
using ::aidl::android::hardware::automotive::remoteaccess::ApState;
using ::aidl::android::hardware::automotive::remoteaccess::BnRemoteTaskCallback;
using ::aidl::android::hardware::automotive::remoteaccess::ScheduleInfo;
+using ::aidl::android::hardware::automotive::remoteaccess::TaskType;
using ::aidl::android::hardware::automotive::vehicle::VehiclePropValue;
using ::grpc::ClientAsyncReaderInterface;
@@ -61,6 +62,7 @@
using ::ndk::ScopedAStatus;
using ::testing::_;
using ::testing::DoAll;
+using ::testing::ElementsAre;
using ::testing::Return;
using ::testing::SetArgPointee;
@@ -434,6 +436,14 @@
EXPECT_TRUE(out);
}
+TEST_F(RemoteAccessServiceUnitTest, TestGetSupportedTaskTypesForScheduling) {
+ std::vector<TaskType> out;
+ ScopedAStatus status = getService()->getSupportedTaskTypesForScheduling(&out);
+
+ EXPECT_TRUE(status.isOk());
+ EXPECT_THAT(out, ElementsAre(TaskType::CUSTOM));
+}
+
TEST_F(RemoteAccessServiceUnitTest, TestScheduleTask) {
ScheduleTaskRequest grpcRequest = {};
EXPECT_CALL(*getGrpcWakeupClientStub(), ScheduleTask)
diff --git a/automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp b/automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp
index c16b29a..03a9df5 100644
--- a/automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp
+++ b/automotive/vehicle/2.0/default/common/src/VehicleUtils.cpp
@@ -30,7 +30,7 @@
std::unique_ptr<VehiclePropValue> createVehiclePropValue(
VehiclePropertyType type, size_t vecSize) {
- auto val = std::unique_ptr<VehiclePropValue>(new VehiclePropValue);
+ auto val = std::unique_ptr<VehiclePropValue>(new VehiclePropValue());
switch (type) {
case VehiclePropertyType::INT32: // fall through
case VehiclePropertyType::INT32_VEC: // fall through
diff --git a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
index 9720aca..55af2ab 100644
--- a/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
+++ b/automotive/vehicle/aidl_property/aidl_api/android.hardware.automotive.vehicle.property/current/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
@@ -37,4 +37,5 @@
USER_POWER_ON = 0,
SYSTEM_USER_DETECTION = 1,
SYSTEM_REMOTE_ACCESS = 2,
+ SYSTEM_ENTER_GARAGE_MODE = 3,
}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
index e325b38..8c8c2da 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleApPowerBootupReason.aidl
@@ -34,7 +34,24 @@
SYSTEM_USER_DETECTION = 1,
/**
* Automatic power on to execute a remote task. This is triggered by
- * receiving a wakeup message from TCU wakeup client.
+ * receiving a wakeup message from an external system in the vehicle.
*/
SYSTEM_REMOTE_ACCESS = 2,
+ /**
+ * Automatic power on to enter garage mode. This is triggered by
+ * receiving a wakeup message from an external system in the vehicle.
+ *
+ * Note that this does not necessarily mean Android will enter
+ * the garage mode since user may enter the vehicle after this is set.
+ * The system will only enter garage mode if VEHICLE_IN_USE is not true
+ * upon check.
+ *
+ * To consider the Time-Of-Check-Time-Of-Use issue, there is a slight chance
+ * that the vehicle become in-use after car service does the VEHICLE_IN_USE
+ * check. The external power controller must also check whether the vehicle
+ * is in use upon receiving the SHUTDOWN_REQUEST, before sending out
+ * SHUTDOWN_PREPARE, to make sure the system does not enter garage mode or
+ * shutdown if the vehicle is currently in use.
+ */
+ SYSTEM_ENTER_GARAGE_MODE = 3,
}
diff --git a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
index 88c8733..fb8f730 100644
--- a/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
+++ b/automotive/vehicle/aidl_property/android/hardware/automotive/vehicle/VehicleProperty.aidl
@@ -4732,12 +4732,22 @@
/**
* Request the head unit to be shutdown.
*
+ * <p>This is required for executing a task when the head unit is powered off (remote task
+ * feature). After the head unit is powered-on to execute the task, the head unit should
+ * be shutdown. The head unit will send this message once the task is finished.
+ *
+ * <p>This is not for the case when a user wants to shutdown the head unit.
+ *
* <p>This usually involves telling a separate system outside the head unit (e.g. a power
* controller) to prepare shutting down the head unit.
*
- * <p>This does not mean the head unit will shutdown immediately.
+ * <p>Note that the external system must validate whether this request is valid by checking
+ * whether the vehicle is currently in use. If a user enters the vehicle after a
+ * SHUTDOWN_REQUEST is sent, then the system must ignore this request. It
+ * is recommended to store a VehicleInUse property in the power controller and exposes it
+ * through VEHICLE_IN_USE property. A shutdown request must be ignored if VehicleInUse is true.
*
- * <p>This means that another system will start sending a shutdown signal to the head unit,
+ * <p>If allowed, the external system will start sending a shutdown signal to the head unit,
* which will cause VHAL to send SHUTDOWN_PREPARE message to Android. Android will then start
* the shut down process by handling the message.
*
diff --git a/bluetooth/audio/aidl/default/A2dpBits.h b/bluetooth/audio/aidl/default/A2dpBits.h
index f467c95..fb7587c 100644
--- a/bluetooth/audio/aidl/default/A2dpBits.h
+++ b/bluetooth/audio/aidl/default/A2dpBits.h
@@ -23,7 +23,8 @@
uint8_t* data_;
public:
- A2dpBits(const std::vector<uint8_t>& vector) : cdata_(vector.data()) {}
+ A2dpBits(const std::vector<uint8_t>& vector)
+ : cdata_(vector.data()), data_(nullptr) {}
A2dpBits(std::vector<uint8_t>& vector)
: cdata_(vector.data()), data_(vector.data()) {}
diff --git a/power/aidl/Android.bp b/power/aidl/Android.bp
index 7643926..8900fb8 100644
--- a/power/aidl/Android.bp
+++ b/power/aidl/Android.bp
@@ -28,11 +28,20 @@
"android/hardware/power/*.aidl",
],
stability: "vintf",
+ imports: [
+ "android.hardware.common.fmq-V1",
+ "android.hardware.common-V2",
+ ],
backend: {
cpp: {
+ enabled: false,
+ },
+ ndk: {
enabled: true,
},
java: {
+ sdk_version: "module_current",
+ enabled: true,
platform_apis: true,
},
},
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/ChannelConfig.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/ChannelConfig.aidl
new file mode 100644
index 0000000..d3caca4
--- /dev/null
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/ChannelConfig.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power;
+@VintfStability
+parcelable ChannelConfig {
+ android.hardware.common.fmq.MQDescriptor<android.hardware.power.ChannelMessage,android.hardware.common.fmq.SynchronizedReadWrite> channelDescriptor;
+ @nullable android.hardware.common.fmq.MQDescriptor<byte,android.hardware.common.fmq.SynchronizedReadWrite> eventFlagDescriptor;
+ int readFlagBitmask;
+ int writeFlagBitmask;
+}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/ChannelMessage.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/ChannelMessage.aidl
new file mode 100644
index 0000000..25f01c0
--- /dev/null
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/ChannelMessage.aidl
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power;
+@FixedSize @VintfStability
+parcelable ChannelMessage {
+ int sessionID;
+ android.hardware.power.ChannelMessage.ChannelMessageContents data;
+ @FixedSize @VintfStability
+ union ChannelMessageContents {
+ int[20] tids = {(-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */, (-1) /* -1 */};
+ long targetDuration;
+ android.hardware.power.SessionHint hint;
+ android.hardware.power.ChannelMessage.ChannelMessageContents.SessionModeSetter mode;
+ android.hardware.power.WorkDurationFixedV1 workDuration;
+ @FixedSize @VintfStability
+ parcelable SessionModeSetter {
+ android.hardware.power.SessionMode modeInt;
+ boolean enabled;
+ }
+ }
+}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPower.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPower.aidl
index ae03313..8acdaf2 100644
--- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPower.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPower.aidl
@@ -40,4 +40,7 @@
boolean isBoostSupported(in android.hardware.power.Boost type);
android.hardware.power.IPowerHintSession createHintSession(in int tgid, in int uid, in int[] threadIds, in long durationNanos);
long getHintSessionPreferredRate();
+ android.hardware.power.IPowerHintSession createHintSessionWithConfig(in int tgid, in int uid, in int[] threadIds, in long durationNanos, in android.hardware.power.SessionTag tag, out android.hardware.power.SessionConfig config);
+ android.hardware.power.ChannelConfig getSessionChannel(in int tgid, in int uid);
+ oneway void closeSessionChannel(in int tgid, in int uid);
}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl
index 6bc663e..010f815 100644
--- a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/IPowerHintSession.aidl
@@ -42,4 +42,5 @@
oneway void sendHint(android.hardware.power.SessionHint hint);
void setThreads(in int[] threadIds);
oneway void setMode(android.hardware.power.SessionMode type, boolean enabled);
+ android.hardware.power.SessionConfig getSessionConfig();
}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionConfig.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionConfig.aidl
new file mode 100644
index 0000000..b03cfb2
--- /dev/null
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionConfig.aidl
@@ -0,0 +1,38 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power;
+@VintfStability
+parcelable SessionConfig {
+ long id;
+}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionTag.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionTag.aidl
new file mode 100644
index 0000000..80848a4
--- /dev/null
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/SessionTag.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power;
+@Backing(type="int") @VintfStability
+enum SessionTag {
+ OTHER,
+ SURFACEFLINGER,
+ HWUI,
+ GAME,
+}
diff --git a/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/WorkDurationFixedV1.aidl b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/WorkDurationFixedV1.aidl
new file mode 100644
index 0000000..8cd246d
--- /dev/null
+++ b/power/aidl/aidl_api/android.hardware.power/current/android/hardware/power/WorkDurationFixedV1.aidl
@@ -0,0 +1,42 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+///////////////////////////////////////////////////////////////////////////////
+// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. //
+///////////////////////////////////////////////////////////////////////////////
+
+// This file is a snapshot of an AIDL file. Do not edit it manually. There are
+// two cases:
+// 1). this is a frozen version file - do not edit this in any case.
+// 2). this is a 'current' file. If you make a backwards compatible change to
+// the interface (from the latest frozen version), the build system will
+// prompt you to update this file with `m <name>-update-api`.
+//
+// You must not make a backward incompatible change to any AIDL file built
+// with the aidl_interface module type with versions property set. The module
+// type is used to build AIDL files in a way that they can be used across
+// independently updatable components of the system. If a device is shipped
+// with such a backward incompatible change, it has a high risk of breaking
+// later when a module using the interface is updated, e.g., Mainline modules.
+
+package android.hardware.power;
+@FixedSize @VintfStability
+parcelable WorkDurationFixedV1 {
+ long timeStampNanos;
+ long durationNanos;
+ long workPeriodStartTimestampNanos;
+ long cpuDurationNanos;
+ long gpuDurationNanos;
+}
diff --git a/power/aidl/android/hardware/power/ChannelConfig.aidl b/power/aidl/android/hardware/power/ChannelConfig.aidl
new file mode 100644
index 0000000..4da292e
--- /dev/null
+++ b/power/aidl/android/hardware/power/ChannelConfig.aidl
@@ -0,0 +1,52 @@
+
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.power;
+
+import android.hardware.common.fmq.MQDescriptor;
+import android.hardware.common.fmq.SynchronizedReadWrite;
+import android.hardware.power.ChannelMessage;
+
+@VintfStability
+parcelable ChannelConfig {
+ /**
+ * The message queue descriptor that provides the information necessary for
+ * a client to write to this channel.
+ */
+ MQDescriptor<ChannelMessage, SynchronizedReadWrite> channelDescriptor;
+
+ /**
+ * A message queue descriptor used to pass an optional event flag to clients,
+ * used to synchronize multiple message queues using the same flag. If not
+ * defined, the flag from the channelDescriptor should be used.
+ */
+ @nullable MQDescriptor<byte, SynchronizedReadWrite> eventFlagDescriptor;
+
+ /**
+ * The read flag bitmask to be used with the event flag, specifying the
+ * bits used by this channel to mark that the buffer has been read from.
+ * If set to 0, the default bitmask will be used.
+ */
+ int readFlagBitmask;
+
+ /**
+ * The write flag bitmask to be used with the event flag, specifying the
+ * bits used by this channel to mark that the buffer has been written to.
+ * If set to 0, the default bitmask will be used.
+ */
+ int writeFlagBitmask;
+}
diff --git a/power/aidl/android/hardware/power/ChannelMessage.aidl b/power/aidl/android/hardware/power/ChannelMessage.aidl
new file mode 100644
index 0000000..4747d90
--- /dev/null
+++ b/power/aidl/android/hardware/power/ChannelMessage.aidl
@@ -0,0 +1,94 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.power;
+
+import android.hardware.power.SessionHint;
+import android.hardware.power.SessionMode;
+import android.hardware.power.WorkDurationFixedV1;
+
+/**
+ * Data sent through the FMQ must follow this structure. It's important to note
+ * that such data may come from the app itself, so the HAL must validate all
+ * data received through this interface, and reject any calls not guaranteed to be
+ * valid. Each of the types defined in the inner union maps to an equivalent call
+ * on IPowerHintSession, and is merely being used to expedite the use of that API
+ * in cases where it is safe to bypass the HintManagerService.
+ */
+@FixedSize
+@VintfStability
+parcelable ChannelMessage {
+ /**
+ * The ID of the specific session sending the hint, used to enable a single
+ * channel to be multiplexed across all sessions in a single process.
+ */
+ int sessionID;
+
+ /**
+ * A union defining the different messages that can be passed through the
+ * channel. Each type corresponds to a different call in IPowerHintSession.
+ */
+ ChannelMessageContents data;
+
+ @FixedSize
+ @VintfStability
+ union ChannelMessageContents {
+ /**
+ * List of TIDs for this session to change to. Can be used in cases
+ * where HintManagerService is not needed to validate the TIDs, such as
+ * when all TIDs directly belong to the process that owns the session.
+ */
+ int[20] tids = {
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1};
+
+ /**
+ * Setting this field will update the session’s target duration, equivalent
+ * to calling updateTargetWorkDuration(targetDuration).
+ */
+ long targetDuration;
+
+ /**
+ * Setting this field will send a hint to the session, equivalent to
+ * calling sendHint(hint).
+ */
+ SessionHint hint;
+
+ /**
+ * Setting this field will send a hint to the session, equivalent to
+ * calling setMode(mode.modeInt, mode.enabled).
+ */
+ SessionModeSetter mode;
+
+ /**
+ * Setting this field will update the session’s actual duration, equivalent
+ * to calling reportActualWorkDuration([workDuration]). Only one duration
+ * can be passed at a time; this API expects durations to be reported
+ * immediately each frame, since the overhead of this call is much lower.
+ */
+ WorkDurationFixedV1 workDuration;
+
+ /**
+ * This structure is used to fit both the mode and the state within one
+ * entry in the union.
+ */
+ @FixedSize
+ @VintfStability
+ parcelable SessionModeSetter {
+ SessionMode modeInt;
+ boolean enabled;
+ }
+ }
+}
diff --git a/power/aidl/android/hardware/power/IPower.aidl b/power/aidl/android/hardware/power/IPower.aidl
index ee8e5a3..e25714f 100644
--- a/power/aidl/android/hardware/power/IPower.aidl
+++ b/power/aidl/android/hardware/power/IPower.aidl
@@ -17,8 +17,11 @@
package android.hardware.power;
import android.hardware.power.Boost;
+import android.hardware.power.ChannelConfig;
import android.hardware.power.IPowerHintSession;
import android.hardware.power.Mode;
+import android.hardware.power.SessionConfig;
+import android.hardware.power.SessionTag;
@VintfStability
interface IPower {
@@ -103,4 +106,42 @@
* EX_UNSUPPORTED_OPERATION if hint session is not supported.
*/
long getHintSessionPreferredRate();
+
+ /**
+ * A version of createHintSession that returns an additional bundle of session
+ * data, useful to help the session immediately communicate via an FMQ channel
+ * for more efficient updates.
+ *
+ * @return the new session if it is supported on this device, otherwise return
+ * with EX_UNSUPPORTED_OPERATION error if hint session is not
+ * supported on this device.
+ * @param tgid The TGID to be associated with this session.
+ * @param uid The UID to be associated with this session.
+ * @param threadIds The list of threads to be associated with this session.
+ * @param durationNanos The desired duration in nanoseconds for this session.
+ * @param config Extra session metadata to be returned to the caller.
+ */
+ IPowerHintSession createHintSessionWithConfig(in int tgid, in int uid, in int[] threadIds,
+ in long durationNanos, in SessionTag tag, out SessionConfig config);
+
+ /**
+ * Used to get an FMQ channel, per-process. The channel should be unique to
+ * that process, and should return the same ChannelConfig if called multiple
+ * times from that same process.
+ *
+ * @return the channel config if hint sessions are supported on this device,
+ * otherwise return with EX_UNSUPPORTED_OPERATION.
+ * @param tgid The TGID to be associated with this channel.
+ * @param uid The UID to be associated with this channel.
+ */
+ ChannelConfig getSessionChannel(in int tgid, in int uid);
+
+ /**
+ * Used to close a channel once it is no longer needed by a process, or that
+ * process dies.
+ *
+ * @param tgid The TGID to be associated with this channel.
+ * @param uid The UID to be associated with this channel.
+ */
+ oneway void closeSessionChannel(in int tgid, in int uid);
}
diff --git a/power/aidl/android/hardware/power/IPowerHintSession.aidl b/power/aidl/android/hardware/power/IPowerHintSession.aidl
index 62263c8..9dd251f 100644
--- a/power/aidl/android/hardware/power/IPowerHintSession.aidl
+++ b/power/aidl/android/hardware/power/IPowerHintSession.aidl
@@ -16,6 +16,7 @@
package android.hardware.power;
+import android.hardware.power.SessionConfig;
import android.hardware.power.SessionHint;
import android.hardware.power.SessionMode;
import android.hardware.power.WorkDuration;
@@ -91,4 +92,11 @@
* @param enabled True to enable the mode, false to disable it
*/
oneway void setMode(SessionMode type, boolean enabled);
+
+ /**
+ * This method provides direct access to a session's config data.
+ *
+ * @return the config data for this session
+ */
+ SessionConfig getSessionConfig();
}
diff --git a/power/aidl/android/hardware/power/SessionConfig.aidl b/power/aidl/android/hardware/power/SessionConfig.aidl
new file mode 100644
index 0000000..93dc9a2
--- /dev/null
+++ b/power/aidl/android/hardware/power/SessionConfig.aidl
@@ -0,0 +1,30 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.power;
+
+/**
+ * Additional session to be passed to the hint session during creation, or acquired
+ * after creation from the session directly.
+ */
+@VintfStability
+parcelable SessionConfig {
+ /**
+ * The session's unique ID, used to identify the session for debugging and
+ * for multiplexing on the per-process FMQ channel.
+ */
+ long id;
+}
diff --git a/power/aidl/android/hardware/power/SessionTag.aidl b/power/aidl/android/hardware/power/SessionTag.aidl
new file mode 100644
index 0000000..c1d48e4
--- /dev/null
+++ b/power/aidl/android/hardware/power/SessionTag.aidl
@@ -0,0 +1,41 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.power;
+
+@VintfStability
+@Backing(type="int")
+enum SessionTag {
+ /**
+ * This tag is used to mark uncategorized hint sessions.
+ */
+ OTHER,
+
+ /**
+ * This tag is used to mark the SurfaceFlinger hint session.
+ */
+ SURFACEFLINGER,
+
+ /**
+ * This tag is used to mark HWUI hint sessions.
+ */
+ HWUI,
+
+ /**
+ * This tag is used to mark Game hint sessions.
+ */
+ GAME,
+}
diff --git a/power/aidl/android/hardware/power/WorkDurationFixedV1.aidl b/power/aidl/android/hardware/power/WorkDurationFixedV1.aidl
new file mode 100644
index 0000000..2d202ff
--- /dev/null
+++ b/power/aidl/android/hardware/power/WorkDurationFixedV1.aidl
@@ -0,0 +1,53 @@
+/*
+ * Copyright (C) 2023 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.power;
+
+@FixedSize
+@VintfStability
+parcelable WorkDurationFixedV1 {
+ /**
+ * Timestamp in nanoseconds based on CLOCK_MONOTONIC when the duration
+ * sample was measured.
+ */
+ long timeStampNanos;
+
+ /**
+ * Total work duration in nanoseconds.
+ */
+ long durationNanos;
+
+ /**
+ * Timestamp in nanoseconds based on CLOCK_MONOTONIC when the work starts.
+ * The work period start timestamp could be zero if the call is from
+ * the legacy SDK/NDK reportActualWorkDuration API.
+ */
+ long workPeriodStartTimestampNanos;
+
+ /**
+ * CPU work duration in nanoseconds.
+ * The CPU work duration could be the same as the total work duration if
+ * the call is from the legacy SDK/NDK reportActualWorkDuration API.
+ */
+ long cpuDurationNanos;
+
+ /**
+ * GPU work duration in nanoseconds.
+ * The GPU work duration could be zero if the call is from the legacy
+ * SDK/NDK reportActualWorkDuration API.
+ */
+ long gpuDurationNanos;
+}
diff --git a/power/aidl/default/Android.bp b/power/aidl/default/Android.bp
index e3af179..b4ccc7d 100644
--- a/power/aidl/default/Android.bp
+++ b/power/aidl/default/Android.bp
@@ -29,8 +29,12 @@
vintf_fragments: [":android.hardware.power.xml"],
vendor: true,
shared_libs: [
+ "android.hardware.common-V2-ndk",
+ "android.hardware.common.fmq-V1-ndk",
"libbase",
"libbinder_ndk",
+ "libcutils",
+ "libfmq",
],
srcs: [
"main.cpp",
diff --git a/power/aidl/default/Power.cpp b/power/aidl/default/Power.cpp
index 8fe370c..8f15663 100644
--- a/power/aidl/default/Power.cpp
+++ b/power/aidl/default/Power.cpp
@@ -18,6 +18,8 @@
#include "PowerHintSession.h"
#include <android-base/logging.h>
+#include <fmq/AidlMessageQueue.h>
+#include <fmq/EventFlag.h>
namespace aidl {
namespace android {
@@ -27,6 +29,10 @@
namespace example {
using namespace std::chrono_literals;
+using ::aidl::android::hardware::common::fmq::MQDescriptor;
+using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite;
+using ::aidl::android::hardware::power::ChannelMessage;
+using ::android::AidlMessageQueue;
using ndk::ScopedAStatus;
@@ -70,6 +76,27 @@
return ScopedAStatus::ok();
}
+ndk::ScopedAStatus Power::createHintSessionWithConfig(
+ int32_t tgid, int32_t uid, const std::vector<int32_t>& threadIds, int64_t durationNanos,
+ SessionTag, SessionConfig* config, std::shared_ptr<IPowerHintSession>* _aidl_return) {
+ auto out = createHintSession(tgid, uid, threadIds, durationNanos, _aidl_return);
+ static_cast<PowerHintSession*>(_aidl_return->get())->getSessionConfig(config);
+ return out;
+}
+
+ndk::ScopedAStatus Power::getSessionChannel(int32_t, int32_t, ChannelConfig* _aidl_return) {
+ static AidlMessageQueue<ChannelMessage, SynchronizedReadWrite> stubQueue{1, true};
+ _aidl_return->channelDescriptor = stubQueue.dupeDesc();
+ _aidl_return->readFlagBitmask = 0;
+ _aidl_return->writeFlagBitmask = 0;
+ _aidl_return->eventFlagDescriptor = std::nullopt;
+ return ndk::ScopedAStatus::ok();
+}
+
+ndk::ScopedAStatus Power::closeSessionChannel(int32_t, int32_t) {
+ return ndk::ScopedAStatus::ok();
+}
+
ScopedAStatus Power::getHintSessionPreferredRate(int64_t* outNanoseconds) {
*outNanoseconds = std::chrono::nanoseconds(1ms).count();
return ScopedAStatus::ok();
diff --git a/power/aidl/default/Power.h b/power/aidl/default/Power.h
index 7f8405e..baabaa7 100644
--- a/power/aidl/default/Power.h
+++ b/power/aidl/default/Power.h
@@ -17,6 +17,7 @@
#pragma once
#include <aidl/android/hardware/power/BnPower.h>
+#include "aidl/android/hardware/power/SessionTag.h"
namespace aidl {
namespace android {
@@ -35,7 +36,14 @@
const std::vector<int32_t>& threadIds,
int64_t durationNanos,
std::shared_ptr<IPowerHintSession>* _aidl_return) override;
+ ndk::ScopedAStatus createHintSessionWithConfig(
+ int32_t tgid, int32_t uid, const std::vector<int32_t>& threadIds, int64_t durationNanos,
+ SessionTag tag, SessionConfig* config,
+ std::shared_ptr<IPowerHintSession>* _aidl_return) override;
ndk::ScopedAStatus getHintSessionPreferredRate(int64_t* outNanoseconds) override;
+ ndk::ScopedAStatus getSessionChannel(int32_t tgid, int32_t uid,
+ ChannelConfig* _aidl_return) override;
+ ndk::ScopedAStatus closeSessionChannel(int32_t tgid, int32_t uid) override;
private:
std::vector<std::shared_ptr<IPowerHintSession>> mPowerHintSessions;
diff --git a/power/aidl/default/PowerHintSession.cpp b/power/aidl/default/PowerHintSession.cpp
index 452e435..847a42e 100644
--- a/power/aidl/default/PowerHintSession.cpp
+++ b/power/aidl/default/PowerHintSession.cpp
@@ -17,6 +17,7 @@
#include "PowerHintSession.h"
#include <android-base/logging.h>
+#include "android/binder_auto_utils.h"
namespace aidl::android::hardware::power::impl::example {
@@ -63,4 +64,9 @@
return ScopedAStatus::ok();
}
+ScopedAStatus PowerHintSession::getSessionConfig(SessionConfig* _aidl_return) {
+ _aidl_return->id = 1;
+ return ScopedAStatus::ok();
+}
+
} // namespace aidl::android::hardware::power::impl::example
diff --git a/power/aidl/default/PowerHintSession.h b/power/aidl/default/PowerHintSession.h
index b488bf1..2ed5588 100644
--- a/power/aidl/default/PowerHintSession.h
+++ b/power/aidl/default/PowerHintSession.h
@@ -35,6 +35,7 @@
ndk::ScopedAStatus sendHint(SessionHint hint) override;
ndk::ScopedAStatus setThreads(const std::vector<int32_t>& threadIds) override;
ndk::ScopedAStatus setMode(SessionMode mode, bool enabled) override;
+ ndk::ScopedAStatus getSessionConfig(SessionConfig* _aidl_return) override;
};
} // namespace aidl::android::hardware::power::impl::example
diff --git a/power/aidl/vts/Android.bp b/power/aidl/vts/Android.bp
index eb98b8b..c9285f4 100644
--- a/power/aidl/vts/Android.bp
+++ b/power/aidl/vts/Android.bp
@@ -31,6 +31,11 @@
srcs: ["VtsHalPowerTargetTest.cpp"],
shared_libs: [
"libbinder_ndk",
+ "libfmq",
+ ],
+ static_libs: [
+ "android.hardware.common.fmq-V1-ndk",
+ "android.hardware.common-V2-ndk",
],
test_suites: [
"general-tests",
diff --git a/power/aidl/vts/VtsHalPowerTargetTest.cpp b/power/aidl/vts/VtsHalPowerTargetTest.cpp
index 96995a0..11d44b8 100644
--- a/power/aidl/vts/VtsHalPowerTargetTest.cpp
+++ b/power/aidl/vts/VtsHalPowerTargetTest.cpp
@@ -24,12 +24,22 @@
#include <android/binder_process.h>
#include <android/binder_status.h>
+#include <fmq/AidlMessageQueue.h>
+#include <fmq/EventFlag.h>
+
#include <unistd.h>
+#include <cstdint>
+#include "aidl/android/hardware/common/fmq/SynchronizedReadWrite.h"
+#include "fmq/EventFlag.h"
namespace aidl::android::hardware::power {
namespace {
+using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite;
+using ::android::AidlMessageQueue;
using android::hardware::power::Boost;
+using android::hardware::power::ChannelConfig;
+using android::hardware::power::ChannelMessage;
using android::hardware::power::IPower;
using android::hardware::power::IPowerHintSession;
using android::hardware::power::Mode;
@@ -37,6 +47,8 @@
using android::hardware::power::SessionMode;
using android::hardware::power::WorkDuration;
+using SessionMessageQueue = AidlMessageQueue<ChannelMessage, SynchronizedReadWrite>;
+
const std::vector<Boost> kBoosts{ndk::enum_range<Boost>().begin(), ndk::enum_range<Boost>().end()};
const std::vector<Mode> kModes{ndk::enum_range<Mode>().begin(), ndk::enum_range<Mode>().end()};
@@ -190,6 +202,31 @@
ASSERT_GE(rate, 1000000);
}
+TEST_P(PowerAidl, createHintSessionWithConfig) {
+ if (mServiceVersion < 5) {
+ GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond.";
+ }
+ std::shared_ptr<IPowerHintSession> session;
+ SessionConfig config;
+
+ auto status = power->createHintSessionWithConfig(getpid(), getuid(), kSelfTids, 16666666L,
+ SessionTag::OTHER, &config, &session);
+ ASSERT_TRUE(status.isOk());
+ ASSERT_NE(nullptr, session);
+}
+
+TEST_P(PowerAidl, getAndCloseSessionChannel) {
+ if (mServiceVersion < 5) {
+ GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond.";
+ }
+ ChannelConfig config;
+ auto status = power->getSessionChannel(getpid(), getuid(), &config);
+ ASSERT_TRUE(status.isOk());
+ auto messageQueue = std::make_shared<SessionMessageQueue>(config.channelDescriptor, true);
+ ASSERT_TRUE(messageQueue->isValid());
+ ASSERT_TRUE(power->closeSessionChannel(getpid(), getuid()).isOk());
+}
+
TEST_P(HintSessionAidl, createAndCloseHintSession) {
ASSERT_TRUE(mSession->pause().isOk());
ASSERT_TRUE(mSession->resume().isOk());
@@ -252,6 +289,14 @@
}
}
+TEST_P(HintSessionAidl, getSessionConfig) {
+ if (mServiceVersion < 5) {
+ GTEST_SKIP() << "DEVICE not launching with Power V5 and beyond.";
+ }
+ SessionConfig config;
+ ASSERT_TRUE(mSession->getSessionConfig(&config).isOk());
+}
+
// FIXED_PERFORMANCE mode is required for all devices which ship on Android 11
// or later
TEST_P(PowerAidl, hasFixedPerformance) {
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
index 0f5e7e4..bc1c292 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfig.aidl
@@ -51,4 +51,5 @@
oneway void setPreferredDataModem(in int serial, in byte modemId);
oneway void setResponseFunctions(in android.hardware.radio.config.IRadioConfigResponse radioConfigResponse, in android.hardware.radio.config.IRadioConfigIndication radioConfigIndication);
oneway void setSimSlotsMapping(in int serial, in android.hardware.radio.config.SlotPortMapping[] slotMap);
+ oneway void getSimultaneousCallingSupport(in int serial);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl
index 9189f90..f786373 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigIndication.aidl
@@ -36,4 +36,5 @@
@VintfStability
interface IRadioConfigIndication {
oneway void simSlotsStatusChanged(in android.hardware.radio.RadioIndicationType type, in android.hardware.radio.config.SimSlotStatus[] slotStatus);
+ oneway void onSimultaneousCallingSupportChanged(in int[] enabledLogicalSlots);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl
index 348aa34..6ff7bd0 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/IRadioConfigResponse.aidl
@@ -42,4 +42,5 @@
oneway void setNumOfLiveModemsResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void setPreferredDataModemResponse(in android.hardware.radio.RadioResponseInfo info);
oneway void setSimSlotsMappingResponse(in android.hardware.radio.RadioResponseInfo info);
+ oneway void getSimultaneousCallingSupportResponse(in android.hardware.radio.RadioResponseInfo info, in int[] enabledLogicalSlots);
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl
index 3648866..2c66abd 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.config/current/android/hardware/radio/config/PhoneCapability.aidl
@@ -39,4 +39,6 @@
byte maxActiveInternetData;
boolean isInternetLingeringSupported;
byte[] logicalModemIds;
+ byte maxActiveVoice = UNKNOWN /* -1 */;
+ const byte UNKNOWN = (-1) /* -1 */;
}
diff --git a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl
index 6dbf09d..9846006 100644
--- a/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl
+++ b/radio/aidl/aidl_api/android.hardware.radio.ims/current/android/hardware/radio/ims/SuggestedAction.aidl
@@ -39,5 +39,5 @@
TRIGGER_PLMN_BLOCK,
TRIGGER_PLMN_BLOCK_WITH_TIMEOUT,
TRIGGER_RAT_BLOCK,
- TRIGGER_CLEAR_RAT_BLOCK,
+ TRIGGER_CLEAR_RAT_BLOCKS,
}
diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
index 9058d9d..8f4dff4 100644
--- a/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
+++ b/radio/aidl/android/hardware/radio/config/IRadioConfig.aidl
@@ -191,4 +191,20 @@
* This is available when android.hardware.telephony.subscription is defined.
*/
void setSimSlotsMapping(in int serial, in SlotPortMapping[] slotMap);
+
+ /**
+ * Get the set of logical slots where simultaneous cellular calling is currently possible. This
+ * does not include simultaneous calling availability over other non-cellular transports, such
+ * as IWLAN.
+ *
+ * Get the set of slots that currently support simultaneous cellular calling. When a new
+ * cellular call is placed/received, if another slot is active and handing a call, both the
+ * active slot and proposed slot must be in this list in order to support simultaneous cellular
+ * calling for both of those slots.
+ *
+ * @param serial Serial number of request
+ *
+ * This is available when android.hardware.telephony is defined.
+ */
+ void getSimultaneousCallingSupport(in int serial);
}
diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl
index ed2366b..9eacb8e 100644
--- a/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl
+++ b/radio/aidl/android/hardware/radio/config/IRadioConfigIndication.aidl
@@ -37,4 +37,15 @@
*/
void simSlotsStatusChanged(
in android.hardware.radio.RadioIndicationType type, in SimSlotStatus[] slotStatus);
+
+ /**
+ * The logical slots supporting simultaneous cellular calling has changed.
+ *
+ * @param enabledLogicalSlots The slots that have simultaneous cellular calling enabled. If
+ * there is a call active on logical slot X, then a simultaneous cellular call is only possible
+ * on logical slot Y if BOTH slot X and slot Y are in enabledLogicalSlots. If simultaneous
+ * cellular calling is not currently supported, the expected value of enabledLogicalSLots is an
+ * empty int array. Sending only one radio slot is not acceptable in any case.
+ */
+ void onSimultaneousCallingSupportChanged(in int[] enabledLogicalSlots);
}
diff --git a/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl b/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl
index df93e3c..33b0ff0 100644
--- a/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl
+++ b/radio/aidl/android/hardware/radio/config/IRadioConfigResponse.aidl
@@ -129,4 +129,27 @@
* RadioError:INVALID_ARGUMENTS
*/
void setSimSlotsMappingResponse(in android.hardware.radio.RadioResponseInfo info);
+
+ /**
+ * Response to the asynchronous
+ * {@link IRadioConfig#getSimultaneousCallingSupport} request.
+ *
+ * @param info Response info struct containing response type, serial no. and error
+ * @param enabledLogicalSlots The slots that have simultaneous cellular calling enabled. If
+ * there is a call active on logical slot X, then a simultaneous cellular call is only possible
+ * on logical slot Y if BOTH slot X and slot Y are in enabledLogicalSlots. If simultaneous
+ * cellular calling is not currently supported, the expected value of enabledLogicalSLots is an
+ * empty int array. Sending only one radio slot is not acceptable in any case.
+ *
+ * Valid errors returned:
+ * RadioError:REQUEST_NOT_SUPPORTED when android.hardware.telephony is not defined
+ * RadioError:NONE
+ * RadioError:RADIO_NOT_AVAILABLE
+ * RadioError:INTERNAL_ERR
+ * RadioError:MODEM_ERR
+ *
+ * @see IRadioConfig#getSimultaneousCallingSupport for more information.
+ */
+ void getSimultaneousCallingSupportResponse(
+ in android.hardware.radio.RadioResponseInfo info, in int[] enabledLogicalSlots);
}
diff --git a/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl b/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl
index 35d6b5d..7936eb6 100644
--- a/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl
+++ b/radio/aidl/android/hardware/radio/config/PhoneCapability.aidl
@@ -25,6 +25,7 @@
@VintfStability
@JavaDerive(toString=true)
parcelable PhoneCapability {
+ const byte UNKNOWN = -1;
/**
* maxActiveData defines how many logical modems can have
* PS attached simultaneously. For example, for L+L modem it
@@ -47,4 +48,10 @@
* List of logical modem IDs.
*/
byte[] logicalModemIds;
+ /**
+ * maxActiveVoice defines how many logical modems can have
+ * cellular voice calls simultaneously. For example, for cellular DSDA
+ * with simultaneous calling support, it should be 2.
+ */
+ byte maxActiveVoice = UNKNOWN;
}
diff --git a/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl b/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl
index f0e28fc..73c57fa 100644
--- a/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl
+++ b/radio/aidl/android/hardware/radio/ims/SuggestedAction.aidl
@@ -37,9 +37,10 @@
TRIGGER_PLMN_BLOCK_WITH_TIMEOUT,
/**
* Indicates that the IMS registration on current RAT failed multiple times.
- * The radio shall block the current RAT and search for other available RATs in the
- * background. If no other RAT is available that meets the carrier requirements, the
- * radio may remain on the current RAT for internet service. The radio clears all
+ * The radio shall block the {@link AccessNetwork} included with this and
+ * search for other available RATs in the background.
+ * If no other RAT is available that meets the carrier requirements, the
+ * radio may remain on the blocked RAT for internet service. The radio clears all
* RATs marked as unavailable if {@link IRadioIms#updateImsRegistrationInfo()} API
* with REGISTERED state is invoked.
*/
@@ -48,5 +49,5 @@
* Indicates that the radio clears all RATs marked as unavailable and tries to find
* an available RAT that meets the carrier requirements.
*/
- TRIGGER_CLEAR_RAT_BLOCK,
+ TRIGGER_CLEAR_RAT_BLOCKS,
}
diff --git a/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp b/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp
index b450418..837c626 100644
--- a/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp
+++ b/radio/aidl/compat/libradiocompat/config/RadioConfig.cpp
@@ -62,6 +62,13 @@
return ok();
}
+ScopedAStatus RadioConfig::getSimultaneousCallingSupport(int32_t serial) {
+ LOG_CALL << serial;
+ LOG(ERROR) << " getSimultaneousCallingSupport is unsupported by HIDL HALs";
+ respond()->getSimultaneousCallingSupportResponse(notSupported(serial), {});
+ return ok();
+}
+
ScopedAStatus RadioConfig::getSimSlotsStatus(int32_t serial) {
LOG_CALL << serial;
mHal1_1->getSimSlotsStatus(serial);
diff --git a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h
index 89ddea0..17d5985 100644
--- a/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h
+++ b/radio/aidl/compat/libradiocompat/include/libradiocompat/RadioConfig.h
@@ -42,6 +42,7 @@
::ndk::ScopedAStatus getHalDeviceCapabilities(int32_t serial) override;
::ndk::ScopedAStatus getNumOfLiveModems(int32_t serial) override;
::ndk::ScopedAStatus getPhoneCapability(int32_t serial) override;
+ ::ndk::ScopedAStatus getSimultaneousCallingSupport(int32_t serial) override;
::ndk::ScopedAStatus getSimSlotsStatus(int32_t serial) override;
::ndk::ScopedAStatus setNumOfLiveModems(int32_t serial, int8_t numOfLiveModems) override;
::ndk::ScopedAStatus setPreferredDataModem(int32_t serial, int8_t modemId) override;
diff --git a/radio/aidl/vts/radio_config_indication.cpp b/radio/aidl/vts/radio_config_indication.cpp
index a84c20b..c707663 100644
--- a/radio/aidl/vts/radio_config_indication.cpp
+++ b/radio/aidl/vts/radio_config_indication.cpp
@@ -22,3 +22,8 @@
RadioIndicationType /*type*/, const std::vector<SimSlotStatus>& /*slotStatus*/) {
return ndk::ScopedAStatus::ok();
}
+
+ndk::ScopedAStatus RadioConfigIndication::onSimultaneousCallingSupportChanged(
+ const std::vector<int32_t>& /*enabledLogicalSlots*/) {
+ return ndk::ScopedAStatus::ok();
+}
diff --git a/radio/aidl/vts/radio_config_response.cpp b/radio/aidl/vts/radio_config_response.cpp
index 7384f87..dccbd0e 100644
--- a/radio/aidl/vts/radio_config_response.cpp
+++ b/radio/aidl/vts/radio_config_response.cpp
@@ -40,6 +40,13 @@
return ndk::ScopedAStatus::ok();
}
+ndk::ScopedAStatus RadioConfigResponse::getSimultaneousCallingSupportResponse(
+ const RadioResponseInfo& info, const std::vector<int32_t>& /* enabledLogicalSlots */) {
+ rspInfo = info;
+ parent_config.notify(info.serial);
+ return ndk::ScopedAStatus::ok();
+}
+
ndk::ScopedAStatus RadioConfigResponse::setPreferredDataModemResponse(
const RadioResponseInfo& info) {
rspInfo = info;
diff --git a/radio/aidl/vts/radio_config_test.cpp b/radio/aidl/vts/radio_config_test.cpp
index d8c0142..f725136 100644
--- a/radio/aidl/vts/radio_config_test.cpp
+++ b/radio/aidl/vts/radio_config_test.cpp
@@ -122,6 +122,41 @@
}
/*
+ * Test IRadioConfig.getSimultaneousCallingSupport() for the response returned.
+ */
+TEST_P(RadioConfigTest, getSimultaneousCallingSupport) {
+ if (telephony_flags::enforce_telephony_feature_mapping()) {
+ if (!deviceSupportsFeature(FEATURE_TELEPHONY)) {
+ GTEST_SKIP() << "Skipping getSimultaneousCallingSupport "
+ "due to undefined FEATURE_TELEPHONY";
+ }
+ }
+
+ int32_t aidl_version;
+ ndk::ScopedAStatus aidl_status = radio_config->getInterfaceVersion(&aidl_version);
+ ASSERT_OK(aidl_status);
+ if (aidl_version < 3) {
+ ALOGI("Skipped the test since"
+ " getSimultaneousCallingSupport is not supported on version < 3.");
+ GTEST_SKIP();
+ }
+
+ serial = GetRandomSerialNumber();
+ ndk::ScopedAStatus res = radio_config->getSimultaneousCallingSupport(serial);
+ ASSERT_OK(res);
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_config->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_config->rspInfo.serial);
+ ALOGI("getSimultaneousCallingSupport, rspInfo.error = %s\n",
+ toString(radioRsp_config->rspInfo.error).c_str());
+
+ ASSERT_TRUE(CheckAnyOfErrors(
+ radioRsp_config->rspInfo.error,
+ {RadioError::NONE, RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR,
+ RadioError::MODEM_ERR, RadioError::REQUEST_NOT_SUPPORTED}));
+}
+
+/*
* Test IRadioConfig.setPreferredDataModem() for the response returned.
*/
TEST_P(RadioConfigTest, setPreferredDataModem) {
diff --git a/radio/aidl/vts/radio_config_utils.h b/radio/aidl/vts/radio_config_utils.h
index f79aedb..9e809ff 100644
--- a/radio/aidl/vts/radio_config_utils.h
+++ b/radio/aidl/vts/radio_config_utils.h
@@ -48,6 +48,9 @@
virtual ndk::ScopedAStatus getPhoneCapabilityResponse(
const RadioResponseInfo& info, const PhoneCapability& phoneCapability) override;
+ virtual ndk::ScopedAStatus getSimultaneousCallingSupportResponse(
+ const RadioResponseInfo& info, const std::vector<int32_t>& enabledLogicalSlots) override;
+
virtual ndk::ScopedAStatus setPreferredDataModemResponse(
const RadioResponseInfo& info) override;
@@ -71,6 +74,9 @@
virtual ndk::ScopedAStatus simSlotsStatusChanged(
RadioIndicationType type, const std::vector<SimSlotStatus>& slotStatus) override;
+
+ virtual ndk::ScopedAStatus onSimultaneousCallingSupportChanged(
+ const std::vector<int32_t>& /*enabledLogicalSlots*/) override;
};
// The main test class for Radio AIDL Config.