Loading core/java/android/view/autofill/AutofillManager.java +59 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import static android.service.autofill.FillRequest.FLAG_SUPPORTS_FILL_DIALOG; import static android.service.autofill.FillRequest.FLAG_VIEW_NOT_FOCUSED; import static android.service.autofill.FillRequest.FLAG_VIEW_REQUESTS_CREDMAN_SERVICE; import static android.service.autofill.Flags.FLAG_FILL_DIALOG_IMPROVEMENTS; import static android.service.autofill.Flags.improveFillDialogAconfig; import static android.service.autofill.Flags.relayoutFix; import static android.view.ContentInfo.SOURCE_AUTOFILL; import static android.view.autofill.Helper.sDebug; Loading Loading @@ -787,6 +788,11 @@ public final class AutofillManager { private AutofillStateFingerprint mAutofillStateFingerprint; /** * Whether improveFillDialog feature is enabled or not. */ private boolean mImproveFillDialogEnabled; /** @hide */ public interface AutofillClient { /** Loading Loading @@ -1017,6 +1023,17 @@ public final class AutofillManager { mRelayoutFix = relayoutFix() && AutofillFeatureFlags.enableRelayoutFixes(); mRelativePositionForRelayout = AutofillFeatureFlags.enableRelativeLocationForRelayout(); mIsCredmanIntegrationEnabled = Flags.autofillCredmanIntegration(); mImproveFillDialogEnabled = improveFillDialogAconfig() && AutofillFeatureFlags.isImproveFillDialogEnabled(); } /** * Whether improvement to fill dialog is enabled. * * @hide */ public boolean isImproveFillDialogEnabled() { return mImproveFillDialogEnabled; } /** Loading Loading @@ -1679,6 +1696,11 @@ public final class AutofillManager { private void notifyViewReadyInner(AutofillId id, @Nullable String[] autofillHints, boolean isCredmanRequested) { if (isImproveFillDialogEnabled() && !isCredmanRequested) { // We do not want to send pre-trigger request. // TODO(b/377868687): verify if we can remove the flow for isCredmanRequested too. return; } if (sDebug) { Log.d(TAG, "notifyViewReadyInner:" + id); } Loading Loading @@ -2045,6 +2067,34 @@ public final class AutofillManager { mEnteredIds.add(id); } /** * Notify autofill system that IME animation has started * @param startTimeMs start time as measured by SystemClock.elapsedRealtime() */ void notifyImeAnimationStart(long startTimeMs) { try { mService.notifyImeAnimationStart(mSessionId, startTimeMs, mContext.getUserId()); } catch (RemoteException e) { // The failure could be a consequence of something going wrong on the // server side. Just log the exception and move-on. Log.w(TAG, "notifyImeAnimationStart(): RemoteException caught but ignored " + e); } } /** * Notify autofill system that IME animation has ended * @param endTimeMs end time as measured by SystemClock.elapsedRealtime() */ void notifyImeAnimationEnd(long endTimeMs) { try { mService.notifyImeAnimationEnd(mSessionId, endTimeMs, mContext.getUserId()); } catch (RemoteException e) { // The failure could be a consequence of something going wrong on the // server side. Just log the exception and move-on. Log.w(TAG, "notifyImeAnimationStart(): RemoteException caught but ignored " + e); } } /** * Called when a virtual view that supports autofill is exited. * Loading Loading @@ -4050,6 +4100,10 @@ public final class AutofillManager { @FlaggedApi(FLAG_FILL_DIALOG_IMPROVEMENTS) @Deprecated public boolean showAutofillDialog(@NonNull View view) { if (isImproveFillDialogEnabled()) { Log.i(TAG, "showAutofillDialog() return false due to improve fill dialog"); return false; } Objects.requireNonNull(view); if (shouldShowAutofillDialog(view, view.getAutofillId())) { mShowAutofillDialogCalled = true; Loading Loading @@ -4093,6 +4147,10 @@ public final class AutofillManager { @FlaggedApi(FLAG_FILL_DIALOG_IMPROVEMENTS) @Deprecated public boolean showAutofillDialog(@NonNull View view, int virtualId) { if (isImproveFillDialogEnabled()) { Log.i(TAG, "showAutofillDialog() return false due to improve fill dialog"); return false; } Objects.requireNonNull(view); if (shouldShowAutofillDialog(view, getAutofillId(view, virtualId))) { mShowAutofillDialogCalled = true; Loading @@ -4117,7 +4175,7 @@ public final class AutofillManager { return false; } if (getImeStateFlag(view) == FLAG_IME_SHOWING) { if (getImeStateFlag(view) == FLAG_IME_SHOWING && !isImproveFillDialogEnabled()) { // IME is showing return false; } Loading core/java/android/view/autofill/IAutoFillManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -70,4 +70,6 @@ oneway interface IAutoFillManager { void notifyNotExpiringResponseDuringAuth(int sessionId, int userId); void notifyViewEnteredIgnoredDuringAuthCount(int sessionId, int userId); void setAutofillIdsAttemptedForRefill(int sessionId, in List<AutofillId> ids, int userId); void notifyImeAnimationStart(int sessionId, long startTimeMs, int userId); void notifyImeAnimationEnd(int sessionId, long endTimeMs, int userId); } services/autofill/bugfixes.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,16 @@ flag { bug: "297380045" } flag { name: "improve_fill_dialog_aconfig" namespace: "autofill" description: "Improvements for Fill Dialog. Guard DeviceConfig rollout " bug: "382493181" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "fill_fields_from_current_session_only" namespace: "autofill" Loading services/autofill/java/com/android/server/autofill/AutofillInlineSuggestionsRequestSession.java +9 −2 Original line number Diff line number Diff line Loading @@ -354,6 +354,13 @@ final class AutofillInlineSuggestionsRequestSession { } } private void handleOnInputMethodStartInputView() { synchronized (mLock) { mUiCallback.onInputMethodStartInputView(); handleOnReceiveImeStatusUpdated(true, true); } } /** * Handles the IME session status received from the IME. * Loading Loading @@ -437,8 +444,8 @@ final class AutofillInlineSuggestionsRequestSession { final AutofillInlineSuggestionsRequestSession session = mSession.get(); if (session != null) { session.mHandler.sendMessage(obtainMessage( AutofillInlineSuggestionsRequestSession::handleOnReceiveImeStatusUpdated, session, true, true)); AutofillInlineSuggestionsRequestSession::handleOnInputMethodStartInputView, session)); } } Loading services/autofill/java/com/android/server/autofill/AutofillManagerService.java +26 −0 Original line number Diff line number Diff line Loading @@ -2138,6 +2138,32 @@ public final class AutofillManagerService } } @Override public void notifyImeAnimationStart(int sessionId, long startTimeMs, int userId) { synchronized (mLock) { final AutofillManagerServiceImpl service = peekServiceForUserWithLocalBinderIdentityLocked(userId); if (service != null) { service.notifyImeAnimationStart(sessionId, startTimeMs, getCallingUid()); } else if (sVerbose) { Slog.v(TAG, "notifyImeAnimationStart(): no service for " + userId); } } } @Override public void notifyImeAnimationEnd(int sessionId, long endTimeMs, int userId) { synchronized (mLock) { final AutofillManagerServiceImpl service = peekServiceForUserWithLocalBinderIdentityLocked(userId); if (service != null) { service.notifyImeAnimationEnd(sessionId, endTimeMs, getCallingUid()); } else if (sVerbose) { Slog.v(TAG, "notifyImeAnimationEnd(): no service for " + userId); } } } @Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { if (!DumpUtils.checkDumpPermission(getContext(), TAG, pw)) return; Loading Loading
core/java/android/view/autofill/AutofillManager.java +59 −1 Original line number Diff line number Diff line Loading @@ -26,6 +26,7 @@ import static android.service.autofill.FillRequest.FLAG_SUPPORTS_FILL_DIALOG; import static android.service.autofill.FillRequest.FLAG_VIEW_NOT_FOCUSED; import static android.service.autofill.FillRequest.FLAG_VIEW_REQUESTS_CREDMAN_SERVICE; import static android.service.autofill.Flags.FLAG_FILL_DIALOG_IMPROVEMENTS; import static android.service.autofill.Flags.improveFillDialogAconfig; import static android.service.autofill.Flags.relayoutFix; import static android.view.ContentInfo.SOURCE_AUTOFILL; import static android.view.autofill.Helper.sDebug; Loading Loading @@ -787,6 +788,11 @@ public final class AutofillManager { private AutofillStateFingerprint mAutofillStateFingerprint; /** * Whether improveFillDialog feature is enabled or not. */ private boolean mImproveFillDialogEnabled; /** @hide */ public interface AutofillClient { /** Loading Loading @@ -1017,6 +1023,17 @@ public final class AutofillManager { mRelayoutFix = relayoutFix() && AutofillFeatureFlags.enableRelayoutFixes(); mRelativePositionForRelayout = AutofillFeatureFlags.enableRelativeLocationForRelayout(); mIsCredmanIntegrationEnabled = Flags.autofillCredmanIntegration(); mImproveFillDialogEnabled = improveFillDialogAconfig() && AutofillFeatureFlags.isImproveFillDialogEnabled(); } /** * Whether improvement to fill dialog is enabled. * * @hide */ public boolean isImproveFillDialogEnabled() { return mImproveFillDialogEnabled; } /** Loading Loading @@ -1679,6 +1696,11 @@ public final class AutofillManager { private void notifyViewReadyInner(AutofillId id, @Nullable String[] autofillHints, boolean isCredmanRequested) { if (isImproveFillDialogEnabled() && !isCredmanRequested) { // We do not want to send pre-trigger request. // TODO(b/377868687): verify if we can remove the flow for isCredmanRequested too. return; } if (sDebug) { Log.d(TAG, "notifyViewReadyInner:" + id); } Loading Loading @@ -2045,6 +2067,34 @@ public final class AutofillManager { mEnteredIds.add(id); } /** * Notify autofill system that IME animation has started * @param startTimeMs start time as measured by SystemClock.elapsedRealtime() */ void notifyImeAnimationStart(long startTimeMs) { try { mService.notifyImeAnimationStart(mSessionId, startTimeMs, mContext.getUserId()); } catch (RemoteException e) { // The failure could be a consequence of something going wrong on the // server side. Just log the exception and move-on. Log.w(TAG, "notifyImeAnimationStart(): RemoteException caught but ignored " + e); } } /** * Notify autofill system that IME animation has ended * @param endTimeMs end time as measured by SystemClock.elapsedRealtime() */ void notifyImeAnimationEnd(long endTimeMs) { try { mService.notifyImeAnimationEnd(mSessionId, endTimeMs, mContext.getUserId()); } catch (RemoteException e) { // The failure could be a consequence of something going wrong on the // server side. Just log the exception and move-on. Log.w(TAG, "notifyImeAnimationStart(): RemoteException caught but ignored " + e); } } /** * Called when a virtual view that supports autofill is exited. * Loading Loading @@ -4050,6 +4100,10 @@ public final class AutofillManager { @FlaggedApi(FLAG_FILL_DIALOG_IMPROVEMENTS) @Deprecated public boolean showAutofillDialog(@NonNull View view) { if (isImproveFillDialogEnabled()) { Log.i(TAG, "showAutofillDialog() return false due to improve fill dialog"); return false; } Objects.requireNonNull(view); if (shouldShowAutofillDialog(view, view.getAutofillId())) { mShowAutofillDialogCalled = true; Loading Loading @@ -4093,6 +4147,10 @@ public final class AutofillManager { @FlaggedApi(FLAG_FILL_DIALOG_IMPROVEMENTS) @Deprecated public boolean showAutofillDialog(@NonNull View view, int virtualId) { if (isImproveFillDialogEnabled()) { Log.i(TAG, "showAutofillDialog() return false due to improve fill dialog"); return false; } Objects.requireNonNull(view); if (shouldShowAutofillDialog(view, getAutofillId(view, virtualId))) { mShowAutofillDialogCalled = true; Loading @@ -4117,7 +4175,7 @@ public final class AutofillManager { return false; } if (getImeStateFlag(view) == FLAG_IME_SHOWING) { if (getImeStateFlag(view) == FLAG_IME_SHOWING && !isImproveFillDialogEnabled()) { // IME is showing return false; } Loading
core/java/android/view/autofill/IAutoFillManager.aidl +2 −0 Original line number Diff line number Diff line Loading @@ -70,4 +70,6 @@ oneway interface IAutoFillManager { void notifyNotExpiringResponseDuringAuth(int sessionId, int userId); void notifyViewEnteredIgnoredDuringAuthCount(int sessionId, int userId); void setAutofillIdsAttemptedForRefill(int sessionId, in List<AutofillId> ids, int userId); void notifyImeAnimationStart(int sessionId, long startTimeMs, int userId); void notifyImeAnimationEnd(int sessionId, long endTimeMs, int userId); }
services/autofill/bugfixes.aconfig +10 −0 Original line number Diff line number Diff line Loading @@ -8,6 +8,16 @@ flag { bug: "297380045" } flag { name: "improve_fill_dialog_aconfig" namespace: "autofill" description: "Improvements for Fill Dialog. Guard DeviceConfig rollout " bug: "382493181" metadata { purpose: PURPOSE_BUGFIX } } flag { name: "fill_fields_from_current_session_only" namespace: "autofill" Loading
services/autofill/java/com/android/server/autofill/AutofillInlineSuggestionsRequestSession.java +9 −2 Original line number Diff line number Diff line Loading @@ -354,6 +354,13 @@ final class AutofillInlineSuggestionsRequestSession { } } private void handleOnInputMethodStartInputView() { synchronized (mLock) { mUiCallback.onInputMethodStartInputView(); handleOnReceiveImeStatusUpdated(true, true); } } /** * Handles the IME session status received from the IME. * Loading Loading @@ -437,8 +444,8 @@ final class AutofillInlineSuggestionsRequestSession { final AutofillInlineSuggestionsRequestSession session = mSession.get(); if (session != null) { session.mHandler.sendMessage(obtainMessage( AutofillInlineSuggestionsRequestSession::handleOnReceiveImeStatusUpdated, session, true, true)); AutofillInlineSuggestionsRequestSession::handleOnInputMethodStartInputView, session)); } } Loading
services/autofill/java/com/android/server/autofill/AutofillManagerService.java +26 −0 Original line number Diff line number Diff line Loading @@ -2138,6 +2138,32 @@ public final class AutofillManagerService } } @Override public void notifyImeAnimationStart(int sessionId, long startTimeMs, int userId) { synchronized (mLock) { final AutofillManagerServiceImpl service = peekServiceForUserWithLocalBinderIdentityLocked(userId); if (service != null) { service.notifyImeAnimationStart(sessionId, startTimeMs, getCallingUid()); } else if (sVerbose) { Slog.v(TAG, "notifyImeAnimationStart(): no service for " + userId); } } } @Override public void notifyImeAnimationEnd(int sessionId, long endTimeMs, int userId) { synchronized (mLock) { final AutofillManagerServiceImpl service = peekServiceForUserWithLocalBinderIdentityLocked(userId); if (service != null) { service.notifyImeAnimationEnd(sessionId, endTimeMs, getCallingUid()); } else if (sVerbose) { Slog.v(TAG, "notifyImeAnimationEnd(): no service for " + userId); } } } @Override public void dump(FileDescriptor fd, PrintWriter pw, String[] args) { if (!DumpUtils.checkDumpPermission(getContext(), TAG, pw)) return; Loading