diff --git a/apex/appsearch/framework/java/android/app/appsearch/AppSearchManager.java b/apex/appsearch/framework/java/android/app/appsearch/AppSearchManager.java index da446bf1e7c6e..a62bb504debc4 100644 --- a/apex/appsearch/framework/java/android/app/appsearch/AppSearchManager.java +++ b/apex/appsearch/framework/java/android/app/appsearch/AppSearchManager.java @@ -19,19 +19,10 @@ import android.annotation.CallbackExecutor; import android.annotation.NonNull; import android.annotation.SystemService; import android.content.Context; -import android.os.Bundle; -import android.os.ParcelableException; -import android.os.RemoteException; -import com.android.internal.infra.AndroidFuture; import com.android.internal.util.Preconditions; -import java.util.ArrayList; -import java.util.Collections; -import java.util.List; -import java.util.Map; import java.util.Objects; -import java.util.concurrent.ExecutionException; import java.util.concurrent.Executor; import java.util.function.Consumer; @@ -246,349 +237,9 @@ public class AppSearchManager { mService, mContext.getUserId(), getPackageName(), executor, callback); } - /** - * Sets the schema being used by documents provided to the {@link #putDocuments} method. - * - *
The schema provided here is compared to the stored copy of the schema previously supplied - * to {@link #setSchema}, if any, to determine how to treat existing documents. The following - * types of schema modifications are always safe and are made without deleting any existing - * documents: - * - *
The following types of schema changes are not backwards-compatible: - * - *
Supplying a schema with such changes will result in this call returning an {@link - * AppSearchResult} with a code of {@link AppSearchResult#RESULT_INVALID_SCHEMA} and an error - * message describing the incompatibility. In this case the previously set schema will remain - * active. - * - *
If you need to make non-backwards-compatible changes as described above, instead use the - * {@link #setSchema(List, boolean)} method with the {@code forceOverride} parameter set to - * {@code true}. - * - *
It is a no-op to set the same schema as has been previously set; this is handled
- * efficiently.
- *
- * @param request The schema update request.
- * @return the result of performing this operation.
- * @hide
- * @deprecated use {@link AppSearchSession#setSchema} instead.
- */
- @NonNull
- public AppSearchResult You should not call this method directly; instead, use the {@code
- * AppSearch#putDocuments()} API provided by JetPack.
- *
- * Each {@link GenericDocument}'s {@code schemaType} field must be set to the name of a
- * schema type previously registered via the {@link #setSchema} method.
- *
- * @param request {@link PutDocumentsRequest} containing documents to be indexed
- * @return The pending result of performing this operation. The keys of the returned {@link
- * AppSearchBatchResult} are the URIs of the input documents. The values are {@code null} if
- * they were successfully indexed, or a failed {@link AppSearchResult} otherwise.
- * @throws RuntimeException If an error occurred during the execution.
- * @hide
- * @deprecated use {@link AppSearchSession#put} instead.
- */
- public AppSearchBatchResult You should not call this method directly; instead, use the {@code
- * AppSearch#getDocuments()} API provided by JetPack.
- *
- * @param request {@link GetByUriRequest} containing URIs to be retrieved.
- * @return The pending result of performing this operation. The keys of the returned {@link
- * AppSearchBatchResult} are the input URIs. The values are the returned {@link
- * GenericDocument}s on success, or a failed {@link AppSearchResult} otherwise. URIs that
- * are not found will return a failed {@link AppSearchResult} with a result code of {@link
- * AppSearchResult#RESULT_NOT_FOUND}.
- * @throws RuntimeException If an error occurred during the execution.
- * @hide
- * @deprecated use {@link AppSearchSession#getByUri} instead.
- */
- public AppSearchBatchResult You should not call this method directly; instead, use the {@code AppSearch#query()} API
- * provided by JetPack.
- *
- * Currently we support following features in the raw query format:
- *
- * AND joins (e.g. “match documents that have both the terms ‘dog’ and ‘cat’”).
- * Example: hello world matches documents that have both ‘hello’ and ‘world’
- * OR joins (e.g. “match documents that have either the term ‘dog’ or ‘cat’”). Example:
- * dog OR puppy
- * Exclude a term (e.g. “match documents that do not have the term ‘dog’”). Example:
- * -dog excludes the term ‘dog’
- * Allow for conceptual grouping of subqueries to enable hierarchical structures (e.g.
- * “match documents that have either ‘dog’ or ‘puppy’, and either ‘cat’ or ‘kitten’”).
- * Example: (dog puppy) (cat kitten) two one group containing two terms.
- * Specifies which properties of a document to specifically match terms in (e.g. “match
- * documents where the ‘subject’ property contains ‘important’”). Example:
- * subject:important matches documents with the term ‘important’ in the ‘subject’ property
- * This is similar to property restricts, but allows for restricts on top-level
- * document fields, such as schema_type. Clients should be able to limit their query to
- * documents of a certain schema_type (e.g. “match documents that are of the ‘Email’
- * schema_type”). Example: { schema_type_filters: “Email”, “Video”,query: “dog” } will
- * match documents that contain the query term ‘dog’ and are of either the ‘Email’ schema
- * type or the ‘Video’ schema type.
- * You should not call this method directly; instead, use the {@code AppSearch#delete()} API
- * provided by JetPack.
- *
- * @param request Request containing URIs to be removed.
- * @return The pending result of performing this operation. The keys of the returned {@link
- * AppSearchBatchResult} are the input URIs. The values are {@code null} on success, or a
- * failed {@link AppSearchResult} otherwise. URIs that are not found will return a failed
- * {@link AppSearchResult} with a result code of {@link AppSearchResult#RESULT_NOT_FOUND}.
- * @throws RuntimeException If an error occurred during the execution.
- * @hide
- * @deprecated use {@link AppSearchSession#remove} instead.
- */
- public AppSearchBatchResult
- *
- *
- * @param queryExpression Query String to search.
- * @param searchSpec Spec for setting filters, raw query etc.
- * @throws RuntimeException If an error occurred during the execution.
- * @hide
- * @deprecated use AppSearchSession#query instead.
- */
- @NonNull
- public AppSearchResult> query(
- @NonNull String queryExpression, @NonNull SearchSpec searchSpec) {
- // TODO(b/146386470): Transmit the result documents as a RemoteStream instead of sending
- // them in one big list.
- AndroidFuture