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

Commit edb31e13 authored by davidln's avatar davidln Committed by David Nelloms
Browse files

Correct null check for end button behavior.

SettingsState.getSettingLocked never returns a null value, so the car_product overlay value of this setting is always ignored. PhoneWindowManager then uses a hardcoded default with undesired behavior for the car. Checking the null indicator on the returned value allows the setting to be initialized properly.

Fixes: 113123033

Test: adb shell input keyevent 6 before and after change, verify desired behavior
Change-Id: Ib2b64331ae986efda6bb961d487e4de023c43d84
parent b16030f3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -3285,8 +3285,8 @@ public class SettingsProvider extends ContentProvider {
                if (currentVersion == 133) {
                    // Version 133: Add default end button behavior
                    final SettingsState systemSettings = getSystemSettingsLocked(userId);
                    if (systemSettings.getSettingLocked(Settings.System.END_BUTTON_BEHAVIOR) ==
                            null) {
                    if (systemSettings.getSettingLocked(Settings.System.END_BUTTON_BEHAVIOR)
                            .isNull()) {
                        String defaultEndButtonBehavior = Integer.toString(getContext()
                                .getResources().getInteger(R.integer.def_end_button_behavior));
                        systemSettings.insertSettingLocked(Settings.System.END_BUTTON_BEHAVIOR,