support duration hint to improve fling behavior
bug 24059298
Change-Id: I0f9b50d5ff7ab8b7c5263286ed2a995f9f624181
diff --git a/power/power.c b/power/power.c
index 8415a49..d6f3b20 100644
--- a/power/power.c
+++ b/power/power.c
@@ -227,6 +227,19 @@
int resources_downmigrate[] = {0x4F0A};
int duration_downmigrate = 1000;
+ if (data) {
+ // modify downmigrate duration based on interaction data hint
+ // 1000 <= duration_downmigrate <= 5000
+ int duration_hint = *((int*)data);
+ if (duration_hint > 1000) {
+ if (duration_hint < 5000) {
+ duration_downmigrate = duration_hint;
+ } else {
+ duration_downmigrate = 5000;
+ }
+ }
+ }
+
interaction(duration, sizeof(resources)/sizeof(resources[0]), resources);
interaction(duration_big, sizeof(resources_big)/sizeof(resources_big[0]), resources_big);
interaction(duration_downmigrate, sizeof(resources_downmigrate)/sizeof(resources_downmigrate[0]), resources_downmigrate);