~ycheng-twn/powerd/powerd_allow-non-root-dbus-cmd

« back to all changes in this revision

Viewing changes to src/powerd.cpp

  • Committer: Tarmac
  • Author(s): Ricardo Mendoza
  • Date: 2013-10-09 18:41:47 UTC
  • mfrom: (99.1.2 build)
  • Revision ID: tarmac-20131009184147-crqd2zwjbbr1ui2l
Use power HAL to signal power subsystems to resume quickly as user interaction is expected. Fixes: https://bugs.launchpad.net/bugs/1233257.

Approved by Ricardo Salveti, PS Jenkins bot.

Show diffs side-by-side

added added

removed removed

Lines of Context:
50
50
 
51
51
#include "libsuspend.h"
52
52
 
 
53
#include <android/hardware/power.h>
 
54
 
53
55
static GThread *powerd_mainloop_thread;
54
56
 
55
57
namespace
153
155
    return FALSE;
154
156
}
155
157
 
 
158
static struct power_module* _power_module;
 
159
 
156
160
void on_new_event(Event* event, void* context)
157
161
{
158
162
    switch(event->type)
241
245
 
242
246
}   //namespace
243
247
 
 
248
void powerd_hal_signal_activity(void)
 
249
{
 
250
    powerd_warn("signalling activity via HAL");
 
251
    if (_power_module)
 
252
        _power_module->powerHint(_power_module, POWER_HINT_INTERACTION, NULL);
 
253
}
 
254
 
244
255
void powerd_reset_activity_timer(int add)
245
256
{
246
257
    int timeout;
466
477
    input_area_height : 2048
467
478
    };
468
479
 
 
480
    int err = hw_get_module(POWER_HARDWARE_MODULE_ID,
 
481
        (hw_module_t const**)&_power_module);
 
482
 
 
483
    if (!err)
 
484
        _power_module->init(_power_module);
 
485
 
469
486
    android_input_stack_initialize(&listener, &config);
470
487
    android_input_stack_start();
471
488