private void updateAndDisplayRegisteredKeys()

in Fido/app/src/main/java/com/fido/example/fido2apiexample/Fido2DemoActivity.java [420:449]


    private void updateAndDisplayRegisteredKeys() {
        progressBar.setVisibility(View.VISIBLE);
        if (ContextCompat.checkSelfPermission(this, Manifest.permission.GET_ACCOUNTS)
                == PackageManager.PERMISSION_GRANTED) {
            Log.i(TAG, "updateAndDisplayRegisteredKeys permission is granted");
            Task<List<Map<String, String>>> refreshSecurityKeyTask = asyncRefreshSecurityKey();
            refreshSecurityKeyTask.addOnCompleteListener(
                    new OnCompleteListener<List<Map<String, String>>>() {
                        @Override
                        public void onComplete(@NonNull Task<List<Map<String, String>>> task) {
                            List<Map<String, String>> tokens = task.getResult();
                            if (tokens == null) {
                                swipeRefreshLayout.setRefreshing(false);
                                progressBar.setVisibility(View.GONE);
                                return;
                            }
                            securityTokens = tokens;
                            adapter.clearSecurityTokens();
                            adapter.addSecurityToken(securityTokens);
                            displayRegisteredKeys();
                        }
                    });
        } else {
            Log.i(TAG, "updateAndDisplayRegisteredKeys permission is requested");
            ActivityCompat.requestPermissions(
                    this,
                    new String[] {Manifest.permission.GET_ACCOUNTS},
                    GET_ACCOUNTS_PERMISSIONS_ALL_TOKENS);
        }
    }