Store voice messages in cache too when store in cache activated
This commit is contained in:
parent
bfbaf3278a
commit
dc33e904e5
1 changed files with 9 additions and 5 deletions
|
@ -5469,12 +5469,16 @@ public class ConversationFragment extends XmppFragment
|
||||||
final String filename =
|
final String filename =
|
||||||
String.format("RECORDING_%s.%s", dateFormat.format(new Date()), extension);
|
String.format("RECORDING_%s.%s", dateFormat.format(new Date()), extension);
|
||||||
final File parentDirectory;
|
final File parentDirectory;
|
||||||
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
if (conversation.storeInCache()) {
|
||||||
parentDirectory =
|
parentDirectory = new File(activity.xmppConnectionService.getCacheDir(), "/media");
|
||||||
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_RECORDINGS);
|
|
||||||
} else {
|
} else {
|
||||||
parentDirectory =
|
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.S) {
|
||||||
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
|
parentDirectory =
|
||||||
|
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_RECORDINGS);
|
||||||
|
} else {
|
||||||
|
parentDirectory =
|
||||||
|
Environment.getExternalStoragePublicDirectory(Environment.DIRECTORY_DOWNLOADS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
final File conversationsDirectory = new File(parentDirectory, getString(R.string.app_name));
|
final File conversationsDirectory = new File(parentDirectory, getString(R.string.app_name));
|
||||||
return new File(conversationsDirectory, filename);
|
return new File(conversationsDirectory, filename);
|
||||||
|
|
Loading…
Add table
Reference in a new issue