Hot-swapped SIMs should be detected and prompt user to reboot

Bug #1332306 reported by Tony Espy
68
This bug affects 12 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Confirmed
Wishlist
Unassigned
indicator-network (Ubuntu)
Triaged
High
Unassigned
ofono (Ubuntu)
Triaged
High
Tony Espy
unity8 (Ubuntu)
Triaged
High
Unassigned

Bug Description

Our telephony stack doesn't support hot-swapping of SIM cards. If a user hot-swaps a SIM, the telephony stack will become unusable.

The telephony-service should detect when this happens and display a snap-decision informing the user that they need to restart their device.

<https://wiki.ubuntu.com/Networking#Inserting_a_new_SIM>: ‘If you insert a new SIM, a “Changing SIM” dialog should appear with the text “To use this new SIM, we need to restart.” and buttons “Later” and “Restart Now”.’

Summary of required work:
 - enabling ofono hotswap support through environment variable
 - adding the modal dialog to unity8 side
 - modify i-network to detect the hotswapping and trickering
   the dialog from unity8

Tags: ota-1 rtm14

Related branches

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in telephony-service (Ubuntu):
status: New → Confirmed
Revision history for this message
Martti Piirainen (piiramar) wrote :

This needs to be fixed in oFono, too. oFono currently doesn't signal SIM removal to its clients (it should do so via property org.ofono.SimManager.Present).

In bug 1329926, I wrote "currently, there are no proper UNSOL_RESPONSE_SIM_STATUS_CHANGED events coming out of the RIL API" but that's not entirely correct. In mako hardware, SIM card removal is correctly signalled by RIL to oFono.

SIM card insertion is not signalled by RIL (for reference, also not with Android SW), so we have no way of recognizing that. This might behave differently on other HW than mako.

Revision history for this message
Martti Piirainen (piiramar) wrote :

oFono fix proposal at https://github.com/rilmodem/ofono/pull/99 . With this fix, SIM card removal is signalled to D-Bus clients
   root@ubuntu-phablet:~# /usr/share/ofono/scripts/monitor-ofono
   {SimManager} [/ril_0] Present = False
and a "Please Reboot" dialog can be implemented on top.

Changed in ofono (Ubuntu):
assignee: nobody → Martti Piirainen (piiramar)
Tony Espy (awe)
Changed in ofono (Ubuntu):
status: New → In Progress
importance: Undecided → High
Changed in telephony-service (Ubuntu):
importance: Undecided → High
tags: added: rtm14
Changed in telepathy-ofono (Ubuntu):
status: New → Confirmed
Changed in telephony-service (Ubuntu):
assignee: nobody → Gustavo Pichorim Boiko (boiko)
Changed in telepathy-ofono (Ubuntu):
assignee: nobody → Tiago Salem Herrmann (tiagosh)
Tony Espy (awe)
Changed in ofono (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ofono - 1.12.bzr6870+14.10.20140721-0ubuntu1

---------------
ofono (1.12.bzr6870+14.10.20140721-0ubuntu1) utopic; urgency=medium

  [ Martti Piirainen ]
  * drivers/rilmodem/sim.c: notify on SIM removal (LP: #1332306)
  * unit/rilmodem/test-sim-online: fix serial number check (LP: #1334867)

  [ Alfonso Sanchez-Beato ]
  * plugins/mtk.c: fix race condition when onlining modem
  * build, drivers/infeonmodem, drivers/rilmodem, gril,
    plugins/infeon.c, plugins/ril.*, unit: add Infeon OEM hooks

  [ Tony Espy ]
  * build, plugins/ubuntu-provision.c, ubuntu-apndb.*: re-named
    provisioning plugin code from android-* to ubuntu-*. Also removed
    code that queries mobile-broadband-provider-info's db, and finally
    implemented a /custom hook for custom apn dbs (LP: #1315509).
 -- Ubuntu daily release <email address hidden> Mon, 21 Jul 2014 18:59:17 +0000

Changed in ofono (Ubuntu):
status: Fix Committed → Fix Released
Bill Filler (bfiller)
Changed in telephony-service:
status: New → Confirmed
importance: Undecided → High
assignee: nobody → Gustavo Pichorim Boiko (boiko)
Bill Filler (bfiller)
Changed in telepathy-ofono (Ubuntu):
importance: Undecided → High
Bill Filler (bfiller)
Changed in telephony-service (Ubuntu):
assignee: Gustavo Pichorim Boiko (boiko) → Tiago Salem Herrmann (tiagosh)
Changed in telephony-service:
assignee: Gustavo Pichorim Boiko (boiko) → Tiago Salem Herrmann (tiagosh)
tags: added: touch-2014-09-25
Bill Filler (bfiller)
Changed in indicator-network (Ubuntu):
importance: Undecided → High
assignee: nobody → Antti Kaijanmäki (kaijanmaki)
no longer affects: telepathy-ofono (Ubuntu)
no longer affects: telephony-service (Ubuntu)
no longer affects: telephony-service
Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

With krillin image 27 the Present signal is _not_ sent. I tested both with gdbus and monitor-ofono. The status claims "fix released", though, so something is amiss.

Revision history for this message
Olga Kemmet (olga-kemmet) wrote :

Not sure if this is/was taken into consideration but the dialog should be triggered if either of the SIM slots (on a dual SIM phone) detects a SIM card.

Changed in indicator-network (Ubuntu):
assignee: Antti Kaijanmäki (kaijanmaki) → Jussi Pakkanen (jpakkane)
status: New → Triaged
Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

According to ofono guys this feature should have landed by today's image. But it still does not work:

{ConnectionManager} [/ril_0] Attached = True
{ConnectionManager} [/ril_0] Bearer = umts
{Modem} [/ril_0] Powered = False
{Modem} [/ril_0] Online = False
{Modem} [/ril_0] Interfaces = []
{Modem} [/ril_0] Features = []
{Modem} [/ril_0] Powered = True
{Modem} [/ril_0] Interfaces = org.ofono.NetworkTime
{Modem} [/ril_0] Features = []
{Modem} [/ril_0] Manufacturer = Fake Manufacturer
{Modem} [/ril_0] Model = Fake Modem Model
{Modem} [/ril_0] Revision = MOLY.WR8.W1315.MD.WG.MP.V37.P5, 2014/05/15 11:49
{Modem} [/ril_0] Serial = 354142060715150
{Modem} [/ril_0] Online = True
{Modem} [/ril_0] Interfaces = org.ofono.CallVolume org.ofono.VoiceCallManager org.ofono.NetworkTime
{Modem} [/ril_0] Features = []
{VoiceCallManager} [/ril_0] EmergencyNumbers = 08 000 999 110 112 911 118 119
{Modem} [/ril_0] Interfaces = org.ofono.SimManager org.ofono.CallVolume org.ofono.VoiceCallManager org.ofono.NetworkTime
{Modem} [/ril_0] Features = sim
{CallVolume} [/ril_0] Muted = False
{Modem} [/ril_0] Interfaces = org.ofono.RadioSettings org.ofono.SimManager org.ofono.CallVolume org.ofono.VoiceCallManager org.ofono.NetworkTime
{Modem} [/ril_0] Features = rat sim

Revision history for this message
Jussi Pakkanen (jpakkane) wrote :

The test above was done with krillin, image 32, ofono version 1.12.bzr6876+14.10.20140904~rtm-0ubuntu1.

The test was done by starting the monitor script and then ejecting the SIM card.

Changed in ofono (Ubuntu):
status: Fix Released → Confirmed
Revision history for this message
Tony Espy (awe) wrote :

Thanks for the details Jussi.

So, unfortunately what you're seeing is a bug in the monitor-ofono script, as it doesn't appear to listen for and output a message when the SimManager 'Present' property changes.

That said, I just verified that on Krillin ( rtm #30 ), the 'Present' property does change from 1 to 0, if the SIM associated with the particular modem instance ( /ril_0 == SIM1/top slot, /ril_1 == SIM2/bottom slot ).

I'll try to fix monitor-ofono, and will attach a new version to the bug that you can try.

Revision history for this message
Tony Espy (awe) wrote :

Changing status back to Incomplete till we've resolved this.

Changed in ofono (Ubuntu):
status: Confirmed → Incomplete
assignee: Martti Piirainen (piiramar) → Tony Espy (awe)
Revision history for this message
Tony Espy (awe) wrote :

OK, strike the comment about monitor-ofono, it does the right thing. Here's output from the same scenario on mako (rtm/#33):

root@ubuntu-phablet:~# /usr/share/ofono/scripts/monitor-ofono
{SimManager} [/ril_0] Present = False

I'll re-run the krillin test again.

Revision history for this message
Tony Espy (awe) wrote :

So this turns out to be yet another instance of us getting bitten by device-specific hardware behavior. I re-ran monitor-ofono on krillin (rtm/#33) and get the same output as @Jussi in comment #9.

That said, in this case when the SIM is removed on krillin, it requires the SimManager interface to be torn down and recreated in sequence, and thus the PropertyChanged can't be fired. The details of why this is true can be found in the comments to the following pull request:

https://github.com/rilmodem/ofono/pull/104

So...with that said, in order to catch SIM removal you need to:

 - watch for SimManager PropertyChanged ( 'Present' ) signals

 - watch for SimManager disappearance / appearance in the modem's 'Interfaces' property. Whenever 'SimManager' appears you need to read the initial state of 'Present'.

Changed in ofono (Ubuntu):
status: Incomplete → Fix Released
Thomas Strehl (strehl-t)
tags: added: touch-2014-10-09
removed: touch-2014-09-25
Thomas Strehl (strehl-t)
tags: added: touch-2014-10-16
removed: touch-2014-10-09
tags: added: touch-2014-10-23
removed: touch-2014-10-16
Changed in ubuntu-ux:
assignee: nobody → Olga Kemmet (olga-kemmet)
Revision history for this message
Michał Sawicz (saviq) wrote :

I don't think unity8 has anything to do with this...

Changed in unity8 (Ubuntu):
status: New → Incomplete
Changed in ubuntu-ux:
importance: Undecided → High
status: New → Fix Committed
Revision history for this message
Olga Kemmet (olga-kemmet) wrote :

I'm linking here a spec which describes a specific use case in the OOBE on pages 9/10.
https://docs.google.com/a/canonical.com/document/d/1VajNkWbBH61iVixXJAmOvNGiG__GWQTMXGNOZijXWJw/edit#

Revision history for this message
Cris Dywan (kalikiana) wrote :

It's worth noting no restart is required - with the latest images I can go into flight mode and back to activate swapped SIM cards without a restart.

Revision history for this message
Michał Sawicz (saviq) wrote : Re: [Bug 1332306] Re: Hot-swapped SIMs should be detected and prompt user to reboot

> It's worth noting no restart is required - with the latest images I can
> go into flight mode and back to activate swapped SIM cards without a
> restart.

This was working on krillin for a long time (like... always?). Not so on
mako, though - is it working for you on mako?

Revision history for this message
Cris Dywan (kalikiana) wrote :

I mentioned this as flight mode was broken for me for a long time :-) and I was wondering if the bug intentionally talks about reboot even though it doesn't seem to be necessary. I'll update the title then.

summary: - Hot-swapped SIMs should be detected and prompt user to reboot
+ Hot-swapped SIMs should be detected and reconnect
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote : Re: Hot-swapped SIMs should be detected and reconnect

For consistency across devices, we need the reboot. The fact that the "hotswapping" simply works on krillin is a device specific anomaly and we can't rely on it on our UX.

Changed in ofono (Ubuntu Utopic):
status: New → Fix Released
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

In order to implement the new design (comment #15) we need to enable hotswapping on ofono-level.

Changed in ofono (Ubuntu Utopic):
status: Fix Released → Triaged
Changed in ofono (Ubuntu Vivid):
status: Fix Released → Triaged
Changed in indicator-network (Ubuntu RTM):
status: New → Triaged
importance: Undecided → High
Changed in indicator-network (Ubuntu Utopic):
status: New → Triaged
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

@saviq:
We need to overload the pin-unlock-dialog to be able to show a modal dialog for rebooting.

Changed in unity8 (Ubuntu Vivid):
importance: Undecided → High
status: Incomplete → Triaged
Changed in unity8 (Ubuntu Utopic):
status: New → Triaged
Changed in unity8 (Ubuntu RTM):
importance: Undecided → High
status: New → Triaged
summary: - Hot-swapped SIMs should be detected and reconnect
+ Hot-swapped SIMs should be detected and prompt user to reboot
tags: removed: touch-2014-10-23
Revision history for this message
Antti Kaijanmäki (kaijanmaki) wrote :

removing any milestone tags as the Product Management needs to evaluate this bug and tag it for proper rtm release target.

description: updated
description: updated
Revision history for this message
Tony Espy (awe) wrote :

So just to be very clear... this was discussed at the Sprint, and as pointed out by Antti in comment #19, krillin's behavior is an anomaly. Mako doesn't support hot-swap.

As supporting hot-swap has the possibility of impacting many other system components ( urfkill, indicator-*, location-here-provider, dialer/messaging apps, network-manager, ... ), we ( the cross functional network/telephony team ) decided *not* to support hot-swap for RTM which is why this bug was created in the first place.

Currently on mako we can detect SIM insert and removal, and thus can prompt the user for both events to restart.

On krillin, our existing code only detects SIM removals.

The code to enable krillin to detect SIM removal is effectively the same thing as enabling hot-swap support in ofono. This support can be toggled in ofono by the defining the environment variable OFONO_RIL_HOT_SIM_SWAP. Note - during the sprint we also confirmed that Android on krillin does fully support hot-swap.

So, we decided not to work on the removal case for RTM, but to instead review full hot-swap support with product management and then release as an OTA update for krillin. The majority of the work required is ensuring that we have a good enough testing story to shake out any regressions found in other components.

Changed in ofono (Ubuntu RTM):
importance: Undecided → High
status: New → Triaged
no longer affects: ofono (Ubuntu Utopic)
Changed in ofono (Ubuntu RTM):
assignee: nobody → Tony Espy (awe)
kevin gunn (kgunn72)
tags: added: ota-1
Changed in unity8 (Ubuntu RTM):
assignee: nobody → Mirco Müller (macslow)
Changed in unity8 (Ubuntu Vivid):
assignee: nobody → Mirco Müller (macslow)
Revision history for this message
Tony Espy (awe) wrote :

Also, this is buried in comment #2, mako *only* supports SIM removal detection. When a SIM is inserted, rild does not notify us. So, atm both krillin and mako are equivalent as only removal is detected.

Changed in indicator-network (Ubuntu):
assignee: Jussi Pakkanen (jpakkane) → nobody
Revision history for this message
Michael Terry (mterry) wrote :

I'm swapping Mirco out for myself. My understanding is that there isn't any UI changes ready to be made yet, since ofono doesn't support hot-swapping yet. But just getting my name in there for when it is ready.

Changed in unity8 (Ubuntu):
assignee: Mirco Müller (macslow) → Michael Terry (mterry)
Changed in unity8 (Ubuntu Vivid):
assignee: Mirco Müller (macslow) → Michael Terry (mterry)
Changed in unity8 (Ubuntu RTM):
assignee: Mirco Müller (macslow) → Michael Terry (mterry)
Paty Davila (dizzypaty)
Changed in ubuntu-ux:
importance: High → Critical
Rolf Leggewie (r0lf)
no longer affects: ofono (Ubuntu Vivid)
no longer affects: indicator-network (Ubuntu Utopic)
no longer affects: indicator-network (Ubuntu Vivid)
no longer affects: unity8 (Ubuntu Utopic)
no longer affects: unity8 (Ubuntu Vivid)
Changed in canonical-devices-system-image:
status: New → Triaged
assignee: nobody → John McAleely (john.mcaleely)
importance: Undecided → High
milestone: none → backlog
Revision history for this message
John McAleely (john.mcaleely) wrote :

@awe, i think the time has come to start looking at this. It has been raised by every QA team that has reviewed Ubuntu phone devices.

Does it make sense to use this bug still, or start from fresh?

Perhaps obviously, we may only be able to deliver this on systems which supply the necessary events (from the discussion above, that may rule out some of our devices).

Changed in canonical-devices-system-image:
status: Triaged → Confirmed
importance: High → Critical
no longer affects: ofono (Ubuntu RTM)
no longer affects: unity8 (Ubuntu RTM)
no longer affects: indicator-network (Ubuntu RTM)
Revision history for this message
Matthew Paul Thomas (mpt) wrote :

It seems this was never designed. Hot-swap is, by definition, not part of the “OOBE”.

Changed in ubuntu-ux:
assignee: Olga Kemmet (olga-kemmet) → Matthew Paul Thomas (mpt)
status: Fix Committed → Confirmed
Changed in ubuntu-ux:
status: Confirmed → In Progress
Revision history for this message
Matthew Paul Thomas (mpt) wrote :
Changed in ubuntu-ux:
status: In Progress → Fix Committed
description: updated
Revision history for this message
Michael Terry (mterry) wrote :

So looking at the dialog in the spec, it should be a simple snap notification emitted by the telephony stack.

EXCEPT, we don't currently support the button on the right being red. We have a rather rigid hint x-canonical-private-rejection-tint=true, which will ONLY tint the left button red.

So there's a tiny bit of work on the unity8/notification side after all. I'm considering adding a hint like x-canonical-private-rejection-actions=listOfActionIds that gives more flexibility.

But that shouldn't block the telephony folks. Just make a snap notification like normal, without any color for now.

Revision history for this message
Pat McGowan (pat-mcgowan) wrote :

Note that the current investigation is how to support hot swap without a reboot, please check with tony before implementing anything.

Changed in canonical-devices-system-image:
importance: Critical → Medium
assignee: John McAleely (john.mcaleely) → nobody
importance: Medium → Wishlist
Michael Terry (mterry)
Changed in unity8 (Ubuntu):
assignee: Michael Terry (mterry) → nobody
no longer affects: ubuntu-ux
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.