mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-05 20:45:49 +01:00
fix crash on Android 2.3
Channel wasn't a thing back then. Catch the ClassNotFound exception and set the same boolean as when permissions aren't available (in manifest), which means nothing else tries to run.
This commit is contained in:
parent
531f30aae8
commit
c0784fe8b7
1 changed files with 9 additions and 7 deletions
|
@ -181,18 +181,20 @@ public class WiDirService extends XWService {
|
|||
public static void init( Context context )
|
||||
{
|
||||
DbgUtils.logd( TAG, "init()" );
|
||||
ChannelListener listener = new ChannelListener() {
|
||||
@Override
|
||||
public void onChannelDisconnected() {
|
||||
DbgUtils.logd( TAG, "onChannelDisconnected()");
|
||||
}
|
||||
};
|
||||
try {
|
||||
ChannelListener listener = new ChannelListener() {
|
||||
@Override
|
||||
public void onChannelDisconnected() {
|
||||
DbgUtils.logd( TAG, "onChannelDisconnected()");
|
||||
}
|
||||
};
|
||||
sChannel = getMgr().initialize( context, Looper.getMainLooper(),
|
||||
listener );
|
||||
s_discoverer = new ServiceDiscoverer( sChannel );
|
||||
sHavePermission = true;
|
||||
} catch ( SecurityException se ) {
|
||||
} catch ( NoClassDefFoundError ndf ) { // old os version
|
||||
sHavePermission = false;
|
||||
} catch ( SecurityException se ) { // perm not in manifest
|
||||
sHavePermission = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue