@Override
  protected boolean isStepCompleted(@NonNull Context context) {
    return isContactsPermComplete(context) && isNotificationPermComplete(context);
  }
@Test
  public void testKeyboardEnabledAndDefaultButNoPermission() {
    final String flatASKComponent =
        new ComponentName(BuildConfig.APPLICATION_ID, SoftKeyboard.class.getName())
            .flattenToString();
    Settings.Secure.putString(
        getApplicationContext().getContentResolver(),
        Settings.Secure.ENABLED_INPUT_METHODS,
        flatASKComponent);
    Settings.Secure.putString(
        getApplicationContext().getContentResolver(),
        Settings.Secure.DEFAULT_INPUT_METHOD,
        flatASKComponent);

    WizardPermissionsFragment fragment = startFragment();
    Assert.assertFalse(fragment.isStepCompleted(getApplicationContext()));

    var contacts = fragment.getView().findViewById(R.id.contacts_permission_group);
    Assert.assertEquals(View.VISIBLE, contacts.getVisibility());

    // no need for this in M
    var notifications = fragment.getView().findViewById(R.id.notification_permission_group);
    Assert.assertEquals(View.GONE, notifications.getVisibility());

    // can handle wiki?
    fragment.getView().findViewById(R.id.open_permissions_wiki_action).performClick();
    Intent wikiIntent =
        Shadows.shadowOf((Application) ApplicationProvider.getApplicationContext())
            .getNextStartedActivity();
    Assert.assertEquals(Intent.ACTION_VIEW, wikiIntent.getAction());
    Assert.assertEquals(
        "https://github.com/AnySoftKeyboard/AnySoftKeyboard/wiki/Why-Does-AnySoftKeyboard-Requires-Extra-Permissions",
        wikiIntent.getData().toString());
    // can disable Contacts
    fragment.getView().findViewById(R.id.disable_contacts_dictionary).performClick();
    Assert.assertFalse(
        SharedPrefsHelper.getPrefValue(R.string.settings_key_use_contacts_dictionary, true));

    // disabling contacts
    Assert.assertTrue(fragment.isStepCompleted(getApplicationContext()));
  }