summaryrefslogtreecommitdiff
path: root/gsi_service.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gsi_service.cpp')
-rw-r--r--gsi_service.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/gsi_service.cpp b/gsi_service.cpp
index 5ef4914..0498966 100644
--- a/gsi_service.cpp
+++ b/gsi_service.cpp
@@ -449,6 +449,7 @@ class ImageService : public BinderService<ImageService>, public BnImageService {
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;
+ binder::Status removeDisabledImages() override;
private:
bool CheckUid();
@@ -554,6 +555,16 @@ binder::Status ImageService::removeAllImages() {
return binder::Status::ok();
}
+binder::Status ImageService::removeDisabledImages() {
+ if (!CheckUid()) return UidSecurityError();
+
+ std::lock_guard<std::mutex> guard(parent_->lock());
+ if (!impl_->RemoveDisabledImages()) {
+ return BinderError("Failed to remove disabled images");
+ }
+ return binder::Status::ok();
+}
+
bool ImageService::CheckUid() {
return uid_ == IPCThreadState::self()->getCallingUid();
}