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

Commit 9bb392c0 authored by Fang Yunong's avatar Fang Yunong Committed by Linux Build Service Account
Browse files

Support to show long or short name in SystemUI.

Supports to switch show long nameor short name.
Add two configs for switching which format need show.
config_show_long_operator_name -- decide to whether show long name
under normal form.
config_show_long_operator_name_when_roaming -- decide to whether show
long name when roaming.

Change-Id: I496274a6c497bf16cea493c401b3d76c62cbcd92
CRs-fixed: 1037642
parent a9ecbf1d
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -301,5 +301,8 @@

    <bool name="config_show4gForIWlan">false</bool>
    <bool name="config_showSignalForIWlan">false</bool>

    <bool name="config_show_long_operator_name">false</bool>
    <bool name="config_show_long_operator_name_when_roaming">false</bool>
</resources>
+15 −1
Original line number Diff line number Diff line
@@ -538,6 +538,12 @@ public class MobileSignalController extends SignalController<
            mCurrentState.networkName = mServiceState.getOperatorAlphaShort();
        }

        if (!showLongOperatorName()) {
            mCurrentState.networkNameData = TextUtils.isEmpty(mServiceState.
                    getOperatorAlphaShort()) ? mCurrentState.networkNameData : mServiceState.
                    getOperatorAlphaShort() + " " + getNetworkClassString(mServiceState);
        }

        if (mConfig.readIconsFromXml) {
            mCurrentState.voiceLevel = getVoiceSignalLevel();
        }
@@ -545,11 +551,19 @@ public class MobileSignalController extends SignalController<
        notifyListenersIfNecessary();
    }


    private boolean isDataDisabled() {
        return !mPhone.getDataEnabled(mSubscriptionInfo.getSubscriptionId());
    }

    private boolean showLongOperatorName() {
        if (mContext.getResources().getBoolean(R.bool.config_show_long_operator_name) || (mContext.
                getResources().getBoolean(R.bool.config_show_long_operator_name_when_roaming) &&
                isRoaming())) {
            return true;
        }
        return false;
    }

    private void generateIconGroup() {
        final int level = mCurrentState.level;
        final int voiceLevel = mCurrentState.voiceLevel;