Conditionally increase suspend timeout

This does two things:

1. Respect ro.hw_timeout_multiplier when computing the default suspend
timeout.

2. Increase the timeout by a factor of 2 when the thread initiating the
suspension has low priority (positive nice value or Java priority < 5).

Case 2 should not normally apply for threads with a 5 second ANR
timeout.

For suspension initiated from low priority threads, this should get
us back to close to the original 10 second timeout.

It should also give slow device the option of avoiding suspension
timeouts by setting ro.hw_timeout_multiplier.

Also includes some minor macro cleanups.

Test: Treehugger
Test: Some manual checking of suspend timeout values
Bug: 339660702
Bug: 337585993
Bug: 327315839
Bug: 199683153
Bug: 297125507
(and others)
Change-Id: I18638667a8d46d117b06ecedca13df9a6a7f8530

Change-Id: I12d2d7c047194775e1789b02603d3c1d96cc3191
5 files changed