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

Commit 2a111c54 authored by Automerger Merge Worker's avatar Automerger Merge Worker
Browse files

Merge "Merge "Hide empty text view when airplane mode" into rvc-dev am:...

Merge "Merge "Hide empty text view when airplane mode" into rvc-dev am: 589c5c55 am: b59133dc" into rvc-d1-dev-plus-aosp am: eb09a9a6

Change-Id: Ie4554c96ac4c1407838c22bcbdaf28096ee0a5bb
parents 46219d10 eb09a9a6
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -25,6 +25,7 @@ import android.os.Looper;
import android.os.Message;
import android.provider.Settings;
import android.telephony.SubscriptionManager;
import android.text.TextUtils;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
@@ -260,8 +261,10 @@ public class QSCarrierGroupController {
                mCarrierGroups[i].setVisibility(View.GONE);
            }
            mNoSimTextView.setText(info.carrierText);
            if (!TextUtils.isEmpty(info.carrierText)) {
                mNoSimTextView.setVisibility(View.VISIBLE);
            }
        }
        handleUpdateState(); // handleUpdateCarrierInfo is always called from main thread.
    }

+15 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@

package com.android.systemui.qs.carrier;

import static org.junit.Assert.assertEquals;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.anyBoolean;
import static org.mockito.ArgumentMatchers.anyInt;
@@ -219,4 +220,18 @@ public class QSCarrierGroupControllerTest extends LeakCheckedTest {
                mock(NetworkController.IconState.class),
                0, 0, true, true, "", "", "", true, 0, true);
    }

    @Test
    public void testNoEmptyVisibleView_airplaneMode() {
        CarrierTextController.CarrierTextCallbackInfo
                info = new CarrierTextController.CarrierTextCallbackInfo(
                "",
                new CharSequence[]{""},
                true,
                new int[]{0},
                true /* airplaneMode */);
        mCallback.updateCarrierInfo(info);
        mTestableLooper.processAllMessages();
        assertEquals(View.GONE, mQSCarrierGroup.getNoSimTextView().getVisibility());
    }
}