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

Commit fe976b7e authored by Adnan Begovic's avatar Adnan Begovic
Browse files

SystemUi: Reintroduce always_show_roaming config.

  Set ro.config.always_show_roaming to true to always
  show both the current data RAT and roaming when in
  a roaming scenario.

Change-Id: I59416f172f24094547b2594347e6accab0bd7fed
TICKET: CYNGNOS-1578
parent df5e2309
Loading
Loading
Loading
Loading
+22 −0
Original line number Original line Diff line number Diff line
<!--
Copyright (C) 2014 The Android Open Source Project
   Licensed under the Apache License, Version 2.0 (the "License");
    you may not use this file except in compliance with the License.
    You may obtain a copy of the License at
         http://www.apache.org/licenses/LICENSE-2.0
    Unless required by applicable law or agreed to in writing, software
    distributed under the License is distributed on an "AS IS" BASIS,
    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
    See the License for the specific language governing permissions and
    limitations under the License.
-->
<vector xmlns:android="http://schemas.android.com/apk/res/android"
        android:width="4.25dp"
        android:height="17dp"
        android:viewportWidth="6.0"
        android:viewportHeight="24.0">
    <path
            android:fillColor="#FFFFFFFF"
            android:pathData="M 2.8,18.8 l -1,0 0,3.1 -1.6,0 0,-8.5 2.7,0 c 0.9,0 1.5,0.2 2,0.7 0.5,0.5 0.7,1.1 0.7,1.9 0,0.6 -0.1,1.1 -0.3,1.5 -0.2,0.4 -0.5,0.6 -0.9,0.8 l 1.5,3.5 0,0.1 -1.8,0 -1.3,-3.1 z m -1,-1.4 1.1,0 C 3.3,17.4 3.5,17.3 3.7,17 3.9,16.7 4,16.5 4,16.1 4,15.7 3.9,15.3 3.7,15.1 3.5,14.9 3.3,14.7 2.9,14.7 l -1.1,0 0,2.7 z" />

</vector>
 No newline at end of file
+33 −19
Original line number Original line Diff line number Diff line
@@ -24,6 +24,11 @@
    android:layout_width="wrap_content"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:layout_height="wrap_content"
    >
    >
    <FrameLayout
            android:paddingStart="3dp"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            >
        <com.android.systemui.statusbar.AnimatedImageView
        <com.android.systemui.statusbar.AnimatedImageView
                android:theme="@style/DualToneLightTheme"
                android:theme="@style/DualToneLightTheme"
                android:id="@+id/mobile_signal"
                android:id="@+id/mobile_signal"
@@ -45,3 +50,12 @@
                android:layout_width="wrap_content"
                android:layout_width="wrap_content"
                />
                />
    </FrameLayout>
    </FrameLayout>

    <ImageView
            android:id="@+id/mobile_roaming"
            android:layout_height="wrap_content"
            android:layout_width="wrap_content"
            android:visibility="gone"
            android:src="@drawable/stat_sys_data_roaming"
            />
</FrameLayout>
+1 −1
Original line number Original line Diff line number Diff line
@@ -201,7 +201,7 @@ public class CellularTile extends QSTile<QSTile.SignalState> {
        @Override
        @Override
        public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
        public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
                int qsType, boolean activityIn, boolean activityOut, String typeContentDescription,
                int qsType, boolean activityIn, boolean activityOut, String typeContentDescription,
                String description, boolean isWide, int subId) {
                String description, boolean isWide, boolean showSeparateRoaming, int subId) {
            if (qsIcon == null) {
            if (qsIcon == null) {
                // Not data sim, don't display.
                // Not data sim, don't display.
                return;
                return;
+6 −1
Original line number Original line Diff line number Diff line
@@ -217,7 +217,7 @@ public class SignalClusterView
    @Override
    @Override
    public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
    public void setMobileDataIndicators(IconState statusIcon, IconState qsIcon, int statusType,
            int qsType, boolean activityIn, boolean activityOut, String typeContentDescription,
            int qsType, boolean activityIn, boolean activityOut, String typeContentDescription,
            String description, boolean isWide, int subId) {
            String description, boolean isWide, boolean showRoamingIndicator, int subId) {
        PhoneState state = getState(subId);
        PhoneState state = getState(subId);
        if (state == null) {
        if (state == null) {
            return;
            return;
@@ -228,6 +228,7 @@ public class SignalClusterView
        state.mMobileDescription = statusIcon.contentDescription;
        state.mMobileDescription = statusIcon.contentDescription;
        state.mMobileTypeDescription = typeContentDescription;
        state.mMobileTypeDescription = typeContentDescription;
        state.mIsMobileTypeIconWide = statusType != 0 && isWide;
        state.mIsMobileTypeIconWide = statusType != 0 && isWide;
        state.mShowRoamingIndicator = showRoamingIndicator;


        apply();
        apply();
    }
    }
@@ -478,9 +479,11 @@ public class SignalClusterView
        private int mMobileStrengthId = 0, mMobileTypeId = 0;
        private int mMobileStrengthId = 0, mMobileTypeId = 0;
        private boolean mIsMobileTypeIconWide;
        private boolean mIsMobileTypeIconWide;
        private String mMobileDescription, mMobileTypeDescription;
        private String mMobileDescription, mMobileTypeDescription;
        private boolean mShowRoamingIndicator;


        private ViewGroup mMobileGroup;
        private ViewGroup mMobileGroup;
        private ImageView mMobile, mMobileDark, mMobileType;
        private ImageView mMobile, mMobileDark, mMobileType;
        private ImageView mMobileRoaming;


        public PhoneState(int subId, Context context) {
        public PhoneState(int subId, Context context) {
            ViewGroup root = (ViewGroup) LayoutInflater.from(context)
            ViewGroup root = (ViewGroup) LayoutInflater.from(context)
@@ -494,6 +497,7 @@ public class SignalClusterView
            mMobile         = (ImageView) root.findViewById(R.id.mobile_signal);
            mMobile         = (ImageView) root.findViewById(R.id.mobile_signal);
            mMobileDark     = (ImageView) root.findViewById(R.id.mobile_signal_dark);
            mMobileDark     = (ImageView) root.findViewById(R.id.mobile_signal_dark);
            mMobileType     = (ImageView) root.findViewById(R.id.mobile_type);
            mMobileType     = (ImageView) root.findViewById(R.id.mobile_type);
            mMobileRoaming  = (ImageView) root.findViewById(R.id.mobile_roaming);
        }
        }


        public boolean apply(boolean isSecondaryIcon) {
        public boolean apply(boolean isSecondaryIcon) {
@@ -520,6 +524,7 @@ public class SignalClusterView
                mMobileGroup.setContentDescription(mMobileTypeDescription
                mMobileGroup.setContentDescription(mMobileTypeDescription
                        + " " + mMobileDescription);
                        + " " + mMobileDescription);
                mMobileGroup.setVisibility(View.VISIBLE);
                mMobileGroup.setVisibility(View.VISIBLE);
                mMobileRoaming.setVisibility(mShowRoamingIndicator ? View.VISIBLE : View.GONE);
            } else {
            } else {
                mMobileGroup.setVisibility(View.GONE);
                mMobileGroup.setVisibility(View.GONE);
            }
            }
+3 −2
Original line number Original line Diff line number Diff line
@@ -126,14 +126,15 @@ public class CallbackHandler extends Handler implements EmergencyListener, Signa
    public void setMobileDataIndicators(final IconState statusIcon, final IconState qsIcon,
    public void setMobileDataIndicators(final IconState statusIcon, final IconState qsIcon,
            final int statusType, final int qsType,final boolean activityIn,
            final int statusType, final int qsType,final boolean activityIn,
            final boolean activityOut, final String typeContentDescription,
            final boolean activityOut, final String typeContentDescription,
            final String description, final boolean isWide, final int subId) {
            final String description, final boolean isWide, final boolean showSeparateRoaming,
            final int subId) {
        post(new Runnable() {
        post(new Runnable() {
            @Override
            @Override
            public void run() {
            public void run() {
                for (SignalCallback signalCluster : mSignalCallbacks) {
                for (SignalCallback signalCluster : mSignalCallbacks) {
                    signalCluster.setMobileDataIndicators(statusIcon, qsIcon, statusType, qsType,
                    signalCluster.setMobileDataIndicators(statusIcon, qsIcon, statusType, qsType,
                            activityIn, activityOut, typeContentDescription, description, isWide,
                            activityIn, activityOut, typeContentDescription, description, isWide,
                            subId);
                            showSeparateRoaming, subId);
                }
                }
            }
            }
        });
        });
Loading