Revert^2 "Support niceness-based priority calls"

Fix comments to reflect the Android S workaround requirements. We need
to make some use of the Thread.priority field again, so that we can
easily implement setPriority via PaletteSchedSetPriority, as before,
where that had unusual semantics or was unsafe to just call once
to construct a table.

Earlier commit message:

Cache niceness values rather than Java priorities, so that we can also
cache priorities set by frameworks code. Add the necessary priority
to niceness and vice-versa conversion infrastructure.

Cache the correct niceness value for system daemons, ensuring that with
the normal priority assignments this still reads back as the same
Java priority value.

Add an API to access the niceness value directly, instead of via Java
priorities.

Preserve the old Thread.priority field, but only to support apps that
read it directly via reflection.

See also go/thread-priorities-in-android and aosp/3287177 .

This is intended to be followed by aosp/3312350 and an updated version
of aosp/3314070 .

Test: Treehugger
Test: atest CtsLibcoreTestCases:libcore.java.lang.ThreadTest
Flag: com.android.libcore.niceness_api
Bug: 389104950

a82145e69f99b3187079534f42cae6d4abe83c93
(cherry picked from https://android-review.googlesource.com/q/commit:d0f8b0266b47eda531393bdca00567466d933824)

Merged-In: Id525c67f954dbaf244f8d3b01dfcce63f9b68449
Change-Id: Id525c67f954dbaf244f8d3b01dfcce63f9b68449
7 files changed