Skip to content

Commit

Permalink
restart on SecurityException
Browse files Browse the repository at this point in the history
  • Loading branch information
cvzi committed Jun 2, 2023
1 parent 4127b45 commit 58ddf98
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,12 @@ class TakeScreenshotActivity : Activity(),
App.createMediaProjection()
} catch (e: SecurityException) {
Log.e(TAG, "prepareForScreenSharing(): SecurityException 3")
null
Handler(Looper.getMainLooper()).postDelayed({
// Something went wrong, restart everything
finish()
App.getInstance().screenshot(this)
}, 500)
return
}
if (mediaProjection == null) {
screenShotFailedToast("Failed to create MediaProjection", Toast.LENGTH_SHORT)
Expand Down

0 comments on commit 58ddf98

Please sign in to comment.