Office Hours — Today, March 16

Friday, March 6

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
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
unless it uses root or something, and the user removed some critical file, I fail to see how your app could brick the phone
9:00 AM
Mark M.
there should be nothing on external storage that would prevent a device from booting
and that's all you have access to by default
EGHDK
I have permission to "WRITE_EXTERNAL_STORAGE"
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
your app's portion of internal storage is getFilesDir(), getCacheDir(), etc.
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
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
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
IMHO, that's a bug on the device manufacturer's part
but, this is a reason why I don't write apps that mess with arbitrary data :-(
9:10 AM
EGHDK
Yep. Makes sense.
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
9:15 AM
Mark M.
internal and external storage are on the same partition (the /data partition)
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?
pc
Mark M.
"pc" is not an OS
EGHDK
sorry
windows or linux
Mark M.
well, if you using Linux, you really should know what partitions are
with respect to Windows, for the purposes of this conversation, a partition roughly equals a drive letter
or, more accurately, a drive letter points to a partition
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
internal and external storage are not "drives"
EGHDK
Yeah, I've mounted stuff via cmd line before in linux
oh.
Okay, that makes more sense.
9:20 AM
Mark M.
and there are other subdirectories of /data that are not part of either internal or external storage
9:25 AM
EGHDK
Blowing my mind here Mark.
Hahah. Data and data in android is scary.
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
out-of-disk-space is the one scenario where I could see you affecting something that broke the boot
though even then the device should be able to wipe out apps' getCacheDir() and getExternalCacheDir() to get enough room
if you are writing a file manager, though, it would behoove you to ensure that you don't consume all disk space
9:30 AM
EGHDK
Thanks.
That's all for me. Take care. Enjoy the nice(r) weather!
Mark M.
thanks!
9:50 AM
EGHDK
has left the room
10:00 AM
Mark M.
turned off guest access

Friday, March 6

 

Office Hours

People in this transcript

  • EGHDK
  • Mark Murphy