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 Original line Diff line number Diff line
@@ -24,7 +24,8 @@
    android:background="@android:color/transparent"
    android:background="@android:color/transparent"
    android:clickable="false"
    android:clickable="false"
    android:clipChildren="false"
    android:clipChildren="false"
    android:clipToPadding="false" >
    android:clipToPadding="false"
    android:focusable="true" >


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


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


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


+10 −4
Original line number Original line Diff line number Diff line
@@ -89,16 +89,22 @@ public class QSCarrier extends LinearLayout {
                        .append(", ");
                        .append(", ");
            }
            }
            // TODO: show mobile data off/no internet text for 5 seconds before carrier text
            // TODO: show mobile data off/no internet text for 5 seconds before carrier text
            if (TextUtils.equals(state.typeContentDescription,
            if (hasValidTypeContentDescription(state.typeContentDescription)) {
                    mContext.getString(R.string.data_connection_no_internet))
                    || TextUtils.equals(state.typeContentDescription,
                    mContext.getString(R.string.cell_data_off_content_description))) {
                contentDescription.append(state.typeContentDescription);
                contentDescription.append(state.typeContentDescription);
            }
            }
            mMobileSignal.setContentDescription(contentDescription);
            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) {
    public void setCarrierText(CharSequence text) {
        mCarrierText.setText(text);
        mCarrierText.setText(text);
    }
    }
+10 −3
Original line number Original line Diff line number Diff line
@@ -256,7 +256,8 @@ public class MobileSignalController extends SignalController<
                level++;
                level++;
            }
            }
            boolean dataDisabled = mCurrentState.userSetup
            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 noInternet = mCurrentState.inetCondition == 0;
            boolean cutOut = dataDisabled || noInternet;
            boolean cutOut = dataDisabled || noInternet;
            return SignalDrawable.getState(level, getNumLevels(), cutOut);
            return SignalDrawable.getState(level, getNumLevels(), cutOut);
@@ -285,7 +286,8 @@ public class MobileSignalController extends SignalController<
        if (mCurrentState.inetCondition == 0) {
        if (mCurrentState.inetCondition == 0) {
            dataContentDescription = mContext.getString(R.string.data_connection_no_internet);
            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;
                && mCurrentState.userSetup;


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