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

Commit 3461d3c0 authored by Felipe Leme's avatar Felipe Leme
Browse files

Initial IME integration.

- Created an AutoFillManager class, which provides methods to show
  the auto-fill bar for views and virtual nodes.
- Automatically launches an auto-fill request when the IME is shown
(and an AutoFillService is set for the given user) on TextViews.
- Updated VirtualNodeListener to use this new API.

BUG: 31001899
BUG: 34171325
Test: CtsAutoFillServiceTestCases passes
Test: manual verification

Change-Id: Id72ce97da70217081b5823cfc7b138412634fcf3
parent dd94abc3
Loading
Loading
Loading
Loading
+8 −1
Original line number Diff line number Diff line
@@ -46094,6 +46094,13 @@ package android.view.autofill {
    field public static final android.os.Parcelable.Creator<android.view.autofill.AutoFillId> CREATOR;
  }
  public final class AutoFillManager {
    method public void updateAutoFillInput(android.view.View, int);
    method public void updateAutoFillInput(android.view.View, int, android.graphics.Rect, int);
    field public static final int FLAG_UPDATE_UI_HIDE = 2; // 0x2
    field public static final int FLAG_UPDATE_UI_SHOW = 1; // 0x1
  }
  public final class AutoFillType implements android.os.Parcelable {
    method public int describeContents();
    method public static android.view.autofill.AutoFillType forList();
@@ -46153,7 +46160,7 @@ package android.view.autofill {
  public static abstract class VirtualViewDelegate.Callback {
    ctor public VirtualViewDelegate.Callback();
    method public void onFocusChanged(int, boolean);
    method public void onAutoFillInputUpdated(int, android.graphics.Rect, int);
    method public void onNodeRemoved(int...);
    method public void onValueChanged(int);
  }
+8 −1
Original line number Diff line number Diff line
@@ -49403,6 +49403,13 @@ package android.view.autofill {
    field public static final android.os.Parcelable.Creator<android.view.autofill.AutoFillId> CREATOR;
  }
  public final class AutoFillManager {
    method public void updateAutoFillInput(android.view.View, int);
    method public void updateAutoFillInput(android.view.View, int, android.graphics.Rect, int);
    field public static final int FLAG_UPDATE_UI_HIDE = 2; // 0x2
    field public static final int FLAG_UPDATE_UI_SHOW = 1; // 0x1
  }
  public final class AutoFillType implements android.os.Parcelable {
    method public int describeContents();
    method public static android.view.autofill.AutoFillType forList();
@@ -49462,7 +49469,7 @@ package android.view.autofill {
  public static abstract class VirtualViewDelegate.Callback {
    ctor public VirtualViewDelegate.Callback();
    method public void onFocusChanged(int, boolean);
    method public void onAutoFillInputUpdated(int, android.graphics.Rect, int);
    method public void onNodeRemoved(int...);
    method public void onValueChanged(int);
  }
+8 −1
Original line number Diff line number Diff line
@@ -46392,6 +46392,13 @@ package android.view.autofill {
    field public static final android.os.Parcelable.Creator<android.view.autofill.AutoFillId> CREATOR;
  }
  public final class AutoFillManager {
    method public void updateAutoFillInput(android.view.View, int);
    method public void updateAutoFillInput(android.view.View, int, android.graphics.Rect, int);
    field public static final int FLAG_UPDATE_UI_HIDE = 2; // 0x2
    field public static final int FLAG_UPDATE_UI_SHOW = 1; // 0x1
  }
  public final class AutoFillType implements android.os.Parcelable {
    method public int describeContents();
    method public static android.view.autofill.AutoFillType forList();
@@ -46451,7 +46458,7 @@ package android.view.autofill {
  public static abstract class VirtualViewDelegate.Callback {
    ctor public VirtualViewDelegate.Callback();
    method public void onFocusChanged(int, boolean);
    method public void onAutoFillInputUpdated(int, android.graphics.Rect, int);
    method public void onNodeRemoved(int...);
    method public void onValueChanged(int);
  }
+10 −0
Original line number Diff line number Diff line
@@ -112,6 +112,7 @@ import android.os.health.SystemHealthManager;
import android.os.storage.StorageManager;
import android.print.IPrintManager;
import android.print.PrintManager;
import android.service.autofill.IAutoFillManagerService;
import android.service.persistentdata.IPersistentDataBlockService;
import android.service.persistentdata.PersistentDataBlockManager;
import android.telecom.TelecomManager;
@@ -126,6 +127,7 @@ import android.view.WindowManager;
import android.view.WindowManagerImpl;
import android.view.accessibility.AccessibilityManager;
import android.view.accessibility.CaptioningManager;
import android.view.autofill.AutoFillManager;
import android.view.inputmethod.InputMethodManager;
import android.view.textclassifier.TextClassificationManager;
import android.view.textservice.TextServicesManager;
@@ -804,6 +806,14 @@ final class SystemServiceRegistry {
                        IBinder b = ServiceManager.getServiceOrThrow(Context.FONT_SERVICE);
                        return new FontManager(IFontManager.Stub.asInterface(b));
                    }});
        registerService(Context.AUTO_FILL_MANAGER_SERVICE, AutoFillManager.class,
                new CachedServiceFetcher<AutoFillManager>() {
            @Override
            public AutoFillManager createService(ContextImpl ctx) throws ServiceNotFoundException {
                IBinder b = ServiceManager.getServiceOrThrow(Context.AUTO_FILL_MANAGER_SERVICE);
                IAutoFillManagerService service = IAutoFillManagerService.Stub.asInterface(b);
                return new AutoFillManager(ctx, service);
            }});
    }

    /**
+2 −6
Original line number Diff line number Diff line
@@ -15,8 +15,6 @@
 */
package android.service.autofill;

import static android.service.voice.VoiceInteractionSession.KEY_FLAGS;
import static android.service.voice.VoiceInteractionSession.KEY_STRUCTURE;
import static android.view.View.AUTO_FILL_FLAG_TYPE_FILL;
import static android.view.View.AUTO_FILL_FLAG_TYPE_SAVE;

@@ -30,13 +28,11 @@ import android.os.CancellationSignal;
import android.os.IBinder;
import android.os.Looper;
import android.os.Message;
import android.os.RemoteException;
import android.util.Log;
import android.view.autofill.AutoFillId;
import android.view.autofill.FillResponse;

import com.android.internal.os.HandlerCaller;
import com.android.internal.os.IResultReceiver;
import com.android.internal.os.SomeArgs;

// TODO(b/33197203): improve javadoc (of both class and methods); in particular, make sure the
@@ -49,8 +45,8 @@ import com.android.internal.os.SomeArgs;
 */
public abstract class AutoFillService extends Service {

    static final String TAG = "AutoFillService";
    static final boolean DEBUG = true; // TODO: set to false once stable
    private static final String TAG = "AutoFillService";
    static final boolean DEBUG = true; // TODO(b/33197203): set to false once stable

    /**
     * The {@link Intent} that must be declared as handled by the service.
Loading