Loading core/java/android/service/autofill/AutofillFieldClassificationService.java +14 −1 Original line number Diff line number Diff line Loading @@ -172,6 +172,7 @@ public abstract class AutofillFieldClassificationService extends Service { * {@hide} */ public static final class Scores implements Parcelable { @NonNull public final float[][] scores; private Scores(Parcel parcel) { Loading @@ -185,10 +186,22 @@ public abstract class AutofillFieldClassificationService extends Service { } } private Scores(float[][] scores) { private Scores(@NonNull float[][] scores) { this.scores = scores; } @Override public String toString() { final int size1 = scores.length; final int size2 = size1 > 0 ? scores[0].length : 0; final StringBuilder builder = new StringBuilder("Scores [") .append(size1).append("x").append(size2).append("] "); for (int i = 0; i < size1; i++) { builder.append(i).append(": ").append(Arrays.toString(scores[i])).append(' '); } return builder.toString(); } @Override public int describeContents() { return 0; Loading core/java/android/view/ViewGroup.java +5 −2 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.view.animation.LayoutAnimationController; import android.view.animation.Transformation; import android.view.autofill.Helper; import com.android.internal.R; Loading Loading @@ -3474,8 +3475,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } if (!isLaidOut()) { if (Helper.sVerbose) { Log.v(VIEW_LOG_TAG, "dispatchProvideStructure(): not laid out, ignoring " + childrenCount + " children of " + getAccessibilityViewId()); } return; } Loading services/autofill/java/com/android/server/autofill/AutofillManagerService.java +7 −3 Original line number Diff line number Diff line Loading @@ -119,6 +119,7 @@ public final class AutofillManagerService extends SystemService { private final LocalLog mRequestsHistory = new LocalLog(20); private final LocalLog mUiLatencyHistory = new LocalLog(20); private final LocalLog mWtfHistory = new LocalLog(50); private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override Loading Loading @@ -310,7 +311,8 @@ public final class AutofillManagerService extends SystemService { AutofillManagerServiceImpl service = mServicesCache.get(resolvedUserId); if (service == null) { service = new AutofillManagerServiceImpl(mContext, mLock, mRequestsHistory, mUiLatencyHistory, resolvedUserId, mUi, mDisabledUsers.get(resolvedUserId)); mUiLatencyHistory, mWtfHistory, resolvedUserId, mUi, mDisabledUsers.get(resolvedUserId)); mServicesCache.put(userId, service); } return service; Loading Loading @@ -878,10 +880,12 @@ public final class AutofillManagerService extends SystemService { mUi.dump(pw); } if (showHistory) { pw.println("Requests history:"); pw.println(); pw.println("Requests history:"); pw.println(); mRequestsHistory.reverseDump(fd, pw, args); pw.println("UI latency history:"); pw.println(); pw.println("UI latency history:"); pw.println(); mUiLatencyHistory.reverseDump(fd, pw, args); pw.println(); pw.println("WTF history:"); pw.println(); mWtfHistory.reverseDump(fd, pw, args); } } finally { setDebugLocked(oldDebug); Loading services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +6 −4 Original line number Diff line number Diff line Loading @@ -43,7 +43,6 @@ import android.os.Binder; import android.os.Bundle; import android.os.IBinder; import android.os.Looper; import android.os.RemoteCallback; import android.os.RemoteCallbackList; import android.os.RemoteException; import android.os.SystemClock; Loading Loading @@ -116,6 +115,7 @@ final class AutofillManagerServiceImpl { private final LocalLog mRequestsHistory; private final LocalLog mUiLatencyHistory; private final LocalLog mWtfHistory; private final FieldClassificationStrategy mFieldClassificationStrategy; /** Loading Loading @@ -179,11 +179,13 @@ final class AutofillManagerServiceImpl { private long mLastPrune = 0; AutofillManagerServiceImpl(Context context, Object lock, LocalLog requestsHistory, LocalLog uiLatencyHistory, int userId, AutoFillUI ui, boolean disabled) { LocalLog uiLatencyHistory, LocalLog wtfHistory, int userId, AutoFillUI ui, boolean disabled) { mContext = context; mLock = lock; mRequestsHistory = requestsHistory; mUiLatencyHistory = uiLatencyHistory; mWtfHistory = wtfHistory; mUserId = userId; mUi = ui; mFieldClassificationStrategy = new FieldClassificationStrategy(context, userId); Loading Loading @@ -484,8 +486,8 @@ final class AutofillManagerServiceImpl { assertCallerLocked(componentName); final Session newSession = new Session(this, mUi, mContext, mHandlerCaller, mUserId, mLock, sessionId, uid, activityToken, appCallbackToken, hasCallback, mUiLatencyHistory, mInfo.getServiceInfo().getComponentName(), componentName, flags); sessionId, uid, activityToken, appCallbackToken, hasCallback, mUiLatencyHistory, mWtfHistory, mInfo.getServiceInfo().getComponentName(), componentName, flags); mSessions.put(newSession.id, newSession); return newSession; Loading services/autofill/java/com/android/server/autofill/Session.java +28 −8 Original line number Diff line number Diff line Loading @@ -210,6 +210,9 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState @GuardedBy("mLock") private final LocalLog mUiLatencyHistory; @GuardedBy("mLock") private final LocalLog mWtfHistory; /** * Receiver of assist data from the app's {@link Activity}. */ Loading Loading @@ -241,7 +244,13 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState // ONE_WAY warning because system_service could block on app calls. We need to // change AssistStructure so it provides a "one-way" writeToParcel() method that // sends all the data try { structure.ensureData(); } catch (RuntimeException e) { wtf(e, "Exception lazy loading assist structure for %s: %s", structure.getActivityComponent(), e); return; } // Sanitize structure before it's sent to service. final ComponentName componentNameFromApp = structure.getActivityComponent(); Loading Loading @@ -447,6 +456,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState @NonNull Context context, @NonNull HandlerCaller handlerCaller, int userId, @NonNull Object lock, int sessionId, int uid, @NonNull IBinder activityToken, @NonNull IBinder client, boolean hasCallback, @NonNull LocalLog uiLatencyHistory, @NonNull LocalLog wtfHistory, @NonNull ComponentName serviceComponentName, @NonNull ComponentName componentName, int flags) { id = sessionId; Loading @@ -461,6 +471,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState mActivityToken = activityToken; mHasCallback = hasCallback; mUiLatencyHistory = uiLatencyHistory; mWtfHistory = wtfHistory; mComponentName = componentName; mClient = IAutoFillManagerClient.Stub.asInterface(client); Loading Loading @@ -1102,8 +1113,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState if (userData != null && fcStrategy != null) { logFieldClassificationScoreLocked(fcStrategy, ignoredDatasets, changedFieldIds, changedDatasetIds, manuallyFilledFieldIds, manuallyFilledDatasetIds, manuallyFilledIds, userData, mViewStates.values()); userData, mViewStates.values()); } else { mService.logContextCommittedLocked(id, mClientState, mSelectedDatasetIds, ignoredDatasets, changedFieldIds, changedDatasetIds, Loading @@ -1123,7 +1133,6 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState @NonNull ArrayList<String> changedDatasetIds, @NonNull ArrayList<AutofillId> manuallyFilledFieldIds, @NonNull ArrayList<ArrayList<String>> manuallyFilledDatasetIds, @NonNull ArrayMap<AutofillId, ArraySet<String>> manuallyFilledIds, @NonNull UserData userData, @NonNull Collection<ViewState> viewStates) { final String[] userValues = userData.getValues(); Loading Loading @@ -1201,8 +1210,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } } } catch (ArrayIndexOutOfBoundsException e) { Slog.wtf(TAG, "Error accessing FC score at " + i + " x " + j + ": " + Arrays.toString(scores.scores), e); wtf(e, "Error accessing FC score at [%d, %d] (%s): %s", i, j, scores, e); return; } Loading Loading @@ -2151,9 +2159,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState final Intent fillInIntent = new Intent(); final FillContext context = getFillContextByRequestIdLocked(requestId); if (context == null) { Slog.wtf(TAG, "createAuthFillInIntentLocked(): no FillContext. requestId=" + requestId + "; mContexts= " + mContexts); wtf(null, "createAuthFillInIntentLocked(): no FillContext. requestId=%d; mContexts=%s", requestId, mContexts); return null; } fillInIntent.putExtra(AutofillManager.EXTRA_ASSIST_STRUCTURE, context.getStructure()); Loading Loading @@ -2418,4 +2427,15 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState private void writeLog(int category) { mMetricsLogger.write(newLogMaker(category)); } private void wtf(@Nullable Exception e, String fmt, Object...args) { final String message = String.format(fmt, args); mWtfHistory.log(message); if (e != null) { Slog.wtf(TAG, message, e); } else { Slog.wtf(TAG, message); } } } Loading
core/java/android/service/autofill/AutofillFieldClassificationService.java +14 −1 Original line number Diff line number Diff line Loading @@ -172,6 +172,7 @@ public abstract class AutofillFieldClassificationService extends Service { * {@hide} */ public static final class Scores implements Parcelable { @NonNull public final float[][] scores; private Scores(Parcel parcel) { Loading @@ -185,10 +186,22 @@ public abstract class AutofillFieldClassificationService extends Service { } } private Scores(float[][] scores) { private Scores(@NonNull float[][] scores) { this.scores = scores; } @Override public String toString() { final int size1 = scores.length; final int size2 = size1 > 0 ? scores[0].length : 0; final StringBuilder builder = new StringBuilder("Scores [") .append(size1).append("x").append(size2).append("] "); for (int i = 0; i < size1; i++) { builder.append(i).append(": ").append(Arrays.toString(scores[i])).append(' '); } return builder.toString(); } @Override public int describeContents() { return 0; Loading
core/java/android/view/ViewGroup.java +5 −2 Original line number Diff line number Diff line Loading @@ -57,6 +57,7 @@ import android.view.animation.Animation; import android.view.animation.AnimationUtils; import android.view.animation.LayoutAnimationController; import android.view.animation.Transformation; import android.view.autofill.Helper; import com.android.internal.R; Loading Loading @@ -3474,8 +3475,10 @@ public abstract class ViewGroup extends View implements ViewParent, ViewManager } if (!isLaidOut()) { if (Helper.sVerbose) { Log.v(VIEW_LOG_TAG, "dispatchProvideStructure(): not laid out, ignoring " + childrenCount + " children of " + getAccessibilityViewId()); } return; } Loading
services/autofill/java/com/android/server/autofill/AutofillManagerService.java +7 −3 Original line number Diff line number Diff line Loading @@ -119,6 +119,7 @@ public final class AutofillManagerService extends SystemService { private final LocalLog mRequestsHistory = new LocalLog(20); private final LocalLog mUiLatencyHistory = new LocalLog(20); private final LocalLog mWtfHistory = new LocalLog(50); private final BroadcastReceiver mBroadcastReceiver = new BroadcastReceiver() { @Override Loading Loading @@ -310,7 +311,8 @@ public final class AutofillManagerService extends SystemService { AutofillManagerServiceImpl service = mServicesCache.get(resolvedUserId); if (service == null) { service = new AutofillManagerServiceImpl(mContext, mLock, mRequestsHistory, mUiLatencyHistory, resolvedUserId, mUi, mDisabledUsers.get(resolvedUserId)); mUiLatencyHistory, mWtfHistory, resolvedUserId, mUi, mDisabledUsers.get(resolvedUserId)); mServicesCache.put(userId, service); } return service; Loading Loading @@ -878,10 +880,12 @@ public final class AutofillManagerService extends SystemService { mUi.dump(pw); } if (showHistory) { pw.println("Requests history:"); pw.println(); pw.println("Requests history:"); pw.println(); mRequestsHistory.reverseDump(fd, pw, args); pw.println("UI latency history:"); pw.println(); pw.println("UI latency history:"); pw.println(); mUiLatencyHistory.reverseDump(fd, pw, args); pw.println(); pw.println("WTF history:"); pw.println(); mWtfHistory.reverseDump(fd, pw, args); } } finally { setDebugLocked(oldDebug); Loading
services/autofill/java/com/android/server/autofill/AutofillManagerServiceImpl.java +6 −4 Original line number Diff line number Diff line Loading @@ -43,7 +43,6 @@ import android.os.Binder; import android.os.Bundle; import android.os.IBinder; import android.os.Looper; import android.os.RemoteCallback; import android.os.RemoteCallbackList; import android.os.RemoteException; import android.os.SystemClock; Loading Loading @@ -116,6 +115,7 @@ final class AutofillManagerServiceImpl { private final LocalLog mRequestsHistory; private final LocalLog mUiLatencyHistory; private final LocalLog mWtfHistory; private final FieldClassificationStrategy mFieldClassificationStrategy; /** Loading Loading @@ -179,11 +179,13 @@ final class AutofillManagerServiceImpl { private long mLastPrune = 0; AutofillManagerServiceImpl(Context context, Object lock, LocalLog requestsHistory, LocalLog uiLatencyHistory, int userId, AutoFillUI ui, boolean disabled) { LocalLog uiLatencyHistory, LocalLog wtfHistory, int userId, AutoFillUI ui, boolean disabled) { mContext = context; mLock = lock; mRequestsHistory = requestsHistory; mUiLatencyHistory = uiLatencyHistory; mWtfHistory = wtfHistory; mUserId = userId; mUi = ui; mFieldClassificationStrategy = new FieldClassificationStrategy(context, userId); Loading Loading @@ -484,8 +486,8 @@ final class AutofillManagerServiceImpl { assertCallerLocked(componentName); final Session newSession = new Session(this, mUi, mContext, mHandlerCaller, mUserId, mLock, sessionId, uid, activityToken, appCallbackToken, hasCallback, mUiLatencyHistory, mInfo.getServiceInfo().getComponentName(), componentName, flags); sessionId, uid, activityToken, appCallbackToken, hasCallback, mUiLatencyHistory, mWtfHistory, mInfo.getServiceInfo().getComponentName(), componentName, flags); mSessions.put(newSession.id, newSession); return newSession; Loading
services/autofill/java/com/android/server/autofill/Session.java +28 −8 Original line number Diff line number Diff line Loading @@ -210,6 +210,9 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState @GuardedBy("mLock") private final LocalLog mUiLatencyHistory; @GuardedBy("mLock") private final LocalLog mWtfHistory; /** * Receiver of assist data from the app's {@link Activity}. */ Loading Loading @@ -241,7 +244,13 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState // ONE_WAY warning because system_service could block on app calls. We need to // change AssistStructure so it provides a "one-way" writeToParcel() method that // sends all the data try { structure.ensureData(); } catch (RuntimeException e) { wtf(e, "Exception lazy loading assist structure for %s: %s", structure.getActivityComponent(), e); return; } // Sanitize structure before it's sent to service. final ComponentName componentNameFromApp = structure.getActivityComponent(); Loading Loading @@ -447,6 +456,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState @NonNull Context context, @NonNull HandlerCaller handlerCaller, int userId, @NonNull Object lock, int sessionId, int uid, @NonNull IBinder activityToken, @NonNull IBinder client, boolean hasCallback, @NonNull LocalLog uiLatencyHistory, @NonNull LocalLog wtfHistory, @NonNull ComponentName serviceComponentName, @NonNull ComponentName componentName, int flags) { id = sessionId; Loading @@ -461,6 +471,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState mActivityToken = activityToken; mHasCallback = hasCallback; mUiLatencyHistory = uiLatencyHistory; mWtfHistory = wtfHistory; mComponentName = componentName; mClient = IAutoFillManagerClient.Stub.asInterface(client); Loading Loading @@ -1102,8 +1113,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState if (userData != null && fcStrategy != null) { logFieldClassificationScoreLocked(fcStrategy, ignoredDatasets, changedFieldIds, changedDatasetIds, manuallyFilledFieldIds, manuallyFilledDatasetIds, manuallyFilledIds, userData, mViewStates.values()); userData, mViewStates.values()); } else { mService.logContextCommittedLocked(id, mClientState, mSelectedDatasetIds, ignoredDatasets, changedFieldIds, changedDatasetIds, Loading @@ -1123,7 +1133,6 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState @NonNull ArrayList<String> changedDatasetIds, @NonNull ArrayList<AutofillId> manuallyFilledFieldIds, @NonNull ArrayList<ArrayList<String>> manuallyFilledDatasetIds, @NonNull ArrayMap<AutofillId, ArraySet<String>> manuallyFilledIds, @NonNull UserData userData, @NonNull Collection<ViewState> viewStates) { final String[] userValues = userData.getValues(); Loading Loading @@ -1201,8 +1210,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState } } } catch (ArrayIndexOutOfBoundsException e) { Slog.wtf(TAG, "Error accessing FC score at " + i + " x " + j + ": " + Arrays.toString(scores.scores), e); wtf(e, "Error accessing FC score at [%d, %d] (%s): %s", i, j, scores, e); return; } Loading Loading @@ -2151,9 +2159,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState final Intent fillInIntent = new Intent(); final FillContext context = getFillContextByRequestIdLocked(requestId); if (context == null) { Slog.wtf(TAG, "createAuthFillInIntentLocked(): no FillContext. requestId=" + requestId + "; mContexts= " + mContexts); wtf(null, "createAuthFillInIntentLocked(): no FillContext. requestId=%d; mContexts=%s", requestId, mContexts); return null; } fillInIntent.putExtra(AutofillManager.EXTRA_ASSIST_STRUCTURE, context.getStructure()); Loading Loading @@ -2418,4 +2427,15 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState private void writeLog(int category) { mMetricsLogger.write(newLogMaker(category)); } private void wtf(@Nullable Exception e, String fmt, Object...args) { final String message = String.format(fmt, args); mWtfHistory.log(message); if (e != null) { Slog.wtf(TAG, message, e); } else { Slog.wtf(TAG, message); } } }