SurfaceFlinger: send VSYNC power hints to IPowerManager
VSYNC power hints are now sent via binder to IPowerManager.
SurfaceFlinger no longer loads a second copy of the PowerHAL.
VSYNC power hints are sent in batches and not on per frame basis.
Change-Id: Ia5a839ab3c857cffae7089f810b4315d4ed23fcf
diff --git a/services/surfaceflinger/DisplayHardware/PowerHAL.h b/services/surfaceflinger/DisplayHardware/PowerHAL.h
index ef67b8f..e5f82a9 100644
--- a/services/surfaceflinger/DisplayHardware/PowerHAL.h
+++ b/services/surfaceflinger/DisplayHardware/PowerHAL.h
@@ -19,7 +19,9 @@
#include <stdint.h>
#include <sys/types.h>
+#include <utils/Mutex.h>
+#include <powermanager/IPowerManager.h>
#include <hardware/power.h>
namespace android {
@@ -28,15 +30,11 @@
class PowerHAL
{
public:
- PowerHAL();
- ~PowerHAL();
-
- status_t initCheck() const;
status_t vsyncHint(bool enabled);
private:
- power_module_t* mPowerModule;
- bool mVSyncHintEnabled;
+ sp<IPowerManager> mPowerManager;
+ Mutex mlock;
};
// ---------------------------------------------------------------------------