Who wants...to live...forever? The "Save for Autofill?" dialog does!

Fixes: 37083017
Test: manual verification
Test: CtsAutoFillServiceTestCases pass

Change-Id: Id177fb59810956e4b43c1d357de415d64ab9d89a
This commit is contained in:
Felipe Leme
2017-04-06 18:03:39 -07:00
parent a441da153e
commit db5f6c00a4
4 changed files with 2 additions and 33 deletions

View File

@@ -283,13 +283,6 @@ public final class AutofillManagerService extends SystemService {
}
}
// Called by Shell command.
public void setSaveTimeout(int timeout) {
Slog.i(TAG, "setSaveTimeout(" + timeout + ")");
mContext.enforceCallingPermission(MANAGE_AUTO_FILL, TAG);
mUi.setSaveTimeout(timeout);
}
/**
* Removes a cached service for a given user.
*/

View File

@@ -47,8 +47,6 @@ public final class AutofillManagerServiceShellCommand extends ShellCommand {
switch (cmd) {
case "save":
return requestSave();
case "set":
return requestSet();
case "list":
return requestList(pw);
case "destroy":
@@ -76,9 +74,6 @@ public final class AutofillManagerServiceShellCommand extends ShellCommand {
pw.println(" save [--user USER_ID]");
pw.println(" Request provider to save contents of the top activity.");
pw.println("");
pw.println(" set save_timeout MS");
pw.println(" Sets how long (in ms) the save snack bar is shown.");
pw.println("");
pw.println(" reset");
pw.println(" Reset all pending sessions and cached service connections.");
pw.println("");
@@ -91,18 +86,6 @@ public final class AutofillManagerServiceShellCommand extends ShellCommand {
return 0;
}
private int requestSet() {
final String type = getNextArgRequired();
switch (type) {
case "save_timeout":
mService.setSaveTimeout(Integer.parseInt(getNextArgRequired()));
break;
default:
throw new IllegalArgumentException("Invalid 'set' type: " + type);
}
return 0;
}
private int requestDestroy(PrintWriter pw) {
if (!isNextArgSessions(pw)) {
return -1;

View File

@@ -255,7 +255,7 @@ public final class AutoFillUI {
}
mMetricsLogger.write(log);
}
}, mSaveTimeoutMs);
});
});
}

View File

@@ -98,7 +98,7 @@ final class SaveUi {
private boolean mDestroyed;
SaveUi(@NonNull Context context, @NonNull CharSequence providerLabel, @NonNull SaveInfo info,
@NonNull OnSaveListener listener, int lifeTimeMs) {
@NonNull OnSaveListener listener) {
mListener = new OneTimeListener(listener);
final LayoutInflater inflater = LayoutInflater.from(context);
@@ -169,13 +169,6 @@ final class SaveUi {
window.getAttributes().width = WindowManager.LayoutParams.MATCH_PARENT;
mDialog.show();
mHandler.postDelayed(() -> {
if (!mListener.mDone) {
mListener.onCancel(null);
Slog.d(TAG, "Save snackbar timed out after " + lifeTimeMs + "ms");
}
}, lifeTimeMs);
}
void destroy() {