Lower the priority of the LazyTaskWriter thread.

This worker thread shouldn't be prioritized at the same level as user
tasks, preemptions of ui threads may result. Additionally, if we lower
its priority level, it will be scheduled on more efficient cores
in big little systems.

Change-Id: I49a7df6fb43d6c067aeacf9ff0cbd5477cb42f7d
diff --git a/services/core/java/com/android/server/am/TaskPersister.java b/services/core/java/com/android/server/am/TaskPersister.java
index ef1559a..aa154a7 100644
--- a/services/core/java/com/android/server/am/TaskPersister.java
+++ b/services/core/java/com/android/server/am/TaskPersister.java
@@ -33,6 +33,7 @@
 import android.util.Slog;
 import android.util.SparseArray;
 import android.util.Xml;
+import android.os.Process;
 
 import com.android.internal.util.FastXmlSerializer;
 import com.android.internal.util.XmlUtils;
@@ -471,6 +472,7 @@
 
         @Override
         public void run() {
+            Process.setThreadPriority(Process.THREAD_PRIORITY_BACKGROUND);
             ArraySet<Integer> persistentTaskIds = new ArraySet<Integer>();
             while (true) {
                 // We can't lock mService while holding TaskPersister.this, but we don't want to