From 73a5789bd0a212bf5a3fd4d626f17da1f5efa01f Mon Sep 17 00:00:00 2001 From: geeksville Date: Tue, 7 Jul 2020 15:33:12 -0700 Subject: [PATCH 1/5] 0.7.92 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 3835898b4..72a26442c 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ android { applicationId "com.geeksville.mesh" minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works) targetSdkVersion 29 - versionCode 10791 // format is Mmmss (where M is 1+the numeric major number - versionName "0.7.91" + versionCode 10792 // format is Mmmss (where M is 1+the numeric major number + versionName "0.7.92" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes { From 90d2a9cde4fb86eb0eb130059123d198375910b9 Mon Sep 17 00:00:00 2001 From: geeksville Date: Wed, 8 Jul 2020 07:50:24 -0700 Subject: [PATCH 2/5] make autobug in appRate non fatal --- .../java/com/geeksville/mesh/MainActivity.kt | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/MainActivity.kt b/app/src/main/java/com/geeksville/mesh/MainActivity.kt index cf2624caa..2c7ad328c 100644 --- a/app/src/main/java/com/geeksville/mesh/MainActivity.kt +++ b/app/src/main/java/com/geeksville/mesh/MainActivity.kt @@ -332,25 +332,28 @@ class MainActivity : AppCompatActivity(), Logging, /// Ask user to rate in play store private fun askToRate() { - AppRate.with(this) - .setInstallDays(10.toByte()) // default is 10, 0 means install day, 10 means app is launched 10 or more days later than installation - .setLaunchTimes(10.toByte()) // default is 10, 3 means app is launched 3 or more times - .setRemindInterval(1.toByte()) // default is 1, 1 means app is launched 1 or more days after neutral button clicked - .setRemindLaunchesNumber(1.toByte()) // default is 0, 1 means app is launched 1 or more times after neutral button clicked - .monitor() // Monitors the app launch times + exceptionReporter { // Got one IllegalArgumentException from inside this lib, but we don't want to crash our app because of bugs in this optional feature + + AppRate.with(this) + .setInstallDays(10.toByte()) // default is 10, 0 means install day, 10 means app is launched 10 or more days later than installation + .setLaunchTimes(10.toByte()) // default is 10, 3 means app is launched 3 or more times + .setRemindInterval(1.toByte()) // default is 1, 1 means app is launched 1 or more days after neutral button clicked + .setRemindLaunchesNumber(1.toByte()) // default is 0, 1 means app is launched 1 or more times after neutral button clicked + .monitor() // Monitors the app launch times - // Only ask to rate if the user has a suitable store - if (AppRate.with(this).storeType == StoreType.GOOGLEPLAY) { // Checks that current app store type from library options is StoreType.GOOGLEPLAY - if (GoogleApiAvailability.getInstance() - .isGooglePlayServicesAvailable(this) != ConnectionResult.SERVICE_MISSING - ) { // Checks that Google Play is available - AppRate.showRateDialogIfMeetsConditions(this) // Shows the Rate Dialog when conditions are met + // Only ask to rate if the user has a suitable store + if (AppRate.with(this).storeType == StoreType.GOOGLEPLAY) { // Checks that current app store type from library options is StoreType.GOOGLEPLAY + if (GoogleApiAvailability.getInstance() + .isGooglePlayServicesAvailable(this) != ConnectionResult.SERVICE_MISSING + ) { // Checks that Google Play is available + AppRate.showRateDialogIfMeetsConditions(this) // Shows the Rate Dialog when conditions are met - // Force the dialog - for testing - // AppRate.with(this).showRateDialog(this) + // Force the dialog - for testing + // AppRate.with(this).showRateDialog(this) + } + } else { + AppRate.showRateDialogIfMeetsConditions(this); // Shows the Rate Dialog when conditions are met } - } else { - AppRate.showRateDialogIfMeetsConditions(this); // Shows the Rate Dialog when conditions are met } } From 931cfb52d359e7c3fbf598b359291a86e08e2b94 Mon Sep 17 00:00:00 2001 From: geeksville Date: Wed, 8 Jul 2020 07:57:22 -0700 Subject: [PATCH 3/5] don't spam crashlytics just because the radio was sleeping --- app/src/main/java/com/geeksville/mesh/ui/ChannelFragment.kt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/ui/ChannelFragment.kt b/app/src/main/java/com/geeksville/mesh/ui/ChannelFragment.kt index 1402d44ab..a17d978f1 100644 --- a/app/src/main/java/com/geeksville/mesh/ui/ChannelFragment.kt +++ b/app/src/main/java/com/geeksville/mesh/ui/ChannelFragment.kt @@ -23,7 +23,6 @@ import com.geeksville.mesh.model.Channel import com.geeksville.mesh.model.ChannelOption import com.geeksville.mesh.model.UIViewModel import com.geeksville.mesh.service.MeshService -import com.geeksville.util.Exceptions import com.google.android.material.dialog.MaterialAlertDialogBuilder import com.google.android.material.snackbar.Snackbar import com.google.protobuf.ByteString @@ -170,13 +169,15 @@ class ChannelFragment : ScreenFragment("Channel"), Logging { filled_exposed_dropdown.editableText.toString() val modemConfig = getModemConfig(selectedChannelOptionString) - if (modemConfig!=MeshProtos.ChannelSettings.ModemConfig.UNRECOGNIZED) + if (modemConfig != MeshProtos.ChannelSettings.ModemConfig.UNRECOGNIZED) newSettings.modemConfig = modemConfig // Try to change the radio, if it fails, tell the user why and throw away their redits try { model.setChannel(newSettings.build()) // Since we are writing to radioconfig, that will trigger the rest of the GUI update (QR code etc) } catch (ex: RemoteException) { + errormsg("ignoring channel problem", ex) + setGUIfromModel() // Throw away user edits // Tell the user to try again @@ -185,7 +186,6 @@ class ChannelFragment : ScreenFragment("Channel"), Logging { R.string.radio_sleeping, Snackbar.LENGTH_SHORT ).show() - Exceptions.report(ex, "ignoring channel problem") } } } From 49752d05505904157dd9f323772ab3b25c89af2c Mon Sep 17 00:00:00 2001 From: geeksville Date: Wed, 8 Jul 2020 08:29:53 -0700 Subject: [PATCH 4/5] if device goes away at just the right time, user won't be able to set channel --- .../main/java/com/geeksville/mesh/MainActivity.kt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/app/src/main/java/com/geeksville/mesh/MainActivity.kt b/app/src/main/java/com/geeksville/mesh/MainActivity.kt index 2c7ad328c..a2d36be98 100644 --- a/app/src/main/java/com/geeksville/mesh/MainActivity.kt +++ b/app/src/main/java/com/geeksville/mesh/MainActivity.kt @@ -333,7 +333,7 @@ class MainActivity : AppCompatActivity(), Logging, /// Ask user to rate in play store private fun askToRate() { exceptionReporter { // Got one IllegalArgumentException from inside this lib, but we don't want to crash our app because of bugs in this optional feature - + AppRate.with(this) .setInstallDays(10.toByte()) // default is 10, 0 means install day, 10 means app is launched 10 or more days later than installation .setLaunchTimes(10.toByte()) // default is 10, 3 means app is launched 3 or more times @@ -646,7 +646,16 @@ class MainActivity : AppCompatActivity(), Logging, } .setPositiveButton(R.string.accept) { _, _ -> debug("Setting channel from URL") - model.setChannel(channel.settings) + try { + model.setChannel(channel.settings) + } catch (ex: RemoteException) { + errormsg("Couldn't change channel ${ex.message}") + Toast.makeText( + this, + "Couldn't change channel, because radio is not yet connected. Please try again.", + Toast.LENGTH_SHORT + ).show() + } } .show() } From 31132471ade509e4e9ea9d396bd156b8e0f7f1fc Mon Sep 17 00:00:00 2001 From: geeksville Date: Wed, 8 Jul 2020 08:30:03 -0700 Subject: [PATCH 5/5] 0.7.93 --- app/build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/build.gradle b/app/build.gradle index 72a26442c..4a6a01320 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -17,8 +17,8 @@ android { applicationId "com.geeksville.mesh" minSdkVersion 21 // The oldest emulator image I have tried is 22 (though 21 probably works) targetSdkVersion 29 - versionCode 10792 // format is Mmmss (where M is 1+the numeric major number - versionName "0.7.92" + versionCode 10793 // format is Mmmss (where M is 1+the numeric major number + versionName "0.7.93" testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" } buildTypes {