Fix maximum time to lock

Changes
* Restore previous timeout behaviour. This
  behaviour was modified in Android S and
  was previously working on Android R.
* If the selected timeout is less than
  the max timeout set by the admin, select
  the largest possible timeout.
* If there are no possible timeouts for the
  user, disable the preference.

Manual testing steps
* Download CtsVerifier and CtsEmptyDeviceOwner apks
* Set device owner
* Run Policy transparency test > set max time to lock
* Set max time to lock and verify correct value is
  shown in Settings. Compare behaviour with Android R.

Bug: 184104507
Test: manual testing
      atest com.android.settings.display.ScreenTimeoutSettingsTest
Change-Id: I8d0e66ccce14cca244bcd380fd225a31df0b8999
2 files changed