From 20c14b54962b57ddb7f259dfb78fe5aafadd11c1 Mon Sep 17 00:00:00 2001 From: Alex Sytnyk Date: Thu, 6 Sep 2018 15:54:47 +0300 Subject: [PATCH 1/2] Init TelegramApplication from OsmAnd --- OsmAnd-telegram/AndroidManifest.xml | 9 +++++++++ .../net/osmand/telegram/InitAppBroadcastReceiver.kt | 12 ++++++++++++ OsmAnd/src/net/osmand/aidl/OsmandAidlApi.java | 11 +++++++++++ 3 files changed, 32 insertions(+) create mode 100644 OsmAnd-telegram/src/net/osmand/telegram/InitAppBroadcastReceiver.kt diff --git a/OsmAnd-telegram/AndroidManifest.xml b/OsmAnd-telegram/AndroidManifest.xml index 32ba316d98..9b89517512 100644 --- a/OsmAnd-telegram/AndroidManifest.xml +++ b/OsmAnd-telegram/AndroidManifest.xml @@ -53,6 +53,15 @@ + + + + + + mapActivityRef = new WeakReference<>(mapActivity); BroadcastReceiver refreshMapReceiver = new BroadcastReceiver() { From 7f0ca8831e7af8d646fe591d796b66f10a319a52 Mon Sep 17 00:00:00 2001 From: Alex Sytnyk Date: Thu, 6 Sep 2018 15:55:38 +0300 Subject: [PATCH 2/2] Replace hardcoded values --- .../src/net/osmand/telegram/TelegramApplication.kt | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt b/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt index 36cf9da896..25ad8b3306 100644 --- a/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt +++ b/OsmAnd-telegram/src/net/osmand/telegram/TelegramApplication.kt @@ -45,10 +45,8 @@ class TelegramApplication : Application(), OsmandHelperListener { osmandAidlHelper.listener = object : OsmandAidlHelper.OsmandHelperListener { override fun onOsmandConnectionStateChanged(connected: Boolean) { if (connected) { - val basePackage = "net.osmand.telegram" - val appPackage = if (BuildConfig.DEBUG) "$basePackage.debug" else basePackage osmandAidlHelper.setNavDrawerItems( - appPackage, + applicationContext.packageName, listOf(getString(R.string.app_name)), listOf("osmand_telegram://main_activity"), listOf("ic_action_location_sharing_app"),