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

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

Change-Id: I8bad578d9be53a2304c623f930fd209a893e2245
This commit is contained in:
TreeHugger Robot
2021-09-28 16:07:41 +00:00
committed by Automerger Merge Worker
2 changed files with 17 additions and 2 deletions

View File

@@ -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,

View File

@@ -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());
}