private void updateMenuForAccount(Menu menu, PinInfo account) {
            MenuItem copyMenuItem = menu.findItem(R.id.copy);
            if (copyMenuItem != null) {
              copyMenuItem.setVisible(false);
            }

            MenuItem renameMenuItem = menu.findItem(R.id.rename);
            if (renameMenuItem != null) {
              renameMenuItem.setVisible(isRenameAccountAvailableSupported(account));
            }

            MenuItem checkKeyValueMenuItem = menu.findItem(R.id.check_code);
            if (checkKeyValueMenuItem != null) {
              checkKeyValueMenuItem.setVisible(isCheckAccountKeyValueSupported(account));
            }
          }
Called when the activity is first created.
java/com/google/android/apps/authenticator/AuthenticatorActivity.java