Fix StackOverflowError by returning VLCApplication which is wrapped

(cherry picked from commit 4c3b295f69)
This commit is contained in:
Nicolas Pomepuy
2019-08-12 10:14:46 +02:00
committed by Geoffrey Métais
parent f6f5c9d5ae
commit 02ae94d64c
8 changed files with 9 additions and 8 deletions

View File

@@ -46,7 +46,7 @@ class DebugLogService : Service(), Logcat.Callback, Runnable {
}
override fun getApplicationContext(): Context {
return getContextWithLocale()
return VLCApplication.appContext
}
override fun onBind(intent: Intent): IBinder? {

View File

@@ -96,7 +96,7 @@ class MediaParsingService : Service(), DevicesDiscoveryCb, CoroutineScope, Lifec
}
override fun getApplicationContext(): Context {
return getContextWithLocale()
return VLCApplication.appContext
}
@SuppressLint("WakelockTimeout")

View File

@@ -448,7 +448,7 @@ class PlaybackService : MediaBrowserServiceCompat(), CoroutineScope, LifecycleOw
}
override fun getApplicationContext(): Context {
return getContextWithLocale()
return VLCApplication.appContext
}
override fun onCreate() {

View File

@@ -38,7 +38,7 @@ class PreviewVideoInputService : TvInputService(), CoroutineScope {
}
override fun getApplicationContext(): Context {
return getContextWithLocale()
return VLCApplication.appContext
}
private inner class PreviewSession(context: Context

View File

@@ -55,7 +55,7 @@ class RecommendationsService : IntentService("RecommendationService"), Coroutine
}
override fun getApplicationContext(): Context {
return getContextWithLocale()
return VLCApplication.appContext
}
override fun onCreate() {

View File

@@ -80,7 +80,7 @@ class StartActivity : FragmentActivity() {
}
override fun getApplicationContext(): Context {
return getContextWithLocale()
return VLCApplication.appContext
}
override fun onCreate(savedInstanceState: Bundle?) {

View File

@@ -9,6 +9,7 @@ import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.MainScope
import kotlinx.coroutines.cancel
import org.videolan.tools.KeyHelper
import org.videolan.vlc.VLCApplication
import org.videolan.vlc.gui.helpers.applyTheme
import org.videolan.vlc.util.Settings
import org.videolan.vlc.util.getContextWithLocale
@@ -29,7 +30,7 @@ open class BaseActivity : AppCompatActivity(), CoroutineScope by MainScope() {
}
override fun getApplicationContext(): Context {
return getContextWithLocale()
return VLCApplication.appContext
}
override fun onKeyDown(keyCode: Int, event: KeyEvent): Boolean {

View File

@@ -61,7 +61,7 @@ abstract class BaseTvActivity : FragmentActivity(), CoroutineScope by MainScope(
}
override fun getApplicationContext(): Context {
return getContextWithLocale()
return VLCApplication.appContext
}
override fun onCreate(savedInstanceState: Bundle?) {