Merge "Lock ComponentResolver when taking snapshot" into tm-dev
This commit is contained in:
committed by
Android (Google) Code Review
commit
715b58c274
@@ -79,7 +79,8 @@ import java.util.Set;
|
|||||||
import java.util.function.Function;
|
import java.util.function.Function;
|
||||||
|
|
||||||
/** Resolves all Android component types [activities, services, providers and receivers]. */
|
/** Resolves all Android component types [activities, services, providers and receivers]. */
|
||||||
public class ComponentResolver extends ComponentResolverLocked implements Snappable {
|
public class ComponentResolver extends ComponentResolverLocked implements
|
||||||
|
Snappable<ComponentResolverApi> {
|
||||||
private static final boolean DEBUG = false;
|
private static final boolean DEBUG = false;
|
||||||
private static final String TAG = "PackageManager";
|
private static final String TAG = "PackageManager";
|
||||||
private static final boolean DEBUG_FILTERS = false;
|
private static final boolean DEBUG_FILTERS = false;
|
||||||
@@ -166,11 +167,13 @@ public class ComponentResolver extends ComponentResolverLocked implements Snappa
|
|||||||
mProvidersByAuthority = new ArrayMap<>();
|
mProvidersByAuthority = new ArrayMap<>();
|
||||||
mDeferProtectedFilters = true;
|
mDeferProtectedFilters = true;
|
||||||
|
|
||||||
mSnapshot = new SnapshotCache<ComponentResolverApi>(this, this) {
|
mSnapshot = new SnapshotCache<>(this, this) {
|
||||||
@Override
|
@Override
|
||||||
public ComponentResolverApi createSnapshot() {
|
public ComponentResolverApi createSnapshot() {
|
||||||
|
synchronized (mLock) {
|
||||||
return new ComponentResolverSnapshot(ComponentResolver.this,
|
return new ComponentResolverSnapshot(ComponentResolver.this,
|
||||||
userNeedsBadgingCache);
|
userNeedsBadgingCache);
|
||||||
|
}
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user