mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-07 05:24:46 +01:00
remove unnecessary parameter
This commit is contained in:
parent
c927dbef54
commit
62dd6c12f7
6 changed files with 16 additions and 22 deletions
|
@ -711,7 +711,7 @@ public class BoardDelegate extends DelegateBase
|
|||
{
|
||||
Perms23.tryGetPerms( this, Perm.READ_PHONE_STATE,
|
||||
R.string.phone_state_rationale,
|
||||
Action.ASKED_PHONE_STATE, this, info );
|
||||
Action.ASKED_PHONE_STATE, info );
|
||||
}
|
||||
|
||||
private void showInviteChoicesThen( Object[] params )
|
||||
|
@ -1183,7 +1183,7 @@ public class BoardDelegate extends DelegateBase
|
|||
break;
|
||||
case SMS:
|
||||
Perms23.tryGetPerms( this, Perm.SEND_SMS, R.string.sms_invite_rationale,
|
||||
Action.INVITE_SMS, this, m_mySIS.nMissing, info );
|
||||
Action.INVITE_SMS, m_mySIS.nMissing, info );
|
||||
break;
|
||||
case RELAY:
|
||||
RelayInviteDelegate.launchForResult( m_activity, m_mySIS.nMissing,
|
||||
|
|
|
@ -110,7 +110,7 @@ public class DelegateBase implements DlgClickNotify,
|
|||
protected void tryGetPerms( Perms23.Perm perm, int rationale,
|
||||
Action action, Object... params )
|
||||
{
|
||||
Perms23.tryGetPerms( this, perm, rationale, action, this, params );
|
||||
Perms23.tryGetPerms( this, perm, rationale, action, params );
|
||||
}
|
||||
|
||||
// Fragments only
|
||||
|
|
|
@ -780,7 +780,7 @@ public class GameConfigDelegate extends DelegateBase
|
|||
if ( null == SMSService.getPhoneInfo( m_activity ) ) {
|
||||
Perms23.tryGetPerms( this, Perms23.Perm.READ_PHONE_STATE,
|
||||
R.string.phone_state_rationale,
|
||||
Action.ASKED_PHONE_STATE, this );
|
||||
Action.ASKED_PHONE_STATE );
|
||||
} else {
|
||||
showDialogFragment( DlgID.CHANGE_CONN, m_conTypes );
|
||||
}
|
||||
|
|
|
@ -1592,9 +1592,8 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
|
||||
case R.id.games_menu_loaddb:
|
||||
case R.id.games_menu_storedb:
|
||||
Perms23.tryGetPerms( this, Perm.STORAGE,
|
||||
null, Action.STORAGE_CONFIRMED,
|
||||
this, itemID );
|
||||
Perms23.tryGetPerms( this, Perm.STORAGE, null,
|
||||
Action.STORAGE_CONFIRMED, itemID );
|
||||
break;
|
||||
|
||||
default:
|
||||
|
@ -2170,8 +2169,7 @@ public class GamesListDelegate extends ListDelegateBase
|
|||
String msg = getString( R.string.phone_lookup_rationale )
|
||||
+ "\n\n" + getString( id );
|
||||
Perms23.tryGetPerms( this, Perm.READ_PHONE_STATE, msg,
|
||||
Action.ASKED_PHONE_STATE, this,
|
||||
gameName, addrs );
|
||||
Action.ASKED_PHONE_STATE, gameName, addrs );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -151,18 +151,15 @@ public class Perms23 {
|
|||
private Action m_action;
|
||||
private Perm m_perm;
|
||||
private DelegateBase m_delegate;
|
||||
private DlgClickNotify m_cbck;
|
||||
private String m_rationaleMsg;
|
||||
private Object[] m_params;
|
||||
|
||||
public QueryInfo( DelegateBase delegate, Action action,
|
||||
Perm perm, String msg,
|
||||
DlgClickNotify cbck, Object[] params ) {
|
||||
Perm perm, String msg, Object[] params ) {
|
||||
m_delegate = delegate;
|
||||
m_action = action;
|
||||
m_perm = perm;
|
||||
m_rationaleMsg = msg;
|
||||
m_cbck = cbck;
|
||||
m_params = params;
|
||||
}
|
||||
|
||||
|
@ -186,9 +183,9 @@ public class Perms23 {
|
|||
public void onPermissionResult( Map<Perm, Boolean> perms ) {
|
||||
if ( Action.SKIP_CALLBACK != m_action ) {
|
||||
if ( perms.get( m_perm ) ) {
|
||||
m_cbck.onPosButton( m_action, m_params );
|
||||
m_delegate.onPosButton( m_action, m_params );
|
||||
} else {
|
||||
m_cbck.onNegButton( m_action, m_params );
|
||||
m_delegate.onNegButton( m_action, m_params );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -204,7 +201,7 @@ public class Perms23 {
|
|||
if ( positive ) {
|
||||
doIt( false );
|
||||
} else {
|
||||
m_cbck.onNegButton( m_action, m_params );
|
||||
m_delegate.onNegButton( m_action, m_params );
|
||||
}
|
||||
}
|
||||
} );
|
||||
|
@ -224,21 +221,20 @@ public class Perms23 {
|
|||
* either positive or negative, the former if permission granted.
|
||||
*/
|
||||
public static void tryGetPerms( DelegateBase delegate, Perm perm, int rationaleId,
|
||||
final Action action, final DlgClickNotify cbck,
|
||||
Object... params )
|
||||
final Action action, Object... params )
|
||||
{
|
||||
// Log.d( TAG, "tryGetPerms(%s)", perm.toString() );
|
||||
Context context = XWApp.getContext();
|
||||
String msg = LocUtils.getString( context, rationaleId );
|
||||
tryGetPerms( delegate, perm, msg, action, cbck, params );
|
||||
tryGetPerms( delegate, perm, msg, action, params );
|
||||
}
|
||||
|
||||
public static void tryGetPerms( DelegateBase delegate, Perm perm,
|
||||
String rationaleMsg, final Action action,
|
||||
final DlgClickNotify cbck, Object... params )
|
||||
Object... params )
|
||||
{
|
||||
// Log.d( TAG, "tryGetPerms(%s)", perm.toString() );
|
||||
new QueryInfo( delegate, action, perm, rationaleMsg, cbck, params )
|
||||
new QueryInfo( delegate, action, perm, rationaleMsg, params )
|
||||
.doIt( true );
|
||||
}
|
||||
|
||||
|
|
|
@ -352,7 +352,7 @@ public class SMSInviteDelegate extends InviteDelegate {
|
|||
// regardless of the answers given. So SKIP_CALLBACK.
|
||||
Perms23.tryGetPerms( this, Perm.READ_CONTACTS,
|
||||
R.string.contacts_rationale,
|
||||
Action.SKIP_CALLBACK, this );
|
||||
Action.SKIP_CALLBACK );
|
||||
}
|
||||
|
||||
private class PhoneRec implements InviterItem {
|
||||
|
|
Loading…
Reference in a new issue