AutofillFieldClassificationService.java revision 9f1921f9ffc20544f22e76dd412523b53cb68a14
1bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme/*
2bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * Copyright (C) 2018 The Android Open Source Project
3bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme *
4bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * Licensed under the Apache License, Version 2.0 (the "License");
5bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * you may not use this file except in compliance with the License.
6bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * You may obtain a copy of the License at
7bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme *
8bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme *      http://www.apache.org/licenses/LICENSE-2.0
9bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme *
10bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * Unless required by applicable law or agreed to in writing, software
11bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * distributed under the License is distributed on an "AS IS" BASIS,
12bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * See the License for the specific language governing permissions and
14bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * limitations under the License.
15bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme */
16bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemepackage android.service.autofill;
17bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
189f1921f9ffc20544f22e76dd412523b53cb68a14Eugene Suslaimport static com.android.internal.util.function.pooled.PooledLambda.obtainMessage;
199f1921f9ffc20544f22e76dd412523b53cb68a14Eugene Susla
20bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemeimport android.annotation.NonNull;
21bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemeimport android.annotation.Nullable;
22bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemeimport android.annotation.SystemApi;
23bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemeimport android.app.Service;
24bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemeimport android.content.Intent;
25bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemeimport android.os.Bundle;
269f1921f9ffc20544f22e76dd412523b53cb68a14Eugene Suslaimport android.os.Handler;
27bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemeimport android.os.IBinder;
28bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemeimport android.os.Looper;
29bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemeimport android.os.Parcel;
30bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemeimport android.os.Parcelable;
31bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemeimport android.os.RemoteCallback;
32bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemeimport android.os.RemoteException;
33bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemeimport android.util.Log;
34bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemeimport android.view.autofill.AutofillValue;
35bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
36bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemeimport java.util.Arrays;
37bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemeimport java.util.List;
38bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
39bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme/**
40bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * A service that calculates field classification scores.
41bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme *
42bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * <p>A field classification score is a {@code float} representing how well an
43bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * {@link AutofillValue} filled matches a expected value predicted by an autofill service
44bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * &mdash;a full-match is {@code 1.0} (representing 100%), while a full mismatch is {@code 0.0}.
45bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme *
46bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * <p>The exact score depends on the algorithm used to calculate it&mdash; the service must provide
47bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * at least one default algorithm (which is used when the algorithm is not specified or is invalid),
48bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * but it could provide more (in which case the algorithm name should be specifiied by the caller
49bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * when calculating the scores).
50bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme *
51bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme * {@hide}
52bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme */
53bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme@SystemApi
54bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Lemepublic abstract class AutofillFieldClassificationService extends Service {
55bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
56bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    private static final String TAG = "AutofillFieldClassificationService";
57bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
58bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    /**
59bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     * The {@link Intent} action that must be declared as handled by a service
60bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     * in its manifest for the system to recognize it as a quota providing service.
61bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     */
62bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    public static final String SERVICE_INTERFACE =
63bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            "android.service.autofill.AutofillFieldClassificationService";
64bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
65d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme    /**
66d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme     * Manifest metadata key for the resource string containing the name of the default field
67d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme     * classification algorithm.
68d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme     */
69d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme    public static final String SERVICE_META_DATA_KEY_DEFAULT_ALGORITHM =
70d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme            "android.autofill.field_classification.default_algorithm";
71d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme    /**
72d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme     * Manifest metadata key for the resource string array containing the names of all field
73d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme     * classification algorithms provided by the service.
74d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme     */
75d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme    public static final String SERVICE_META_DATA_KEY_AVAILABLE_ALGORITHMS =
76d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme            "android.autofill.field_classification.available_algorithms";
77d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme
78d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme
79bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    /** {@hide} **/
80bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    public static final String EXTRA_SCORES = "scores";
81bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
82bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    private AutofillFieldClassificationServiceWrapper mWrapper;
83bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
849f1921f9ffc20544f22e76dd412523b53cb68a14Eugene Susla    private void getScores(RemoteCallback callback, String algorithmName, Bundle algorithmArgs,
859f1921f9ffc20544f22e76dd412523b53cb68a14Eugene Susla            List<AutofillValue> actualValues, String[] userDataValues) {
86bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        final Bundle data = new Bundle();
879f1921f9ffc20544f22e76dd412523b53cb68a14Eugene Susla        final float[][] scores = onGetScores(algorithmName, algorithmArgs, actualValues,
889f1921f9ffc20544f22e76dd412523b53cb68a14Eugene Susla                Arrays.asList(userDataValues));
899f1921f9ffc20544f22e76dd412523b53cb68a14Eugene Susla        if (scores != null) {
909f1921f9ffc20544f22e76dd412523b53cb68a14Eugene Susla            data.putParcelable(EXTRA_SCORES, new Scores(scores));
91bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        }
92bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        callback.sendResult(data);
939f1921f9ffc20544f22e76dd412523b53cb68a14Eugene Susla    }
94bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
959f1921f9ffc20544f22e76dd412523b53cb68a14Eugene Susla    private final Handler mHandler = new Handler(Looper.getMainLooper(), null, true);
96bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
97bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    /** @hide */
98bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    public AutofillFieldClassificationService() {
99bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
100bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    }
101bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
102bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    @Override
103bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    public void onCreate() {
104bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        super.onCreate();
105bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        mWrapper = new AutofillFieldClassificationServiceWrapper();
106bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    }
107bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
108bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    @Override
109bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    public IBinder onBind(Intent intent) {
110bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        return mWrapper;
111bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    }
112bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
113bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    /**
114bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     * Calculates field classification scores in a batch.
115bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     *
116bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     * <p>See {@link AutofillFieldClassificationService} for more info about field classification
117bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     * scores.
118bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     *
119bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     * @param algorithm name of the algorithm to be used to calculate the scores. If invalid, the
120bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     * default algorithm will be used instead.
121bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     * @param args optional arguments to be passed to the algorithm.
122bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     * @param actualValues values entered by the user.
123bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     * @param userDataValues values predicted from the user data.
124d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme     * @return the calculated scores, with the first dimension representing actual values and the
125d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme     * second dimension values from {@link UserData}.
126bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     *
127bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     * {@hide}
128bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     */
129bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    @Nullable
130bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    @SystemApi
131d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme    public float[][] onGetScores(@Nullable String algorithm,
132bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            @Nullable Bundle args, @NonNull List<AutofillValue> actualValues,
133bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            @NonNull List<String> userDataValues) {
134029f10100cced4a0dd6b07b26b0ffd670881aa47Felipe Leme        Log.e(TAG, "service implementation (" + getClass() + " does not implement onGetScore()");
135029f10100cced4a0dd6b07b26b0ffd670881aa47Felipe Leme        return null;
136bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    }
137bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
138bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    private final class AutofillFieldClassificationServiceWrapper
139bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            extends IAutofillFieldClassificationService.Stub {
140bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        @Override
141bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        public void getScores(RemoteCallback callback, String algorithmName, Bundle algorithmArgs,
142bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme                List<AutofillValue> actualValues, String[] userDataValues)
143bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme                        throws RemoteException {
1449f1921f9ffc20544f22e76dd412523b53cb68a14Eugene Susla            mHandler.sendMessage(obtainMessage(
1459f1921f9ffc20544f22e76dd412523b53cb68a14Eugene Susla                    AutofillFieldClassificationService::getScores,
1469f1921f9ffc20544f22e76dd412523b53cb68a14Eugene Susla                    AutofillFieldClassificationService.this,
1479f1921f9ffc20544f22e76dd412523b53cb68a14Eugene Susla                    callback, algorithmName, algorithmArgs, actualValues, userDataValues));
148bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        }
149bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    }
150bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
151bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    /**
152d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme     * Helper class used to encapsulate a float[][] in a Parcelable.
153bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     *
154bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     * {@hide}
155bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme     */
156bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    public static final class Scores implements Parcelable {
157fe05a529885281ebfb103d1a3ad6bfb862281268Felipe Leme        @NonNull
158d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme        public final float[][] scores;
159bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
160d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme        private Scores(Parcel parcel) {
161bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            final int size1 = parcel.readInt();
162bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            final int size2 = parcel.readInt();
163d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme            scores = new float[size1][size2];
164bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            for (int i = 0; i < size1; i++) {
165bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme                for (int j = 0; j < size2; j++) {
166d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme                    scores[i][j] = parcel.readFloat();
167bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme                }
168bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            }
169bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        }
170bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
171fe05a529885281ebfb103d1a3ad6bfb862281268Felipe Leme        private Scores(@NonNull float[][] scores) {
172d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme            this.scores = scores;
173bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        }
174bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
175bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        @Override
176fe05a529885281ebfb103d1a3ad6bfb862281268Felipe Leme        public String toString() {
177fe05a529885281ebfb103d1a3ad6bfb862281268Felipe Leme            final int size1 = scores.length;
178fe05a529885281ebfb103d1a3ad6bfb862281268Felipe Leme            final int size2 = size1 > 0 ? scores[0].length : 0;
179fe05a529885281ebfb103d1a3ad6bfb862281268Felipe Leme            final StringBuilder builder = new StringBuilder("Scores [")
180fe05a529885281ebfb103d1a3ad6bfb862281268Felipe Leme                    .append(size1).append("x").append(size2).append("] ");
181fe05a529885281ebfb103d1a3ad6bfb862281268Felipe Leme            for (int i = 0; i < size1; i++) {
182fe05a529885281ebfb103d1a3ad6bfb862281268Felipe Leme                builder.append(i).append(": ").append(Arrays.toString(scores[i])).append(' ');
183fe05a529885281ebfb103d1a3ad6bfb862281268Felipe Leme            }
184fe05a529885281ebfb103d1a3ad6bfb862281268Felipe Leme            return builder.toString();
185fe05a529885281ebfb103d1a3ad6bfb862281268Felipe Leme        }
186fe05a529885281ebfb103d1a3ad6bfb862281268Felipe Leme
187fe05a529885281ebfb103d1a3ad6bfb862281268Felipe Leme        @Override
188bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        public int describeContents() {
189bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            return 0;
190bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        }
191bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
192bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        @Override
193bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        public void writeToParcel(Parcel parcel, int flags) {
194d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme            int size1 = scores.length;
195d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme            int size2 = scores[0].length;
196bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            parcel.writeInt(size1);
197bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            parcel.writeInt(size2);
198bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            for (int i = 0; i < size1; i++) {
199bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme                for (int j = 0; j < size2; j++) {
200d11a66220c424c030542aca5c47de059d4a308ccFelipe Leme                    parcel.writeFloat(scores[i][j]);
201bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme                }
202bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            }
203bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        }
204bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
205bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        public static final Creator<Scores> CREATOR = new Creator<Scores>() {
206bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            @Override
207bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            public Scores createFromParcel(Parcel parcel) {
208bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme                return new Scores(parcel);
209bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            }
210bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme
211bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            @Override
212bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            public Scores[] newArray(int size) {
213bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme                return new Scores[size];
214bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme            }
215bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme        };
216bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme    }
217bc055b0ef1c11337b8ec5f681097e7b51e84b9c4Felipe Leme}
218