1
2<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3<html><head><title>Python: module telemetry.core.android_platform</title>
4<meta charset="utf-8">
5</head><body bgcolor="#f0f0f8">
6
7<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
8<tr bgcolor="#7799ee">
9<td valign=bottom>&nbsp;<br>
10<font color="#ffffff" face="helvetica, arial">&nbsp;<br><big><big><strong><a href="telemetry.html"><font color="#ffffff">telemetry</font></a>.<a href="telemetry.core.html"><font color="#ffffff">core</font></a>.android_platform</strong></big></big></font></td
11><td align=right valign=bottom
12><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="../telemetry/core/android_platform.py">telemetry/core/android_platform.py</a></font></td></tr></table>
13    <p><tt>#&nbsp;Copyright&nbsp;2014&nbsp;The&nbsp;Chromium&nbsp;Authors.&nbsp;All&nbsp;rights&nbsp;reserved.<br>
14#&nbsp;Use&nbsp;of&nbsp;this&nbsp;source&nbsp;code&nbsp;is&nbsp;governed&nbsp;by&nbsp;a&nbsp;BSD-style&nbsp;license&nbsp;that&nbsp;can&nbsp;be<br>
15#&nbsp;found&nbsp;in&nbsp;the&nbsp;LICENSE&nbsp;file.</tt></p>
16<p>
17<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
18<tr bgcolor="#aa55cc">
19<td colspan=3 valign=bottom>&nbsp;<br>
20<font color="#ffffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
21
22<tr><td bgcolor="#aa55cc"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
23<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="telemetry.core.android_action_runner.html">telemetry.core.android_action_runner</a><br>
24</td><td width="25%" valign=top><a href="telemetry.internal.app.android_app.html">telemetry.internal.app.android_app</a><br>
25</td><td width="25%" valign=top><a href="telemetry.internal.backends.android_app_backend.html">telemetry.internal.backends.android_app_backend</a><br>
26</td><td width="25%" valign=top><a href="telemetry.core.platform.html">telemetry.core.platform</a><br>
27</td></tr></table></td></tr></table><p>
28<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
29<tr bgcolor="#ee77aa">
30<td colspan=3 valign=bottom>&nbsp;<br>
31<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
32
33<tr><td bgcolor="#ee77aa"><tt>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
34<td width="100%"><dl>
35<dt><font face="helvetica, arial"><a href="telemetry.core.platform.html#Platform">telemetry.core.platform.Platform</a>(<a href="__builtin__.html#object">__builtin__.object</a>)
36</font></dt><dd>
37<dl>
38<dt><font face="helvetica, arial"><a href="telemetry.core.android_platform.html#AndroidPlatform">AndroidPlatform</a>
39</font></dt></dl>
40</dd>
41</dl>
42 <p>
43<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
44<tr bgcolor="#ffc8d8">
45<td colspan=3 valign=bottom>&nbsp;<br>
46<font color="#000000" face="helvetica, arial"><a name="AndroidPlatform">class <strong>AndroidPlatform</strong></a>(<a href="telemetry.core.platform.html#Platform">telemetry.core.platform.Platform</a>)</font></td></tr>
47
48<tr><td bgcolor="#ffc8d8"><tt>&nbsp;&nbsp;&nbsp;</tt></td><td>&nbsp;</td>
49<td width="100%"><dl><dt>Method resolution order:</dt>
50<dd><a href="telemetry.core.android_platform.html#AndroidPlatform">AndroidPlatform</a></dd>
51<dd><a href="telemetry.core.platform.html#Platform">telemetry.core.platform.Platform</a></dd>
52<dd><a href="__builtin__.html#object">__builtin__.object</a></dd>
53</dl>
54<hr>
55Methods defined here:<br>
56<dl><dt><a name="AndroidPlatform-LaunchAndroidApplication"><strong>LaunchAndroidApplication</strong></a>(self, start_intent, is_app_ready_predicate<font color="#909090">=None</font>, app_has_webviews<font color="#909090">=True</font>)</dt><dd><tt>Launches&nbsp;an&nbsp;Android&nbsp;application&nbsp;given&nbsp;the&nbsp;intent.<br>
57&nbsp;<br>
58Args:<br>
59&nbsp;&nbsp;start_intent:&nbsp;The&nbsp;intent&nbsp;to&nbsp;use&nbsp;to&nbsp;start&nbsp;the&nbsp;app.<br>
60&nbsp;&nbsp;is_app_ready_predicate:&nbsp;A&nbsp;predicate&nbsp;function&nbsp;to&nbsp;determine<br>
61&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;whether&nbsp;the&nbsp;app&nbsp;is&nbsp;ready.&nbsp;This&nbsp;is&nbsp;a&nbsp;function&nbsp;that&nbsp;takes&nbsp;an<br>
62&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;AndroidApp&nbsp;instance&nbsp;and&nbsp;return&nbsp;a&nbsp;boolean.&nbsp;When&nbsp;it&nbsp;is&nbsp;not&nbsp;passed&nbsp;in,<br>
63&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;the&nbsp;app&nbsp;is&nbsp;ready&nbsp;when&nbsp;the&nbsp;intent&nbsp;to&nbsp;launch&nbsp;it&nbsp;is&nbsp;completed.<br>
64&nbsp;&nbsp;app_has_webviews:&nbsp;A&nbsp;boolean&nbsp;indicating&nbsp;whether&nbsp;the&nbsp;app&nbsp;is&nbsp;expected&nbsp;to<br>
65&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;contain&nbsp;any&nbsp;WebViews.&nbsp;If&nbsp;True,&nbsp;the&nbsp;app&nbsp;will&nbsp;be&nbsp;launched&nbsp;with<br>
66&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;appropriate&nbsp;webview&nbsp;flags,&nbsp;and&nbsp;the&nbsp;GetWebViews&nbsp;method&nbsp;of&nbsp;the&nbsp;returned<br>
67&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;object&nbsp;may&nbsp;be&nbsp;used&nbsp;to&nbsp;access&nbsp;them.<br>
68&nbsp;<br>
69Returns:<br>
70&nbsp;&nbsp;A&nbsp;reference&nbsp;to&nbsp;the&nbsp;android_app&nbsp;launched.</tt></dd></dl>
71
72<dl><dt><a name="AndroidPlatform-__init__"><strong>__init__</strong></a>(self, platform_backend)</dt></dl>
73
74<hr>
75Data descriptors defined here:<br>
76<dl><dt><strong>android_action_runner</strong></dt>
77</dl>
78<hr>
79Methods inherited from <a href="telemetry.core.platform.html#Platform">telemetry.core.platform.Platform</a>:<br>
80<dl><dt><a name="AndroidPlatform-CanCaptureVideo"><strong>CanCaptureVideo</strong></a>(self)</dt><dd><tt>Returns&nbsp;a&nbsp;bool&nbsp;indicating&nbsp;whether&nbsp;the&nbsp;platform&nbsp;supports&nbsp;video&nbsp;capture.</tt></dd></dl>
81
82<dl><dt><a name="AndroidPlatform-CanFlushIndividualFilesFromSystemCache"><strong>CanFlushIndividualFilesFromSystemCache</strong></a>(self)</dt><dd><tt>Returns&nbsp;true&nbsp;if&nbsp;the&nbsp;disk&nbsp;cache&nbsp;can&nbsp;be&nbsp;flushed&nbsp;for&nbsp;specific&nbsp;files.</tt></dd></dl>
83
84<dl><dt><a name="AndroidPlatform-CanLaunchApplication"><strong>CanLaunchApplication</strong></a>(self, application)</dt><dd><tt>Returns&nbsp;whether&nbsp;the&nbsp;platform&nbsp;can&nbsp;launch&nbsp;the&nbsp;given&nbsp;application.</tt></dd></dl>
85
86<dl><dt><a name="AndroidPlatform-CanMeasurePerApplicationPower"><strong>CanMeasurePerApplicationPower</strong></a>(self)</dt><dd><tt>Returns&nbsp;True&nbsp;if&nbsp;the&nbsp;power&nbsp;monitor&nbsp;can&nbsp;measure&nbsp;power&nbsp;for&nbsp;the&nbsp;target<br>
87application&nbsp;in&nbsp;isolation.&nbsp;False&nbsp;if&nbsp;power&nbsp;measurement&nbsp;is&nbsp;for&nbsp;full&nbsp;system<br>
88energy&nbsp;consumption.</tt></dd></dl>
89
90<dl><dt><a name="AndroidPlatform-CanMonitorNetworkData"><strong>CanMonitorNetworkData</strong></a>(self)</dt><dd><tt>Returns&nbsp;true&nbsp;if&nbsp;network&nbsp;data&nbsp;can&nbsp;be&nbsp;retrieved,&nbsp;false&nbsp;otherwise.</tt></dd></dl>
91
92<dl><dt><a name="AndroidPlatform-CanMonitorPower"><strong>CanMonitorPower</strong></a>(self)</dt><dd><tt>Returns&nbsp;True&nbsp;iff&nbsp;power&nbsp;can&nbsp;be&nbsp;monitored&nbsp;asynchronously&nbsp;via<br>
93<a href="#AndroidPlatform-StartMonitoringPower">StartMonitoringPower</a>()&nbsp;and&nbsp;<a href="#AndroidPlatform-StopMonitoringPower">StopMonitoringPower</a>().</tt></dd></dl>
94
95<dl><dt><a name="AndroidPlatform-CanMonitorThermalThrottling"><strong>CanMonitorThermalThrottling</strong></a>(self)</dt><dd><tt>Platforms&nbsp;may&nbsp;be&nbsp;able&nbsp;to&nbsp;detect&nbsp;thermal&nbsp;throttling.<br>
96&nbsp;<br>
97Some&nbsp;fan-less&nbsp;computers&nbsp;go&nbsp;into&nbsp;a&nbsp;reduced&nbsp;performance&nbsp;mode&nbsp;when&nbsp;their&nbsp;heat<br>
98exceeds&nbsp;a&nbsp;certain&nbsp;threshold.&nbsp;Performance&nbsp;tests&nbsp;in&nbsp;particular&nbsp;should&nbsp;use&nbsp;this<br>
99API&nbsp;to&nbsp;detect&nbsp;if&nbsp;this&nbsp;has&nbsp;happened&nbsp;and&nbsp;interpret&nbsp;results&nbsp;accordingly.</tt></dd></dl>
100
101<dl><dt><a name="AndroidPlatform-CanTakeScreenshot"><strong>CanTakeScreenshot</strong></a>(self)</dt></dl>
102
103<dl><dt><a name="AndroidPlatform-CooperativelyShutdown"><strong>CooperativelyShutdown</strong></a>(self, proc, app_name)</dt><dd><tt>Cooperatively&nbsp;shut&nbsp;down&nbsp;the&nbsp;given&nbsp;process&nbsp;from&nbsp;subprocess.Popen.<br>
104&nbsp;<br>
105Currently&nbsp;this&nbsp;is&nbsp;only&nbsp;implemented&nbsp;on&nbsp;Windows.&nbsp;See<br>
106crbug.com/424024&nbsp;for&nbsp;background&nbsp;on&nbsp;why&nbsp;it&nbsp;was&nbsp;added.<br>
107&nbsp;<br>
108Args:<br>
109&nbsp;&nbsp;proc:&nbsp;a&nbsp;process&nbsp;object&nbsp;returned&nbsp;from&nbsp;subprocess.Popen.<br>
110&nbsp;&nbsp;app_name:&nbsp;on&nbsp;Windows,&nbsp;is&nbsp;the&nbsp;prefix&nbsp;of&nbsp;the&nbsp;application's&nbsp;window<br>
111&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;class&nbsp;name&nbsp;that&nbsp;should&nbsp;be&nbsp;searched&nbsp;for.&nbsp;This&nbsp;helps&nbsp;ensure<br>
112&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;that&nbsp;only&nbsp;the&nbsp;application's&nbsp;windows&nbsp;are&nbsp;closed.<br>
113&nbsp;<br>
114Returns&nbsp;True&nbsp;if&nbsp;it&nbsp;is&nbsp;believed&nbsp;the&nbsp;attempt&nbsp;succeeded.</tt></dd></dl>
115
116<dl><dt><a name="AndroidPlatform-FlushDnsCache"><strong>FlushDnsCache</strong></a>(self)</dt><dd><tt>Flushes&nbsp;the&nbsp;OS's&nbsp;DNS&nbsp;cache&nbsp;completely.<br>
117&nbsp;<br>
118This&nbsp;function&nbsp;may&nbsp;require&nbsp;root&nbsp;or&nbsp;administrator&nbsp;access.</tt></dd></dl>
119
120<dl><dt><a name="AndroidPlatform-FlushEntireSystemCache"><strong>FlushEntireSystemCache</strong></a>(self)</dt><dd><tt>Flushes&nbsp;the&nbsp;OS's&nbsp;file&nbsp;cache&nbsp;completely.<br>
121&nbsp;<br>
122This&nbsp;function&nbsp;may&nbsp;require&nbsp;root&nbsp;or&nbsp;administrator&nbsp;access.</tt></dd></dl>
123
124<dl><dt><a name="AndroidPlatform-FlushSystemCacheForDirectory"><strong>FlushSystemCacheForDirectory</strong></a>(self, directory)</dt><dd><tt>Flushes&nbsp;the&nbsp;OS's&nbsp;file&nbsp;cache&nbsp;for&nbsp;the&nbsp;specified&nbsp;directory.<br>
125&nbsp;<br>
126This&nbsp;function&nbsp;does&nbsp;not&nbsp;require&nbsp;root&nbsp;or&nbsp;administrator&nbsp;access.</tt></dd></dl>
127
128<dl><dt><a name="AndroidPlatform-GetArchName"><strong>GetArchName</strong></a>(self)</dt><dd><tt>Returns&nbsp;a&nbsp;string&nbsp;description&nbsp;of&nbsp;the&nbsp;<a href="telemetry.core.platform.html#Platform">Platform</a>&nbsp;architecture.<br>
129&nbsp;<br>
130Examples:&nbsp;x86_64&nbsp;(posix),&nbsp;AMD64&nbsp;(win),&nbsp;armeabi-v7a,&nbsp;x86</tt></dd></dl>
131
132<dl><dt><a name="AndroidPlatform-GetDeviceTypeName"><strong>GetDeviceTypeName</strong></a>(self)</dt><dd><tt>Returns&nbsp;a&nbsp;string&nbsp;description&nbsp;of&nbsp;the&nbsp;<a href="telemetry.core.platform.html#Platform">Platform</a>&nbsp;device,&nbsp;or&nbsp;None.<br>
133&nbsp;<br>
134Examples:&nbsp;Nexus&nbsp;7,&nbsp;Nexus&nbsp;6,&nbsp;Desktop</tt></dd></dl>
135
136<dl><dt><a name="AndroidPlatform-GetNetworkData"><strong>GetNetworkData</strong></a>(self, browser)</dt><dd><tt>Get&nbsp;current&nbsp;network&nbsp;data.<br>
137Returns:<br>
138&nbsp;&nbsp;Tuple&nbsp;of&nbsp;(sent_data,&nbsp;received_data)&nbsp;in&nbsp;kb&nbsp;if&nbsp;data&nbsp;can&nbsp;be&nbsp;found,<br>
139&nbsp;&nbsp;None&nbsp;otherwise.</tt></dd></dl>
140
141<dl><dt><a name="AndroidPlatform-GetOSName"><strong>GetOSName</strong></a>(self)</dt><dd><tt>Returns&nbsp;a&nbsp;string&nbsp;description&nbsp;of&nbsp;the&nbsp;<a href="telemetry.core.platform.html#Platform">Platform</a>&nbsp;OS.<br>
142&nbsp;<br>
143Examples:&nbsp;WIN,&nbsp;MAC,&nbsp;LINUX,&nbsp;CHROMEOS</tt></dd></dl>
144
145<dl><dt><a name="AndroidPlatform-GetOSVersionName"><strong>GetOSVersionName</strong></a>(self)</dt><dd><tt>Returns&nbsp;a&nbsp;logically&nbsp;sortable,&nbsp;string-like&nbsp;description&nbsp;of&nbsp;the&nbsp;<a href="telemetry.core.platform.html#Platform">Platform</a>&nbsp;OS<br>
146version.<br>
147&nbsp;<br>
148Examples:&nbsp;VISTA,&nbsp;WIN7,&nbsp;LION,&nbsp;MOUNTAINLION</tt></dd></dl>
149
150<dl><dt><a name="AndroidPlatform-GetOSVersionNumber"><strong>GetOSVersionNumber</strong></a>(self)</dt><dd><tt>Returns&nbsp;an&nbsp;integer&nbsp;description&nbsp;of&nbsp;the&nbsp;<a href="telemetry.core.platform.html#Platform">Platform</a>&nbsp;OS&nbsp;major&nbsp;version.<br>
151&nbsp;<br>
152Examples:&nbsp;On&nbsp;Mac,&nbsp;13&nbsp;for&nbsp;Mavericks,&nbsp;14&nbsp;for&nbsp;Yosemite.</tt></dd></dl>
153
154<dl><dt><a name="AndroidPlatform-HasBeenThermallyThrottled"><strong>HasBeenThermallyThrottled</strong></a>(self)</dt><dd><tt>Returns&nbsp;True&nbsp;if&nbsp;the&nbsp;device&nbsp;has&nbsp;been&nbsp;thermally&nbsp;throttled.</tt></dd></dl>
155
156<dl><dt><a name="AndroidPlatform-InstallApplication"><strong>InstallApplication</strong></a>(self, application)</dt><dd><tt>Installs&nbsp;the&nbsp;given&nbsp;application.</tt></dd></dl>
157
158<dl><dt><a name="AndroidPlatform-IsApplicationRunning"><strong>IsApplicationRunning</strong></a>(self, application)</dt><dd><tt>Returns&nbsp;whether&nbsp;an&nbsp;application&nbsp;is&nbsp;currently&nbsp;running.</tt></dd></dl>
159
160<dl><dt><a name="AndroidPlatform-IsCooperativeShutdownSupported"><strong>IsCooperativeShutdownSupported</strong></a>(self)</dt><dd><tt>Indicates&nbsp;whether&nbsp;CooperativelyShutdown,&nbsp;below,&nbsp;is&nbsp;supported.<br>
161It&nbsp;is&nbsp;not&nbsp;necessary&nbsp;to&nbsp;implement&nbsp;it&nbsp;on&nbsp;all&nbsp;platforms.</tt></dd></dl>
162
163<dl><dt><a name="AndroidPlatform-IsMonitoringPower"><strong>IsMonitoringPower</strong></a>(self)</dt><dd><tt>Returns&nbsp;true&nbsp;if&nbsp;power&nbsp;is&nbsp;currently&nbsp;being&nbsp;monitored,&nbsp;false&nbsp;otherwise.</tt></dd></dl>
164
165<dl><dt><a name="AndroidPlatform-IsThermallyThrottled"><strong>IsThermallyThrottled</strong></a>(self)</dt><dd><tt>Returns&nbsp;True&nbsp;if&nbsp;the&nbsp;device&nbsp;is&nbsp;currently&nbsp;thermally&nbsp;throttled.</tt></dd></dl>
166
167<dl><dt><a name="AndroidPlatform-LaunchApplication"><strong>LaunchApplication</strong></a>(self, application, parameters<font color="#909090">=None</font>, elevate_privilege<font color="#909090">=False</font>)</dt><dd><tt>"Launches&nbsp;the&nbsp;given&nbsp;|application|&nbsp;with&nbsp;a&nbsp;list&nbsp;of&nbsp;|parameters|&nbsp;on&nbsp;the&nbsp;OS.<br>
168&nbsp;<br>
169Set&nbsp;|elevate_privilege|&nbsp;to&nbsp;launch&nbsp;the&nbsp;application&nbsp;with&nbsp;root&nbsp;or&nbsp;admin&nbsp;rights.<br>
170&nbsp;<br>
171Returns:<br>
172&nbsp;&nbsp;A&nbsp;popen&nbsp;style&nbsp;process&nbsp;handle&nbsp;for&nbsp;host&nbsp;platforms.</tt></dd></dl>
173
174<dl><dt><a name="AndroidPlatform-SetHTTPServerDirectories"><strong>SetHTTPServerDirectories</strong></a>(self, paths)</dt><dd><tt>Returns&nbsp;True&nbsp;if&nbsp;the&nbsp;HTTP&nbsp;server&nbsp;was&nbsp;started,&nbsp;False&nbsp;otherwise.</tt></dd></dl>
175
176<dl><dt><a name="AndroidPlatform-StartLocalServer"><strong>StartLocalServer</strong></a>(self, server)</dt><dd><tt>Starts&nbsp;a&nbsp;LocalServer&nbsp;and&nbsp;associates&nbsp;it&nbsp;with&nbsp;this&nbsp;platform.<br>
177|server.Close()|&nbsp;should&nbsp;be&nbsp;called&nbsp;manually&nbsp;to&nbsp;close&nbsp;the&nbsp;started&nbsp;server.</tt></dd></dl>
178
179<dl><dt><a name="AndroidPlatform-StartMonitoringPower"><strong>StartMonitoringPower</strong></a>(self, browser)</dt><dd><tt>Starts&nbsp;monitoring&nbsp;power&nbsp;utilization&nbsp;statistics.<br>
180&nbsp;<br>
181Args:<br>
182&nbsp;&nbsp;browser:&nbsp;The&nbsp;browser&nbsp;to&nbsp;monitor.</tt></dd></dl>
183
184<dl><dt><a name="AndroidPlatform-StartVideoCapture"><strong>StartVideoCapture</strong></a>(self, min_bitrate_mbps)</dt><dd><tt>Starts&nbsp;capturing&nbsp;video.<br>
185&nbsp;<br>
186Outer&nbsp;framing&nbsp;may&nbsp;be&nbsp;included&nbsp;(from&nbsp;the&nbsp;OS,&nbsp;browser&nbsp;window,&nbsp;and&nbsp;webcam).<br>
187&nbsp;<br>
188Args:<br>
189&nbsp;&nbsp;min_bitrate_mbps:&nbsp;The&nbsp;minimum&nbsp;capture&nbsp;bitrate&nbsp;in&nbsp;MegaBits&nbsp;Per&nbsp;Second.<br>
190&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The&nbsp;platform&nbsp;is&nbsp;free&nbsp;to&nbsp;deliver&nbsp;a&nbsp;higher&nbsp;bitrate&nbsp;if&nbsp;it&nbsp;can&nbsp;do&nbsp;so<br>
191&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;without&nbsp;increasing&nbsp;overhead.<br>
192&nbsp;<br>
193Raises:<br>
194&nbsp;&nbsp;ValueError&nbsp;if&nbsp;the&nbsp;required&nbsp;|min_bitrate_mbps|&nbsp;can't&nbsp;be&nbsp;achieved.</tt></dd></dl>
195
196<dl><dt><a name="AndroidPlatform-StopAllLocalServers"><strong>StopAllLocalServers</strong></a>(self)</dt></dl>
197
198<dl><dt><a name="AndroidPlatform-StopMonitoringPower"><strong>StopMonitoringPower</strong></a>(self)</dt><dd><tt>Stops&nbsp;monitoring&nbsp;power&nbsp;utilization&nbsp;and&nbsp;returns&nbsp;stats<br>
199&nbsp;<br>
200Returns:<br>
201&nbsp;&nbsp;None&nbsp;if&nbsp;power&nbsp;measurement&nbsp;failed&nbsp;for&nbsp;some&nbsp;reason,&nbsp;otherwise&nbsp;a&nbsp;dict&nbsp;of<br>
202&nbsp;&nbsp;power&nbsp;utilization&nbsp;statistics&nbsp;containing:&nbsp;{<br>
203&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;An&nbsp;identifier&nbsp;for&nbsp;the&nbsp;data&nbsp;provider.&nbsp;Allows&nbsp;to&nbsp;evaluate&nbsp;the&nbsp;precision<br>
204&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;of&nbsp;the&nbsp;data.&nbsp;Example&nbsp;values:&nbsp;monsoon,&nbsp;powermetrics,&nbsp;ds2784<br>
205&nbsp;&nbsp;&nbsp;&nbsp;'identifier':&nbsp;identifier,<br>
206&nbsp;<br>
207&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;The&nbsp;instantaneous&nbsp;power&nbsp;(voltage&nbsp;*&nbsp;current)&nbsp;reading&nbsp;in&nbsp;milliwatts&nbsp;at<br>
208&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;each&nbsp;sample.<br>
209&nbsp;&nbsp;&nbsp;&nbsp;'power_samples_mw':&nbsp;&nbsp;[mw0,&nbsp;mw1,&nbsp;...,&nbsp;mwN],<br>
210&nbsp;<br>
211&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;The&nbsp;full&nbsp;system&nbsp;energy&nbsp;consumption&nbsp;during&nbsp;the&nbsp;sampling&nbsp;period&nbsp;in<br>
212&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;milliwatt&nbsp;hours.&nbsp;May&nbsp;be&nbsp;estimated&nbsp;by&nbsp;integrating&nbsp;power&nbsp;samples&nbsp;or&nbsp;may<br>
213&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;be&nbsp;exact&nbsp;on&nbsp;supported&nbsp;hardware.<br>
214&nbsp;&nbsp;&nbsp;&nbsp;'energy_consumption_mwh':&nbsp;mwh,<br>
215&nbsp;<br>
216&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;The&nbsp;target&nbsp;application's&nbsp;energy&nbsp;consumption&nbsp;during&nbsp;the&nbsp;sampling&nbsp;period<br>
217&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;in&nbsp;milliwatt&nbsp;hours.&nbsp;Should&nbsp;be&nbsp;returned&nbsp;iff<br>
218&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;<a href="#AndroidPlatform-CanMeasurePerApplicationPower">CanMeasurePerApplicationPower</a>()&nbsp;return&nbsp;true.<br>
219&nbsp;&nbsp;&nbsp;&nbsp;'application_energy_consumption_mwh':&nbsp;mwh,<br>
220&nbsp;<br>
221&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;A&nbsp;platform-specific&nbsp;dictionary&nbsp;of&nbsp;additional&nbsp;details&nbsp;about&nbsp;the<br>
222&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;utilization&nbsp;of&nbsp;individual&nbsp;hardware&nbsp;components.<br>
223&nbsp;&nbsp;&nbsp;&nbsp;component_utilization:&nbsp;{<br>
224&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...<br>
225&nbsp;&nbsp;&nbsp;&nbsp;}<br>
226&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;<a href="telemetry.core.platform.html#Platform">Platform</a>-specific&nbsp;data&nbsp;not&nbsp;attributed&nbsp;to&nbsp;any&nbsp;particular&nbsp;hardware<br>
227&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;component.<br>
228&nbsp;&nbsp;&nbsp;&nbsp;platform_info:&nbsp;{<br>
229&nbsp;<br>
230&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;#&nbsp;Device-specific&nbsp;onboard&nbsp;temperature&nbsp;sensor.<br>
231&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'average_temperature_c':&nbsp;c,<br>
232&nbsp;<br>
233&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...<br>
234&nbsp;&nbsp;&nbsp;&nbsp;}<br>
235&nbsp;<br>
236&nbsp;&nbsp;}</tt></dd></dl>
237
238<dl><dt><a name="AndroidPlatform-StopVideoCapture"><strong>StopVideoCapture</strong></a>(self)</dt><dd><tt>Stops&nbsp;capturing&nbsp;video.<br>
239&nbsp;<br>
240Returns:<br>
241&nbsp;&nbsp;A&nbsp;telemetry.core.video.Video&nbsp;object.</tt></dd></dl>
242
243<dl><dt><a name="AndroidPlatform-TakeScreenshot"><strong>TakeScreenshot</strong></a>(self, file_path)</dt><dd><tt>Takes&nbsp;a&nbsp;screenshot&nbsp;of&nbsp;the&nbsp;platform&nbsp;and&nbsp;save&nbsp;to&nbsp;|file_path|.<br>
244&nbsp;<br>
245Note&nbsp;that&nbsp;this&nbsp;method&nbsp;may&nbsp;not&nbsp;be&nbsp;supported&nbsp;on&nbsp;all&nbsp;platform,&nbsp;so&nbsp;check&nbsp;with<br>
246CanTakeScreenshot&nbsp;before&nbsp;calling&nbsp;this.<br>
247&nbsp;<br>
248Args:<br>
249&nbsp;&nbsp;file_path:&nbsp;Where&nbsp;to&nbsp;save&nbsp;the&nbsp;screenshot&nbsp;to.&nbsp;If&nbsp;the&nbsp;platform&nbsp;is&nbsp;remote,<br>
250&nbsp;&nbsp;&nbsp;&nbsp;|file_path|&nbsp;is&nbsp;the&nbsp;path&nbsp;on&nbsp;the&nbsp;host&nbsp;platform.<br>
251&nbsp;<br>
252Returns&nbsp;True&nbsp;if&nbsp;it&nbsp;is&nbsp;believed&nbsp;the&nbsp;attempt&nbsp;succeeded.</tt></dd></dl>
253
254<hr>
255Data descriptors inherited from <a href="telemetry.core.platform.html#Platform">telemetry.core.platform.Platform</a>:<br>
256<dl><dt><strong>__dict__</strong></dt>
257<dd><tt>dictionary&nbsp;for&nbsp;instance&nbsp;variables&nbsp;(if&nbsp;defined)</tt></dd>
258</dl>
259<dl><dt><strong>__weakref__</strong></dt>
260<dd><tt>list&nbsp;of&nbsp;weak&nbsp;references&nbsp;to&nbsp;the&nbsp;object&nbsp;(if&nbsp;defined)</tt></dd>
261</dl>
262<dl><dt><strong>http_server</strong></dt>
263</dl>
264<dl><dt><strong>is_host_platform</strong></dt>
265</dl>
266<dl><dt><strong>local_servers</strong></dt>
267<dd><tt>Returns&nbsp;the&nbsp;currently&nbsp;running&nbsp;local&nbsp;servers.</tt></dd>
268</dl>
269<dl><dt><strong>network_controller</strong></dt>
270<dd><tt>Control&nbsp;network&nbsp;settings&nbsp;and&nbsp;servers&nbsp;to&nbsp;simulate&nbsp;the&nbsp;Web.</tt></dd>
271</dl>
272<dl><dt><strong>tracing_controller</strong></dt>
273</dl>
274</td></tr></table></td></tr></table>
275</body></html>