diff --git a/okhttp/src/androidMain/kotlin/okhttp3/android/TracingConnectionListener.kt b/okhttp/src/androidMain/kotlin/okhttp3/android/TracingConnectionListener.kt index 327d4c349358..ed94e427215c 100644 --- a/okhttp/src/androidMain/kotlin/okhttp3/android/TracingConnectionListener.kt +++ b/okhttp/src/androidMain/kotlin/okhttp3/android/TracingConnectionListener.kt @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ -package okhttp3.android; +package okhttp3.android import androidx.tracing.Trace import java.util.concurrent.atomic.AtomicInteger @@ -30,15 +30,24 @@ import okio.IOException class TracingConnectionListener : ConnectionListener() { private val idGenerator = AtomicInteger(0) - override fun connectStart(route: Route, call: Call) { + override fun connectStart( + route: Route, + call: Call, + ) { Trace.beginAsyncSection(route.tracingTag, idGenerator.incrementAndGet()) } - override fun connectFailed(route: Route, call: Call, failure: IOException) { + override fun connectFailed( + route: Route, + call: Call, + failure: IOException, + ) { + // TODO same id Trace.endAsyncSection(route.tracingTag, idGenerator.incrementAndGet()) } override fun connectionClosed(connection: Connection) { + // TODO same id Trace.endAsyncSection(connection.route().tracingTag, idGenerator.incrementAndGet()) } diff --git a/okhttp/src/androidMain/kotlin/okhttp3/android/TracingInterceptor.kt b/okhttp/src/androidMain/kotlin/okhttp3/android/TracingInterceptor.kt index f4785b257a3f..c57837d2b3fd 100644 --- a/okhttp/src/androidMain/kotlin/okhttp3/android/TracingInterceptor.kt +++ b/okhttp/src/androidMain/kotlin/okhttp3/android/TracingInterceptor.kt @@ -14,7 +14,7 @@ * limitations under the License. * */ -package okhttp3.android; +package okhttp3.android import androidx.tracing.trace import okhttp3.Interceptor