mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Merge changes from topic "revert-1431616-thirtytwo-QKCUUIXLZL" am: 4737502679 am: 7fe9553d96 am: 786b335242 am: efb41275bd
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/1433255 Change-Id: Ib16b8ee6fe107e63fc054f26992e779e1a56bda9
This commit is contained in:
@@ -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,
|
|
||||||
}
|
|
||||||
@@ -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,
|
|
||||||
}
|
|
||||||
@@ -22,12 +22,9 @@ import android.hardware.common.GrantorDescriptor;
|
|||||||
* For use with libfmq. This is created from an instance of AidlMessageQueue,
|
* 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
|
* and is used to pass information required to create another instance of that
|
||||||
* queue for fast communication.
|
* 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
|
@VintfStability
|
||||||
parcelable MQDescriptor<T, Flavor> {
|
parcelable MQDescriptor {
|
||||||
/*
|
/*
|
||||||
* Describes each of the grantors for the message queue. They are used to
|
* Describes each of the grantors for the message queue. They are used to
|
||||||
* get the readptr, writeptr, dataptr, and the optional EventFlag word
|
* get the readptr, writeptr, dataptr, and the optional EventFlag word
|
||||||
|
|||||||
@@ -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,
|
|
||||||
}
|
|
||||||
@@ -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,
|
|
||||||
}
|
|
||||||
@@ -31,7 +31,7 @@ interface ITestMsgQ {
|
|||||||
*
|
*
|
||||||
* @return ret True if the setup is successful.
|
* @return ret True if the setup is successful.
|
||||||
*/
|
*/
|
||||||
configureFmqSyncReadWrite(fmq_sync<int32_t> mqDesc) generates(bool ret);
|
configureFmqSyncReadWrite(fmq_sync<uint16_t> mqDesc) generates(bool ret);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method requests the service to return an MQDescriptor to
|
* 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
|
* @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.
|
* 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<int32_t> mqDesc);
|
getFmqUnsyncWrite(bool configureFmq) generates(bool ret, fmq_unsync<uint16_t> mqDesc);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This method request the service to write into the synchronized read/write
|
* This method request the service to write into the synchronized read/write
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ namespace implementation {
|
|||||||
|
|
||||||
// Methods from ::android::hardware::tests::msgq::V1_0::ITestMsgQ follow.
|
// Methods from ::android::hardware::tests::msgq::V1_0::ITestMsgQ follow.
|
||||||
Return<bool> TestMsgQ::configureFmqSyncReadWrite(
|
Return<bool> TestMsgQ::configureFmqSyncReadWrite(
|
||||||
const android::hardware::MQDescriptorSync<int32_t>& mqDesc) {
|
const android::hardware::MQDescriptorSync<uint16_t>& mqDesc) {
|
||||||
mFmqSynchronized.reset(new (std::nothrow) MessageQueueSync(mqDesc));
|
mFmqSynchronized.reset(new (std::nothrow) MessageQueueSync(mqDesc));
|
||||||
if ((mFmqSynchronized == nullptr) || (mFmqSynchronized->isValid() == false)) {
|
if ((mFmqSynchronized == nullptr) || (mFmqSynchronized->isValid() == false)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -56,7 +56,7 @@ Return<void> TestMsgQ::getFmqUnsyncWrite(bool configureFmq, getFmqUnsyncWrite_cb
|
|||||||
}
|
}
|
||||||
|
|
||||||
Return<bool> TestMsgQ::requestWriteFmqSync(int32_t count) {
|
Return<bool> TestMsgQ::requestWriteFmqSync(int32_t count) {
|
||||||
std::vector<int32_t> data(count);
|
std::vector<uint16_t> data(count);
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
data[i] = i;
|
data[i] = i;
|
||||||
}
|
}
|
||||||
@@ -65,14 +65,14 @@ Return<bool> TestMsgQ::requestWriteFmqSync(int32_t count) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Return<bool> TestMsgQ::requestReadFmqSync(int32_t count) {
|
Return<bool> TestMsgQ::requestReadFmqSync(int32_t count) {
|
||||||
std::vector<int32_t> data(count);
|
std::vector<uint16_t> data(count);
|
||||||
bool result = mFmqSynchronized->read(&data[0], count)
|
bool result = mFmqSynchronized->read(&data[0], count)
|
||||||
&& verifyData(&data[0], count);
|
&& verifyData(&data[0], count);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Return<bool> TestMsgQ::requestWriteFmqUnsync(int32_t count) {
|
Return<bool> TestMsgQ::requestWriteFmqUnsync(int32_t count) {
|
||||||
std::vector<int32_t> data(count);
|
std::vector<uint16_t> data(count);
|
||||||
for (int i = 0; i < count; i++) {
|
for (int i = 0; i < count; i++) {
|
||||||
data[i] = i;
|
data[i] = i;
|
||||||
}
|
}
|
||||||
@@ -81,14 +81,14 @@ Return<bool> TestMsgQ::requestWriteFmqUnsync(int32_t count) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Return<bool> TestMsgQ::requestReadFmqUnsync(int32_t count) {
|
Return<bool> TestMsgQ::requestReadFmqUnsync(int32_t count) {
|
||||||
std::vector<int32_t> data(count);
|
std::vector<uint16_t> data(count);
|
||||||
bool result =
|
bool result =
|
||||||
mFmqUnsynchronized->read(&data[0], count) && verifyData(&data[0], count);
|
mFmqUnsynchronized->read(&data[0], count) && verifyData(&data[0], count);
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
Return<void> TestMsgQ::requestBlockingRead(int32_t count) {
|
Return<void> TestMsgQ::requestBlockingRead(int32_t count) {
|
||||||
std::vector<int32_t> data(count);
|
std::vector<uint16_t> data(count);
|
||||||
bool result = mFmqSynchronized->readBlocking(
|
bool result = mFmqSynchronized->readBlocking(
|
||||||
&data[0],
|
&data[0],
|
||||||
count,
|
count,
|
||||||
@@ -103,7 +103,7 @@ Return<void> TestMsgQ::requestBlockingRead(int32_t count) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Return<void> TestMsgQ::requestBlockingReadDefaultEventFlagBits(int32_t count) {
|
Return<void> TestMsgQ::requestBlockingReadDefaultEventFlagBits(int32_t count) {
|
||||||
std::vector<int32_t> data(count);
|
std::vector<uint16_t> data(count);
|
||||||
bool result = mFmqSynchronized->readBlocking(
|
bool result = mFmqSynchronized->readBlocking(
|
||||||
&data[0],
|
&data[0],
|
||||||
count);
|
count);
|
||||||
@@ -116,7 +116,7 @@ Return<void> TestMsgQ::requestBlockingReadDefaultEventFlagBits(int32_t count) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Return<void> TestMsgQ::requestBlockingReadRepeat(int32_t count, int32_t numIter) {
|
Return<void> TestMsgQ::requestBlockingReadRepeat(int32_t count, int32_t numIter) {
|
||||||
std::vector<int32_t> data(count);
|
std::vector<uint16_t> data(count);
|
||||||
for (int i = 0; i < numIter; i++) {
|
for (int i = 0; i < numIter; i++) {
|
||||||
bool result = mFmqSynchronized->readBlocking(
|
bool result = mFmqSynchronized->readBlocking(
|
||||||
&data[0],
|
&data[0],
|
||||||
|
|||||||
@@ -49,13 +49,13 @@ using android::hardware::MQDescriptorUnsync;
|
|||||||
using android::hardware::MessageQueue;
|
using android::hardware::MessageQueue;
|
||||||
|
|
||||||
struct TestMsgQ : public ITestMsgQ {
|
struct TestMsgQ : public ITestMsgQ {
|
||||||
typedef MessageQueue<int32_t, kSynchronizedReadWrite> MessageQueueSync;
|
typedef MessageQueue<uint16_t, kSynchronizedReadWrite> MessageQueueSync;
|
||||||
typedef MessageQueue<int32_t, kUnsynchronizedWrite> MessageQueueUnsync;
|
typedef MessageQueue<uint16_t, kUnsynchronizedWrite> MessageQueueUnsync;
|
||||||
|
|
||||||
TestMsgQ() : mFmqSynchronized(nullptr), mFmqUnsynchronized(nullptr) {}
|
TestMsgQ() : mFmqSynchronized(nullptr), mFmqUnsynchronized(nullptr) {}
|
||||||
|
|
||||||
// Methods from ::android::hardware::tests::msgq::V1_0::ITestMsgQ follow.
|
// Methods from ::android::hardware::tests::msgq::V1_0::ITestMsgQ follow.
|
||||||
Return<bool> configureFmqSyncReadWrite(const MQDescriptorSync<int32_t>& mqDesc) override;
|
Return<bool> configureFmqSyncReadWrite(const MQDescriptorSync<uint16_t>& mqDesc) override;
|
||||||
Return<void> getFmqUnsyncWrite(bool configureFmq, getFmqUnsyncWrite_cb _hidl_cb) override;
|
Return<void> getFmqUnsyncWrite(bool configureFmq, getFmqUnsyncWrite_cb _hidl_cb) override;
|
||||||
Return<bool> requestWriteFmqSync(int32_t count) override;
|
Return<bool> requestWriteFmqSync(int32_t count) override;
|
||||||
Return<bool> requestReadFmqSync(int32_t count) override;
|
Return<bool> requestReadFmqSync(int32_t count) override;
|
||||||
@@ -73,7 +73,7 @@ private:
|
|||||||
/*
|
/*
|
||||||
* Utility function to verify data read from the fast message queue.
|
* 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++) {
|
for (int i = 0; i < count; i++) {
|
||||||
if (data[i] != i) return false;
|
if (data[i] != i) return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user