diff options
author | Svetoslav Ganov <svetoslavganov@google.com> | 2012-10-08 15:51:14 -0700 |
---|---|---|
committer | Android (Google) Code Review <android-gerrit@google.com> | 2012-10-08 15:51:15 -0700 |
commit | 62f1722d7c168048952f93045c5f1d06fdab0202 (patch) | |
tree | 7dfb2b61dd5afda1783c4d31b3bcadd505bd6061 | |
parent | 0fb7e32a0129e9e62d58ea652cc00f8a908d65b5 (diff) | |
parent | bac221ff0b9e1406f95f23c9a5c3b580ece10eab (diff) | |
download | frameworks_base-62f1722d7c168048952f93045c5f1d06fdab0202.zip frameworks_base-62f1722d7c168048952f93045c5f1d06fdab0202.tar.gz frameworks_base-62f1722d7c168048952f93045c5f1d06fdab0202.tar.bz2 |
Merge "Accessibility enhancements within quick settings and notification shade." into jb-mr1-dev
9 files changed, 156 insertions, 28 deletions
diff --git a/packages/SystemUI/res/values/strings.xml b/packages/SystemUI/res/values/strings.xml index 1b98286..7ac27fe 100644 --- a/packages/SystemUI/res/values/strings.xml +++ b/packages/SystemUI/res/values/strings.xml @@ -256,16 +256,18 @@ <!-- Content description of the data signal when it is full for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> <string name="accessibility_data_signal_full">Data signal full.</string> + <!-- Content description of the WIFI signal when WIFI is disabled for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_wifi_off">Wifi off.</string> <!-- Content description of the WIFI signal when no signal for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> - <string name="accessibility_no_wifi">No Wi-Fi.</string> + <string name="accessibility_no_wifi">Wifi disconnected.</string> <!-- Content description of the WIFI signal when it is one bar for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> - <string name="accessibility_wifi_one_bar">Wi-Fi one bar.</string> + <string name="accessibility_wifi_one_bar">Wifi one bar.</string> <!-- Content description of the WIFI signal when it is two bars for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> - <string name="accessibility_wifi_two_bars">Wi-Fi two bars.</string> + <string name="accessibility_wifi_two_bars">Wifi two bars.</string> <!-- Content description of the WIFI signal when it is three bars for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> - <string name="accessibility_wifi_three_bars">Wi-Fi three bars.</string> + <string name="accessibility_wifi_three_bars">Wifi three bars.</string> <!-- Content description of the WIFI signal when it is full for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> - <string name="accessibility_wifi_signal_full">Wi-Fi signal full.</string> + <string name="accessibility_wifi_signal_full">Wifi signal full.</string> <!-- Content description of the WiMAX signal when no signal for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> <string name="accessibility_no_wimax">No WiMAX.</string> @@ -278,9 +280,37 @@ <!-- Content description of the WiMAX signal when it is full for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> <string name="accessibility_wimax_signal_full">WiMAX signal full.</string> + <!-- Content description of an item with no signal for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_no_signal">No signal.</string> + <!-- Content description of an item with no signal and no connection for accessibility (not shown on the screen) [CHAR LIMIT=NONE] --> + <string name="accessibility_not_connected">Not connected.</string> + <!-- Content description of an item with zero signal bars for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_zero_bars">Zero bars.</string> + <!-- Content description of an item with one signal bar for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_one_bar">One bar.</string> + <!-- Content description of an item with two signal bars for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_two_bars">Two bars.</string> + <!-- Content description of an item with three signal bars for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_three_bars">Three bars.</string> + <!-- Content description of an item with full signal for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_signal_full">Signal full.</string> + + <!-- Content description of an item that is turned on for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_desc_on">On.</string> + <!-- Content description of an item that is turned off for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_desc_off">Off.</string> + <!-- Content description of an item that is connected for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_desc_connected">Connected.</string> + <!-- Content description of the data connection type GPRS for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> <string name="accessibility_data_connection_gprs">GPRS</string> + <!-- Content description of the data connection type 1x for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_data_connection_1x">1 X</string> + + <!-- Content description of the data connection type HSPA and its variants for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_data_connection_hspa">HSPA</string> + <!-- Content description of the data connection type 3G for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> <string name="accessibility_data_connection_3g">3G</string> @@ -293,6 +323,9 @@ <!-- Content description of the data connection type CDMA for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> <string name="accessibility_data_connection_cdma">CDMA</string> + <!-- Content description of the roaming data connection type for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_data_connection_roaming">Roaming</string> + <!-- Content description of the data connection type Edge for accessibility (not shown on the screen). [CHAR LIMIT=NONE] --> <string name="accessibility_data_connection_edge">Edge</string> @@ -337,6 +370,28 @@ <!-- Content description to tell the user an application has been removed from recents --> <string name="accessibility_recents_item_dismissed"><xliff:g id="app" example="Calendar">%s</xliff:g> dismissed.</string> + <!-- Content description to tell the user a notification has been removed from the notification shade --> + <string name="accessibility_notification_dismissed">Notification dismissed.</string> + + <!-- Content description for the notification shade panel (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_desc_notification_shade">Notification shade.</string> + <!-- Content description for the quick settings panel (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_desc_quick_settings">Quick settings.</string> + + <!-- Content description of the user tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_quick_settings_user">User <xliff:g id="user" example="John Doe">%s</xliff:g>.</string> + <!-- Content description of the wifi tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_quick_settings_wifi"><xliff:g id="signal" example="Three bars">%1$s</xliff:g>. <xliff:g id="network" example="MyWifiNetwork">%2$s</xliff:g></string> + <!-- Content description of the mobile data tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_quick_settings_mobile">Mobile <xliff:g id="signal" example="Three bars">%1$s</xliff:g>. <xliff:g id="type" example="4G">%2$s</xliff:g>. <xliff:g id="network" example="T-Mobile">%3$s</xliff:g>.</string> + <!-- Content description of the battery tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_quick_settings_battery">Battery <xliff:g id="state" example="50% charging">%s</xliff:g>.</string> + <!-- Content description of the airplane mode tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_quick_settings_airplane">Airplane Mode <xliff:g id="state" example="Off">%s</xliff:g>.</string> + <!-- Content description of the bluetooth tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_quick_settings_bluetooth">Bluetooth <xliff:g id="state" example="Off">%s</xliff:g>.</string> + <!-- Content description of the alarm tile in quick settings (not shown on the screen). [CHAR LIMIT=NONE] --> + <string name="accessibility_quick_settings_alarm">Alarm set for <xliff:g id="time" example="Wed 3:30 PM">%s</xliff:g>.</string> <!-- Title of dialog shown when 2G-3G data usage has exceeded limit and has been disabled. [CHAR LIMIT=48] --> <string name="data_usage_disabled_dialog_3g_title">2G-3G data disabled</string> diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java index e88f9cd..3e929d6 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/BaseStatusBar.java @@ -301,8 +301,12 @@ public abstract class BaseStatusBar extends SystemUI implements final int _id = n.id; vetoButton.setOnClickListener(new View.OnClickListener() { public void onClick(View v) { + // Accessibility feedback + v.announceForAccessibility( + mContext.getString(R.string.accessibility_notification_dismissed)); try { mBarService.onNotificationClear(_pkg, _tag, _id); + } catch (RemoteException ex) { // system process is dead if we're here. } @@ -312,6 +316,7 @@ public abstract class BaseStatusBar extends SystemUI implements } else { vetoButton.setVisibility(View.GONE); } + vetoButton.setImportantForAccessibility(View.IMPORTANT_FOR_ACCESSIBILITY_NO); return vetoButton; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java index 32b7c68..c832fb8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/NotificationPanelView.java @@ -44,6 +44,8 @@ public class NotificationPanelView extends PanelView { mHandleBar = resources.getDrawable(R.drawable.status_bar_close); mHandleBarHeight = resources.getDimension(R.dimen.close_handle_height); mHandleView = findViewById(R.id.handle); + + setContentDescription(resources.getString(R.string.accessibility_desc_notification_shade)); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java index 516b1ab..da31861 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/PhoneStatusBarView.java @@ -39,6 +39,7 @@ public class PhoneStatusBarView extends PanelBar { boolean mFullWidthNotifications; PanelView mFadingPanel = null; + PanelView mLastFullyOpenedPanel = null; PanelView mNotificationPanel, mSettingsPanel; private boolean mShouldFade; @@ -145,12 +146,17 @@ public class PhoneStatusBarView extends PanelBar { super.onAllPanelsCollapsed(); mBar.makeExpandedInvisible(); mFadingPanel = null; + mLastFullyOpenedPanel = null; } @Override public void onPanelFullyOpened(PanelView openPanel) { super.onPanelFullyOpened(openPanel); + if (openPanel != mLastFullyOpenedPanel) { + openPanel.sendAccessibilityEvent(AccessibilityEvent.TYPE_WINDOW_STATE_CHANGED); + } mFadingPanel = openPanel; + mLastFullyOpenedPanel = openPanel; mShouldFade = true; // now you own the fade, mister } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java index 2e298d1..e8772df 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettings.java @@ -19,9 +19,12 @@ package com.android.systemui.statusbar.phone; import com.android.internal.view.RotationPolicy; import com.android.internal.widget.LockPatternUtils; import com.android.systemui.R; + +import com.android.systemui.statusbar.phone.QuickSettingsModel.BluetoothState; import com.android.systemui.statusbar.phone.QuickSettingsModel.RSSIState; import com.android.systemui.statusbar.phone.QuickSettingsModel.State; import com.android.systemui.statusbar.phone.QuickSettingsModel.UserState; +import com.android.systemui.statusbar.phone.QuickSettingsModel.WifiState; import com.android.systemui.statusbar.policy.BatteryController; import com.android.systemui.statusbar.policy.BluetoothController; import com.android.systemui.statusbar.policy.BrightnessController; @@ -90,7 +93,7 @@ class QuickSettings { private DisplayManager mDisplayManager; private WifiDisplayStatus mWifiDisplayStatus; private PhoneStatusBar mStatusBarService; - private QuickSettingsModel.BluetoothState mBluetoothState; + private BluetoothState mBluetoothState; private BrightnessController mBrightnessController; private BluetoothController mBluetoothController; @@ -305,6 +308,8 @@ class QuickSettings { if (us.avatar != null) { iv.setImageDrawable(us.avatar); } + view.setContentDescription(mContext.getString( + R.string.accessibility_quick_settings_user, state.label)); } }); parent.addView(userTile); @@ -363,9 +368,14 @@ class QuickSettings { mModel.addWifiTile(wifiTile, new QuickSettingsModel.RefreshCallback() { @Override public void refreshView(QuickSettingsTileView view, State state) { + WifiState wifiState = (WifiState) state; TextView tv = (TextView) view.findViewById(R.id.wifi_textview); - tv.setCompoundDrawablesWithIntrinsicBounds(0, state.iconId, 0, 0); - tv.setText(state.label); + tv.setCompoundDrawablesWithIntrinsicBounds(0, wifiState.iconId, 0, 0); + tv.setText(wifiState.label); + view.setContentDescription(mContext.getString( + R.string.accessibility_quick_settings_wifi, + wifiState.signalContentDescription, + (wifiState.connected) ? wifiState.label : "")); } }); parent.addView(wifiTile); @@ -393,12 +403,17 @@ class QuickSettings { ImageView iov = (ImageView) view.findViewById(R.id.rssi_overlay_image); TextView tv = (TextView) view.findViewById(R.id.rssi_textview); iv.setImageResource(rssiState.signalIconId); + if (rssiState.dataTypeIconId > 0) { iov.setImageResource(rssiState.dataTypeIconId); } else { iov.setImageDrawable(null); } tv.setText(state.label); + view.setContentDescription(mContext.getResources().getString( + R.string.accessibility_quick_settings_mobile, + rssiState.signalContentDescription, rssiState.dataContentDescription, + state.label)); } }); parent.addView(rssiTile); @@ -460,6 +475,8 @@ class QuickSettings { iv.setImageDrawable(d); iv.setImageLevel(batteryState.batteryLevel); tv.setText(t); + view.setContentDescription( + mContext.getString(R.string.accessibility_quick_settings_battery, t)); } }); parent.addView(batteryTile); @@ -473,6 +490,12 @@ class QuickSettings { public void refreshView(QuickSettingsTileView view, State state) { TextView tv = (TextView) view.findViewById(R.id.airplane_mode_textview); tv.setCompoundDrawablesWithIntrinsicBounds(0, state.iconId, 0, 0); + + String airplaneState = mContext.getString( + (state.enabled) ? R.string.accessibility_desc_on + : R.string.accessibility_desc_off); + view.setContentDescription( + mContext.getString(R.string.accessibility_quick_settings_airplane, airplaneState)); tv.setText(state.label); } }); @@ -492,6 +515,7 @@ class QuickSettings { mModel.addBluetoothTile(bluetoothTile, new QuickSettingsModel.RefreshCallback() { @Override public void refreshView(QuickSettingsTileView view, State state) { + BluetoothState bluetoothState = (BluetoothState) state; TextView tv = (TextView) view.findViewById(R.id.bluetooth_textview); tv.setCompoundDrawablesWithIntrinsicBounds(0, state.iconId, 0, 0); @@ -510,6 +534,9 @@ class QuickSettings { btDevices.size()); } */ + view.setContentDescription(mContext.getString( + R.string.accessibility_quick_settings_bluetooth, + bluetoothState.stateContentDescription)); tv.setText(label); } }); @@ -561,6 +588,8 @@ class QuickSettings { TextView tv = (TextView) view.findViewById(R.id.alarm_textview); tv.setText(alarmState.label); view.setVisibility(alarmState.enabled ? View.VISIBLE : View.GONE); + view.setContentDescription(mContext.getString( + R.string.accessibility_quick_settings_alarm, alarmState.label)); } }); parent.addView(alarmTile); @@ -697,7 +726,7 @@ class QuickSettings { showBrightnessDialog(); } } - + private void removeAllBrightnessDialogCallbacks() { mHandler.removeCallbacks(mDismissBrightnessDialogRunnable); } @@ -717,7 +746,7 @@ class QuickSettings { mBrightnessDialog.requestWindowFeature(Window.FEATURE_NO_TITLE); mBrightnessDialog.setContentView(R.layout.quick_settings_brightness_dialog); mBrightnessDialog.setCanceledOnTouchOutside(true); - + mBrightnessController = new BrightnessController(mContext, (ToggleSlider) mBrightnessDialog.findViewById(R.id.brightness_slider)); mBrightnessController.addStateChangedCallback(mModel); @@ -727,7 +756,7 @@ class QuickSettings { mBrightnessController = null; } }); - + mBrightnessDialog.getWindow().setType(WindowManager.LayoutParams.TYPE_SYSTEM_ALERT); mBrightnessDialog.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DIM_BEHIND); } @@ -831,6 +860,7 @@ class QuickSettings { Log.e(TAG, "Couldn't get current user id for profile change", e); } } + } }; } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java index 95cb922..4513dcb 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/QuickSettingsModel.java @@ -71,7 +71,13 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, } static class RSSIState extends State { int signalIconId; + String signalContentDescription; int dataTypeIconId; + String dataContentDescription; + } + static class WifiState extends State { + String signalContentDescription; + boolean connected; } static class UserState extends State { Drawable avatar; @@ -81,6 +87,7 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, } public static class BluetoothState extends State { boolean connected = false; + String stateContentDescription; } /** The callback to update a given tile. */ @@ -182,7 +189,7 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, private QuickSettingsTileView mWifiTile; private RefreshCallback mWifiCallback; - private State mWifiState = new State(); + private WifiState mWifiState = new WifiState(); private QuickSettingsTileView mWifiDisplayTile; private RefreshCallback mWifiDisplayCallback; @@ -371,21 +378,27 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, } // NetworkSignalChanged callback @Override - public void onWifiSignalChanged(boolean enabled, int wifiSignalIconId, String enabledDesc) { + public void onWifiSignalChanged(boolean enabled, int wifiSignalIconId, + String wifiSignalContentDescription, String enabledDesc) { // TODO: If view is in awaiting state, disable Resources r = mContext.getResources(); - mWifiState.enabled = enabled; + boolean wifiConnected = enabled && (wifiSignalIconId > 0) && (enabledDesc != null); boolean wifiNotConnected = (wifiSignalIconId > 0) && (enabledDesc == null); + mWifiState.enabled = enabled; + mWifiState.connected = wifiConnected; if (wifiConnected) { mWifiState.iconId = wifiSignalIconId; mWifiState.label = removeDoubleQuotes(enabledDesc); + mWifiState.signalContentDescription = wifiSignalContentDescription; } else if (wifiNotConnected) { mWifiState.iconId = R.drawable.ic_qs_wifi_0; mWifiState.label = r.getString(R.string.quick_settings_wifi_label); + mWifiState.signalContentDescription = r.getString(R.string.accessibility_no_wifi); } else { mWifiState.iconId = R.drawable.ic_qs_wifi_no_network; mWifiState.label = r.getString(R.string.quick_settings_wifi_off_label); + mWifiState.signalContentDescription = r.getString(R.string.accessibility_wifi_off); } mWifiCallback.refreshView(mWifiTile, mWifiState); } @@ -402,17 +415,24 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, } // NetworkSignalChanged callback @Override - public void onMobileDataSignalChanged(boolean enabled, int mobileSignalIconId, - int dataTypeIconId, String enabledDesc) { + public void onMobileDataSignalChanged( + boolean enabled, int mobileSignalIconId, String signalContentDescription, + int dataTypeIconId, String dataContentDescription, String enabledDesc) { if (deviceSupportsTelephony()) { // TODO: If view is in awaiting state, disable Resources r = mContext.getResources(); mRSSIState.signalIconId = enabled && (mobileSignalIconId > 0) ? mobileSignalIconId : R.drawable.ic_qs_signal_no_signal; + mRSSIState.signalContentDescription = enabled && (mobileSignalIconId > 0) + ? signalContentDescription + : r.getString(R.string.accessibility_no_signal); mRSSIState.dataTypeIconId = enabled && (dataTypeIconId > 0) && !mWifiState.enabled ? dataTypeIconId : 0; + mRSSIState.dataContentDescription = enabled && (dataTypeIconId > 0) && !mWifiState.enabled + ? dataContentDescription + : r.getString(R.string.accessibility_no_data); mRSSIState.label = enabled ? removeTrailingPeriod(enabledDesc) : r.getString(R.string.quick_settings_rssi_emergency_only); @@ -448,13 +468,16 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, if (mBluetoothState.enabled) { if (mBluetoothState.connected) { mBluetoothState.iconId = R.drawable.ic_qs_bluetooth_on; + mBluetoothState.stateContentDescription = r.getString(R.string.accessibility_desc_connected); } else { mBluetoothState.iconId = R.drawable.ic_qs_bluetooth_not_connected; + mBluetoothState.stateContentDescription = r.getString(R.string.accessibility_desc_on); } mBluetoothState.label = r.getString(R.string.quick_settings_bluetooth_label); } else { mBluetoothState.iconId = R.drawable.ic_qs_bluetooth_off; mBluetoothState.label = r.getString(R.string.quick_settings_bluetooth_off_label); + mBluetoothState.stateContentDescription = r.getString(R.string.accessibility_desc_off); } mBluetoothCallback.refreshView(mBluetoothTile, mBluetoothState); } @@ -632,7 +655,7 @@ class QuickSettingsModel implements BluetoothStateChangeCallback, ? mContext.getString(R.string.quick_settings_rotation_locked_label) : mContext.getString(R.string.quick_settings_rotation_unlocked_label); - // may be called before addRotationLockTile due to RotationPolicyListener in QuickSettings + // may be called before addRotationLockTile due to RotationPolicyListener in QuickSettings if (mRotationLockTile != null && mRotationLockCallback != null) { mRotationLockCallback.refreshView(mRotationLockTile, mRotationLockState); } diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java index e555277..4e10fa3 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/SettingsPanelView.java @@ -59,6 +59,8 @@ public class SettingsPanelView extends PanelView { mHandleBar = resources.getDrawable(R.drawable.status_bar_close); mHandleBarHeight = resources.getDimension(R.dimen.close_handle_height); mHandleView = findViewById(R.id.handle); + + setContentDescription(resources.getString(R.string.accessibility_desc_quick_settings)); } @Override diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessibilityContentDescriptions.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessibilityContentDescriptions.java index f45426b..7ac2a98 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessibilityContentDescriptions.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/AccessibilityContentDescriptions.java @@ -10,7 +10,6 @@ import com.android.systemui.R; public class AccessibilityContentDescriptions { private AccessibilityContentDescriptions() {} - static final int[] PHONE_SIGNAL_STRENGTH = { R.string.accessibility_no_phone, R.string.accessibility_phone_one_bar, diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java index 463aacb..bbb90c8 100644 --- a/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java +++ b/packages/SystemUI/src/com/android/systemui/statusbar/policy/NetworkController.java @@ -174,9 +174,11 @@ public class NetworkController extends BroadcastReceiver { } public interface NetworkSignalChangedCallback { - void onWifiSignalChanged(boolean enabled, int wifiSignalIconId, String description); - void onMobileDataSignalChanged(boolean enabled, int mobileSignalIconId, int dataTypeIconId, - String description); + void onWifiSignalChanged(boolean enabled, int wifiSignalIconId, + String wifitSignalContentDescriptionId, String description); + void onMobileDataSignalChanged(boolean enabled, int mobileSignalIconId, + String mobileSignalContentDescriptionId, int dataTypeIconId, + String dataTypeContentDescriptionId, String description); void onAirplaneModeChanged(boolean enabled); } @@ -347,19 +349,23 @@ public class NetworkController extends BroadcastReceiver { boolean wifiEnabled = mWifiEnabled && (mWifiConnected || !mHasMobileDataFeature); String wifiDesc = wifiEnabled ? mWifiSsid : null; - cb.onWifiSignalChanged(wifiEnabled, mQSWifiIconId, wifiDesc); + cb.onWifiSignalChanged(wifiEnabled, mQSWifiIconId, mContentDescriptionWifi, wifiDesc); if (isEmergencyOnly()) { - cb.onMobileDataSignalChanged(false, mQSPhoneSignalIconId, mQSDataTypeIconId, null); + cb.onMobileDataSignalChanged(false, mQSPhoneSignalIconId, + mContentDescriptionPhoneSignal, mQSDataTypeIconId, mContentDescriptionDataType, + null); } else { if (mIsWimaxEnabled && mWimaxConnected) { // Wimax is special - cb.onMobileDataSignalChanged(true, mQSPhoneSignalIconId, mQSDataTypeIconId, - mNetworkName); + cb.onMobileDataSignalChanged(true, mQSPhoneSignalIconId, + mContentDescriptionPhoneSignal, mQSDataTypeIconId, + mContentDescriptionDataType, mNetworkName); } else { // Normal mobile data cb.onMobileDataSignalChanged(mHasMobileDataFeature, mQSPhoneSignalIconId, - mQSDataTypeIconId, mNetworkName); + mContentDescriptionPhoneSignal, mQSDataTypeIconId, + mContentDescriptionDataType, mNetworkName); } } cb.onAirplaneModeChanged(mAirplaneMode); @@ -1005,7 +1011,7 @@ public class NetworkController extends BroadcastReceiver { // - We are connected to mobile data, or // - We are not connected to mobile data, as long as the *reason* packets are not // being routed over that link is that we have better connectivity via wifi. - // If data is disconnected for some other reason but wifi (or ethernet/bluetooth) + // If data is disconnected for some other reason but wifi (or ethernet/bluetooth) // is connected, we show nothing. // Otherwise (nothing connected) we show "No internet connection". @@ -1350,7 +1356,7 @@ public class NetworkController extends BroadcastReceiver { public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { pw.println("NetworkController state:"); - pw.println(String.format(" %s network type %d (%s)", + pw.println(String.format(" %s network type %d (%s)", mConnected?"CONNECTED":"DISCONNECTED", mConnectedNetworkType, mConnectedNetworkTypeName)); pw.println(" - telephony ------"); |