AutofillFramework/Application/src/main/java/com/example/android/autofill/app/commoncases/VirtualSignInActivity.java [48:86]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        CustomVirtualView.Partition credentialsPartition =
                mCustomVirtualView.addPartition(getString(R.string.partition_credentials));
        mUsernameLine = credentialsPartition.addLine("username", View.AUTOFILL_TYPE_TEXT,
                getString(R.string.username_label),
                "         ", false, View.AUTOFILL_HINT_USERNAME);
        mPasswordLine = credentialsPartition.addLine("password", View.AUTOFILL_TYPE_TEXT,
                getString(R.string.password_label),
                "         ", true, View.AUTOFILL_HINT_PASSWORD);

        findViewById(R.id.login).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                login();
            }
        });
        findViewById(R.id.clear).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                resetFields();
                mAutofillManager.cancel();
            }
        });
        mAutofillManager = getSystemService(AutofillManager.class);
    }

    private void resetFields() {
        mUsernameLine.reset();
        mPasswordLine.reset();
        mCustomVirtualView.postInvalidate();
    }

    /**
     * Emulates a login action.
     */
    private void login() {
        String username = mUsernameLine.getText().toString();
        String password = mPasswordLine.getText().toString();
        boolean valid = isValidCredentials(username, password);
        if (valid) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



AutofillFramework/Application/src/main/java/com/example/android/autofill/app/edgecases/VirtualCompatModeSignInActivity.java [65:103]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
        CustomVirtualView.Partition credentialsPartition =
                mCustomVirtualView.addPartition(getString(R.string.partition_credentials));
        mUsernameLine = credentialsPartition.addLine("username", View.AUTOFILL_TYPE_TEXT,
                getString(R.string.username_label),
                "         ", false, View.AUTOFILL_HINT_USERNAME);
        mPasswordLine = credentialsPartition.addLine("password", View.AUTOFILL_TYPE_TEXT,
                getString(R.string.password_label),
                "         ", true, View.AUTOFILL_HINT_PASSWORD);

        findViewById(R.id.login).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                login();
            }
        });
        findViewById(R.id.clear).setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                resetFields();
                mAutofillManager.cancel();
            }
        });
        mAutofillManager = getSystemService(AutofillManager.class);
    }

    private void resetFields() {
        mUsernameLine.reset();
        mPasswordLine.reset();
        mCustomVirtualView.postInvalidate();
    }

    /**
     * Emulates a login action.
     */
    private void login() {
        String username = mUsernameLine.getText().toString();
        String password = mPasswordLine.getText().toString();
        boolean valid = isValidCredentials(username, password);
        if (valid) {
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



