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

Commit ebcad124 authored by Junchen Quan's avatar Junchen Quan Committed by Android (Google) Code Review
Browse files

Merge "[Device Supervision] Avoid showing blank settings page on auth callback...

Merge "[Device Supervision] Avoid showing blank settings page on auth callback from main switch toggle." into main
parents 6c4424da 275162b1
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -2826,6 +2826,7 @@
        <activity android:name=".supervision.ConfirmSupervisionCredentialsActivity"
            android:exported="true"
            android:excludeFromRecents="true"
            android:theme="@style/Theme.Settings.NoActionBar"
            android:featureFlag="android.app.supervision.flags.supervision_manager_apis">
            <intent-filter>
                <action android:name="android.app.supervision.action.CONFIRM_SUPERVISION_CREDENTIALS" />
+6 −6
Original line number Diff line number Diff line
@@ -63,24 +63,18 @@ class ConfirmSupervisionCredentialsActivity : FragmentActivity() {

    private val mAuthenticationCallback =
        object : AuthenticationCallback() {
            @RequiresPermission(anyOf = [INTERACT_ACROSS_USERS_FULL, MANAGE_USERS])
            override fun onAuthenticationError(errorCode: Int, errString: CharSequence) {
                tryStopProfile()
                Log.w(TAG, "onAuthenticationError(errorCode=$errorCode, errString=$errString)")
                setResult(RESULT_CANCELED)
                finish()
            }

            @RequiresPermission(anyOf = [INTERACT_ACROSS_USERS_FULL, MANAGE_USERS])
            override fun onAuthenticationSucceeded(result: BiometricPrompt.AuthenticationResult?) {
                tryStopProfile()
                setResult(RESULT_OK)
                finish()
            }

            @RequiresPermission(anyOf = [INTERACT_ACROSS_USERS_FULL, MANAGE_USERS])
            override fun onAuthenticationFailed() {
                tryStopProfile()
                setResult(RESULT_CANCELED)
                finish()
            }
@@ -92,6 +86,12 @@ class ConfirmSupervisionCredentialsActivity : FragmentActivity() {
            finish()
        }

    @RequiresPermission(anyOf = [INTERACT_ACROSS_USERS_FULL, MANAGE_USERS])
    override fun onStop() {
        super.onStop()
        tryStopProfile()
    }

    @RequiresPermission(
        allOf = [USE_BIOMETRIC_INTERNAL, SET_BIOMETRIC_DIALOG_ADVANCED, INTERACT_ACROSS_USERS_FULL]
    )