Hide Device Lock settings screen if device lock manager is not available
Bug: 285999016 Test: atest DeviceLockPreferenceControllerTest Change-Id: Ice9e8c27d3e6171306e0ad4e6bc58d9454ce0c60
This commit is contained in:
@@ -47,6 +47,11 @@ public final class DeviceLockPreferenceController extends BasePreferenceControll
|
||||
@Override
|
||||
public void updateState(Preference preference) {
|
||||
super.updateState(preference);
|
||||
if (mDeviceLockManager == null) {
|
||||
Log.w(TAG, "DeviceLockManager is not available");
|
||||
preference.setVisible(false);
|
||||
return;
|
||||
}
|
||||
mDeviceLockManager.getKioskApps(mContext.getMainExecutor(),
|
||||
result -> {
|
||||
// if kiosk apps present on the device, the device is provisioned by Device Lock
|
||||
|
||||
Reference in New Issue
Block a user