summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorVadim Tryshev <vadimt@google.com>2015-08-11 23:21:04 (GMT)
committerVadim Tryshev <vadimt@google.com>2015-08-12 00:50:35 (GMT)
commitcc436d5d95af1aff9d486ce25f7965d159f871bb (patch)
tree49593675b4cf2da0b5ee75cdc9f0e961d380980c
parenta2917f6a0b9a24accaf21d75c0e80701bb07e2ed (diff)
downloadandroid_packages_apps_Trebuchet-cc436d5d95af1aff9d486ce25f7965d159f871bb.zip
android_packages_apps_Trebuchet-cc436d5d95af1aff9d486ce25f7965d159f871bb.tar.gz
android_packages_apps_Trebuchet-cc436d5d95af1aff9d486ce25f7965d159f871bb.tar.bz2
Fixing crash upon cancellation of an accessible drag.
This fixes perhaps an old bug. If we started an accessible drag for an only item on a page, then uninstalled the app while dragging, the page was removed without unsetting its accessibility delegate. Later, the system asks the delegate to do something, but the drag is over, and some pointers are null, so everything crashes. Fixing this. Bug: 22028725 Change-Id: I85adcd42ae896603634994e20a7790792f7e84b1 (cherry picked from commit de1e67c38856ab1253426bfb4f892895eeb5f6d9)
-rw-r--r--src/com/android/launcher3/Workspace.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/com/android/launcher3/Workspace.java b/src/com/android/launcher3/Workspace.java
index e83ef7c..08e6429 100644
--- a/src/com/android/launcher3/Workspace.java
+++ b/src/com/android/launcher3/Workspace.java
@@ -887,6 +887,9 @@ public class Workspace extends PagedView
}
}
+ LauncherAccessibilityDelegate delegate =
+ LauncherAppState.getInstance().getAccessibilityDelegate();
+
// We enforce at least one page to add new items to. In the case that we remove the last
// such screen, we convert the last screen to the empty screen
int minScreens = 1 + numCustomPages();
@@ -901,6 +904,11 @@ public class Workspace extends PagedView
if (indexOfChild(cl) < currentPage) {
pageShift++;
}
+
+ if (delegate != null && delegate.isInAccessibleDrag()) {
+ cl.enableAccessibleDrag(false, CellLayout.WORKSPACE_ACCESSIBILITY_DRAG);
+ }
+
removeView(cl);
} else {
// if this is the last non-custom content screen, convert it to the empty screen