Skip to content

Commit

Permalink
Changed resource id heuristic to use 'email' - works with PayPal.
Browse files Browse the repository at this point in the history
  • Loading branch information
the-felipeal committed Nov 29, 2017
1 parent c52ca2a commit b2c294e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
import android.support.annotation.Nullable;
import android.support.v7.app.AppCompatActivity;
import android.text.Editable;
import android.util.Log;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.autofill.AutofillManager;
Expand All @@ -43,9 +42,9 @@
import static android.view.autofill.AutofillManager.EXTRA_AUTHENTICATION_RESULT;
import static com.example.android.autofill.service.Util.EXTRA_DATASET_NAME;
import static com.example.android.autofill.service.Util.EXTRA_FOR_RESPONSE;
import static com.example.android.autofill.service.Util.logv;
import static com.example.android.autofill.service.Util.logw;


/**
* This Activity controls the UI for logging in to the Autofill service.
* It is launched when an Autofill Response or specific Dataset within the Response requires
Expand Down Expand Up @@ -145,10 +144,12 @@ private void onSuccess() {
}

private void setResponseIntent(FillResponse fillResponse) {
logv("Setting response on auth activity: %s", fillResponse);
mReplyIntent.putExtra(EXTRA_AUTHENTICATION_RESULT, fillResponse);
}

private void setDatasetIntent(Dataset dataset) {
logv("Setting dataset on auth activity: %s", dataset);
mReplyIntent.putExtra(EXTRA_AUTHENTICATION_RESULT, dataset);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,13 @@ private void parseLocked(boolean forFill, ViewNode viewNode, StringBuilder valid
if (hasResourceId && filteredHints == null) {
resourceId = resourceId.toLowerCase();
logd("Trying resourceId: %s", resourceId);
logd("Found username");
if (resourceId.contains("username")) {
logd("Found username");
filteredHints = new String[] {View.AUTOFILL_HINT_USERNAME};
} else if (resourceId.contains("email")) {
logd("Found email");
filteredHints = new String[]{View.AUTOFILL_HINT_EMAIL_ADDRESS};
} else if (resourceId.contains("password")) {
logd("Found password");
filteredHints = new String[] {View.AUTOFILL_HINT_PASSWORD};
Expand Down

0 comments on commit b2c294e

Please sign in to comment.