Merge "Revert "Get compatibility immediately on initialization""
This commit is contained in:
committed by
Android (Google) Code Review
commit
c375c6b0cd
@@ -41,7 +41,6 @@ import android.util.SparseArray;
|
||||
import com.android.internal.R;
|
||||
import com.android.internal.annotations.VisibleForTesting;
|
||||
import com.android.server.FgThread;
|
||||
import com.android.server.compat.CompatConfig;
|
||||
|
||||
import java.io.PrintWriter;
|
||||
import java.util.ArrayList;
|
||||
@@ -131,11 +130,11 @@ public class AppsFilter {
|
||||
|
||||
private static class FeatureConfigImpl implements FeatureConfig {
|
||||
private static final String FILTERING_ENABLED_NAME = "package_query_filtering_enabled";
|
||||
private final PackageManagerService.Injector mInjector;
|
||||
private volatile boolean mFeatureEnabled = false;
|
||||
private CompatConfig mCompatibility;
|
||||
|
||||
private FeatureConfigImpl(PackageManagerService.Injector injector) {
|
||||
mCompatibility = injector.getCompatibility();
|
||||
mInjector = injector;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -158,7 +157,7 @@ public class AppsFilter {
|
||||
|
||||
@Override
|
||||
public boolean packageIsEnabled(PackageParser.Package pkg) {
|
||||
return mCompatibility.isChangeEnabled(
|
||||
return mInjector.getCompatibility().isChangeEnabled(
|
||||
PackageManager.FILTER_APPLICATION_QUERY, pkg.applicationInfo);
|
||||
}
|
||||
}
|
||||
@@ -263,10 +262,10 @@ public class AppsFilter {
|
||||
* Grants access based on an interaction between a calling and target package, granting
|
||||
* visibility of the caller from the target.
|
||||
*
|
||||
* @param callingPackage the package initiating the interaction
|
||||
* @param targetPackage the package being interacted with and thus gaining visibility of the
|
||||
* initiating package.
|
||||
* @param userId the user in which this interaction was taking place
|
||||
* @param callingPackage the package initiating the interaction
|
||||
* @param targetPackage the package being interacted with and thus gaining visibility of the
|
||||
* initiating package.
|
||||
* @param userId the user in which this interaction was taking place
|
||||
*/
|
||||
public void grantImplicitAccess(
|
||||
String callingPackage, String targetPackage, int userId) {
|
||||
|
||||
@@ -299,7 +299,7 @@ import com.android.server.ServiceThread;
|
||||
import com.android.server.SystemConfig;
|
||||
import com.android.server.SystemServerInitThreadPool;
|
||||
import com.android.server.Watchdog;
|
||||
import com.android.server.compat.CompatConfig;
|
||||
import com.android.server.compat.PlatformCompat;
|
||||
import com.android.server.net.NetworkPolicyManagerInternal;
|
||||
import com.android.server.pm.Installer.InstallerException;
|
||||
import com.android.server.pm.Settings.DatabaseVersion;
|
||||
@@ -837,7 +837,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
private final Singleton<StorageManager> mStorageManagerProducer;
|
||||
private final Singleton<AppOpsManager> mAppOpsManagerProducer;
|
||||
private final Singleton<AppsFilter> mAppsFilterProducer;
|
||||
private final Singleton<CompatConfig> mPlatformCompatProducer;
|
||||
private final Singleton<PlatformCompat> mPlatformCompatProducer;
|
||||
|
||||
Injector(Context context, Object lock, Installer installer,
|
||||
Object installLock, PackageAbiHelper abiHelper,
|
||||
@@ -855,7 +855,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
Producer<StorageManager> storageManagerProducer,
|
||||
Producer<AppOpsManager> appOpsManagerProducer,
|
||||
Producer<AppsFilter> appsFilterProducer,
|
||||
Producer<CompatConfig> platformCompatProducer) {
|
||||
Producer<PlatformCompat> platformCompatProducer) {
|
||||
mContext = context;
|
||||
mLock = lock;
|
||||
mInstaller = installer;
|
||||
@@ -966,7 +966,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
return mAppsFilterProducer.get(this, mPackageManager);
|
||||
}
|
||||
|
||||
public CompatConfig getCompatibility() {
|
||||
public PlatformCompat getCompatibility() {
|
||||
return mPlatformCompatProducer.get(this, mPackageManager);
|
||||
}
|
||||
}
|
||||
@@ -2356,7 +2356,7 @@ public class PackageManagerService extends IPackageManager.Stub
|
||||
new Injector.SystemServiceProducer<>(StorageManager.class),
|
||||
new Injector.SystemServiceProducer<>(AppOpsManager.class),
|
||||
(i, pm) -> AppsFilter.create(i),
|
||||
(i, pm) -> CompatConfig.get());
|
||||
(i, pm) -> (PlatformCompat) ServiceManager.getService("platform_compat"));
|
||||
|
||||
PackageManagerService m = new PackageManagerService(injector, factoryTest, onlyCore);
|
||||
t.traceEnd(); // "create package manager"
|
||||
|
||||
Reference in New Issue
Block a user