mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-02-09 22:00:39 +01:00
fix logic error in permissions callback
Somehow I forgot what params were and decided that array's length needed to match another's.
This commit is contained in:
parent
06fe5894b9
commit
506ddc8f7a
1 changed files with 7 additions and 9 deletions
|
@ -201,20 +201,18 @@ public class Perms23 {
|
|||
}
|
||||
builder.asyncQuery( m_delegate.getActivity(), new PermCbck() {
|
||||
@Override
|
||||
public void onPermissionResult( Map<Perm, Boolean> perms ) {
|
||||
public void onPermissionResult( Map<Perm, Boolean> permsMap ) {
|
||||
if ( Action.SKIP_CALLBACK != m_action ) {
|
||||
Set<Perm> keys = perms.keySet();
|
||||
|
||||
// We need all the sought perms to have been granted
|
||||
boolean allGood = keys.size() == m_params.length;
|
||||
for ( Iterator<Perm> iter = keys.iterator();
|
||||
allGood && iter.hasNext(); ) {
|
||||
if ( !perms.get(iter.next()) ) {
|
||||
allGood = false;
|
||||
}
|
||||
boolean allGranted = true;
|
||||
Iterator<Perm> iter = permsMap.keySet().iterator();
|
||||
while ( allGranted && iter.hasNext() ) {
|
||||
Perm perm = iter.next();
|
||||
allGranted = allGranted && permsMap.get( perm );
|
||||
}
|
||||
|
||||
if ( allGood ) {
|
||||
if ( allGranted ) {
|
||||
m_delegate.onPosButton( m_action, m_params );
|
||||
} else {
|
||||
m_delegate.onNegButton( m_action, m_params );
|
||||
|
|
Loading…
Add table
Reference in a new issue