summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author Jorim Jaggi <jjaggi@google.com> 2016-02-03 18:28:49 -0800
committer Jorim Jaggi <jjaggi@google.com> 2016-02-04 14:36:35 -0800
commitdefd9225e65a5111833ab3f08e29b394571532d8 (patch)
treec8c2870d0422522d7df4c4300c318c0f6d14fba1
parent95085d154b1ea6b4db3ae14d39a1c8c8a6560f78 (diff)
Fix crash in SysUI when configuration changes
Bug: 26913675 Change-Id: Ib36e5fcdd22197317f1b99a3aec8a46896a8cc36
-rw-r--r--packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java11
1 files changed, 8 insertions, 3 deletions
diff --git a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
index 1e11fa81f3bc..3095e17f5e90 100644
--- a/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
+++ b/packages/SystemUI/src/com/android/systemui/stackdivider/DividerView.java
@@ -192,7 +192,7 @@ public class DividerView extends FrameLayout implements OnTouchListener,
insets.getStableInsetRight(), insets.getStableInsetBottom());
if (mSnapAlgorithm != null) {
mSnapAlgorithm = null;
- getSnapAlgorithm();
+ initializeSnapAlgorithm();
}
}
return super.onApplyWindowInsets(insets);
@@ -211,7 +211,7 @@ public class DividerView extends FrameLayout implements OnTouchListener,
mHandle.setTouching(true, animate);
}
mDockSide = mWindowManagerProxy.getDockSide();
- getSnapAlgorithm();
+ initializeSnapAlgorithm();
if (mDockSide != WindowManager.DOCKED_INVALID) {
mWindowManagerProxy.setResizing(true);
mWindowManager.setSlippery(false);
@@ -239,11 +239,15 @@ public class DividerView extends FrameLayout implements OnTouchListener,
releaseBackground();
}
- public DividerSnapAlgorithm getSnapAlgorithm() {
+ private void initializeSnapAlgorithm() {
if (mSnapAlgorithm == null) {
mSnapAlgorithm = new DividerSnapAlgorithm(getContext().getResources(), mDisplayWidth,
mDisplayHeight, mDividerSize, isHorizontalDivision(), mStableInsets);
}
+ }
+
+ public DividerSnapAlgorithm getSnapAlgorithm() {
+ initializeSnapAlgorithm();
return mSnapAlgorithm;
}
@@ -421,6 +425,7 @@ public class DividerView extends FrameLayout implements OnTouchListener,
mDisplayWidth = info.logicalWidth;
mDisplayHeight = info.logicalHeight;
mSnapAlgorithm = null;
+ initializeSnapAlgorithm();
}
private int calculatePosition(int touchX, int touchY) {