Leave a bit of time before force stopping the application. This might
help prevent bad numbers.
Call killbackgroundApp after doing force-stop to make sure nothing is
still running.
Bug: 117094510
Bug: 117888316
Test: atest google/perf/app-startup/third-party-apps/cold-dropcache-stable-test
Change-Id: I47792f99b38edf2c40f61cc3f6817d82e6339d12
If the app does not exist log an error but do not fail the test.
Test: atest google/test/performance/app-install-startup -v
(cherry-picked from commit 55db8ff9a6fa383134142f65d0b1d0da9957411d)
Merged-In: Idb6f1d0ba3c5bfb6c7985cd84f5aa4e0599c6b59
Change-Id: Idb6f1d0ba3c5bfb6c7985cd84f5aa4e0599c6b59
If cycle-clean is enabled then all the apps will be
killed at the end of the cycle and cache will dropped.
Cycle time is also enabled to measure the sum of launch times
during each cycle.
Above two options will enable use to measure app launch time under
memeory pressue by not killing the app between the launches and
by killing all the apps and dropping the cache before each cycle
and measuring the cycle time.
Bug: b/73091210
Tested : Tested with nodropcache, no force stop between launches
and cycle clean option and the cycle time avg,min and max
is printed as expected.
Change-Id: I8fb22439a9fe191104ce024c8a85a2688068cd60
This change sets LOCAL_SDK_VERSION for all packages where
this is possible without breaking the build, and
LOCAL_PRIVATE_PLATFORM_APIS := true otherwise.
Setting one of these two will be made required soon, and this
is a change in preparation for that. Not setting LOCAL_SDK_VERSION
makes the app implicitly depend on the bootclasspath, which is
often not required. This change effectively makes depending on
private apis opt-in rather than opt-out.
Test: make relevant packages
Bug: 73535841
Change-Id: I4233b9091d9066c4fa69f3d24aaf367ea500f760
closeApp is always force closing app. Just make it so.
Move the go home intent into its own method.
Test: adb shell "am instrument -w -e drop_cache true -e simpleperf_app true -e compiler_filters speed\|speed-profile\|quicken\|verify -e apps Maps^Maps -e launch_directory /data/local/tmp com.android.tests.applaunch/android.test.InstrumentationTestRunner"
Change-Id: I0d7d28a99a1ce9dfcefc4572ec3a0142482b1e48
Bug : b/65842123
Test: App launch test config able to build and install this test
apk in the atest.
Change-Id: I040e299b1e1fdafbcc716f2b0b8b32e7b842de20
Previous changes statically included legacy-android-test in preparation
for removing android.test.* and junit.* classes from the android.jar.
Unfortunately, that lead to duplicate classes between APKs and the
bootclasspath which caused build problems (Proguard) and also runtime
problems (when targeting and running on older releases).
Switching from statically including the classes to using the runtime
libraries cannot be done in one step because legacy-android-test is
statically included in libraries which are used in many APKs and so
removing it from those libraries requires that all APKs be updated at
once. Doing that atomically across dozens of projects is not practical.
This change modifies APKS that statically include the
legacy-android-test library indirectly.
* If the APK manifest uses the android.test.runner library then the APK
is modified to stop statically including legacy-android-test and
instead build against android.test.base/mock/runner libraries instead.
* Otherwise, the APK statically includes legacy-android-test.
Also, any libraries that statically include are modified to stop
statically including it and if it has source dependencies on the classes
is changed to build against the android.test.base/mock/runner libraries.
The following change descriptions were generated automatically and so
may be a little repetitive. They are provided to give the reviewer
enough information to check the comments match what has actually been
changed and check the reasoning behind the changes.
* cmds/uiautomator/instrumentation/Android.mk
Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
because uiautomator-instrumentation is not a package so does not
need to statically include the classes
* cmds/uiautomator/library/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
uiautomator.core has a source dependency on its classes
Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
because uiautomator.core is not a package so does not need to
statically include the classes
* core/tests/BroadcastRadioTests/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
BroadcastRadioTests's source depends on its classes and because of
these changes they are no longer present on the compilation path.
The classes do not need to be statically included because the
classes will be provided by the runtime, either from the default
bootclasspath or from the android.test.runner library that
BroadcastRadioTests specifies in its manifest.
* core/tests/coretests/Android.mk
Added 'android.test.base' and 'android.test.mock' to
LOCAL_JAVA_LIBRARIES because FrameworksCoreTests's source depends
on their classes and because of these changes they are no longer
present on the compilation path. The classes do not need to be
statically included because the classes will be provided by the
runtime, either from the default bootclasspath or from the
android.test.runner library that FrameworksCoreTests specifies in
its manifest.
* core/tests/featureflagtests/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
FrameworksCoreFeatureFlagTests's source depends on its classes and
because of these changes they are no longer present on the
compilation path. The classes do not need to be statically included
because the classes will be provided by the runtime, either from
the default bootclasspath or from the android.test.runner library
that FrameworksCoreFeatureFlagTests specifies in its manifest.
* core/tests/systemproperties/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
FrameworksCoreSystemPropertiesTests's source depends on its classes
and because of these changes they are no longer present on the
compilation path. The classes do not need to be statically included
because the classes will be provided by the runtime, either from
the default bootclasspath or from the android.test.runner library
that FrameworksCoreSystemPropertiesTests specifies in its manifest.
* core/tests/utillib/Android.mk
Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
because frameworks-core-util-lib is not a package so does not need
to statically include the classes
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
frameworks-core-util-lib has a source dependency on its classes
* core/tests/utiltests/Android.mk
Added 'android.test.base' and 'android.test.mock' to
LOCAL_JAVA_LIBRARIES because FrameworksUtilTests's source depends
on their classes and because of these changes they are no longer
present on the compilation path. The classes do not need to be
statically included because the classes will be provided by the
runtime, either from the default bootclasspath or from the
android.test.runner library that FrameworksUtilTests specifies in
its manifest.
* location/tests/locationtests/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
FrameworksLocationTests's source depends on its classes and because
of these changes they are no longer present on the compilation
path. The classes do not need to be statically included because the
classes will be provided by the runtime, either from the default
bootclasspath or from the android.test.runner library that
FrameworksLocationTests specifies in its manifest.
* lowpan/tests/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
FrameworksLowpanApiTests's source depends on its classes and
because of these changes they are no longer present on the
compilation path. The classes do not need to be statically included
because the classes will be provided by the runtime, either from
the default bootclasspath or from the android.test.runner library
that FrameworksLowpanApiTests specifies in its manifest.
* packages/Osu2/tests/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
OsuTests's source depends on its classes and because of these
changes they are no longer present on the compilation path. The
classes do not need to be statically included because the classes
will be provided by the runtime, either from the default
bootclasspath or from the android.test.runner library that OsuTests
specifies in its manifest.
* packages/SettingsProvider/test/Android.mk
Replaced 'legacy-android-test' with 'android.test.base' in
LOCAL_JAVA_LIBRARIES because SettingsProviderTest's source depends
on its classes. The classes do not need to be statically included
because the classes will be provided by the runtime, either from
the default bootclasspath or from the android.test.runner library
that SettingsProviderTest specifies in its manifest.
* services/tests/notification/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
FrameworksNotificationTests's source depends on its classes and
because of these changes they are no longer present on the
compilation path. The classes do not need to be statically included
because the classes will be provided by the runtime, either from
the default bootclasspath or from the android.test.runner library
that FrameworksNotificationTests specifies in its manifest.
* services/tests/servicestests/Android.mk
Replaced 'legacy-android-test' with 'android.test.base' and
'android.test.runner' in LOCAL_JAVA_LIBRARIES because
FrameworksServicesTests's source depends on their classes. The
classes do not need to be statically included because the classes
will be provided by the runtime, either from the default
bootclasspath or from the android.test.runner library that
FrameworksServicesTests specifies in its manifest.
* services/tests/shortcutmanagerutils/Android.mk
Added 'android.test.runner.stubs' to LOCAL_JAVA_LIBRARIES because
ShortcutManagerTestUtils has a source dependency on its classes
* tests/AppLaunch/Android.mk
Replaced 'legacy-android-test' with 'android.test.base' and
'android.test.runner' in LOCAL_JAVA_LIBRARIES because AppLaunch's
source depends on their classes. The classes do not need to be
statically included because the classes will be provided by the
runtime, either from the default bootclasspath or from the
android.test.runner library that AppLaunch specifies in its
manifest.
* tests/Camera2Tests/SmartCamera/SimpleCamera/tests/Android.mk
Replaced 'legacy-android-test' with 'android.test.base' in
LOCAL_JAVA_LIBRARIES because SmartCamera-tests's source depends on
its classes. The classes do not need to be statically included
because the classes will be provided by the runtime, either from
the default bootclasspath or from the android.test.runner library
that SmartCamera-tests specifies in its manifest.
* tests/ServiceCrashTest/Android.mk
Replaced 'legacy-android-test' with 'android.test.base' in
LOCAL_JAVA_LIBRARIES because ServiceCrashTest's source depends on
its classes. The classes do not need to be statically included
because the classes will be provided by the runtime, either from
the default bootclasspath or from the android.test.runner library
that ServiceCrashTest specifies in its manifest.
* tests/net/Android.mk
Added 'android.test.base' and 'android.test.mock' to
LOCAL_JAVA_LIBRARIES because FrameworksNetTests's source depends on
their classes and because of these changes they are no longer
present on the compilation path. The classes do not need to be
statically included because the classes will be provided by the
runtime, either from the default bootclasspath or from the
android.test.runner library that FrameworksNetTests specifies in
its manifest.
* tests/testables/Android.mk
Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
because testables is not a package so does not need to statically
include the classes
Added 'android.test.mock' to LOCAL_JAVA_LIBRARIES because testables
has a source dependency on its classes
* tests/utils/testutils/Android.mk
Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
because frameworks-base-testutils is not a package so does not need
to statically include the classes
Added 'android.test.base' and 'android.test.mock' to
LOCAL_JAVA_LIBRARIES because frameworks-base-testutils has a source
dependency on their classes
* wifi/tests/Android.mk
Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
FrameworksWifiApiTests's source depends on its classes and because
of these changes they are no longer present on the compilation
path. The classes do not need to be statically included because the
classes will be provided by the runtime, either from the default
bootclasspath or from the android.test.runner library that
FrameworksWifiApiTests specifies in its manifest.
Bug: 30188076
Test: make checkbuild
Change-Id: Ia6a48234f28e7e1789049cf4b37cd7fe0bc8251c
Having spaces in the trace file names introduces slashes in the
file names and not able to pull the file names with the slashes
from the device.So avoid having spaces while constructing the
trace file names.
Bug : b/65737738
Change-Id: Ie1971566586f77d18b17722ce0e3cc9ef3ebfdd3
A previous change added legacy-android-test as a static dependency to
all packages that build against the current, test_current or
system_current and failed to compile when the junit and android.test
classes were removed from the API. Unfortunately, those changes did not
take into account that some of those packages target earlier API
versions and so will always have the classes available at runtime.
This change replaces those static dependencies with dynamic dependencies
for any package that targets an earlier API version. The file changes
were made automatically by a tool that constructed and then analyzed a
full dependency graph of all the Android Java modules. The individual
changes were checked manually to ensure that the changes matched the
intent. The affected modules were built against an API with the junit
and android.test classes removed. Any issues found during this process
resulted in either the tool being updated to address the issue or a
separate change being made to fix an existing problem with the build. A
sample of the affected packages were run to ensure that they worked as
expected at runtime; no issues were found during testing.
The following change descriptions were generated automatically and so
may be a little repetitive. They are provided to give the reviewer
enough information to check the comments match what has actually been
changed and check the reasoning behind the changes.
* packages/SettingsProvider/test/Android.mk
Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
because SettingsProviderTest's manifest file (AndroidManifest.xml)
targets API level 21 and dynamically includes the
android.test.runner library at runtime so there is no point in
statically including the classes.
Added 'legacy-android-test' to LOCAL_JAVA_LIBRARIES because module
SettingsProviderTest uses classes from package android.test
(possible indirectly) and needs them available at compile time.
Dependency 'legacy-android-test' is used instead of
'android.test.runner' because the latter will conflict with
dependencies on junit.
* services/tests/servicestests/Android.mk
Replaced 'android.test.runner' with 'android.test.mock' and
'legacy-android-test' in LOCAL_JAVA_LIBRARIES because module
FrameworksServicesTests uses classes from packages android.test and
android.test.mock (possible indirectly) and needs them available at
compile time.
Dependency 'legacy-android-test' is used instead of
'android.test.runner' because the latter will conflict with
dependencies on junit.
They were not added to LOCAL_STATIC_JAVA_LIBRARIES because
FrameworksServicesTests's manifest file (AndroidManifest.xml)
targets API level 26 and uses the android.test.runner library which
will provide the classes dynamically at runtime.
Dependency 'android.test.mock.sdk' is used instead of
'android.test.mock' because module FrameworksServicesTests builds
against internal jars not the API and so should use libraries that
build against internal jars not the API.
* tests/AppLaunch/Android.mk
Replaced 'android.test.runner' with 'legacy-android-test' in
LOCAL_JAVA_LIBRARIES because module AppLaunch uses classes from
package android.test (possible indirectly) and needs them available
at compile time.
Dependency 'legacy-android-test' is used instead of
'android.test.runner' because the latter will conflict with
dependencies on junit.
Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
because AppLaunch's manifest file (AndroidManifest.xml) targets API
level 24 and dynamically includes the android.test.runner library
at runtime so there is no point in statically including the
classes.
* tests/Camera2Tests/SmartCamera/SimpleCamera/tests/Android.mk
Replaced 'android.test.runner' with 'legacy-android-test' in
LOCAL_JAVA_LIBRARIES because module SmartCamera-tests uses classes
from package android.test (possible indirectly) and needs them
available at compile time.
Dependency 'legacy-android-test' is used instead of
'android.test.runner' because the latter will conflict with
dependencies on junit.
Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
because SmartCamera-tests's manifest file (AndroidManifest.xml)
targets API level 17 and dynamically includes the
android.test.runner library at runtime so there is no point in
statically including the classes.
* tests/Compatibility/Android.mk
Replaced 'android.test.runner' with 'legacy-android-test' in
LOCAL_JAVA_LIBRARIES because module AppCompatibilityTest uses
classes from package android.test (possible indirectly) and needs
them available at compile time.
Dependency 'legacy-android-test' is used instead of
'android.test.runner' because the latter will conflict with
dependencies on junit.
Removed legacy-android-test from LOCAL_STATIC_JAVA_LIBRARIES
because AppCompatibilityTest's manifest file (AndroidManifest.xml)
targets API level 21 and dynamically includes the
android.test.runner library at runtime so there is no point in
statically including the classes.
Bug: 30188076
Test: make checkbuild and ran a sample of tests
Change-Id: I3d183a96bf87437028a2d4b774d311e40349f4d0
Support launching the app using the package name.
Remove the unused variables.
b/33226470
Change-Id: I5b3829912782a9fc0c8f09cbd6fa9ee4b5b35314
(cherry picked from commit a00259f47dc480f799a812a00f52e3c887aae4b0)
Note : Dismissing initial dialogs on the apps (maps, youtube
and camera) craetes the profile.
Bug : b/28941042
Change-Id: Ifbc2853059ca59026d0a833e6dc7e7f96bda9117
In preparation for removing junit classes from the Android API
the legacy-test target will be removed from the
TARGET_DEFAULT_JAVA_LIBRARIES. This change adds explicit
dependencies on junit and/or legacy-android-test to ensure that
modules will compile properly once it is removed.
Bug: 30188076
Test: make checkbuild
Change-Id: I13e88297731253420e4e5f5291d503f13a39a156
1) Drop cache between app launches Bug 29564205
2) Trace capture while launching app Bug 26779882
3) Simple Perf while launching app Bug 29249860
4) Launch order which could be cyclic or sequential
Change-Id: I0c883e7feb7e07474b045835fd56a97d8a126552
Current harness performs one round of app launch as a "warm up", and
does not include that into final app launch time calculation. This
change skips this process so that it can speed up local test run
investigation.
Change-Id: I0b1948b2247d9f7e442e799d537508fba6dfa508
TV apps declare a launcher activity using a
CATEGORY_LEANBACK_LAUNCHER intent filter.
Bug: 27444470
Change-Id: I0d3e412dc0abf65f6eeed4e5d2c0784d08773620
This optional parameter ensures that, before test starts, device
has the listed account types configured already.
e.g. to test app launch time of Gmail, a valid Google account
must present on device
Change-Id: Idba11beff754fd1d201a9c44a562809d4a9495e2
new approach:
* for each app
* initial launch
* sleep 7.5s
* do 10 iterations: launch app with force stop + sleep in between
* report average of 10 launches
Change-Id: I9e68975325aa83af35620d727823f5c072aac488
Improve handling of vibration op, so that apps are
better blamed (there is now a hidden vibrator API that
supplies the app to blame, and the system now uses this
when vibrating on behalf of an app).
Add operation for retrieving neighboring cell information.
Add a new op for calling a phone number. This required
plumbing information about the launching package name through
the activity manager, which required changing the internal
startActivity class, which required hitting a ton of code that
uses those internal APIs.
Change-Id: I3f8015634fdb296558f07fe654fb8d53e5c94d07
to get closer to the previous harness:
* sleep 750ms after launch then press HOME
* force close app after launch
* sleep 2s then move to next app
Change-Id: I70fefa7f3e87c637ed8b4cb2981c26d665c94319
* fixed NPE when specified app name does not exist
* force stop package before starting, because some names may
resolve into the same package
* ensure app is launched in the order as sepcified in command
line
* fixed time recording: it should have been 'thisTime' as
reported by ActivityManager, to be consistent with previous
harness
Change-Id: I411a568580feef21821dcbe6ec15884f697af6fd