Merge "VTS for UsageSetting"
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl
similarity index 83%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
copy to bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl
index 73385d4..7c0d825 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright 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
+ * 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,
@@ -31,9 +31,11 @@
// 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.graphics.composer3;
-@VintfStability
-parcelable LayerGenericMetadataKey {
- String name;
- boolean mandatory;
+package android.hardware.bluetooth.audio;
+@Backing(type="int") @VintfStability
+enum BluetoothAudioStatus {
+ UNKNOWN = 0,
+ SUCCESS = 1,
+ UNSUPPORTED_CODEC_CONFIGURATION = 2,
+ FAILURE = 3,
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
index 84bcc0c..e5e79cb 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
@@ -35,7 +35,7 @@
@VintfStability
interface IBluetoothAudioProvider {
void endSession();
- android.hardware.common.fmq.MQDescriptor<int,android.hardware.common.fmq.UnsynchronizedWrite> startSession(in android.hardware.bluetooth.audio.IBluetoothAudioPort hostIf, in android.hardware.bluetooth.audio.AudioConfiguration audioConfig);
- void streamStarted(in boolean status);
- void streamSuspended(in boolean status);
+ android.hardware.common.fmq.MQDescriptor<byte,android.hardware.common.fmq.SynchronizedReadWrite> startSession(in android.hardware.bluetooth.audio.IBluetoothAudioPort hostIf, in android.hardware.bluetooth.audio.AudioConfiguration audioConfig);
+ void streamStarted(in android.hardware.bluetooth.audio.BluetoothAudioStatus status);
+ void streamSuspended(in android.hardware.bluetooth.audio.BluetoothAudioStatus status);
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl
index bc0d97b..693392f 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LdacQualityIndex.aidl
@@ -34,8 +34,8 @@
package android.hardware.bluetooth.audio;
@Backing(type="byte") @VintfStability
enum LdacQualityIndex {
- QUALITY_HIGH = 1,
- QUALITY_MID = 2,
- QUALITY_LOW = 4,
- QUALITY_ABR = 8,
+ HIGH = 1,
+ MID = 2,
+ LOW = 4,
+ ABR = 8,
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
index 9efafca..a7224ca 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
@@ -38,13 +38,13 @@
android.hardware.bluetooth.audio.CodecType codecType;
android.hardware.bluetooth.audio.AudioLocation supportedChannel;
int supportedChannelCount;
- android.hardware.bluetooth.audio.LeAudioCapabilities.LeaudioCodecCapabilities leaudioCodecCapabilities;
+ android.hardware.bluetooth.audio.LeAudioCapabilities.LeAudioCodecCapabilities leAudioCodecCapabilities;
@VintfStability
parcelable VendorCapabilities {
ParcelableHolder extension;
}
@VintfStability
- union LeaudioCodecCapabilities {
+ union LeAudioCodecCapabilities {
android.hardware.bluetooth.audio.Lc3Capabilities lc3Capabilities;
android.hardware.bluetooth.audio.LeAudioCapabilities.VendorCapabilities vendorCapabillities;
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl
index c6cb5cb..2bc1791 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl
@@ -35,10 +35,10 @@
@VintfStability
parcelable LeAudioConfiguration {
android.hardware.bluetooth.audio.LeAudioMode mode;
- android.hardware.bluetooth.audio.LeAudioConfiguration.LeAuioModeConfig modeConfig;
+ android.hardware.bluetooth.audio.LeAudioConfiguration.LeAudioModeConfig modeConfig;
android.hardware.bluetooth.audio.CodecType codecType;
@VintfStability
- union LeAuioModeConfig {
+ union LeAudioModeConfig {
android.hardware.bluetooth.audio.UnicastConfiguration unicastConfig;
android.hardware.bluetooth.audio.BroadcastConfiguration broadcastConfig;
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl
index 0c2f87d..6cfe5cd 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PcmCapabilities.aidl
@@ -35,7 +35,7 @@
@VintfStability
parcelable PcmCapabilities {
int[] sampleRateHz;
- android.hardware.bluetooth.audio.ChannelMode[] channelMode;
+ android.hardware.bluetooth.audio.ChannelMode channelMode;
byte[] bitsPerSample;
int[] dataIntervalUs;
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl
index 810a9a1..7e997e8 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/PresentationPosition.aidl
@@ -36,7 +36,7 @@
parcelable PresentationPosition {
long remoteDeviceAudioDelayNanos;
long transmittedOctets;
- android.hardware.bluetooth.audio.PresentationPosition.TimeSpec transmittedOctetsTimeStamp;
+ android.hardware.bluetooth.audio.PresentationPosition.TimeSpec transmittedOctetsTimestamp;
@VintfStability
parcelable TimeSpec {
long tvSec;
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl
index 900ab31..72d7fb2 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/SessionType.aidl
@@ -36,7 +36,7 @@
enum SessionType {
UNKNOWN = 0,
A2DP_SOFTWARE_ENCODING_DATAPATH = 1,
- A2DP_HARDWARE_OFFLOAD_DATAPATH = 2,
+ A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH = 2,
HEARING_AID_SOFTWARE_ENCODING_DATAPATH = 3,
LE_AUDIO_SOFTWARE_ENCODING_DATAPATH = 4,
LE_AUDIO_SOFTWARE_DECODING_DATAPATH = 5,
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl
new file mode 100644
index 0000000..ec78445
--- /dev/null
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BluetoothAudioStatus.aidl
@@ -0,0 +1,27 @@
+/*
+ * Copyright 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.
+ */
+
+package android.hardware.bluetooth.audio;
+
+@VintfStability
+@Backing(type="int")
+enum BluetoothAudioStatus {
+ UNKNOWN = 0,
+ SUCCESS = 1,
+ UNSUPPORTED_CODEC_CONFIGURATION = 2,
+ // General failure
+ FAILURE = 3
+}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
index cebd808..a2c5ae9 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
@@ -17,9 +17,10 @@
package android.hardware.bluetooth.audio;
import android.hardware.bluetooth.audio.AudioConfiguration;
+import android.hardware.bluetooth.audio.BluetoothAudioStatus;
import android.hardware.bluetooth.audio.IBluetoothAudioPort;
import android.hardware.common.fmq.MQDescriptor;
-import android.hardware.common.fmq.UnsynchronizedWrite;
+import android.hardware.common.fmq.SynchronizedReadWrite;
/**
* HAL interface from the Bluetooth stack to the Audio HAL
@@ -55,7 +56,7 @@
* audioConfig.pcmConfig parameter. Invalid if streaming is offloaded
* from/to hardware or on failure
*/
- MQDescriptor<int, UnsynchronizedWrite> startSession(
+ MQDescriptor<byte, SynchronizedReadWrite> startSession(
in IBluetoothAudioPort hostIf, in AudioConfiguration audioConfig);
/**
@@ -63,12 +64,12 @@
*
* @param status true for SUCCESS or false for FAILURE
*/
- void streamStarted(in boolean status);
+ void streamStarted(in BluetoothAudioStatus status);
/**
* Callback for IBluetoothAudioPort.suspendStream()
*
* @param status true for SUCCESS or false for FAILURE
*/
- void streamSuspended(in boolean status);
+ void streamSuspended(in BluetoothAudioStatus status);
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl
index fc532f4..cb12583 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LdacQualityIndex.aidl
@@ -22,17 +22,17 @@
/**
* 990kbps
*/
- QUALITY_HIGH = 1,
+ HIGH = 1,
/**
* 660kbps
*/
- QUALITY_MID = 1 << 1,
+ MID = 1 << 1,
/**
* 330kbps
*/
- QUALITY_LOW = 1 << 2,
+ LOW = 1 << 2,
/**
* Adaptive Bit Rate mode
*/
- QUALITY_ABR = 1 << 3,
+ ABR = 1 << 3,
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
index ea05820..732427f 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
@@ -31,7 +31,7 @@
ParcelableHolder extension;
}
@VintfStability
- union LeaudioCodecCapabilities {
+ union LeAudioCodecCapabilities {
Lc3Capabilities lc3Capabilities;
VendorCapabilities vendorCapabillities;
}
@@ -43,5 +43,5 @@
*/
AudioLocation supportedChannel;
int supportedChannelCount;
- LeaudioCodecCapabilities leaudioCodecCapabilities;
+ LeAudioCodecCapabilities leAudioCodecCapabilities;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl
index a212c96..515794b 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioConfiguration.aidl
@@ -24,7 +24,7 @@
@VintfStability
parcelable LeAudioConfiguration {
@VintfStability
- union LeAuioModeConfig {
+ union LeAudioModeConfig {
UnicastConfiguration unicastConfig;
BroadcastConfiguration broadcastConfig;
}
@@ -32,6 +32,6 @@
* The mode of the LE audio
*/
LeAudioMode mode;
- LeAuioModeConfig modeConfig;
+ LeAudioModeConfig modeConfig;
CodecType codecType;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl
index 776b777..f5d699e 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PcmCapabilities.aidl
@@ -24,7 +24,7 @@
@VintfStability
parcelable PcmCapabilities {
int[] sampleRateHz;
- ChannelMode[] channelMode;
+ ChannelMode channelMode;
byte[] bitsPerSample;
/**
* Data interval for data transfer
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl
index 17e746f..f3b8aed 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/PresentationPosition.aidl
@@ -44,9 +44,9 @@
*/
long transmittedOctets;
/*
- * transmittedOctetsTimeStamp the value of CLOCK_MONOTONIC
+ * transmittedOctetsTimestamp the value of CLOCK_MONOTONIC
* corresponding to transmittedOctets. If the software data path is
* unused (e.g., for Hardware Offload), the value is set to zero.
*/
- TimeSpec transmittedOctetsTimeStamp;
+ TimeSpec transmittedOctetsTimestamp;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl
index b588869..30faae3 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/SessionType.aidl
@@ -27,7 +27,7 @@
/**
* The encoding of AVDTP media is done by HW and there is control only
*/
- A2DP_HARDWARE_OFFLOAD_DATAPATH,
+ A2DP_HARDWARE_OFFLOAD_ENCODING_DATAPATH,
/**
* Used when encoded by Bluetooth Stack and streaming to Hearing Aid
*/
diff --git a/compatibility_matrices/compatibility_matrix.3.xml b/compatibility_matrices/compatibility_matrix.3.xml
index a75ed25..468735d 100644
--- a/compatibility_matrices/compatibility_matrix.3.xml
+++ b/compatibility_matrices/compatibility_matrix.3.xml
@@ -207,7 +207,10 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <!-- Either the AIDL or the HIDL health HAL must exist on the device.
+ If the HIDL health HAL exists, it must be at least version 2.0.
+ See DeviceManifestTest.HealthHal -->
+ <hal format="hidl" optional="true">
<name>android.hardware.health</name>
<version>2.0</version>
<interface>
diff --git a/compatibility_matrices/compatibility_matrix.4.xml b/compatibility_matrices/compatibility_matrix.4.xml
index 3b8ee21..96f291f 100644
--- a/compatibility_matrices/compatibility_matrix.4.xml
+++ b/compatibility_matrices/compatibility_matrix.4.xml
@@ -213,7 +213,10 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <!-- Either the AIDL or the HIDL health HAL must exist on the device.
+ If the HIDL health HAL exists, it must be at least version 2.0.
+ See DeviceManifestTest.HealthHal -->
+ <hal format="hidl" optional="true">
<name>android.hardware.health</name>
<version>2.0</version>
<interface>
diff --git a/compatibility_matrices/compatibility_matrix.5.xml b/compatibility_matrices/compatibility_matrix.5.xml
index 0fb21a7..3642814 100644
--- a/compatibility_matrices/compatibility_matrix.5.xml
+++ b/compatibility_matrices/compatibility_matrix.5.xml
@@ -238,7 +238,10 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <!-- Either the AIDL or the HIDL health HAL must exist on the device.
+ If the HIDL health HAL exists, it must be at least version 2.1.
+ See DeviceManifestTest.HealthHal -->
+ <hal format="hidl" optional="true">
<name>android.hardware.health</name>
<version>2.1</version>
<interface>
diff --git a/compatibility_matrices/compatibility_matrix.6.xml b/compatibility_matrices/compatibility_matrix.6.xml
index aee2c51..9c42cb0 100644
--- a/compatibility_matrices/compatibility_matrix.6.xml
+++ b/compatibility_matrices/compatibility_matrix.6.xml
@@ -268,7 +268,10 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="false">
+ <!-- Either the AIDL or the HIDL health HAL must exist on the device.
+ If the HIDL health HAL exists, it must be at least version 2.1.
+ See DeviceManifestTest.HealthHal -->
+ <hal format="hidl" optional="true">
<name>android.hardware.health</name>
<version>2.1</version>
<interface>
diff --git a/compatibility_matrices/compatibility_matrix.current.xml b/compatibility_matrices/compatibility_matrix.current.xml
index 27e6b26..c875e8c 100644
--- a/compatibility_matrices/compatibility_matrix.current.xml
+++ b/compatibility_matrices/compatibility_matrix.current.xml
@@ -210,14 +210,6 @@
</interface>
</hal>
<hal format="hidl" optional="true">
- <name>android.hardware.contexthub</name>
- <version>1.2</version>
- <interface>
- <name>IContexthub</name>
- <instance>default</instance>
- </interface>
- </hal>
- <hal format="hidl" optional="true">
<name>android.hardware.drm</name>
<version>1.3-4</version>
<interface>
@@ -337,9 +329,9 @@
<instance>default</instance>
</interface>
</hal>
- <hal format="hidl" optional="true">
+ <hal format="aidl" optional="true">
<name>android.hardware.ir</name>
- <version>1.0</version>
+ <version>1</version>
<interface>
<name>IConsumerIr</name>
<instance>default</instance>
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl
similarity index 95%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
rename to graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl
index 73385d4..856ec64 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl
@@ -33,7 +33,6 @@
package android.hardware.graphics.composer3;
@VintfStability
-parcelable LayerGenericMetadataKey {
- String name;
- boolean mandatory;
+parcelable ClockMonotonicTimestamp {
+ long timestamp;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorTransformPayload.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorTransformPayload.aidl
deleted file mode 100644
index df07c9c..0000000
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/ColorTransformPayload.aidl
+++ /dev/null
@@ -1,39 +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.
- */
-///////////////////////////////////////////////////////////////////////////////
-// 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.graphics.composer3;
-@VintfStability
-parcelable ColorTransformPayload {
- float[] matrix;
- android.hardware.graphics.common.ColorTransform hint;
-}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl
index 2f5d00f..3382633 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/DisplayCommand.aidl
@@ -36,9 +36,10 @@
parcelable DisplayCommand {
long display;
android.hardware.graphics.composer3.LayerCommand[] layers;
- @nullable android.hardware.graphics.composer3.ColorTransformPayload colorTransform;
+ @nullable float[] colorTransformMatrix;
@nullable android.hardware.graphics.composer3.ClientTarget clientTarget;
@nullable android.hardware.graphics.composer3.Buffer virtualDisplayOutputBuffer;
+ @nullable android.hardware.graphics.composer3.ClockMonotonicTimestamp expectedPresentTime;
boolean validateDisplay;
boolean acceptDisplayChanges;
boolean presentDisplay;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/GenericMetadata.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/GenericMetadata.aidl
deleted file mode 100644
index c18529b..0000000
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/GenericMetadata.aidl
+++ /dev/null
@@ -1,39 +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.
- */
-///////////////////////////////////////////////////////////////////////////////
-// 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.graphics.composer3;
-@VintfStability
-parcelable GenericMetadata {
- android.hardware.graphics.composer3.LayerGenericMetadataKey key;
- byte[] value;
-}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
index 2bdbc9f..2d17e0f 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -52,11 +52,10 @@
android.hardware.graphics.composer3.DisplayContentSample getDisplayedContentSample(long display, long maxFrames, long timestamp);
android.hardware.graphics.composer3.DisplayContentSamplingAttributes getDisplayedContentSamplingAttributes(long display);
android.hardware.graphics.composer3.HdrCapabilities getHdrCapabilities(long display);
- android.hardware.graphics.composer3.LayerGenericMetadataKey[] getLayerGenericMetadataKeys();
int getMaxVirtualDisplayCount();
android.hardware.graphics.composer3.PerFrameMetadataKey[] getPerFrameMetadataKeys(long display);
android.hardware.graphics.composer3.ReadbackBufferAttributes getReadbackBufferAttributes(long display);
- ParcelFileDescriptor getReadbackBufferFence(long display);
+ @nullable ParcelFileDescriptor getReadbackBufferFence(long display);
android.hardware.graphics.composer3.RenderIntent[] getRenderIntents(long display, android.hardware.graphics.composer3.ColorMode mode);
android.hardware.graphics.composer3.ContentType[] getSupportedContentTypes(long display);
void registerCallback(in android.hardware.graphics.composer3.IComposerCallback callback);
@@ -69,7 +68,7 @@
void setDisplayBrightness(long display, float brightness);
void setDisplayedContentSamplingEnabled(long display, boolean enable, android.hardware.graphics.composer3.FormatColorComponent componentMask, long maxFrames);
void setPowerMode(long display, android.hardware.graphics.composer3.PowerMode mode);
- void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer, in ParcelFileDescriptor releaseFence);
+ void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer, in @nullable ParcelFileDescriptor releaseFence);
void setVsyncEnabled(long display, boolean enabled);
const int EX_BAD_CONFIG = 1;
const int EX_BAD_DISPLAY = 2;
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
index bad72fc..ab77880 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerCommand.aidl
@@ -52,7 +52,6 @@
@nullable android.hardware.graphics.composer3.ZOrder z;
@nullable float[] colorTransform;
@nullable android.hardware.graphics.composer3.WhitePointNits whitePointNits;
- @nullable android.hardware.graphics.composer3.GenericMetadata genericMetadata;
@nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata;
@nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl
similarity index 68%
rename from graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
rename to graphics/composer/aidl/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl
index 17704b8..f385038 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/ClockMonotonicTimestamp.aidl
@@ -16,16 +16,10 @@
package android.hardware.graphics.composer3;
+/**
+ * Represents a nanoseconds timestamp in CLOCK_MONOTONIC.
+ */
@VintfStability
-parcelable LayerGenericMetadataKey {
- /**
- * Key names must comply with the requirements specified for
- * getLayerGenericMetadataKeys below
- */
- String name;
- /**
- * The mandatory flag is defined in the description of
- * setLayerGenericMetadata above
- */
- boolean mandatory;
+parcelable ClockMonotonicTimestamp {
+ long timestamp;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl
deleted file mode 100644
index fc37dac..0000000
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/ColorTransformPayload.aidl
+++ /dev/null
@@ -1,33 +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.
- */
-
-package android.hardware.graphics.composer3;
-
-import android.hardware.graphics.common.ColorTransform;
-
-@VintfStability
-parcelable ColorTransformPayload {
- /**
- * 4x4 transform matrix (16 floats) as described in DisplayCommand.colorTransform.
- */
- float[] matrix;
-
- /**
- * Hint value which may be used instead of the given matrix unless it
- * is ColorTransform.ARBITRARY.
- */
- ColorTransform hint;
-}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl
index 4947463..49cdffc 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Composition.aidl
@@ -74,16 +74,20 @@
*/
SIDEBAND = 5,
/**
- * A display decoration layer contains a buffer which is an 8 bit
- * alpha mask. Pixels in the mask with an alpha of 0 (transparent) will
- * show the content underneath, and pixels with an alpha of 255 will be
- * be rendered in black. An alpha in between will show the content
- * blended with black. This is useful, for example, to provide
+ * A display decoration layer contains a buffer which is used to provide
* anti-aliasing on the cutout region/rounded corners on the top and
* bottom of a display.
*
+ * Pixels in the buffer with an alpha of 0 (transparent) will show the
+ * content underneath, and pixels with an alpha of 255 will be rendered in
+ * black. An alpha in between will show the underlying content blended with
+ * black.
+ *
+ * Some devices may support this flag with a buffer containing an 8 bit
+ * alpha mask.
+ *
* Upon validateDisplay, the device may request a change from this type
- * to CLIENT.
+ * to either DEVICE or CLIENT.
*/
DISPLAY_DECORATION = 6,
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl
index 21497c4..18461ad 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/DisplayCommand.aidl
@@ -18,7 +18,7 @@
import android.hardware.graphics.composer3.Buffer;
import android.hardware.graphics.composer3.ClientTarget;
-import android.hardware.graphics.composer3.ColorTransformPayload;
+import android.hardware.graphics.composer3.ClockMonotonicTimestamp;
import android.hardware.graphics.composer3.LayerCommand;
@VintfStability
@@ -38,11 +38,7 @@
/**
* Sets a color transform which will be applied after composition.
*
- * If hint is not ColorTransform.ARBITRARY, then the device may use the
- * hint to apply the desired color transform instead of using the color
- * matrix directly.
- *
- * If the device is not capable of either using the hint or the matrix to
+ * If the device is not capable of either using the matrix to
* apply the desired color transform, it must force all layers to client
* composition during VALIDATE_DISPLAY.
*
@@ -70,7 +66,7 @@
* B_out = R_in * r.b + G_in * g.b + B_in * b.b + Tb
*
*/
- @nullable ColorTransformPayload colorTransform;
+ @nullable float[] colorTransformMatrix;
/**
* Sets the buffer handle which will receive the output of client
@@ -115,6 +111,14 @@
@nullable Buffer virtualDisplayOutputBuffer;
/**
+ * Sets the expected present time to present the current content on screen.
+ * The implementation should try to present the display as close as possible
+ * to the given expectedPresentTime. If expectedPresentTime is 0, the
+ * implementation should present the display as soon as possible.
+ */
+ @nullable ClockMonotonicTimestamp expectedPresentTime;
+
+ /**
* Instructs the device to inspect all of the layer state and determine if
* there are any composition type changes necessary before presenting the
* display. Permitted changes are described in the definition of
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/GenericMetadata.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/GenericMetadata.aidl
deleted file mode 100644
index d0254dd..0000000
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/GenericMetadata.aidl
+++ /dev/null
@@ -1,33 +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.
- */
-
-package android.hardware.graphics.composer3;
-
-import android.hardware.graphics.composer3.LayerGenericMetadataKey;
-
-@VintfStability
-parcelable GenericMetadata {
- /**
- * Indicates which metadata value should be set.
- */
- LayerGenericMetadataKey key;
- /**
- * The binary representation of a AIDL struct corresponding to
- * the key as described above.
- * TODO(b/209691612): revisit the use of byte[]
- */
- byte[] value;
-}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
index 28bdb2c..ab7f397 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/IComposerClient.aidl
@@ -30,7 +30,6 @@
import android.hardware.graphics.composer3.FormatColorComponent;
import android.hardware.graphics.composer3.HdrCapabilities;
import android.hardware.graphics.composer3.IComposerCallback;
-import android.hardware.graphics.composer3.LayerGenericMetadataKey;
import android.hardware.graphics.composer3.PerFrameMetadataKey;
import android.hardware.graphics.composer3.PowerMode;
import android.hardware.graphics.composer3.ReadbackBufferAttributes;
@@ -369,20 +368,6 @@
HdrCapabilities getHdrCapabilities(long display);
/**
- * Retrieves the set of keys that may be passed into setLayerGenericMetadata
- *
- * Key names must meet the following requirements:
- * - Must be specified in reverse domain name notation
- * - Must not start with 'com.android' or 'android'
- * - Must be unique within the returned vector
- * - Must correspond to a matching HIDL struct type, which defines the
- * structure of its values. For example, the key 'com.example.V1-3.Foo'
- * should correspond to a value of type com.example@1.3::Foo, which is
- * defined in a vendor HAL extension
- */
- LayerGenericMetadataKey[] getLayerGenericMetadataKeys();
-
- /**
* Returns the maximum number of virtual displays supported by this device
* (which may be 0). The client must not attempt to create more than this
* many virtual displays on this device. This number must not change for
@@ -479,7 +464,7 @@
* getReadbackBufferAttributes
* setReadbackBuffer
*/
- ParcelFileDescriptor getReadbackBufferFence(long display);
+ @nullable ParcelFileDescriptor getReadbackBufferFence(long display);
/**
* Returns the render intents supported by the specified display and color
@@ -702,13 +687,15 @@
* This buffer must have been allocated as described in
* getReadbackBufferAttributes and is in the dataspace provided by the same.
*
+ * Also provides a file descriptor referring to a release sync fence
+ * object, which must be signaled when it is safe to write to the readback
+ * buffer. If it is already safe to write to the readback buffer, null may be passed instead.
+ *
* If there is hardware protected content on the display at the time of the next
* composition, the area of the readback buffer covered by such content must be
* completely black. Any areas of the buffer not covered by such content may
* optionally be black as well.
*
- * The release fence file descriptor provided works identically to the one
- * described for setOutputBuffer.
*
* This function must not be called between any call to validateDisplay and a
* subsequent call to presentDisplay.
@@ -716,7 +703,8 @@
* Parameters:
* @param display - the display on which to create the layer.
* @param buffer - the new readback buffer
- * @param releaseFence - a sync fence file descriptor as described in setOutputBuffer
+ * @param releaseFence - a sync fence file descriptor as described above or null if it is
+ * already safe to write to the readback buffer.
*
* @exception EX_BAD_DISPLAY - an invalid display handle was passed in
* @exception EX_BAD_PARAMETER - the new readback buffer handle was invalid
@@ -726,7 +714,7 @@
* getReadbackBufferFence
*/
void setReadbackBuffer(long display, in android.hardware.common.NativeHandle buffer,
- in ParcelFileDescriptor releaseFence);
+ in @nullable ParcelFileDescriptor releaseFence);
/**
* Enables or disables the vsync signal for the given display. Virtual
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
index 761da9a..44fd4dc 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
@@ -23,7 +23,6 @@
import android.hardware.graphics.composer3.Buffer;
import android.hardware.graphics.composer3.Color;
import android.hardware.graphics.composer3.FloatColor;
-import android.hardware.graphics.composer3.GenericMetadata;
import android.hardware.graphics.composer3.ParcelableBlendMode;
import android.hardware.graphics.composer3.ParcelableComposition;
import android.hardware.graphics.composer3.ParcelableDataspace;
@@ -247,33 +246,6 @@
@nullable WhitePointNits whitePointNits;
/**
- * Sets a piece of generic metadata for the given layer. If this
- * function is called twice with the same key but different values, the
- * newer value must override the older one. Calling this function with a
- * 0-length value must reset that key's metadata as if it had not been
- * set.
- *
- * A given piece of metadata may either be mandatory or a hint
- * (non-mandatory) as indicated by the second parameter. Mandatory
- * metadata may affect the composition result, which is to say that it
- * may cause a visible change in the final image. By contrast, hints may
- * only affect the composition strategy, such as which layers are
- * composited by the client, but must not cause a visible change in the
- * final image. The value of the mandatory flag shall match the value
- * returned from getLayerGenericMetadataKeys for the given key.
- *
- * Only keys which have been returned from getLayerGenericMetadataKeys()
- * shall be accepted. Any other keys must result in an UNSUPPORTED error.
- *
- * The value passed into this function shall be the binary
- * representation of a stable AIDL type corresponding to the given key. For
- * example, a key of 'com.example.Foo-V2' shall be paired with a
- * value of type com.exampleFoo-V2, which would be defined in a
- * vendor HAL extension.
- */
- @nullable GenericMetadata genericMetadata;
-
- /**
* Sets the PerFrameMetadata for the display. This metadata must be used
* by the implementation to better tone map content to that display.
*
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp
index a3c8176..8a789e3 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/translate-ndk.cpp
@@ -445,13 +445,4 @@
return true;
}
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_4::IComposerClient::
- LayerGenericMetadataKey& in,
- aidl::android::hardware::graphics::composer3::LayerGenericMetadataKey* out) {
- out->name = in.name;
- out->mandatory = static_cast<bool>(in.mandatory);
- return true;
-}
-
} // namespace android::h2a
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp
index 34dea9e..eddc2d3 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_ReadbackTest.cpp
@@ -258,7 +258,7 @@
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
// if hwc cannot handle and asks for composition change,
// just succeed the test
@@ -317,7 +317,7 @@
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
std::vector<int64_t> changedCompositionLayers;
@@ -377,7 +377,7 @@
mDisplayWidth, mDisplayHeight, mPixelFormat, mDataspace);
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
std::vector<int64_t> changedCompositionLayers;
@@ -492,7 +492,7 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
std::vector<int64_t> changedCompositionLayers;
@@ -606,7 +606,7 @@
clientLayer->setDisplayFrame(clientFrame);
clientLayer->setZOrder(0);
clientLayer->write(mWriter);
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
std::vector<int64_t> changedCompositionLayers;
@@ -685,7 +685,7 @@
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
std::vector<int64_t> changedCompositionLayers;
std::vector<Composition> changedCompositionTypes;
@@ -715,7 +715,7 @@
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers,
@@ -756,7 +756,7 @@
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
std::vector<int64_t> changedCompositionLayers;
std::vector<Composition> changedCompositionTypes;
@@ -819,7 +819,7 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
std::vector<int64_t> changedCompositionLayers;
std::vector<Composition> changedCompositionTypes;
@@ -877,7 +877,7 @@
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
std::vector<int64_t> changedCompositionLayers;
std::vector<Composition> changedCompositionTypes;
@@ -902,7 +902,7 @@
writeLayers(layers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
mReader.takeChangedCompositionTypes(mPrimaryDisplay, &changedCompositionLayers,
&changedCompositionTypes);
@@ -1027,7 +1027,7 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
std::vector<int64_t> changedCompositionLayers;
std::vector<Composition> changedCompositionTypes;
@@ -1072,7 +1072,7 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
std::vector<int64_t> changedCompositionLayers;
std::vector<Composition> changedCompositionTypes;
@@ -1112,7 +1112,7 @@
ASSERT_NO_FATAL_FAILURE(readbackBuffer.setReadbackBuffer());
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
std::vector<int64_t> changedCompositionLayers;
std::vector<Composition> changedCompositionTypes;
@@ -1195,7 +1195,7 @@
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
std::vector<int64_t> changedCompositionLayers;
std::vector<Composition> changedCompositionTypes;
@@ -1241,7 +1241,7 @@
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
std::vector<int64_t> changedCompositionLayers;
std::vector<Composition> changedCompositionTypes;
@@ -1287,7 +1287,7 @@
writeLayers(mLayers);
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
std::vector<int64_t> layers;
std::vector<Composition> types;
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
index 1f30475..6638744 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
@@ -17,6 +17,7 @@
#include <android/hardware/graphics/composer3/ComposerClientWriter.h>
#include <binder/ProcessState.h>
#include <gtest/gtest.h>
+#include <ui/Fence.h>
#include <ui/GraphicBuffer.h>
#include <ui/PixelFormat.h>
#include <algorithm>
@@ -840,28 +841,6 @@
Test_setContentType(ContentType::GAME, "GAME");
}
-TEST_P(GraphicsComposerAidlTest, getLayerGenericMetadataKeys) {
- std::vector<LayerGenericMetadataKey> keys;
- EXPECT_TRUE(mComposerClient->getLayerGenericMetadataKeys(&keys).isOk());
-
- std::regex reverseDomainName("^[a-zA-Z-]{2,}(\\.[a-zA-Z0-9-]+)+$");
- std::unordered_set<std::string> uniqueNames;
- for (const auto& key : keys) {
- std::string name(key.name);
-
- // Keys must not start with 'android' or 'com.android'
- EXPECT_FALSE(name.find("android") == 0);
- EXPECT_FALSE(name.find("com.android") == 0);
-
- // Keys must be in reverse domain name format
- EXPECT_TRUE(std::regex_match(name, reverseDomainName));
-
- // Keys must be unique within this list
- const auto& [iter, inserted] = uniqueNames.insert(name);
- EXPECT_TRUE(inserted);
- }
-}
-
TEST_P(GraphicsComposerAidlTest, CreateVirtualDisplay) {
int32_t maxVirtualDisplayCount;
EXPECT_TRUE(mComposerClient->getMaxVirtualDisplayCount(&maxVirtualDisplayCount).isOk());
@@ -993,14 +972,14 @@
TEST_P(GraphicsComposerAidlTest, SetPowerModeUnsupported) {
std::vector<DisplayCapability> capabilities;
- const auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities);
+ auto error = mComposerClient->getDisplayCapabilities(mPrimaryDisplay, &capabilities);
ASSERT_TRUE(error.isOk());
const bool isDozeSupported = std::find(capabilities.begin(), capabilities.end(),
DisplayCapability::DOZE) != capabilities.end();
const bool isSuspendSupported = std::find(capabilities.begin(), capabilities.end(),
DisplayCapability::SUSPEND) != capabilities.end();
if (!isDozeSupported) {
- auto error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE);
+ error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::DOZE);
EXPECT_FALSE(error.isOk());
EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError());
@@ -1010,7 +989,7 @@
}
if (!isSuspendSupported) {
- auto error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON_SUSPEND);
+ error = mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON_SUSPEND);
EXPECT_FALSE(error.isOk());
EXPECT_EQ(IComposerClient::EX_UNSUPPORTED, error.getServiceSpecificError());
@@ -1283,7 +1262,7 @@
mWriter.setLayerBuffer(display.get(), layer, 0, buffer->handle, -1);
mWriter.setLayerDataspace(display.get(), layer, common::Dataspace::UNKNOWN);
- mWriter.validateDisplay(display.get());
+ mWriter.validateDisplay(display.get(), ComposerClientWriter::kNoTimestamp);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -1299,7 +1278,7 @@
mWriter.setLayerBuffer(display.get(), layer, 0, buffer->handle, -1);
mWriter.setLayerSurfaceDamage(display.get(), layer,
std::vector<Rect>(1, {0, 0, 10, 10}));
- mWriter.validateDisplay(display.get());
+ mWriter.validateDisplay(display.get(), ComposerClientWriter::kNoTimestamp);
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
@@ -1310,6 +1289,53 @@
ASSERT_NO_FATAL_FAILURE(destroyLayer(display, layer));
}
+ sp<::android::Fence> presentAndGetFence(
+ std::optional<ClockMonotonicTimestamp> expectedPresentTime) {
+ mWriter.validateDisplay(mPrimaryDisplay, expectedPresentTime);
+ execute();
+ EXPECT_TRUE(mReader.takeErrors().empty());
+
+ mWriter.presentDisplay(mPrimaryDisplay);
+ execute();
+ EXPECT_TRUE(mReader.takeErrors().empty());
+
+ int presentFence;
+ mReader.takePresentFence(mPrimaryDisplay, &presentFence);
+ EXPECT_NE(-1, presentFence);
+ return sp<::android::Fence>::make(presentFence);
+ }
+
+ int32_t getVsyncPeriod() {
+ int32_t activeConfig;
+ EXPECT_TRUE(mComposerClient->getActiveConfig(mPrimaryDisplay, &activeConfig).isOk());
+
+ int32_t vsyncPeriod;
+ EXPECT_TRUE(mComposerClient
+ ->getDisplayAttribute(mPrimaryDisplay, activeConfig,
+ DisplayAttribute::VSYNC_PERIOD, &vsyncPeriod)
+ .isOk());
+ return vsyncPeriod;
+ }
+
+ int64_t createOnScreenLayer() {
+ const int64_t layer = createLayer(mDisplays[0]);
+ mWriter.setLayerCompositionType(mPrimaryDisplay, layer, Composition::DEVICE);
+ mWriter.setLayerDisplayFrame(mPrimaryDisplay, layer, {0, 0, mDisplayWidth, mDisplayHeight});
+ mWriter.setLayerPlaneAlpha(mPrimaryDisplay, layer, 1);
+ mWriter.setLayerSourceCrop(
+ mPrimaryDisplay, layer,
+ {0, 0, static_cast<float>(mDisplayWidth), static_cast<float>(mDisplayHeight)});
+ mWriter.setLayerTransform(mPrimaryDisplay, layer, static_cast<Transform>(0));
+ mWriter.setLayerVisibleRegion(mPrimaryDisplay, layer,
+ std::vector<Rect>(1, {0, 0, mDisplayWidth, mDisplayHeight}));
+ mWriter.setLayerZOrder(mPrimaryDisplay, layer, 10);
+ mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE);
+ mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer,
+ std::vector<Rect>(1, {0, 0, mDisplayWidth, mDisplayHeight}));
+ mWriter.setLayerDataspace(mPrimaryDisplay, layer, common::Dataspace::UNKNOWN);
+ return layer;
+ }
+
void Test_setActiveConfigWithConstraints(const TestParameters& params) {
for (VtsDisplay& display : mDisplays) {
forEachTwoConfigs(display.get(), [&](int32_t config1, int32_t config2) {
@@ -1400,6 +1426,47 @@
}
}
+ void Test_expectedPresentTime(std::optional<int> framesDelay) {
+ ASSERT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::ON).isOk());
+
+ const auto vsyncPeriod = getVsyncPeriod();
+
+ const auto buffer1 = allocate();
+ const auto buffer2 = allocate();
+ ASSERT_NE(nullptr, buffer1);
+ ASSERT_NE(nullptr, buffer2);
+
+ const auto layer = createOnScreenLayer();
+ mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, buffer1->handle, -1);
+ const sp<::android::Fence> presentFence1 =
+ presentAndGetFence(ComposerClientWriter::kNoTimestamp);
+ presentFence1->waitForever(LOG_TAG);
+
+ auto expectedPresentTime = presentFence1->getSignalTime() + vsyncPeriod;
+ if (framesDelay.has_value()) {
+ expectedPresentTime += *framesDelay * vsyncPeriod;
+ }
+
+ mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, buffer2->handle, -1);
+ const auto setExpectedPresentTime = [&]() -> std::optional<ClockMonotonicTimestamp> {
+ if (!framesDelay.has_value()) {
+ return ComposerClientWriter::kNoTimestamp;
+ } else if (*framesDelay == 0) {
+ return ClockMonotonicTimestamp{0};
+ }
+ return ClockMonotonicTimestamp{expectedPresentTime};
+ }();
+
+ const sp<::android::Fence> presentFence2 = presentAndGetFence(setExpectedPresentTime);
+ presentFence2->waitForever(LOG_TAG);
+
+ const auto actualPresentTime = presentFence2->getSignalTime();
+ const auto presentError = std::abs(expectedPresentTime - actualPresentTime);
+ EXPECT_LE(presentError, vsyncPeriod / 2);
+
+ ASSERT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk());
+ }
+
// clang-format off
const std::array<float, 16> kIdentity = {{
1.0f, 0.0f, 0.0f, 0.0f,
@@ -1414,7 +1481,7 @@
};
TEST_P(GraphicsComposerAidlCommandTest, SET_COLOR_TRANSFORM) {
- mWriter.setColorTransform(mPrimaryDisplay, kIdentity.data(), ColorTransform::IDENTITY);
+ mWriter.setColorTransform(mPrimaryDisplay, kIdentity.data());
execute();
}
@@ -1462,19 +1529,19 @@
}
TEST_P(GraphicsComposerAidlCommandTest, VALIDATE_DISPLAY) {
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
}
TEST_P(GraphicsComposerAidlCommandTest, ACCEPT_DISPLAY_CHANGES) {
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
mWriter.acceptDisplayChanges(mPrimaryDisplay);
execute();
}
// TODO(b/208441745) fix the test failure
TEST_P(GraphicsComposerAidlCommandTest, PRESENT_DISPLAY) {
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
mWriter.presentDisplay(mPrimaryDisplay);
execute();
}
@@ -1523,7 +1590,7 @@
mWriter.setLayerBuffer(mPrimaryDisplay, layer, 0, handle, -1);
mWriter.setLayerDataspace(mPrimaryDisplay, layer, Dataspace::UNKNOWN);
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
std::vector<int64_t> layers;
std::vector<Composition> types;
@@ -1570,7 +1637,7 @@
mWriter.setLayerBlendMode(mPrimaryDisplay, layer, BlendMode::NONE);
mWriter.setLayerSurfaceDamage(mPrimaryDisplay, layer, std::vector<Rect>(1, displayFrame));
mWriter.setLayerDataspace(mPrimaryDisplay, layer, Dataspace::UNKNOWN);
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
execute();
std::vector<int64_t> layers;
@@ -1587,7 +1654,7 @@
execute();
mWriter.setLayerCursorPosition(mPrimaryDisplay, layer, 0, 0);
- mWriter.validateDisplay(mPrimaryDisplay);
+ mWriter.validateDisplay(mPrimaryDisplay, ComposerClientWriter::kNoTimestamp);
mWriter.presentDisplay(mPrimaryDisplay);
execute();
}
@@ -1947,6 +2014,18 @@
}
}
+TEST_P(GraphicsComposerAidlCommandTest, expectedPresentTime_NoTimestamp) {
+ ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(std::nullopt));
+}
+
+TEST_P(GraphicsComposerAidlCommandTest, expectedPresentTime_0) {
+ ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(0));
+}
+
+TEST_P(GraphicsComposerAidlCommandTest, expectedPresentTime_5) {
+ ASSERT_NO_FATAL_FAILURE(Test_expectedPresentTime(5));
+}
+
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(GraphicsComposerAidlCommandTest);
INSTANTIATE_TEST_SUITE_P(
PerInstance, GraphicsComposerAidlCommandTest,
diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
index bd03673..5bab266 100644
--- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
+++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
@@ -63,6 +63,8 @@
class ComposerClientWriter {
public:
+ static constexpr std::optional<ClockMonotonicTimestamp> kNoTimestamp = std::nullopt;
+
ComposerClientWriter() { reset(); }
virtual ~ComposerClientWriter() { reset(); }
@@ -73,11 +75,11 @@
mCommands.clear();
}
- void setColorTransform(int64_t display, const float* matrix, ColorTransform hint) {
- ColorTransformPayload colorTransformPayload;
- colorTransformPayload.matrix.assign(matrix, matrix + 16);
- colorTransformPayload.hint = hint;
- getDisplayCommand(display).colorTransform.emplace(std::move(colorTransformPayload));
+ void setColorTransform(int64_t display, const float* matrix) {
+ std::vector<float> matVec;
+ matVec.reserve(16);
+ matVec.assign(matrix, matrix + 16);
+ getDisplayCommand(display).colorTransformMatrix.emplace(std::move(matVec));
}
void setClientTarget(int64_t display, uint32_t slot, const native_handle_t* target,
@@ -95,10 +97,18 @@
getBuffer(slot, buffer, releaseFence));
}
- void validateDisplay(int64_t display) { getDisplayCommand(display).validateDisplay = true; }
+ void validateDisplay(int64_t display,
+ std::optional<ClockMonotonicTimestamp> expectedPresentTime) {
+ auto& command = getDisplayCommand(display);
+ command.expectedPresentTime = expectedPresentTime;
+ command.validateDisplay = true;
+ }
- void presentOrvalidateDisplay(int64_t display) {
- getDisplayCommand(display).presentOrValidateDisplay = true;
+ void presentOrvalidateDisplay(int64_t display,
+ std::optional<ClockMonotonicTimestamp> expectedPresentTime) {
+ auto& command = getDisplayCommand(display);
+ command.expectedPresentTime = expectedPresentTime;
+ command.presentOrValidateDisplay = true;
}
void acceptDisplayChanges(int64_t display) {
@@ -201,15 +211,6 @@
getLayerCommand(display, layer).floatColor.emplace(color);
}
- void setLayerGenericMetadata(int64_t display, int64_t layer, const std::string& key,
- const bool mandatory, const std::vector<uint8_t>& value) {
- GenericMetadata metadata;
- metadata.key.name = key;
- metadata.key.mandatory = mandatory;
- metadata.value.assign(value.begin(), value.end());
- getLayerCommand(display, layer).genericMetadata.emplace(std::move(metadata));
- }
-
void setLayerWhitePointNits(int64_t display, int64_t layer, float whitePointNits) {
getLayerCommand(display, layer)
.whitePointNits.emplace(WhitePointNits{.nits = whitePointNits});
diff --git a/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h b/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h
index 7004955..263167e 100644
--- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h
+++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/translate-ndk.h
@@ -32,7 +32,6 @@
#include "aidl/android/hardware/graphics/composer3/FormatColorComponent.h"
#include "aidl/android/hardware/graphics/composer3/HandleIndex.h"
#include "aidl/android/hardware/graphics/composer3/IComposer.h"
-#include "aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.h"
#include "aidl/android/hardware/graphics/composer3/PerFrameMetadata.h"
#include "aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h"
#include "aidl/android/hardware/graphics/composer3/PerFrameMetadataKey.h"
@@ -79,9 +78,5 @@
const ::android::hardware::graphics::composer::V2_4::IComposerClient::ClientTargetProperty&
in,
aidl::android::hardware::graphics::composer3::ClientTargetProperty* out);
-__attribute__((warn_unused_result)) bool translate(
- const ::android::hardware::graphics::composer::V2_4::IComposerClient::
- LayerGenericMetadataKey& in,
- aidl::android::hardware::graphics::composer3::LayerGenericMetadataKey* out);
} // namespace android::h2a
diff --git a/health/aidl/vts/functional/Android.bp b/health/aidl/vts/functional/Android.bp
index 434f565..d315c60 100644
--- a/health/aidl/vts/functional/Android.bp
+++ b/health/aidl/vts/functional/Android.bp
@@ -43,6 +43,7 @@
"libhealthtest_headers",
],
test_suites: [
+ "general-tests",
"vts",
],
}
diff --git a/ir/aidl/Android.bp b/ir/aidl/Android.bp
new file mode 100644
index 0000000..8741157
--- /dev/null
+++ b/ir/aidl/Android.bp
@@ -0,0 +1,35 @@
+// 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.
+
+aidl_interface {
+ name: "android.hardware.ir",
+ vendor_available: true,
+ srcs: ["android/hardware/ir/*.aidl"],
+ stability: "vintf",
+ backend: {
+ cpp: {
+ enabled: false,
+ },
+ java: {
+ sdk_version: "module_current",
+ },
+ ndk: {
+ separate_platform_variant: false,
+ vndk: {
+ // TODO(b/206116595) enable this
+ enabled: false,
+ },
+ },
+ },
+}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/ConsumerIrFreqRange.aidl
similarity index 86%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
copy to ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/ConsumerIrFreqRange.aidl
index 73385d4..4a0d286 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
+++ b/ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/ConsumerIrFreqRange.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * 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
+ * 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,
@@ -31,9 +31,9 @@
// 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.graphics.composer3;
+package android.hardware.ir;
@VintfStability
-parcelable LayerGenericMetadataKey {
- String name;
- boolean mandatory;
+parcelable ConsumerIrFreqRange {
+ int minHz;
+ int maxHz;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl b/ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl
similarity index 84%
copy from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
copy to ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl
index 73385d4..056a8b1 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
+++ b/ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * 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
+ * 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,
@@ -31,9 +31,9 @@
// 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.graphics.composer3;
+package android.hardware.ir;
@VintfStability
-parcelable LayerGenericMetadataKey {
- String name;
- boolean mandatory;
+interface IConsumerIr {
+ android.hardware.ir.ConsumerIrFreqRange[] getCarrierFreqs();
+ void transmit(in int carrierFreq, in int[] pattern);
}
diff --git a/ir/aidl/android/hardware/ir/ConsumerIrFreqRange.aidl b/ir/aidl/android/hardware/ir/ConsumerIrFreqRange.aidl
new file mode 100644
index 0000000..ab0276a
--- /dev/null
+++ b/ir/aidl/android/hardware/ir/ConsumerIrFreqRange.aidl
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+package android.hardware.ir;
+
+@VintfStability
+parcelable ConsumerIrFreqRange {
+ int minHz;
+ int maxHz;
+}
diff --git a/ir/aidl/android/hardware/ir/IConsumerIr.aidl b/ir/aidl/android/hardware/ir/IConsumerIr.aidl
new file mode 100644
index 0000000..d14fa56
--- /dev/null
+++ b/ir/aidl/android/hardware/ir/IConsumerIr.aidl
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ */
+
+package android.hardware.ir;
+
+import android.hardware.ir.ConsumerIrFreqRange;
+
+@VintfStability
+interface IConsumerIr {
+ /**
+ * Enumerates which frequencies the IR transmitter supports.
+ *
+ * Status OK (EX_NONE) on success.
+ *
+ * @return - an array of all supported frequency ranges.
+ */
+ ConsumerIrFreqRange[] getCarrierFreqs();
+
+ /**
+ * Sends an IR pattern at a given frequency in HZ.
+ *
+ * The pattern is alternating series of carrier on and off periods measured in
+ * microseconds. The carrier should be turned off at the end of a transmit
+ * even if there are and odd number of entries in the pattern array.
+ *
+ * This call must return when the transmit is complete or encounters an error.
+ *
+ * Status OK (EX_NONE) on success.
+ * EX_UNSUPPORTED_OPERATION when the frequency is not supported.
+ */
+ void transmit(in int carrierFreq, in int[] pattern);
+}
diff --git a/ir/aidl/default/Android.bp b/ir/aidl/default/Android.bp
new file mode 100644
index 0000000..6519664
--- /dev/null
+++ b/ir/aidl/default/Android.bp
@@ -0,0 +1,33 @@
+// 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.
+
+// Example binder service of the ir HAL.
+cc_binary {
+ name: "android.hardware.ir-service.example",
+ relative_install_path: "hw",
+ init_rc: ["android.hardware.ir-service.example.rc"],
+ vendor: true,
+ vintf_fragments: ["android.hardware.ir-service.example.xml"],
+
+ shared_libs: [
+ "libbase",
+ "libbinder_ndk",
+ "libcutils",
+ "liblog",
+ "libutils",
+ "android.hardware.ir-V1-ndk",
+ ],
+
+ srcs: ["main.cpp"],
+}
diff --git a/ir/aidl/default/android.hardware.ir-service.example.rc b/ir/aidl/default/android.hardware.ir-service.example.rc
new file mode 100644
index 0000000..56def64
--- /dev/null
+++ b/ir/aidl/default/android.hardware.ir-service.example.rc
@@ -0,0 +1,4 @@
+service vendor.ir-default /vendor/bin/hw/android.hardware.ir-service.example
+ class hal
+ user nobody
+ group nobody
diff --git a/ir/aidl/default/android.hardware.ir-service.example.xml b/ir/aidl/default/android.hardware.ir-service.example.xml
new file mode 100644
index 0000000..1a63520
--- /dev/null
+++ b/ir/aidl/default/android.hardware.ir-service.example.xml
@@ -0,0 +1,7 @@
+<manifest version="1.0" type="device">
+ <hal format="aidl">
+ <name>android.hardware.ir</name>
+ <version>1</version>
+ <fqname>IConsumerIr/default</fqname>
+ </hal>
+</manifest>
diff --git a/ir/aidl/default/main.cpp b/ir/aidl/default/main.cpp
new file mode 100644
index 0000000..764aeaf
--- /dev/null
+++ b/ir/aidl/default/main.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ */
+
+#include <aidl/android/hardware/ir/BnConsumerIr.h>
+#include <android-base/logging.h>
+#include <android/binder_interface_utils.h>
+#include <android/binder_manager.h>
+#include <android/binder_process.h>
+#include <numeric>
+
+namespace aidl::android::hardware::ir {
+
+const std::vector<ConsumerIrFreqRange> kSupportedFreqs = {
+ {2000, 4000},
+ {10000, 30000},
+};
+
+class ConsumerIr : public BnConsumerIr {
+ ::ndk::ScopedAStatus getCarrierFreqs(std::vector<ConsumerIrFreqRange>* _aidl_return) override;
+ ::ndk::ScopedAStatus transmit(int32_t in_carrierFreq,
+ const std::vector<int32_t>& in_pattern) override;
+};
+
+::ndk::ScopedAStatus ConsumerIr::getCarrierFreqs(std::vector<ConsumerIrFreqRange>* _aidl_return) {
+ *_aidl_return = kSupportedFreqs;
+ return ::ndk::ScopedAStatus::ok();
+}
+
+bool isSupportedFreq(int32_t freq) {
+ for (const auto& range : kSupportedFreqs) {
+ if (freq >= range.minHz && freq <= range.maxHz) return true;
+ }
+ return false;
+}
+
+::ndk::ScopedAStatus ConsumerIr::transmit(int32_t in_carrierFreq,
+ const std::vector<int32_t>& in_pattern) {
+ if (isSupportedFreq(in_carrierFreq)) {
+ // trasmit the pattern, each integer is number of microseconds in an
+ // alternating on/off state.
+ usleep(std::accumulate(in_pattern.begin(), in_pattern.end(), 0));
+ return ::ndk::ScopedAStatus::ok();
+ } else {
+ // unsupported operation
+ return ::ndk::ScopedAStatus::fromExceptionCode(EX_UNSUPPORTED_OPERATION);
+ }
+ return ::ndk::ScopedAStatus::ok();
+}
+
+} // namespace aidl::android::hardware::ir
+
+using aidl::android::hardware::ir::ConsumerIr;
+
+int main() {
+ auto binder = ::ndk::SharedRefBase::make<ConsumerIr>();
+ const std::string name = std::string() + ConsumerIr::descriptor + "/default";
+ CHECK_EQ(STATUS_OK, AServiceManager_addService(binder->asBinder().get(), name.c_str()))
+ << "Failed to register " << name;
+
+ ABinderProcess_setThreadPoolMaxThreadCount(0);
+ ABinderProcess_joinThreadPool();
+
+ return EXIT_FAILURE; // should not reached
+}
diff --git a/ir/aidl/vts/Android.bp b/ir/aidl/vts/Android.bp
new file mode 100644
index 0000000..c2491b8
--- /dev/null
+++ b/ir/aidl/vts/Android.bp
@@ -0,0 +1,43 @@
+//
+// 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.
+//
+
+package {
+ // See: http://go/android-license-faq
+ // A large-scale-change added 'default_applicable_licenses' to import
+ // all of the 'license_kinds' from "hardware_interfaces_license"
+ // to get the below license kinds:
+ // SPDX-license-identifier-Apache-2.0
+ default_applicable_licenses: ["hardware_interfaces_license"],
+}
+
+cc_test {
+ name: "VtsHalIrTargetTest",
+ defaults: [
+ "VtsHalTargetTestDefaults",
+ "use_libaidlvintf_gtest_helper_static",
+ ],
+ srcs: ["VtsHalIrTargetTest.cpp"],
+ shared_libs: [
+ "libbinder_ndk",
+ ],
+ static_libs: [
+ "android.hardware.ir-V1-ndk",
+ ],
+ test_suites: [
+ "general-tests",
+ "vts",
+ ],
+}
diff --git a/ir/aidl/vts/VtsHalIrTargetTest.cpp b/ir/aidl/vts/VtsHalIrTargetTest.cpp
new file mode 100644
index 0000000..3527625
--- /dev/null
+++ b/ir/aidl/vts/VtsHalIrTargetTest.cpp
@@ -0,0 +1,77 @@
+/*
+ * 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.
+ */
+
+#define LOG_TAG "ir_aidl_hal_test"
+
+#include <aidl/Gtest.h>
+#include <aidl/Vintf.h>
+#include <aidl/android/hardware/ir/IConsumerIr.h>
+#include <android-base/logging.h>
+#include <android/binder_auto_utils.h>
+#include <android/binder_manager.h>
+#include <gtest/gtest.h>
+#include <algorithm>
+#include <vector>
+
+using ::aidl::android::hardware::ir::ConsumerIrFreqRange;
+using ::aidl::android::hardware::ir::IConsumerIr;
+using ::ndk::SpAIBinder;
+
+class ConsumerIrTest : public ::testing::TestWithParam<std::string> {
+ public:
+ virtual void SetUp() override {
+ mIr = IConsumerIr::fromBinder(
+ SpAIBinder(AServiceManager_waitForService(GetParam().c_str())));
+ ASSERT_NE(mIr, nullptr);
+ }
+
+ std::shared_ptr<IConsumerIr> mIr;
+};
+
+// Test transmit() for the min and max frequency of every available range
+TEST_P(ConsumerIrTest, TransmitTest) {
+ std::vector<ConsumerIrFreqRange> ranges;
+ const auto& ret = mIr->getCarrierFreqs(&ranges);
+ ASSERT_TRUE(ret.isOk());
+
+ if (ranges.size() > 0) {
+ uint32_t len = 16;
+ std::vector<int32_t> vec;
+ vec.resize(len);
+ std::fill(vec.begin(), vec.end(), 1000);
+ for (auto range = ranges.begin(); range != ranges.end(); range++) {
+ EXPECT_TRUE(mIr->transmit(range->minHz, vec).isOk());
+ EXPECT_TRUE(mIr->transmit(range->maxHz, vec).isOk());
+ }
+ }
+}
+
+// Test transmit() when called with invalid frequencies
+TEST_P(ConsumerIrTest, BadFreqTest) {
+ uint32_t len = 16;
+ std::vector<int32_t> vec;
+ vec.resize(len);
+ std::fill(vec.begin(), vec.end(), 1);
+ const auto& res = mIr->transmit(-1, vec);
+ EXPECT_FALSE(res.isOk());
+ EXPECT_EQ(res.getExceptionCode(), EX_UNSUPPORTED_OPERATION);
+}
+
+GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(ConsumerIrTest);
+INSTANTIATE_TEST_SUITE_P(
+ PerInstance, ConsumerIrTest,
+ testing::ValuesIn(android::getAidlHalInstanceNames(IConsumerIr::descriptor)),
+ ::android::PrintInstanceNameToString);
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl
index 2c6cc00..e763cfb 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessage.aidl
@@ -50,4 +50,5 @@
android.hardware.tv.tuner.FrontendModulation modulation;
android.hardware.tv.tuner.FrontendDvbcAnnex annex;
boolean isHighPriority;
+ int[] dvbtCellIds;
}
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageType.aidl
index b121c85..6976ecd 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageType.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendScanMessageType.aidl
@@ -50,4 +50,5 @@
MODULATION = 12,
DVBC_ANNEX = 13,
HIGH_PRIORITY = 14,
+ DVBT_CELL_IDS = 15,
}
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl
index c79b751..fc0efc9 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatus.aidl
@@ -75,4 +75,5 @@
android.hardware.tv.tuner.FrontendIsdbtMode isdbtMode;
android.hardware.tv.tuner.FrontendIsdbtPartialReceptionFlag partialReceptionFlag;
int[] streamIdList;
+ int[] dvbtCellIds;
}
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl
index 9ea3200..2cc62d5 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/FrontendStatusType.aidl
@@ -75,4 +75,5 @@
ISDBT_MODE = 37,
ISDBT_PARTIAL_RECEPTION_FLAG = 38,
STREAM_ID_LIST = 39,
+ DVBT_CELL_IDS = 40,
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl
index 19c6766..a941066 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessage.aidl
@@ -70,4 +70,10 @@
FrontendDvbcAnnex annex;
boolean isHighPriority;
+
+ /**
+ * DVB-T Cell Ids.
+ */
+ int[] dvbtCellIds;
+
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageType.aidl
index 2b91216..f4d2ee0 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageType.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendScanMessageType.aidl
@@ -86,4 +86,10 @@
DVBC_ANNEX,
HIGH_PRIORITY,
+
+ /**
+ * DVB-T CELL ID.
+ */
+ DVBT_CELL_IDS,
+
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl
index 6e6f315..ae6e46f 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatus.aidl
@@ -236,4 +236,10 @@
*/
int[] streamIdList;
+ /**
+ * DVB-T Cell Id.
+ */
+ int[] dvbtCellIds;
+
+
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl
index 7feb72d..e7da517 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/FrontendStatusType.aidl
@@ -223,4 +223,9 @@
* Stream ID list included in a transponder.
*/
STREAM_ID_LIST,
+
+ /**
+ * DVB-T Cell Id.
+ */
+ DVBT_CELL_IDS,
}
diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp
index a4dde2a..c1b8b5d 100644
--- a/tv/tuner/aidl/default/Frontend.cpp
+++ b/tv/tuner/aidl/default/Frontend.cpp
@@ -237,6 +237,13 @@
mCallback->onScanMessage(FrontendScanMessageType::HIGH_PRIORITY, msg);
}
+ if (mType == FrontendType::DVBT) {
+ FrontendScanMessage msg;
+ vector<int32_t> dvbtCellIds = {0, 1};
+ msg.set<FrontendScanMessage::Tag::dvbtCellIds>(dvbtCellIds);
+ mCallback->onScanMessage(FrontendScanMessageType::DVBT_CELL_IDS, msg);
+ }
+
{
FrontendScanMessage msg;
msg.set<FrontendScanMessage::Tag::isLocked>(true);
@@ -681,6 +688,11 @@
status.set<FrontendStatus::streamIdList>(streamIds);
break;
}
+ case FrontendStatusType::DVBT_CELL_IDS: {
+ vector<int32_t> dvbtCellIds = {0, 1};
+ status.set<FrontendStatus::dvbtCellIds>(dvbtCellIds);
+ break;
+ }
default: {
continue;
}
diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp
index 96e83bb..9e81177 100644
--- a/tv/tuner/aidl/default/Tuner.cpp
+++ b/tv/tuner/aidl/default/Tuner.cpp
@@ -112,6 +112,7 @@
FrontendStatusType::GUARD_INTERVAL,
FrontendStatusType::TRANSMISSION_MODE,
FrontendStatusType::T2_SYSTEM_ID,
+ FrontendStatusType::DVBT_CELL_IDS,
};
mFrontendStatusCaps[4] = statusCaps;
diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
index 42d20f7..f24dea1 100644
--- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp
+++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
@@ -405,6 +405,13 @@
expectStatuses[i].get<FrontendStatus::Tag::streamIdList>().begin()));
break;
}
+ case FrontendStatusType::DVBT_CELL_IDS: {
+ ASSERT_TRUE(std::equal(
+ realStatuses[i].get<FrontendStatus::Tag::dvbtCellIds>().begin(),
+ realStatuses[i].get<FrontendStatus::Tag::dvbtCellIds>().end(),
+ expectStatuses[i].get<FrontendStatus::Tag::dvbtCellIds>().begin()));
+ break;
+ }
default: {
continue;
}
diff --git a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IHostapdCallback.aidl b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IHostapdCallback.aidl
index 36d2104..9dd062a 100644
--- a/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IHostapdCallback.aidl
+++ b/wifi/hostapd/aidl/aidl_api/android.hardware.wifi.hostapd/current/android/hardware/wifi/hostapd/IHostapdCallback.aidl
@@ -36,5 +36,5 @@
interface IHostapdCallback {
oneway void onApInstanceInfoChanged(in android.hardware.wifi.hostapd.ApInfo apInfo);
oneway void onConnectedClientsChanged(in android.hardware.wifi.hostapd.ClientInfo clientInfo);
- oneway void onFailure(in String ifaceName);
+ oneway void onFailure(in String ifaceName, in String instanceName);
}
diff --git a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IHostapdCallback.aidl b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IHostapdCallback.aidl
index 7b04944..456f46a 100644
--- a/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IHostapdCallback.aidl
+++ b/wifi/hostapd/aidl/android/hardware/wifi/hostapd/IHostapdCallback.aidl
@@ -41,7 +41,10 @@
* Invoked when an asynchronous failure is encountered in one of the access
* points added via |IHostapd.addAccessPoint|.
*
- * @param ifaceName Name of the interface.
+ * @param ifaceName Name of the interface which was added via
+ * |IHostapd.addAccessPoint|.
+ * @param instanceName Name of the AP instance which is associated with
+ * the interface.
*/
- oneway void onFailure(in String ifaceName);
+ oneway void onFailure(in String ifaceName, in String instanceName);
}
diff --git a/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp b/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp
index 41c54b3..dad7085 100644
--- a/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp
+++ b/wifi/hostapd/aidl/vts/functional/VtsHalHostapdTargetTest.cpp
@@ -232,7 +232,7 @@
const ::aidl::android::hardware::wifi::hostapd::ClientInfo &) override {
return ndk::ScopedAStatus::ok();
}
- ::ndk::ScopedAStatus onFailure(const std::string &) override {
+ ::ndk::ScopedAStatus onFailure(const std::string&, const std::string&) override {
return ndk::ScopedAStatus::ok();
}
};