New issue
Advanced search Search tips

Issue 800362 link

Starred by 15 users

Issue metadata

Status: Fixed
Owner:
Closed: Apr 2018
Cc:
EstimatedDays: ----
NextAction: ----
OS: Chrome
Pri: 1
Type: Bug



Sign in to add a comment

Unable to write to SD Card in Android on Chromebook (ARC)

Reported by jason.so...@gmail.com, Jan 9 2018

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_13_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36
Platform: 10032.75.0 (Official Build) stable-channel veyron_minnie

Steps to reproduce the problem:
Scenario 1
1.  Run attached test case app
2.  Choose "Save the file (Directory)" from the menu in the upper right hand corner
3.  Choose the SD Card directory and hit Select

alternatively

Scenario 2
1.  Run attached test case app
2.  Choose "Save the file (File)" from the menu in the upper right hand corner
3.  Choose the SD Card directory and hit Save

What is the expected behavior?
The user can save a file to the SD card

What went wrong?
Both scenarios work fine on an Android device with an SD card (at least with the emulator).  On a Chromebook with ARC, you can perform both scenarios to locations other than the SD Card.  For the SD Card, Scenario 1 will let you select the location but the save of the file fails with an exception like this :

W/DocumentsContract: Failed to create document
                     java.lang.IllegalStateException: Failed to touch /var/run/arc/media/removable/UNTITLED/20180103-131600-Started.log.txt: java.io.IOException: Permission denied
                         at android.os.Parcel.readException(Parcel.java:1692)

For the SD Card on a Chromebook, Scenario 2 will not even let you select the SD Card as the path (you can see it however, just not choose it).  Reading files seems to work fine, but you cannot write them in Android/ARC on a Chromebook.

Did this work before? N/A 

Does this work in other browsers? N/A

Chrome version: 63.0.3239.116  Channel: stable
OS Version: 63.0.3239.116 (Official Build) (32-bit)
Flash Version: 

Related to cr bug :  660189 

The test case app is a modified Storage Client Framework example and uses the ACTION_OPEN_DOCUMENT_TREE and ACTION_CREATE_DOCUMENT intents

I was able to write to the SD Card from ChromeOS itself, so the card isn't read only.  The SD card is formatted by ChromeOS, so it should be Fat32.

I see some crbugs (789045) mention using the removable storage API (https://developer.android.com/training/articles/scoped-directory-access.html#removable), but I need to support pre 7.0 devices (non ARC obviously).

Should I be trying something other than Storage Access Framework to write to an SD Card on Android on a Chromebook?

Version 63.0.3239.116 (Official Build) (32-bit)

Platform
10032.75.0 (Official Build) stable-channel veyron_minnie

Firmware
Google_Veyron_Minnie.6588.237.0

Channel
Currently on stable

ARC Version
4505339

Android version 7.1.1

Security patch level 
November 1, 2017

Kernel version
3.1.14.0
chrome-bot@cros-beefy331-c2 #1
Mon Dec 18 20:22:56 PST 2017

Build number
R63-10032 75.0 release-keys
 
android-StorageClient.zip
336 KB Download
Cc: maxkirsch@chromium.org hashimoto@chromium.org risan@chromium.org
hashimoto@ / risan@, is this your area? If so can you take a look?

Comment 2 by vsu...@google.com, Jan 10 2018

Components: Platform>ARC
Owner: hashimoto@chromium.org
Status: Assigned (was: Unconfirmed)
Thank you for filing this detailed report.

I guess the scenario #1 can be fixed by changing the mount option in the container to make it not read-only.
I think it's OK in terms of security, but let me consult someone for double check.

The scenario #2 looks more complicated, I'll take a closer look later.

Comment 4 by raniel...@gmail.com, Jan 16 2018

Any updates on this yet?
Any updates?
Labels: -Pri-2 M-68 Pri-1
Status: Started (was: Assigned)
Project Member

Comment 7 by bugdroid1@chromium.org, Apr 16 2018

The following revision refers to this bug:
  https://chromium.googlesource.com/chromiumos/platform2/+/3030923c51e087052549078b4ad40df3f6be3734

commit 3030923c51e087052549078b4ad40df3f6be3734
Author: Ryo Hashimoto <hashimoto@google.com>
Date: Mon Apr 16 16:20:21 2018

arc-removable-media: Make /run/arc/media/removable writable

BUG= chromium:800362 
TEST=test_that cheets_RemovableMedia

Change-Id: I300e92fa0ba324fa832ca985ef62f3ffccff2050
Reviewed-on: https://chromium-review.googlesource.com/1006714
Commit-Ready: Ryo Hashimoto <hashimoto@chromium.org>
Tested-by: Ryo Hashimoto <hashimoto@chromium.org>
Reviewed-by: Shuhei Takahashi <nya@chromium.org>

[modify] https://crrev.com/3030923c51e087052549078b4ad40df3f6be3734/arc/removable-media/arc-removable-media.conf

Comment 8 by raniel...@gmail.com, Apr 16 2018

Is it possible to get this moved in an earlier release?

Comment 9 by raniel...@gmail.com, Apr 20 2018

We are hoping in adding this functionality in our app this summer. It would help us considerably if we could get this moved to an earlier release. Looking at the change, it's a simple one line fix of changing permissions when mounting removeable media.

Comment 10 by uekawa@google.com, Apr 24 2018

Re #8 
You can try out canary channel / dev channel and see if this feature works for you.

M68 is going to be stable this summer.



Status: Fixed (was: Started)
Is it possible to get this moved to M67
#12, 

The first step is to verify this actually works on M-68. 

Since we're already on second beta on M67 it's relatively risky to chnage M-67 at this point.
#13,

We tried it on M-68 and it does work. 

Sign in to add a comment