Add media.codec.update service
This is done similarly to how we update the extractors.
media.swcodec will start a service "media.codec.update"
to get notified of the update apk location, then updated
version of the component store will be loaded.
Since the update interface is exactly the same, we reuse
IMediaExtractorUpdateService to avoid adding new an aidl
interface. Besides this service will likely be removed
after we switch to APEX.)
Bug: 111407413
Bug: 117290290
Change-Id: I739ba0071806beed99302ccd3da7a6f73a437f06
diff --git a/services/mediacodec/main_swcodecservice.cpp b/services/mediacodec/main_swcodecservice.cpp
index 1729c3f..386abb2 100644
--- a/services/mediacodec/main_swcodecservice.cpp
+++ b/services/mediacodec/main_swcodecservice.cpp
@@ -20,10 +20,13 @@
// from LOCAL_C_INCLUDES
#include "minijail.h"
+#include <android-base/properties.h>
#include <binder/ProcessState.h>
+#include <dlfcn.h>
#include <hidl/HidlTransportSupport.h>
#include <media/CodecServiceRegistrant.h>
-#include <dlfcn.h>
+
+#include "MediaCodecUpdateService.h"
using namespace android;
@@ -40,6 +43,11 @@
signal(SIGPIPE, SIG_IGN);
SetUpMinijail(kSystemSeccompPolicyPath, kVendorSeccompPolicyPath);
+ std::string value = base::GetProperty("ro.build.type", "unknown");
+ if (value == "userdebug" || value == "eng") {
+ media::MediaCodecUpdateService::instantiate();
+ }
+
android::ProcessState::self()->startThreadPool();
::android::hardware::configureRpcThreadpool(64, false);