- // Create a string for the default file path.
- String defaultFilePath;
-
- // Set the default file path according to the storage permission state.
- if (ContextCompat.checkSelfPermission(parentContext, Manifest.permission.WRITE_EXTERNAL_STORAGE) == PackageManager.PERMISSION_GRANTED) { // The storage permission has been granted.
- // Set the default file path to use the external public directory.
- defaultFilePath = Environment.getExternalStorageDirectory() + "/" + getString(R.string.privacy_browser_logcat_txt);
- } else { // The storage permission has not been granted.
- // Set the default file path to use the external private directory.
- defaultFilePath = parentContext.getExternalFilesDir(null) + "/" + getString(R.string.privacy_browser_logcat_txt);
- }
-
- // Display the default file path.
- fileNameEditText.setText(defaultFilePath);
+ // Remove the incorrect lint warnings below that the views might be null.
+ assert fileNameEditText != null;
+ assert browseButton != null;
+ assert fileExistsWarningTextView != null;
+ assert storagePermissionTextView != null;