Skip to content

Commit ee3bc00

Browse files
authored
Merge pull request #2759 from DataDog/nogorodnikov/remove-default-value-for-addAccountExtraInfo-call
Remove default value for the `addAccountExtraInfo` call
2 parents b820571 + 809abcb commit ee3bc00

File tree

4 files changed

+32
-27
lines changed

4 files changed

+32
-27
lines changed

dd-sdk-android-core/api/apiSurface

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ object com.datadog.android.Datadog
1111
fun addUserProperties(Map<String, Any?>, com.datadog.android.api.SdkCore = getInstance())
1212
fun clearAllData(com.datadog.android.api.SdkCore = getInstance())
1313
fun setAccountInfo(String, String? = null, Map<String, Any?> = emptyMap(), com.datadog.android.api.SdkCore = getInstance())
14-
fun addAccountExtraInfo(Map<String, Any?> = emptyMap(), com.datadog.android.api.SdkCore = getInstance())
14+
fun addAccountExtraInfo(Map<String, Any?>, com.datadog.android.api.SdkCore = getInstance())
1515
fun clearAccountInfo(com.datadog.android.api.SdkCore = getInstance())
1616
fun _internalProxy(String? = null): _InternalProxy
1717
enum com.datadog.android.DatadogSite
@@ -61,7 +61,7 @@ interface com.datadog.android.api.SdkCore
6161
fun addUserProperties(Map<String, Any?>)
6262
fun clearAllData()
6363
fun setAccountInfo(String, String? = null, Map<String, Any?> = emptyMap())
64-
fun addAccountExtraInfo(Map<String, Any?> = emptyMap())
64+
fun addAccountExtraInfo(Map<String, Any?>)
6565
fun clearAccountInfo()
6666
data class com.datadog.android.api.context.AccountInfo
6767
constructor(String, String? = null, Map<String, Any?> = emptyMap())

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

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ public final class com/datadog/android/Datadog {
1212
public static final field INSTANCE Lcom/datadog/android/Datadog;
1313
public final fun _internalProxy (Ljava/lang/String;)Lcom/datadog/android/_InternalProxy;
1414
public static synthetic fun _internalProxy$default (Lcom/datadog/android/Datadog;Ljava/lang/String;ILjava/lang/Object;)Lcom/datadog/android/_InternalProxy;
15-
public static final fun addAccountExtraInfo ()V
1615
public static final fun addAccountExtraInfo (Ljava/util/Map;)V
1716
public static final fun addAccountExtraInfo (Ljava/util/Map;Lcom/datadog/android/api/SdkCore;)V
1817
public static synthetic fun addAccountExtraInfo$default (Ljava/util/Map;Lcom/datadog/android/api/SdkCore;ILjava/lang/Object;)V
@@ -138,7 +137,6 @@ public abstract interface class com/datadog/android/api/SdkCore {
138137
}
139138

140139
public final class com/datadog/android/api/SdkCore$DefaultImpls {
141-
public static synthetic fun addAccountExtraInfo$default (Lcom/datadog/android/api/SdkCore;Ljava/util/Map;ILjava/lang/Object;)V
142140
public static synthetic fun setAccountInfo$default (Lcom/datadog/android/api/SdkCore;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;ILjava/lang/Object;)V
143141
public static synthetic fun setUserInfo$default (Lcom/datadog/android/api/SdkCore;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;ILjava/lang/Object;)V
144142
}

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

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -304,7 +304,7 @@ object Datadog {
304304
*
305305
* @param id Account ID.
306306
* @param name representing the account, if exists.
307-
* @param extraInfo Account's custom attributes, if exists.
307+
* @param extraInfo Account custom attributes, if exists.
308308
* @param sdkCore SDK instance to set account information. If not provided, default SDK
309309
* instance will be used.
310310
*/
@@ -329,14 +329,14 @@ object Datadog {
329329
* This extra info will be added to already existing extra info that is added
330330
* to Logs, Traces and RUM events automatically.
331331
*
332-
* @param extraInfo Account's additional custom attributes.
333-
* @param sdkCore SDK instance to add account custom attributes. If not provided,
334-
* default SDK instance will be used.
332+
* @param extraInfo Account additional custom attributes.
333+
* @param sdkCore SDK instance to add extra account information. If not provided, default SDK
334+
* instance will be used.
335335
*/
336336
@JvmStatic
337337
@JvmOverloads
338338
fun addAccountExtraInfo(
339-
extraInfo: Map<String, Any?> = emptyMap(),
339+
extraInfo: Map<String, Any?>,
340340
sdkCore: SdkCore = getInstance()
341341
) {
342342
sdkCore.addAccountExtraInfo(extraInfo)
@@ -345,20 +345,19 @@ object Datadog {
345345
/**
346346
* Clear the current account information.
347347
*
348-
* Account information will set to null
348+
* Account information will be set to null.
349349
* Following Logs, Traces, RUM Events will not include the account information anymore.
350350
*
351-
* Any active RUM Session, active RUM View at the time of call will have their `account` attribute cleared
351+
* Any active RUM Session, active RUM View at the time of call will have their `account` attribute cleared.
352352
*
353353
* If you want to retain the current `account` on the active RUM session,
354-
* you need to stop the session first by using `GlobalRumMonitor.get().stopSession()`
354+
* you need to stop the session first by using `GlobalRumMonitor.get().stopSession()`.
355355
*
356356
* If you want to retain the current `account` on the active RUM views,
357357
* you need to stop the view first by using `GlobalRumMonitor.get().stopView()`.
358358
*
359-
* @param sdkCore SDK instance to clear account info. If not provided,
360-
* default SDK instance will be used.
361-
*
359+
* @param sdkCore SDK instance to clear account information. If not provided, default SDK
360+
* instance will be used.
362361
*/
363362
@JvmStatic
364363
@JvmOverloads

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

Lines changed: 20 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,43 +83,51 @@ interface SdkCore {
8383
fun clearAllData()
8484

8585
/**
86-
* Sets current account information.
86+
* Sets the account information that the user is currently logged into.
8787
*
88-
* Those will be added to logs, traces and RUM events automatically.
88+
* This API should be used to assign an identifier for the user's account which represents a
89+
* contextual identity within the app, typically tied to business or tenant logic. The
90+
* information set here will be added to logs, traces and RUM events.
91+
*
92+
* This value should be set when user logs in with his account, and cleared by calling
93+
* [clearAccountInfo] when he logs out.
8994
*
9095
* @param id Account ID.
9196
* @param name representing the account, if exists.
92-
* @param extraInfo Account's custom attributes, if exists.
97+
* @param extraInfo Account custom attributes, if exists.
9398
*/
9499
fun setAccountInfo(
95100
id: String,
96101
name: String? = null,
97102
extraInfo: Map<String, Any?> = emptyMap()
98103
)
99104

100-
/** Add custom attributes to the current account information
105+
/**
106+
* Add custom attributes to the current account information.
101107
*
102108
* This extra info will be added to already existing extra info that is added
103-
* to logs traces and RUM events automatically.
109+
* to Logs, Traces and RUM events automatically.
104110
*
105-
* @param extraInfo Account's additional custom attributes.
111+
* @param extraInfo Account additional custom attributes.
106112
*/
107113
fun addAccountExtraInfo(
108-
extraInfo: Map<String, Any?> = emptyMap()
114+
extraInfo: Map<String, Any?>
109115
)
110116

111-
/** Clear the current account information
117+
/**
118+
* Clear the current account information.
112119
*
113-
* Account information will set to null
120+
* Account information will be set to null.
114121
* Following Logs, Traces, RUM Events will not include the account information anymore.
115122
*
116-
* Any active RUM Session, active RUM View at the time of call will have their `account` attribute cleared
123+
* Any active RUM Session, active RUM View at the time of call will have their `account` attribute cleared.
117124
*
118125
* If you want to retain the current `account` on the active RUM session,
119-
* you need to stop the session first by using `GlobalRumMonitor.get().stopSession()`
126+
* you need to stop the session first by using `GlobalRumMonitor.get().stopSession()`.
120127
*
121128
* If you want to retain the current `account` on the active RUM views,
122-
* you need to stop the view first by using `GlobalRumMonitor.get().stopView()`
129+
* you need to stop the view first by using `GlobalRumMonitor.get().stopView()`.
130+
*
123131
*/
124132
fun clearAccountInfo()
125133
}

0 commit comments

Comments
 (0)