Unhide AppSearchManager APIs.
Bug: 172180369 CTS-Coverage-Bug: 175661706 Test: AppSearchCtsTests Change-Id: I3a17ec73708226ef7894ab894a8327ee2a6973d3
This commit is contained in:
@@ -7,6 +7,20 @@ package android.app.appsearch {
|
||||
method public boolean isSuccess();
|
||||
}
|
||||
|
||||
public class AppSearchManager {
|
||||
method public void createSearchSession(@NonNull android.app.appsearch.AppSearchManager.SearchContext, @NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.app.appsearch.AppSearchResult<android.app.appsearch.AppSearchSession>>);
|
||||
}
|
||||
|
||||
public static final class AppSearchManager.SearchContext {
|
||||
method @NonNull public String getDatabaseName();
|
||||
}
|
||||
|
||||
public static final class AppSearchManager.SearchContext.Builder {
|
||||
ctor public AppSearchManager.SearchContext.Builder();
|
||||
method @NonNull public android.app.appsearch.AppSearchManager.SearchContext build();
|
||||
method @NonNull public android.app.appsearch.AppSearchManager.SearchContext.Builder setDatabaseName(@NonNull String);
|
||||
}
|
||||
|
||||
public final class AppSearchResult<ValueType> {
|
||||
method @Nullable public String getErrorMessage();
|
||||
method public int getResultCode();
|
||||
|
||||
@@ -1,6 +1,10 @@
|
||||
// Signature format: 2.0
|
||||
package android.app.appsearch {
|
||||
|
||||
public class AppSearchManager {
|
||||
method public void createGlobalSearchSession(@NonNull java.util.concurrent.Executor, @NonNull java.util.function.Consumer<android.app.appsearch.AppSearchResult<android.app.appsearch.GlobalSearchSession>>);
|
||||
}
|
||||
|
||||
public class AppSearchManagerFrameworkInitializer {
|
||||
method public static void initialize();
|
||||
}
|
||||
|
||||
@@ -17,6 +17,7 @@ package android.app.appsearch;
|
||||
|
||||
import android.annotation.CallbackExecutor;
|
||||
import android.annotation.NonNull;
|
||||
import android.annotation.SystemApi;
|
||||
import android.annotation.SystemService;
|
||||
import android.content.Context;
|
||||
import android.os.Bundle;
|
||||
@@ -39,8 +40,6 @@ import java.util.function.Consumer;
|
||||
*
|
||||
* <p>Apps can index structured text documents with AppSearch, which can then be retrieved through
|
||||
* the query API.
|
||||
*
|
||||
* @hide
|
||||
*/
|
||||
// TODO(b/148046169): This class header needs a detailed example/tutorial.
|
||||
@SystemService(Context.APP_SEARCH_SERVICE)
|
||||
@@ -92,7 +91,8 @@ public class AppSearchManager {
|
||||
*
|
||||
* <p>Database name cannot contain {@code '/'}.
|
||||
*
|
||||
* <p>If not specified, defaults to {@link #DEFAULT_DATABASE_NAME}.
|
||||
* <p>If not specified, defaults to the empty string.
|
||||
*
|
||||
* @param databaseName The name of the database.
|
||||
* @throws IllegalArgumentException if the databaseName contains {@code '/'}.
|
||||
*/
|
||||
@@ -150,7 +150,9 @@ public class AppSearchManager {
|
||||
* @param callback The {@link AppSearchResult}<{@link GlobalSearchSession}> of
|
||||
* performing this operation. Or a {@link AppSearchResult} with failure
|
||||
* reason code and error information.
|
||||
* @hide
|
||||
*/
|
||||
@SystemApi
|
||||
public void createGlobalSearchSession(
|
||||
@NonNull @CallbackExecutor Executor executor,
|
||||
@NonNull Consumer<AppSearchResult<GlobalSearchSession>> callback) {
|
||||
@@ -300,6 +302,7 @@ public class AppSearchManager {
|
||||
* @throws RuntimeException If an error occurred during the execution.
|
||||
*
|
||||
* @deprecated use {@link AppSearchSession#getByUri} instead.
|
||||
* @hide
|
||||
*/
|
||||
public AppSearchBatchResult<String, GenericDocument> getByUri(
|
||||
@NonNull GetByUriRequest request) {
|
||||
@@ -443,6 +446,7 @@ public class AppSearchManager {
|
||||
* @throws RuntimeException If an error occurred during the execution.
|
||||
*
|
||||
* @deprecated use {@link AppSearchSession#removeByUri} instead.
|
||||
* @hide
|
||||
*/
|
||||
public AppSearchBatchResult<String, Void> removeByUri(@NonNull RemoveByUriRequest request) {
|
||||
List<String> uris = new ArrayList<>(request.getUris());
|
||||
|
||||
@@ -10246,6 +10246,7 @@ package android.content {
|
||||
field public static final String ALARM_SERVICE = "alarm";
|
||||
field public static final String APPWIDGET_SERVICE = "appwidget";
|
||||
field public static final String APP_OPS_SERVICE = "appops";
|
||||
field public static final String APP_SEARCH_SERVICE = "app_search";
|
||||
field public static final String AUDIO_SERVICE = "audio";
|
||||
field public static final String BATTERY_SERVICE = "batterymanager";
|
||||
field public static final int BIND_ABOVE_CLIENT = 8; // 0x8
|
||||
|
||||
@@ -5225,7 +5225,6 @@ public abstract class Context {
|
||||
* indexing and querying app data managed by the system.
|
||||
*
|
||||
* @see #getSystemService(String)
|
||||
* @hide
|
||||
*/
|
||||
public static final String APP_SEARCH_SERVICE = "app_search";
|
||||
|
||||
|
||||
Reference in New Issue
Block a user