Merge "Only apply back gesture device config if there are existing insets" into rvc-d1-dev am: f7a4faa241

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/12272603

Change-Id: I60642aa24d0d3ac575b4d4b9dd9ac1441a32fd48
This commit is contained in:
Winson Chung
2020-07-31 16:51:39 +00:00
committed by Automerger Merge Worker

View File

@@ -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(