From 4a7a6256fc927aaab5b97dfa561100688ac066b9 Mon Sep 17 00:00:00 2001 From: Felipe Leme Date: Thu, 31 Jan 2019 17:46:48 -0800 Subject: [PATCH] Removed the Augmented Autofill blacklist APIs. We'll initially implement just the whitelist ones... Bug: 123233342 Test: m update-api Test: atest CtsAutoFillServiceTestCases:android.autofillservice.cts.augmented.AugmentedLoginActivityTest Change-Id: If24519ec7bf136cf288c86e6d0621f35f4c92d09 --- api/system-current.txt | 4 -- api/test-current.txt | 4 -- .../view/autofill/AutofillManager.java | 72 ------------------- 3 files changed, 80 deletions(-) diff --git a/api/system-current.txt b/api/system-current.txt index 43d055b1199b4..1535b4d386aeb 100644 --- a/api/system-current.txt +++ b/api/system-current.txt @@ -9220,11 +9220,7 @@ package android.view.accessibility { package android.view.autofill { public final class AutofillManager { - method @NonNull public java.util.Set getAugmentedAutofillDisabledActivities(); - method @NonNull public java.util.Set getAugmentedAutofillDisabledPackages(); - method public void setActivityAugmentedAutofillEnabled(@NonNull android.content.ComponentName, boolean); method public void setAugmentedAutofillWhitelist(@Nullable java.util.List, @Nullable java.util.List); - method public void setPackageAugmentedAutofillEnabled(@NonNull String, boolean); } } diff --git a/api/test-current.txt b/api/test-current.txt index 9023a859a2869..2949c9cc8ecfc 100644 --- a/api/test-current.txt +++ b/api/test-current.txt @@ -2592,11 +2592,7 @@ package android.view.autofill { } public final class AutofillManager { - method @NonNull public java.util.Set getAugmentedAutofillDisabledActivities(); - method @NonNull public java.util.Set getAugmentedAutofillDisabledPackages(); - method public void setActivityAugmentedAutofillEnabled(@NonNull android.content.ComponentName, boolean); method public void setAugmentedAutofillWhitelist(@Nullable java.util.List, @Nullable java.util.List); - method public void setPackageAugmentedAutofillEnabled(@NonNull String, boolean); field public static final int FLAG_SMART_SUGGESTION_SYSTEM = 1; // 0x1 field public static final int MAX_TEMP_AUGMENTED_SERVICE_DURATION_MS = 120000; // 0x1d4c0 } diff --git a/core/java/android/view/autofill/AutofillManager.java b/core/java/android/view/autofill/AutofillManager.java index 64c34f612048f..1c96b87394b6b 100644 --- a/core/java/android/view/autofill/AutofillManager.java +++ b/core/java/android/view/autofill/AutofillManager.java @@ -79,7 +79,6 @@ import java.util.Arrays; import java.util.Collections; import java.util.List; import java.util.Objects; -import java.util.Set; //TODO: use java.lang.ref.Cleaner once Android supports Java 9 import sun.misc.Cleaner; @@ -1768,45 +1767,6 @@ public final class AutofillManager { } } - /** - * Defines whether augmented autofill should be triggered for activities with such - * {@link android.content.ComponentName}. - * - *

Useful to blacklist a particular activity. - * - *

Note: This method should only be called by the app providing the augmented autofill - * service, and it's ignored if the caller isn't it. - * - * @hide - */ - @SystemApi - @TestApi - //TODO(b/122654591): @TestApi is needed because CtsAutoFillServiceTestCases hosts the service - //in the same package as the test, and that module is compiled with SDK=test_current - public void setActivityAugmentedAutofillEnabled(@NonNull ComponentName activity, - boolean enabled) { - // TODO(b/123100824): implement - } - - /** - * Defines whether augmented autofill should be triggered for activities of the app with such - * {@code packageName}. - * - *

Useful to blacklist any activity from a particular app. - * - *

Note: This method should only be called by the app providing the augmented autofill - * service, and it's ignored if the caller isn't it. - * - * @hide - */ - @SystemApi - @TestApi - //TODO(b/122654591): @TestApi is needed because CtsAutoFillServiceTestCases hosts the service - //in the same package as the test, and that module is compiled with SDK=test_current - public void setPackageAugmentedAutofillEnabled(@NonNull String packageName, boolean enabled) { - // TODO(b/123100824): implement - } - /** * Explicitly limits augmented autofill to the given packages and activities. * @@ -1838,38 +1798,6 @@ public final class AutofillManager { // TODO(b/123100824): implement } - /** - * Gets the activities where augmented autofill was disabled by - * {@link #setActivityAugmentedAutofillEnabled(ComponentName, boolean)}. - * - *

Note: This method should only be called by the app providing the augmented autofill - * service, and it's ignored if the caller isn't it. - * - * @hide - */ - @SystemApi - @TestApi - @NonNull - public Set getAugmentedAutofillDisabledActivities() { - return null; // TODO(b/123100824): implement - } - - /** - * Gets the apps where content capture was disabled by - * {@link #setPackageAugmentedAutofillEnabled(String, boolean)}. - * - *

Note: This method should only be called by the app providing the augmented autofill - * service, and it's ignored if the caller isn't it. - * - * @hide - */ - @SystemApi - @TestApi - @NonNull - public Set getAugmentedAutofillDisabledPackages() { - return null; // TODO(b/123100824): implement - } - private void requestShowFillUi(int sessionId, AutofillId id, int width, int height, Rect anchorBounds, IAutofillWindowPresenter presenter) { final View anchor = findView(id);