From 1a74232430f03aac903e1ca4e2f8d6e932b0ee10 Mon Sep 17 00:00:00 2001 From: Nazar Date: Thu, 13 Jun 2019 19:11:21 +0300 Subject: [PATCH] turn screen test 2 commit --- .../.gitignore | 0 .../build.gradle | 0 .../proguard-rules.pro | 0 .../ExampleInstrumentedTest.java | 2 +- .../src/main/AndroidManifest.xml | 11 +-- .../net/osmand/aidl/IOsmAndAidlCallback.aidl | 0 .../net/osmand/aidl/IOsmAndAidlInterface.aidl | 0 .../calculateroute/CalculateRouteParams.aidl | 0 .../calculateroute/CalculateRouteParams.java | 0 .../aidl/contextmenu/AContextMenuButton.aidl | 0 .../aidl/contextmenu/AContextMenuButton.java | 0 .../contextmenu/ContextMenuButtonsParams.aidl | 0 .../contextmenu/ContextMenuButtonsParams.java | 0 .../RemoveContextMenuButtonsParams.aidl | 0 .../RemoveContextMenuButtonsParams.java | 0 .../UpdateContextMenuButtonsParams.aidl | 0 .../UpdateContextMenuButtonsParams.java | 0 .../osmand/aidl/copyfile/CopyFileParams.aidl | 0 .../osmand/aidl/copyfile/CopyFileParams.java | 0 .../customization/OsmandSettingsParams.aidl | 0 .../customization/OsmandSettingsParams.java | 0 .../aidl/customization/SetWidgetsParams.aidl | 0 .../aidl/customization/SetWidgetsParams.java | 0 .../net/osmand/aidl/favorite/AFavorite.aidl | 0 .../net/osmand/aidl/favorite/AFavorite.java | 0 .../aidl/favorite/AddFavoriteParams.aidl | 0 .../aidl/favorite/AddFavoriteParams.java | 0 .../aidl/favorite/RemoveFavoriteParams.aidl | 0 .../aidl/favorite/RemoveFavoriteParams.java | 0 .../aidl/favorite/UpdateFavoriteParams.aidl | 0 .../aidl/favorite/UpdateFavoriteParams.java | 0 .../aidl/favorite/group/AFavoriteGroup.aidl | 0 .../aidl/favorite/group/AFavoriteGroup.java | 0 .../group/AddFavoriteGroupParams.aidl | 0 .../group/AddFavoriteGroupParams.java | 0 .../group/RemoveFavoriteGroupParams.aidl | 0 .../group/RemoveFavoriteGroupParams.java | 0 .../group/UpdateFavoriteGroupParams.aidl | 0 .../group/UpdateFavoriteGroupParams.java | 0 .../java/net/osmand/aidl/gpx/AGpxBitmap.aidl | 0 .../java/net/osmand/aidl/gpx/AGpxBitmap.java | 0 .../java/net/osmand/aidl/gpx/AGpxFile.aidl | 0 .../java/net/osmand/aidl/gpx/AGpxFile.java | 0 .../net/osmand/aidl/gpx/AGpxFileDetails.aidl | 0 .../net/osmand/aidl/gpx/AGpxFileDetails.java | 0 .../net/osmand/aidl/gpx/ASelectedGpxFile.aidl | 0 .../net/osmand/aidl/gpx/ASelectedGpxFile.java | 0 .../aidl/gpx/CreateGpxBitmapParams.aidl | 0 .../aidl/gpx/CreateGpxBitmapParams.java | 0 .../net/osmand/aidl/gpx/HideGpxParams.aidl | 0 .../net/osmand/aidl/gpx/HideGpxParams.java | 0 .../net/osmand/aidl/gpx/ImportGpxParams.aidl | 0 .../net/osmand/aidl/gpx/ImportGpxParams.java | 0 .../net/osmand/aidl/gpx/RemoveGpxParams.aidl | 0 .../net/osmand/aidl/gpx/RemoveGpxParams.java | 0 .../net/osmand/aidl/gpx/ShowGpxParams.aidl | 0 .../net/osmand/aidl/gpx/ShowGpxParams.java | 0 .../aidl/gpx/StartGpxRecordingParams.aidl | 0 .../aidl/gpx/StartGpxRecordingParams.java | 0 .../aidl/gpx/StopGpxRecordingParams.aidl | 0 .../aidl/gpx/StopGpxRecordingParams.java | 0 .../java/net/osmand/aidl/map/ALatLon.aidl | 0 .../java/net/osmand/aidl/map/ALatLon.java | 0 .../osmand/aidl/map/SetMapLocationParams.aidl | 0 .../osmand/aidl/map/SetMapLocationParams.java | 0 .../net/osmand/aidl/maplayer/AMapLayer.aidl | 0 .../net/osmand/aidl/maplayer/AMapLayer.java | 0 .../aidl/maplayer/AddMapLayerParams.aidl | 0 .../aidl/maplayer/AddMapLayerParams.java | 0 .../aidl/maplayer/RemoveMapLayerParams.aidl | 0 .../aidl/maplayer/RemoveMapLayerParams.java | 0 .../aidl/maplayer/UpdateMapLayerParams.aidl | 0 .../aidl/maplayer/UpdateMapLayerParams.java | 0 .../osmand/aidl/maplayer/point/AMapPoint.aidl | 0 .../osmand/aidl/maplayer/point/AMapPoint.java | 0 .../maplayer/point/AddMapPointParams.aidl | 0 .../maplayer/point/AddMapPointParams.java | 0 .../maplayer/point/RemoveMapPointParams.aidl | 0 .../maplayer/point/RemoveMapPointParams.java | 0 .../maplayer/point/ShowMapPointParams.aidl | 0 .../maplayer/point/ShowMapPointParams.java | 0 .../maplayer/point/UpdateMapPointParams.aidl | 0 .../maplayer/point/UpdateMapPointParams.java | 0 .../net/osmand/aidl/mapmarker/AMapMarker.aidl | 0 .../net/osmand/aidl/mapmarker/AMapMarker.java | 0 .../aidl/mapmarker/AddMapMarkerParams.aidl | 0 .../aidl/mapmarker/AddMapMarkerParams.java | 0 .../aidl/mapmarker/RemoveMapMarkerParams.aidl | 0 .../aidl/mapmarker/RemoveMapMarkerParams.java | 0 .../aidl/mapmarker/UpdateMapMarkerParams.aidl | 0 .../aidl/mapmarker/UpdateMapMarkerParams.java | 0 .../net/osmand/aidl/mapwidget/AMapWidget.aidl | 0 .../net/osmand/aidl/mapwidget/AMapWidget.java | 0 .../aidl/mapwidget/AddMapWidgetParams.aidl | 0 .../aidl/mapwidget/AddMapWidgetParams.java | 0 .../aidl/mapwidget/RemoveMapWidgetParams.aidl | 0 .../aidl/mapwidget/RemoveMapWidgetParams.java | 0 .../aidl/mapwidget/UpdateMapWidgetParams.aidl | 0 .../aidl/mapwidget/UpdateMapWidgetParams.java | 0 .../aidl/navdrawer/NavDrawerFooterParams.aidl | 0 .../aidl/navdrawer/NavDrawerFooterParams.java | 0 .../aidl/navdrawer/NavDrawerHeaderParams.aidl | 0 .../aidl/navdrawer/NavDrawerHeaderParams.java | 0 .../osmand/aidl/navdrawer/NavDrawerItem.aidl | 0 .../osmand/aidl/navdrawer/NavDrawerItem.java | 0 .../navdrawer/SetNavDrawerItemsParams.aidl | 0 .../navdrawer/SetNavDrawerItemsParams.java | 0 .../aidl/navigation/ADirectionInfo.aidl | 0 .../aidl/navigation/ADirectionInfo.java | 0 .../navigation/ANavigationUpdateParams.aidl | 0 .../navigation/ANavigationUpdateParams.java | 0 .../ANavigationVoiceRouterMessageParams.aidl | 0 .../ANavigationVoiceRouterMessageParams.java | 0 .../aidl/navigation/MuteNavigationParams.aidl | 0 .../aidl/navigation/MuteNavigationParams.java | 0 .../aidl/navigation/NavigateGpxParams.aidl | 0 .../aidl/navigation/NavigateGpxParams.java | 0 .../aidl/navigation/NavigateParams.aidl | 0 .../aidl/navigation/NavigateParams.java | 0 .../aidl/navigation/NavigateSearchParams.aidl | 0 .../aidl/navigation/NavigateSearchParams.java | 0 .../navigation/PauseNavigationParams.aidl | 0 .../navigation/PauseNavigationParams.java | 0 .../navigation/ResumeNavigationParams.aidl | 0 .../navigation/ResumeNavigationParams.java | 0 .../aidl/navigation/StopNavigationParams.aidl | 0 .../aidl/navigation/StopNavigationParams.java | 0 .../navigation/UnmuteNavigationParams.aidl | 0 .../navigation/UnmuteNavigationParams.java | 0 .../aidl/note/StartAudioRecordingParams.aidl | 0 .../aidl/note/StartAudioRecordingParams.java | 0 .../aidl/note/StartVideoRecordingParams.aidl | 0 .../aidl/note/StartVideoRecordingParams.java | 0 .../osmand/aidl/note/StopRecordingParams.aidl | 0 .../osmand/aidl/note/StopRecordingParams.java | 0 .../osmand/aidl/note/TakePhotoNoteParams.aidl | 0 .../osmand/aidl/note/TakePhotoNoteParams.java | 0 .../net/osmand/aidl/plugins/PluginParams.aidl | 0 .../net/osmand/aidl/plugins/PluginParams.java | 0 .../net/osmand/aidl/search/SearchParams.aidl | 0 .../net/osmand/aidl/search/SearchParams.java | 0 .../net/osmand/aidl/search/SearchResult.aidl | 0 .../net/osmand/aidl/search/SearchResult.java | 0 .../net/osmand/aidl/tiles/ASqliteDbFile.aidl | 0 .../net/osmand/aidl/tiles/ASqliteDbFile.java | 0 .../osmand/turnScreenOn}/MainActivity.java | 88 +++++++----------- .../PermissionsSetUpActivity.java | 11 ++- .../PluginDescriptionActivity.java | 10 +- .../osmand/turnScreenOn}/PluginSettings.java | 57 +++++++----- .../java/net/osmand/turnScreenOn}/Some.java | 6 +- .../turnScreenOn/app/TurnScreenApp.java | 54 +++++++++++ .../turnScreenOn}/helpers/AndroidUtils.java | 2 +- .../turnScreenOn}/helpers/LockHelper.java | 11 ++- .../helpers/OsmAndAidlHelper.java | 33 +++---- .../turnScreenOn/helpers/SensorHelper.java | 48 ++++++++++ .../receiver/DeviceAdminRecv.java | 2 +- .../main/res/drawable-hdpi/ic_action_help.png | Bin .../res/drawable-hdpi/ic_action_osmand.png | Bin .../drawable-hdpi/ic_action_osmand_logo.png | Bin .../drawable-hdpi/ic_action_osmand_plus.png | Bin .../ic_action_sensor_interaction.png | Bin .../res/drawable-hdpi/ic_action_time_span.png | Bin .../main/res/drawable-mdpi/ic_action_help.png | Bin .../res/drawable-mdpi/ic_action_osmand.png | Bin .../drawable-mdpi/ic_action_osmand_logo.png | Bin .../drawable-mdpi/ic_action_osmand_plus.png | Bin .../ic_action_sensor_interaction.png | Bin .../res/drawable-mdpi/ic_action_time_span.png | Bin .../drawable-v24/ic_launcher_foreground.xml | 0 .../res/drawable-xhdpi/ic_action_help.png | Bin .../res/drawable-xhdpi/ic_action_osmand.png | Bin .../drawable-xhdpi/ic_action_osmand_logo.png | Bin .../drawable-xhdpi/ic_action_osmand_plus.png | Bin .../ic_action_sensor_interaction.png | Bin .../drawable-xhdpi/ic_action_time_span.png | Bin .../res/drawable-xxhdpi/ic_action_help.png | Bin .../res/drawable-xxhdpi/ic_action_osmand.png | Bin .../drawable-xxhdpi/ic_action_osmand_logo.png | Bin .../drawable-xxhdpi/ic_action_osmand_plus.png | Bin .../ic_action_sensor_interaction.png | Bin .../drawable-xxhdpi/ic_action_time_span.png | Bin .../res/drawable-xxxhdpi/ic_action_help.png | Bin .../res/drawable-xxxhdpi/ic_action_osmand.png | Bin .../ic_action_osmand_logo.png | Bin .../ic_action_osmand_plus.png | Bin .../ic_action_sensor_interaction.png | Bin .../drawable-xxxhdpi/ic_action_time_span.png | Bin .../src/main/res/drawable/blue_button.xml | 0 .../res/drawable/ic_launcher_background.xml | 0 .../src/main/res/drawable/img_add_24dp.xml | 0 ...ctivity_admin_device_permission_set_up.xml | 0 .../src/main/res/layout/activity_main.xml | 0 .../layout/activity_plugin_description.xml | 0 .../res/layout/main_el_btn_open_osmand.xml | 0 .../res/layout/main_el_osmand_versions.xml | 0 .../res/layout/main_el_plugin_switcher.xml | 0 .../src/main/res/layout/main_el_sensor.xml | 0 .../main/res/layout/main_el_time_set_up.xml | 0 .../src/main/res/layout/main_install_desc.xml | 0 .../main/res/layout/main_settings_panel.xml | 0 .../main/res/layout/osmand_version_item.xml | 0 .../src/main/res/menu/menu_main.xml | 0 .../res/mipmap-anydpi-v26/ic_launcher.xml | 0 .../mipmap-anydpi-v26/ic_launcher_round.xml | 0 .../src/main/res/mipmap-hdpi/ic_launcher.png | Bin .../res/mipmap-hdpi/ic_launcher_round.png | Bin .../src/main/res/mipmap-mdpi/ic_launcher.png | Bin .../res/mipmap-mdpi/ic_launcher_round.png | Bin .../src/main/res/mipmap-xhdpi/ic_launcher.png | Bin .../res/mipmap-xhdpi/ic_launcher_round.png | Bin .../main/res/mipmap-xxhdpi/ic_launcher.png | Bin .../res/mipmap-xxhdpi/ic_launcher_round.png | Bin .../main/res/mipmap-xxxhdpi/ic_launcher.png | Bin .../res/mipmap-xxxhdpi/ic_launcher_round.png | Bin .../src/main/res/values/colors.xml | 0 .../src/main/res/values/strings.xml | 0 .../src/main/res/values/styles.xml | 0 .../src/main/res/xml/device_admin.xml | 0 .../app/TurnScreenOnApplication.java | 17 ---- .../net/osmand/aidl/IOsmAndAidlInterface.aidl | 3 + .../net/osmand/aidl/OsmandAidlService.java | 35 +++++++ .../net/osmand/plus/routing/VoiceRouter.java | 6 +- settings.gradle | 2 +- 223 files changed, 256 insertions(+), 142 deletions(-) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/.gitignore (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/build.gradle (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/proguard-rules.pro (100%) rename {OsmAnd-turn_screen_on/src/androidTest/java/net/osmand/turn_screen_on => OsmAnd-turnScreenOn/src/androidTest/java/net/osmand/turnScreenOn}/ExampleInstrumentedTest.java (95%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/AndroidManifest.xml (80%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/IOsmAndAidlCallback.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/IOsmAndAidlInterface.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/calculateroute/CalculateRouteParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/calculateroute/CalculateRouteParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/contextmenu/AContextMenuButton.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/contextmenu/AContextMenuButton.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/contextmenu/ContextMenuButtonsParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/contextmenu/ContextMenuButtonsParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/contextmenu/RemoveContextMenuButtonsParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/contextmenu/RemoveContextMenuButtonsParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/contextmenu/UpdateContextMenuButtonsParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/contextmenu/UpdateContextMenuButtonsParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/copyfile/CopyFileParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/copyfile/CopyFileParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/customization/OsmandSettingsParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/customization/OsmandSettingsParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/customization/SetWidgetsParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/customization/SetWidgetsParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/favorite/AFavorite.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/favorite/AFavorite.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/favorite/AddFavoriteParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/favorite/AddFavoriteParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/favorite/RemoveFavoriteParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/favorite/RemoveFavoriteParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/favorite/UpdateFavoriteParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/favorite/UpdateFavoriteParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/favorite/group/AFavoriteGroup.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/favorite/group/AFavoriteGroup.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/favorite/group/AddFavoriteGroupParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/favorite/group/AddFavoriteGroupParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/favorite/group/RemoveFavoriteGroupParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/favorite/group/RemoveFavoriteGroupParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/favorite/group/UpdateFavoriteGroupParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/favorite/group/UpdateFavoriteGroupParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/AGpxBitmap.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/AGpxBitmap.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/AGpxFile.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/AGpxFile.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/AGpxFileDetails.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/AGpxFileDetails.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/ASelectedGpxFile.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/ASelectedGpxFile.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/CreateGpxBitmapParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/CreateGpxBitmapParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/HideGpxParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/HideGpxParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/ImportGpxParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/ImportGpxParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/RemoveGpxParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/RemoveGpxParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/ShowGpxParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/ShowGpxParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/StartGpxRecordingParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/StartGpxRecordingParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/StopGpxRecordingParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/gpx/StopGpxRecordingParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/map/ALatLon.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/map/ALatLon.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/map/SetMapLocationParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/map/SetMapLocationParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/AMapLayer.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/AMapLayer.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/AddMapLayerParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/AddMapLayerParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/RemoveMapLayerParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/RemoveMapLayerParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/UpdateMapLayerParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/UpdateMapLayerParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/point/AMapPoint.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/point/AMapPoint.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/point/AddMapPointParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/point/AddMapPointParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/point/RemoveMapPointParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/point/RemoveMapPointParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/point/ShowMapPointParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/point/ShowMapPointParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/point/UpdateMapPointParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/maplayer/point/UpdateMapPointParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/mapmarker/AMapMarker.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/mapmarker/AMapMarker.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/mapmarker/AddMapMarkerParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/mapmarker/AddMapMarkerParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/mapmarker/RemoveMapMarkerParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/mapmarker/RemoveMapMarkerParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/mapmarker/UpdateMapMarkerParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/mapmarker/UpdateMapMarkerParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/mapwidget/AMapWidget.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/mapwidget/AMapWidget.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/mapwidget/AddMapWidgetParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/mapwidget/AddMapWidgetParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/mapwidget/RemoveMapWidgetParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/mapwidget/RemoveMapWidgetParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/mapwidget/UpdateMapWidgetParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/mapwidget/UpdateMapWidgetParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navdrawer/NavDrawerFooterParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navdrawer/NavDrawerFooterParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navdrawer/NavDrawerHeaderParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navdrawer/NavDrawerHeaderParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navdrawer/NavDrawerItem.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navdrawer/NavDrawerItem.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navdrawer/SetNavDrawerItemsParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navdrawer/SetNavDrawerItemsParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/ADirectionInfo.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/ADirectionInfo.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/ANavigationUpdateParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/ANavigationUpdateParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/ANavigationVoiceRouterMessageParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/ANavigationVoiceRouterMessageParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/MuteNavigationParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/MuteNavigationParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/NavigateGpxParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/NavigateGpxParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/NavigateParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/NavigateParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/NavigateSearchParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/NavigateSearchParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/PauseNavigationParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/PauseNavigationParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/ResumeNavigationParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/ResumeNavigationParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/StopNavigationParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/StopNavigationParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/UnmuteNavigationParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/navigation/UnmuteNavigationParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/note/StartAudioRecordingParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/note/StartAudioRecordingParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/note/StartVideoRecordingParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/note/StartVideoRecordingParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/note/StopRecordingParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/note/StopRecordingParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/note/TakePhotoNoteParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/note/TakePhotoNoteParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/plugins/PluginParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/plugins/PluginParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/search/SearchParams.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/search/SearchParams.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/search/SearchResult.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/search/SearchResult.java (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/tiles/ASqliteDbFile.aidl (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/java/net/osmand/aidl/tiles/ASqliteDbFile.java (100%) rename {OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on => OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn}/MainActivity.java (88%) rename {OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on => OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn}/PermissionsSetUpActivity.java (89%) rename {OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on => OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn}/PluginDescriptionActivity.java (83%) rename {OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on => OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn}/PluginSettings.java (77%) rename {OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on => OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn}/Some.java (95%) create mode 100644 OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/app/TurnScreenApp.java rename {OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on => OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn}/helpers/AndroidUtils.java (91%) rename {OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on => OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn}/helpers/LockHelper.java (90%) rename {OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on => OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn}/helpers/OsmAndAidlHelper.java (85%) create mode 100644 OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/helpers/SensorHelper.java rename {OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on => OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn}/receiver/DeviceAdminRecv.java (92%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-hdpi/ic_action_help.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-hdpi/ic_action_osmand.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-hdpi/ic_action_osmand_logo.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-hdpi/ic_action_osmand_plus.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-hdpi/ic_action_sensor_interaction.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-hdpi/ic_action_time_span.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-mdpi/ic_action_help.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-mdpi/ic_action_osmand.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-mdpi/ic_action_osmand_logo.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-mdpi/ic_action_osmand_plus.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-mdpi/ic_action_sensor_interaction.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-mdpi/ic_action_time_span.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-v24/ic_launcher_foreground.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xhdpi/ic_action_help.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xhdpi/ic_action_osmand.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xhdpi/ic_action_osmand_logo.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xhdpi/ic_action_osmand_plus.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xhdpi/ic_action_sensor_interaction.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xhdpi/ic_action_time_span.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xxhdpi/ic_action_help.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xxhdpi/ic_action_osmand.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xxhdpi/ic_action_osmand_logo.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xxhdpi/ic_action_osmand_plus.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xxhdpi/ic_action_sensor_interaction.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xxhdpi/ic_action_time_span.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xxxhdpi/ic_action_help.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xxxhdpi/ic_action_osmand.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xxxhdpi/ic_action_osmand_logo.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xxxhdpi/ic_action_osmand_plus.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xxxhdpi/ic_action_sensor_interaction.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable-xxxhdpi/ic_action_time_span.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable/blue_button.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable/ic_launcher_background.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/drawable/img_add_24dp.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/layout/activity_admin_device_permission_set_up.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/layout/activity_main.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/layout/activity_plugin_description.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/layout/main_el_btn_open_osmand.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/layout/main_el_osmand_versions.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/layout/main_el_plugin_switcher.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/layout/main_el_sensor.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/layout/main_el_time_set_up.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/layout/main_install_desc.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/layout/main_settings_panel.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/layout/osmand_version_item.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/menu/menu_main.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/mipmap-anydpi-v26/ic_launcher.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/mipmap-hdpi/ic_launcher.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/mipmap-hdpi/ic_launcher_round.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/mipmap-mdpi/ic_launcher.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/mipmap-mdpi/ic_launcher_round.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/mipmap-xhdpi/ic_launcher.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/mipmap-xhdpi/ic_launcher_round.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/mipmap-xxhdpi/ic_launcher.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/mipmap-xxhdpi/ic_launcher_round.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/mipmap-xxxhdpi/ic_launcher.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/values/colors.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/values/strings.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/values/styles.xml (100%) rename {OsmAnd-turn_screen_on => OsmAnd-turnScreenOn}/src/main/res/xml/device_admin.xml (100%) delete mode 100644 OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/app/TurnScreenOnApplication.java diff --git a/OsmAnd-turn_screen_on/.gitignore b/OsmAnd-turnScreenOn/.gitignore similarity index 100% rename from OsmAnd-turn_screen_on/.gitignore rename to OsmAnd-turnScreenOn/.gitignore diff --git a/OsmAnd-turn_screen_on/build.gradle b/OsmAnd-turnScreenOn/build.gradle similarity index 100% rename from OsmAnd-turn_screen_on/build.gradle rename to OsmAnd-turnScreenOn/build.gradle diff --git a/OsmAnd-turn_screen_on/proguard-rules.pro b/OsmAnd-turnScreenOn/proguard-rules.pro similarity index 100% rename from OsmAnd-turn_screen_on/proguard-rules.pro rename to OsmAnd-turnScreenOn/proguard-rules.pro diff --git a/OsmAnd-turn_screen_on/src/androidTest/java/net/osmand/turn_screen_on/ExampleInstrumentedTest.java b/OsmAnd-turnScreenOn/src/androidTest/java/net/osmand/turnScreenOn/ExampleInstrumentedTest.java similarity index 95% rename from OsmAnd-turn_screen_on/src/androidTest/java/net/osmand/turn_screen_on/ExampleInstrumentedTest.java rename to OsmAnd-turnScreenOn/src/androidTest/java/net/osmand/turnScreenOn/ExampleInstrumentedTest.java index 4f2b7ac878..dd6c6a304f 100644 --- a/OsmAnd-turn_screen_on/src/androidTest/java/net/osmand/turn_screen_on/ExampleInstrumentedTest.java +++ b/OsmAnd-turnScreenOn/src/androidTest/java/net/osmand/turnScreenOn/ExampleInstrumentedTest.java @@ -1,4 +1,4 @@ -package net.osmand.turn_screen_on; +package net.osmand.turnScreenOn; import android.content.Context; import android.support.test.InstrumentationRegistry; diff --git a/OsmAnd-turn_screen_on/src/main/AndroidManifest.xml b/OsmAnd-turnScreenOn/src/main/AndroidManifest.xml similarity index 80% rename from OsmAnd-turn_screen_on/src/main/AndroidManifest.xml rename to OsmAnd-turnScreenOn/src/main/AndroidManifest.xml index 923d260d4c..beff5e63a1 100644 --- a/OsmAnd-turn_screen_on/src/main/AndroidManifest.xml +++ b/OsmAnd-turnScreenOn/src/main/AndroidManifest.xml @@ -1,24 +1,23 @@ + package="net.osmand.turnScreenOn"> - + @@ -28,7 +27,7 @@ = -SENSOR_SENSITIVITY && event.values[0] <= SENSOR_SENSITIVITY) { - //near - Toast.makeText(getApplicationContext(), "near", Toast.LENGTH_SHORT).show(); - } else { - //far - Toast.makeText(getApplicationContext(), "far", Toast.LENGTH_SHORT).show(); - } - } - } - - @Override - public void onAccuracyChanged(Sensor sensor, int accuracy) { - } } diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/PermissionsSetUpActivity.java b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/PermissionsSetUpActivity.java similarity index 89% rename from OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/PermissionsSetUpActivity.java rename to OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/PermissionsSetUpActivity.java index 9c2a3d524a..187be5b1ce 100644 --- a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/PermissionsSetUpActivity.java +++ b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/PermissionsSetUpActivity.java @@ -1,4 +1,4 @@ -package net.osmand.turn_screen_on; +package net.osmand.turnScreenOn; import android.app.admin.DevicePolicyManager; import android.content.ComponentName; @@ -9,7 +9,8 @@ import android.util.Log; import android.view.View; import android.widget.FrameLayout; -import net.osmand.turn_screen_on.receiver.DeviceAdminRecv; +import net.osmand.turnScreenOn.app.TurnScreenApp; +import net.osmand.turnScreenOn.receiver.DeviceAdminRecv; public class PermissionsSetUpActivity extends AppCompatActivity { private FrameLayout btnContinue; @@ -17,12 +18,16 @@ public class PermissionsSetUpActivity extends AppCompatActivity { private PluginSettings settings; private static final int DEVICE_ADMIN_REQUEST = 5; + private TurnScreenApp app; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_admin_device_permission_set_up); - settings = PluginSettings.getInstance(); + app = new TurnScreenApp(this); + + settings = app.getSettings(); mDeviceAdmin = new ComponentName(getApplicationContext(), DeviceAdminRecv.class); diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/PluginDescriptionActivity.java b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/PluginDescriptionActivity.java similarity index 83% rename from OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/PluginDescriptionActivity.java rename to OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/PluginDescriptionActivity.java index 25bac2fc3a..f217ea055d 100644 --- a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/PluginDescriptionActivity.java +++ b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/PluginDescriptionActivity.java @@ -1,4 +1,4 @@ -package net.osmand.turn_screen_on; +package net.osmand.turnScreenOn; import android.content.Intent; import android.support.v7.app.AppCompatActivity; @@ -6,16 +6,22 @@ import android.os.Bundle; import android.view.View; import android.widget.FrameLayout; +import net.osmand.turnScreenOn.app.TurnScreenApp; + public class PluginDescriptionActivity extends AppCompatActivity { private FrameLayout btnContinue; private PluginSettings settings; + private TurnScreenApp app; + @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_plugin_description); - settings = PluginSettings.getInstance(); + app = new TurnScreenApp(this); + + settings = app.getSettings(); btnContinue = findViewById(R.id.btnContinue); diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/PluginSettings.java b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/PluginSettings.java similarity index 77% rename from OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/PluginSettings.java rename to OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/PluginSettings.java index 327edd1c29..30b2167bd9 100644 --- a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/PluginSettings.java +++ b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/PluginSettings.java @@ -1,4 +1,4 @@ -package net.osmand.turn_screen_on; +package net.osmand.turnScreenOn; import android.app.admin.DevicePolicyManager; import android.content.ComponentName; @@ -7,9 +7,8 @@ import android.content.SharedPreferences; import android.content.pm.PackageManager; import android.preference.PreferenceManager; -import net.osmand.turn_screen_on.app.TurnScreenOnApplication; -import net.osmand.turn_screen_on.helpers.OsmAndAidlHelper; -import net.osmand.turn_screen_on.receiver.DeviceAdminRecv; +import net.osmand.turnScreenOn.app.TurnScreenApp; +import net.osmand.turnScreenOn.receiver.DeviceAdminRecv; import java.util.ArrayList; import java.util.List; @@ -17,12 +16,13 @@ import java.util.List; 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_PLUGIN_ENABLE = "pluginEnable"; private static final String PREFERENCE_TIME_INDEX = "timeId"; private static final String PREFERENCE_OSMAND_VERSION = "OsmandVersionInt"; private static final String PREFERENCE_FIRST_OPEN = "firstOpen"; + private static final String PREFERENCE_SENSOR_ENABLE = "sensorEnable"; - private final static Context context = TurnScreenOnApplication.getAppContext(); + private static TurnScreenApp app; public enum OsmandVersion { OSMAND_PLUS(132356, R.string.OsmandPlus, R.drawable.ic_action_osmand_plus, "net.osmand.plus"), @@ -67,7 +67,8 @@ public class PluginSettings { public static boolean isVersionInstalled(OsmandVersion version) { String path = version.getPath(); - PackageManager pm = context.getPackageManager(); + //todo refactor + PackageManager pm = app.getContext().getPackageManager(); try { pm.getPackageInfo(path, PackageManager.GET_ACTIVITIES); return true; @@ -88,35 +89,41 @@ public class PluginSettings { } } + private static int[] unlockTime = {5, 10, 15, 20, 30, 45, 60}; - //todo change singleton type - - private static PluginSettings INSTANCE = new PluginSettings(); - private PluginSettings() { - preferences = PreferenceManager.getDefaultSharedPreferences(context); - OsmAndAidlHelper helper = OsmAndAidlHelper.getInstance(); - } - - public static PluginSettings getInstance() { - return INSTANCE; + public PluginSettings(TurnScreenApp app) { + this.app = app; + preferences = PreferenceManager.getDefaultSharedPreferences(app.getContext()); } public void enablePlugin() { - setBoolean(PREFERENCE_ENABLE, true); + setBoolean(PREFERENCE_PLUGIN_ENABLE, true); } public void disablePlugin() { - setBoolean(PREFERENCE_ENABLE, false); + setBoolean(PREFERENCE_PLUGIN_ENABLE, false); } public boolean isPluginEnabled() { - return preferences.getBoolean(PREFERENCE_ENABLE, false); + return preferences.getBoolean(PREFERENCE_PLUGIN_ENABLE, false); + } + + public void enableSensor() { + setBoolean(PREFERENCE_SENSOR_ENABLE, true); + } + + public void disableSensor() { + setBoolean(PREFERENCE_SENSOR_ENABLE, false); + } + + public boolean isSensorEnabled() { + return preferences.getBoolean(PREFERENCE_SENSOR_ENABLE, false); } public boolean isPermissionAvailable() { - ComponentName mDeviceAdmin = new ComponentName(context, DeviceAdminRecv.class); - DevicePolicyManager mDevicePolicyManager = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE); + ComponentName mDeviceAdmin = new ComponentName(app.getContext(), DeviceAdminRecv.class); + DevicePolicyManager mDevicePolicyManager = (DevicePolicyManager) app.getContext().getSystemService(Context.DEVICE_POLICY_SERVICE); return mDevicePolicyManager.isAdminActive(mDeviceAdmin); } @@ -176,14 +183,14 @@ public class PluginSettings { List result = new ArrayList<>(); for (int t : unlockTime) { result.add(new StringBuilder().append(t).append(" ") - .append(context.getString(R.string.secondsShort)).toString()); + .append(app.getContext().getString(R.string.secondsShort)).toString()); } return result; } public boolean isAdminPermissionAvailable() { - ComponentName mDeviceAdmin = new ComponentName(context, DeviceAdminRecv.class); - DevicePolicyManager mDevicePolicyManager = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE); + ComponentName mDeviceAdmin = new ComponentName(app.getContext(), DeviceAdminRecv.class); + DevicePolicyManager mDevicePolicyManager = (DevicePolicyManager) app.getContext().getSystemService(Context.DEVICE_POLICY_SERVICE); return mDevicePolicyManager.isAdminActive(mDeviceAdmin); } diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/Some.java b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/Some.java similarity index 95% rename from OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/Some.java rename to OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/Some.java index e5822f1007..8e6f29ba65 100644 --- a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/Some.java +++ b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/Some.java @@ -1,10 +1,10 @@ -package net.osmand.turn_screen_on; +package net.osmand.turnScreenOn; import android.content.ComponentName; import android.widget.Button; -import net.osmand.turn_screen_on.helpers.LockHelper; -import net.osmand.turn_screen_on.helpers.OsmAndAidlHelper; +import net.osmand.turnScreenOn.helpers.LockHelper; +import net.osmand.turnScreenOn.helpers.OsmAndAidlHelper; public class Some { private Button button; diff --git a/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/app/TurnScreenApp.java b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/app/TurnScreenApp.java new file mode 100644 index 0000000000..b785684242 --- /dev/null +++ b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/app/TurnScreenApp.java @@ -0,0 +1,54 @@ +package net.osmand.turnScreenOn.app; + +import android.content.Context; + +import net.osmand.turnScreenOn.PluginSettings; +import net.osmand.turnScreenOn.helpers.AndroidUtils; +import net.osmand.turnScreenOn.helpers.LockHelper; +import net.osmand.turnScreenOn.helpers.OsmAndAidlHelper; +import net.osmand.turnScreenOn.helpers.SensorHelper; + +public class TurnScreenApp { + private LockHelper lockHelper; + private SensorHelper sensorHelper; + private PluginSettings settings; + private OsmAndAidlHelper osmAndAidlHelper; + private AndroidUtils utils; + + private Context context; + + public TurnScreenApp(){} + + public TurnScreenApp(Context context) { + this.context = context; + lockHelper = new LockHelper(this); + sensorHelper = new SensorHelper(this); + settings = new PluginSettings(this); + osmAndAidlHelper = new OsmAndAidlHelper(this); + utils = new AndroidUtils(); + } + + public LockHelper getLockHelper() { + return lockHelper; + } + + public SensorHelper getSensorHelper() { + return sensorHelper; + } + + public PluginSettings getSettings() { + return settings; + } + + public OsmAndAidlHelper getOsmAndAidlHelper() { + return osmAndAidlHelper; + } + + public AndroidUtils getUtils() { + return utils; + } + + public Context getContext() { + return context; + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/AndroidUtils.java b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/helpers/AndroidUtils.java similarity index 91% rename from OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/AndroidUtils.java rename to OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/helpers/AndroidUtils.java index 73908644b2..e68ac4a011 100644 --- a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/AndroidUtils.java +++ b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/helpers/AndroidUtils.java @@ -1,4 +1,4 @@ -package net.osmand.turn_screen_on.helpers; +package net.osmand.turnScreenOn.helpers; import android.content.Context; import android.content.res.Resources; diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/LockHelper.java b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/helpers/LockHelper.java similarity index 90% rename from OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/LockHelper.java rename to OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/helpers/LockHelper.java index 45171bb4ab..8eddf7a60c 100644 --- a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/LockHelper.java +++ b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/helpers/LockHelper.java @@ -1,4 +1,4 @@ -package net.osmand.turn_screen_on.helpers; +package net.osmand.turnScreenOn.helpers; import android.Manifest; import android.app.KeyguardManager; @@ -11,7 +11,8 @@ import android.os.PowerManager; import android.support.v4.content.ContextCompat; import android.util.Log; -import net.osmand.turn_screen_on.receiver.DeviceAdminRecv; +import net.osmand.turnScreenOn.app.TurnScreenApp; +import net.osmand.turnScreenOn.receiver.DeviceAdminRecv; public class LockHelper { private PowerManager.WakeLock wakeLock = null; @@ -19,13 +20,15 @@ public class LockHelper { private ComponentName mDeviceAdmin; private Handler uiHandler; private Context context; + private TurnScreenApp app; private KeyguardManager.KeyguardLock keyguardLock; private LockRunnable lockRunnable; private final static String TAG = "LockHelperTag"; - public LockHelper(Context context) { - this.context = context; + public LockHelper(TurnScreenApp app) { + this.app = app; + this.context = app.getContext(); uiHandler = new Handler(); mDeviceAdmin = new ComponentName(context, DeviceAdminRecv.class); mDevicePolicyManager = (DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE); diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/OsmAndAidlHelper.java b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/helpers/OsmAndAidlHelper.java similarity index 85% rename from OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/OsmAndAidlHelper.java rename to OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/helpers/OsmAndAidlHelper.java index c072a88d76..de5affa1a0 100644 --- a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/helpers/OsmAndAidlHelper.java +++ b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/helpers/OsmAndAidlHelper.java @@ -1,4 +1,4 @@ -package net.osmand.turn_screen_on.helpers; +package net.osmand.turnScreenOn.helpers; import android.content.ComponentName; import android.content.Context; @@ -11,27 +11,21 @@ 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.navigation.ANavigationVoiceRouterMessageParams; import net.osmand.aidl.search.SearchResult; -import net.osmand.turn_screen_on.PluginSettings; -import net.osmand.turn_screen_on.app.TurnScreenOnApplication; +import net.osmand.turnScreenOn.PluginSettings; +import net.osmand.turnScreenOn.app.TurnScreenApp; import java.util.List; public class OsmAndAidlHelper { - //todo change singleton type - private final static OsmAndAidlHelper INSTANCE = new OsmAndAidlHelper(); - private final static String AIDL_SERVICE_PATH = "net.osmand.aidl.OsmandAidlService"; private LockHelper lockHelper; private PluginSettings settings; - private Context context; + private TurnScreenApp app; private int osmandUpdatesCallbackId; private boolean bound; @@ -74,7 +68,7 @@ public class OsmAndAidlHelper { public void onVoiceRouterNotify() throws RemoteException { Log.d("ttpl", "take message from vr"); if (settings.isPluginEnabled()) { - lockHelper.timedUnlock(PluginSettings.getInstance().getTimeLikeSeconds() * 1000L); + lockHelper.timedUnlock(app.getSettings().getTimeLikeSeconds() * 1000L); } } }; @@ -105,15 +99,10 @@ public class OsmAndAidlHelper { } }; - private OsmAndAidlHelper() { - //todo change - settings = PluginSettings.getInstance(); - lockHelper = new LockHelper(TurnScreenOnApplication.getAppContext()); - context = TurnScreenOnApplication.getAppContext(); - } - - public static OsmAndAidlHelper getInstance() { - return INSTANCE; + public OsmAndAidlHelper(TurnScreenApp app) { + this.app = app; + settings = app.getSettings(); + lockHelper = app.getLockHelper(); } public boolean isConnected() { @@ -167,7 +156,7 @@ public class OsmAndAidlHelper { if (mIOsmAndAidlInterface == null) { Intent intent = new Intent("net.osmand.aidl.OsmandAidlService"); intent.setPackage(packageName); - context.bindService(intent, mConnection, Context.BIND_AUTO_CREATE); + app.getContext().bindService(intent, mConnection, Context.BIND_AUTO_CREATE); } else { } @@ -180,7 +169,7 @@ public class OsmAndAidlHelper { // unregisterFromUpdates(); mIOsmAndAidlInterface = null; Log.d("ttpl", "disconnecting from Osmand"); - context.unbindService(mConnection); + app.getContext().unbindService(mConnection); } } catch (Throwable e) { e.printStackTrace(); diff --git a/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/helpers/SensorHelper.java b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/helpers/SensorHelper.java new file mode 100644 index 0000000000..c11d97d0e5 --- /dev/null +++ b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/helpers/SensorHelper.java @@ -0,0 +1,48 @@ +package net.osmand.turnScreenOn.helpers; + +import android.content.Context; +import android.hardware.Sensor; +import android.hardware.SensorEvent; +import android.hardware.SensorEventListener; +import android.hardware.SensorManager; +import android.util.Log; + +import net.osmand.turnScreenOn.app.TurnScreenApp; + +public class SensorHelper implements SensorEventListener { + + private SensorManager mSensorManager; + private Sensor mProximity; + private static final int SENSOR_SENSITIVITY = 4; + private Context context; + private TurnScreenApp app; + + public SensorHelper(TurnScreenApp app) { + this.app = app; + this.context = app.getContext(); + mSensorManager = (SensorManager) context.getSystemService(Context.SENSOR_SERVICE); + mProximity = mSensorManager.getDefaultSensor(Sensor.TYPE_PROXIMITY); + } + + public void switchOnSensor() { + mSensorManager.registerListener(this, mProximity, SensorManager.SENSOR_DELAY_NORMAL); + } + + public void switchOffSensor() { + mSensorManager.unregisterListener(this); + } + + @Override + public void onSensorChanged(SensorEvent event) { + if (event.sensor.getType() == Sensor.TYPE_PROXIMITY) { + if (event.values[0] >= -SENSOR_SENSITIVITY && event.values[0] <= SENSOR_SENSITIVITY) { + Log.d("ttpl", "onSensorChanged: sensor signal"); + } + } + } + + @Override + public void onAccuracyChanged(Sensor sensor, int accuracy) { + + } +} diff --git a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/receiver/DeviceAdminRecv.java b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/receiver/DeviceAdminRecv.java similarity index 92% rename from OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/receiver/DeviceAdminRecv.java rename to OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/receiver/DeviceAdminRecv.java index 7bbc673654..986ccd40d4 100644 --- a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/receiver/DeviceAdminRecv.java +++ b/OsmAnd-turnScreenOn/src/main/java/net/osmand/turnScreenOn/receiver/DeviceAdminRecv.java @@ -1,4 +1,4 @@ -package net.osmand.turn_screen_on.receiver; +package net.osmand.turnScreenOn.receiver; import android.app.admin.DeviceAdminReceiver; import android.content.Context; diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-hdpi/ic_action_help.png b/OsmAnd-turnScreenOn/src/main/res/drawable-hdpi/ic_action_help.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-hdpi/ic_action_help.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-hdpi/ic_action_help.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-hdpi/ic_action_osmand.png b/OsmAnd-turnScreenOn/src/main/res/drawable-hdpi/ic_action_osmand.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-hdpi/ic_action_osmand.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-hdpi/ic_action_osmand.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-hdpi/ic_action_osmand_logo.png b/OsmAnd-turnScreenOn/src/main/res/drawable-hdpi/ic_action_osmand_logo.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-hdpi/ic_action_osmand_logo.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-hdpi/ic_action_osmand_logo.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-hdpi/ic_action_osmand_plus.png b/OsmAnd-turnScreenOn/src/main/res/drawable-hdpi/ic_action_osmand_plus.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-hdpi/ic_action_osmand_plus.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-hdpi/ic_action_osmand_plus.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-hdpi/ic_action_sensor_interaction.png b/OsmAnd-turnScreenOn/src/main/res/drawable-hdpi/ic_action_sensor_interaction.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-hdpi/ic_action_sensor_interaction.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-hdpi/ic_action_sensor_interaction.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-hdpi/ic_action_time_span.png b/OsmAnd-turnScreenOn/src/main/res/drawable-hdpi/ic_action_time_span.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-hdpi/ic_action_time_span.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-hdpi/ic_action_time_span.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-mdpi/ic_action_help.png b/OsmAnd-turnScreenOn/src/main/res/drawable-mdpi/ic_action_help.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-mdpi/ic_action_help.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-mdpi/ic_action_help.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-mdpi/ic_action_osmand.png b/OsmAnd-turnScreenOn/src/main/res/drawable-mdpi/ic_action_osmand.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-mdpi/ic_action_osmand.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-mdpi/ic_action_osmand.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-mdpi/ic_action_osmand_logo.png b/OsmAnd-turnScreenOn/src/main/res/drawable-mdpi/ic_action_osmand_logo.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-mdpi/ic_action_osmand_logo.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-mdpi/ic_action_osmand_logo.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-mdpi/ic_action_osmand_plus.png b/OsmAnd-turnScreenOn/src/main/res/drawable-mdpi/ic_action_osmand_plus.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-mdpi/ic_action_osmand_plus.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-mdpi/ic_action_osmand_plus.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-mdpi/ic_action_sensor_interaction.png b/OsmAnd-turnScreenOn/src/main/res/drawable-mdpi/ic_action_sensor_interaction.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-mdpi/ic_action_sensor_interaction.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-mdpi/ic_action_sensor_interaction.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-mdpi/ic_action_time_span.png b/OsmAnd-turnScreenOn/src/main/res/drawable-mdpi/ic_action_time_span.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-mdpi/ic_action_time_span.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-mdpi/ic_action_time_span.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-v24/ic_launcher_foreground.xml b/OsmAnd-turnScreenOn/src/main/res/drawable-v24/ic_launcher_foreground.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-v24/ic_launcher_foreground.xml rename to OsmAnd-turnScreenOn/src/main/res/drawable-v24/ic_launcher_foreground.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xhdpi/ic_action_help.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xhdpi/ic_action_help.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xhdpi/ic_action_help.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xhdpi/ic_action_help.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xhdpi/ic_action_osmand.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xhdpi/ic_action_osmand.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xhdpi/ic_action_osmand.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xhdpi/ic_action_osmand.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xhdpi/ic_action_osmand_logo.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xhdpi/ic_action_osmand_logo.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xhdpi/ic_action_osmand_logo.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xhdpi/ic_action_osmand_logo.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xhdpi/ic_action_osmand_plus.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xhdpi/ic_action_osmand_plus.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xhdpi/ic_action_osmand_plus.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xhdpi/ic_action_osmand_plus.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xhdpi/ic_action_sensor_interaction.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xhdpi/ic_action_sensor_interaction.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xhdpi/ic_action_sensor_interaction.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xhdpi/ic_action_sensor_interaction.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xhdpi/ic_action_time_span.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xhdpi/ic_action_time_span.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xhdpi/ic_action_time_span.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xhdpi/ic_action_time_span.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xxhdpi/ic_action_help.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xxhdpi/ic_action_help.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xxhdpi/ic_action_help.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xxhdpi/ic_action_help.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xxhdpi/ic_action_osmand.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xxhdpi/ic_action_osmand.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xxhdpi/ic_action_osmand.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xxhdpi/ic_action_osmand.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xxhdpi/ic_action_osmand_logo.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xxhdpi/ic_action_osmand_logo.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xxhdpi/ic_action_osmand_logo.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xxhdpi/ic_action_osmand_logo.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xxhdpi/ic_action_osmand_plus.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xxhdpi/ic_action_osmand_plus.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xxhdpi/ic_action_osmand_plus.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xxhdpi/ic_action_osmand_plus.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xxhdpi/ic_action_sensor_interaction.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xxhdpi/ic_action_sensor_interaction.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xxhdpi/ic_action_sensor_interaction.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xxhdpi/ic_action_sensor_interaction.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xxhdpi/ic_action_time_span.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xxhdpi/ic_action_time_span.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xxhdpi/ic_action_time_span.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xxhdpi/ic_action_time_span.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xxxhdpi/ic_action_help.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xxxhdpi/ic_action_help.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xxxhdpi/ic_action_help.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xxxhdpi/ic_action_help.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xxxhdpi/ic_action_osmand.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xxxhdpi/ic_action_osmand.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xxxhdpi/ic_action_osmand.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xxxhdpi/ic_action_osmand.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xxxhdpi/ic_action_osmand_logo.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xxxhdpi/ic_action_osmand_logo.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xxxhdpi/ic_action_osmand_logo.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xxxhdpi/ic_action_osmand_logo.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xxxhdpi/ic_action_osmand_plus.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xxxhdpi/ic_action_osmand_plus.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xxxhdpi/ic_action_osmand_plus.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xxxhdpi/ic_action_osmand_plus.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xxxhdpi/ic_action_sensor_interaction.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xxxhdpi/ic_action_sensor_interaction.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xxxhdpi/ic_action_sensor_interaction.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xxxhdpi/ic_action_sensor_interaction.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable-xxxhdpi/ic_action_time_span.png b/OsmAnd-turnScreenOn/src/main/res/drawable-xxxhdpi/ic_action_time_span.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable-xxxhdpi/ic_action_time_span.png rename to OsmAnd-turnScreenOn/src/main/res/drawable-xxxhdpi/ic_action_time_span.png diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable/blue_button.xml b/OsmAnd-turnScreenOn/src/main/res/drawable/blue_button.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable/blue_button.xml rename to OsmAnd-turnScreenOn/src/main/res/drawable/blue_button.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable/ic_launcher_background.xml b/OsmAnd-turnScreenOn/src/main/res/drawable/ic_launcher_background.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable/ic_launcher_background.xml rename to OsmAnd-turnScreenOn/src/main/res/drawable/ic_launcher_background.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/drawable/img_add_24dp.xml b/OsmAnd-turnScreenOn/src/main/res/drawable/img_add_24dp.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/drawable/img_add_24dp.xml rename to OsmAnd-turnScreenOn/src/main/res/drawable/img_add_24dp.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/layout/activity_admin_device_permission_set_up.xml b/OsmAnd-turnScreenOn/src/main/res/layout/activity_admin_device_permission_set_up.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/layout/activity_admin_device_permission_set_up.xml rename to OsmAnd-turnScreenOn/src/main/res/layout/activity_admin_device_permission_set_up.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/layout/activity_main.xml b/OsmAnd-turnScreenOn/src/main/res/layout/activity_main.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/layout/activity_main.xml rename to OsmAnd-turnScreenOn/src/main/res/layout/activity_main.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/layout/activity_plugin_description.xml b/OsmAnd-turnScreenOn/src/main/res/layout/activity_plugin_description.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/layout/activity_plugin_description.xml rename to OsmAnd-turnScreenOn/src/main/res/layout/activity_plugin_description.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/layout/main_el_btn_open_osmand.xml b/OsmAnd-turnScreenOn/src/main/res/layout/main_el_btn_open_osmand.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/layout/main_el_btn_open_osmand.xml rename to OsmAnd-turnScreenOn/src/main/res/layout/main_el_btn_open_osmand.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/layout/main_el_osmand_versions.xml b/OsmAnd-turnScreenOn/src/main/res/layout/main_el_osmand_versions.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/layout/main_el_osmand_versions.xml rename to OsmAnd-turnScreenOn/src/main/res/layout/main_el_osmand_versions.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/layout/main_el_plugin_switcher.xml b/OsmAnd-turnScreenOn/src/main/res/layout/main_el_plugin_switcher.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/layout/main_el_plugin_switcher.xml rename to OsmAnd-turnScreenOn/src/main/res/layout/main_el_plugin_switcher.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/layout/main_el_sensor.xml b/OsmAnd-turnScreenOn/src/main/res/layout/main_el_sensor.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/layout/main_el_sensor.xml rename to OsmAnd-turnScreenOn/src/main/res/layout/main_el_sensor.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/layout/main_el_time_set_up.xml b/OsmAnd-turnScreenOn/src/main/res/layout/main_el_time_set_up.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/layout/main_el_time_set_up.xml rename to OsmAnd-turnScreenOn/src/main/res/layout/main_el_time_set_up.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/layout/main_install_desc.xml b/OsmAnd-turnScreenOn/src/main/res/layout/main_install_desc.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/layout/main_install_desc.xml rename to OsmAnd-turnScreenOn/src/main/res/layout/main_install_desc.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/layout/main_settings_panel.xml b/OsmAnd-turnScreenOn/src/main/res/layout/main_settings_panel.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/layout/main_settings_panel.xml rename to OsmAnd-turnScreenOn/src/main/res/layout/main_settings_panel.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/layout/osmand_version_item.xml b/OsmAnd-turnScreenOn/src/main/res/layout/osmand_version_item.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/layout/osmand_version_item.xml rename to OsmAnd-turnScreenOn/src/main/res/layout/osmand_version_item.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/menu/menu_main.xml b/OsmAnd-turnScreenOn/src/main/res/menu/menu_main.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/menu/menu_main.xml rename to OsmAnd-turnScreenOn/src/main/res/menu/menu_main.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/mipmap-anydpi-v26/ic_launcher.xml b/OsmAnd-turnScreenOn/src/main/res/mipmap-anydpi-v26/ic_launcher.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/mipmap-anydpi-v26/ic_launcher.xml rename to OsmAnd-turnScreenOn/src/main/res/mipmap-anydpi-v26/ic_launcher.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml b/OsmAnd-turnScreenOn/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml rename to OsmAnd-turnScreenOn/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/mipmap-hdpi/ic_launcher.png b/OsmAnd-turnScreenOn/src/main/res/mipmap-hdpi/ic_launcher.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/mipmap-hdpi/ic_launcher.png rename to OsmAnd-turnScreenOn/src/main/res/mipmap-hdpi/ic_launcher.png diff --git a/OsmAnd-turn_screen_on/src/main/res/mipmap-hdpi/ic_launcher_round.png b/OsmAnd-turnScreenOn/src/main/res/mipmap-hdpi/ic_launcher_round.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/mipmap-hdpi/ic_launcher_round.png rename to OsmAnd-turnScreenOn/src/main/res/mipmap-hdpi/ic_launcher_round.png diff --git a/OsmAnd-turn_screen_on/src/main/res/mipmap-mdpi/ic_launcher.png b/OsmAnd-turnScreenOn/src/main/res/mipmap-mdpi/ic_launcher.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/mipmap-mdpi/ic_launcher.png rename to OsmAnd-turnScreenOn/src/main/res/mipmap-mdpi/ic_launcher.png diff --git a/OsmAnd-turn_screen_on/src/main/res/mipmap-mdpi/ic_launcher_round.png b/OsmAnd-turnScreenOn/src/main/res/mipmap-mdpi/ic_launcher_round.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/mipmap-mdpi/ic_launcher_round.png rename to OsmAnd-turnScreenOn/src/main/res/mipmap-mdpi/ic_launcher_round.png diff --git a/OsmAnd-turn_screen_on/src/main/res/mipmap-xhdpi/ic_launcher.png b/OsmAnd-turnScreenOn/src/main/res/mipmap-xhdpi/ic_launcher.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/mipmap-xhdpi/ic_launcher.png rename to OsmAnd-turnScreenOn/src/main/res/mipmap-xhdpi/ic_launcher.png diff --git a/OsmAnd-turn_screen_on/src/main/res/mipmap-xhdpi/ic_launcher_round.png b/OsmAnd-turnScreenOn/src/main/res/mipmap-xhdpi/ic_launcher_round.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/mipmap-xhdpi/ic_launcher_round.png rename to OsmAnd-turnScreenOn/src/main/res/mipmap-xhdpi/ic_launcher_round.png diff --git a/OsmAnd-turn_screen_on/src/main/res/mipmap-xxhdpi/ic_launcher.png b/OsmAnd-turnScreenOn/src/main/res/mipmap-xxhdpi/ic_launcher.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/mipmap-xxhdpi/ic_launcher.png rename to OsmAnd-turnScreenOn/src/main/res/mipmap-xxhdpi/ic_launcher.png diff --git a/OsmAnd-turn_screen_on/src/main/res/mipmap-xxhdpi/ic_launcher_round.png b/OsmAnd-turnScreenOn/src/main/res/mipmap-xxhdpi/ic_launcher_round.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/mipmap-xxhdpi/ic_launcher_round.png rename to OsmAnd-turnScreenOn/src/main/res/mipmap-xxhdpi/ic_launcher_round.png diff --git a/OsmAnd-turn_screen_on/src/main/res/mipmap-xxxhdpi/ic_launcher.png b/OsmAnd-turnScreenOn/src/main/res/mipmap-xxxhdpi/ic_launcher.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/mipmap-xxxhdpi/ic_launcher.png rename to OsmAnd-turnScreenOn/src/main/res/mipmap-xxxhdpi/ic_launcher.png diff --git a/OsmAnd-turn_screen_on/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png b/OsmAnd-turnScreenOn/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png rename to OsmAnd-turnScreenOn/src/main/res/mipmap-xxxhdpi/ic_launcher_round.png diff --git a/OsmAnd-turn_screen_on/src/main/res/values/colors.xml b/OsmAnd-turnScreenOn/src/main/res/values/colors.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/values/colors.xml rename to OsmAnd-turnScreenOn/src/main/res/values/colors.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/values/strings.xml b/OsmAnd-turnScreenOn/src/main/res/values/strings.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/values/strings.xml rename to OsmAnd-turnScreenOn/src/main/res/values/strings.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/values/styles.xml b/OsmAnd-turnScreenOn/src/main/res/values/styles.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/values/styles.xml rename to OsmAnd-turnScreenOn/src/main/res/values/styles.xml diff --git a/OsmAnd-turn_screen_on/src/main/res/xml/device_admin.xml b/OsmAnd-turnScreenOn/src/main/res/xml/device_admin.xml similarity index 100% rename from OsmAnd-turn_screen_on/src/main/res/xml/device_admin.xml rename to OsmAnd-turnScreenOn/src/main/res/xml/device_admin.xml 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 deleted file mode 100644 index 0872d08fa3..0000000000 --- a/OsmAnd-turn_screen_on/src/main/java/net/osmand/turn_screen_on/app/TurnScreenOnApplication.java +++ /dev/null @@ -1,17 +0,0 @@ -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/src/net/osmand/aidl/IOsmAndAidlInterface.aidl b/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl index 1ec1943d93..a9759d216a 100644 --- a/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl +++ b/OsmAnd/src/net/osmand/aidl/IOsmAndAidlInterface.aidl @@ -701,5 +701,8 @@ interface IOsmAndAidlInterface { boolean removeContextMenuButtons(in RemoveContextMenuButtonsParams params); boolean updateContextMenuButtons(in UpdateContextMenuButtonsParams params); + boolean areOsmandSettingsCustomized(in OsmandSettingsInfoParams params); + + boolean setCustomization(in CustomizationInfoParams params); long registerForVoiceRouterMessages(in ANavigationVoiceRouterMessageParams params, IOsmAndAidlCallback callback); } \ No newline at end of file diff --git a/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java b/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java index 7315f66cfc..bc5e22dbe5 100644 --- a/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java +++ b/OsmAnd/src/net/osmand/aidl/OsmandAidlService.java @@ -1151,6 +1151,41 @@ public class OsmandAidlService extends Service implements AidlCallbackListener { }); return 0; } + + public long registerForVoiceRouterMessages(ANavigationVoiceRouterMessageParams params, final IOsmAndAidlCallback callback) throws RemoteException { + /*try { + OsmandAidlApi api = getApi("registerForNavUpdates"); + if (api != null ) { + if (!params.isSubscribeToUpdates() && params.getCallbackId() != -1) { + api.unregisterFromUpdates(params.getCallbackId()); + removeAidlCallback(params.getCallbackId()); + return -1; + } else { + long id = addAidlCallback(callback, KEY_ON_NAV_DATA_UPDATE); + api.registerForNavigationUpdates(id); + return id; + } + } else { + return -1; + } + } catch (Exception e) { + handleException(e); + return UNKNOWN_API_ERROR; + }*/ + + VoiceRouter voiceRouter = getApp().getRoutingHelper().getVoiceRouter(); + voiceRouter.addVoiceMessageListener(new VoiceRouter.VoiceMessageListener() { + @Override + public void onVoiceMessage() { + try { + callback.onVoiceRouterNotify(); + } catch (RemoteException e) { + handleException(e); + } + } + }); + return 0; + } }; public static class AidlCallbackParams { diff --git a/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java b/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java index cf17e5465e..750f002f0f 100644 --- a/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java +++ b/OsmAnd/src/net/osmand/plus/routing/VoiceRouter.java @@ -947,8 +947,8 @@ public class VoiceRouter { } public void notifyOnVoiceMessage() { - for (VoiceMessageListener lnt : voiceMessageListeners.keySet()) { - lnt.onVoiceMessage(); - } + for (VoiceMessageListener lnt : voiceMessageListeners.keySet()) { + lnt.onVoiceMessage(); + } } } diff --git a/settings.gradle b/settings.gradle index 609d8bf8b1..2be70d1e6f 100644 --- a/settings.gradle +++ b/settings.gradle @@ -1,4 +1,4 @@ -include ':OsmAnd-java', ':OsmAndCore-sample', ':OsmAnd-telegram', ':OsmAnd-turn_screen_on' +include ':OsmAnd-java', ':OsmAndCore-sample', ':OsmAnd-telegram', ':OsmAnd-turnScreenOn' include ':OsmAnd' include ':plugins:Osmand-Nautical' include ':plugins:Osmand-ParkingPlugin'