cutils: sched_policy: remove audio app/sys groups, merge into fg

Bug: 6528015
Change-Id: I6c2658b62442d811b53c6d18476fbd6cd45f9e3f
Signed-off-by: Dima Zavin <dima@android.com>
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c
index 2dce985..d20d217 100644
--- a/libcutils/sched_policy.c
+++ b/libcutils/sched_policy.c
@@ -63,8 +63,6 @@
 #if CAN_SET_SP_SYSTEM
 static int system_cgroup_fd = -1;
 #endif
-static int audio_app_cgroup_fd = -1;
-static int audio_sys_cgroup_fd = -1;
 
 /* Add tid to the scheduling group defined by the policy */
 static int add_tid_to_cgroup(int tid, SchedPolicy policy)
@@ -76,6 +74,8 @@
         fd = bg_cgroup_fd;
         break;
     case SP_FOREGROUND:
+    case SP_AUDIO_APP:
+    case SP_AUDIO_SYS:
         fd = fg_cgroup_fd;
         break;
 #if CAN_SET_SP_SYSTEM
@@ -83,12 +83,6 @@
         fd = system_cgroup_fd;
         break;
 #endif
-    case SP_AUDIO_APP:
-        fd = audio_app_cgroup_fd;
-        break;
-    case SP_AUDIO_SYS:
-        fd = audio_sys_cgroup_fd;
-        break;
     default:
         fd = -1;
         break;
@@ -148,19 +142,6 @@
         if (bg_cgroup_fd < 0) {
             SLOGE("open of %s failed: %s\n", filename, strerror(errno));
         }
-
-        filename = "/dev/cpuctl/audio_app/tasks";
-        audio_app_cgroup_fd = open(filename, O_WRONLY | O_CLOEXEC);
-        if (audio_app_cgroup_fd < 0) {
-            SLOGV("open of %s failed: %s\n", filename, strerror(errno));
-        }
-
-        filename = "/dev/cpuctl/audio_sys/tasks";
-        audio_sys_cgroup_fd = open(filename, O_WRONLY | O_CLOEXEC);
-        if (audio_sys_cgroup_fd < 0) {
-            SLOGV("open of %s failed: %s\n", filename, strerror(errno));
-        }
-
     } else {
         __sys_supports_schedgroups = 0;
     }
@@ -257,10 +238,6 @@
             *policy = SP_BACKGROUND;
         } else if (!strcmp(grpBuf, "apps")) {
             *policy = SP_FOREGROUND;
-        } else if (!strcmp(grpBuf, "audio_app")) {
-            *policy = SP_AUDIO_APP;
-        } else if (!strcmp(grpBuf, "audio_sys")) {
-            *policy = SP_AUDIO_SYS;
         } else {
             errno = ERANGE;
             return -1;
@@ -319,17 +296,13 @@
         SLOGD("vvv tid %d (%s)", tid, thread_name);
         break;
     case SP_FOREGROUND:
+    case SP_AUDIO_APP:
+    case SP_AUDIO_SYS:
         SLOGD("^^^ tid %d (%s)", tid, thread_name);
         break;
     case SP_SYSTEM:
         SLOGD("/// tid %d (%s)", tid, thread_name);
         break;
-    case SP_AUDIO_APP:
-        SLOGD("aaa tid %d (%s)", tid, thread_name);
-        break;
-    case SP_AUDIO_SYS:
-        SLOGD("sss tid %d (%s)", tid, thread_name);
-        break;
     default:
         SLOGD("??? tid %d (%s)", tid, thread_name);
         break;