Merge "[IHostapd] Support vendor-specific AP config elem"
diff --git a/automotive/evs/OWNERS b/automotive/evs/OWNERS
index 6fc5024..b973e91 100644
--- a/automotive/evs/OWNERS
+++ b/automotive/evs/OWNERS
@@ -1,3 +1,3 @@
+ankitarora@google.com
changyeon@google.com
-garysungang@google.com
-haoxiangl@google.com
+jwhpryor@google.com
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioCapabilities.aidl
index 20a7731..8ae716f 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioCapabilities.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioCapabilities.aidl
@@ -35,6 +35,6 @@
@VintfStability
union AudioCapabilities {
android.hardware.bluetooth.audio.PcmCapabilities pcmCapabilities;
- android.hardware.bluetooth.audio.CodecCapabilities codecCapabilities;
- android.hardware.bluetooth.audio.LeAudioCapabilities leAudioCapabilities;
+ android.hardware.bluetooth.audio.CodecCapabilities a2dpCapabilities;
+ android.hardware.bluetooth.audio.LeAudioCodecCapabilitiesSetting leAudioCapabilities;
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioConfiguration.aidl
index 34f7837..50b54c3 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioConfiguration.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/AudioConfiguration.aidl
@@ -35,6 +35,6 @@
@VintfStability
union AudioConfiguration {
android.hardware.bluetooth.audio.PcmConfiguration pcmConfig;
- android.hardware.bluetooth.audio.CodecConfiguration codecConfig;
+ android.hardware.bluetooth.audio.CodecConfiguration a2dpConfig;
android.hardware.bluetooth.audio.LeAudioConfiguration leAudioConfig;
}
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/BroadcastCapability.aidl
similarity index 83%
copy from bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
copy to bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastCapability.aidl
index a7224ca..58710ef 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/BroadcastCapability.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2021 The Android Open Source Project
+ * Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -33,19 +33,18 @@
package android.hardware.bluetooth.audio;
@VintfStability
-parcelable LeAudioCapabilities {
- android.hardware.bluetooth.audio.LeAudioMode mode;
+parcelable BroadcastCapability {
android.hardware.bluetooth.audio.CodecType codecType;
android.hardware.bluetooth.audio.AudioLocation supportedChannel;
- int supportedChannelCount;
- android.hardware.bluetooth.audio.LeAudioCapabilities.LeAudioCodecCapabilities leAudioCodecCapabilities;
+ int channelCountPerStream;
+ android.hardware.bluetooth.audio.BroadcastCapability.LeAudioCodecCapabilities leAudioCodecCapabilities;
@VintfStability
parcelable VendorCapabilities {
ParcelableHolder extension;
}
@VintfStability
union LeAudioCodecCapabilities {
- android.hardware.bluetooth.audio.Lc3Capabilities lc3Capabilities;
- android.hardware.bluetooth.audio.LeAudioCapabilities.VendorCapabilities vendorCapabillities;
+ @nullable android.hardware.bluetooth.audio.Lc3Capabilities[] lc3Capabilities;
+ @nullable android.hardware.bluetooth.audio.BroadcastCapability.VendorCapabilities[] vendorCapabillities;
}
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl
index b3aa709..5fa3926 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl
@@ -39,6 +39,6 @@
parcelable BroadcastStreamMap {
char streamHandle;
int audioChannelAllocation;
- android.hardware.bluetooth.audio.LeAudioCodecConfiguration leAudioCondecConfig;
+ android.hardware.bluetooth.audio.LeAudioCodecConfiguration leAudioCodecConfig;
}
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecCapabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecCapabilities.aidl
index b451880..e2a08a0 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecCapabilities.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecCapabilities.aidl
@@ -42,5 +42,6 @@
android.hardware.bluetooth.audio.AacCapabilities aacCapabilities;
android.hardware.bluetooth.audio.LdacCapabilities ldacCapabilities;
android.hardware.bluetooth.audio.AptxCapabilities aptxCapabilities;
+ android.hardware.bluetooth.audio.Lc3Capabilities lc3Capabilities;
}
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecConfiguration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecConfiguration.aidl
index 863aee2..34ebd60 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecConfiguration.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/CodecConfiguration.aidl
@@ -45,5 +45,6 @@
android.hardware.bluetooth.audio.AacConfiguration aacConfig;
android.hardware.bluetooth.audio.LdacConfiguration ldacConfig;
android.hardware.bluetooth.audio.AptxConfiguration aptxConfig;
+ android.hardware.bluetooth.audio.Lc3Configuration lc3Config;
}
}
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 e5e79cb..0dcba2e 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
@@ -38,4 +38,5 @@
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);
+ void updateAudioConfiguration(in android.hardware.bluetooth.audio.AudioConfiguration audioConfig);
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Capabilities.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Capabilities.aidl
index 3c650da..cc4449a 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Capabilities.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Capabilities.aidl
@@ -39,4 +39,5 @@
int[] frameDurationUs;
int[] octetsPerFrame;
byte[] blocksPerSdu;
+ android.hardware.bluetooth.audio.ChannelMode[] channelMode;
}
diff --git a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Configuration.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Configuration.aidl
index ef77da7..7e8dccf 100644
--- a/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Configuration.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/Lc3Configuration.aidl
@@ -39,4 +39,5 @@
int frameDurationUs;
int octetsPerFrame;
byte blocksPerSdu;
+ android.hardware.bluetooth.audio.ChannelMode channelMode;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FloatColor.aidl b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCodecCapabilitiesSetting.aidl
similarity index 78%
rename from graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FloatColor.aidl
rename to bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCodecCapabilitiesSetting.aidl
index faadf57..9818d54 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/FloatColor.aidl
+++ b/bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCodecCapabilitiesSetting.aidl
@@ -1,11 +1,11 @@
-/**
- * Copyright (c) 2021, The Android Open Source Project
+/*
+ * Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
- * http://www.apache.org/licenses/LICENSE-2.0
+ * 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,11 +31,10 @@
// 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.bluetooth.audio;
@VintfStability
-parcelable FloatColor {
- float r;
- float g;
- float b;
- float a;
+parcelable LeAudioCodecCapabilitiesSetting {
+ android.hardware.bluetooth.audio.UnicastCapability unicastEncodeCapability;
+ android.hardware.bluetooth.audio.UnicastCapability unicastDecodeCapability;
+ android.hardware.bluetooth.audio.BroadcastCapability broadcastCapability;
}
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/UnicastCapability.aidl
similarity index 86%
rename from bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
rename to bluetooth/audio/aidl/aidl_api/android.hardware.bluetooth.audio/current/android/hardware/bluetooth/audio/UnicastCapability.aidl
index a7224ca..130fef9 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/UnicastCapability.aidl
@@ -33,12 +33,12 @@
package android.hardware.bluetooth.audio;
@VintfStability
-parcelable LeAudioCapabilities {
- android.hardware.bluetooth.audio.LeAudioMode mode;
+parcelable UnicastCapability {
android.hardware.bluetooth.audio.CodecType codecType;
android.hardware.bluetooth.audio.AudioLocation supportedChannel;
- int supportedChannelCount;
- android.hardware.bluetooth.audio.LeAudioCapabilities.LeAudioCodecCapabilities leAudioCodecCapabilities;
+ int deviceCount;
+ int channelCountPerDevice;
+ android.hardware.bluetooth.audio.UnicastCapability.LeAudioCodecCapabilities leAudioCodecCapabilities;
@VintfStability
parcelable VendorCapabilities {
ParcelableHolder extension;
@@ -46,6 +46,6 @@
@VintfStability
union LeAudioCodecCapabilities {
android.hardware.bluetooth.audio.Lc3Capabilities lc3Capabilities;
- android.hardware.bluetooth.audio.LeAudioCapabilities.VendorCapabilities vendorCapabillities;
+ android.hardware.bluetooth.audio.UnicastCapability.VendorCapabilities vendorCapabillities;
}
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioCapabilities.aidl
index 6ed4472..a75c445 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioCapabilities.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioCapabilities.aidl
@@ -17,7 +17,7 @@
package android.hardware.bluetooth.audio;
import android.hardware.bluetooth.audio.CodecCapabilities;
-import android.hardware.bluetooth.audio.LeAudioCapabilities;
+import android.hardware.bluetooth.audio.LeAudioCodecCapabilitiesSetting;
import android.hardware.bluetooth.audio.PcmCapabilities;
/**
@@ -26,6 +26,6 @@
@VintfStability
union AudioCapabilities {
PcmCapabilities pcmCapabilities;
- CodecCapabilities codecCapabilities;
- LeAudioCapabilities leAudioCapabilities;
+ CodecCapabilities a2dpCapabilities;
+ LeAudioCodecCapabilitiesSetting leAudioCapabilities;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl
index ce515b5..81b41dc 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/AudioConfiguration.aidl
@@ -26,6 +26,6 @@
@VintfStability
union AudioConfiguration {
PcmConfiguration pcmConfig;
- CodecConfiguration codecConfig;
+ CodecConfiguration a2dpConfig;
LeAudioConfiguration leAudioConfig;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastCapability.aidl
similarity index 69%
copy from bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
copy to bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastCapability.aidl
index 732427f..cb63f88 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastCapability.aidl
@@ -1,5 +1,5 @@
/*
- * Copyright 2021 The Android Open Source Project
+ * Copyright 2022 The Android Open Source Project
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -22,26 +22,22 @@
import android.hardware.bluetooth.audio.LeAudioMode;
/**
- * Used to specify the capabilities of the LC3 codecs supported by Hardware Encoding.
+ * Used to specify the le audio broadcast codec capabilities for hardware offload.
*/
@VintfStability
-parcelable LeAudioCapabilities {
+parcelable BroadcastCapability {
@VintfStability
parcelable VendorCapabilities {
ParcelableHolder extension;
}
@VintfStability
union LeAudioCodecCapabilities {
- Lc3Capabilities lc3Capabilities;
- VendorCapabilities vendorCapabillities;
+ @nullable Lc3Capabilities[] lc3Capabilities;
+ @nullable VendorCapabilities[] vendorCapabillities;
}
- LeAudioMode mode;
CodecType codecType;
- /*
- * This is bitfield, if bit N is set, HW Offloader supports N+1 channels at the same time.
- * Example: 0x27 = 0b00100111: One, two, three or six channels supported.
- */
AudioLocation supportedChannel;
- int supportedChannelCount;
+ // Supported channel count for each stream
+ int channelCountPerStream;
LeAudioCodecCapabilities leAudioCodecCapabilities;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl
index 07d05f1..cfc9d3a 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/BroadcastConfiguration.aidl
@@ -33,7 +33,7 @@
* least significant bit to the most significant bit.
*/
int audioChannelAllocation;
- LeAudioCodecConfiguration leAudioCondecConfig;
+ LeAudioCodecConfiguration leAudioCodecConfig;
}
BroadcastStreamMap[] streamMap;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl
index 0eee8cb..5bf0252 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecCapabilities.aidl
@@ -19,6 +19,7 @@
import android.hardware.bluetooth.audio.AacCapabilities;
import android.hardware.bluetooth.audio.AptxCapabilities;
import android.hardware.bluetooth.audio.CodecType;
+import android.hardware.bluetooth.audio.Lc3Capabilities;
import android.hardware.bluetooth.audio.LdacCapabilities;
import android.hardware.bluetooth.audio.SbcCapabilities;
@@ -34,6 +35,7 @@
AacCapabilities aacCapabilities;
LdacCapabilities ldacCapabilities;
AptxCapabilities aptxCapabilities;
+ Lc3Capabilities lc3Capabilities;
}
CodecType codecType;
Capabilities capabilities;
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl
index fac90f0..9e43f22 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/CodecConfiguration.aidl
@@ -19,6 +19,7 @@
import android.hardware.bluetooth.audio.AacConfiguration;
import android.hardware.bluetooth.audio.AptxConfiguration;
import android.hardware.bluetooth.audio.CodecType;
+import android.hardware.bluetooth.audio.Lc3Configuration;
import android.hardware.bluetooth.audio.LdacConfiguration;
import android.hardware.bluetooth.audio.SbcConfiguration;
@@ -34,6 +35,7 @@
AacConfiguration aacConfig;
LdacConfiguration ldacConfig;
AptxConfiguration aptxConfig;
+ Lc3Configuration lc3Config;
}
CodecType codecType;
/**
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
index a2c5ae9..6f88f30 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/IBluetoothAudioProvider.aidl
@@ -72,4 +72,14 @@
* @param status true for SUCCESS or false for FAILURE
*/
void streamSuspended(in BluetoothAudioStatus status);
+
+ /**
+ * Called when the audio configuration of the stream has been changed.
+ *
+ * @param audioConfig The audio configuration negotiated with the remote
+ * device. The PCM parameters are set if software based encoding,
+ * otherwise the correct codec configuration is used for hardware
+ * encoding.
+ */
+ void updateAudioConfiguration(in AudioConfiguration audioConfig);
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Capabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Capabilities.aidl
index 1aedefd..fc2f382 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Capabilities.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Capabilities.aidl
@@ -16,6 +16,8 @@
package android.hardware.bluetooth.audio;
+import android.hardware.bluetooth.audio.ChannelMode;
+
/**
* Used for Hardware Encoding/Decoding LC3 codec capabilities.
*/
@@ -41,4 +43,8 @@
* Number of blocks of codec frames per single SDU (Service Data Unit)
*/
byte[] blocksPerSdu;
+ /*
+ * Channel mode used in A2DP special audio, ignored in standard LE Audio mode
+ */
+ ChannelMode[] channelMode;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Configuration.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Configuration.aidl
index 77c04c1..e8a93b2 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Configuration.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/Lc3Configuration.aidl
@@ -16,6 +16,8 @@
package android.hardware.bluetooth.audio;
+import android.hardware.bluetooth.audio.ChannelMode;
+
/**
* Used for Hardware Encoding/Decoding LC3 codec configuration.
*/
@@ -41,4 +43,8 @@
* Number of blocks of codec frames per single SDU (Service Data Unit)
*/
byte blocksPerSdu;
+ /*
+ * Channel mode used in A2DP special audio, ignored in standard LE Audio mode
+ */
+ ChannelMode channelMode;
}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCodecCapabilitiesSetting.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCodecCapabilitiesSetting.aidl
new file mode 100644
index 0000000..58dac06
--- /dev/null
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCodecCapabilitiesSetting.aidl
@@ -0,0 +1,30 @@
+/*
+ * Copyright 2022 The Android Open Source Project
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package android.hardware.bluetooth.audio;
+
+import android.hardware.bluetooth.audio.BroadcastCapability;
+import android.hardware.bluetooth.audio.UnicastCapability;
+
+/**
+ * Used to specify the le audio capabilities for unicast and broadcast hardware offload.
+ */
+@VintfStability
+parcelable LeAudioCodecCapabilitiesSetting {
+ UnicastCapability unicastEncodeCapability;
+ UnicastCapability unicastDecodeCapability;
+ BroadcastCapability broadcastCapability;
+}
diff --git a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl
similarity index 77%
rename from bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
rename to bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl
index 732427f..cd8a4c1 100644
--- a/bluetooth/audio/aidl/android/hardware/bluetooth/audio/LeAudioCapabilities.aidl
+++ b/bluetooth/audio/aidl/android/hardware/bluetooth/audio/UnicastCapability.aidl
@@ -22,10 +22,10 @@
import android.hardware.bluetooth.audio.LeAudioMode;
/**
- * Used to specify the capabilities of the LC3 codecs supported by Hardware Encoding.
+ * Used to specify the le audio unicast codec capabilities for hardware offload.
*/
@VintfStability
-parcelable LeAudioCapabilities {
+parcelable UnicastCapability {
@VintfStability
parcelable VendorCapabilities {
ParcelableHolder extension;
@@ -35,13 +35,11 @@
Lc3Capabilities lc3Capabilities;
VendorCapabilities vendorCapabillities;
}
- LeAudioMode mode;
CodecType codecType;
- /*
- * This is bitfield, if bit N is set, HW Offloader supports N+1 channels at the same time.
- * Example: 0x27 = 0b00100111: One, two, three or six channels supported.
- */
AudioLocation supportedChannel;
- int supportedChannelCount;
+ // The number of connected device
+ int deviceCount;
+ // Supported channel count for each device
+ int channelCountPerDevice;
LeAudioCodecCapabilities leAudioCodecCapabilities;
}
diff --git a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Color.aidl b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Color.aidl
index 7733deb..8222909 100644
--- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Color.aidl
+++ b/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/Color.aidl
@@ -34,8 +34,8 @@
package android.hardware.graphics.composer3;
@VintfStability
parcelable Color {
- byte r;
- byte g;
- byte b;
- byte a;
+ float r;
+ float g;
+ float b;
+ float a;
}
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 7e6c00b..c1c0117 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
@@ -40,7 +40,6 @@
@nullable android.hardware.graphics.common.Rect[] damage;
@nullable android.hardware.graphics.composer3.ParcelableBlendMode blendMode;
@nullable android.hardware.graphics.composer3.Color color;
- @nullable android.hardware.graphics.composer3.FloatColor floatColor;
@nullable android.hardware.graphics.composer3.ParcelableComposition composition;
@nullable android.hardware.graphics.composer3.ParcelableDataspace dataspace;
@nullable android.hardware.graphics.common.Rect displayFrame;
@@ -54,4 +53,5 @@
@nullable android.hardware.graphics.composer3.Luminance whitePointNits;
@nullable android.hardware.graphics.composer3.PerFrameMetadata[] perFrameMetadata;
@nullable android.hardware.graphics.composer3.PerFrameMetadataBlob[] perFrameMetadataBlob;
+ @nullable android.hardware.graphics.common.Rect[] blockingRegion;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Color.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/Color.aidl
index 979f677..151a854 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/Color.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Color.aidl
@@ -16,10 +16,13 @@
package android.hardware.graphics.composer3;
+/**
+ * Color representation as a floating point number in the range [0.0 - 1.0]
+ */
@VintfStability
parcelable Color {
- byte r;
- byte g;
- byte b;
- byte a;
+ float r;
+ float g;
+ float b;
+ float a;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/FloatColor.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/FloatColor.aidl
deleted file mode 100644
index a0a1d4b..0000000
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/FloatColor.aidl
+++ /dev/null
@@ -1,29 +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;
-
-/**
- * Color representation as a floating point number in the range [0.0 - 1.0]
- */
-
-@VintfStability
-parcelable FloatColor {
- float r;
- float g;
- float b;
- float a;
-}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp
index d34b405..d2cabff 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/Hidl2AidlAsserts.cpp
@@ -25,7 +25,6 @@
#include "aidl/android/hardware/graphics/composer3/DisplayAttribute.h"
#include "aidl/android/hardware/graphics/composer3/DisplayCapability.h"
#include "aidl/android/hardware/graphics/composer3/DisplayConnectionType.h"
-#include "aidl/android/hardware/graphics/composer3/FloatColor.h"
#include "aidl/android/hardware/graphics/composer3/FormatColorComponent.h"
#include "aidl/android/hardware/graphics/composer3/IComposer.h"
#include "aidl/android/hardware/graphics/composer3/PerFrameMetadata.h"
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
index fa2d154..0a2711b 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl
@@ -22,7 +22,6 @@
import android.hardware.graphics.common.Rect;
import android.hardware.graphics.composer3.Buffer;
import android.hardware.graphics.composer3.Color;
-import android.hardware.graphics.composer3.FloatColor;
import android.hardware.graphics.composer3.Luminance;
import android.hardware.graphics.composer3.ParcelableBlendMode;
import android.hardware.graphics.composer3.ParcelableComposition;
@@ -114,13 +113,6 @@
@nullable Color color;
/**
- * Sets the color of the given layer. If the composition type of the layer
- * is not Composition.SOLID_COLOR, this call must succeed and have no
- * other effect.
- */
- @nullable FloatColor floatColor;
-
- /**
* Sets the desired composition type of the given layer. During
* validateDisplay, the device may request changes to the composition
* types of any of the layers as described in the definition of
@@ -264,4 +256,15 @@
* This command may be called every frame.
*/
@nullable PerFrameMetadataBlob[] perFrameMetadataBlob;
+
+ /**
+ * Specifies a region of the layer that is transparent and may be skipped
+ * by the DPU, e.g. using a blocking region, in order to save power. This
+ * is only a hint, so the composition of the layer must look the same
+ * whether or not this region is skipped.
+ *
+ * The region is in screen space and must not exceed the dimensions of
+ * the screen.
+ */
+ @nullable Rect[] blockingRegion;
}
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 0ece1d5..e519221 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
@@ -922,35 +922,30 @@
auto layer = mLayers[1];
BlendMode blendMode = layer->getBlendMode();
- float alpha = mTopLayerColor.a / 255.0f * layer->getAlpha();
+ float alpha = mTopLayerColor.a * layer->getAlpha();
if (blendMode == BlendMode::NONE) {
for (auto& expectedColor : expectedColors) {
- expectedColor.r = mTopLayerColor.r * static_cast<int8_t>(layer->getAlpha());
- expectedColor.g = mTopLayerColor.g * static_cast<int8_t>(layer->getAlpha());
- expectedColor.b = mTopLayerColor.b * static_cast<int8_t>(layer->getAlpha());
- expectedColor.a = static_cast<int8_t>(alpha * 255.0);
+ expectedColor.r = mTopLayerColor.r * layer->getAlpha();
+ expectedColor.g = mTopLayerColor.g * layer->getAlpha();
+ expectedColor.b = mTopLayerColor.b * layer->getAlpha();
+ expectedColor.a = alpha;
}
} else if (blendMode == BlendMode::PREMULTIPLIED) {
for (auto& expectedColor : expectedColors) {
- expectedColor.r = static_cast<int8_t>(
- mTopLayerColor.r * static_cast<int8_t>(layer->getAlpha()) +
- mBackgroundColor.r * (1.0 - alpha));
- expectedColor.g = static_cast<int8_t>(mTopLayerColor.g * layer->getAlpha() +
- mBackgroundColor.g * (1.0 - alpha));
- expectedColor.b = static_cast<int8_t>(mTopLayerColor.b * layer->getAlpha() +
- mBackgroundColor.b * (1.0 - alpha));
- expectedColor.a = static_cast<int8_t>(alpha + mBackgroundColor.a * (1.0 - alpha));
+ expectedColor.r =
+ mTopLayerColor.r * layer->getAlpha() + mBackgroundColor.r * (1.0f - alpha);
+ expectedColor.g =
+ mTopLayerColor.g * layer->getAlpha() + mBackgroundColor.g * (1.0f - alpha);
+ expectedColor.b =
+ mTopLayerColor.b * layer->getAlpha() + mBackgroundColor.b * (1.0f - alpha);
+ expectedColor.a = alpha + mBackgroundColor.a * (1.0f - alpha);
}
} else if (blendMode == BlendMode::COVERAGE) {
for (auto& expectedColor : expectedColors) {
- expectedColor.r = static_cast<int8_t>(mTopLayerColor.r * alpha +
- mBackgroundColor.r * (1.0 - alpha));
- expectedColor.g = static_cast<int8_t>(mTopLayerColor.g * alpha +
- mBackgroundColor.g * (1.0 - alpha));
- expectedColor.b = static_cast<int8_t>(mTopLayerColor.b * alpha +
- mBackgroundColor.b * (1.0 - alpha));
- expectedColor.a = static_cast<int8_t>(mTopLayerColor.a * alpha +
- mBackgroundColor.a * (1.0 - alpha));
+ expectedColor.r = mTopLayerColor.r * alpha + mBackgroundColor.r * (1.0f - alpha);
+ expectedColor.g = mTopLayerColor.g * alpha + mBackgroundColor.g * (1.0f - alpha);
+ expectedColor.b = mTopLayerColor.b * alpha + mBackgroundColor.b * (1.0f - alpha);
+ expectedColor.a = mTopLayerColor.a * alpha + mBackgroundColor.a * (1.0f - alpha);
}
}
}
@@ -1083,7 +1078,7 @@
GraphicsCompositionTest::SetUp();
auto backgroundLayer = std::make_shared<TestColorLayer>(mComposerClient, mPrimaryDisplay);
- backgroundLayer->setColor({0, 0, 0, 0});
+ backgroundLayer->setColor({0.0f, 0.0f, 0.0f, 0.0f});
backgroundLayer->setDisplayFrame({0, 0, mDisplayWidth, mDisplayHeight});
backgroundLayer->setZOrder(0);
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 a591aaa..5ae99a9 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
@@ -1426,8 +1426,7 @@
presentFence2->waitForever(LOG_TAG);
const auto actualPresentTime = presentFence2->getSignalTime();
- const auto presentError = std::abs(expectedPresentTime - actualPresentTime);
- EXPECT_LE(presentError, vsyncPeriod / 2);
+ EXPECT_GE(actualPresentTime, expectedPresentTime - vsyncPeriod / 2);
ASSERT_TRUE(mComposerClient->setPowerMode(mPrimaryDisplay, PowerMode::OFF).isOk());
}
@@ -1720,13 +1719,11 @@
int64_t layer;
EXPECT_TRUE(mComposerClient->createLayer(mPrimaryDisplay, kBufferSlotCount, &layer).isOk());
- mWriter.setLayerColor(mPrimaryDisplay, layer,
- Color{static_cast<int8_t>(0xff), static_cast<int8_t>(0xff),
- static_cast<int8_t>(0xff), static_cast<int8_t>(0xff)});
+ mWriter.setLayerColor(mPrimaryDisplay, layer, Color{1.0f, 1.0f, 1.0f, 1.0f});
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
- mWriter.setLayerColor(mPrimaryDisplay, layer, Color{0, 0, 0, 0});
+ mWriter.setLayerColor(mPrimaryDisplay, layer, Color{0.0f, 0.0f, 0.0f, 0.0f});
execute();
ASSERT_TRUE(mReader.takeErrors().empty());
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp
index 5eb912b..deb5ac3 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/ReadbackVts.cpp
@@ -131,12 +131,12 @@
int offset = (row * static_cast<int32_t>(stride) + col) * bytesPerPixel;
uint8_t* pixelColor = (uint8_t*)bufferData + offset;
- pixelColor[0] = static_cast<uint8_t>(srcColor.r);
- pixelColor[1] = static_cast<uint8_t>(srcColor.g);
- pixelColor[2] = static_cast<uint8_t>(srcColor.b);
+ pixelColor[0] = static_cast<uint8_t>(std::round(255.0f * srcColor.r));
+ pixelColor[1] = static_cast<uint8_t>(std::round(255.0f * srcColor.g));
+ pixelColor[2] = static_cast<uint8_t>(std::round(255.0f * srcColor.b));
if (bytesPerPixel == 4) {
- pixelColor[3] = static_cast<uint8_t>(srcColor.a);
+ pixelColor[3] = static_cast<uint8_t>(std::round(255.0f * srcColor.a));
}
}
}
@@ -184,13 +184,11 @@
auto pixel = row * static_cast<int32_t>(width) + col;
int offset = (row * stride + col) * bytesPerPixel;
uint8_t* pixelColor = (uint8_t*)bufferData + offset;
+ const Color expectedColor = expectedColors[static_cast<size_t>(pixel)];
- ASSERT_EQ(static_cast<int8_t>(expectedColors[static_cast<size_t>(pixel)].r),
- pixelColor[0]);
- ASSERT_EQ(static_cast<int8_t>(expectedColors[static_cast<size_t>(pixel)].g),
- pixelColor[1]);
- ASSERT_EQ(static_cast<int8_t>(expectedColors[static_cast<size_t>(pixel)].b),
- pixelColor[2]);
+ ASSERT_EQ(std::round(255.0f * expectedColor.r), pixelColor[0]);
+ ASSERT_EQ(std::round(255.0f * expectedColor.g), pixelColor[1]);
+ ASSERT_EQ(std::round(255.0f * expectedColor.b), pixelColor[2]);
}
}
}
@@ -262,12 +260,8 @@
LayerSettings TestColorLayer::toRenderEngineLayerSettings() {
LayerSettings layerSettings = TestLayer::toRenderEngineLayerSettings();
- layerSettings.source.solidColor =
- ::android::half3(static_cast<::android::half>(mColor.r) / 255.0,
- static_cast<::android::half>(mColor.g) / 255.0,
- static_cast<::android::half>(mColor.b) / 255.0);
- layerSettings.alpha =
- mAlpha * static_cast<float>((static_cast<::android::half>(mColor.a) / 255.0));
+ layerSettings.source.solidColor = ::android::half3(mColor.r, mColor.g, mColor.b);
+ layerSettings.alpha = mAlpha * mColor.a;
return layerSettings;
}
diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h
index 60a036e..0fac2b3 100644
--- a/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h
+++ b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/composer-vts/include/ReadbackVts.h
@@ -41,13 +41,12 @@
using common::PixelFormat;
using IMapper2_1 = ::android::hardware::graphics::mapper::V2_1::IMapper;
-static const Color BLACK = {0, 0, 0, static_cast<int8_t>(0xff)};
-static const Color RED = {static_cast<int8_t>(0xff), 0, 0, static_cast<int8_t>(0xff)};
-static const Color TRANSLUCENT_RED = {static_cast<int8_t>(0xff), 0, 0, 0x33};
-static const Color GREEN = {0, static_cast<int8_t>(0xff), 0, static_cast<int8_t>(0xff)};
-static const Color BLUE = {0, 0, static_cast<int8_t>(0xff), static_cast<int8_t>(0xff)};
-static const Color WHITE = {static_cast<int8_t>(0xff), static_cast<int8_t>(0xff),
- static_cast<int8_t>(0xff), static_cast<int8_t>(0xff)};
+static const Color BLACK = {0.0f, 0.0f, 0.0f, 1.0f};
+static const Color RED = {1.0f, 0.0f, 0.0f, 1.0f};
+static const Color TRANSLUCENT_RED = {1.0f, 0.0f, 0.0f, 0.3f};
+static const Color GREEN = {0.0f, 1.0f, 0.0f, 1.0f};
+static const Color BLUE = {0.0f, 0.0f, 1.0f, 1.0f};
+static const Color WHITE = {1.0f, 1.0f, 1.0f, 1.0f};
class TestRenderEngine;
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 2d927cd..d3266e7 100644
--- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
+++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h
@@ -30,7 +30,6 @@
#include <aidl/android/hardware/graphics/composer3/Color.h>
#include <aidl/android/hardware/graphics/composer3/Composition.h>
#include <aidl/android/hardware/graphics/composer3/DisplayBrightness.h>
-#include <aidl/android/hardware/graphics/composer3/FloatColor.h>
#include <aidl/android/hardware/graphics/composer3/Luminance.h>
#include <aidl/android/hardware/graphics/composer3/PerFrameMetadata.h>
#include <aidl/android/hardware/graphics/composer3/PerFrameMetadataBlob.h>
@@ -210,14 +209,14 @@
.perFrameMetadataBlob.emplace(metadata.begin(), metadata.end());
}
- void setLayerFloatColor(int64_t display, int64_t layer, FloatColor color) {
- getLayerCommand(display, layer).floatColor.emplace(color);
- }
-
void setLayerWhitePointNits(int64_t display, int64_t layer, float whitePointNits) {
getLayerCommand(display, layer).whitePointNits.emplace(Luminance{.nits = whitePointNits});
}
+ void setLayerBlockingRegion(int64_t display, int64_t layer, const std::vector<Rect>& blocking) {
+ getLayerCommand(display, layer).blockingRegion.emplace(blocking.begin(), blocking.end());
+ }
+
const std::vector<DisplayCommand>& getPendingCommands() {
flushLayerCommand();
flushDisplayCommand();
diff --git a/ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl b/ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl
index 056a8b1..07bf4b4 100644
--- a/ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl
+++ b/ir/aidl/aidl_api/android.hardware.ir/current/android/hardware/ir/IConsumerIr.aidl
@@ -35,5 +35,5 @@
@VintfStability
interface IConsumerIr {
android.hardware.ir.ConsumerIrFreqRange[] getCarrierFreqs();
- void transmit(in int carrierFreq, in int[] pattern);
+ void transmit(in int carrierFreqHz, in int[] pattern);
}
diff --git a/ir/aidl/android/hardware/ir/IConsumerIr.aidl b/ir/aidl/android/hardware/ir/IConsumerIr.aidl
index d14fa56..f6f9742 100644
--- a/ir/aidl/android/hardware/ir/IConsumerIr.aidl
+++ b/ir/aidl/android/hardware/ir/IConsumerIr.aidl
@@ -23,23 +23,21 @@
/**
* 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.
+ * @param carrierFreq - Frequency of the transmission in HZ.
+ *
+ * @param pattern - Alternating series of on and off periods measured in
+ * microseconds. The carrier should be turned off at the end of a transmit
+ * even if there are an odd number of entries in the pattern array.
+ *
+ * @throws EX_UNSUPPORTED_OPERATION when the frequency is not supported.
*/
- void transmit(in int carrierFreq, in int[] pattern);
+ void transmit(in int carrierFreqHz, in int[] pattern);
}
diff --git a/ir/aidl/default/main.cpp b/ir/aidl/default/main.cpp
index 764aeaf..7c4a816 100644
--- a/ir/aidl/default/main.cpp
+++ b/ir/aidl/default/main.cpp
@@ -30,7 +30,7 @@
class ConsumerIr : public BnConsumerIr {
::ndk::ScopedAStatus getCarrierFreqs(std::vector<ConsumerIrFreqRange>* _aidl_return) override;
- ::ndk::ScopedAStatus transmit(int32_t in_carrierFreq,
+ ::ndk::ScopedAStatus transmit(int32_t in_carrierFreqHz,
const std::vector<int32_t>& in_pattern) override;
};
@@ -46,9 +46,9 @@
return false;
}
-::ndk::ScopedAStatus ConsumerIr::transmit(int32_t in_carrierFreq,
+::ndk::ScopedAStatus ConsumerIr::transmit(int32_t in_carrierFreqHz,
const std::vector<int32_t>& in_pattern) {
- if (isSupportedFreq(in_carrierFreq)) {
+ if (isSupportedFreq(in_carrierFreqHz)) {
// 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));
diff --git a/sensors/aidl/Android.bp b/sensors/aidl/Android.bp
index fd1ac44..7324abf 100644
--- a/sensors/aidl/Android.bp
+++ b/sensors/aidl/Android.bp
@@ -1,5 +1,3 @@
-// This is the expected build file, but it may not be right in all cases
-
aidl_interface {
name: "android.hardware.sensors",
vendor_available: true,
diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl
index 186b2be..c92ab1a 100644
--- a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl
+++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/Event.aidl
@@ -51,6 +51,7 @@
android.hardware.sensors.DynamicSensorInfo dynamic;
android.hardware.sensors.AdditionalInfo additional;
android.hardware.sensors.Event.EventPayload.Data data;
+ android.hardware.sensors.Event.EventPayload.HeadTracker headTracker;
@FixedSize @VintfStability
parcelable Vec4 {
float x;
@@ -75,6 +76,16 @@
float zBias;
}
@FixedSize @VintfStability
+ parcelable HeadTracker {
+ float rx;
+ float ry;
+ float rz;
+ float vx;
+ float vy;
+ float vz;
+ int discontinuityCount;
+ }
+ @FixedSize @VintfStability
parcelable HeartRate {
float bpm;
android.hardware.sensors.SensorStatus status;
diff --git a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl
index 4f3b5b2..3d7ab45 100644
--- a/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl
+++ b/sensors/aidl/aidl_api/android.hardware.sensors/current/android/hardware/sensors/SensorType.aidl
@@ -70,5 +70,6 @@
LOW_LATENCY_OFFBODY_DETECT = 34,
ACCELEROMETER_UNCALIBRATED = 35,
HINGE_ANGLE = 36,
+ HEAD_TRACKER = 37,
DEVICE_PRIVATE_BASE = 65536,
}
diff --git a/sensors/aidl/android/hardware/sensors/Event.aidl b/sensors/aidl/android/hardware/sensors/Event.aidl
index 6ef9acb..fd6a8cc 100644
--- a/sensors/aidl/android/hardware/sensors/Event.aidl
+++ b/sensors/aidl/android/hardware/sensors/Event.aidl
@@ -127,6 +127,11 @@
*/
Data data;
+ /**
+ * SensorType::HEAD_TRACKER
+ */
+ HeadTracker headTracker;
+
@FixedSize
@VintfStability
parcelable Vec4 {
@@ -156,6 +161,46 @@
float zBias;
}
+ /**
+ * Payload of the HEAD_TRACKER sensor type. Note that the axis
+ * definition of this sensor type differs from the rest of Android. See
+ * SensorType::HEAD_TRACKER for more information.
+ */
+ @FixedSize
+ @VintfStability
+ parcelable HeadTracker {
+ /**
+ * An Euler vector (rotation vector, i.e. a vector whose direction
+ * indicates the axis of rotation and magnitude indicates the angle
+ * to rotate around that axis) representing the transform from
+ * the (arbitrary, possibly slowly drifting) reference frame to the
+ * head frame. Expressed in radians. Magnitude of the vector must be
+ * in the range [0, pi], while the value of individual axes are
+ * in the range [-pi, pi].
+ */
+ float rx;
+ float ry;
+ float rz;
+
+ /**
+ * An Euler vector (rotation vector) representing the angular
+ * velocity of the head (relative to itself), in radians per second.
+ * The direction of this vector indicates the axis of rotation, and
+ * the magnitude indicates the rate of rotation.
+ */
+ float vx;
+ float vy;
+ float vz;
+
+ /**
+ * This value increments (or wraps around to 0) each time the
+ * reference frame is suddenly and significantly changed, for
+ * example if an orientation filter algorithm used for determining
+ * the orientation has had its state reset.
+ */
+ int discontinuityCount;
+ }
+
@FixedSize
@VintfStability
parcelable HeartRate {
diff --git a/sensors/aidl/android/hardware/sensors/SensorType.aidl b/sensors/aidl/android/hardware/sensors/SensorType.aidl
index 95c7a6a..01e6bee 100644
--- a/sensors/aidl/android/hardware/sensors/SensorType.aidl
+++ b/sensors/aidl/android/hardware/sensors/SensorType.aidl
@@ -142,6 +142,10 @@
* The rotation vector symbolizes the orientation of the device relative to
* the East-North-Up coordinates frame.
*
+ * Note that despite the name, SensorType::ROTATION_VECTOR uses
+ * quaternion representation, rather than the rotation vector representation
+ * (aka Euler vector) seen in SensorType::HEAD_TRACKER.
+ *
* Implement the non-wake-up version of this sensor and implement the
* wake-up version if the system possesses a wake up fifo.
*/
@@ -634,6 +638,35 @@
HINGE_ANGLE = 36,
/**
+ * HEAD_TRACKER
+ * reporting-mode: continuous
+ *
+ * A sensor of this type measures the orientation of a user's head relative
+ * to an arbitrary reference frame, and the rate of rotation.
+ *
+ * Events produced by this sensor follow a special head-centric coordinate
+ * frame, where:
+ * - The X axis crosses through the user's ears, with the positive X
+ * direction extending out of the user's right ear
+ * - The Y axis crosses from the back of the user's head through their
+ * nose, with the positive direction extending out of the nose, and the
+ * X/Y plane being nominally parallel to the ground when the user is
+ * upright and looking straight ahead
+ * - The Z axis crosses from the neck through the top of the user's head,
+ * with the positive direction extending out from the top of the head
+ *
+ * When this sensor type is exposed as a dynamic sensor through a
+ * communications channel that uses HID, such as Bluetooth or USB, as part
+ * of a device with audio output capability (e.g. headphones), then the
+ * DynamicSensorInfo::uuid field shall be set to contents of the HID
+ * Persistent Unique ID to permit association between the sensor and audio
+ * device. Accordingly, the HID Persistent Unique ID (Sensors Page 0x20,
+ * Usage ID 0x302) must be populated as a UUID in binary representation,
+ * following RFC 4122 byte order.
+ */
+ HEAD_TRACKER = 37,
+
+ /**
* Base for device manufacturers private sensor types.
* These sensor types can't be exposed in the SDK.
*/