File tree Expand file tree Collapse file tree 1 file changed +7
-1
lines changed
app/src/main/java/io/github/fate_grand_automata/ui Expand file tree Collapse file tree 1 file changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -3,14 +3,20 @@ package io.github.fate_grand_automata.ui
33import android.app.Activity
44import android.content.Context
55import android.content.Intent
6+ import android.media.projection.MediaProjectionConfig
67import android.media.projection.MediaProjectionManager
8+ import android.os.Build
79import androidx.activity.result.contract.ActivityResultContract
810
911class StartMediaProjection : ActivityResultContract <Unit , Intent ?>() {
1012 override fun createIntent (context : Context , input : Unit ): Intent {
1113 val mediaProjectionManager = context.getSystemService(MediaProjectionManager ::class .java)
1214
13- return mediaProjectionManager.createScreenCaptureIntent()
15+ return if (Build .VERSION .SDK_INT >= Build .VERSION_CODES .VANILLA_ICE_CREAM ) {
16+ mediaProjectionManager.createScreenCaptureIntent(MediaProjectionConfig .createConfigForDefaultDisplay())
17+ } else {
18+ mediaProjectionManager.createScreenCaptureIntent()
19+ }
1420 }
1521
1622 override fun parseResult (resultCode : Int , intent : Intent ? ) =
You can’t perform that action at this time.
0 commit comments