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

This commit is contained in:
TreeHugger Robot
2017-05-11 00:18:32 +00:00
committed by Android (Google) Code Review
2 changed files with 17 additions and 5 deletions

View File

@@ -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);
}
}
}

View File

@@ -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);