If you create a recording file with the same name as a folder in that directory, you will be unable to create the recording file
f.exists() && !f.isDirectory() has problem in RecordingService.java
public void setFileNameAndPath(boolean isFilePathTemp) {
if (isFilePathTemp) {
mFileName = getString(R.string.default_file_name) + (++tempFileCount) + "_" + ".tmp";
mFilePath = Paths.combine(
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC),
Paths.SOUND_RECORDER_FOLDER, mFileName);
} else {
int count = 0;
File f;
do {
++count;
mFileName =
getString(R.string.default_file_name) + "_" + (mDatabase.getCount() + count) + ".mp4";
mFilePath = Paths.combine(
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_MUSIC),
Paths.SOUND_RECORDER_FOLDER, mFileName);
f = new File(mFilePath);
} while (f.exists() && !f.isDirectory());//Bug in here
}
}
If you create a recording file with the same name as a folder in that directory, you will be unable to create the recording file
f.exists() && !f.isDirectory()has problem in RecordingService.java