From f13a62ae2e8e400615955716ded0ad310321bbb4 Mon Sep 17 00:00:00 2001 From: Alexander Dorokhine Date: Fri, 20 Nov 2020 22:03:29 -0800 Subject: Unhide GenericDocument API. Bug: 157082794 CTS-Coverage-Bug: 152547059 Test: AppSearchManagerTest Change-Id: I761cfb63acf61ca8de1873d5ff1b8aec2f7df19b --- apex/appsearch/framework/api/current.txt | 40 ++++++++++++++++++++++ .../android/app/appsearch/GenericDocument.java | 13 ++++--- 2 files changed, 46 insertions(+), 7 deletions(-) diff --git a/apex/appsearch/framework/api/current.txt b/apex/appsearch/framework/api/current.txt index 3c4706261d03..fdf891b14c9e 100644 --- a/apex/appsearch/framework/api/current.txt +++ b/apex/appsearch/framework/api/current.txt @@ -45,5 +45,45 @@ package android.app.appsearch { method @NonNull public android.app.appsearch.AppSearchSchema.PropertyConfig.Builder setTokenizerType(int); } + public class GenericDocument { + ctor protected GenericDocument(@NonNull android.app.appsearch.GenericDocument); + method public long getCreationTimestampMillis(); + method public static int getMaxIndexedProperties(); + method @NonNull public String getNamespace(); + method public boolean getPropertyBoolean(@NonNull String); + method @Nullable public boolean[] getPropertyBooleanArray(@NonNull String); + method @Nullable public byte[] getPropertyBytes(@NonNull String); + method @Nullable public byte[][] getPropertyBytesArray(@NonNull String); + method @Nullable public android.app.appsearch.GenericDocument getPropertyDocument(@NonNull String); + method @Nullable public android.app.appsearch.GenericDocument[] getPropertyDocumentArray(@NonNull String); + method public double getPropertyDouble(@NonNull String); + method @Nullable public double[] getPropertyDoubleArray(@NonNull String); + method public long getPropertyLong(@NonNull String); + method @Nullable public long[] getPropertyLongArray(@NonNull String); + method @NonNull public java.util.Set getPropertyNames(); + method @Nullable public String getPropertyString(@NonNull String); + method @Nullable public String[] getPropertyStringArray(@NonNull String); + method @NonNull public String getSchemaType(); + method public int getScore(); + method public long getTtlMillis(); + method @NonNull public String getUri(); + field public static final String DEFAULT_NAMESPACE = ""; + } + + public static class GenericDocument.Builder { + ctor public GenericDocument.Builder(@NonNull String, @NonNull String); + method @NonNull public android.app.appsearch.GenericDocument build(); + method @NonNull public BuilderType setCreationTimestampMillis(long); + method @NonNull public BuilderType setNamespace(@NonNull String); + method @NonNull public BuilderType setPropertyBoolean(@NonNull String, @NonNull boolean...); + method @NonNull public BuilderType setPropertyBytes(@NonNull String, @NonNull byte[]...); + method @NonNull public BuilderType setPropertyDocument(@NonNull String, @NonNull android.app.appsearch.GenericDocument...); + method @NonNull public BuilderType setPropertyDouble(@NonNull String, @NonNull double...); + method @NonNull public BuilderType setPropertyLong(@NonNull String, @NonNull long...); + method @NonNull public BuilderType setPropertyString(@NonNull String, @NonNull java.lang.String...); + method @NonNull public BuilderType setScore(@IntRange(from=0, to=java.lang.Integer.MAX_VALUE) int); + method @NonNull public BuilderType setTtlMillis(long); + } + } diff --git a/apex/appsearch/framework/java/android/app/appsearch/GenericDocument.java b/apex/appsearch/framework/java/android/app/appsearch/GenericDocument.java index f41fa8df453a..0056377f007a 100644 --- a/apex/appsearch/framework/java/android/app/appsearch/GenericDocument.java +++ b/apex/appsearch/framework/java/android/app/appsearch/GenericDocument.java @@ -37,10 +37,9 @@ import java.util.Set; * *

Documents are constructed via {@link GenericDocument.Builder}. * - * @see AppSearchSession#putDocuments - * @see AppSearchSession#getByUri - * @see AppSearchSession#query - * @hide + * @see AppSearchManager#putDocuments + * @see AppSearchManager#getByUri + * @see AppSearchManager#query */ public class GenericDocument { private static final String TAG = "GenericDocument"; @@ -684,10 +683,10 @@ public class GenericDocument { * * @param uri The uri of {@link GenericDocument}. * @param schemaType The schema type of the {@link GenericDocument}. The passed-in {@code - * schemaType} must be defined using {@link AppSearchSession#setSchema} prior to + * schemaType} must be defined using {@link AppSearchManager#setSchema} prior to * inserting a document of this {@code schemaType} into the AppSearch index using {@link - * AppSearchSession#putDocuments}. Otherwise, the document will be rejected by {@link - * AppSearchSession#putDocuments}. + * AppSearchManager#putDocuments}. Otherwise, the document will be rejected by {@link + * AppSearchManager#putDocuments}. */ @SuppressWarnings("unchecked") public Builder(@NonNull String uri, @NonNull String schemaType) { -- cgit v1.2.3-59-g8ed1b