mapBoxMapVersion:10.14.0
mapBoxSearchVersion:1.0.0-beta.43
Android Java project
When the app starts, I do this by:
searchEngine = SearchEngine.createSearchEngine(new SearchEngineSettings(mAccessToken));
The searchEngine is created, and then the ACC OFF, and the screen is off, and then it is found that the mapbox will request gps information, causing the car to be pulled up again. No search method was used during this period, only the searchEngine object was created.
I tried the plugin to get the mapbox's location when the map was initialized and set his availability to false. At the same time I removed the ACTION_PROCESS_LOCATION_UPDATES broadcast via the locationEngine object, which was found in the manifest file in the introduced dependency package: com.mapbox.common:common:23.6.0@arr. I tried to stop mapbox from getting GPS information in the following ways, and it doesn't work well to open it at the moment.
This issue doesn't occur when I don't execute the createSearchEngine method.
searchEngine = SearchEngine.createSearchEngine(new SearchEngineSettings(mAccessToken));
mapView = new MapView(mContext, mapInitOptions);
locationComponentPlugin = mapView.getPlugin(Plugin.MAPBOX_LOCATION_COMPONENT_PLUGIN_ID);
locationComponentPlugin.setEnabled(false);
LocationEngine locationEngine = LocationEngineProvider.getBestLocationEngine(mContext);
Intent intent = new Intent("com.mapbox.common.location.LocationUpdatesReceiver.ACTION_PROCESS_LOCATION_UPDATES");
PendingIntent pendingIntent = PendingIntent.getActivity(mContext,0,intent,0);
locationEngine.removeLocationUpdates(pendingIntent);
I'm expecting that after I've created the searchEngine object, mapbox won't request location information until a specific search method is executed.Thanks.