Эх сурвалжийг харах

Additional logging to diagnose opening chat view from notification

Signed-off-by: Dariusz Olszewski <starypatyk@users.noreply.github.com>
Dariusz Olszewski 3 жил өмнө
parent
commit
be6e5d78cb

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

@@ -29,6 +29,7 @@ import android.os.Build
 import android.os.Bundle
 import android.os.Bundle
 import android.provider.ContactsContract
 import android.provider.ContactsContract
 import android.text.TextUtils
 import android.text.TextUtils
+import android.util.Log
 import androidx.annotation.RequiresApi
 import androidx.annotation.RequiresApi
 import autodagger.AutoInjector
 import autodagger.AutoInjector
 import com.bluelinelabs.conductor.Conductor
 import com.bluelinelabs.conductor.Conductor
@@ -87,6 +88,8 @@ class MainActivity : BaseActivity(), ActionBarProvider {
     private var router: Router? = null
     private var router: Router? = null
 
 
     override fun onCreate(savedInstanceState: Bundle?) {
     override fun onCreate(savedInstanceState: Bundle?) {
+        Log.d(TAG, "onCreate: Activity: " + System.identityHashCode(this).toString())
+
         super.onCreate(savedInstanceState)
         super.onCreate(savedInstanceState)
         // Set the default theme to replace the launch screen theme.
         // Set the default theme to replace the launch screen theme.
         setTheme(R.style.AppTheme)
         setTheme(R.style.AppTheme)
@@ -162,6 +165,8 @@ class MainActivity : BaseActivity(), ActionBarProvider {
     }
     }
 
 
     override fun onStart() {
     override fun onStart() {
+        Log.d(TAG, "onStart: Activity: " + System.identityHashCode(this).toString())
+
         super.onStart()
         super.onStart()
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
         if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) {
             checkIfWeAreSecure()
             checkIfWeAreSecure()
@@ -170,6 +175,21 @@ class MainActivity : BaseActivity(), ActionBarProvider {
         handleActionFromContact(intent)
         handleActionFromContact(intent)
     }
     }
 
 
+    override fun onResume() {
+        Log.d(TAG, "onResume: Activity: " + System.identityHashCode(this).toString())
+        super.onResume()
+    }
+
+    override fun onPause() {
+        Log.d(TAG, "onPause: Activity: " + System.identityHashCode(this).toString())
+        super.onPause()
+    }
+
+    override fun onStop() {
+        Log.d(TAG, "onStop: Activity: " + System.identityHashCode(this).toString())
+        super.onStop()
+    }
+
     fun resetConversationsList() {
     fun resetConversationsList() {
         if (userUtils.anyUserExists()) {
         if (userUtils.anyUserExists()) {
             router!!.setRoot(
             router!!.setRoot(
@@ -317,6 +337,7 @@ class MainActivity : BaseActivity(), ActionBarProvider {
     }
     }
 
 
     override fun onNewIntent(intent: Intent) {
     override fun onNewIntent(intent: Intent) {
+        Log.d(TAG, "onNewIntent Activity: " + System.identityHashCode(this).toString())
         super.onNewIntent(intent)
         super.onNewIntent(intent)
         handleActionFromContact(intent)
         handleActionFromContact(intent)
         if (intent.hasExtra(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL)) {
         if (intent.hasExtra(BundleKeys.KEY_FROM_NOTIFICATION_START_CALL)) {

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

@@ -268,7 +268,7 @@ class ChatController(args: Bundle) :
     var currentlyPlayedVoiceMessage: ChatMessage? = null
     var currentlyPlayedVoiceMessage: ChatMessage? = null
 
 
     init {
     init {
-        Log.d(TAG, "init ChatController")
+        Log.d(TAG, "init ChatController: " + System.identityHashCode(this).toString())
 
 
         setHasOptionsMenu(true)
         setHasOptionsMenu(true)
         NextcloudTalkApplication.sharedApplication!!.componentApplication.inject(this)
         NextcloudTalkApplication.sharedApplication!!.componentApplication.inject(this)
@@ -440,6 +440,7 @@ class ChatController(args: Bundle) :
         .ROOM_TYPE_ONE_TO_ONE_CALL
         .ROOM_TYPE_ONE_TO_ONE_CALL
 
 
     override fun onViewBound(view: View) {
     override fun onViewBound(view: View) {
+        Log.d(TAG, "onViewBound: " + System.identityHashCode(this).toString())
         actionBar?.show()
         actionBar?.show()
         var adapterWasNull = false
         var adapterWasNull = false
 
 
@@ -1505,7 +1506,8 @@ class ChatController(args: Bundle) :
 
 
     override fun onAttach(view: View) {
     override fun onAttach(view: View) {
         super.onAttach(view)
         super.onAttach(view)
-        Log.d(TAG, "onAttach")
+        Log.d(TAG, "onAttach: Controller: " + System.identityHashCode(this).toString() +
+            " Activity: " + System.identityHashCode(activity).toString())
         eventBus?.register(this)
         eventBus?.register(this)
 
 
         if (conversationUser?.userId != "?" &&
         if (conversationUser?.userId != "?" &&
@@ -1577,7 +1579,9 @@ class ChatController(args: Bundle) :
 
 
     override fun onDetach(view: View) {
     override fun onDetach(view: View) {
         super.onDetach(view)
         super.onDetach(view)
-        Log.d(TAG, "onDetach")
+        Log.d(TAG, "onDetach: Controller: " + System.identityHashCode(this).toString() +
+            " Activity: " + System.identityHashCode(activity).toString())
+
         eventBus?.unregister(this)
         eventBus?.unregister(this)
 
 
         if (activity != null) {
         if (activity != null) {