From adba2fcc368ab81c773818497a365775b4a48bf8 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Wed, 23 Sep 2020 10:00:40 -0700 Subject: [PATCH] vold: remove unused stop() methods NetlinkManager::stop() and VolumeManager::stop() are never called, so remove them. Change-Id: I868aa2ad24066d2830816984afcc10000cbabad1 --- NetlinkHandler.cpp | 4 ---- NetlinkHandler.h | 1 - NetlinkManager.cpp | 16 ---------------- NetlinkManager.h | 1 - VolumeManager.cpp | 10 ---------- VolumeManager.h | 1 - 6 files changed, 33 deletions(-) diff --git a/NetlinkHandler.cpp b/NetlinkHandler.cpp index d180a95..2231cd1 100644 --- a/NetlinkHandler.cpp +++ b/NetlinkHandler.cpp @@ -33,10 +33,6 @@ int NetlinkHandler::start() { return this->startListener(); } -int NetlinkHandler::stop() { - return this->stopListener(); -} - void NetlinkHandler::onEvent(NetlinkEvent* evt) { VolumeManager* vm = VolumeManager::Instance(); const char* subsys = evt->getSubsystem(); diff --git a/NetlinkHandler.h b/NetlinkHandler.h index 8af7575..d779eae 100644 --- a/NetlinkHandler.h +++ b/NetlinkHandler.h @@ -25,7 +25,6 @@ class NetlinkHandler : public NetlinkListener { virtual ~NetlinkHandler(); int start(void); - int stop(void); protected: virtual void onEvent(NetlinkEvent* evt); diff --git a/NetlinkManager.cpp b/NetlinkManager.cpp index aacf4b9..56d9df6 100644 --- a/NetlinkManager.cpp +++ b/NetlinkManager.cpp @@ -90,19 +90,3 @@ out: close(mSock); return -1; } - -int NetlinkManager::stop() { - int status = 0; - - if (mHandler->stop()) { - PLOG(ERROR) << "Unable to stop NetlinkHandler"; - status = -1; - } - delete mHandler; - mHandler = NULL; - - close(mSock); - mSock = -1; - - return status; -} diff --git a/NetlinkManager.h b/NetlinkManager.h index e31fc2e..c4f3ab5 100644 --- a/NetlinkManager.h +++ b/NetlinkManager.h @@ -35,7 +35,6 @@ class NetlinkManager { virtual ~NetlinkManager(); int start(); - int stop(); void setBroadcaster(SocketListener* sl) { mBroadcaster = sl; } SocketListener* getBroadcaster() { return mBroadcaster; } diff --git a/VolumeManager.cpp b/VolumeManager.cpp index a543573..fb88fa4 100644 --- a/VolumeManager.cpp +++ b/VolumeManager.cpp @@ -198,16 +198,6 @@ int VolumeManager::start() { return 0; } -int VolumeManager::stop() { - CHECK(!mInternalEmulatedVolumes.empty()); - for (const auto& vol : mInternalEmulatedVolumes) { - vol->destroy(); - } - mInternalEmulatedVolumes.clear(); - - return 0; -} - void VolumeManager::handleBlockEvent(NetlinkEvent* evt) { std::lock_guard lock(mLock); diff --git a/VolumeManager.h b/VolumeManager.h index 3277f75..54a2443 100644 --- a/VolumeManager.h +++ b/VolumeManager.h @@ -56,7 +56,6 @@ class VolumeManager { android::sp getListener() const { return mListener; } int start(); - int stop(); void handleBlockEvent(NetlinkEvent* evt);