@Override
  public void onClick(View v) {
    AppCompatActivity activity = (AppCompatActivity) getActivity();
    if (activity == null) return;

    switch (v.getId()) {
      case R.id.ask_for_contact_permissions_action -> enableContactsDictionary();
      case R.id.disable_contacts_dictionary -> {
        mSharedPrefs
            .edit()
            .putBoolean(getString(R.string.settings_key_use_contacts_dictionary), false)
            .apply();
        refreshWizardPager();
      }
      case R.id.open_permissions_wiki_action -> {
        Intent browserIntent =
            new Intent(
                Intent.ACTION_VIEW,
                Uri.parse(getResources().getString(R.string.permissions_wiki_site_url)));
        try {
          startActivity(browserIntent);
        } catch (ActivityNotFoundException weirdException) {
          // https://github.com/AnySoftKeyboard/AnySoftKeyboard/issues/516
          // this means that there is nothing on the device
          // that can handle Intent.ACTION_VIEW with "https" schema..
          // silently swallowing it
          Logger.w(
              "WizardPermissionsFragment",
              "Can not open '%' since there is nothing on the device that can handle" + " it.",
              browserIntent.getData());
        }
      }
      case R.id.ask_for_notification_permissions_action ->
          AnyApplication.notifier(activity).askForNotificationPostPermission(this);
      case R.id.skip_notification_permissions_action -> {
        mNotificationSkipped = true;
        refreshWizardPager();
      }
      default ->
          throw new IllegalArgumentException(
              "Failed to handle " + v.getId() + " in WizardPermissionsFragment");
    }
  }
@Test
  @Config(sdk = Build.VERSION_CODES.TIRAMISU)
  public void testHidesNotificationGroupIfNotGrantedButSkipped() {
    var fragment = startFragment();
    var group = fragment.getView().findViewById(R.id.notification_permission_group);
    Assert.assertEquals(View.VISIBLE, group.getVisibility());

    View skipLink = fragment.getView().findViewById(R.id.skip_notification_permissions_action);
    var clickSkipHandler = Shadows.shadowOf(skipLink).getOnClickListener();
    Assert.assertNotNull(clickSkipHandler);

    clickSkipHandler.onClick(skipLink);

    Assert.assertEquals(View.GONE, group.getVisibility());
  }