Settings: Disable USB preferences if USB signaling is off
* When developer options is turned
off and on again, 'Default USB
configuration' and 'Disable USB
audio routing' should not be enabled
if USB data signaling is disabled.
Manual testing:
* Disable USB data signaling
* Verify preferences are disabled
* Turn developer options off and on
* Verify preferences remain disabled
Bug: 180711035
Test: manual testing
make RunSettingsRoboTests -j ROBOTEST_FILTER=UsbAudioRoutingPreferenceControllerTest
make RunSettingsRoboTests -j ROBOTEST_FILTER=DefaultUsbConfigurationPreferenceControllerTest
Change-Id: Id08228da812b7534e2217b0c3f30a7ac989f7553
This commit is contained in:
@@ -83,4 +83,11 @@ public class UsbAudioRoutingPreferenceController extends DeveloperOptionsPrefere
|
||||
Settings.Secure.USB_AUDIO_AUTOMATIC_ROUTING_DISABLED, SETTING_VALUE_OFF);
|
||||
((SwitchPreference) mPreference).setChecked(false);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected void onDeveloperOptionsSwitchEnabled() {
|
||||
super.onDeveloperOptionsSwitchEnabled();
|
||||
mPreference.setDisabledByAdmin(
|
||||
checkIfUsbDataSignalingIsDisabled(mContext, UserHandle.myUserId()));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user