Add support for top-app stune group.

bug 29512132

Change-Id: I41ec2dd80a469309f48dbb59fc27fbe43fcd67b3
diff --git a/libcutils/sched_policy.c b/libcutils/sched_policy.c
index ff38e50..c097a12 100644
--- a/libcutils/sched_policy.c
+++ b/libcutils/sched_policy.c
@@ -71,6 +71,7 @@
 // File descriptors open to /dev/stune/../tasks, setup by initialize, or -1 on error
 static int bg_schedboost_fd = -1;
 static int fg_schedboost_fd = -1;
+static int ta_schedboost_fd = -1;
 
 /* Add tid to the scheduling group defined by the policy */
 static int add_tid_to_cgroup(int tid, int fd)
@@ -140,6 +141,8 @@
         ta_cpuset_fd = open(filename, O_WRONLY | O_CLOEXEC);
 
 #ifdef USE_SCHEDBOOST
+        filename = "/dev/stune/top-app/tasks";
+        ta_schedboost_fd = open(filename, O_WRONLY | O_CLOEXEC);
         filename = "/dev/stune/foreground/tasks";
         fg_schedboost_fd = open(filename, O_WRONLY | O_CLOEXEC);
         filename = "/dev/stune/tasks";
@@ -296,11 +299,11 @@
     case SP_AUDIO_APP:
     case SP_AUDIO_SYS:
         fd = fg_cpuset_fd;
-        boost_fd = bg_schedboost_fd;
+        boost_fd = fg_schedboost_fd;
         break;
     case SP_TOP_APP :
         fd = ta_cpuset_fd;
-        boost_fd = fg_schedboost_fd;
+        boost_fd = ta_schedboost_fd;
         break;
     case SP_SYSTEM:
         fd = system_bg_cpuset_fd;
@@ -388,11 +391,11 @@
         case SP_AUDIO_APP:
         case SP_AUDIO_SYS:
             fd = fg_cgroup_fd;
-            boost_fd = bg_schedboost_fd;
+            boost_fd = fg_schedboost_fd;
             break;
         case SP_TOP_APP:
             fd = fg_cgroup_fd;
-            boost_fd = fg_schedboost_fd;
+            boost_fd = ta_schedboost_fd;
             break;
         default:
             fd = -1;