Add ability to guard a thread against setting its own prio to bg

The guard is compiled out by default because it adds overhead to
android.os.Process.setPriority().

Change-Id: Ibb2a648c6349b381abb7ae62a358888b04fba871
This commit is contained in:
Christopher Tate
2010-06-30 17:46:30 -07:00
parent c6e1d88022
commit 160edb3645
5 changed files with 53 additions and 1 deletions

View File

@@ -572,6 +572,7 @@ public class WindowManagerService extends IWindowManager.Stub
mHaveInputMethods);
android.os.Process.setThreadPriority(
android.os.Process.THREAD_PRIORITY_DISPLAY);
android.os.Process.setCanSelfBackground(false);
synchronized (this) {
mService = s;
@@ -607,6 +608,7 @@ public class WindowManagerService extends IWindowManager.Stub
// Log.VERBOSE, "WindowManagerPolicy", Log.LOG_ID_SYSTEM));
android.os.Process.setThreadPriority(
android.os.Process.THREAD_PRIORITY_FOREGROUND);
android.os.Process.setCanSelfBackground(false);
mPolicy.init(mContext, mService, mPM);
synchronized (this) {