diff options
| -rw-r--r-- | services/autofill/java/com/android/server/autofill/AutofillManagerService.java | 63 | ||||
| -rw-r--r-- | services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java | 45 |
2 files changed, 11 insertions, 97 deletions
diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java index 25494fce9fbf..d504d1e2ccb6 100644 --- a/services/autofill/java/com/android/server/autofill/AutofillManagerService.java +++ b/services/autofill/java/com/android/server/autofill/AutofillManagerService.java @@ -246,8 +246,6 @@ public final class AutofillManagerService private static final boolean DEFAULT_PCC_USE_FALLBACK = true; - private static final boolean DBG = false; - public AutofillManagerService(Context context) { super(context, new SecureSettingsServiceNameResolver(context, Settings.Secure.AUTOFILL_SERVICE), @@ -315,59 +313,21 @@ public final class AutofillManagerService new WindowManagerInternal.ImeInsetsAnimationChangeListener() { @Override public void onAnimationStart( - @InsetsController.AnimationType int animationType, int userId) { - if (DBG) { - Slog.e(TAG, - "onAnimationStart() notifyImeAnimationStart() " - + "animationType:" - + String.valueOf(animationType)); - } - synchronized (mLock) { - - // We are mostly interested in animations that show up the IME - if (animationType == InsetsController.ANIMATION_TYPE_HIDE) { - // IME is going away - mIsImeShowing = false; - } - if (animationType != InsetsController.ANIMATION_TYPE_SHOW) { - return; - } - mIsImeShowing = true; - mImeAnimatingWhileShowingUp = true; - final AutofillManagerServiceImpl service = - peekServiceForUserWithLocalBinderIdentityLocked(userId); - if (service != null) { - service.notifyImeAnimationStart(); - } else if (sVerbose) { - Slog.v(TAG, - "notifyImeAnimationStart(): no service for " + userId); - } + @InsetsController.AnimationType int animationType, + int userId) { + // TODO: Add logic + if (sVerbose) { + Slog.e(TAG, "onAnimationStart()"); } } @Override public void onAnimationEnd( - @InsetsController.AnimationType int animationType, int userId) { - if (DBG) { - Slog.e(TAG, - "onAnimationEnd() notifyImeAnimationEnd() " - + "animationType:" - + String.valueOf(animationType)); - } - // We are only interested in animations that show up the IME - if (animationType != InsetsController.ANIMATION_TYPE_SHOW) { - return; - } - mImeAnimatingWhileShowingUp = false; - synchronized (mLock) { - final AutofillManagerServiceImpl service = - peekServiceForUserWithLocalBinderIdentityLocked(userId); - if (service != null) { - service.notifyImeAnimationEnd(); - } else if (sVerbose) { - Slog.v(TAG, "notifyImeAnimationEnd(): no service for " - + userId); - } + @InsetsController.AnimationType int animationType, + int userId) { + // TODO: Add logic + if (sVerbose) { + Slog.e(TAG, "onAnimationEnd()"); } } }; @@ -376,9 +336,6 @@ public final class AutofillManagerService } } - public boolean mImeAnimatingWhileShowingUp = false; - public boolean mIsImeShowing = false; - @Override // from AbstractMasterSystemService protected String getServiceSettingsProperty() { return Settings.Secure.AUTOFILL_SERVICE; diff --git a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java index 2353907793a5..11710c9d8a9b 100644 --- a/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +++ b/services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java @@ -208,11 +208,6 @@ final class AutofillManagerServiceImpl private final DisabledInfoCache mDisabledInfoCache; - // Tracks active session id. There is no guarantee that such a session exists. For eg, if the - // session is destroyed, the id may no longer be valid. We don't update the state in all the - // cases. - private int mActiveSessionId = NO_SESSION; - AutofillManagerServiceImpl(AutofillManagerService master, Object lock, LocalLog uiLatencyHistory, LocalLog wtfHistory, int userId, AutoFillUI ui, AutofillCompatState autofillCompatState, @@ -391,7 +386,6 @@ final class AutofillManagerServiceImpl @NonNull Rect virtualBounds, @Nullable AutofillValue value, boolean hasCallback, @NonNull ComponentName clientActivity, boolean compatMode, boolean bindInstantServiceAllowed, int flags) { - mActiveSessionId = NO_SESSION; // FLAG_AUGMENTED_AUTOFILL_REQUEST is set in the flags when standard autofill is disabled // but the package is allowlisted for augmented autofill boolean forAugmentedAutofillOnly = (flags @@ -450,7 +444,6 @@ final class AutofillManagerServiceImpl if (newSession == null) { return NO_SESSION; } - mActiveSessionId = newSession.id; // Service can be null when it's only for augmented autofill String servicePackageName = mInfo == null ? null : mInfo.getServiceInfo().packageName; @@ -754,7 +747,6 @@ final class AutofillManagerServiceImpl Slog.d(TAG, "restarting session " + sessionId + " due to manual request on " + autofillId); } - mActiveSessionId = sessionId; return true; } if (sVerbose) { @@ -764,8 +756,6 @@ final class AutofillManagerServiceImpl return false; } - - mActiveSessionId = sessionId; session.updateLocked(autofillId, virtualBounds, value, action, flags); return false; } @@ -884,54 +874,21 @@ final class AutofillManagerServiceImpl } @GuardedBy("mLock") - public void notifyImeAnimationStart() { - if (!isEnabledLocked()) { - Slog.wtf(TAG, "Service not enabled"); - return; - } - final Session session = mSessions.get(mActiveSessionId); - if (session == null) { - Slog.v(TAG, "notifyImeAnimationEnd(): no session for " + mActiveSessionId); - return; - } - session.notifyImeAnimationStart(SystemClock.elapsedRealtime()); - } - - @GuardedBy("mLock") public void notifyImeAnimationEnd(int sessionId, long endTimeMs, int uid) { if (!isEnabledLocked()) { Slog.wtf(TAG, "Service not enabled"); return; } final Session session = mSessions.get(sessionId); - if (session == null) { + if (session == null || uid != session.uid) { Slog.v(TAG, "notifyImeAnimationEnd(): no session for " + sessionId + "(" + uid + ")"); return; } - if (uid != session.uid) { - Slog.v(TAG, "notifyImeAnimationEnd(): Mismatched session id's " - + sessionId + "(" + uid + ")"); - return; - } session.notifyImeAnimationEnd(endTimeMs); } @GuardedBy("mLock") - public void notifyImeAnimationEnd() { - if (!isEnabledLocked()) { - Slog.wtf(TAG, "Service not enabled"); - return; - } - final Session session = mSessions.get(mActiveSessionId); - if (session == null) { - Slog.v(TAG, "notifyImeAnimationEnd(): no session for " + mActiveSessionId); - return; - } - session.notifyImeAnimationEnd(SystemClock.elapsedRealtime()); - } - - @GuardedBy("mLock") @Override // from PerUserSystemService protected void handlePackageUpdateLocked(@NonNull String packageName) { final ServiceInfo serviceInfo = mFieldClassificationStrategy.getServiceInfo(); |