Adjust logic for UI thread priority

This patch adjusts the logic for UI thread priority:

1) The priority is only increased to DISPLAY unless it was lower to
   begin with. Recent versions of Android (O+) automatically set the top
   activity's UI thread's niceness to TOP_APP_PRIORITY_BOOST (-10), so
   by setting the priority to DISPLAY (-4) we were in fact lowering the
   priority.

2) The priority is increased earlier in the start-up flow to minimize
   the chances of descheduling.

We also add a field trial for the first change to evaluate its impact.

BUG=841804
TEST=Manual inspection

Change-Id: I3ec70042be86f2b88bb1ae3a2dd8cba7d87eb807
Reviewed-on: https://chromium-review.googlesource.com/1136648
Commit-Queue: Sami Kyöstilä <skyostil@chromium.org>
Reviewed-by: Camille Lamy <clamy@chromium.org>
Reviewed-by: Gabriel Charette <gab@chromium.org>
Reviewed-by: Antoine Labour <piman@chromium.org>
Cr-Commit-Position: refs/heads/master@{#576079}
3 files changed