Merge "Allow setting a persistent VR thread."

This commit is contained in:
TreeHugger Robot
2017-03-20 22:35:36 +00:00
committed by Android (Google) Code Review
5 changed files with 359 additions and 40 deletions

View File

@@ -4060,6 +4060,10 @@ public class ActivityManager {
* thread can be a VR thread in a process at a time, and that thread may be subject to
* restrictions on the amount of time it can run.
*
* If persistent VR mode is set, whatever thread has been granted aggressive scheduling via this
* method will return to normal operation, and calling this method will do nothing while
* persistent VR mode is enabled.
*
* To reset the VR thread for an application, a tid of 0 can be passed.
*
* @see android.os.Process#myTid()
@@ -4073,6 +4077,31 @@ public class ActivityManager {
}
}
/**
* Enable more aggressive scheduling for latency-sensitive low-runtime VR threads that persist
* beyond a single process. It requires holding the
* {@link android.Manifest.permission#RESTRICTED_VR_ACCESS} permission. Only one thread can be a
* persistent VR thread at a time, and that thread may be subject to restrictions on the amount
* of time it can run. Calling this method will disable aggressive scheduling for non-persistent
* VR threads set via {@link #setVrThread}. If persistent VR mode is disabled then the
* persistent VR thread loses its new scheduling priority; this method must be called again to
* set the persistent thread.
*
* To reset the persistent VR thread, a tid of 0 can be passed.
*
* @see android.os.Process#myTid()
* @param tid tid of the VR thread
* @hide
*/
@RequiresPermission(Manifest.permission.RESTRICTED_VR_ACCESS)
public static void setPersistentVrThread(int tid) {
try {
getService().setPersistentVrThread(tid);
} catch (RemoteException e) {
// pass
}
}
/**
* The AppTask allows you to manage your own application's tasks.
* See {@link android.app.ActivityManager#getAppTasks()}

View File

@@ -605,6 +605,7 @@ interface IActivityManager {
ActivityManager.TaskSnapshot getTaskSnapshot(int taskId);
void scheduleApplicationInfoChanged(in List<String> packageNames, int userId);
void setPersistentVrThread(int tid);
// WARNING: when these transactions are updated, check if they are any callers on the native
// side. If so, make sure they are using the correct transaction ids and arguments.