Moved AIDL types to new android.hardware.common.fmq package

Needed to handle the move from android.hardware.common to
android.hardware.common.fmq.

Test: atest fmq_test fmq_unit_test
Bug: 142326204
Change-Id: I092e180f2e5082ba541809d15529036f90f19d44
diff --git a/include/fmq/AidlMQDescriptorShim.h b/include/fmq/AidlMQDescriptorShim.h
index eb4bbc2..97b3fa7 100644
--- a/include/fmq/AidlMQDescriptorShim.h
+++ b/include/fmq/AidlMQDescriptorShim.h
@@ -14,7 +14,7 @@
  * limitations under the License.
  */
 
-#include <aidl/android/hardware/common/MQDescriptor.h>
+#include <aidl/android/hardware/common/fmq/MQDescriptor.h>
 #include <cutils/native_handle.h>
 #include <fmq/MQDescriptorBase.h>
 #include <limits>
@@ -23,10 +23,10 @@
 namespace android {
 namespace details {
 
-using aidl::android::hardware::common::GrantorDescriptor;
-using aidl::android::hardware::common::MQDescriptor;
-using aidl::android::hardware::common::SynchronizedReadWrite;
-using aidl::android::hardware::common::UnsynchronizedWrite;
+using aidl::android::hardware::common::fmq::GrantorDescriptor;
+using aidl::android::hardware::common::fmq::MQDescriptor;
+using aidl::android::hardware::common::fmq::SynchronizedReadWrite;
+using aidl::android::hardware::common::fmq::UnsynchronizedWrite;
 using android::hardware::MQFlavor;
 
 template <typename T, MQFlavor flavor>
diff --git a/include/fmq/AidlMessageQueue.h b/include/fmq/AidlMessageQueue.h
index b7a33be..f1dd7e2 100644
--- a/include/fmq/AidlMessageQueue.h
+++ b/include/fmq/AidlMessageQueue.h
@@ -16,9 +16,9 @@
 
 #pragma once
 
-#include <aidl/android/hardware/common/MQDescriptor.h>
-#include <aidl/android/hardware/common/SynchronizedReadWrite.h>
-#include <aidl/android/hardware/common/UnsynchronizedWrite.h>
+#include <aidl/android/hardware/common/fmq/MQDescriptor.h>
+#include <aidl/android/hardware/common/fmq/SynchronizedReadWrite.h>
+#include <aidl/android/hardware/common/fmq/UnsynchronizedWrite.h>
 #include <cutils/native_handle.h>
 #include <fmq/AidlMQDescriptorShim.h>
 #include <fmq/MessageQueueBase.h>
@@ -27,9 +27,9 @@
 
 namespace android {
 
-using aidl::android::hardware::common::MQDescriptor;
-using aidl::android::hardware::common::SynchronizedReadWrite;
-using aidl::android::hardware::common::UnsynchronizedWrite;
+using aidl::android::hardware::common::fmq::MQDescriptor;
+using aidl::android::hardware::common::fmq::SynchronizedReadWrite;
+using aidl::android::hardware::common::fmq::UnsynchronizedWrite;
 using android::details::AidlMQDescriptorShim;
 using android::hardware::MQFlavor;
 
@@ -111,9 +111,9 @@
 MQDescriptor<T, U> AidlMessageQueue<T, U>::dupeDesc() {
     auto* shim = MessageQueueBase<AidlMQDescriptorShim, T, FlavorTypeToValue<U>::value>::getDesc();
     if (shim) {
-        std::vector<aidl::android::hardware::common::GrantorDescriptor> grantors;
+        std::vector<aidl::android::hardware::common::fmq::GrantorDescriptor> grantors;
         for (const auto& grantor : shim->grantors()) {
-            grantors.push_back(aidl::android::hardware::common::GrantorDescriptor{
+            grantors.push_back(aidl::android::hardware::common::fmq::GrantorDescriptor{
                     .offset = static_cast<int32_t>(grantor.offset),
                     .extent = static_cast<int64_t>(grantor.extent)});
         }
diff --git a/tests/Android.bp b/tests/Android.bp
index 0685ff4..957e4e1 100644
--- a/tests/Android.bp
+++ b/tests/Android.bp
@@ -53,7 +53,7 @@
     static_libs: [
         "android.hardware.tests.msgq@1.0",
         "android.fmq.test-ndk_platform",
-        "android.hardware.common-unstable-ndk_platform",
+        "android.hardware.common.fmq-unstable-ndk_platform",
     ],
     whole_static_libs: [
         "android.hardware.tests.msgq@1.0-impl",
@@ -86,7 +86,7 @@
         "libutils",
     ],
     static_libs: [
-        "android.hardware.common-unstable-ndk_platform",
+        "android.hardware.common.fmq-unstable-ndk_platform",
     ],
 
     cflags: [
diff --git a/tests/aidl/Android.bp b/tests/aidl/Android.bp
index 27b9827..b104cc2 100644
--- a/tests/aidl/Android.bp
+++ b/tests/aidl/Android.bp
@@ -7,7 +7,7 @@
         "android/fmq/test/*.aidl",
     ],
     imports: [
-        "android.hardware.common",
+        "android.hardware.common.fmq",
     ],
     gen_trace: true,
     backend: {
diff --git a/tests/aidl/android/fmq/test/ITestAidlMsgQ.aidl b/tests/aidl/android/fmq/test/ITestAidlMsgQ.aidl
index 6540ed3..96d9158 100644
--- a/tests/aidl/android/fmq/test/ITestAidlMsgQ.aidl
+++ b/tests/aidl/android/fmq/test/ITestAidlMsgQ.aidl
@@ -16,9 +16,9 @@
 
 package android.fmq.test;
 
-import android.hardware.common.MQDescriptor;
-import android.hardware.common.SynchronizedReadWrite;
-import android.hardware.common.UnsynchronizedWrite;
+import android.hardware.common.fmq.MQDescriptor;
+import android.hardware.common.fmq.SynchronizedReadWrite;
+import android.hardware.common.fmq.UnsynchronizedWrite;
 
 /**
  * Test interface for MQDescriptor.
diff --git a/tests/aidl/default/Android.bp b/tests/aidl/default/Android.bp
index 54660e4..024fc60 100644
--- a/tests/aidl/default/Android.bp
+++ b/tests/aidl/default/Android.bp
@@ -4,7 +4,7 @@
         "libbase",
         "libbinder_ndk",
         "libfmq",
-        "android.hardware.common-unstable-ndk_platform",
+        "android.hardware.common.fmq-unstable-ndk_platform",
     ],
     static_libs: [
         "android.fmq.test-ndk_platform",
diff --git a/tests/aidl/default/TestAidlMsgQ.h b/tests/aidl/default/TestAidlMsgQ.h
index 1a65406..f6b2859 100644
--- a/tests/aidl/default/TestAidlMsgQ.h
+++ b/tests/aidl/default/TestAidlMsgQ.h
@@ -29,9 +29,9 @@
 using ::aidl::android::fmq::test::EventFlagBits;
 using ::aidl::android::fmq::test::ITestAidlMsgQ;
 
-using ::aidl::android::hardware::common::MQDescriptor;
-using ::aidl::android::hardware::common::SynchronizedReadWrite;
-using ::aidl::android::hardware::common::UnsynchronizedWrite;
+using ::aidl::android::hardware::common::fmq::MQDescriptor;
+using ::aidl::android::hardware::common::fmq::SynchronizedReadWrite;
+using ::aidl::android::hardware::common::fmq::UnsynchronizedWrite;
 using ::android::hardware::kSynchronizedReadWrite;
 using ::android::hardware::kUnsynchronizedWrite;
 using ::android::hardware::MQFlavor;
diff --git a/tests/fmq_unit_tests.cpp b/tests/fmq_unit_tests.cpp
index d365054..1f16189 100644
--- a/tests/fmq_unit_tests.cpp
+++ b/tests/fmq_unit_tests.cpp
@@ -24,8 +24,8 @@
 #include <sstream>
 #include <thread>
 
-using aidl::android::hardware::common::SynchronizedReadWrite;
-using aidl::android::hardware::common::UnsynchronizedWrite;
+using aidl::android::hardware::common::fmq::SynchronizedReadWrite;
+using aidl::android::hardware::common::fmq::UnsynchronizedWrite;
 using android::hardware::kSynchronizedReadWrite;
 using android::hardware::kUnsynchronizedWrite;
 
@@ -245,7 +245,7 @@
 }
 
 TEST_F(AidlOnlyBadQueueConfig, NegativeAidlDescriptor) {
-    aidl::android::hardware::common::MQDescriptor<uint16_t, SynchronizedReadWrite> desc;
+    aidl::android::hardware::common::fmq::MQDescriptor<uint16_t, SynchronizedReadWrite> desc;
     desc.quantum = -10;
     AidlMessageQueueSync16* fmq = new (std::nothrow) AidlMessageQueueSync16(desc);
     ASSERT_NE(nullptr, fmq);
@@ -256,11 +256,11 @@
 }
 
 TEST_F(AidlOnlyBadQueueConfig, NegativeAidlDescriptorGrantor) {
-    aidl::android::hardware::common::MQDescriptor<uint16_t, SynchronizedReadWrite> desc;
+    aidl::android::hardware::common::fmq::MQDescriptor<uint16_t, SynchronizedReadWrite> desc;
     desc.quantum = 2;
     desc.flags = 0;
     desc.grantors.push_back(
-            aidl::android::hardware::common::GrantorDescriptor{.offset = 12, .extent = -10});
+            aidl::android::hardware::common::fmq::GrantorDescriptor{.offset = 12, .extent = -10});
     AidlMessageQueueSync16* fmq = new (std::nothrow) AidlMessageQueueSync16(desc);
     ASSERT_NE(nullptr, fmq);
     /*
@@ -276,7 +276,7 @@
  */
 TEST_F(AidlOnlyBadQueueConfig, MismatchedPayloadSize) {
     AidlMessageQueueSync16 fmq = AidlMessageQueueSync16(64);
-    aidl::android::hardware::common::MQDescriptor<uint16_t, SynchronizedReadWrite> desc =
+    aidl::android::hardware::common::fmq::MQDescriptor<uint16_t, SynchronizedReadWrite> desc =
             fmq.dupeDesc();
     // This should work fine with the unmodified MQDescriptor
     AidlMessageQueueSync16 fmq2 = AidlMessageQueueSync16(desc);
diff --git a/tests/msgq_test_client.cpp b/tests/msgq_test_client.cpp
index b29f198..c447b6b 100644
--- a/tests/msgq_test_client.cpp
+++ b/tests/msgq_test_client.cpp
@@ -49,8 +49,8 @@
 using android::hardware::MQDescriptorUnsync;
 using android::hardware::details::waitForHwService;
 
-using aidl::android::hardware::common::SynchronizedReadWrite;
-using aidl::android::hardware::common::UnsynchronizedWrite;
+using aidl::android::hardware::common::fmq::SynchronizedReadWrite;
+using aidl::android::hardware::common::fmq::UnsynchronizedWrite;
 using android::hardware::kSynchronizedReadWrite;
 using android::hardware::kUnsynchronizedWrite;
 
@@ -138,7 +138,7 @@
     bool getFmqUnsyncWrite(bool configureFmq, std::shared_ptr<ITestAidlMsgQ> service,
                            AidlMessageQueueUnsync** queue) {
         bool result = false;
-        aidl::android::hardware::common::MQDescriptor<int32_t, UnsynchronizedWrite> desc;
+        aidl::android::hardware::common::fmq::MQDescriptor<int32_t, UnsynchronizedWrite> desc;
         auto ret = service->getFmqUnsyncWrite(configureFmq, &desc, &result);
         *queue = new (std::nothrow) AidlMessageQueueUnsync(desc);
         return result && ret.isOk();