Sim lock screen doesn't appear after restarting the device

Bug #1580908 reported by Jean-Baptiste Lallement on 2016-05-12
44
This bug affects 6 people
Affects Status Importance Assigned to Milestone
Canonical System Image
Critical
John McAleely
indicator-network (Ubuntu)
Undecided
Pete Woods
ofono (Ubuntu)
Critical
Alfonso Sanchez-Beato
unity8 (Ubuntu)
Undecided
Pete Woods

Bug Description

From https://bugs.launchpad.net/zhongshan/+bug/1572886

current build number: 4
device name: turbo
channel: ubuntu-touch/rc/meizu.en
last update: 2016-04-19 10:38:50
version version: 4
version ubuntu: 20160418
version device: 20160412-d272a77
version custom: 20160324-945-18-69

Steps:
1.turn on sim pin lock
2.reboot the device
3.swipe to dismiss the greeter

Actual result:
phone lock screen is displayed

Expected result:
sim lock screen should appear before the phone lock screen

It also happens sometimes on arale without any pattern to reproduce, just random on reboot.

=============

After debugging it seems that this is caused by ofono removing the modems in the middle of the unlock process. You can see the difference for Turbo and Krillin below.

Log for Turbo: http://paste.ubuntu.com/16666147/

Log for Krillin: http://paste.ubuntu.com/16675431/

Related branches

Changed in canonical-devices-system-image:
importance: Undecided → High
status: New → Confirmed

I have tried on a turbo device and behaviour of ofono seems normal (list-modems shows right values and I can enter PIN). It looks like some race condition on boot.

Michael Zanetti (mzanetti) wrote :

Yes, indicator-network seems to check only at startup if a SIM pin is required. On all the other devices that's fine, ofono is ready by then. However, on turbo the complete stack boots up so fast, ofono isn't ready inspecting available modems and sim cards by that time.

FWIW, here's the turbo related report: https://bugs.launchpad.net/zhongshan/+bug/1559533

Pete Woods (pete-woods) wrote :

Indicator-network is asked by unity8 when it first shows the greeter to "unlock all SIMs". At this point it goes and looks at ofono to find out which SIMs need unlocking.

Pete Woods (pete-woods) wrote :

I can't do any further debugging, as I don't have access to a turbo device.

Pete Woods (pete-woods) wrote :

Assuming mzanetti is correct, and that what's happening is that the indicator is asking ofono about the SIMs before it is ready, then we need a way of getting the indicator to delay the unlocking until ofono actually *is* ready. I'm not sure what signals we should be waiting on there, though..

@pete-woods, you need to wait for org.ofono.SimManager to appear in the list of interfaces of Interfaces property for each modem. You can check at that moment Present property there and if Present=1, check LockedPins.

Launchpad Janitor (janitor) wrote :

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

Changed in indicator-network (Ubuntu):
status: New → Confirmed
Changed in ofono (Ubuntu):
status: New → Confirmed
Changed in unity8 (Ubuntu):
status: New → Confirmed
Timo Jyrinki (timo-jyrinki) wrote :

Got my Meizu Pro 5 today, upgraded to rc-proposed and this started happening. I need to unlock SIM manually now from indicator menu.

On OTA-10.2 I got the SIM unlock dialog on boot still, several times.

Pete Woods (pete-woods) wrote :

Did some debugging on this today, it's caused by ofono removing all the modems after we queue them up for unlocking. Then it adds them back again a short time later. This basically clears them from our unlock queue, as they are different modems as far as indicator-network knows.

See output: http://paste.ubuntu.com/16658512/

Pete Woods (pete-woods) wrote :

Further debugging reveals this happens at each startup of indicator-network. Maybe the bug is in QOfono...

Pete Woods (pete-woods) wrote :

No, that's not true. Misread the logs.

Pete Woods (pete-woods) wrote :

Debug: Adding modems QSet("/ril_1", "/ril_0") (/home/phablet/indicator-network/src/indicator/nmofono/manager-impl.cpp:310, void nmofono::ManagerImpl::Private::modems_changed(const QStringList&))
acquired
Debug: virtual void nmofono::ManagerImpl::unlockAllModems() (/home/phablet/indicator-network/src/indicator/nmofono/manager-impl.cpp:735, virtual void nmofono::ManagerImpl::unlockAllModems())
Debug: Waiting for modem to be ready "SIM 1" (/home/phablet/indicator-network/src/indicator/nmofono/manager-impl.cpp:714, virtual void nmofono::ManagerImpl::unlockModem(nmofono::wwan::Modem::Ptr))
Debug: (/home/phablet/indicator-network/src/indicator/nmofono/wwan/modem.cpp:766, void nmofono::wwan::Modem::notifyWhenReadyToUnlock())
Debug: Waiting for modem to be ready "SIM 2" (/home/phablet/indicator-network/src/indicator/nmofono/manager-impl.cpp:714, virtual void nmofono::ManagerImpl::unlockModem(nmofono::wwan::Modem::Ptr))
Debug: (/home/phablet/indicator-network/src/indicator/nmofono/wwan/modem.cpp:766, void nmofono::wwan::Modem::notifyWhenReadyToUnlock())
Debug: Removing modems QSet("/ril_1", "/ril_0") (/home/phablet/indicator-network/src/indicator/nmofono/manager-impl.cpp:294, void nmofono::ManagerImpl::Private::modems_changed(const QStringList&))
Debug: Adding modems QSet("/ril_0") (/home/phablet/indicator-network/src/indicator/nmofono/manager-impl.cpp:310, void nmofono::ManagerImpl::Private::modems_changed(const QStringList&))
Debug: Adding modems QSet("/ril_1") (/home/phablet/indicator-network/src/indicator/nmofono/manager-impl.cpp:310, void nmofono::ManagerImpl::Private::modems_changed(const QStringList&))

Pete Woods (pete-woods) on 2016-05-25
description: updated
Pete Woods (pete-woods) wrote :

I'm adding a branch that improves logging in the indicator, although obviously it doesn't fix the issue that exists in Ofono.

Changed in indicator-network (Ubuntu):
status: Confirmed → Invalid
Changed in unity8 (Ubuntu):
status: Confirmed → Invalid
Changed in indicator-network (Ubuntu):
assignee: nobody → Pete Woods (pete-woods)
Changed in unity8 (Ubuntu):
assignee: nobody → Pete Woods (pete-woods)
Changed in canonical-devices-system-image:
assignee: nobody → John McAleely (john.mcaleely)
Changed in ofono (Ubuntu):
assignee: nobody → Alfonso Sanchez-Beato (alfonsosanchezbeato)
Pat McGowan (pat-mcgowan) wrote :

Proposed for a hot fix

Changed in canonical-devices-system-image:
milestone: none → 12
importance: High → Critical
Changed in ofono (Ubuntu):
importance: Undecided → Critical

Same problem for me on Meizu MX4 starting from OTA-11 update.

tags: added: hotfix
Changed in canonical-devices-system-image:
status: Confirmed → Fix Committed
status: Fix Committed → Confirmed
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package indicator-network - 0.8.0+16.10.20160622.1-0ubuntu1

---------------
indicator-network (0.8.0+16.10.20160622.1-0ubuntu1) yakkety; urgency=medium

  [ Pete ]
  * Add SIM management API.

  [ Antti Kaijanmäki ]
  * New Connectivity Service Private API for managing mobile data and
    SIM cards. (LP: #1373463)

  [ Pete Woods ]
  * Improve logging (LP: #1580908)
  * add mobile data switch (LP: #1373463)

  [ Antti Kaijanmäki, Pete Woods ]
  * New Connectivity Service Private API for managing mobile data and
    SIM cards. Tests. (LP: #1373463)

 -- Antti Kaijanmäki <email address hidden> Wed, 22 Jun 2016 09:49:15 +0000

Changed in indicator-network (Ubuntu):
status: Invalid → Fix Released
Changed in ofono (Ubuntu):
status: Confirmed → In Progress
Changed in canonical-devices-system-image:
milestone: 12 → fi
Changed in canonical-devices-system-image:
status: Confirmed → In Progress

The last few times I've booted my turbo i had to enter the sim pin, so it might be working now? or maybe just good luck?

@julia-palandri, this is all about timing, so probably it is just good luck. However, silo 29 has a new ofono that should fix this, you can give it a try if you want. Ticket is https://requests.ci-train.ubuntu.com/#/ticket/1610 .

Pete Woods (pete-woods) on 2016-07-05
Changed in indicator-network (Ubuntu):
status: Fix Released → Invalid
Changed in canonical-devices-system-image:
milestone: fi → 13
status: In Progress → Fix Committed
Changed in ofono (Ubuntu):
status: In Progress → Fix Released
alain (al1guillet) wrote :

After OTA 13, the problem still exists on my phone. It worked only once: the first time after the update.

Changed in canonical-devices-system-image:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers