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

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

Merge "Fixed autofill dumpsys and improved logging." into oc-dev

am: 08d8e034

Change-Id: I303ec6c9d1bef5d88b33c35e62c598ad6082c6ad
parents 65b4bb8c 08d8e034
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -144,6 +144,9 @@ public final class AutofillManagerService extends SystemService {
            final int userId = users.get(i).id;
            final boolean disabled = umi.getUserRestriction(userId, UserManager.DISALLOW_AUTOFILL);
            if (disabled) {
                if (disabled) {
                    Slog.i(TAG, "Disabling Autofill for user " + userId);
                }
                mDisabledUsers.put(userId, disabled);
            }
        }
@@ -155,11 +158,12 @@ public final class AutofillManagerService extends SystemService {
                if (disabledBefore == disabledNow) {
                    // Nothing changed, do nothing.
                    if (sDebug) {
                        Slog.d(TAG, "Restriction not changed for user " + userId + ": "
                        Slog.d(TAG, "Autofill restriction did not change for user " + userId + ": "
                                + bundleToString(newRestrictions));
                        return;
                    }
                }
                Slog.i(TAG, "Updating Autofill for user " + userId + ": disabled=" + disabledNow);
                mDisabledUsers.put(userId, disabledNow);
                updateCachedServiceLocked(userId, disabledNow);
            }
@@ -606,7 +610,7 @@ public final class AutofillManagerService extends SystemService {
                            pw.println("Usage: dumpsys autofill [--ui-only|--no-history]");
                            return;
                        default:
                            throw new IllegalArgumentException("Invalid dump arg: " + arg);
                            Slog.w(TAG, "Ignoring invalid dump arg: " + arg);
                    }
                }
            }
+11 −3
Original line number Diff line number Diff line
@@ -384,6 +384,7 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
            }
        }
        if (response == null) {
            if (sVerbose) Slog.v(TAG, "canceling session " + id + " when server returned null");
            if ((requestFlags & FLAG_MANUAL_REQUEST) != 0) {
                getUiForShowing().showError(R.string.autofill_error_cannot_autofill, this);
            }
@@ -906,7 +907,10 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState

        // If it's not, then check if it it should start a partition.
        if (shouldStartNewPartitionLocked(id)) {
            if (sDebug) Slog.d(TAG, "Starting partition for view id " + id);
            if (sDebug) {
                Slog.d(TAG, "Starting partition for view id " + id + ": "
                        + viewState.getStateAsString());
            }
            viewState.setState(ViewState.STATE_STARTED_PARTITION);
            requestNewFillResponseLocked(flags);
        }
@@ -1344,15 +1348,19 @@ final class Session implements RemoteFillService.FillServiceCallbacks, ViewState
    }

    void dumpLocked(String prefix, PrintWriter pw) {
        final String prefix2 = prefix + "  ";
        pw.print(prefix); pw.print("id: "); pw.println(id);
        pw.print(prefix); pw.print("uid: "); pw.println(uid);
        pw.print(prefix); pw.print("mActivityToken: "); pw.println(mActivityToken);
        pw.print(prefix); pw.print("mResponses: "); pw.println(mResponses);
        pw.print(prefix); pw.print("mResponses: "); pw.println(mResponses.size());
        for (int i = 0; i < mResponses.size(); i++) {
            pw.print(prefix2); pw.print('#'); pw.print(i); pw.print(' ');
                pw.println(mResponses.valueAt(i));
        }
        pw.print(prefix); pw.print("mCurrentViewId: "); pw.println(mCurrentViewId);
        pw.print(prefix); pw.print("mViewStates size: "); pw.println(mViewStates.size());
        pw.print(prefix); pw.print("mDestroyed: "); pw.println(mDestroyed);
        pw.print(prefix); pw.print("mIsSaving: "); pw.println(mIsSaving);
        final String prefix2 = prefix + "  ";
        for (Map.Entry<AutofillId, ViewState> entry : mViewStates.entrySet()) {
            pw.print(prefix); pw.print("State for id "); pw.println(entry.getKey());
            entry.getValue().dump(prefix2, pw);