Loading api/system-current.txt +8 −4 Original line number Diff line number Diff line Loading @@ -6473,10 +6473,14 @@ package android.service.contentsuggestions { public abstract class ContentSuggestionsService extends android.app.Service { ctor public ContentSuggestionsService(); method public abstract void classifyContentSelections(@NonNull android.app.contentsuggestions.ClassificationsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.ClassificationsCallback); method public abstract void notifyInteraction(@NonNull String, @NonNull android.os.Bundle); method public abstract void processContextImage(int, @Nullable android.graphics.Bitmap, @NonNull android.os.Bundle); method public abstract void suggestContentSelections(@NonNull android.app.contentsuggestions.SelectionsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.SelectionsCallback); method @Deprecated public void classifyContentSelections(@NonNull android.app.contentsuggestions.ClassificationsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.ClassificationsCallback); method @Deprecated public void notifyInteraction(@NonNull String, @NonNull android.os.Bundle); method public void onClassifyContentSelections(@NonNull android.app.contentsuggestions.ClassificationsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.ClassificationsCallback); method public void onNotifyInteraction(@NonNull String, @NonNull android.os.Bundle); method public void onProcessContextImage(int, @Nullable android.graphics.Bitmap, @NonNull android.os.Bundle); method public void onSuggestContentSelections(@NonNull android.app.contentsuggestions.SelectionsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.SelectionsCallback); method @Deprecated public void processContextImage(int, @Nullable android.graphics.Bitmap, @NonNull android.os.Bundle); method @Deprecated public void suggestContentSelections(@NonNull android.app.contentsuggestions.SelectionsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.SelectionsCallback); field public static final String SERVICE_INTERFACE = "android.service.contentsuggestions.ContentSuggestionsService"; } Loading core/java/android/service/contentsuggestions/ContentSuggestionsService.java +70 −16 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ public abstract class ContentSuggestionsService extends Service { } mHandler.sendMessage( obtainMessage(ContentSuggestionsService::processContextImage, obtainMessage(ContentSuggestionsService::onProcessContextImage, ContentSuggestionsService.this, taskId, wrappedBuffer, imageContextRequestExtras)); Loading @@ -81,7 +81,8 @@ public abstract class ContentSuggestionsService extends Service { @Override public void suggestContentSelections(SelectionsRequest request, ISelectionsCallback callback) { mHandler.sendMessage(obtainMessage(ContentSuggestionsService::suggestContentSelections, mHandler.sendMessage(obtainMessage( ContentSuggestionsService::onSuggestContentSelections, ContentSuggestionsService.this, request, wrapSelectionsCallback(callback))); } Loading @@ -89,14 +90,15 @@ public abstract class ContentSuggestionsService extends Service { @Override public void classifyContentSelections(ClassificationsRequest request, IClassificationsCallback callback) { mHandler.sendMessage(obtainMessage(ContentSuggestionsService::classifyContentSelections, mHandler.sendMessage(obtainMessage( ContentSuggestionsService::onClassifyContentSelections, ContentSuggestionsService.this, request, wrapClassificationCallback(callback))); } @Override public void notifyInteraction(String requestId, Bundle interaction) { mHandler.sendMessage( obtainMessage(ContentSuggestionsService::notifyInteraction, obtainMessage(ContentSuggestionsService::onNotifyInteraction, ContentSuggestionsService.this, requestId, interaction)); } }; Loading @@ -122,25 +124,41 @@ public abstract class ContentSuggestionsService extends Service { * Called by the system to provide the snapshot for the task associated with the given * {@param taskId}. */ public abstract void processContextImage( int taskId, @Nullable Bitmap contextImage, @NonNull Bundle extras); public void onProcessContextImage( int taskId, @Nullable Bitmap contextImage, @NonNull Bundle extras) { // TODO(b/127532182): remove after next prebuilt drop. processContextImage(taskId, contextImage, extras); } /** * Called by a client app to make a request for content selections. * Content selections have been request through {@link ContentSuggestionsManager}, implementer * should reply on the callback with selections. */ public abstract void suggestContentSelections(@NonNull SelectionsRequest request, @NonNull ContentSuggestionsManager.SelectionsCallback callback); public void onSuggestContentSelections(@NonNull SelectionsRequest request, @NonNull ContentSuggestionsManager.SelectionsCallback callback) { // TODO(b/127532182): remove after next prebuilt drop. suggestContentSelections(request, callback); } /** * Called by a client app to classify the provided content selections. * Content classifications have been request through {@link ContentSuggestionsManager}, * implementer should reply on the callback with classifications. */ public abstract void classifyContentSelections(@NonNull ClassificationsRequest request, @NonNull ContentSuggestionsManager.ClassificationsCallback callback); public void onClassifyContentSelections(@NonNull ClassificationsRequest request, @NonNull ContentSuggestionsManager.ClassificationsCallback callback) { // TODO(b/127532182): remove after next prebuilt drop. classifyContentSelections(request, callback); } /** * Called by a client app to report an interaction. * User interactions have been reported through {@link ContentSuggestionsManager}, implementer * should handle those interactions. */ public abstract void notifyInteraction(@NonNull String requestId, @NonNull Bundle interaction); public void onNotifyInteraction( @NonNull String requestId, @NonNull Bundle interaction) { // TODO(b/127532182): remove after next prebuilt drop. notifyInteraction(requestId, interaction); } private ContentSuggestionsManager.SelectionsCallback wrapSelectionsCallback( ISelectionsCallback callback) { Loading @@ -163,4 +181,40 @@ public abstract class ContentSuggestionsService extends Service { } }); } /** * For temporary compat reason, remove with b/127532182 * @deprecated */ @Deprecated public void processContextImage( int taskId, @Nullable Bitmap contextImage, @NonNull Bundle extras) { } /** * For temporary compat reason, remove with b/127532182 * @deprecated */ @Deprecated public void suggestContentSelections(@NonNull SelectionsRequest request, @NonNull ContentSuggestionsManager.SelectionsCallback callback) { } /** * For temporary compat reason, remove with b/127532182 * @deprecated */ @Deprecated public void classifyContentSelections(@NonNull ClassificationsRequest request, @NonNull ContentSuggestionsManager.ClassificationsCallback callback) { } /** * For temporary compat reason, remove with b/127532182 * @deprecated */ @Deprecated public void notifyInteraction(@NonNull String requestId, @NonNull Bundle interaction) { } } Loading
api/system-current.txt +8 −4 Original line number Diff line number Diff line Loading @@ -6473,10 +6473,14 @@ package android.service.contentsuggestions { public abstract class ContentSuggestionsService extends android.app.Service { ctor public ContentSuggestionsService(); method public abstract void classifyContentSelections(@NonNull android.app.contentsuggestions.ClassificationsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.ClassificationsCallback); method public abstract void notifyInteraction(@NonNull String, @NonNull android.os.Bundle); method public abstract void processContextImage(int, @Nullable android.graphics.Bitmap, @NonNull android.os.Bundle); method public abstract void suggestContentSelections(@NonNull android.app.contentsuggestions.SelectionsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.SelectionsCallback); method @Deprecated public void classifyContentSelections(@NonNull android.app.contentsuggestions.ClassificationsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.ClassificationsCallback); method @Deprecated public void notifyInteraction(@NonNull String, @NonNull android.os.Bundle); method public void onClassifyContentSelections(@NonNull android.app.contentsuggestions.ClassificationsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.ClassificationsCallback); method public void onNotifyInteraction(@NonNull String, @NonNull android.os.Bundle); method public void onProcessContextImage(int, @Nullable android.graphics.Bitmap, @NonNull android.os.Bundle); method public void onSuggestContentSelections(@NonNull android.app.contentsuggestions.SelectionsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.SelectionsCallback); method @Deprecated public void processContextImage(int, @Nullable android.graphics.Bitmap, @NonNull android.os.Bundle); method @Deprecated public void suggestContentSelections(@NonNull android.app.contentsuggestions.SelectionsRequest, @NonNull android.app.contentsuggestions.ContentSuggestionsManager.SelectionsCallback); field public static final String SERVICE_INTERFACE = "android.service.contentsuggestions.ContentSuggestionsService"; } Loading
core/java/android/service/contentsuggestions/ContentSuggestionsService.java +70 −16 Original line number Diff line number Diff line Loading @@ -72,7 +72,7 @@ public abstract class ContentSuggestionsService extends Service { } mHandler.sendMessage( obtainMessage(ContentSuggestionsService::processContextImage, obtainMessage(ContentSuggestionsService::onProcessContextImage, ContentSuggestionsService.this, taskId, wrappedBuffer, imageContextRequestExtras)); Loading @@ -81,7 +81,8 @@ public abstract class ContentSuggestionsService extends Service { @Override public void suggestContentSelections(SelectionsRequest request, ISelectionsCallback callback) { mHandler.sendMessage(obtainMessage(ContentSuggestionsService::suggestContentSelections, mHandler.sendMessage(obtainMessage( ContentSuggestionsService::onSuggestContentSelections, ContentSuggestionsService.this, request, wrapSelectionsCallback(callback))); } Loading @@ -89,14 +90,15 @@ public abstract class ContentSuggestionsService extends Service { @Override public void classifyContentSelections(ClassificationsRequest request, IClassificationsCallback callback) { mHandler.sendMessage(obtainMessage(ContentSuggestionsService::classifyContentSelections, mHandler.sendMessage(obtainMessage( ContentSuggestionsService::onClassifyContentSelections, ContentSuggestionsService.this, request, wrapClassificationCallback(callback))); } @Override public void notifyInteraction(String requestId, Bundle interaction) { mHandler.sendMessage( obtainMessage(ContentSuggestionsService::notifyInteraction, obtainMessage(ContentSuggestionsService::onNotifyInteraction, ContentSuggestionsService.this, requestId, interaction)); } }; Loading @@ -122,25 +124,41 @@ public abstract class ContentSuggestionsService extends Service { * Called by the system to provide the snapshot for the task associated with the given * {@param taskId}. */ public abstract void processContextImage( int taskId, @Nullable Bitmap contextImage, @NonNull Bundle extras); public void onProcessContextImage( int taskId, @Nullable Bitmap contextImage, @NonNull Bundle extras) { // TODO(b/127532182): remove after next prebuilt drop. processContextImage(taskId, contextImage, extras); } /** * Called by a client app to make a request for content selections. * Content selections have been request through {@link ContentSuggestionsManager}, implementer * should reply on the callback with selections. */ public abstract void suggestContentSelections(@NonNull SelectionsRequest request, @NonNull ContentSuggestionsManager.SelectionsCallback callback); public void onSuggestContentSelections(@NonNull SelectionsRequest request, @NonNull ContentSuggestionsManager.SelectionsCallback callback) { // TODO(b/127532182): remove after next prebuilt drop. suggestContentSelections(request, callback); } /** * Called by a client app to classify the provided content selections. * Content classifications have been request through {@link ContentSuggestionsManager}, * implementer should reply on the callback with classifications. */ public abstract void classifyContentSelections(@NonNull ClassificationsRequest request, @NonNull ContentSuggestionsManager.ClassificationsCallback callback); public void onClassifyContentSelections(@NonNull ClassificationsRequest request, @NonNull ContentSuggestionsManager.ClassificationsCallback callback) { // TODO(b/127532182): remove after next prebuilt drop. classifyContentSelections(request, callback); } /** * Called by a client app to report an interaction. * User interactions have been reported through {@link ContentSuggestionsManager}, implementer * should handle those interactions. */ public abstract void notifyInteraction(@NonNull String requestId, @NonNull Bundle interaction); public void onNotifyInteraction( @NonNull String requestId, @NonNull Bundle interaction) { // TODO(b/127532182): remove after next prebuilt drop. notifyInteraction(requestId, interaction); } private ContentSuggestionsManager.SelectionsCallback wrapSelectionsCallback( ISelectionsCallback callback) { Loading @@ -163,4 +181,40 @@ public abstract class ContentSuggestionsService extends Service { } }); } /** * For temporary compat reason, remove with b/127532182 * @deprecated */ @Deprecated public void processContextImage( int taskId, @Nullable Bitmap contextImage, @NonNull Bundle extras) { } /** * For temporary compat reason, remove with b/127532182 * @deprecated */ @Deprecated public void suggestContentSelections(@NonNull SelectionsRequest request, @NonNull ContentSuggestionsManager.SelectionsCallback callback) { } /** * For temporary compat reason, remove with b/127532182 * @deprecated */ @Deprecated public void classifyContentSelections(@NonNull ClassificationsRequest request, @NonNull ContentSuggestionsManager.ClassificationsCallback callback) { } /** * For temporary compat reason, remove with b/127532182 * @deprecated */ @Deprecated public void notifyInteraction(@NonNull String requestId, @NonNull Bundle interaction) { } }