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

Commit 59ab9535 authored by Danny Baumann's avatar Danny Baumann Committed by Steve Kondik
Browse files

Remove pointless notification drawer network info label in MSIM mode.

Change-Id: I44761c152094ae71050cbb7faf9ee1671b6c2dc4
parent cd1b2274
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
@@ -355,7 +355,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;
@@ -1067,11 +1066,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);

@@ -1082,8 +1080,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
@@ -1963,30 +1959,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;
@@ -3699,7 +3679,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
@@ -42,6 +42,7 @@ import android.provider.Telephony;
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.text.TextUtils;
@@ -108,7 +109,6 @@ public class MSimNetworkControllerImpl extends NetworkControllerImpl {
    int PHONE_ID2 = PhoneConstants.PHONE_ID2;
    private HashMap<Integer, 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,
@@ -448,14 +448,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) {
@@ -505,19 +497,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 ==============================================================