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

Commit 6f781be9 authored by TreeHugger Robot's avatar TreeHugger Robot Committed by Android (Google) Code Review
Browse files

Merge "Minor improvements to help diagnose auth workflow."

parents ed717563 d633f072
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.service.autofill;

import static android.view.autofill.Helper.DEBUG;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.IntentSender;
@@ -23,6 +25,7 @@ import android.os.Parcel;
import android.os.Parcelable;
import android.view.autofill.AutoFillId;
import android.view.autofill.AutoFillValue;

import com.android.internal.util.Preconditions;

import java.util.ArrayList;
@@ -41,7 +44,6 @@ import java.util.ArrayList;
 * @see android.service.autofill.FillResponse for examples.
 */
public final class Dataset implements Parcelable {
    private static final boolean DEBUG = false;

    private final CharSequence mName;
    private final ArrayList<AutoFillId> mFieldIds;
+2 −1
Original line number Diff line number Diff line
@@ -15,6 +15,8 @@
 */
package android.service.autofill;

import static android.view.autofill.Helper.DEBUG;

import android.annotation.NonNull;
import android.annotation.Nullable;
import android.content.IntentSender;
@@ -152,7 +154,6 @@ import android.view.autofill.AutoFillManager;
 * experience.</p>
 */
public final class FillResponse implements Parcelable {
    private static final boolean DEBUG = false;

    private final ArraySet<Dataset> mDatasets;
    private final ArraySet<AutoFillId> mSavableIds;
+11 −4
Original line number Diff line number Diff line
@@ -16,6 +16,8 @@

package android.view.autofill;

import static android.view.autofill.Helper.DEBUG;

import android.content.Context;
import android.content.Intent;
import android.content.IntentSender;
@@ -37,7 +39,6 @@ import java.util.List;
// TODO(b/33197203): improve this javadoc
//TODO(b/33197203): restrict manager calls to activity
public final class AutoFillManager {
    private static final boolean DEBUG = false;

    private static final String TAG = "AutoFillManager";

@@ -247,12 +248,18 @@ public final class AutoFillManager {

    /** @hide */
    public void onAuthenticationResult(Intent data) {
        // TODO(b/33197203): the result code is being ignored, so this method is not reliably
        // handling the cases where it's not RESULT_OK: it works fine if the service does not
        // set the EXTRA_AUTHENTICATION_RESULT extra, but it could cause weird results if the
        // service set the extra and returned RESULT_CANCELED...

        if (DEBUG) Log.d(TAG, "onAuthenticationResult(): d=" + data);

        if (data == null) {
            return;
        }
        Parcelable result = data.getParcelableExtra(
                EXTRA_AUTHENTICATION_RESULT);
        Bundle responseData = new Bundle();
        final Parcelable result = data.getParcelableExtra(EXTRA_AUTHENTICATION_RESULT);
        final Bundle responseData = new Bundle();
        responseData.putParcelable(EXTRA_AUTHENTICATION_RESULT, result);
        try {
            mService.setAuthenticationResult(responseData,
+3 −3
Original line number Diff line number Diff line
@@ -25,9 +25,9 @@ import java.util.Set;
/** @hide */
public final class Helper {

    static final boolean DEBUG = true; // TODO(b/33197203): set to false when stable
    static final boolean VERBOSE = false;
    static final String REDACTED = "[REDACTED]";
    public static final boolean DEBUG = true; // TODO(b/33197203): set to false when stable
    public static final boolean VERBOSE = false;
    public static final String REDACTED = "[REDACTED]";

    static StringBuilder append(StringBuilder builder, Bundle bundle) {
        if (bundle == null) {