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

Commit 0a211127 authored by Your Name's avatar Your Name
Browse files

Enable PLMN and SPN carrier strings to be hidden from the Status bar.

parent c3e148ab
Loading
Loading
Loading
Loading
+24 −0
Original line number Diff line number Diff line
@@ -1355,6 +1355,30 @@ public final class Settings {
         */
        public static final String RECENT_APPS_NUMBER = "recent_apps_number";

		/**
		 * bcrook - Double Carrier
		 * Toggles whether to display the PLMN field on the Lockscreen
		 */
		public static final String SHOW_PLMN_LS = "show_plmn_ls";

		/**
		 * bcrook - Double Carrier
		 * Toggles whether to display the SPN field on the Lockscreen
		 */
		public static final String SHOW_SPN_LS = "show_spn_ls";

		/**
		 * bcrook - Double Carrier
		 * Toggles whether to display the PLMN field on the Notification bar
		 */
		public static final String SHOW_PLMN_SB = "show_plmn_sb";

		/**
		 * bcrook - Double Carrier
		 * Toggles whether to display the SPN field on the Notification bar
		 */
		public static final String SHOW_SPN_SB = "show_spn_sb";
        
        /**
         * Wysie_Soh
         * Specifies whether to show or hide clock
+16 −3
Original line number Diff line number Diff line
@@ -90,6 +90,10 @@ public class StatusBarService extends IStatusBar.Stub
    static final String TAG = "StatusBar";
    static final boolean SPEW = false;

	//Double carrier
	private boolean mShowPlmnSb;
	private boolean mShowSpnSb;

    static final int EXPANDED_LEAVE_ALONE = -10000;
    static final int EXPANDED_FULL_OPEN = -10001;

@@ -1785,12 +1789,16 @@ public class StatusBarService extends IStatusBar.Stub
    };

    void updateNetworkName(boolean showSpn, String spn, boolean showPlmn, String plmn) {
// Double carrier
        mShowPlmnSb = (Settings.System.getInt(mContext.getContentResolver(), Settings.System.SHOW_PLMN_SB, 0) == 1);
        mShowSpnSb = (Settings.System.getInt(mContext.getContentResolver(), Settings.System.SHOW_SPN_SB, 0) == 1);
        if (false) {
            Log.d(TAG, "updateNetworkName showSpn=" + showSpn + " spn=" + spn
                    + " showPlmn=" + showPlmn + " plmn=" + plmn);
                    + " ShowPlmn=" + showPlmn + " plmn=" + plmn);
        }
        boolean something = false;
        if (showPlmn) {
// Double carrier - bcrook
        if (showPlmn && mShowPlmnSb) {
            mPlmnLabel.setVisibility(View.VISIBLE);
            if (plmn != null) {
                mPlmnLabel.setText(plmn);
@@ -1801,7 +1809,11 @@ public class StatusBarService extends IStatusBar.Stub
            mPlmnLabel.setText("");
            mPlmnLabel.setVisibility(View.GONE);
        }
        if (showSpn && spn != null) {

// Double carrier - bcrook, refinements from Wysie


        if (showSpn && spn != null && mShowSpnSb) {
            mSpnLabel.setText(spn);
            mSpnLabel.setVisibility(View.VISIBLE);
            something = true;
@@ -1809,6 +1821,7 @@ public class StatusBarService extends IStatusBar.Stub
            mSpnLabel.setText("");
            mSpnLabel.setVisibility(View.GONE);
        }

    }

    /**