File tree Expand file tree Collapse file tree 6 files changed +21
-14
lines changed
src/com/android/location/fused
services/java/com/android/server Expand file tree Collapse file tree 6 files changed +21
-14
lines changed Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff line change 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" />
Original file line number Diff line number Diff line change 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 >
Original file line number Diff line number Diff 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 ;
Original file line number Diff line number Diff 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 (
Original file line number Diff line number Diff line change 4242 */
4343public 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 ;
You can’t perform that action at this time.
0 commit comments