Skip to content
Commit f1f376fc authored by Pinyao Ting's avatar Pinyao Ting
Browse files

Shortcut integration with AppSearch (Part 9)

1. Close AppSearchSession after use.

When the device is shutdown with open AppSearchSession, if the data is
not properly persisted to disk, it would lead to a recovery upon reboot,
which could hurt boot performance.

We cannot rely on shutdown signal to close existing session because the
broadcast is not guranteed. Since session creation is light-weight, it
is more performant to simply close the session everytime after use.

2. Refrain from calling setup schema on boot.

To improve the performance of device start up, we want to avoid calling
AppSearchSession#setSchema unnecessarily since it could hurt performance.
In this CL we saved the version of the schema in the xml file which can
serve as an indicator of whether schema setup is required.

Bug: 151359749
Test: atest ShortcutManagerTest1 ShortcutManagerTest2
    ShortcutManagerTest3 ShortcutManagerTest4 ShortcutManagerTest5
    ShortcutManagerTest6 ShortcutManagerTest7 ShortcutManagerTest8
    ShortcutManagerTest9 ShortcutManagerTest10 ShortcutManagerTest11
    ShortcutManagerTest12
Test: atest CtsShortcutManagerTestCases
Change-Id: I2d6b66cef0c152ad99611dec3dee32a473bef4a9
parent ba25bacc
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment