From 61395f07e92121e81afbeb319727e2933eb2af85 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 12 Mar 2019 07:05:51 -0700 Subject: [PATCH] use the latest NBSProxy dev release --- xwords4/android/app/build.gradle | 2 +- .../java/org/eehouse/android/xw4/XWApp.java | 19 ++++++++++++++++--- 2 files changed, 17 insertions(+), 4 deletions(-) diff --git a/xwords4/android/app/build.gradle b/xwords4/android/app/build.gradle index d698e5c3a..1845eca14 100644 --- a/xwords4/android/app/build.gradle +++ b/xwords4/android/app/build.gradle @@ -273,7 +273,7 @@ dependencies { implementation 'com.google.firebase:firebase-messaging:17.3.4' // rm-for-fdroid implementation 'com.google.firebase:firebase-core:16.0.6' // rm-for-fdroid - implementation 'com.github.eehouse:nbsproxy:v0.1.0' + implementation 'com.github.eehouse:nbsproxy:v0.2.1' } task mkImages(type: Exec) { diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWApp.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWApp.java index 4753d5ca9..1fec82e96 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWApp.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/XWApp.java @@ -33,6 +33,7 @@ import android.preference.PreferenceManager; import org.eehouse.android.nbsplib.NBSProxy; +import org.eehouse.android.xw4.jni.CommsAddrRec.CommsConnType; import org.eehouse.android.xw4.jni.XwJNI; import java.util.UUID; @@ -96,9 +97,7 @@ public class XWApp extends Application WiDirWrapper.init( this ); mPort = Short.valueOf( getString( R.string.nbs_port ) ); - if ( NBSProxy.isInstalled( this ) ) { - NBSProxy.register( mPort, BuildConfig.APPLICATION_ID, this ); - } + NBSProxy.register( mPort, BuildConfig.APPLICATION_ID, this ); } @OnLifecycleEvent(ON_ANY) @@ -127,6 +126,20 @@ public class XWApp extends Application } // NBSProxy.Callbacks + + @Override + public void onProxyAppLaunched() + { + Log.d( TAG, "onProxyAppLaunched()" ); + } + + @Override + public void onPermissionsGranted() + { + Log.d( TAG, "onPermissionsGranted()" ); + GameUtils.resendAllIf( this, CommsConnType.COMMS_CONN_SMS ); + } + @Override public void onDataReceived( short port, String fromPhone, byte[] data ) {