Show reboot dialog when users disable developer options

When NFC detailed logging mechanisms are enabled and users try to
disable develoepr options, show reboot request dialog to make sure
NFC logging mechanisms are also disabled.

Bug: 204397062
Test: manual
Merged-In: I531c85fd77934ad7821c480df07465a8cd8f24f9
Change-Id: I531c85fd77934ad7821c480df07465a8cd8f24f9
(cherry picked from commit d270f29cc8)
This commit is contained in:
Jack Yu
2022-08-04 09:52:30 +00:00
committed by Henri Chataing
parent 8f1794043c
commit d91e7a0565

View File

@@ -301,10 +301,19 @@ public class DevelopmentSettingsDashboardFragment extends RestrictedDashboardFra
final BluetoothLeAudioHwOffloadPreferenceController leAudioController =
getDevelopmentOptionsController(
BluetoothLeAudioHwOffloadPreferenceController.class);
final NfcSnoopLogPreferenceController nfcSnoopLogController =
getDevelopmentOptionsController(
NfcSnoopLogPreferenceController.class);
final NfcVerboseVendorLogPreferenceController nfcVerboseLogController =
getDevelopmentOptionsController(
NfcVerboseVendorLogPreferenceController.class);
// If hardware offload isn't default value, we must reboot after disable
// developer options. Show a dialog for the user to confirm.
if ((a2dpController == null || a2dpController.isDefaultValue())
&& (leAudioController == null || leAudioController.isDefaultValue())) {
&& (leAudioController == null || leAudioController.isDefaultValue())
&& (nfcSnoopLogController == null || nfcSnoopLogController.isDefaultValue())
&& (nfcVerboseLogController == null
|| nfcVerboseLogController.isDefaultValue())) {
disableDeveloperOptions();
} else {
DisableDevSettingsDialogFragment.show(this /* host */);