Skip to content

Commit

Permalink
Make ActivityLifecycleListener extend ActivityLifecycleCallacks with …
Browse files Browse the repository at this point in the history
…no-op defaults
  • Loading branch information
bidetofevil committed Jul 17, 2024
1 parent e077e6c commit 74a2e3d
Showing 1 changed file with 17 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,32 +1,25 @@
package io.embrace.android.embracesdk.internal.session.lifecycle

import android.app.Activity
import android.app.Application.ActivityLifecycleCallbacks
import android.os.Bundle

/**
* Listener implemented by observers of the [ActivityLifecycleTracker].
* Implementation of [ActivityLifecycleCallbacks] with no-op defaults
*/
internal interface ActivityLifecycleListener {

/**
* Triggered when an activity is opened.
*
* @param activity details of the activity
*/
fun onActivityStarted(activity: Activity) {}

/**
* Triggered when an activity is closed.
*
* @param activity details of the activity
*/
fun onActivityStopped(activity: Activity) {}

/**
* Triggered when an activity is created.
*
* @param activity the activity
* @param bundle the bundle
*/
fun onActivityCreated(activity: Activity, bundle: Bundle?) {}
internal interface ActivityLifecycleListener : ActivityLifecycleCallbacks {

override fun onActivityCreated(activity: Activity, bundle: Bundle?) {}

Check warning on line 12 in embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/session/lifecycle/ActivityLifecycleListener.kt

View check run for this annotation

Codecov / codecov/patch

embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/session/lifecycle/ActivityLifecycleListener.kt#L12

Added line #L12 was not covered by tests

override fun onActivityStarted(activity: Activity) {}

Check warning on line 14 in embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/session/lifecycle/ActivityLifecycleListener.kt

View check run for this annotation

Codecov / codecov/patch

embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/session/lifecycle/ActivityLifecycleListener.kt#L14

Added line #L14 was not covered by tests

override fun onActivityResumed(activity: Activity) {}

Check warning on line 16 in embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/session/lifecycle/ActivityLifecycleListener.kt

View check run for this annotation

Codecov / codecov/patch

embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/session/lifecycle/ActivityLifecycleListener.kt#L16

Added line #L16 was not covered by tests

override fun onActivityPaused(activity: Activity) {}

Check warning on line 18 in embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/session/lifecycle/ActivityLifecycleListener.kt

View check run for this annotation

Codecov / codecov/patch

embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/session/lifecycle/ActivityLifecycleListener.kt#L18

Added line #L18 was not covered by tests

override fun onActivityStopped(activity: Activity) {}

Check warning on line 20 in embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/session/lifecycle/ActivityLifecycleListener.kt

View check run for this annotation

Codecov / codecov/patch

embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/session/lifecycle/ActivityLifecycleListener.kt#L20

Added line #L20 was not covered by tests

override fun onActivitySaveInstanceState(activity: Activity, outState: Bundle) {}

Check warning on line 22 in embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/session/lifecycle/ActivityLifecycleListener.kt

View check run for this annotation

Codecov / codecov/patch

embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/session/lifecycle/ActivityLifecycleListener.kt#L22

Added line #L22 was not covered by tests

override fun onActivityDestroyed(activity: Activity) {}

Check warning on line 24 in embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/session/lifecycle/ActivityLifecycleListener.kt

View check run for this annotation

Codecov / codecov/patch

embrace-android-sdk/src/main/java/io/embrace/android/embracesdk/internal/session/lifecycle/ActivityLifecycleListener.kt#L24

Added line #L24 was not covered by tests
}

0 comments on commit 74a2e3d

Please sign in to comment.