Apply suggestions from code review
Refactored for conciseness Co-authored-by: Tobi <TobiGr@users.noreply.github.com>
This commit is contained in:
parent
5762da2dbd
commit
0821adc486
|
@ -885,17 +885,16 @@ public class DownloadDialog extends DialogFragment
|
|||
|
||||
// Check for free memory space (for api 24 and up)
|
||||
if (android.os.Build.VERSION.SDK_INT >= android.os.Build.VERSION_CODES.N) {
|
||||
final long freeSpace;
|
||||
freeSpace = mainStorage.getFreeMemory();
|
||||
final long freeSpace = mainStorage.getFreeMemory();
|
||||
if (freeSpace <= size) {
|
||||
Toast.makeText(context, getString(R.
|
||||
string.error_insufficient_storage), Toast.LENGTH_LONG).show();
|
||||
// move the user to storage setting tab
|
||||
final Intent storageSettingsIntent = new Intent(Settings.
|
||||
ACTION_INTERNAL_STORAGE_SETTINGS);
|
||||
NoFileManagerSafeGuard.launchSafe(requestStorageSettingsLauncher,
|
||||
storageSettingsIntent, TAG,
|
||||
context);
|
||||
if (storageSettingsIntent.resolveActivity(context.getPackageManager()) != null) {
|
||||
startActivity(storageSettingsIntent);
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue