From 18ae10380f0f0bcfa85ae874aa5615913c1ccb52 Mon Sep 17 00:00:00 2001 From: Nazar Date: Fri, 7 Jun 2019 19:09:29 +0300 Subject: [PATCH 01/32] Plugin 'Turn Screen On' initial commit --- OsmAnd-turn_screen_on/.gitignore | 1 + OsmAnd-turn_screen_on/build.gradle | 44 + OsmAnd-turn_screen_on/proguard-rules.pro | 21 + .../ExampleInstrumentedTest.java | 26 + .../src/main/AndroidManifest.xml | 42 + .../net/osmand/aidl/IOsmAndAidlCallback.aidl | 43 + .../net/osmand/aidl/IOsmAndAidlInterface.aidl | 704 +++ .../calculateroute/CalculateRouteParams.aidl | 3 + .../calculateroute/CalculateRouteParams.java | 100 + .../aidl/contextmenu/AContextMenuButton.aidl | 3 + .../aidl/contextmenu/AContextMenuButton.java | 101 + .../contextmenu/ContextMenuButtonsParams.aidl | 3 + .../contextmenu/ContextMenuButtonsParams.java | 105 + .../RemoveContextMenuButtonsParams.aidl | 3 + .../RemoveContextMenuButtonsParams.java | 53 + .../UpdateContextMenuButtonsParams.aidl | 3 + .../UpdateContextMenuButtonsParams.java | 43 + .../osmand/aidl/copyfile/CopyFileParams.aidl | 3 + .../osmand/aidl/copyfile/CopyFileParams.java | 78 + .../customization/OsmandSettingsParams.aidl | 3 + .../customization/OsmandSettingsParams.java | 60 + .../aidl/customization/SetWidgetsParams.aidl | 3 + .../aidl/customization/SetWidgetsParams.java | 93 + .../net/osmand/aidl/favorite/AFavorite.aidl | 3 + .../net/osmand/aidl/favorite/AFavorite.java | 96 + .../aidl/favorite/AddFavoriteParams.aidl | 3 + .../aidl/favorite/AddFavoriteParams.java | 47 + .../aidl/favorite/RemoveFavoriteParams.aidl | 3 + .../aidl/favorite/RemoveFavoriteParams.java | 47 + .../aidl/favorite/UpdateFavoriteParams.aidl | 3 + .../aidl/favorite/UpdateFavoriteParams.java | 55 + .../aidl/favorite/group/AFavoriteGroup.aidl | 3 + .../aidl/favorite/group/AFavoriteGroup.java | 63 + .../group/AddFavoriteGroupParams.aidl | 3 + .../group/AddFavoriteGroupParams.java | 47 + .../group/RemoveFavoriteGroupParams.aidl | 3 + .../group/RemoveFavoriteGroupParams.java | 47 + .../group/UpdateFavoriteGroupParams.aidl | 3 + .../group/UpdateFavoriteGroupParams.java | 55 + .../java/net/osmand/aidl/gpx/AGpxBitmap.aidl | 4 + .../java/net/osmand/aidl/gpx/AGpxBitmap.java | 46 + .../java/net/osmand/aidl/gpx/AGpxFile.aidl | 3 + .../java/net/osmand/aidl/gpx/AGpxFile.java | 89 + .../net/osmand/aidl/gpx/AGpxFileDetails.aidl | 3 + .../net/osmand/aidl/gpx/AGpxFileDetails.java | 196 + .../net/osmand/aidl/gpx/ASelectedGpxFile.aidl | 3 + .../net/osmand/aidl/gpx/ASelectedGpxFile.java | 85 + .../aidl/gpx/CreateGpxBitmapParams.aidl | 3 + .../aidl/gpx/CreateGpxBitmapParams.java | 101 + .../net/osmand/aidl/gpx/HideGpxParams.aidl | 3 + .../net/osmand/aidl/gpx/HideGpxParams.java | 45 + .../net/osmand/aidl/gpx/ImportGpxParams.aidl | 3 + .../net/osmand/aidl/gpx/ImportGpxParams.java | 106 + .../net/osmand/aidl/gpx/RemoveGpxParams.aidl | 3 + .../net/osmand/aidl/gpx/RemoveGpxParams.java | 48 + .../net/osmand/aidl/gpx/ShowGpxParams.aidl | 3 + .../net/osmand/aidl/gpx/ShowGpxParams.java | 44 + .../aidl/gpx/StartGpxRecordingParams.aidl | 3 + .../aidl/gpx/StartGpxRecordingParams.java | 40 + .../aidl/gpx/StopGpxRecordingParams.aidl | 3 + .../aidl/gpx/StopGpxRecordingParams.java | 40 + .../java/net/osmand/aidl/map/ALatLon.aidl | 3 + .../java/net/osmand/aidl/map/ALatLon.java | 83 + .../osmand/aidl/map/SetMapLocationParams.aidl | 3 + .../osmand/aidl/map/SetMapLocationParams.java | 68 + .../net/osmand/aidl/maplayer/AMapLayer.aidl | 3 + .../net/osmand/aidl/maplayer/AMapLayer.java | 176 + .../aidl/maplayer/AddMapLayerParams.aidl | 3 + .../aidl/maplayer/AddMapLayerParams.java | 43 + .../aidl/maplayer/RemoveMapLayerParams.aidl | 3 + .../aidl/maplayer/RemoveMapLayerParams.java | 43 + .../aidl/maplayer/UpdateMapLayerParams.aidl | 3 + .../aidl/maplayer/UpdateMapLayerParams.java | 43 + .../osmand/aidl/maplayer/point/AMapPoint.aidl | 3 + .../osmand/aidl/maplayer/point/AMapPoint.java | 125 + .../maplayer/point/AddMapPointParams.aidl | 3 + .../maplayer/point/AddMapPointParams.java | 51 + .../maplayer/point/RemoveMapPointParams.aidl | 3 + .../maplayer/point/RemoveMapPointParams.java | 51 + .../maplayer/point/ShowMapPointParams.aidl | 3 + .../maplayer/point/ShowMapPointParams.java | 56 + .../maplayer/point/UpdateMapPointParams.aidl | 3 + .../maplayer/point/UpdateMapPointParams.java | 59 + .../net/osmand/aidl/mapmarker/AMapMarker.aidl | 3 + .../net/osmand/aidl/mapmarker/AMapMarker.java | 63 + .../aidl/mapmarker/AddMapMarkerParams.aidl | 3 + .../aidl/mapmarker/AddMapMarkerParams.java | 44 + .../aidl/mapmarker/RemoveMapMarkerParams.aidl | 3 + .../aidl/mapmarker/RemoveMapMarkerParams.java | 44 + .../aidl/mapmarker/UpdateMapMarkerParams.aidl | 3 + .../aidl/mapmarker/UpdateMapMarkerParams.java | 52 + .../net/osmand/aidl/mapwidget/AMapWidget.aidl | 3 + .../net/osmand/aidl/mapwidget/AMapWidget.java | 110 + .../aidl/mapwidget/AddMapWidgetParams.aidl | 3 + .../aidl/mapwidget/AddMapWidgetParams.java | 43 + .../aidl/mapwidget/RemoveMapWidgetParams.aidl | 3 + .../aidl/mapwidget/RemoveMapWidgetParams.java | 43 + .../aidl/mapwidget/UpdateMapWidgetParams.aidl | 3 + .../aidl/mapwidget/UpdateMapWidgetParams.java | 43 + .../aidl/navdrawer/NavDrawerFooterParams.aidl | 3 + .../aidl/navdrawer/NavDrawerFooterParams.java | 68 + .../aidl/navdrawer/NavDrawerHeaderParams.aidl | 3 + .../aidl/navdrawer/NavDrawerHeaderParams.java | 68 + .../osmand/aidl/navdrawer/NavDrawerItem.aidl | 3 + .../osmand/aidl/navdrawer/NavDrawerItem.java | 73 + .../navdrawer/SetNavDrawerItemsParams.aidl | 3 + .../navdrawer/SetNavDrawerItemsParams.java | 56 + .../aidl/navigation/ADirectionInfo.aidl | 3 + .../aidl/navigation/ADirectionInfo.java | 73 + .../navigation/ANavigationUpdateParams.aidl | 4 + .../navigation/ANavigationUpdateParams.java | 57 + .../aidl/navigation/MuteNavigationParams.aidl | 3 + .../aidl/navigation/MuteNavigationParams.java | 38 + .../aidl/navigation/NavigateGpxParams.aidl | 3 + .../aidl/navigation/NavigateGpxParams.java | 69 + .../aidl/navigation/NavigateParams.aidl | 3 + .../aidl/navigation/NavigateParams.java | 104 + .../aidl/navigation/NavigateSearchParams.aidl | 3 + .../aidl/navigation/NavigateSearchParams.java | 106 + .../navigation/PauseNavigationParams.aidl | 3 + .../navigation/PauseNavigationParams.java | 38 + .../navigation/ResumeNavigationParams.aidl | 3 + .../navigation/ResumeNavigationParams.java | 38 + .../aidl/navigation/StopNavigationParams.aidl | 3 + .../aidl/navigation/StopNavigationParams.java | 38 + .../navigation/UnmuteNavigationParams.aidl | 3 + .../navigation/UnmuteNavigationParams.java | 38 + .../aidl/note/StartAudioRecordingParams.aidl | 3 + .../aidl/note/StartAudioRecordingParams.java | 56 + .../aidl/note/StartVideoRecordingParams.aidl | 3 + .../aidl/note/StartVideoRecordingParams.java | 56 + .../osmand/aidl/note/StopRecordingParams.aidl | 3 + .../osmand/aidl/note/StopRecordingParams.java | 42 + .../osmand/aidl/note/TakePhotoNoteParams.aidl | 3 + .../osmand/aidl/note/TakePhotoNoteParams.java | 56 + .../net/osmand/aidl/plugins/PluginParams.aidl | 5 + .../net/osmand/aidl/plugins/PluginParams.java | 51 + .../net/osmand/aidl/search/SearchParams.aidl | 3 + .../net/osmand/aidl/search/SearchParams.java | 91 + .../net/osmand/aidl/search/SearchResult.aidl | 3 + .../net/osmand/aidl/search/SearchResult.java | 96 + .../net/osmand/aidl/tiles/ASqliteDbFile.aidl | 3 + .../net/osmand/aidl/tiles/ASqliteDbFile.java | 69 + .../AdminDevicePermissionSetUpActivity.java | 92 + .../osmand/turn_screen_on/MainActivity.java | 159 + .../osmand/turn_screen_on/PluginSettings.java | 72 + .../java/net/osmand/turn_screen_on/Some.java | 104 + .../app/TurnScreenOnApplication.java | 17 + .../turn_screen_on/helpers/LockHelper.java | 92 + .../helpers/OsmAndAidlHelper.java | 152 + .../helpers/WakeLockHelper.java | 145 + .../receiver/DeviceAdminRecv.java | 24 + .../drawable-v24/ic_launcher_foreground.xml | 34 + .../src/main/res/drawable/blue_button.xml | 17 + .../res/drawable/ic_launcher_background.xml | 170 + .../src/main/res/drawable/img_add_24dp.xml | 5 + ...ctivity_admin_device_permission_set_up.xml | 9 + .../src/main/res/layout/activity_main.xml | 118 + .../res/mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin 0 -> 2963 bytes .../res/mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 4905 bytes .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin 0 -> 2060 bytes .../res/mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2783 bytes .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 4490 bytes .../res/mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 6895 bytes .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 6387 bytes .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 10413 bytes .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 9128 bytes .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 15132 bytes .../src/main/res/values/colors.xml | 12 + .../src/main/res/values/strings.xml | 9 + .../src/main/res/values/styles.xml | 21 + .../src/main/res/xml/device_admin.xml | 14 + .../net/osmand/aidl/IOsmAndAidlCallback.aidl | 2 + .../net/osmand/aidl/IOsmAndAidlInterface.aidl | 2 + .../net/osmand/aidl/OsmandAidlService.java | 17 + .../osmand/plus/activities/MapActivity.java | 4022 +++++++++-------- .../net/osmand/plus/routing/VoiceRouter.java | 7 +- build.gradle | 2 +- gradle.properties | 4 +- gradle/wrapper/gradle-wrapper.properties | 4 +- settings.gradle | 2 +- 183 files changed, 8963 insertions(+), 2015 deletions(-) create mode 100644 OsmAnd-turn_screen_on/.gitignore create mode 100644 OsmAnd-turn_screen_on/build.gradle create mode 100644 OsmAnd-turn_screen_on/proguard-rules.pro create mode 100644 OsmAnd-turn_screen_on/src/androidTest/java/net/osmand/turn_screen_on/ExampleInstrumentedTest.java create mode 100644 OsmAnd-turn_screen_on/src/main/AndroidManifest.xml create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/IOsmAndAidlCallback.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/IOsmAndAidlInterface.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/calculateroute/CalculateRouteParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/calculateroute/CalculateRouteParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/AContextMenuButton.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/AContextMenuButton.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/ContextMenuButtonsParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/ContextMenuButtonsParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/RemoveContextMenuButtonsParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/RemoveContextMenuButtonsParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/UpdateContextMenuButtonsParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/UpdateContextMenuButtonsParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/copyfile/CopyFileParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/copyfile/CopyFileParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/customization/OsmandSettingsParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/customization/OsmandSettingsParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/customization/SetWidgetsParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/customization/SetWidgetsParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/AFavorite.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/AFavorite.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/AddFavoriteParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/AddFavoriteParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/RemoveFavoriteParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/RemoveFavoriteParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/UpdateFavoriteParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/UpdateFavoriteParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/AFavoriteGroup.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/AFavoriteGroup.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/AddFavoriteGroupParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/AddFavoriteGroupParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/RemoveFavoriteGroupParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/RemoveFavoriteGroupParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/UpdateFavoriteGroupParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/UpdateFavoriteGroupParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxBitmap.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxBitmap.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxFile.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxFile.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxFileDetails.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxFileDetails.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ASelectedGpxFile.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ASelectedGpxFile.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/CreateGpxBitmapParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/CreateGpxBitmapParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/HideGpxParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/HideGpxParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ImportGpxParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ImportGpxParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/RemoveGpxParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/RemoveGpxParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ShowGpxParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ShowGpxParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/StartGpxRecordingParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/StartGpxRecordingParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/StopGpxRecordingParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/StopGpxRecordingParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/map/ALatLon.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/map/ALatLon.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/map/SetMapLocationParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/map/SetMapLocationParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/AMapLayer.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/AMapLayer.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/AddMapLayerParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/AddMapLayerParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/RemoveMapLayerParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/RemoveMapLayerParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/UpdateMapLayerParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/UpdateMapLayerParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/AMapPoint.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/AMapPoint.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/AddMapPointParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/AddMapPointParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/RemoveMapPointParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/RemoveMapPointParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/ShowMapPointParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/ShowMapPointParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/UpdateMapPointParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/UpdateMapPointParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/AMapMarker.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/AMapMarker.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/AddMapMarkerParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/AddMapMarkerParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/RemoveMapMarkerParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/RemoveMapMarkerParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/UpdateMapMarkerParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/UpdateMapMarkerParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/AMapWidget.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/AMapWidget.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/AddMapWidgetParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/AddMapWidgetParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/RemoveMapWidgetParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/RemoveMapWidgetParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/UpdateMapWidgetParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/UpdateMapWidgetParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerFooterParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerFooterParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerHeaderParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerHeaderParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerItem.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerItem.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/SetNavDrawerItemsParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/SetNavDrawerItemsParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ADirectionInfo.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ADirectionInfo.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ANavigationUpdateParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ANavigationUpdateParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/MuteNavigationParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/MuteNavigationParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateGpxParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateGpxParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateSearchParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateSearchParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/PauseNavigationParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/PauseNavigationParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ResumeNavigationParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ResumeNavigationParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/StopNavigationParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/StopNavigationParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/UnmuteNavigationParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/UnmuteNavigationParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StartAudioRecordingParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StartAudioRecordingParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StartVideoRecordingParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StartVideoRecordingParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StopRecordingParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StopRecordingParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/TakePhotoNoteParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/TakePhotoNoteParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/plugins/PluginParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/plugins/PluginParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/search/SearchParams.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/search/SearchParams.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/search/SearchResult.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/search/SearchResult.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/tiles/ASqliteDbFile.aidl create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/tiles/ASqliteDbFile.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/AdminDevicePermissionSetUpActivity.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/MainActivity.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/PluginSettings.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/Some.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/app/TurnScreenOnApplication.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/LockHelper.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/OsmAndAidlHelper.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/WakeLockHelper.java create mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/receiver/DeviceAdminRecv.java create mode 100644 OsmAnd-turn_screen_on/src/main/res/drawable-v24/ic_launcher_foreground.xml create mode 100644 OsmAnd-turn_screen_on/src/main/res/drawable/blue_button.xml create mode 100644 OsmAnd-turn_screen_on/src/main/res/drawable/ic_launcher_background.xml create mode 100644 OsmAnd-turn_screen_on/src/main/res/drawable/img_add_24dp.xml create mode 100644 OsmAnd-turn_screen_on/src/main/res/layout/activity_admin_device_permission_set_up.xml create mode 100644 OsmAnd-turn_screen_on/src/main/res/layout/activity_main.xml create mode 100644 OsmAnd-turn_screen_on/src/main/res/mipmap-anydpi-v26/ic_launcher.xml create mode 100644 OsmAnd-turn_screen_on/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100644 OsmAnd-turn_screen_on/src/main/res/mipmap-hdpi/ic_launcher.png create mode 100644 OsmAnd-turn_screen_on/src/main/res/mipmap-hdpi/ic_launcher_round.png create mode 100644 OsmAnd-turn_screen_on/src/main/res/mipmap-mdpi/ic_launcher.png create mode 100644 OsmAnd-turn_screen_on/src/main/res/mipmap-mdpi/ic_launcher_round.png create mode 100644 OsmAnd-turn_screen_on/src/main/res/mipmap-xhdpi/ic_launcher.png create mode 100644 OsmAnd-turn_screen_on/src/main/res/mipmap-xhdpi/ic_launcher_round.png create mode 100644 OsmAnd-turn_screen_on/src/main/res/mipmap-xxhdpi/ic_launcher.png create mode 100644 OsmAnd-turn_screen_on/src/main/res/mipmap-xxhdpi/ic_launcher_round.png create mode 100644 OsmAnd-turn_screen_on/src/main/res/mipmap-xxxhdpi/ic_launcher.png create mode 100644 OsmAnd-turn_screen_on/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png create mode 100644 OsmAnd-turn_screen_on/src/main/res/values/colors.xml create mode 100644 OsmAnd-turn_screen_on/src/main/res/values/strings.xml create mode 100644 OsmAnd-turn_screen_on/src/main/res/values/styles.xml create mode 100644 OsmAnd-turn_screen_on/src/main/res/xml/device_admin.xml diff --git a/OsmAnd-turn_screen_on/.gitignore b/OsmAnd-turn_screen_on/.gitignore new file mode 100644 index 0000000000..796b96d1c4 --- /dev/null +++ b/OsmAnd-turn_screen_on/.gitignore @@ -0,0 +1 @@ +/build diff --git a/OsmAnd-turn_screen_on/build.gradle b/OsmAnd-turn_screen_on/build.gradle new file mode 100644 index 0000000000..86bc558370 --- /dev/null +++ b/OsmAnd-turn_screen_on/build.gradle @@ -0,0 +1,44 @@ +apply plugin: 'com.android.application' + +android { + compileSdkVersion 28 + + sourceSets { + main { + manifest.srcFile "src/main/AndroidManifest.xml" + aidl.srcDirs = ["src/main/java"] + java.srcDirs = ["src/main/java"] + resources.srcDirs = ["src/main/resources"] + res.srcDirs = ["src/main/res"] + } + } + + defaultConfig { + applicationId "net.osmand.turn_screen_on" + minSdkVersion 15 + targetSdkVersion 28 + versionCode 1 + versionName "1.0" + + testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner" + + } + + buildTypes { + release { + minifyEnabled false + proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' + } + } + +} + +dependencies { + implementation fileTree(dir: 'libs', include: ['*.jar']) + + implementation 'com.android.support:appcompat-v7:28.0.0' + implementation 'com.android.support.constraint:constraint-layout:1.1.3' + testImplementation 'junit:junit:4.12' + androidTestImplementation 'com.android.support.test:runner:1.0.2' + androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2' +} diff --git a/OsmAnd-turn_screen_on/proguard-rules.pro b/OsmAnd-turn_screen_on/proguard-rules.pro new file mode 100644 index 0000000000..f1b424510d --- /dev/null +++ b/OsmAnd-turn_screen_on/proguard-rules.pro @@ -0,0 +1,21 @@ +# Add project specific ProGuard rules here. +# You can control the set of applied configuration files using the +# proguardFiles setting in build.gradle. +# +# For more details, see +# http://developer.android.com/guide/developing/tools/proguard.html + +# If your project uses WebView with JS, uncomment the following +# and specify the fully qualified class name to the JavaScript interface +# class: +#-keepclassmembers class fqcn.of.javascript.interface.for.webview { +# public *; +#} + +# Uncomment this to preserve the line number information for +# debugging stack traces. +#-keepattributes SourceFile,LineNumberTable + +# If you keep the line number information, uncomment this to +# hide the original source file name. +#-renamesourcefileattribute SourceFile diff --git a/OsmAnd-turn_screen_on/src/androidTest/java/net/osmand/turn_screen_on/ExampleInstrumentedTest.java b/OsmAnd-turn_screen_on/src/androidTest/java/net/osmand/turn_screen_on/ExampleInstrumentedTest.java new file mode 100644 index 0000000000..4f2b7ac878 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/androidTest/java/net/osmand/turn_screen_on/ExampleInstrumentedTest.java @@ -0,0 +1,26 @@ +package net.osmand.turn_screen_on; + +import android.content.Context; +import android.support.test.InstrumentationRegistry; +import android.support.test.runner.AndroidJUnit4; + +import org.junit.Test; +import org.junit.runner.RunWith; + +import static org.junit.Assert.*; + +/** + * Instrumented test, which will execute on an Android device. + * + * @see Testing documentation + */ +@RunWith(AndroidJUnit4.class) +public class ExampleInstrumentedTest { + @Test + public void useAppContext() { + // Context of the app under test. + Context appContext = InstrumentationRegistry.getTargetContext(); + + assertEquals("net.osmand.turn_screen_on", appContext.getPackageName()); + } +} diff --git a/OsmAnd-turn_screen_on/src/main/AndroidManifest.xml b/OsmAnd-turn_screen_on/src/main/AndroidManifest.xml new file mode 100644 index 0000000000..f6ea8420c0 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/AndroidManifest.xml @@ -0,0 +1,42 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/IOsmAndAidlCallback.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/IOsmAndAidlCallback.aidl new file mode 100644 index 0000000000..c88c7c4ca5 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/IOsmAndAidlCallback.aidl @@ -0,0 +1,43 @@ +package net.osmand.aidl; + +import net.osmand.aidl.search.SearchResult; +import net.osmand.aidl.gpx.AGpxBitmap; +import net.osmand.aidl.navigation.ADirectionInfo; + +interface IOsmAndAidlCallback { + + /** + * Callback for search requests. + * + * @return resultSet - set of SearchResult + */ + void onSearchComplete(in List 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); + + void onContextMenuButtonClicked(in int buttonId, String pointId, String layerId); + + void onVoiceRouterNotify(); +} \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/IOsmAndAidlInterface.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/IOsmAndAidlInterface.aidl new file mode 100644 index 0000000000..ece1e9faf4 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/IOsmAndAidlInterface.aidl @@ -0,0 +1,704 @@ +package net.osmand.aidl; + +import net.osmand.aidl.map.ALatLon; +import net.osmand.aidl.map.SetMapLocationParams; + +import net.osmand.aidl.favorite.group.AFavoriteGroup; +import net.osmand.aidl.favorite.group.AddFavoriteGroupParams; +import net.osmand.aidl.favorite.group.RemoveFavoriteGroupParams; +import net.osmand.aidl.favorite.group.UpdateFavoriteGroupParams; + +import net.osmand.aidl.favorite.AFavorite; +import net.osmand.aidl.favorite.AddFavoriteParams; +import net.osmand.aidl.favorite.RemoveFavoriteParams; +import net.osmand.aidl.favorite.UpdateFavoriteParams; + +import net.osmand.aidl.mapmarker.AMapMarker; +import net.osmand.aidl.mapmarker.AddMapMarkerParams; +import net.osmand.aidl.mapmarker.RemoveMapMarkerParams; +import net.osmand.aidl.mapmarker.UpdateMapMarkerParams; + +import net.osmand.aidl.calculateroute.CalculateRouteParams; + +import net.osmand.aidl.gpx.ImportGpxParams; +import net.osmand.aidl.gpx.ShowGpxParams; +import net.osmand.aidl.gpx.StartGpxRecordingParams; +import net.osmand.aidl.gpx.StopGpxRecordingParams; +import net.osmand.aidl.gpx.HideGpxParams; +import net.osmand.aidl.gpx.ASelectedGpxFile; + +import net.osmand.aidl.mapwidget.AMapWidget; +import net.osmand.aidl.mapwidget.AddMapWidgetParams; +import net.osmand.aidl.mapwidget.RemoveMapWidgetParams; +import net.osmand.aidl.mapwidget.UpdateMapWidgetParams; + +import net.osmand.aidl.maplayer.point.AMapPoint; +import net.osmand.aidl.maplayer.point.AddMapPointParams; +import net.osmand.aidl.maplayer.point.RemoveMapPointParams; +import net.osmand.aidl.maplayer.point.UpdateMapPointParams; +import net.osmand.aidl.maplayer.AMapLayer; +import net.osmand.aidl.maplayer.AddMapLayerParams; +import net.osmand.aidl.maplayer.RemoveMapLayerParams; +import net.osmand.aidl.maplayer.UpdateMapLayerParams; + +import net.osmand.aidl.navigation.NavigateParams; +import net.osmand.aidl.navigation.NavigateGpxParams; + +import net.osmand.aidl.note.TakePhotoNoteParams; +import net.osmand.aidl.note.StartVideoRecordingParams; +import net.osmand.aidl.note.StartAudioRecordingParams; +import net.osmand.aidl.note.StopRecordingParams; + +import net.osmand.aidl.gpx.RemoveGpxParams; + +import net.osmand.aidl.maplayer.point.ShowMapPointParams; + +import net.osmand.aidl.navdrawer.SetNavDrawerItemsParams; +import net.osmand.aidl.navdrawer.NavDrawerFooterParams; +import net.osmand.aidl.navdrawer.NavDrawerHeaderParams; + +import net.osmand.aidl.navigation.PauseNavigationParams; +import net.osmand.aidl.navigation.ResumeNavigationParams; +import net.osmand.aidl.navigation.StopNavigationParams; +import net.osmand.aidl.navigation.MuteNavigationParams; +import net.osmand.aidl.navigation.UnmuteNavigationParams; + +import net.osmand.aidl.IOsmAndAidlCallback; + +import net.osmand.aidl.search.SearchResult; +import net.osmand.aidl.search.SearchParams; +import net.osmand.aidl.navigation.NavigateSearchParams; + +import net.osmand.aidl.customization.SetWidgetsParams; +import net.osmand.aidl.customization.OsmandSettingsParams; + +import net.osmand.aidl.gpx.AGpxFile; +import net.osmand.aidl.gpx.AGpxFileDetails; +import net.osmand.aidl.gpx.CreateGpxBitmapParams; + +import net.osmand.aidl.tiles.ASqliteDbFile; + +import net.osmand.aidl.plugins.PluginParams; +import net.osmand.aidl.copyfile.CopyFileParams; + +import net.osmand.aidl.navigation.ANavigationUpdateParams; + +import net.osmand.aidl.contextmenu.ContextMenuButtonsParams; +import net.osmand.aidl.contextmenu.UpdateContextMenuButtonsParams; +import net.osmand.aidl.contextmenu.RemoveContextMenuButtonsParams; + + +// 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); + + /** + * Add map marker at given location. + * + * @param lat (double) - latitude. + * @param lon (double) - longitude. + * @param name (String)- name of marker. + */ + boolean removeMapMarker(in RemoveMapMarkerParams params); + + /** + * Update map marker at given location with name. + * + * @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). + */ + 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)- list of details. Displayed under context menu. + * @param params (Map) - 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 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) - list of details. Displayed under context menu. + * @param params (Map) - 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 - 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 - 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 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); + + /** + * 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 removeFavoriteGroup(in RemoveFavoriteGroupParams params); + + /** + * Remove favorite group with given name. + * + * @param name (String) - name of favorite group. + */ + 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); + + /** + * 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 removeFavorite(in RemoveFavoriteParams 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 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 - list of details. Displayed under context menu. + * @param params Map - 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)- list of menu items keys from {@link OsmAndCustomizationConstants} + */ + boolean setEnabledIds(in List ids); + + /** + * Method for selected UI elements (like QuickSearch button) to hide. + * + * @param ids (List)- list of menu items keys from {@link OsmAndCustomizationConstants} + */ + boolean setDisabledIds(in List ids); + + /** + * Method to show selected NavDrawer's menu items. + * + * @param patterns (List) - list of menu items names from {@link OsmAndCustomizationConstants} + */ + boolean setEnabledPatterns(in List patterns); + + /** + * Method to hide selected NavDrawer's menu items. + * + * @param patterns (List)- list of menu items names from {@link OsmAndCustomizationConstants} + */ + boolean setDisabledPatterns(in List 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)- 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 files); + + /** + * Method to get list of sqlitedb files registered in OsmAnd; + * + * @return list of sqlitedb files + */ + boolean getSqliteDbFiles(out List files); + + /** + * Method to get list of currently active sqlitedb files + * + * @return list of sqlitedb files + */ + boolean getActiveSqliteDbFiles(out List 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. + * + * @params subscribeToUpdates (boolean) - boolean flag to subscribe or unsubscribe from updates + * @params callbackId (long) - id of callback, needed to unsubscribe from updates + * @params callback (IOsmAndAidlCallback) - callback to notify user on navigation data change + */ + long registerForNavigationUpdates(in ANavigationUpdateParams params, IOsmAndAidlCallback callback); + + long addContextMenuButtons(in ContextMenuButtonsParams params, IOsmAndAidlCallback callback); + boolean removeContextMenuButtons(in RemoveContextMenuButtonsParams params); + boolean updateContextMenuButtons(in UpdateContextMenuButtonsParams params); + + long registerForVoiceRouterMessages(in IOsmAndAidlCallback callback); +} \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/calculateroute/CalculateRouteParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/calculateroute/CalculateRouteParams.aidl new file mode 100644 index 0000000000..017dd5e944 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/calculateroute/CalculateRouteParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.calculateroute; + +parcelable CalculateRouteParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/calculateroute/CalculateRouteParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/calculateroute/CalculateRouteParams.java new file mode 100644 index 0000000000..1186f2dcd5 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/calculateroute/CalculateRouteParams.java @@ -0,0 +1,100 @@ +package net.osmand.aidl.calculateroute; + +import android.os.Parcel; +import android.os.Parcelable; + +import net.osmand.aidl.map.ALatLon; + +import java.util.ArrayList; +import java.util.List; + +public class CalculateRouteParams implements Parcelable { + + private ALatLon startPoint; + private String startPointName; + private ALatLon endPoint; + private String endPointName; + private List intermediatePoints = new ArrayList<>(); + private List intermediateNames = new ArrayList<>(); + + public CalculateRouteParams(ALatLon startPoint, String startPointName, + ALatLon endPoint, String endPointName, + List intermediatePoints, List 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 CREATOR = new + Creator() { + public CalculateRouteParams createFromParcel(Parcel in) { + return new CalculateRouteParams(in); + } + + 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 getIntermediatePoints() { + return intermediatePoints; + } + + public List getIntermediateNames() { + return intermediateNames; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(startPoint, flags); + out.writeString(startPointName); + out.writeParcelable(endPoint, flags); + out.writeString(endPointName); + out.writeTypedList(intermediatePoints); + out.writeStringList(intermediateNames); + } + + private void readFromParcel(Parcel in) { + startPoint = in.readParcelable(ALatLon.class.getClassLoader()); + startPointName = in.readString(); + endPoint = in.readParcelable(ALatLon.class.getClassLoader()); + endPointName = in.readString(); + in.readTypedList(intermediatePoints, ALatLon.CREATOR); + in.readStringList(intermediateNames); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/AContextMenuButton.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/AContextMenuButton.aidl new file mode 100644 index 0000000000..4a8cbee665 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/AContextMenuButton.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.contextmenu; + +parcelable AContextMenuButton; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/AContextMenuButton.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/AContextMenuButton.java new file mode 100644 index 0000000000..b235116999 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/AContextMenuButton.java @@ -0,0 +1,101 @@ +package net.osmand.aidl.contextmenu; + +import android.os.Parcel; +import android.os.Parcelable; + +public class AContextMenuButton implements Parcelable { + + 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 CREATOR = new Creator() { + @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 isNeedColorizeIcon() { + return needColorizeIcon; + } + + public boolean isEnabled() { + return enabled; + } + + public static Creator getCREATOR() { + return CREATOR; + } + + @Override + public void writeToParcel(Parcel dest, int f) { + dest.writeInt(buttonId); + dest.writeString(leftTextCaption); + dest.writeString(rightTextCaption); + dest.writeString(leftIconName); + dest.writeString(rightIconName); + dest.writeInt(needColorizeIcon ? 1 : 0); + dest.writeInt(enabled ? 1 : 0); + } + + private void readFromParcel(Parcel in) { + buttonId = in.readInt(); + leftTextCaption = in.readString(); + rightTextCaption = in.readString(); + leftIconName = in.readString(); + rightIconName = in.readString(); + needColorizeIcon = in.readInt() != 0; + enabled = in.readInt() != 0; + } + + @Override + public int describeContents() { + return 0; + } +} \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/ContextMenuButtonsParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/ContextMenuButtonsParams.aidl new file mode 100644 index 0000000000..cf05b9db9c --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/ContextMenuButtonsParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.contextmenu; + +parcelable ContextMenuButtonsParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/ContextMenuButtonsParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/ContextMenuButtonsParams.java new file mode 100644 index 0000000000..85cb9cb3e0 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/ContextMenuButtonsParams.java @@ -0,0 +1,105 @@ +package net.osmand.aidl.contextmenu; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.ArrayList; +import java.util.List; + +public class ContextMenuButtonsParams implements Parcelable { + + private AContextMenuButton leftButton; + private AContextMenuButton rightButton; + + private String id; + private String appPackage; + private String layerId; + + private long callbackId = -1L; + + private List pointsIds = new ArrayList<>(); + + public ContextMenuButtonsParams(AContextMenuButton leftButton, AContextMenuButton rightButton, String id, String appPackage, String layerId, boolean followOpenedPoint, long callbackId, List pointsIds) { + this.leftButton = leftButton; + this.rightButton = rightButton; + this.id = id; + this.appPackage = appPackage; + this.layerId = layerId; + this.callbackId = callbackId; + this.pointsIds = pointsIds; + } + + public ContextMenuButtonsParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @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 getPointsIds() { + return pointsIds; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeParcelable(leftButton, flags); + dest.writeParcelable(rightButton, flags); + dest.writeString(id); + dest.writeString(appPackage); + dest.writeString(layerId); + dest.writeLong(callbackId); + dest.writeStringList(pointsIds); + } + + private void readFromParcel(Parcel in) { + leftButton = in.readParcelable(AContextMenuButton.class.getClassLoader()); + rightButton = in.readParcelable(AContextMenuButton.class.getClassLoader()); + id = in.readString(); + appPackage = in.readString(); + layerId = in.readString(); + callbackId = in.readLong(); + in.readStringList(pointsIds); + } + + @Override + public int describeContents() { + return 0; + } +} \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/RemoveContextMenuButtonsParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/RemoveContextMenuButtonsParams.aidl new file mode 100644 index 0000000000..557a8e5113 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/RemoveContextMenuButtonsParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.contextmenu; + +parcelable RemoveContextMenuButtonsParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/RemoveContextMenuButtonsParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/RemoveContextMenuButtonsParams.java new file mode 100644 index 0000000000..33f3ab400c --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/RemoveContextMenuButtonsParams.java @@ -0,0 +1,53 @@ +package net.osmand.aidl.contextmenu; + +import android.os.Parcel; +import android.os.Parcelable; + +public class RemoveContextMenuButtonsParams implements Parcelable { + + 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 CREATOR = new + Creator() { + public RemoveContextMenuButtonsParams createFromParcel(Parcel in) { + return new RemoveContextMenuButtonsParams(in); + } + + public RemoveContextMenuButtonsParams[] newArray(int size) { + return new RemoveContextMenuButtonsParams[size]; + } + }; + + public String getParamsId() { + return paramsId; + } + + public long getCallbackId() { + return callbackId; + } + + public void writeToParcel(Parcel dest, int flags) { + dest.writeString(paramsId); + dest.writeLong(callbackId); + } + + private void readFromParcel(Parcel in) { + paramsId = in.readString(); + callbackId = in.readLong(); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/UpdateContextMenuButtonsParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/UpdateContextMenuButtonsParams.aidl new file mode 100644 index 0000000000..f5482b3452 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/UpdateContextMenuButtonsParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.contextmenu; + +parcelable UpdateContextMenuButtonsParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/UpdateContextMenuButtonsParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/UpdateContextMenuButtonsParams.java new file mode 100644 index 0000000000..ce4d4a637c --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/contextmenu/UpdateContextMenuButtonsParams.java @@ -0,0 +1,43 @@ +package net.osmand.aidl.contextmenu; + +import android.os.Parcel; +import android.os.Parcelable; + +public class UpdateContextMenuButtonsParams implements Parcelable { + private ContextMenuButtonsParams buttonsParams; + + public UpdateContextMenuButtonsParams(ContextMenuButtonsParams widget) { + this.buttonsParams = widget; + } + + public UpdateContextMenuButtonsParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public UpdateContextMenuButtonsParams createFromParcel(Parcel in) { + return new UpdateContextMenuButtonsParams(in); + } + + public UpdateContextMenuButtonsParams[] newArray(int size) { + return new UpdateContextMenuButtonsParams[size]; + } + }; + + public ContextMenuButtonsParams getContextMenuButtonsParams() { + return buttonsParams; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(buttonsParams, flags); + } + + private void readFromParcel(Parcel in) { + buttonsParams = in.readParcelable(ContextMenuButtonsParams.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/copyfile/CopyFileParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/copyfile/CopyFileParams.aidl new file mode 100644 index 0000000000..a786325e98 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/copyfile/CopyFileParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.copyfile; + +parcelable CopyFileParams; diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/copyfile/CopyFileParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/copyfile/CopyFileParams.java new file mode 100644 index 0000000000..e795d5b7b7 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/copyfile/CopyFileParams.java @@ -0,0 +1,78 @@ +package net.osmand.aidl.copyfile; + +import android.os.Parcel; +import android.os.Parcelable; +import android.support.annotation.NonNull; + +public class CopyFileParams implements Parcelable { + 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; + } + + public String getFileName() { + return fileName; + } + + public byte[] getFilePartData() { + return filePartData; + } + + public boolean isDone() { + return done; + } + + public long getStartTime() { + return startTime; + } + + protected CopyFileParams(Parcel in) { + fileName = in.readString(); + filePartData = in.createByteArray(); + startTime = in.readLong(); + done = in.readByte() == 0; + } + + public static final Creator CREATOR = new Creator() { + @Override + public CopyFileParams createFromParcel(Parcel in) { + return new CopyFileParams(in); + } + + @Override + public CopyFileParams[] newArray(int size) { + return new CopyFileParams[size]; + } + }; + + + @Override + public int describeContents() { + return 0; + } + + @Override + public String toString() { + return "CopyFileParams {" + + " fileName=" + fileName + + ", filePartData size=" + filePartData.length + + ", startTime=" + startTime + + ", done=" + done + + " }"; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeString(fileName); + dest.writeByteArray(filePartData); + dest.writeLong(startTime); + dest.writeByte((byte) (done ? 0 : 1)); + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/customization/OsmandSettingsParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/customization/OsmandSettingsParams.aidl new file mode 100644 index 0000000000..770070bb46 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/customization/OsmandSettingsParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.customization; + +parcelable OsmandSettingsParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/customization/OsmandSettingsParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/customization/OsmandSettingsParams.java new file mode 100644 index 0000000000..bff8c68018 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/customization/OsmandSettingsParams.java @@ -0,0 +1,60 @@ +package net.osmand.aidl.customization; + +import android.annotation.SuppressLint; +import android.os.Bundle; +import android.os.Parcel; +import android.os.Parcelable; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; + +public class OsmandSettingsParams implements Parcelable { + + private String sharedPreferencesName; + private Bundle bundle; + + public OsmandSettingsParams(@NonNull String sharedPreferencesName, @Nullable Bundle bundle) { + this.sharedPreferencesName = sharedPreferencesName; + this.bundle = bundle; + } + + public OsmandSettingsParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @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 bundle; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeString(sharedPreferencesName); + out.writeBundle(bundle); + } + + @SuppressLint("ParcelClassLoader") + private void readFromParcel(Parcel in) { + sharedPreferencesName = in.readString(); + bundle = in.readBundle(); + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/customization/SetWidgetsParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/customization/SetWidgetsParams.aidl new file mode 100644 index 0000000000..235a4abe51 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/customization/SetWidgetsParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.customization; + +parcelable SetWidgetsParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/customization/SetWidgetsParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/customization/SetWidgetsParams.java new file mode 100644 index 0000000000..d9343b920e --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/customization/SetWidgetsParams.java @@ -0,0 +1,93 @@ +package net.osmand.aidl.customization; + +import android.os.Parcel; +import android.os.Parcelable; +import android.support.annotation.Nullable; + +import java.util.ArrayList; +import java.util.List; + +public class SetWidgetsParams implements Parcelable { + + private String widgetKey; + private List appModesKeys; + + public SetWidgetsParams(String widgetKey, @Nullable List appModesKeys) { + this.widgetKey = widgetKey; + this.appModesKeys = appModesKeys; + } + + public SetWidgetsParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @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 getAppModesKeys() { + return appModesKeys; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeString(widgetKey); + writeStringList(out, appModesKeys); + } + + private void readFromParcel(Parcel in) { + widgetKey = in.readString(); + appModesKeys = readStringList(in); + } + + @Override + public int describeContents() { + return 0; + } + + private void writeStringList(Parcel out, List val) { + if (val == null) { + out.writeInt(-1); + return; + } + int N = val.size(); + int i = 0; + out.writeInt(N); + while (i < N) { + out.writeString(val.get(i)); + i++; + } + } + + private List readStringList(Parcel in) { + List list = new ArrayList<>(); + int M = list.size(); + int N = in.readInt(); + if (N == -1) { + return null; + } + int i = 0; + for (; i < M && i < N; i++) { + list.set(i, in.readString()); + } + for (; i < N; i++) { + list.add(in.readString()); + } + for (; i < M; i++) { + list.remove(N); + } + return list; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/AFavorite.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/AFavorite.aidl new file mode 100644 index 0000000000..afd535fbe8 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/AFavorite.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.favorite; + +parcelable AFavorite; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/AFavorite.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/AFavorite.java new file mode 100644 index 0000000000..b7fc057249 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/AFavorite.java @@ -0,0 +1,96 @@ +package net.osmand.aidl.favorite; + +import android.os.Parcel; +import android.os.Parcelable; + +public class AFavorite implements Parcelable { + + 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 CREATOR = new Creator() { + @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 writeToParcel(Parcel out, int flags) { + out.writeDouble(lat); + out.writeDouble(lon); + out.writeString(name); + out.writeString(description); + out.writeString(category); + out.writeString(color); + out.writeByte((byte) (visible ? 1 : 0)); + } + + private void readFromParcel(Parcel in) { + lat = in.readDouble(); + lon = in.readDouble(); + name = in.readString(); + description = in.readString(); + category = in.readString(); + color = in.readString(); + visible = in.readByte() != 0; + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/AddFavoriteParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/AddFavoriteParams.aidl new file mode 100644 index 0000000000..c546992b10 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/AddFavoriteParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.favorite; + +parcelable AddFavoriteParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/AddFavoriteParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/AddFavoriteParams.java new file mode 100644 index 0000000000..87baeb5a99 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/AddFavoriteParams.java @@ -0,0 +1,47 @@ +package net.osmand.aidl.favorite; + +import android.os.Parcel; +import android.os.Parcelable; + +public class AddFavoriteParams implements Parcelable { + + private AFavorite favorite; + + public AddFavoriteParams(AFavorite favorite) { + this.favorite = favorite; + } + + public AddFavoriteParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @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 writeToParcel(Parcel out, int flags) { + out.writeParcelable(favorite, flags); + } + + private void readFromParcel(Parcel in) { + favorite = in.readParcelable(AFavorite.class.getClassLoader()); + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/RemoveFavoriteParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/RemoveFavoriteParams.aidl new file mode 100644 index 0000000000..37c08cd374 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/RemoveFavoriteParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.favorite; + +parcelable RemoveFavoriteParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/RemoveFavoriteParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/RemoveFavoriteParams.java new file mode 100644 index 0000000000..15e2ca74bd --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/RemoveFavoriteParams.java @@ -0,0 +1,47 @@ +package net.osmand.aidl.favorite; + +import android.os.Parcel; +import android.os.Parcelable; + +public class RemoveFavoriteParams implements Parcelable { + + private AFavorite favorite; + + public RemoveFavoriteParams(AFavorite favorite) { + this.favorite = favorite; + } + + public RemoveFavoriteParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @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 writeToParcel(Parcel out, int flags) { + out.writeParcelable(favorite, flags); + } + + private void readFromParcel(Parcel in) { + favorite = in.readParcelable(AFavorite.class.getClassLoader()); + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/UpdateFavoriteParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/UpdateFavoriteParams.aidl new file mode 100644 index 0000000000..ba4a9364d3 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/UpdateFavoriteParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.favorite; + +parcelable UpdateFavoriteParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/UpdateFavoriteParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/UpdateFavoriteParams.java new file mode 100644 index 0000000000..43fdfc13bd --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/UpdateFavoriteParams.java @@ -0,0 +1,55 @@ +package net.osmand.aidl.favorite; + +import android.os.Parcel; +import android.os.Parcelable; + +public class UpdateFavoriteParams implements Parcelable { + + 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 CREATOR = new Creator() { + @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 writeToParcel(Parcel out, int flags) { + out.writeParcelable(favoritePrev, flags); + out.writeParcelable(favoriteNew, flags); + } + + private void readFromParcel(Parcel in) { + favoritePrev = in.readParcelable(AFavorite.class.getClassLoader()); + favoriteNew = in.readParcelable(AFavorite.class.getClassLoader()); + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/AFavoriteGroup.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/AFavoriteGroup.aidl new file mode 100644 index 0000000000..baec925474 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/AFavoriteGroup.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.favorite.group; + +parcelable AFavoriteGroup; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/AFavoriteGroup.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/AFavoriteGroup.java new file mode 100644 index 0000000000..e9b6348468 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/AFavoriteGroup.java @@ -0,0 +1,63 @@ +package net.osmand.aidl.favorite.group; + +import android.os.Parcel; +import android.os.Parcelable; + +public class AFavoriteGroup implements Parcelable { + + 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 CREATOR = new Creator() { + @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 writeToParcel(Parcel out, int flags) { + out.writeString(name); + out.writeString(color); + out.writeByte((byte) (visible ? 1 : 0)); + } + + private void readFromParcel(Parcel in) { + name = in.readString(); + color = in.readString(); + visible = in.readByte() != 0; + } + + @Override + public int describeContents() { + return 0; + } +} \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/AddFavoriteGroupParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/AddFavoriteGroupParams.aidl new file mode 100644 index 0000000000..5850b5cd34 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/AddFavoriteGroupParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.favorite.group; + +parcelable AddFavoriteGroupParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/AddFavoriteGroupParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/AddFavoriteGroupParams.java new file mode 100644 index 0000000000..7cb3228572 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/AddFavoriteGroupParams.java @@ -0,0 +1,47 @@ +package net.osmand.aidl.favorite.group; + +import android.os.Parcel; +import android.os.Parcelable; + +public class AddFavoriteGroupParams implements Parcelable { + + private AFavoriteGroup favoriteGroup; + + public AddFavoriteGroupParams(AFavoriteGroup favoriteGroup) { + this.favoriteGroup = favoriteGroup; + } + + public AddFavoriteGroupParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @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 writeToParcel(Parcel out, int flags) { + out.writeParcelable(favoriteGroup, flags); + } + + private void readFromParcel(Parcel in) { + favoriteGroup = in.readParcelable(AFavoriteGroup.class.getClassLoader()); + } + + @Override + public int describeContents() { + return 0; + } +} \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/RemoveFavoriteGroupParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/RemoveFavoriteGroupParams.aidl new file mode 100644 index 0000000000..e8b0710a01 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/RemoveFavoriteGroupParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.favorite.group; + +parcelable RemoveFavoriteGroupParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/RemoveFavoriteGroupParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/RemoveFavoriteGroupParams.java new file mode 100644 index 0000000000..0b17274440 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/RemoveFavoriteGroupParams.java @@ -0,0 +1,47 @@ +package net.osmand.aidl.favorite.group; + +import android.os.Parcel; +import android.os.Parcelable; + +public class RemoveFavoriteGroupParams implements Parcelable { + + private AFavoriteGroup favoriteGroup; + + public RemoveFavoriteGroupParams(AFavoriteGroup favoriteGroup) { + this.favoriteGroup = favoriteGroup; + } + + public RemoveFavoriteGroupParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @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 writeToParcel(Parcel out, int flags) { + out.writeParcelable(favoriteGroup, flags); + } + + private void readFromParcel(Parcel in) { + favoriteGroup = in.readParcelable(AFavoriteGroup.class.getClassLoader()); + } + + @Override + public int describeContents() { + return 0; + } +} \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/UpdateFavoriteGroupParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/UpdateFavoriteGroupParams.aidl new file mode 100644 index 0000000000..e9001a8c5e --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/UpdateFavoriteGroupParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.favorite.group; + +parcelable UpdateFavoriteGroupParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/UpdateFavoriteGroupParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/UpdateFavoriteGroupParams.java new file mode 100644 index 0000000000..0ea52e1fda --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/favorite/group/UpdateFavoriteGroupParams.java @@ -0,0 +1,55 @@ +package net.osmand.aidl.favorite.group; + +import android.os.Parcel; +import android.os.Parcelable; + +public class UpdateFavoriteGroupParams implements Parcelable { + + 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 CREATOR = new Creator() { + @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 writeToParcel(Parcel out, int flags) { + out.writeParcelable(favoriteGroupPrev, flags); + out.writeParcelable(favoriteGroupNew, flags); + } + + private void readFromParcel(Parcel in) { + favoriteGroupPrev = in.readParcelable(AFavoriteGroup.class.getClassLoader()); + favoriteGroupNew = in.readParcelable(AFavoriteGroup.class.getClassLoader()); + } + + @Override + public int describeContents() { + return 0; + } +} \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxBitmap.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxBitmap.aidl new file mode 100644 index 0000000000..128f5e6b94 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxBitmap.aidl @@ -0,0 +1,4 @@ +package net.osmand.aidl.gpx; + +parcelable AGpxBitmap; + diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxBitmap.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxBitmap.java new file mode 100644 index 0000000000..f4bdef433d --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxBitmap.java @@ -0,0 +1,46 @@ +package net.osmand.aidl.gpx; + +import android.graphics.Bitmap; +import android.os.Parcel; +import android.os.Parcelable; +import android.support.annotation.NonNull; + +public class AGpxBitmap implements Parcelable { + + 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 CREATOR = new + Creator() { + public AGpxBitmap createFromParcel(Parcel in) { + return new AGpxBitmap(in); + } + + public AGpxBitmap[] newArray(int size) { + return new AGpxBitmap[size]; + } + }; + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(bitmap, flags); + } + + private void readFromParcel(Parcel in) { + bitmap = in.readParcelable(Bitmap.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxFile.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxFile.aidl new file mode 100644 index 0000000000..413d34a571 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxFile.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable AGpxFile; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxFile.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxFile.java new file mode 100644 index 0000000000..9572057fdc --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxFile.java @@ -0,0 +1,89 @@ +package net.osmand.aidl.gpx; + +import android.os.Parcel; +import android.os.Parcelable; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; + +public class AGpxFile implements Parcelable { + + private String fileName; + private long modifiedTime; + private long fileSize; + private boolean active; + private AGpxFileDetails details; + + public AGpxFile(@NonNull String fileName, long modifiedTime, long fileSize, boolean active, @Nullable AGpxFileDetails details) { + this.fileName = fileName; + this.modifiedTime = modifiedTime; + this.fileSize = fileSize; + this.active = active; + this.details = details; + } + + public AGpxFile(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public AGpxFile createFromParcel(Parcel in) { + return new AGpxFile(in); + } + + 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 AGpxFileDetails getDetails() { + return details; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(fileName); + out.writeLong(modifiedTime); + out.writeLong(fileSize); + out.writeByte((byte) (active ? 1 : 0)); + + out.writeByte((byte) (details != null ? 1 : 0)); + if (details != null) { + out.writeParcelable(details, flags); + } + } + + private void readFromParcel(Parcel in) { + fileName = in.readString(); + modifiedTime = in.readLong(); + fileSize = in.readLong(); + active = in.readByte() != 0; + + boolean hasDetails= in.readByte() != 0; + if (hasDetails) { + details = in.readParcelable(AGpxFileDetails.class.getClassLoader()); + } else { + details = null; + } + } + + public int describeContents() { + return 0; + } +} + diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxFileDetails.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxFileDetails.aidl new file mode 100644 index 0000000000..1e2cdec2b1 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxFileDetails.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable AGpxFileDetails; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxFileDetails.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxFileDetails.java new file mode 100644 index 0000000000..3fe755135e --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/AGpxFileDetails.java @@ -0,0 +1,196 @@ +package net.osmand.aidl.gpx; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.ArrayList; +import java.util.List; +import java.util.Set; + +public class AGpxFileDetails implements Parcelable { + + 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 List 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 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 = new ArrayList<>(wptCategoryNames); + } + } + + public AGpxFileDetails(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public AGpxFileDetails createFromParcel(Parcel in) { + return new AGpxFileDetails(in); + } + + 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 getWptCategoryNames() { + return wptCategoryNames; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeFloat(totalDistance); + out.writeInt(totalTracks); + out.writeLong(startTime); + out.writeLong(endTime); + out.writeLong(timeSpan); + out.writeLong(timeMoving); + out.writeFloat(totalDistanceMoving); + out.writeDouble(diffElevationUp); + out.writeDouble(diffElevationDown); + out.writeDouble(avgElevation); + out.writeDouble(minElevation); + out.writeDouble(maxElevation); + out.writeFloat(minSpeed); + out.writeFloat(maxSpeed); + out.writeFloat(avgSpeed); + out.writeInt(points); + out.writeInt(wptPoints); + out.writeStringList(wptCategoryNames); + } + + private void readFromParcel(Parcel in) { + totalDistance = in.readFloat(); + totalTracks = in.readInt(); + startTime = in.readLong(); + endTime = in.readLong(); + timeSpan = in.readLong(); + timeMoving = in.readLong(); + totalDistanceMoving = in.readFloat(); + diffElevationUp = in.readDouble(); + diffElevationDown = in.readDouble(); + avgElevation = in.readDouble(); + minElevation = in.readDouble(); + maxElevation = in.readDouble(); + minSpeed = in.readFloat(); + maxSpeed = in.readFloat(); + avgSpeed = in.readFloat(); + points = in.readInt(); + wptPoints = in.readInt(); + in.readStringList(wptCategoryNames); + } + + public int describeContents() { + return 0; + } +} \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ASelectedGpxFile.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ASelectedGpxFile.aidl new file mode 100644 index 0000000000..23fc3312b4 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ASelectedGpxFile.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable ASelectedGpxFile; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ASelectedGpxFile.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ASelectedGpxFile.java new file mode 100644 index 0000000000..6ffc6e2a70 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ASelectedGpxFile.java @@ -0,0 +1,85 @@ +package net.osmand.aidl.gpx; + +import android.os.Parcel; +import android.os.Parcelable; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; + +public class ASelectedGpxFile implements Parcelable { + + 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 CREATOR = new + Creator() { + public ASelectedGpxFile createFromParcel(Parcel in) { + return new ASelectedGpxFile(in); + } + + 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; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(fileName); + out.writeLong(modifiedTime); + out.writeLong(fileSize); + + out.writeByte((byte) (details != null ? 1 : 0)); + if (details != null) { + out.writeParcelable(details, flags); + } + } + + private void readFromParcel(Parcel in) { + fileName = in.readString(); + modifiedTime = in.readLong(); + fileSize = in.readLong(); + + boolean hasDetails= in.readByte() != 0; + if (hasDetails) { + details = in.readParcelable(AGpxFileDetails.class.getClassLoader()); + } else { + details = null; + } + } + + public int describeContents() { + return 0; + } +} + diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/CreateGpxBitmapParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/CreateGpxBitmapParams.aidl new file mode 100644 index 0000000000..b02d5c6e70 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/CreateGpxBitmapParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable CreateGpxBitmapParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/CreateGpxBitmapParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/CreateGpxBitmapParams.java new file mode 100644 index 0000000000..b6af1d354c --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/CreateGpxBitmapParams.java @@ -0,0 +1,101 @@ +package net.osmand.aidl.gpx; + +import android.net.Uri; +import android.os.Parcel; +import android.os.Parcelable; + +import java.io.File; + +public class CreateGpxBitmapParams implements Parcelable { + + 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 CREATOR = new + Creator() { + public CreateGpxBitmapParams createFromParcel(Parcel in) { + return new CreateGpxBitmapParams(in); + } + + 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; + } + + public void writeToParcel(Parcel out, int flags) { + if (gpxFile != null) { + out.writeString(gpxFile.getAbsolutePath()); + } else { + out.writeString(null); + } + out.writeParcelable(gpxUri, flags); + out.writeFloat(density); + out.writeInt(widthPixels); + out.writeInt(heightPixels); + out.writeInt(color); + } + + private void readFromParcel(Parcel in) { + String gpxAbsolutePath = in.readString(); + if (gpxAbsolutePath != null) { + gpxFile = new File(gpxAbsolutePath); + } + gpxUri = in.readParcelable(Uri.class.getClassLoader()); + density = in.readFloat(); + widthPixels = in.readInt(); + heightPixels = in.readInt(); + color = in.readInt(); + } + + public int describeContents() { + return 0; + } +} \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/HideGpxParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/HideGpxParams.aidl new file mode 100644 index 0000000000..4c8992552c --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/HideGpxParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable HideGpxParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/HideGpxParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/HideGpxParams.java new file mode 100644 index 0000000000..5e37c66f80 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/HideGpxParams.java @@ -0,0 +1,45 @@ +package net.osmand.aidl.gpx; + +import android.os.Parcel; +import android.os.Parcelable; + +public class HideGpxParams implements Parcelable { + + private String fileName; + + public HideGpxParams(String fileName) { + this.fileName = fileName; + } + + public HideGpxParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public HideGpxParams createFromParcel(Parcel in) { + return new HideGpxParams(in); + } + + public HideGpxParams[] newArray(int size) { + return new HideGpxParams[size]; + } + }; + + public String getFileName() { + return fileName; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(fileName); + } + + private void readFromParcel(Parcel in) { + fileName = in.readString(); + } + + public int describeContents() { + return 0; + } +} + diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ImportGpxParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ImportGpxParams.aidl new file mode 100644 index 0000000000..23ecdb6ff3 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ImportGpxParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable ImportGpxParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ImportGpxParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ImportGpxParams.java new file mode 100644 index 0000000000..6d2ed2cb88 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ImportGpxParams.java @@ -0,0 +1,106 @@ +package net.osmand.aidl.gpx; + +import android.net.Uri; +import android.os.Parcel; +import android.os.Parcelable; + +import java.io.File; + +public class ImportGpxParams implements Parcelable { + + 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 CREATOR = new + Creator() { + public ImportGpxParams createFromParcel(Parcel in) { + return new ImportGpxParams(in); + } + + 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; + } + + public void writeToParcel(Parcel out, int flags) { + if (gpxFile != null) { + out.writeString(gpxFile.getAbsolutePath()); + } else { + out.writeString(null); + } + out.writeParcelable(gpxUri, flags); + out.writeString(sourceRawData); + out.writeString(destinationPath); + out.writeString(color); + out.writeByte((byte) (show ? 1 : 0)); + } + + private void readFromParcel(Parcel in) { + String gpxAbsolutePath = in.readString(); + if (gpxAbsolutePath != null) { + gpxFile = new File(gpxAbsolutePath); + } + gpxUri = in.readParcelable(Uri.class.getClassLoader()); + sourceRawData = in.readString(); + destinationPath = in.readString(); + color = in.readString(); + show = in.readByte() == 1; + } + + public int describeContents() { + return 0; + } +} \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/RemoveGpxParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/RemoveGpxParams.aidl new file mode 100644 index 0000000000..e9025f7a19 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/RemoveGpxParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable RemoveGpxParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/RemoveGpxParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/RemoveGpxParams.java new file mode 100644 index 0000000000..2253fa3616 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/RemoveGpxParams.java @@ -0,0 +1,48 @@ +package net.osmand.aidl.gpx; + +import android.os.Parcel; +import android.os.Parcelable; + +public class RemoveGpxParams implements Parcelable { + + private String fileName; + + public RemoveGpxParams(String fileName) { + this.fileName = fileName; + } + + public RemoveGpxParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + @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 writeToParcel(Parcel out, int flags) { + out.writeString(fileName); + } + + private void readFromParcel(Parcel in) { + fileName = in.readString(); + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ShowGpxParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ShowGpxParams.aidl new file mode 100644 index 0000000000..217f600c4e --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ShowGpxParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable ShowGpxParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ShowGpxParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ShowGpxParams.java new file mode 100644 index 0000000000..4d385a65a4 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/ShowGpxParams.java @@ -0,0 +1,44 @@ +package net.osmand.aidl.gpx; + +import android.os.Parcel; +import android.os.Parcelable; + +public class ShowGpxParams implements Parcelable { + + private String fileName; + + public ShowGpxParams(String fileName) { + this.fileName = fileName; + } + + public ShowGpxParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public ShowGpxParams createFromParcel(Parcel in) { + return new ShowGpxParams(in); + } + + public ShowGpxParams[] newArray(int size) { + return new ShowGpxParams[size]; + } + }; + + public String getFileName() { + return fileName; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(fileName); + } + + private void readFromParcel(Parcel in) { + fileName = in.readString(); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/StartGpxRecordingParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/StartGpxRecordingParams.aidl new file mode 100644 index 0000000000..14f4871540 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/StartGpxRecordingParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable StartGpxRecordingParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/StartGpxRecordingParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/StartGpxRecordingParams.java new file mode 100644 index 0000000000..139eac8ea3 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/StartGpxRecordingParams.java @@ -0,0 +1,40 @@ +package net.osmand.aidl.gpx; + +import android.os.Parcel; +import android.os.Parcelable; + +public class StartGpxRecordingParams implements Parcelable { + + public StartGpxRecordingParams() { + + } + + public StartGpxRecordingParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public StartGpxRecordingParams createFromParcel(Parcel in) { + return new StartGpxRecordingParams(in); + } + + @Override + public StartGpxRecordingParams[] newArray(int size) { + return new StartGpxRecordingParams[size]; + } + }; + + @Override + public void writeToParcel(Parcel out, int flags) { + } + + private void readFromParcel(Parcel in) { + + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/StopGpxRecordingParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/StopGpxRecordingParams.aidl new file mode 100644 index 0000000000..db08f1811a --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/StopGpxRecordingParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.gpx; + +parcelable StopGpxRecordingParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/StopGpxRecordingParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/StopGpxRecordingParams.java new file mode 100644 index 0000000000..ada47db418 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/gpx/StopGpxRecordingParams.java @@ -0,0 +1,40 @@ +package net.osmand.aidl.gpx; + +import android.os.Parcel; +import android.os.Parcelable; + +public class StopGpxRecordingParams implements Parcelable { + + public StopGpxRecordingParams() { + + } + + public StopGpxRecordingParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public StopGpxRecordingParams createFromParcel(Parcel in) { + return new StopGpxRecordingParams(in); + } + + @Override + public StopGpxRecordingParams[] newArray(int size) { + return new StopGpxRecordingParams[size]; + } + }; + + @Override + public void writeToParcel(Parcel out, int flags) { + } + + private void readFromParcel(Parcel in) { + + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/map/ALatLon.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/map/ALatLon.aidl new file mode 100644 index 0000000000..33d5930f02 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/map/ALatLon.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.map; + +parcelable ALatLon; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/map/ALatLon.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/map/ALatLon.java new file mode 100644 index 0000000000..d55d1628e5 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/map/ALatLon.java @@ -0,0 +1,83 @@ +package net.osmand.aidl.map; + +import android.os.Parcel; +import android.os.Parcelable; + +public class ALatLon implements Parcelable { + + 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 CREATOR = new + Creator() { + public ALatLon createFromParcel(Parcel in) { + return new ALatLon(in); + } + + 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; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeDouble(latitude); + out.writeDouble(longitude); + } + + public void readFromParcel(Parcel in) { + latitude = in.readDouble(); + longitude = in.readDouble(); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/map/SetMapLocationParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/map/SetMapLocationParams.aidl new file mode 100644 index 0000000000..9edde4f616 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/map/SetMapLocationParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.map; + +parcelable SetMapLocationParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/map/SetMapLocationParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/map/SetMapLocationParams.java new file mode 100644 index 0000000000..929c817d9d --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/map/SetMapLocationParams.java @@ -0,0 +1,68 @@ +package net.osmand.aidl.map; + +import android.os.Parcel; +import android.os.Parcelable; + +public class SetMapLocationParams implements Parcelable { + + 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 CREATOR = new + Creator() { + public SetMapLocationParams createFromParcel(Parcel in) { + return new SetMapLocationParams(in); + } + + 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; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeDouble(latitude); + out.writeDouble(longitude); + out.writeInt(zoom); + out.writeByte((byte) (animated ? 1 : 0)); + } + + private void readFromParcel(Parcel in) { + latitude = in.readDouble(); + longitude = in.readDouble(); + zoom = in.readInt(); + animated = in.readByte() != 0; + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/AMapLayer.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/AMapLayer.aidl new file mode 100644 index 0000000000..745f49f1a5 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/AMapLayer.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer; + +parcelable AMapLayer; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/AMapLayer.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/AMapLayer.java new file mode 100644 index 0000000000..5c0aa471fa --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/AMapLayer.java @@ -0,0 +1,176 @@ +package net.osmand.aidl.maplayer; + +import android.os.Parcel; +import android.os.Parcelable; + +import net.osmand.aidl.maplayer.point.AMapPoint; + +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.concurrent.ConcurrentHashMap; + +public class AMapLayer implements Parcelable { + private String id; + private String name; + private float zOrder = 5.5f; + private Map 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 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 CREATOR = new + Creator() { + public AMapLayer createFromParcel(Parcel in) { + return new AMapLayer(in); + } + + 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 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; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(id); + out.writeString(name); + out.writeFloat(zOrder); + out.writeTypedList(new ArrayList<>(points.values())); + out.writeByte((byte) (imagePoints ? 1 : 0)); + out.writeInt(circlePointMinZoom); + out.writeInt(circlePointMaxZoom); + out.writeInt(smallPointMinZoom); + out.writeInt(smallPointMaxZoom); + out.writeInt(bigPointMinZoom); + out.writeInt(bigPointMaxZoom); + } + + private void readFromParcel(Parcel in) { + id = in.readString(); + name = in.readString(); + zOrder = in.readFloat(); + List pointList = new ArrayList<>(); + in.readTypedList(pointList, AMapPoint.CREATOR); + for (AMapPoint p : pointList) { + this.points.put(p.getId(), p); + } + imagePoints = in.readByte() == 1; + circlePointMinZoom = in.readInt(); + circlePointMaxZoom = in.readInt(); + smallPointMinZoom = in.readInt(); + smallPointMaxZoom = in.readInt(); + bigPointMinZoom = in.readInt(); + bigPointMaxZoom = in.readInt(); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/AddMapLayerParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/AddMapLayerParams.aidl new file mode 100644 index 0000000000..8116760a45 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/AddMapLayerParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer; + +parcelable AddMapLayerParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/AddMapLayerParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/AddMapLayerParams.java new file mode 100644 index 0000000000..c7a230425c --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/AddMapLayerParams.java @@ -0,0 +1,43 @@ +package net.osmand.aidl.maplayer; + +import android.os.Parcel; +import android.os.Parcelable; + +public class AddMapLayerParams implements Parcelable { + private AMapLayer layer; + + public AddMapLayerParams(AMapLayer layer) { + this.layer = layer; + } + + public AddMapLayerParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public AddMapLayerParams createFromParcel(Parcel in) { + return new AddMapLayerParams(in); + } + + public AddMapLayerParams[] newArray(int size) { + return new AddMapLayerParams[size]; + } + }; + + public AMapLayer getLayer() { + return layer; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(layer, flags); + } + + private void readFromParcel(Parcel in) { + layer = in.readParcelable(AMapLayer.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/RemoveMapLayerParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/RemoveMapLayerParams.aidl new file mode 100644 index 0000000000..20a972ee95 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/RemoveMapLayerParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer; + +parcelable RemoveMapLayerParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/RemoveMapLayerParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/RemoveMapLayerParams.java new file mode 100644 index 0000000000..e3fcb765d1 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/RemoveMapLayerParams.java @@ -0,0 +1,43 @@ +package net.osmand.aidl.maplayer; + +import android.os.Parcel; +import android.os.Parcelable; + +public class RemoveMapLayerParams implements Parcelable { + private String id; + + public RemoveMapLayerParams(String id) { + this.id = id; + } + + public RemoveMapLayerParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public RemoveMapLayerParams createFromParcel(Parcel in) { + return new RemoveMapLayerParams(in); + } + + public RemoveMapLayerParams[] newArray(int size) { + return new RemoveMapLayerParams[size]; + } + }; + + public String getId() { + return id; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(id); + } + + private void readFromParcel(Parcel in) { + id = in.readString(); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/UpdateMapLayerParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/UpdateMapLayerParams.aidl new file mode 100644 index 0000000000..eafe8ef464 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/UpdateMapLayerParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer; + +parcelable UpdateMapLayerParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/UpdateMapLayerParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/UpdateMapLayerParams.java new file mode 100644 index 0000000000..01384c168a --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/UpdateMapLayerParams.java @@ -0,0 +1,43 @@ +package net.osmand.aidl.maplayer; + +import android.os.Parcel; +import android.os.Parcelable; + +public class UpdateMapLayerParams implements Parcelable { + private AMapLayer layer; + + public UpdateMapLayerParams(AMapLayer layer) { + this.layer = layer; + } + + public UpdateMapLayerParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public UpdateMapLayerParams createFromParcel(Parcel in) { + return new UpdateMapLayerParams(in); + } + + public UpdateMapLayerParams[] newArray(int size) { + return new UpdateMapLayerParams[size]; + } + }; + + public AMapLayer getLayer() { + return layer; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(layer, flags); + } + + private void readFromParcel(Parcel in) { + layer = in.readParcelable(AMapLayer.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/AMapPoint.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/AMapPoint.aidl new file mode 100644 index 0000000000..53fb86b788 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/AMapPoint.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer.point; + +parcelable AMapPoint; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/AMapPoint.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/AMapPoint.java new file mode 100644 index 0000000000..48acffde78 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/AMapPoint.java @@ -0,0 +1,125 @@ +package net.osmand.aidl.maplayer.point; + +import android.os.Parcel; +import android.os.Parcelable; + +import net.osmand.aidl.map.ALatLon; + +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +public class AMapPoint implements Parcelable { + 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 List details = new ArrayList<>(); + private Map params = new HashMap<>(); + + public AMapPoint(String id, String shortName, String fullName, String typeName, String layerId, + int color, ALatLon location, List details, Map 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 CREATOR = new + Creator() { + public AMapPoint createFromParcel(Parcel in) { + return new AMapPoint(in); + } + + 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 getDetails() { + return details; + } + + public Map getParams() { + return params; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(id); + out.writeString(shortName); + out.writeString(fullName); + out.writeString(typeName); + out.writeString(layerId); + out.writeInt(color); + out.writeParcelable(location, flags); + out.writeStringList(details); + out.writeMap(params); + } + + private void readFromParcel(Parcel in) { + id = in.readString(); + shortName = in.readString(); + fullName = in.readString(); + typeName = in.readString(); + layerId = in.readString(); + color = in.readInt(); + location = in.readParcelable(ALatLon.class.getClassLoader()); + in.readStringList(details); + in.readMap(params, HashMap.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/AddMapPointParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/AddMapPointParams.aidl new file mode 100644 index 0000000000..d41d6b69ca --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/AddMapPointParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer.point; + +parcelable AddMapPointParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/AddMapPointParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/AddMapPointParams.java new file mode 100644 index 0000000000..0d575a38d9 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/AddMapPointParams.java @@ -0,0 +1,51 @@ +package net.osmand.aidl.maplayer.point; + +import android.os.Parcel; +import android.os.Parcelable; + +public class AddMapPointParams implements Parcelable { + 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 CREATOR = new + Creator() { + public AddMapPointParams createFromParcel(Parcel in) { + return new AddMapPointParams(in); + } + + public AddMapPointParams[] newArray(int size) { + return new AddMapPointParams[size]; + } + }; + + public String getLayerId() { + return layerId; + } + + public AMapPoint getPoint() { + return point; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(layerId); + out.writeParcelable(point, flags); + } + + private void readFromParcel(Parcel in) { + layerId = in.readString(); + point = in.readParcelable(AMapPoint.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/RemoveMapPointParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/RemoveMapPointParams.aidl new file mode 100644 index 0000000000..68a5fdcf11 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/RemoveMapPointParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer.point; + +parcelable RemoveMapPointParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/RemoveMapPointParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/RemoveMapPointParams.java new file mode 100644 index 0000000000..797556b1e3 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/RemoveMapPointParams.java @@ -0,0 +1,51 @@ +package net.osmand.aidl.maplayer.point; + +import android.os.Parcel; +import android.os.Parcelable; + +public class RemoveMapPointParams implements Parcelable { + 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 CREATOR = new + Creator() { + public RemoveMapPointParams createFromParcel(Parcel in) { + return new RemoveMapPointParams(in); + } + + public RemoveMapPointParams[] newArray(int size) { + return new RemoveMapPointParams[size]; + } + }; + + public String getLayerId() { + return layerId; + } + + public String getPointId() { + return pointId; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(layerId); + out.writeString(pointId); + } + + private void readFromParcel(Parcel in) { + layerId = in.readString(); + pointId = in.readString(); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/ShowMapPointParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/ShowMapPointParams.aidl new file mode 100644 index 0000000000..54ff9b2075 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/ShowMapPointParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer.point; + +parcelable ShowMapPointParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/ShowMapPointParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/ShowMapPointParams.java new file mode 100644 index 0000000000..5b6e0c17c9 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/ShowMapPointParams.java @@ -0,0 +1,56 @@ +package net.osmand.aidl.maplayer.point; + +import android.os.Parcel; +import android.os.Parcelable; + +public class ShowMapPointParams implements Parcelable { + + 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 CREATOR = new + Creator() { + @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 writeToParcel(Parcel out, int flags) { + out.writeString(layerId); + out.writeParcelable(point, flags); + } + + private void readFromParcel(Parcel in) { + layerId = in.readString(); + point = in.readParcelable(AMapPoint.class.getClassLoader()); + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/UpdateMapPointParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/UpdateMapPointParams.aidl new file mode 100644 index 0000000000..d81ea87253 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/UpdateMapPointParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.maplayer.point; + +parcelable UpdateMapPointParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/UpdateMapPointParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/UpdateMapPointParams.java new file mode 100644 index 0000000000..a7b871a1d4 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/maplayer/point/UpdateMapPointParams.java @@ -0,0 +1,59 @@ +package net.osmand.aidl.maplayer.point; + +import android.os.Parcel; +import android.os.Parcelable; + +public class UpdateMapPointParams implements Parcelable { + 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 CREATOR = new + Creator() { + public UpdateMapPointParams createFromParcel(Parcel in) { + return new UpdateMapPointParams(in); + } + + public UpdateMapPointParams[] newArray(int size) { + return new UpdateMapPointParams[size]; + } + }; + + public String getLayerId() { + return layerId; + } + + public AMapPoint getPoint() { + return point; + } + + public boolean isUpdateOpenedMenuAndMap() { + return updateOpenedMenuAndMap; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(layerId); + out.writeParcelable(point, flags); + out.writeInt(updateOpenedMenuAndMap ? 1 : 0); + } + + private void readFromParcel(Parcel in) { + layerId = in.readString(); + point = in.readParcelable(AMapPoint.class.getClassLoader()); + updateOpenedMenuAndMap = in.readInt() != 0; + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/AMapMarker.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/AMapMarker.aidl new file mode 100644 index 0000000000..4721b1812b --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/AMapMarker.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.mapmarker; + +parcelable AMapMarker; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/AMapMarker.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/AMapMarker.java new file mode 100644 index 0000000000..c6bcb853c7 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/AMapMarker.java @@ -0,0 +1,63 @@ +package net.osmand.aidl.mapmarker; + +import android.os.Parcel; +import android.os.Parcelable; + +import net.osmand.aidl.map.ALatLon; + +public class AMapMarker implements Parcelable { + + 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 CREATOR = new + Creator() { + public AMapMarker createFromParcel(Parcel in) { + return new AMapMarker(in); + } + + public AMapMarker[] newArray(int size) { + return new AMapMarker[size]; + } + }; + + public ALatLon getLatLon() { + return latLon; + } + + public String getName() { + return name; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(latLon, flags); + out.writeString(name); + } + + private void readFromParcel(Parcel in) { + latLon = in.readParcelable(ALatLon.class.getClassLoader()); + name = in.readString(); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/AddMapMarkerParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/AddMapMarkerParams.aidl new file mode 100644 index 0000000000..eef370b4e2 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/AddMapMarkerParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.mapmarker; + +parcelable AddMapMarkerParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/AddMapMarkerParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/AddMapMarkerParams.java new file mode 100644 index 0000000000..4448ec7336 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/AddMapMarkerParams.java @@ -0,0 +1,44 @@ +package net.osmand.aidl.mapmarker; + +import android.os.Parcel; +import android.os.Parcelable; + +public class AddMapMarkerParams implements Parcelable { + + private AMapMarker marker; + + public AddMapMarkerParams(AMapMarker marker) { + this.marker = marker; + } + + public AddMapMarkerParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public AddMapMarkerParams createFromParcel(Parcel in) { + return new AddMapMarkerParams(in); + } + + public AddMapMarkerParams[] newArray(int size) { + return new AddMapMarkerParams[size]; + } + }; + + public AMapMarker getMarker() { + return marker; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(marker, flags); + } + + private void readFromParcel(Parcel in) { + marker = in.readParcelable(AMapMarker.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/RemoveMapMarkerParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/RemoveMapMarkerParams.aidl new file mode 100644 index 0000000000..e5b5b126ad --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/RemoveMapMarkerParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.mapmarker; + +parcelable RemoveMapMarkerParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/RemoveMapMarkerParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/RemoveMapMarkerParams.java new file mode 100644 index 0000000000..08d412d6c5 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/RemoveMapMarkerParams.java @@ -0,0 +1,44 @@ +package net.osmand.aidl.mapmarker; + +import android.os.Parcel; +import android.os.Parcelable; + +public class RemoveMapMarkerParams implements Parcelable { + + private AMapMarker marker; + + public RemoveMapMarkerParams(AMapMarker marker) { + this.marker = marker; + } + + public RemoveMapMarkerParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public RemoveMapMarkerParams createFromParcel(Parcel in) { + return new RemoveMapMarkerParams(in); + } + + public RemoveMapMarkerParams[] newArray(int size) { + return new RemoveMapMarkerParams[size]; + } + }; + + public AMapMarker getMarker() { + return marker; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(marker, flags); + } + + private void readFromParcel(Parcel in) { + marker = in.readParcelable(AMapMarker.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/UpdateMapMarkerParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/UpdateMapMarkerParams.aidl new file mode 100644 index 0000000000..2a17fa9369 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/UpdateMapMarkerParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.mapmarker; + +parcelable UpdateMapMarkerParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/UpdateMapMarkerParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/UpdateMapMarkerParams.java new file mode 100644 index 0000000000..2b589edfda --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapmarker/UpdateMapMarkerParams.java @@ -0,0 +1,52 @@ +package net.osmand.aidl.mapmarker; + +import android.os.Parcel; +import android.os.Parcelable; + +public class UpdateMapMarkerParams implements Parcelable { + + private AMapMarker markerPrev; + private AMapMarker markerNew; + + public UpdateMapMarkerParams(AMapMarker markerPrev, AMapMarker markerNew) { + this.markerPrev = markerPrev; + this.markerNew = markerNew; + } + + public UpdateMapMarkerParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public UpdateMapMarkerParams createFromParcel(Parcel in) { + return new UpdateMapMarkerParams(in); + } + + public UpdateMapMarkerParams[] newArray(int size) { + return new UpdateMapMarkerParams[size]; + } + }; + + public AMapMarker getMarkerPrev() { + return markerPrev; + } + + public AMapMarker getMarkerNew() { + return markerNew; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(markerPrev, flags); + out.writeParcelable(markerNew, flags); + } + + private void readFromParcel(Parcel in) { + markerPrev = in.readParcelable(AMapMarker.class.getClassLoader()); + markerNew = in.readParcelable(AMapMarker.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/AMapWidget.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/AMapWidget.aidl new file mode 100644 index 0000000000..7798986483 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/AMapWidget.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.mapwidget; + +parcelable AMapWidget; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/AMapWidget.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/AMapWidget.java new file mode 100644 index 0000000000..e5c64cb5a8 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/AMapWidget.java @@ -0,0 +1,110 @@ +package net.osmand.aidl.mapwidget; + +import android.content.Intent; +import android.os.Parcel; +import android.os.Parcelable; + +public class AMapWidget implements Parcelable { + private String id; + private String menuIconName; + private String menuTitle; + private String lightIconName; + private String darkIconName; + private String text; + private String description; + private int order; + private Intent intentOnClick; + + public AMapWidget(String id, String menuIconName, String menuTitle, + String lightIconName, String darkIconName, String text, String description, + int order, Intent intentOnClick) { + this.id = id; + this.menuIconName = menuIconName; + this.menuTitle = menuTitle; + this.lightIconName = lightIconName; + this.darkIconName = darkIconName; + this.text = text; + this.description = description; + this.order = order; + this.intentOnClick = intentOnClick; + } + + public AMapWidget(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public AMapWidget createFromParcel(Parcel in) { + return new AMapWidget(in); + } + + public AMapWidget[] newArray(int size) { + return new AMapWidget[size]; + } + }; + + public String getId() { + return id; + } + + public String getMenuIconName() { + return menuIconName; + } + + public String getMenuTitle() { + return menuTitle; + } + + public String getLightIconName() { + return lightIconName; + } + + public String getDarkIconName() { + return darkIconName; + } + + public String getText() { + return text; + } + + public String getDescription() { + return description; + } + + public int getOrder() { + return order; + } + + public Intent getIntentOnClick() { + return intentOnClick; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(id); + out.writeString(menuIconName); + out.writeString(menuTitle); + out.writeString(lightIconName); + out.writeString(darkIconName); + out.writeString(text); + out.writeString(description); + out.writeInt(order); + out.writeParcelable(intentOnClick, flags); + } + + private void readFromParcel(Parcel in) { + id = in.readString(); + menuIconName = in.readString(); + menuTitle = in.readString(); + lightIconName = in.readString(); + darkIconName = in.readString(); + text = in.readString(); + description = in.readString(); + order = in.readInt(); + intentOnClick = in.readParcelable(Intent.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/AddMapWidgetParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/AddMapWidgetParams.aidl new file mode 100644 index 0000000000..891d338eb8 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/AddMapWidgetParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.mapwidget; + +parcelable AddMapWidgetParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/AddMapWidgetParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/AddMapWidgetParams.java new file mode 100644 index 0000000000..c411d33409 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/AddMapWidgetParams.java @@ -0,0 +1,43 @@ +package net.osmand.aidl.mapwidget; + +import android.os.Parcel; +import android.os.Parcelable; + +public class AddMapWidgetParams implements Parcelable { + private AMapWidget widget; + + public AddMapWidgetParams(AMapWidget widget) { + this.widget = widget; + } + + public AddMapWidgetParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public AddMapWidgetParams createFromParcel(Parcel in) { + return new AddMapWidgetParams(in); + } + + public AddMapWidgetParams[] newArray(int size) { + return new AddMapWidgetParams[size]; + } + }; + + public AMapWidget getWidget() { + return widget; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(widget, flags); + } + + private void readFromParcel(Parcel in) { + widget = in.readParcelable(AMapWidget.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/RemoveMapWidgetParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/RemoveMapWidgetParams.aidl new file mode 100644 index 0000000000..445b0c994d --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/RemoveMapWidgetParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.mapwidget; + +parcelable RemoveMapWidgetParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/RemoveMapWidgetParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/RemoveMapWidgetParams.java new file mode 100644 index 0000000000..10152e1515 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/RemoveMapWidgetParams.java @@ -0,0 +1,43 @@ +package net.osmand.aidl.mapwidget; + +import android.os.Parcel; +import android.os.Parcelable; + +public class RemoveMapWidgetParams implements Parcelable { + private String id; + + public RemoveMapWidgetParams(String id) { + this.id = id; + } + + public RemoveMapWidgetParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public RemoveMapWidgetParams createFromParcel(Parcel in) { + return new RemoveMapWidgetParams(in); + } + + public RemoveMapWidgetParams[] newArray(int size) { + return new RemoveMapWidgetParams[size]; + } + }; + + public String getId() { + return id; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(id); + } + + private void readFromParcel(Parcel in) { + id = in.readString(); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/UpdateMapWidgetParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/UpdateMapWidgetParams.aidl new file mode 100644 index 0000000000..b92f94c008 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/UpdateMapWidgetParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.mapwidget; + +parcelable UpdateMapWidgetParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/UpdateMapWidgetParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/UpdateMapWidgetParams.java new file mode 100644 index 0000000000..3e96676293 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/mapwidget/UpdateMapWidgetParams.java @@ -0,0 +1,43 @@ +package net.osmand.aidl.mapwidget; + +import android.os.Parcel; +import android.os.Parcelable; + +public class UpdateMapWidgetParams implements Parcelable { + private AMapWidget widget; + + public UpdateMapWidgetParams(AMapWidget widget) { + this.widget = widget; + } + + public UpdateMapWidgetParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public UpdateMapWidgetParams createFromParcel(Parcel in) { + return new UpdateMapWidgetParams(in); + } + + public UpdateMapWidgetParams[] newArray(int size) { + return new UpdateMapWidgetParams[size]; + } + }; + + public AMapWidget getWidget() { + return widget; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeParcelable(widget, flags); + } + + private void readFromParcel(Parcel in) { + widget = in.readParcelable(AMapWidget.class.getClassLoader()); + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerFooterParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerFooterParams.aidl new file mode 100644 index 0000000000..fc1271a8ca --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerFooterParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navdrawer; + +parcelable NavDrawerFooterParams; diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerFooterParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerFooterParams.java new file mode 100644 index 0000000000..9bfd70193f --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerFooterParams.java @@ -0,0 +1,68 @@ +package net.osmand.aidl.navdrawer; + +import android.os.Parcel; +import android.os.Parcelable; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; + +public class NavDrawerFooterParams implements Parcelable { + + @NonNull + private String packageName; + @Nullable + private String intent; + @Nullable + private String appName; + + @NonNull + public String getPackageName() { + return packageName; + } + + @Nullable + public String getIntent() { + return intent; + } + + @Nullable + public String getAppName() { + return appName; + } + + public NavDrawerFooterParams(@NonNull String packageName, @Nullable String intent, + @Nullable String appName) { + this.packageName = packageName; + this.intent = intent; + this.appName = appName; + } + + protected NavDrawerFooterParams(Parcel in) { + packageName = in.readString(); + intent = in.readString(); + appName = in.readString(); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeString(packageName); + dest.writeString(intent); + dest.writeString(appName); + } + + @Override + public int describeContents() { + return 0; + } + + public static final Creator CREATOR = new Creator() { + @Override + public NavDrawerFooterParams createFromParcel(Parcel in) { + return new NavDrawerFooterParams(in); + } + + @Override + public NavDrawerFooterParams[] newArray(int size) { + return new NavDrawerFooterParams[size]; + } + }; +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerHeaderParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerHeaderParams.aidl new file mode 100644 index 0000000000..c230824841 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerHeaderParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navdrawer; + +parcelable NavDrawerHeaderParams; diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerHeaderParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerHeaderParams.java new file mode 100644 index 0000000000..c88950fd10 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerHeaderParams.java @@ -0,0 +1,68 @@ +package net.osmand.aidl.navdrawer; + +import android.os.Parcel; +import android.os.Parcelable; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; + +public class NavDrawerHeaderParams implements Parcelable { + + @NonNull + private String imageUri; + @NonNull + private String packageName; + @Nullable + private String intent; + + @NonNull + public String getImageUri() { + return imageUri; + } + + @NonNull + public String getPackageName() { + return packageName; + } + + @Nullable + public String getIntent() { + return intent; + } + + public NavDrawerHeaderParams(@NonNull String imageUri, @NonNull String packageName, + @Nullable String intent) { + this.imageUri = imageUri; + this.packageName = packageName; + this.intent = intent; + } + + public NavDrawerHeaderParams(Parcel in) { + imageUri = in.readString(); + packageName = in.readString(); + intent = in.readString(); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeString(imageUri); + dest.writeString(packageName); + dest.writeString(intent); + } + + @Override + public int describeContents() { + return 0; + } + + public static final Creator CREATOR = new Creator() { + @Override + public NavDrawerHeaderParams createFromParcel(Parcel in) { + return new NavDrawerHeaderParams(in); + } + + @Override + public NavDrawerHeaderParams[] newArray(int size) { + return new NavDrawerHeaderParams[size]; + } + }; +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerItem.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerItem.aidl new file mode 100644 index 0000000000..082061b7f1 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerItem.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navdrawer; + +parcelable NavDrawerItem; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerItem.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerItem.java new file mode 100644 index 0000000000..aedc585b65 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/NavDrawerItem.java @@ -0,0 +1,73 @@ +package net.osmand.aidl.navdrawer; + +import android.os.Parcel; +import android.os.Parcelable; +import android.support.annotation.NonNull; +import android.support.annotation.Nullable; + +public class NavDrawerItem implements Parcelable { + + private String name; + private String uri; + private String iconName; + private int flags; + + public NavDrawerItem(@NonNull String name, @NonNull String uri, @Nullable String iconName) { + this(name, uri, iconName, -1); + } + + public NavDrawerItem(@NonNull String name, @NonNull String uri, @Nullable String iconName, int flags) { + this.name = name; + this.uri = uri; + this.iconName = iconName; + this.flags = flags; + } + + protected NavDrawerItem(Parcel in) { + name = in.readString(); + uri = in.readString(); + iconName = in.readString(); + flags = in.readInt(); + } + + public String getName() { + return name; + } + + public String getUri() { + return uri; + } + + public String getIconName() { + return iconName; + } + + public int getFlags() { + return flags; + } + + @Override + public void writeToParcel(Parcel dest, int f) { + dest.writeString(name); + dest.writeString(uri); + dest.writeString(iconName); + dest.writeInt(flags); + } + + @Override + public int describeContents() { + return 0; + } + + public static final Creator CREATOR = new Creator() { + @Override + public NavDrawerItem createFromParcel(Parcel in) { + return new NavDrawerItem(in); + } + + @Override + public NavDrawerItem[] newArray(int size) { + return new NavDrawerItem[size]; + } + }; +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/SetNavDrawerItemsParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/SetNavDrawerItemsParams.aidl new file mode 100644 index 0000000000..1d34a5cdc5 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/SetNavDrawerItemsParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navdrawer; + +parcelable SetNavDrawerItemsParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/SetNavDrawerItemsParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/SetNavDrawerItemsParams.java new file mode 100644 index 0000000000..783a76eb7b --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navdrawer/SetNavDrawerItemsParams.java @@ -0,0 +1,56 @@ +package net.osmand.aidl.navdrawer; + +import android.os.Parcel; +import android.os.Parcelable; +import android.support.annotation.NonNull; + +import java.util.ArrayList; +import java.util.List; + +public class SetNavDrawerItemsParams implements Parcelable { + + private String appPackage; + private List items; + + public SetNavDrawerItemsParams(@NonNull String appPackage, @NonNull List items) { + this.appPackage = appPackage; + this.items = items; + } + + protected SetNavDrawerItemsParams(Parcel in) { + appPackage = in.readString(); + items = new ArrayList<>(); + in.readTypedList(items, NavDrawerItem.CREATOR); + } + + public String getAppPackage() { + return appPackage; + } + + public List getItems() { + return items; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeString(appPackage); + dest.writeTypedList(new ArrayList<>(items)); + } + + @Override + public int describeContents() { + return 0; + } + + public static final Creator CREATOR = new Creator() { + @Override + public SetNavDrawerItemsParams createFromParcel(Parcel in) { + return new SetNavDrawerItemsParams(in); + } + + @Override + public SetNavDrawerItemsParams[] newArray(int size) { + return new SetNavDrawerItemsParams[size]; + } + }; +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ADirectionInfo.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ADirectionInfo.aidl new file mode 100644 index 0000000000..b0793d6e1a --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ADirectionInfo.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navigation; + +parcelable ADirectionInfo; diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ADirectionInfo.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ADirectionInfo.java new file mode 100644 index 0000000000..a5e7074f0e --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ADirectionInfo.java @@ -0,0 +1,73 @@ +package net.osmand.aidl.navigation; + +import android.os.Parcel; +import android.os.Parcelable; + +public class ADirectionInfo implements Parcelable { + + private int distanceTo; //distance to next turn + private int turnType; //turn type + private boolean isLeftSide; //is movement left-sided + + public ADirectionInfo(int distanceTo, int turnType, boolean isLeftSide) { + this.distanceTo = distanceTo; + this.turnType = turnType; + this.isLeftSide = isLeftSide; + } + + protected ADirectionInfo(Parcel in) { + distanceTo = in.readInt(); + turnType = in.readInt(); + isLeftSide = in.readByte() != 0; + } + + public static final Creator CREATOR = new Creator() { + @Override + public ADirectionInfo createFromParcel(Parcel in) { + return new ADirectionInfo(in); + } + + @Override + public ADirectionInfo[] newArray(int size) { + return new ADirectionInfo[size]; + } + }; + + public int getDistanceTo() { + return distanceTo; + } + + public int getTurnType() { + return turnType; + } + + public boolean isLeftSide() { + return isLeftSide; + } + + public void setDistanceTo(int distanceTo) { + this.distanceTo = distanceTo; + } + + public void setTurnType(int turnType) { + this.turnType = turnType; + } + + public void setLeftSide(boolean leftSide) { + isLeftSide = leftSide; + } + + @Override + public int describeContents() { + return 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeInt(distanceTo); + dest.writeInt(turnType); + dest.writeByte((byte) (isLeftSide ? 1 : 0)); + } + + +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ANavigationUpdateParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ANavigationUpdateParams.aidl new file mode 100644 index 0000000000..43f370d024 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ANavigationUpdateParams.aidl @@ -0,0 +1,4 @@ + +package net.osmand.aidl.navigation; + +parcelable ANavigationUpdateParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ANavigationUpdateParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ANavigationUpdateParams.java new file mode 100644 index 0000000000..38c8f5ffe4 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ANavigationUpdateParams.java @@ -0,0 +1,57 @@ +package net.osmand.aidl.navigation; + +import android.os.Parcel; +import android.os.Parcelable; + +public class ANavigationUpdateParams implements Parcelable { + + private boolean subscribeToUpdates = true; + private long callbackId = -1L; + + public ANavigationUpdateParams() { + } + + public long getCallbackId() { + return callbackId; + } + + public void setCallbackId(long callbackId) { + this.callbackId = callbackId; + } + + public void setSubscribeToUpdates(boolean subscribeToUpdates) { + this.subscribeToUpdates = subscribeToUpdates; + } + + public boolean isSubscribeToUpdates() { + return subscribeToUpdates; + } + + protected ANavigationUpdateParams(Parcel in) { + callbackId = in.readLong(); + subscribeToUpdates = in.readByte() != 0; + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeLong(callbackId); + dest.writeByte((byte) (subscribeToUpdates ? 1 : 0)); + } + + @Override + public int describeContents() { + return 0; + } + + public static final Creator CREATOR = new Creator() { + @Override + public ANavigationUpdateParams createFromParcel(Parcel in) { + return new ANavigationUpdateParams(in); + } + + @Override + public ANavigationUpdateParams[] newArray(int size) { + return new ANavigationUpdateParams[size]; + } + }; +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/MuteNavigationParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/MuteNavigationParams.aidl new file mode 100644 index 0000000000..d1205adaf3 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/MuteNavigationParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navigation; + +parcelable MuteNavigationParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/MuteNavigationParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/MuteNavigationParams.java new file mode 100644 index 0000000000..8965c415fa --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/MuteNavigationParams.java @@ -0,0 +1,38 @@ +package net.osmand.aidl.navigation; + +import android.os.Parcel; +import android.os.Parcelable; + +public class MuteNavigationParams implements Parcelable { + + public MuteNavigationParams() { + } + + public MuteNavigationParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public MuteNavigationParams createFromParcel(Parcel in) { + return new MuteNavigationParams(in); + } + + @Override + public MuteNavigationParams[] newArray(int size) { + return new MuteNavigationParams[size]; + } + }; + + @Override + public void writeToParcel(Parcel out, int flags) { + } + + private void readFromParcel(Parcel in) { + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateGpxParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateGpxParams.aidl new file mode 100644 index 0000000000..dea59ed048 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateGpxParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navigation; + +parcelable NavigateGpxParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateGpxParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateGpxParams.java new file mode 100644 index 0000000000..6e8fb8efe7 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateGpxParams.java @@ -0,0 +1,69 @@ +package net.osmand.aidl.navigation; + +import android.net.Uri; +import android.os.Parcel; +import android.os.Parcelable; + +public class NavigateGpxParams implements Parcelable { + + private String data; + private Uri uri; + private boolean force; + + public NavigateGpxParams(String data, boolean force) { + this.data = data; + this.force = force; + } + + public NavigateGpxParams(Uri uri, boolean force) { + this.uri = uri; + this.force = force; + } + + public NavigateGpxParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public NavigateGpxParams createFromParcel(Parcel in) { + return new NavigateGpxParams(in); + } + + @Override + public NavigateGpxParams[] newArray(int size) { + return new NavigateGpxParams[size]; + } + }; + + public String getData() { + return data; + } + + public Uri getUri() { + return uri; + } + + public boolean isForce() { + return force; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeString(data); + out.writeParcelable(uri, flags); + out.writeByte((byte) (force ? 1 : 0)); + } + + private void readFromParcel(Parcel in) { + data = in.readString(); + uri = in.readParcelable(Uri.class.getClassLoader()); + force = in.readByte() != 0; + } + + @Override + public int describeContents() { + return 0; + } + +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateParams.aidl new file mode 100644 index 0000000000..f9b51d7a8c --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navigation; + +parcelable NavigateParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateParams.java new file mode 100644 index 0000000000..8b0bdeb1eb --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateParams.java @@ -0,0 +1,104 @@ +package net.osmand.aidl.navigation; + +import android.os.Parcel; +import android.os.Parcelable; + +public class NavigateParams implements Parcelable { + + private String startName; + private double startLat; + private double startLon; + private String destName; + private double destLat; + private double destLon; + private String profile; + private boolean force; + + public NavigateParams(String startName, double startLat, double startLon, String destName, double destLat, double destLon, String profile, boolean force) { + this.startName = startName; + this.startLat = startLat; + this.startLon = startLon; + this.destName = destName; + this.destLat = destLat; + this.destLon = destLon; + this.profile = profile; + this.force = force; + } + + public NavigateParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public NavigateParams createFromParcel(Parcel in) { + return new NavigateParams(in); + } + + @Override + public NavigateParams[] newArray(int size) { + return new NavigateParams[size]; + } + }; + + public String getStartName() { + return startName; + } + + public double getStartLat() { + return startLat; + } + + public double getStartLon() { + return startLon; + } + + public String getDestName() { + return destName; + } + + public double getDestLat() { + return destLat; + } + + public double getDestLon() { + return destLon; + } + + public String getProfile() { + return profile; + } + + public boolean isForce() { + return force; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeString(startName); + out.writeDouble(startLat); + out.writeDouble(startLon); + out.writeString(destName); + out.writeDouble(destLat); + out.writeDouble(destLon); + out.writeString(profile); + out.writeByte((byte) (force ? 1 : 0)); + } + + private void readFromParcel(Parcel in) { + startName = in.readString(); + startLat = in.readDouble(); + startLon = in.readDouble(); + destName = in.readString(); + destLat = in.readDouble(); + destLon = in.readDouble(); + profile = in.readString(); + force = in.readByte() != 0; + } + + @Override + public int describeContents() { + return 0; + } + +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateSearchParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateSearchParams.aidl new file mode 100644 index 0000000000..57433b8fde --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateSearchParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navigation; + +parcelable NavigateSearchParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateSearchParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateSearchParams.java new file mode 100644 index 0000000000..b092bcd4eb --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/NavigateSearchParams.java @@ -0,0 +1,106 @@ +package net.osmand.aidl.navigation; + +import android.os.Parcel; +import android.os.Parcelable; + +public class NavigateSearchParams implements Parcelable { + + private String startName; + private double startLat; + private double startLon; + private String searchQuery; + private double searchLat; + private double searchLon; + private String profile; + private boolean force; + + public NavigateSearchParams(String startName, double startLat, double startLon, + String searchQuery, double searchLat, double searchLon, + String profile, boolean force) { + this.startName = startName; + this.startLat = startLat; + this.startLon = startLon; + this.searchQuery = searchQuery; + this.searchLat = searchLat; + this.searchLon = searchLon; + this.profile = profile; + this.force = force; + } + + public NavigateSearchParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public NavigateSearchParams createFromParcel(Parcel in) { + return new NavigateSearchParams(in); + } + + @Override + public NavigateSearchParams[] newArray(int size) { + return new NavigateSearchParams[size]; + } + }; + + public String getStartName() { + return startName; + } + + public double getStartLat() { + return startLat; + } + + public double getStartLon() { + return startLon; + } + + public String getSearchQuery() { + return searchQuery; + } + + public double getSearchLat() { + return searchLat; + } + + public double getSearchLon() { + return searchLon; + } + + public String getProfile() { + return profile; + } + + public boolean isForce() { + return force; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeString(startName); + out.writeDouble(startLat); + out.writeDouble(startLon); + out.writeString(searchQuery); + out.writeString(profile); + out.writeByte((byte) (force ? 1 : 0)); + out.writeDouble(searchLat); + out.writeDouble(searchLon); + } + + private void readFromParcel(Parcel in) { + startName = in.readString(); + startLat = in.readDouble(); + startLon = in.readDouble(); + searchQuery = in.readString(); + profile = in.readString(); + force = in.readByte() != 0; + searchLat = in.readDouble(); + searchLon = in.readDouble(); + } + + @Override + public int describeContents() { + return 0; + } + +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/PauseNavigationParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/PauseNavigationParams.aidl new file mode 100644 index 0000000000..0a18566304 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/PauseNavigationParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navigation; + +parcelable PauseNavigationParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/PauseNavigationParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/PauseNavigationParams.java new file mode 100644 index 0000000000..5a28538039 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/PauseNavigationParams.java @@ -0,0 +1,38 @@ +package net.osmand.aidl.navigation; + +import android.os.Parcel; +import android.os.Parcelable; + +public class PauseNavigationParams implements Parcelable { + + public PauseNavigationParams() { + } + + public PauseNavigationParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public PauseNavigationParams createFromParcel(Parcel in) { + return new PauseNavigationParams(in); + } + + @Override + public PauseNavigationParams[] newArray(int size) { + return new PauseNavigationParams[size]; + } + }; + + @Override + public void writeToParcel(Parcel out, int flags) { + } + + private void readFromParcel(Parcel in) { + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ResumeNavigationParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ResumeNavigationParams.aidl new file mode 100644 index 0000000000..4dcf619aaa --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ResumeNavigationParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navigation; + +parcelable ResumeNavigationParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ResumeNavigationParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ResumeNavigationParams.java new file mode 100644 index 0000000000..d1032dc914 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/ResumeNavigationParams.java @@ -0,0 +1,38 @@ +package net.osmand.aidl.navigation; + +import android.os.Parcel; +import android.os.Parcelable; + +public class ResumeNavigationParams implements Parcelable { + + public ResumeNavigationParams() { + } + + public ResumeNavigationParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public ResumeNavigationParams createFromParcel(Parcel in) { + return new ResumeNavigationParams(in); + } + + @Override + public ResumeNavigationParams[] newArray(int size) { + return new ResumeNavigationParams[size]; + } + }; + + @Override + public void writeToParcel(Parcel out, int flags) { + } + + private void readFromParcel(Parcel in) { + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/StopNavigationParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/StopNavigationParams.aidl new file mode 100644 index 0000000000..5ba45bdf50 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/StopNavigationParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navigation; + +parcelable StopNavigationParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/StopNavigationParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/StopNavigationParams.java new file mode 100644 index 0000000000..e87d6ed2da --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/StopNavigationParams.java @@ -0,0 +1,38 @@ +package net.osmand.aidl.navigation; + +import android.os.Parcel; +import android.os.Parcelable; + +public class StopNavigationParams implements Parcelable { + + public StopNavigationParams() { + } + + public StopNavigationParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public StopNavigationParams createFromParcel(Parcel in) { + return new StopNavigationParams(in); + } + + @Override + public StopNavigationParams[] newArray(int size) { + return new StopNavigationParams[size]; + } + }; + + @Override + public void writeToParcel(Parcel out, int flags) { + } + + private void readFromParcel(Parcel in) { + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/UnmuteNavigationParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/UnmuteNavigationParams.aidl new file mode 100644 index 0000000000..7512bbcf34 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/UnmuteNavigationParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.navigation; + +parcelable UnmuteNavigationParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/UnmuteNavigationParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/UnmuteNavigationParams.java new file mode 100644 index 0000000000..36819db065 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/navigation/UnmuteNavigationParams.java @@ -0,0 +1,38 @@ +package net.osmand.aidl.navigation; + +import android.os.Parcel; +import android.os.Parcelable; + +public class UnmuteNavigationParams implements Parcelable { + + public UnmuteNavigationParams() { + } + + public UnmuteNavigationParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public UnmuteNavigationParams createFromParcel(Parcel in) { + return new UnmuteNavigationParams(in); + } + + @Override + public UnmuteNavigationParams[] newArray(int size) { + return new UnmuteNavigationParams[size]; + } + }; + + @Override + public void writeToParcel(Parcel out, int flags) { + } + + private void readFromParcel(Parcel in) { + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StartAudioRecordingParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StartAudioRecordingParams.aidl new file mode 100644 index 0000000000..bb16dea140 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StartAudioRecordingParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.note; + +parcelable StartAudioRecordingParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StartAudioRecordingParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StartAudioRecordingParams.java new file mode 100644 index 0000000000..c2800feb9c --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StartAudioRecordingParams.java @@ -0,0 +1,56 @@ +package net.osmand.aidl.note; + +import android.os.Parcel; +import android.os.Parcelable; + +public class StartAudioRecordingParams implements Parcelable { + + private double latitude; + private double longitude; + + public StartAudioRecordingParams(double latitude, double longitude) { + this.latitude = latitude; + this.longitude = longitude; + } + + public StartAudioRecordingParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public StartAudioRecordingParams createFromParcel(Parcel in) { + return new StartAudioRecordingParams(in); + } + + @Override + public StartAudioRecordingParams[] newArray(int size) { + return new StartAudioRecordingParams[size]; + } + }; + + public double getLatitude() { + return latitude; + } + + public double getLongitude() { + return longitude; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeDouble(latitude); + out.writeDouble(longitude); + } + + private void readFromParcel(Parcel in) { + latitude = in.readDouble(); + longitude = in.readDouble(); + } + + @Override + public int describeContents() { + return 0; + } + +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StartVideoRecordingParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StartVideoRecordingParams.aidl new file mode 100644 index 0000000000..082b68e09c --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StartVideoRecordingParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.note; + +parcelable StartVideoRecordingParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StartVideoRecordingParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StartVideoRecordingParams.java new file mode 100644 index 0000000000..aee86ea9de --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StartVideoRecordingParams.java @@ -0,0 +1,56 @@ +package net.osmand.aidl.note; + +import android.os.Parcel; +import android.os.Parcelable; + +public class StartVideoRecordingParams implements Parcelable { + + private double latitude; + private double longitude; + + public StartVideoRecordingParams(double latitude, double longitude) { + this.latitude = latitude; + this.longitude = longitude; + } + + public StartVideoRecordingParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public StartVideoRecordingParams createFromParcel(Parcel in) { + return new StartVideoRecordingParams(in); + } + + @Override + public StartVideoRecordingParams[] newArray(int size) { + return new StartVideoRecordingParams[size]; + } + }; + + public double getLatitude() { + return latitude; + } + + public double getLongitude() { + return longitude; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeDouble(latitude); + out.writeDouble(longitude); + } + + private void readFromParcel(Parcel in) { + latitude = in.readDouble(); + longitude = in.readDouble(); + } + + @Override + public int describeContents() { + return 0; + } + +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StopRecordingParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StopRecordingParams.aidl new file mode 100644 index 0000000000..4111efbcb6 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StopRecordingParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.note; + +parcelable StopRecordingParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StopRecordingParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StopRecordingParams.java new file mode 100644 index 0000000000..b56a42504b --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/StopRecordingParams.java @@ -0,0 +1,42 @@ +package net.osmand.aidl.note; + +import android.os.Parcel; +import android.os.Parcelable; + +public class StopRecordingParams implements Parcelable { + + public StopRecordingParams() { + + } + + public StopRecordingParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public StopRecordingParams createFromParcel(Parcel in) { + return new StopRecordingParams(in); + } + + @Override + public StopRecordingParams[] newArray(int size) { + return new StopRecordingParams[size]; + } + }; + + @Override + public void writeToParcel(Parcel out, int flags) { + + } + + private void readFromParcel(Parcel in) { + + } + + @Override + public int describeContents() { + return 0; + } + +} \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/TakePhotoNoteParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/TakePhotoNoteParams.aidl new file mode 100644 index 0000000000..3c09d62c41 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/TakePhotoNoteParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.note; + +parcelable TakePhotoNoteParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/TakePhotoNoteParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/TakePhotoNoteParams.java new file mode 100644 index 0000000000..254516e080 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/note/TakePhotoNoteParams.java @@ -0,0 +1,56 @@ +package net.osmand.aidl.note; + +import android.os.Parcel; +import android.os.Parcelable; + +public class TakePhotoNoteParams implements Parcelable { + + private double latitude; + private double longitude; + + public TakePhotoNoteParams(double latitude, double longitude) { + this.latitude = latitude; + this.longitude = longitude; + } + + public TakePhotoNoteParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public TakePhotoNoteParams createFromParcel(Parcel in) { + return new TakePhotoNoteParams(in); + } + + @Override + public TakePhotoNoteParams[] newArray(int size) { + return new TakePhotoNoteParams[size]; + } + }; + + public double getLatitude() { + return latitude; + } + + public double getLongitude() { + return longitude; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeDouble(latitude); + out.writeDouble(longitude); + } + + private void readFromParcel(Parcel in) { + latitude = in.readDouble(); + longitude = in.readDouble(); + } + + @Override + public int describeContents() { + return 0; + } + +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/plugins/PluginParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/plugins/PluginParams.aidl new file mode 100644 index 0000000000..beff693f5a --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/plugins/PluginParams.aidl @@ -0,0 +1,5 @@ +// PluginParams.aidl +package net.osmand.aidl.plugins; + +parcelable PluginParams; + diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/plugins/PluginParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/plugins/PluginParams.java new file mode 100644 index 0000000000..028bd8676a --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/plugins/PluginParams.java @@ -0,0 +1,51 @@ +package net.osmand.aidl.plugins; + +import android.os.Parcel; +import android.os.Parcelable; + +public class PluginParams implements Parcelable { + + private String pluginId; + private int newState; //0- off, 1 - on + + public PluginParams(String pluginId, int newState) { + this.pluginId = pluginId; + this.newState = newState; + } + + public String getPluginId() { + return pluginId; + } + + public int getNewState() { + return newState; + } + + protected PluginParams(Parcel in) { + pluginId = in.readString(); + newState = in.readInt(); + } + + @Override + public void writeToParcel(Parcel dest, int flags) { + dest.writeString(pluginId); + dest.writeInt(newState); + } + + @Override + public int describeContents() { + return 0; + } + + public static final Creator CREATOR = new Creator() { + @Override + public PluginParams createFromParcel(Parcel in) { + return new PluginParams(in); + } + + @Override + public PluginParams[] newArray(int size) { + return new PluginParams[size]; + } + }; +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/search/SearchParams.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/search/SearchParams.aidl new file mode 100644 index 0000000000..dfda88c493 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/search/SearchParams.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.search; + +parcelable SearchParams; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/search/SearchParams.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/search/SearchParams.java new file mode 100644 index 0000000000..303cecb25c --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/search/SearchParams.java @@ -0,0 +1,91 @@ +package net.osmand.aidl.search; + +import android.os.Parcel; +import android.os.Parcelable; + +public class SearchParams implements Parcelable { + + public static final int SEARCH_TYPE_POI = 1; + public static final int SEARCH_TYPE_ADDRESS = 2; + public static final int SEARCH_TYPE_ALL = SEARCH_TYPE_POI | SEARCH_TYPE_ADDRESS; + + private String searchQuery; + private int searchType; + private double latitude; + private double longitude; + private int radiusLevel = 1; + private int totalLimit = -1; + + public SearchParams(String searchQuery, int searchType, double latitude, double longitude, int radiusLevel, int totalLimit) { + this.searchQuery = searchQuery; + this.searchType = searchType; + this.latitude = latitude; + this.longitude = longitude; + this.radiusLevel = radiusLevel; + this.totalLimit = totalLimit; + } + + public SearchParams(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public SearchParams createFromParcel(Parcel in) { + return new SearchParams(in); + } + + @Override + public SearchParams[] newArray(int size) { + return new SearchParams[size]; + } + }; + + public String getSearchQuery() { + return searchQuery; + } + + public int getSearchType() { + return searchType; + } + + public double getLatitude() { + return latitude; + } + + public double getLongitude() { + return longitude; + } + + public int getRadiusLevel() { + return radiusLevel; + } + + public int getTotalLimit() { + return totalLimit; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeString(searchQuery); + out.writeInt(searchType); + out.writeDouble(latitude); + out.writeDouble(longitude); + out.writeInt(radiusLevel); + out.writeInt(totalLimit); + } + + private void readFromParcel(Parcel in) { + searchQuery = in.readString(); + searchType = in.readInt(); + latitude = in.readDouble(); + longitude = in.readDouble(); + radiusLevel = in.readInt(); + totalLimit = in.readInt(); + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/search/SearchResult.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/search/SearchResult.aidl new file mode 100644 index 0000000000..caecc7721b --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/search/SearchResult.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.search; + +parcelable SearchResult; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/search/SearchResult.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/search/SearchResult.java new file mode 100644 index 0000000000..ef28063355 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/search/SearchResult.java @@ -0,0 +1,96 @@ +package net.osmand.aidl.search; + +import android.os.Parcel; +import android.os.Parcelable; + +import java.util.ArrayList; +import java.util.List; + +public class SearchResult implements Parcelable { + + private double latitude; + private double longitude; + + private String localName; + private String localTypeName; + + private String alternateName; + private List otherNames = new ArrayList<>(); + + + public SearchResult(double latitude, double longitude, String localName, String localTypeName, + String alternateName, List otherNames) { + this.latitude = latitude; + this.longitude = longitude; + this.localName = localName; + this.localTypeName = localTypeName; + this.alternateName = alternateName; + if (otherNames != null) { + this.otherNames = otherNames; + } + } + + public SearchResult(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new Creator() { + @Override + public SearchResult createFromParcel(Parcel in) { + return new SearchResult(in); + } + + @Override + public SearchResult[] newArray(int size) { + return new SearchResult[size]; + } + }; + + public double getLatitude() { + return latitude; + } + + public double getLongitude() { + return longitude; + } + + public String getLocalName() { + return localName; + } + + public String getLocalTypeName() { + return localTypeName; + } + + public String getAlternateName() { + return alternateName; + } + + public List getOtherNames() { + return otherNames; + } + + @Override + public void writeToParcel(Parcel out, int flags) { + out.writeDouble(latitude); + out.writeDouble(longitude); + out.writeString(localName); + out.writeString(localTypeName); + out.writeString(alternateName); + out.writeStringList(otherNames); + } + + private void readFromParcel(Parcel in) { + latitude = in.readDouble(); + longitude = in.readDouble(); + localName = in.readString(); + localTypeName = in.readString(); + alternateName = in.readString(); + in.readStringList(otherNames); + } + + @Override + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/tiles/ASqliteDbFile.aidl b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/tiles/ASqliteDbFile.aidl new file mode 100644 index 0000000000..319cfd5035 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/tiles/ASqliteDbFile.aidl @@ -0,0 +1,3 @@ +package net.osmand.aidl.tiles; + +parcelable ASqliteDbFile; \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/tiles/ASqliteDbFile.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/tiles/ASqliteDbFile.java new file mode 100644 index 0000000000..ac6f5e55d2 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/aidl/tiles/ASqliteDbFile.java @@ -0,0 +1,69 @@ +package net.osmand.aidl.tiles; + +import android.os.Parcel; +import android.os.Parcelable; +import android.support.annotation.NonNull; + +public class ASqliteDbFile implements Parcelable { + + private String fileName; + private long modifiedTime; + private long fileSize; + private boolean active; + + public ASqliteDbFile(@NonNull String fileName, long modifiedTime, long fileSize, boolean active) { + this.fileName = fileName; + this.modifiedTime = modifiedTime; + this.fileSize = fileSize; + this.active = active; + } + + public ASqliteDbFile(Parcel in) { + readFromParcel(in); + } + + public static final Creator CREATOR = new + Creator() { + public ASqliteDbFile createFromParcel(Parcel in) { + return new ASqliteDbFile(in); + } + + public ASqliteDbFile[] newArray(int size) { + return new ASqliteDbFile[size]; + } + }; + + public String getFileName() { + return fileName; + } + + public long getModifiedTime() { + return modifiedTime; + } + + public long getFileSize() { + return fileSize; + } + + public boolean isActive() { + return active; + } + + public void writeToParcel(Parcel out, int flags) { + out.writeString(fileName); + out.writeLong(modifiedTime); + out.writeLong(fileSize); + out.writeByte((byte) (active ? 1 : 0)); + } + + private void readFromParcel(Parcel in) { + fileName = in.readString(); + modifiedTime = in.readLong(); + fileSize = in.readLong(); + active = in.readByte() != 0; + } + + public int describeContents() { + return 0; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/AdminDevicePermissionSetUpActivity.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/AdminDevicePermissionSetUpActivity.java new file mode 100644 index 0000000000..cd43740663 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/AdminDevicePermissionSetUpActivity.java @@ -0,0 +1,92 @@ +package net.osmand.turn_screen_on; + +import android.app.admin.DevicePolicyManager; +import android.content.ComponentName; +import android.content.Intent; +import android.preference.Preference; +import android.support.v7.app.AppCompatActivity; +import android.os.Bundle; +import android.util.Log; + +import net.osmand.turn_screen_on.receiver.DeviceAdminRecv; + +public class AdminDevicePermissionSetUpActivity extends AppCompatActivity + implements Preference.OnPreferenceChangeListener, Preference.OnPreferenceClickListener { + private ComponentName mDeviceAdmin; + private PluginSettings settings; + private static final int DEVICE_ADMIN_REQUEST = 5; + + @Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_admin_device_permission_set_up); + + settings = PluginSettings.getInstance(); + + DevicePolicyManager mDevicePolicyManager = (DevicePolicyManager) getSystemService(DEVICE_POLICY_SERVICE); + mDeviceAdmin = new ComponentName(getApplicationContext(), + DeviceAdminRecv.class); + + if (mDevicePolicyManager.isAdminActive(mDeviceAdmin)) { + settings.enablePlugin(); + } else { + requestLockScreenAdmin(); + } + + super.onBackPressed(); + } + + @Override + protected void onActivityResult(int requestCode, int resultCode, Intent data) { + super.onActivityResult(requestCode, resultCode, data); + if (requestCode == DEVICE_ADMIN_REQUEST) { + if (resultCode == RESULT_OK) { + settings.enablePlugin(); + Log.d("ttpl", "Lock screen permission approved."); + } else { + settings.disablePlugin(); + //todo refactor +// settings.WAKE_ON_VOICE_INT.set(0); + Log.d("ttpl", "Lock screen permission refused."); + } + return; + } + } + + private void requestLockScreenAdmin() { + // request permission from user + Intent intent = new Intent( + DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN); + intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, + mDeviceAdmin); + intent.putExtra( + DevicePolicyManager.EXTRA_ADD_EXPLANATION, + getString(R.string.lock_screen_request_explanation, + "")); + startActivityForResult(intent, DEVICE_ADMIN_REQUEST); + } + + //TODO CHANGE_PREFERENCE + //TODO WAKE_ON_VOICE + @Override + public boolean onPreferenceChange(Preference preference, Object newValue) { + String id = preference.getKey(); +// if (id.equals(settings.WAKE_ON_VOICE_INT.getId())) { +// Integer value; +// try { +// value = Integer.parseInt(newValue.toString()); +// } catch (NumberFormatException e) { +// value = 0; +// } +// if (value > 0) { +// requestLockScreenAdmin(); +// } +// } + return true; + } + + @Override + public boolean onPreferenceClick(Preference preference) { + return false; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/MainActivity.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/MainActivity.java new file mode 100644 index 0000000000..390b372968 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/MainActivity.java @@ -0,0 +1,159 @@ +package net.osmand.turn_screen_on; + +import android.content.Intent; +import android.os.Build; +import android.os.Bundle; +import android.os.Handler; +import android.support.v4.content.ContextCompat; +import android.support.v7.app.AppCompatActivity; +import android.support.v7.widget.SwitchCompat; +import android.support.v7.widget.Toolbar; +import android.view.View; +import android.widget.AdapterView; +import android.widget.ArrayAdapter; +import android.widget.Button; +import android.widget.CompoundButton; +import android.widget.FrameLayout; +import android.widget.Spinner; +import android.widget.TextView; + +import net.osmand.turn_screen_on.helpers.LockHelper; +import net.osmand.turn_screen_on.helpers.OsmAndAidlHelper; + +import java.util.ArrayList; +import java.util.List; + +public class MainActivity extends AppCompatActivity { + private Toolbar tbPluginToolbar; + private FrameLayout btnOpenOsmand; + private SwitchCompat swFunctionSwitcher; + private TextView tvPluginStateDescription; + private Spinner spTime; + + //todo delete + private Button btnRegister; + + private static int[] timeBySeconds = {5, 10, 15}; + + private OsmAndAidlHelper osmAndAidlHelper; + private PluginSettings settings; + + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + osmAndAidlHelper = OsmAndAidlHelper.getInstance(); + settings = PluginSettings.getInstance(); + + tbPluginToolbar = findViewById(R.id.tbPluginToolbar); + btnOpenOsmand = findViewById(R.id.btnOpenOsmand); + swFunctionSwitcher = findViewById(R.id.swFunctionSwitcher); + tvPluginStateDescription = findViewById(R.id.tvPluginStateDescription); + spTime = findViewById(R.id.spTime); + + btnOpenOsmand.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + osmAndAidlHelper.show(); + } + }); + + swFunctionSwitcher.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { + @Override + public void onCheckedChanged(CompoundButton buttonView, boolean isChecked) { + if (isChecked) { + Intent intent = new Intent(MainActivity.this, AdminDevicePermissionSetUpActivity.class); + startActivity(intent); + } else { + settings.disablePlugin(); + } + refreshView(); + } + }); + + List spinnerArray = new ArrayList<>(); + for (int t : timeBySeconds) { + spinnerArray.add(new StringBuilder().append(t).append(" ") + .append(getString(R.string.secondsShort)).toString()); + } + + ArrayAdapter adapter = new ArrayAdapter( + MainActivity.this, + android.R.layout.simple_spinner_item, + spinnerArray + ); + + adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item); + + spTime.setAdapter(adapter); + spTime.setOnItemSelectedListener(new AdapterView.OnItemSelectedListener() { + public void onItemSelected(AdapterView parent, + View itemSelected, int selectedItemPosition, long selectedId) { + + int time = timeBySeconds[selectedItemPosition]; + settings.setTimeLikeSeconds(time); + settings.setTimePosition(selectedItemPosition); + } + + public void onNothingSelected(AdapterView parent) { + + } + }); + + //todo delete + btnRegister = findViewById(R.id.btnRegister); + /*btnRegister.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + if (settings.isPluginEnabled()) { + Handler handler = new Handler(); + final LockHelper lockHelper = new LockHelper(MainActivity.this); + lockHelper.lock(); + handler.postDelayed(new Runnable() { + @Override + public void run() { + lockHelper.timedUnlock(5000); + } + }, 5000); + } + } + });*/ + btnRegister.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + osmAndAidlHelper.register(); + } + }); + } + + @Override + protected void onResume() { + super.onResume(); + refreshView(); + } + + public void refreshView() { + //set up status bar color + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.LOLLIPOP) { + if (settings.isPluginEnabled()) { + getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.orange)); + } else { + getWindow().setStatusBarColor(ContextCompat.getColor(this, R.color.darkGrey)); + } + } + + boolean isPluginEnabled = settings.isPluginEnabled(); + + if (isPluginEnabled) { + tvPluginStateDescription.setText(getString(R.string.enabled)); + tbPluginToolbar.setBackgroundColor(getResources().getColor(R.color.orange)); + } else { + tvPluginStateDescription.setText(getString(R.string.disabled)); + tbPluginToolbar.setBackgroundColor(getResources().getColor(R.color.darkGrey)); + } + swFunctionSwitcher.setChecked(isPluginEnabled); + + int timePosition = settings.getTimePosition(); + spTime.setSelection(timePosition); + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/PluginSettings.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/PluginSettings.java new file mode 100644 index 0000000000..88368620ac --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/PluginSettings.java @@ -0,0 +1,72 @@ +package net.osmand.turn_screen_on; + +import android.content.SharedPreferences; +import android.preference.PreferenceManager; + +import net.osmand.turn_screen_on.app.TurnScreenOnApplication; + +public class PluginSettings { + private SharedPreferences preferences; + private static final String APP_PREFERENCE = "TurnScreenOnPreferences"; + private static final String PREFERENCE_ENABLE = "enable"; + private static final String PREFERENCE_TIME = "timeSeconds"; + private static final String PREFERENCE_TIME_INDEX = "timeId"; + + //todo change singleton type + private static PluginSettings INSTANCE = new PluginSettings(); + + private PluginSettings() { + preferences = PreferenceManager.getDefaultSharedPreferences(TurnScreenOnApplication.getAppContext()); + } + + public static PluginSettings getInstance() { + return INSTANCE; + } + + public void enablePlugin() { + setBoolean(PREFERENCE_ENABLE, true); + } + + public void disablePlugin() { + setBoolean(PREFERENCE_ENABLE, false); + } + + public boolean isPluginEnabled() { + if (preferences.contains(PREFERENCE_ENABLE)) { + return preferences.getBoolean(PREFERENCE_ENABLE, false); + } + return false; + } + + public int getTimeLikeSeconds() { + if (preferences.contains(PREFERENCE_TIME)) { + return preferences.getInt(PREFERENCE_TIME, 0); + } + return 0; + } + + public void setTimeLikeSeconds(int seconds) { + SharedPreferences.Editor editor = preferences.edit(); + editor.putInt(PREFERENCE_TIME, seconds); + editor.apply(); + } + + public int getTimePosition() { + if (preferences.contains(PREFERENCE_TIME_INDEX)) { + return preferences.getInt(PREFERENCE_TIME_INDEX, 0); + } + return 0; + } + + public void setTimePosition(int seconds) { + SharedPreferences.Editor editor = preferences.edit(); + editor.putInt(PREFERENCE_TIME_INDEX, seconds); + editor.apply(); + } + + private void setBoolean(String tag, boolean val) { + SharedPreferences.Editor editor = preferences.edit(); + editor.putBoolean(tag, val); + editor.apply(); + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/Some.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/Some.java new file mode 100644 index 0000000000..4a57024001 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/Some.java @@ -0,0 +1,104 @@ +package net.osmand.turn_screen_on; + +import android.app.admin.DevicePolicyManager; +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.os.Handler; +import android.os.Bundle; +import android.view.View; +import android.widget.Button; +import android.widget.Toast; + +import net.osmand.turn_screen_on.app.TurnScreenOnApplication; +import net.osmand.turn_screen_on.helpers.LockHelper; +import net.osmand.turn_screen_on.helpers.OsmAndAidlHelper; +import net.osmand.turn_screen_on.helpers.WakeLockHelper; +import net.osmand.turn_screen_on.receiver.DeviceAdminRecv; + +public class Some { + private Button button; + private Button btnShow; + private Button btnConnect; + private Button btnRegister; + private ComponentName mDeviceAdmin; + private WakeLockHelper wakeLockHelper; + private LockHelper lockHelper; + private OsmAndAidlHelper helper; + + private static final int DEVICE_ADMIN_REQUEST = 5; + + /*@Override + protected void onCreate(Bundle savedInstanceState) { + super.onCreate(savedInstanceState); + setContentView(R.layout.activity_main); + + //todo refactor + wakeLockHelper = new WakeLockHelper(TurnScreenOnApplication.getAppContext()); + lockHelper = new LockHelper(TurnScreenOnApplication.getAppContext()); + + mDeviceAdmin = new ComponentName(getApplicationContext(), + DeviceAdminRecv.class); + final DevicePolicyManager deviceManger = (DevicePolicyManager) getSystemService(Context.DEVICE_POLICY_SERVICE); + + helper = new OsmAndAidlHelper(); + + button = findViewById(R.id.btn); + button.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + Toast.makeText(MainActivity.this, "locked", Toast.LENGTH_SHORT).show(); + Handler handler = new Handler(); + lockHelper.lock(); + handler.postDelayed(new Runnable() { + @Override + public void run() { + lockHelper.timedUnlock(5000); + } + }, 5000); + } + }); + + btnShow = findViewById(R.id.btnShow); + btnShow.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + helper.show(); + } + }); + + btnConnect = findViewById(R.id.btnConnect); + btnConnect.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + helper.bindService("net.osmand.plus", getApplication()); + } + }); + + btnRegister = findViewById(R.id.btnRegister); + btnRegister.setOnClickListener(new View.OnClickListener() { + @Override + public void onClick(View v) { + helper.register(); + } + }); + } + + private void requestLockScreenAdmin() { + mDeviceAdmin = new ComponentName(getApplicationContext(), + DeviceAdminRecv.class); + + DevicePolicyManager mDevicePolicyManager = (DevicePolicyManager) getSystemService(DEVICE_POLICY_SERVICE); + + if (!mDevicePolicyManager.isAdminActive(mDeviceAdmin)) { + // request permission from user + Intent intent = new Intent( + DevicePolicyManager.ACTION_ADD_DEVICE_ADMIN); + intent.putExtra(DevicePolicyManager.EXTRA_DEVICE_ADMIN, + mDeviceAdmin); + intent.putExtra( + DevicePolicyManager.EXTRA_ADD_EXPLANATION, "lock_screen_request_explanation"); + startActivityForResult(intent, DEVICE_ADMIN_REQUEST); + } + }*/ +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/app/TurnScreenOnApplication.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/app/TurnScreenOnApplication.java new file mode 100644 index 0000000000..0872d08fa3 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/app/TurnScreenOnApplication.java @@ -0,0 +1,17 @@ +package net.osmand.turn_screen_on.app; + +import android.app.Application; +import android.content.Context; + +public class TurnScreenOnApplication extends Application { + private static Context context; + + public void onCreate() { + super.onCreate(); + this.context = getApplicationContext(); + } + + public static Context getAppContext() { + return context; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/LockHelper.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/LockHelper.java new file mode 100644 index 0000000000..45171bb4ab --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/LockHelper.java @@ -0,0 +1,92 @@ +package net.osmand.turn_screen_on.helpers; + +import android.Manifest; +import android.app.KeyguardManager; +import android.app.admin.DevicePolicyManager; +import android.content.ComponentName; +import android.content.Context; +import android.content.pm.PackageManager; +import android.os.Handler; +import android.os.PowerManager; +import android.support.v4.content.ContextCompat; +import android.util.Log; + +import net.osmand.turn_screen_on.receiver.DeviceAdminRecv; + +public class LockHelper { + private PowerManager.WakeLock wakeLock = null; + private DevicePolicyManager mDevicePolicyManager; + private ComponentName mDeviceAdmin; + private Handler uiHandler; + private Context context; + private KeyguardManager.KeyguardLock keyguardLock; + private LockRunnable lockRunnable; + + private final static String TAG = "LockHelperTag"; + + public LockHelper(Context context) { + this.context = context; + uiHandler = new Handler(); + mDeviceAdmin = new ComponentName(context, DeviceAdminRecv.class); + mDevicePolicyManager = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE); + lockRunnable = new LockRunnable(); + keyguardLock = ((KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE)) + .newKeyguardLock(TAG); + } + + private void releaseWakeLocks() { + if (wakeLock != null) { + wakeLock.release(); + wakeLock = null; + } + } + + private class LockRunnable implements Runnable { + @Override + public void run() { + lock(); + } + } + + public void lock() { + if (readyToLock()) { + releaseWakeLocks(); + keyguardLock.reenableKeyguard(); + mDevicePolicyManager.lockNow(); + + Log.d("ttpl", "LockHelper: device lock"); + } + } + + public void unlock() { + if (readyToUnlock()) { + PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); + wakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK + | PowerManager.ACQUIRE_CAUSES_WAKEUP, "tso:wakelocktag"); + wakeLock.acquire(); + keyguardLock.disableKeyguard(); + + Log.d("ttpl", "LockHelper: device unlock"); + } + } + + public void timedUnlock(long millis) { + uiHandler.removeCallbacks(lockRunnable); + unlock(); + uiHandler.postDelayed(lockRunnable, millis); + } + + private boolean readyToLock() { + return mDevicePolicyManager != null + && mDeviceAdmin != null + && mDevicePolicyManager.isAdminActive(mDeviceAdmin) + && ContextCompat.checkSelfPermission(context, Manifest.permission.DISABLE_KEYGUARD) + == PackageManager.PERMISSION_GRANTED; + } + + private boolean readyToUnlock() { + return wakeLock==null + && ContextCompat.checkSelfPermission(context, Manifest.permission.DISABLE_KEYGUARD) + == PackageManager.PERMISSION_GRANTED; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/OsmAndAidlHelper.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/OsmAndAidlHelper.java new file mode 100644 index 0000000000..7e5c4237a6 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/OsmAndAidlHelper.java @@ -0,0 +1,152 @@ +package net.osmand.turn_screen_on.helpers; + +import android.content.ComponentName; +import android.content.Context; +import android.content.Intent; +import android.content.ServiceConnection; +import android.os.IBinder; +import android.os.RemoteException; +import android.util.Log; + +import net.osmand.aidl.IOsmAndAidlCallback; +import net.osmand.aidl.IOsmAndAidlInterface; +import net.osmand.aidl.gpx.AGpxBitmap; +import net.osmand.aidl.map.ALatLon; +import net.osmand.aidl.maplayer.point.AMapPoint; +import net.osmand.aidl.maplayer.point.ShowMapPointParams; +import net.osmand.aidl.navigation.ADirectionInfo; +import net.osmand.aidl.search.SearchResult; +import net.osmand.turn_screen_on.PluginSettings; +import net.osmand.turn_screen_on.app.TurnScreenOnApplication; + +import java.util.List; + +public class OsmAndAidlHelper { + public final static String OSMAND_FREE_PACKAGE_NAME = "net.osmand"; + public final static String OSMAND_PLUS_PACKAGE_NAME = "net.osmand.plus"; + public final static String OSMAND_NIGHTLY_PACKAGE_NAME = "net.osmand.dev"; + + //todo change singleton type + private final static OsmAndAidlHelper INSTANCE = new OsmAndAidlHelper(); + + private LockHelper lockHelper; + + private IOsmAndAidlInterface mIOsmAndAidlInterface; + + private IOsmAndAidlCallback mIOsmAndAidlCallbackInterface = new IOsmAndAidlCallback.Stub() { + + @Override + public void onSearchComplete(List resultSet) throws RemoteException { + + } + + @Override + public void onUpdate() throws RemoteException { + + } + + @Override + public void onAppInitialized() throws RemoteException { + + } + + @Override + public void onGpxBitmapCreated(AGpxBitmap bitmap) throws RemoteException { + + } + + @Override + public void updateNavigationInfo(ADirectionInfo directionInfo) throws RemoteException { + + } + + @Override + public void onContextMenuButtonClicked(int buttonId, String pointId, String layerId) throws RemoteException { + + } + + @Override + public void onVoiceRouterNotify() throws RemoteException { + Log.d("ttpl", "take message from vr"); + lockHelper.timedUnlock(PluginSettings.getInstance().getTimeLikeSeconds()*1000L); + } + }; + + private boolean isConnected = false; + + private ServiceConnection mConnection = new ServiceConnection() { + @Override + public void onServiceConnected(ComponentName name, IBinder service) { + mIOsmAndAidlInterface = IOsmAndAidlInterface.Stub.asInterface(service); + if (mIOsmAndAidlInterface != null) { + isConnected = true; + try { + Log.d("ttpl", "onServiceConnected: connected to " + service.getInterfaceDescriptor()); + } catch (RemoteException e) { + e.printStackTrace(); + } + } else { + Log.d("ttpl", "no connection set up"); + } + } + + @Override + public void onServiceDisconnected(ComponentName name) { + mIOsmAndAidlInterface = null; + isConnected = false; + Log.d("ttpl", "onServiceDisconnected: disconnect"); + } + }; + + private OsmAndAidlHelper() { + bindService(OSMAND_PLUS_PACKAGE_NAME, TurnScreenOnApplication.getAppContext()); + } + + public static OsmAndAidlHelper getInstance(){ + return INSTANCE; + } + + public boolean isConnected() { + return isConnected; + } + + public void show() { + ALatLon ll = new ALatLon(50.43859, 30.50534); + AMapPoint mp = new AMapPoint("mapPointId", "mapPoint", "Destination location", "point", null, + 1, ll, null, null); + ShowMapPointParams m = new ShowMapPointParams("ShowMapPointParams", mp); + try { + if (mIOsmAndAidlInterface != null) { + Log.d("ttpl", "show point"); + mIOsmAndAidlInterface.showMapPoint(m); + } else { + Log.d("ttpl", "mIOsmAndAidlInterface is null"); + } + } catch (RemoteException e) { + Log.d("ttpl", "some exception"); + e.printStackTrace(); + } + } + + public void register() { + try { + if (mIOsmAndAidlInterface != null) { + Log.d("ttpl", "register for voice router messages"); + mIOsmAndAidlInterface.registerForVoiceRouterMessages(mIOsmAndAidlCallbackInterface); + } else { + Log.d("ttpl", "not registered for messages"); + } + } catch (RemoteException e) { + Log.d("ttpl", "some exception"); + e.printStackTrace(); + } + } + + private boolean bindService(String appToConnectPackage, Context context) { + Intent intent = new Intent("net.osmand.aidl.OsmandAidlService"); + intent.setPackage(appToConnectPackage); + context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE); + lockHelper = new LockHelper(TurnScreenOnApplication.getAppContext()); + return false; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/WakeLockHelper.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/WakeLockHelper.java new file mode 100644 index 0000000000..fe36dd8964 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/WakeLockHelper.java @@ -0,0 +1,145 @@ +package net.osmand.turn_screen_on.helpers; + +import android.Manifest; +import android.annotation.SuppressLint; +import android.app.Activity; +import android.app.KeyguardManager; +import android.app.admin.DevicePolicyManager; +import android.content.ComponentName; +import android.content.Context; +import android.content.pm.PackageManager; +import android.os.Handler; +import android.os.PowerManager; +import android.support.v4.content.ContextCompat; +import android.util.Log; + +import net.osmand.turn_screen_on.receiver.DeviceAdminRecv; + +@SuppressLint("NewApi") +public class WakeLockHelper { + + private PowerManager.WakeLock wakeLock = null; + private ReleaseWakeLocksRunnable releaseWakeLocksRunnable = new ReleaseWakeLocksRunnable(); + private DevicePolicyManager mDevicePolicyManager; + private ComponentName mDeviceAdmin; + private Handler uiHandler; +// private TurnScreenOnApplication app; +// private Application app; + private Context context; + private boolean active; + private KeyguardManager.KeyguardLock lock; + + private boolean isSet = false; + + public WakeLockHelper(Context context) { + this.context = context; + uiHandler = new Handler(); + mDeviceAdmin = new ComponentName(context, DeviceAdminRecv.class); + mDevicePolicyManager = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE); + KeyguardManager keyguardManager = (KeyguardManager) context.getSystemService(Context.KEYGUARD_SERVICE); + lock = keyguardManager.newKeyguardLock("TAG"); + } + + private void releaseWakeLocks() { + if (wakeLock != null) { + wakeLock.release(); + wakeLock = null; + } + +// changeKeyguardFlags(); + + if (mDevicePolicyManager != null && mDeviceAdmin != null) { + //TODO + //OsmandSettings settings = app.getSettings(); + // final Integer screenPowerSave = settings.WAKE_ON_VOICE_INT.get(); + //if (screenPowerSave > 0 && settings.MAP_ACTIVITY_ENABLED.get()) { + if (mDevicePolicyManager.isAdminActive(mDeviceAdmin)) { + try { + if (ContextCompat.checkSelfPermission(context, Manifest.permission.DISABLE_KEYGUARD) + == PackageManager.PERMISSION_GRANTED) { + lock.reenableKeyguard(); + } + mDevicePolicyManager.lockNow(); + + Log.d("ttpl", "device lock"); + + } catch (SecurityException e) { + Log.d("ttpl", "SecurityException: No device admin permission to lock the screen!"); + } + } else { + Log.d("ttpl", "No device admin permission to lock the screen!"); + } +// } + } + } + + private class ReleaseWakeLocksRunnable implements Runnable { + + @Override + public void run() { + releaseWakeLocks(); + } + + } + + public void onStart(Activity a) { + //TODO voice routing with aidl + this.active = true; + /*if (wakeLock == null) { + VoiceRouter voiceRouter = app.getRoutingHelper().getVoiceRouter(); + voiceRouter.removeVoiceMessageListener(this); + }*/ + } + + public void onStop(Activity a) { + this.active = false; + //TODO voice routing with aidl + /*OsmandSettings settings = app.getSettings(); + if (!a.isFinishing() && (settings.WAKE_ON_VOICE_INT.get() > 0)) { + VoiceRouter voiceRouter = app.getRoutingHelper().getVoiceRouter(); + voiceRouter.addVoiceMessageListener(this); + }*/ + } + +// @Override + public void onVoiceMessage() { +// OsmandSettings settings = app.getSettings(); +// final Integer screenPowerSave = settings.WAKE_ON_VOICE_INT.get(); +// if (screenPowerSave > 0) { + uiHandler.removeCallbacks(releaseWakeLocksRunnable); + + if (/*!active && */wakeLock == null) { + PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE); + wakeLock = pm.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK + | PowerManager.ACQUIRE_CAUSES_WAKEUP, "ttpl:wakelocktag"); +// changeKeyguardFlags(); + wakeLock.acquire(); + + if (ContextCompat.checkSelfPermission(context, Manifest.permission.DISABLE_KEYGUARD) + == PackageManager.PERMISSION_GRANTED) { + lock.disableKeyguard(); + } + + Log.d("ttpl", "device unlock"); + } + + uiHandler.postDelayed(releaseWakeLocksRunnable, 4000L); +// screenPowerSave * 1000L); +// } + } + +/* private void changeKeyguardFlags() { + if (!isSet) { + Log.d("ttpl", "set flags"); + activity.getWindow().setFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED, + WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED); + isSet = true; + } else { + Log.d("ttpl", "reset flags"); + activity.getWindow().clearFlags(WindowManager.LayoutParams.FLAG_DISMISS_KEYGUARD | WindowManager.LayoutParams.FLAG_SHOW_WHEN_LOCKED + | WindowManager.LayoutParams.FLAG_TURN_SCREEN_ON); + isSet = false; + } + }*/ + +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/receiver/DeviceAdminRecv.java b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/receiver/DeviceAdminRecv.java new file mode 100644 index 0000000000..7bbc673654 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/receiver/DeviceAdminRecv.java @@ -0,0 +1,24 @@ +package net.osmand.turn_screen_on.receiver; + +import android.app.admin.DeviceAdminReceiver; +import android.content.Context; +import android.content.Intent; +import android.util.Log; + +public class DeviceAdminRecv extends DeviceAdminReceiver { + + private static final String TAG = "DeviceAdminReceiver"; + + public void onEnabled(Context context, Intent intent) { + Log.d(TAG, "permission disabled"); + } + + public CharSequence onDisableRequested(Context context, Intent intent) { + return null; + } + + public void onDisabled(Context context, Intent intent) { + Log.d(TAG, "permission enabled"); + } + +} \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-v24/ic_launcher_foreground.xml b/OsmAnd-turn_screen_on/src/main/res/drawable-v24/ic_launcher_foreground.xml new file mode 100644 index 0000000000..1f6bb29060 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/res/drawable-v24/ic_launcher_foreground.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable/blue_button.xml b/OsmAnd-turn_screen_on/src/main/res/drawable/blue_button.xml new file mode 100644 index 0000000000..ef25b120ea --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/res/drawable/blue_button.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable/ic_launcher_background.xml b/OsmAnd-turn_screen_on/src/main/res/drawable/ic_launcher_background.xml new file mode 100644 index 0000000000..0d025f9bf6 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/res/drawable/ic_launcher_background.xml @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable/img_add_24dp.xml b/OsmAnd-turn_screen_on/src/main/res/drawable/img_add_24dp.xml new file mode 100644 index 0000000000..e3979cd7f2 --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/res/drawable/img_add_24dp.xml @@ -0,0 +1,5 @@ + + + diff --git a/OsmAnd-turn_screen_on/src/main/res/layout/activity_admin_device_permission_set_up.xml b/OsmAnd-turn_screen_on/src/main/res/layout/activity_admin_device_permission_set_up.xml new file mode 100644 index 0000000000..45ed5fb2de --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/res/layout/activity_admin_device_permission_set_up.xml @@ -0,0 +1,9 @@ + + + + \ No newline at end of file diff --git a/OsmAnd-turn_screen_on/src/main/res/layout/activity_main.xml b/OsmAnd-turn_screen_on/src/main/res/layout/activity_main.xml new file mode 100644 index 0000000000..d8ed11b32e --- /dev/null +++ b/OsmAnd-turn_screen_on/src/main/res/layout/activity_main.xml @@ -0,0 +1,118 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + +