Replace "lower power mode" experiment
This replaces the previous low-power mode experiment, which
discarded refresh events, with a new experiment that alters
the refresh period.
(see also I2849e5ea335c0d2509fea1c315392bce7f20451d )
The feature is enabled by specifying a nonzero value for the
"refresh skip count", which indicates the number of periods
to skip. For example, the command:
adb shell service call SurfaceFlinger 1016 i32 1
sets a skip count of '1', yielding a 30Hz refresh rate on a device
with a 60Hz display. Changing the last value to '2' would set the
refresh to 20Hz. '0' returns to the default behavior.
Bug 15523257
Change-Id: I00039c22a55750e74035644c63800e4bee1c774a
diff --git a/services/surfaceflinger/SurfaceFlinger.cpp b/services/surfaceflinger/SurfaceFlinger.cpp
index 3bdbb4f..f06db5c 100644
--- a/services/surfaceflinger/SurfaceFlinger.cpp
+++ b/services/surfaceflinger/SurfaceFlinger.cpp
@@ -2682,11 +2682,8 @@
// This is an experimental interface
// Needs to be shifted to proper binder interface when we productize
case 1016: {
- mPrimaryDispSync.setLowPowerMode(true);
- return NO_ERROR;
- }
- case 1017: {
- mPrimaryDispSync.setLowPowerMode(false);
+ n = data.readInt32();
+ mPrimaryDispSync.setRefreshSkipCount(n);
return NO_ERROR;
}
}