Force FilterClient to NOT reset the FMQ pointer when creating the MQ

Previously we created the Filter FMQ from the AIDL MQ Descriptor after
it is passed from the TunerService to the client side.
But the default creation would reset the mq pointer.
Since we only get the mq when read operation is executed on the filter,
the mq could have already been writtern. The default creation would
reset the pointer and erase the data.

Test: atest TunerTest
Bug: 185542142
Change-Id: I56a09e30b0cfbf9fadcaa7f0c7ef1ac6a6d601b1
This commit is contained in:
Amy Zhang
2021-04-15 21:36:20 -07:00
parent 5c00142fe0
commit 2aa9fa55cc

View File

@@ -921,7 +921,7 @@ Result FilterClient::getFilterMq() {
Status s = mTunerFilter->getQueueDesc(&aidlMqDesc);
res = ClientHelper::getServiceSpecificErrorCode(s);
if (res == Result::SUCCESS) {
mFilterMQ = new (nothrow) AidlMQ(aidlMqDesc);
mFilterMQ = new (nothrow) AidlMQ(aidlMqDesc, false/*resetPointer*/);
EventFlag::createEventFlag(mFilterMQ->getEventFlagWord(), &mFilterMQEventFlag);
}
return res;
@@ -938,7 +938,7 @@ Result FilterClient::getFilterMq() {
AidlMQDesc aidlMQDesc;
unsafeHidlToAidlMQDescriptor<uint8_t, int8_t, SynchronizedReadWrite>(
filterMQDesc, &aidlMQDesc);
mFilterMQ = new (nothrow) AidlMessageQueue(aidlMQDesc);
mFilterMQ = new (nothrow) AidlMessageQueue(aidlMQDesc, false/*resetPointer*/);
EventFlag::createEventFlag(mFilterMQ->getEventFlagWord(), &mFilterMQEventFlag);
}
}