Skip to content

Commit

Permalink
refactor: alter internal api visibility
Browse files Browse the repository at this point in the history
  • Loading branch information
fractalwrench committed Jul 10, 2024
1 parent f05d333 commit e29c2cb
Show file tree
Hide file tree
Showing 14 changed files with 237 additions and 81 deletions.
129 changes: 129 additions & 0 deletions embrace-android-sdk/api/embrace-android-sdk.api
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,19 @@ public final class io/embrace/android/embracesdk/internal/InternalTracingApi$Def
public static synthetic fun stopSpan$default (Lio/embrace/android/embracesdk/internal/InternalTracingApi;Ljava/lang/String;Lio/embrace/android/embracesdk/spans/ErrorCode;Ljava/lang/Long;ILjava/lang/Object;)Z
}

public abstract interface class io/embrace/android/embracesdk/internal/api/BreadcrumbApi {
public abstract fun addBreadcrumb (Ljava/lang/String;)V
}

public abstract interface class io/embrace/android/embracesdk/internal/api/EmbraceAndroidApi {
public abstract fun endView (Ljava/lang/String;)Z
public abstract fun start (Landroid/content/Context;)V
public abstract fun start (Landroid/content/Context;Lio/embrace/android/embracesdk/Embrace$AppFramework;)V
public abstract fun start (Landroid/content/Context;Z)V
public abstract fun start (Landroid/content/Context;ZLio/embrace/android/embracesdk/Embrace$AppFramework;)V
public abstract fun startView (Ljava/lang/String;)Z
}

public abstract interface class io/embrace/android/embracesdk/internal/api/InternalInterfaceApi {
public abstract fun getFlutterInternalInterface ()Lio/embrace/android/embracesdk/FlutterInternalInterface;
public abstract fun getInternalInterface ()Lio/embrace/android/embracesdk/internal/EmbraceInternalInterface;
Expand All @@ -252,12 +265,94 @@ public abstract interface class io/embrace/android/embracesdk/internal/api/Inter
public abstract fun trackWebViewPerformance (Ljava/lang/String;Ljava/lang/String;)V
}

public abstract interface class io/embrace/android/embracesdk/internal/api/LogsApi {
public abstract fun logCustomStacktrace ([Ljava/lang/StackTraceElement;)V
public abstract fun logCustomStacktrace ([Ljava/lang/StackTraceElement;Lio/embrace/android/embracesdk/Severity;)V
public abstract fun logCustomStacktrace ([Ljava/lang/StackTraceElement;Lio/embrace/android/embracesdk/Severity;Ljava/util/Map;)V
public abstract fun logCustomStacktrace ([Ljava/lang/StackTraceElement;Lio/embrace/android/embracesdk/Severity;Ljava/util/Map;Ljava/lang/String;)V
public abstract fun logError (Ljava/lang/String;)V
public abstract fun logException (Ljava/lang/Throwable;)V
public abstract fun logException (Ljava/lang/Throwable;Lio/embrace/android/embracesdk/Severity;)V
public abstract fun logException (Ljava/lang/Throwable;Lio/embrace/android/embracesdk/Severity;Ljava/util/Map;)V
public abstract fun logException (Ljava/lang/Throwable;Lio/embrace/android/embracesdk/Severity;Ljava/util/Map;Ljava/lang/String;)V
public abstract fun logInfo (Ljava/lang/String;)V
public abstract fun logMessage (Ljava/lang/String;Lio/embrace/android/embracesdk/Severity;)V
public abstract fun logMessage (Ljava/lang/String;Lio/embrace/android/embracesdk/Severity;Ljava/util/Map;)V
public abstract fun logPushNotification (Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/String;Ljava/lang/Integer;Ljava/lang/Integer;Ljava/lang/Boolean;Ljava/lang/Boolean;)V
public abstract fun logWarning (Ljava/lang/String;)V
}

public abstract interface class io/embrace/android/embracesdk/internal/api/MomentsApi {
public abstract fun endAppStartup ()V
public abstract fun endAppStartup (Ljava/util/Map;)V
public abstract fun endMoment (Ljava/lang/String;)V
public abstract fun endMoment (Ljava/lang/String;Ljava/lang/String;)V
public abstract fun endMoment (Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)V
public abstract fun endMoment (Ljava/lang/String;Ljava/util/Map;)V
public abstract fun startMoment (Ljava/lang/String;)V
public abstract fun startMoment (Ljava/lang/String;Ljava/lang/String;)V
public abstract fun startMoment (Ljava/lang/String;Ljava/lang/String;Ljava/util/Map;)V
}

public abstract interface class io/embrace/android/embracesdk/internal/api/NetworkRequestApi {
public abstract fun generateW3cTraceparent ()Ljava/lang/String;
public abstract fun getTraceIdHeader ()Ljava/lang/String;
public abstract fun recordNetworkRequest (Lio/embrace/android/embracesdk/network/EmbraceNetworkRequest;)V
}

public abstract interface class io/embrace/android/embracesdk/internal/api/OTelApi {
public abstract fun addLogRecordExporter (Lio/opentelemetry/sdk/logs/export/LogRecordExporter;)V
public abstract fun addSpanExporter (Lio/opentelemetry/sdk/trace/export/SpanExporter;)V
public abstract fun getOpenTelemetry ()Lio/opentelemetry/api/OpenTelemetry;
}

public abstract interface class io/embrace/android/embracesdk/internal/api/SdkApi : io/embrace/android/embracesdk/internal/api/BreadcrumbApi, io/embrace/android/embracesdk/internal/api/EmbraceAndroidApi, io/embrace/android/embracesdk/internal/api/InternalInterfaceApi, io/embrace/android/embracesdk/internal/api/InternalWebViewApi, io/embrace/android/embracesdk/internal/api/LogsApi, io/embrace/android/embracesdk/internal/api/MomentsApi, io/embrace/android/embracesdk/internal/api/NetworkRequestApi, io/embrace/android/embracesdk/internal/api/OTelApi, io/embrace/android/embracesdk/internal/api/SdkStateApi, io/embrace/android/embracesdk/internal/api/SessionApi, io/embrace/android/embracesdk/internal/api/UserApi, io/embrace/android/embracesdk/spans/TracingApi {
}

public final class io/embrace/android/embracesdk/internal/api/SdkApi$DefaultImpls {
public static fun createSpan (Lio/embrace/android/embracesdk/internal/api/SdkApi;Ljava/lang/String;)Lio/embrace/android/embracesdk/spans/EmbraceSpan;
public static fun recordCompletedSpan (Lio/embrace/android/embracesdk/internal/api/SdkApi;Ljava/lang/String;JJ)Z
public static fun recordCompletedSpan (Lio/embrace/android/embracesdk/internal/api/SdkApi;Ljava/lang/String;JJLio/embrace/android/embracesdk/spans/EmbraceSpan;)Z
public static fun recordCompletedSpan (Lio/embrace/android/embracesdk/internal/api/SdkApi;Ljava/lang/String;JJLio/embrace/android/embracesdk/spans/ErrorCode;)Z
public static fun recordCompletedSpan (Lio/embrace/android/embracesdk/internal/api/SdkApi;Ljava/lang/String;JJLio/embrace/android/embracesdk/spans/ErrorCode;Lio/embrace/android/embracesdk/spans/EmbraceSpan;)Z
public static fun recordCompletedSpan (Lio/embrace/android/embracesdk/internal/api/SdkApi;Ljava/lang/String;JJLjava/util/Map;Ljava/util/List;)Z
public static fun recordSpan (Lio/embrace/android/embracesdk/internal/api/SdkApi;Ljava/lang/String;Lio/embrace/android/embracesdk/spans/EmbraceSpan;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public static fun recordSpan (Lio/embrace/android/embracesdk/internal/api/SdkApi;Ljava/lang/String;Ljava/util/Map;Ljava/util/List;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public static fun recordSpan (Lio/embrace/android/embracesdk/internal/api/SdkApi;Ljava/lang/String;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public static fun startSpan (Lio/embrace/android/embracesdk/internal/api/SdkApi;Ljava/lang/String;)Lio/embrace/android/embracesdk/spans/EmbraceSpan;
public static fun startSpan (Lio/embrace/android/embracesdk/internal/api/SdkApi;Ljava/lang/String;Lio/embrace/android/embracesdk/spans/EmbraceSpan;)Lio/embrace/android/embracesdk/spans/EmbraceSpan;
}

public abstract interface class io/embrace/android/embracesdk/internal/api/SdkStateApi {
public abstract fun getCurrentSessionId ()Ljava/lang/String;
public abstract fun getDeviceId ()Ljava/lang/String;
public abstract fun getLastRunEndState ()Lio/embrace/android/embracesdk/Embrace$LastRunEndState;
public abstract fun isStarted ()Z
public abstract fun setAppId (Ljava/lang/String;)Z
}

public abstract interface class io/embrace/android/embracesdk/internal/api/SessionApi {
public abstract fun addSessionProperty (Ljava/lang/String;Ljava/lang/String;Z)Z
public abstract fun endSession ()V
public abstract fun endSession (Z)V
public abstract fun getSessionProperties ()Ljava/util/Map;
public abstract fun removeSessionProperty (Ljava/lang/String;)Z
}

public abstract interface class io/embrace/android/embracesdk/internal/api/UserApi {
public abstract fun addUserPersona (Ljava/lang/String;)V
public abstract fun clearAllUserPersonas ()V
public abstract fun clearUserAsPayer ()V
public abstract fun clearUserEmail ()V
public abstract fun clearUserIdentifier ()V
public abstract fun clearUserPersona (Ljava/lang/String;)V
public abstract fun clearUsername ()V
public abstract fun setUserAsPayer ()V
public abstract fun setUserEmail (Ljava/lang/String;)V
public abstract fun setUserIdentifier (Ljava/lang/String;)V
public abstract fun setUsername (Ljava/lang/String;)V
}

public abstract interface class io/embrace/android/embracesdk/internal/clock/Clock {
public abstract fun now ()J
public abstract fun nowInNanos ()J
Expand Down Expand Up @@ -413,3 +508,37 @@ public final class io/embrace/android/embracesdk/spans/ErrorCode : java/lang/Enu
public static fun values ()[Lio/embrace/android/embracesdk/spans/ErrorCode;
}

public abstract interface class io/embrace/android/embracesdk/spans/TracingApi {
public abstract fun createSpan (Ljava/lang/String;)Lio/embrace/android/embracesdk/spans/EmbraceSpan;
public abstract fun createSpan (Ljava/lang/String;Lio/embrace/android/embracesdk/spans/EmbraceSpan;)Lio/embrace/android/embracesdk/spans/EmbraceSpan;
public abstract fun getSpan (Ljava/lang/String;)Lio/embrace/android/embracesdk/spans/EmbraceSpan;
public abstract fun isTracingAvailable ()Z
public abstract fun recordCompletedSpan (Ljava/lang/String;JJ)Z
public abstract fun recordCompletedSpan (Ljava/lang/String;JJLio/embrace/android/embracesdk/spans/EmbraceSpan;)Z
public abstract fun recordCompletedSpan (Ljava/lang/String;JJLio/embrace/android/embracesdk/spans/ErrorCode;)Z
public abstract fun recordCompletedSpan (Ljava/lang/String;JJLio/embrace/android/embracesdk/spans/ErrorCode;Lio/embrace/android/embracesdk/spans/EmbraceSpan;)Z
public abstract fun recordCompletedSpan (Ljava/lang/String;JJLio/embrace/android/embracesdk/spans/ErrorCode;Lio/embrace/android/embracesdk/spans/EmbraceSpan;Ljava/util/Map;Ljava/util/List;)Z
public abstract fun recordCompletedSpan (Ljava/lang/String;JJLjava/util/Map;Ljava/util/List;)Z
public abstract fun recordSpan (Ljava/lang/String;Lio/embrace/android/embracesdk/spans/EmbraceSpan;Ljava/util/Map;Ljava/util/List;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public abstract fun recordSpan (Ljava/lang/String;Lio/embrace/android/embracesdk/spans/EmbraceSpan;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public abstract fun recordSpan (Ljava/lang/String;Ljava/util/Map;Ljava/util/List;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public abstract fun recordSpan (Ljava/lang/String;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public abstract fun startSpan (Ljava/lang/String;)Lio/embrace/android/embracesdk/spans/EmbraceSpan;
public abstract fun startSpan (Ljava/lang/String;Lio/embrace/android/embracesdk/spans/EmbraceSpan;)Lio/embrace/android/embracesdk/spans/EmbraceSpan;
public abstract fun startSpan (Ljava/lang/String;Lio/embrace/android/embracesdk/spans/EmbraceSpan;Ljava/lang/Long;)Lio/embrace/android/embracesdk/spans/EmbraceSpan;
}

public final class io/embrace/android/embracesdk/spans/TracingApi$DefaultImpls {
public static fun createSpan (Lio/embrace/android/embracesdk/spans/TracingApi;Ljava/lang/String;)Lio/embrace/android/embracesdk/spans/EmbraceSpan;
public static fun recordCompletedSpan (Lio/embrace/android/embracesdk/spans/TracingApi;Ljava/lang/String;JJ)Z
public static fun recordCompletedSpan (Lio/embrace/android/embracesdk/spans/TracingApi;Ljava/lang/String;JJLio/embrace/android/embracesdk/spans/EmbraceSpan;)Z
public static fun recordCompletedSpan (Lio/embrace/android/embracesdk/spans/TracingApi;Ljava/lang/String;JJLio/embrace/android/embracesdk/spans/ErrorCode;)Z
public static fun recordCompletedSpan (Lio/embrace/android/embracesdk/spans/TracingApi;Ljava/lang/String;JJLio/embrace/android/embracesdk/spans/ErrorCode;Lio/embrace/android/embracesdk/spans/EmbraceSpan;)Z
public static fun recordCompletedSpan (Lio/embrace/android/embracesdk/spans/TracingApi;Ljava/lang/String;JJLjava/util/Map;Ljava/util/List;)Z
public static fun recordSpan (Lio/embrace/android/embracesdk/spans/TracingApi;Ljava/lang/String;Lio/embrace/android/embracesdk/spans/EmbraceSpan;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public static fun recordSpan (Lio/embrace/android/embracesdk/spans/TracingApi;Ljava/lang/String;Ljava/util/Map;Ljava/util/List;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public static fun recordSpan (Lio/embrace/android/embracesdk/spans/TracingApi;Ljava/lang/String;Lkotlin/jvm/functions/Function0;)Ljava/lang/Object;
public static fun startSpan (Lio/embrace/android/embracesdk/spans/TracingApi;Ljava/lang/String;)Lio/embrace/android/embracesdk/spans/EmbraceSpan;
public static fun startSpan (Lio/embrace/android/embracesdk/spans/TracingApi;Ljava/lang/String;Lio/embrace/android/embracesdk/spans/EmbraceSpan;)Lio/embrace/android/embracesdk/spans/EmbraceSpan;
}

Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
package io.embrace.android.embracesdk.internal.api

internal interface BreadcrumbApi {
import io.embrace.android.embracesdk.annotation.InternalApi

@InternalApi
public interface BreadcrumbApi {

/**
* Adds a breadcrumb.
Expand All @@ -9,5 +12,5 @@ internal interface BreadcrumbApi {
*
* @param message the name of the breadcrumb to add
*/
fun addBreadcrumb(message: String)
public fun addBreadcrumb(message: String)
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ package io.embrace.android.embracesdk.internal.api

import android.content.Context
import io.embrace.android.embracesdk.Embrace
import io.embrace.android.embracesdk.annotation.InternalApi

/**
* Declares the functions that consist of Embrace's public API - specifically
* those that are only declared on Android. You should not use
* [EmbraceAndroidApi] directly or implement it in your own custom classes,
* as new functions may be added in future. Use the [Embrace] class instead.
*/
internal interface EmbraceAndroidApi {
@InternalApi
public interface EmbraceAndroidApi {

/**
* Starts instrumentation of the Android application using the Embrace SDK. This should be
Expand All @@ -21,7 +23,7 @@ internal interface EmbraceAndroidApi {
*
* @param context an instance of the application context
*/
fun start(context: Context)
public fun start(context: Context)

/**
* Starts instrumentation of the Android application using the Embrace SDK. This should be
Expand All @@ -36,7 +38,7 @@ internal interface EmbraceAndroidApi {
*/
@Suppress("DEPRECATION")
@Deprecated("Use {@link #start(Context)} instead.")
fun start(
public fun start(
context: Context,
appFramework: Embrace.AppFramework
)
Expand All @@ -54,7 +56,7 @@ internal interface EmbraceAndroidApi {
* sets the environment for all sessions to 'Development'.
*/
@Deprecated("Use {@link #start(Context)} instead. The isDevMode parameter has no effect.")
fun start(
public fun start(
context: Context,
isDevMode: Boolean
)
Expand All @@ -75,7 +77,7 @@ internal interface EmbraceAndroidApi {
*/
@Suppress("DEPRECATION")
@Deprecated("Use {@link #start(Context, Embrace.AppFramework)} instead. The isDevMode parameter has no effect.")
fun start(
public fun start(
context: Context,
isDevMode: Boolean,
appFramework: Embrace.AppFramework
Expand All @@ -94,7 +96,7 @@ internal interface EmbraceAndroidApi {
*
* @param name the name of the view to log
*/
fun startView(name: String): Boolean
public fun startView(name: String): Boolean

/**
* Records that a view 'ended'. You should call this when your app stops displaying an
Expand All @@ -109,5 +111,5 @@ internal interface EmbraceAndroidApi {
*
* @param name the name of the view to log
*/
fun endView(name: String): Boolean
public fun endView(name: String): Boolean
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import io.embrace.android.embracesdk.UnityInternalInterface
import io.embrace.android.embracesdk.annotation.InternalApi
import io.embrace.android.embracesdk.internal.EmbraceInternalInterface

@InternalApi
public interface InternalInterfaceApi {

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package io.embrace.android.embracesdk.internal.api

import android.webkit.ConsoleMessage
import io.embrace.android.embracesdk.annotation.InternalApi

@InternalApi
public interface InternalWebViewApi {
public fun logWebView(url: String?)
public fun trackWebViewPerformance(tag: String, consoleMessage: ConsoleMessage)
Expand Down
Loading

0 comments on commit e29c2cb

Please sign in to comment.