summaryrefslogtreecommitdiffstats
path: root/services/java/com
diff options
context:
space:
mode:
authorSvetoslav Ganov <svetoslavganov@google.com>2011-06-28 01:12:41 -0700
committerSvetoslav Ganov <svetoslavganov@google.com>2011-07-21 12:04:54 -0700
commit6179ea3196e9306d3f14361fe9ef14191b1edba6 (patch)
treed821da4d5840aebcddf4a714a3217ec595847bc9 /services/java/com
parentac4159549c10dbe428d42980278c0e43ecc8d93f (diff)
downloadframeworks_base-6179ea3196e9306d3f14361fe9ef14191b1edba6.zip
frameworks_base-6179ea3196e9306d3f14361fe9ef14191b1edba6.tar.gz
frameworks_base-6179ea3196e9306d3f14361fe9ef14191b1edba6.tar.bz2
Adding accessibility support to the Status Bar.
1. Added content description to pretty much all animals in the zoo including buttons in the navigation bar, notifications and status icons for battery, signal, data, etc. 2. Rectored to avoid ovelaying views since they block touch exploratino. In general overlaying views cause trouble for touch exploration and accessibility in general. 3. Avoid sending accessibility events in case the user is touching outside of the StatauBAr panels to avoid confusion. 4. Added records to accessibility events in the places where this would help the presentation. So the event comes from a given "leaf" view and its predecessor is adding a record to the event for itself to provide more cotext. It is up to the accessiiblity service to choose how to present that. bug:4686943 Change-Id: I1c1bd123d828fb10911bca92130e9a05c1f020b3
Diffstat (limited to 'services/java/com')
-rw-r--r--services/java/com/android/server/InputMethodManagerService.java12
-rw-r--r--services/java/com/android/server/StatusBarManagerService.java10
2 files changed, 17 insertions, 5 deletions
diff --git a/services/java/com/android/server/InputMethodManagerService.java b/services/java/com/android/server/InputMethodManagerService.java
index 2597978..7399679 100644
--- a/services/java/com/android/server/InputMethodManagerService.java
+++ b/services/java/com/android/server/InputMethodManagerService.java
@@ -50,6 +50,7 @@ import android.content.ServiceConnection;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.PackageManager;
+import android.content.pm.PackageManager.NameNotFoundException;
import android.content.pm.ResolveInfo;
import android.content.pm.ServiceInfo;
import android.content.res.Configuration;
@@ -1046,7 +1047,16 @@ public class InputMethodManagerService extends IInputMethodManager.Stub
mStatusBar.setIconVisibility("ime", false);
} else if (packageName != null) {
if (DEBUG) Slog.d(TAG, "show a small icon for the input method");
- mStatusBar.setIcon("ime", packageName, iconId, 0);
+ CharSequence contentDescription = null;
+ try {
+ PackageManager packageManager = mContext.getPackageManager();
+ contentDescription = packageManager.getApplicationLabel(
+ packageManager.getApplicationInfo(packageName, 0));
+ } catch (NameNotFoundException nnfe) {
+ /* ignore */
+ }
+ mStatusBar.setIcon("ime", packageName, iconId, 0,
+ contentDescription != null ? contentDescription.toString() : null);
mStatusBar.setIconVisibility("ime", true);
}
}
diff --git a/services/java/com/android/server/StatusBarManagerService.java b/services/java/com/android/server/StatusBarManagerService.java
index 286a937..4ced83c 100644
--- a/services/java/com/android/server/StatusBarManagerService.java
+++ b/services/java/com/android/server/StatusBarManagerService.java
@@ -22,10 +22,10 @@ import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.content.res.Resources;
-import android.os.IBinder;
-import android.os.RemoteException;
import android.os.Binder;
import android.os.Handler;
+import android.os.IBinder;
+import android.os.RemoteException;
import android.util.Slog;
import android.view.View;
@@ -175,7 +175,8 @@ public class StatusBarManagerService extends IStatusBarService.Stub
}
}
- public void setIcon(String slot, String iconPackage, int iconId, int iconLevel) {
+ public void setIcon(String slot, String iconPackage, int iconId, int iconLevel,
+ String contentDescription) {
enforceStatusBar();
synchronized (mIcons) {
@@ -184,7 +185,8 @@ public class StatusBarManagerService extends IStatusBarService.Stub
throw new SecurityException("invalid status bar icon slot: " + slot);
}
- StatusBarIcon icon = new StatusBarIcon(iconPackage, iconId, iconLevel);
+ StatusBarIcon icon = new StatusBarIcon(iconPackage, iconId, iconLevel, 0,
+ contentDescription);
//Slog.d(TAG, "setIcon slot=" + slot + " index=" + index + " icon=" + icon);
mIcons.setIcon(index, icon);