I have an application that creates a log file on external device and passes the log file path to the underlying ndk library for logging.
I am using Environment.MEDIA_MOUNTED.equals(state) before creating the log file to check whether the external storage is available for logging. My question is what will happen if the user mounts the device onto a computer after creating the log file?
Would my application still be able to access the log file?
As Drake said in his comment, when you attach the phone to a computer and choose to mount it as a drive the external storage will become unavailable to the phone. I guess you read it but it’s described here.