add explanation for foreground service notification

This commit is contained in:
Eric House 2018-11-23 08:21:52 -08:00
parent 2ba5982ddf
commit f8e15bd3a0
3 changed files with 22 additions and 0 deletions

View file

@ -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;
}

View file

@ -136,6 +136,7 @@
<string name="key_invite_multi">key_invite_multi</string>
<string name="key_na_rematch_two_only">key_notagain_rematch_two_only</string>
<string name="key_notagain_dfltname">key_notagain_dfltname</string>
<string name="key_notagain_btservice">key_notagain_btservice</string>
<string name="key_na_comms_bt">key_na_comms_bt</string>
<string name="key_na_comms_p2p">key_na_comms_p2p</string>

View file

@ -2641,6 +2641,14 @@
player name \"%1$s\". Would you like to personalize with your own
name before you create this game?</string>
<string name="not_again_btservice">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.</string>
<string name="no_invites">This game has sent no invitations</string>
<string name="disable_dualpane">Disable side-by-side</string>