powerd proximity sensors enable/disable code will fail when the phone can accept more than 1 call
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
powerd |
Confirmed
|
High
|
Unassigned | ||
powerd (Ubuntu) |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
RIght now the proximity sensor code in powerd triggers off the active/alerting and disconnected signals. When multiple calls are allowed, there will be multiple signals. Prototype code to handle this is below, but powerd will also need to listen on dbus for the creation of a new call and attach to the new object. There is 1 dbus object per call and right now powerd only listens for signals from voicecall01. This is not handled in the code below.
static void
update_
{
if (active_call_count > 0) {
//call is active, enable sensor
if (powerd_
}
else {
//call is disconnected, disable sensor
}
}
void
on_ofono_
gchar *sender_name,
gchar *signal_name,
GVariant *parameters,
gpointer user_data)
{
GVariant *value = NULL;
const char *prop_name;
const char *prop_value;
static uint active_call_count = 0;
static gboolean alerted = FALSE;
powerd_
/* This function enables and disables the proximity sensor based
* on the state of the call.
* Active - meaning, the call is in progress --> Proximity On
* Alerting - a signal made on outbound calls only which means that
* the phone is ringing on the other side, but has not
* been picked up. --> Proximity On (this signal is not
* sent on inbound calls)
* Disconnected - the call is over. --> Proximity Off.
*
* For more details on states see voicecall-api.txt in the ofono source
*
* The mappings of the states aren't exact because you can be on
* more than 1 call at a time, so instead they modify counters
* which then affect the state. For a single call the mappings
* above are correct.
*/
/* Note: As of June 13, 2013, the phone cannot successfully
* accept a call while another call is in progress. Until this is
* fixed, there will only ever be one accept message, although
* two disconnect signals will be seen. Once this is fixed, we
* need to re-test this block and then delete this comment (mfisch) */
if (!strcmp(
if (!strcmp(
if (!strcmp(
if (!alerted) {
}
}
}
else if (!strcmp(
}
else if (!strcmp(
if (active_call_count > 0) {
}
// Clear the flag in case the remote call did not answer.
}
}
}
}
Related branches
- Ricardo Salveti (community): Approve
-
Diff: 586 lines (+370/-94)4 files modifiedsrc/display.c (+1/-1)
src/powerd-internal.h (+20/-2)
src/powerd-object.c (+60/-6)
src/powerd.cpp (+289/-85)
Changed in powerd: | |
status: | New → Confirmed |
importance: | Undecided → High |
This bug was fixed in the package powerd - 0.13+14. 04.20140328. 1-0ubuntu1
--------------- 04.20140328. 1-0ubuntu1) trusty; urgency=low
powerd (0.13+14.
[ Alfonso Sanchez-Beato ]
* Add support for multiple ofono modems (LP#1295085). Handle
simultaneous voice calls (LP#1191033). Listen to ofono USSD signals
(LP: #1191033, #1295085)
[ Ubuntu daily release ]
* New rebuild forced
-- Ubuntu daily release <email address hidden> Fri, 28 Mar 2014 15:30:54 +0000