Loading core/api/test-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -2570,6 +2570,9 @@ package android.view.autofill { package android.view.contentcapture { public final class ContentCaptureManager { method @RequiresPermission(android.Manifest.permission.MANAGE_CONTENT_CAPTURE) public static void resetTemporaryService(int); method @RequiresPermission(android.Manifest.permission.MANAGE_CONTENT_CAPTURE) public static void setDefaultServiceEnabled(int, boolean); method @RequiresPermission(android.Manifest.permission.MANAGE_CONTENT_CAPTURE) public static void setTemporaryService(int, @NonNull String, int); 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/view/contentcapture/ContentCaptureManager.java +71 −0 Original line number Diff line number Diff line Loading @@ -23,10 +23,13 @@ import android.annotation.CallbackExecutor; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.TestApi; import android.annotation.UiThread; import android.annotation.UserIdInt; import android.app.Service; import android.content.ComponentName; import android.content.ContentCaptureOptions; import android.content.Context; Loading Loading @@ -755,6 +758,74 @@ public final class ContentCaptureManager { } } /** * Resets the temporary content capture service implementation to the default component. * * @hide */ @TestApi @RequiresPermission(android.Manifest.permission.MANAGE_CONTENT_CAPTURE) public static void resetTemporaryService(@UserIdInt int userId) { final IContentCaptureManager service = getService(); if (service == null) { Log.e(TAG, "IContentCaptureManager is null"); } try { service.resetTemporaryService(userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Temporarily sets the content capture service implementation. * * @param userId user Id to set the temporary service on. * @param serviceName name of the new component * @param duration how long the change will be valid (the service will be automatically reset * to the default component after this timeout expires). * * @hide */ @TestApi @RequiresPermission(android.Manifest.permission.MANAGE_CONTENT_CAPTURE) public static void setTemporaryService( @UserIdInt int userId, @NonNull String serviceName, int duration) { final IContentCaptureManager service = getService(); if (service == null) { Log.e(TAG, "IContentCaptureManager is null"); } try { service.setTemporaryService(userId, serviceName, duration); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Sets whether the default content capture service should be used. * * @hide */ @TestApi @RequiresPermission(android.Manifest.permission.MANAGE_CONTENT_CAPTURE) public static void setDefaultServiceEnabled(@UserIdInt int userId, boolean enabled) { final IContentCaptureManager service = getService(); if (service == null) { Log.e(TAG, "IContentCaptureManager is null"); } try { service.setDefaultServiceEnabled(userId, enabled); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } private static IContentCaptureManager getService() { return IContentCaptureManager.Stub.asInterface(ServiceManager.getService( Service.CONTENT_CAPTURE_MANAGER_SERVICE)); } private interface MyRunnable { void run(@NonNull SyncResultReceiver receiver) throws RemoteException; } Loading core/java/android/view/contentcapture/IContentCaptureManager.aidl +15 −0 Original line number Diff line number Diff line Loading @@ -85,4 +85,19 @@ oneway interface IContentCaptureManager { * Returns a list with the ContentCaptureConditions for the package (or null if not defined). */ void getContentCaptureConditions(String packageName, in IResultReceiver result); /** * Resets the temporary service implementation to the default component. */ void resetTemporaryService(int userId); /** * Temporarily sets the service implementation. */ void setTemporaryService(int userId, in String serviceName, int duration); /** * Sets whether the default service should be used. */ void setDefaultServiceEnabled(int userId, boolean enabled); } services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java +17 −0 Original line number Diff line number Diff line Loading @@ -795,6 +795,23 @@ public final class ContentCaptureManagerService extends new ContentCaptureManagerServiceShellCommand(ContentCaptureManagerService.this).exec( this, in, out, err, args, callback, resultReceiver); } @Override public void resetTemporaryService(@UserIdInt int userId) { ContentCaptureManagerService.this.resetTemporaryService(userId); } @Override public void setTemporaryService( @UserIdInt int userId, @NonNull String serviceName, int duration) { ContentCaptureManagerService.this.setTemporaryService( userId, serviceName, duration); } @Override public void setDefaultServiceEnabled(@UserIdInt int userId, boolean enabled) { ContentCaptureManagerService.this.setDefaultServiceEnabled(userId, enabled); } } private final class LocalService extends ContentCaptureManagerInternal { Loading Loading
core/api/test-current.txt +3 −0 Original line number Diff line number Diff line Loading @@ -2570,6 +2570,9 @@ package android.view.autofill { package android.view.contentcapture { public final class ContentCaptureManager { method @RequiresPermission(android.Manifest.permission.MANAGE_CONTENT_CAPTURE) public static void resetTemporaryService(int); method @RequiresPermission(android.Manifest.permission.MANAGE_CONTENT_CAPTURE) public static void setDefaultServiceEnabled(int, boolean); method @RequiresPermission(android.Manifest.permission.MANAGE_CONTENT_CAPTURE) public static void setTemporaryService(int, @NonNull String, int); 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/view/contentcapture/ContentCaptureManager.java +71 −0 Original line number Diff line number Diff line Loading @@ -23,10 +23,13 @@ import android.annotation.CallbackExecutor; import android.annotation.IntDef; import android.annotation.NonNull; import android.annotation.Nullable; import android.annotation.RequiresPermission; import android.annotation.SystemApi; import android.annotation.SystemService; import android.annotation.TestApi; import android.annotation.UiThread; import android.annotation.UserIdInt; import android.app.Service; import android.content.ComponentName; import android.content.ContentCaptureOptions; import android.content.Context; Loading Loading @@ -755,6 +758,74 @@ public final class ContentCaptureManager { } } /** * Resets the temporary content capture service implementation to the default component. * * @hide */ @TestApi @RequiresPermission(android.Manifest.permission.MANAGE_CONTENT_CAPTURE) public static void resetTemporaryService(@UserIdInt int userId) { final IContentCaptureManager service = getService(); if (service == null) { Log.e(TAG, "IContentCaptureManager is null"); } try { service.resetTemporaryService(userId); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Temporarily sets the content capture service implementation. * * @param userId user Id to set the temporary service on. * @param serviceName name of the new component * @param duration how long the change will be valid (the service will be automatically reset * to the default component after this timeout expires). * * @hide */ @TestApi @RequiresPermission(android.Manifest.permission.MANAGE_CONTENT_CAPTURE) public static void setTemporaryService( @UserIdInt int userId, @NonNull String serviceName, int duration) { final IContentCaptureManager service = getService(); if (service == null) { Log.e(TAG, "IContentCaptureManager is null"); } try { service.setTemporaryService(userId, serviceName, duration); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } /** * Sets whether the default content capture service should be used. * * @hide */ @TestApi @RequiresPermission(android.Manifest.permission.MANAGE_CONTENT_CAPTURE) public static void setDefaultServiceEnabled(@UserIdInt int userId, boolean enabled) { final IContentCaptureManager service = getService(); if (service == null) { Log.e(TAG, "IContentCaptureManager is null"); } try { service.setDefaultServiceEnabled(userId, enabled); } catch (RemoteException e) { throw e.rethrowFromSystemServer(); } } private static IContentCaptureManager getService() { return IContentCaptureManager.Stub.asInterface(ServiceManager.getService( Service.CONTENT_CAPTURE_MANAGER_SERVICE)); } private interface MyRunnable { void run(@NonNull SyncResultReceiver receiver) throws RemoteException; } Loading
core/java/android/view/contentcapture/IContentCaptureManager.aidl +15 −0 Original line number Diff line number Diff line Loading @@ -85,4 +85,19 @@ oneway interface IContentCaptureManager { * Returns a list with the ContentCaptureConditions for the package (or null if not defined). */ void getContentCaptureConditions(String packageName, in IResultReceiver result); /** * Resets the temporary service implementation to the default component. */ void resetTemporaryService(int userId); /** * Temporarily sets the service implementation. */ void setTemporaryService(int userId, in String serviceName, int duration); /** * Sets whether the default service should be used. */ void setDefaultServiceEnabled(int userId, boolean enabled); }
services/contentcapture/java/com/android/server/contentcapture/ContentCaptureManagerService.java +17 −0 Original line number Diff line number Diff line Loading @@ -795,6 +795,23 @@ public final class ContentCaptureManagerService extends new ContentCaptureManagerServiceShellCommand(ContentCaptureManagerService.this).exec( this, in, out, err, args, callback, resultReceiver); } @Override public void resetTemporaryService(@UserIdInt int userId) { ContentCaptureManagerService.this.resetTemporaryService(userId); } @Override public void setTemporaryService( @UserIdInt int userId, @NonNull String serviceName, int duration) { ContentCaptureManagerService.this.setTemporaryService( userId, serviceName, duration); } @Override public void setDefaultServiceEnabled(@UserIdInt int userId, boolean enabled) { ContentCaptureManagerService.this.setDefaultServiceEnabled(userId, enabled); } } private final class LocalService extends ContentCaptureManagerInternal { Loading