summaryrefslogtreecommitdiffstats
path: root/src/com/android
diff options
context:
space:
mode:
authoralanv <alanv@google.com>2012-10-17 13:15:47 -0700
committeralanv <alanv@google.com>2012-10-17 13:15:47 -0700
commit1d4fde686433ddfa7f940e298d935433ecfed8eb (patch)
tree8894d6bb3fd2596269b9acdc68dff391f1af2917 /src/com/android
parent0c2388a40c3435615afa1e9b424549d29a98f44e (diff)
downloadandroid_packages_apps_Trebuchet-1d4fde686433ddfa7f940e298d935433ecfed8eb.tar.gz
android_packages_apps_Trebuchet-1d4fde686433ddfa7f940e298d935433ecfed8eb.tar.bz2
android_packages_apps_Trebuchet-1d4fde686433ddfa7f940e298d935433ecfed8eb.zip
Send correctly populated Accessibility event on Launcher state change.
Bug: 7362253 Change-Id: I72811292e8091a21866cb4599d37a71eb475b1d5
Diffstat (limited to 'src/com/android')
-rw-r--r--src/com/android/launcher2/Launcher.java17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/com/android/launcher2/Launcher.java b/src/com/android/launcher2/Launcher.java
index 6fcda8a13..2c44496fc 100644
--- a/src/com/android/launcher2/Launcher.java
+++ b/src/com/android/launcher2/Launcher.java
@@ -2784,8 +2784,9 @@ public final class Launcher extends Activity
mUserPresent = true;
updateRunning();
- // send an accessibility event to announce the context change
- getWindow().getDecorView().sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
+ // Send an accessibility event to announce the context change
+ getWindow().getDecorView()
+ .sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}
void showAllApps(boolean animated) {
@@ -2803,7 +2804,8 @@ public final class Launcher extends Activity
closeFolder();
// Send an accessibility event to announce the context change
- getWindow().getDecorView().sendAccessibilityEvent(AccessibilityEvent.TYPE_VIEW_SELECTED);
+ getWindow().getDecorView()
+ .sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED);
}
void enterSpringLoadedDragMode() {
@@ -3177,10 +3179,15 @@ public final class Launcher extends Activity
@Override
public boolean dispatchPopulateAccessibilityEvent(AccessibilityEvent event) {
- boolean result = super.dispatchPopulateAccessibilityEvent(event);
+ final boolean result = super.dispatchPopulateAccessibilityEvent(event);
final List<CharSequence> text = event.getText();
text.clear();
- text.add(getString(R.string.home));
+ // Populate event with a fake title based on the current state.
+ if (mState == State.APPS_CUSTOMIZE) {
+ text.add(getString(R.string.all_apps_button_label));
+ } else {
+ text.add(getString(R.string.all_apps_home_button_label));
+ }
return result;
}