Skip to content

Commit

Permalink
Merge branch 'develop' into yl/merge-develop-into-release
Browse files Browse the repository at this point in the history
  • Loading branch information
ambushwork committed Oct 30, 2024
2 parents 2383221 + bcfc7e9 commit b2c9bae
Show file tree
Hide file tree
Showing 58 changed files with 793 additions and 111 deletions.
40 changes: 16 additions & 24 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ include:
# SETUP

variables:
CURRENT_CI_IMAGE: "13"
CI_IMAGE_DOCKER: 486234852809.dkr.ecr.us-east-1.amazonaws.com/ci/dd-sdk-android:$CURRENT_CI_IMAGE
CURRENT_CI_IMAGE: "14"
CI_IMAGE_DOCKER: registry.ddbuild.io/ci/dd-sdk-android:$CURRENT_CI_IMAGE
GIT_DEPTH: 5

DD_SERVICE: "dd-sdk-android"
Expand All @@ -32,16 +32,8 @@ stages:
- notify

.snippets:
install-android-sdk:
- curl -sSL -o commandlinetools.zip https://dl.google.com/android/repository/$ANDROID_SDK_VERSION.zip
- rm -rf ~/android_sdk
- rm -rf ~/cmdline-tools
- unzip -q commandlinetools -d ~/
- mkdir -p ~/android_sdk/cmdline-tools/latest
- mv ~/cmdline-tools/* ~/android_sdk/cmdline-tools/latest
- rm ./commandlinetools.zip
- export ANDROID_HOME="$HOME/android_sdk/"
- export ANDROID_SDK_ROOT="$HOME/android_sdk/"
# macOS AMI will already have cmdline-tools installed
install-android-api-components:
- echo y | ~/android_sdk/cmdline-tools/latest/bin/sdkmanager --install "emulator"
- echo y | ~/android_sdk/cmdline-tools/latest/bin/sdkmanager --install "platform-tools"
- echo y | ~/android_sdk/cmdline-tools/latest/bin/sdkmanager --install "$ANDROID_PLATFORM"
Expand Down Expand Up @@ -225,7 +217,7 @@ test:kover:
# the steps in this section should reflect our test pyramid strategy

test-pyramid:core-it-min-api:
tags: [ "macos:sonoma" ]
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
variables:
Expand All @@ -234,11 +226,11 @@ test-pyramid:core-it-min-api:
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
script:
- !reference [.snippets, install-android-sdk]
- !reference [.snippets, install-android-api-components]
- !reference [.snippets, run-core-it-instrumented]

test-pyramid:core-it-latest-api:
tags: [ "macos:sonoma" ]
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
variables:
Expand All @@ -247,11 +239,11 @@ test-pyramid:core-it-latest-api:
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
script:
- !reference [.snippets, install-android-sdk]
- !reference [.snippets, install-android-api-components]
- !reference [.snippets, run-core-it-instrumented]

test-pyramid:core-it-median-api:
tags: [ "macos:sonoma" ]
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
variables:
Expand All @@ -260,7 +252,7 @@ test-pyramid:core-it-median-api:
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
script:
- !reference [.snippets, install-android-sdk]
- !reference [.snippets, install-android-api-components]
- !reference [.snippets, run-core-it-instrumented]

test-pyramid:single-fit-logs:
Expand Down Expand Up @@ -329,7 +321,7 @@ test-pyramid:single-fit-trace:
# RUN INSTRUMENTED TESTS ON MIN API (21), LATEST API (34) and MEDIAN API (28)

test-pyramid:legacy-integration-instrumented-min-api:
tags: [ "macos:sonoma" ]
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
variables:
Expand All @@ -338,11 +330,11 @@ test-pyramid:legacy-integration-instrumented-min-api:
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
script:
- !reference [.snippets, install-android-sdk]
- !reference [.snippets, install-android-api-components]
- !reference [.snippets, run-legacy-integration-instrumented]

test-pyramid:legacy-integration-instrumented-latest-api:
tags: [ "macos:sonoma" ]
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
variables:
Expand All @@ -351,11 +343,11 @@ test-pyramid:legacy-integration-instrumented-latest-api:
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
script:
- !reference [.snippets, install-android-sdk]
- !reference [.snippets, install-android-api-components]
- !reference [.snippets, run-legacy-integration-instrumented]

test-pyramid:legacy-integration-instrumented-median-api:
tags: [ "macos:sonoma" ]
tags: [ "macos:sonoma", "specific:true" ]
stage: test-pyramid
timeout: 1h
variables:
Expand All @@ -364,7 +356,7 @@ test-pyramid:legacy-integration-instrumented-median-api:
ANDROID_PLATFORM: "platforms;android-$ANDROID_API"
ANDROID_BUILD_TOOLS: "build-tools;$ANDROID_API.0.0"
script:
- !reference [.snippets, install-android-sdk]
- !reference [.snippets, install-android-api-components]
- !reference [.snippets, run-legacy-integration-instrumented]

test-pyramid:detekt-api-coverage:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.gitlab
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ RUN set -x \
&& apt-get -y clean \
&& rm -rf /var/lib/apt/lists/*

ENV GRADLE_VERSION 8.9
ENV GRADLE_VERSION 8.10.2
ENV ANDROID_COMPILE_SDK 35
ENV ANDROID_BUILD_TOOLS 35.0.0
ENV ANDROID_SDK_TOOLS 11076708
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ object AndroidConfig {
const val MIN_SDK_FOR_WEAR = 23
const val BUILD_TOOLS_VERSION = "35.0.0"

val VERSION = Version(2, 15, 0, Version.Type.Release)
val VERSION = Version(2, 16, 0, Version.Type.Snapshot)
}

// TODO RUM-628 Switch to Java 17 bytecode
Expand Down
1 change: 1 addition & 0 deletions detekt_custom.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1001,6 +1001,7 @@ datadog:
- "kotlin.collections.listOf(com.datadog.android.rum.model.ResourceEvent.Interface)"
- "kotlin.collections.listOf(com.datadog.android.rum.model.ViewEvent.Interface)"
- "kotlin.collections.listOf(com.datadog.android.sessionreplay.internal.recorder.DefaultOptionSelectorDetector)"
- "kotlin.collections.listOf(com.datadog.android.sessionreplay.material.internal.MaterialDrawableToColorMapper)"
- "kotlin.collections.listOf(com.datadog.android.sessionreplay.material.internal.MaterialOptionSelectorDetector)"
- "kotlin.collections.listOf(com.datadog.android.sessionreplay.model.MobileSegment.MobileRecord.ViewEndRecord)"
- "kotlin.collections.listOf(com.datadog.android.sessionreplay.model.MobileSegment.Wireframe)"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
class com.datadog.android.sessionreplay.material.MaterialExtensionSupport : com.datadog.android.sessionreplay.ExtensionSupport
override fun getCustomViewMappers(): List<com.datadog.android.sessionreplay.MapperTypeWrapper<*>>
override fun getOptionSelectorDetectors(): List<com.datadog.android.sessionreplay.recorder.OptionSelectorDetector>
override fun getCustomDrawableMapper(): List<com.datadog.android.sessionreplay.utils.DrawableToColorMapper>
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
public final class com/datadog/android/sessionreplay/material/MaterialExtensionSupport : com/datadog/android/sessionreplay/ExtensionSupport {
public fun <init> ()V
public fun getCustomDrawableMapper ()Ljava/util/List;
public fun getCustomViewMappers ()Ljava/util/List;
public fun getOptionSelectorDetectors ()Ljava/util/List;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.cardview.widget.CardView
import com.datadog.android.sessionreplay.ExtensionSupport
import com.datadog.android.sessionreplay.MapperTypeWrapper
import com.datadog.android.sessionreplay.material.internal.CardWireframeMapper
import com.datadog.android.sessionreplay.material.internal.MaterialDrawableToColorMapper
import com.datadog.android.sessionreplay.material.internal.MaterialOptionSelectorDetector
import com.datadog.android.sessionreplay.material.internal.SliderWireframeMapper
import com.datadog.android.sessionreplay.material.internal.TabWireframeMapper
Expand All @@ -34,7 +35,9 @@ class MaterialExtensionSupport : ExtensionSupport {
private val viewIdentifierResolver: ViewIdentifierResolver = DefaultViewIdentifierResolver
private val colorStringFormatter: ColorStringFormatter = DefaultColorStringFormatter
private val viewBoundsResolver: ViewBoundsResolver = DefaultViewBoundsResolver
private val drawableToColorMapper: DrawableToColorMapper = DrawableToColorMapper.getDefault()
private val materialDrawableToColorMapper = MaterialDrawableToColorMapper()
private val drawableToColorMapper: DrawableToColorMapper =
DrawableToColorMapper.getDefault(listOf(materialDrawableToColorMapper))

override fun getCustomViewMappers(): List<MapperTypeWrapper<*>> {
val sliderWireframeMapper = SliderWireframeMapper(
Expand Down Expand Up @@ -71,4 +74,8 @@ class MaterialExtensionSupport : ExtensionSupport {
override fun getOptionSelectorDetectors(): List<OptionSelectorDetector> {
return listOf(MaterialOptionSelectorDetector())
}

override fun getCustomDrawableMapper(): List<DrawableToColorMapper> {
return listOf(materialDrawableToColorMapper)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
/*
* Unless explicitly stated otherwise all files in this repository are licensed under the Apache License Version 2.0.
* This product includes software developed at Datadog (https://www.datadoghq.com/).
* Copyright 2016-Present Datadog, Inc.
*/

package com.datadog.android.sessionreplay.material.internal

import android.graphics.drawable.Drawable
import com.datadog.android.api.InternalLogger
import com.datadog.android.sessionreplay.utils.DrawableToColorMapper
import com.google.android.material.shape.MaterialShapeDrawable

internal class MaterialDrawableToColorMapper : DrawableToColorMapper {

override fun mapDrawableToColor(drawable: Drawable, internalLogger: InternalLogger): Int? {
return when (drawable) {
is MaterialShapeDrawable -> resolveMaterialShapeDrawable(drawable)
else -> null
}
}

private fun resolveMaterialShapeDrawable(
shapeDrawable: MaterialShapeDrawable
): Int? {
return shapeDrawable.fillColor?.defaultColor
}
}
7 changes: 6 additions & 1 deletion features/dd-sdk-android-session-replay/api/apiSurface
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
interface com.datadog.android.sessionreplay.ExtensionSupport
fun getCustomViewMappers(): List<MapperTypeWrapper<*>>
fun getOptionSelectorDetectors(): List<com.datadog.android.sessionreplay.recorder.OptionSelectorDetector>
fun getCustomDrawableMapper(): List<com.datadog.android.sessionreplay.utils.DrawableToColorMapper>
enum com.datadog.android.sessionreplay.ImagePrivacy : PrivacyLevel
- MASK_NONE
- MASK_LARGE_ONLY
Expand Down Expand Up @@ -81,9 +82,11 @@ interface com.datadog.android.sessionreplay.recorder.mapper.TraverseAllChildrenM
interface com.datadog.android.sessionreplay.recorder.mapper.WireframeMapper<T: android.view.View>
fun map(T, com.datadog.android.sessionreplay.recorder.MappingContext, com.datadog.android.sessionreplay.utils.AsyncJobStatusCallback, com.datadog.android.api.InternalLogger): List<com.datadog.android.sessionreplay.model.MobileSegment.Wireframe>
open class com.datadog.android.sessionreplay.utils.AndroidMDrawableToColorMapper : LegacyDrawableToColorMapper
constructor(List<DrawableToColorMapper> = emptyList())
override fun resolveRippleDrawable(android.graphics.drawable.RippleDrawable, com.datadog.android.api.InternalLogger): Int?
override fun resolveInsetDrawable(android.graphics.drawable.InsetDrawable, com.datadog.android.api.InternalLogger): Int?
open class com.datadog.android.sessionreplay.utils.AndroidQDrawableToColorMapper : AndroidMDrawableToColorMapper
constructor(List<DrawableToColorMapper> = emptyList())
override fun resolveGradientDrawable(android.graphics.drawable.GradientDrawable, com.datadog.android.api.InternalLogger): Int?
companion object
interface com.datadog.android.sessionreplay.utils.AsyncJobStatusCallback
Expand All @@ -106,15 +109,17 @@ object com.datadog.android.sessionreplay.utils.DefaultViewIdentifierResolver : V
interface com.datadog.android.sessionreplay.utils.DrawableToColorMapper
fun mapDrawableToColor(android.graphics.drawable.Drawable, com.datadog.android.api.InternalLogger): Int?
companion object
fun getDefault(): DrawableToColorMapper
fun getDefault(List<DrawableToColorMapper> = emptyList()): DrawableToColorMapper
data class com.datadog.android.sessionreplay.utils.GlobalBounds
constructor(Long, Long, Long, Long)
interface com.datadog.android.sessionreplay.utils.ImageWireframeHelper
fun createImageWireframe(android.view.View, com.datadog.android.sessionreplay.ImagePrivacy, Int, Long, Long, Int, Int, Boolean, android.graphics.drawable.Drawable, com.datadog.android.sessionreplay.internal.recorder.resources.DrawableCopier = DefaultDrawableCopier(), AsyncJobStatusCallback, com.datadog.android.sessionreplay.model.MobileSegment.WireframeClip? = null, com.datadog.android.sessionreplay.model.MobileSegment.ShapeStyle? = null, com.datadog.android.sessionreplay.model.MobileSegment.ShapeBorder? = null, String? = DRAWABLE_CHILD_NAME): com.datadog.android.sessionreplay.model.MobileSegment.Wireframe?
fun createCompoundDrawableWireframes(android.widget.TextView, com.datadog.android.sessionreplay.recorder.MappingContext, Int, AsyncJobStatusCallback): MutableList<com.datadog.android.sessionreplay.model.MobileSegment.Wireframe>
companion object
open class com.datadog.android.sessionreplay.utils.LegacyDrawableToColorMapper : DrawableToColorMapper
constructor(List<DrawableToColorMapper> = emptyList())
override fun mapDrawableToColor(android.graphics.drawable.Drawable, com.datadog.android.api.InternalLogger): Int?
protected open fun resolveShapeDrawable(android.graphics.drawable.ShapeDrawable, com.datadog.android.api.InternalLogger): Int
protected open fun resolveColorDrawable(android.graphics.drawable.ColorDrawable): Int?
protected open fun resolveRippleDrawable(android.graphics.drawable.RippleDrawable, com.datadog.android.api.InternalLogger): Int?
protected open fun resolveLayerDrawable(android.graphics.drawable.LayerDrawable, com.datadog.android.api.InternalLogger, (Int, android.graphics.drawable.Drawable) -> Boolean = { _, _ -> true }): Int?
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
public abstract interface class com/datadog/android/sessionreplay/ExtensionSupport {
public abstract fun getCustomDrawableMapper ()Ljava/util/List;
public abstract fun getCustomViewMappers ()Ljava/util/List;
public abstract fun getOptionSelectorDetectors ()Ljava/util/List;
}
Expand Down Expand Up @@ -44,8 +45,8 @@ public final class com/datadog/android/sessionreplay/SessionReplay {
}

public final class com/datadog/android/sessionreplay/SessionReplayConfiguration {
public final fun copy (Ljava/lang/String;Lcom/datadog/android/sessionreplay/SessionReplayPrivacy;Ljava/util/List;Ljava/util/List;FLcom/datadog/android/sessionreplay/ImagePrivacy;ZLcom/datadog/android/sessionreplay/TouchPrivacy;Lcom/datadog/android/sessionreplay/TextAndInputPrivacy;ZLcom/datadog/android/sessionreplay/SystemRequirementsConfiguration;)Lcom/datadog/android/sessionreplay/SessionReplayConfiguration;
public static synthetic fun copy$default (Lcom/datadog/android/sessionreplay/SessionReplayConfiguration;Ljava/lang/String;Lcom/datadog/android/sessionreplay/SessionReplayPrivacy;Ljava/util/List;Ljava/util/List;FLcom/datadog/android/sessionreplay/ImagePrivacy;ZLcom/datadog/android/sessionreplay/TouchPrivacy;Lcom/datadog/android/sessionreplay/TextAndInputPrivacy;ZLcom/datadog/android/sessionreplay/SystemRequirementsConfiguration;ILjava/lang/Object;)Lcom/datadog/android/sessionreplay/SessionReplayConfiguration;
public final fun copy (Ljava/lang/String;Lcom/datadog/android/sessionreplay/SessionReplayPrivacy;Ljava/util/List;Ljava/util/List;Ljava/util/List;FLcom/datadog/android/sessionreplay/ImagePrivacy;ZLcom/datadog/android/sessionreplay/TouchPrivacy;Lcom/datadog/android/sessionreplay/TextAndInputPrivacy;ZLcom/datadog/android/sessionreplay/SystemRequirementsConfiguration;)Lcom/datadog/android/sessionreplay/SessionReplayConfiguration;
public static synthetic fun copy$default (Lcom/datadog/android/sessionreplay/SessionReplayConfiguration;Ljava/lang/String;Lcom/datadog/android/sessionreplay/SessionReplayPrivacy;Ljava/util/List;Ljava/util/List;Ljava/util/List;FLcom/datadog/android/sessionreplay/ImagePrivacy;ZLcom/datadog/android/sessionreplay/TouchPrivacy;Lcom/datadog/android/sessionreplay/TextAndInputPrivacy;ZLcom/datadog/android/sessionreplay/SystemRequirementsConfiguration;ILjava/lang/Object;)Lcom/datadog/android/sessionreplay/SessionReplayConfiguration;
public fun equals (Ljava/lang/Object;)Z
public fun hashCode ()I
public fun toString ()Ljava/lang/String;
Expand Down Expand Up @@ -1487,13 +1488,17 @@ public abstract interface class com/datadog/android/sessionreplay/recorder/mappe

public class com/datadog/android/sessionreplay/utils/AndroidMDrawableToColorMapper : com/datadog/android/sessionreplay/utils/LegacyDrawableToColorMapper {
public fun <init> ()V
public fun <init> (Ljava/util/List;)V
public synthetic fun <init> (Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
protected fun resolveInsetDrawable (Landroid/graphics/drawable/InsetDrawable;Lcom/datadog/android/api/InternalLogger;)Ljava/lang/Integer;
protected fun resolveRippleDrawable (Landroid/graphics/drawable/RippleDrawable;Lcom/datadog/android/api/InternalLogger;)Ljava/lang/Integer;
}

public class com/datadog/android/sessionreplay/utils/AndroidQDrawableToColorMapper : com/datadog/android/sessionreplay/utils/AndroidMDrawableToColorMapper {
public static final field Companion Lcom/datadog/android/sessionreplay/utils/AndroidQDrawableToColorMapper$Companion;
public fun <init> ()V
public fun <init> (Ljava/util/List;)V
public synthetic fun <init> (Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
protected fun resolveGradientDrawable (Landroid/graphics/drawable/GradientDrawable;Lcom/datadog/android/api/InternalLogger;)Ljava/lang/Integer;
}

Expand Down Expand Up @@ -1539,7 +1544,8 @@ public abstract interface class com/datadog/android/sessionreplay/utils/Drawable
}

public final class com/datadog/android/sessionreplay/utils/DrawableToColorMapper$Companion {
public final fun getDefault ()Lcom/datadog/android/sessionreplay/utils/DrawableToColorMapper;
public final fun getDefault (Ljava/util/List;)Lcom/datadog/android/sessionreplay/utils/DrawableToColorMapper;
public static synthetic fun getDefault$default (Lcom/datadog/android/sessionreplay/utils/DrawableToColorMapper$Companion;Ljava/util/List;ILjava/lang/Object;)Lcom/datadog/android/sessionreplay/utils/DrawableToColorMapper;
}

public final class com/datadog/android/sessionreplay/utils/GlobalBounds {
Expand Down Expand Up @@ -1575,6 +1581,8 @@ public final class com/datadog/android/sessionreplay/utils/ImageWireframeHelper$
public class com/datadog/android/sessionreplay/utils/LegacyDrawableToColorMapper : com/datadog/android/sessionreplay/utils/DrawableToColorMapper {
public static final field Companion Lcom/datadog/android/sessionreplay/utils/LegacyDrawableToColorMapper$Companion;
public fun <init> ()V
public fun <init> (Ljava/util/List;)V
public synthetic fun <init> (Ljava/util/List;ILkotlin/jvm/internal/DefaultConstructorMarker;)V
public fun mapDrawableToColor (Landroid/graphics/drawable/Drawable;Lcom/datadog/android/api/InternalLogger;)Ljava/lang/Integer;
protected final fun mergeColorAndAlpha (II)I
protected fun resolveColorDrawable (Landroid/graphics/drawable/ColorDrawable;)Ljava/lang/Integer;
Expand All @@ -1583,6 +1591,7 @@ public class com/datadog/android/sessionreplay/utils/LegacyDrawableToColorMapper
protected fun resolveLayerDrawable (Landroid/graphics/drawable/LayerDrawable;Lcom/datadog/android/api/InternalLogger;Lkotlin/jvm/functions/Function2;)Ljava/lang/Integer;
public static synthetic fun resolveLayerDrawable$default (Lcom/datadog/android/sessionreplay/utils/LegacyDrawableToColorMapper;Landroid/graphics/drawable/LayerDrawable;Lcom/datadog/android/api/InternalLogger;Lkotlin/jvm/functions/Function2;ILjava/lang/Object;)Ljava/lang/Integer;
protected fun resolveRippleDrawable (Landroid/graphics/drawable/RippleDrawable;Lcom/datadog/android/api/InternalLogger;)Ljava/lang/Integer;
protected fun resolveShapeDrawable (Landroid/graphics/drawable/ShapeDrawable;Lcom/datadog/android/api/InternalLogger;)I
}

public final class com/datadog/android/sessionreplay/utils/LegacyDrawableToColorMapper$Companion {
Expand Down
Loading

0 comments on commit b2c9bae

Please sign in to comment.