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

Commit a0677a80 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Automerger Merge Worker
Browse files

Merge "Keyguard indication area - owner info fix" into sc-qpr1-dev am: 97e242b3

Original change: https://googleplex-android-review.googlesource.com/c/platform/frameworks/base/+/15924909

Change-Id: I8bad578d9be53a2304c623f930fd209a893e2245
parents a2cbc7a4 97e242b3
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -335,7 +335,7 @@ public class KeyguardIndicationController {
                info = mLockPatternUtils.getOwnerInfo(KeyguardUpdateMonitor.getCurrentUser());
            }
        }
        if (info != null) {
        if (!TextUtils.isEmpty(info)) {
            mRotateTextViewController.updateIndication(
                    INDICATION_TYPE_OWNER_INFO,
                    new KeyguardIndication.Builder()
@@ -433,7 +433,7 @@ public class KeyguardIndicationController {
    }

    private void updateResting() {
        if (mRestingIndication != null
        if (!TextUtils.isEmpty(mRestingIndication)
                && !mRotateTextViewController.hasIndications()) {
            mRotateTextViewController.updateIndication(
                    INDICATION_TYPE_RESTING,
+15 −0
Original line number Diff line number Diff line
@@ -23,6 +23,7 @@ import static android.content.pm.UserInfo.FLAG_MANAGED_PROFILE;
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_ALIGNMENT;
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_BATTERY;
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_DISCLOSURE;
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_OWNER_INFO;
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_RESTING;
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_TRANSIENT;
import static com.android.systemui.keyguard.KeyguardIndicationRotateTextViewController.INDICATION_TYPE_TRUST;
@@ -725,6 +726,20 @@ public class KeyguardIndicationControllerTest extends SysuiTestCase {
        verify(mIndicationAreaBottom).announceForAccessibility(eq(faceHelpMsg));
    }

    @Test
    public void testEmptyOwnerInfoHidesIndicationArea() {
        createController();

        // GIVEN the owner info is set to an empty string
        when(mLockPatternUtils.getDeviceOwnerInfo()).thenReturn("");

        // WHEN asked to update the indication area
        mController.setVisible(true);

        // THEN the owner info should be hidden
        verifyHideIndication(INDICATION_TYPE_OWNER_INFO);
    }

    private void sendUpdateDisclosureBroadcast() {
        mBroadcastReceiver.onReceive(mContext, new Intent());
    }