summaryrefslogtreecommitdiffstats
path: root/src/com/android/launcher3/CellLayout.java
diff options
context:
space:
mode:
authorSunny Goyal <sunnygoyal@google.com>2014-07-22 12:13:14 -0700
committerSunny Goyal <sunnygoyal@google.com>2014-07-24 09:33:15 -0700
commit33a152fa4958b5c0b8c4b2f3857d62809862d15f (patch)
tree1d4ac12e2e3f9039efa7da9a3aac358f0b30bff2 /src/com/android/launcher3/CellLayout.java
parent82cc3fe6c77322d93ff74b25354e4bca77ab4a83 (diff)
downloadandroid_packages_apps_Trebuchet-33a152fa4958b5c0b8c4b2f3857d62809862d15f.tar.gz
android_packages_apps_Trebuchet-33a152fa4958b5c0b8c4b2f3857d62809862d15f.tar.bz2
android_packages_apps_Trebuchet-33a152fa4958b5c0b8c4b2f3857d62809862d15f.zip
Merging motorola's patch to prevent crashes on view id mess up
issue: 15517526 Change-Id: Ib15b3dc2f5ed4e488f5d172ed02ccb72741d5980
Diffstat (limited to 'src/com/android/launcher3/CellLayout.java')
-rw-r--r--src/com/android/launcher3/CellLayout.java17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/com/android/launcher3/CellLayout.java b/src/com/android/launcher3/CellLayout.java
index 8ca8d9105..107376482 100644
--- a/src/com/android/launcher3/CellLayout.java
+++ b/src/com/android/launcher3/CellLayout.java
@@ -30,8 +30,6 @@ import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;
import android.graphics.Point;
-import android.graphics.PorterDuff;
-import android.graphics.PorterDuffXfermode;
import android.graphics.Rect;
import android.graphics.drawable.ColorDrawable;
import android.graphics.drawable.Drawable;
@@ -169,8 +167,6 @@ public class CellLayout extends ViewGroup {
private Rect mTempRect = new Rect();
- private final static PorterDuffXfermode sAddBlendMode =
- new PorterDuffXfermode(PorterDuff.Mode.ADD);
private final static Paint sPaint = new Paint();
public CellLayout(Context context) {
@@ -579,7 +575,15 @@ public class CellLayout extends ViewGroup {
}
public void restoreInstanceState(SparseArray<Parcelable> states) {
- dispatchRestoreInstanceState(states);
+ try {
+ dispatchRestoreInstanceState(states);
+ } catch (IllegalArgumentException ex) {
+ if (LauncherAppState.isDogfoodBuild()) {
+ throw ex;
+ }
+ // Mismatched viewId / viewType preventing restore. Skip restore on production builds.
+ Log.e(TAG, "Ignoring an error while restoring a view instance state", ex);
+ }
}
@Override
@@ -700,9 +704,6 @@ public class CellLayout extends ViewGroup {
// First we clear the tag to ensure that on every touch down we start with a fresh slate,
// even in the case where we return early. Not clearing here was causing bugs whereby on
// long-press we'd end up picking up an item from a previous drag operation.
- final int action = ev.getAction();
-
-
if (mInterceptTouchListener != null && mInterceptTouchListener.onTouch(this, ev)) {
return true;
}