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

Commit 16ed8dbd authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "StatusBar: Do not show both voice and data icons on sub2"

parents 193d4db2 b69557a7
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -135,5 +135,10 @@

    <!-- monitor locale change -->
    <bool name="config_monitor_locale_change">false</bool>
    <integer-array name="config_showVoiceAndDataForSub">
        <item>0</item>
        <item>0</item>
        <item>0</item>
    </integer-array>
</resources>
+13 −3
Original line number Diff line number Diff line
@@ -49,6 +49,7 @@ public class MSimSignalClusterView
    private final int STATUS_BAR_STYLE_DATA_VOICE = 3;

    private int mStyle = 0;
    private int[] mShowTwoBars;

    MSimNetworkController mMSimNC;

@@ -161,6 +162,8 @@ public class MSimSignalClusterView
        }

        mStyle = context.getResources().getInteger(R.integer.status_bar_style);
        mShowTwoBars = context.getResources().getIntArray(
                R.array.config_showVoiceAndDataForSub);
    }

    public void setNetworkController(MSimNetworkController nc) {
@@ -442,11 +445,18 @@ public class MSimSignalClusterView
    }

    private boolean showBothDataAndVoice(int sub) {
        return mStyle == STATUS_BAR_STYLE_DATA_VOICE
            &&((mMobileTypeId[sub] == R.drawable.stat_sys_data_connected_3g)
        if (mStyle != STATUS_BAR_STYLE_DATA_VOICE) {
            return false;
        }

        if (mShowTwoBars[sub] == 0) {
            return false;
        }

        return (mMobileTypeId[sub] == R.drawable.stat_sys_data_connected_3g)
                || (mMobileTypeId[sub] == R.drawable.stat_sys_data_connected_4g)
                || (mMobileTypeId[sub] == R.drawable.stat_sys_data_fully_connected_3g)
                || (mMobileTypeId[sub] == R.drawable.stat_sys_data_fully_connected_4g));
                || (mMobileTypeId[sub] == R.drawable.stat_sys_data_fully_connected_4g);
    }

    private boolean showBoth3gAnd1x() {
+13 −3
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ public class SignalClusterView
    private final int STATUS_BAR_STYLE_DATA_VOICE = 3;

    private int mStyle = 0;
    private int[] mShowTwoBars;

    NetworkController mNC;

@@ -97,6 +98,8 @@ public class SignalClusterView
        super(context, attrs, defStyle);

        mStyle = context.getResources().getInteger(R.integer.status_bar_style);
        mShowTwoBars = context.getResources().getIntArray(
                R.array.config_showVoiceAndDataForSub);
    }

    public void setNetworkController(NetworkController nc) {
@@ -389,11 +392,18 @@ public class SignalClusterView
    }

    private boolean showBothDataAndVoice() {
        return mStyle == STATUS_BAR_STYLE_DATA_VOICE
            &&((mMobileTypeId == R.drawable.stat_sys_data_connected_3g)
        if (mStyle != STATUS_BAR_STYLE_DATA_VOICE) {
            return false;
        }

        if (mShowTwoBars[0] == 0) {
            return false;
        }

        return (mMobileTypeId == R.drawable.stat_sys_data_connected_3g)
                || (mMobileTypeId == R.drawable.stat_sys_data_connected_4g)
                || (mMobileTypeId == R.drawable.stat_sys_data_fully_connected_3g)
                || (mMobileTypeId == R.drawable.stat_sys_data_fully_connected_4g));
                || (mMobileTypeId == R.drawable.stat_sys_data_fully_connected_4g);
    }

    private boolean showBoth3gAnd1x() {