diff options
| author | TreeHugger Robot <treehugger-gerrit@google.com> | 2019-02-04 23:04:48 +0000 |
|---|---|---|
| committer | Android (Google) Code Review <android-gerrit@google.com> | 2019-02-04 23:04:48 +0000 |
| commit | 1a9862c9da87f4e160929ebc77e086bea74a0023 (patch) | |
| tree | c864e696fa6a04787757d82a7ff321b546fa159a /core/java | |
| parent | 282e869f426ab3097c292961f2c2f4fb3ed8eb38 (diff) | |
| parent | 3186bcdedac9432909b8821dfed23c3db12a1866 (diff) | |
Merge "Removed the Content Capture blacklist APIs."
Diffstat (limited to 'core/java')
| -rw-r--r-- | core/java/android/service/contentcapture/ContentCaptureService.java | 76 | ||||
| -rw-r--r-- | core/java/android/service/contentcapture/IContentCaptureServiceCallback.aidl | 4 |
2 files changed, 0 insertions, 80 deletions
diff --git a/core/java/android/service/contentcapture/ContentCaptureService.java b/core/java/android/service/contentcapture/ContentCaptureService.java index 020de7f24048..cc2e59a073ca 100644 --- a/core/java/android/service/contentcapture/ContentCaptureService.java +++ b/core/java/android/service/contentcapture/ContentCaptureService.java @@ -48,9 +48,7 @@ import com.android.internal.os.IResultReceiver; import java.io.FileDescriptor; import java.io.PrintWriter; -import java.util.Collections; import java.util.List; -import java.util.Set; /** * A service used to capture the content of the screen to provide contextual data in other areas of @@ -166,10 +164,6 @@ public abstract class ContentCaptureService extends Service { /** * Explicitly limits content capture to the given packages and activities. * - * <p>When the whitelist is set, it overrides the values passed to - * {@link #setActivityContentCaptureEnabled(ComponentName, boolean)} - * and {@link #setPackageContentCaptureEnabled(String, boolean)}. - * * <p>To reset the whitelist, call it passing {@code null} to both arguments. * * <p>Useful when the service wants to restrict content capture to a category of apps, like @@ -194,76 +188,6 @@ public abstract class ContentCaptureService extends Service { } /** - * Defines whether content capture should be enabled for activities with such - * {@link android.content.ComponentName}. - * - * <p>Useful to blacklist a particular activity. - */ - public final void setActivityContentCaptureEnabled(@NonNull ComponentName activity, - boolean enabled) { - final IContentCaptureServiceCallback callback = mCallback; - if (callback == null) { - Log.w(TAG, "setActivityContentCaptureEnabled(): no server callback"); - return; - } - try { - callback.setActivityContentCaptureEnabled(activity, enabled); - } catch (RemoteException e) { - e.rethrowFromSystemServer(); - } - } - - /** - * Defines whether content capture should be enabled for activities of the app with such - * {@code packageName}. - * - * <p>Useful to blacklist any activity from a particular app. - */ - public final void setPackageContentCaptureEnabled(@NonNull String packageName, - boolean enabled) { - final IContentCaptureServiceCallback callback = mCallback; - if (callback == null) { - Log.w(TAG, "setPackageContentCaptureEnabled(): no server callback"); - return; - } - try { - callback.setPackageContentCaptureEnabled(packageName, enabled); - } catch (RemoteException e) { - e.rethrowFromSystemServer(); - } - } - - /** - * Gets the activities where content capture was disabled by - * {@link #setActivityContentCaptureEnabled(ComponentName, boolean)}. - */ - @NonNull - public final Set<ComponentName> getContentCaptureDisabledActivities() { - final IContentCaptureServiceCallback callback = mCallback; - if (callback == null) { - Log.w(TAG, "getContentCaptureDisabledActivities(): no server callback"); - return Collections.emptySet(); - } - //TODO(b/122595322): implement (using SyncResultReceiver) - return null; - } - - /** - * Gets the apps where content capture was disabled by - * {@link #setPackageContentCaptureEnabled(String, boolean)}. - */ - @NonNull - public final Set<String> getContentCaptureDisabledPackages() { - final IContentCaptureServiceCallback callback = mCallback; - if (callback == null) { - Log.w(TAG, "getContentCaptureDisabledPackages(): no server callback"); - return Collections.emptySet(); - } - //TODO(b/122595322): implement (using SyncResultReceiver) - return null; - } - - /** * Called when the Android system connects to service. * * <p>You should generally do initialization here rather than in {@link #onCreate}. diff --git a/core/java/android/service/contentcapture/IContentCaptureServiceCallback.aidl b/core/java/android/service/contentcapture/IContentCaptureServiceCallback.aidl index e84bd6fdf2b6..2a729b6dc874 100644 --- a/core/java/android/service/contentcapture/IContentCaptureServiceCallback.aidl +++ b/core/java/android/service/contentcapture/IContentCaptureServiceCallback.aidl @@ -28,8 +28,4 @@ import java.util.List; */ oneway interface IContentCaptureServiceCallback { void setContentCaptureWhitelist(in List<String> packages, in List<ComponentName> activities); - void setActivityContentCaptureEnabled(in ComponentName activity, boolean enabled); - void setPackageContentCaptureEnabled(in String packageName, boolean enabled); - void getContentCaptureDisabledActivities(in IResultReceiver receiver); - void getContentCaptureDisabledPackages(in IResultReceiver receiver); } |
