summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Chen <liangyuchen@google.com>2023-02-14 18:15:43 +0000
committerCharles Chen <liangyuchen@google.com>2023-02-21 23:04:03 +0000
commitff9ae5e7f319fa417a6f7ea50daadf26dfc8e4ca (patch)
tree612d252f700db785855b518cc7767efdab1f836b
parent370e40a3db70425e6bae5dc9c22fc4bd6e0fa3b4 (diff)
Publish gralloc4 to allow isolated process
Allowed with a new API to add service with flags. Bug: 268016157 Test: Manual - isolated apps can access gralloc Change-Id: I1e682ed4c6a223bd06232a1282f6d47a03bbb056
-rw-r--r--gralloc4/service/aidl/service.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/gralloc4/service/aidl/service.cpp b/gralloc4/service/aidl/service.cpp
index 26cf77e..b6ccd44 100644
--- a/gralloc4/service/aidl/service.cpp
+++ b/gralloc4/service/aidl/service.cpp
@@ -19,7 +19,8 @@ int main() {
AIBinder_setMinSchedulerPolicy(binder.get(), SCHED_NORMAL, -20);
const auto instance = std::string() + GrallocAllocator::descriptor + "/default";
- auto status = AServiceManager_addService(binder.get(), instance.c_str());
+ auto status = AServiceManager_addServiceWithFlag(binder.get(), instance.c_str(),
+ AServiceManager_AddServiceFlag::ADD_SERVICE_ALLOW_ISOLATED);
if (status != STATUS_OK) {
ALOGE("Failed to start AIDL gralloc allocator service");
return -EINVAL;