Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ import org.jetbrains.annotations.ApiStatus
* .build()
* ```
*
* If you're using the Sentry Android Gradle Plugin (SAGP), wrapping will be performed
* automatically.
*
* @param delegate The [SQLiteDriver] instance to delegate calls to.
*/
@ApiStatus.Experimental
Expand Down Expand Up @@ -87,9 +90,16 @@ public class SentrySQLiteDriver private constructor(private val delegate: SQLite
*
* In the case of (2), wrap the open helper passed to the `SupportSQLiteDriver` constructor via
* `SentrySupportSQLiteOpenHelper` instead.
*
* Note that wrapping will be performed if the delegate isn't a `SupportSQLiteDriver` itself but
* wraps or subclasses one. In that case, ensure the open helper passed to the support driver
* constructor is *not* wrapped.
*/
// Warning! The SAGP depends on this method's ABI.
@JvmStatic
public fun create(delegate: SQLiteDriver): SQLiteDriver =
// FQN check simplifies our SAGP implementation, allowing it to naively instrument all
// RoomDatabase.Builder.setDriver() call sites.
if (delegate is SentrySQLiteDriver || delegate.javaClass.name == SUPPORT_SQLITE_DRIVER_FQN) {
delegate
} else {
Expand Down
Loading