Call persistToDisk after indexing VisibilityDoc

In ag/13985751 [e62a4eb007fc0266be6955c837d188a204c11cc2], we added calls to persist LITE after each mutation api
call. However, VisibilityStore also creates a mutation in Icing lib - it
indexes a single VisibilityDoc. We should also call persist LITE after
this so that we can be sure not to lose the VisibilityDoc.

Bug: 180127220
Test: None

Change-Id: Ib8465a3b2f4adb8f4dc4308c3845fcc501f36c0b
This commit is contained in:
Tim Barron
2021-04-28 21:46:02 +00:00
parent 05f4f582b8
commit b10fd7d064

View File

@@ -38,6 +38,8 @@ import android.util.Log;
import com.android.internal.util.Preconditions;
import com.android.server.appsearch.external.localstorage.util.PrefixUtil;
import com.google.android.icing.proto.PersistType;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
@@ -374,6 +376,8 @@ public class VisibilityStore {
mAppSearchImpl.putDocument(
PACKAGE_NAME, DATABASE_NAME, visibilityDocument.build(), /*logger=*/ null);
// Now that the visibility document has been written. Persist the newly written data.
mAppSearchImpl.persistToDisk(PersistType.Code.LITE);
// Update derived data structures.
mNotPlatformSurfaceableMap.put(prefix, schemasNotPlatformSurfaceable);