Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 21bf6dab authored by Hangyu Kuang's avatar Hangyu Kuang
Browse files

Revert "trancoding: lazy-start transcoding service"

This reverts commit 628baafe.

Reason for revert: change to conditional start

Bug: 187271658
Test: atest MediaTranscodeManagerTest; unit tests
Change-Id: Iaa4f26e7c0de16e20376cae65bd1e69e7b0a5997
parent 1ba66b4f
Loading
Loading
Loading
Loading
+0 −1
Original line number Diff line number Diff line
@@ -8,5 +8,4 @@ service media.transcoding /apex/com.android.media/bin/mediatranscoding
    ioprio rt 4
    # Restrict to little cores only with system-background cpuset.
    writepid /dev/cpuset/system-background/tasks
    interface aidl media.transcoding
    disabled
+4 −4
Original line number Diff line number Diff line
@@ -131,10 +131,10 @@ binder_status_t MediaTranscodingService::dump(int fd, const char** /*args*/, uin
void MediaTranscodingService::instantiate() {
    std::shared_ptr<MediaTranscodingService> service =
            ::ndk::SharedRefBase::make<MediaTranscodingService>();
    if (__builtin_available(android __TRANSCODING_MIN_API__, *)) {
        // Once service is started, we want it to stay even is client side perished.
        AServiceManager_forceLazyServicesPersist(true /*persist*/);
        (void)AServiceManager_registerLazyService(service->asBinder().get(), getServiceName());
    binder_status_t status =
            AServiceManager_addService(service->asBinder().get(), getServiceName());
    if (status != STATUS_OK) {
        return;
    }
}

+1 −1
Original line number Diff line number Diff line
@@ -481,7 +481,7 @@ public:
        // Need thread pool to receive callbacks, otherwise oneway callbacks are
        // silently ignored.
        ABinderProcess_startThreadPool();
        ::ndk::SpAIBinder binder(AServiceManager_waitForService("media.transcoding"));
        ::ndk::SpAIBinder binder(AServiceManager_getService("media.transcoding"));
        mService = IMediaTranscodingService::fromBinder(binder);
        if (mService == nullptr) {
            ALOGE("Failed to connect to the media.trascoding service.");