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

Commit 0d3f6517 authored by Aaron Liu's avatar Aaron Liu
Browse files

Reset message area.

Reset message area when reset is called. Remove scrimmed code path and
merge it in with the regular path. I checked the scrimmed states on all
of the security methods and it looks good.

Fixes: 266801486
Test: added a unit test.
Test: test scrimmed bouncers for all three security methods by long
pressing the lock icon.
Test: add face unlock and get a swipe and try again message and back out
and go back to boucner.

Change-Id: I61e77d4f657db665170f0a6a32793edc50ca13f2
parent 4d2d2c25
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -103,6 +103,7 @@ public abstract class KeyguardAbsKeyInputViewController<T extends KeyguardAbsKey

    @Override
    public void reset() {
        super.reset();
        // start fresh
        mDismissing = false;
        mView.resetPasswordText(false /* animate */, false /* announce */);
+1 −0
Original line number Diff line number Diff line
@@ -121,6 +121,7 @@ public abstract class KeyguardInputViewController<T extends KeyguardInputView>

    @Override
    public void reset() {
        mMessageAreaController.setMessage("", false);
    }

    @Override
+0 −7
Original line number Diff line number Diff line
@@ -106,13 +106,6 @@ object KeyguardBouncerViewBinder {
                            hostViewController.appear(
                                SystemBarUtils.getStatusBarHeight(view.context)
                            )
                        }
                    }

                    launch {
                        viewModel.showWithFullExpansion.collect { model ->
                            hostViewController.resetSecurityContainer()
                            hostViewController.showPromptReason(model.promptReason)
                            hostViewController.onResume()
                        }
                    }
+0 −6
Original line number Diff line number Diff line
@@ -20,12 +20,10 @@ import android.view.View
import com.android.systemui.keyguard.data.BouncerView
import com.android.systemui.keyguard.data.BouncerViewDelegate
import com.android.systemui.keyguard.domain.interactor.PrimaryBouncerInteractor
import com.android.systemui.keyguard.shared.constants.KeyguardBouncerConstants.EXPANSION_VISIBLE
import com.android.systemui.keyguard.shared.model.BouncerShowMessageModel
import com.android.systemui.keyguard.shared.model.KeyguardBouncerModel
import javax.inject.Inject
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.filter
import kotlinx.coroutines.flow.map

/** Models UI state for the lock screen bouncer; handles user input. */
@@ -44,10 +42,6 @@ constructor(
    /** Observe whether bouncer is showing. */
    val show: Flow<KeyguardBouncerModel> = interactor.show

    /** Observe visible expansion when bouncer is showing. */
    val showWithFullExpansion: Flow<KeyguardBouncerModel> =
        interactor.show.filter { it.expansionAmount == EXPANSION_VISIBLE }

    /** Observe whether bouncer is hiding. */
    val hide: Flow<Unit> = interactor.hide

+7 −0
Original line number Diff line number Diff line
@@ -150,4 +150,11 @@ public class KeyguardAbsKeyInputViewControllerTest extends SysuiTestCase {
                getContext().getResources().getString(R.string.kg_prompt_reason_restart_password),
                false);
    }


    @Test
    public void testReset() {
        mKeyguardAbsKeyInputViewController.reset();
        verify(mKeyguardMessageAreaController).setMessage("", false);
    }
}