Use libartpalette instead of libprocessgroup to set task profiles.

This reduces the size of the ART APEX by 144KB when uncompressed.

Bug: 238182454
Test: atest art_standalone_libarttools_tests
Ignore-AOSP-First: ART Services.
Change-Id: I30c406ce9baeca0820c06cd1c7d9be233456f34e
diff --git a/libartpalette/Android.bp b/libartpalette/Android.bp
index 9ac9091..e6aae64 100644
--- a/libartpalette/Android.bp
+++ b/libartpalette/Android.bp
@@ -58,6 +58,9 @@
         "libbase_headers",
         "jni_headers",
     ],
+    export_header_lib_headers: [
+        "jni_headers",
+    ],
     target: {
         // Targets supporting dlopen build the client library which loads
         // and binds the methods in the libartpalette-system library.
diff --git a/libarttools/Android.bp b/libarttools/Android.bp
index 46f7a70..5b42ae8 100644
--- a/libarttools/Android.bp
+++ b/libarttools/Android.bp
@@ -86,30 +86,17 @@
     ],
 }
 
-// A defaults that contains libprocessgroup and all its dependencies.
-cc_defaults {
-    name: "art_libprocessgroup_defaults",
-    shared_libs: [
-        "libbase",
-        "libcgrouprc",
-    ],
-    static_libs: [
-        "libjsoncpp",
-        "libprocessgroup",
-    ],
-}
-
 cc_binary {
     name: "art_exec",
     defaults: [
         "art_defaults",
-        "art_libprocessgroup_defaults",
     ],
     srcs: [
         "tools/art_exec.cc",
     ],
     shared_libs: [
         "libartbase",
+        "libartpalette",
         "libarttools", // Contains "libc++fs".
         "libbase",
     ],
diff --git a/libarttools/tools/art_exec.cc b/libarttools/tools/art_exec.cc
index 7fecda6..1806ed4 100644
--- a/libarttools/tools/art_exec.cc
+++ b/libarttools/tools/art_exec.cc
@@ -37,7 +37,7 @@
 #include "base/macros.h"
 #include "base/scoped_cap.h"
 #include "fmt/format.h"
-#include "processgroup/processgroup.h"
+#include "palette/palette.h"
 #include "system/thread_defs.h"
 
 namespace {
@@ -192,8 +192,9 @@
   }
 
   if (!options.task_profiles.empty()) {
-    if (!SetTaskProfiles(/*tid=*/0, options.task_profiles)) {
-      LOG(ERROR) << "Failed to set task profile";
+    if (int ret = PaletteSetTaskProfiles(/*tid=*/0, options.task_profiles);
+        ret != PALETTE_STATUS_OK) {
+      LOG(ERROR) << "Failed to set task profile: " << ret;
       return kErrorOther;
     }
   }