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

Commit a8a07f1f authored by Winson Chung's avatar Winson Chung
Browse files

Only apply back gesture device config if there are existing insets

Bug: 161995292
Test: Change navigation modes and verify the insets are correct
Change-Id: I4d940099b7fdc00c129f60dc6b3d0cb470b7f42e
parent 379eb5c2
Loading
Loading
Loading
Loading
+5 −2
Original line number Diff line number Diff line
@@ -103,8 +103,11 @@ public class GestureNavigationSettingsObserver extends ContentObserver {
        final DisplayMetrics dm = userRes.getDisplayMetrics();
        final float defaultInset = userRes.getDimension(
                com.android.internal.R.dimen.config_backGestureInset) / dm.density;
        final float backGestureInset = DeviceConfig.getFloat(DeviceConfig.NAMESPACE_SYSTEMUI,
                BACK_GESTURE_EDGE_WIDTH, defaultInset);
        // Only apply the back gesture config if there is an existing inset
        final float backGestureInset = defaultInset > 0
                ? DeviceConfig.getFloat(DeviceConfig.NAMESPACE_SYSTEMUI,
                        BACK_GESTURE_EDGE_WIDTH, defaultInset)
                : defaultInset;
        final float inset = TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, backGestureInset,
                dm);
        final float scale = Settings.Secure.getFloatForUser(