1
0
Fork 0
mirror of https://gitlab.gnome.org/GNOME/calls.git synced 2024-06-28 14:49:30 +00:00
Commit graph

34 commits

Author SHA1 Message Date
Evangelos Ribeiro Tzaras 0d072e7335 ringer: Remove explicit DBus timeout handling
As libfeedback uses GDbusProxy under the hood which defaults to timing
out after 25 seconds there is no need to handle timeouts explicitly.

Furthermore 1 second seems to not always be enough time to get a
response which leads to endless ringing.

Fixes #543
2023-01-09 16:58:33 +00:00
Evangelos Ribeiro Tzaras f997048a38 build: Rename config.h to calls-config.h
This guards against accidentally including configuration from elsewhere.
2022-12-22 15:08:18 +00:00
Дилян Палаузов d363583802 ringer: Fix typo 2022-12-20 07:34:39 +01:00
Evangelos Ribeiro Tzaras e1f0b83d25 ringer: Break loop if triggered event was ended immediately
When the only feedback of an event is unavailable on a system (e.g. no
vibration motor or LED) the "feedback-ended" signal is emitted
immediately and the end reason will be LFB_EVENT_END_REASON_NOT_FOUND.

In this case we need to change the target state, so that our logic does
not end up retriggering the event infinitely.
2022-11-15 09:52:17 +00:00
Evangelos Ribeiro Tzaras e52f327aae ringer: Cancel async libfeedback calls on timeout
If libfeedback has not finished triggering/ending a feedback after one
second we give up and set an error state.
2022-11-15 09:52:17 +00:00
Evangelos Ribeiro Tzaras 1056cba62a ringer: Never cancel async DBus calls and refactor
Previously our code assumed that g_cancellable_cancel() the async DBus
calls to libfeedback would guarantee that the underlying operation would
not be performed (i.e. triggering or ending a feedback).

However the endless ringing exhibited in #470 shows this assumption not
to hold. Therefore we avoid using g_cancellable_cancel () completely and
default to waiting for the async operation to finish.

update_ring () now sets the target state by inspecting managed calls and
the main logic will now step towards the target state:
Changing from regular/loud to soft/quiet ringing (or vice versa)
requires we first end feedback before (re)triggering it.

Additionally the "is-quiet" and "is-ringing" properties are replaced by
a new "state" property to allow changing the combination atomically.

Closes: #470
2022-11-15 09:52:17 +00:00
Evangelos Ribeiro Tzaras 8c6d64ddaf ringer: Cancel any ongoing actions on shutdown 2022-09-20 12:27:38 +02:00
Evangelos Ribeiro Tzaras 97626c467f ringer: Move libfeedback related cleanup to finalize()
Leave the LfbEvent self->event alive in dispose()
to give potentially pending GAsyncReadyCallback invocations
or running GSources a better chance of finishing gracefully.
2022-09-20 12:27:26 +02:00
Evangelos Ribeiro Tzaras e28b15b41a ringer: Remove deprecated CuiCallStates
They haven't been used since
4bc8e82ff6
and could probably have been removed sooner.
2022-09-20 12:27:23 +02:00
Evangelos Ribeiro Tzaras 7ac862155b Uncrustify sources
Ran `find src plugins -iname '*.[c|h]' -print0 | xargs -0 uncrustify --no-backup`
with some minimal manual intervention.
2022-04-24 12:59:42 +02:00
Evangelos Ribeiro Tzaras 93cf894a8c ringer: Take ui-active property into account
Only start ringing once the UI is deemed active, i.e. the "pre-ring" phase has
passed.

Fixes #371
2022-02-03 12:37:05 +01:00
Evangelos Ribeiro Tzaras 5b9609c4f7 ringer: Use CallsUiCallData instead of CallsCall
This will allow us to handle pre-ringing better.
2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras 2f32e09982 ringer: Switch to state notify signal 2022-02-01 06:11:58 +01:00
Evangelos Ribeiro Tzaras 5e2061da46 ringer: Reorder headers
config.h goes first then sort alphabetically.
2022-02-01 06:11:04 +01:00
Evangelos Ribeiro Tzaras 0f72780814 ringer: Restart ringer if quiet parameter changed
This makes sure the following sequence of events works:

- Call A incoming
- Rings loudly
- Call B incoming
- Still rings loudly
- Call A accepted
- Rings quietly
- Call A hung up
- Rings loudly again

Being able to restart the ringing is needed for this case because we cannot
retroactively change the feedback levels of a event that has already been
triggered.

Without this patch Calls would continue ringing for the scenario above even
after call A was accepted.
2021-12-05 10:04:05 +01:00
Evangelos Ribeiro Tzaras b89f6a6f17 ringer: Add is-quiet property and getter
This let's us query if the ringer is ringing quietly.
2021-12-05 10:04:03 +01:00
Evangelos Ribeiro Tzaras 410cf8945a ringer: Check if incoming call is silenced
Avoid ringing in this case.
2021-12-05 09:49:05 +01:00
Evangelos Ribeiro Tzaras f02d22150e ringer: Add debugging 2021-12-05 09:49:05 +01:00
Evangelos Ribeiro Tzaras 9fff41fd53 ringer: Make sure to reset feedback profile if not set to "quiet" 2021-12-05 09:49:05 +01:00
Evangelos Ribeiro Tzaras e604779497 ringer: Don't warn if feedback triggering got cancelled 2021-12-05 09:49:05 +01:00
Evangelos Ribeiro Tzaras 3e26294f3c ringer: Track ringer state
This allows to cancel triggered feedbacks.
2021-12-05 09:49:05 +01:00
Evangelos Ribeiro Tzaras 1e5edea855 ringer: Disconnect signal handlers on dispose 2021-12-05 09:49:05 +01:00
Evangelos Ribeiro Tzaras fd7193a525 ringer: Refactor to keep track of ongoing calls
This makes it easier to silence a call.
2021-12-05 09:49:05 +01:00
Evangelos Ribeiro Tzaras 17a2c94387 ringer: codestyle 2021-12-05 09:49:05 +01:00
Evangelos Ribeiro Tzaras 160d3e42a8 ringer: Follow coding style for G_LOG_DOMAIN
Closes #294
2021-06-18 11:12:13 +02:00
Evangelos Ribeiro Tzaras 78c0fb1ed7 ringer: use quiet profile for non-primary calls 2021-03-15 09:24:46 +00:00
Evangelos Ribeiro Tzaras 5d4b84470c code style: consistent whitespaces for g_autoptr 2021-02-11 00:43:18 +01:00
Guido Günther ecca21b0ed ringer: Use libfeedback
This triggers e.g. haptic feeback as well and can later on be used
for LED feedback.

We can drop the audio theme setting completely since feedbackd picks up
the global GNOME setting.

Since feedbackd currently does not cancel gsound's via a cancellable
this might make the phone ring a bit too long atm but that will be fixed
on the feedbackd side
(https://source.puri.sm/Librem5/feedbackd/-/issues/10)
2020-06-05 16:42:24 +02:00
Guido Günther f96ad96b3f ringer: Make more functions static 2020-06-05 16:37:01 +02:00
Julian Sparber 3d4b547d04
Ringer: Use Manager 2020-03-27 12:05:34 +01:00
Julian Sparber c5cb1a97ed
Ringer: fix parent instance 2020-03-27 12:05:34 +01:00
Julian Sparber e911f391c6
Use correct parent class when chaining up overridden functions
How `g_type_class_peek ()` was used it didn't return the correct parent
class in most cases.
G_DEFINE_TYPE macro creates a pointer we can use to get the parent
class `n_p_parent_class`.
Because we didn't use the correct parent class the object initialisation
wasn't fully completed for some GtkWidgets.
See https://developer.gnome.org/gobject/stable/chapter-gobject.html#gobject-instantiation
for more information.

This commit makes use of the `n_p_parent_class pointer` created for this
specific use case where ever possible.

Fixes: https://source.puri.sm/Librem5/calls/issues/118
2020-02-19 12:49:58 +01:00
Bob Ham e7ba7d731c ringer: Use the GTK sound theme 2019-09-23 15:22:31 +01:00
Bob Ham 7252962139 Add ringtone support using GSound 2018-11-09 16:30:40 +00:00