| Index: base/threading/platform_thread_android.cc
|
| diff --git a/base/threading/platform_thread_android.cc b/base/threading/platform_thread_android.cc
|
| index fd5e54d8af961fe03c90d3bd6c7b61b111aa6f13..a40c9cf39571cc00ed41b951b8f762d7d7a0f4af 100644
|
| --- a/base/threading/platform_thread_android.cc
|
| +++ b/base/threading/platform_thread_android.cc
|
| @@ -51,14 +51,37 @@ bool GetCurrentThreadPriorityForPlatform(ThreadPriority* priority) {
|
| DCHECK(priority);
|
| *priority = ThreadPriority::NORMAL;
|
| JNIEnv* env = base::android::AttachCurrentThread();
|
| - if (Java_ThreadUtils_isThreadPriorityAudio(
|
| - env, PlatformThread::CurrentId())) {
|
| + if (Java_ThreadUtils_isThreadPriorityBackground(
|
| + env, PlatformThread::CurrentId())) {
|
| + *priority = ThreadPriority::BACKGROUND;
|
| + return true;
|
| + } else if (Java_ThreadUtils_isThreadPriorityNormal(
|
| + env, PlatformThread::CurrentId())) {
|
| + *priority = ThreadPriority::NORMAL;
|
| + return true;
|
| + } else if (Java_ThreadUtils_isThreadPriorityAudio(
|
| + env, PlatformThread::CurrentId())) {
|
| *priority = ThreadPriority::REALTIME_AUDIO;
|
| return true;
|
| }
|
| return false;
|
| }
|
|
|
| +bool SetChildThreadPriorityInCurrentProcess(PlatformThreadId tid,
|
| + ThreadPriority priority) {
|
| + // On Android, we set the Normal or Background priority through JNI.
|
| + // Other priorities are not yet supported by current function.
|
| + JNIEnv* env = base::android::AttachCurrentThread();
|
| + if (priority == ThreadPriority::BACKGROUND) {
|
| + Java_ThreadUtils_setThreadPriorityBackground(env, tid);
|
| + return true;
|
| + } else if (priority == ThreadPriority::NORMAL) {
|
| + Java_ThreadUtils_setThreadPriorityNormal(env, tid);
|
| + return true;
|
| + }
|
| + return false;
|
| +}
|
| +
|
| } // namespace internal
|
|
|
| void PlatformThread::SetName(const std::string& name) {
|
|
|