From 4ea44095df41b257e0db8823a517c3d06e99c6aa Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Tue, 2 Feb 2021 10:47:54 +0800 Subject: [PATCH 1/5] 1.1.40 trying to squash native crash in mb via testlab. --- app/build.gradle | 4 ++-- .../com/geeksville/mesh/ui/MapFragment.kt | 21 ++++++++++++++----- 2 files changed, 18 insertions(+), 7 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 112bb7572..fc08675b3 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -31,8 +31,8 @@ android { applicationId "com.geeksville.mesh" minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works) targetSdkVersion 29 - versionCode 20139 // format is Mmmss (where M is 1+the numeric major number - versionName "1.1.39" + versionCode 20140 // format is Mmmss (where M is 1+the numeric major number + versionName "1.1.40" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" // per https://developer.android.com/studio/write/vector-asset-studio diff --git a/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt b/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt index 21d5a650c..7a694e408 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/MapFragment.kt @@ -136,7 +136,7 @@ class MapFragment : ScreenFragment("Map"), Logging { * Mapbox native code can crash painfully if you ever call a mapbox view function while the view is not actively being show */ private val isViewVisible: Boolean - get() = view != null && isResumed + get() = view != null && isResumed && (mapView?.isDestroyed != false) override fun onViewCreated(viewIn: View, savedInstanceState: Bundle?) { super.onViewCreated(viewIn, savedInstanceState) @@ -145,9 +145,9 @@ class MapFragment : ScreenFragment("Map"), Logging { if ((requireContext().applicationContext as GeeksvilleApplication).isAnalyticsAllowed) { val vIn = viewIn.findViewById(R.id.mapView) mapView = vIn - vIn.onCreate(savedInstanceState) - mapView?.let { v -> + v.onCreate(savedInstanceState) + // Each time the pane is shown start fetching new map info (we do this here instead of // onCreate because getMapAsync can die in native code if the view goes away) v.getMapAsync { map -> @@ -205,14 +205,25 @@ class MapFragment : ScreenFragment("Map"), Logging { } override fun onDestroyView() { - mapView?.onDestroy() super.onDestroyView() + mapView?.onDestroy() } override fun onSaveInstanceState(outState: Bundle) { - mapView?.onSaveInstanceState(outState) + mapView?.let { + if (!it.isDestroyed) + it.onSaveInstanceState(outState) + } super.onSaveInstanceState(outState) } + + override fun onLowMemory() { + mapView?.let { + if (!it.isDestroyed) + it.onLowMemory() + } + super.onLowMemory() + } } From 55fd7c7330159eca39c600992aed1747aa656ab8 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Thu, 4 Feb 2021 08:20:43 +0800 Subject: [PATCH 2/5] make a guaranteed non vector version of icon for older androids --- .../com/geeksville/mesh/service/MeshServiceNotifications.kt | 2 +- app/src/main/res/drawable-hdpi/app_icon_novect.png | 1 + app/src/main/res/drawable-mdpi/app_icon_novect.png | 1 + app/src/main/res/drawable-xhdpi/app_icon_novect.png | 1 + app/src/main/res/drawable-xxhdpi/app_icon_novect.png | 1 + 5 files changed, 5 insertions(+), 1 deletion(-) create mode 120000 app/src/main/res/drawable-hdpi/app_icon_novect.png create mode 120000 app/src/main/res/drawable-mdpi/app_icon_novect.png create mode 120000 app/src/main/res/drawable-xhdpi/app_icon_novect.png create mode 120000 app/src/main/res/drawable-xxhdpi/app_icon_novect.png diff --git a/app/src/main/java/com/geeksville/mesh/service/MeshServiceNotifications.kt b/app/src/main/java/com/geeksville/mesh/service/MeshServiceNotifications.kt index ddf55a306..207ea93a1 100644 --- a/app/src/main/java/com/geeksville/mesh/service/MeshServiceNotifications.kt +++ b/app/src/main/java/com/geeksville/mesh/service/MeshServiceNotifications.kt @@ -73,7 +73,7 @@ class MeshServiceNotifications( val builder = NotificationCompat.Builder(context, channelId).setOngoing(true) .setPriority(NotificationCompat.PRIORITY_MIN) .setCategory(category) - .setSmallIcon(R.drawable.app_icon) + .setSmallIcon(if (Build.VERSION.SDK_INT < Build.VERSION_CODES.N) R.drawable.app_icon_novect else R.drawable.app_icon) // vector form icons don't work reliably on older androids .setContentTitle(summaryString) // leave this off for now so our notification looks smaller .setVisibility(NotificationCompat.VISIBILITY_PUBLIC) .setContentIntent(openAppIntent) diff --git a/app/src/main/res/drawable-hdpi/app_icon_novect.png b/app/src/main/res/drawable-hdpi/app_icon_novect.png new file mode 120000 index 000000000..ef5958e92 --- /dev/null +++ b/app/src/main/res/drawable-hdpi/app_icon_novect.png @@ -0,0 +1 @@ +app_icon.png \ No newline at end of file diff --git a/app/src/main/res/drawable-mdpi/app_icon_novect.png b/app/src/main/res/drawable-mdpi/app_icon_novect.png new file mode 120000 index 000000000..ef5958e92 --- /dev/null +++ b/app/src/main/res/drawable-mdpi/app_icon_novect.png @@ -0,0 +1 @@ +app_icon.png \ No newline at end of file diff --git a/app/src/main/res/drawable-xhdpi/app_icon_novect.png b/app/src/main/res/drawable-xhdpi/app_icon_novect.png new file mode 120000 index 000000000..ef5958e92 --- /dev/null +++ b/app/src/main/res/drawable-xhdpi/app_icon_novect.png @@ -0,0 +1 @@ +app_icon.png \ No newline at end of file diff --git a/app/src/main/res/drawable-xxhdpi/app_icon_novect.png b/app/src/main/res/drawable-xxhdpi/app_icon_novect.png new file mode 120000 index 000000000..ef5958e92 --- /dev/null +++ b/app/src/main/res/drawable-xxhdpi/app_icon_novect.png @@ -0,0 +1 @@ +app_icon.png \ No newline at end of file From e919104bbb758372a2252e5eceda2c687467ba96 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Thu, 4 Feb 2021 08:21:01 +0800 Subject: [PATCH 3/5] update jvm --- .idea/compiler.xml | 2 +- .idea/misc.xml | 2 +- .idea/vcs.xml | 1 + 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 0f4a1a9c8..38982c38b 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,7 +1,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index d5d35ec44..b3c4f59b4 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + diff --git a/.idea/vcs.xml b/.idea/vcs.xml index e8f81507d..bc2dfb5ae 100644 --- a/.idea/vcs.xml +++ b/.idea/vcs.xml @@ -3,6 +3,7 @@ + From a209d3b585a3397d073a4beb782cb733fd7a8ac6 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Thu, 4 Feb 2021 09:20:19 +0800 Subject: [PATCH 4/5] update to latest kotlin --- build.gradle | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/build.gradle b/build.gradle index 5c61f9d69..cfef6d972 100644 --- a/build.gradle +++ b/build.gradle @@ -1,7 +1,7 @@ // Top-level build file where you can add configuration options common to all sub-projects/modules. buildscript { - ext.kotlin_version = '1.4.21' + ext.kotlin_version = '1.4.30' ext.coroutines_version = "1.3.9" repositories { From 3db5be760d44c6272463e866bfcf95234de27a94 Mon Sep 17 00:00:00 2001 From: Kevin Hester Date: Thu, 4 Feb 2021 09:25:06 +0800 Subject: [PATCH 5/5] 1.1.41 --- .idea/compiler.xml | 2 +- .idea/misc.xml | 2 +- app/build.gradle | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.idea/compiler.xml b/.idea/compiler.xml index 38982c38b..0f4a1a9c8 100644 --- a/.idea/compiler.xml +++ b/.idea/compiler.xml @@ -1,7 +1,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index b3c4f59b4..d5d35ec44 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -1,6 +1,6 @@ - + diff --git a/app/build.gradle b/app/build.gradle index fc08675b3..fb75ed47a 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -31,8 +31,8 @@ android { applicationId "com.geeksville.mesh" minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works) targetSdkVersion 29 - versionCode 20140 // format is Mmmss (where M is 1+the numeric major number - versionName "1.1.40" + versionCode 20141 // format is Mmmss (where M is 1+the numeric major number + versionName "1.1.41" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" // per https://developer.android.com/studio/write/vector-asset-studio