Changes to support updating location providers.
There is now only a single config value pointing at a list of packages to get certs from. The old system was a bit confusing. The fused location provider also now builds against SDK 17, and the meta data service version tag was renamed from the overly generic "version" to "serviceVersion". Bug: 7242814 Change-Id: I00d27c9cbd5cc31a37bb4a98160435d15a72e19e
This commit is contained in:
@@ -275,14 +275,10 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
|
||||
*/
|
||||
Resources resources = mContext.getResources();
|
||||
ArrayList<String> providerPackageNames = new ArrayList<String>();
|
||||
String[] pkgs1 = resources.getStringArray(
|
||||
String[] pkgs = resources.getStringArray(
|
||||
com.android.internal.R.array.config_locationProviderPackageNames);
|
||||
String[] pkgs2 = resources.getStringArray(
|
||||
com.android.internal.R.array.config_overlay_locationProviderPackageNames);
|
||||
if (D) Log.d(TAG, "built-in location providers: " + Arrays.toString(pkgs1));
|
||||
if (D) Log.d(TAG, "overlay location providers: " + Arrays.toString(pkgs2));
|
||||
if (pkgs1 != null) providerPackageNames.addAll(Arrays.asList(pkgs1));
|
||||
if (pkgs2 != null) providerPackageNames.addAll(Arrays.asList(pkgs2));
|
||||
if (D) Log.d(TAG, "built-in location providers: " + Arrays.toString(pkgs));
|
||||
if (pkgs != null) providerPackageNames.addAll(Arrays.asList(pkgs));
|
||||
|
||||
// bind to network provider
|
||||
LocationProviderProxy networkProvider = LocationProviderProxy.createAndBind(
|
||||
|
||||
@@ -42,7 +42,7 @@ import java.util.List;
|
||||
*/
|
||||
public class ServiceWatcher implements ServiceConnection {
|
||||
private static final boolean D = false;
|
||||
private static final String EXTRA_VERSION = "version";
|
||||
private static final String EXTRA_SERVICE_VERSION = "serviceVersion";
|
||||
|
||||
private final String mTag;
|
||||
private final Context mContext;
|
||||
@@ -127,7 +127,7 @@ public class ServiceWatcher implements ServiceConnection {
|
||||
// check version
|
||||
int version = 0;
|
||||
if (rInfo.serviceInfo.metaData != null) {
|
||||
version = rInfo.serviceInfo.metaData.getInt(EXTRA_VERSION, 0);
|
||||
version = rInfo.serviceInfo.metaData.getInt(EXTRA_SERVICE_VERSION, 0);
|
||||
}
|
||||
if (version > mVersion) {
|
||||
bestVersion = version;
|
||||
|
||||
Reference in New Issue
Block a user