OSDN Git Service

Null check in accessibility delegate
authorSunny Goyal <sunnygoyal@google.com>
Mon, 1 Jun 2015 17:09:06 +0000 (10:09 -0700)
committerSunny Goyal <sunnygoyal@google.com>
Mon, 1 Jun 2015 17:10:28 +0000 (10:10 -0700)
bug: 21338696
Change-Id: I00d67e53e03e33b26a8eadb669b60fec47553f26

src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java

index eeec8c5..93cf8d0 100644 (file)
@@ -219,9 +219,13 @@ public class LauncherAccessibilityDelegate extends AccessibilityDelegate {
     }
 
     private ArrayList<Integer> getSupportedResizeActions(View host, LauncherAppWidgetInfo info) {
-        AppWidgetProviderInfo providerInfo = ((LauncherAppWidgetHostView) host).getAppWidgetInfo();
         ArrayList<Integer> actions = new ArrayList<>();
 
+        AppWidgetProviderInfo providerInfo = ((LauncherAppWidgetHostView) host).getAppWidgetInfo();
+        if (providerInfo == null) {
+            return actions;
+        }
+
         CellLayout layout = (CellLayout) host.getParent().getParent();
         if ((providerInfo.resizeMode & AppWidgetProviderInfo.RESIZE_HORIZONTAL) != 0) {
             if (layout.isRegionVacant(info.cellX + info.spanX, info.cellY, 1, info.spanY) ||