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

Commit b69557a7 authored by Haiyang Liu's avatar Haiyang Liu Committed by Sivasri Kumar Vanka
Browse files

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

Data and voice share the same network for sub2. Do not
show both voice and data icons on sub two as required.

Add a config config_showVoiceAndDataForSub to control
whether show two bars for specified sub.

Change-Id: Id461faa5f0e248fde0c2b332975a1a8e62b8cd6f
CRs-Fixed: 646296
parent 70302163
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() {