From 8acba7e09246d69bd12ff2f825b25e75acb43075 Mon Sep 17 00:00:00 2001 From: Eric House Date: Wed, 29 Jul 2015 06:39:03 -0700 Subject: [PATCH 1/5] add only phones and computers to list of possible BT opponent devices --- .../XWords4/src/org/eehouse/android/xw4/BTService.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java index 7c986a891..640c6ddd2 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BTService.java @@ -23,6 +23,7 @@ package org.eehouse.android.xw4; import android.app.Activity; import android.app.Service; import android.bluetooth.BluetoothAdapter; +import android.bluetooth.BluetoothClass.Device.Major; import android.bluetooth.BluetoothClass; import android.bluetooth.BluetoothDevice; import android.bluetooth.BluetoothServerSocket; @@ -974,7 +975,10 @@ public class BTService extends XWService { Set pairedDevs = m_adapter.getBondedDevices(); synchronized( m_addrs ) { for ( BluetoothDevice dev : pairedDevs ) { - m_addrs.add( dev.getAddress() ); + int clazz = dev.getBluetoothClass().getMajorDeviceClass(); + if ( Major.PHONE == clazz || Major.COMPUTER == clazz ) { + m_addrs.add( dev.getAddress() ); + } } } } From 4a580eabdae32685191a5a004c00eebeb590ef94 Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 31 Jul 2015 06:36:35 -0700 Subject: [PATCH 2/5] handle maintenance messages from relay --- .../XWords4/src/org/eehouse/android/xw4/DelegateBase.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java index 1f4cae16b..f278985cb 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/DelegateBase.java @@ -524,6 +524,9 @@ public class DelegateBase implements DlgClickNotify, case APP_NOT_FOUND: fmtId = R.string.app_not_found_fmt; break; + case RELAY_ALERT: + m_dlgDelegate.eventOccurred( event, args ); + break; default: if ( BuildConfig.DEBUG ) { DbgUtils.logf( "DelegateBase.eventOccurred(event=%s) (DROPPED)", From 36adf7f86c9268c18e9180d142da55f04fb4e1e2 Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 31 Jul 2015 07:12:27 -0700 Subject: [PATCH 3/5] get rid of About menuitem in board -- in main view is enough --- xwords4/android/XWords4/res/menu-small/board_menu.xml | 5 ----- xwords4/android/XWords4/res/menu/board_menu.xml | 4 ---- .../XWords4/src/org/eehouse/android/xw4/BoardDelegate.java | 4 ---- 3 files changed, 13 deletions(-) diff --git a/xwords4/android/XWords4/res/menu-small/board_menu.xml b/xwords4/android/XWords4/res/menu-small/board_menu.xml index fe5c90f2f..f933fe7b9 100644 --- a/xwords4/android/XWords4/res/menu-small/board_menu.xml +++ b/xwords4/android/XWords4/res/menu-small/board_menu.xml @@ -93,11 +93,6 @@ android:title="@string/menu_prefs" android:alphabeticShortcut="P" /> - - diff --git a/xwords4/android/XWords4/res/menu/board_menu.xml b/xwords4/android/XWords4/res/menu/board_menu.xml index dfec84b14..65cffc8d2 100644 --- a/xwords4/android/XWords4/res/menu/board_menu.xml +++ b/xwords4/android/XWords4/res/menu/board_menu.xml @@ -65,10 +65,6 @@ android:title="@string/menu_prefs" android:alphabeticShortcut="P" /> - diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java index d11b650d8..db6f32c9e 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java @@ -920,10 +920,6 @@ public class BoardDelegate extends DelegateBase Utils.launchSettings( m_activity ); break; - case R.id.board_menu_file_about: - showAboutDialog(); - break; - default: DbgUtils.logf( "menuitem %d not handled", id ); handled = false; From 81834bcbfab89230858f13890c3f8ce68b1d1a66 Mon Sep 17 00:00:00 2001 From: Eric House Date: Fri, 31 Jul 2015 07:10:19 -0700 Subject: [PATCH 4/5] provide app name in variant too to fix empty substitution errors (e.g. About menutem) --- xwords4/android/XWords4-dbg/build.xml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/xwords4/android/XWords4-dbg/build.xml b/xwords4/android/XWords4-dbg/build.xml index dd73d82c4..76facd222 100644 --- a/xwords4/android/XWords4-dbg/build.xml +++ b/xwords4/android/XWords4-dbg/build.xml @@ -54,6 +54,8 @@ + + From b56924b030e2892c92a264c74b32b3214485edfd Mon Sep 17 00:00:00 2001 From: Eric House Date: Sun, 2 Aug 2015 16:29:53 -0700 Subject: [PATCH 5/5] fix off-by-one error that probably had me slowly leaking local obj references for the last few years. --- xwords4/android/XWords4/jni/andutils.c | 4 ++-- xwords4/android/XWords4/jni/andutils.h | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/xwords4/android/XWords4/jni/andutils.c b/xwords4/android/XWords4/jni/andutils.c index ec2c9cbe6..25ac4b227 100644 --- a/xwords4/android/XWords4/jni/andutils.c +++ b/xwords4/android/XWords4/jni/andutils.c @@ -659,10 +659,10 @@ void deleteLocalRef( JNIEnv* env, jobject jobj ) } void -deleteLocalRefs( JNIEnv* env, jobject jobj, ... ) +deleteLocalRefs( JNIEnv* env, ... ) { va_list ap; - va_start( ap, jobj ); + va_start( ap, env ); for ( ; ; ) { jobject jnext = va_arg( ap, jobject ); if ( DELETE_NO_REF == jnext ) { diff --git a/xwords4/android/XWords4/jni/andutils.h b/xwords4/android/XWords4/jni/andutils.h index 214c41022..f66af6a89 100644 --- a/xwords4/android/XWords4/jni/andutils.h +++ b/xwords4/android/XWords4/jni/andutils.h @@ -97,6 +97,6 @@ jint jEnumToInt( JNIEnv* env, jobject jenum ); XP_U32 getCurSeconds( JNIEnv* env ); void deleteLocalRef( JNIEnv* env, jobject jobj ); -void deleteLocalRefs( JNIEnv* env, jobject jobj, ... ); +void deleteLocalRefs( JNIEnv* env, ... ); # define DELETE_NO_REF ((jobject)-1) /* terminates above varargs list */ #endif