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 9, 2024
1 parent d1f4040 commit f7fb862
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 32 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import io.embrace.android.embracesdk.Embrace
* [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 {
public interface EmbraceAndroidApi {

/**
* Starts instrumentation of the Android application using the Embrace SDK. This should be
Expand All @@ -21,7 +21,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 +36,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 +54,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 +75,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 +94,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 +109,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 @@ -2,7 +2,7 @@ package io.embrace.android.embracesdk.internal.api

import io.embrace.android.embracesdk.spans.TracingApi

internal interface SdkApi :
public interface SdkApi :
LogsApi,
MomentsApi,
NetworkRequestApi,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ package io.embrace.android.embracesdk.internal.api

import io.embrace.android.embracesdk.Embrace

internal interface SdkStateApi {
public interface SdkStateApi {

/**
* Whether or not the SDK has been started.
*
* @return true if the SDK is started, false otherwise
*/
val isStarted: Boolean
public val isStarted: Boolean

/**
* Sets a custom app ID that overrides the one specified at build time. Must be called before
Expand All @@ -18,11 +18,11 @@ internal interface SdkStateApi {
* @param appId custom app ID
* @return true if the app ID could be set, false otherwise.
*/
fun setAppId(appId: String): Boolean
public fun setAppId(appId: String): Boolean

fun getDeviceId(): String
public fun getDeviceId(): String

val currentSessionId: String?
public val currentSessionId: String?

fun getLastRunEndState(): Embrace.LastRunEndState
public fun getLastRunEndState(): Embrace.LastRunEndState
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import io.embrace.android.embracesdk.annotation.BetaApi
* The actual trace won't be recorded until the SDK is started, but it's safe to use this prior to SDK initialization.
*/
@BetaApi
internal interface TracingApi {
public interface TracingApi {
/**
* Create an [EmbraceSpan] with the given name that will be the root span of a new trace. Returns null if the [EmbraceSpan] cannot
* be created given the current conditions of the SDK or an invalid name.
*
* Note: the [EmbraceSpan] created will not be started. For a method that creates and starts the span, use [startSpan]
*/
@BetaApi
fun createSpan(
public fun createSpan(
name: String
): EmbraceSpan? = createSpan(name = name, parent = null)

Expand All @@ -27,7 +27,7 @@ internal interface TracingApi {
* * Note: the [EmbraceSpan] created will not be started. For a method that creates and starts the span, use [startSpan]
*/
@BetaApi
fun createSpan(
public fun createSpan(
name: String,
parent: EmbraceSpan?
): EmbraceSpan?
Expand All @@ -37,7 +37,7 @@ internal interface TracingApi {
* [EmbraceSpan] cannot be created or started.
*/
@BetaApi
fun startSpan(
public fun startSpan(
name: String
): EmbraceSpan? = startSpan(name = name, parent = null)

Expand All @@ -46,7 +46,7 @@ internal interface TracingApi {
* or started, like if the parent has been started.
*/
@BetaApi
fun startSpan(
public fun startSpan(
name: String,
parent: EmbraceSpan?
): EmbraceSpan? = startSpan(
Expand All @@ -60,7 +60,7 @@ internal interface TracingApi {
* Returns null if the [EmbraceSpan] cannot be created or started, like if the parent has been started.
*/
@BetaApi
fun startSpan(
public fun startSpan(
name: String,
parent: EmbraceSpan?,
startTimeMs: Long?
Expand All @@ -72,7 +72,7 @@ internal interface TracingApi {
* [Throwable] will be rethrown.
*/
@BetaApi
fun <T> recordSpan(
public fun <T> recordSpan(
name: String,
code: () -> T
): T = recordSpan(name = name, parent = null, attributes = null, events = null, code = code)
Expand All @@ -84,7 +84,7 @@ internal interface TracingApi {
* [Throwable] will be rethrown.
*/
@BetaApi
fun <T> recordSpan(
public fun <T> recordSpan(
name: String,
parent: EmbraceSpan?,
code: () -> T
Expand All @@ -96,7 +96,7 @@ internal interface TracingApi {
* the span will end at the point of the throw and the [Throwable] will be rethrown.
*/
@BetaApi
fun <T> recordSpan(
public fun <T> recordSpan(
name: String,
attributes: Map<String, String>?,
events: List<EmbraceSpanEvent>?,
Expand All @@ -111,7 +111,7 @@ internal interface TracingApi {
* [Throwable] will be rethrown.
*/
@BetaApi
fun <T> recordSpan(
public fun <T> recordSpan(
name: String,
parent: EmbraceSpan?,
attributes: Map<String, String>?,
Expand All @@ -124,7 +124,7 @@ internal interface TracingApi {
* a new trace.
*/
@BetaApi
fun recordCompletedSpan(
public fun recordCompletedSpan(
name: String,
startTimeMs: Long,
endTimeMs: Long
Expand All @@ -145,7 +145,7 @@ internal interface TracingApi {
* unsuccessfully under the stated circumstances.
*/
@BetaApi
fun recordCompletedSpan(
public fun recordCompletedSpan(
name: String,
startTimeMs: Long,
endTimeMs: Long,
Expand All @@ -166,7 +166,7 @@ internal interface TracingApi {
* will result in a new trace with the new span as its root.
*/
@BetaApi
fun recordCompletedSpan(
public fun recordCompletedSpan(
name: String,
startTimeMs: Long,
endTimeMs: Long,
Expand All @@ -188,7 +188,7 @@ internal interface TracingApi {
* operation the span represents was ended unsuccessfully under the stated circumstances.
*/
@BetaApi
fun recordCompletedSpan(
public fun recordCompletedSpan(
name: String,
startTimeMs: Long,
endTimeMs: Long,
Expand All @@ -210,7 +210,7 @@ internal interface TracingApi {
* a [List] of [EmbraceSpanEvent] to be used as the events of the recorded span.
*/
@BetaApi
fun recordCompletedSpan(
public fun recordCompletedSpan(
name: String,
startTimeMs: Long,
endTimeMs: Long,
Expand All @@ -234,7 +234,7 @@ internal interface TracingApi {
* as the events of the recorded span.
*/
@BetaApi
fun recordCompletedSpan(
public fun recordCompletedSpan(
name: String,
startTimeMs: Long,
endTimeMs: Long,
Expand All @@ -250,11 +250,11 @@ internal interface TracingApi {
* if was completed in a prior session.
*/
@BetaApi
fun getSpan(spanId: String): EmbraceSpan?
public fun getSpan(spanId: String): EmbraceSpan?

/**
* @see [Embrace.isStarted]
*/
@Deprecated("Not required. Use Embrace.isStarted() to know when the full tracing API is available")
fun isTracingAvailable(): Boolean
public fun isTracingAvailable(): Boolean
}

0 comments on commit f7fb862

Please sign in to comment.