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

Commit 20576fe8 authored by Danny Baumann's avatar Danny Baumann Committed by Adnan Begovic
Browse files

Remove pointless notification drawer network info label in MSIM mode.

Change-Id: I44761c152094ae71050cbb7faf9ee1671b6c2dc4
parent e47c6b78
Loading
Loading
Loading
Loading
+0 −6
Original line number Diff line number Diff line
@@ -29,12 +29,6 @@
    android:background="@android:color/transparent"
    >

   <include
            layout="@layout/subs_label"
            android:layout_height="@dimen/carrier_label_height"
            android:layout_width="match_parent"
            android:layout_gravity="bottom"
            />
    <include
        layout="@layout/carrier_label"
        android:layout_height="@dimen/carrier_label_height"
+9 −30
Original line number Diff line number Diff line
@@ -345,7 +345,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,

    // carrier/wifi label
    private TextView mCarrierLabel;
    private TextView mSubsLabel;
    private boolean mCarrierLabelVisible = false;
    private int mCarrierLabelHeight;
    private int mStatusBarHeaderHeight;
@@ -1046,11 +1045,10 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
            mMSimNetworkController.addEmergencyLabelView(mHeader);

            mCarrierLabel = (TextView)mStatusBarWindowContent.findViewById(R.id.carrier_label);
            mSubsLabel = (TextView)mStatusBarWindowContent.findViewById(R.id.subs_label);
            mShowCarrierInPanel = (mCarrierLabel != null);

            if (DEBUG) Log.v(TAG, "carrierlabel=" + mCarrierLabel + " show=" +
                                    mShowCarrierInPanel + "operator label=" + mSubsLabel);
                                    mShowCarrierInPanel);
            if (mShowCarrierInPanel) {
                mCarrierLabel.setVisibility(mCarrierLabelVisible ? View.VISIBLE : View.INVISIBLE);

@@ -1061,8 +1059,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
                } else {
                    mMSimNetworkController.addCombinedLabelView(mCarrierLabel);
                }
                mSubsLabel.setVisibility(View.VISIBLE);
                mMSimNetworkController.addSubsLabelView(mSubsLabel);
                // set up the dynamic hide/show of the label
                //mPile.setOnSizeChangedListener(new OnSizeChangedListener() {
                //    @Override
@@ -1942,30 +1938,14 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        final boolean emergencyCallsShownElsewhere = mContext.getResources().getBoolean(
                R.bool.config_showEmergencyCallLabelOnly);

        final boolean makeVisible ;
        if (isMSim()) {
            makeVisible =
            !(emergencyCallsShownElsewhere && mMSimNetworkController.isEmergencyOnly())
            && mStackScroller.getHeight() < (mNotificationPanel.getHeight()
                    - mCarrierLabelHeight - mStatusBarHeaderHeight)
            && mStackScroller.getVisibility() == View.VISIBLE
            && mState != StatusBarState.KEYGUARD;

            if (mState == StatusBarState.KEYGUARD) {
                // The subs are already displayed on the top bar
                mSubsLabel.setVisibility(View.INVISIBLE);
            } else {
                mSubsLabel.setVisibility(View.VISIBLE);
            }
        } else {
            makeVisible =
            !(emergencyCallsShownElsewhere && mNetworkController.isEmergencyOnly())
        final NetworkControllerImpl networkController = isMSim()
                ? mMSimNetworkController : mNetworkController;
        final boolean makeVisible =
                !(emergencyCallsShownElsewhere && networkController.isEmergencyOnly())
                && mStackScroller.getHeight() < (mNotificationPanel.getHeight()
                        - mCarrierLabelHeight - mStatusBarHeaderHeight)
                && mStackScroller.getVisibility() == View.VISIBLE
                && mState != StatusBarState.KEYGUARD;
        }


        if (force || mCarrierLabelVisible != makeVisible) {
            mCarrierLabelVisible = makeVisible;
@@ -3674,7 +3654,6 @@ public class PhoneStatusBar extends BaseStatusBar implements DemoMode,
        mRecreating = true;

        if (mMSimNetworkController != null) {
            mMSimNetworkController.clearSubsLabelView();
            mContext.unregisterReceiver(mMSimNetworkController);
        } else if (mNetworkController != null) {
            mContext.unregisterReceiver(mNetworkController);
+5 −20
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@ import android.os.SystemProperties;
import android.telephony.PhoneStateListener;
import android.telephony.ServiceState;
import android.telephony.SignalStrength;
import android.telephony.SubInfoRecord;
import android.telephony.SubscriptionManager;
import android.telephony.TelephonyManager;
import android.util.Slog;
@@ -96,7 +97,6 @@ public class MSimNetworkControllerImpl extends NetworkControllerImpl {
    int mPhoneCount = 0;
    private HashMap<Long, Integer> mSubIdPhoneIdMap;
    ArrayList<MSimSignalCluster> mSimSignalClusters = new ArrayList<MSimSignalCluster>();
    ArrayList<TextView> mSubsLabelViews = new ArrayList<TextView>();

    public interface MSimSignalCluster {
        void setWifiIndicators(boolean visible, int strengthIcon, int activityIcon,
@@ -433,14 +433,6 @@ public class MSimNetworkControllerImpl extends NetworkControllerImpl {
        }
    }

    public void addSubsLabelView(TextView v) {
        mSubsLabelViews.add(v);
    }

    public void clearSubsLabelView() {
        mSubsLabelViews.clear();
    }

    private void updateCarrierText(int sub) {
        int textResId = 0;
        if (mAirplaneMode) {
@@ -490,19 +482,12 @@ public class MSimNetworkControllerImpl extends NetworkControllerImpl {
            carrierName = carrierName + "    " + mCarrierTextSub[i];
        }

        if (mContext.getResources().getBoolean(R.bool.config_showDataConnectionView)) {
            for (int i = 0; i < mSubsLabelViews.size(); i++) {
                TextView v = mSubsLabelViews.get(i);
                v.setText(carrierName);
            }
        } else {
        for (int i = 0; i < mMobileLabelViews.size(); i++) {
            TextView v = mMobileLabelViews.get(i);
            v.setText(carrierName);
            v.setVisibility(View.VISIBLE);
        }
    }
    }


    // ===== Telephony ==============================================================