MraidNativeCommandHandler { public boolean isStorePictureSupported(Context context) { return MEDIA_MOUNTED.equals(Environment.getExternalStorageState()) && context.checkCallingOrSelfPermission(WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED; }  boolean isStorePictureSupported(Context context); static final String ANDROID_CALENDAR_CONTENT_TYPE; }
@Test public void isStorePictureAvailable_whenPermissionDeclaredAndMediaMounted_shouldReturnTrue() throws Exception { Robolectric.getShadowApplication().grantPermissions(Manifest.permission.WRITE_EXTERNAL_STORAGE); ShadowEnvironment.setExternalStorageState(Environment.MEDIA_MOUNTED); assertThat(subject.isStorePictureSupported(context)).isTrue(); }
@Test public void isStorePictureAvailable_whenPermissionDenied_shouldReturnFalse() throws Exception { Robolectric.getShadowApplication().denyPermissions(Manifest.permission.WRITE_EXTERNAL_STORAGE); ShadowEnvironment.setExternalStorageState(Environment.MEDIA_MOUNTED); assertThat(subject.isStorePictureSupported(context)).isFalse(); }
@Test public void isStorePictureAvailable_whenMediaUnmounted_shouldReturnFalse() throws Exception { Robolectric.getShadowApplication().grantPermissions(Manifest.permission.WRITE_EXTERNAL_STORAGE); ShadowEnvironment.setExternalStorageState(Environment.MEDIA_UNMOUNTED); assertThat(subject.isStorePictureSupported(context)).isFalse(); }