summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHyunyoung Song <hyunyoungs@google.com>2015-05-28 14:45:59 -0700
committerHyunyoung Song <hyunyoungs@google.com>2015-05-28 14:45:59 -0700
commit89aeda1b78907fefe259df770a01f490d4901128 (patch)
treece291f70d2094dfe7606787944cd4ec481a2584b /src
parenta6095969bb5938ad95ee9f858970d5eb54eb124d (diff)
downloadandroid_packages_apps_Trebuchet-89aeda1b78907fefe259df770a01f490d4901128.tar.gz
android_packages_apps_Trebuchet-89aeda1b78907fefe259df770a01f490d4901128.tar.bz2
android_packages_apps_Trebuchet-89aeda1b78907fefe259df770a01f490d4901128.zip
Guard against monkey actor test NPE inside FocusHelper
b/19626762 Change-Id: Icaff5931f4076323855f23e7165b0e78a11241b6
Diffstat (limited to 'src')
-rw-r--r--src/com/android/launcher3/FocusHelper.java6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/com/android/launcher3/FocusHelper.java b/src/com/android/launcher3/FocusHelper.java
index e60704718..0dca07843 100644
--- a/src/com/android/launcher3/FocusHelper.java
+++ b/src/com/android/launcher3/FocusHelper.java
@@ -284,6 +284,12 @@ public class FocusHelper {
if (workspace != null) {
int pageIndex = workspace.getCurrentPage();
CellLayout topLayout = (CellLayout) workspace.getChildAt(pageIndex);
+ if (topLayout == null) {
+ // This is to guard against monkey actor test where the cell layout
+ // of the new pageIndex is null monkey issuing commands while
+ // animations happen.
+ return wasHandled;
+ }
ShortcutAndWidgetContainer children = topLayout.getShortcutsAndWidgets();
final View newIcon = getIconInDirection(layout, children, -1, 1);
// Select the first bubble text view in the current page of the workspace