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

Proposed by Ricardo Salveti
Status: Merged
Merged at revision: 127
Proposed branch: lp:~rsalveti/powerd/export_dim_brightness_value
Merge into: lp:powerd
Diff against target: 91 lines (+18/-9)
4 files modified
cli/powerd-cli.c (+8/-7)
data/com.canonical.powerd.xml (+1/-1)
debian/changelog (+7/-0)
src/backlight.c (+2/-1)
To merge this branch: bzr merge lp:~rsalveti/powerd/export_dim_brightness_value
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Ubuntu Phablet Team Pending
Review via email: mp+216805@code.launchpad.net

Commit message

Also exporting dim brightness value via getBrightnessParams

Description of the change

Also exporting dim brightness value via getBrightnessParams

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

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'cli/powerd-cli.c'
2--- cli/powerd-cli.c 2014-03-27 21:00:53 +0000
3+++ cli/powerd-cli.c 2014-04-23 02:22:08 +0000
4@@ -916,7 +916,7 @@
5 }
6
7 static gboolean
8-getBrightnessParams(int *min, int *max, int *dflt, gboolean *ab_supported)
9+getBrightnessParams(int *dim, int *min, int *max, int *dflt, gboolean *ab_supported)
10 {
11 GVariant *ret = NULL;
12 GError *error = NULL;
13@@ -932,7 +932,7 @@
14 return FALSE;
15 }
16
17- g_variant_get(ret, "((iiib))", min, max, dflt, ab_supported);
18+ g_variant_get(ret, "((iiiib))", dim, min, max, dflt, ab_supported);
19 g_variant_unref(ret);
20 return TRUE;
21 }
22@@ -966,7 +966,7 @@
23 "exit, causing the request to be dropped.\n");
24 printf("autobrightness <enable|disable> - enable or disable autobrightness.\n");
25 printf("brightness <brightness> - set user screen brightness.\n");
26- printf("brightness-params - get brightness parameters (min, max, etc.)\n");
27+ printf("brightness-params - get brightness parameters (dim, min, max, etc.)\n");
28 printf("clear-sys <cookie> - clear a System state request given a cookie.\n");
29 printf("clear-disp <cookie> - clear a Display state request given a cookie.\n");
30 printf("client-test - test powerd registration / ack API.\n");
31@@ -1191,13 +1191,14 @@
32 }
33 setUserAutobrightness(enable);
34 } else if (!strcmp(argv[1], "brightness-params")) {
35- int min, max, dflt, ab;
36- if (getBrightnessParams(&min, &max, &dflt, &ab)) {
37- printf("Minimum Brightness: %d\n"
38+ int dim, min, max, dflt, ab;
39+ if (getBrightnessParams(&dim, &min, &max, &dflt, &ab)) {
40+ printf("Dim Brightness: %d\n"
41+ "Minimum Brightness: %d\n"
42 "Maximum Brightness: %d\n"
43 "Default Brightness: %d\n"
44 "Autobrightness: %ssupported\n",
45- min, max, dflt, ab ? "" : "not ");
46+ dim, min, max, dflt, ab ? "" : "not ");
47 }
48 } else if (!strcmp(argv[1], "brightness")) {
49 long brightness;
50
51=== modified file 'data/com.canonical.powerd.xml'
52--- data/com.canonical.powerd.xml 2014-01-14 03:14:22 +0000
53+++ data/com.canonical.powerd.xml 2014-04-23 02:22:08 +0000
54@@ -51,7 +51,7 @@
55 <method name="getBrightnessParams">
56 <!-- Returns min, max, and default brighness and whether or not
57 autobrightness is supported, in that order -->
58- <arg type="(iiib)" name="params" direction="out" />
59+ <arg type="(iiiib)" name="params" direction="out" />
60 </method>
61
62 <method name="setUserBrightness">
63
64=== modified file 'debian/changelog'
65--- debian/changelog 2014-04-15 00:36:41 +0000
66+++ debian/changelog 2014-04-23 02:22:08 +0000
67@@ -1,3 +1,10 @@
68+powerd (0.15-0ubuntu1) UNRELEASED; urgency=medium
69+
70+ * Also exporting dim brightness value via getBrightnessParams
71+ * Bump major version due dbus API changes
72+
73+ -- Ricardo Salveti de Araujo <ricardo.salveti@canonical.com> Tue, 22 Apr 2014 23:18:06 -0300
74+
75 powerd (0.14+14.04.20140415-0ubuntu1) trusty; urgency=low
76
77 [ Michael Terry ]
78
79=== modified file 'src/backlight.c'
80--- src/backlight.c 2014-01-14 03:14:22 +0000
81+++ src/backlight.c 2014-04-23 02:22:08 +0000
82@@ -161,7 +161,8 @@
83 {
84 gboolean ab_available = powerd_autobrightness_available();
85 g_dbus_method_invocation_return_value(invocation,
86- g_variant_new("((iiib))",
87+ g_variant_new("((iiiib))",
88+ dim_brightness,
89 min_user_brightness,
90 max_brightness,
91 default_brightness,

Subscribers

People subscribed via source and target branches