Files
android_development/samples/UiAutomator
Paul Duffin 50840e6a26 Flatten dependency hierarchy of legacy-android-test
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.

* samples/UiAutomator/Android.mk
    Added 'android.test.base' to LOCAL_JAVA_LIBRARIES because
    uiautomator.samples has a source dependency on its classes

Bug: 30188076
Test: make checkbuild
Change-Id: I07b9638373eae0e36c365b604748b1279793620b
2017-12-08 23:43:32 +00:00
..
2012-09-25 17:15:17 -07:00

----------- LaunchSettings Demo -----------

  This demos how we read content-description to properly open the
  All Apps view and select and application to launch. Then we will
  use the package name to verify that the current window is actually
  from the expected package

  To run this demo you must build it first and push it on your device:
  # adb push uiautomator.samples.jar /data/local/tmp
  # adb shell uiautomator runtest uiautomator.samples.jar -c com.android.test.uiautomator.demos.LaunchSettings

---------- LogBuildNumber Demo ------------

  This demos how we can scroll list views and verify data in list view
  items. Here we do the following:
   + Launch Settings
   + Select the About
   + Read the Build string

  To run this demo you must build it first and push it on your device:
  # adb push uiautomator.samples.jar /data/local/tmp
  # adb shell uiautomator runtest uiautomator.samples.jar -c com.android.test.uiautomator.demos.LogBuildNumber

---------- SetTwoMinuteAlarm Demo ---------

  Test demonstrates using the UiAutomator APIs to set an alarm to
  go off in 2 minutes

  To run this demo you must build it first and push it on your device:
  # adb push uiautomator.samples.jar /data/local/tmp
  # adb shell uiautomator runtest uiautomator.samples.jar -c com.android.test.uiautomator.demos.SetTwoMinuteAlarm