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 c18529bb3f..0000000000 --- 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 -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 36f701ce2b..2d17e0fdea 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,7 +52,6 @@ interface IComposerClient { 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); 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 bad72fcb5a..ab77880daf 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 @@ parcelable LayerCommand { @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/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/LayerGenericMetadataKey.aidl deleted file mode 100644 index 73385d438c..0000000000 --- a/graphics/composer/aidl/aidl_api/android.hardware.graphics.composer3/current/android/hardware/graphics/composer3/LayerGenericMetadataKey.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 -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 LayerGenericMetadataKey { - String name; - boolean mandatory; -} 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 d0254ddf48..0000000000 --- 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 1b198924fb..ab7f39781e 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.DisplayIdentification; 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; @@ -368,20 +367,6 @@ interface IComposerClient { */ 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 diff --git a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerCommand.aidl index 761da9a2c5..44fd4dcb9a 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.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.GenericMetadata; import android.hardware.graphics.composer3.ParcelableBlendMode; import android.hardware.graphics.composer3.ParcelableComposition; import android.hardware.graphics.composer3.ParcelableDataspace; @@ -246,33 +245,6 @@ parcelable LayerCommand { */ @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/LayerGenericMetadataKey.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl deleted file mode 100644 index 17704b8d3c..0000000000 --- a/graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl +++ /dev/null @@ -1,31 +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; - -@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; -} 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 a3c81765a1..8a789e3ac1 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 @@ __attribute__((warn_unused_result)) bool translate( 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(in.mandatory); - return true; -} - } // namespace android::h2a 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 e8dd61c5a3..6638744547 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 @@ -841,28 +841,6 @@ TEST_P(GraphicsComposerAidlTest, setGameContentType) { Test_setContentType(ContentType::GAME, "GAME"); } -TEST_P(GraphicsComposerAidlTest, getLayerGenericMetadataKeys) { - std::vector keys; - EXPECT_TRUE(mComposerClient->getLayerGenericMetadataKeys(&keys).isOk()); - - std::regex reverseDomainName("^[a-zA-Z-]{2,}(\\.[a-zA-Z0-9-]+)+$"); - std::unordered_set 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()); 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 be31d7974c..5bab266fa3 100644 --- a/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h +++ b/graphics/composer/aidl/include/android/hardware/graphics/composer3/ComposerClientWriter.h @@ -211,15 +211,6 @@ class ComposerClientWriter { getLayerCommand(display, layer).floatColor.emplace(color); } - void setLayerGenericMetadata(int64_t display, int64_t layer, const std::string& key, - const bool mandatory, const std::vector& 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 7004955eae..263167ee29 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 @@ __attribute__((warn_unused_result)) bool translate( 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