Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b10fd7d0 authored by Tim Barron's avatar Tim Barron
Browse files

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
parent 05f4f582
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);