summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
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
commit1a9862c9da87f4e160929ebc77e086bea74a0023 (patch)
treec864e696fa6a04787757d82a7ff321b546fa159a
parent282e869f426ab3097c292961f2c2f4fb3ed8eb38 (diff)
parent3186bcdedac9432909b8821dfed23c3db12a1866 (diff)
Merge "Removed the Content Capture blacklist APIs."
-rw-r--r--api/system-current.txt4
-rw-r--r--core/java/android/service/contentcapture/ContentCaptureService.java76
-rw-r--r--core/java/android/service/contentcapture/IContentCaptureServiceCallback.aidl4
-rw-r--r--services/contentcapture/java/com/android/server/contentcapture/ContentCapturePerUserService.java31
4 files changed, 0 insertions, 115 deletions
diff --git a/api/system-current.txt b/api/system-current.txt
index 0d8b729354b9..7bc2c817dffa 100644
--- a/api/system-current.txt
+++ b/api/system-current.txt
@@ -6305,8 +6305,6 @@ package android.service.contentcapture {
public abstract class ContentCaptureService extends android.app.Service {
ctor public ContentCaptureService();
- method @NonNull public final java.util.Set<android.content.ComponentName> getContentCaptureDisabledActivities();
- method @NonNull public final java.util.Set<java.lang.String> getContentCaptureDisabledPackages();
method public void onActivitySnapshot(@NonNull android.view.contentcapture.ContentCaptureSessionId, @NonNull android.service.contentcapture.SnapshotData);
method public void onConnected();
method public void onContentCaptureEvent(@NonNull android.view.contentcapture.ContentCaptureSessionId, @NonNull android.view.contentcapture.ContentCaptureEvent);
@@ -6315,9 +6313,7 @@ package android.service.contentcapture {
method public void onDestroyContentCaptureSession(@NonNull android.view.contentcapture.ContentCaptureSessionId);
method public void onDisconnected();
method public void onUserDataRemovalRequest(@NonNull android.view.contentcapture.UserDataRemovalRequest);
- method public final void setActivityContentCaptureEnabled(@NonNull android.content.ComponentName, boolean);
method public final void setContentCaptureWhitelist(@Nullable java.util.List<java.lang.String>, @Nullable java.util.List<android.content.ComponentName>);
- method public final void setPackageContentCaptureEnabled(@NonNull String, boolean);
field public static final String SERVICE_INTERFACE = "android.service.contentcapture.ContentCaptureService";
}
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);
}
diff --git a/services/contentcapture/java/com/android/server/contentcapture/ContentCapturePerUserService.java b/services/contentcapture/java/com/android/server/contentcapture/ContentCapturePerUserService.java
index c8a27f165a99..7102b82d5e18 100644
--- a/services/contentcapture/java/com/android/server/contentcapture/ContentCapturePerUserService.java
+++ b/services/contentcapture/java/com/android/server/contentcapture/ContentCapturePerUserService.java
@@ -416,36 +416,5 @@ final class ContentCapturePerUserService
// TODO(b/122595322): implement
// TODO(b/119613670): log metrics
}
-
- @Override
- public void setActivityContentCaptureEnabled(ComponentName activity, boolean enabled) {
- if (mMaster.verbose) {
- Log.v(TAG, "setActivityContentCaptureEnabled(activity=" + activity + ", enabled="
- + enabled + ")");
- }
- // TODO(b/122595322): implement
- // TODO(b/119613670): log metrics
- }
-
- @Override
- public void setPackageContentCaptureEnabled(String packageName, boolean enabled) {
- if (mMaster.verbose) {
- Log.v(TAG,
- "setPackageContentCaptureEnabled(packageName=" + packageName + ", enabled="
- + enabled + ")");
- }
- // TODO(b/122595322): implement
- // TODO(b/119613670): log metrics
- }
-
- @Override
- public void getContentCaptureDisabledActivities(IResultReceiver receiver) {
- // TODO(b/122595322): implement
- }
-
- @Override
- public void getContentCaptureDisabledPackages(IResultReceiver receiver) {
- // TODO(b/122595322): implement
- }
}
}