diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2011-01-05 21:03:52 -0800 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-01-05 21:03:52 -0800 |
commit | 8772946cfefd94b04eb554aa931fbdf0f99c8d78 (patch) | |
tree | ab8adf2759ee04c633621525c4eec18b79675cb1 | |
parent | b7713da07743265edc2cc60d3cf7fccd9b42f55d (diff) | |
download | ofono-8772946cfefd94b04eb554aa931fbdf0f99c8d78.tar.bz2 |
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.
-rw-r--r-- | src/network.c | 8 |
1 files changed, 8 insertions, 0 deletions
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) { |