From b26628ac32fa48f414ad321a4964675b4ad59de4 Mon Sep 17 00:00:00 2001 From: Diego Wilson Date: Mon, 21 Sep 2020 19:36:49 +0000 Subject: [PATCH 1/2] Revert "Add template parameters to MQDescriptor" Revert "Change payload type to int32_t for fmq device tests" Revert submission 1431616-thirtytwo Reason for revert: This topic broke the aosp_x86-userdebug target. Details at http://b/169077648 Reverted Changes: If736389eb:Add template parameters to MQDescriptor Ice9c28c3d:Change HIDL fmq tests to use int32_t for payload Ia18d8459b:Add template arguments to MQDescriptor for AIDL I95586cc83:Change payload type to int32_t for fmq device test... Change-Id: Ib7c409b164c76517d642a415cdfc2406e4f2f351 --- .../common/SynchronizedReadWrite.aidl | 22 --------------- .../hardware/common/UnsynchronizedWrite.aidl | 22 --------------- .../android/hardware/common/MQDescriptor.aidl | 5 +--- .../common/SynchronizedReadWrite.aidl | 27 ------------------- .../hardware/common/UnsynchronizedWrite.aidl | 27 ------------------- 5 files changed, 1 insertion(+), 102 deletions(-) delete mode 100644 common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/SynchronizedReadWrite.aidl delete mode 100644 common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/UnsynchronizedWrite.aidl delete mode 100644 common/aidl/android/hardware/common/SynchronizedReadWrite.aidl delete mode 100644 common/aidl/android/hardware/common/UnsynchronizedWrite.aidl diff --git a/common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/SynchronizedReadWrite.aidl b/common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/SynchronizedReadWrite.aidl deleted file mode 100644 index aec3d6dfd3..0000000000 --- a/common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/SynchronizedReadWrite.aidl +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. -// -// You must not make a backward incompatible changes to the AIDL files 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.common; -@VintfStability -enum SynchronizedReadWrite { - EMPTY = 0, -} diff --git a/common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/UnsynchronizedWrite.aidl b/common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/UnsynchronizedWrite.aidl deleted file mode 100644 index e390d20bce..0000000000 --- a/common/aidl/aidl_api/android.hardware.common/current/android/hardware/common/UnsynchronizedWrite.aidl +++ /dev/null @@ -1,22 +0,0 @@ -/////////////////////////////////////////////////////////////////////////////// -// THIS FILE IS IMMUTABLE. DO NOT EDIT IN ANY CASE. // -/////////////////////////////////////////////////////////////////////////////// - -// This file is a snapshot of an AIDL interface (or parcelable). Do not try to -// edit this file. It looks like you are doing that because you have modified -// an AIDL interface in a backward-incompatible way, e.g., deleting a function -// from an interface or a field from a parcelable and it broke the build. That -// breakage is intended. -// -// You must not make a backward incompatible changes to the AIDL files 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.common; -@VintfStability -enum UnsynchronizedWrite { - EMPTY = 0, -} diff --git a/common/aidl/android/hardware/common/MQDescriptor.aidl b/common/aidl/android/hardware/common/MQDescriptor.aidl index 7e89b15f56..899768890e 100644 --- a/common/aidl/android/hardware/common/MQDescriptor.aidl +++ b/common/aidl/android/hardware/common/MQDescriptor.aidl @@ -22,12 +22,9 @@ import android.hardware.common.GrantorDescriptor; * For use with libfmq. This is created from an instance of AidlMessageQueue, * and is used to pass information required to create another instance of that * queue for fast communication. - * T - is used to specify the type of the payload - * Flavor - is used to specify the type of the queue using - * android.hardware.common.SynchronizedReadWrite or UnsynchronizedWrite */ @VintfStability -parcelable MQDescriptor { +parcelable MQDescriptor { /* * Describes each of the grantors for the message queue. They are used to * get the readptr, writeptr, dataptr, and the optional EventFlag word diff --git a/common/aidl/android/hardware/common/SynchronizedReadWrite.aidl b/common/aidl/android/hardware/common/SynchronizedReadWrite.aidl deleted file mode 100644 index ef93bf2aba..0000000000 --- a/common/aidl/android/hardware/common/SynchronizedReadWrite.aidl +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2020 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.common; - -/* - * For use with android.hardware.common.MQDescriptor to specify which type of - * queue to use. SynchronizedReadWrite is single reader, single writer, with no - * overflow. All messages written need to be read. - */ -@VintfStability -enum SynchronizedReadWrite { - EMPTY, -} diff --git a/common/aidl/android/hardware/common/UnsynchronizedWrite.aidl b/common/aidl/android/hardware/common/UnsynchronizedWrite.aidl deleted file mode 100644 index aa27c8d029..0000000000 --- a/common/aidl/android/hardware/common/UnsynchronizedWrite.aidl +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright 2020 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.common; - -/* - * For use with android.hardware.common.MQDescriptor to specify which type of - * queue to use. UnsynchronizedWrite is single writer, multiple reader, with - * overflow. If messages are not read fast enough, they can be overwritten. - */ -@VintfStability -enum UnsynchronizedWrite { - EMPTY, -} From 9719e2d984de2f2921e65566765e24a98ea22930 Mon Sep 17 00:00:00 2001 From: Diego Wilson Date: Mon, 21 Sep 2020 19:36:49 +0000 Subject: [PATCH 2/2] Revert "Change HIDL fmq tests to use int32_t for payload" Revert "Change payload type to int32_t for fmq device tests" Revert submission 1431616-thirtytwo Reason for revert: This topic broke the aosp_x86-userdebug target. Details at http://b/169077648 Reverted Changes: If736389eb:Add template parameters to MQDescriptor Ice9c28c3d:Change HIDL fmq tests to use int32_t for payload Ia18d8459b:Add template arguments to MQDescriptor for AIDL I95586cc83:Change payload type to int32_t for fmq device test... Change-Id: Iaf37a5dca7a915f098e49ecb076c0932eb60e0c3 --- tests/msgq/1.0/ITestMsgQ.hal | 4 ++-- tests/msgq/1.0/default/TestMsgQ.cpp | 16 ++++++++-------- tests/msgq/1.0/default/TestMsgQ.h | 8 ++++---- 3 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/msgq/1.0/ITestMsgQ.hal b/tests/msgq/1.0/ITestMsgQ.hal index bd10237c90..112270a9e8 100644 --- a/tests/msgq/1.0/ITestMsgQ.hal +++ b/tests/msgq/1.0/ITestMsgQ.hal @@ -31,7 +31,7 @@ interface ITestMsgQ { * * @return ret True if the setup is successful. */ - configureFmqSyncReadWrite(fmq_sync mqDesc) generates(bool ret); + configureFmqSyncReadWrite(fmq_sync mqDesc) generates(bool ret); /** * This method requests the service to return an MQDescriptor to @@ -46,7 +46,7 @@ interface ITestMsgQ { * @return mqDesc This structure describes the unsynchronized FMQ that was * set up by the service. Client can use it to set up the FMQ at its end. */ - getFmqUnsyncWrite(bool configureFmq) generates(bool ret, fmq_unsync mqDesc); + getFmqUnsyncWrite(bool configureFmq) generates(bool ret, fmq_unsync mqDesc); /** * This method request the service to write into the synchronized read/write diff --git a/tests/msgq/1.0/default/TestMsgQ.cpp b/tests/msgq/1.0/default/TestMsgQ.cpp index 44737378b3..ba665c9204 100644 --- a/tests/msgq/1.0/default/TestMsgQ.cpp +++ b/tests/msgq/1.0/default/TestMsgQ.cpp @@ -25,7 +25,7 @@ namespace implementation { // Methods from ::android::hardware::tests::msgq::V1_0::ITestMsgQ follow. Return TestMsgQ::configureFmqSyncReadWrite( - const android::hardware::MQDescriptorSync& mqDesc) { + const android::hardware::MQDescriptorSync& mqDesc) { mFmqSynchronized.reset(new (std::nothrow) MessageQueueSync(mqDesc)); if ((mFmqSynchronized == nullptr) || (mFmqSynchronized->isValid() == false)) { return false; @@ -56,7 +56,7 @@ Return TestMsgQ::getFmqUnsyncWrite(bool configureFmq, getFmqUnsyncWrite_cb } Return TestMsgQ::requestWriteFmqSync(int32_t count) { - std::vector data(count); + std::vector data(count); for (int i = 0; i < count; i++) { data[i] = i; } @@ -65,14 +65,14 @@ Return TestMsgQ::requestWriteFmqSync(int32_t count) { } Return TestMsgQ::requestReadFmqSync(int32_t count) { - std::vector data(count); + std::vector data(count); bool result = mFmqSynchronized->read(&data[0], count) && verifyData(&data[0], count); return result; } Return TestMsgQ::requestWriteFmqUnsync(int32_t count) { - std::vector data(count); + std::vector data(count); for (int i = 0; i < count; i++) { data[i] = i; } @@ -81,14 +81,14 @@ Return TestMsgQ::requestWriteFmqUnsync(int32_t count) { } Return TestMsgQ::requestReadFmqUnsync(int32_t count) { - std::vector data(count); + std::vector data(count); bool result = mFmqUnsynchronized->read(&data[0], count) && verifyData(&data[0], count); return result; } Return TestMsgQ::requestBlockingRead(int32_t count) { - std::vector data(count); + std::vector data(count); bool result = mFmqSynchronized->readBlocking( &data[0], count, @@ -103,7 +103,7 @@ Return TestMsgQ::requestBlockingRead(int32_t count) { } Return TestMsgQ::requestBlockingReadDefaultEventFlagBits(int32_t count) { - std::vector data(count); + std::vector data(count); bool result = mFmqSynchronized->readBlocking( &data[0], count); @@ -116,7 +116,7 @@ Return TestMsgQ::requestBlockingReadDefaultEventFlagBits(int32_t count) { } Return TestMsgQ::requestBlockingReadRepeat(int32_t count, int32_t numIter) { - std::vector data(count); + std::vector data(count); for (int i = 0; i < numIter; i++) { bool result = mFmqSynchronized->readBlocking( &data[0], diff --git a/tests/msgq/1.0/default/TestMsgQ.h b/tests/msgq/1.0/default/TestMsgQ.h index 8a204b725d..f9fcddd4bc 100644 --- a/tests/msgq/1.0/default/TestMsgQ.h +++ b/tests/msgq/1.0/default/TestMsgQ.h @@ -49,13 +49,13 @@ using android::hardware::MQDescriptorUnsync; using android::hardware::MessageQueue; struct TestMsgQ : public ITestMsgQ { - typedef MessageQueue MessageQueueSync; - typedef MessageQueue MessageQueueUnsync; + typedef MessageQueue MessageQueueSync; + typedef MessageQueue MessageQueueUnsync; TestMsgQ() : mFmqSynchronized(nullptr), mFmqUnsynchronized(nullptr) {} // Methods from ::android::hardware::tests::msgq::V1_0::ITestMsgQ follow. - Return configureFmqSyncReadWrite(const MQDescriptorSync& mqDesc) override; + Return configureFmqSyncReadWrite(const MQDescriptorSync& mqDesc) override; Return getFmqUnsyncWrite(bool configureFmq, getFmqUnsyncWrite_cb _hidl_cb) override; Return requestWriteFmqSync(int32_t count) override; Return requestReadFmqSync(int32_t count) override; @@ -73,7 +73,7 @@ private: /* * Utility function to verify data read from the fast message queue. */ - bool verifyData(int32_t* data, int count) { + bool verifyData(uint16_t* data, int count) { for (int i = 0; i < count; i++) { if (data[i] != i) return false; }