gralloc: Allow isolated processes to add allocator service

Apps like AICore will be isolated processes, they should be allowed to
allocate AHardwareBuffer as well.

Bug: 446850456
Test: Run AICore debug app on android rauru
Change-Id: Ibc595313c0ab4cbfc46b4b7f29d3c1bf2ef9e784
Reviewed-on: https://chromium-review.googlesource.com/c/chromiumos/platform/minigbm/+/6999953
Tested-by: Tommy Chiang <[email protected]>
Reviewed-by: Yiwei Zhang <[email protected]>
Commit-Queue: Yiwei Zhang <[email protected]>
Auto-Submit: Tommy Chiang <[email protected]>
Reviewed-by: Ryan Neph <[email protected]>
Reviewed-by: Jason Macnak <[email protected]>
diff --git a/cros_gralloc/aidl/Main.cpp b/cros_gralloc/aidl/Main.cpp
index c2c4c5c..150d427 100644
--- a/cros_gralloc/aidl/Main.cpp
+++ b/cros_gralloc/aidl/Main.cpp
@@ -32,8 +32,9 @@
     }
 
     const std::string instance = std::string() + Allocator::descriptor + "/default";
-    binder_status_t status =
-            AServiceManager_addService(allocator->asBinder().get(), instance.c_str());
+    binder_status_t status = AServiceManager_addServiceWithFlags(
+            allocator->asBinder().get(), instance.c_str(),
+            AServiceManager_AddServiceFlag::ADD_SERVICE_ALLOW_ISOLATED);
     CHECK_EQ(status, STATUS_OK);
 
     ABinderProcess_setThreadPoolMaxThreadCount(4);
@@ -41,4 +42,4 @@
     ABinderProcess_joinThreadPool();
 
     return EXIT_FAILURE;
-}
\ No newline at end of file
+}