@@ -25,6 +25,18 @@ void autoBrightnessChanged(GSettings *settings, const gchar *key, QDBusInterface
2525 unityScreen->asyncCall("userAutobrightnessEnable", QVariant(value));
2626}
2727
28+void activityTimeoutChanged(GSettings *settings, const gchar *key, QDBusInterface *unityScreen)
29+{
30+ int value = g_settings_get_uint(settings, key);
31+ unityScreen->asyncCall("setInactivityTimeouts", QVariant(value), QVariant(-1));
32+}
33+
34+void dimTimeoutChanged(GSettings *settings, const gchar *key, QDBusInterface *unityScreen)
35+{
36+ int value = g_settings_get_uint(settings, key);
37+ unityScreen->asyncCall("setInactivityTimeouts", QVariant(-1), QVariant(value));
38+}
39+
2840Powerd::Powerd(QObject* parent)
2941 : QObject(parent),
3042 unityScreen(NULL)
@@ -43,7 +55,11 @@ Powerd::Powerd(QObject* parent)
4355
4456 systemSettings = g_settings_new("com.ubuntu.touch.system");
4557 g_signal_connect(systemSettings, "changed::auto-brightness", G_CALLBACK(autoBrightnessChanged), unityScreen);
58+ g_signal_connect(systemSettings, "changed::activity-timeout", G_CALLBACK(activityTimeoutChanged), unityScreen);
59+ g_signal_connect(systemSettings, "changed::dim-timeout", G_CALLBACK(dimTimeoutChanged), unityScreen);
4660 autoBrightnessChanged(systemSettings, "auto-brightness", unityScreen);
61+ activityTimeoutChanged(systemSettings, "activity-timeout", unityScreen);
62+ dimTimeoutChanged(systemSettings, "dim-timeout", unityScreen);
4763}
4864
4965Powerd::~Powerd()