diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java index 16077063c..1f14fe7f2 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GamesListDelegate.java @@ -86,6 +86,7 @@ public class GamesListDelegate extends ListDelegateBase private static final String RELAYIDS_EXTRA = "relayids"; private static final String ROWID_EXTRA = "rowid"; + private static final String BACKGROUND_EXTRA = "bkgrnd"; private static final String GAMEID_EXTRA = "gameid"; private static final String REMATCH_ROWID_EXTRA = "rm_rowid"; private static final String REMATCH_DICT_EXTRA = "rm_dict"; @@ -2267,6 +2268,16 @@ public class GamesListDelegate extends ListDelegateBase } } + private void tryBackgroundIntent( Intent intent ) + { + if ( intent.getBooleanExtra( BACKGROUND_EXTRA, false ) ) { + makeNotAgainBuilder( R.string.not_again_btservice, + R.string.key_notagain_btservice, + Action.OPEN_GAME ) + .show(); + } + } + private void askDefaultName() { String name = CommonPrefs.getDefaultPlayerName( m_activity, 0, true ); @@ -2481,6 +2492,7 @@ public class GamesListDelegate extends ListDelegateBase startRematch( intent ); tryAlert( intent ); tryNFCIntent( intent ); + tryBackgroundIntent( intent ); } private void doOpenGame( Object[] params ) @@ -2668,6 +2680,7 @@ public class GamesListDelegate extends ListDelegateBase public static Intent makeBackgroundIntent( Context context ) { Intent intent = makeSelfIntent( context ); + intent.putExtra( BACKGROUND_EXTRA, true ); return intent; } diff --git a/xwords4/android/app/src/main/res/values/common_rsrc.xml b/xwords4/android/app/src/main/res/values/common_rsrc.xml index b776b8be4..389e79ddb 100644 --- a/xwords4/android/app/src/main/res/values/common_rsrc.xml +++ b/xwords4/android/app/src/main/res/values/common_rsrc.xml @@ -136,6 +136,7 @@ key_invite_multi key_notagain_rematch_two_only key_notagain_dfltname + key_notagain_btservice key_na_comms_bt key_na_comms_p2p diff --git a/xwords4/android/app/src/main/res/values/strings.xml b/xwords4/android/app/src/main/res/values/strings.xml index 7427f169a..d330d7eda 100644 --- a/xwords4/android/app/src/main/res/values/strings.xml +++ b/xwords4/android/app/src/main/res/values/strings.xml @@ -2641,6 +2641,14 @@ player name \"%1$s\". Would you like to personalize with your own name before you create this game? + This notification is present + whenever CrossWords is ready to receive Bluetooth messages in the + background. This readiness has a slight impact on battery. If you + don\'t want to listen in the background disable the \"Enable + Background Listener\" preference. CrossWords will still receive + Bluetooth moves and invitations while in the foreground, but any + sent while it\'s in the background will be lost. + This game has sent no invitations Disable side-by-side