Merge "Fix maximum time to lock" into sc-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
2f9b5b6ad7
@@ -159,6 +159,16 @@ public class ScreenTimeoutSettings extends RadioButtonPickerFragment implements
|
||||
screen.addPreference(pref);
|
||||
}
|
||||
|
||||
final long selectedTimeout = Long.parseLong(defaultKey);
|
||||
final long maxTimeout = getMaxScreenTimeout(getContext());
|
||||
if (!candidateList.isEmpty() && (selectedTimeout > maxTimeout)) {
|
||||
// The selected time out value is longer than the max timeout allowed by the admin.
|
||||
// Select the largest value from the list by default.
|
||||
final RadioButtonPreference preferenceWithLargestTimeout =
|
||||
(RadioButtonPreference) screen.getPreference(candidateList.size() - 1);
|
||||
preferenceWithLargestTimeout.setChecked(true);
|
||||
}
|
||||
|
||||
if (isScreenAttentionAvailable(getContext())) {
|
||||
mAdaptiveSleepPermissionController.addToScreen(screen);
|
||||
mAdaptiveSleepCameraStatePreferenceController.addToScreen(screen);
|
||||
|
Reference in New Issue
Block a user