show BT-troubleshooting hint when scan finds no devices

This commit is contained in:
Eric House 2019-01-14 12:20:27 -08:00
parent 23e58524a1
commit c976b3f595
2 changed files with 7 additions and 3 deletions

View file

@ -56,6 +56,7 @@ public class BTInviteDelegate extends InviteDelegate {
private Activity m_activity;
private ProgressBar mProgressBar;
private Handler m_handler = new Handler();
private int mNDevsThisScan;
private static class Persisted implements Serializable {
List<TwoStringPair> pairs;
@ -178,7 +179,7 @@ public class BTInviteDelegate extends InviteDelegate {
public void run() {
hideProgress();
if ( mPersisted.empty() ) {
if ( mPersisted.empty() || 0 == mNDevsThisScan ) {
makeNotAgainBuilder( R.string.not_again_emptybtscan,
R.string.key_notagain_emptybtscan )
.show();
@ -235,6 +236,7 @@ public class BTInviteDelegate extends InviteDelegate {
int count = BTService.getPairedCount( m_activity );
if ( 0 < count ) {
mNDevsThisScan = 0;
showProgress( count, SCAN_SECONDS );
BTService.scan( m_activity, 1000 * SCAN_SECONDS );
} else {
@ -249,6 +251,7 @@ public class BTInviteDelegate extends InviteDelegate {
{
DbgUtils.assertOnUIThread();
++mNDevsThisScan;
mPersisted.add( dev.getAddress(), dev.getName() );
store();

View file

@ -2763,8 +2763,9 @@
<string name="gameevent_channel_expl">In-game events</string>
<string name="not_again_emptybtscan">If a scan doesn\'t find the device you expect:\n
• First, just try again\n
• Make sure Bluetooth is on on the other device\n
• First, just Rescan\n
• Make sure Bluetooth is enabled on the other device\n
• Launch CrossWords on the other device\n
• If all else fails, reboot this device\n
</string>
</resources>