Make setScreenPowerMode() method static

Its implementation does not use the instance at all.
pull/1576/head
Romain Vimont 4 years ago
parent f7d4b6d0db
commit 334964c380

@ -116,7 +116,7 @@ public class Controller {
case ControlMessage.TYPE_SET_SCREEN_POWER_MODE:
if (device.supportsInputEvents()) {
int mode = msg.getAction();
boolean setPowerModeOk = device.setScreenPowerMode(mode);
boolean setPowerModeOk = Device.setScreenPowerMode(mode);
if (setPowerModeOk) {
Ln.i("Device screen turned " + (mode == Device.POWER_MODE_OFF ? "off" : "on"));
}

@ -230,7 +230,7 @@ public final class Device {
/**
* @param mode one of the {@code SCREEN_POWER_MODE_*} constants
*/
public boolean setScreenPowerMode(int mode) {
public static boolean setScreenPowerMode(int mode) {
IBinder d = SurfaceControl.getBuiltInDisplay();
if (d == null) {
Ln.e("Could not get built-in display");

Loading…
Cancel
Save