Set thread priority to audio. - Android java.lang

Android examples for java.lang:Thread

Description

Set thread priority to audio.

Demo Code

// Copyright (c) 2012 The Chromium Authors. All rights reserved.
import android.os.Handler;
import android.os.Looper;
import android.os.Process;
import java.util.concurrent.Callable;
import java.util.concurrent.ExecutionException;
import java.util.concurrent.FutureTask;

public class Main{
    /**/*from w w w  .  j a  v  a  2s. c  om*/
     * Set thread priority to audio.
     */
    @CalledByNative
    public static void setThreadPriorityAudio(int tid) {
        Process.setThreadPriority(tid, Process.THREAD_PRIORITY_AUDIO);
    }
}

Related Tutorials