198 Commits

Author SHA1 Message Date
Alexander Dorokhine
eea1716148 Update framework from jetpack.
Included changes:
* 1be54dc: Minor fix for where we set version in schema.
* 5c8a15d: Clean up deprecated methods after dogfood transition.
* 53407e5: Upstream fixes to storage info tests.

Bug: 182620003
Bug: 182909475
Bug: 181887768
Bug: 183395357
Test: Presubmit
Change-Id: Ie918c6c337c3943bc56909dc09eb75287a275487
2021-03-31 16:48:18 -07:00
Cassie Wang
c29724005b Switch to Binder.getCallingUid.
Since there are some AppSearch callers from system_server, we don't want
to throw.

Bug: 183986767
Test: presubmit
Change-Id: I4ee3640a71f2f0bc2758a0fb41667c55ef13296c
2021-03-30 12:39:21 -07:00
Cassie Wang
bc4504e5fd Merge "Implement getStorageInfo." into sc-dev 2021-03-30 01:13:57 +00:00
Cassie Wang
751415fb9f Implement getStorageInfo.
This retrieves storage info for a certain package and database.

Bug: 182909475
Test: atest -m -c --rebuild-module-info CtsAppSearchTestCases
FrameworksCoreTests: android.app.appsearch
FrameworksServicesTests: com.android.server.appsearch
Change-Id: I524e0b2ada919981f50722f01ecd3f62b2ae4f43
2021-03-29 23:01:32 +00:00
Alexander Dorokhine
4b063daf5d Run framework migration on a background thread.
Bug: 183177268
Test: AppSearchSchemaMigrationCtsTest
Change-Id: Ie0566ebf1e669cacc0e1a37f5131d49b0256dde6
2021-03-24 23:09:51 -07:00
Alexander Dorokhine
30ccdcd621 Merge "Remove deprecated methods from AppSearch APIs." into sc-dev 2021-03-25 05:34:38 +00:00
Alexander Dorokhine
65c4fd881e Remove deprecated methods from AppSearch APIs.
These methods were only available for dogfooder transition.
None of these methods shipped in a stable SDK.

Bug: 181887768
Bug: 183395357
Test: Build, presubmit
Change-Id: I74feebd2721208c97475df9b74f734a17a41d5e2
2021-03-24 22:14:38 -07:00
Pinyao Ting
b3c71c2f97 Merge "Move from getDataUserCePackageDirectory to getDataSystemCeDirectory." into sc-dev 2021-03-25 04:48:40 +00:00
Alexander Dorokhine
75962baf8e Move from getDataUserCePackageDirectory to getDataSystemCeDirectory.
The other folder doesn't seem to work for non-primary users.

Bug: 177685938
Test: Presubmit
Change-Id: I31cd3a9b98d3205bb06c3339404a176b8c2fe6c5
2021-03-24 16:59:48 -07:00
Terry Wang
17ea05b2a3 Implement schema migration in framework.
Changes included:
* 9d1cf52:Supports schema migration in AppSearch

Bug: 177266929
Test: AppSearchSchemaMigrationCtsTest
Change-Id: Ia5b964baeb413ec7d176bb12c9e4c2af26cf2bf3
2021-03-24 14:06:48 -07:00
Alexander Dorokhine
ff9b4dfc5e Add another executor to setSchema() for running framework migrations.
The advice to add a second executor is based on API council guidance,
who do not recommend reusing the callback executor.

The executor is not yet used but will be used once schema migration is
implemented in framework.

Bug: 183177268
Test: Builds
Change-Id: Ic6735e696bc868884adffddd1433a198a005cad6
2021-03-24 01:57:45 -07:00
Alexander Dorokhine
ffb44f506f Update framework from jetpack.
Changes included:
* 4d36ab: Rename AppSearchSession in test message to avoid export bug.
* 0b2126: Update AppSearch to be in sync google3 update ag/13878956.
* e79e74: Add getRankingSignal method to SearchResult.
* 2c2383: Add a getNamespaces() API.
* 712009: Add getStorageInfo API.
* 81e601: Add resut grouping flags and limits.
* f23105: Support usage reporting by the system in AppSearchImpl.
* 05b7d3: Change schema version from per AppSearchSchema to overall.
* effe02: Support schema migration to another type.
* a0db44: Some minor fix for GetSchemaResponse
* 66a1c3: Support AppSearchResult to convert a failure result to another type.

Bug: 177266929
Bug: 182620003
Bug: 183031844
Bug: 180429302
Bug: 182909475
Bug: 179160886
Bug: 183042276
Bug: 181179404
Test: Presubmit
Change-Id: I091b25a78093d0c8c193903a58122d09788e31ff
2021-03-23 22:06:59 -07:00
TreeHugger Robot
2cea467f9b Merge "Fix a timing issue in unlock signal propagation in AppSearch" into sc-dev 2021-03-19 18:20:06 +00:00
Pinyao Ting
46e734cae9 Fix a timing issue in unlock signal propagation in AppSearch
There is a tiny gap between user unlock and when the unlock event
reaches AppSearch. The fact that unlock event haven't reach AppSearch
isn't suffice to say user is not unlocked. This CL added the logic to
check with UM when cache misses.

Bug: 151359749
Test: manual
Change-Id: I49f0754d53fc4d391245917bb35b726a305e4e30
2021-03-19 09:49:47 -07:00
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
db7aecbc3a Merge "Update Framework from Jetpack." into sc-dev 2021-03-05 22:01:56 +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
Terry Wang
9bcf7462e3 Split getAppSearchImpl and createAppSearchImpl in AppSearchImpl
User could never call an uninitialized SearchSession, so convert and
propagate the initialize error in getAppSearchImpl to user
for every call is unnecessary.

Test: presubmit
Bug: 162450968
Change-Id: Ie2b3c7c0a56852d7e517c616960c19b7b9e9ad35
2021-03-04 22:29:02 -08: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
Bob Badour
745e7ee830 Merge "[LSC] Add LOCAL_LICENSE_KINDS to frameworks/base" into sc-dev 2021-02-24 18:43:29 +00: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
Cassie Wang
5b4c45b298 Merge "Check schemas using getSchema in VisibilityStore." into sc-dev 2021-02-23 22:15:42 +00:00
Bob Badour
d59495855e [LSC] Add LOCAL_LICENSE_KINDS to frameworks/base
Added SPDX-license-identifier-Apache-2.0 to:
  apct-tests/perftests/contentcapture/Android.bp
  apct-tests/perftests/inputmethod/Android.bp
  apex/appsearch/Android.bp
  apex/appsearch/framework/Android.bp
  apex/appsearch/service/Android.bp
  apex/appsearch/testing/Android.bp
  apex/jobscheduler/service/jni/Android.bp
  apex/media/service/Android.bp
  cmds/abx/Android.bp
  cmds/uinput/Android.bp
  cmds/uinput/jni/Android.bp
  core/tests/GameManagerTests/Android.bp
  core/tests/batterystatstests/BatteryStatsLoadTests/Android.bp
  core/tests/batterystatstests/BatteryStatsViewer/Android.bp
  core/tests/devicestatetests/Android.bp
  libs/WindowManager/Shell/tests/flicker/Android.bp
  libs/WindowManager/Shell/tests/flicker/test-apps/flickerapp/Android.bp
  libs/androidfw/fuzz/cursorwindow_fuzzer/Android.bp
  native/android/tests/activitymanager/UidImportanceHelperApps/Android.bp
  native/android/tests/activitymanager/nativeTests/Android.bp
  packages/SettingsLib/BannerMessagePreference/Android.bp
  packages/SettingsLib/CollapsingToolbarBaseActivity/Android.bp
  packages/SettingsLib/EmergencyNumber/Android.bp
  packages/SettingsLib/FooterPreference/Android.bp
  packages/SettingsLib/MainSwitchPreference/Android.bp
  packages/SettingsLib/TopIntroPreference/Android.bp
  packages/SettingsLib/UsageProgressBarPreference/Android.bp
  packages/overlays/AccentColorAmethystOverlay/Android.bp
  packages/overlays/AccentColorAquamarineOverlay/Android.bp
  packages/overlays/AccentColorBlackOverlay/Android.bp
  packages/overlays/AccentColorCarbonOverlay/Android.bp
  packages/overlays/AccentColorCinnamonOverlay/Android.bp
  packages/overlays/AccentColorGreenOverlay/Android.bp
  packages/overlays/AccentColorOceanOverlay/Android.bp
  packages/overlays/AccentColorOrchidOverlay/Android.bp
  packages/overlays/AccentColorPaletteOverlay/Android.bp
  packages/overlays/AccentColorPurpleOverlay/Android.bp
  packages/overlays/AccentColorSandOverlay/Android.bp
  packages/overlays/AccentColorSpaceOverlay/Android.bp
  packages/overlays/AccentColorTangerineOverlay/Android.bp
  packages/overlays/DisplayCutoutEmulationCornerOverlay/Android.bp
  packages/overlays/DisplayCutoutEmulationDoubleOverlay/Android.bp
  packages/overlays/DisplayCutoutEmulationHoleOverlay/Android.bp
  packages/overlays/DisplayCutoutEmulationNarrowOverlay/Android.bp
  packages/overlays/DisplayCutoutEmulationTallOverlay/Android.bp
  packages/overlays/DisplayCutoutEmulationWaterfallOverlay/Android.bp
  packages/overlays/DisplayCutoutEmulationWideOverlay/Android.bp
  packages/overlays/FontNotoSerifSourceOverlay/Android.bp
  packages/overlays/IconPackCircularAndroidOverlay/Android.bp
  packages/overlays/IconPackCircularLauncherOverlay/Android.bp
  packages/overlays/IconPackCircularSettingsOverlay/Android.bp
  packages/overlays/IconPackCircularSystemUIOverlay/Android.bp
  packages/overlays/IconPackCircularThemePickerOverlay/Android.bp
  packages/overlays/IconPackFilledAndroidOverlay/Android.bp
  packages/overlays/IconPackFilledLauncherOverlay/Android.bp
  packages/overlays/IconPackFilledSettingsOverlay/Android.bp
  packages/overlays/IconPackFilledSystemUIOverlay/Android.bp
  packages/overlays/IconPackFilledThemePickerOverlay/Android.bp
  packages/overlays/IconPackKaiAndroidOverlay/Android.bp
  packages/overlays/IconPackKaiLauncherOverlay/Android.bp
  packages/overlays/IconPackKaiSettingsOverlay/Android.bp
  packages/overlays/IconPackKaiSystemUIOverlay/Android.bp
  packages/overlays/IconPackKaiThemePickerOverlay/Android.bp
  packages/overlays/IconPackRoundedAndroidOverlay/Android.bp
  packages/overlays/IconPackRoundedLauncherOverlay/Android.bp
  packages/overlays/IconPackRoundedSettingsOverlay/Android.bp
  packages/overlays/IconPackRoundedSystemUIOverlay/Android.bp
  packages/overlays/IconPackRoundedThemePickerOverlay/Android.bp
  packages/overlays/IconPackSamAndroidOverlay/Android.bp
  packages/overlays/IconPackSamLauncherOverlay/Android.bp
  packages/overlays/IconPackSamSettingsOverlay/Android.bp
  packages/overlays/IconPackSamSystemUIOverlay/Android.bp
  packages/overlays/IconPackSamThemePickerOverlay/Android.bp
  packages/overlays/IconPackVictorAndroidOverlay/Android.bp
  packages/overlays/IconPackVictorLauncherOverlay/Android.bp
  packages/overlays/IconPackVictorSettingsOverlay/Android.bp
  packages/overlays/IconPackVictorSystemUIOverlay/Android.bp
  packages/overlays/IconPackVictorThemePickerOverlay/Android.bp
  packages/overlays/IconShapeHeartOverlay/Android.bp
  packages/overlays/IconShapePebbleOverlay/Android.bp
  packages/overlays/IconShapeRoundedRectOverlay/Android.bp
  packages/overlays/IconShapeSquareOverlay/Android.bp
  packages/overlays/IconShapeSquircleOverlay/Android.bp
  packages/overlays/IconShapeTaperedRectOverlay/Android.bp
  packages/overlays/IconShapeTeardropOverlay/Android.bp
  packages/overlays/IconShapeVesselOverlay/Android.bp
  packages/overlays/NavigationBarMode2ButtonOverlay/Android.bp
  packages/overlays/NavigationBarMode3ButtonOverlay/Android.bp
  packages/overlays/NavigationBarModeGesturalOverlay/Android.bp
  packages/overlays/NavigationBarModeGesturalOverlayExtraWideBack/Android.bp
  packages/overlays/NavigationBarModeGesturalOverlayNarrowBack/Android.bp
  packages/overlays/NavigationBarModeGesturalOverlayWideBack/Android.bp
  packages/overlays/OneHandedModeGesturalOverlay/Android.bp
  packages/services/CameraExtensionsProxy/Android.bp
  services/core/java/com/android/server/speech/Android.bp
  services/musicrecognition/Android.bp
  services/searchui/Android.bp
  services/smartspace/Android.bp
  services/tests/PackageManagerServiceTests/host/libs/IntentVerifyUtils/Android.bp
  services/tests/PackageManagerServiceTests/host/test-apps/DeviceSide/Android.bp
  services/tests/PackageManagerServiceTests/host/test-apps/IntentVerifier/Android.bp
  services/tests/PackageManagerServiceTests/host/test-apps/IntentVerifierTarget/Android.bp
  services/tests/PackageManagerServiceTests/host/test-apps/UsesStaticLibrary/Android.bp
  services/tests/PackageManagerServiceTests/unit/Android.bp
  services/tests/inprocesstests/Android.bp
  services/tests/mockingservicestests/jni/Android.bp
  services/tests/servicestests/test-apps/PackageParsingTestManifests/Android.bp
  services/texttospeech/Android.bp
  services/translation/Android.bp
  tests/BatteryStatsPerfTest/Android.bp
  tests/FlickerTests/test-apps/Android.bp
  tests/Input/Android.bp
  tests/SilkFX/Android.bp
  tests/SurfaceViewBufferTests/Android.bp
  tests/UpdatableSystemFontTest/Android.bp
  tests/UpdatableSystemFontTest/testdata/Android.bp
  tests/benchmarks/internal/Android.bp
  tools/powerstats/Android.bp
  tools/processors/intdef_mappings/Android.bp
  tools/xmlpersistence/Android.bp

Bug: 68860345
Bug: 151177513
Bug: 151953481

Test: m all

Exempt-From-Owner-Approval: janitorial work
Change-Id: I1b8d155a26a1a589a38abedea5f7f366e00346c6
2021-02-23 13:18:34 -08: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
736cf72fd3 Merge "Update framework from jetpack." into sc-dev 2021-02-23 20:23:25 +00:00
Mathew Inwood
d7bbb7a190 Set updatable:false explicity.
This is currently the default value but this is changing.

Bug: 180375550
Test: Treehugger
Change-Id: Ibf0523c03c3559f78f8e9f191e0487237ae44564
2021-02-23 15:13:51 +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
Cassie Wang
e1d191c86b Check schemas using getSchema in VisibilityStore.
This switches away from the package-private hasSchemaTypeLocked method
that is only package-private because VisibilityStore uses it. Instead,
use the publicly-supported getSchema API. Using getSchema will be less
efficient than hasSchemaTypeLocked, but it should only be called once
during initialization so it won't be reoccuring.

The change to remove hasSchemaTypeLocked from AppSearchImpl will be
made upstream in go/ag/13556686

Bug: 180058203
Test: presubmit
Change-Id: I2bafb8243bb15f321633eae5ed37676201e98c84
2021-02-12 11:16:31 -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
796efb8dcb Merge "Replace @code with @link for setSchema." into sc-dev 2021-02-12 15:48:42 +00:00
Cassie Wang
0d80bdbd54 Merge "Fix locking issues." into sc-dev 2021-02-12 15:48:28 +00: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
Cassie Wang
446c9e63a6 Fix locking issues.
* Synchronize access to unlocked user cache. The cache will be checked
for each API call. Add synchronization blocks when reading/writing to
it.
* Synchronize and remove double locking for access to static array of
AppSearchImpl instances.

Bug: 179406838
Test: atest -m -c --rebuild-module-info CtsAppSearchTestCases
FrameworksCoreTests: android.app.appsearch
FrameworksServicesTests: com.android.server.appsearch
Change-Id: Ibaf0d6ff07b4e2f15f3479ff56e143a34ce453e3
2021-02-11 14:30:59 -08:00
Cassie Wang
c124c17061 Merge "Remove a placeholder uri." into sc-dev 2021-02-11 22:08:03 +00:00
Cassie Wang
b2cd677e81 Merge "Fix package access bug." into sc-dev 2021-02-10 23:12:43 +00:00
Cassie Wang
ee27e2960a Remove a placeholder uri.
IcingSearchEngine used to enforce that nested documents had to have a
non-empty uri. This decision was relaxed to allow for empty uris
upstream already. Remove the "placeholder" that we used to temporarily
work around this. This shouldn't affect any visibility settings for
clients since we don't actually retrieve or check what the nested
document's uri is.

Bug: 169883602
Test: presubmit
Change-Id: Ia99d5500801ca275242814bbe8086591267e8d89
2021-02-10 10:03:44 -08:00
Cassie Wang
446067c743 Fix package access bug.
Bug where we weren't passing the PackageIdentifiers from the
SetSchemaRequest properly.

Bug: 179416188
Test: atest -m -c --rebuild-module-info CtsAppSearchTestCases
Change-Id: Ie51a27a728ae7a2f25960ab47ee4054a56ed6abe
2021-02-09 12:01:55 -08:00
Alexander Dorokhine
ce069c5e0e Merge "Update framework from Jetpack." into sc-dev 2021-02-09 19:02:51 +00:00
Cassie Wang
6f200eb94f Merge "Require unlocked user for AppSearchImpl." into sc-dev 2021-02-09 16:20:21 +00:00