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.
This commit is contained in:
Marcel Holtmann 2011-01-05 21:03:52 -08:00
parent b7713da077
commit 8772946cfe
1 changed files with 8 additions and 0 deletions

View File

@ -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) {