mirror of
https://github.com/nextcloud/talk-android
synced 2025-06-20 03:59:35 +01:00
Notifications from lock screen - initial attempt to fix the issue
Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
This commit is contained in:
parent
be6e5d78cb
commit
dfa14e7c52
@ -87,6 +87,8 @@ class MainActivity : BaseActivity(), ActionBarProvider {
|
||||
|
||||
private var router: Router? = null
|
||||
|
||||
var ignoreNextDetach: Boolean = false
|
||||
|
||||
override fun onCreate(savedInstanceState: Bundle?) {
|
||||
Log.d(TAG, "onCreate: Activity: " + System.identityHashCode(this).toString())
|
||||
|
||||
@ -178,6 +180,10 @@ class MainActivity : BaseActivity(), ActionBarProvider {
|
||||
override fun onResume() {
|
||||
Log.d(TAG, "onResume: Activity: " + System.identityHashCode(this).toString())
|
||||
super.onResume()
|
||||
if (hasWindowFocus()) {
|
||||
Log.d(TAG, "onResume: clear ignoreNextDetach")
|
||||
ignoreNextDetach = false
|
||||
}
|
||||
}
|
||||
|
||||
override fun onPause() {
|
||||
@ -346,6 +352,8 @@ class MainActivity : BaseActivity(), ActionBarProvider {
|
||||
intent.extras?.let { callNotificationIntent.putExtras(it) }
|
||||
startActivity(callNotificationIntent)
|
||||
} else {
|
||||
Log.d(TAG, "onNewIntent set ignoreNextDetach")
|
||||
ignoreNextDetach = true
|
||||
ConductorRemapping.remapChatController(
|
||||
router!!, intent.getLongExtra(BundleKeys.KEY_INTERNAL_USER_ID, -1),
|
||||
intent.getStringExtra(KEY_ROOM_TOKEN)!!, intent.extras!!, false
|
||||
|
@ -1594,9 +1594,16 @@ class ChatController(args: Bundle) :
|
||||
!ApplicationWideCurrentRoomHolder.getInstance().isInCall &&
|
||||
!ApplicationWideCurrentRoomHolder.getInstance().isDialing
|
||||
) {
|
||||
ApplicationWideCurrentRoomHolder.getInstance().clear()
|
||||
wasDetached = true
|
||||
leaveRoom()
|
||||
val mainActivity = activity as MainActivity
|
||||
if (mainActivity.ignoreNextDetach) {
|
||||
Log.d(TAG, "onDetach: ignoring Detach event Controller: " + System.identityHashCode(this).toString() +
|
||||
" Activity: " + System.identityHashCode(activity).toString())
|
||||
mainActivity.ignoreNextDetach = false
|
||||
} else {
|
||||
ApplicationWideCurrentRoomHolder.getInstance().clear()
|
||||
wasDetached = true
|
||||
leaveRoom()
|
||||
}
|
||||
}
|
||||
|
||||
if (mentionAutocomplete != null && mentionAutocomplete!!.isPopupShowing) {
|
||||
|
Loading…
Reference in New Issue
Block a user