Merge "composer: rename ClockMonotonicTimestamp.timestamp"
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/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 73385d4..0000000
--- 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 <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 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 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/LayerGenericMetadataKey.aidl b/graphics/composer/aidl/android/hardware/graphics/composer3/LayerGenericMetadataKey.aidl
deleted file mode 100644
index 17704b8..0000000
--- 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 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_TargetTest.cpp b/graphics/composer/aidl/android/hardware/graphics/composer3/vts/functional/VtsHalGraphicsComposer3_TargetTest.cpp
index e8dd61c..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
@@ -841,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());
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 be31d79..5bab266 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 @@
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/radio/aidl/vts/radio_network_response.cpp b/radio/aidl/vts/radio_network_response.cpp
index 64f85c6..b242341 100644
--- a/radio/aidl/vts/radio_network_response.cpp
+++ b/radio/aidl/vts/radio_network_response.cpp
@@ -96,8 +96,11 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioNetworkResponse::getUsageSettingResponse(
- const RadioResponseInfo& /*info*/, const UsageSetting /*usageSetting*/) {
+ndk::ScopedAStatus RadioNetworkResponse::getUsageSettingResponse(const RadioResponseInfo& info,
+ const UsageSetting usageSetting) {
+ rspInfo = info;
+ this->usageSetting = usageSetting;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
@@ -195,8 +198,9 @@
return ndk::ScopedAStatus::ok();
}
-ndk::ScopedAStatus RadioNetworkResponse::setUsageSettingResponse(
- const RadioResponseInfo& /*info*/) {
+ndk::ScopedAStatus RadioNetworkResponse::setUsageSettingResponse(const RadioResponseInfo& info) {
+ rspInfo = info;
+ parent_network.notify(info.serial);
return ndk::ScopedAStatus::ok();
}
diff --git a/radio/aidl/vts/radio_network_test.cpp b/radio/aidl/vts/radio_network_test.cpp
index a8f87fc..1cdbb6d 100644
--- a/radio/aidl/vts/radio_network_test.cpp
+++ b/radio/aidl/vts/radio_network_test.cpp
@@ -146,4 +146,114 @@
radioRsp_network->rspInfo.error,
{RadioError::RADIO_NOT_AVAILABLE, RadioError::INTERNAL_ERR, RadioError::NONE}));
}
-}
\ No newline at end of file
+}
+
+void RadioNetworkTest::invokeAndExpectResponse(
+ std::function<ndk::ScopedAStatus(int32_t serial)> request,
+ std::vector<RadioError> errors_to_check) {
+ serial = GetRandomSerialNumber();
+
+ ndk::ScopedAStatus res = request(serial);
+ ASSERT_OK(res);
+
+ EXPECT_EQ(std::cv_status::no_timeout, wait());
+ EXPECT_EQ(RadioResponseType::SOLICITED, radioRsp_network->rspInfo.type);
+ EXPECT_EQ(serial, radioRsp_network->rspInfo.serial);
+ ASSERT_TRUE(CheckAnyOfErrors(radioRsp_network->rspInfo.error, errors_to_check));
+}
+
+/*
+ * Test IRadioNetwork.getUsageSetting()
+ *
+ * Verify that the usage setting can be retrieved.
+ */
+TEST_P(RadioNetworkTest, getUsageSetting) {
+ invokeAndExpectResponse([&](int serial) { return radio_network->getUsageSetting(serial); },
+ {RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_STATE,
+ RadioError::SIM_ABSENT, RadioError::INTERNAL_ERR, RadioError::NONE});
+
+ ASSERT_TRUE(radioRsp_network->usageSetting == UsageSetting::VOICE_CENTRIC ||
+ radioRsp_network->usageSetting == UsageSetting::DATA_CENTRIC);
+}
+
+void RadioNetworkTest::testSetUsageSetting_InvalidValues(std::vector<RadioError> errors) {
+ invokeAndExpectResponse(
+ [&](int serial) {
+ return radio_network->setUsageSetting(serial,
+ UsageSetting(0) /*below valid range*/);
+ },
+ errors);
+ invokeAndExpectResponse(
+ [&](int serial) {
+ return radio_network->setUsageSetting(serial, UsageSetting(-1) /*negative*/);
+ },
+ errors);
+ invokeAndExpectResponse(
+ [&](int serial) {
+ return radio_network->setUsageSetting(serial,
+ UsageSetting(3) /*above valid range*/);
+ },
+ errors);
+}
+
+/*
+ * Test IRadioNetwork.setUsageSetting() and IRadioNetwork.getUsageSetting()
+ *
+ * Verify the following:
+ * -That the usage setting can be retrieved.
+ * -That the usage setting can be successfully set to allowed values.
+ * -That the usage setting cannot be set to invalid values.
+ */
+TEST_P(RadioNetworkTest, setUsageSetting) {
+ invokeAndExpectResponse([&](int serial) { return radio_network->getUsageSetting(serial); },
+ {RadioError::RADIO_NOT_AVAILABLE, RadioError::INVALID_STATE,
+ RadioError::SIM_ABSENT, RadioError::INTERNAL_ERR, RadioError::NONE});
+
+ if (radioRsp_network->rspInfo.error != RadioError::NONE) {
+ // Test only for invalid values, with the only allowable response being the same error
+ // that was previously provided, or an error indicating invalid arguments.
+ testSetUsageSetting_InvalidValues(
+ {radioRsp_network->rspInfo.error, RadioError::INVALID_ARGUMENTS});
+ // It is unsafe to proceed with setting valid values without knowing the starting value, but
+ // we expect errors anyway, so not necessary.
+ return;
+ } else {
+ // Because querying succeeded, the device is in a valid state to test for invalid values
+ // and the only thing that can change is that we expect to have an EINVAL return each time.
+ testSetUsageSetting_InvalidValues({RadioError::INVALID_ARGUMENTS});
+ }
+
+ // Store the original setting value to reset later.
+ const UsageSetting originalSetting = radioRsp_network->usageSetting;
+
+ // Choose the "other" value that is not the current value for test.
+ const UsageSetting testSetting = radioRsp_network->usageSetting == UsageSetting::VOICE_CENTRIC
+ ? UsageSetting::DATA_CENTRIC
+ : UsageSetting::VOICE_CENTRIC;
+
+ // Set an alternative setting; it may either succeed or be disallowed as out of range for
+ // the current device (if the device only supports its current mode).
+ invokeAndExpectResponse(
+ [&](int serial) { return radio_network->setUsageSetting(serial, testSetting); },
+ {RadioError::INVALID_ARGUMENTS, RadioError::NONE});
+
+ // If there was no error, then we expect the test setting to be set, or if there is an error
+ // we expect the original setting to be maintained.
+ const UsageSetting expectedSetting =
+ radioRsp_network->rspInfo.error == RadioError::NONE ? testSetting : originalSetting;
+ invokeAndExpectResponse([&](int serial) { return radio_network->getUsageSetting(serial); },
+ {RadioError::NONE});
+
+ const UsageSetting updatedSetting = radioRsp_network->usageSetting;
+
+ // Re-set the original setting, which must always succeed.
+ invokeAndExpectResponse(
+ [&](int serial) { return radio_network->setUsageSetting(serial, originalSetting); },
+ {RadioError::NONE});
+
+ // Check that indeed the updated setting was set. We do this after resetting to original
+ // conditions to avoid early-exiting the test and leaving the device in a modified state.
+ ASSERT_TRUE(expectedSetting == updatedSetting);
+ // Check that indeed the original setting was reset.
+ ASSERT_TRUE(originalSetting == radioRsp_network->usageSetting);
+}
diff --git a/radio/aidl/vts/radio_network_utils.h b/radio/aidl/vts/radio_network_utils.h
index 26fce01..caa1ecc 100644
--- a/radio/aidl/vts/radio_network_utils.h
+++ b/radio/aidl/vts/radio_network_utils.h
@@ -43,6 +43,7 @@
RegStateResult regStateResp;
CellIdentity barringCellIdentity;
std::vector<BarringInfo> barringInfos;
+ UsageSetting usageSetting;
virtual ndk::ScopedAStatus acknowledgeRequest(int32_t serial) override;
@@ -211,4 +212,10 @@
std::shared_ptr<RadioNetworkResponse> radioRsp_network;
/* radio network indication handle */
std::shared_ptr<RadioNetworkIndication> radioInd_network;
+
+ void invokeAndExpectResponse(std::function<ndk::ScopedAStatus(int32_t serial)> request,
+ std::vector<RadioError> errors_to_check);
+
+ // Helper function to reduce copy+paste
+ void testSetUsageSetting_InvalidValues(std::vector<RadioError> errors);
};
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioStreamType.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioStreamType.aidl
index bfd2aa8..6c538ea 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioStreamType.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/AudioStreamType.aidl
@@ -51,4 +51,8 @@
OPUS = 13,
VORBIS = 14,
DRA = 15,
+ AAC_ADTS = 16,
+ AAC_LATM = 17,
+ AAC_HE_ADTS = 18,
+ AAC_HE_LATM = 19,
}
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl
index 993c639..61a9555 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl
@@ -48,4 +48,5 @@
int mpuSequenceNumber;
boolean isPesPrivateData;
android.hardware.tv.tuner.DemuxFilterMediaEventExtraMetaData extraMetaData;
+ android.hardware.tv.tuner.DemuxFilterScIndexMask scIndexMask;
}
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl
index ed5b0c0..e7aa070 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/IFrontend.aidl
@@ -43,7 +43,7 @@
void stopScan();
android.hardware.tv.tuner.FrontendStatus[] getStatus(in android.hardware.tv.tuner.FrontendStatusType[] statusTypes);
void setLnb(in int lnbId);
- void setLna(in boolean bEnable);
int linkCiCam(in int ciCamId);
void unlinkCiCam(in int ciCamId);
+ String getHardwareInfo();
}
diff --git a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl
index 0e903d8..decf5b1 100644
--- a/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl
+++ b/tv/tuner/aidl/aidl_api/android.hardware.tv.tuner/current/android/hardware/tv/tuner/ITuner.aidl
@@ -44,4 +44,5 @@
int[] getLnbIds();
android.hardware.tv.tuner.ILnb openLnbById(in int lnbId);
android.hardware.tv.tuner.ILnb openLnbByName(in String lnbName, out int[] lnbId);
+ void setLna(in boolean bEnable);
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/AudioStreamType.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/AudioStreamType.aidl
index 1bb5c68f..9e9a8cf 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/AudioStreamType.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/AudioStreamType.aidl
@@ -99,4 +99,24 @@
* SJ/T 11368-2006
*/
DRA,
+
+ /*
+ * AAC with ADTS (Audio Data Transport Format).
+ */
+ AAC_ADTS,
+
+ /*
+ * AAC with ADTS with LATM (Low-overhead MPEG-4 Audio Transport Multiplex).
+ */
+ AAC_LATM,
+
+ /*
+ * High-Efficiency AAC (HE-AAC) with ADTS (Audio Data Transport Format).
+ */
+ AAC_HE_ADTS,
+
+ /*
+ * High-Efficiency AAC (HE-AAC) with LATM (Low-overhead MPEG-4 Audio Transport Multiplex).
+ */
+ AAC_HE_LATM,
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl
index e92b711..32f0cb2 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/DemuxFilterMediaEvent.aidl
@@ -19,6 +19,7 @@
import android.hardware.common.NativeHandle;
import android.hardware.tv.tuner.DemuxFilterMediaEventExtraMetaData;
+import android.hardware.tv.tuner.DemuxFilterScIndexMask;
/**
* Filter Event for Audio or Video Filter.
@@ -84,4 +85,10 @@
boolean isPesPrivateData;
DemuxFilterMediaEventExtraMetaData extraMetaData;
+
+ /**
+ * DemuxFilterScIndexMask for the key frame info. It's optional to hardware which can only
+ * access unit framing at decode stage.
+ */
+ DemuxFilterScIndexMask scIndexMask;
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl
index b2717db..5b3ce39 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/IFrontend.aidl
@@ -117,13 +117,6 @@
void setLnb(in int lnbId);
/**
- * Enable or Disable Low Noise Amplifier (LNA).
- *
- * @param bEnable true if activate LNA module; false if deactivate LNA
- */
- void setLna(in boolean bEnable);
-
- /**
* Link Conditional Access Modules (CAM) to Frontend support Common
* Interface (CI) bypass mode.
*
@@ -143,4 +136,14 @@
* @param ciCamId specify CI-CAM Id to unlink.
*/
void unlinkCiCam(in int ciCamId);
+
+ /**
+ * Request Hardware information about the frontend.
+ *
+ * The client may use this to collect vendor specific hardware information, e.g. RF
+ * chip version, Demod chip version, detailed status of dvbs blind scan, etc.
+ *
+ * @return the frontend hardware information.
+ */
+ String getHardwareInfo();
}
diff --git a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl
index ab8b0b8..1fcbb06 100644
--- a/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl
+++ b/tv/tuner/aidl/android/hardware/tv/tuner/ITuner.aidl
@@ -120,4 +120,11 @@
* @return the newly opened Lnb iterface.
*/
ILnb openLnbByName(in String lnbName, out int[] lnbId);
+
+ /**
+ * Enable or Disable Low Noise Amplifier (LNA).
+ *
+ * @param bEnable true if activate LNA module; false if deactivate LNA
+ */
+ void setLna(in boolean bEnable);
}
diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp
index c1b8b5d..d36841c 100644
--- a/tv/tuner/aidl/default/Frontend.cpp
+++ b/tv/tuner/aidl/default/Frontend.cpp
@@ -703,12 +703,6 @@
return ::ndk::ScopedAStatus::ok();
}
-::ndk::ScopedAStatus Frontend::setLna(bool /* in_bEnable */) {
- ALOGV("%s", __FUNCTION__);
-
- return ::ndk::ScopedAStatus::ok();
-}
-
::ndk::ScopedAStatus Frontend::setLnb(int32_t /* in_lnbId */) {
ALOGV("%s", __FUNCTION__);
if (!supportsSatellite()) {
@@ -743,6 +737,13 @@
return STATUS_OK;
}
+::ndk::ScopedAStatus Frontend::getHardwareInfo(std::string* _aidl_return) {
+ ALOGV("%s", __FUNCTION__);
+
+ *_aidl_return = "Sample Frontend";
+ return ::ndk::ScopedAStatus::ok();
+}
+
FrontendType Frontend::getFrontendType() {
return mType;
}
diff --git a/tv/tuner/aidl/default/Frontend.h b/tv/tuner/aidl/default/Frontend.h
index 5e7b10c..66ae901 100644
--- a/tv/tuner/aidl/default/Frontend.h
+++ b/tv/tuner/aidl/default/Frontend.h
@@ -46,9 +46,9 @@
::ndk::ScopedAStatus getStatus(const std::vector<FrontendStatusType>& in_statusTypes,
std::vector<FrontendStatus>* _aidl_return) override;
::ndk::ScopedAStatus setLnb(int32_t in_lnbId) override;
- ::ndk::ScopedAStatus setLna(bool in_bEnable) override;
::ndk::ScopedAStatus linkCiCam(int32_t in_ciCamId, int32_t* _aidl_return) override;
::ndk::ScopedAStatus unlinkCiCam(int32_t in_ciCamId) override;
+ ::ndk::ScopedAStatus getHardwareInfo(std::string* _aidl_return) override;
binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
diff --git a/tv/tuner/aidl/default/Tuner.cpp b/tv/tuner/aidl/default/Tuner.cpp
index 9e81177..45f3dfa 100644
--- a/tv/tuner/aidl/default/Tuner.cpp
+++ b/tv/tuner/aidl/default/Tuner.cpp
@@ -318,6 +318,12 @@
return ::ndk::ScopedAStatus::ok();
}
+::ndk::ScopedAStatus Tuner::setLna(bool /* in_bEnable */) {
+ ALOGV("%s", __FUNCTION__);
+
+ return ::ndk::ScopedAStatus::ok();
+}
+
binder_status_t Tuner::dump(int fd, const char** args, uint32_t numArgs) {
ALOGV("%s", __FUNCTION__);
{
diff --git a/tv/tuner/aidl/default/Tuner.h b/tv/tuner/aidl/default/Tuner.h
index 682496c..b33a1be 100644
--- a/tv/tuner/aidl/default/Tuner.h
+++ b/tv/tuner/aidl/default/Tuner.h
@@ -56,6 +56,7 @@
::ndk::ScopedAStatus openLnbByName(const std::string& in_lnbName,
std::vector<int32_t>* out_lnbId,
std::shared_ptr<ILnb>* _aidl_return) override;
+ ::ndk::ScopedAStatus setLna(bool in_bEnable) override;
binder_status_t dump(int fd, const char** args, uint32_t numArgs) override;
diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.cpp b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
index f24dea1..075ffad 100644
--- a/tv/tuner/aidl/vts/functional/FrontendTests.cpp
+++ b/tv/tuner/aidl/vts/functional/FrontendTests.cpp
@@ -484,6 +484,13 @@
feId = INVALID_ID;
}
+AssertionResult FrontendTests::verifyHardwareInfo() {
+ EXPECT_TRUE(mFrontend) << "Test with openFrontendById first.";
+ std::string info;
+ ndk::ScopedAStatus status = mFrontend->getHardwareInfo(&info);
+ return AssertionResult(status.isOk() && !info.empty());
+}
+
void FrontendTests::tuneTest(FrontendConfig frontendConf) {
int32_t feId;
getFrontendIdByType(frontendConf.type, feId);
@@ -500,6 +507,18 @@
ASSERT_TRUE(closeFrontend());
}
+void FrontendTests::debugInfoTest(FrontendConfig frontendConf) {
+ int32_t feId;
+ getFrontendIdByType(frontendConf.type, feId);
+ ASSERT_TRUE(feId != INVALID_ID);
+ ASSERT_TRUE(openFrontendById(feId));
+ ASSERT_TRUE(setFrontendCallback());
+ ASSERT_TRUE(tuneFrontend(frontendConf, false /*testWithDemux*/));
+ ASSERT_TRUE(verifyHardwareInfo());
+ ASSERT_TRUE(stopTuneFrontend(false /*testWithDemux*/));
+ ASSERT_TRUE(closeFrontend());
+}
+
void FrontendTests::scanTest(FrontendConfig frontendConf, FrontendScanType scanType) {
int32_t feId;
getFrontendIdByType(frontendConf.type, feId);
diff --git a/tv/tuner/aidl/vts/functional/FrontendTests.h b/tv/tuner/aidl/vts/functional/FrontendTests.h
index e5a9cd3..8f769a0 100644
--- a/tv/tuner/aidl/vts/functional/FrontendTests.h
+++ b/tv/tuner/aidl/vts/functional/FrontendTests.h
@@ -94,10 +94,12 @@
AssertionResult linkCiCam(int32_t ciCamId);
AssertionResult unlinkCiCam(int32_t ciCamId);
+ AssertionResult verifyHardwareInfo();
void getFrontendIdByType(FrontendType feType, int32_t& feId);
void tuneTest(FrontendConfig frontendConf);
void scanTest(FrontendConfig frontend, FrontendScanType type);
+ void debugInfoTest(FrontendConfig frontendConf);
void setDvrTests(DvrTests* dvrTests) { mExternalDvrTests = dvrTests; }
void setDemux(std::shared_ptr<IDemux> demux) { getDvrTests()->setDemux(demux); }
diff --git a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp
index 89e42df..202f83f 100644
--- a/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp
+++ b/tv/tuner/aidl/vts/functional/VtsHalTvTunerTargetTest.cpp
@@ -883,6 +883,14 @@
mFrontendTests.tuneTest(frontendMap[live.frontendId]);
}
+TEST_P(TunerFrontendAidlTest, getHardwareInfo) {
+ description("Test Frontend get hardware info");
+ if (!live.hasFrontendConnection) {
+ return;
+ }
+ mFrontendTests.debugInfoTest(frontendMap[live.frontendId]);
+}
+
TEST_P(TunerBroadcastAidlTest, BroadcastDataFlowVideoFilterTest) {
description("Test Video Filter functionality in Broadcast use case.");
if (!live.hasFrontendConnection) {
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();
}
};