fix two crashes
* fix crash where Workspace gets an ACTION_MOVE
but didn't get the ACTION_DOWN before it
* fix crash in DimmableBubbleTextView on
non-xlarge devices (buganizer bug#3001211)
Change-Id: I419b4a9fd3c95df9949f1d46746845ad2dc4b831
diff --git a/res/layout-land/application.xml b/res/layout-land/application.xml
index 846c81c..6e8c31e 100644
--- a/res/layout-land/application.xml
+++ b/res/layout-land/application.xml
@@ -14,5 +14,5 @@
limitations under the License.
-->
-<com.android.launcher2.DimmableBubbleTextView xmlns:android="http://schemas.android.com/apk/res/android"
+<com.android.launcher2.BubbleTextView xmlns:android="http://schemas.android.com/apk/res/android"
style="@style/WorkspaceIcon.Landscape" />
diff --git a/res/layout-port/application.xml b/res/layout-port/application.xml
index ec66976..32c1510 100644
--- a/res/layout-port/application.xml
+++ b/res/layout-port/application.xml
@@ -4,9 +4,9 @@
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-
+
http://www.apache.org/licenses/LICENSE-2.0
-
+
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
@@ -14,5 +14,5 @@
limitations under the License.
-->
-<com.android.launcher2.DimmableBubbleTextView xmlns:android="http://schemas.android.com/apk/res/android"
- style="@style/WorkspaceIcon.Portrait" />
+<com.android.launcher2.BubbleTextView xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/WorkspaceIcon.Portrait" />
diff --git a/res/layout-xlarge-land/application.xml b/res/layout-xlarge-land/application.xml
new file mode 100644
index 0000000..d0c8d9b
--- /dev/null
+++ b/res/layout-xlarge-land/application.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<com.android.launcher2.DimmableBubbleTextView xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/WorkspaceIcon.Landscape" />
\ No newline at end of file
diff --git a/res/layout-xlarge-port/application.xml b/res/layout-xlarge-port/application.xml
new file mode 100644
index 0000000..ec66976
--- /dev/null
+++ b/res/layout-xlarge-port/application.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2008 The Android Open Source Project
+
+ Licensed under the Apache License, Version 2.0 (the "License");
+ you may not use this file except in compliance with the License.
+ You may obtain a copy of the License at
+
+ http://www.apache.org/licenses/LICENSE-2.0
+
+ Unless required by applicable law or agreed to in writing, software
+ distributed under the License is distributed on an "AS IS" BASIS,
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ See the License for the specific language governing permissions and
+ limitations under the License.
+-->
+
+<com.android.launcher2.DimmableBubbleTextView xmlns:android="http://schemas.android.com/apk/res/android"
+ style="@style/WorkspaceIcon.Portrait" />
diff --git a/src/com/android/launcher2/PagedView.java b/src/com/android/launcher2/PagedView.java
index ebb28f9..1e0dad4 100644
--- a/src/com/android/launcher2/PagedView.java
+++ b/src/com/android/launcher2/PagedView.java
@@ -545,15 +545,21 @@
return true;
}
-
switch (action & MotionEvent.ACTION_MASK) {
case MotionEvent.ACTION_MOVE: {
/*
* mIsBeingDragged == false, otherwise the shortcut would have caught it. Check
* whether the user has moved far enough from his original down touch.
*/
- determineScrollingStart(ev);
- break;
+ if (mActivePointerId != INVALID_POINTER) {
+ determineScrollingStart(ev);
+ break;
+ }
+ // if mActivePointerId is INVALID_POINTER, then we must have missed an ACTION_DOWN
+ // event. in that case, treat the first occurence of a move event as a ACTION_DOWN
+ // i.e. fall through to the next case (don't break)
+ // (We sometimes miss ACTION_DOWN events in Workspace because it ignores all events
+ // while it's small- this was causing a crash before we checked for INVALID_POINTER)
}
case MotionEvent.ACTION_DOWN: {