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

Commit aee6e41e authored by Jorim Jaggi's avatar Jorim Jaggi Committed by Android (Google) Code Review
Browse files

Merge "Finish trampoline activity for ConfirmDeviceCredential immediately" into mnc-dr-dev

parents cdf00b16 74a2283d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1409,7 +1409,7 @@
        <!-- Lock screen settings -->
        <activity android:name="ConfirmDeviceCredentialActivity"
            android:exported="true"
            android:theme="@style/Transparent">
            android:theme="@android:style/Theme.NoDisplay">
            <intent-filter android:priority="1">
                <action android:name="android.app.action.CONFIRM_DEVICE_CREDENTIAL" />
                <category android:name="android.intent.category.DEFAULT" />
+12 −3
Original line number Diff line number Diff line
@@ -158,11 +158,20 @@ public final class ChooseLockSettingsHelper {
        intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_HAS_CHALLENGE, hasChallenge);
        intent.putExtra(ChooseLockSettingsHelper.EXTRA_KEY_CHALLENGE, challenge);
        intent.setClassName(ConfirmDeviceCredentialBaseFragment.PACKAGE, activityClass.getName());
        if (external) {
            intent.addFlags(Intent.FLAG_ACTIVITY_FORWARD_RESULT);
            if (mFragment != null) {
                mFragment.startActivity(intent);
            } else {
                mActivity.startActivity(intent);
            }
        } else {
            if (mFragment != null) {
                mFragment.startActivityForResult(intent, request);
            } else {
                mActivity.startActivityForResult(intent, request);
            }
        }
        return true;
    }
}
+5 −16
Original line number Diff line number Diff line
@@ -58,23 +58,12 @@ public class ConfirmDeviceCredentialActivity extends Activity {
        String title = intent.getStringExtra(KeyguardManager.EXTRA_TITLE);
        String details = intent.getStringExtra(KeyguardManager.EXTRA_DESCRIPTION);

        // Ignore rotates and ensure we only launch this once
        if (savedInstanceState == null) {
        ChooseLockSettingsHelper helper = new ChooseLockSettingsHelper(this);
        if (!helper.launchConfirmationActivity(0 /* request code */, null /* title */, title,
                details, false /* returnCredentials */, true /* isExternal */)) {
            Log.d(TAG, "No pattern, password or PIN set.");
            setResult(Activity.RESULT_OK);
                finish();
            }
        }
        }

    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        boolean credentialsConfirmed = (resultCode == Activity.RESULT_OK);
        Log.d(TAG, "Device credentials confirmed: " + credentialsConfirmed);
        setResult(credentialsConfirmed ? Activity.RESULT_OK : Activity.RESULT_CANCELED);
        finish();
    }
}