File dir = getDir(null, dirname);
<BUG>return getFile(dir);
</BUG>
}
<BUG>private File getFile(File dir) {
</BUG>
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(Constants.DATE_FORMAT, new Locale(Constants.LOCALE_EN));
String datetime = simpleDateFormat.format(new Date());
<BUG>File file = new File(dir.getAbsolutePath(), "IMG-" + datetime + ".jpg");
</BUG>
while (file.exists()) {

File dir = getDir(null, dirname);
return getFile(dir, extension);
}
private File getFile(File dir, String extension) {
SimpleDateFormat simpleDateFormat = new SimpleDateFormat(Constants.DATE_FORMAT, new Locale(Constants.LOCALE_EN));
String datetime = simpleDateFormat.format(new Date());
File file = new File(dir.getAbsolutePath(), "IMG-" + datetime + extension);
while (file.exists()) {
