Skip to content

Commit 20de160

Browse files
committed
Revert "Changes to support updating location providers."
This reverts commit c19efc2.
1 parent d21b483 commit 20de160

File tree

6 files changed

+21
-14
lines changed

6 files changed

+21
-14
lines changed

core/res/res/values/config.xml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -636,12 +636,19 @@
636636
of new location providers at run-time. The new package does not
637637
have to be explicitly listed here, however it must have a signature
638638
that matches the signature of at least one package on this list.
639+
Platforms should overlay additional packages in
640+
config_overlay_locationProviderPackageNames, instead of overlaying
641+
this config, if they only want to append packages and not replace
642+
the entire array.
639643
-->
640644
<string-array name="config_locationProviderPackageNames" translatable="false">
641-
<!-- The standard AOSP fused location provider -->
642645
<item>com.android.location.fused</item>
643646
</string-array>
644647

648+
<!-- Pacakge name(s) supplied by overlay, and appended to
649+
config_locationProviderPackageNames. -->
650+
<string-array name="config_overlay_locationProviderPackageNames" translatable="false" />
651+
645652
<!-- Boolean indicating if current platform supports bluetooth SCO for off call
646653
use cases -->
647654
<bool name="config_bluetooth_sco_off_call">true</bool>

core/res/res/values/symbols.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1467,6 +1467,7 @@
14671467
<java-symbol type="array" name="radioAttributes" />
14681468
<java-symbol type="array" name="config_oemUsbModeOverride" />
14691469
<java-symbol type="array" name="config_locationProviderPackageNames" />
1470+
<java-symbol type="array" name="config_overlay_locationProviderPackageNames" />
14701471
<java-symbol type="bool" name="config_animateScreenLights" />
14711472
<java-symbol type="bool" name="config_automatic_brightness_available" />
14721473
<java-symbol type="bool" name="config_sf_limitedAlpha" />

packages/FusedLocation/AndroidManifest.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
<intent-filter>
4040
<action android:name="com.android.location.service.FusedLocationProvider" />
4141
</intent-filter>
42-
<meta-data android:name="serviceVersion" android:value="1" />
42+
<meta-data android:name="version" android:value="1" />
4343
</service>
4444
</application>
4545
</manifest>

packages/FusedLocation/src/com/android/location/fused/FusionEngine.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ private void updateFusedLocation() {
247247
mNetworkWeight /= totalWeight;
248248
mGpsWeight /= totalWeight;
249249

250-
Location fused = new Location(/* LocationManager.FUSED_PROVIDER */ "fused");
250+
Location fused = new Location(LocationManager.FUSED_PROVIDER);
251251
// fuse lat/long
252252
// assumes the two locations are close enough that earth curvature doesn't matter
253253
fused.setLatitude(weigh(mGpsLocation.getLatitude(), mNetworkLocation.getLatitude()));
@@ -303,12 +303,7 @@ private void updateFusedLocation() {
303303
}
304304

305305
if (mNetworkLocation != null) {
306-
// Manually set the extras for the "no gps" location, pointing at the NLP
307-
Bundle extras = new Bundle();
308-
extras.putParcelable("noGPSLocation", mNetworkLocation);
309-
fused.setExtras(extras);
310-
// Done inline above to compile against SDK 17
311-
//fused.setExtraLocation(Location.EXTRA_NO_GPS_LOCATION, mNetworkLocation);
306+
fused.setExtraLocation(Location.EXTRA_NO_GPS_LOCATION, mNetworkLocation);
312307
}
313308

314309
mFusedLocation = fused;

services/java/com/android/server/LocationManagerService.java

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,14 @@ Load package name(s) containing location provider support.
275275
*/
276276
Resources resources = mContext.getResources();
277277
ArrayList<String> providerPackageNames = new ArrayList<String>();
278-
String[] pkgs = resources.getStringArray(
278+
String[] pkgs1 = resources.getStringArray(
279279
com.android.internal.R.array.config_locationProviderPackageNames);
280-
if (D) Log.d(TAG, "built-in location providers: " + Arrays.toString(pkgs));
281-
if (pkgs != null) providerPackageNames.addAll(Arrays.asList(pkgs));
280+
String[] pkgs2 = resources.getStringArray(
281+
com.android.internal.R.array.config_overlay_locationProviderPackageNames);
282+
if (D) Log.d(TAG, "built-in location providers: " + Arrays.toString(pkgs1));
283+
if (D) Log.d(TAG, "overlay location providers: " + Arrays.toString(pkgs2));
284+
if (pkgs1 != null) providerPackageNames.addAll(Arrays.asList(pkgs1));
285+
if (pkgs2 != null) providerPackageNames.addAll(Arrays.asList(pkgs2));
282286

283287
// bind to network provider
284288
LocationProviderProxy networkProvider = LocationProviderProxy.createAndBind(

services/java/com/android/server/ServiceWatcher.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
*/
4343
public class ServiceWatcher implements ServiceConnection {
4444
private static final boolean D = false;
45-
private static final String EXTRA_SERVICE_VERSION = "serviceVersion";
45+
private static final String EXTRA_VERSION = "version";
4646

4747
private final String mTag;
4848
private final Context mContext;
@@ -127,7 +127,7 @@ private boolean bindBestPackage(String justCheckThisPackage) {
127127
// check version
128128
int version = 0;
129129
if (rInfo.serviceInfo.metaData != null) {
130-
version = rInfo.serviceInfo.metaData.getInt(EXTRA_SERVICE_VERSION, 0);
130+
version = rInfo.serviceInfo.metaData.getInt(EXTRA_VERSION, 0);
131131
}
132132
if (version > mVersion) {
133133
bestVersion = version;

0 commit comments

Comments
 (0)