Loading api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -6369,6 +6369,7 @@ package android.service.contentcapture { public abstract class ContentCaptureService extends android.app.Service { ctor public ContentCaptureService(); method public final void disableContentCaptureServices(); 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); Loading Loading @@ -9386,7 +9387,6 @@ package android.view.contentcapture { public final class ContentCaptureManager { method public boolean isContentCaptureFeatureEnabled(); method public void setContentCaptureFeatureEnabled(boolean); } public final class ViewNode extends android.app.assist.AssistStructure.ViewNode { api/test-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -2116,6 +2116,7 @@ package android.service.contentcapture { public abstract class ContentCaptureService extends android.app.Service { ctor public ContentCaptureService(); method public final void disableContentCaptureServices(); 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); Loading Loading @@ -2760,7 +2761,6 @@ package android.view.contentcapture { public final class ContentCaptureManager { method public boolean isContentCaptureFeatureEnabled(); method public void setContentCaptureFeatureEnabled(boolean); field public static final String DEVICE_CONFIG_PROPERTY_IDLE_FLUSH_FREQUENCY = "idle_flush_frequency"; field public static final String DEVICE_CONFIG_PROPERTY_LOGGING_LEVEL = "logging_level"; field public static final String DEVICE_CONFIG_PROPERTY_LOG_HISTORY_SIZE = "log_history_size"; Loading core/java/android/service/contentcapture/ContentCaptureService.java +18 −0 Original line number Diff line number Diff line Loading @@ -283,6 +283,24 @@ public abstract class ContentCaptureService extends Service { if (VERBOSE) Log.v(TAG, "onDestroyContentCaptureSession(id=" + sessionId + ")"); } /** * Disables the Content Capture service for the given user. */ public final void disableContentCaptureServices() { if (DEBUG) Log.d(TAG, "disableContentCaptureServices()"); final IContentCaptureServiceCallback callback = mCallback; if (callback == null) { Log.w(TAG, "disableContentCaptureServices(): no server callback"); return; } try { callback.disableSelf(); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } /** * Called when the Android system disconnects from the service. * Loading core/java/android/service/contentcapture/IContentCaptureServiceCallback.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package android.service.contentcapture; import android.content.ComponentName; import com.android.internal.os.IResultReceiver; import java.util.List; Loading @@ -28,4 +27,5 @@ import java.util.List; */ oneway interface IContentCaptureServiceCallback { void setContentCaptureWhitelist(in List<String> packages, in List<ComponentName> activities); void disableSelf(); } core/java/android/view/contentcapture/ContentCaptureManager.java +2 −33 Original line number Diff line number Diff line Loading @@ -327,39 +327,8 @@ public final class ContentCaptureManager { case RESULT_CODE_NOT_SERVICE: throw new SecurityException("caller is not user's ContentCapture service"); default: throw new IllegalStateException("received invalid result: " + resultCode); } } /** * Sets whether Content Capture is enabled for the given user. * * @throws SecurityException if caller is not the app that owns the Content Capture service * associated with the user. * * @hide */ @SystemApi @TestApi public void setContentCaptureFeatureEnabled(boolean enabled) { if (sDebug) Log.d(TAG, "setContentCaptureFeatureEnabled(): setting to " + enabled); final SyncResultReceiver resultReceiver = new SyncResultReceiver(SYNC_CALLS_TIMEOUT_MS); final int resultCode; try { mService.setContentCaptureFeatureEnabled(enabled, resultReceiver); resultCode = resultReceiver.getIntResult(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } switch (resultCode) { case RESULT_CODE_TRUE: // Our work is done here, in our void existance... return; case RESULT_CODE_NOT_SERVICE: throw new SecurityException("caller is not user's ContentCapture service"); default: throw new IllegalStateException("received invalid result: " + resultCode); Log.wtf(TAG, "received invalid result: " + resultCode); return false; } } Loading Loading
api/system-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -6369,6 +6369,7 @@ package android.service.contentcapture { public abstract class ContentCaptureService extends android.app.Service { ctor public ContentCaptureService(); method public final void disableContentCaptureServices(); 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); Loading Loading @@ -9386,7 +9387,6 @@ package android.view.contentcapture { public final class ContentCaptureManager { method public boolean isContentCaptureFeatureEnabled(); method public void setContentCaptureFeatureEnabled(boolean); } public final class ViewNode extends android.app.assist.AssistStructure.ViewNode {
api/test-current.txt +1 −1 Original line number Diff line number Diff line Loading @@ -2116,6 +2116,7 @@ package android.service.contentcapture { public abstract class ContentCaptureService extends android.app.Service { ctor public ContentCaptureService(); method public final void disableContentCaptureServices(); 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); Loading Loading @@ -2760,7 +2761,6 @@ package android.view.contentcapture { public final class ContentCaptureManager { method public boolean isContentCaptureFeatureEnabled(); method public void setContentCaptureFeatureEnabled(boolean); field public static final String DEVICE_CONFIG_PROPERTY_IDLE_FLUSH_FREQUENCY = "idle_flush_frequency"; field public static final String DEVICE_CONFIG_PROPERTY_LOGGING_LEVEL = "logging_level"; field public static final String DEVICE_CONFIG_PROPERTY_LOG_HISTORY_SIZE = "log_history_size"; Loading
core/java/android/service/contentcapture/ContentCaptureService.java +18 −0 Original line number Diff line number Diff line Loading @@ -283,6 +283,24 @@ public abstract class ContentCaptureService extends Service { if (VERBOSE) Log.v(TAG, "onDestroyContentCaptureSession(id=" + sessionId + ")"); } /** * Disables the Content Capture service for the given user. */ public final void disableContentCaptureServices() { if (DEBUG) Log.d(TAG, "disableContentCaptureServices()"); final IContentCaptureServiceCallback callback = mCallback; if (callback == null) { Log.w(TAG, "disableContentCaptureServices(): no server callback"); return; } try { callback.disableSelf(); } catch (RemoteException e) { e.rethrowFromSystemServer(); } } /** * Called when the Android system disconnects from the service. * Loading
core/java/android/service/contentcapture/IContentCaptureServiceCallback.aidl +2 −2 Original line number Diff line number Diff line Loading @@ -17,7 +17,6 @@ package android.service.contentcapture; import android.content.ComponentName; import com.android.internal.os.IResultReceiver; import java.util.List; Loading @@ -28,4 +27,5 @@ import java.util.List; */ oneway interface IContentCaptureServiceCallback { void setContentCaptureWhitelist(in List<String> packages, in List<ComponentName> activities); void disableSelf(); }
core/java/android/view/contentcapture/ContentCaptureManager.java +2 −33 Original line number Diff line number Diff line Loading @@ -327,39 +327,8 @@ public final class ContentCaptureManager { case RESULT_CODE_NOT_SERVICE: throw new SecurityException("caller is not user's ContentCapture service"); default: throw new IllegalStateException("received invalid result: " + resultCode); } } /** * Sets whether Content Capture is enabled for the given user. * * @throws SecurityException if caller is not the app that owns the Content Capture service * associated with the user. * * @hide */ @SystemApi @TestApi public void setContentCaptureFeatureEnabled(boolean enabled) { if (sDebug) Log.d(TAG, "setContentCaptureFeatureEnabled(): setting to " + enabled); final SyncResultReceiver resultReceiver = new SyncResultReceiver(SYNC_CALLS_TIMEOUT_MS); final int resultCode; try { mService.setContentCaptureFeatureEnabled(enabled, resultReceiver); resultCode = resultReceiver.getIntResult(); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } switch (resultCode) { case RESULT_CODE_TRUE: // Our work is done here, in our void existance... return; case RESULT_CODE_NOT_SERVICE: throw new SecurityException("caller is not user's ContentCapture service"); default: throw new IllegalStateException("received invalid result: " + resultCode); Log.wtf(TAG, "received invalid result: " + resultCode); return false; } } Loading