Closed
Bug 915974
Opened 12 years ago
Closed 12 years ago
USB connections gets disconnected when phone screen times out
Categories
(Firefox OS Graveyard :: General, defect)
Tracking
(firefox27 wontfix, firefox28 fixed, firefox29 fixed, b2g-v1.2 wontfix, b2g-v1.3 fixed, b2g-v1.3T fixed, b2g-v1.4 fixed)
RESOLVED
FIXED
1.3 C1/1.4 S1(20dec)
People
(Reporter: parul, Assigned: dhylands)
References
Details
(Keywords: regression)
Attachments
(1 file, 1 obsolete file)
|
5.49 KB,
patch
|
fabrice
:
review+
lsblakk
:
approval-mozilla-aurora+
|
Details | Diff | Splinter Review |
Test Environment:
Device: Leo
OS version: 1.2.0.0-prerelease
Firmware revision: D300f10a
Hardware revision: d300
Platform version: 26.0a1
Build Identifier: 20130911040201
Update channel: leo/1.2.0/nightly
Gaia: ebbb325
Git commit info: 2013-09-11 10:05:39
Steps to reproduce:
1. Ensure phone has SD Card inserted. Connect phone to computer via USB cable.
2. Go to Settings > Display and set Screen timeout to 1 minute.
3. Go to Settings > Storage and enable USB storage.
Expected Results:
The SD Card on the phone is mounted on the computer and shown as file storage. This should persist even after the phone screen times out in 1 minute.
Actual Results:
The SD Card on the phone is mounted on the computer and shown as file storage. After the phone screen times out in 1 minute, the USB connection breaks. The computer no longer shows the phone SD Card as file storage.
Updated•12 years ago
|
blocking-b2g: --- → koi?
Keywords: regression,
regressionwindow-wanted
Updated•12 years ago
|
QA Contact: nkot
Comment 1•12 years ago
|
||
blocked to test this issue on Leo m-r due to a bug 887486,
the behavior seems to be different on other devices, have tested on Buri 20130911040201 build (same as in comment 0)- the issue does NOT reproduce
Comment 2•12 years ago
|
||
Okay - that implies that this is likely a partner-specific issue.
blocking-b2g: koi? → ---
Component: Gaia::System → Vendcom
Keywords: regressionwindow-wanted
Whiteboard: [POVB]
| Assignee | ||
Comment 3•12 years ago
|
||
The correct behaviour is as follows:
If UMS (USB Mass Storage) is enabled, and the phone is locked, then UMS will remain disabled until the phone is unlocked.
Once UMS is enabled, it should stay enabled, even when the phone locks itself, until the cable is unplugged, or the option is disabled in settings (which further requires that the cable be unplugged to complete).
I tested on master/unagi and it behaves the way its supposed to.
Having a logcat of the failing device would help to identify where the problem is, but it seems to be device specific.
| Assignee | ||
Comment 4•12 years ago
|
||
Hmm. I wonder if this is related to bug 810092 (adb gets disabled when the screen is locked).
If adb is enabled, then disabling adb might be having a side-effect of also disabling UMS (they're both controlled through the same android property), and the actual implementation is vendor specific.
I'll do some further tests on a user build to see if this happens (VARIANT=eng and VARIANT=eng always have adb enabled, so they wouldn't be affected)
| Assignee | ||
Comment 5•12 years ago
|
||
So I can reproduce this on my unagi using a VARIANT=user build with remote debugging enabled. When the screen locks, the UMS session is disabled and re-enabled.
In the code before the screen is locked, persist.sys.usb.config is set to: diag,modem,nmea,mass_storage,adb
When the screen is locked we change persist.sys.usb.config to diag,modem,nmea,mass_storage
The exact behaviour of how this gets dealt with is determined by the vendor portion of the code.
Comment 6•12 years ago
|
||
please triage. comment 5 proves its not specific to partner.
blocking-b2g: --- → koi?
Comment 7•12 years ago
|
||
(In reply to Tony Chung [:tchung] from comment #6)
> please triage. comment 5 proves its not specific to partner.
This is likely povb per above discussion, which doesn't fall under our scope to fix. Unless I'm misinterpreting the above discussion.
| Assignee | ||
Comment 8•12 years ago
|
||
The behaviour is common across many phones, but not all phones (IIRC my sgs2 didn't behave this way).
The behaviour comes from the kernel/init.rc files provided by the SoC provider, which is why you see it across multiple phones.
Comment 9•12 years ago
|
||
Hi Leo,
Refer to command 5, when B2G tried to disable ADB from persist.sys.usb.config, it seems to that the following actions will effect the mass_storage too. Could you help to give some suggestion on this? Thanks.
Flags: needinfo?(leo.bugzilla.fw)
| Assignee | ||
Comment 10•12 years ago
|
||
Another option that we have is that we could detect that mass_storage and adb are both turned on, and not turn off adb when mass_storage is enabled, although I'd probably need to hear that this is OK from our security team.
Flags: needinfo?(ptheriault)
Comment 11•12 years ago
|
||
I think comment10 is the best way to solve the issue, at now.
Flags: needinfo?(leo.bugzilla.fw)
Comment 12•12 years ago
|
||
(In reply to Dave Hylands [:dhylands] (on PTO back Oct 15) from comment #10)
It is a quick and simple way for this issue if there is no security concern. Good suggestion.
| Assignee | ||
Comment 13•12 years ago
|
||
And even though it says I'm on PTO, I will be trying to check emails once a day, and actually working a couple of days after the summit before I get back.
So I'll be available to either code this up, or review a patch if somebody else codes it up (and if not, fabrice can probably do it).
I'd just like to get an ok from Paul. Not disabling adb if mass storage is pretty simple, and would just go in b2g/chrome/content/settings.js
We can easily not disable adb if mass_storage is enabled.
It isn't so easy to have adb also get disabled when mass_storage gets disabled (I'm not aware of any notifications that occur when this happens), but adb will get back in sync as soon as the user goes through the next unlock/lock cycle of the phone.
Right now the automounter uses the ums.mode setting to control the automounter (the settings app uses ums.enabled), but the automounter can change the mode internally without updating the setting. If we had the Automounter reflect its internal mode in the ums.mode, the we could easily add an observer that watches when ums.mode gets set to disabled.
The other way would be if there is a way to observe changes in an android property (which would be useful for another automounter bug). IN that case we could just update the adb state anytime we observe a change in persist.sys.usb.config.
Comment 14•12 years ago
|
||
Not disabling adb while a phone is mounted via USB Mass storage seems fine to me. But I think you mean 'not disabling adb while the user has the 'USB Mass Storage Setting' enabled. That isn't terrible but if there was a way to do the former I would be better.
Or put it this way, my ideal preference for all things USB related are below.
State: Device not connected via USB cable:
If your phone is locked, you can't initiate any USB related connections (UMS, adb shell, remote debugging etc).
If your phone is unlocked, you can initiate any USB connections based on your settings.
State: Device connected via USB cable (as, plugged in, regardless of active debugging, UMS etc)
Only make changes to connections based on settings changes (ie no need to make any changes based on lockscreen state)
Possible Solution?
In "setLockscreenState" can we check if the device is currently connected via USB? If it is connected, then just don't call this.updateState();
Would that do what I outlined above? Not sure if I am missing edge cases or shooting myself in the foot here.
Flags: needinfo?(ptheriault)
Comment 15•12 years ago
|
||
PS I am away from today for a while so CC'ing dchan who can answer in my absence.
| Assignee | ||
Comment 16•12 years ago
|
||
So I think that this means that we need to know either:
1 - When the USB cable is unplugged
2 - When USB Mass Storage changes mode from "disabled when unplugged" to "disabled" (which happens then the USB cable is unplugged).
I'd prefer to implement #2, and since ums.mode is a setting, it would be trivial to make adb update its state whenever ums.mode is changed to disabled.
Updated•12 years ago
|
Whiteboard: [POVB]
Comment 17•12 years ago
|
||
Dave,
This sounds like expected behavior. If not, what next steps? Also, why would this block 1.2?
Flags: needinfo?(dhylands)
Whiteboard: [POVB]
I would say that we should probably file a separate bug to cleanly disconnect the USB Mass storage so that it doesn't corrupt the SD card before locking out the USB Mass storage.
Updated•12 years ago
|
Whiteboard: [POVB]
Updated•12 years ago
|
Component: Vendcom → General
Comment 19•12 years ago
|
||
I spoke about this with Dave via IRC. He agrees we shouldn't hold 1.2 for this since this is only an issue when adb is enabled which isn't terribly common.
blocking-b2g: koi? → -
Flags: needinfo?(dhylands)
| Assignee | ||
Comment 20•12 years ago
|
||
(In reply to Naoki Hirata :nhirata (please use needinfo instead of cc) from comment #18)
> I would say that we should probably file a separate bug to cleanly
> disconnect the USB Mass storage so that it doesn't corrupt the SD card
> before locking out the USB Mass storage.
We can't cleanly disconnect the USB Mass Storage from the phone side. It has to be done from the PC side. So all we can do is to leave adb running until the user stops mass storage on the PC side, and unplugs the USB cable.
| Assignee | ||
Comment 21•12 years ago
|
||
(In reply to Preeti Raghunath(:Preeti) from comment #17)
> Dave,
>
> This sounds like expected behavior. If not, what next steps? Also, why would
> this block 1.2?
I think that we should fix this as described in comment 16 point #2
I don't think that this should block 1.2
| Assignee | ||
Comment 23•12 years ago
|
||
We should also experiment and see if turning remote debugging on after UMS is enabled causes any troubles. If it does, then we need to not allow turning on adb while UMS is enabled.
Tethering may also be impacted, so whatever it is we do for UMS will probably require similar treatment for tethering.
Comment 24•12 years ago
|
||
I'm seeing this on a ZTE Open running master. I was copying music files from PC to phone and it kept getting disconnected when the screen turned off.
| Assignee | ||
Comment 25•12 years ago
|
||
(In reply to Chris Double (:doublec) from comment #24)
> I'm seeing this on a ZTE Open running master. I was copying music files from
> PC to phone and it kept getting disconnected when the screen turned off.
If you turn off remote debugging then it should behave properly.
Comment 26•12 years ago
|
||
Turning off remote debugging make it behave properly. I tested this on Buri V1.2 build.
Steps to reproduce:
1. Ensure phone has SD Card inserted. Connect phone to computer via USB cable.
2. Go to Settings > Device information > More information > Developer and Enable Remote Debugging
3. Go to Settings > Storage and enable USB storage.
You can see SD card is mounted to PC
4. Click "Power" button to Lock Screen
=> USB connection disconnects.
5. Unlock screen
USB connection is established
6. Disable remote debugging
7. Repeat 4,5
USB connection is connected all the time.
Tested build:
Gaia: ce276842c9ac1746073271fb736dfdb626a89240
Gecko: http://hg.mozilla.org/releases/mozilla-b2g26_v1_2/rev/36c4c667b9f2
BuildID 20131121004002
Version 26.0
Comment 27•12 years ago
|
||
This bug does not only affect mass storage devices connected via USB to the phone. It's simply everything which runs via USB. What drives me crazy those days is the internet sharing option via USB. Whenever the screen goes off the USB connection gets killed and so the internet connection on my connected PC. I really don't want to have the screen always on and enabling/disabling the ADB setting is also not an option for me because it makes it even harder to report good logs while dog fooding. For me this is a major limitation as of now. So can we make some progress on it?
Summary: [leo] USB Mass Storage connection breaks when phone screen times out → [leo] USB connections gets disconnected when phone screen times out
| Assignee | ||
Updated•12 years ago
|
Assignee: nobody → dhylands
| Assignee | ||
Comment 29•12 years ago
|
||
Add code to detect if USB Mass Storage, USB Tethering, or a debug session is active, and leave adbg enabled in those scenarios.
Attachment #8347514 -
Flags: review?(fabrice)
Comment 30•12 years ago
|
||
Comment on attachment 8347514 [details] [diff] [review]
Don't disable adb if a USB function is currently active.
Review of attachment 8347514 [details] [diff] [review]:
-----------------------------------------------------------------
Instead of having storageIndex has an AdbController property, turn it into a parameter to updateStorageState().
Attachment #8347514 -
Flags: review?(fabrice) → feedback+
| Assignee | ||
Comment 31•12 years ago
|
||
I like that (I had a fleeting thought about doing that way when I coded it - not sure why I didn't).
Attachment #8347514 -
Attachment is obsolete: true
Attachment #8347555 -
Flags: review?(fabrice)
| Assignee | ||
Comment 32•12 years ago
|
||
Comment on attachment 8347555 [details] [diff] [review]
Don't disable adb if a USB function is currently active. v2
Review of attachment 8347555 [details] [diff] [review]:
-----------------------------------------------------------------
::: b2g/chrome/content/settings.js
@@ +411,5 @@
> if (this.DEBUG) {
> this.debug("updateState: enableAdb = " + enableAdb +
> " remoteDebuggerEnabled = " + this.remoteDebuggerEnabled +
> " lockEnabled = " + this.lockEnabled +
> + " locked = " + this.locked +
I've removed this trailing space in my local patchset.
Comment 33•12 years ago
|
||
Comment on attachment 8347555 [details] [diff] [review]
Don't disable adb if a USB function is currently active. v2
Review of attachment 8347555 [details] [diff] [review]:
-----------------------------------------------------------------
r=me with nits fixed
::: b2g/chrome/content/settings.js
@@ +340,5 @@
> + }.bind(this);
> + req.onerror = function(e) {
> + dump("AdbController: error querying storage availability for '" +
> + this.storages[storageIndex].storageName + "' (ignoring)\n");
> + this.updateStorageState();
this should be this.updateStorageState(storageIndex + 1);
@@ +411,5 @@
> if (this.DEBUG) {
> this.debug("updateState: enableAdb = " + enableAdb +
> " remoteDebuggerEnabled = " + this.remoteDebuggerEnabled +
> " lockEnabled = " + this.lockEnabled +
> + " locked = " + this.locked +
nit: trailing whitespace.
Attachment #8347555 -
Flags: review?(fabrice) → review+
| Assignee | ||
Comment 34•12 years ago
|
||
Comment 35•12 years ago
|
||
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 36•12 years ago
|
||
I hope that we can get this backported to 1.2.
status-b2g-v1.2:
--- → affected
| Assignee | ||
Comment 37•12 years ago
|
||
Nominating for 1.2 and/or 1.3
Impact: This patch only affects users which use adb (i.e. typically developers).
Risk: This patch affects the code which is used to determine when adb is enabled/disabled. I think this makes it fairly low risk.
blocking-b2g: - → koi?
Comment 38•12 years ago
|
||
(In reply to Dave Hylands [:dhylands] from comment #37)
> Nominating for 1.2 and/or 1.3
>
> Impact: This patch only affects users which use adb (i.e. typically
> developers).
>
> Risk: This patch affects the code which is used to determine when adb is
> enabled/disabled. I think this makes it fairly low risk.
I don't think this would be a good candidate to block 1.2 on - we're way late in the release at this point, so we should only be blocking at extremely critical issues. We could certainly consider this for approval for 1.3, however.
| Assignee | ||
Comment 39•12 years ago
|
||
That was my thinking as well. I'll change it to 1.3?
blocking-b2g: koi? → 1.3?
Comment 40•12 years ago
|
||
(In reply to Dave Hylands [:dhylands] from comment #39)
> That was my thinking as well. I'll change it to 1.3?
I was actually meaning approval, not blocking however. Can you ask for approval for 1.3 here?
blocking-b2g: 1.3? → ---
Flags: needinfo?(dhylands)
| Assignee | ||
Comment 41•12 years ago
|
||
Comment on attachment 8347555 [details] [diff] [review]
Don't disable adb if a USB function is currently active. v2
[Approval Request Comment]
Bug caused by (feature/regressing bug #): bug 810092
User impact if declined: USB sessions (USB Mass Storage, USB Tethering, adb sessions, and remote debugging sessions) get disconnected on production devices when the screen gets locked, or the 12 hour timeout expires.
Testing completed (on m-c, etc.): Already landed on m-c. Seems to be working fine.
Risk to taking this patch (and alternatives if risky): Low
String or IDL/UUID changes made by this patch: None
Attachment #8347555 -
Flags: approval-mozilla-aurora?
Flags: needinfo?(dhylands)
| Assignee | ||
Comment 42•12 years ago
|
||
Removed leo from the title since this impacts all of the phones we're supporting.
Summary: [leo] USB connections gets disconnected when phone screen times out → USB connections gets disconnected when phone screen times out
Updated•12 years ago
|
Attachment #8347555 -
Flags: approval-mozilla-aurora? → approval-mozilla-aurora+
Updated•12 years ago
|
Whiteboard: [checkin-needed-aurora]
Comment 43•12 years ago
|
||
https://hg.mozilla.org/releases/mozilla-aurora/rev/284895507d2d
Is this wontfix for v1.2?
status-b2g-v1.3:
--- → fixed
status-b2g-v1.4:
--- → fixed
status-firefox27:
--- → wontfix
status-firefox28:
--- → fixed
status-firefox29:
--- → fixed
Flags: needinfo?(dhylands)
Whiteboard: [checkin-needed-aurora]
Target Milestone: --- → 1.3 C1/1.4 S1(20dec)
| Assignee | ||
Comment 44•12 years ago
|
||
(In reply to Ryan VanderMeulen [:RyanVM UTC-5] from comment #43)
> https://hg.mozilla.org/releases/mozilla-aurora/rev/284895507d2d
>
> Is this wontfix for v1.2?
I believe so.
Flags: needinfo?(dhylands)
Updated•12 years ago
|
Comment 45•11 years ago
|
||
I Have this problem on my ZTE OPEN C, how to fix?
| Assignee | ||
Comment 46•11 years ago
|
||
(In reply to vampirefo from comment #45)
> I Have this problem on my ZTE OPEN C, how to fix?
Which version of software are you running?
If you're running 1.2, then the only fix I'm aware of is to disable the lock screen.
Looking at the patch from https://hg.mozilla.org/releases/mozilla-aurora/rev/284895507d2d it appears to be pure JS, so if you've got root access you can probably patch your phone.
You would need to pull /system/b2g/omni.ja, unpack it (it's a zip file), and apply the patch to the chrome/chome/content/settings.js file, repack omni.ja and push it to the phone.
Comment 47•11 years ago
|
||
I am using 1.3, I am new to firefox and don't know to do this, but will give it a try thanks.
| Assignee | ||
Comment 48•11 years ago
|
||
If you(In reply to vampirefo from comment #47)
> I am using 1.3, I am new to firefox and don't know to do this, but will give
> it a try thanks.
This was fixed in 1.3, so you shouldn't need to do anything.
Comment 49•11 years ago
|
||
LOL, if it was fixed, I wouldn't have the problem, so it's not fixed in my version of 1.3
Comment 50•11 years ago
|
||
I have to add that I also have seen this yesterday with latest 1.4. I was using internet sharing via USB and the connection dropped when the screen turned off. Looks like we need a follow-up bug here.
Comment 51•11 years ago
|
||
I was told yesterday this isn't a bug but a security feature added to the OS, I didn't like that answer, as this is an inconvenience, not a security issue, some developer wants to play big brother, was told to install another OS to fix problem, then finally one person told me to disable lock screen, this fixed it. Now if firefox would stop playing big brother and just develop the OS and stop adding fake security features to the phones, firefox would be a great OS.
firefox has decided to go the way windows did, and start crippling the OS for no reason um (security), that's why I stopped using windows back in 2003 the fake security bs, hopefully firefox devs, will revers this in next build or simply add a override or disable feature to this useless feature.
https://groups.google.com/forum/#!topic/mozilla.dev.b2g/o7IvjPuZCMA
| Assignee | ||
Comment 52•11 years ago
|
||
(In reply to Henrik Skupin (:whimboo) from comment #50)
> I have to add that I also have seen this yesterday with latest 1.4. I was
> using internet sharing via USB and the connection dropped when the screen
> turned off. Looks like we need a follow-up bug here.
I think that we should open a separate bug for internet sharing.
This code:
http://dxr.mozilla.org/mozilla-central/source/b2g/chrome/content/settings.js#364
will need to have "usbFuncActive" updated to include "internet sharing".
Isn't "internet sharing" the same thing as "rndis".
Comment 53•11 years ago
|
||
I filed bug 1025791 for the USB tethering case.
Updated•11 years ago
|
status-b2g-v1.3T:
--- → fixed
You need to log in
before you can comment on or make changes to this bug.
Description
•