Restrict screen saver settings searches to enabled users.
If a user can't enable screen saver, they shouldn't be able to accidentally find screen saver related settings in Settings. Bug: 260276394 Test: atest ScreenSaverPreferenceControllerTest Test: manually by settings up a second user on a device that supports screen saver, switching to that user, and making sure that searches for "screen saver" don't accidentally reveal settings that can't be accessed. Change-Id: If2f465b2acb548455f0868507cf47217ea1a626f
This commit is contained in:
@@ -35,13 +35,7 @@ public class ScreenSaverPreferenceController extends BasePreferenceController im
|
||||
|
||||
@Override
|
||||
public int getAvailabilityStatus() {
|
||||
final boolean dreamsSupported = mContext.getResources().getBoolean(
|
||||
com.android.internal.R.bool.config_dreamsSupported);
|
||||
final boolean dreamsOnlyEnabledForDockUser = mContext.getResources().getBoolean(
|
||||
com.android.internal.R.bool.config_dreamsOnlyEnabledForDockUser);
|
||||
return (dreamsSupported && (!dreamsOnlyEnabledForDockUser
|
||||
|| Utils.canCurrentUserDream(mContext)))
|
||||
? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
return Utils.areDreamsAvailableToCurrentUser(mContext) ? AVAILABLE : UNSUPPORTED_ON_DEVICE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
Reference in New Issue
Block a user