mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-23 07:27:22 +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
30f70db59b
commit
8f6745a308
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 )
|
private static void enqueueWork( Context context, Intent intent )
|
||||||
{
|
{
|
||||||
|
if ( BTEnabled() ) {
|
||||||
enqueueWork( context, BTService.class, sJobID, intent );
|
enqueueWork( context, BTService.class, sJobID, intent );
|
||||||
Log.d( TAG, "called enqueueWork(cmd=%s)",
|
}
|
||||||
cmdFrom( intent, BTAction.values() ) );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void onACLConnected( Context context )
|
public static void onACLConnected( Context context )
|
||||||
{
|
{
|
||||||
Log.d( TAG, "onACLConnected()" );
|
|
||||||
enqueueWork( context,
|
enqueueWork( context,
|
||||||
getIntentTo( context, BTAction.ACL_CONN ) );
|
getIntentTo( context, BTAction.ACL_CONN ) );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void radioChanged( Context context, boolean cameOn )
|
public static void radioChanged( Context context, boolean cameOn )
|
||||||
|
@ -417,6 +415,7 @@ public class BTService extends XWJIService {
|
||||||
@Override
|
@Override
|
||||||
void onHandleWorkImpl( Intent intent, XWJICmds jicmd, long timestamp )
|
void onHandleWorkImpl( Intent intent, XWJICmds jicmd, long timestamp )
|
||||||
{
|
{
|
||||||
|
if ( BTEnabled() ) {
|
||||||
BTAction cmd = (BTAction)jicmd;
|
BTAction cmd = (BTAction)jicmd;
|
||||||
switch( cmd ) {
|
switch( cmd ) {
|
||||||
case ACL_CONN: // just forces onCreate to run
|
case ACL_CONN: // just forces onCreate to run
|
||||||
|
@ -527,6 +526,7 @@ public class BTService extends XWJIService {
|
||||||
default:
|
default:
|
||||||
Assert.fail();
|
Assert.fail();
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} // onHandleWorkImpl()
|
} // onHandleWorkImpl()
|
||||||
|
|
||||||
private void add( BTQueueElem elem )
|
private void add( BTQueueElem elem )
|
||||||
|
|
Loading…
Add table
Reference in a new issue