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

Commit d02cc585 authored by Fabian Kozynski's avatar Fabian Kozynski Committed by Android (Google) Code Review
Browse files

Merge "Added correct TalkBack support for QSCarrier"

parents 9f6f3ece c7bc84b9
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -24,7 +24,8 @@
    android:background="@android:color/transparent"
    android:clickable="false"
    android:clipChildren="false"
    android:clipToPadding="false" >
    android:clipToPadding="false"
    android:focusable="true" >

    <include
        layout="@layout/mobile_signal_group"
+4 −2
Original line number Diff line number Diff line
@@ -34,7 +34,8 @@
        android:id="@+id/qs_carrier_divider1"
        android:layout_width="@dimen/qs_header_carrier_separator_width"
        android:layout_height="match_parent"
        android:visibility="gone" />
        android:visibility="gone"
        android:importantForAccessibility="no"/>

    <include
        layout="@layout/qs_carrier"
@@ -47,7 +48,8 @@
        android:layout_width="@dimen/qs_header_carrier_separator_width"
        android:layout_height="match_parent"
        android:layout_weight="1"
        android:visibility="gone" />
        android:visibility="gone"
        android:importantForAccessibility="no"/>

    <include
        layout="@layout/qs_carrier"
+3 −0
Original line number Diff line number Diff line
@@ -447,6 +447,9 @@
    <!-- Content description of the cell data being disabled. [CHAR LIMIT=NONE] -->
    <string name="cell_data_off_content_description">Mobile data off</string>

    <!-- Content description of the cell data for not default subscription. [CHAR LIMIT=NONE] -->
    <string name="not_default_data_content_description">Not set to use data</string>

    <!-- Content description of the cell data being disabled but shortened. [CHAR LIMIT=20] -->
    <string name="cell_data_off">Off</string>

+10 −4
Original line number Diff line number Diff line
@@ -89,16 +89,22 @@ public class QSCarrier extends LinearLayout {
                        .append(", ");
            }
            // TODO: show mobile data off/no internet text for 5 seconds before carrier text
            if (TextUtils.equals(state.typeContentDescription,
                    mContext.getString(R.string.data_connection_no_internet))
                    || TextUtils.equals(state.typeContentDescription,
                    mContext.getString(R.string.cell_data_off_content_description))) {
            if (hasValidTypeContentDescription(state.typeContentDescription)) {
                contentDescription.append(state.typeContentDescription);
            }
            mMobileSignal.setContentDescription(contentDescription);
        }
    }

    private boolean hasValidTypeContentDescription(String typeContentDescription) {
        return TextUtils.equals(typeContentDescription,
                mContext.getString(R.string.data_connection_no_internet))
                || TextUtils.equals(typeContentDescription,
                mContext.getString(R.string.cell_data_off_content_description))
                || TextUtils.equals(typeContentDescription,
                mContext.getString(R.string.not_default_data_content_description));
    }

    public void setCarrierText(CharSequence text) {
        mCarrierText.setText(text);
    }
+10 −3
Original line number Diff line number Diff line
@@ -256,7 +256,8 @@ public class MobileSignalController extends SignalController<
                level++;
            }
            boolean dataDisabled = mCurrentState.userSetup
                    && mCurrentState.iconGroup == TelephonyIcons.DATA_DISABLED;
                    && (mCurrentState.iconGroup == TelephonyIcons.DATA_DISABLED
                    || mCurrentState.iconGroup == TelephonyIcons.NOT_DEFAULT_DATA);
            boolean noInternet = mCurrentState.inetCondition == 0;
            boolean cutOut = dataDisabled || noInternet;
            return SignalDrawable.getState(level, getNumLevels(), cutOut);
@@ -285,7 +286,8 @@ public class MobileSignalController extends SignalController<
        if (mCurrentState.inetCondition == 0) {
            dataContentDescription = mContext.getString(R.string.data_connection_no_internet);
        }
        final boolean dataDisabled = mCurrentState.iconGroup == TelephonyIcons.DATA_DISABLED
        final boolean dataDisabled = (mCurrentState.iconGroup == TelephonyIcons.DATA_DISABLED
                || mCurrentState.iconGroup == TelephonyIcons.NOT_DEFAULT_DATA)
                && mCurrentState.userSetup;

        // Show icon in QS when we are connected or data is disabled.
@@ -456,8 +458,13 @@ public class MobileSignalController extends SignalController<
        if (isCarrierNetworkChangeActive()) {
            mCurrentState.iconGroup = TelephonyIcons.CARRIER_NETWORK_CHANGE;
        } else if (isDataDisabled() && !mConfig.alwaysShowDataRatIcon) {
            if (mSubscriptionInfo.getSubscriptionId()
                    != mDefaults.getDefaultDataSubId()) {
                mCurrentState.iconGroup = TelephonyIcons.NOT_DEFAULT_DATA;
            } else {
                mCurrentState.iconGroup = TelephonyIcons.DATA_DISABLED;
            }
        }
        if (isEmergencyOnly() != mCurrentState.isEmergency) {
            mCurrentState.isEmergency = isEmergencyOnly();
            mNetworkController.recalculateEmergency();
Loading