Skip to content

Commit

Permalink
maybe fix #4896
Browse files Browse the repository at this point in the history
  • Loading branch information
westnordost committed Mar 27, 2023
1 parent ff3b1bd commit 07e37d4
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -185,15 +185,19 @@ class MainActivity :
window.addFlags(WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON)
}

downloadController.showNotification = false
uploadController.showNotification = false
uploadController.addUploadProgressListener(uploadProgressListener)
downloadController.addDownloadProgressListener(downloadProgressListener)

locationAvailabilityReceiver.addListener(::updateLocationAvailability)
updateLocationAvailability(hasLocationPermission && isLocationEnabled)
}

public override fun onResume() {
super.onResume()
downloadController.showNotification = false
uploadController.showNotification = false
}

@Deprecated("Deprecated in Java")
override fun onBackPressed() {
if (!forwardBackPressedToChildren()) super.onBackPressed()
Expand Down Expand Up @@ -229,12 +233,12 @@ class MainActivity :
putLong(Prefs.MAP_LATITUDE, java.lang.Double.doubleToRawLongBits(pos.latitude))
putLong(Prefs.MAP_LONGITUDE, java.lang.Double.doubleToRawLongBits(pos.longitude))
}
downloadController.showNotification = true
uploadController.showNotification = true
}

public override fun onStop() {
super.onStop()
downloadController.showNotification = true
uploadController.showNotification = true
uploadController.removeUploadProgressListener(uploadProgressListener)
downloadController.removeDownloadProgressListener(downloadProgressListener)
locationAvailabilityReceiver.removeListener(::updateLocationAvailability)
Expand Down

0 comments on commit 07e37d4

Please sign in to comment.