Skip to content

Commit d84e7a3

Browse files
authored
Merge pull request #2210 from bugsnag/release/v6.15.0
Release v6.15.0
2 parents 6b35e65 + 0202c18 commit d84e7a3

51 files changed

Lines changed: 1072 additions & 280 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ jobs:
6464

6565
# Initializes the CodeQL tools for scanning.
6666
- name: Initialize CodeQL
67-
uses: github/codeql-action/init@28deaeda66b76a05916b6923827895f2b14ab387 #v3.28.16
67+
uses: github/codeql-action/init@181d5eefc20863364f96762470ba6f862bdef56b #v3.29.2
6868
with:
6969
languages: ${{ matrix.language }}
7070
# If you wish to specify custom queries, you can do so here or in a config file.
@@ -83,6 +83,6 @@ jobs:
8383
./gradlew --no-daemon assemble
8484
8585
- name: Perform CodeQL Analysis
86-
uses: github/codeql-action/analyze@28deaeda66b76a05916b6923827895f2b14ab387 #v3.28.16
86+
uses: github/codeql-action/analyze@181d5eefc20863364f96762470ba6f862bdef56b #v3.29.2
8787
with:
8888
category: "/language:${{matrix.language}}"

.github/workflows/scorecard.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ jobs:
3737
persist-credentials: false
3838

3939
- name: "Run analysis"
40-
uses: ossf/scorecard-action@f49aabe0b5af0936a0987cfb85d86b75731b0186 # v2.4.1
40+
uses: ossf/scorecard-action@05b42c624433fc40578a4040d5cf5e36ddca8cde # v2.4.2
4141
with:
4242
results_file: results.sarif
4343
results_format: sarif
@@ -68,7 +68,7 @@ jobs:
6868
# Upload the results to GitHub's code scanning dashboard (optional).
6969
# Commenting out will disable upload of results to your repo's Code Scanning dashboard
7070
- name: "Upload to code-scanning"
71-
uses: github/codeql-action/upload-sarif@28deaeda66b76a05916b6923827895f2b14ab387 # v3.28.16
71+
uses: github/codeql-action/upload-sarif@181d5eefc20863364f96762470ba6f862bdef56b # v3.29.2
7272
with:
7373
sarif_file: results.sarif
7474

@@ -77,4 +77,4 @@ jobs:
7777
runs-on: ubuntu-latest
7878
steps:
7979
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
80-
- uses: gradle/actions/wrapper-validation@06832c7b30a0129d7fb559bcc6e43d26f6374244 # v4.3.1
80+
- uses: gradle/actions/wrapper-validation@ac638b010cf58a27ee6c972d7336334ccaf61c96 # v4.4.1

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## 6.15.0 (2025-07-07)
4+
5+
### Enhancements
6+
7+
* `bugsnag-plugin-android-ndk` no longer exports the `Java_` JNI functions, and instead uses the JNI `RegisterNatives` API to register the native methods.
8+
[#2205](https://github.com/bugsnag/bugsnag-android/pull/2205)
9+
10+
### Bug fixes
11+
12+
* The `bugsnag-plugin-android-exitinfo` plugin now calls `setProcessState` (if configured) on a background thread and swallows any rate-limiting errors, so that it does not block the main thread during startup
13+
[#2197](https://github.com/bugsnag/bugsnag-android/pull/2197)
14+
* Improve the scoping of the build-id capturing in `bugsnag-plugin-android-ndk` to more reliably capture the build-id from the correct `.so` file
15+
[#2203](https://github.com/bugsnag/bugsnag-android/pull/2203)
16+
* Fixed a background ANR that could occur during startup if processes do not launch or run quickly enough
17+
[#2202](https://github.com/bugsnag/bugsnag-android/pull/2202)
18+
319
## 6.14.0 (2025-06-04)
420

521
### Enhancements

bugsnag-android-core/detekt-baseline.xml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<ID>CyclomaticComplexMethod:ConfigInternal.kt$ConfigInternal$fun getConfigDifferences(): Map&lt;String, Any></ID>
77
<ID>ImplicitDefaultLocale:Deliverable.kt$Deliverable$String.format("%02x", byte)</ID>
88
<ID>LongParameterList:App.kt$App$( /** * The architecture of the running application binary */ var binaryArch: String?, /** * The package name of the application */ var id: String?, /** * The release stage set in [Configuration.releaseStage] */ var releaseStage: String?, /** * The version of the application set in [Configuration.version] */ var version: String?, /** The revision ID from the manifest (React Native apps only) */ var codeBundleId: String?, /** * The unique identifier for the build of the application set in [Configuration.buildUuid] */ buildUuid: Provider&lt;String?>?, /** * The application type set in [Configuration#version] */ var type: String?, /** * The version code of the application set in [Configuration.versionCode] */ var versionCode: Number? )</ID>
9-
<ID>LongParameterList:AppDataCollector.kt$AppDataCollector$( appContext: Context, private val packageManager: PackageManager?, private val config: ImmutableConfig, private val sessionTracker: SessionTracker, private val activityManager: ActivityManager?, private val launchCrashTracker: LaunchCrashTracker, private val memoryTrimState: MemoryTrimState )</ID>
9+
<ID>LongParameterList:AppDataCollector.kt$AppDataCollector$( appContext: Context, private val packageManager: PackageManager?, private val config: ImmutableConfig, private val sessionTracker: Provider&lt;SessionTracker>, private val activityManager: ActivityManager?, private val launchCrashTracker: LaunchCrashTracker, private val memoryTrimState: MemoryTrimState )</ID>
1010
<ID>LongParameterList:AppWithState.kt$AppWithState$( binaryArch: String?, id: String?, releaseStage: String?, version: String?, codeBundleId: String?, buildUuid: Provider&lt;String?>?, type: String?, versionCode: Number?, /** * The number of milliseconds the application was running before the event occurred */ var duration: Number?, /** * The number of milliseconds the application was running in the foreground before the * event occurred */ var durationInForeground: Number?, /** * Whether the application was in the foreground when the event occurred */ var inForeground: Boolean?, /** * Whether the application was launching when the event occurred */ var isLaunching: Boolean? )</ID>
1111
<ID>LongParameterList:AppWithState.kt$AppWithState$( binaryArch: String?, id: String?, releaseStage: String?, version: String?, codeBundleId: String?, buildUuid: String?, type: String?, versionCode: Number?, /** * The number of milliseconds the application was running before the event occurred */ duration: Number?, /** * The number of milliseconds the application was running in the foreground before the * event occurred */ durationInForeground: Number?, /** * Whether the application was in the foreground when the event occurred */ inForeground: Boolean?, /** * Whether the application was launching when the event occurred */ isLaunching: Boolean? )</ID>
1212
<ID>LongParameterList:AppWithState.kt$AppWithState$( config: ImmutableConfig, binaryArch: String?, id: String?, releaseStage: String?, version: String?, codeBundleId: String?, duration: Number?, durationInForeground: Number?, inForeground: Boolean?, isLaunching: Boolean? )</ID>
@@ -61,6 +61,7 @@
6161
<ID>SwallowedException:ForegroundDetector.kt$ForegroundDetector$e: Exception</ID>
6262
<ID>SwallowedException:JsonHelperTest.kt$JsonHelperTest$e: IllegalArgumentException</ID>
6363
<ID>SwallowedException:PluginClient.kt$PluginClient$exc: ClassNotFoundException</ID>
64+
<ID>SwallowedException:RootDetector.kt$RootDetector$ex: IllegalThreadStateException</ID>
6465
<ID>SwallowedException:SharedPrefMigrator.kt$SharedPrefMigrator$e: RuntimeException</ID>
6566
<ID>ThrowsCount:JsonHelper.kt$JsonHelper$fun jsonToLong(value: Any?): Long?</ID>
6667
<ID>TooManyFunctions:ConfigInternal.kt$ConfigInternal : CallbackAwareMetadataAwareUserAwareFeatureFlagAware</ID>

bugsnag-android-core/src/androidTest/java/com/bugsnag/android/AppDataCollectorForegroundTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.bugsnag.android
22

33
import android.content.Context
44
import android.os.SystemClock
5+
import com.bugsnag.android.internal.dag.ValueProvider
56
import org.junit.Assert.assertEquals
67
import org.junit.Assert.assertTrue
78
import org.junit.Before
@@ -41,7 +42,7 @@ class AppDataCollectorForegroundTest {
4142
appContext,
4243
null,
4344
config,
44-
sessionTracker,
45+
ValueProvider(sessionTracker),
4546
null,
4647
launchCrashTracker,
4748
memoryTrimState

bugsnag-android-core/src/androidTest/java/com/bugsnag/android/AppDataCollectorTest.kt

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import android.content.pm.PackageManager
66
import android.os.Build
77
import android.os.Process
88
import androidx.test.core.app.ApplicationProvider
9+
import com.bugsnag.android.internal.dag.ValueProvider
910
import org.junit.Assert.assertEquals
1011
import org.junit.Assert.assertNull
1112
import org.junit.Assert.assertTrue
@@ -49,7 +50,7 @@ class AppDataCollectorTest {
4950
context,
5051
context.packageManager,
5152
client.immutableConfig,
52-
client.sessionTracker,
53+
ValueProvider(client.sessionTracker),
5354
am,
5455
client.launchCrashTracker,
5556
client.memoryTrimState
@@ -70,7 +71,7 @@ class AppDataCollectorTest {
7071
context,
7172
context.packageManager,
7273
client.immutableConfig,
73-
client.sessionTracker,
74+
ValueProvider(client.sessionTracker),
7475
am,
7576
client.launchCrashTracker,
7677
client.memoryTrimState
@@ -93,7 +94,7 @@ class AppDataCollectorTest {
9394
context,
9495
context.packageManager,
9596
client.immutableConfig,
96-
client.sessionTracker,
97+
ValueProvider(client.sessionTracker),
9798
am,
9899
client.launchCrashTracker,
99100
client.memoryTrimState
@@ -115,7 +116,7 @@ class AppDataCollectorTest {
115116
context,
116117
packageManager,
117118
client.immutableConfig,
118-
client.sessionTracker,
119+
ValueProvider(client.sessionTracker),
119120
am,
120121
client.launchCrashTracker,
121122
client.memoryTrimState
@@ -144,7 +145,7 @@ class AppDataCollectorTest {
144145
context,
145146
packageManager,
146147
client.immutableConfig,
147-
client.sessionTracker,
148+
ValueProvider(client.sessionTracker),
148149
am,
149150
client.launchCrashTracker,
150151
client.memoryTrimState
@@ -171,7 +172,7 @@ class AppDataCollectorTest {
171172
context,
172173
packageManager,
173174
client.immutableConfig,
174-
client.sessionTracker,
175+
ValueProvider(client.sessionTracker),
175176
am,
176177
client.launchCrashTracker,
177178
client.memoryTrimState
@@ -198,7 +199,7 @@ class AppDataCollectorTest {
198199
context,
199200
packageManager,
200201
client.immutableConfig,
201-
client.sessionTracker,
202+
ValueProvider(client.sessionTracker),
202203
am,
203204
client.launchCrashTracker,
204205
client.memoryTrimState

bugsnag-android-core/src/androidTest/java/com/bugsnag/android/FileStoreTest.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.bugsnag.android
22

33
import android.app.Application
44
import androidx.test.core.app.ApplicationProvider
5+
import com.bugsnag.android.internal.dag.ValueProvider
56
import org.junit.Assert.assertEquals
67
import org.junit.Test
78
import org.junit.runner.RunWith
@@ -48,6 +49,6 @@ internal class CustomFileStore(
4849
folder: File,
4950
maxStoreCount: Int,
5051
delegate: Delegate?
51-
) : FileStore(folder, maxStoreCount, NoopLogger, delegate) {
52+
) : FileStore(folder, maxStoreCount, NoopLogger, ValueProvider(delegate)) {
5253
override fun getFilename(obj: Any?) = "foo.json"
5354
}

bugsnag-android-core/src/main/java/com/bugsnag/android/AppDataCollector.kt

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ import android.os.Build.VERSION_CODES
2424
import android.os.Process
2525
import android.os.SystemClock
2626
import com.bugsnag.android.internal.ImmutableConfig
27+
import com.bugsnag.android.internal.dag.Provider
2728

2829
/**
2930
* Collects various data on the application state
@@ -32,7 +33,7 @@ internal class AppDataCollector(
3233
appContext: Context,
3334
private val packageManager: PackageManager?,
3435
private val config: ImmutableConfig,
35-
private val sessionTracker: SessionTracker,
36+
private val sessionTracker: Provider<SessionTracker>,
3637
private val activityManager: ActivityManager?,
3738
private val launchCrashTracker: LaunchCrashTracker,
3839
private val memoryTrimState: MemoryTrimState
@@ -54,7 +55,7 @@ internal class AppDataCollector(
5455
App(config, binaryArch, packageName, releaseStage, versionName, codeBundleId)
5556

5657
fun generateAppWithState(): AppWithState {
57-
val inForeground = sessionTracker.isInForeground
58+
val inForeground = sessionTracker.get().isInForeground
5859
val durationInForeground = calculateDurationInForeground(inForeground)
5960

6061
return AppWithState(
@@ -118,7 +119,7 @@ internal class AppDataCollector(
118119
fun getAppDataMetadata(): MutableMap<String, Any?> {
119120
val map = HashMap<String, Any?>()
120121
map["name"] = appName
121-
map["activeScreen"] = sessionTracker.contextActivity
122+
map["activeScreen"] = sessionTracker.get().contextActivity
122123
map["lowMemory"] = memoryTrimState.isLowMemory
123124
map["memoryTrimLevel"] = memoryTrimState.trimLevelDescription
124125
map["processImportance"] = getProcessImportance()
@@ -168,15 +169,15 @@ internal class AppDataCollector(
168169
*
169170
* @return the duration in ms
170171
*/
171-
internal fun calculateDurationInForeground(inForeground: Boolean? = sessionTracker.isInForeground): Long? {
172+
internal fun calculateDurationInForeground(inForeground: Boolean? = sessionTracker.get().isInForeground): Long? {
172173
if (inForeground == null) {
173174
return null
174175
}
175176

176177
val nowMs = SystemClock.elapsedRealtime()
177178
var durationMs: Long = 0
178179

179-
val sessionStartTimeMs: Long = sessionTracker.lastEnteredForegroundMs
180+
val sessionStartTimeMs: Long = sessionTracker.get().lastEnteredForegroundMs
180181

181182
if (inForeground && sessionStartTimeMs != 0L) {
182183
durationMs = nowMs - sessionStartTimeMs

bugsnag-android-core/src/main/java/com/bugsnag/android/DataCollectionModule.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ internal class DataCollectionModule(
3434
ctx,
3535
ctx.packageManager,
3636
cfg,
37-
trackerModule.sessionTracker.get(),
37+
trackerModule.sessionTracker,
3838
systemServiceModule.activityManager,
3939
trackerModule.launchCrashTracker,
4040
memoryTrimState

bugsnag-android-core/src/main/java/com/bugsnag/android/EventStorageModule.kt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ internal class EventStorageModule(
2929
cfg.logger,
3030
cfg,
3131
systemServiceModule.storageManager,
32-
dataCollectionModule.appDataCollector.get(),
32+
dataCollectionModule.appDataCollector,
3333
dataCollectionModule.deviceDataCollector,
34-
trackerModule.sessionTracker.get(),
34+
trackerModule.sessionTracker,
3535
notifier,
3636
bgTaskService
3737
) else null
@@ -43,7 +43,7 @@ internal class EventStorageModule(
4343
cfg.logger,
4444
notifier,
4545
bgTaskService,
46-
delegate.getOrNull(),
46+
delegate,
4747
callbackState
4848
)
4949
}

0 commit comments

Comments
 (0)