Merge "Disallow Package Installer to be disabled"
This commit is contained in:
committed by
Android (Google) Code Review
commit
b2852a41cb
@@ -140,9 +140,9 @@ public class ApplicationFeatureProviderImpl implements ApplicationFeatureProvide
|
||||
if (defaultSms != null) {
|
||||
keepEnabledPackages.add(defaultSms.getPackageName());
|
||||
}
|
||||
// Keep Settings intelligence enabled, otherwise search feature will be disabled.
|
||||
keepEnabledPackages.add(
|
||||
mContext.getString(R.string.config_settingsintelligence_package_name));
|
||||
|
||||
keepEnabledPackages.addAll(getEnabledPackageWhitelist());
|
||||
|
||||
final LocationManager locationManager =
|
||||
(LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
|
||||
final String locationHistoryPackage = locationManager.getExtraLocationControllerPackage();
|
||||
@@ -152,6 +152,19 @@ public class ApplicationFeatureProviderImpl implements ApplicationFeatureProvide
|
||||
return keepEnabledPackages;
|
||||
}
|
||||
|
||||
private Set<String> getEnabledPackageWhitelist() {
|
||||
final Set<String> keepEnabledPackages = new ArraySet<>();
|
||||
|
||||
// Keep Settings intelligence enabled, otherwise search feature will be disabled.
|
||||
keepEnabledPackages.add(
|
||||
mContext.getString(R.string.config_settingsintelligence_package_name));
|
||||
|
||||
// Keep Package Installer enabled.
|
||||
keepEnabledPackages.add(mContext.getString(R.string.config_package_installer_package_name));
|
||||
|
||||
return keepEnabledPackages;
|
||||
}
|
||||
|
||||
private static class CurrentUserAndManagedProfilePolicyInstalledAppCounter
|
||||
extends InstalledAppCounter {
|
||||
private NumberOfAppsCallback mCallback;
|
||||
@@ -219,5 +232,4 @@ public class ApplicationFeatureProviderImpl implements ApplicationFeatureProvide
|
||||
mCallback.onListOfAppsResult(list);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user