telemetry.internal.platform.android_platform_backend | index telemetry/internal/platform/android_platform_backend.py

`# Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.`

Modules
`` |  |

adb_install_cert telemetry.internal.platform.android_device telemetry.internal.platform.power_monitor.android_dumpsys_power_monitor telemetry.internal.forwarders.android_forwarder telemetry.internal.platform.power_monitor.android_fuelgauge_power_monitor
telemetry.core.android_platform
telemetry.internal.platform.profiler.android_prebuilt_profiler_helper
telemetry.internal.platform.power_monitor.android_temperature_monitor
devil.android.battery_utils
telemetry.internal.util.binary_manager
devil.android.perf.cache_control
certutils
pylib.constants
telemetry.decorators
devil.android.device_errors
devil.android.device_utils
telemetry.internal.util.exception_formatter
telemetry.core.exceptions
telemetry.internal.util.external_modules
telemetry.internal.platform.linux_based_platform_backend
logging
telemetry.internal.platform.power_monitor.monsoon_power_monitor
os
devil.android.perf.perf_control
telemetry.core.platform
platformsettings
telemetry.internal.platform.power_monitor.power_monitor_controller
psutil
re
pylib.screenshot
shutil
stat
subprocess
devil.android.perf.surface_stats_collector
telemetry.internal.platform.power_monitor.sysfs_power_monitor
tempfile
devil.android.perf.thermal_throttle
telemetry.core.util
devil.android.sdk.version_codes
telemetry.internal.image_processing.video

Classes
`` |  |

telemetry.internal.platform.linux_based_platform_backend.LinuxBasedPlatformBackend(telemetry.internal.platform.platform_backend.PlatformBackend)
  AndroidPlatformBackend

class AndroidPlatformBackend(telemetry.internal.platform.linux_based_platform_backend.LinuxBasedPlatformBackend)
`` |  |

Method resolution order:
  AndroidPlatformBackend
  telemetry.internal.platform.linux_based_platform_backend.LinuxBasedPlatformBackend
  telemetry.internal.platform.platform_backend.PlatformBackend
  __builtin__.object

Methods defined here:

CanCaptureVideo(*args, **kwargs)

CanFlushIndividualFilesFromSystemCache(self)

CanLaunchApplication(self, application)

CanMonitorNetworkData(self)

CanMonitorPower(self)

CanMonitorThermalThrottling(self)

CanTakeScreenshot(self)

DismissCrashDialogIfNeeded(self)
  `Dismiss any error dialogs.
  Limit the number in case we have an error loop or we are failing to dismiss.`

FlushDnsCache(self)

FlushEntireSystemCache(self)

FlushSystemCacheForDirectory(self, directory)

ForwardHostToDevice(self, host_port, device_port)

GetArchName(*args, **kwargs)

GetChildPids(self, pid)

GetCommandLine(*args, **kwargs)

GetCpuStats(self, pid)

GetCpuTimestamp(self)

GetDeviceTypeName(self)

GetFileContents(self, fname)

GetMemoryStats(self, pid)

GetNetworkData(self, browser)

GetOSName(self)

GetOSVersionName(*args, **kwargs)

GetPsOutput(self, columns, pid=None)

GetStackTrace(self, target_arch)
  `Returns stack trace.
  The stack trace consists of raw logcat dump, logcat dump with symbols,
  and stack info from tomstone files.
  Args:
  target_arch: String specifying device architecture (eg. arm, arm64, mips,
  x86, x86_64)`

GetStandardOutput(self, number_of_lines=500)
  `Returns most recent lines of logcat dump.
  Args:
  number_of_lines: Number of lines of log to return.`

HasBeenThermallyThrottled(self)

InstallApplication(self, application)

InstallTestCa(self)
  `Install a randomly generated root CA on the android device.
  This allows transparent HTTPS testing with WPR server without need
  to tweak application network stack.`

IsAppRunning(self, process_name)
  `Determine if the given process is running.
  Args:
  process_name: The full package name string of the process.`

IsApplicationRunning(self, application)

IsDisplayTracingSupported(self)

IsScreenLocked(self)
  `Determines if device screen is locked.`

IsScreenOn(self)
  `Determines if device screen is on.`

IsThermallyThrottled(self)

KillApplication(self, application)
  `Kill the given |application|.
  Might be used instead of ForceStop for efficiency reasons.
  Args:
  application: The full package name string of the application to kill.`

LaunchApplication(self, application, parameters=None, elevate_privilege=False)
  `Launches the given |application| with a list of |parameters| on the OS.
  Args:
  application: The full package name string of the application to launch.
  parameters: A list of parameters to be passed to the ActivityManager.
  elevate_privilege: Currently unimplemented on Android.`

PathExists(self, device_path, timeout=None, retries=None)
  `Return whether the given path exists on the device.
  This method is the same as
  devil.android.device_utils.DeviceUtils.PathExists.`

PullProfile(self, package, output_profile_path)
  `Copy application profile from device to host machine.
  Args:
  package: The full package name string of the application for which the
  profile is to be copied.
  output_profile_dir: Location where profile to be stored on host machine.`

PurgeUnpinnedMemory(self)
  `Purges the unpinned ashmem memory for the whole system.
  This can be used to make memory measurements more stable. Requires root.`

PushProfile(self, package, new_profile_dir)
  `Replace application profile with files found on host machine.
  Pushing the profile is slow, so we don't want to do it every time.
  Avoid this by pushing to a safe location using PushChangedFiles, and
  then copying into the correct location on each test run.
  Args:
  package: The full package name string of the application for which the
  profile is to be updated.
  new_profile_dir: Location where profile to be pushed is stored on the
  host machine.`

RemoveProfile(self, package, ignore_list)
  `Delete application profile on device.
  Args:
  package: The full package name string of the application for which the
  profile is to be deleted.
  ignore_list: List of files to keep.`

RemoveTestCa(self)
  `Remove root CA generated by previous call to InstallTestCa().
  Removes the test root certificate from both the device and host machine.`

RunCommand(self, command)

SetDebugApp(self, package)
  `Set application to debugging.
  Args:
  package: The full package name string of the application.`

SetFullPerformanceModeEnabled(self, enabled)

SetGraphicsMemoryTrackingEnabled(self, enabled)

SetRelaxSslCheck(self, value)

StartDisplayTracing(self)

StartMonitoringPower(self, browser)

StartVideoCapture(self, min_bitrate_mbps)
  `Starts the video capture at specified bitrate.`

StopApplication(self, application)
  `Stop the given |application|.
  Args:
  application: The full package name string of the application to stop.`

StopDisplayTracing(self)

StopForwardingHost(self, host_port)

StopMonitoringPower(self)

StopVideoCapture(self)

TakeScreenshot(self, file_path)

__init__(self, device, finder_options)

Class methods defined here:

CreatePlatformForDevice(cls, device, finder_options) from __builtin__.type

SupportsDevice(cls, device) from __builtin__.type

Static methods defined here:

ParseCStateSample(sample)

Data descriptors defined here:

device

forwarder_factory

is_test_ca_installed

is_video_capture_running

log_file_path

use_rndis_forwarder

wpr_ca_cert_path
  `Path to root certificate installed on browser (or None).
  If this is set, web page replay will use it to sign HTTPS responses.`

Methods inherited from telemetry.internal.platform.linux_based_platform_backend.LinuxBasedPlatformBackend:

GetClockTicks(*args, **kwargs)
  `Returns the number of clock ticks per second.
  The proper way is to call os.sysconf('SC_CLK_TCK') but that is not easy to
  do on Android/CrOS. In practice, nearly all Linux machines have a USER_HZ
  of 100, so just return that.`

GetSystemCommitCharge(self)
  `# Get the commit charge in kB.`

GetSystemTotalPhysicalMemory(*args, **kwargs)

Methods inherited from telemetry.internal.platform.platform_backend.PlatformBackend:

CanMeasurePerApplicationPower(self)

CooperativelyShutdown(self, proc, app_name)
  `Cooperatively shut down the given process from subprocess.Popen.
  Currently this is only implemented on Windows. See
  crbug.com/424024 for background on why it was added.
  Args:
  proc: a process object returned from subprocess.Popen.
  app_name: on Windows, is the prefix of the application's window
  class name that should be searched for. This helps ensure
  that only the application's windows are closed.
  Returns True if it is believed the attempt succeeded.`

DidCreateBrowser(self, browser, browser_backend)

DidStartBrowser(self, browser, browser_backend)

GetRemotePort(self, port)

InitPlatformBackend(self)

IsCooperativeShutdownSupported(self)
  `Indicates whether CooperativelyShutdown, below, is supported.
  It is not necessary to implement it on all platforms.`

ReadMsr(self, msr_number, start=0, length=64)
  `Read a CPU model-specific register (MSR).
  Which MSRs are available depends on the CPU model.
  On systems with multiple CPUs, this function may run on any CPU.
  Args:
  msr_number: The number of the register to read.
  start: The least significant bit to read, zero-indexed.
  (Said another way, the number of bits to right-shift the MSR value.)
  length: The number of bits to read. MSRs are 64 bits, even on 32-bit CPUs.`

SetPlatform(self, platform)

WillCloseBrowser(self, browser, browser_backend)

Class methods inherited from telemetry.internal.platform.platform_backend.PlatformBackend:

IsPlatformBackendForHost(cls) from __builtin__.type
  `Returns whether this platform backend is the platform backend to be used
  for the host device which telemetry is running on.`

Data descriptors inherited from telemetry.internal.platform.platform_backend.PlatformBackend:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`

is_host_platform

network_controller_backend

platform

running_browser_backends

tracing_controller_backend

wpr_http_device_port

wpr_https_device_port