Add cpuset switching to scheduler policy mechanism.

Add the ability to add a cpuset to the supported scheduler policies.
This enables services that use the scheduler policy API to run in
the correct cpuset without explicitly requesting a cpuset via the
deprecated API.

Add tests to confirm the correct operation and fix flaky test due
to racing with thread.join().

Also fix log messages on performanced startup related to failure to
access /proc/<pid> directories for certain tasks: this failure is
expected due to sepolicy settings and the log spam is unnecessary.

Bug: 64337476
Test: performance_service_tests passes.
Change-Id: I8a82852e63e39fe72fa3b731e03237f3652cddc7
diff --git a/services/vr/performanced/task.cpp b/services/vr/performanced/task.cpp
index 1175a7b..c2f078e 100644
--- a/services/vr/performanced/task.cpp
+++ b/services/vr/performanced/task.cpp
@@ -48,15 +48,18 @@
       thread_count_(0),
       cpus_allowed_mask_(0) {
   task_fd_ = OpenTaskDirectory(task_id_);
-  ALOGE_IF(task_fd_.get() < 0,
+  const int error = errno;
+  ALOGE_IF(task_fd_.get() < 0 && error != EACCES,
            "Task::Task: Failed to open task directory for task_id=%d: %s",
-           task_id, strerror(errno));
+           task_id, strerror(error));
 
-  ReadStatusFields();
-
-  ALOGD_IF(TRACE, "Task::Task: task_id=%d name=%s tgid=%d ppid=%d cpu_mask=%x",
-           task_id_, name_.c_str(), thread_group_id_, parent_process_id_,
-           cpus_allowed_mask_);
+  if (IsValid()) {
+    ReadStatusFields();
+    ALOGD_IF(TRACE,
+             "Task::Task: task_id=%d name=%s tgid=%d ppid=%d cpu_mask=%x",
+             task_id_, name_.c_str(), thread_group_id_, parent_process_id_,
+             cpus_allowed_mask_);
+  }
 }
 
 base::unique_fd Task::OpenTaskFile(const std::string& name) const {