crash fixes

This commit is contained in:
LagradOst 2021-07-27 00:06:41 +02:00
parent 3b7327f27e
commit a6c96c9647
4 changed files with 11 additions and 9 deletions

View File

@ -13,8 +13,8 @@ android {
applicationId "com.lagradost.cloudstream3"
minSdkVersion 21
targetSdkVersion 30
versionCode 3
versionName "1.1.1"
versionCode 5
versionName "1.1.3"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"

View File

@ -45,7 +45,7 @@
</receiver>
<service
android:name=".services.VideoDownloadKeepAliveService"
android:enabled="true" >
android:enabled="false" >
</service>
<service
android:name=".services.VideoDownloadService"

View File

@ -14,10 +14,10 @@ class VideoDownloadRestartReceiver : BroadcastReceiver() {
override fun onReceive(context: Context?, intent: Intent?) {
Log.i("Broadcast Listened", "Service tried to stop")
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
context?.startForegroundService(Intent(context, VideoDownloadKeepAliveService::class.java).putExtra(START_VALUE_KEY, RESTART_ALL_DOWNLOADS_AND_QUEUE))
} else {
context?.startService(Intent(context, VideoDownloadKeepAliveService::class.java).putExtra(START_VALUE_KEY, RESTART_ALL_DOWNLOADS_AND_QUEUE))
}
// if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) {
// context?.startForegroundService(Intent(context, VideoDownloadKeepAliveService::class.java).putExtra(START_VALUE_KEY, RESTART_ALL_DOWNLOADS_AND_QUEUE))
// } else {
// context?.startService(Intent(context, VideoDownloadKeepAliveService::class.java).putExtra(START_VALUE_KEY, RESTART_ALL_DOWNLOADS_AND_QUEUE))
// }
}
}

View File

@ -1345,7 +1345,9 @@ class PlayerFragment : Fragment() {
outState.putBoolean(STATE_PLAYER_PLAYING, isPlayerPlaying)
outState.putInt(RESIZE_MODE_KEY, resizeMode)
outState.putFloat(PLAYBACK_SPEED, playbackSpeed)
outState.putString("data", mapper.writeValueAsString(playerData))
if(!isDownloadedFile) {
outState.putString("data", mapper.writeValueAsString(playerData))
}
super.onSaveInstanceState(outState)
}