-
Notifications
You must be signed in to change notification settings - Fork 3.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
check status of external storage before file write/update #1221
Conversation
//private static final String LOG_TAG = "FileStorageUtils"; | ||
|
||
public static final boolean isStorageWritable() { | ||
return Environment.getExternalStorageState() == Environment.MEDIA_MOUNTED; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should imho be implemented with an equals since you are comparing Strings and to make it null safe I would suggest:
return Environment.MEDIA_MOUNTED.equals(Environment.getExternalStorageState());
Hi @templateK In case this is your first PR to any ownCloud repo, please fill out the contributor agreement, see https://owncloud.org/contribute/agreement/ , sign it and send it to @karlitschek and probably to @masensio |
In file writing functions at FileDataStorageManager class, Android external storage has many state for example, not-mounted, read-only etc. So, I added condition that checks writable status of external storage to these functions. |
I didn't noticed that there's contributor agreement. Sorry, that for my bad. |
AFAIR you can also say that your code is under a special license, if you do not want to sign anything... |
User of the commit is unknown - cannot determine CLA |
closing... not scheduled |
check status of external storage before file write/update