Merge lp:~rsalveti/powerd/drop_support_sf into lp:powerd

Proposed by Ricardo Salveti
Status: Superseded
Proposed branch: lp:~rsalveti/powerd/drop_support_sf
Merge into: lp:powerd
Diff against target: 132 lines (+35/-46)
2 files modified
debian/changelog (+6/-0)
src/display.c (+29/-46)
To merge this branch: bzr merge lp:~rsalveti/powerd/drop_support_sf
Reviewer Review Type Date Requested Status
Michał Sawicz Approve
PS Jenkins bot continuous-integration Approve
Review via email: mp+213340@code.launchpad.net

This proposal has been superseded by a proposal from 2014-04-01.

Commit message

Drop support for surface flinger (MIR is now the default)

Description of the change

Drop support for surface flinger (MIR is now the default)

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
lp:~rsalveti/powerd/drop_support_sf updated
124. By Ricardo Salveti

Bumping major version, dropping compatibility with Surface Flinger

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Michał Sawicz (saviq) wrote :

Yes.

review: Approve

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2014-03-28 15:30:54 +0000
3+++ debian/changelog 2014-03-31 15:36:44 +0000
4@@ -1,3 +1,9 @@
5+powerd (0.14-0ubuntu1) trusty; urgency=medium
6+
7+ * Bumping major version, dropping compatibility with Surface Flinger
8+
9+ -- Ricardo Salveti de Araujo <ricardo.salveti@canonical.com> Mon, 31 Mar 2014 12:34:00 -0300
10+
11 powerd (0.13+14.04.20140328.1-0ubuntu1) trusty; urgency=low
12
13 [ Alfonso Sanchez-Beato ]
14
15=== modified file 'src/display.c'
16--- src/display.c 2014-03-20 11:28:05 +0000
17+++ src/display.c 2014-03-31 15:36:44 +0000
18@@ -32,8 +32,6 @@
19 #include <glib.h>
20 #include <glib-object.h>
21
22-#include <hybris/surface_flinger/surface_flinger_compatibility_layer.h>
23-
24 #include "powerd.h"
25 #include "powerd-internal.h"
26 #include "log.h"
27@@ -48,9 +46,6 @@
28 };
29 static enum bl_state target_bl_state = BL_BRIGHT;
30
31-/* Mir usage hint file path */
32-#define MIR_HINT_PATH "/home/phablet/.display-mir"
33-
34 /* Treat "don't care" display state as off */
35 #define DISPLAY_STATE_OFF POWERD_DISPLAY_STATE_DONT_CARE
36
37@@ -61,7 +56,6 @@
38
39 static int user_brightness;
40 static gboolean user_ab_enabled;
41-static gboolean running_mir = FALSE;
42
43 /* Assume screen is off to start; we will force it on */
44 static uuid_t internal_request_cookie;
45@@ -160,48 +154,41 @@
46
47 powerd_debug("display_set_power_mode(%s)", power_mode);
48
49- if (!running_mir) {
50- if (strcmp(power_mode, "off") == 0)
51- sf_blank(display);
52- else
53- sf_unblank(display);
54- } else {
55- if (strcmp(power_mode, "on") == 0)
56- powerd_hal_signal_activity();
57-
58- unity_proxy = g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM,
59- G_DBUS_PROXY_FLAGS_NONE,
60- NULL,
61- "com.canonical.Unity.Screen",
62- "/com/canonical/Unity/Screen",
63- "com.canonical.Unity.Screen",
64- NULL,
65- &error);
66-
67- if (error != NULL) {
68- powerd_warn("could not connect to Unity: %s", error->message);
69- g_error_free(error);
70- return FALSE;
71- }
72-
73- GVariant *ret = g_dbus_proxy_call_sync(unity_proxy,
74- "setScreenPowerMode",
75- g_variant_new("(s)", power_mode),
76- G_DBUS_CALL_FLAGS_NONE,
77- -1,
78+ if (strcmp(power_mode, "on") == 0)
79+ powerd_hal_signal_activity();
80+
81+ unity_proxy = g_dbus_proxy_new_for_bus_sync(G_BUS_TYPE_SYSTEM,
82+ G_DBUS_PROXY_FLAGS_NONE,
83+ NULL,
84+ "com.canonical.Unity.Screen",
85+ "/com/canonical/Unity/Screen",
86+ "com.canonical.Unity.Screen",
87 NULL,
88 &error);
89
90- if (ret == NULL) {
91- powerd_warn("screen power setting failed: %s", error->message);
92- g_error_free(error);
93- g_object_unref(unity_proxy);
94- return FALSE;
95- }
96-
97+ if (error != NULL) {
98+ powerd_warn("could not connect to Unity: %s", error->message);
99+ g_error_free(error);
100+ return FALSE;
101+ }
102+
103+ GVariant *ret = g_dbus_proxy_call_sync(unity_proxy,
104+ "setScreenPowerMode",
105+ g_variant_new("(s)", power_mode),
106+ G_DBUS_CALL_FLAGS_NONE,
107+ -1,
108+ NULL,
109+ &error);
110+
111+ if (ret == NULL) {
112+ powerd_warn("screen power setting failed: %s", error->message);
113+ g_error_free(error);
114 g_object_unref(unity_proxy);
115+ return FALSE;
116 }
117
118+ g_object_unref(unity_proxy);
119+
120 return TRUE;
121 }
122
123@@ -424,10 +411,6 @@
124 /* Use the current brightness until we're told another value */
125 user_brightness = powerd_get_brightness();
126
127- /* decide whether we are running on Mir or SF */
128- if (stat(MIR_HINT_PATH, &stats) == 0)
129- running_mir = TRUE;
130-
131 return 0;
132 }
133

Subscribers

People subscribed via source and target branches