Merge changes from topic 'stune' into nyc-mr1-dev

* changes:
  Put bootanimation in top-app stune group.
  Sets android.ui to be in the fg stune group.
This commit is contained in:
Tim Murray
2016-07-11 20:29:38 +00:00
committed by Android (Google) Code Review
3 changed files with 10 additions and 1 deletions

View File

@ -4,3 +4,4 @@ service bootanim /system/bin/bootanimation
group graphics audio group graphics audio
disabled disabled
oneshot oneshot
writepid /dev/stune/top-app/tasks

View File

@ -971,6 +971,9 @@ public class Process {
* priority. * priority.
* If the thread is a thread group leader, that is it's gettid() == getpid(), * If the thread is a thread group leader, that is it's gettid() == getpid(),
* then the other threads in the same thread group are _not_ affected. * then the other threads in the same thread group are _not_ affected.
*
* Does not set cpuset for some historical reason, just calls
* libcutils::set_sched_policy().
*/ */
public static final native void setThreadGroup(int tid, int group) public static final native void setThreadGroup(int tid, int group)
throws IllegalArgumentException, SecurityException; throws IllegalArgumentException, SecurityException;
@ -992,6 +995,8 @@ public class Process {
* priority threads alone. group == THREAD_GROUP_BG_NONINTERACTIVE moves all * priority threads alone. group == THREAD_GROUP_BG_NONINTERACTIVE moves all
* threads, regardless of priority, to the background scheduling group. * threads, regardless of priority, to the background scheduling group.
* group == THREAD_GROUP_FOREGROUND is not allowed. * group == THREAD_GROUP_FOREGROUND is not allowed.
*
* Always sets cpusets.
*/ */
public static final native void setProcessGroup(int pid, int group) public static final native void setProcessGroup(int pid, int group)
throws IllegalArgumentException, SecurityException; throws IllegalArgumentException, SecurityException;

View File

@ -17,6 +17,7 @@
package com.android.server; package com.android.server;
import android.os.Handler; import android.os.Handler;
import android.os.Process;
import android.os.Trace; import android.os.Trace;
/** /**
@ -29,7 +30,9 @@ public final class UiThread extends ServiceThread {
private static Handler sHandler; private static Handler sHandler;
private UiThread() { private UiThread() {
super("android.ui", android.os.Process.THREAD_PRIORITY_FOREGROUND, false /*allowIo*/); super("android.ui", Process.THREAD_PRIORITY_FOREGROUND, false /*allowIo*/);
// Make sure UiThread is in the fg stune boost group
Process.setThreadGroup(Process.myTid(), Process.THREAD_GROUP_TOP_APP);
} }
private static void ensureThreadLocked() { private static void ensureThreadLocked() {