From 62dd6c12f7785ae11ae8eaa8a7864d6f142939a8 Mon Sep 17 00:00:00 2001 From: Eric House Date: Tue, 1 Aug 2017 22:03:47 -0700 Subject: [PATCH] remove unnecessary parameter --- .../eehouse/android/xw4/BoardDelegate.java | 4 ++-- .../org/eehouse/android/xw4/DelegateBase.java | 2 +- .../android/xw4/GameConfigDelegate.java | 2 +- .../android/xw4/GamesListDelegate.java | 8 +++----- .../java/org/eehouse/android/xw4/Perms23.java | 20 ++++++++----------- .../android/xw4/SMSInviteDelegate.java | 2 +- 6 files changed, 16 insertions(+), 22 deletions(-) diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java index 95712fc20..c4e258fa8 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/BoardDelegate.java @@ -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, diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DelegateBase.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DelegateBase.java index e40ad3c92..3fa3eecce 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DelegateBase.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/DelegateBase.java @@ -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 diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameConfigDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameConfigDelegate.java index 158ee4165..35cfa6614 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameConfigDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/GameConfigDelegate.java @@ -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 ); } 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 a31368173..2923a4444 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 @@ -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 ); } } } diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Perms23.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Perms23.java index 452333cd0..ab1fcaa36 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Perms23.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/Perms23.java @@ -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 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 ); } diff --git a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/SMSInviteDelegate.java b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/SMSInviteDelegate.java index 143b9e4e6..e80006550 100644 --- a/xwords4/android/app/src/main/java/org/eehouse/android/xw4/SMSInviteDelegate.java +++ b/xwords4/android/app/src/main/java/org/eehouse/android/xw4/SMSInviteDelegate.java @@ -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 {