@Override
  protected boolean isStepCompleted(@NonNull Context context) {
    // note: we can not use mSharedPrefs, since this method might be
    // called before onAttached is called.
    return (mSharedPrefs == null ? DirectBootAwareSharedPreferences.create(context) : mSharedPrefs)
            .getBoolean(SKIPPED_PREF_KEY, false)
        || SetupSupport.hasLanguagePackForCurrentLocale(
            AnyApplication.getKeyboardFactory(context).getAllAddOns());
  }
@Test
  public void testPageCompleteIfStartedWithLanguagePackInstalled() {
    Locale.setDefault(Locale.US);
    WizardLanguagePackFragment fragment = startFragment();
    Assert.assertTrue(fragment.isStepCompleted(getApplicationContext()));

    ImageView stateIcon = fragment.getView().findViewById(R.id.step_state_icon);
    Assert.assertNotNull(stateIcon);

    Assert.assertFalse(stateIcon.isClickable());
    Assert.assertEquals(
        R.drawable.ic_wizard_download_pack_ready,
        Shadows.shadowOf(stateIcon.getDrawable()).getCreatedFromResId());
  }