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

Commit 2cab38ca authored by Felipe Leme's avatar Felipe Leme
Browse files

Made Augmented Autofill APIs accessible to tests.

Bug: 119638958

Test: atest CtsAutoFillServiceTestCases
Test: m update-api && m

Change-Id: I4863885be6121889e4a53db4eb9afad3565c51aa
parent 6eab9950
Loading
Loading
Loading
Loading
+69 −0
Original line number Diff line number Diff line
@@ -1206,6 +1206,71 @@ package android.service.autofill {

}

package android.service.autofill.augmented {

  public abstract class AugmentedAutofillService extends android.app.Service {
    ctor public AugmentedAutofillService();
    method protected final void dump(java.io.FileDescriptor, java.io.PrintWriter, java.lang.String[]);
    method protected void dump(java.io.PrintWriter, java.lang.String[]);
    method public void onFillRequest(android.service.autofill.augmented.FillRequest, android.os.CancellationSignal, android.service.autofill.augmented.FillController, android.service.autofill.augmented.FillCallback);
    field public static final java.lang.String SERVICE_INTERFACE = "android.service.autofill.augmented.AugmentedAutofillService";
  }

  public final class FillCallback {
    method public void onSuccess(android.service.autofill.augmented.FillResponse);
  }

  public final class FillController {
    method public void autofill(java.util.List<android.util.Pair<android.view.autofill.AutofillId, android.view.autofill.AutofillValue>>);
  }

  public final class FillRequest {
    method public android.content.ComponentName getActivityComponent();
    method public android.view.autofill.AutofillId getFocusedId();
    method public android.view.autofill.AutofillValue getFocusedValue();
    method public android.service.autofill.augmented.PresentationParams getPresentationParams();
    method public int getTaskId();
  }

  public final class FillResponse implements android.os.Parcelable {
    method public int describeContents();
    method public void writeToParcel(android.os.Parcel, int);
    field public static final android.os.Parcelable.Creator<android.service.autofill.augmented.FillResponse> CREATOR;
  }

  public static final class FillResponse.Builder {
    ctor public FillResponse.Builder();
    method public android.service.autofill.augmented.FillResponse build();
    method public android.service.autofill.augmented.FillResponse.Builder setFillWindow(android.service.autofill.augmented.FillWindow);
    method public android.service.autofill.augmented.FillResponse.Builder setIgnoredIds(java.util.List<android.view.autofill.AutofillId>);
  }

  public final class FillWindow implements java.lang.AutoCloseable {
    ctor public FillWindow();
    method public void destroy();
    method public boolean update(android.service.autofill.augmented.PresentationParams.Area, android.view.View, long);
    field public static final long FLAG_METADATA_ADDRESS = 1L; // 0x1L
  }

  public abstract class PresentationParams {
    method public int getFlags();
    method public android.service.autofill.augmented.PresentationParams.Area getFullArea();
    method public android.service.autofill.augmented.PresentationParams.Area getSuggestionArea();
    field public static final int FLAG_HINT_GRAVITY_BOTTOM = 2; // 0x2
    field public static final int FLAG_HINT_GRAVITY_LEFT = 4; // 0x4
    field public static final int FLAG_HINT_GRAVITY_RIGHT = 8; // 0x8
    field public static final int FLAG_HINT_GRAVITY_TOP = 1; // 0x1
    field public static final int FLAG_HOST_IME = 16; // 0x10
    field public static final int FLAG_HOST_SYSTEM = 32; // 0x20
  }

  public static abstract class PresentationParams.Area {
    method public android.graphics.Rect getBounds();
    method public android.service.autofill.augmented.PresentationParams.Area getSubArea(android.graphics.Rect);
  }

}

package android.service.notification {

  public final class Adjustment implements android.os.Parcelable {
@@ -1807,6 +1872,10 @@ package android.view.autofill {
    ctor public AutofillId(android.view.autofill.AutofillId, int);
  }

  public final class AutofillManager {
    field public static final int MAX_TEMP_AUGMENTED_SERVICE_DURATION_MS = 120000; // 0x1d4c0
  }

}

package android.view.inputmethod {
+4 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@ import android.annotation.IntDef;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.app.Service;
import android.content.ComponentName;
import android.content.Intent;
@@ -58,6 +59,9 @@ import java.util.List;
 * @hide
 */
@SystemApi
@TestApi
// TODO(b/122654591): @TestApi is needed because CtsAutoFillServiceTestCases hosts the service
// in the same package as the test, and that module is compiled with SDK=test_current
public abstract class AugmentedAutofillService extends Service {

    private static final String TAG = AugmentedAutofillService.class.getSimpleName();
@@ -268,7 +272,6 @@ public abstract class AugmentedAutofillService extends Service {
         *
         * <p>Used to make sure the SmartSuggestionsParams is updated when a new fields is focused.
         */
        // TODO(b/111330312): might not be needed when using IME
        @GuardedBy("mLock")
        private AutofillId mLastShownId;

+4 −0
Original line number Diff line number Diff line
@@ -20,6 +20,7 @@ import static android.service.autofill.augmented.AugmentedAutofillService.DEBUG;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.service.autofill.augmented.AugmentedAutofillService.AutofillProxy;
import android.util.Log;

@@ -29,6 +30,9 @@ import android.util.Log;
 * @hide
 */
@SystemApi
@TestApi
//TODO(b/122654591): @TestApi is needed because CtsAutoFillServiceTestCases hosts the service
//in the same package as the test, and that module is compiled with SDK=test_current
public final class FillCallback {

    private static final String TAG = FillCallback.class.getSimpleName();
+4 −0
Original line number Diff line number Diff line
@@ -19,6 +19,7 @@ import static android.service.autofill.augmented.AugmentedAutofillService.DEBUG;

import android.annotation.NonNull;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.os.RemoteException;
import android.service.autofill.augmented.AugmentedAutofillService.AutofillProxy;
import android.util.Log;
@@ -36,6 +37,9 @@ import java.util.List;
 * @hide
 */
@SystemApi
@TestApi
//TODO(b/122654591): @TestApi is needed because CtsAutoFillServiceTestCases hosts the service
//in the same package as the test, and that module is compiled with SDK=test_current
public final class FillController {
    private static final String TAG = "FillController";

+4 −0
Original line number Diff line number Diff line
@@ -18,6 +18,7 @@ package android.service.autofill.augmented;
import android.annotation.NonNull;
import android.annotation.Nullable;
import android.annotation.SystemApi;
import android.annotation.TestApi;
import android.content.ComponentName;
import android.service.autofill.augmented.AugmentedAutofillService.AutofillProxy;
import android.view.autofill.AutofillId;
@@ -29,6 +30,9 @@ import android.view.autofill.AutofillValue;
 */
@SystemApi
// TODO(b/111330312): pass a requestId and/or sessionId
@TestApi
// TODO(b/122654591): @TestApi is needed because CtsAutoFillServiceTestCases hosts the service
// in the same package as the test, and that module is compiled with SDK=test_current
public final class FillRequest {

    final AutofillProxy mProxy;
Loading