diff options
Diffstat (limited to 'services/autofill')
-rw-r--r-- | services/autofill/java/com/android/server/autofill/Session.java | 25 | ||||
-rw-r--r-- | services/autofill/java/com/android/server/autofill/ui/SaveUi.java | 5 |
2 files changed, 22 insertions, 8 deletions
diff --git a/services/autofill/java/com/android/server/autofill/Session.java b/services/autofill/java/com/android/server/autofill/Session.java index 60b65fb812c2..9b3d075e3f2c 100644 --- a/services/autofill/java/com/android/server/autofill/Session.java +++ b/services/autofill/java/com/android/server/autofill/Session.java @@ -1009,6 +1009,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState || disableDuration > 0) { // Response is "empty" from an UI point of view, need to notify client. notifyUnavailableToClient(sessionFinishedState, /* autofillableIds= */ null); + synchronized (mLock) { + mInlineSessionController.setInlineFillUiLocked( + InlineFillUi.emptyUi(mCurrentViewId)); + } } if (requestLog != null) { @@ -2983,8 +2987,8 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState inlineSuggestionsRequest.get(), response, focusedId, filterText, /*uiCallback*/this, /*onErrorCallback*/ () -> { synchronized (mLock) { - mInlineSessionController.hideInlineSuggestionsUiLocked( - focusedId); + mInlineSessionController.setInlineFillUiLocked( + InlineFillUi.emptyUi(focusedId)); } }, remoteRenderService, userId, id); return mInlineSessionController.setInlineFillUiLocked(inlineFillUi); @@ -3170,12 +3174,15 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState notifyUnavailableToClient(AutofillManager.STATE_FINISHED, autofillableIds); removeSelf(); } else { - if (sVerbose) { - if ((flags & FLAG_PASSWORD_INPUT_TYPE) != 0) { + if ((flags & FLAG_PASSWORD_INPUT_TYPE) != 0) { + if (sVerbose) { Slog.v(TAG, "keeping session " + id + " when service returned null and " + "augmented service is disabled for password fields. " + "AutofillableIds: " + autofillableIds); - } else { + } + mInlineSessionController.hideInlineSuggestionsUiLocked(mCurrentViewId); + } else { + if (sVerbose) { Slog.v(TAG, "keeping session " + id + " when service returned null but " + "it can be augmented. AutofillableIds: " + autofillableIds); } @@ -3201,7 +3208,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState // non-null response but without datasets (for example, just SaveInfo) @GuardedBy("mLock") private Runnable triggerAugmentedAutofillLocked(int flags) { - // (TODO: b/141703197) Fix later by passing info to service. + // TODO: (b/141703197) Fix later by passing info to service. if ((flags & FLAG_PASSWORD_INPUT_TYPE) != 0) { return null; } @@ -3246,7 +3253,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState + ComponentName.flattenToShortString(mComponentName) + " not whitelisted "); } logAugmentedAutofillRequestLocked(mode, remoteService.getComponentName(), - mCurrentViewId, isWhitelisted, /*isInline*/null); + mCurrentViewId, isWhitelisted, /* isInline= */ null); return null; } @@ -3288,6 +3295,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState /*onErrorCallback=*/ () -> { synchronized (mLock) { cancelAugmentedAutofillLocked(); + + // Also cancel augmented in IME + mInlineSessionController.setInlineFillUiLocked( + InlineFillUi.emptyUi(mCurrentViewId)); } }, mService.getRemoteInlineSuggestionRenderServiceLocked(), userId); } diff --git a/services/autofill/java/com/android/server/autofill/ui/SaveUi.java b/services/autofill/java/com/android/server/autofill/ui/SaveUi.java index 507e98369855..1c3116699b2d 100644 --- a/services/autofill/java/com/android/server/autofill/ui/SaveUi.java +++ b/services/autofill/java/com/android/server/autofill/ui/SaveUi.java @@ -33,6 +33,7 @@ import android.graphics.drawable.Drawable; import android.metrics.LogMaker; import android.os.Handler; import android.os.IBinder; +import android.os.UserHandle; import android.service.autofill.BatchUpdates; import android.service.autofill.CustomDescription; import android.service.autofill.InternalOnClickAction; @@ -196,7 +197,9 @@ final class SaveUi { } intent.putExtra(AutofillManager.EXTRA_RESTORE_CROSS_ACTIVITY, true); - PendingIntent p = PendingIntent.getActivity(this, 0, intent, 0); + PendingIntent p = PendingIntent.getActivityAsUser( + this, /* requestCode= */ 0, intent, /* flags= */ 0, /* options= */ null, + UserHandle.CURRENT); if (sDebug) { Slog.d(TAG, "startActivity add save UI restored with intent=" + intent); } |