Mar 16 | 8:55 AM |
Mark M. | has entered the room |
Mark M. | turned on guest access |
EGHDK | has entered the room |
Mark M. |
hello, EGHDK
|
Mark M. |
how can I help you today?
|
EGHDK |
I have a user indicating that my file eraser app bricked his phone. Is this possible? He is saying that his galaxy S4 has encryption turned on, after he turned on my app and ran it, then after a little while he rebooted, and then said that the device wont boot.
|
Mark M. |
um
|
Mark M. |
unless it uses root or something, and the user removed some critical file, I fail to see how your app could brick the phone
|
Mar 16 | 9:00 AM |
Mark M. |
there should be nothing on external storage that would prevent a device from booting
|
Mark M. |
and that's all you have access to by default
|
EGHDK |
I have permission to "WRITE_EXTERNAL_STORAGE"
|
EGHDK |
but you're saying that anything that the devices needs to boot would be on "internal" storage?
|
Mark M. |
more importantly, most will be on the /system partition
|
EGHDK |
Which is "internal"?
|
Mark M. |
neither, really
|
Mark M. |
your app's portion of internal storage is getFilesDir(), getCacheDir(), etc.
|
Mar 16 | 9:05 AM |
EGHDK |
Hmm... I'm using getDir()
|
Mark M. |
getFilesDir(), getCacheDir(), etc. all route to getDir() AFAIK
|
EGHDK |
Either way though. Without root, I can't touch the system directory (or is it a partition)?
|
Mark M. |
/system is a directory, mounted on a partition
|
EGHDK |
And thats what would only be the realistic thing that could mess up a phone (messing with /system)?
|
Mark M. |
and, yes, without superuser privileges (a.k.a., root), you cannot write there
|
Mark M. |
it is the primary area of where modifications could brick a phone
|
EGHDK |
Okay, that's all I need. I just want to be able to give the user an answer.
|
Mark M. |
now, there are thousands of Android devices
|
Mark M. |
and I can't rule out the possibility that some device somewhere depends upon a file that could be deleted by your app even without root
|
Mark M. |
IMHO, that's a bug on the device manufacturer's part
|
Mark M. |
but, this is a reason why I don't write apps that mess with arbitrary data :-(
|
Mar 16 | 9:10 AM |
EGHDK |
Yep. Makes sense.
|
EGHDK |
Is my application data on "external" storage though?
|
Mark M. |
if you mean getDir(), then no
|
EGHDK |
The user thinks that my application created too much data, and then couldn't boot up.
|
Mark M. |
running out of disk space could interfere with a boot, I suppose
|
Mar 16 | 9:15 AM |
Mark M. |
internal and external storage are on the same partition (the /data partition)
|
Mark M. |
and so from a disk space standpoint, both pull from the same place
|
EGHDK |
gotcha. I don't really understand that, but that may be my lack of knowledge of how a partition works.
|
Mark M. |
what OS are you using for your developer PC? Windows?
|
EGHDK |
I don't get how internal and external could be on the same /data dir?
|
EGHDK |
pc
|
Mark M. |
"pc" is not an OS
|
EGHDK |
sorry
|
EGHDK |
windows or linux
|
Mark M. |
well, if you using Linux, you really should know what partitions are
|
Mark M. |
with respect to Windows, for the purposes of this conversation, a partition roughly equals a drive letter
|
Mark M. |
or, more accurately, a drive letter points to a partition
|
Mark M. |
in Linux, a partition mounts to a directory (e.g., /data)
|
EGHDK |
Well, I know what a partition is, but I didn't know that you can have two drives (external and internal storage) make up one partition.
|
Mark M. |
internal and external storage are separate directories inside that root /data directory
|
Mark M. |
internal and external storage are not "drives"
|
EGHDK |
Yeah, I've mounted stuff via cmd line before in linux
|
EGHDK |
oh.
|
EGHDK |
Okay, that makes more sense.
|
Mar 16 | 9:20 AM |
Mark M. |
and there are other subdirectories of /data that are not part of either internal or external storage
|
Mar 16 | 9:25 AM |
EGHDK |
Blowing my mind here Mark.
|
EGHDK |
Hahah. Data and data in android is scary.
|
EGHDK |
I guess I can look into that later though. In a nutshell... an application shouldn't have permission to mess with a devices boot up process.
|
Mark M. |
a device should be robust enough to handle anything you could affect
|
Mark M. |
out-of-disk-space is the one scenario where I could see you affecting something that broke the boot
|
Mark M. |
though even then the device should be able to wipe out apps' getCacheDir() and getExternalCacheDir() to get enough room
|
Mark M. |
if you are writing a file manager, though, it would behoove you to ensure that you don't consume all disk space
|
Mar 16 | 9:30 AM |
EGHDK |
Thanks.
|
EGHDK |
That's all for me. Take care. Enjoy the nice(r) weather!
|
Mark M. |
thanks!
|
Mar 16 | 9:50 AM |
EGHDK | has left the room |
Mar 16 | 10:00 AM |
Mark M. | turned off guest access |