In newer versions of adb, files cannot be installed unless they use the
`.apk` extension therefore we need to be able to distinguish between
regular apks and instrumented test files.
Uiautomator1 has been deprecated, therefore the uiautomation base classes have
been upgraded to use uiautomator2 and the new gradle build system.
Altered to retrieve `package_name` rather than `package` as per the previous commit.
The new method of using uiautomation 2 is by using instrumented apk files rather
than JAR files. This commit updates the base workload has been updated to
install/uninstall the new uiautomation APK files and to invoke the relevant
instrumentation.
When moving to Uiautomation 2, tests are now complied into apk files rather than
jar files. To avoid conflicts with regular workload apks a new resource type is
added to retrieve the test files which will be renamed to have the extension
.uiautoapk
A force flag has been added to the `install_apk` method which
ignores the check that the specified file is an apk. This is to support
the new UiAutomation Apk which have been given the extention .uiautoapk.
Adds a method to determine the appropriate method of triggering a media refresh
of a given list of file based on the devices android version and root status. If
a device is running android marshmallow and below or has root, trigger a refresh
of the files containing folder otherwise trigger a refresh of each individual
file.
In android N it is no longer allowed to trigger a media refresh of a directory
without root, therefore this method has been added to trigger a refresh of an
individual file.
Previously AndroidPerfWorkload broadcast media mounted unconditionally
inside push_assets and delete_assets. This change makes it so the
broadcast only happens if something was actually pushed/needs to be
delete.
To work around appshare requiring access to protected variables of a workload,
a `setWorkloadParameters` method has been added to manually supply a parameter
bundle, and a `getPackageID` method to retrieve a workloads package ID.
To prevent parameters having to be converted individually for each worload
the getParams() function has been overridden to perform the required type and
url decoding on the passed parameter bundle before passing the correctly typed
bundle to the workloads.
Due to the limitations of UiAutomator, parameters are not allowed to contain
certain characters including spaces and newlines when passed on the command line.
The python UiAutomatorWorkload baseclasse has been updated to use a
ParameterDict when storing workload parameters.
Inorder to support application launch workload, a new interface is created
which has methods that need to be implemented by all workloads that
support application launch time instrumentation.
UiAutoUtility class added to support utility functions used for UiAutomation.
This class can help in refactoring some existing fucntionalities into utility functions.
Launch command generation is added as a utility class method which can be used
by workloads to construct their launch command from parameters passed.
All the uxperf workloads get some common package parameters.
These are moved to the parent class and a new method is introduced to fill
these parameter values. All the uxperf workloads can call this method to resolve
the package parameters.
On Android targets, WA collects device display information by running
"dumpsys window" during run initialisation. Previously, this was
redirectied into on-device file (under the working directory) and then
pulled from the target.
It looks like on Android-on-ChromeOS devices the redirect leads to an
"Unknown Error" and the resulting file is empty. To get around that,
this commit modfies the dumpsys command so that the output is collected
directly from the shell's stdout and then writen on the host.
Apkworkload setup phase performs many functionalities in
a single method that is broken down into short methods.
The split short methods can be called individually when
relevant use cases arise.
Log time changed to produce epoch time in milli seconds.
Nano to milli second conversion done in uxperf result
processor is removed.
Tested on Mate8 and time obtained is verified.
Renamed android device property from 'supported_eabis' to 'supported_abis' to be consistent with linux device.
Updated dex2oat workload to use new property name.
Previously when retrieving apks only it's name would be used to choose
an apk. Now the native code reported by the apk is used to determine
the correct version to run for the specific device. It tries to
match the primary abi of device with native code before falling back to
using a compatible apk.
When using the check_abi parameter it no longer relies on naming convention
and only allows apks with native code supporting a devices primary abi to be
used.
Updated the relevant documentation.
Moved broadcast to super. Mandatory and Default are XOR
Added a longer wait for sync to finish. Increases reliability on certain phones
Changed recipient to not mandatory and a default set
Wait for sync when launching gmail from the sharing feature
Fix: cornercase where image viewer already points to working directory. Refactored code due to duplication
Added new function to BaseUiAutomation class to find a folder in the gallery
- Updated the revent parser to handle the new revent format.
- Updated the revent parser to expose device info and recording
metatdata.
- The parser can now be used in streaming and non-streaming mode (stream
events from the file as they are being accessed, or read them all in
at once).
- -g option added to "record" command to expose the gamepad recording
mode.
- Corrected code highlighting and phase names in documentation
- Fixed check_states paremeter not being honoured
- Moved state dependencies check to happen earlier in execution
and to be a user facing error
- renamed the capture method from "capture_view_hierachy" to
"capture_ui_hierarchy" to fix typo and make more descriptive.
- Change the file extension of the cature file to ".uix" because this is
the extension uiautomatorviewer looks for.
It is possible that the command executed by get_pids_of() will return
None (in cases where there are no running processes with the specified
name and the grep call didn't find anything). If that happens, then the
subsequent call to split() failed (as that is not a method of None). To
avoid this, substitute an empty string instead.
Adds support for passing -d option to "pm install", which allows
installing an APK when a newer version of the package is already present
on the device.
Previously if trying to downgrade an app using the `-r` option of
`adb install` the `INSTALL_FAILED_VERSION_DOWNGRADE` error would occur.
The app is now uninstalled first to prevent this.
Since initilize only runs once per workload, we can't set variables required
for each iteration in initilize. Revent workload was setting its file paths
in initilize, now moved to setup.