Skip to content
Snippets Groups Projects
Commit 2872b261 authored by Pierre Nicolas's avatar Pierre Nicolas :joy:
Browse files

tv: call: fix incoming call

mSession is used through super.onViewCreated although is it not initialized

GitLab: #1337
Change-Id: Iabb62439bf1eaa1755a32611c313b203b8881776
parent 624d2370
No related branches found
No related tags found
No related merge requests found
...@@ -146,13 +146,13 @@ class TVCallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView ...@@ -146,13 +146,13 @@ class TVCallFragment : BaseSupportFragment<CallPresenter, CallView>(), CallView
} }
override fun onViewCreated(view: View, savedInstanceState: Bundle?) { override fun onViewCreated(view: View, savedInstanceState: Bundle?) {
super.onViewCreated(view, savedInstanceState)
Log.w(TAG, "onViewCreated"); Log.w(TAG, "onViewCreated");
mSession = MediaSessionCompat(requireContext(), TAG).apply { mSession = MediaSessionCompat(requireContext(), TAG).apply {
setMetadata(MediaMetadataCompat.Builder() setMetadata(MediaMetadataCompat.Builder()
.putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_TITLE, getString(R.string.pip_title)) .putString(MediaMetadataCompat.METADATA_KEY_DISPLAY_TITLE, getString(R.string.pip_title))
.build()) .build())
} }
super.onViewCreated(view, savedInstanceState)
val powerManager = requireContext().getSystemService(Context.POWER_SERVICE) as PowerManager val powerManager = requireContext().getSystemService(Context.POWER_SERVICE) as PowerManager
mScreenWakeLock = powerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK or PowerManager.ACQUIRE_CAUSES_WAKEUP or PowerManager.ON_AFTER_RELEASE, "ring:callLock") mScreenWakeLock = powerManager.newWakeLock(PowerManager.SCREEN_BRIGHT_WAKE_LOCK or PowerManager.ACQUIRE_CAUSES_WAKEUP or PowerManager.ON_AFTER_RELEASE, "ring:callLock")
.apply { setReferenceCounted(false) } .apply { setReferenceCounted(false) }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment