Skip to content

Commit

Permalink
Fix some permission checking
Browse files Browse the repository at this point in the history
  • Loading branch information
rcgroot committed Mar 9, 2017
1 parent d035b77 commit 102b9c0
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ class ControlFragment : Fragment() {

override fun onStart() {
super.onStart()
permissionRequester.checkPermissions(activity) { controlPresenter.start(activity) }
permissionRequester.checkPermissions(this, { controlPresenter.start(activity) })
}

override fun onStop() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class TrackMapFragment : Fragment() {
super.onStart()
binding!!.fragmentMapMapview?.onStart()
binding!!.fragmentMapMapview.getMapAsync(trackPresenter)
permissionRequester.checkPermissions(activity, { trackPresenter.start(activity) })
permissionRequester.checkPermissions(this, { trackPresenter.start(activity) })
}

override fun onResume() {
Expand Down Expand Up @@ -94,4 +94,8 @@ class TrackMapFragment : Fragment() {
super.onLowMemory()
binding?.fragmentMapMapview?.onLowMemory()
}

override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
permissionRequester.onRequestPermissionsResult(requestCode, permissions, grantResults)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,16 @@ class RecordingFragment : Fragment() {

override fun onStart() {
super.onStart()
permissionRequester.checkPermissions(activity) { presenter.start(activity) }
permissionRequester.checkPermissions(this, { presenter.start(activity) })
}

override fun onStop() {
super.onStop()
permissionRequester.stop()
presenter.stop()
}

override fun onRequestPermissionsResult(requestCode: Int, permissions: Array<String>, grantResults: IntArray) {
permissionRequester.onRequestPermissionsResult(requestCode, permissions, grantResults)
}
}

0 comments on commit 102b9c0

Please sign in to comment.