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

Commit 9b32a707 authored by Felipe Leme's avatar Felipe Leme Committed by android-build-merger
Browse files

Merge "Couple autofill fixes." into oc-dev

am: 5fd8672d

Change-Id: I767486242a6c8494e70710622029b9e03d621a9e
parents c1ff21c8 5fd8672d
Loading
Loading
Loading
Loading
+9 −8
Original line number Diff line number Diff line
@@ -2770,6 +2770,7 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     *         1                         PFLAG3_HAS_OVERLAPPING_RENDERING_FORCED
     *        1                          PFLAG3_TEMPORARY_DETACH
     *       1                           PFLAG3_NO_REVEAL_ON_FOCUS
     *      1                            PFLAG3_NOTIFY_AUTOFILL_ENTER_ON_LAYOUT
     * |-------|-------|-------|-------|
     */
@@ -2858,14 +2859,6 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     */
    static final int PFLAG3_SCROLL_INDICATOR_END = 0x2000;
    /**
     * Flag indicating that when layout is completed we should notify
     * that the view was entered for autofill purposes. To minimize
     * showing autofill for views not visible to the user we evaluate
     * user visibility which cannot be done until the view is laid out.
     */
    static final int PFLAG3_NOTIFY_AUTOFILL_ENTER_ON_LAYOUT = 0x4000;
    static final int DRAG_MASK = PFLAG2_DRAG_CAN_ACCEPT | PFLAG2_DRAG_HOVERED;
    static final int SCROLL_INDICATORS_NONE = 0x0000;
@@ -3050,6 +3043,14 @@ public class View implements Drawable.Callback, KeyEvent.Callback,
     */
    private static final int PFLAG3_NO_REVEAL_ON_FOCUS = 0x4000000;
    /**
     * Flag indicating that when layout is completed we should notify
     * that the view was entered for autofill purposes. To minimize
     * showing autofill for views not visible to the user we evaluate
     * user visibility which cannot be done until the view is laid out.
     */
    static final int PFLAG3_NOTIFY_AUTOFILL_ENTER_ON_LAYOUT = 0x8000000;
    /* End of masks for mPrivateFlags3 */
    /**
+9 −0
Original line number Diff line number Diff line
@@ -335,6 +335,7 @@ public final class AutofillManagerService extends SystemService {
    void listSessions(int userId, IResultReceiver receiver) {
        Slog.i(TAG, "listSessions() for userId " + userId);
        mContext.enforceCallingPermission(MANAGE_AUTO_FILL, TAG);

        final Bundle resultData = new Bundle();
        final ArrayList<String> sessions = new ArrayList<>();

@@ -364,6 +365,7 @@ public final class AutofillManagerService extends SystemService {
    void reset() {
        Slog.i(TAG, "reset()");
        mContext.enforceCallingPermission(MANAGE_AUTO_FILL, TAG);

        synchronized (mLock) {
            final int size = mServicesCache.size();
            for (int i = 0; i < size; i++) {
@@ -376,6 +378,8 @@ public final class AutofillManagerService extends SystemService {
    // Called by Shell command.
    void setLogLevel(int level) {
        Slog.i(TAG, "setLogLevel(): " + level);
        mContext.enforceCallingPermission(MANAGE_AUTO_FILL, TAG);

        boolean debug = false;
        boolean verbose = false;
        if (level == AutofillManager.FLAG_ADD_CLIENT_VERBOSE) {
@@ -391,6 +395,8 @@ public final class AutofillManagerService extends SystemService {

    // Called by Shell command.
    int getLogLevel() {
        mContext.enforceCallingPermission(MANAGE_AUTO_FILL, TAG);

        synchronized (mLock) {
            if (sVerbose) return AutofillManager.FLAG_ADD_CLIENT_VERBOSE;
            if (sDebug) return AutofillManager.FLAG_ADD_CLIENT_DEBUG;
@@ -400,6 +406,8 @@ public final class AutofillManagerService extends SystemService {

    // Called by Shell command.
    public int getMaxPartitions() {
        mContext.enforceCallingPermission(MANAGE_AUTO_FILL, TAG);

        synchronized (mLock) {
            return sPartitionMaxCount;
        }
@@ -407,6 +415,7 @@ public final class AutofillManagerService extends SystemService {

    // Called by Shell command.
    public void setMaxPartitions(int max) {
        mContext.enforceCallingPermission(MANAGE_AUTO_FILL, TAG);
        Slog.i(TAG, "setMaxPartitions(): " + max);
        synchronized (mLock) {
            sPartitionMaxCount = max;
+1 −0
Original line number Diff line number Diff line
@@ -818,6 +818,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
                }
            }
            if (atLeastOneChanged) {
                if (sDebug) Slog.d(TAG, "at least one field changed - showing save UI");
                mService.setSaveShown();
                getUiForShowing().showSaveUi(mService.getServiceLabel(), saveInfo, mPackageName,
                        this);
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,7 @@
package com.android.server.autofill.ui;

import static com.android.server.autofill.Helper.sDebug;
import static com.android.server.autofill.Helper.sVerbose;

import android.annotation.NonNull;
import android.annotation.Nullable;
@@ -108,6 +109,8 @@ public final class AutoFillUI {
     * Displays an error message to the user.
     */
    public void showError(@Nullable CharSequence message, @NonNull AutoFillUiCallback callback) {
        Slog.w(TAG, "showError(): " + message);

        mHandler.post(() -> {
            if (mCallback != callback) {
                return;
@@ -237,6 +240,7 @@ public final class AutoFillUI {
     */
    public void showSaveUi(@NonNull CharSequence providerLabel, @NonNull SaveInfo info,
            @NonNull String packageName, @NonNull AutoFillUiCallback callback) {
        if (sVerbose) Slog.v(TAG, "showSaveUi() for " + packageName + ": " + info);
        int numIds = 0;
        numIds += info.getRequiredIds() == null ? 0 : info.getRequiredIds().length;
        numIds += info.getOptionalIds() == null ? 0 : info.getOptionalIds().length;