Merge lp:~ricmm/powerd/use-hal-power-hint into lp:powerd

Proposed by Ricardo Mendoza
Status: Merged
Approved by: Ricardo Salveti
Approved revision: 101
Merged at revision: 100
Proposed branch: lp:~ricmm/powerd/use-hal-power-hint
Merge into: lp:powerd
Diff against target: 97 lines (+23/-0)
5 files modified
CMakeLists.txt (+1/-0)
debian/control (+1/-0)
src/display.c (+3/-0)
src/powerd-internal.h (+1/-0)
src/powerd.cpp (+17/-0)
To merge this branch: bzr merge lp:~ricmm/powerd/use-hal-power-hint
Reviewer Review Type Date Requested Status
Ricardo Salveti (community) Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+190027@code.launchpad.net

Commit message

Use power HAL to signal power subsystems to resume quickly as user interaction is expected

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:100
http://jenkins.qa.ubuntu.com/job/powerd-ci/127/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/powerd-saucy-armhf-ci/81/console

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/powerd-ci/127/rebuild

review: Needs Fixing (continuous-integration)
lp:~ricmm/powerd/use-hal-power-hint updated
101. By Ricardo Mendoza

Match dep versionto next release hardware lib

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

FAILED: Continuous integration, rev:101
http://jenkins.qa.ubuntu.com/job/powerd-ci/128/
Executed test runs:
    FAILURE: http://jenkins.qa.ubuntu.com/job/powerd-saucy-armhf-ci/82/console

Click here to trigger a rebuild:
http://10.97.0.26:8080/job/powerd-ci/128/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Loïc Minier (lool) wrote :

Waiting on libhybris to be in release pocket.

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Ricardo Salveti (rsalveti) wrote :

Looks good, thanks.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'CMakeLists.txt'
2--- CMakeLists.txt 2013-10-01 14:16:41 +0000
3+++ CMakeLists.txt 2013-10-09 14:55:25 +0000
4@@ -112,6 +112,7 @@
5 ${PHABLET_LIBRARIES}
6 "-lubuntu_application_api"
7 "-landroid-properties"
8+ "-lhardware"
9 ${LIBUDEV_LIBRARIES}
10 ${UPOWER_GLIB_LIBRARIES}
11 ${UUID_LIBRARIES}
12
13=== modified file 'debian/control'
14--- debian/control 2013-09-25 21:29:09 +0000
15+++ debian/control 2013-10-09 14:55:25 +0000
16@@ -12,6 +12,7 @@
17 libplatform-api1-dev,
18 libupower-glib-dev,
19 uuid-dev,
20+ libhardware-dev (>= 0.1.0+git20130606+c5d897a-0ubuntu33),
21 Standards-Version: 3.9.4
22 Homepage: https://launchpad.net/powerd
23 # If you aren't a member of ~phablet-team but need to upload packaging changes,
24
25=== modified file 'src/display.c'
26--- src/display.c 2013-09-25 21:29:09 +0000
27+++ src/display.c 2013-10-09 14:55:25 +0000
28@@ -120,6 +120,9 @@
29 else
30 sf_unblank(display);
31 } else {
32+ if (strcmp(power_mode, "on") == 0)
33+ powerd_hal_signal_activity();
34+
35 unity_proxy = g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM,
36 G_DBUS_PROXY_FLAGS_NONE,
37 NULL,
38
39=== modified file 'src/powerd-internal.h'
40--- src/powerd-internal.h 2013-09-24 13:15:40 +0000
41+++ src/powerd-internal.h 2013-10-09 14:55:25 +0000
42@@ -53,6 +53,7 @@
43
44 void powerd_shutdown(void);
45 void powerd_exit(int exit_code);
46+void powerd_hal_signal_activity(void);
47 void powerd_reset_activity_timer(int add);
48 void powerd_dbus_init_complete(void);
49 int powerd_is_mainloop(void);
50
51=== modified file 'src/powerd.cpp'
52--- src/powerd.cpp 2013-10-07 11:52:19 +0000
53+++ src/powerd.cpp 2013-10-09 14:55:25 +0000
54@@ -50,6 +50,8 @@
55
56 #include "libsuspend.h"
57
58+#include <android/hardware/power.h>
59+
60 static GThread *powerd_mainloop_thread;
61
62 namespace
63@@ -153,6 +155,8 @@
64 return FALSE;
65 }
66
67+static struct power_module* _power_module;
68+
69 void on_new_event(Event* event, void* context)
70 {
71 switch(event->type)
72@@ -241,6 +245,13 @@
73
74 } //namespace
75
76+void powerd_hal_signal_activity(void)
77+{
78+ powerd_warn("signalling activity via HAL");
79+ if (_power_module)
80+ _power_module->powerHint(_power_module, POWER_HINT_INTERACTION, NULL);
81+}
82+
83 void powerd_reset_activity_timer(int add)
84 {
85 int timeout;
86@@ -466,6 +477,12 @@
87 input_area_height : 2048
88 };
89
90+ int err = hw_get_module(POWER_HARDWARE_MODULE_ID,
91+ (hw_module_t const**)&_power_module);
92+
93+ if (!err)
94+ _power_module->init(_power_module);
95+
96 android_input_stack_initialize(&listener, &config);
97 android_input_stack_start();
98

Subscribers

People subscribed via source and target branches