From 502888ee03b55e7348032d07c5fb33c6a6ee7224 Mon Sep 17 00:00:00 2001 From: Eric House Date: Thu, 15 Dec 2016 06:44:40 -0800 Subject: [PATCH] wifi: add reset() that will help troubleshoot --- .../src/org/eehouse/android/xw4/BoardDelegate.java | 11 +++++++++-- .../src/org/eehouse/android/xw4/WiDirService.java | 5 +++++ 2 files changed, 14 insertions(+), 2 deletions(-) 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 b78cc2254..137fab4fb 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/BoardDelegate.java @@ -201,12 +201,19 @@ public class BoardDelegate extends DelegateBase ab.setNegativeButton( R.string.button_rematch, lstnr ); } else if ( DlgID.DLG_CONNSTAT == dlgID && BuildConfig.DEBUG && null != m_connTypes - && m_connTypes.contains( CommsConnType.COMMS_CONN_RELAY ) ) { + && (m_connTypes.contains( CommsConnType.COMMS_CONN_RELAY ) + || m_connTypes.contains( CommsConnType.COMMS_CONN_P2P )) ) { + lstnr = new OnClickListener() { public void onClick( DialogInterface dlg, int whichButton ) { NetStateCache.reset( m_activity ); - RelayService.reset( m_activity ); + if ( m_connTypes.contains( CommsConnType.COMMS_CONN_RELAY ) ) { + RelayService.reset( m_activity ); + } + if ( m_connTypes.contains( CommsConnType.COMMS_CONN_P2P ) ) { + WiDirService.reset( m_activity ); + } } }; ab.setNegativeButton( R.string.button_reconnect, lstnr ); diff --git a/xwords4/android/XWords4/src/org/eehouse/android/xw4/WiDirService.java b/xwords4/android/XWords4/src/org/eehouse/android/xw4/WiDirService.java index 03c2ea232..028f05d40 100644 --- a/xwords4/android/XWords4/src/org/eehouse/android/xw4/WiDirService.java +++ b/xwords4/android/XWords4/src/org/eehouse/android/xw4/WiDirService.java @@ -198,6 +198,11 @@ public class WiDirService extends XWService { } } + public static void reset( Context context ) + { + // Put experimental stuff here that might help get a connection + } + public static boolean supported() { return WIFI_DIRECT_ENABLED;