# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/.
from mozdevice import ADBError
def tune_performance(device, log=None, timeout=None): """Set various performance-oriented parameters, to reduce jitter.
def turn_off_services(self):
services = [ "mpdecision", "thermal-engine", "thermald",
] for service in services: try:
self.log.info(" ".join(["turning off service:", service]))
self.device.shell_bool( " ".join(["stop", service]), timeout=self.timeout
) except ADBError as e:
self.log.info( "Ignoring failure to stop service {}. Error: {}: {}".format(
service, e.__class__.__name__, e
)
)
services_list_output = self.device.shell_output( "service list", timeout=self.timeout
) for service in services: if service notin services_list_output:
self.log.info(" ".join(["successfully terminated:", service])) else:
self.log.warning(" ".join(["failed to terminate:", service]))
for key, value in commands.items():
command = " ".join(["settings", "put", "global", key, str(value)])
self.log.info("setting {} to {}".format(key, value))
self.device.shell_bool(command, timeout=self.timeout)
def restore_animations(self): # animation settings are not restored to default by reboot
self.log.info("restoring animations")
commands = { "animator_duration_scale": 1.0, "transition_animation_scale": 1.0, "window_animation_scale": 1.0,
}
for key, value in commands.items():
command = " ".join(["settings", "put", "global", key, str(value)])
self.device.shell_bool(command, timeout=self.timeout)
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.