diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BTUtils.kt b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BTUtils.kt index c572c3f3f..6ab879ab3 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BTUtils.kt +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BTUtils.kt @@ -32,17 +32,6 @@ import android.os.Build import android.provider.Settings import android.text.TextUtils -import org.eehouse.android.xw4.DbgUtils.DeadlockWatch -import org.eehouse.android.xw4.MultiService.DictFetchOwner -import org.eehouse.android.xw4.MultiService.MultiEvent -import org.eehouse.android.xw4.Perms23.Perm -import org.eehouse.android.xw4.TimerReceiver.TimerCallback -import org.eehouse.android.xw4.XWServiceHelper.ReceiveResult -import org.eehouse.android.xw4.jni.CommsAddrRec -import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnType -import org.eehouse.android.xw4.jni.CommsAddrRec.ConnExpl -import org.eehouse.android.xw4.jni.XwJNI - import java.io.ByteArrayInputStream import java.io.ByteArrayOutputStream import java.io.Closeable @@ -56,6 +45,18 @@ import java.util.concurrent.atomic.AtomicReference import kotlin.concurrent.Volatile import kotlin.math.min +import org.eehouse.android.xw4.DbgUtils.DeadlockWatch +import org.eehouse.android.xw4.MultiService.DictFetchOwner +import org.eehouse.android.xw4.MultiService.MultiEvent +import org.eehouse.android.xw4.Perms23.Perm +import org.eehouse.android.xw4.TimerReceiver.TimerCallback +import org.eehouse.android.xw4.XWServiceHelper.ReceiveResult +import org.eehouse.android.xw4.jni.CommsAddrRec +import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnType +import org.eehouse.android.xw4.jni.CommsAddrRec.ConnExpl +import org.eehouse.android.xw4.jni.XwJNI +import org.eehouse.android.xw4.jni.XwJNI.STAT + object BTUtils { private val TAG: String = BTUtils::class.java.simpleName private const val BOGUS_MARSHMALLOW_ADDR = "02:00:00:00:00:00" @@ -988,6 +989,7 @@ object BTUtils { msgCount, data.size, Utils.getMD5SumFor(data), this ) + XwJNI.sts_increment(STAT.STAT_BT_SENT); } catch (ioe: IOException) { Log.e(TAG, "writeAndCheck(): ioe: %s", ioe.message) localElems = null @@ -1408,6 +1410,8 @@ object BTUtils { data.size, Utils.getMD5SumFor(data), nMessages ) + XwJNI.sts_increment(STAT.STAT_BT_RCVD); + for (ii in 0 until nMessages) { val cmdOrd = dis.readByte() val oneLen = if (isOldProto) 0 else dis.readShort() // used only to skip diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/XwJNI.kt b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/XwJNI.kt index e73ca22f3..fc3ed3769 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/XwJNI.kt +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/jni/XwJNI.kt @@ -219,6 +219,8 @@ class XwJNI private constructor() { STAT_NBS_RCVD, STAT_NBS_SENT, + STAT_BT_RCVD, + STAT_BT_SENT, STAT_NSTATS, } diff --git a/xwords4/common/stats.c b/xwords4/common/stats.c index 97aecd352..ec77f3790 100644 --- a/xwords4/common/stats.c +++ b/xwords4/common/stats.c @@ -142,6 +142,8 @@ STATtoStr(STAT stat) CASESTR(STAT_NEW_REMATCH); CASESTR(STAT_NBS_SENT); CASESTR(STAT_NBS_RCVD); + CASESTR(STAT_BT_SENT); + CASESTR(STAT_BT_RCVD); default: XP_ASSERT(0); } diff --git a/xwords4/common/stats.h b/xwords4/common/stats.h index 0739a296b..3c39ce571 100644 --- a/xwords4/common/stats.h +++ b/xwords4/common/stats.h @@ -40,6 +40,8 @@ typedef enum { STAT_NBS_RCVD, STAT_NBS_SENT, + STAT_BT_RCVD, + STAT_BT_SENT, STAT_NSTATS, } STAT;