Merge "Fix package access bug." into sc-dev
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user