Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 056ba8cf authored by Bruno Martins's avatar Bruno Martins
Browse files

ButtonSettings: Remove power button preference category if empty

Test: Preference category doesn't show on WiFi-only tablet with no flashlight.

Change-Id: Ibc51e90f731b96039535c98893421755dfab03be
parent cfe52298
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -255,6 +255,10 @@ public class ButtonSettings extends SettingsPreferenceFragment
                powerCategory.removePreference(mTorchLongPressPowerGesture);
                powerCategory.removePreference(mTorchLongPressPowerTimeout);
            }
            if (!TelephonyUtils.isVoiceCapable(getActivity()) &&
                    !DeviceUtils.deviceSupportsFlashLight(getActivity())) {
                prefScreen.removePreference(powerCategory);
            }
        } else {
            prefScreen.removePreference(powerCategory);
        }