Commit Graph

110 Commits

Author SHA1 Message Date
Alexander Dorokhine
bda2ada6da Update Framework from Jetpack.
Changes included:
* 517c1ee: Schema Migration API updates to match API council recommendations.
* 407144d: Refactor some migration helper methods to Utils class.
* 2297b3a: Add a test for migrate to a nonexistent schema.
* 16a38d0: Log the PutDocumentStats in AppSearchImpl

Bug: 178060626
Bug: 179804862
Bug: 173532925
Test: Presubmit
Change-Id: I8b879bc9a5f30f9be3ce08d07dc60f4b177fb11b
2021-03-16 23:57:49 -07:00
Alexander Dorokhine
61897f07b2 Merge "Update Framework from Jetpack." into sc-dev 2021-03-15 23:02:25 +00:00
Alexander Dorokhine
64bc77cfec Merge "Update platform from Jetpack." into sc-dev 2021-03-15 23:02:02 +00:00
Cassie Wang
a7ee1a9a49 Merge "Require database name when creating session." into sc-dev 2021-03-15 03:13:34 +00:00
Xiaoyu Jin
4c1020ccb8 Add Logger Implementation for WestWorld
1) Implement sampling and rate limiting
2) Caching packageUid for the packages

Bug: 173532925
Test: atest
FrameworksServicesTests:com.android.server.appsearch.stats.PlatformLoggerTest

Change-Id: Ic6ca1cc0b0da8a0188a152037b6ae240293d9756
2021-03-15 01:25:40 +00:00
Alexander Dorokhine
c153efec4f Update Framework from Jetpack.
Included changes:
* b7eb43a: Require a namespace across APIs.
* 4e92597: Require databaseName when creating session.

Bug: 180460765
Bug: 181364730
Test: Presubmit

Change-Id: I22a0f4a2bd38d9b2e4e70258184800d281e579f1
2021-03-14 10:00:06 +00:00
Cassie Wang
1c2fa255b6 Require database name when creating session.
Deprecates the old constructor and setDatabaseName.

Bug: 180460765
Test: presubmit
Change-Id: I927159e39006c8c6ee6b89aed43245d62252f651
2021-03-12 13:03:17 -08:00
Alexander Dorokhine
c02dcf75f4 Update platform from Jetpack.
Included changes:
* b2c0825: Unhide builders for AppSearch objects to facilitate testing.
* dde789a: Expose Builders for SearchResult and MatchInfo.

Bug: 180143983
Bug: 177954902
Test: Presubmit

Change-Id: I3307cb5fd52b99bcbd72216bb4afbc7b58dd8650
2021-03-12 20:14:46 +00:00
Terry Wang
cfba1031c1 Delete depracated method in AppSearchManager.
Test: presubmit
Bug: 162450968
Change-Id: I423e3a25bb986ca6cc0a87c74ce97becb59ed25b
2021-03-08 20:29:06 +00:00
Alexander Dorokhine
73fb4da96d Update Framework from Jetpack.
Included changes:
* 509ebe: Rename getSchemasNotVisibleToSystemUi to setSchemaTypeDisplayedBySystem
* a532fe: Resolve merge conflicts from upstream sync.

Bug: 179143575
Bug: 175146044
Bug: 179160886
Bug: 175255572
Bug: 181887768
Test: Presubmit

Change-Id: I977baf47f6188e4c182a5cf96af4873d0e5284e0
2021-03-05 22:01:32 +00:00
Alexander Dorokhine
ad71d8301a Move Executor parameter into SearchResult#getNextPage.
Bug: 180460795
Test: AppSearchSessionCtsTest
Change-Id: Iaf8ef970222801bf097a6b83643909d48ad44844
2021-02-25 13:05:25 -08:00
Alexander Dorokhine
8bddbddb88 Update framework from jetpack.
Included changes:
* aef5cff2: Remove hasSchemaTypeLocked.
* b2acdaae: Update documentation for setSchema and SetSchemaRequest

Bug: 180058203
Test: Presubmit
Change-Id: Id2b38bad5eb9240d514310b8122043edf35d11b5
2021-02-24 14:44:14 -08:00
Dan Saadati
11924878af Merge "Update AppSearchManager class header with description and examples" into sc-dev 2021-02-24 17:56:30 +00:00
Dan Saadati
b6604fca95 Update AppSearchManager class header with description and examples
Bug: 148046169
Test: N/A
Relnote: N/A
Change-Id: I86c73be48a6f70d027cb7604712959277022174e
2021-02-24 03:06:04 +00:00
Alexander Dorokhine
c13d22555f Merge "API updates to match API council recommendations." into sc-dev 2021-02-23 20:25:03 +00:00
Alexander Dorokhine
43fe0b1b5e Update framework from jetpack.
Changes included:
* bdc86ce: Remove parameters from javadocs for methods that differ in framework.
* c8e1f21: Add logger interface for AppSearch
* 1de2a5a: Remove parameters from javadocs for methods that differ in framework.

Bug: 173532925
Test: Presubmit
Change-Id: Ia27d60be83b6ac3a6ad53ceb9bda58d5bd91bcb7
2021-02-19 11:43:43 -08:00
Alexander Dorokhine
67ebdec552 API updates to match API council recommendations.
Bug: 175763859
Test: Presubmit
Change-Id: If51b4456520cca6c781eec6c8f9467f730edd110
2021-02-16 18:17:47 -08:00
Alexander Dorokhine
7cbb20b23e Update Framework from Jetpack.
Changes included:
* 1fc8203: Add getAll() API to AppSearchBatchResult as recommended by API council
* aa94928: Updates to Query Documentation
* 63badf5: Create flavours of all Session tests to run against both backends.
* 03e917e: Move the decision to optimize out of AppSearchImpl.
* 4909a2f: Make AppSearchImpl closeable.
* 3ebce41: Fix and enforce MixedMutabilityReturnType errorprone warnings
* 6994b7e: Update documentation for GetByUri
* 4f632ca: Preinitialize map to proper size.
* efeb70b: Update documentation for RemoveByUriRequest
* daecb8a: Refactor SetSchemaResponse to merge SetSchemaResult
* 2682de4: SetSchemaResponse will be only returned in successful case.
* f0f0ec4: Update documentation for GenericDocument

Bug: 178060626
Bug: 179416188
Bug: 175763859
Bug: 175801531
Bug: 162450968
Bug: 179407490
Bug: 171758893
Test: Presubmit
Change-Id: I3937e877a84b6255a5ca0fd343a3de28ebaea174
2021-02-12 09:30:34 -08:00
Cassie Wang
1d75e79509 Replace @code with @link for setSchema.
Now that the visibility APIs are exposed, we can properly @link to the
methods in the documentation.

Bug: 169883602
Test: presubmit
Change-Id: Ic5e9cb5f4279077cae72a566a631163ca7dd7264
2021-02-11 14:33:14 -08:00
Alexander Dorokhine
158ffacc06 Update framework from Jetpack.
Included changes:
* 0532abb: Rename DataClassFactory to DocumentClassFactory.
* c44176d: Update Get and Remove request objects with API council feedback.
* 1910709: Remove all remaining references to 'data class'.
* f8a5243: Fix a potential bug in BundleUtil.deepHashCode() if iteration order changes.
* 3b50162: Remove redundant logic for sorting keys.
* 2964d35: Revert "Remove redundant logic for sorting keys."

Bug: 171340471
Bug: 175763859
Bug: 178741022
Test: Presubmit
Change-Id: I5c2ec332d0f0e07913ffcec9e2dc1ef9634b33da
2021-02-03 11:19:59 -08:00
Alexander Dorokhine
dcbf7708d5 Update framework from Jetpack.
Changes included:
* 081c412: Remove spam logs from GenericDocumentToPlatformConverter.
* 69df01d: Fix an issue with nested documents after serialization.
* 0197939: Update Jetpack API usages to build against the latest SDK.
* 843f415: Rename @AppSearchDocument to @Document.
* 37adb0f: Update docs around database name.
* 19383f8: Apply naming changes to AppSearchSession and GlobalSearchSession.
* 8359c2b: Update SetSchemaRequest to comply with API council requirements.
* 4b04aba: Update PutDocumentsRequest APIs to align with API council guidance.
* 3c8ebfb: Update SearchSpec APIs to match API council recommendations.

Bug: 174614009
Bug: 178540467
Bug: 175763859
Bug: 171340471
Test: Presubmit
Change-Id: I4649ffe1d1c94b0c6125943772d33c6fb38d0006
2021-01-29 10:32:32 -08:00
Terry Wang
cb362c021f Sync AppSearch from framework.
Included changes:
* 9d1cf52: Supports schema migration in AppSearch
* 1c55f12: Change AppSearch setSchema() to return a SetSchemaRsponse.
* 9d94171: Unhide AppSearchMigrationHelper, Transformer and
           SetSchemaResponse.
* f07132f: add maybeFlush to AppSearchSession.

Bug: 169883602
Bug: 173742929
Test: Presubmit

Change-Id: I9e70ed04014ae3d134defb93c5cb02a5def0c71e
2021-01-21 21:16:04 -08:00
Alexander Dorokhine
17e406e2fd Sync AppSearch from framework.
Contains changes:
* 37a4e9: Split indexing configs into per-type configs.
* 69d6e3: Add projection to the Get api.

Bug: 175039682
Bug: 177572431
Bug: 171857731
Test: Presubmit

Change-Id: Ida457b2d617be6e85557023bfb4716ad78c8db6c
2021-01-20 15:41:25 -08:00
Alexander Dorokhine
3311711b82 Sync AppSearch from framework.
Contains changes:
* 91ce28: Properly check permissions for globalQuery.
* 5663cb: Add cts tests for projection wildcard.
* 0c3732: Add cts test for RELEVANCE_SCORE.
* 79beac: Implement the usage reporting API.
* 7d3c33:  Add Version number to AppSearchSchema

Bug: 169883602
Bug: 175039682
Bug: 174698212
Bug: 177278213
Bug: 177266929
Test: Presubmit
Change-Id: Ia9b59e9957e6022d9b6f4ef82b9d0198952afa30
2021-01-20 15:26:13 -08:00
Cassie Wang
1d83dda7dc Pass package name across binder.
Take the client's context package name and pass it across binder so we
can forward it to AppSearchImpl. We'll no longer be getting package name
from UID, but we'll still verify that the package name belongs to the
binder calling UID.

Bug: 177752194
Test: presubmit
Change-Id: I8aef10594a6130790e28fa34d87ab89717159d79
2021-01-19 21:47:31 -08:00
Cassie Wang
a2c93f461b Update framework from jetpack.
Included changes:
* a8bcc3: Add database name to SearchResult.
* 8f855e: Support new framework APIs for visibility in the platform
backend.
* 01f349: Unhide AppSearchSession.close() by extends Closeable
* 7cb0c4: Add Closeable to GlobalSearchSession.
* cf37e4: Update AppSearch to be in sync google3 update aosp/1551754

Bug: 175637134
Bug: 169883602
Bug: 177278213
Test: presubmit
Change-Id: Ia71431441ee4b32fa248604aead1f28ea1fe45ea
2021-01-18 02:19:16 -08:00
Alexander Dorokhine
0310d7c128 Make GlobalSearchSession public.
This API is needed for 3p global query access.

Bug: 169883602
Test: N/A
Change-Id: Id5fc056caabab83127a594c0f43c77b6c63f28bf
2021-01-15 22:41:22 -08:00
Terry Wang
966057a8cc Sync Framework from Jetpack
Included changes:
* 01f349b: unhide AppSearchSession.close() by extends Closeable
* 7cb0c4e: Add Closeable to GlobalSearchSession.

Bug: 175637134, 176852483
Test: presubmit
Relnote: Added Closeable to AppSearchSession and GlobalSearchSession.
Change-Id: Ia0929f70942ba6d57712cfc97b332efb8628c416
2021-01-15 13:31:55 -08:00
Alexander Dorokhine
747a1e67c1 Update Framework from Jetpack.
Included changes:
* b5a5eb: Make Projection APIs functional.
* 7ce5da: Persist package accessible visibility settings.
* b69a9b: Add package name filters to SearchSpec.
* e723de: Unhide SearchResult.getPackageName.
* 67a584: More verbose AppSearchResult error messages.
* c1b9db: Update builder methods to accept subclasses
* 1c5ae0: Unhide package name filters on SearchSpec.
* 8aa2b8: Make PackageIdentifier bundle-based.

Bug: 175039682
Bug: 169883602
Bug: 175747439
Bug: 174876269
Bug: 171914169
Bug: 175794710
Test: Presubmit
Change-Id: Ia54d51156774e09ed1f0694bd61bc8c25fb63810
2021-01-11 21:00:00 -08:00
Alexander Dorokhine
98abb2ec3a Unhide APIs in Framework that were already unhidden in Jetpack.
Bug: 169883602
Test: GlobalSearchSessionCtsTest
Change-Id: Ib004de00c078e066d8a9acd2355bcb5fe2859b62
2021-01-07 21:23:53 -08:00
Alexander Dorokhine
51193cd969 Sync Framework from Jetpack.
Included changes:
* ebd84f: Further fixes and improvements to export script.
* 968bbd: Copy AppSearchSession, GlobalSearchSession and SearchResults into shims.
* a0d314: Refactor tests involving AppSearchSession into base and concrete class.
* 8d652e: Remove spam logs from GenericDocument.
* 11e8f8: Update AppSearch to be in sync google3 update aosp/1541514.
* cdd6f7: Add package name to SearchResult.

Bug: 176519441
Bug: 175801531
Bug: 174614009
Bug: 169883602
Test: Presubmit
Change-Id: I4cf2d830294b41909b6d41adb7925ddebc1d01eb
2021-01-07 21:09:51 -08:00
Terry Wang
4aba0d8466 Update Framework from Jetpack.
Changes included:
#efb600e:Add Closeable to AppSearchSession, allow it persist data to disk.

Bug: 162450968
Test: presubmit
Change-Id: Ib00cf83e41f0e3e2f79b4c46d9a50407e72bd9bb
2021-01-06 01:32:11 -08:00
Alexander Dorokhine
6a54e73a3d Update Framework from Jetpack.
* e2124eb: Switch from throwing AssertionError to using a Truth assertion.
* 2ff6b81: Remove FutureUtils.map.
* 40eb8b5: Add projection to the SearchSpec.

Also, ports GlobalSearchSessionTest to platform for the first time.

Bug: 170997047
Bug: 162450968
Bug: 175661706
Bug: 170539682
Test: AppSearchSessionTest, GlobalSearchSessionTest
Change-Id: I9bdfb69b4d36b194c2c4038fb053f6237af9412a
2020-12-29 00:16:00 -08:00
Alexander Dorokhine
fb182aebae Merge "Update framework from Jetpack" 2020-12-29 05:24:10 +00:00
Alexander Dorokhine
4306d3f8e7 Update framework from Jetpack
Included changes:
* 8b9027a: Unhide visibility APIs on SetSchemaRequest.
* 9079d15: Support collections of subclasses in SetSchemaRequest builder
* 3a36aa7: Snapshot global query results in tests.
* afbdc54: Fix errors cause by AppSearchImpl.reset.
* 2463600: Place CTS tests and test utils into the right places.
* 92cd45a: Remove AppSearchResult from methods returning a single value.

Bug: 169883602
Bug: 171914169
Bug: 175430168
Bug: 170997047
Bug: 162450968
Test: AppSearchSessionTest
Change-Id: I01101e7928e0a0526412f5905ff5d6afa645042b
2020-12-28 16:36:50 -08:00
Terry Wang
bcb007a9e1 Support Multi-User AppSearch within SystemServer
Bug: 173553485
Test: presubmit
Change-Id: Id296ef9b309d6c7f46f2c78712f5951181c7c7ab
2020-12-23 02:47:04 -08:00
Alexander Dorokhine
7749895904 Unhide AppSearchManager APIs.
Bug: 172180369
CTS-Coverage-Bug: 175661706
Test: AppSearchCtsTests
Change-Id: I3a17ec73708226ef7894ab894a8327ee2a6973d3
2020-12-14 23:43:41 -08:00
Alexander Dorokhine
fbe21fe661 Unhide GlobalSearchSession API.
Bug: 172180369
CTS-Coverage-Bug: 175661706
Test: AppSearchManagerTest
Change-Id: Ie460dbbb226fd50cbbeb89c7d41e45cdf1bd66ca
2020-12-14 23:43:15 -08:00
Alexander Dorokhine
b0bb379e10 Unhide AppSearchSession APIs.
Bug: 172180369
CTS-Coverage-Bug: 175661706
Test: AppSearchCtsTests
Change-Id: Ia00206ec4bbe78cc0c970fb2f0c708740a3078af
2020-12-14 23:42:48 -08:00
Alexander Dorokhine
779b7cebf0 Sync platform from Jetpack.
Included changes:
* caf5d9: Add a uri prefix to visibility store documents.
* 5b26a8: Minor comment fix in AppSearchSession
* 31b691: Add package visibility APIs for schema types.
* d36a2c: Require a package name in AppSearchImpl.

Bug: 169883602
Bug: 162450968
Test: Presubmit
Change-Id: I155145e4b14a271f3012cb7b5efbbe1b7ba27a18
2020-12-14 22:58:12 -08:00
Terry Wang
115113c67c Merge "Porting AppSearch jetpack upstream changes to platform" 2020-12-15 03:36:45 +00:00
Terry Wang
79c45aaa3c Porting AppSearch jetpack upstream changes to platform
Changes included:
#af6646e : Support retrieving the current database's schema
#2696e50 : Unhide the createGlobalSearchSession API.

Bug: 162450968
Test: presubmit
Change-Id: I8e97304fedd446b88393eb6ca5b42c2e210e3271
2020-12-14 13:18:53 -08:00
Terry Wang
c729f3921f Remove AppSearchException from java doc of AppSearchSession.
AppSearchException caused by initialization error won't be propagate to
client.

Test: presubmit
Bug: 162450968
Change-Id: I0b275c522afd2990f0729aca5b3367637c151ccb
2020-12-11 16:46:44 -08:00
Terry Wang
07c2422ad0 Revert "Split getInstance and createInstance in AppSearchImpl"
This reverts commit 5caaa238eb.

Reason for revert: <b/175408530>

Change-Id: Icc000c874ff1db45eba1a513e8aacf52b4ede147
2020-12-11 22:17:09 +00:00
Terry Wang
5caaa238eb Split getInstance and createInstance in AppSearchImpl
User could never call an uninitialized SearchSession, so convert and
propagate the initialize error in getInstace to user for every call is
unnecessary.

Split createInstace for initialization, and getInstance for other calls.
Removed AppSearchException from getInstace's signature.

Test: presubmit
Bug: 162450968
Change-Id: I925506ad0f6540b060c77ed2a535737ee71f781c
2020-12-07 19:49:38 -08:00
Alexander Dorokhine
bb2433fdfa Move externally synced framework files to an 'external' folder.
Java package paths and the overall API is unaffected.

This makes it much easier to maintain the export script. Prior to this
CL, the export script had an allowlist of framework files to leave
alone. This list was badly out of date and hard to maintain in
lockstep with framework.

There are no functional changes in this CL.

Bug: 162450968
Test: m -j, framework-appsearch.stubs.source-update-current-api, presubmit
Change-Id: I5a91f4afb1cfe2aa5e514d5f3159bf212f7de03b
2020-12-04 02:59:14 -08:00
Alexander Dorokhine
1e6072d831 Update AppSearch code from Jetpack.
* 31db05: Move visibility settings into SetSchemaRequest.
* af6646: Support retrieving the current database's schema.
* 468ec2: Minor comment fix.
* b67963: Refactor AppSearchImpl to use List instead of Set.
* 1ae2bc: Delete an assertion that bundle.equals(bundle).

Bug: 169883602
Bug: 172260083
Bug: 162450968
Bug: 174825775
Test: Presubmit
Change-Id: I485bc9d1d9980467f6bdde1f36b077c0a3e7f5b4
2020-12-04 02:57:22 -08:00
Alexander Dorokhine
ff92588fd4 Unhide AppSearchResult and AppSearchBatchResult objects.
Bug: 172180369
CTS-Coverage-Bug: 152547059
Test: AppSearchManagerTest
Change-Id: Ifcbae5934d5403cd81b546202fed3c0d951321c8
2020-12-02 17:24:49 -08:00
Alexander Dorokhine
db8173e4c8 Unhide Request objects.
Bug: 172180369
CTS-Coverage-Bug: 152547059
Test: AppSearchManagerTest
Change-Id: I54b0b5d3159c5d0b66b7762200f830e74f0fc08c
2020-12-02 17:24:24 -08:00
Terry Wang
b00edb6923 Merge "Add GlobalSearchSession to AppSearch platform." 2020-12-02 05:04:21 +00:00