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

Commit b2cd677e authored by Cassie Wang's avatar Cassie Wang Committed by Android (Google) Code Review
Browse files

Merge "Fix package access bug." into sc-dev

parents c74bee91 446067c7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -108,7 +108,7 @@ public class AppSearchManagerService extends SystemService {
                        schemasPackageAccessibleBundles.entrySet()) {
                    List<PackageIdentifier> packageIdentifiers =
                            new ArrayList<>(entry.getValue().size());
                    for (int i = 0; i < packageIdentifiers.size(); i++) {
                    for (int i = 0; i < entry.getValue().size(); i++) {
                        packageIdentifiers.add(new PackageIdentifier(entry.getValue().get(i)));
                    }
                    schemasPackageAccessible.put(entry.getKey(), packageIdentifiers);
+1 −1
Original line number Diff line number Diff line
@@ -317,7 +317,7 @@ public final class AppSearchImpl {
            }

            Map<String, List<PackageIdentifier>> prefixedSchemasPackageAccessible =
                    new ArrayMap<>(schemasNotPlatformSurfaceable.size());
                    new ArrayMap<>(schemasPackageAccessible.size());
            for (Map.Entry<String, List<PackageIdentifier>> entry :
                    schemasPackageAccessible.entrySet()) {
                prefixedSchemasPackageAccessible.put(prefix + entry.getKey(), entry.getValue());
+10 −4
Original line number Diff line number Diff line
@@ -37,8 +37,9 @@ import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * This test class adapts the AppSearch Framework API to ListenableFuture, so it can be tested via
 * a consistent interface.
 * This test class adapts the AppSearch Framework API to ListenableFuture, so it can be tested via a
 * consistent interface.
 *
 * @hide
 */
public class GlobalSearchSessionShimImpl implements GlobalSearchSessionShim {
@@ -47,7 +48,13 @@ public class GlobalSearchSessionShimImpl implements GlobalSearchSessionShim {

    @NonNull
    public static ListenableFuture<GlobalSearchSessionShim> createGlobalSearchSession() {
        Context context = ApplicationProvider.getApplicationContext();
        return createGlobalSearchSession(ApplicationProvider.getApplicationContext());
    }

    /** Only for use when called from a non-instrumented context. */
    @NonNull
    public static ListenableFuture<GlobalSearchSessionShim> createGlobalSearchSession(
            @NonNull Context context) {
        AppSearchManager appSearchManager = context.getSystemService(AppSearchManager.class);
        SettableFuture<AppSearchResult<GlobalSearchSession>> future = SettableFuture.create();
        ExecutorService executor = Executors.newCachedThreadPool();
@@ -62,7 +69,6 @@ public class GlobalSearchSessionShimImpl implements GlobalSearchSessionShim {
            @NonNull GlobalSearchSession session, @NonNull ExecutorService executor) {
        mGlobalSearchSession = Preconditions.checkNotNull(session);
        mExecutor = Preconditions.checkNotNull(executor);

    }

    @NonNull