summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-02-19 04:10:01 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-02-19 04:10:01 +0000
commitb8aff82869a936f63bdf4361a9e1016318bc822d (patch)
treeef273064754773a69bfd226fc641730ba52f218c
parent6b2ca43e314fba0e30e2b8ac74442e88e246e67e (diff)
parent090198bb079e118fb913eaa5618c45bd87cbf6fa (diff)
downloadgsid-b8aff82869a936f63bdf4361a9e1016318bc822d.tar.gz
Snap for 8202755 from 090198bb079e118fb913eaa5618c45bd87cbf6fa to tm-release
Change-Id: I3744916ffbfe36135291e2126388f306bfe25e9c
-rw-r--r--aidl/android/gsi/IImageService.aidl5
-rw-r--r--gsi_service.cpp9
2 files changed, 14 insertions, 0 deletions
diff --git a/aidl/android/gsi/IImageService.aidl b/aidl/android/gsi/IImageService.aidl
index c8c5a9d..363a919 100644
--- a/aidl/android/gsi/IImageService.aidl
+++ b/aidl/android/gsi/IImageService.aidl
@@ -135,6 +135,11 @@ interface IImageService {
void removeDisabledImages();
/**
+ * Return whether an image is disabled.
+ */
+ boolean isImageDisabled(@utf8InCpp String name);
+
+ /**
* Return the block device path of a mapped image, or an empty string if not mapped.
*/
@utf8InCpp String getMappedImageDevice(@utf8InCpp String name);
diff --git a/gsi_service.cpp b/gsi_service.cpp
index c7b3a28..122bbf6 100644
--- a/gsi_service.cpp
+++ b/gsi_service.cpp
@@ -594,6 +594,7 @@ class ImageService : public BinderService<ImageService>, public BnImageService {
binder::Status removeAllImages() override;
binder::Status removeDisabledImages() override;
binder::Status getMappedImageDevice(const std::string& name, std::string* device) override;
+ binder::Status isImageDisabled(const std::string& name, bool* _aidl_return) override;
private:
bool CheckUid();
@@ -764,6 +765,14 @@ binder::Status ImageService::removeDisabledImages() {
return binder::Status::ok();
}
+binder::Status ImageService::isImageDisabled(const std::string& name, bool* _aidl_return) {
+ if (!CheckUid()) return UidSecurityError();
+
+ std::lock_guard<std::mutex> guard(service_->lock());
+ *_aidl_return = impl_->IsImageDisabled(name);
+ return binder::Status::ok();
+}
+
binder::Status ImageService::getMappedImageDevice(const std::string& name, std::string* device) {
if (!CheckUid()) return UidSecurityError();