Merge pull request #1 from osmandapp/master

s
This commit is contained in:
verdulo 2020-02-13 00:05:00 +01:00 committed by GitHub
commit 8d840525ca
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3053 changed files with 164819 additions and 65043 deletions

View file

@ -1,14 +0,0 @@
language: android
# Work in progress. Repo should be used for initial checkout https://github.com/osmandapp/OsmAnd-manifest/blob/master/android_build.xml
android:
components:
- tools
- platform-tools
# The BuildTools version used by your project
- build-tools-27.0.3
- android-27
script: ./gradlew test

View file

@ -76,7 +76,6 @@
* 3rd party libraries present in the libs folder (https://github.com/osmandapp/Osmand/tree/master/OsmAnd-java/libs):
- bzip2-20090327.jar Bzip2 - Apache License
- bsh-core-2.0b4.jar Bean Shell - SPL and LGPL (http://www.beanshell.org/license.html)
- commons-logging-1.1.1.jar - Apache License
- gnu-trove-osmand.jar GNU trove - LGPL
- icu4j-49_1.jar - ICU license (http://source.icu-project.org/repos/icu/icu/trunk/license.html)

10
OsmAnd-api/.gitignore vendored Normal file
View file

@ -0,0 +1,10 @@
# Android Studio
*/.idea
*/*.iml
# Gradle
*/.gradle
*/local.properties
# Output files
*/build

View file

@ -0,0 +1 @@
<manifest package="net.osmand.aidlapi" />

41
OsmAnd-api/build.gradle Normal file
View file

@ -0,0 +1,41 @@
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
group = 'com.github.osmandapp.osmand'
version = '2.0.0'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
minSdkVersion 14
targetSdkVersion 26
versionCode 2
versionName "2.0"
}
lintOptions {
abortOnError false
}
sourceSets {
main {
manifest.srcFile "AndroidManifest.xml"
aidl.srcDirs = ["src"]
java.srcDirs = ["src"]
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:support-annotations:27.1.1'
}
task sourcesJar(type: Jar) {
classifier = 'sources'
from android.sourceSets.main.java.srcDirs
}
artifacts {
archives sourcesJar
}

View file

@ -0,0 +1,3 @@
<resources>
<string name="app_name">OsmAnd-api</string>
</resources>

View file

@ -0,0 +1,35 @@
package net.osmand.aidlapi;
import android.os.Bundle;
import android.os.Parcel;
import android.os.Parcelable;
public abstract class AidlParams implements Parcelable {
@Override
public final void writeToParcel(Parcel dest, int flags) {
Bundle bundle = new Bundle();
writeToBundle(bundle);
dest.writeBundle(bundle);
}
public final void readFromParcel(Parcel in) {
Bundle bundle = in.readBundle(getClass().getClassLoader());
if (bundle != null) {
readFromBundle(bundle);
}
}
protected void writeToBundle(Bundle bundle) {
}
protected void readFromBundle(Bundle bundle) {
}
@Override
public int describeContents() {
return 0;
}
}

View file

@ -0,0 +1,54 @@
package net.osmand.aidlapi;
import net.osmand.aidlapi.search.SearchResult;
import net.osmand.aidlapi.gpx.AGpxBitmap;
import net.osmand.aidlapi.navigation.ADirectionInfo;
import net.osmand.aidlapi.navigation.OnVoiceNavigationParams;
interface IOsmAndAidlCallback {
/**
* Callback for search requests.
*
* @return resultSet - set of SearchResult
*/
void onSearchComplete(in List<SearchResult> resultSet);
/**
* Callback for {@link IOsmAndAidlInterface} registerForUpdates() method.
*/
void onUpdate();
/**
* Callback for {@link IOsmAndAidlInterface} registerForOsmandInitListener() method.
*/
void onAppInitialized();
/**
* Callback for {@link IOsmAndAidlInterface} getBitmapForGpx() method.
*
* @return bitmap - snapshot image of gpx track on map
*/
void onGpxBitmapCreated(in AGpxBitmap bitmap);
/**
* Callback for {@link IOsmAndAidlInterface} registerForNavigationUpdates() method.
*
* @return directionInfo - update on distance to next turn and turns type.
*/
void updateNavigationInfo(in ADirectionInfo directionInfo);
/**
* Callback for {@link IOsmAndAidlInterface} buttons set with addContextMenuButtons() method.
*
* @param buttonId - id of custom button
* @param pointId - id of point button associated with
* @param layerId - id of layer point and button associated with
*/
void onContextMenuButtonClicked(in int buttonId, String pointId, String layerId);
/**
* Callback for {@link IOsmAndAidlInterface} registerForVoiceRouterMessages() method.
*/
void onVoiceRouterNotify(in OnVoiceNavigationParams params);
}

View file

@ -0,0 +1,837 @@
package net.osmand.aidlapi;
import net.osmand.aidlapi.map.ALatLon;
import net.osmand.aidlapi.map.SetMapLocationParams;
import net.osmand.aidlapi.favorite.group.AFavoriteGroup;
import net.osmand.aidlapi.favorite.group.AddFavoriteGroupParams;
import net.osmand.aidlapi.favorite.group.RemoveFavoriteGroupParams;
import net.osmand.aidlapi.favorite.group.UpdateFavoriteGroupParams;
import net.osmand.aidlapi.favorite.AFavorite;
import net.osmand.aidlapi.favorite.AddFavoriteParams;
import net.osmand.aidlapi.favorite.RemoveFavoriteParams;
import net.osmand.aidlapi.favorite.UpdateFavoriteParams;
import net.osmand.aidlapi.mapmarker.AMapMarker;
import net.osmand.aidlapi.mapmarker.AddMapMarkerParams;
import net.osmand.aidlapi.mapmarker.RemoveMapMarkerParams;
import net.osmand.aidlapi.mapmarker.UpdateMapMarkerParams;
import net.osmand.aidlapi.calculateroute.CalculateRouteParams;
import net.osmand.aidlapi.gpx.ImportGpxParams;
import net.osmand.aidlapi.gpx.ShowGpxParams;
import net.osmand.aidlapi.gpx.StartGpxRecordingParams;
import net.osmand.aidlapi.gpx.StopGpxRecordingParams;
import net.osmand.aidlapi.gpx.HideGpxParams;
import net.osmand.aidlapi.gpx.ASelectedGpxFile;
import net.osmand.aidlapi.mapwidget.AMapWidget;
import net.osmand.aidlapi.mapwidget.AddMapWidgetParams;
import net.osmand.aidlapi.mapwidget.RemoveMapWidgetParams;
import net.osmand.aidlapi.mapwidget.UpdateMapWidgetParams;
import net.osmand.aidlapi.maplayer.point.AMapPoint;
import net.osmand.aidlapi.maplayer.point.AddMapPointParams;
import net.osmand.aidlapi.maplayer.point.RemoveMapPointParams;
import net.osmand.aidlapi.maplayer.point.UpdateMapPointParams;
import net.osmand.aidlapi.maplayer.AMapLayer;
import net.osmand.aidlapi.maplayer.AddMapLayerParams;
import net.osmand.aidlapi.maplayer.RemoveMapLayerParams;
import net.osmand.aidlapi.maplayer.UpdateMapLayerParams;
import net.osmand.aidlapi.navigation.NavigateParams;
import net.osmand.aidlapi.navigation.NavigateGpxParams;
import net.osmand.aidlapi.note.TakePhotoNoteParams;
import net.osmand.aidlapi.note.StartVideoRecordingParams;
import net.osmand.aidlapi.note.StartAudioRecordingParams;
import net.osmand.aidlapi.note.StopRecordingParams;
import net.osmand.aidlapi.gpx.RemoveGpxParams;
import net.osmand.aidlapi.maplayer.point.ShowMapPointParams;
import net.osmand.aidlapi.navdrawer.SetNavDrawerItemsParams;
import net.osmand.aidlapi.navdrawer.NavDrawerFooterParams;
import net.osmand.aidlapi.navdrawer.NavDrawerHeaderParams;
import net.osmand.aidlapi.navigation.PauseNavigationParams;
import net.osmand.aidlapi.navigation.ResumeNavigationParams;
import net.osmand.aidlapi.navigation.StopNavigationParams;
import net.osmand.aidlapi.navigation.MuteNavigationParams;
import net.osmand.aidlapi.navigation.UnmuteNavigationParams;
import net.osmand.aidlapi.IOsmAndAidlCallback;
import net.osmand.aidlapi.search.SearchResult;
import net.osmand.aidlapi.search.SearchParams;
import net.osmand.aidlapi.navigation.NavigateSearchParams;
import net.osmand.aidlapi.customization.SetWidgetsParams;
import net.osmand.aidlapi.customization.OsmandSettingsParams;
import net.osmand.aidlapi.customization.OsmandSettingsInfoParams;
import net.osmand.aidlapi.customization.CustomizationInfoParams;
import net.osmand.aidlapi.customization.ProfileSettingsParams;
import net.osmand.aidlapi.gpx.AGpxFile;
import net.osmand.aidlapi.gpx.AGpxFileDetails;
import net.osmand.aidlapi.gpx.CreateGpxBitmapParams;
import net.osmand.aidlapi.tiles.ASqliteDbFile;
import net.osmand.aidlapi.plugins.PluginParams;
import net.osmand.aidlapi.copyfile.CopyFileParams;
import net.osmand.aidlapi.navigation.ANavigationUpdateParams;
import net.osmand.aidlapi.navigation.ANavigationVoiceRouterMessageParams;
import net.osmand.aidlapi.contextmenu.ContextMenuButtonsParams;
import net.osmand.aidlapi.contextmenu.UpdateContextMenuButtonsParams;
import net.osmand.aidlapi.contextmenu.RemoveContextMenuButtonsParams;
import net.osmand.aidlapi.mapmarker.RemoveMapMarkersParams;
// NOTE: Add new methods at the end of file!!!
interface IOsmAndAidlInterface {
/**
* Add map marker at given location.
*
* @param lat (double) - latitude.
* @param lon (double) - longitude.
* @param name (String)- name of marker.
*/
boolean addMapMarker(in AddMapMarkerParams params);
/**
* Remove map marker.
*
* If ignoreCoordinates is false the marker is only removed if lat/lon match the currently set values of the marker.
* If ignoreCoordinates is true the marker is removed if the name matches, the values of lat/lon are ignored.
*
* @param lat (double) - latitude.
* @param lon (double) - longitude.
* @param name (String)- name of marker.
* @param ignoreCoordinates (boolean) - flag to determine whether lat/lon shall be ignored
*/
boolean removeMapMarker(in RemoveMapMarkerParams params);
/**
* Update map marker.
*
* If ignoreCoordinates is false the marker gets updated only if latPrev/lonPrev match the currently set values of the marker.
* If ignoreCoordinates is true the marker gets updated if the name matches, the values of latPrev/lonPrev are ignored.
*
* @param latPrev (double) - latitude (current marker).
* @param lonPrev (double) - longitude (current marker).
* @param namePrev (String) - name (current marker).
* @param latNew (double) - latitude (new marker).
* @param lonNew (double) - longitude (new marker).
* @param nameNew (String) - name (new marker).
* @param ignoreCoordinates (boolean) - flag to determine whether latPrev/lonPrev shall be ignored
*/
boolean updateMapMarker(in UpdateMapMarkerParams params);
/**
* Add map widget to the right side of the main screen.
* Note: any specified icon should exist in OsmAnd app resources.
*
* @param id (String) - widget id.
* @param menuIconName (String) - icon name (configure map menu).
* @param menuTitle (String) - widget name (configure map menu).
* @param lightIconName (String) - icon name for the light theme (widget).
* @param darkIconName (String) - icon name for the dark theme (widget).
* @param text (String) - main widget text.
* @param description (String) - sub text, like "km/h".
* @param order (int) - order position in the widgets list.
* @param intentOnClick (String) - onClick intent. Called after click on widget as startActivity(Intent intent).
*/
boolean addMapWidget(in AddMapWidgetParams params);
/**
* Remove map widget.
*
* @param (String) id - widget id.
*/
boolean removeMapWidget(in RemoveMapWidgetParams params);
/**
* Update map widget.
* Note: any specified icon should exist in OsmAnd app resources.
*
* @param id (String) - widget id.
* @param menuIconName (String) - icon name (configure map menu).
* @param menuTitle (String) - widget name (configure map menu).
* @param lightIconName (String) - icon name for the light theme (widget).
* @param darkIconName (String) - icon name for the dark theme (widget).
* @param text (String) - main widget text.
* @param description (String) - sub text, like "km/h".
* @param order (int) - order position in the widgets list.
* @param intentOnClick (String) - onClick intent. Called after click on widget as startActivity(Intent intent).
*/
boolean updateMapWidget(in UpdateMapWidgetParams params);
/**
* Add point to user layer.
*
* @param layerId (String) - layer id. Note: layer should be added first.
* @param pointId (String) - point id.
* @param shortName (String) - short name (single char). Displayed on the map.
* @param fullName (String) - full name. Displayed in the context menu on first row.
* @param typeName (String) - type name. Displayed in context menu on second row.
* @param color (int) - color of circle's background.
* @param location (ALatLon) - location of the point.
* @param details (List<String>)- list of details. Displayed under context menu.
* @param params (Map<String, String>) - optional map of params for point.
*/
boolean addMapPoint(in AddMapPointParams params);
/**
* Remove point.
*
* @param layerId (String) - layer id.
* @param pointId (String) - point id.
*/
boolean removeMapPoint(in RemoveMapPointParams params);
/**
* Update point.
*
* @param layerId (String) - layer id.
* @param pointId (String) - point id.
* @param updateOpenedMenuAndMap (boolean) - flag to enable folowing mode and menu updates for point
* @param shortName (String) - short name (single char). Displayed on the map.
* @param fullName (String) - full name. Displayed in the context menu on first row.
* @param typeName (String) - type name. Displayed in context menu on second row.
* @param color (String) - color of circle's background.
* @param location (ALatLon)- location of the point.
* @param details (List<String>) - list of details. Displayed under context menu.
* @param params (Map<String, String>) - optional map of params for point.
*/
boolean updateMapPoint(in UpdateMapPointParams params);
/**
* Add user layer on the map.
*
* @param id (String) - layer id.
* @param name (String) - layer name.
* @param zOrder (float) - z-order position of layer. Default value is 5.5f
* @param points Map<Sting, AMapPoint> - initial list of points. Nullable.
* @param imagePoints (boolean) - use new style for points on map or not. Also default zoom bounds for new style can be edited.
*/
boolean addMapLayer(in AddMapLayerParams params);
/**
* Remove user layer.
*
* @param id (String) - layer id.
*/
boolean removeMapLayer(in RemoveMapLayerParams params);
/**
* Update user layer.
*
* @param id (String) - layer id.
* @param name (String) - layer name.
* @param zOrder (float) - z-order position of layer. Default value is 5.5f
* @param points Map<Sting, AMapPoint> - list of points. Nullable.
* @param imagePoints (boolean) - use new style for points on map or not. Also default zoom bounds for new style can be edited.
*/
boolean updateMapLayer(in UpdateMapLayerParams params);
/**
* Import GPX file to OsmAnd (from URI or file).
*
* @param gpxUri (Uri) - URI created by FileProvider (preferable method).
* @param file (File) - File which represents GPX track (not recomended, OsmAnd should have rights to access file location).
* @param fileName (String) - Destination file name. May contain dirs.
* @param color (String) - color of gpx. Can be one of: "red", "orange", "lightblue", "blue", "purple",
* "translucent_red", "translucent_orange", "translucent_lightblue",
* "translucent_blue", "translucent_purple"
* @param show (boolean) - show track on the map after import
*/
boolean importGpx(in ImportGpxParams params);
/**
* Show GPX file on map.
*
* @param fileName (String) - file name to show. Must be imported first.
*/
boolean showGpx(in ShowGpxParams params);
/**
* Hide GPX file.
*
* @param fileName (String) - file name to hide.
*/
boolean hideGpx(in HideGpxParams params);
/**
* Get list of active GPX files.
*
* @return list of active gpx files.
*/
boolean getActiveGpx(out List<ASelectedGpxFile> files);
/**
* Set map view to current location.
*
* @param latitude (double) - latitude of new map center.
* @param longitude (double) - longitude of new map center.
* @param zoom (float) - map zoom level. Set 0 to keep zoom unchanged.
* @param animated (boolean) - set true to animate changes.
*/
boolean setMapLocation(in SetMapLocationParams params);
boolean calculateRoute(in CalculateRouteParams params);
/**
* Refresh the map (UI)
*/
boolean refreshMap();
/**
* Add favorite group with given params.
*
* @param name (String) - group name.
* @param color (String) - group color. Can be one of: "red", "orange", "yellow",
* "lightgreen", "green", "lightblue", "blue", "purple", "pink", "brown".
* @param visible (boolean) - group visibility.
*/
boolean addFavoriteGroup(in AddFavoriteGroupParams params);
/**
* Remove favorite group with given name.
*
* @param name (String) - name of favorite group.
*/
boolean removeFavoriteGroup(in RemoveFavoriteGroupParams params);
/**
* Update favorite group with given params.
*
* @param namePrev (String) - group name (current).
* @param colorPrev (String) - group color (current).
* @param visiblePrev (boolean) - group visibility (current).
* @param nameNew (String) - group name (new).
* @param colorNew (String) - group color (new).
* @param visibleNew (boolean) - group visibility (new).
*/
boolean updateFavoriteGroup(in UpdateFavoriteGroupParams params);
/**
* Add favorite at given location with given params.
*
* @param lat (double) - latitude.
* @param lon (double) - longitude.
* @param name (String) - name of favorite item.
* @param description (String) - description of favorite item.
* @param category (String) - category of favorite item.
* @param color (String) - color of favorite item. Can be one of: "red", "orange", "yellow",
* "lightgreen", "green", "lightblue", "blue", "purple", "pink", "brown".
* @param visible (boolean) - should favorite item be visible after creation.
*/
boolean addFavorite(in AddFavoriteParams params);
/**
* Remove favorite at given location with given params.
*
* @param lat (double) - latitude.
* @param lon (double) - longitude.
* @param name (String) - name of favorite item.
* @param category (String) - category of favorite item.
*/
boolean removeFavorite(in RemoveFavoriteParams params);
/**
* Update favorite at given location with given params.
*
* @param latPrev (double) - latitude (current favorite).
* @param lonPrev (double) - longitude (current favorite).
* @param namePrev (String) - name of favorite item (current favorite).
* @param categoryPrev (String) - category of favorite item (current favorite).
* @param latNew (double) - latitude (new favorite).
* @param lonNew (double) - longitude (new favorite).
* @param nameNew (String) - name of favorite item (new favorite).
* @param descriptionNew (String) - description of favorite item (new favorite).
* @param categoryNew (String) - category of favorite item (new favorite). Use only to create a new category,
* not to update an existing one. If you want to update an existing category,
* use the {@link #updateFavoriteGroup(String, String, boolean, String, String, boolean)} method.
* @param colorNew (String) - color of new category. Can be one of: "red", "orange", "yellow",
* "lightgreen", "green", "lightblue", "blue", "purple", "pink", "brown".
* @param visibleNew (boolean) - should new category be visible after creation.
*/
boolean updateFavorite(in UpdateFavoriteParams params);
/**
* Start gpx recording.
*/
boolean startGpxRecording(in StartGpxRecordingParams params);
/**
* Stop gpx recording.
*/
boolean stopGpxRecording(in StopGpxRecordingParams params);
/**
* Take photo note.
*
* @param lat (double) - latutude of photo note.
* @param lon (double) - longitude of photo note.
*/
boolean takePhotoNote(in TakePhotoNoteParams params);
/**
* Start video note recording.
*
* @param lat (double) - latutude of video note point.
* @param lon (double) - longitude of video note point.
*/
boolean startVideoRecording(in StartVideoRecordingParams params);
/**
* Start audio note recording.
*
* @param lat (double) - latutude of audio note point.
* @param lon (double) - longitude of audio note point.
*/
boolean startAudioRecording(in StartAudioRecordingParams params);
/**
* Stop Audio/Video recording.
*/
boolean stopRecording(in StopRecordingParams params);
/**
* Start navigation.
*
* @param startName (String) - name of the start point as it displays in OsmAnd's UI. Nullable.
* @param startLat (double) - latitude of the start point. If 0 - current location is used.
* @param startLon (double) - longitude of the start point. If 0 - current location is used.
* @param destName (String) - name of the start point as it displays in OsmAnd's UI.
* @param destLat (double) - latitude of a destination point.
* @param destLon (double) - longitude of a destination point.
* @param profile (String) - One of: "default", "car", "bicycle", "pedestrian", "aircraft", "boat", "hiking", "motorcycle", "truck". Nullable (default).
* @param force (boolean) - ask to stop current navigation if any. False - ask. True - don't ask.
*/
boolean navigate(in NavigateParams params);
/**
* Start navigation using gpx file. User need to grant Uri permission to OsmAnd.
*
* @param gpxUri (Uri) - URI created by FileProvider.
* @param force (boolean) - ask to stop current navigation if any. False - ask. True - don't ask.
*/
boolean navigateGpx(in NavigateGpxParams params);
/**
* Remove GPX file.
*
* @param fileName (String) - file name to remove;
*/
boolean removeGpx(in RemoveGpxParams params);
/**
* Show AMapPoint on map in OsmAnd.
*
* @param layerId (String) - layer id. Note: layer should be added first.
* @param pointId (String) - point id.
* @param shortName (String) - short name (single char). Displayed on the map.
* @param fullName (String) - full name. Displayed in the context menu on first row.
* @param typeName (String) - type name. Displayed in context menu on second row.
* @param color (int) - color of circle's background.
* @param location (ALatLon) - location of the point.
* @param details List<String> - list of details. Displayed under context menu.
* @param params Map<String, String> - optional map of params for point.
*/
boolean showMapPoint(in ShowMapPointParams params);
/**
* Method for adding up to 3 items to the OsmAnd navigation drawer.
*
* @param appPackage - current application package.
* @param names - list of names for items.
* @param uris - list of uris for intents.
* @param iconNames - list of icon names for items.
* @param flags - list of flags for intents. Use -1 if no flags needed.
*/
boolean setNavDrawerItems(in SetNavDrawerItemsParams params);
/**
* Put navigation on pause.
*/
boolean pauseNavigation(in PauseNavigationParams params);
/**
* Resume navigation if it was paused before.
*/
boolean resumeNavigation(in ResumeNavigationParams params);
/**
* Stop navigation. Removes target / intermediate points and route path from the map.
*/
boolean stopNavigation(in StopNavigationParams params);
/**
* Mute voice guidance. Stays muted until unmute manually or via the api.
*/
boolean muteNavigation(in MuteNavigationParams params);
/**
* Unmute voice guidance.
*/
boolean unmuteNavigation(in UnmuteNavigationParams params);
/**
* Run search for POI / Address.
*
* @param searchQuery (String) - search query string.
* @param searchType (int) - type of search. Values:
* SearchParams.SEARCH_TYPE_ALL - all kind of search
* SearchParams.SEARCH_TYPE_POI - POIs only
* SearchParams.SEARCH_TYPE_ADDRESS - addresses only
*
* @param latitude (double) - latitude of original search location.
* @param longitude (double) - longitude of original search location.
* @param radiusLevel (int) - value from 1 to 7. Default value = 1.
* @param totalLimit (int) - limit of returned search result rows. Default value = -1 (unlimited).
*/
boolean search(in SearchParams params, IOsmAndAidlCallback callback);
/**
* Do search and start navigation.
*
* @param startName (String) - name of the start point as it displays in OsmAnd's UI. Nullable.
* @param startLat (double) - latitude of the start point. If 0 - current location is used.
* @param startLon (double) - longitude of the start point. If 0 - current location is used.
* @param searchQuery (String) - Text of a query for searching a destination point. Sent as URI parameter.
* @param searchLat (double) - original location of search (latitude). Sent as URI parameter.
* @param searchLon (double) - original location of search (longitude). Sent as URI parameter.
* @param profile (String) - one of: "default", "car", "bicycle", "pedestrian", "aircraft", "boat", "hiking", "motorcycle", "truck". Nullable (default).
* @param force (boolean) - ask to stop current navigation if any. False - ask. True - don't ask.
*/
boolean navigateSearch(in NavigateSearchParams params);
/**
* Method to register for periodical callbacks from OsmAnd
*
* @param updateTimeMS (long)- period of time in millisecond after which callback is triggered
* @param callback (IOsmAndCallback)- create and provide instance of {@link IOsmAndAidlCallback} interface
* @return id (long) - id of callback in OsmAnd. Needed to unsubscribe from updates.
*/
long registerForUpdates(in long updateTimeMS, IOsmAndAidlCallback callback);
/**
* Method to unregister from periodical callbacks from OsmAnd
*
* @param callbackId (long)- id of registered callback (provided by OsmAnd
* in {@link OsmAndAidlHelper#registerForUpdates(long, IOsmAndAidlCallback)})
*/
boolean unregisterFromUpdates(in long callbackId);
/**
* Method for adding image to the top of Osmand's NavDrawer.
*
* @param imageUri (String)- image's URI.toString
*
* @deprecated
* Use the {@link #setNavDrawerLogoWithParams(NavDrawerHeaderParams params)} method.
*/
boolean setNavDrawerLogo(in String imageUri);
/**
* Method for selected UI elements (like QuickSearch button) to show.
*
* @param ids (List<String>)- list of menu items keys from {@link OsmAndCustomizationConstants}
*/
boolean setEnabledIds(in List<String> ids);
/**
* Method for selected UI elements (like QuickSearch button) to hide.
*
* @param ids (List<String>)- list of menu items keys from {@link OsmAndCustomizationConstants}
*/
boolean setDisabledIds(in List<String> ids);
/**
* Method to show selected NavDrawer's menu items.
*
* @param patterns (List<String>) - list of menu items names from {@link OsmAndCustomizationConstants}
*/
boolean setEnabledPatterns(in List<String> patterns);
/**
* Method to hide selected NavDrawer's menu items.
*
* @param patterns (List<String>)- list of menu items names from {@link OsmAndCustomizationConstants}
*/
boolean setDisabledPatterns(in List<String> patterns);
/**
* Register OsmAnd widgets for visibility.
*
* @param widgetKey ()- widget id.
* @param appModKeys - list of OsmAnd Application modes widget active with. Could be "null" for all modes.
*/
boolean regWidgetVisibility(in SetWidgetsParams params);
/**
* Register OsmAnd widgets for availability.
*
* @param widgetKey (String) - widget id.
* @param appModKeys (List<String>)- ist of OsmAnd Application modes widget active with. Could be "null" for all modes.
*/
boolean regWidgetAvailability(in SetWidgetsParams params);
/**
* Add custom parameters for OsmAnd settings to associate with client app.
*
* @param sharedPreferencesName (String)- string with name of clint's app for shared preferences key
* @param bundle (Bundle)- bundle with keys from Settings IDs {@link OsmAndCustomizationConstants} and Settings params
*/
boolean customizeOsmandSettings(in OsmandSettingsParams params);
/**
* Method to get list of gpx files currently registered (imported or created) in OsmAnd;
*
* @return list of gpx files
*/
boolean getImportedGpx(out List<AGpxFile> files);
/**
* Method to get list of sqlitedb files registered in OsmAnd;
*
* @return list of sqlitedb files
*/
boolean getSqliteDbFiles(out List<ASqliteDbFile> files);
/**
* Method to get list of currently active sqlitedb files
*
* @return list of sqlitedb files
*/
boolean getActiveSqliteDbFiles(out List<ASqliteDbFile> files);
/**
* Method to show selected sqlitedb file as map overlay.
*
* @param fileName (String) - name of sqlitedb file
*/
boolean showSqliteDbFile(String fileName);
/**
* Method to hide sqlitedb file from map overlay.
*
* @param fileName (String) - name of sqlitedb file
*/
boolean hideSqliteDbFile(String fileName);
/**
* Method for adding image to the top of OsmAnd's NavDrawer with additional params
*
* @param imageUri (String) - image's URI.toString
* @param packageName (String) - client's app package name
* @param intent (String) - intent for additional functionality on image click
*
*/
boolean setNavDrawerLogoWithParams(in NavDrawerHeaderParams params);
/**
* Method for adding functionality to "Powered by Osmand" logo in NavDrawer's footer
* (reset OsmAnd settings to pre-clinet app's state)
*
* @param packageName (String) - package name
* @param intent (String) - intent
* @param appName (String) - client's app name
*/
boolean setNavDrawerFooterWithParams(in NavDrawerFooterParams params);
/**
* Restore default (pre-client) OsmAnd settings and state:
* clears features, widgets and settings customization, NavDraw logo.
*/
boolean restoreOsmand();
/**
* Method to change state of plug-ins in OsmAnd.
*
* @param pluginId (String) - id (name) of plugin.
* @param newState (int) - new state (0 - off, 1 - on).
*/
boolean changePluginState(in PluginParams params);
/**
* Method to register for callback on OsmAnd initialization
* @param callback (IOsmAndAidlCallback) - create and provide instance of {@link IOsmAndAidlCallback} interface
*/
boolean registerForOsmandInitListener(in IOsmAndAidlCallback callback);
/**
* Requests bitmap snap-shot of map with GPX file from provided URI in its center.
* You can set bitmap size, density and GPX lines color, but you need
* to manually download appropriate map in OsmAnd or background will be empty.
* Bitmap will be returned through callback {@link IOsmAndAidlCallback#onGpxBitmapCreated(AGpxBitmap)}
*
* @param gpxUri (Uri/File) - Uri for gpx file
* @param density (float) - image density. Recommended to use default metrics for device's display.
* @param widthPixels (int) - width of bitmap
* @param heightPixels (int) - height of bitmap
* @param color (int) - color in ARGB format
* @param callback (IOsmAndAidlCallback) - instance of callback from OsmAnd.
*/
boolean getBitmapForGpx(in CreateGpxBitmapParams file, IOsmAndAidlCallback callback);
/**
* Method to copy files to OsmAnd part by part. For now supports only sqlitedb format.
* Part size (bytearray) should not exceed 256k.
*
* @param fileName (String) - name of file
* @param filePartData (byte[]) - parts of file, byte[] with size 256k or less.
* @param startTime (long) - timestamp of copying start.
* @param isDone (boolean) - boolean to mark end of copying.
* @return number of last successfully received file part or error(-1).
*/
int copyFile(in CopyFileParams filePart);
/**
* Method to register for updates during navgation. Notifies user about distance to the next turn and its type.
*
* @param subscribeToUpdates (boolean) - subscribe or unsubscribe from updates
* @param callbackId (long) - id of callback, needed to unsubscribe from updates
* @param callback (IOsmAndAidlCallback) - callback to notify user on navigation data change
*/
long registerForNavigationUpdates(in ANavigationUpdateParams params, IOsmAndAidlCallback callback);
/**
* Method to add Context Menu buttons to OsmAnd Context menu.
*
* {@link ContextMenuButtonsParams } is a wrapper class for params:
*
* @param leftButton (AContextMenuButton) - parameters for left context button:
* @param buttonId (String at AContextMenuButton) - id of button in View
* @param leftTextCaption (String at AContextMenuButton) - left-side button text
* @param rightTextCaption (String at AContextMenuButton) - right-side button text
* @param String leftIconName (String at AContextMenuButton) - name of left-side icon
* @param String rightIconName (String at AContextMenuButton) - name of right-side icon
* @param boolean needColorizeIcon (booleanat AContextMenuButton) - flag to apply color to icon
* @param boolean enabled (boolean at AContextMenuButton) - enable button flag
*
* @param rightButton (AContextMenuButton) - parameters for right context button, see <i>leftButton</i> param for details.
* @param id (String) - button id;
* @param appPackage (String) - clinet's app package name
* @param layerId (String) - id of Osmand's map layer
* @param callbackId (long) - {@link IOsmAndAidlCallback} id
* @param pointsIds (List<String>) - list of point Ids to which this rules applies to.
*
* @param callback (IOsmAndAidlCallback) - AIDL callback;
*
* @return long - callback's Id;
*/
long addContextMenuButtons(in ContextMenuButtonsParams params, IOsmAndAidlCallback callback);
/**
* Method to remove Context Menu buttons from OsmAnd Context menu.
*
* {@link RemoveContextMenuButtonsParams} is a wrapper class for params:
*
* @param paramsId (String) - id of {@link ContextMenuButtonsParams} of button you want to remove;
* @param callbackId (long) - id of {@ling IOsmAndAidlCallback} of button you want to remove;
*
*/
boolean removeContextMenuButtons(in RemoveContextMenuButtonsParams params);
/**
* Method to update params on already set custom Context Button.
*
* {@link UpdateContextMenuButtonsParams } is a wrapper class for params:
*
* @param leftButton (AContextMenuButton) - parameters for left context button:
* @param buttonId (String at AContextMenuButton) - id of button in View
* @param leftTextCaption (String at AContextMenuButton) - left-side button text
* @param rightTextCaption (String at AContextMenuButton) - right-side button text
* @param String leftIconName (String at AContextMenuButton) - name of left-side icon
* @param String rightIconName (String at AContextMenuButton) - name of right-side icon
* @param boolean needColorizeIcon (booleanat AContextMenuButton) - flag to apply color to icon
* @param boolean enabled (boolean at AContextMenuButton) - enable button flag
*
* @param rightButton (AContextMenuButton) - parameters for right context button, see <i>leftButton</i> param for details.
* @param id (String) - button id;
* @param appPackage (String) - clinet's app package name
* @param layerId (String) - id of Osmand's map layer
* @param callbackId (long) - {@link IOsmAndAidlCallback} id
* @param pointsIds (List<String>) - list of point Ids to which this rules applies to.
*
*/
boolean updateContextMenuButtons(in UpdateContextMenuButtonsParams params);
/**
* Method to check if there is a customized setting in OsmAnd Settings.
*
* {@link OsmandSettingsInfoParams} is a wrapper class for params:
*
* @param sharedPreferencesName (String at OsmandSettingInfoParams) - key of setting in OsmAnd's preferences.
*
* @return boolean - true if setting is already set in SharedPreferences
*
*/
boolean areOsmandSettingsCustomized(in OsmandSettingsInfoParams params);
/**
* Method to customize parameters of OsmAnd.
*
* @param params (CustomizationInfoParams) - wrapper class for custom settings and ui.
*
* @param settingsParams (OsmandSettingsParams) - wrapper class for OsmAnd shared preferences params.
* See {@link #customizeOsmandSettings(in OsmandSettingsParams params) customizeOsmandSettings}
* method description for details.
* @param navDrawerHeaderParams (NavDrawerHeaderParams) - wrapper class for OsmAnd navdrawer header params.
* See {@link #setNavDrawerLogoWithParams(in NavDrawerHeaderParams params) setNavDrawerLogoWithParams}
* method description for details.
* @param navDrawerFooterParams (NavDrawerFooterParams) - wrapper class for OsmAnd navdrawer footer params.
* See {@link #setNavDrawerFooterWithParams(in NavDrawerFooterParams params) setNavDrawerFooterWithParams}
* method description for details.
* @param visibilityWidgetsParams (ArrayList<SetWidgetsParams>) - wrapper class for OsmAnd widgets visibility.
* See {@link #regWidgetVisibility(in SetWidgetsParams params) regWidgetVisibility}
* method description for details.
* @param availabilityWidgetsParams (ArrayList<SetWidgetsParams>) - wrapper class for OsmAnd widgets availability.
* See {@link #regWidgetAvailability(in SetWidgetsParams params) regWidgetAvailability}
* method description for details.
* @param pluginsParams (ArrayList<PluginParams>) - wrapper class for OsmAnd plugins states params.
* See {@link #changePluginState(in PluginParams params) changePluginState}
* method description for details.
* @param featuresEnabledIds (List<String>) - list of UI elements (like QuickSearch button) to show.
* See {@link #setEnabledIds(in List<String> ids) setEnabledIds}
* @param featuresDisabledIds (List<String>) - list of UI elements (like QuickSearch button) to hide.
* See {@link #setDisabledIds(in List<String> ids) setDisabledIds}
* @param featuresEnabledPatterns (List<String>) - list of NavDrawer menu items to show.
* See {@link #setEnabledPatterns(in List<String> patterns) setEnabledPatterns}
* @param featuresDisabledPatterns (List<String>) - list of NavDrawer menu items to hide.
* See {@link #setDisabledPatterns(in List<String> patterns) setDisabledPatterns}
*
*/
boolean setCustomization(in CustomizationInfoParams params);
/**
* Method to register for Voice Router voice messages during navigation. Notifies user about voice messages.
*
* @params subscribeToUpdates (boolean) - boolean flag to subscribe or unsubscribe from messages
* @params callbackId (long) - id of callback, needed to unsubscribe from messages
* @params callback (IOsmAndAidlCallback) - callback to notify user on voice message
*/
long registerForVoiceRouterMessages(in ANavigationVoiceRouterMessageParams params, IOsmAndAidlCallback callback);
/**
* Removes all active map markers (marks them as passed and moves to history)
* Empty class of params
*/
boolean removeAllActiveMapMarkers(in RemoveMapMarkersParams params);
boolean importProfile(in ProfileSettingsParams params);
}

View file

@ -1,9 +1,8 @@
package net.osmand.plus;
package net.osmand.aidlapi;
public interface OsmAndCustomizationConstants {
// Navigation Drawer:
String DRAWER_ITEM_ID_SCHEME = "drawer.action.";
String DRAWER_DASHBOARD_ID = DRAWER_ITEM_ID_SCHEME + "dashboard";
String DRAWER_MAP_MARKERS_ID = DRAWER_ITEM_ID_SCHEME + "map_markers";
@ -23,7 +22,6 @@ public interface OsmAndCustomizationConstants {
String DRAWER_DIVIDER_ID = DRAWER_ITEM_ID_SCHEME + "divider";
// Configure Map:
String CONFIGURE_MAP_ITEM_ID_SCHEME = "map.configure.";
String SHOW_ITEMS_ID_SCHEME = CONFIGURE_MAP_ITEM_ID_SCHEME + "show.";
String RENDERING_ITEMS_ID_SCHEME = CONFIGURE_MAP_ITEM_ID_SCHEME + "rendering.";
@ -42,6 +40,7 @@ public interface OsmAndCustomizationConstants {
String RECORDING_LAYER = SHOW_ITEMS_ID_SCHEME + "recording_layer";
String MAPILLARY = SHOW_ITEMS_ID_SCHEME + "mapillary";
String OSM_NOTES = SHOW_ITEMS_ID_SCHEME + "osm_notes";
String OSM_EDITS = SHOW_ITEMS_ID_SCHEME + "osm_edits";
String OVERLAY_MAP = SHOW_ITEMS_ID_SCHEME + "overlay_map";
String UNDERLAY_MAP = SHOW_ITEMS_ID_SCHEME + "underlay_map";
String CONTOUR_LINES = SHOW_ITEMS_ID_SCHEME + "contour_lines";
@ -50,7 +49,7 @@ public interface OsmAndCustomizationConstants {
String MAP_RENDERING_CATEGORY_ID = RENDERING_ITEMS_ID_SCHEME + "category";
String MAP_STYLE_ID = RENDERING_ITEMS_ID_SCHEME + "map_style";
String MAP_MODE_ID = RENDERING_ITEMS_ID_SCHEME + "map_mode";
String MAP_MAGNIFIER_ID = RENDERING_ITEMS_ID_SCHEME + "map_marnifier";
String MAP_MAGNIFIER_ID = RENDERING_ITEMS_ID_SCHEME + "map_magnifier";
String ROAD_STYLE_ID = RENDERING_ITEMS_ID_SCHEME + "road_style";
String TEXT_SIZE_ID = RENDERING_ITEMS_ID_SCHEME + "text_size";
String MAP_LANGUAGE_ID = RENDERING_ITEMS_ID_SCHEME + "map_language";
@ -60,7 +59,6 @@ public interface OsmAndCustomizationConstants {
String ROUTES_ID = RENDERING_ITEMS_ID_SCHEME + "routes";
// Map Controls:
String HUD_BTN_ID_SCHEME = "map.view.";
String LAYERS_HUD_ID = HUD_BTN_ID_SCHEME + "layers";
String COMPASS_HUD_ID = HUD_BTN_ID_SCHEME + "compass";
@ -78,6 +76,7 @@ public interface OsmAndCustomizationConstants {
String MAP_CONTEXT_MENU_CHANGE_MARKER_POSITION = MAP_CONTEXT_MENU_ACTIONS + "change_m_position";
String MAP_CONTEXT_MENU_MARK_AS_PARKING_LOC = MAP_CONTEXT_MENU_ACTIONS + "mark_as_parking";
String MAP_CONTEXT_MENU_MEASURE_DISTANCE = MAP_CONTEXT_MENU_ACTIONS + "measure_distance";
String MAP_CONTEXT_MENU_AVOID_ROAD = MAP_CONTEXT_MENU_ACTIONS + "avoid_road";
String MAP_CONTEXT_MENU_EDIT_GPX_WP = MAP_CONTEXT_MENU_ACTIONS + "edit_gpx_waypoint";
String MAP_CONTEXT_MENU_ADD_GPX_WAYPOINT = MAP_CONTEXT_MENU_ACTIONS + "add_gpx_waypoint";
String MAP_CONTEXT_MENU_UPDATE_MAP = MAP_CONTEXT_MENU_ACTIONS + "update_map";
@ -99,5 +98,4 @@ public interface OsmAndCustomizationConstants {
String PLUGIN_RASTER_MAPS = "osmand.rastermaps";
String PLUGIN_SKI_MAPS = "skimaps.plugin";
String PLUGIN_SRTM = "osmand.srtm";
}
}

View file

@ -0,0 +1,36 @@
package net.osmand.aidlapi;
public interface OsmandAidlConstants {
int OK_RESPONSE = 0;
int MIN_UPDATE_TIME_MS = 1000;
long COPY_FILE_PART_SIZE_LIMIT = 256 * 1024;
long COPY_FILE_MAX_LOCK_TIME_MS = 10000;
int CANNOT_ACCESS_API_ERROR = -5;
int UNKNOWN_API_ERROR = -2;
int MIN_UPDATE_TIME_MS_ERROR = -1;
int COPY_FILE_PARAMS_ERROR = -1001;
int COPY_FILE_PART_SIZE_LIMIT_ERROR = -1002;
int COPY_FILE_WRITE_LOCK_ERROR = -1003;
int COPY_FILE_IO_ERROR = -1004;
int COPY_FILE_UNSUPPORTED_FILE_TYPE_ERROR = -1005;
int TURN_TYPE_C = 1; //"C"; // continue (go straight)
int TURN_TYPE_TL = 2; // turn left
int TURN_TYPE_TSLL = 3; // turn slightly left
int TURN_TYPE_TSHL = 4; // turn sharply left
int TURN_TYPE_TR = 5; // turn right
int TURN_TYPE_TSLR = 6; // turn slightly right
int TURN_TYPE_TSHR = 7; // turn sharply right
int TURN_TYPE_KL = 8; // keep left
int TURN_TYPE_KR = 9; // keep right
int TURN_TYPE_TU = 10; // U-turn
int TURN_TYPE_TRU = 11; // Right U-turn
int TURN_TYPE_OFFR = 12; // Off route
int TURN_TYPE_RNDB = 13; // Roundabout
int TURN_TYPE_RNLB = 14; // Roundabout left
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.calculateroute;
parcelable CalculateRouteParams;

View file

@ -0,0 +1,101 @@
package net.osmand.aidlapi.calculateroute;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
import net.osmand.aidlapi.map.ALatLon;
import java.util.ArrayList;
import java.util.List;
public class CalculateRouteParams extends AidlParams {
private ALatLon startPoint;
private String startPointName;
private ALatLon endPoint;
private String endPointName;
private ArrayList<ALatLon> intermediatePoints = new ArrayList<>();
private ArrayList<String> intermediateNames = new ArrayList<>();
public CalculateRouteParams(ALatLon startPoint, String startPointName,
ALatLon endPoint, String endPointName,
List<ALatLon> intermediatePoints, List<String> intermediateNames) {
if (endPoint == null) {
throw new IllegalArgumentException("endPoint cannot be null");
}
this.startPoint = startPoint;
this.startPointName = startPointName;
this.endPoint = endPoint;
this.endPointName = endPointName;
if (intermediatePoints != null) {
this.intermediatePoints.addAll(intermediatePoints);
}
if (intermediateNames != null) {
this.intermediateNames.addAll(intermediateNames);
}
}
public CalculateRouteParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<CalculateRouteParams> CREATOR = new Creator<CalculateRouteParams>() {
@Override
public CalculateRouteParams createFromParcel(Parcel in) {
return new CalculateRouteParams(in);
}
@Override
public CalculateRouteParams[] newArray(int size) {
return new CalculateRouteParams[size];
}
};
public ALatLon getStartPoint() {
return startPoint;
}
public String getStartPointName() {
return startPointName;
}
public ALatLon getEndPoint() {
return endPoint;
}
public String getEndPointName() {
return endPointName;
}
public List<ALatLon> getIntermediatePoints() {
return intermediatePoints;
}
public List<String> getIntermediateNames() {
return intermediateNames;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("startPoint", startPoint);
bundle.putString("startPointName", startPointName);
bundle.putParcelable("endPoint", endPoint);
bundle.putString("endPointName", endPointName);
bundle.putParcelableArrayList("intermediatePoints", intermediatePoints);
bundle.putStringArrayList("intermediateNames", intermediateNames);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(ALatLon.class.getClassLoader());
startPoint = bundle.getParcelable("startPoint");
startPointName = bundle.getString("startPointName");
endPoint = bundle.getParcelable("endPoint");
endPointName = bundle.getString("endPointName");
intermediatePoints = bundle.getParcelableArrayList("intermediatePoints");
intermediateNames = bundle.getStringArrayList("intermediateNames");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.contextmenu;
parcelable AContextMenuButton;

View file

@ -0,0 +1,95 @@
package net.osmand.aidlapi.contextmenu;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class AContextMenuButton extends AidlParams {
private int buttonId;
private String leftTextCaption;
private String rightTextCaption;
private String leftIconName;
private String rightIconName;
private boolean needColorizeIcon;
private boolean enabled;
public AContextMenuButton(int buttonId, String leftTextCaption, String rightTextCaption, String leftIconName, String rightIconName, boolean needColorizeIcon, boolean enabled) {
this.buttonId = buttonId;
this.leftTextCaption = leftTextCaption;
this.rightTextCaption = rightTextCaption;
this.leftIconName = leftIconName;
this.rightIconName = rightIconName;
this.needColorizeIcon = needColorizeIcon;
this.enabled = enabled;
}
protected AContextMenuButton(Parcel in) {
readFromParcel(in);
}
public static final Creator<AContextMenuButton> CREATOR = new Creator<AContextMenuButton>() {
@Override
public AContextMenuButton createFromParcel(Parcel in) {
return new AContextMenuButton(in);
}
@Override
public AContextMenuButton[] newArray(int size) {
return new AContextMenuButton[size];
}
};
public int getButtonId() {
return buttonId;
}
public String getLeftTextCaption() {
return leftTextCaption;
}
public String getRightTextCaption() {
return rightTextCaption;
}
public String getLeftIconName() {
return leftIconName;
}
public String getRightIconName() {
return rightIconName;
}
public boolean isTintIcon() {
return needColorizeIcon;
}
public boolean isEnabled() {
return enabled;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putInt("buttonId", buttonId);
bundle.putString("leftTextCaption", leftTextCaption);
bundle.putString("rightTextCaption", rightTextCaption);
bundle.putString("leftIconName", leftIconName);
bundle.putString("rightIconName", rightIconName);
bundle.putBoolean("needColorizeIcon", needColorizeIcon);
bundle.putBoolean("enabled", enabled);
}
@Override
protected void readFromBundle(Bundle bundle) {
buttonId = bundle.getInt("buttonId");
leftTextCaption = bundle.getString("leftTextCaption");
rightTextCaption = bundle.getString("rightTextCaption");
leftIconName = bundle.getString("leftIconName");
rightIconName = bundle.getString("rightIconName");
needColorizeIcon = bundle.getBoolean("needColorizeIcon");
enabled = bundle.getBoolean("enabled");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.contextmenu;
parcelable ContextMenuButtonsParams;

View file

@ -0,0 +1,106 @@
package net.osmand.aidlapi.contextmenu;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
import java.util.ArrayList;
import java.util.List;
public class ContextMenuButtonsParams extends AidlParams {
private AContextMenuButton leftButton;
private AContextMenuButton rightButton;
private String id;
private String appPackage;
private String layerId;
private long callbackId = -1L;
private ArrayList<String> pointsIds = new ArrayList<>();
public ContextMenuButtonsParams(AContextMenuButton leftButton, AContextMenuButton rightButton, String id, String appPackage, String layerId, long callbackId, List<String> pointsIds) {
this.leftButton = leftButton;
this.rightButton = rightButton;
this.id = id;
this.appPackage = appPackage;
this.layerId = layerId;
this.callbackId = callbackId;
if (pointsIds != null) {
this.pointsIds.addAll(pointsIds);
}
}
public ContextMenuButtonsParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<ContextMenuButtonsParams> CREATOR = new Creator<ContextMenuButtonsParams>() {
@Override
public ContextMenuButtonsParams createFromParcel(Parcel in) {
return new ContextMenuButtonsParams(in);
}
@Override
public ContextMenuButtonsParams[] newArray(int size) {
return new ContextMenuButtonsParams[size];
}
};
public AContextMenuButton getLeftButton() {
return leftButton;
}
public AContextMenuButton getRightButton() {
return rightButton;
}
public String getId() {
return id;
}
public String getAppPackage() {
return appPackage;
}
public String getLayerId() {
return layerId;
}
public long getCallbackId() {
return callbackId;
}
public void setCallbackId(long callbackId) {
this.callbackId = callbackId;
}
public List<String> getPointsIds() {
return pointsIds;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("leftButton", leftButton);
bundle.putParcelable("rightButton", rightButton);
bundle.putString("id", id);
bundle.putString("appPackage", appPackage);
bundle.putString("layerId", layerId);
bundle.putLong("callbackId", callbackId);
bundle.putStringArrayList("pointsIds", pointsIds);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AContextMenuButton.class.getClassLoader());
leftButton = bundle.getParcelable("leftButton");
rightButton = bundle.getParcelable("rightButton");
id = bundle.getString("id");
appPackage = bundle.getString("appPackage");
layerId = bundle.getString("layerId");
callbackId = bundle.getLong("callbackId");
pointsIds = bundle.getStringArrayList("pointsIds");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.contextmenu;
parcelable RemoveContextMenuButtonsParams;

View file

@ -0,0 +1,53 @@
package net.osmand.aidlapi.contextmenu;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class RemoveContextMenuButtonsParams extends AidlParams {
private String paramsId;
private long callbackId = -1L;
public RemoveContextMenuButtonsParams(String paramsId, long callbackId) {
this.paramsId = paramsId;
this.callbackId = callbackId;
}
public RemoveContextMenuButtonsParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<RemoveContextMenuButtonsParams> CREATOR = new Creator<RemoveContextMenuButtonsParams>() {
@Override
public RemoveContextMenuButtonsParams createFromParcel(Parcel in) {
return new RemoveContextMenuButtonsParams(in);
}
@Override
public RemoveContextMenuButtonsParams[] newArray(int size) {
return new RemoveContextMenuButtonsParams[size];
}
};
public String getParamsId() {
return paramsId;
}
public long getCallbackId() {
return callbackId;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("paramsId", paramsId);
bundle.putLong("callbackId", callbackId);
}
@Override
protected void readFromBundle(Bundle bundle) {
paramsId = bundle.getString("paramsId");
callbackId = bundle.getLong("callbackId");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.contextmenu;
parcelable UpdateContextMenuButtonsParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.contextmenu;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class UpdateContextMenuButtonsParams extends AidlParams {
private ContextMenuButtonsParams buttonsParams;
public UpdateContextMenuButtonsParams(ContextMenuButtonsParams widget) {
this.buttonsParams = widget;
}
public UpdateContextMenuButtonsParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<UpdateContextMenuButtonsParams> CREATOR = new Creator<UpdateContextMenuButtonsParams>() {
@Override
public UpdateContextMenuButtonsParams createFromParcel(Parcel in) {
return new UpdateContextMenuButtonsParams(in);
}
@Override
public UpdateContextMenuButtonsParams[] newArray(int size) {
return new UpdateContextMenuButtonsParams[size];
}
};
public ContextMenuButtonsParams getContextMenuButtonsParams() {
return buttonsParams;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("buttonsParams", buttonsParams);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(ContextMenuButtonsParams.class.getClassLoader());
buttonsParams = bundle.getParcelable("buttonsParams");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.copyfile;
parcelable CopyFileParams;

View file

@ -0,0 +1,80 @@
package net.osmand.aidlapi.copyfile;
import android.os.Bundle;
import android.os.Parcel;
import android.support.annotation.NonNull;
import net.osmand.aidlapi.AidlParams;
public class CopyFileParams extends AidlParams {
private String fileName;
private byte[] filePartData;
private long startTime;
private boolean done;
public CopyFileParams(@NonNull String fileName, @NonNull byte[] filePartData, long startTime, boolean done) {
this.fileName = fileName;
this.filePartData = filePartData;
this.startTime = startTime;
this.done = done;
}
protected CopyFileParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<CopyFileParams> CREATOR = new Creator<CopyFileParams>() {
@Override
public CopyFileParams createFromParcel(Parcel in) {
return new CopyFileParams(in);
}
@Override
public CopyFileParams[] newArray(int size) {
return new CopyFileParams[size];
}
};
public String getFileName() {
return fileName;
}
public byte[] getFilePartData() {
return filePartData;
}
public boolean isDone() {
return done;
}
public long getStartTime() {
return startTime;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("fileName", fileName);
bundle.putByteArray("filePartData", filePartData);
bundle.putLong("startTime", startTime);
bundle.putBoolean("done", done);
}
@Override
protected void readFromBundle(Bundle bundle) {
fileName = bundle.getString("fileName");
filePartData = bundle.getByteArray("filePartData");
startTime = bundle.getLong("startTime");
done = bundle.getBoolean("done");
}
@Override
public String toString() {
return "CopyFileParams {" +
" fileName=" + fileName +
", filePartData size=" + filePartData.length +
", startTime=" + startTime +
", done=" + done +
" }";
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.customization;
parcelable CustomizationInfoParams;

View file

@ -0,0 +1,173 @@
package net.osmand.aidlapi.customization;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
import net.osmand.aidlapi.navdrawer.NavDrawerFooterParams;
import net.osmand.aidlapi.navdrawer.NavDrawerHeaderParams;
import net.osmand.aidlapi.navdrawer.SetNavDrawerItemsParams;
import net.osmand.aidlapi.plugins.PluginParams;
import java.util.ArrayList;
import java.util.List;
public class CustomizationInfoParams extends AidlParams {
private OsmandSettingsParams settingsParams;
private NavDrawerHeaderParams navDrawerHeaderParams;
private NavDrawerFooterParams navDrawerFooterParams;
private SetNavDrawerItemsParams navDrawerItemsParams;
private ArrayList<SetWidgetsParams> visibilityWidgetsParams = new ArrayList<>();
private ArrayList<SetWidgetsParams> availabilityWidgetsParams = new ArrayList<>();
private ArrayList<PluginParams> pluginsParams = new ArrayList<>();
private ArrayList<String> featuresEnabledIds = new ArrayList<>();
private ArrayList<String> featuresDisabledIds = new ArrayList<>();
private ArrayList<String> featuresEnabledPatterns = new ArrayList<>();
private ArrayList<String> featuresDisabledPatterns = new ArrayList<>();
public CustomizationInfoParams(OsmandSettingsParams settingsParams,
NavDrawerHeaderParams navDrawerHeaderParams,
NavDrawerFooterParams navDrawerFooterParams,
SetNavDrawerItemsParams navDrawerItemsParams,
ArrayList<SetWidgetsParams> visibilityWidgetsParams,
ArrayList<SetWidgetsParams> availabilityWidgetsParams,
ArrayList<PluginParams> pluginsParams,
List<String> featuresEnabledIds,
List<String> featuresDisabledIds,
List<String> featuresEnabledPatterns,
List<String> featuresDisabledPatterns) {
this.settingsParams = settingsParams;
this.navDrawerHeaderParams = navDrawerHeaderParams;
this.navDrawerFooterParams = navDrawerFooterParams;
this.navDrawerItemsParams = navDrawerItemsParams;
if (visibilityWidgetsParams != null) {
this.visibilityWidgetsParams.addAll(visibilityWidgetsParams);
}
if (availabilityWidgetsParams != null) {
this.availabilityWidgetsParams.addAll(availabilityWidgetsParams);
}
if (pluginsParams != null) {
this.pluginsParams.addAll(pluginsParams);
}
if (featuresEnabledIds != null) {
this.featuresEnabledIds.addAll(featuresEnabledIds);
}
if (featuresDisabledIds != null) {
this.featuresDisabledIds.addAll(featuresDisabledIds);
}
if (featuresEnabledPatterns != null) {
this.featuresEnabledPatterns.addAll(featuresEnabledPatterns);
}
if (featuresDisabledPatterns != null) {
this.featuresDisabledPatterns.addAll(featuresDisabledPatterns);
}
}
public CustomizationInfoParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<CustomizationInfoParams> CREATOR = new Creator<CustomizationInfoParams>() {
@Override
public CustomizationInfoParams createFromParcel(Parcel in) {
return new CustomizationInfoParams(in);
}
@Override
public CustomizationInfoParams[] newArray(int size) {
return new CustomizationInfoParams[size];
}
};
public OsmandSettingsParams getSettingsParams() {
return settingsParams;
}
public NavDrawerHeaderParams getNavDrawerHeaderParams() {
return navDrawerHeaderParams;
}
public NavDrawerFooterParams getNavDrawerFooterParams() {
return navDrawerFooterParams;
}
public SetNavDrawerItemsParams getNavDrawerItemsParams() {
return navDrawerItemsParams;
}
public ArrayList<SetWidgetsParams> getVisibilityWidgetsParams() {
return visibilityWidgetsParams;
}
public ArrayList<SetWidgetsParams> getAvailabilityWidgetsParams() {
return availabilityWidgetsParams;
}
public ArrayList<PluginParams> getPluginsParams() {
return pluginsParams;
}
public List<String> getFeaturesEnabledIds() {
return featuresEnabledIds;
}
public List<String> getFeaturesDisabledIds() {
return featuresDisabledIds;
}
public List<String> getFeaturesEnabledPatterns() {
return featuresEnabledPatterns;
}
public List<String> getFeaturesDisabledPatterns() {
return featuresDisabledPatterns;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("settingsParams", settingsParams);
bundle.putParcelable("navDrawerHeaderParams", navDrawerHeaderParams);
bundle.putParcelable("navDrawerFooterParams", navDrawerFooterParams);
bundle.putParcelable("navDrawerItemsParams", navDrawerItemsParams);
bundle.putParcelableArrayList("visibilityWidgetsParams", visibilityWidgetsParams);
bundle.putParcelableArrayList("availabilityWidgetsParams", availabilityWidgetsParams);
bundle.putParcelableArrayList("pluginsParams", pluginsParams);
bundle.putStringArrayList("featuresEnabledIds", featuresEnabledIds);
bundle.putStringArrayList("featuresDisabledIds", featuresDisabledIds);
bundle.putStringArrayList("featuresEnabledPatterns", featuresEnabledPatterns);
bundle.putStringArrayList("featuresDisabledPatterns", featuresDisabledPatterns);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(OsmandSettingsParams.class.getClassLoader());
settingsParams = bundle.getParcelable("settingsParams");
bundle.setClassLoader(NavDrawerHeaderParams.class.getClassLoader());
navDrawerHeaderParams = bundle.getParcelable("navDrawerHeaderParams");
bundle.setClassLoader(NavDrawerFooterParams.class.getClassLoader());
navDrawerFooterParams = bundle.getParcelable("navDrawerFooterParams");
bundle.setClassLoader(SetNavDrawerItemsParams.class.getClassLoader());
navDrawerItemsParams = bundle.getParcelable("navDrawerItemsParams");
bundle.setClassLoader(SetWidgetsParams.class.getClassLoader());
visibilityWidgetsParams = bundle.getParcelableArrayList("visibilityWidgetsParams");
availabilityWidgetsParams = bundle.getParcelableArrayList("availabilityWidgetsParams");
bundle.setClassLoader(PluginParams.class.getClassLoader());
pluginsParams = bundle.getParcelableArrayList("pluginsParams");
featuresEnabledIds = bundle.getStringArrayList("featuresEnabledIds");
featuresDisabledIds = bundle.getStringArrayList("featuresDisabledIds");
featuresEnabledPatterns = bundle.getStringArrayList("featuresEnabledPatterns");
featuresDisabledPatterns = bundle.getStringArrayList("featuresDisabledPatterns");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.customization;
parcelable OsmandSettingsInfoParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.customization;
import android.os.Bundle;
import android.os.Parcel;
import android.support.annotation.NonNull;
import net.osmand.aidlapi.AidlParams;
public class OsmandSettingsInfoParams extends AidlParams {
private String sharedPreferencesName;
public OsmandSettingsInfoParams(@NonNull String sharedPreferencesName) {
this.sharedPreferencesName = sharedPreferencesName;
}
public OsmandSettingsInfoParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<OsmandSettingsInfoParams> CREATOR = new Creator<OsmandSettingsInfoParams>() {
@Override
public OsmandSettingsInfoParams createFromParcel(Parcel in) {
return new OsmandSettingsInfoParams(in);
}
@Override
public OsmandSettingsInfoParams[] newArray(int size) {
return new OsmandSettingsInfoParams[size];
}
};
public String getSharedPreferencesName() {
return sharedPreferencesName;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("sharedPreferencesName", sharedPreferencesName);
}
@Override
protected void readFromBundle(Bundle bundle) {
sharedPreferencesName = bundle.getString("sharedPreferencesName");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.customization;
parcelable OsmandSettingsParams;

View file

@ -0,0 +1,55 @@
package net.osmand.aidlapi.customization;
import android.os.Bundle;
import android.os.Parcel;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import net.osmand.aidlapi.AidlParams;
public class OsmandSettingsParams extends AidlParams {
private String sharedPreferencesName;
private Bundle bundleSettings;
public OsmandSettingsParams(@NonNull String sharedPreferencesName, @Nullable Bundle bundle) {
this.sharedPreferencesName = sharedPreferencesName;
this.bundleSettings = bundle;
}
public OsmandSettingsParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<OsmandSettingsParams> CREATOR = new Creator<OsmandSettingsParams>() {
@Override
public OsmandSettingsParams createFromParcel(Parcel in) {
return new OsmandSettingsParams(in);
}
@Override
public OsmandSettingsParams[] newArray(int size) {
return new OsmandSettingsParams[size];
}
};
public String getSharedPreferencesName() {
return sharedPreferencesName;
}
public Bundle getBundle() {
return bundleSettings;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("sharedPreferencesName", sharedPreferencesName);
bundle.putBundle("bundleSettings", bundleSettings);
}
@Override
protected void readFromBundle(Bundle bundle) {
sharedPreferencesName = bundle.getString("sharedPreferencesName");
bundleSettings = bundle.getBundle("bundleSettings");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.customization;
parcelable ProfileSettingsParams;

View file

@ -0,0 +1,62 @@
package net.osmand.aidlapi.customization;
import android.net.Uri;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class ProfileSettingsParams extends AidlParams {
private Uri profileSettingsUri;
private String latestChanges;
private int version;
public ProfileSettingsParams(Uri profileSettingsUri, String latestChanges, int version) {
this.profileSettingsUri = profileSettingsUri;
this.latestChanges = latestChanges;
this.version = version;
}
public ProfileSettingsParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<ProfileSettingsParams> CREATOR = new Creator<ProfileSettingsParams>() {
@Override
public ProfileSettingsParams createFromParcel(Parcel in) {
return new ProfileSettingsParams(in);
}
@Override
public ProfileSettingsParams[] newArray(int size) {
return new ProfileSettingsParams[size];
}
};
public int getVersion() {
return version;
}
public String getLatestChanges() {
return latestChanges;
}
public Uri getProfileSettingsUri() {
return profileSettingsUri;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putInt("version", version);
bundle.putString("latestChanges", latestChanges);
bundle.putParcelable("profileSettingsUri", profileSettingsUri);
}
@Override
protected void readFromBundle(Bundle bundle) {
version = bundle.getInt("version");
latestChanges = bundle.getString("latestChanges");
profileSettingsUri = bundle.getParcelable("profileSettingsUri");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.customization;
parcelable SetWidgetsParams;

View file

@ -0,0 +1,59 @@
package net.osmand.aidlapi.customization;
import android.os.Bundle;
import android.os.Parcel;
import android.support.annotation.Nullable;
import net.osmand.aidlapi.AidlParams;
import java.util.ArrayList;
import java.util.List;
public class SetWidgetsParams extends AidlParams {
private String widgetKey;
private ArrayList<String> appModesKeys = new ArrayList<>();
public SetWidgetsParams(String widgetKey, @Nullable List<String> appModesKeys) {
this.widgetKey = widgetKey;
if (appModesKeys != null) {
this.appModesKeys.addAll(appModesKeys);
}
}
public SetWidgetsParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<SetWidgetsParams> CREATOR = new Creator<SetWidgetsParams>() {
@Override
public SetWidgetsParams createFromParcel(Parcel in) {
return new SetWidgetsParams(in);
}
@Override
public SetWidgetsParams[] newArray(int size) {
return new SetWidgetsParams[size];
}
};
public String getWidgetKey() {
return widgetKey;
}
public List<String> getAppModesKeys() {
return appModesKeys;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("widgetKey", widgetKey);
bundle.putStringArrayList("appModesKeys", appModesKeys);
}
@Override
protected void readFromBundle(Bundle bundle) {
widgetKey = bundle.getString("widgetKey");
appModesKeys = bundle.getStringArrayList("appModesKeys");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.favorite;
parcelable AFavorite;

View file

@ -0,0 +1,94 @@
package net.osmand.aidlapi.favorite;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class AFavorite extends AidlParams {
private double lat;
private double lon;
private String name;
private String description;
private String category;
private String color;
private boolean visible;
public AFavorite(double lat, double lon, String name, String description,
String category, String color, boolean visible) {
this.lat = lat;
this.lon = lon;
this.name = name;
this.description = description;
this.category = category;
this.color = color;
this.visible = visible;
}
public AFavorite(Parcel in) {
readFromParcel(in);
}
public static final Creator<AFavorite> CREATOR = new Creator<AFavorite>() {
@Override
public AFavorite createFromParcel(Parcel in) {
return new AFavorite(in);
}
@Override
public AFavorite[] newArray(int size) {
return new AFavorite[size];
}
};
public double getLat() {
return lat;
}
public double getLon() {
return lon;
}
public String getName() {
return name;
}
public String getDescription() {
return description;
}
public String getCategory() {
return category;
}
public String getColor() {
return color;
}
public boolean isVisible() {
return visible;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putDouble("lat", lat);
bundle.putDouble("lon", lon);
bundle.putString("name", name);
bundle.putString("description", description);
bundle.putString("category", category);
bundle.putString("color", color);
bundle.putBoolean("visible", visible);
}
@Override
protected void readFromBundle(Bundle bundle) {
lat = bundle.getDouble("lat");
lon = bundle.getDouble("lon");
name = bundle.getString("name");
description = bundle.getString("description");
category = bundle.getString("category");
color = bundle.getString("color");
visible = bundle.getBoolean("visible");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.favorite;
parcelable AddFavoriteParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.favorite;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class AddFavoriteParams extends AidlParams {
private AFavorite favorite;
public AddFavoriteParams(AFavorite favorite) {
this.favorite = favorite;
}
public AddFavoriteParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<AddFavoriteParams> CREATOR = new Creator<AddFavoriteParams>() {
@Override
public AddFavoriteParams createFromParcel(Parcel in) {
return new AddFavoriteParams(in);
}
@Override
public AddFavoriteParams[] newArray(int size) {
return new AddFavoriteParams[size];
}
};
public AFavorite getFavorite() {
return favorite;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("favorite", favorite);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AFavorite.class.getClassLoader());
favorite = bundle.getParcelable("favorite");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.favorite;
parcelable RemoveFavoriteParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.favorite;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class RemoveFavoriteParams extends AidlParams {
private AFavorite favorite;
public RemoveFavoriteParams(AFavorite favorite) {
this.favorite = favorite;
}
public RemoveFavoriteParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<RemoveFavoriteParams> CREATOR = new Creator<RemoveFavoriteParams>() {
@Override
public RemoveFavoriteParams createFromParcel(Parcel in) {
return new RemoveFavoriteParams(in);
}
@Override
public RemoveFavoriteParams[] newArray(int size) {
return new RemoveFavoriteParams[size];
}
};
public AFavorite getFavorite() {
return favorite;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("favorite", favorite);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AFavorite.class.getClassLoader());
favorite = bundle.getParcelable("favorite");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.favorite;
parcelable UpdateFavoriteParams;

View file

@ -0,0 +1,54 @@
package net.osmand.aidlapi.favorite;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class UpdateFavoriteParams extends AidlParams {
private AFavorite favoritePrev;
private AFavorite favoriteNew;
public UpdateFavoriteParams(AFavorite favoritePrev, AFavorite favoriteNew) {
this.favoritePrev = favoritePrev;
this.favoriteNew = favoriteNew;
}
public UpdateFavoriteParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<UpdateFavoriteParams> CREATOR = new Creator<UpdateFavoriteParams>() {
@Override
public UpdateFavoriteParams createFromParcel(Parcel in) {
return new UpdateFavoriteParams(in);
}
@Override
public UpdateFavoriteParams[] newArray(int size) {
return new UpdateFavoriteParams[size];
}
};
public AFavorite getFavoritePrev() {
return favoritePrev;
}
public AFavorite getFavoriteNew() {
return favoriteNew;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("favoritePrev", favoritePrev);
bundle.putParcelable("favoriteNew", favoriteNew);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AFavorite.class.getClassLoader());
favoritePrev = bundle.getParcelable("favoritePrev");
favoriteNew = bundle.getParcelable("favoriteNew");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.favorite.group;
parcelable AFavoriteGroup;

View file

@ -0,0 +1,61 @@
package net.osmand.aidlapi.favorite.group;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class AFavoriteGroup extends AidlParams {
private String name;
private String color;
private boolean visible;
public AFavoriteGroup(String name, String color, boolean visible) {
this.name = name;
this.color = color;
this.visible = visible;
}
public AFavoriteGroup(Parcel in) {
readFromParcel(in);
}
public static final Creator<AFavoriteGroup> CREATOR = new Creator<AFavoriteGroup>() {
@Override
public AFavoriteGroup createFromParcel(Parcel in) {
return new AFavoriteGroup(in);
}
@Override
public AFavoriteGroup[] newArray(int size) {
return new AFavoriteGroup[size];
}
};
public String getName() {
return name;
}
public String getColor() {
return color;
}
public boolean isVisible() {
return visible;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("name", name);
bundle.putString("color", color);
bundle.putBoolean("visible", visible);
}
@Override
protected void readFromBundle(Bundle bundle) {
name = bundle.getString("name");
color = bundle.getString("color");
visible = bundle.getBoolean("visible");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.favorite.group;
parcelable AddFavoriteGroupParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.favorite.group;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class AddFavoriteGroupParams extends AidlParams {
private AFavoriteGroup favoriteGroup;
public AddFavoriteGroupParams(AFavoriteGroup favoriteGroup) {
this.favoriteGroup = favoriteGroup;
}
public AddFavoriteGroupParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<AddFavoriteGroupParams> CREATOR = new Creator<AddFavoriteGroupParams>() {
@Override
public AddFavoriteGroupParams createFromParcel(Parcel in) {
return new AddFavoriteGroupParams(in);
}
@Override
public AddFavoriteGroupParams[] newArray(int size) {
return new AddFavoriteGroupParams[size];
}
};
public AFavoriteGroup getFavoriteGroup() {
return favoriteGroup;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("favoriteGroup", favoriteGroup);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AFavoriteGroup.class.getClassLoader());
favoriteGroup = bundle.getParcelable("favoriteGroup");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.favorite.group;
parcelable RemoveFavoriteGroupParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.favorite.group;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class RemoveFavoriteGroupParams extends AidlParams {
private AFavoriteGroup favoriteGroup;
public RemoveFavoriteGroupParams(AFavoriteGroup favoriteGroup) {
this.favoriteGroup = favoriteGroup;
}
public RemoveFavoriteGroupParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<RemoveFavoriteGroupParams> CREATOR = new Creator<RemoveFavoriteGroupParams>() {
@Override
public RemoveFavoriteGroupParams createFromParcel(Parcel in) {
return new RemoveFavoriteGroupParams(in);
}
@Override
public RemoveFavoriteGroupParams[] newArray(int size) {
return new RemoveFavoriteGroupParams[size];
}
};
public AFavoriteGroup getFavoriteGroup() {
return favoriteGroup;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("favoriteGroup", favoriteGroup);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AFavoriteGroup.class.getClassLoader());
favoriteGroup = bundle.getParcelable("favoriteGroup");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.favorite.group;
parcelable UpdateFavoriteGroupParams;

View file

@ -0,0 +1,54 @@
package net.osmand.aidlapi.favorite.group;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class UpdateFavoriteGroupParams extends AidlParams {
private AFavoriteGroup favoriteGroupPrev;
private AFavoriteGroup favoriteGroupNew;
public UpdateFavoriteGroupParams(AFavoriteGroup favoriteGroup, AFavoriteGroup favoriteGroupNew) {
this.favoriteGroupPrev = favoriteGroup;
this.favoriteGroupNew = favoriteGroupNew;
}
public UpdateFavoriteGroupParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<UpdateFavoriteGroupParams> CREATOR = new Creator<UpdateFavoriteGroupParams>() {
@Override
public UpdateFavoriteGroupParams createFromParcel(Parcel in) {
return new UpdateFavoriteGroupParams(in);
}
@Override
public UpdateFavoriteGroupParams[] newArray(int size) {
return new UpdateFavoriteGroupParams[size];
}
};
public AFavoriteGroup getFavoriteGroupPrev() {
return favoriteGroupPrev;
}
public AFavoriteGroup getFavoriteGroupNew() {
return favoriteGroupNew;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("favoriteGroupPrev", favoriteGroupPrev);
bundle.putParcelable("favoriteGroupNew", favoriteGroupNew);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AFavoriteGroup.class.getClassLoader());
favoriteGroupPrev = bundle.getParcelable("favoriteGroupPrev");
favoriteGroupNew = bundle.getParcelable("favoriteGroupNew");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable AGpxBitmap;

View file

@ -0,0 +1,48 @@
package net.osmand.aidlapi.gpx;
import android.graphics.Bitmap;
import android.os.Bundle;
import android.os.Parcel;
import android.support.annotation.NonNull;
import net.osmand.aidlapi.AidlParams;
public class AGpxBitmap extends AidlParams {
private Bitmap bitmap;
public AGpxBitmap(@NonNull Bitmap bitmap) {
this.bitmap = bitmap;
}
public AGpxBitmap(Parcel in) {
readFromParcel(in);
}
public Bitmap getBitmap() {
return bitmap;
}
public static final Creator<AGpxBitmap> CREATOR = new Creator<AGpxBitmap>() {
@Override
public AGpxBitmap createFromParcel(Parcel in) {
return new AGpxBitmap(in);
}
@Override
public AGpxBitmap[] newArray(int size) {
return new AGpxBitmap[size];
}
};
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("bitmap", bitmap);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(Bitmap.class.getClassLoader());
bitmap = bundle.getParcelable("bitmap");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable AGpxFile;

View file

@ -0,0 +1,88 @@
package net.osmand.aidlapi.gpx;
import android.os.Bundle;
import android.os.Parcel;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import net.osmand.aidlapi.AidlParams;
public class AGpxFile extends AidlParams {
private String fileName;
private long modifiedTime;
private long fileSize;
private boolean active;
private String color;
private AGpxFileDetails details;
public AGpxFile(@NonNull String fileName, long modifiedTime, long fileSize, boolean active, String color, @Nullable AGpxFileDetails details) {
this.fileName = fileName;
this.modifiedTime = modifiedTime;
this.fileSize = fileSize;
this.active = active;
this.color = color;
this.details = details;
}
public AGpxFile(Parcel in) {
readFromParcel(in);
}
public static final Creator<AGpxFile> CREATOR = new Creator<AGpxFile>() {
@Override
public AGpxFile createFromParcel(Parcel in) {
return new AGpxFile(in);
}
@Override
public AGpxFile[] newArray(int size) {
return new AGpxFile[size];
}
};
public String getFileName() {
return fileName;
}
public long getModifiedTime() {
return modifiedTime;
}
public long getFileSize() {
return fileSize;
}
public boolean isActive() {
return active;
}
public String getColor() {
return color;
}
public AGpxFileDetails getDetails() {
return details;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("fileName", fileName);
bundle.putLong("modifiedTime", modifiedTime);
bundle.putLong("fileSize", fileSize);
bundle.putBoolean("active", active);
bundle.putParcelable("details", details);
bundle.putString("color", color);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AGpxFileDetails.class.getClassLoader());
fileName = bundle.getString("fileName");
modifiedTime = bundle.getLong("modifiedTime");
fileSize = bundle.getLong("fileSize");
active = bundle.getBoolean("active");
details = bundle.getParcelable("details");
color = bundle.getString("color");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable AGpxFileDetails;

View file

@ -0,0 +1,197 @@
package net.osmand.aidlapi.gpx;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
import java.util.ArrayList;
import java.util.List;
import java.util.Set;
public class AGpxFileDetails extends AidlParams {
private float totalDistance = 0;
private int totalTracks = 0;
private long startTime = Long.MAX_VALUE;
private long endTime = Long.MIN_VALUE;
private long timeSpan = 0;
private long timeMoving = 0;
private float totalDistanceMoving = 0;
private double diffElevationUp = 0;
private double diffElevationDown = 0;
private double avgElevation = 0;
private double minElevation = 99999;
private double maxElevation = -100;
private float minSpeed = Float.MAX_VALUE;
private float maxSpeed = 0;
private float avgSpeed;
private int points;
private int wptPoints = 0;
private ArrayList<String> wptCategoryNames = new ArrayList<>();
public AGpxFileDetails(float totalDistance, int totalTracks,
long startTime, long endTime,
long timeSpan, long timeMoving, float totalDistanceMoving,
double diffElevationUp, double diffElevationDown,
double avgElevation, double minElevation, double maxElevation,
float minSpeed, float maxSpeed, float avgSpeed,
int points, int wptPoints, Set<String> wptCategoryNames) {
this.totalDistance = totalDistance;
this.totalTracks = totalTracks;
this.startTime = startTime;
this.endTime = endTime;
this.timeSpan = timeSpan;
this.timeMoving = timeMoving;
this.totalDistanceMoving = totalDistanceMoving;
this.diffElevationUp = diffElevationUp;
this.diffElevationDown = diffElevationDown;
this.avgElevation = avgElevation;
this.minElevation = minElevation;
this.maxElevation = maxElevation;
this.minSpeed = minSpeed;
this.maxSpeed = maxSpeed;
this.avgSpeed = avgSpeed;
this.points = points;
this.wptPoints = wptPoints;
if (wptCategoryNames != null) {
this.wptCategoryNames.addAll(wptCategoryNames);
}
}
public AGpxFileDetails(Parcel in) {
readFromParcel(in);
}
public static final Creator<AGpxFileDetails> CREATOR = new Creator<AGpxFileDetails>() {
@Override
public AGpxFileDetails createFromParcel(Parcel in) {
return new AGpxFileDetails(in);
}
@Override
public AGpxFileDetails[] newArray(int size) {
return new AGpxFileDetails[size];
}
};
public float getTotalDistance() {
return totalDistance;
}
public int getTotalTracks() {
return totalTracks;
}
public long getStartTime() {
return startTime;
}
public long getEndTime() {
return endTime;
}
public long getTimeSpan() {
return timeSpan;
}
public long getTimeMoving() {
return timeMoving;
}
public float getTotalDistanceMoving() {
return totalDistanceMoving;
}
public double getDiffElevationUp() {
return diffElevationUp;
}
public double getDiffElevationDown() {
return diffElevationDown;
}
public double getAvgElevation() {
return avgElevation;
}
public double getMinElevation() {
return minElevation;
}
public double getMaxElevation() {
return maxElevation;
}
public float getMinSpeed() {
return minSpeed;
}
public float getMaxSpeed() {
return maxSpeed;
}
public float getAvgSpeed() {
return avgSpeed;
}
public int getPoints() {
return points;
}
public int getWptPoints() {
return wptPoints;
}
public List<String> getWptCategoryNames() {
return wptCategoryNames;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putFloat("totalDistance", totalDistance);
bundle.putInt("totalTracks", totalTracks);
bundle.putLong("startTime", startTime);
bundle.putLong("endTime", endTime);
bundle.putLong("timeSpan", timeSpan);
bundle.putLong("timeMoving", timeMoving);
bundle.putFloat("totalDistanceMoving", totalDistanceMoving);
bundle.putDouble("diffElevationUp", diffElevationUp);
bundle.putDouble("diffElevationDown", diffElevationDown);
bundle.putDouble("avgElevation", avgElevation);
bundle.putDouble("minElevation", minElevation);
bundle.putDouble("maxElevation", maxElevation);
bundle.putFloat("minSpeed", minSpeed);
bundle.putFloat("maxSpeed", maxSpeed);
bundle.putFloat("avgSpeed", avgSpeed);
bundle.putInt("points", points);
bundle.putInt("wptPoints", wptPoints);
bundle.putStringArrayList("wptCategoryNames", wptCategoryNames);
}
@Override
protected void readFromBundle(Bundle bundle) {
totalDistance = bundle.getFloat("totalDistance");
totalTracks = bundle.getInt("totalTracks");
startTime = bundle.getLong("startTime");
endTime = bundle.getLong("endTime");
timeSpan = bundle.getLong("timeSpan");
timeMoving = bundle.getLong("timeMoving");
totalDistanceMoving = bundle.getFloat("totalDistanceMoving");
diffElevationUp = bundle.getDouble("diffElevationUp");
diffElevationDown = bundle.getDouble("diffElevationDown");
avgElevation = bundle.getDouble("avgElevation");
minElevation = bundle.getDouble("minElevation");
maxElevation = bundle.getDouble("maxElevation");
minSpeed = bundle.getFloat("minSpeed");
maxSpeed = bundle.getFloat("maxSpeed");
avgSpeed = bundle.getFloat("avgSpeed");
points = bundle.getInt("points");
wptPoints = bundle.getInt("wptPoints");
wptCategoryNames = bundle.getStringArrayList("wptCategoryNames");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable ASelectedGpxFile;

View file

@ -0,0 +1,76 @@
package net.osmand.aidlapi.gpx;
import android.os.Bundle;
import android.os.Parcel;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import net.osmand.aidlapi.AidlParams;
public class ASelectedGpxFile extends AidlParams {
private String fileName;
private long modifiedTime;
private long fileSize;
private AGpxFileDetails details;
public ASelectedGpxFile(@NonNull String fileName) {
this.fileName = fileName;
}
public ASelectedGpxFile(@NonNull String fileName, long modifiedTime, long fileSize, @Nullable AGpxFileDetails details) {
this.fileName = fileName;
this.modifiedTime = modifiedTime;
this.fileSize = fileSize;
this.details = details;
}
public ASelectedGpxFile(Parcel in) {
readFromParcel(in);
}
public static final Creator<ASelectedGpxFile> CREATOR = new Creator<ASelectedGpxFile>() {
@Override
public ASelectedGpxFile createFromParcel(Parcel in) {
return new ASelectedGpxFile(in);
}
@Override
public ASelectedGpxFile[] newArray(int size) {
return new ASelectedGpxFile[size];
}
};
public String getFileName() {
return fileName;
}
public long getModifiedTime() {
return modifiedTime;
}
public long getFileSize() {
return fileSize;
}
public AGpxFileDetails getDetails() {
return details;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("fileName", fileName);
bundle.putLong("modifiedTime", modifiedTime);
bundle.putLong("fileSize", fileSize);
bundle.putParcelable("details", details);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AGpxFileDetails.class.getClassLoader());
fileName = bundle.getString("fileName");
modifiedTime = bundle.getLong("modifiedTime");
fileSize = bundle.getLong("fileSize");
details = bundle.getParcelable("details");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable CreateGpxBitmapParams;

View file

@ -0,0 +1,100 @@
package net.osmand.aidlapi.gpx;
import android.net.Uri;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
import java.io.File;
public class CreateGpxBitmapParams extends AidlParams {
private File gpxFile;
private Uri gpxUri;
private float density;
private int widthPixels;
private int heightPixels;
private int color; //ARGB color int
public CreateGpxBitmapParams(File gpxFile, float density, int widthPixels, int heightPixels, int color) {
this.gpxFile = gpxFile;
this.density = density;
this.widthPixels = widthPixels;
this.heightPixels = heightPixels;
this.color = color;
}
public CreateGpxBitmapParams(Uri gpxUri, float density, int widthPixels, int heightPixels, int color) {
this.gpxUri = gpxUri;
this.density = density;
this.widthPixels = widthPixels;
this.heightPixels = heightPixels;
this.color = color;
}
public CreateGpxBitmapParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<CreateGpxBitmapParams> CREATOR = new Creator<CreateGpxBitmapParams>() {
@Override
public CreateGpxBitmapParams createFromParcel(Parcel in) {
return new CreateGpxBitmapParams(in);
}
@Override
public CreateGpxBitmapParams[] newArray(int size) {
return new CreateGpxBitmapParams[size];
}
};
public File getGpxFile() {
return gpxFile;
}
public Uri getGpxUri() {
return gpxUri;
}
public int getWidthPixels() {
return widthPixels;
}
public int getHeightPixels() {
return heightPixels;
}
public float getDensity() {
return density;
}
public int getColor() {
return color;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("gpxAbsolutePath", gpxFile != null ? gpxFile.getAbsolutePath() : null);
bundle.putParcelable("gpxUri", gpxUri);
bundle.putFloat("density", density);
bundle.putInt("widthPixels", widthPixels);
bundle.putInt("heightPixels", heightPixels);
bundle.putInt("color", color);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(Uri.class.getClassLoader());
String gpxAbsolutePath = bundle.getString("gpxAbsolutePath");
if (gpxAbsolutePath != null) {
gpxFile = new File(gpxAbsolutePath);
}
gpxUri = bundle.getParcelable("gpxUri");
density = bundle.getFloat("density");
widthPixels = bundle.getInt("widthPixels");
heightPixels = bundle.getInt("heightPixels");
color = bundle.getInt("color");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable HideGpxParams;

View file

@ -0,0 +1,45 @@
package net.osmand.aidlapi.gpx;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class HideGpxParams extends AidlParams {
private String fileName;
public HideGpxParams(String fileName) {
this.fileName = fileName;
}
public HideGpxParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<HideGpxParams> CREATOR = new Creator<HideGpxParams>() {
@Override
public HideGpxParams createFromParcel(Parcel in) {
return new HideGpxParams(in);
}
@Override
public HideGpxParams[] newArray(int size) {
return new HideGpxParams[size];
}
};
public String getFileName() {
return fileName;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("fileName", fileName);
}
@Override
protected void readFromBundle(Bundle bundle) {
fileName = bundle.getString("fileName");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable ImportGpxParams;

View file

@ -0,0 +1,105 @@
package net.osmand.aidlapi.gpx;
import android.net.Uri;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
import java.io.File;
public class ImportGpxParams extends AidlParams {
private File gpxFile;
private Uri gpxUri;
private String sourceRawData;
private String destinationPath;
private String color;
private boolean show;
public ImportGpxParams(File gpxFile, String destinationPath, String color, boolean show) {
this.gpxFile = gpxFile;
this.destinationPath = destinationPath;
this.color = color;
this.show = show;
}
public ImportGpxParams(Uri gpxUri, String destinationPath, String color, boolean show) {
this.gpxUri = gpxUri;
this.destinationPath = destinationPath;
this.color = color;
this.show = show;
}
public ImportGpxParams(String sourceRawData, String destinationPath, String color, boolean show) {
this.sourceRawData = sourceRawData;
this.destinationPath = destinationPath;
this.color = color;
this.show = show;
}
public ImportGpxParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<ImportGpxParams> CREATOR = new Creator<ImportGpxParams>() {
@Override
public ImportGpxParams createFromParcel(Parcel in) {
return new ImportGpxParams(in);
}
@Override
public ImportGpxParams[] newArray(int size) {
return new ImportGpxParams[size];
}
};
public File getGpxFile() {
return gpxFile;
}
public Uri getGpxUri() {
return gpxUri;
}
public String getSourceRawData() {
return sourceRawData;
}
public String getDestinationPath() {
return destinationPath;
}
public String getColor() {
return color;
}
public boolean isShow() {
return show;
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(Uri.class.getClassLoader());
String gpxAbsolutePath = bundle.getString("gpxAbsolutePath");
if (gpxAbsolutePath != null) {
gpxFile = new File(gpxAbsolutePath);
}
gpxUri = bundle.getParcelable("gpxUri");
sourceRawData = bundle.getString("sourceRawData");
destinationPath = bundle.getString("destinationPath");
color = bundle.getString("color");
show = bundle.getBoolean("show");
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("gpxAbsolutePath", gpxFile != null ? gpxFile.getAbsolutePath() : null);
bundle.putParcelable("gpxUri", gpxUri);
bundle.putString("sourceRawData", sourceRawData);
bundle.putString("destinationPath", destinationPath);
bundle.putString("color", color);
bundle.putBoolean("show", show);
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable RemoveGpxParams;

View file

@ -0,0 +1,45 @@
package net.osmand.aidlapi.gpx;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class RemoveGpxParams extends AidlParams {
private String fileName;
public RemoveGpxParams(String fileName) {
this.fileName = fileName;
}
public RemoveGpxParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<RemoveGpxParams> CREATOR = new Creator<RemoveGpxParams>() {
@Override
public RemoveGpxParams createFromParcel(Parcel in) {
return new RemoveGpxParams(in);
}
@Override
public RemoveGpxParams[] newArray(int size) {
return new RemoveGpxParams[size];
}
};
public String getFileName() {
return fileName;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("fileName", fileName);
}
@Override
protected void readFromBundle(Bundle bundle) {
fileName = bundle.getString("fileName");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable ShowGpxParams;

View file

@ -0,0 +1,45 @@
package net.osmand.aidlapi.gpx;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class ShowGpxParams extends AidlParams {
private String fileName;
public ShowGpxParams(String fileName) {
this.fileName = fileName;
}
public ShowGpxParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<ShowGpxParams> CREATOR = new Creator<ShowGpxParams>() {
@Override
public ShowGpxParams createFromParcel(Parcel in) {
return new ShowGpxParams(in);
}
@Override
public ShowGpxParams[] newArray(int size) {
return new ShowGpxParams[size];
}
};
public String getFileName() {
return fileName;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("fileName", fileName);
}
@Override
protected void readFromBundle(Bundle bundle) {
fileName = bundle.getString("fileName");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable StartGpxRecordingParams;

View file

@ -0,0 +1,28 @@
package net.osmand.aidlapi.gpx;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class StartGpxRecordingParams extends AidlParams {
public StartGpxRecordingParams() {
}
public StartGpxRecordingParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<StartGpxRecordingParams> CREATOR = new Creator<StartGpxRecordingParams>() {
@Override
public StartGpxRecordingParams createFromParcel(Parcel in) {
return new StartGpxRecordingParams(in);
}
@Override
public StartGpxRecordingParams[] newArray(int size) {
return new StartGpxRecordingParams[size];
}
};
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.gpx;
parcelable StopGpxRecordingParams;

View file

@ -0,0 +1,28 @@
package net.osmand.aidlapi.gpx;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class StopGpxRecordingParams extends AidlParams {
public StopGpxRecordingParams() {
}
public StopGpxRecordingParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<StopGpxRecordingParams> CREATOR = new Creator<StopGpxRecordingParams>() {
@Override
public StopGpxRecordingParams createFromParcel(Parcel in) {
return new StopGpxRecordingParams(in);
}
@Override
public StopGpxRecordingParams[] newArray(int size) {
return new StopGpxRecordingParams[size];
}
};
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.map;
parcelable ALatLon;

View file

@ -0,0 +1,84 @@
package net.osmand.aidlapi.map;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class ALatLon extends AidlParams {
private double longitude;
private double latitude;
public ALatLon(double latitude, double longitude) {
this.latitude = latitude;
this.longitude = longitude;
}
public ALatLon(Parcel in) {
readFromParcel(in);
}
public static final Creator<ALatLon> CREATOR = new Creator<ALatLon>() {
@Override
public ALatLon createFromParcel(Parcel in) {
return new ALatLon(in);
}
@Override
public ALatLon[] newArray(int size) {
return new ALatLon[size];
}
};
@Override
public int hashCode() {
final int prime = 31;
int result = 1;
int temp;
temp = (int) Math.floor(latitude * 10000);
result = prime * result + temp;
temp = (int) Math.floor(longitude * 10000);
result = prime * result + temp;
return result;
}
@Override
public boolean equals(Object obj) {
if (this == obj)
return true;
if (obj == null)
return false;
if (getClass() != obj.getClass())
return false;
ALatLon other = (ALatLon) obj;
return Math.abs(latitude - other.latitude) < 0.00001
&& Math.abs(longitude - other.longitude) < 0.00001;
}
@Override
public String toString() {
return "Lat " + ((float) latitude) + " Lon " + ((float) longitude);
}
public double getLatitude() {
return latitude;
}
public double getLongitude() {
return longitude;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putDouble("latitude", latitude);
bundle.putDouble("longitude", longitude);
}
@Override
protected void readFromBundle(Bundle bundle) {
latitude = bundle.getDouble("latitude");
longitude = bundle.getDouble("longitude");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.map;
parcelable SetMapLocationParams;

View file

@ -0,0 +1,69 @@
package net.osmand.aidlapi.map;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class SetMapLocationParams extends AidlParams {
private double latitude;
private double longitude;
private int zoom;
private boolean animated;
public SetMapLocationParams(double latitude, double longitude, int zoom, boolean animated) {
this.latitude = latitude;
this.longitude = longitude;
this.zoom = zoom;
this.animated = animated;
}
public SetMapLocationParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<SetMapLocationParams> CREATOR = new Creator<SetMapLocationParams>() {
@Override
public SetMapLocationParams createFromParcel(Parcel in) {
return new SetMapLocationParams(in);
}
@Override
public SetMapLocationParams[] newArray(int size) {
return new SetMapLocationParams[size];
}
};
public double getLatitude() {
return latitude;
}
public double getLongitude() {
return longitude;
}
public int getZoom() {
return zoom;
}
public boolean isAnimated() {
return animated;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putDouble("latitude", latitude);
bundle.putDouble("longitude", longitude);
bundle.putInt("zoom", zoom);
bundle.putBoolean("animated", animated);
}
@Override
protected void readFromBundle(Bundle bundle) {
latitude = bundle.getDouble("latitude");
longitude = bundle.getDouble("longitude");
zoom = bundle.getInt("zoom");
animated = bundle.getBoolean("animated");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer;
parcelable AMapLayer;

View file

@ -0,0 +1,180 @@
package net.osmand.aidlapi.maplayer;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
import net.osmand.aidlapi.maplayer.point.AMapPoint;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
public class AMapLayer extends AidlParams {
private String id;
private String name;
private float zOrder = 5.5f;
private Map<String, AMapPoint> points = new ConcurrentHashMap<>();
private boolean imagePoints = false;
private int circlePointMinZoom = 0;
private int circlePointMaxZoom = 6;
private int smallPointMinZoom = 7;
private int smallPointMaxZoom = 13;
private int bigPointMinZoom = 14;
private int bigPointMaxZoom = 22;
public AMapLayer(String id, String name, float zOrder, List<AMapPoint> pointList) {
this.id = id;
this.name = name;
this.zOrder = zOrder;
if (pointList != null) {
for (AMapPoint p : pointList) {
this.points.put(p.getId(), p);
}
}
}
public AMapLayer(Parcel in) {
readFromParcel(in);
}
public static final Creator<AMapLayer> CREATOR = new Creator<AMapLayer>() {
@Override
public AMapLayer createFromParcel(Parcel in) {
return new AMapLayer(in);
}
@Override
public AMapLayer[] newArray(int size) {
return new AMapLayer[size];
}
};
public String getId() {
return id;
}
public String getName() {
return name;
}
public float getZOrder() {
return zOrder;
}
public List<AMapPoint> getPoints() {
return new ArrayList<>(points.values());
}
public AMapPoint getPoint(String pointId) {
return points.get(pointId);
}
public boolean hasPoint(String pointId) {
return points.containsKey(pointId);
}
public void putPoint(AMapPoint point) {
points.put(point.getId(), point);
}
public void removePoint(String pointId) {
points.remove(pointId);
}
public boolean isImagePoints() {
return imagePoints;
}
public void setImagePoints(boolean imagePoints) {
this.imagePoints = imagePoints;
}
public void copyZoomBounds(AMapLayer layer) {
circlePointMinZoom = layer.circlePointMinZoom;
circlePointMaxZoom = layer.circlePointMaxZoom;
smallPointMinZoom = layer.smallPointMinZoom;
smallPointMaxZoom = layer.smallPointMaxZoom;
bigPointMinZoom = layer.bigPointMinZoom;
bigPointMaxZoom = layer.bigPointMaxZoom;
}
public void setCirclePointZoomBounds(int min, int max) {
circlePointMinZoom = min;
circlePointMaxZoom = max;
}
public void setSmallPointZoomBounds(int min, int max) {
smallPointMinZoom = min;
smallPointMaxZoom = max;
}
public void setBigPointZoomBounds(int min, int max) {
bigPointMinZoom = min;
bigPointMaxZoom = max;
}
public int getCirclePointMinZoom() {
return circlePointMinZoom;
}
public int getCirclePointMaxZoom() {
return circlePointMaxZoom;
}
public int getSmallPointMinZoom() {
return smallPointMinZoom;
}
public int getSmallPointMaxZoom() {
return smallPointMaxZoom;
}
public int getBigPointMinZoom() {
return bigPointMinZoom;
}
public int getBigPointMaxZoom() {
return bigPointMaxZoom;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("id", id);
bundle.putString("name", name);
bundle.putFloat("zOrder", zOrder);
bundle.putParcelableArrayList("points", new ArrayList<>(points.values()));
bundle.putBoolean("imagePoints", imagePoints);
bundle.putInt("circlePointMinZoom", circlePointMinZoom);
bundle.putInt("circlePointMaxZoom", circlePointMaxZoom);
bundle.putInt("smallPointMinZoom", smallPointMinZoom);
bundle.putInt("smallPointMaxZoom", smallPointMaxZoom);
bundle.putInt("bigPointMinZoom", bigPointMinZoom);
bundle.putInt("bigPointMaxZoom", bigPointMaxZoom);
}
@Override
protected void readFromBundle(Bundle bundle) {
id = bundle.getString("id");
name = bundle.getString("name");
zOrder = bundle.getFloat("zOrder");
imagePoints = bundle.getBoolean("imagePoints");
circlePointMinZoom = bundle.getInt("circlePointMinZoom");
circlePointMaxZoom = bundle.getInt("circlePointMaxZoom");
smallPointMinZoom = bundle.getInt("smallPointMinZoom");
smallPointMaxZoom = bundle.getInt("smallPointMaxZoom");
bigPointMinZoom = bundle.getInt("bigPointMinZoom");
bigPointMaxZoom = bundle.getInt("bigPointMaxZoom");
bundle.setClassLoader(AMapPoint.class.getClassLoader());
List<AMapPoint> pointList = bundle.getParcelableArrayList("points");
if (pointList != null) {
for (AMapPoint p : pointList) {
this.points.put(p.getId(), p);
}
}
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer;
parcelable AddMapLayerParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.maplayer;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class AddMapLayerParams extends AidlParams {
private AMapLayer layer;
public AddMapLayerParams(AMapLayer layer) {
this.layer = layer;
}
public AddMapLayerParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<AddMapLayerParams> CREATOR = new Creator<AddMapLayerParams>() {
@Override
public AddMapLayerParams createFromParcel(Parcel in) {
return new AddMapLayerParams(in);
}
@Override
public AddMapLayerParams[] newArray(int size) {
return new AddMapLayerParams[size];
}
};
public AMapLayer getLayer() {
return layer;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("layer", layer);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AMapLayer.class.getClassLoader());
layer = bundle.getParcelable("layer");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer;
parcelable RemoveMapLayerParams;

View file

@ -0,0 +1,45 @@
package net.osmand.aidlapi.maplayer;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class RemoveMapLayerParams extends AidlParams {
private String id;
public RemoveMapLayerParams(String id) {
this.id = id;
}
public RemoveMapLayerParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<RemoveMapLayerParams> CREATOR = new Creator<RemoveMapLayerParams>() {
@Override
public RemoveMapLayerParams createFromParcel(Parcel in) {
return new RemoveMapLayerParams(in);
}
@Override
public RemoveMapLayerParams[] newArray(int size) {
return new RemoveMapLayerParams[size];
}
};
public String getId() {
return id;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("id", id);
}
@Override
protected void readFromBundle(Bundle bundle) {
id = bundle.getString("id");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer;
parcelable UpdateMapLayerParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.maplayer;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class UpdateMapLayerParams extends AidlParams {
private AMapLayer layer;
public UpdateMapLayerParams(AMapLayer layer) {
this.layer = layer;
}
public UpdateMapLayerParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<UpdateMapLayerParams> CREATOR = new Creator<UpdateMapLayerParams>() {
@Override
public UpdateMapLayerParams createFromParcel(Parcel in) {
return new UpdateMapLayerParams(in);
}
@Override
public UpdateMapLayerParams[] newArray(int size) {
return new UpdateMapLayerParams[size];
}
};
public AMapLayer getLayer() {
return layer;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("layer", layer);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AMapLayer.class.getClassLoader());
layer = bundle.getParcelable("layer");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer.point;
parcelable AMapPoint;

View file

@ -0,0 +1,128 @@
package net.osmand.aidlapi.maplayer.point;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
import net.osmand.aidlapi.map.ALatLon;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class AMapPoint extends AidlParams {
public static final String POINT_IMAGE_URI_PARAM = "point_image_uri_param";
public static final String POINT_SPEED_PARAM = "point_speed_param";
public static final String POINT_TYPE_ICON_NAME_PARAM = "point_type_icon_name_param";
public static final String POINT_STALE_LOC_PARAM = "point_stale_loc_param";
public static final String POINT_BEARING_PARAM = "point_bearing_param";
private String id;
private String shortName;
private String fullName;
private String typeName;
private String layerId;
private int color;
private ALatLon location;
private ArrayList<String> details = new ArrayList<>();
private HashMap<String, String> params = new HashMap<>();
public AMapPoint(String id, String shortName, String fullName, String typeName, String layerId,
int color, ALatLon location, List<String> details, Map<String, String> params) {
this.id = id;
this.shortName = shortName;
this.fullName = fullName;
this.typeName = typeName;
this.layerId = layerId;
this.color = color;
this.location = location;
if (details != null) {
this.details.addAll(details);
}
if (params != null) {
this.params.putAll(params);
}
}
public AMapPoint(Parcel in) {
readFromParcel(in);
}
public static final Creator<AMapPoint> CREATOR = new Creator<AMapPoint>() {
@Override
public AMapPoint createFromParcel(Parcel in) {
return new AMapPoint(in);
}
@Override
public AMapPoint[] newArray(int size) {
return new AMapPoint[size];
}
};
public String getId() {
return id;
}
public String getShortName() {
return shortName;
}
public String getFullName() {
return fullName;
}
public String getTypeName() {
return typeName;
}
public String getLayerId() {
return layerId;
}
public int getColor() {
return color;
}
public ALatLon getLocation() {
return location;
}
public List<String> getDetails() {
return details;
}
public Map<String, String> getParams() {
return params;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("id", id);
bundle.putString("shortName", shortName);
bundle.putString("fullName", fullName);
bundle.putString("typeName", typeName);
bundle.putInt("color", color);
bundle.putParcelable("location", location);
bundle.putStringArrayList("details", details);
bundle.putSerializable("params", params);
bundle.putString("layerId", layerId);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(ALatLon.class.getClassLoader());
id = bundle.getString("id");
shortName = bundle.getString("shortName");
fullName = bundle.getString("fullName");
typeName = bundle.getString("typeName");
color = bundle.getInt("color");
location = bundle.getParcelable("location");
details = bundle.getStringArrayList("details");
params = (HashMap<String, String>) bundle.getSerializable("params");
layerId = bundle.getString("layerId");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer.point;
parcelable AddMapPointParams;

View file

@ -0,0 +1,55 @@
package net.osmand.aidlapi.maplayer.point;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class AddMapPointParams extends AidlParams {
private String layerId;
private AMapPoint point;
public AddMapPointParams(String layerId, AMapPoint point) {
this.layerId = layerId;
this.point = point;
}
public AddMapPointParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<AddMapPointParams> CREATOR = new Creator<AddMapPointParams>() {
@Override
public AddMapPointParams createFromParcel(Parcel in) {
return new AddMapPointParams(in);
}
@Override
public AddMapPointParams[] newArray(int size) {
return new AddMapPointParams[size];
}
};
public String getLayerId() {
return layerId;
}
public AMapPoint getPoint() {
return point;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("layerId", layerId);
bundle.putParcelable("point", point);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AMapPoint.class.getClassLoader());
layerId = bundle.getString("layerId");
point = bundle.getParcelable("point");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer.point;
parcelable RemoveMapPointParams;

View file

@ -0,0 +1,55 @@
package net.osmand.aidlapi.maplayer.point;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class RemoveMapPointParams extends AidlParams {
private String layerId;
private String pointId;
public RemoveMapPointParams(String layerId, String pointId) {
this.layerId = layerId;
this.pointId = pointId;
}
public RemoveMapPointParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<RemoveMapPointParams> CREATOR = new Creator<RemoveMapPointParams>() {
@Override
public RemoveMapPointParams createFromParcel(Parcel in) {
return new RemoveMapPointParams(in);
}
@Override
public RemoveMapPointParams[] newArray(int size) {
return new RemoveMapPointParams[size];
}
};
public String getLayerId() {
return layerId;
}
public String getPointId() {
return pointId;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("layerId", layerId);
bundle.putString("pointId", pointId);
}
@Override
protected void readFromBundle(Bundle bundle) {
super.readFromBundle(bundle);
layerId = bundle.getString("layerId");
pointId = bundle.getString("pointId");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer.point;
parcelable ShowMapPointParams;

View file

@ -0,0 +1,54 @@
package net.osmand.aidlapi.maplayer.point;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class ShowMapPointParams extends AidlParams {
private String layerId;
private AMapPoint point;
public ShowMapPointParams(String layerId, AMapPoint point) {
this.layerId = layerId;
this.point = point;
}
public ShowMapPointParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<ShowMapPointParams> CREATOR = new Creator<ShowMapPointParams>() {
@Override
public ShowMapPointParams createFromParcel(Parcel in) {
return new ShowMapPointParams(in);
}
@Override
public ShowMapPointParams[] newArray(int size) {
return new ShowMapPointParams[size];
}
};
public String getLayerId() {
return layerId;
}
public AMapPoint getPoint() {
return point;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("layerId", layerId);
bundle.putParcelable("point", point);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AMapPoint.class.getClassLoader());
layerId = bundle.getString("layerId");
point = bundle.getParcelable("point");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.maplayer.point;
parcelable UpdateMapPointParams;

View file

@ -0,0 +1,62 @@
package net.osmand.aidlapi.maplayer.point;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class UpdateMapPointParams extends AidlParams {
private String layerId;
private AMapPoint point;
private boolean updateOpenedMenuAndMap;
public UpdateMapPointParams(String layerId, AMapPoint point, boolean updateOpenedMenuAndMap) {
this.layerId = layerId;
this.point = point;
this.updateOpenedMenuAndMap = updateOpenedMenuAndMap;
}
public UpdateMapPointParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<UpdateMapPointParams> CREATOR = new Creator<UpdateMapPointParams>() {
@Override
public UpdateMapPointParams createFromParcel(Parcel in) {
return new UpdateMapPointParams(in);
}
@Override
public UpdateMapPointParams[] newArray(int size) {
return new UpdateMapPointParams[size];
}
};
public String getLayerId() {
return layerId;
}
public AMapPoint getPoint() {
return point;
}
public boolean isUpdateOpenedMenuAndMap() {
return updateOpenedMenuAndMap;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putString("layerId", layerId);
bundle.putParcelable("point", point);
bundle.putBoolean("updateOpenedMenuAndMap", updateOpenedMenuAndMap);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AMapPoint.class.getClassLoader());
layerId = bundle.getString("layerId");
point = bundle.getParcelable("point");
updateOpenedMenuAndMap = bundle.getBoolean("updateOpenedMenuAndMap");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.mapmarker;
parcelable AMapMarker;

View file

@ -0,0 +1,61 @@
package net.osmand.aidlapi.mapmarker;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
import net.osmand.aidlapi.map.ALatLon;
public class AMapMarker extends AidlParams {
private ALatLon latLon;
private String name;
public AMapMarker(ALatLon latLon, String name) {
if (latLon == null) {
throw new IllegalArgumentException("latLon cannot be null");
}
if (name == null) {
name = "";
}
this.latLon = latLon;
this.name = name;
}
public AMapMarker(Parcel in) {
readFromParcel(in);
}
public static final Creator<AMapMarker> CREATOR = new Creator<AMapMarker>() {
@Override
public AMapMarker createFromParcel(Parcel in) {
return new AMapMarker(in);
}
@Override
public AMapMarker[] newArray(int size) {
return new AMapMarker[size];
}
};
public ALatLon getLatLon() {
return latLon;
}
public String getName() {
return name;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("latLon", latLon);
bundle.putString("name", name);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(ALatLon.class.getClassLoader());
latLon = bundle.getParcelable("latLon");
name = bundle.getString("name");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.mapmarker;
parcelable AddMapMarkerParams;

View file

@ -0,0 +1,46 @@
package net.osmand.aidlapi.mapmarker;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class AddMapMarkerParams extends AidlParams {
private AMapMarker marker;
public AddMapMarkerParams(AMapMarker marker) {
this.marker = marker;
}
public AddMapMarkerParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<AddMapMarkerParams> CREATOR = new Creator<AddMapMarkerParams>() {
@Override
public AddMapMarkerParams createFromParcel(Parcel in) {
return new AddMapMarkerParams(in);
}
@Override
public AddMapMarkerParams[] newArray(int size) {
return new AddMapMarkerParams[size];
}
};
public AMapMarker getMarker() {
return marker;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("marker", marker);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AMapMarker.class.getClassLoader());
marker = bundle.getParcelable("marker");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.mapmarker;
parcelable RemoveMapMarkerParams;

View file

@ -0,0 +1,59 @@
package net.osmand.aidlapi.mapmarker;
import android.os.Bundle;
import android.os.Parcel;
import net.osmand.aidlapi.AidlParams;
public class RemoveMapMarkerParams extends AidlParams {
private AMapMarker marker;
private boolean ignoreCoordinates;
public RemoveMapMarkerParams(AMapMarker marker) {
this.marker = marker;
this.ignoreCoordinates = false;
}
public RemoveMapMarkerParams(AMapMarker marker, boolean ignoreCoordinates) {
this.marker = marker;
this.ignoreCoordinates = ignoreCoordinates;
}
public RemoveMapMarkerParams(Parcel in) {
readFromParcel(in);
}
public static final Creator<RemoveMapMarkerParams> CREATOR = new Creator<RemoveMapMarkerParams>() {
@Override
public RemoveMapMarkerParams createFromParcel(Parcel in) {
return new RemoveMapMarkerParams(in);
}
@Override
public RemoveMapMarkerParams[] newArray(int size) {
return new RemoveMapMarkerParams[size];
}
};
public AMapMarker getMarker() {
return marker;
}
public boolean getIgnoreCoordinates() {
return ignoreCoordinates;
}
@Override
public void writeToBundle(Bundle bundle) {
bundle.putParcelable("marker", marker);
bundle.putBoolean("ignoreCoordinates", ignoreCoordinates);
}
@Override
protected void readFromBundle(Bundle bundle) {
bundle.setClassLoader(AMapMarker.class.getClassLoader());
marker = bundle.getParcelable("marker");
ignoreCoordinates = bundle.getBoolean("ignoreCoordinates");
}
}

View file

@ -0,0 +1,3 @@
package net.osmand.aidlapi.mapmarker;
parcelable RemoveMapMarkersParams;

Some files were not shown because too many files have changed in this diff Show more