Browse Source

Revert "Notifications from lock screen - initial attempt to fix the issue"

This reverts commit ce8bec73

Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Dariusz Olszewski 3 years ago
parent
commit
b10d0cb98a

+ 0 - 8
app/src/main/java/com/nextcloud/talk/activities/MainActivity.kt

@@ -87,8 +87,6 @@ class MainActivity : BaseActivity(), ActionBarProvider {
 
 
     private var router: Router? = null
     private var router: Router? = null
 
 
-    var ignoreNextDetach: Boolean = false
-
     override fun onCreate(savedInstanceState: Bundle?) {
     override fun onCreate(savedInstanceState: Bundle?) {
         Log.d(TAG, "onCreate: Activity: " + System.identityHashCode(this).toString())
         Log.d(TAG, "onCreate: Activity: " + System.identityHashCode(this).toString())
 
 
@@ -180,10 +178,6 @@ class MainActivity : BaseActivity(), ActionBarProvider {
     override fun onResume() {
     override fun onResume() {
         Log.d(TAG, "onResume: Activity: " + System.identityHashCode(this).toString())
         Log.d(TAG, "onResume: Activity: " + System.identityHashCode(this).toString())
         super.onResume()
         super.onResume()
-        if (hasWindowFocus()) {
-            Log.d(TAG, "onResume: clear ignoreNextDetach")
-            ignoreNextDetach = false
-        }
     }
     }
 
 
     override fun onPause() {
     override fun onPause() {
@@ -352,8 +346,6 @@ class MainActivity : BaseActivity(), ActionBarProvider {
                 intent.extras?.let { callNotificationIntent.putExtras(it) }
                 intent.extras?.let { callNotificationIntent.putExtras(it) }
                 startActivity(callNotificationIntent)
                 startActivity(callNotificationIntent)
             } else {
             } else {
-                Log.d(TAG, "onNewIntent set ignoreNextDetach")
-                ignoreNextDetach = true
                 ConductorRemapping.remapChatController(
                 ConductorRemapping.remapChatController(
                     router!!, intent.getLongExtra(BundleKeys.KEY_INTERNAL_USER_ID, -1),
                     router!!, intent.getLongExtra(BundleKeys.KEY_INTERNAL_USER_ID, -1),
                     intent.getStringExtra(KEY_ROOM_TOKEN)!!, intent.extras!!, false
                     intent.getStringExtra(KEY_ROOM_TOKEN)!!, intent.extras!!, false

+ 3 - 10
app/src/main/java/com/nextcloud/talk/controllers/ChatController.kt

@@ -1594,16 +1594,9 @@ class ChatController(args: Bundle) :
             !ApplicationWideCurrentRoomHolder.getInstance().isInCall &&
             !ApplicationWideCurrentRoomHolder.getInstance().isInCall &&
             !ApplicationWideCurrentRoomHolder.getInstance().isDialing
             !ApplicationWideCurrentRoomHolder.getInstance().isDialing
         ) {
         ) {
-            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()
-            }
+            ApplicationWideCurrentRoomHolder.getInstance().clear()
+            wasDetached = true
+            leaveRoom()
         }
         }
 
 
         if (mentionAutocomplete != null && mentionAutocomplete!!.isPopupShowing) {
         if (mentionAutocomplete != null && mentionAutocomplete!!.isPopupShowing) {