Revert "Add media.c2 AIDL service to media.swcodec"

Revert submission 2758286-c2aidl-swcodec

Reason for revert: b/308991806

Reverted changes: /q/submissionid:2758286-c2aidl-swcodec

Bug: 308991806
Change-Id: If37e7b6ba5a0597690e2ee16762fc930370ff1d7
diff --git a/media/codec2/hal/aidl/Android.bp b/media/codec2/hal/aidl/Android.bp
index 68d7152..44f85fd 100644
--- a/media/codec2/hal/aidl/Android.bp
+++ b/media/codec2/hal/aidl/Android.bp
@@ -6,6 +6,7 @@
 // use libcodec2-aidl-client-defaults instead
 cc_library {
     name: "libcodec2_aidl_client",
+    min_sdk_version: "31",
 
     srcs: [
         "BufferTypes.cpp",
@@ -35,6 +36,7 @@
     ],
 
     static_libs: [
+        "libPlatformProperties",
         "libaidlcommonsupport",
     ],
 
@@ -53,7 +55,7 @@
 // use libcodec2-aidl-defaults instead
 cc_library {
     name: "libcodec2_aidl",
-    min_sdk_version: "30",
+    min_sdk_version: "31",
     vendor_available: true,
     apex_available: [
         "//apex_available:platform",
@@ -96,6 +98,7 @@
     ],
 
     static_libs: [
+        "libPlatformProperties",
         "libaidlcommonsupport",
     ],
 
@@ -131,7 +134,7 @@
 // public dependency for Codec 2.0 HAL service implementations
 cc_defaults {
     name: "libcodec2-aidl-defaults",
-    min_sdk_version: "30",
+    min_sdk_version: "31",
     defaults: ["libcodec2-impl-defaults"],
 
     shared_libs: [
@@ -144,6 +147,7 @@
 // public dependency for Codec 2.0 HAL client
 cc_defaults {
     name: "libcodec2-aidl-client-defaults",
+    min_sdk_version: "31",
     defaults: ["libcodec2-impl-defaults"],
 
     shared_libs: [
diff --git a/media/codec2/hal/aidl/ParamTypes.cpp b/media/codec2/hal/aidl/ParamTypes.cpp
index 495e748..41e6f50 100644
--- a/media/codec2/hal/aidl/ParamTypes.cpp
+++ b/media/codec2/hal/aidl/ParamTypes.cpp
@@ -19,9 +19,7 @@
 #include <android-base/logging.h>
 
 #include <android/binder_manager.h>
-// NOTE: due to dependency from mainline modules cannot use libsysprop
-// #include <android/sysprop/MediaProperties.sysprop.h>
-#include <android-base/properties.h>
+#include <android/sysprop/MediaProperties.sysprop.h>
 #include <codec2/aidl/ParamTypes.h>
 #include <codec2/common/ParamTypes.h>
 
@@ -169,8 +167,6 @@
         // Cannot select AIDL if not enabled
         return false;
     }
-#if 0
-    // NOTE: due to dependency from mainline modules cannot use libsysprop
     using ::android::sysprop::MediaProperties::codec2_hal_selection;
     using ::android::sysprop::MediaProperties::codec2_hal_selection_values;
     constexpr codec2_hal_selection_values AIDL = codec2_hal_selection_values::AIDL;
@@ -184,16 +180,6 @@
     default:
         LOG(FATAL) << "Unexpected codec2 HAL selection value: " << (int)selection;
     }
-#else
-    std::string selection = ::android::base::GetProperty("media.c2.hal.selection", "hidl");
-    if (selection == "aidl") {
-        return true;
-    } else if (selection == "hidl") {
-        return false;
-    } else {
-        LOG(FATAL) << "Unexpected codec2 HAL selection value: " << selection;
-    }
-#endif
 
     return false;
 }