Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 58d807f6 authored by Daniel Sandler's avatar Daniel Sandler Committed by Android (Google) Code Review
Browse files

Merge "Fix contentDescriptions in status bar."

parents b11d09cb bcf6ef0b
Loading
Loading
Loading
Loading
+1 −0
Original line number Original line Diff line number Diff line
@@ -34,6 +34,7 @@
        android:paddingRight="15dp"
        android:paddingRight="15dp"
        android:src="@drawable/ic_notify_clear"
        android:src="@drawable/ic_notify_clear"
        android:visibility="invisible"
        android:visibility="invisible"
        android:contentDescription="@string/accessibility_clear_all"
        />
        />


    <RelativeLayout
    <RelativeLayout
+2 −0
Original line number Original line Diff line number Diff line
@@ -65,6 +65,7 @@
            android:paddingLeft="8dp"
            android:paddingLeft="8dp"
            android:paddingRight="8dp"
            android:paddingRight="8dp"
            android:src="@drawable/ic_notify_quicksettings"
            android:src="@drawable/ic_notify_quicksettings"
            android:contentDescription="@string/accessibility_settings_button"
            />
            />


        <ImageView android:id="@+id/clear_all_button"
        <ImageView android:id="@+id/clear_all_button"
@@ -74,6 +75,7 @@
            android:paddingLeft="8dp"
            android:paddingLeft="8dp"
            android:paddingRight="8dp"
            android:paddingRight="8dp"
            android:src="@drawable/ic_notify_clear"
            android:src="@drawable/ic_notify_clear"
            android:contentDescription="@string/accessibility_clear_all"
            />            
            />            
    </RelativeLayout>
    </RelativeLayout>


+5 −3
Original line number Original line Diff line number Diff line
@@ -282,13 +282,13 @@
    <string name="accessibility_battery_level">Battery <xliff:g id="number">%d</xliff:g> percent.</string>
    <string name="accessibility_battery_level">Battery <xliff:g id="number">%d</xliff:g> percent.</string>


    <!-- Content description of the button for showing a settings panel in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
    <!-- Content description of the button for showing a settings panel in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_settings_button">Settings button.</string>
    <string name="accessibility_settings_button">System settings.</string>


    <!-- Content description of the button for showing a notifications panel in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
    <!-- Content description of the button for showing a notifications panel in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_notifications_button">Notifications button.</string>
    <string name="accessibility_notifications_button">Notifications.</string>


    <!-- Content description of the button for removing a notification in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
    <!-- Content description of the button for removing a notification in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_remove_notification">Remove notification.</string>
    <string name="accessibility_remove_notification">Clear notification.</string>


    <!-- Content description of the enabled GPS icon in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
    <!-- Content description of the enabled GPS icon in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_gps_enabled">GPS enabled.</string>
    <string name="accessibility_gps_enabled">GPS enabled.</string>
@@ -336,4 +336,6 @@
    <!-- Notification text: when GPS has found a fix [CHAR LIMIT=50] -->
    <!-- Notification text: when GPS has found a fix [CHAR LIMIT=50] -->
    <string name="gps_notification_found_text">Location set by GPS</string>
    <string name="gps_notification_found_text">Location set by GPS</string>


    <!-- Content description of the clear button in the notification panel for accessibility (not shown on the screen). [CHAR LIMIT=NONE] -->
    <string name="accessibility_clear_all">Clear all notifications.</string>
</resources>
</resources>
+9 −2
Original line number Original line Diff line number Diff line
@@ -44,6 +44,7 @@ public class SignalClusterView
    private boolean mMobileVisible = false;
    private boolean mMobileVisible = false;
    private int mMobileStrengthId = 0, mMobileActivityId = 0, mMobileTypeId = 0;
    private int mMobileStrengthId = 0, mMobileActivityId = 0, mMobileTypeId = 0;
    private boolean mIsAirplaneMode = false;
    private boolean mIsAirplaneMode = false;
    private String mWifiDescription, mMobileDescription, mMobileTypeDescription;


    ViewGroup mWifiGroup, mMobileGroup;
    ViewGroup mWifiGroup, mMobileGroup;
    ImageView mWifi, mMobile, mWifiActivity, mMobileActivity, mMobileType;
    ImageView mWifi, mMobile, mWifiActivity, mMobileActivity, mMobileType;
@@ -95,20 +96,24 @@ public class SignalClusterView
        super.onDetachedFromWindow();
        super.onDetachedFromWindow();
    }
    }


    public void setWifiIndicators(boolean visible, int strengthIcon, int activityIcon) {
    public void setWifiIndicators(boolean visible, int strengthIcon, int activityIcon,
            String contentDescription) {
        mWifiVisible = visible;
        mWifiVisible = visible;
        mWifiStrengthId = strengthIcon;
        mWifiStrengthId = strengthIcon;
        mWifiActivityId = activityIcon;
        mWifiActivityId = activityIcon;
        mWifiDescription = contentDescription;


        apply();
        apply();
    }
    }


    public void setMobileDataIndicators(boolean visible, int strengthIcon, int activityIcon,
    public void setMobileDataIndicators(boolean visible, int strengthIcon, int activityIcon,
            int typeIcon) {
            int typeIcon, String contentDescription, String typeContentDescription) {
        mMobileVisible = visible;
        mMobileVisible = visible;
        mMobileStrengthId = strengthIcon;
        mMobileStrengthId = strengthIcon;
        mMobileActivityId = activityIcon;
        mMobileActivityId = activityIcon;
        mMobileTypeId = typeIcon;
        mMobileTypeId = typeIcon;
        mMobileDescription = contentDescription;
        mMobileTypeDescription = typeContentDescription;


        apply();
        apply();
    }
    }
@@ -125,6 +130,7 @@ public class SignalClusterView
            mWifiGroup.setVisibility(View.VISIBLE);
            mWifiGroup.setVisibility(View.VISIBLE);
            mWifi.setImageResource(mWifiStrengthId);
            mWifi.setImageResource(mWifiStrengthId);
            mWifiActivity.setImageResource(mWifiActivityId);
            mWifiActivity.setImageResource(mWifiActivityId);
            mWifiGroup.setContentDescription(mWifiDescription);
        } else {
        } else {
            mWifiGroup.setVisibility(View.GONE);
            mWifiGroup.setVisibility(View.GONE);
        }
        }
@@ -139,6 +145,7 @@ public class SignalClusterView
            mMobile.setImageResource(mMobileStrengthId);
            mMobile.setImageResource(mMobileStrengthId);
            mMobileActivity.setImageResource(mMobileActivityId);
            mMobileActivity.setImageResource(mMobileActivityId);
            mMobileType.setImageResource(mMobileTypeId);
            mMobileType.setImageResource(mMobileTypeId);
            mMobileGroup.setContentDescription(mMobileTypeDescription + " " + mMobileDescription);
        } else {
        } else {
            mMobileGroup.setVisibility(View.GONE);
            mMobileGroup.setVisibility(View.GONE);
        }
        }
+16 −8
Original line number Original line Diff line number Diff line
@@ -139,9 +139,10 @@ public class NetworkController extends BroadcastReceiver {
    IBatteryStats mBatteryStats;
    IBatteryStats mBatteryStats;


    public interface SignalCluster {
    public interface SignalCluster {
        void setWifiIndicators(boolean visible, int strengthIcon, int activityIcon);
        void setWifiIndicators(boolean visible, int strengthIcon, int activityIcon, 
                String contentDescription);
        void setMobileDataIndicators(boolean visible, int strengthIcon, int activityIcon,
        void setMobileDataIndicators(boolean visible, int strengthIcon, int activityIcon,
                int typeIcon);
                int typeIcon, String contentDescription, String typeContentDescription);
        void setIsAirplaneMode(boolean is);
        void setIsAirplaneMode(boolean is);
    }
    }


@@ -235,12 +236,16 @@ public class NetworkController extends BroadcastReceiver {
        cluster.setWifiIndicators(
        cluster.setWifiIndicators(
                mWifiConnected, // only show wifi in the cluster if connected
                mWifiConnected, // only show wifi in the cluster if connected
                mWifiIconId,
                mWifiIconId,
                mWifiActivityIconId);
                mWifiActivityIconId,
                mContentDescriptionWifi);
        cluster.setMobileDataIndicators(
        cluster.setMobileDataIndicators(
                mHasMobileDataFeature,
                mHasMobileDataFeature,
                mPhoneSignalIconId,
                mPhoneSignalIconId,
                mMobileActivityIconId,
                mMobileActivityIconId,
                mDataTypeIconId);
                mDataTypeIconId,
                mContentDescriptionPhoneSignal,
                mContentDescriptionDataType);

    }
    }


    public void setStackedMode(boolean stacked) {
    public void setStackedMode(boolean stacked) {
@@ -807,8 +812,8 @@ public class NetworkController extends BroadcastReceiver {
                (mServiceState == null || (!hasService() && !mServiceState.isEmergencyOnly()))) {
                (mServiceState == null || (!hasService() && !mServiceState.isEmergencyOnly()))) {
            // Only display the flight-mode icon if not in "emergency calls only" mode.
            // Only display the flight-mode icon if not in "emergency calls only" mode.
            label = context.getString(R.string.status_bar_settings_signal_meter_disconnected);
            label = context.getString(R.string.status_bar_settings_signal_meter_disconnected);
            mContentDescriptionCombinedSignal = mContext.getString(
            mContentDescriptionCombinedSignal = mContentDescriptionPhoneSignal
                    R.string.accessibility_airplane_mode);
                = mContext.getString(R.string.accessibility_airplane_mode);
            
            
            // look again; your radios are now airplanes
            // look again; your radios are now airplanes
            mPhoneSignalIconId = mDataSignalIconId = R.drawable.stat_sys_signal_flightmode;
            mPhoneSignalIconId = mDataSignalIconId = R.drawable.stat_sys_signal_flightmode;
@@ -863,12 +868,15 @@ public class NetworkController extends BroadcastReceiver {
                cluster.setWifiIndicators(
                cluster.setWifiIndicators(
                        mWifiConnected, // only show wifi in the cluster if connected
                        mWifiConnected, // only show wifi in the cluster if connected
                        mWifiIconId,
                        mWifiIconId,
                        mWifiActivityIconId);
                        mWifiActivityIconId,
                        mContentDescriptionWifi);
                cluster.setMobileDataIndicators(
                cluster.setMobileDataIndicators(
                        mHasMobileDataFeature,
                        mHasMobileDataFeature,
                        mPhoneSignalIconId,
                        mPhoneSignalIconId,
                        mMobileActivityIconId,
                        mMobileActivityIconId,
                        mDataTypeIconId);
                        mDataTypeIconId,
                        mContentDescriptionPhoneSignal,
                        mContentDescriptionDataType);
                cluster.setIsAirplaneMode(mAirplaneMode);
                cluster.setIsAirplaneMode(mAirplaneMode);
            }
            }
        }
        }