am 20de160c: Revert "Changes to support updating location providers."
* commit '20de160ca32a8f2936a80ffd70551a22e2371d25': Revert "Changes to support updating location providers."
This commit is contained in:
@@ -636,12 +636,19 @@
|
|||||||
of new location providers at run-time. The new package does not
|
of new location providers at run-time. The new package does not
|
||||||
have to be explicitly listed here, however it must have a signature
|
have to be explicitly listed here, however it must have a signature
|
||||||
that matches the signature of at least one package on this list.
|
that matches the signature of at least one package on this list.
|
||||||
|
Platforms should overlay additional packages in
|
||||||
|
config_overlay_locationProviderPackageNames, instead of overlaying
|
||||||
|
this config, if they only want to append packages and not replace
|
||||||
|
the entire array.
|
||||||
-->
|
-->
|
||||||
<string-array name="config_locationProviderPackageNames" translatable="false">
|
<string-array name="config_locationProviderPackageNames" translatable="false">
|
||||||
<!-- The standard AOSP fused location provider -->
|
|
||||||
<item>com.android.location.fused</item>
|
<item>com.android.location.fused</item>
|
||||||
</string-array>
|
</string-array>
|
||||||
|
|
||||||
|
<!-- Pacakge name(s) supplied by overlay, and appended to
|
||||||
|
config_locationProviderPackageNames. -->
|
||||||
|
<string-array name="config_overlay_locationProviderPackageNames" translatable="false" />
|
||||||
|
|
||||||
<!-- Boolean indicating if current platform supports bluetooth SCO for off call
|
<!-- Boolean indicating if current platform supports bluetooth SCO for off call
|
||||||
use cases -->
|
use cases -->
|
||||||
<bool name="config_bluetooth_sco_off_call">true</bool>
|
<bool name="config_bluetooth_sco_off_call">true</bool>
|
||||||
|
|||||||
@@ -1467,6 +1467,7 @@
|
|||||||
<java-symbol type="array" name="radioAttributes" />
|
<java-symbol type="array" name="radioAttributes" />
|
||||||
<java-symbol type="array" name="config_oemUsbModeOverride" />
|
<java-symbol type="array" name="config_oemUsbModeOverride" />
|
||||||
<java-symbol type="array" name="config_locationProviderPackageNames" />
|
<java-symbol type="array" name="config_locationProviderPackageNames" />
|
||||||
|
<java-symbol type="array" name="config_overlay_locationProviderPackageNames" />
|
||||||
<java-symbol type="bool" name="config_animateScreenLights" />
|
<java-symbol type="bool" name="config_animateScreenLights" />
|
||||||
<java-symbol type="bool" name="config_automatic_brightness_available" />
|
<java-symbol type="bool" name="config_automatic_brightness_available" />
|
||||||
<java-symbol type="bool" name="config_sf_limitedAlpha" />
|
<java-symbol type="bool" name="config_sf_limitedAlpha" />
|
||||||
|
|||||||
@@ -39,7 +39,7 @@
|
|||||||
<intent-filter>
|
<intent-filter>
|
||||||
<action android:name="com.android.location.service.FusedLocationProvider" />
|
<action android:name="com.android.location.service.FusedLocationProvider" />
|
||||||
</intent-filter>
|
</intent-filter>
|
||||||
<meta-data android:name="serviceVersion" android:value="1" />
|
<meta-data android:name="version" android:value="1" />
|
||||||
</service>
|
</service>
|
||||||
</application>
|
</application>
|
||||||
</manifest>
|
</manifest>
|
||||||
|
|||||||
@@ -247,7 +247,7 @@ public class FusionEngine implements LocationListener {
|
|||||||
mNetworkWeight /= totalWeight;
|
mNetworkWeight /= totalWeight;
|
||||||
mGpsWeight /= totalWeight;
|
mGpsWeight /= totalWeight;
|
||||||
|
|
||||||
Location fused = new Location(/* LocationManager.FUSED_PROVIDER */ "fused");
|
Location fused = new Location(LocationManager.FUSED_PROVIDER);
|
||||||
// fuse lat/long
|
// fuse lat/long
|
||||||
// assumes the two locations are close enough that earth curvature doesn't matter
|
// assumes the two locations are close enough that earth curvature doesn't matter
|
||||||
fused.setLatitude(weigh(mGpsLocation.getLatitude(), mNetworkLocation.getLatitude()));
|
fused.setLatitude(weigh(mGpsLocation.getLatitude(), mNetworkLocation.getLatitude()));
|
||||||
@@ -303,12 +303,7 @@ public class FusionEngine implements LocationListener {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mNetworkLocation != null) {
|
if (mNetworkLocation != null) {
|
||||||
// Manually set the extras for the "no gps" location, pointing at the NLP
|
fused.setExtraLocation(Location.EXTRA_NO_GPS_LOCATION, mNetworkLocation);
|
||||||
Bundle extras = new Bundle();
|
|
||||||
extras.putParcelable("noGPSLocation", mNetworkLocation);
|
|
||||||
fused.setExtras(extras);
|
|
||||||
// Done inline above to compile against SDK 17
|
|
||||||
//fused.setExtraLocation(Location.EXTRA_NO_GPS_LOCATION, mNetworkLocation);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
mFusedLocation = fused;
|
mFusedLocation = fused;
|
||||||
|
|||||||
@@ -275,10 +275,14 @@ public class LocationManagerService extends ILocationManager.Stub implements Run
|
|||||||
*/
|
*/
|
||||||
Resources resources = mContext.getResources();
|
Resources resources = mContext.getResources();
|
||||||
ArrayList<String> providerPackageNames = new ArrayList<String>();
|
ArrayList<String> providerPackageNames = new ArrayList<String>();
|
||||||
String[] pkgs = resources.getStringArray(
|
String[] pkgs1 = resources.getStringArray(
|
||||||
com.android.internal.R.array.config_locationProviderPackageNames);
|
com.android.internal.R.array.config_locationProviderPackageNames);
|
||||||
if (D) Log.d(TAG, "built-in location providers: " + Arrays.toString(pkgs));
|
String[] pkgs2 = resources.getStringArray(
|
||||||
if (pkgs != null) providerPackageNames.addAll(Arrays.asList(pkgs));
|
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));
|
||||||
|
|
||||||
// bind to network provider
|
// bind to network provider
|
||||||
LocationProviderProxy networkProvider = LocationProviderProxy.createAndBind(
|
LocationProviderProxy networkProvider = LocationProviderProxy.createAndBind(
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class ServiceWatcher implements ServiceConnection {
|
public class ServiceWatcher implements ServiceConnection {
|
||||||
private static final boolean D = false;
|
private static final boolean D = false;
|
||||||
private static final String EXTRA_SERVICE_VERSION = "serviceVersion";
|
private static final String EXTRA_VERSION = "version";
|
||||||
|
|
||||||
private final String mTag;
|
private final String mTag;
|
||||||
private final Context mContext;
|
private final Context mContext;
|
||||||
@@ -127,7 +127,7 @@ public class ServiceWatcher implements ServiceConnection {
|
|||||||
// check version
|
// check version
|
||||||
int version = 0;
|
int version = 0;
|
||||||
if (rInfo.serviceInfo.metaData != null) {
|
if (rInfo.serviceInfo.metaData != null) {
|
||||||
version = rInfo.serviceInfo.metaData.getInt(EXTRA_SERVICE_VERSION, 0);
|
version = rInfo.serviceInfo.metaData.getInt(EXTRA_VERSION, 0);
|
||||||
}
|
}
|
||||||
if (version > mVersion) {
|
if (version > mVersion) {
|
||||||
bestVersion = version;
|
bestVersion = version;
|
||||||
|
|||||||
Reference in New Issue
Block a user