Revert "Add IPTV default implementation"

This reverts commit 1f3f0ac11cb8edac5d4127bd791598fe90430494.

Reason for revert: build failure https://android-build.corp.google.com/build_explorer/branch_dashboard/git_main/build_id/11044788/ quarterdeck https://android-build.corp.google.com/builds/quarterdeck?branch=git_main-without-vendor&target=aosp_x86_64-trunk_staging-userdebug&lkgb=11044124&lkbb=11044818&fkbb=11044818

Bug: 309021506
Change-Id: I27c938017785e8a5ee4f8aa708b4e0f6ab448420
diff --git a/tv/tuner/aidl/default/Frontend.cpp b/tv/tuner/aidl/default/Frontend.cpp
index 6bdbac5..cd072bf 100644
--- a/tv/tuner/aidl/default/Frontend.cpp
+++ b/tv/tuner/aidl/default/Frontend.cpp
@@ -213,83 +213,21 @@
     return ::ndk::ScopedAStatus::ok();
 }
 
-void Frontend::readTuneByte(dtv_streamer* streamer, void* buf, size_t buf_size, int timeout_ms) {
-    ssize_t bytes_read = mIptvPluginInterface->read_stream(streamer, buf, buf_size, timeout_ms);
-    if (bytes_read == 0) {
-        ALOGI("[   ERROR   ] Tune byte couldn't be read.");
-        return;
-    }
-    mCallback->onEvent(FrontendEventType::LOCKED);
-    mIsLocked = true;
-}
-
-::ndk::ScopedAStatus Frontend::tune(const FrontendSettings& in_settings) {
+::ndk::ScopedAStatus Frontend::tune(const FrontendSettings& /* in_settings */) {
+    ALOGV("%s", __FUNCTION__);
     if (mCallback == nullptr) {
-        ALOGW("[   WARN   ] Frontend callback is not set for tunin0g");
+        ALOGW("[   WARN   ] Frontend callback is not set when tune");
         return ::ndk::ScopedAStatus::fromServiceSpecificError(
                 static_cast<int32_t>(Result::INVALID_STATE));
     }
 
     if (mType != FrontendType::IPTV) {
         mTuner->frontendStartTune(mId);
-        mCallback->onEvent(FrontendEventType::LOCKED);
-        mIsLocked = true;
-    } else {
-        // This is a reference implementation for IPTV. It uses an additional socket buffer.
-        // Vendors can use hardware memory directly to make the implementation more performant.
-        ALOGI("[   INFO   ] Frontend type is set to IPTV, tag = %d id=%d", in_settings.getTag(),
-              mId);
-
-        // load udp plugin for reading TS data
-        const char* path = "/vendor/lib/iptv_udp_plugin.so";
-        DtvPlugin* plugin = new DtvPlugin(path);
-        if (!plugin) {
-            ALOGE("Failed to create DtvPlugin, plugin_path is invalid");
-            return ::ndk::ScopedAStatus::fromServiceSpecificError(
-                    static_cast<int32_t>(Result::INVALID_ARGUMENT));
-        }
-        bool plugin_loaded = plugin->load();
-        if (!plugin_loaded) {
-            ALOGE("Failed to load plugin");
-            return ::ndk::ScopedAStatus::fromServiceSpecificError(
-                    static_cast<int32_t>(Result::INVALID_ARGUMENT));
-        }
-        mIptvPluginInterface = plugin->interface();
-
-        // validate content_url format
-        std::string content_url = in_settings.get<FrontendSettings::Tag::iptv>()->contentUrl;
-        std::string transport_desc = "{ \"uri\": \"" + content_url + "\"}";
-        ALOGI("[   INFO   ] transport_desc: %s", transport_desc.c_str());
-        bool is_transport_desc_valid = plugin->validate(transport_desc.c_str());
-        if (!is_transport_desc_valid) {  // not of format protocol://ip:port
-            ALOGE("[   INFO   ] transport_desc is not valid");
-            return ::ndk::ScopedAStatus::fromServiceSpecificError(
-                    static_cast<int32_t>(Result::INVALID_ARGUMENT));
-        }
-        mIptvTransportDescription = transport_desc;
-
-        // create a streamer and open it for reading data
-        dtv_streamer* streamer = mIptvPluginInterface->create_streamer();
-        mIptvPluginStreamer = streamer;
-        int open_fd = mIptvPluginInterface->open_stream(streamer, transport_desc.c_str());
-        if (open_fd < 0) {
-            ALOGE("[   INFO   ] could not open stream");
-            return ::ndk::ScopedAStatus::fromServiceSpecificError(
-                    static_cast<int32_t>(Result::INVALID_ARGUMENT));
-        }
-        ALOGI("[   INFO   ] open_stream successful, open_fd=%d", open_fd);
-
-        size_t buf_size = 1;
-        int timeout_ms = 2000;
-        void* buf = malloc(sizeof(char) * buf_size);
-        if (buf == nullptr) ALOGI("malloc buf failed [TUNE]");
-        ALOGI("[   INFO   ] [Tune] Allocated buffer of size %zu", buf_size);
-        mIptvFrontendTuneThread =
-                std::thread(&Frontend::readTuneByte, this, streamer, buf, buf_size, timeout_ms);
-        if (mIptvFrontendTuneThread.joinable()) mIptvFrontendTuneThread.join();
-        free(buf);
     }
 
+    mCallback->onEvent(FrontendEventType::LOCKED);
+    mIsLocked = true;
+
     return ::ndk::ScopedAStatus::ok();
 }
 
@@ -1064,18 +1002,6 @@
     return mId;
 }
 
-dtv_plugin* Frontend::getIptvPluginInterface() {
-    return mIptvPluginInterface;
-}
-
-string Frontend::getIptvTransportDescription() {
-    return mIptvTransportDescription;
-}
-
-dtv_streamer* Frontend::getIptvPluginStreamer() {
-    return mIptvPluginStreamer;
-}
-
 bool Frontend::supportsSatellite() {
     return mType == FrontendType::DVBS || mType == FrontendType::ISDBS ||
            mType == FrontendType::ISDBS3;