mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-02 20:46:15 +01:00
fix path name string causing JNI crash on emulator
And catch NPE that also seems to be emulator-only
This commit is contained in:
parent
91828cb851
commit
b23b837009
2 changed files with 4 additions and 2 deletions
|
@ -214,6 +214,8 @@ public class WiDirService extends XWService {
|
||||||
sHavePermission = false;
|
sHavePermission = false;
|
||||||
} catch ( SecurityException se ) { // perm not in manifest
|
} catch ( SecurityException se ) { // perm not in manifest
|
||||||
sHavePermission = false;
|
sHavePermission = false;
|
||||||
|
} catch ( NullPointerException npe ) { // Seeing this on Oreo emulator
|
||||||
|
sHavePermission = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -702,10 +702,10 @@ and_dutil_deviceRegistered( XW_DUtilCtxt* duc, DevIDType typ,
|
||||||
const XP_UCHAR* idRelay )
|
const XP_UCHAR* idRelay )
|
||||||
{
|
{
|
||||||
DUTIL_CBK_HEADER( "deviceRegistered",
|
DUTIL_CBK_HEADER( "deviceRegistered",
|
||||||
"(L" PKG_PATH("jni/UtilCtxt$DevIDType") ";Ljava/lang/String;)V" );
|
"(L" PKG_PATH("jni/DUtilCtxt$DevIDType") ";Ljava/lang/String;)V" );
|
||||||
jstring jstr = (*env)->NewStringUTF( env, idRelay );
|
jstring jstr = (*env)->NewStringUTF( env, idRelay );
|
||||||
jobject jtyp = intToJEnum( env, typ,
|
jobject jtyp = intToJEnum( env, typ,
|
||||||
PKG_PATH("jni/UtilCtxt$DevIDType") );
|
PKG_PATH("jni/DUtilCtxt$DevIDType") );
|
||||||
(*env)->CallVoidMethod( env, dutil->jdutil, mid, jtyp, jstr );
|
(*env)->CallVoidMethod( env, dutil->jdutil, mid, jtyp, jstr );
|
||||||
deleteLocalRefs( env, jstr, jtyp, DELETE_NO_REF );
|
deleteLocalRefs( env, jstr, jtyp, DELETE_NO_REF );
|
||||||
DUTIL_CBK_TAIL();
|
DUTIL_CBK_TAIL();
|
||||||
|
|
Loading…
Add table
Reference in a new issue