Optimize is an important job for AppSearch to work properly.
It could collect garbage and release resources. Without it, the garbage
resource will last forever and the device's space will be fulled up by
zombie documents.
The algorithm to trigger optimize is:
1: Query garbage resource info after a batch of mutation operations.
2: Only trigger optimize if there are enough resource could be released.
The behavior exists in AppSearch Jetpack for a while and working properly
for our Jetpack dogfooders.
Bug: 175255572
Test: FrameworkOptimizeStrategyTest
Test: AppSearchConfigTest
Test: AppSearchImplTest
Change-Id: Ib7ae475cc035d1b69969df1e22ac409895e0e3fa
This is needed to prevent abuse of our service and to share icing
docids in framework, which are the resource we are most likely to
run out of.
Without this change, an app could use the platform backend to index
a very high number of documents and exhaust the docid limit, thereby
preventing any other app from using AppSearch.
Bug: 170371356
Test: New testcases added to AppSearchImplTest
Change-Id: I03ade35072bc69b84f8fcefed72b3c3bc2b8ee68
Previously, the hidden API encoding of the appsearch boot dex jars,
i.e. those dex jars that appsearch contributes to the bootclasspath
were done as part of the monolithic hidden API processing. This change
causes the encoding to be done by the appsearch's
bootclasspath_fragment.
This change involves the following:
* Addition of the fragments property to the appsearch's
bootclasspath_fragment module to list all the other
bootclasspath_fragment modules on which this depends.
* Addition of the additional_stubs property to add stubs for APIs that
are not provided by another bootclasspath_fragment.
The build automatically checks that the hidden API flags which are
computed by appsearch and encoded into its boot dex jars match those
that are generated by the monolithic processing so this is guaranteed
to be safe.
Bug: 179354495
Test: m com.android.appsearch
- ensure that the generated APEX is byte-for-byte identical
before and after these changes.
m out/soong/hiddenapi/hiddenapi-flags.csv
- make sure that they are not changed by this.
Change-Id: I8e5a60d64d3e147535e11a4ad30404f9888f53d2
The hidden APIs have already been fixed, so this CL mostly changes
build rules.
Bug: 181787682
Bug: 146218515
Test: Presubmit
Change-Id: I5d68d68ce8f39753f62c5e3680216877b7d7f819
Changes included:
* 79f2ffe: Fixes required for export.
* e1ca63a: Implement empty schema shouldn't have a version number.
* 8b76be4: Refactor VisibilityStore from a no-op implementation into an interface.
* 47ba533: Remove the max repeatable length limit for GenericDocument
* 52ca287: Add GetSchemaResponse cts test.
* 56585f5: Change PutDocumentsRequestTest to be a cts test.
Bug: 183050495
Bug: 180058203
Bug: 191592792
Bug: 189161227
Bug: 183239766
Test: Presubmit
Change-Id: I30f51a18d697d3a5e43d2c63549ab19a36bbe99e
Included changes:
* a8c984: Add more tests for logging
* 501a51: Remove some deprecated TODOs.
* 639f25: Add SchemaMigrationStats.
* 0b8885: Use consistent terminology for 3p and system access.
* 064c36: Add a CTS test for snippeting window sizes and max match counts.
Bug: 173532925
Bug: 187879464
Bug: 180058203
Test: Presubmit
Change-Id: I878fd6c7a42cccb237898392aac8c615830eb564
Adding this check in a testable way requires refactoring VisibilityStore
to pull it out of management by the AppSearchImpl object. It is now
initialized as a sibling of AppSearchImpl, managed by
AppSearchUserInstanceManager.
This has several benefits:
* Breaks the complicated initialization inter-dependency between
AppSearchImpl and VisibilityStore
* Reduces duplicative singleton managers
* Allows AppSearchImpl to be tested more easily by accepting a
"hasSystemSurfaceable" boolean that can be set in tests
* Reduces the number of times we have to call into VisStore; we can
determine whether the caller has system access in advance instead of
repeating the check for every schema type
Bug: 180058203
Bug: 183031844
Test: GlobalSearchSessionCtsTest#testReportSystemUsage_ForbiddenFromNonSystem
Test: GlobalSearchSessionPlatformCtsTest#testReportSystemUsage
Test: VisibilityStoreTest
Change-Id: I84c84819f287628ccf8af369f5481a8e90255f62
Since we cannot access locked user's data and clear it when a package
got removed. When a user is unlocking, we should prune their data and
remove all data that doesn't belong to any of installed packages.
This will also help in handling the case where device gets
rebooted before the data is cleared for an uninstalled package.
Bug: 186151459
Test: atest --rebuild-module-info CtsAppSearchHostTestCases
Change-Id: Ic6d151621a88df7806901781d3edfec65700c35d
We need to store other things in the appsearch data dir other than what
Icing stores, such as the storage info cache.
Bug: 177685938
Bug: 181787682
Test: Presubmit
Change-Id: I903c34a2c891d617217d44f5126d0d31c8c6bf39
Non-updatable APEXes are going to be only present on a dm-verity
protected read-only partition. For such APEXes there is no need in
embedding a hashtree.
This is a no-op change in preparation of switching default value of
generate_hashtree to true.
Bug: 190621617
Test: m
Change-Id: I0283fb03908a87490e5e29b803553977b8b6729f
Flushing takes a few ms, it seems like a pretty good trade off compared
to keeping an icing instance in memory forever.
Bug: 179390369
Test: presubmit
Change-Id: Ic0493137dc8c33d44bd074bbd9ca4ae442049513
The implementation of handleIncomingUser is copied from
ag/13200660 (1d1547b).
Bug: 181787682
Test: Presubmit
Change-Id: I946199a8844e7fd6ea5574b873da56d8b8630f62
It manages the P/H flags from DeviceConfig.
bug: 173532925
Test: atest FrameworksMockingServicesTests:AppSearchConfigManagerTest
Change-Id: I668ecd8190bbe7a21ab3a23b52d08f4dce400491
This helps readers understand that the AppSearch APIs can operate
across users.
Bug: 179822197
Test: presubmit
Change-Id: I0be942f16d0211ea1ea68d72ac82c254b9dd6d02
The txt was previously referencing VcnGatewayConnectionConfig.MIN_MTU_V6
which isn't part of the API. The API txt should be complete on its own,
so inline the value instead.
Similar case for appsearch annotations referencing non-API values.
Bug: 188527836
Test: m checkapi
Change-Id: Ideb34ab78c9a8fc4d589e58e810316b6f36b7a43
Instead of using the "framework" module, we use our own module for
generating the atoms.
Bug: 181787682
Test: Builds
Change-Id: I626e2ddcad60d7a15c33b7a143b9e5d0ed0bb289
Most public and system APIs use UserHandle instead of UserIdInt, so this
CL ports AppSearch to do so as well, so that there are less conversions
required.
Bug: 181787682
Test: Presubmit
Change-Id: I29e4ba6bc73b994f1ece077ce515e1465ce54b12
It could not parse the annotation.
Bug: 188503851
Test: atest HiddenApiTest#testSignatureMethodsThroughReflection
Test: flash image, remove jetpack @SdkSuppress, and run jetpack tests
Change-Id: I05093b61b8658ad95db4f7e49c2f64bc314aa4b1