-
-
Notifications
You must be signed in to change notification settings - Fork 435
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace Android thread id with kernel thread id in span data (#3706)
* renamed IMainThreadChecker to IThreadChecker * added getCurrentThreadId() to IThreadChecker * replaced thread id of SentryTracer and PerformanceAndroidEventProcessor * removed useless deprecated SentryOptions.get/setMainThreadChecker() method
- Loading branch information
1 parent
8bab428
commit 61a31d5
Showing
38 changed files
with
167 additions
and
132 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,7 +11,7 @@ import io.sentry.SentryEvent | |
import io.sentry.SentryIntegrationPackageStorage | ||
import io.sentry.TypeCheckHint.ANDROID_ACTIVITY | ||
import io.sentry.protocol.SentryException | ||
import io.sentry.util.thread.IMainThreadChecker | ||
import io.sentry.util.thread.IThreadChecker | ||
import org.junit.runner.RunWith | ||
import org.mockito.kotlin.any | ||
import org.mockito.kotlin.mock | ||
|
@@ -35,7 +35,7 @@ class ScreenshotEventProcessorTest { | |
val window = mock<Window>() | ||
val view = mock<View>() | ||
val rootView = mock<View>() | ||
val mainThreadChecker = mock<IMainThreadChecker>() | ||
val threadChecker = mock<IThreadChecker>() | ||
val options = SentryAndroidOptions().apply { | ||
dsn = "https://[email protected]/proj" | ||
} | ||
|
@@ -52,12 +52,12 @@ class ScreenshotEventProcessorTest { | |
it.getArgument<Runnable>(0).run() | ||
} | ||
|
||
whenever(mainThreadChecker.isMainThread).thenReturn(true) | ||
whenever(threadChecker.isMainThread).thenReturn(true) | ||
} | ||
|
||
fun getSut(attachScreenshot: Boolean = false): ScreenshotEventProcessor { | ||
options.isAttachScreenshot = attachScreenshot | ||
options.mainThreadChecker = mainThreadChecker | ||
options.threadChecker = threadChecker | ||
|
||
return ScreenshotEventProcessor(options, buildInfo) | ||
} | ||
|
@@ -172,7 +172,7 @@ class ScreenshotEventProcessorTest { | |
@Test | ||
fun `when screenshot event processor is called from background thread it executes on main thread`() { | ||
val sut = fixture.getSut(true) | ||
whenever(fixture.mainThreadChecker.isMainThread).thenReturn(false) | ||
whenever(fixture.threadChecker.isMainThread).thenReturn(false) | ||
|
||
CurrentActivityHolder.getInstance().setActivity(fixture.activity) | ||
|
||
|
Oops, something went wrong.