From 8772946cfefd94b04eb554aa931fbdf0f99c8d78 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Wed, 5 Jan 2011 21:03:52 -0800 Subject: [PATCH] network: Ignore signal strength notifications if not registered With the fix to query the signal strength when the registration status changes it should be now fine again to just ignore notifications about signal strength changes when not registered. So put this extra check and comment back into signal strenth notification function. --- src/network.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/network.c b/src/network.c index ac4942ba..eb0f7972 100644 --- a/src/network.c +++ b/src/network.c @@ -1405,6 +1405,14 @@ void ofono_netreg_strength_notify(struct ofono_netreg *netreg, int strength) if (netreg->signal_strength == strength) return; + /* + * Theoretically we can get signal strength even when not registered + * to any network. However, what do we do with it in that case? + */ + if (netreg->status != NETWORK_REGISTRATION_STATUS_REGISTERED && + netreg->status != NETWORK_REGISTRATION_STATUS_ROAMING) + return; + netreg->signal_strength = strength; if (strength != -1) {