shadows/framework/src/main/java/org/robolectric/shadows/ShadowEnvironment.java
public static void setExternalStorageState(File directory, String state) {
    storageState.put(directory.toPath(), state);
  }
public static void setExternalStorageState(File directory, String state) {
    storageState.put(directory.toPath(), state);
  }
Sets the {@link #getExternalStorageState(File)} for given directory.

@param externalStorageState Value to return from {@link #getExternalStorageState(File)}.