mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-08 05:24:39 +01:00
avoid crashes when BT turned off
Test at enqueueWork() and onHandleWorkImpl(). Seems to do it. Maybe turning it off mid-send will still crash...
This commit is contained in:
parent
601eaf395c
commit
2afce586a3
1 changed files with 107 additions and 107 deletions
|
@ -292,17 +292,15 @@ public class BTService extends XWJIService {
|
|||
|
||||
private static void enqueueWork( Context context, Intent intent )
|
||||
{
|
||||
if ( BTEnabled() ) {
|
||||
enqueueWork( context, BTService.class, sJobID, intent );
|
||||
Log.d( TAG, "called enqueueWork(cmd=%s)",
|
||||
cmdFrom( intent, BTAction.values() ) );
|
||||
}
|
||||
}
|
||||
|
||||
public static void onACLConnected( Context context )
|
||||
{
|
||||
Log.d( TAG, "onACLConnected()" );
|
||||
enqueueWork( context,
|
||||
getIntentTo( context, BTAction.ACL_CONN ) );
|
||||
|
||||
}
|
||||
|
||||
public static void radioChanged( Context context, boolean cameOn )
|
||||
|
@ -417,6 +415,7 @@ public class BTService extends XWJIService {
|
|||
@Override
|
||||
void onHandleWorkImpl( Intent intent, XWJICmds jicmd, long timestamp )
|
||||
{
|
||||
if ( BTEnabled() ) {
|
||||
BTAction cmd = (BTAction)jicmd;
|
||||
switch( cmd ) {
|
||||
case ACL_CONN: // just forces onCreate to run
|
||||
|
@ -527,6 +526,7 @@ public class BTService extends XWJIService {
|
|||
default:
|
||||
Assert.fail();
|
||||
}
|
||||
}
|
||||
} // onHandleWorkImpl()
|
||||
|
||||
private void add( BTQueueElem elem )
|
||||
|
|
Loading…
Reference in a new issue