[a11y] fix the issue where launcher announces item added to homescreen before
it does
Test:
1. long press on home screen -> widgets
2. enable talkback
3. add a custom shortcut to home screen (i.e. 1x1 widgets, e.g. drive
scan in Google Drive, Driving Mode in Google Maps ... e.t.c )
4. verify talkback announces "item addded to homescreen" after it does
get added to the homescreen
5. repeat the same test for widgets (e.g. calendar)
Bug: 141527338
Change-Id: I232e6e796c9edb81128f816c71a33310c3700e73
diff --git a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
index 0c12c60..a7ef9ef 100644
--- a/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
+++ b/src/com/android/launcher3/accessibility/LauncherAccessibilityDelegate.java
@@ -191,6 +191,7 @@
ArrayList<ItemInfo> itemList = new ArrayList<>();
itemList.add(info);
mLauncher.bindItems(itemList, true);
+ announceConfirmation(R.string.item_added_to_workspace);
} else if (item instanceof PendingAddItemInfo) {
PendingAddItemInfo info = (PendingAddItemInfo) item;
Workspace workspace = mLauncher.getWorkspace();
@@ -198,7 +199,6 @@
mLauncher.addPendingItem(info, Favorites.CONTAINER_DESKTOP,
screenId, coordinates, info.spanX, info.spanY);
}
- announceConfirmation(R.string.item_added_to_workspace);
}
});
return true;