Skip to content

Commit 0e43b45

Browse files
Merge pull request #3057 from DataDog/aleksandr-gringauz/merge-app-launch-to-profiling
Merge app launch into perfetto profiling branch
2 parents 0342fdd + e03c887 commit 0e43b45

File tree

82 files changed

+3369
-272
lines changed

Some content is hidden

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

82 files changed

+3369
-272
lines changed

CHANGELOG.md

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,24 @@
1-
# 3.3.0 / 2025-11-18
1+
# 3.4.0 / 2025-12-11
2+
3+
* [FEATURE] State change notification for flags client. See [#3025](https://github.com/DataDog/dd-sdk-android/pull/3025)
4+
* [BUGFIX] Fix crash in `KronosTimeProvider`. See [#3014](https://github.com/DataDog/dd-sdk-android/pull/3014)
5+
* [BUGFIX] Fix RUM resource duration breakdown. See [#3010](https://github.com/DataDog/dd-sdk-android/pull/3010)
6+
* [BUGFIX] Handle potential `StackOverflowError`. See [#2990](https://github.com/DataDog/dd-sdk-android/pull/2990)
7+
* [IMPROVEMENT] Send text truncation mode in Session Replay. See [#2978](https://github.com/DataDog/dd-sdk-android/pull/2978)
8+
* [IMPROVEMENT] Support svgs with `navigation3`. See [#3027](https://github.com/DataDog/dd-sdk-android/pull/3027)
9+
* [IMPROVEMENT] Support content scaling in Jetpack Compose. See [#3035](https://github.com/DataDog/dd-sdk-android/pull/3035)
10+
* [IMPROVEMENT] Support non-ASCII GraphQL headers. See [#3041](https://github.com/DataDog/dd-sdk-android/pull/3041)
11+
* [IMPROVEMENT] Add service name to `ddtags` of `LogEvent`. See [#3006](https://github.com/DataDog/dd-sdk-android/pull/3006)
12+
* [IMPROVEMENT] Add `versionCode` and `buildId` in more places. See [#3007](https://github.com/DataDog/dd-sdk-android/pull/3007)
13+
* [IMPROVEMENT] Add `anonymousId` to the empty `UserInfo` object check. See [#3012](https://github.com/DataDog/dd-sdk-android/pull/3012)
14+
* [IMPROVEMENT] Override Metrics telemetry sample rate. See [#3022](https://github.com/DataDog/dd-sdk-android/pull/3022)
15+
* [IMPROVEMENT] Stop using process importance when distinguishing between cold and warm launches. See [#3030](https://github.com/DataDog/dd-sdk-android/pull/3030)
16+
* [MAINTENANCE] Merge `release/3.3.0` into `develop`. See [#3016](https://github.com/DataDog/dd-sdk-android/pull/3016)
17+
* [MAINTENANCE] Remove `resolveMeta` & `resolveMetrics` methods in tests. See [#3005](https://github.com/DataDog/dd-sdk-android/pull/3005)
18+
* [MAINTENANCE] Revive Session Replay instrumentation tests. See [#2965](https://github.com/DataDog/dd-sdk-android/pull/2965)
19+
* [MAINTENANCE] Next dev iteration. See [#3009](https://github.com/DataDog/dd-sdk-android/pull/3009)
220

3-
## What's Changed
21+
# 3.3.0 / 2025-11-18
422

523
* [FEATURE] Feature flags. See [#2982](https://github.com/DataDog/dd-sdk-android/pull/2982) and [#2879](https://github.com/DataDog/dd-sdk-android/pull/2879)
624
* [FEATURE] Feature flags: Apply readme suggestions. See [#2988](https://github.com/DataDog/dd-sdk-android/pull/2988)

buildSrc/src/main/kotlin/com/datadog/gradle/config/AndroidConfig.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ object AndroidConfig {
2020
const val MIN_SDK_FOR_AUTO = 29
2121
const val BUILD_TOOLS_VERSION = "36.0.0"
2222

23-
val VERSION = Version(3, 4, 0, Version.Type.Snapshot)
23+
val VERSION = Version(3, 5, 0, Version.Type.Snapshot)
2424
}
2525

2626
// TODO RUM-628 Switch to Java 17 bytecode

dd-sdk-android-core/api/apiSurface

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ interface com.datadog.android.core.InternalSdkCore : com.datadog.android.api.fea
203203
val lastViewEvent: com.google.gson.JsonObject?
204204
val lastFatalAnrSent: Long?
205205
val appStartTimeNs: Long
206+
val appUptimeNs: Long
206207
fun writeLastViewEvent(ByteArray)
207208
fun deleteLastViewEvent()
208209
fun writeLastFatalAnrSent(Long)

dd-sdk-android-core/api/dd-sdk-android-core.api

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -599,6 +599,7 @@ public abstract interface class com/datadog/android/core/InternalSdkCore : com/d
599599
public abstract fun deleteLastViewEvent ()V
600600
public abstract fun getAllFeatures ()Ljava/util/List;
601601
public abstract fun getAppStartTimeNs ()J
602+
public abstract fun getAppUptimeNs ()J
602603
public abstract fun getDatadogContext (Ljava/util/Set;)Lcom/datadog/android/api/context/DatadogContext;
603604
public abstract fun getFirstPartyHostResolver ()Lcom/datadog/android/core/internal/net/FirstPartyHostHeaderTypeResolver;
604605
public abstract fun getLastFatalAnrSent ()Ljava/lang/Long;

dd-sdk-android-core/src/main/kotlin/com/datadog/android/api/context/TimeInfo.kt

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,8 @@ data class TimeInfo(
2020
val serverTimeNs: Long,
2121
val serverTimeOffsetNs: Long,
2222
val serverTimeOffsetMs: Long
23-
)
23+
) {
24+
internal companion object {
25+
internal val EMPTY = TimeInfo(0, 0, 0, 0)
26+
}
27+
}

dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/InternalSdkCore.kt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,15 @@ interface InternalSdkCore : FeatureSdkCore {
7878
@InternalApi
7979
val appStartTimeNs: Long
8080

81+
/**
82+
* Provide the time since the application started in nanoseconds from device boot, or our best guess
83+
* if the actual start time is not available. Note: since the implementation may rely on [System.nanoTime],
84+
* this property can only be used to measure elapsed time and is not related to any other notion of system
85+
* or wall-clock time. The value is the time since VM start.
86+
*/
87+
@InternalApi
88+
val appUptimeNs: Long
89+
8190
/**
8291
* Writes current RUM view event to the dedicated file for the needs of NDK crash reporting.
8392
*

dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/constraints/DatadogDataConstraints.kt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -214,8 +214,7 @@ class DatadogDataConstraints(private val internalLogger: InternalLogger) : DataC
214214
private val reservedTagKeys = setOf(
215215
"host",
216216
"device",
217-
"source",
218-
"service"
217+
"source"
219218
)
220219
}
221220
}

dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/internal/CoreFeature.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,9 @@ internal class CoreFeature(
210210
internal val appStartTimeNs: Long
211211
get() = appStartTimeProvider.appStartTimeNs
212212

213+
internal val appUptimeNs: Long
214+
get() = appStartTimeProvider.appUptimeNs
215+
213216
// lazy here on purpose: we need to read it only once, even if it is used in different features
214217
@get:WorkerThread
215218
internal val lastViewEvent: JsonObject? by lazy {

dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/internal/DatadogContextProvider.kt

Lines changed: 2 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ import com.datadog.android.api.context.DatadogContext
1010
import com.datadog.android.api.context.DeviceInfo
1111
import com.datadog.android.api.context.LocaleInfo
1212
import com.datadog.android.api.context.ProcessInfo
13-
import com.datadog.android.api.context.TimeInfo
14-
import java.util.concurrent.TimeUnit
13+
import com.datadog.android.core.internal.time.composeTimeInfo
1514

1615
internal class DatadogContextProvider(
1716
private val coreFeature: CoreFeature,
@@ -31,17 +30,7 @@ internal class DatadogContextProvider(
3130
variant = coreFeature.variant,
3231
sdkVersion = coreFeature.sdkVersion,
3332
source = coreFeature.sourceName,
34-
time = with(coreFeature.timeProvider) {
35-
val deviceTimeMs = getDeviceTimestamp()
36-
val serverTimeMs = getServerTimestamp()
37-
TimeInfo(
38-
deviceTimeNs = TimeUnit.MILLISECONDS.toNanos(deviceTimeMs),
39-
serverTimeNs = TimeUnit.MILLISECONDS.toNanos(serverTimeMs),
40-
serverTimeOffsetNs = TimeUnit.MILLISECONDS
41-
.toNanos(serverTimeMs - deviceTimeMs),
42-
serverTimeOffsetMs = serverTimeMs - deviceTimeMs
43-
)
44-
},
33+
time = coreFeature.timeProvider.composeTimeInfo(),
4534
processInfo = ProcessInfo(
4635
isMainProcess = coreFeature.isMainProcess
4736
),

dd-sdk-android-core/src/main/kotlin/com/datadog/android/core/internal/DatadogCore.kt

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import com.datadog.android.core.internal.logger.SdkInternalLogger
3434
import com.datadog.android.core.internal.net.FirstPartyHostHeaderTypeResolver
3535
import com.datadog.android.core.internal.system.BuildSdkVersionProvider
3636
import com.datadog.android.core.internal.time.DefaultAppStartTimeProvider
37+
import com.datadog.android.core.internal.time.composeTimeInfo
3738
import com.datadog.android.core.internal.utils.executeSafe
3839
import com.datadog.android.core.internal.utils.getSafe
3940
import com.datadog.android.core.internal.utils.scheduleSafe
@@ -100,17 +101,7 @@ internal class DatadogCore(
100101
/** @inheritDoc */
101102
override val time: TimeInfo
102103
get() {
103-
return with(coreFeature.timeProvider) {
104-
val deviceTimeMs = getDeviceTimestamp()
105-
val serverTimeMs = getServerTimestamp()
106-
TimeInfo(
107-
deviceTimeNs = TimeUnit.MILLISECONDS.toNanos(deviceTimeMs),
108-
serverTimeNs = TimeUnit.MILLISECONDS.toNanos(serverTimeMs),
109-
serverTimeOffsetNs = TimeUnit.MILLISECONDS
110-
.toNanos(serverTimeMs - deviceTimeMs),
111-
serverTimeOffsetMs = serverTimeMs - deviceTimeMs
112-
)
113-
}
104+
return coreFeature.timeProvider.composeTimeInfo()
114105
}
115106

116107
/** @inheritDoc */
@@ -387,6 +378,9 @@ internal class DatadogCore(
387378
override val appStartTimeNs: Long
388379
get() = coreFeature.appStartTimeNs
389380

381+
override val appUptimeNs: Long
382+
get() = coreFeature.appUptimeNs
383+
390384
@WorkerThread
391385
override fun writeLastViewEvent(data: ByteArray) {
392386
// we need to write it only if we are going to read ApplicationExitInfo (available on

0 commit comments

Comments
 (0)