Expose ImageManager::RemoveAllImages via binder. Bug: N/A Test: manual test Change-Id: I9429ed49f57caab054c6c3418d4da351a21a8131
diff --git a/gsi_service.cpp b/gsi_service.cpp index dbf0ea6..2916c74 100644 --- a/gsi_service.cpp +++ b/gsi_service.cpp
@@ -359,6 +359,7 @@ binder::Status backingImageExists(const std::string& name, bool* _aidl_return) override; binder::Status isImageMapped(const std::string& name, bool* _aidl_return) override; binder::Status zeroFillNewImage(const std::string& name, int64_t bytes) override; + binder::Status removeAllImages() override; private: bool CheckUid(); @@ -454,6 +455,16 @@ return binder::Status::ok(); } +binder::Status ImageService::removeAllImages() { + if (!CheckUid()) return UidSecurityError(); + + std::lock_guard<std::mutex> guard(parent_->lock()); + if (!impl_->RemoveAllImages()) { + return BinderError("Failed to remove all images"); + } + return binder::Status::ok(); +} + bool ImageService::CheckUid() { return uid_ == IPCThreadState::self()->getCallingUid(); }