Merge "Make location history package not disableable."

This commit is contained in:
TreeHugger Robot
2018-12-15 05:10:30 +00:00
committed by Android (Google) Code Review
2 changed files with 23 additions and 3 deletions

View File

@@ -25,6 +25,7 @@ import android.content.pm.IPackageManager;
import android.content.pm.PackageManager;
import android.content.pm.ResolveInfo;
import android.content.pm.UserInfo;
import android.location.LocationManager;
import android.os.RemoteException;
import android.os.UserManager;
import android.telecom.DefaultDialerManager;
@@ -142,6 +143,12 @@ public class ApplicationFeatureProviderImpl implements ApplicationFeatureProvide
// Keep Settings intelligence enabled, otherwise search feature will be disabled.
keepEnabledPackages.add(
mContext.getString(R.string.config_settingsintelligence_package_name));
final LocationManager locationManager =
(LocationManager) mContext.getSystemService(Context.LOCATION_SERVICE);
final String locationHistoryPackage = locationManager.getLocationControllerExtraPackage();
if (locationHistoryPackage != null) {
keepEnabledPackages.add(locationHistoryPackage);
}
return keepEnabledPackages;
}