kopia lustrzana https://github.com/meshtastic/Meshtastic-Android
hotfix 0.3.7 - don't ask for permissions in simulation, boolean was backwards
rodzic
ef5c59705e
commit
51a1245068
|
@ -16,8 +16,8 @@ android {
|
|||
applicationId "com.geeksville.mesh"
|
||||
minSdkVersion 22 // The oldest emulator image I have tried is 22 (though 21 probably works)
|
||||
targetSdkVersion 29
|
||||
versionCode 136
|
||||
versionName "0.3.6"
|
||||
versionCode 137
|
||||
versionName "0.3.7"
|
||||
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
|
||||
}
|
||||
buildTypes {
|
||||
|
|
|
@ -216,6 +216,14 @@ class MainActivity : AppCompatActivity(), Logging,
|
|||
grantResults: IntArray
|
||||
) {
|
||||
super.onRequestPermissionsResult(requestCode, permissions, grantResults)
|
||||
|
||||
if (grantResults.contains(PackageManager.PERMISSION_DENIED)) {
|
||||
Toast.makeText(
|
||||
this,
|
||||
getString(R.string.permission_missing),
|
||||
Toast.LENGTH_LONG
|
||||
).show()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@ -271,7 +279,7 @@ class MainActivity : AppCompatActivity(), Logging,
|
|||
model.ownerName.value = prefs.getString("owner", "")!!
|
||||
|
||||
val isInTestLab = (application as GeeksvilleApplication).isInTestLab
|
||||
|
||||
|
||||
// Ensures Bluetooth is available on the device and it is enabled. If not,
|
||||
// displays a dialog requesting user permission to enable Bluetooth.
|
||||
if (bluetoothAdapter != null && !isInTestLab) {
|
||||
|
@ -288,7 +296,7 @@ class MainActivity : AppCompatActivity(), Logging,
|
|||
.show()
|
||||
}
|
||||
|
||||
if (isInTestLab)
|
||||
if (!isInTestLab)
|
||||
requestPermission() // permissions don't work there
|
||||
|
||||
/* not yet working
|
||||
|
|
|
@ -35,4 +35,5 @@
|
|||
<string name="map_not_allowed">You have analytics disabled. Unfortunately our map provider (mapbox) requires analytics to be allowed for their \'free\' plan. So we have turned off the map view.\n\n
|
||||
If you would like to see the map, you\'ll need to turn on analytics in the Settings pane (also, for the time being you might need to force restart the application).\n\n
|
||||
If you are interested in us paying for mapbox (or switching to a different map provider), please post in our forum.</string>
|
||||
<string name="permission_missing">A required permission is missing, Meshtastic won\'t be able to work properly. Please enable in application settings.</string>
|
||||
</resources>
|
||||
|
|
Ładowanie…
Reference in New Issue