Loading cmds/bootanimation/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ LOCAL_SHARED_LIBRARIES := \ libandroidfw \ libutils \ libbinder \ libhardware \ libui \ libskia \ libEGL \ Loading cmds/bootanimation/BootAnimation.cpp +22 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,8 @@ #include <media/mediaplayer.h> #include <media/IMediaHTTPService.h> #include <hardware/power.h> #include "BootAnimation.h" #include "AudioPlayer.h" Loading Loading @@ -117,6 +119,24 @@ class MPlayerListener : public MediaPlayerListener } }; static void setPowerHint(int durationMs) { int rc; power_module_t *power_module = NULL; rc = hw_get_module(POWER_HARDWARE_MODULE_ID, (const hw_module_t **)&power_module); if (rc) { ALOGE("%s: Failed to obtain reference to power module %s\n", __func__, strerror(-rc)); return; } if (power_module && power_module->powerHint) { power_module->powerHint(power_module, POWER_HINT_CPU_BOOST, (void *)(static_cast<int64_t>(durationMs))); } } static long getFreeMemory(void) { int fd = open("/proc/meminfo", O_RDONLY); Loading Loading @@ -772,6 +792,8 @@ bool BootAnimation::movie() } setPowerHint(frameDuration * 1000 * fcount); for (int r=0 ; !part.count || r<part.count ; r++) { // Exit any non playuntil complete parts immediately if(exitPending() && !part.playUntilComplete) Loading Loading
cmds/bootanimation/Android.mk +1 −0 Original line number Diff line number Diff line Loading @@ -16,6 +16,7 @@ LOCAL_SHARED_LIBRARIES := \ libandroidfw \ libutils \ libbinder \ libhardware \ libui \ libskia \ libEGL \ Loading
cmds/bootanimation/BootAnimation.cpp +22 −0 Original line number Diff line number Diff line Loading @@ -56,6 +56,8 @@ #include <media/mediaplayer.h> #include <media/IMediaHTTPService.h> #include <hardware/power.h> #include "BootAnimation.h" #include "AudioPlayer.h" Loading Loading @@ -117,6 +119,24 @@ class MPlayerListener : public MediaPlayerListener } }; static void setPowerHint(int durationMs) { int rc; power_module_t *power_module = NULL; rc = hw_get_module(POWER_HARDWARE_MODULE_ID, (const hw_module_t **)&power_module); if (rc) { ALOGE("%s: Failed to obtain reference to power module %s\n", __func__, strerror(-rc)); return; } if (power_module && power_module->powerHint) { power_module->powerHint(power_module, POWER_HINT_CPU_BOOST, (void *)(static_cast<int64_t>(durationMs))); } } static long getFreeMemory(void) { int fd = open("/proc/meminfo", O_RDONLY); Loading Loading @@ -772,6 +792,8 @@ bool BootAnimation::movie() } setPowerHint(frameDuration * 1000 * fcount); for (int r=0 ; !part.count || r<part.count ; r++) { // Exit any non playuntil complete parts immediately if(exitPending() && !part.playUntilComplete) Loading