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

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

Merge "Changed onGetScores() to return null instead of throwing exception."

parents 1776fa33 029f1010
Loading
Loading
Loading
Loading
+6 −3
Original line number Diff line number Diff line
@@ -99,7 +99,9 @@ public abstract class AutofillFieldClassificationService extends Service {
                final String[] userDataValues = (String[]) args.arg5;
                final float[][] scores = onGetScores(algorithmName, algorithmArgs, actualValues,
                        Arrays.asList(userDataValues));
                if (scores != null) {
                    data.putParcelable(EXTRA_SCORES, new Scores(scores));
                }
                break;
            default:
                Log.w(TAG, "Handling unknown message: " + action);
@@ -148,7 +150,8 @@ public abstract class AutofillFieldClassificationService extends Service {
    public float[][] onGetScores(@Nullable String algorithm,
            @Nullable Bundle args, @NonNull List<AutofillValue> actualValues,
            @NonNull List<String> userDataValues) {
        throw new UnsupportedOperationException("Must be implemented by external service");
        Log.e(TAG, "service implementation (" + getClass() + " does not implement onGetScore()");
        return null;
    }

    private final class AutofillFieldClassificationServiceWrapper