code: public synchronized void onTransportActive() {
      if (state == State.IDLE) {
        // When the transport goes active, we do not reset the nextKeepaliveTime. This allows us to
        // quickly check whether the connection is still working.
        state = State.PING_SCHEDULED;
        if (pingFuture == null) {
          pingFuture = scheduler.schedule(
              sendPing,
              keepAliveTimeInNanos - stopwatch.elapsed(TimeUnit.NANOSECONDS),
              TimeUnit.NANOSECONDS);
        }
      } else if (state == State.IDLE_AND_PING_SENT) {
        state = State.PING_SENT;
      } // Other states are possible when keepAliveDuringTransportIdle == true
    }
docs: Transport has active streams. Start sending keepalives if necessary.