when game opens and SMS is off, offer to turn it not rather than just

to open the Android settings app (as done in game config already)
This commit is contained in:
Eric House 2015-03-02 06:45:46 -08:00
parent 0233ad6b79
commit 61649aab2d
3 changed files with 16 additions and 10 deletions

View file

@ -907,7 +907,9 @@ public class BoardDelegate extends DelegateBase
@Override
public void dlgButtonClicked( Action action, int which, Object[] params )
{
boolean handled = false;
if ( AlertDialog.BUTTON_POSITIVE == which ) {
handled = true;
JNICmd cmd = JNICmd.CMD_NONE;
switch ( action ) {
case UNDO_LAST_ACTION:
@ -919,7 +921,6 @@ public class BoardDelegate extends DelegateBase
case SMS_CONFIG_ACTION:
Utils.launchSettings( m_activity );
break;
case COMMIT_ACTION:
cmd = JNICmd.CMD_COMMIT;
break;
@ -972,13 +973,17 @@ public class BoardDelegate extends DelegateBase
GamesListDelegate.sendNFCToSelf( m_activity, makeNFCMessage() );
break;
default:
Assert.fail();
handled = false;
}
if ( JNICmd.CMD_NONE != cmd ) {
checkAndHandle( cmd );
}
}
if ( !handled ) {
super.dlgButtonClicked( action, which, params );
}
} // dlgButtonClicked
public void inviteChoiceMade( Action action, InviteMeans means,
@ -2220,8 +2225,9 @@ public class BoardDelegate extends DelegateBase
if ( m_connTypes.contains( CommsConnType.COMMS_CONN_SMS ) ) {
if ( XWApp.SMSSUPPORTED && !XWPrefs.getSMSEnabled( m_activity ) ) {
showConfirmThen( R.string.warn_sms_disabled,
R.string.button_go_settings,
Action.SMS_CONFIG_ACTION );
R.string.button_enable_sms,
R.string.button_later,
Action.ENABLE_SMS_ASK );
}
}
}

View file

@ -523,6 +523,12 @@ public class DelegateBase implements DlgClickNotify,
showSMSEnableDialog( Action.ENABLE_SMS_DO );
handled = true;
break;
case ENABLE_SMS_DO:
boolean enabled = (Boolean)params[0];
if ( enabled ) {
XWPrefs.setSMSEnabled( m_activity, true );
}
break;
case ENABLE_BT_DO:
BTService.enable();
break;

View file

@ -655,12 +655,6 @@ public class GameConfigDelegate extends DelegateBase
}
finish();
break;
case ENABLE_SMS_DO:
boolean enabled = (Boolean)params[0];
if ( enabled ) {
XWPrefs.setSMSEnabled( m_activity, true );
}
break;
default:
callSuper = true;
}