[
  {
    "path": ".bazelrc",
    "content": "# Configurations for testing with Bazel\n# Select a configuration by running `bazel test //my:target --config={headless, gui, local_device}`\n\n# Headless instrumentation tests\ntest:headless --test_arg=--enable_display=false\n\n# Graphical instrumentation tests. Ensure that $DISPLAY is set.\ntest:gui --test_env=DISPLAY\ntest:gui --test_arg=--enable_display=true\n\n# Testing with a local emulator or device. Ensure that `adb devices` lists the device.\n# Run tests serially.\ntest:local_device --test_strategy=exclusive\n# Use the local device broker type, as opposed to WRAPPED_EMULATOR.\ntest:local_device --test_arg=--device_broker_type=LOCAL_ADB_SERVER\n# Uncomment and set $device_id if there is more than one connected device.\n# test:local_device --test_arg=--device_serial_number=$device_id\n\ntest --flaky_test_attempts=3\n\n# The unified launcher runs in Python 2 host configuration\n# https://github.com/bazelbuild/bazel/issues/7899\nbuild --host_force_python=PY2\n\n# ------------------------\n# General RBE configuration\n# ------------------------\nbuild:remote --jobs=100\n\n# Java toolchain setup\nbuild:remote --java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8\nbuild:remote --host_java_toolchain=@bazel_tools//tools/jdk:toolchain_hostjdk8\nbuild:remote --host_javabase=@rbe_default//java:jdk\nbuild:remote --javabase=@rbe_default//java:jdk\n\n# C++ toolchain setup\nbuild:remote --extra_toolchains=@rbe_default//config:cc-toolchain\nbuild:remote --crosstool_top=@rbe_default//cc:toolchain\n\n# Remote instance setup\nbuild:remote --remote_instance_name=projects/bazel-untrusted/instances/default_instance\nbuild:remote --project_id=bazel-untrusted\n\n# Set various strategies so that all actions execute remotely. Mixing remote\n# and local execution will lead to errors unless the toolchain and remote\n# machine exactly match the host machine.\nbuild:remote --spawn_strategy=remote\nbuild:remote --define=EXECUTOR=remote\n\n# Enable the remote cache so action results can be shared across machines,\n# developers, and workspaces.\nbuild:remote --remote_cache=remotebuildexecution.googleapis.com\n\n# Enable remote execution so actions are performed on the remote systems.\nbuild:remote --remote_executor=remotebuildexecution.googleapis.com\n\n# Enable authentication. This will pick up application default credentials by\n# default.\nbuild:remote --google_default_credentials\n\n# -------------------------------------------\n# Custom RBE configuration for Android builds\n# -------------------------------------------\n\nbuild:remote_android --config=remote  # Reuse general configuration\n\n# Platform configuration\nbuild:remote_android --extra_execution_platforms=:android_platform\nbuild:remote_android --host_platform=:android_platform\nbuild:remote_android --platforms=:android_platform\n\nbuild:remote_android --strategy=DexBuilder=remote\nbuild:remote_android --noexperimental_check_desugar_deps # Workaround for singlejar incompatibility with RBE\nbuild:remote_android --incompatible_strict_action_env\n"
  },
  {
    "path": ".github/ci-gradle.properties",
    "content": ""
  },
  {
    "path": ".github/workflows/composescreenshot.yml",
    "content": "# Workflow name\nname: Compose Preview Screenshot\non:\n  workflow_dispatch:\n  push:\n    branches: [ main ]\n  # When it will be triggered\n  # And in which branch\n  pull_request:\n    branches: [ main ]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n        \n      - name: Set Up JDK\n        uses: actions/setup-java@v3\n        with:\n          distribution: 'zulu' # See 'Supported distributions' for available options\n          java-version: '17'\n          cache: 'gradle'\n\n      - name: Build project and run screenshot tests\n        working-directory: ./ui/PreviewScreenshot\n        run: ./gradlew validateDebugScreenshotTest\n"
  },
  {
    "path": ".github/workflows/copy-branch.yml",
    "content": "# Duplicates default main branch to the old master branch\n\nname: Duplicates main to old master branch\n\n# Controls when the action will run. Triggers the workflow on push or pull request\n# events but only for the main branch\non:\n  workflow_dispatch:\n  push:\n    branches: [ main ]\n\n# A workflow run is made up of one or more jobs that can run sequentially or in parallel\njobs:\n  # This workflow contains a single job called \"copy-branch\"\n  copy-branch:\n    # The type of runner that the job will run on\n    runs-on: ubuntu-latest\n\n    # Steps represent a sequence of tasks that will be executed as part of the job\n    steps:\n    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it,\n    # but specifies master branch (old default).\n    - uses: actions/checkout@v2\n      with:\n        fetch-depth: 0\n        ref: master\n        \n    - run: |\n        git config user.name github-actions\n        git config user.email github-actions@github.com\n        git merge origin/main\n        git push\n"
  },
  {
    "path": ".github/workflows/gradle-wrapper-validation.yml",
    "content": "name: Validate Gradle Wrapper\n\non:\n  workflow_dispatch:\n  push:\n    branches: [ main ]\n\n  pull_request:\n    branches: [ main ]\n\njobs:\n  validation:\n    name: Validation\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n      - uses: gradle/wrapper-validation-action@v1\n"
  },
  {
    "path": ".github/workflows/test-all.yml",
    "content": "# Workflow name\nname: Build + Test all\non:\n  workflow_dispatch:\n  push:\n    branches: [ main ]\n  # When it will be triggered\n  # And in which branch\n  pull_request:\n    branches: [ main ]\n\njobs:\n  build:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n\n      - name: Enable KVM group perms\n        run: |\n          echo 'KERNEL==\"kvm\", GROUP=\"kvm\", MODE=\"0666\", OPTIONS+=\"static_node=kvm\"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules\n          sudo udevadm control --reload-rules\n          sudo udevadm trigger --name-match=kvm\n          ls /dev/kvm\n        \n      - name: Set Up JDK\n        uses: actions/setup-java@v3\n        with:\n          distribution: 'zulu' # See 'Supported distributions' for available options\n          java-version: '17'\n          cache: 'gradle'\n\n      - name: Setup Gradle\n        uses: gradle/actions/setup-gradle@v4\n        \n      - name: Setup Android SDK\n        uses: android-actions/setup-android@v3\n        \n      - name: Build project and run local and device tests\n        run: ./test_all.sh\n\n      - name: Upload test reports\n        if: always()\n        uses: actions/upload-artifact@v4\n        with:\n          name: test-reports\n          path: '**/app/build/reports/androidTests'\n"
  },
  {
    "path": ".gitignore",
    "content": ".idea\n*.iml\nlocal.properties\nbuild\n.gradle\n# Eclipse project files\n.project\n.settings/\t\n.classpath\nbazel-*\n.DS_Store\n"
  },
  {
    "path": "BUILD.bazel",
    "content": "load(\"@rules_jvm_external//:defs.bzl\", \"artifact\")\nload(\"//:common_defs.bzl\", \"androidxLibVersion\", \"coreVersion\", \"espressoVersion\", \"extJUnitVersion\", \"extTruthVersion\", \"rulesVersion\", \"runnerVersion\")\n\nlicenses([\"notice\"])  # Apache 2.0\n\nandroid_library(\n    name = \"test_deps\",\n    visibility = [\"//visibility:public\"],\n    exports = [\n        artifact(\"androidx.annotation:annotation\"),\n        artifact(\"androidx.test.espresso:espresso-core\"),\n        artifact(\"androidx.test:rules\"),\n        artifact(\"androidx.test:runner\"),\n        artifact(\"androidx.test:monitor\"),\n        artifact(\"androidx.test.ext:junit\"),\n        artifact(\"androidx.test:core\"),\n        artifact(\"com.google.guava:guava\"),\n        artifact(\"com.google.inject:guice\"),\n        artifact(\"javax.inject:javax.inject\"),\n        artifact(\"junit:junit\"),\n        artifact(\"org.hamcrest:java-hamcrest\"),\n    ],\n)\n\n# Platform configuration for emulators on RBE for Bazel CI\nplatform(\n    name = \"android_platform\",\n    constraint_values = [\n        \"@bazel_tools//platforms:x86_64\",\n        \"@bazel_tools//platforms:linux\",\n        \"@bazel_toolchains//constraints:xenial\",\n        \"@bazel_tools//tools/cpp:clang\",\n    ],\n    # TODO(@jin): s/di-cloud-exp/rbe-containers/ when the official android-test container with libxcursor1 and libxcomposite1 is ready.\n    # URI for official container: docker://gcr.io/rbe-containers/ubuntu16_04-android_test@sha256:<sha256>\n    remote_execution_properties = \"\"\"\n        properties: {\n            name: \"container-image\"\n            value: \"docker://gcr.io/di-cloud-exp/rbe-ubuntu16-04-android@sha256:eb3828f71faf595f44b20b97d205e73e8a21982f1d7a170c3ec8f9d33ce3179a\"\n        }\n        properties: {\n            name: \"dockerNetwork\"\n            value: \"standard\"\n        }\n        properties: {\n            name: \"dockerPrivileged\"\n            value: \"true\"\n        }\n        properties: {\n            name: \"gceMachineType\"\n            value: \"n1-standard-2\"\n        }\n\"\"\",\n)\n"
  },
  {
    "path": "CODEOWNERS",
    "content": "* @josealcerreca"
  },
  {
    "path": "CONTRIBUTING.md",
    "content": "# How to become a contributor and submit your own code\n\nTo contribute with a small fix, simply create a pull request. If you want to add a new sample or plan to request a big change, [contact us](https://groups.google.com/forum/#!forum/android-testing-support-library) first.\n\n## Contributing new samples\n\nIf you want to contribute full samples, we'd love to review and accept them. In case you need ideas, these are some samples on the roadmap:\n\n* Advanced Idling Resource \n* RecyclerView actions\n* Sharding \n* RunListener \n* Rules\n \nYou can also contribute to this list if you have a sample request.\n\n## Code style and structure\n\nPlease check out the [Code Style for Contributors](https://source.android.com/source/code-style.html) section in AOSP. Also, check out the rest of the samples and maintain as much consistency with them as possible.\n\n## Contributor License Agreements\n\nWe'd love to accept your sample apps and patches! Before we can take them, we\nhave to jump a couple of legal hurdles.\n\nPlease fill out either the individual or corporate Contributor License Agreement (CLA).\n\n  * If you are an individual writing original source code and you're sure you\n    own the intellectual property, then you'll need to sign an [individual CLA]\n    (https://cla.developers.google.com).\n  * If you work for a company that wants to allow you to contribute your work,\n    then you'll need to sign a [corporate CLA]\n    (https://cla.developers.google.com).\n  * Please make sure you sign both, Android and Google CLA\n\nFollow either of the two links above to access the appropriate CLA and\ninstructions for how to sign and return it. Once we receive it, we'll be able to\naccept your pull requests.\n\n## Contributing A Patch\n\n1. Submit an issue describing your proposed change to the repo in question.\n1. The repo owner will respond to your issue promptly.\n1. If your proposed change is accepted, and you haven't already done so, sign a\n   Contributor License Agreement (see details above).\n1. Fork the desired repo, develop and test your code changes.\n1. Ensure that your code adheres to the existing style in the sample to which\n   you are contributing. Refer to the\n   [Android Code Style Guide]\n   (https://source.android.com/source/code-style.html) for the\n   recommended coding standards for this organization.\n1. Ensure that your code has an appropriate set of unit tests which all pass.\n1. Submit a pull request.\n"
  },
  {
    "path": "LICENSE",
    "content": "                                 Apache License\n                           Version 2.0, January 2004\n                        http://www.apache.org/licenses/\n\n   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION\n\n   1. Definitions.\n\n      \"License\" shall mean the terms and conditions for use, reproduction,\n      and distribution as defined by Sections 1 through 9 of this document.\n\n      \"Licensor\" shall mean the copyright owner or entity authorized by\n      the copyright owner that is granting the License.\n\n      \"Legal Entity\" shall mean the union of the acting entity and all\n      other entities that control, are controlled by, or are under common\n      control with that entity. For the purposes of this definition,\n      \"control\" means (i) the power, direct or indirect, to cause the\n      direction or management of such entity, whether by contract or\n      otherwise, or (ii) ownership of fifty percent (50%) or more of the\n      outstanding shares, or (iii) beneficial ownership of such entity.\n\n      \"You\" (or \"Your\") shall mean an individual or Legal Entity\n      exercising permissions granted by this License.\n\n      \"Source\" form shall mean the preferred form for making modifications,\n      including but not limited to software source code, documentation\n      source, and configuration files.\n\n      \"Object\" form shall mean any form resulting from mechanical\n      transformation or translation of a Source form, including but\n      not limited to compiled object code, generated documentation,\n      and conversions to other media types.\n\n      \"Work\" shall mean the work of authorship, whether in Source or\n      Object form, made available under the License, as indicated by a\n      copyright notice that is included in or attached to the work\n      (an example is provided in the Appendix below).\n\n      \"Derivative Works\" shall mean any work, whether in Source or Object\n      form, that is based on (or derived from) the Work and for which the\n      editorial revisions, annotations, elaborations, or other modifications\n      represent, as a whole, an original work of authorship. For the purposes\n      of this License, Derivative Works shall not include works that remain\n      separable from, or merely link (or bind by name) to the interfaces of,\n      the Work and Derivative Works thereof.\n\n      \"Contribution\" shall mean any work of authorship, including\n      the original version of the Work and any modifications or additions\n      to that Work or Derivative Works thereof, that is intentionally\n      submitted to Licensor for inclusion in the Work by the copyright owner\n      or by an individual or Legal Entity authorized to submit on behalf of\n      the copyright owner. For the purposes of this definition, \"submitted\"\n      means any form of electronic, verbal, or written communication sent\n      to the Licensor or its representatives, including but not limited to\n      communication on electronic mailing lists, source code control systems,\n      and issue tracking systems that are managed by, or on behalf of, the\n      Licensor for the purpose of discussing and improving the Work, but\n      excluding communication that is conspicuously marked or otherwise\n      designated in writing by the copyright owner as \"Not a Contribution.\"\n\n      \"Contributor\" shall mean Licensor and any individual or Legal Entity\n      on behalf of whom a Contribution has been received by Licensor and\n      subsequently incorporated within the Work.\n\n   2. Grant of Copyright License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      copyright license to reproduce, prepare Derivative Works of,\n      publicly display, publicly perform, sublicense, and distribute the\n      Work and such Derivative Works in Source or Object form.\n\n   3. Grant of Patent License. Subject to the terms and conditions of\n      this License, each Contributor hereby grants to You a perpetual,\n      worldwide, non-exclusive, no-charge, royalty-free, irrevocable\n      (except as stated in this section) patent license to make, have made,\n      use, offer to sell, sell, import, and otherwise transfer the Work,\n      where such license applies only to those patent claims licensable\n      by such Contributor that are necessarily infringed by their\n      Contribution(s) alone or by combination of their Contribution(s)\n      with the Work to which such Contribution(s) was submitted. If You\n      institute patent litigation against any entity (including a\n      cross-claim or counterclaim in a lawsuit) alleging that the Work\n      or a Contribution incorporated within the Work constitutes direct\n      or contributory patent infringement, then any patent licenses\n      granted to You under this License for that Work shall terminate\n      as of the date such litigation is filed.\n\n   4. Redistribution. You may reproduce and distribute copies of the\n      Work or Derivative Works thereof in any medium, with or without\n      modifications, and in Source or Object form, provided that You\n      meet the following conditions:\n\n      (a) You must give any other recipients of the Work or\n          Derivative Works a copy of this License; and\n\n      (b) You must cause any modified files to carry prominent notices\n          stating that You changed the files; and\n\n      (c) You must retain, in the Source form of any Derivative Works\n          that You distribute, all copyright, patent, trademark, and\n          attribution notices from the Source form of the Work,\n          excluding those notices that do not pertain to any part of\n          the Derivative Works; and\n\n      (d) If the Work includes a \"NOTICE\" text file as part of its\n          distribution, then any Derivative Works that You distribute must\n          include a readable copy of the attribution notices contained\n          within such NOTICE file, excluding those notices that do not\n          pertain to any part of the Derivative Works, in at least one\n          of the following places: within a NOTICE text file distributed\n          as part of the Derivative Works; within the Source form or\n          documentation, if provided along with the Derivative Works; or,\n          within a display generated by the Derivative Works, if and\n          wherever such third-party notices normally appear. The contents\n          of the NOTICE file are for informational purposes only and\n          do not modify the License. You may add Your own attribution\n          notices within Derivative Works that You distribute, alongside\n          or as an addendum to the NOTICE text from the Work, provided\n          that such additional attribution notices cannot be construed\n          as modifying the License.\n\n      You may add Your own copyright statement to Your modifications and\n      may provide additional or different license terms and conditions\n      for use, reproduction, or distribution of Your modifications, or\n      for any such Derivative Works as a whole, provided Your use,\n      reproduction, and distribution of the Work otherwise complies with\n      the conditions stated in this License.\n\n   5. Submission of Contributions. Unless You explicitly state otherwise,\n      any Contribution intentionally submitted for inclusion in the Work\n      by You to the Licensor shall be under the terms and conditions of\n      this License, without any additional terms or conditions.\n      Notwithstanding the above, nothing herein shall supersede or modify\n      the terms of any separate license agreement you may have executed\n      with Licensor regarding such Contributions.\n\n   6. Trademarks. This License does not grant permission to use the trade\n      names, trademarks, service marks, or product names of the Licensor,\n      except as required for reasonable and customary use in describing the\n      origin of the Work and reproducing the content of the NOTICE file.\n\n   7. Disclaimer of Warranty. Unless required by applicable law or\n      agreed to in writing, Licensor provides the Work (and each\n      Contributor provides its Contributions) on an \"AS IS\" BASIS,\n      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or\n      implied, including, without limitation, any warranties or conditions\n      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A\n      PARTICULAR PURPOSE. You are solely responsible for determining the\n      appropriateness of using or redistributing the Work and assume any\n      risks associated with Your exercise of permissions under this License.\n\n   8. Limitation of Liability. In no event and under no legal theory,\n      whether in tort (including negligence), contract, or otherwise,\n      unless required by applicable law (such as deliberate and grossly\n      negligent acts) or agreed to in writing, shall any Contributor be\n      liable to You for damages, including any direct, indirect, special,\n      incidental, or consequential damages of any character arising as a\n      result of this License or out of the use or inability to use the\n      Work (including but not limited to damages for loss of goodwill,\n      work stoppage, computer failure or malfunction, or any and all\n      other commercial damages or losses), even if such Contributor\n      has been advised of the possibility of such damages.\n\n   9. Accepting Warranty or Additional Liability. While redistributing\n      the Work or Derivative Works thereof, You may choose to offer,\n      and charge a fee for, acceptance of support, warranty, indemnity,\n      or other liability obligations and/or rights consistent with this\n      License. However, in accepting such obligations, You may act only\n      on Your own behalf and on Your sole responsibility, not on behalf\n      of any other Contributor, and only if You agree to indemnify,\n      defend, and hold each Contributor harmless for any liability\n      incurred by, or claims asserted against, such Contributor by reason\n      of your accepting any such warranty or additional liability.\n\n   END OF TERMS AND CONDITIONS\n\n   APPENDIX: How to apply the Apache License to your work.\n\n      To apply the Apache License to your work, attach the following\n      boilerplate notice, with the fields enclosed by brackets \"[]\"\n      replaced with your own identifying information. (Don't include\n      the brackets!)  The text should be enclosed in the appropriate\n      comment syntax for the file format. We also recommend that a\n      file or class name and description of purpose be included on the\n      same \"printed page\" as the copyright notice for easier\n      identification within third-party archives.\n\n   Copyright 2014 The Android Open Source Project\n\n   Licensed under the Apache License, Version 2.0 (the \"License\");\n   you may not use this file except in compliance with the License.\n   You may obtain a copy of the License at\n\n       http://www.apache.org/licenses/LICENSE-2.0\n\n   Unless required by applicable law or agreed to in writing, software\n   distributed under the License is distributed on an \"AS IS\" BASIS,\n   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n   See the License for the specific language governing permissions and\n   limitations under the License.\n"
  },
  {
    "path": "README.md",
    "content": "Android testing samples\n===================================\n\nA collection of samples demonstrating different frameworks and techniques for automated testing.\n\n### Espresso Samples\n\n**[BasicSample](https://github.com/googlesamples/android-testing/blob/main/ui/espresso/BasicSample)** - Basic Espresso sample\n\n**[CustomMatcherSample](https://github.com/googlesamples/android-testing/blob/main/ui/espresso/CustomMatcherSample)** - Shows how to extend Espresso to match the *hint* property of an EditText\n\n**[DataAdapterSample](https://github.com/googlesamples/android-testing/blob/main/ui/espresso/DataAdapterSample)** - Showcases the `onData()` entry point for Espresso, for lists and AdapterViews\n\n**[FragmentScenarioSample](https://github.com/googlesamples/android-testing/blob/main/ui/espresso/FragmentScenarioSample)** - Basic usage of `FragmentScenario` with Espresso.\n\n**[IdlingResourceSample](https://github.com/googlesamples/android-testing/blob/main/ui/espresso/IdlingResourceSample)** - Synchronization with background jobs\n\n**[IntentsBasicSample](https://github.com/googlesamples/android-testing/blob/main/ui/espresso/IntentsBasicSample)** - Basic usage of `intended()` and `intending()`\n\n**[IntentsAdvancedSample](https://github.com/googlesamples/android-testing/blob/main/ui/espresso/IntentsAdvancedSample)** - Simulates a user fetching a bitmap using the camera\n\n**[MultiWindowSample](https://github.com/googlesamples/android-testing/blob/main/ui/espresso/MultiWindowSample)** - Shows how to point Espresso to different windows\n\n**[RecyclerViewSample](https://github.com/googlesamples/android-testing/blob/main/ui/espresso/RecyclerViewSample)** - RecyclerView actions for Espresso\n\n**[ScreenshotSample](https://github.com/googlesamples/android-testing/blob/main/ui/espresso/ScreenshotSample)** - Screenshot capturing and saving using Espresso and androidx.test.core APIs\n\n**[WebBasicSample](https://github.com/googlesamples/android-testing/blob/main/ui/espresso/WebBasicSample)** - Use Espresso-web to interact with WebViews\n\n**[BasicSampleBundled](https://github.com/googlesamples/android-testing/blob/main/ui/espresso/BasicSampleBundled)** - Basic sample for Eclipse and other IDEs\n\n**[MultiProcessSample](https://github.com/googlesamples/android-testing/blob/main/ui/espresso/MultiProcessSample)** - Showcases how to use multiprocess Espresso.\n### UiAutomator Sample\n\n**[BasicSample](https://github.com/googlesamples/android-testing/tree/main/ui/uiautomator/BasicSample)** - Basic UI Automator sample\n\n### AndroidJUnitRunner Sample\n\n**[AndroidJunitRunnerSample](https://github.com/googlesamples/android-testing/tree/main/runner/AndroidJunitRunnerSample)** - Showcases test annotations, parameterized tests and testsuite creation\n\n### JUnit4 Rules Sample\n\n**All previous samples use ActivityTestRule or IntentsTestRule but there's one specific to ServiceTestRule:\n\n**[BasicSample](https://github.com/googlesamples/android-testing/blob/main/ui/espresso/BasicSample)** - Simple usage of `ActivityTestRule`\n\n**[IntentsBasicSample](https://github.com/googlesamples/android-testing/blob/main/ui/espresso/IntentsBasicSample)** - Simple usage of `IntentsTestRule`\n\n**[ServiceTestRuleSample](https://github.com/googlesamples/android-testing/tree/main/integration/ServiceTestRuleSample)** - Simple usage of `ServiceTestRule`\n\nPrerequisites\n--------------\n\n- Android SDK v28\n- Android Build Tools v28.03\n\nGetting Started\n---------------\n\nThese samples use the Gradle build system. To build a project, enter the project directory and use the `./gradlew assemble` command or use \"Import Project\" in Android Studio.\n\n- Use `./gradlew connectedAndroidTest` to run the tests on a connected emulator or device.\n- Use `./gradlew test` to run the unit test on your local host.\n\nThere is a top-level `build.gradle` file if you want to build and test all samples from the root directory. This is mostly helpful to build on a CI (Continuous Integration) server.\n\nAndroidX Test Library\n---------------\nMany of these samples use the AndroidX Test Library. Visit the [Testing site on developer.android.com](https://developer.android.com/training/testing) for more information.\n\nExperimental Bazel Support\n--------------------------\n\n[![Build status](https://badge.buildkite.com/18dda320b265e9a8f20cb6141b1e80ca58fb62bdb443e527be.svg)](https://buildkite.com/bazel/android-testing)\n\nSome of these samples can be tested with [Bazel](https://bazel.build) on Linux. These samples contain a `BUILD.bazel` file, which is similar to a `build.gradle` file. The external dependencies are defined in the top level `WORKSPACE` file.\n\nThis is __experimental__ feature. To run the tests, please install the latest version of Bazel (0.12.0 or later) by following the [instructions on the Bazel website](https://docs.bazel.build/versions/master/install-ubuntu.html).\n\n### Bazel commands\n\n```\n# Clone the repository if you haven't.\n$ git clone https://github.com/google/android-testing\n$ cd android-testing\n\n# Edit the path to your local SDK at the top of the WORKSPACE file\n$ $EDITOR WORKSPACE\n\n# Test everything in a headless mode (no graphical display)\n$ bazel test //... --config=headless\n\n# Test a single test, e.g. ui/espresso/BasicSample/BUILD.bazel\n$ bazel test //ui/uiautomator/BasicSample:BasicSampleInstrumentationTest_21_x86 --config=headless\n\n# Query for all android_instrumentation_test targets\n$ bazel query 'kind(android_instrumentation_test, //...)'\n//ui/uiautomator/BasicSample:BasicSampleInstrumentationTest_23_x86\n//ui/uiautomator/BasicSample:BasicSampleInstrumentationTest_22_x86\n//ui/uiautomator/BasicSample:BasicSampleInstrumentationTest_21_x86\n//ui/uiautomator/BasicSample:BasicSampleInstrumentationTest_19_x86\n//ui/espresso/RecyclerViewSample:RecyclerViewSampleInstrumentationTest_23_x86\n//ui/espresso/RecyclerViewSample:RecyclerViewSampleInstrumentationTest_22_x86\n//ui/espresso/RecyclerViewSample:RecyclerViewSampleInstrumentationTest_21_x86\n//ui/espresso/RecyclerViewSample:RecyclerViewSampleInstrumentationTest_19_x86\n//ui/espresso/MultiWindowSample:MultiWindowSampleInstrumentationTest_23_x86\n//ui/espresso/MultiWindowSample:MultiWindowSampleInstrumentationTest_22_x86\n...\n\n# Test everything with GUI enabled\n$ bazel test //... --config=gui\n\n# Test with a local device or emulator. Ensure that `adb devices` lists the device.\n$ bazel test //... --config=local_device\n\n# If multiple devices are connected, add --device_serial_number=$identifier where $identifier is the name of the device in `adb devices`\n$ bazel test //... --config=local_device --test_arg=--device_serial_number=$identifier\n```\n\nFor more information, check out the documentation for [Android Instrumentation Tests in Bazel](https://docs.bazel.build/versions/master/android-instrumentation-test.html). You may also want to check out [Building an Android App with Bazel](https://docs.bazel.build/versions/master/tutorial/android-app.html), and the list of [Android Rules](https://docs.bazel.build/versions/master/be/android.html) in the Bazel Build Encyclopedia.\n\nKnown issues:\n\n* Building of APKs is supported on Linux, Mac and Windows, but testing is only supported on Linux.\n* `android_instrumentation_test.target_device` attribute still needs to be specified even if `--config=local_device` is used.\n* If using a local device or emulator, the APKs are not uninstalled automatically after the test. Use this command to\nremove the packages:\n    * `adb shell pm list packages com.example.android.testing | cut -d ':' -f 2 | tr -d '\\r' | xargs -L1 -t adb uninstall`\n    \nPlease file Bazel related issues against the [Bazel](https://github.com/bazelbuild/bazel) repository instead of this repository.\n\nSupport\n-------\n\n- Google+ Community: https://plus.google.com/communities/105153134372062985968\n- Stack Overflow: http://stackoverflow.com/questions/tagged/android-testing\n\nIf you've found an error in this sample, please file an issue:\nhttps://github.com/googlesamples/android-testing\n\nPatches are encouraged, and may be submitted by forking this project and\nsubmitting a pull request through GitHub. Please see CONTRIBUTING.md for more details.\n\nLicense\n-------\n\nCopyright 2015 The Android Open Source Project, Inc.\n\nLicensed to the Apache Software Foundation (ASF) under one or more contributor\nlicense agreements.  See the NOTICE file distributed with this work for\nadditional information regarding copyright ownership.  The ASF licenses this\nfile to you under the Apache License, Version 2.0 (the \"License\"); you may not\nuse this file except in compliance with the License.  You may obtain a copy of\nthe License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS, WITHOUT\nWARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  See the\nLicense for the specific language governing permissions and limitations under\nthe License.\n"
  },
  {
    "path": "WORKSPACE",
    "content": "load(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\nload(\"@bazel_tools//tools/build_defs/repo:jvm.bzl\", \"jvm_maven_import_external\")\n\n# Set the path to your local SDK installation, or use the ANDROID_HOME environment variable.\nandroid_sdk_repository(name = \"androidsdk\")\n\n# Required for running emulator tests on RBE on Bazel CI\nandroid_ndk_repository(name = \"androidndk\")\n\n# Android Test Support\n#\n# This repository contains the supporting tools to run Android instrumentation tests,\n# like the emulator definitions (android_device) and the device broker/test runner.\nATS_TAG = \"1edfdab3134a7f01b37afabd3eebfd2c5bb05151\"\n\nATS_SHA256 = \"dcd1ff76aef1a26329d77863972780c8fe1fc8ff625747342239f0489c2837ec\"\n\nhttp_archive(\n    name = \"android_test_support\",\n    sha256 = ATS_SHA256,\n    strip_prefix = \"android-test-%s\" % ATS_TAG,\n    urls = [\"https://github.com/android/android-test/archive/%s.tar.gz\" % ATS_TAG],\n)\n\nload(\"@android_test_support//:repo.bzl\", \"android_test_repositories\")\n\nandroid_test_repositories()\n\nload(\"@bazel_tools//tools/build_defs/repo:http.bzl\", \"http_archive\")\n\nRULES_JVM_EXTERNAL_TAG = \"3.1\"\n\nRULES_JVM_EXTERNAL_SHA = \"e246373de2353f3d34d35814947aa8b7d0dd1a58c2f7a6c41cfeaff3007c2d14\"\n\nhttp_archive(\n    name = \"rules_jvm_external\",\n    sha256 = RULES_JVM_EXTERNAL_SHA,\n    strip_prefix = \"rules_jvm_external-%s\" % RULES_JVM_EXTERNAL_TAG,\n    url = \"https://github.com/bazelbuild/rules_jvm_external/archive/%s.zip\" % RULES_JVM_EXTERNAL_TAG,\n)\n\nload(\"@rules_jvm_external//:defs.bzl\", \"maven_install\")\nload(\"@rules_jvm_external//:specs.bzl\", \"maven\")\nload(\n    \"//:common_defs.bzl\",\n    \"androidxLibVersion\",\n    \"coreVersion\",\n    \"espressoVersion\",\n    \"extJUnitVersion\",\n    \"extTruthVersion\",\n    \"rulesVersion\",\n    \"runnerVersion\",\n    \"uiAutomatorVersion\",\n)\n\nmaven_install(\n    name = \"maven\",\n    artifacts = [\n        \"androidx.annotation:annotation:\" + androidxLibVersion,\n        \"androidx.core:core:\" + androidxLibVersion,\n        \"androidx.recyclerview:recyclerview:\" + androidxLibVersion,\n        \"androidx.test:core:\" + coreVersion,\n        \"androidx.test.espresso:espresso-accessibility:\" + espressoVersion,\n        \"androidx.test.espresso:espresso-contrib:\" + espressoVersion,\n        \"androidx.test.espresso:espresso-core:\" + espressoVersion,\n        \"androidx.test.espresso:espresso-idling-resource:\" + espressoVersion,\n        \"androidx.test.espresso:espresso-intents:\" + espressoVersion,\n        \"androidx.test.ext:junit:\" + extJUnitVersion,\n        \"androidx.test.ext:truth:\" + extTruthVersion,\n        \"androidx.test:monitor:\" + runnerVersion,\n        \"androidx.test:rules:\" + rulesVersion,\n        \"androidx.test:runner:\" + runnerVersion,\n        \"androidx.test.uiautomator:uiautomator:\" + uiAutomatorVersion,\n        \"androidx.viewpager:viewpager:1.0.0\",\n        maven.artifact(\n            \"com.google.inject\",\n            \"guice\",\n            \"4.0\",\n            neverlink = True,\n        ),\n        \"junit:junit:4.12\",\n        \"javax.inject:javax.inject:1\",\n        \"org.hamcrest:java-hamcrest:2.0.0.0\",\n        maven.artifact(\n            \"org.robolectric\",\n            \"robolectric\",\n            \"4.3-beta-1\",\n            neverlink = True,\n            exclusions = [\"com.google.guava:guava\"],\n        ),\n        \"com.google.guava:guava:26.0-android\",\n        \"com.google.truth:truth:0.42\",\n        \"com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework:2.0\",\n    ],\n    jetify = True,\n    repositories = [\n        \"https://maven.google.com\",\n        \"https://repo1.maven.org/maven2\",\n    ],\n    version_conflict_policy = \"pinned\",\n)\n\nhttp_archive(\n    name = \"bazel_toolchains\",\n    sha256 = \"4d348abfaddbcee0c077fc51bb1177065c3663191588ab3d958f027cbfe1818b\",\n    strip_prefix = \"bazel-toolchains-2.1.0\",\n    urls = [\n        \"https://github.com/bazelbuild/bazel-toolchains/releases/download/2.1.0/bazel-toolchains-2.1.0.tar.gz\",\n        \"https://mirror.bazel.build/github.com/bazelbuild/bazel-toolchains/archive/2.1.0.tar.gz\",\n    ],\n)\n\nload(\"@bazel_toolchains//rules:rbe_repo.bzl\", \"rbe_autoconfig\")\n\nrbe_autoconfig(name = \"rbe_default\")\n"
  },
  {
    "path": "bazelci/buildkite-pipeline.yml",
    "content": "# https://github.com/googlesamples/android-testing#experimental-bazel-support\n---\nplatforms:\n  ubuntu1804:\n    build_targets:\n    - \"//...\"\n    - \"-//ui/uiautomator/BasicSample:BasicSampleInstrumentationTest_23_x86\" # BazelCI does not have Android Emulator\n    - \"-//ui/uiautomator/BasicSample:BasicSampleInstrumentationTest_22_x86\"\n    - \"-//ui/uiautomator/BasicSample:BasicSampleInstrumentationTest_21_x86\"\n    - \"-//ui/uiautomator/BasicSample:BasicSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/RecyclerViewSample:RecyclerViewSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/RecyclerViewSample:RecyclerViewSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/RecyclerViewSample:RecyclerViewSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/RecyclerViewSample:RecyclerViewSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/MultiWindowSample:MultiWindowSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/MultiWindowSample:MultiWindowSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/MultiWindowSample:MultiWindowSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/MultiWindowSample:MultiWindowSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/IntentsBasicSample:IntentsBasicSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/IntentsBasicSample:IntentsBasicSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/IntentsBasicSample:IntentsBasicSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/IntentsBasicSample:IntentsBasicSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/IntentsAdvancedSample:IntentsAdvancedSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/IntentsAdvancedSample:IntentsAdvancedSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/IntentsAdvancedSample:IntentsAdvancedSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/IntentsAdvancedSample:IntentsAdvancedSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/IdlingResourceSample:IdlingResourceSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/IdlingResourceSample:IdlingResourceSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/IdlingResourceSample:IdlingResourceSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/IdlingResourceSample:IdlingResourceSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/DataAdapterSample:DataAdapterSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/DataAdapterSample:DataAdapterSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/DataAdapterSample:DataAdapterSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/DataAdapterSample:DataAdapterSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/CustomMatcherSample:CustomMatcherSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/CustomMatcherSample:CustomMatcherSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/CustomMatcherSample:CustomMatcherSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/CustomMatcherSample:CustomMatcherSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/BasicSample:BasicSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/BasicSample:BasicSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/BasicSample:BasicSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/BasicSample:BasicSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/AccessibilitySample:BasicSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/AccessibilitySample:BasicSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/AccessibilitySample:BasicSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/AccessibilitySample:BasicSampleInstrumentationTest_19_x86\"\n    test_flags:\n    - \"--config=remote_android\"\n    - \"--flaky_test_attempts=3\"\n    test_targets:\n    - \"//...\"\n    - \"-//ui/espresso/AccessibilitySample/...\"\n    - \"-//ui/uiautomator/BasicSample:BasicSampleInstrumentationTest_23_x86\" # BazelCI does not have Android Emulator\n    - \"-//ui/uiautomator/BasicSample:BasicSampleInstrumentationTest_22_x86\"\n    - \"-//ui/uiautomator/BasicSample:BasicSampleInstrumentationTest_21_x86\"\n    - \"-//ui/uiautomator/BasicSample:BasicSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/RecyclerViewSample:RecyclerViewSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/RecyclerViewSample:RecyclerViewSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/RecyclerViewSample:RecyclerViewSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/RecyclerViewSample:RecyclerViewSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/MultiWindowSample:MultiWindowSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/MultiWindowSample:MultiWindowSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/MultiWindowSample:MultiWindowSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/MultiWindowSample:MultiWindowSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/IntentsBasicSample:IntentsBasicSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/IntentsBasicSample:IntentsBasicSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/IntentsBasicSample:IntentsBasicSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/IntentsBasicSample:IntentsBasicSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/IntentsAdvancedSample:IntentsAdvancedSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/IntentsAdvancedSample:IntentsAdvancedSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/IntentsAdvancedSample:IntentsAdvancedSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/IntentsAdvancedSample:IntentsAdvancedSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/IdlingResourceSample:IdlingResourceSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/IdlingResourceSample:IdlingResourceSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/IdlingResourceSample:IdlingResourceSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/IdlingResourceSample:IdlingResourceSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/DataAdapterSample:DataAdapterSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/DataAdapterSample:DataAdapterSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/DataAdapterSample:DataAdapterSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/DataAdapterSample:DataAdapterSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/CustomMatcherSample:CustomMatcherSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/CustomMatcherSample:CustomMatcherSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/CustomMatcherSample:CustomMatcherSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/CustomMatcherSample:CustomMatcherSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/BasicSample:BasicSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/BasicSample:BasicSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/BasicSample:BasicSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/BasicSample:BasicSampleInstrumentationTest_19_x86\"\n    - \"-//ui/espresso/AccessibilitySample:BasicSampleInstrumentationTest_23_x86\"\n    - \"-//ui/espresso/AccessibilitySample:BasicSampleInstrumentationTest_22_x86\"\n    - \"-//ui/espresso/AccessibilitySample:BasicSampleInstrumentationTest_21_x86\"\n    - \"-//ui/espresso/AccessibilitySample:BasicSampleInstrumentationTest_19_x86\"    \n  macos:\n    # Testing does not work for macos and windows yet\n    build_targets: # Results of `bazel query 'kind(android_binary, //...)'\n      - \"//ui/uiautomator/BasicSample:BasicSampleTest\"\n      - \"//ui/uiautomator/BasicSample:BasicSample\"\n      - \"//ui/espresso/RecyclerViewSample:RecyclerViewSampleTest\"\n      - \"//ui/espresso/RecyclerViewSample:RecyclerViewSample\"\n      - \"//ui/espresso/MultiWindowSample:MultiWindowSampleTest\"\n      - \"//ui/espresso/MultiWindowSample:MultiWindowSample\"\n      - \"//ui/espresso/IntentsBasicSample:IntentsBasicSampleTest\"\n      - \"//ui/espresso/IntentsBasicSample:IntentsBasicSample\"\n      - \"//ui/espresso/IntentsAdvancedSample:IntentsAdvancedSampleTest\"\n      - \"//ui/espresso/IntentsAdvancedSample:IntentsAdvancedSample\"\n      - \"//ui/espresso/IdlingResourceSample:IdlingResourceSampleTest\"\n      - \"//ui/espresso/IdlingResourceSample:IdlingResourceSample\"\n      - \"//ui/espresso/DataAdapterSample:DataAdapterSampleTest\"\n      - \"//ui/espresso/DataAdapterSample:DataAdapterSample\"\n      - \"//ui/espresso/CustomMatcherSample:CustomMatcherSampleTest\"\n      - \"//ui/espresso/CustomMatcherSample:CustomMatcherSample\"\n      - \"//ui/espresso/BasicSample:BasicSampleTest\"\n      - \"//ui/espresso/BasicSample:BasicSample\"\n      - \"//ui/espresso/AccessibilitySample:BasicSampleTest\"\n      - \"//ui/espresso/AccessibilitySample:BasicSample\"\n  windows:\n    build_targets: # Results of `bazel query 'kind(android_binary, //...)'\n      - \"//ui/uiautomator/BasicSample:BasicSampleTest\"\n      - \"//ui/uiautomator/BasicSample:BasicSample\"\n      - \"//ui/espresso/RecyclerViewSample:RecyclerViewSampleTest\"\n      - \"//ui/espresso/RecyclerViewSample:RecyclerViewSample\"\n      - \"//ui/espresso/MultiWindowSample:MultiWindowSampleTest\"\n      - \"//ui/espresso/MultiWindowSample:MultiWindowSample\"\n      - \"//ui/espresso/IntentsBasicSample:IntentsBasicSampleTest\"\n      - \"//ui/espresso/IntentsBasicSample:IntentsBasicSample\"\n      - \"//ui/espresso/IntentsAdvancedSample:IntentsAdvancedSampleTest\"\n      - \"//ui/espresso/IntentsAdvancedSample:IntentsAdvancedSample\"\n      - \"//ui/espresso/IdlingResourceSample:IdlingResourceSampleTest\"\n      - \"//ui/espresso/IdlingResourceSample:IdlingResourceSample\"\n      - \"//ui/espresso/DataAdapterSample:DataAdapterSampleTest\"\n      - \"//ui/espresso/DataAdapterSample:DataAdapterSample\"\n      - \"//ui/espresso/CustomMatcherSample:CustomMatcherSampleTest\"\n      - \"//ui/espresso/CustomMatcherSample:CustomMatcherSample\"\n      - \"//ui/espresso/BasicSample:BasicSampleTest\"\n      - \"//ui/espresso/BasicSample:BasicSample\"\n      - \"//ui/espresso/AccessibilitySample:BasicSampleTest\"\n      - \"//ui/espresso/AccessibilitySample:BasicSample\"\n\n"
  },
  {
    "path": "common_defs.bzl",
    "content": "# Common constants for bazel builds\n\n# keep naming convention consistent with gradle variables, so version numbers can be auto-incremented\n# via a script\n\nandroidxLibVersion = \"1.0.0\"\ncoreVersion = \"1.2.0-beta01\"\nextJUnitVersion = \"1.1.1-beta01\"\nextTruthVersion = \"1.2.0-beta01\"\nrunnerVersion = \"1.2.0-beta01\"\nrulesVersion = \"1.2.0-beta01\"\nespressoVersion = \"3.2.0-beta01\"\nuiAutomatorVersion = \"2.2.0\"\nminSdkVersion = \"14\"\ntargetSdkVersion = \"28\"\n"
  },
  {
    "path": "integration/ServiceTestRuleSample/.gitignore",
    "content": ".gradle\nlocal.properties\n.idea\n.DS_Store\nbuild\n*.iml\n"
  },
  {
    "path": "integration/ServiceTestRuleSample/README.md",
    "content": "# Basic sample for ServiceTestRule\n\nThis rule provides a simplified mechanism to start and shutdown your service before and after\nthe duration of your test. It also guarantees that the service is successfully connected when starting\n(or binding to) a service. The service can be started (or bound) using one of the helper methods.\nIt will automatically be stopped (or unbound) after the test completes and any methods annotated with @After are finished.\n\nNote: This rule doesn't support `IntentService` because it's automatically destroyed when\n`IntentService#onHandleIntent(android.content.Intent)`\n finishes all outstanding commands. So there is no guarantee to establish a successful connection in a timely manner.\n\nThis project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio is recommended.\n\n1. Download the project code, preferably using `git clone`.\n1. Open the Android SDK Manager (*Tools* Menu | *Android*) and make sure you have installed the *Support Repository* under *Extras*.\n1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n1. Check out the relevant code:\n    * The application under test is located in `src/main/java`\n    * Tests are in `src/androidTest/java`\n1. Connect a device or start an emulator\n1. Run the newly created configuration\n\nThe application will be started on the device/emulator and a series of actions will be performed automatically.\n\nIf you are using Android Studio, the *Run* window will show the test results.\n"
  },
  {
    "path": "integration/ServiceTestRuleSample/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\nandroid {\n    compileSdk 34\n    defaultConfig {\n        applicationId \"com.example.android.testing.integrationtesting.ServiceTestRuleSample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    productFlavors {\n    }\n    testOptions {\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    namespace \"com.example.android.testing.ServiceTestRuleSample\"\n    lint {\n        abortOnError false\n    }\n}\n\ndependencies {\n    // Testing-only dependencies\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion;\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion;\n    androidTestImplementation \"androidx.test:rules:\" + rootProject.rulesVersion;\n}\n"
  },
  {
    "path": "integration/ServiceTestRuleSample/app/src/androidTest/java/com/example/android/testing/ServiceTestRuleSample/LocalServiceTest.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.ServiceTestRuleSample;\n\nimport android.content.Intent;\nimport android.os.IBinder;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.filters.MediumTest;\nimport androidx.test.rule.ServiceTestRule;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport java.util.concurrent.TimeoutException;\n\nimport static androidx.test.core.app.ApplicationProvider.getApplicationContext;\nimport static org.hamcrest.CoreMatchers.any;\nimport static org.hamcrest.CoreMatchers.is;\nimport static org.junit.Assert.assertThat;\n\n/**\n * JUnit4 test that uses a {@link ServiceTestRule} to interact with a bound service.\n * <p>\n * {@link ServiceTestRule} is a JUnit rule that provides a\n * simplified mechanism to start and shutdown your service before\n * and after the duration of your test. It also guarantees that the service is successfully\n * connected when starting (or binding to) a service. The service can be started\n * (or bound) using one of the helper methods. It will automatically be stopped (or unbound) after\n * the test completes and any methods annotated with\n * <a href=\"http://junit.sourceforge.net/javadoc/org/junit/After.html\"><code>After</code></a> are\n * finished.\n * <p>\n * Note: This rule doesn't support {@link android.app.IntentService} because it's automatically\n * destroyed when {@link android.app.IntentService#onHandleIntent(android.content.Intent)} finishes\n * all outstanding commands. So there is no guarantee to establish a successful connection\n * in a timely manner.\n */\n@MediumTest\n@RunWith(AndroidJUnit4.class)\npublic class LocalServiceTest {\n    @Rule\n    public final ServiceTestRule mServiceRule = new ServiceTestRule();\n\n    @Test\n    public void testWithBoundService() throws TimeoutException {\n        // Create the service Intent.\n        Intent serviceIntent =\n                new Intent(getApplicationContext(), LocalService.class);\n\n        // Data can be passed to the service via the Intent.\n        serviceIntent.putExtra(LocalService.SEED_KEY, 42L);\n\n        // Bind the service and grab a reference to the binder.\n        IBinder binder = mServiceRule.bindService(serviceIntent);\n\n        // Get the reference to the service, or you can call public methods on the binder directly.\n        LocalService service = ((LocalService.LocalBinder) binder).getService();\n\n        // Verify that the service is working correctly.\n        assertThat(service.getRandomInt(), is(any(Integer.class)));\n    }\n}\n"
  },
  {
    "path": "integration/ServiceTestRuleSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2015 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\">\n        <service android:name=\".LocalService\"/>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "integration/ServiceTestRuleSample/app/src/main/java/com/example/android/testing/ServiceTestRuleSample/LocalService.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.ServiceTestRuleSample;\n\nimport android.app.Service;\nimport android.content.Intent;\nimport android.os.Binder;\nimport android.os.IBinder;\n\nimport java.util.Random;\n\n/**\n * {@link Service} that generates random numbers.\n * <p>\n * A seed for the random number generator can be set via the {@link Intent} passed to\n * {@link #onBind(Intent)}.\n */\npublic class LocalService extends Service {\n    // Used as a key for the Intent.\n    public static final String SEED_KEY = \"SEED_KEY\";\n\n    // Binder given to clients\n    private final IBinder mBinder = new LocalBinder();\n\n    // Random number generator\n    private Random mGenerator = new Random();\n\n    private long mSeed;\n\n    @Override\n    public IBinder onBind(Intent intent) {\n        // If the Intent comes with a seed for the number generator, apply it.\n        if (intent.hasExtra(SEED_KEY)) {\n            mSeed = intent.getLongExtra(SEED_KEY, 0);\n            mGenerator.setSeed(mSeed);\n        }\n        return mBinder;\n    }\n\n    public class LocalBinder extends Binder {\n\n        public LocalService getService() {\n            // Return this instance of LocalService so clients can call public methods.\n            return LocalService.this;\n        }\n    }\n\n    /**\n     * Returns a random integer in [0, 100).\n     */\n    public int getRandomInt() {\n        return mGenerator.nextInt(100);\n    }\n}\n"
  },
  {
    "path": "integration/ServiceTestRuleSample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2015 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <string name=\"app_name\">ServiceTestRule Basic Sample</string>\n</resources>\n"
  },
  {
    "path": "integration/ServiceTestRuleSample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2015 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Light\"/>\n</resources>"
  },
  {
    "path": "integration/ServiceTestRuleSample/app/src/main/res/values-v13/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2015 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Holo.Light\"/>\n</resources>"
  },
  {
    "path": "integration/ServiceTestRuleSample/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2015 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Material.Light\"/>\n</resources>\n"
  },
  {
    "path": "integration/ServiceTestRuleSample/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    coreVersion = \"1.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    runnerVersion = \"1.6.1\"\n    rulesVersion = \"1.6.1\"\n}\n"
  },
  {
    "path": "integration/ServiceTestRuleSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "integration/ServiceTestRuleSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonFinalResIds=false\nandroid.nonTransitiveRClass=false\nandroid.useAndroidX=true\n"
  },
  {
    "path": "integration/ServiceTestRuleSample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "integration/ServiceTestRuleSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "integration/ServiceTestRuleSample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "projects.conf",
    "content": "integration/ServiceTestRuleSample\nrunner/AndroidJunitRunnerSample\nrunner/AndroidTestOrchestratorSample\nui/espresso/AccessibilitySample\nui/espresso/BasicSample\nui/espresso/CustomMatcherSample\nui/espresso/DataAdapterSample\nui/espresso/EspressoDeviceSample\nui/espresso/FragmentScenarioSample\nui/espresso/IdlingResourceSample\nui/espresso/IntentsAdvancedSample\nui/espresso/IntentsBasicSample\nui/espresso/MultiWindowSample\nui/espresso/MultiProcessSample\nui/espresso/RecyclerViewSample\nui/espresso/ScreenshotSample\nui/espresso/WebBasicSample\nui/uiautomator/BasicSample\nunit/BasicNativeAndroidTest\n"
  },
  {
    "path": "renovate.json",
    "content": "{\n  \"$schema\": \"https://docs.renovatebot.com/renovate-schema.json\",\n  \"extends\": [\n    \"local>android/.github:renovate-config\"\n  ]\n}\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/.gitignore",
    "content": ".gradle\n/local.properties\n.idea\n*.iml\n.DS_Store\nbuild\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/README.md",
    "content": "# AndroidJUnitRunner sample\n\nThe new android test runner brings Junit4 support to android testing. This samples gives a quick\noverview of some of the new features like test annotations, parameterized tests and test suite\ncreation.\n\n1. CalculatorTest.java contains JUnit4 style unit tests for the calculator logic.\n1. CalculatorAddParameterizedTest.java contains JUnit4 style tests and uses the @Parameters annotation\n   to parameterize a single test with different values.\n1. CalculatorInstrumentationTest.java uses JUnit4 style tests to test the Ui of the CalculatorActivity\n1. OperationHintInstrumentationTest.java uses JUnit3 style tests to test the Ui of the CalculatorActivity\n\nThis project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio is recommended.\n\n1. Download the project code, preferably using `git clone`.\n1. Open the Android SDK Manager (*Tools* Menu | *Android*) and make sure you have installed the *Android Support Repository* under *Extras*.\n1. In Android Studio, select *File* | *Open...* and point to the top-level `./build.gradle` file.\n1. Check out the relevant code:\n    * The application under test is located in `src/main/java`\n    * Tests are in `src/androidTest/java`\n1. Create the test configuration with a custom runner: `androidx.test.runner.AndroidJUnitRunner`\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *Android Tests* configuration\n    * Choose a module\n    * Choose which tests to run. Click on Test: class and select one of the TestSuites\n    (AndroidTestSuite, UnitTestSuite, InstrumentationTestSuite)\n    * Add a *Specific instrumentation runner*: `androidx.test.runner.AndroidJUnitRunner`\n1. Connect a device or start an emulator\n    * Turn animations off.\n    (On your device, under Settings->Developer options disable the following 3 settings: \"Window animation scale\", \"Transition animation scale\" and \"Animator duration scale\")\n1. Run the newly created configuration\n\nThe application will be started on the device/emulator and a series of actions will be performed automatically.\n\nIf you are using Android Studio, the *Run* window will show the test results.\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\n\nandroid {\n    compileSdk 34\n    defaultConfig {\n        applicationId \"com.example.android.testing.androidjunitrunnersample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n        }\n    }\n    productFlavors {\n    }\n    testOptions {\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                   // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    useLibrary \"android.test.runner\"\n\n    useLibrary \"android.test.base\"\n    useLibrary \"android.test.mock\"\n    namespace \"com.example.android.testing.androidjunitrunnersample\"\n\n}\n\ndependencies {\n    // App's dependencies, including test\n    implementation \"androidx.annotation:annotation:\" + rootProject.androidxAnnotationVersion;\n    implementation \"com.google.guava:guava:\" + rootProject.guavaVersion\n\n    // Testing-only dependencies\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion;\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion;\n    androidTestImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion;\n\n    // https://truth.dev/\n    androidTestImplementation \"com.google.truth:truth:\" + rootProject.truthVersion;\n}\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/CalculatorAddParameterizedTest.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidjunitrunnersample;\n\nimport static com.google.common.truth.Truth.assertThat;\nimport static org.junit.runners.Parameterized.Parameters;\n\nimport androidx.test.filters.SmallTest;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.junit.runners.Parameterized;\n\nimport java.util.Arrays;\n\n\n/**\n * JUnit4 tests for the calculator's add logic.\n *\n * <p> This test uses Junit4s Parameterized tests features which uses annotations to pass\n * parameters into a unit test. The way this works is that you have to use the {@link Parameterized}\n * runner to run your tests.\n * </p>\n */\n@RunWith(Parameterized.class)\n@SmallTest\npublic class CalculatorAddParameterizedTest {\n\n    /**\n     * @return {@link Iterable} that contains the values that should be passed to the constructor.\n     * In this example we are going to use three parameters: operand one, operand two and the\n     * expected result.\n     */\n    @Parameters\n    public static Iterable<Object[]> data() {\n        return Arrays.asList(new Object[][]{\n                {0, 0, 0},\n                {0, -1, -1},\n                {2, 2, 4},\n                {8, 8, 16},\n                {16, 16, 32},\n                {32, 0, 32},\n                {64, 64, 128}});\n    }\n\n    private final double mOperandOne;\n    private final double mOperandTwo;\n    private final double mExpectedResult;\n\n    private Calculator mCalculator;\n\n    /**\n     * Constructor that takes in the values specified in\n     * {@link CalculatorAddParameterizedTest#data()}. The values need to be saved to fields in order\n     * to reuse them in your tests.\n     */\n    public CalculatorAddParameterizedTest(double operandOne, double operandTwo,\n                                          double expectedResult) {\n\n        mOperandOne = operandOne;\n        mOperandTwo = operandTwo;\n        mExpectedResult = expectedResult;\n    }\n\n    @Before\n    public void setUp() {\n        mCalculator = new Calculator();\n    }\n\n    @Test\n    public void testAdd_TwoNumbers() {\n        double resultAdd = mCalculator.add(mOperandOne, mOperandTwo);\n        assertThat(resultAdd).isEqualTo(mExpectedResult);\n    }\n\n}\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/CalculatorInstrumentationTest.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidjunitrunnersample;\n\nimport junit.framework.TestSuite;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.internal.builders.AllDefaultPossibilitiesBuilder;\nimport org.junit.runner.RunWith;\n\nimport androidx.test.core.app.ActivityScenario;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.filters.LargeTest;\nimport androidx.test.runner.AndroidJUnitRunner;\n\nimport static androidx.test.core.app.ApplicationProvider.getApplicationContext;\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.action.ViewActions.click;\nimport static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;\nimport static androidx.test.espresso.action.ViewActions.typeText;\nimport static androidx.test.espresso.assertion.ViewAssertions.matches;\nimport static androidx.test.espresso.matcher.ViewMatchers.withId;\nimport static androidx.test.espresso.matcher.ViewMatchers.withText;\n\n/**\n * JUnit4 Ui Tests for {@link CalculatorActivity} using the {@link AndroidJUnitRunner}.\n * This class uses the JUnit4 syntax for tests.\n * <p>\n * With the new AndroidJUnit runner you can run both JUnit3 and JUnit4 tests in a single test\n * suite. The {@link AndroidRunnerBuilder} which extends JUnit's\n * {@link AllDefaultPossibilitiesBuilder} will create a single {@link\n * TestSuite} from all tests and run them.\n */\n@RunWith(AndroidJUnit4.class)\n@LargeTest\npublic class CalculatorInstrumentationTest {\n\n    /**\n     * Use {@link ActivityScenario} to create and launch of the activity.\n     */\n    @Before\n    public void launchActivity() {\n        ActivityScenario.launch(CalculatorActivity.class);\n    }\n\n    @Test\n    public void noOperandShowsComputationError() {\n        final String expectedResult = getApplicationContext().getString(R.string.computationError);\n        onView(withId(R.id.operation_add_btn)).perform(click());\n        onView(withId(R.id.operation_result_text_view)).check(matches(withText(expectedResult)));\n    }\n\n    @Test\n    public void typeOperandsAndPerformAddOperation() {\n        performOperation(R.id.operation_add_btn, \"16.0\", \"16.0\", \"32.0\");\n    }\n\n    @Test\n    public void typeOperandsAndPerformSubOperation() {\n        performOperation(R.id.operation_sub_btn, \"32.0\", \"16.0\", \"16.0\");\n    }\n\n    @Test\n    public void typeOperandsAndPerformDivOperation() {\n        performOperation(R.id.operation_div_btn, \"128.0\", \"16.0\", \"8.0\");\n    }\n\n    @Test\n    public void divZeroForOperandTwoShowsError() {\n        final String expectedResult = getApplicationContext().getString(R.string.computationError);\n        performOperation(R.id.operation_div_btn, \"128.0\", \"0.0\", expectedResult);\n    }\n\n    @Test\n    public void typeOperandsAndPerformMulOperation() {\n        performOperation(R.id.operation_mul_btn, \"16.0\", \"16.0\", \"256.0\");\n    }\n\n    private void performOperation(int btnOperationResId, String operandOne,\n            String operandTwo, String expectedResult) {\n        // Type the two operands in the EditText fields\n        onView(withId(R.id.operand_one_edit_text)).perform(typeText(operandOne),\n                closeSoftKeyboard());\n        onView(withId(R.id.operand_two_edit_text)).perform(typeText(operandTwo),\n                closeSoftKeyboard());\n\n        // Click on a given operation button\n        onView(withId(btnOperationResId)).perform(click());\n\n        // Check the expected test is displayed in the Ui\n        onView(withId(R.id.operation_result_text_view)).check(matches(withText(expectedResult)));\n    }\n\n}\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/CalculatorTest.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidjunitrunnersample;\n\nimport static com.google.common.truth.Truth.assertThat;\n\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.filters.SmallTest;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\n\n\n/**\n * JUnit4 unit tests for the calculator logic.\n */\n@RunWith(AndroidJUnit4.class)\n@SmallTest\npublic class CalculatorTest {\n\n    private Calculator mCalculator;\n\n    @Before\n    public void setUp() {\n        mCalculator = new Calculator();\n    }\n\n    @Test\n    public void addTwoNumbers() {\n        double resultAdd = mCalculator.add(1d, 1d);\n        assertThat(resultAdd).isEqualTo(2d);\n    }\n\n    @Test\n    public void subTwoNumbers() {\n        double resultSub = mCalculator.sub(1d, 1d);\n        assertThat(resultSub).isEqualTo(0d);\n    }\n\n    @Test\n    public void subWorksWithNegativeResult() {\n        double resultSub = mCalculator.sub(1d, 17d);\n        assertThat(resultSub).isEqualTo(-16d);\n    }\n\n    @Test\n    public void divTwoNumbers() {\n        double resultDiv = mCalculator.div(32d,2d);\n        assertThat(resultDiv).isEqualTo(16d);\n    }\n\n    @Test(expected = IllegalArgumentException.class)\n    public void divDivideByZeroThrows() {\n        mCalculator.div(32d,0d);\n    }\n\n    @Test\n    public void mulTwoNumbers() {\n        double resultMul = mCalculator.mul(32d, 2d);\n        assertThat(resultMul).isEqualTo(64d);\n    }\n\n}"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/HintMatcher.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidjunitrunnersample;\n\nimport androidx.test.espresso.matcher.BoundedMatcher;\n\nimport org.hamcrest.Description;\nimport org.hamcrest.Matcher;\n\nimport android.view.View;\nimport android.widget.EditText;\n\nimport static com.google.common.base.Preconditions.checkNotNull;\nimport static org.hamcrest.Matchers.is;\n\n/**\n * A custom matcher that checks the hint property of an {@link android.widget.EditText}. It\n * accepts either a {@link String} or a {@link org.hamcrest.Matcher}.\n */\npublic class HintMatcher {\n\n    static Matcher<View> withHint(final String substring) {\n        return withHint(is(substring));\n    }\n\n    static Matcher<View> withHint(final Matcher<String> stringMatcher) {\n        checkNotNull(stringMatcher);\n        return new BoundedMatcher<View, EditText>(EditText.class) {\n\n            @Override\n            public boolean matchesSafely(EditText view) {\n                final CharSequence hint = view.getHint();\n                return hint != null && stringMatcher.matches(hint.toString());\n            }\n\n            @Override\n            public void describeTo(Description description) {\n                description.appendText(\"with hint: \");\n                stringMatcher.describeTo(description);\n            }\n        };\n    }\n}\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/OperationHintInstrumentationTest.java",
    "content": "/*\n * Copyright 2014, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidjunitrunnersample;\n\nimport junit.framework.TestSuite;\n\nimport org.junit.internal.builders.AllDefaultPossibilitiesBuilder;\n\nimport androidx.test.filters.LargeTest;\nimport androidx.test.runner.AndroidJUnitRunner;\nimport android.test.ActivityInstrumentationTestCase2;\n\nimport static com.example.android.testing.androidjunitrunnersample.HintMatcher.withHint;\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.assertion.ViewAssertions.matches;\nimport static androidx.test.espresso.matcher.ViewMatchers.withId;\nimport static org.hamcrest.CoreMatchers.notNullValue;\nimport static org.junit.Assert.assertThat;\n\n/**\n * JUnit3 Ui Tests for {@link CalculatorActivity} using the {@link AndroidJUnitRunner}. This class\n * uses the Junit3 syntax for tests.\n *\n * <p> With the new AndroidJUnit runner you can run both JUnit3 and JUnit4 tests in a single test\n * test suite. The {@link AndroidRunnerBuilder} which extends JUnit's {@link\n * AllDefaultPossibilitiesBuilder} will create a single {@link TestSuite} from all tests and run\n * them. </p>\n */\n@LargeTest\npublic class OperationHintInstrumentationTest\n        extends ActivityInstrumentationTestCase2<CalculatorActivity> {\n\n    private CalculatorActivity mActivity;\n\n    public OperationHintInstrumentationTest() {\n        super(CalculatorActivity.class);\n    }\n\n    @Override\n    protected void setUp() throws Exception {\n        super.setUp();\n\n        // Espresso does not start the Activity for you we need to do this manually here.\n        mActivity = getActivity();\n    }\n\n    public void testPreconditions() {\n        assertThat(mActivity, notNullValue());\n    }\n\n    public void testEditText_OperandOneHint() {\n        String operandOneHint = mActivity.getString(R.string.type_operand_one_hint);\n        onView(withId(R.id.operand_one_edit_text)).check(matches(withHint(operandOneHint)));\n    }\n\n    public void testEditText_OperandTwoHint() {\n        String operandTwoHint = mActivity.getString(R.string.type_operant_two_hint);\n        onView(withId(R.id.operand_two_edit_text)).check(matches(withHint(operandTwoHint)));\n    }\n\n}\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/OperationHintLegacyInstrumentationTest.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidjunitrunnersample;\n\nimport junit.framework.TestSuite;\n\nimport org.junit.internal.builders.AllDefaultPossibilitiesBuilder;\n\nimport androidx.test.filters.LargeTest;\nimport androidx.test.runner.AndroidJUnitRunner;\nimport android.test.ActivityInstrumentationTestCase2;\n\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.assertion.ViewAssertions.matches;\nimport static androidx.test.espresso.matcher.ViewMatchers.withId;\nimport static com.example.android.testing.androidjunitrunnersample.HintMatcher.withHint;\nimport static org.hamcrest.CoreMatchers.notNullValue;\nimport static org.junit.Assert.assertThat;\n\n/**\n * JUnit3 Ui Tests for {@link CalculatorActivity} using the {@link AndroidJUnitRunner}. This class\n * uses the Junit3 syntax for tests and extends {@link ActivityInstrumentationTestCase2}.\n * <p>\n * With the new AndroidJUnit runner you can run both JUnit3 and JUnit4 tests in a single test\n * test suite. The {@link AndroidRunnerBuilder} which extends JUnit's {@link\n * AllDefaultPossibilitiesBuilder} will create a single {@link TestSuite} from all tests and run\n * them.\n * <p>\n * ActivityInstrumentationTestCase2 will be deprecated soon. Please use {@link ActivityTestRule}\n * when writing new tests. For an example on how to use {@link ActivityTestRule} please see\n * {@link CalculatorInstrumentationTest}.\n */\n@LargeTest\npublic class OperationHintLegacyInstrumentationTest\n        extends ActivityInstrumentationTestCase2<CalculatorActivity> {\n\n    private CalculatorActivity mActivity;\n\n    public OperationHintLegacyInstrumentationTest() {\n        super(CalculatorActivity.class);\n    }\n\n    @Override\n    protected void setUp() throws Exception {\n        super.setUp();\n\n        // Espresso does not start the Activity for you we need to do this manually here.\n        mActivity = getActivity();\n    }\n\n    public void testPreconditions() {\n        assertThat(mActivity, notNullValue());\n    }\n\n    public void testEditText_OperandOneHint() {\n        String operandOneHint = mActivity.getString(R.string.type_operand_one_hint);\n        onView(withId(R.id.operand_one_edit_text)).check(matches(withHint(operandOneHint)));\n    }\n\n    public void testEditText_OperandTwoHint() {\n        String operandTwoHint = mActivity.getString(R.string.type_operant_two_hint);\n        onView(withId(R.id.operand_two_edit_text)).check(matches(withHint(operandTwoHint)));\n    }\n\n}\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/suite/AndroidTestSuite.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidjunitrunnersample.suite;\n\nimport org.junit.runner.RunWith;\nimport org.junit.runners.Suite;\n\n/**\n * Test suite that runs all tests, unit + instrumentation tests.\n */\n@RunWith(Suite.class)\n@Suite.SuiteClasses({UnitTestSuite.class, InstrumentationTestSuite.class})\npublic class AndroidTestSuite {}"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/suite/InstrumentationTestSuite.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidjunitrunnersample.suite;\n\nimport com.example.android.testing.androidjunitrunnersample.CalculatorInstrumentationTest;\nimport com.example.android.testing.androidjunitrunnersample.OperationHintLegacyInstrumentationTest;\n\nimport org.junit.runner.RunWith;\nimport org.junit.runners.Suite;\n\n/**\n * Runs all Junit3 and Junit4 Instrumentation tests.\n */\n@RunWith(Suite.class)\n@Suite.SuiteClasses({CalculatorInstrumentationTest.class, OperationHintLegacyInstrumentationTest.class})\npublic class InstrumentationTestSuite {}\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/androidTest/java/com/example/android/testing/androidjunitrunnersample/suite/UnitTestSuite.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidjunitrunnersample.suite;\n\nimport com.example.android.testing.androidjunitrunnersample.CalculatorAddParameterizedTest;\nimport com.example.android.testing.androidjunitrunnersample.CalculatorTest;\n\nimport org.junit.runner.RunWith;\nimport org.junit.runners.Suite;\n\n/**\n * Runs all unit tests.\n */\n@RunWith(Suite.class)\n@Suite.SuiteClasses({CalculatorTest.class, CalculatorAddParameterizedTest.class})\npublic class UnitTestSuite {}\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2015 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\".CalculatorActivity\"\n            android:label=\"@string/app_name\"\n            android:exported=\"true\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/main/java/com/example/android/testing/androidjunitrunnersample/Calculator.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidjunitrunnersample;\n\nimport static com.google.common.base.Preconditions.checkArgument;\n\n/**\n * A simple calculator with a basic set of operations.\n */\npublic class Calculator {\n\n    public enum Operator {ADD, SUB, DIV, MUL}\n\n    /**\n     * Addition operation\n     */\n    public double add(double firstOperand, double secondOperand) {\n        return firstOperand + secondOperand;\n    }\n\n    /**\n     * Substract operation\n     */\n    public double sub(double firstOperand, double secondOperand) {\n        return firstOperand - secondOperand;\n    }\n\n    /**\n     * Divide operation\n     */\n    public double div(double firstOperand, double secondOperand) {\n        checkArgument(secondOperand != 0, \"secondOperand must be != 0, you cannot divide by zero\");\n        return firstOperand / secondOperand;\n    }\n\n    /**\n     * Multiply operation\n     */\n    public double mul(double firstOperand, double secondOperand) {\n\n        return firstOperand * secondOperand;\n    }\n}\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/main/java/com/example/android/testing/androidjunitrunnersample/CalculatorActivity.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidjunitrunnersample;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.text.TextUtils;\nimport android.util.Log;\nimport android.view.View;\nimport android.widget.Button;\nimport android.widget.EditText;\nimport android.widget.TextView;\n\n/**\n * {@link android.app.Activity} which contains a simple calculator. Numbers can be entered in the\n * two {@link EditText} fields and result can be obtained by pressing one of the\n * operation {@link Button}s at the bottom.\n */\npublic class CalculatorActivity extends Activity {\n\n    private static final String TAG = \"CalculatorActivity\";\n\n    private Calculator mCalculator;\n\n    private EditText mOperandOneEditText;\n    private EditText mOperandTwoEditText;\n\n    private TextView mResultTextView;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_calculator);\n        mCalculator = new Calculator();\n        mResultTextView = (TextView) findViewById(R.id.operation_result_text_view);\n        mOperandOneEditText = (EditText) findViewById(R.id.operand_one_edit_text);\n        mOperandTwoEditText = (EditText) findViewById(R.id.operand_two_edit_text);\n    }\n\n    /**\n     * OnClick method that is called when the add {@link Button} is pressed.\n     */\n    public void onAdd(View view) {\n        compute(Calculator.Operator.ADD);\n    }\n\n    /**\n     * OnClick method that is called when the substract {@link Button} is pressed.\n     */\n    public void onSub(View view) {\n        compute(Calculator.Operator.SUB);\n    }\n\n    /**\n     * OnClick method that is called when the divide {@link Button} is pressed.\n     */\n    public void onDiv(View view) {\n        try {\n            compute(Calculator.Operator.DIV);\n        } catch (IllegalArgumentException iae) {\n            Log.e(TAG, \"IllegalArgumentException\", iae);\n            mResultTextView.setText(getString(R.string.computationError));\n        }\n    }\n\n    /**\n     * OnClick method that is called when the multiply {@link Button} is pressed.\n     */\n    public void onMul(View view) {\n        compute(Calculator.Operator.MUL);\n    }\n\n    private void compute(Calculator.Operator operator) {\n        double operandOne;\n        double operandTwo;\n        try {\n            operandOne = getOperand(mOperandOneEditText);\n            operandTwo = getOperand(mOperandTwoEditText);\n        } catch (NumberFormatException nfe) {\n            Log.e(TAG, \"NumberFormatException\", nfe);\n            mResultTextView.setText(getString(R.string.computationError));\n            return;\n        }\n\n        String result;\n        switch (operator) {\n            case ADD:\n                result = String.valueOf(mCalculator.add(operandOne, operandTwo));\n                break;\n            case SUB:\n                result = String.valueOf(mCalculator.sub(operandOne, operandTwo));\n                break;\n            case DIV:\n                result = String.valueOf(mCalculator.div(operandOne, operandTwo));\n                break;\n            case MUL:\n                result = String.valueOf(mCalculator.mul(operandOne, operandTwo));\n                break;\n            default:\n                result = getString(R.string.computationError);\n                break;\n        }\n        mResultTextView.setText(result);\n    }\n\n    /**\n     * @return the operand value which was entered in an {@link EditText} as a double\n     */\n    private static Double getOperand(EditText operandEditText) {\n        String operandText = getOperandText(operandEditText);\n        return Double.valueOf(operandText);\n    }\n\n    /**\n     * @return the operand text which was entered in an {@link EditText}.\n     */\n    private static String getOperandText(EditText operandEditText) {\n        String operandText = operandEditText.getText().toString();\n        if (TextUtils.isEmpty(operandText)) {\n            throw new NumberFormatException(\"operand cannot be empty!\");\n        }\n        return operandText;\n    }\n}\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/main/res/layout/activity_calculator.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2015 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n    android:paddingRight=\"@dimen/activity_horizontal_margin\"\n    android:paddingTop=\"@dimen/activity_vertical_margin\"\n    android:paddingBottom=\"@dimen/activity_vertical_margin\"\n    android:orientation=\"vertical\"\n    tools:context=\".CalculatorActivity\">\n\n    <EditText android:id=\"@+id/operand_one_edit_text\"\n        android:hint=\"@string/type_operand_one_hint\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:inputType=\"numberDecimal\"/>\n\n    <EditText android:id=\"@+id/operand_two_edit_text\"\n        android:hint=\"@string/type_operant_two_hint\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:inputType=\"numberDecimal\"/>\n\n    <RelativeLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\">\n\n        <Button android:id=\"@+id/operation_add_btn\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/add_operation_text\"\n            android:onClick=\"onAdd\"/>\n\n        <Button android:id=\"@+id/operation_sub_btn\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/sub_operation_text\"\n            android:layout_toRightOf=\"@id/operation_add_btn\"\n            android:layout_toEndOf=\"@id/operation_add_btn\"\n            android:onClick=\"onSub\"/>\n\n        <Button android:id=\"@+id/operation_div_btn\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/div_operation_text\"\n            android:layout_below=\"@id/operation_add_btn\"\n            android:onClick=\"onDiv\"/>\n\n        <Button android:id=\"@+id/operation_mul_btn\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/mul_operation_text\"\n            android:layout_below=\"@id/operation_add_btn\"\n            android:layout_toRightOf=\"@id/operation_add_btn\"\n            android:layout_toEndOf=\"@id/operation_add_btn\"\n            android:onClick=\"onMul\"/>\n\n    </RelativeLayout>\n\n    <TextView android:id=\"@+id/operation_result_text_view\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"@dimen/activity_vertical_margin\"/>\n\n</LinearLayout>\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2015 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2015 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n\n    <string name=\"app_name\">AndroidJunitRunnerSample</string>\n    <string name=\"type_operand_one_hint\">Type Operand 1</string>\n    <string name=\"type_operant_two_hint\">Type Operand 2</string>\n    <string name=\"add_operation_text\">Add</string>\n    <string name=\"sub_operation_text\">Sub</string>\n    <string name=\"div_operation_text\">Div</string>\n    <string name=\"mul_operation_text\">Mul</string>\n    <string name=\"computationError\">Error</string>\n\n</resources>\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2015 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Black\"/>\n</resources>\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/main/res/values-v14/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2015 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Holo\"/>\n</resources>\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2015 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <style name=\"AppTheme\" parent=\"android:ThemeOverlay.Material.Dark\"/>\n</resources>\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2015 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    buildToolsVersion = \"32.0.0\"\n    androidxAnnotationVersion = \"1.5.0\"\n    guavaVersion = \"31.1-android\"\n    coreVersion = \"1.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    runnerVersion = \"1.6.1\"\n    rulesVersion = \"1.6.1\"\n    espressoVersion = \"3.6.1\"\n    truthVersion = \"1.1.3\"\n}\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonFinalResIds=false\nandroid.nonTransitiveRClass=false\nandroid.useAndroidX=true\nandroid.useAndroidX=true\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "runner/AndroidJunitRunnerSample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/.gitignore",
    "content": ".gradle\n/local.properties\n.idea\n*.iml\n.DS_Store\nbuild\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/README.md",
    "content": "# AndroidTestOrchestrator sample\n\nThe Android Test Orchestrator allows you to run each of your app's tests in isolation, enabling greater relability.\nSee https://developer.android.com/training/testing/junit-runner#using-android-test-orchestrator for more background.\n\nThis sample is a subset of the AndroidJUnitRunner sample, but it\nillustrates how to enable the Android Test Orchestrator in the app/build.gradle file.\n\nThis project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio is recommended.\n\n1. Download the project code, preferably using `git clone`.\n1. Open the Android SDK Manager (*Tools* Menu | *Android*).\n1. In Android Studio, select *File* | *Open...* and point to the top-level `./build.gradle` file.\n1. Check out the relevant code:\n    * The application under test is located in `src/main/java`\n    * Tests are in `src/androidTest/java`\n1. Create the test configuration\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *Android Tests* configuration\n    * Choose a module\n1. Connect a device or start an emulator\n    * Turn animations off.\n    (On your device, under Settings->Developer options disable the following 3 settings: \"Window animation scale\", \"Transition animation scale\" and \"Animator duration scale\")\n1. Run the newly created configuration\n\nThe application will be started on the device/emulator and a series of actions will be performed automatically.\n\nIf you are using Android Studio, the *Run* window will show the test results.\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\nandroid {\n    compileSdk 34\n    defaultConfig {\n        applicationId \"com.example.android.testing.androidtestorchestratorsample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n        testInstrumentationRunnerArguments clearPackageData: \"true\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n        }\n    }\n    productFlavors {\n    }\n\n    testOptions {\n        execution \"ANDROIDX_TEST_ORCHESTRATOR\"\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    namespace \"com.example.android.testing.androidtestorchestratorsample\"\n}\n\ndependencies {\n    // App's dependencies, including test\n    implementation \"androidx.annotation:annotation:\" + rootProject.androidxAnnotationVersion;\n    implementation \"com.google.guava:guava:\" + rootProject.guavaVersion\n\n    // Testing-only dependencies\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion;\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion;\n    androidTestImplementation \"androidx.test:monitor:\" + rootProject.monitorVersion;\n    androidTestImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion;\n    androidTestImplementation \"com.google.truth:truth:\" + rootProject.truthVersion;\n    androidTestUtil \"androidx.test:orchestrator:\" + rootProject.orchestratorVersion;\n\n}\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/app/src/androidTest/java/com/example/android/testing/androidtestorchestratorsample/CalculatorAddParameterizedTest.java",
    "content": "/*\n * Copyright 2020, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidtestorchestratorsample;\n\nimport static com.google.common.truth.Truth.assertThat;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.junit.runners.Parameterized;\n\nimport androidx.test.filters.SmallTest;\n\nimport java.lang.Iterable;\nimport java.util.Arrays;\n\nimport static org.junit.runners.Parameterized.Parameters;\n\n\n/**\n * JUnit4 tests for the calculator's add logic.\n *\n * <p> This test uses a Junit4s Parameterized tests features which uses annotations to pass\n * parameters into a unit test. The way this works is that you have to use the {@link Parameterized}\n * runner to run your tests.\n * </p>\n */\n@RunWith(Parameterized.class)\n@SmallTest\npublic class CalculatorAddParameterizedTest {\n\n    /**\n     * @return {@link Iterable} that contains the values that should be passed to the constructor.\n     * In this example we are going to use three parameters: operand one, operand two and the\n     * expected result.\n     */\n    @Parameters\n    public static Iterable<Object[]> data() {\n        return Arrays.asList(new Object[][]{\n                {0, 0, 0},\n                {0, -1, -1},\n                {2, 2, 4},\n                {8, 8, 16},\n                {16, 16, 32},\n                {32, 0, 32},\n                {64, 64, 128}});\n    }\n\n    private final double mOperandOne;\n    private final double mOperandTwo;\n    private final double mExpectedResult;\n\n    private Calculator mCalculator;\n\n    /**\n     * Constructor that takes in the values specified in\n     * {@link CalculatorAddParameterizedTest#data()}. The values need to be saved to fields in order\n     * to reuse them in your tests.\n     */\n    public CalculatorAddParameterizedTest(double operandOne, double operandTwo,\n            double expectedResult) {\n\n        mOperandOne = operandOne;\n        mOperandTwo = operandTwo;\n        mExpectedResult = expectedResult;\n    }\n\n    @Before\n    public void setUp() {\n        mCalculator = new Calculator();\n    }\n\n    @Test\n    public void testAdd_TwoNumbers() {\n        double resultAdd = mCalculator.add(mOperandOne, mOperandTwo);\n        assertThat(resultAdd).isEqualTo(mExpectedResult);\n    }\n}"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/app/src/androidTest/java/com/example/android/testing/androidtestorchestratorsample/CalculatorInstrumentationTest.java",
    "content": "/*\n * Copyright 2020, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidtestorchestratorsample;\n\nimport androidx.test.platform.graphics.HardwareRendererCompat;\nimport junit.framework.TestSuite;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.internal.builders.AllDefaultPossibilitiesBuilder;\nimport org.junit.runner.RunWith;\n\nimport androidx.test.core.app.ActivityScenario;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.filters.LargeTest;\nimport androidx.test.runner.AndroidJUnitRunner;\n\nimport static androidx.test.core.app.ApplicationProvider.getApplicationContext;\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.action.ViewActions.click;\nimport static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;\nimport static androidx.test.espresso.action.ViewActions.typeText;\nimport static androidx.test.espresso.assertion.ViewAssertions.matches;\nimport static androidx.test.espresso.matcher.ViewMatchers.withId;\nimport static androidx.test.espresso.matcher.ViewMatchers.withText;\n\n/**\n * JUnit4 Ui Tests for {@link CalculatorActivity} using the {@link AndroidJUnitRunner} with the\n * Android Test Orchestrator.\n * This class uses the JUnit4 syntax for tests.\n * <p>\n * With the new AndroidJUnit runner you can run both JUnit3 and JUnit4 tests in a single test\n * suite. The {@link AndroidRunnerBuilder} which extends JUnit's\n * {@link AllDefaultPossibilitiesBuilder} will create a single {@link\n * TestSuite} from all tests and run them.\n */\n@RunWith(AndroidJUnit4.class)\n@LargeTest\npublic class CalculatorInstrumentationTest {\n\n    /**\n     * Use {@link ActivityScenario} to create and launch of the activity.\n     */\n    @Before\n    public void launchActivity() {\n        ActivityScenario.launch(CalculatorActivity.class);\n    }\n\n    @Test\n    public void noOperandShowsComputationError() {\n        final String expectedResult = getApplicationContext().getString(R.string.computationError);\n        onView(withId(R.id.operation_add_btn)).perform(click());\n        onView(withId(R.id.operation_result_text_view)).check(matches(withText(expectedResult)));\n    }\n\n    @Test\n    public void typeOperandsAndPerformAddOperation() {\n        performOperation(R.id.operation_add_btn, \"16.0\", \"16.0\", \"32.0\");\n    }\n\n    @Test\n    public void typeOperandsAndPerformSubOperation() {\n        performOperation(R.id.operation_sub_btn, \"32.0\", \"16.0\", \"16.0\");\n    }\n\n    @Test\n    public void typeOperandsAndPerformDivOperation() {\n        performOperation(R.id.operation_div_btn, \"128.0\", \"16.0\", \"8.0\");\n    }\n\n    @Test\n    public void divZeroForOperandTwoShowsError() {\n        final String expectedResult = getApplicationContext().getString(R.string.computationError);\n        performOperation(R.id.operation_div_btn, \"128.0\", \"0.0\", expectedResult);\n    }\n\n    @Test\n    public void typeOperandsAndPerformMulOperation() {\n        performOperation(R.id.operation_mul_btn, \"16.0\", \"16.0\", \"256.0\");\n    }\n\n    private void performOperation(int btnOperationResId, String operandOne,\n            String operandTwo, String expectedResult) {\n        // Type the two operands in the EditText fields\n        onView(withId(R.id.operand_one_edit_text)).perform(typeText(operandOne),\n                closeSoftKeyboard());\n        onView(withId(R.id.operand_two_edit_text)).perform(typeText(operandTwo),\n                closeSoftKeyboard());\n\n        // Click on a given operation button\n        onView(withId(btnOperationResId)).perform(click());\n\n        // Check the expected test is displayed in the Ui\n        onView(withId(R.id.operation_result_text_view)).check(matches(withText(expectedResult)));\n    }\n\n}\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2020 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\".CalculatorActivity\"\n            android:label=\"@string/app_name\"\n            android:exported=\"true\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/app/src/main/java/com/example/android/testing/androidtestorchestratorsample/Calculator.java",
    "content": "/*\n * Copyright 2020, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidtestorchestratorsample;\n\nimport static com.google.common.base.Preconditions.checkArgument;\n\n/**\n * A simple calculator with a basic set of operations.\n */\npublic class Calculator {\n\n    public enum Operator {ADD, SUB, DIV, MUL}\n\n    /**\n     * Addition operation\n     */\n    public double add(double firstOperand, double secondOperand) {\n        return firstOperand + secondOperand;\n    }\n\n    /**\n     * Substract operation\n     */\n    public double sub(double firstOperand, double secondOperand) {\n        return firstOperand - secondOperand;\n    }\n\n    /**\n     * Divide operation\n     */\n    public double div(double firstOperand, double secondOperand) {\n        checkArgument(secondOperand != 0, \"secondOperand must be != 0, you cannot divide by zero\");\n        return firstOperand / secondOperand;\n    }\n\n    /**\n     * Multiply operation\n     */\n    public double mul(double firstOperand, double secondOperand) {\n\n        return firstOperand * secondOperand;\n    }\n}\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/app/src/main/java/com/example/android/testing/androidtestorchestratorsample/CalculatorActivity.java",
    "content": "/*\n * Copyright 2020, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidtestorchestratorsample;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.text.TextUtils;\nimport android.util.Log;\nimport android.view.View;\nimport android.widget.Button;\nimport android.widget.EditText;\nimport android.widget.TextView;\n\n/**\n * {@link android.app.Activity} which contains a simple calculator. Numbers can be entered in the\n * two {@link EditText} fields and result can be obtained by pressing one of the\n * operation {@link Button}s at the bottom.\n */\npublic class CalculatorActivity extends Activity {\n\n    private static final String TAG = \"CalculatorActivity\";\n\n    private Calculator mCalculator;\n\n    private EditText mOperandOneEditText;\n    private EditText mOperandTwoEditText;\n\n    private TextView mResultTextView;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_calculator);\n        mCalculator = new Calculator();\n        mResultTextView = (TextView) findViewById(R.id.operation_result_text_view);\n        mOperandOneEditText = (EditText) findViewById(R.id.operand_one_edit_text);\n        mOperandTwoEditText = (EditText) findViewById(R.id.operand_two_edit_text);\n    }\n\n    /**\n     * OnClick method that is called when the add {@link Button} is pressed.\n     */\n    public void onAdd(View view) {\n        compute(Calculator.Operator.ADD);\n    }\n\n    /**\n     * OnClick method that is called when the substract {@link Button} is pressed.\n     */\n    public void onSub(View view) {\n        compute(Calculator.Operator.SUB);\n    }\n\n    /**\n     * OnClick method that is called when the divide {@link Button} is pressed.\n     */\n    public void onDiv(View view) {\n        try {\n            compute(Calculator.Operator.DIV);\n        } catch (IllegalArgumentException iae) {\n            Log.e(TAG, \"IllegalArgumentException\", iae);\n            mResultTextView.setText(getString(R.string.computationError));\n        }\n    }\n\n    /**\n     * OnClick method that is called when the multiply {@link Button} is pressed.\n     */\n    public void onMul(View view) {\n        compute(Calculator.Operator.MUL);\n    }\n\n    private void compute(Calculator.Operator operator) {\n        double operandOne;\n        double operandTwo;\n        try {\n            operandOne = getOperand(mOperandOneEditText);\n            operandTwo = getOperand(mOperandTwoEditText);\n        } catch (NumberFormatException nfe) {\n            Log.e(TAG, \"NumberFormatException\", nfe);\n            mResultTextView.setText(getString(R.string.computationError));\n            return;\n        }\n\n        String result;\n        switch (operator) {\n            case ADD:\n                result = String.valueOf(mCalculator.add(operandOne, operandTwo));\n                break;\n            case SUB:\n                result = String.valueOf(mCalculator.sub(operandOne, operandTwo));\n                break;\n            case DIV:\n                result = String.valueOf(mCalculator.div(operandOne, operandTwo));\n                break;\n            case MUL:\n                result = String.valueOf(mCalculator.mul(operandOne, operandTwo));\n                break;\n            default:\n                result = getString(R.string.computationError);\n                break;\n        }\n        mResultTextView.setText(result);\n    }\n\n    /**\n     * @return the operand value which was entered in an {@link EditText} as a double\n     */\n    private static Double getOperand(EditText operandEditText) {\n        String operandText = getOperandText(operandEditText);\n        return Double.valueOf(operandText);\n    }\n\n    /**\n     * @return the operand text which was entered in an {@link EditText}.\n     */\n    private static String getOperandText(EditText operandEditText) {\n        String operandText = operandEditText.getText().toString();\n        if (TextUtils.isEmpty(operandText)) {\n            throw new NumberFormatException(\"operand cannot be empty!\");\n        }\n        return operandText;\n    }\n}\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/app/src/main/res/layout/activity_calculator.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2020 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n    android:paddingRight=\"@dimen/activity_horizontal_margin\"\n    android:paddingTop=\"@dimen/activity_vertical_margin\"\n    android:paddingBottom=\"@dimen/activity_vertical_margin\"\n    android:orientation=\"vertical\"\n    tools:context=\".CalculatorActivity\">\n\n    <EditText android:id=\"@+id/operand_one_edit_text\"\n        android:hint=\"@string/type_operand_one_hint\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:inputType=\"numberDecimal\"/>\n\n    <EditText android:id=\"@+id/operand_two_edit_text\"\n        android:hint=\"@string/type_operant_two_hint\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:inputType=\"numberDecimal\"/>\n\n    <RelativeLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\">\n\n        <Button android:id=\"@+id/operation_add_btn\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/add_operation_text\"\n            android:onClick=\"onAdd\"/>\n\n        <Button android:id=\"@+id/operation_sub_btn\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/sub_operation_text\"\n            android:layout_toRightOf=\"@id/operation_add_btn\"\n            android:layout_toEndOf=\"@id/operation_add_btn\"\n            android:onClick=\"onSub\"/>\n\n        <Button android:id=\"@+id/operation_div_btn\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/div_operation_text\"\n            android:layout_below=\"@id/operation_add_btn\"\n            android:onClick=\"onDiv\"/>\n\n        <Button android:id=\"@+id/operation_mul_btn\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/mul_operation_text\"\n            android:layout_below=\"@id/operation_add_btn\"\n            android:layout_toRightOf=\"@id/operation_add_btn\"\n            android:layout_toEndOf=\"@id/operation_add_btn\"\n            android:onClick=\"onMul\"/>\n\n    </RelativeLayout>\n\n    <TextView android:id=\"@+id/operation_result_text_view\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"@dimen/activity_vertical_margin\"/>\n\n</LinearLayout>\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2020 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2020 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n\n    <string name=\"app_name\">AndroidTestOrchestratorSample</string>\n    <string name=\"type_operand_one_hint\">Type Operand 1</string>\n    <string name=\"type_operant_two_hint\">Type Operand 2</string>\n    <string name=\"add_operation_text\">Add</string>\n    <string name=\"sub_operation_text\">Sub</string>\n    <string name=\"div_operation_text\">Div</string>\n    <string name=\"mul_operation_text\">Mul</string>\n    <string name=\"computationError\">Error</string>\n\n</resources>\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2020 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Black\"/>\n</resources>\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/app/src/main/res/values-v14/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2020 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Holo\"/>\n</resources>\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2020 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <style name=\"AppTheme\" parent=\"android:ThemeOverlay.Material.Dark\"/>\n</resources>\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2020 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    androidxAnnotationVersion = \"1.5.0\"\n    guavaVersion = \"31.1-android\"\n    coreVersion = \"1.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    runnerVersion = \"1.6.1\"\n    monitorVersion = \"1.7.1\"\n    rulesVersion = \"1.6.1\"\n    espressoVersion = \"3.6.1\"\n    orchestratorVersion = \"1.5.0\"\n    truthVersion = \"1.1.3\"\n}\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonFinalResIds=false\nandroid.nonTransitiveRClass=false\nandroid.useAndroidX=true\nandroid.useAndroidX=true"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorSample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/.gitignore",
    "content": ".gradle\n/local.properties\n.idea\n*.iml\n.DS_Store\nbuild\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/README.md",
    "content": "# AndroidTestOrchestrator with test coverage sample\n\nThe Android Test Orchestrator allows you to run each of your app's tests in isolation, enabling greater reliability.\nSee https://developer.android.com/training/testing/junit-runner#using-android-test-orchestrator for more background.\n\nThis sample is a subset of the AndroidJUnitRunner sample, but it\nillustrates how to enable Jacoco test coverage report with the Android Test Orchestrator in the app/build.gradle file.\n\nThis project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio is recommended.\n\n1. Download the project code, preferably using `git clone`.\n1. Open the Android SDK Manager (*Tools* Menu | *Android*).\n1. In Android Studio, select *File* | *Open...* and point to the top-level `./build.gradle` file.\n1. Check out the relevant code:\n    * The application under test is located in `src/main/java`\n    * Tests are in `src/androidTest/java`\n1. Connect a device or start an emulator:\n    * Turn animations off.\n    (On your device, under Settings->Developer options disable the following 3 settings: \"Window animation scale\", \"Transition animation scale\" and \"Animator duration scale\")\n1. Run the newly created configuration.\n\nThe application will be started on the device/emulator and a series of actions will be performed automatically.\n\nIf you are using Android Studio, the *Run* window will show the test results.\nThe test coverage report will be generated in `app/build/reports/coverage/androidTest/debug/index.html`.\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\nandroid {\n    compileSdk 33\n    defaultConfig {\n        applicationId \"com.example.android.testing.androidtestorchestratorsample\"\n        minSdkVersion 14\n        targetSdkVersion 33\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n        testInstrumentationRunnerArguments clearPackageData: \"true\"\n        testInstrumentationRunnerArguments useTestStorageService: \"true\"\n    }\n    buildTypes {\n        debug {\n            testCoverageEnabled true\n        }\n    }\n    testOptions {\n        execution \"ANDROIDX_TEST_ORCHESTRATOR\"\n    }\n    namespace \"com.example.android.testing.androidtestorchestratorsample\"\n}\n\ndependencies {\n    // App's dependencies, including test\n    implementation \"androidx.annotation:annotation:\" + rootProject.androidxAnnotationVersion\n    implementation \"com.google.guava:guava:\" + rootProject.guavaVersion\n\n    // Testing-only dependencies\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion\n    androidTestImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion\n    androidTestImplementation \"com.google.truth:truth:\" + rootProject.truthVersion;\n    androidTestUtil \"androidx.test:orchestrator:\" + rootProject.orchestratorVersion\n    androidTestUtil \"androidx.test.services:test-services:\" + rootProject.testServicesVersion\n\n}\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/app/src/androidTest/java/com/example/android/testing/androidtestorchestratorsample/CalculatorAddParameterizedTest.java",
    "content": "/*\n * Copyright 2020, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidtestorchestratorsample;\n\nimport static com.google.common.truth.Truth.assertThat;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.junit.runners.Parameterized;\n\nimport androidx.test.filters.SmallTest;\n\nimport java.lang.Iterable;\nimport java.util.Arrays;\n\nimport static org.junit.runners.Parameterized.Parameters;\n\n\n/**\n * JUnit4 tests for the calculator's add logic.\n *\n * <p> This test uses a Junit4s Parameterized tests features which uses annotations to pass\n * parameters into a unit test. The way this works is that you have to use the {@link Parameterized}\n * runner to run your tests.\n * </p>\n */\n@RunWith(Parameterized.class)\n@SmallTest\npublic class CalculatorAddParameterizedTest {\n\n    /**\n     * @return {@link Iterable} that contains the values that should be passed to the constructor.\n     * In this example we are going to use three parameters: operand one, operand two and the\n     * expected result.\n     */\n    @Parameters\n    public static Iterable<Object[]> data() {\n        return Arrays.asList(new Object[][]{\n                {0, 0, 0},\n                {0, -1, -1},\n                {2, 2, 4},\n                {8, 8, 16},\n                {16, 16, 32},\n                {32, 0, 32},\n                {64, 64, 128}});\n    }\n\n    private final double mOperandOne;\n    private final double mOperandTwo;\n    private final double mExpectedResult;\n\n    private Calculator mCalculator;\n\n    /**\n     * Constructor that takes in the values specified in\n     * {@link CalculatorAddParameterizedTest#data()}. The values need to be saved to fields in order\n     * to reuse them in your tests.\n     */\n    public CalculatorAddParameterizedTest(double operandOne, double operandTwo,\n            double expectedResult) {\n\n        mOperandOne = operandOne;\n        mOperandTwo = operandTwo;\n        mExpectedResult = expectedResult;\n    }\n\n    @Before\n    public void setUp() {\n        mCalculator = new Calculator();\n    }\n\n    @Test\n    public void testAdd_TwoNumbers() {\n        double resultAdd = mCalculator.add(mOperandOne, mOperandTwo);\n        assertThat(resultAdd).isEqualTo(mExpectedResult);\n    }\n}"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/app/src/androidTest/java/com/example/android/testing/androidtestorchestratorsample/CalculatorInstrumentationTest.java",
    "content": "/*\n * Copyright 2020, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidtestorchestratorsample;\n\nimport junit.framework.TestSuite;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.internal.builders.AllDefaultPossibilitiesBuilder;\nimport org.junit.runner.RunWith;\n\nimport androidx.test.core.app.ActivityScenario;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.filters.LargeTest;\nimport androidx.test.runner.AndroidJUnitRunner;\n\nimport static androidx.test.core.app.ApplicationProvider.getApplicationContext;\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.action.ViewActions.click;\nimport static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;\nimport static androidx.test.espresso.action.ViewActions.typeText;\nimport static androidx.test.espresso.assertion.ViewAssertions.matches;\nimport static androidx.test.espresso.matcher.ViewMatchers.withId;\nimport static androidx.test.espresso.matcher.ViewMatchers.withText;\n\n/**\n * JUnit4 Ui Tests for {@link CalculatorActivity} using the {@link AndroidJUnitRunner} with the\n * Android Test Orchestrator.\n * This class uses the JUnit4 syntax for tests.\n * <p>\n * With the new AndroidJUnit runner you can run both JUnit3 and JUnit4 tests in a single test\n * suite. The {@link AndroidRunnerBuilder} which extends JUnit's\n * {@link AllDefaultPossibilitiesBuilder} will create a single {@link\n * TestSuite} from all tests and run them.\n */\n@RunWith(AndroidJUnit4.class)\n@LargeTest\npublic class CalculatorInstrumentationTest {\n\n    /**\n     * Use {@link ActivityScenario} to create and launch of the activity.\n     */\n    @Before\n    public void launchActivity() {\n        ActivityScenario.launch(CalculatorActivity.class);\n    }\n\n    @Test\n    public void noOperandShowsComputationError() {\n        final String expectedResult = getApplicationContext().getString(R.string.computationError);\n        onView(withId(R.id.operation_add_btn)).perform(click());\n        onView(withId(R.id.operation_result_text_view)).check(matches(withText(expectedResult)));\n    }\n\n    @Test\n    public void typeOperandsAndPerformAddOperation() {\n        performOperation(R.id.operation_add_btn, \"16.0\", \"16.0\", \"32.0\");\n    }\n\n    @Test\n    public void typeOperandsAndPerformSubOperation() {\n        performOperation(R.id.operation_sub_btn, \"32.0\", \"16.0\", \"16.0\");\n    }\n\n    @Test\n    public void typeOperandsAndPerformDivOperation() {\n        performOperation(R.id.operation_div_btn, \"128.0\", \"16.0\", \"8.0\");\n    }\n\n    @Test\n    public void divZeroForOperandTwoShowsError() {\n        final String expectedResult = getApplicationContext().getString(R.string.computationError);\n        performOperation(R.id.operation_div_btn, \"128.0\", \"0.0\", expectedResult);\n    }\n\n    @Test\n    public void typeOperandsAndPerformMulOperation() {\n        performOperation(R.id.operation_mul_btn, \"16.0\", \"16.0\", \"256.0\");\n    }\n\n    private void performOperation(int btnOperationResId, String operandOne,\n            String operandTwo, String expectedResult) {\n        // Type the two operands in the EditText fields\n        onView(withId(R.id.operand_one_edit_text)).perform(typeText(operandOne),\n                closeSoftKeyboard());\n        onView(withId(R.id.operand_two_edit_text)).perform(typeText(operandTwo),\n                closeSoftKeyboard());\n\n        // Click on a given operation button\n        onView(withId(btnOperationResId)).perform(click());\n\n        // Check the expected test is displayed in the Ui\n        onView(withId(R.id.operation_result_text_view)).check(matches(withText(expectedResult)));\n    }\n\n}\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2020 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\".CalculatorActivity\"\n            android:label=\"@string/app_name\"\n            android:exported=\"true\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/app/src/main/java/com/example/android/testing/androidtestorchestratorsample/Calculator.java",
    "content": "/*\n * Copyright 2020, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidtestorchestratorsample;\n\nimport static com.google.common.base.Preconditions.checkArgument;\n\n/**\n * A simple calculator with a basic set of operations.\n */\npublic class Calculator {\n\n    public enum Operator {ADD, SUB, DIV, MUL}\n\n    /**\n     * Addition operation\n     */\n    public double add(double firstOperand, double secondOperand) {\n        return firstOperand + secondOperand;\n    }\n\n    /**\n     * Substract operation\n     */\n    public double sub(double firstOperand, double secondOperand) {\n        return firstOperand - secondOperand;\n    }\n\n    /**\n     * Divide operation\n     */\n    public double div(double firstOperand, double secondOperand) {\n        checkArgument(secondOperand != 0, \"secondOperand must be != 0, you cannot divide by zero\");\n        return firstOperand / secondOperand;\n    }\n\n    /**\n     * Multiply operation\n     */\n    public double mul(double firstOperand, double secondOperand) {\n\n        return firstOperand * secondOperand;\n    }\n}\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/app/src/main/java/com/example/android/testing/androidtestorchestratorsample/CalculatorActivity.java",
    "content": "/*\n * Copyright 2020, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.androidtestorchestratorsample;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.text.TextUtils;\nimport android.util.Log;\nimport android.view.View;\nimport android.widget.Button;\nimport android.widget.EditText;\nimport android.widget.TextView;\n\n/**\n * {@link android.app.Activity} which contains a simple calculator. Numbers can be entered in the\n * two {@link EditText} fields and result can be obtained by pressing one of the\n * operation {@link Button}s at the bottom.\n */\npublic class CalculatorActivity extends Activity {\n\n    private static final String TAG = \"CalculatorActivity\";\n\n    private Calculator mCalculator;\n\n    private EditText mOperandOneEditText;\n    private EditText mOperandTwoEditText;\n\n    private TextView mResultTextView;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_calculator);\n        mCalculator = new Calculator();\n        mResultTextView = (TextView) findViewById(R.id.operation_result_text_view);\n        mOperandOneEditText = (EditText) findViewById(R.id.operand_one_edit_text);\n        mOperandTwoEditText = (EditText) findViewById(R.id.operand_two_edit_text);\n    }\n\n    /**\n     * OnClick method that is called when the add {@link Button} is pressed.\n     */\n    public void onAdd(View view) {\n        compute(Calculator.Operator.ADD);\n    }\n\n    /**\n     * OnClick method that is called when the substract {@link Button} is pressed.\n     */\n    public void onSub(View view) {\n        compute(Calculator.Operator.SUB);\n    }\n\n    /**\n     * OnClick method that is called when the divide {@link Button} is pressed.\n     */\n    public void onDiv(View view) {\n        try {\n            compute(Calculator.Operator.DIV);\n        } catch (IllegalArgumentException iae) {\n            Log.e(TAG, \"IllegalArgumentException\", iae);\n            mResultTextView.setText(getString(R.string.computationError));\n        }\n    }\n\n    /**\n     * OnClick method that is called when the multiply {@link Button} is pressed.\n     */\n    public void onMul(View view) {\n        compute(Calculator.Operator.MUL);\n    }\n\n    private void compute(Calculator.Operator operator) {\n        double operandOne;\n        double operandTwo;\n        try {\n            operandOne = getOperand(mOperandOneEditText);\n            operandTwo = getOperand(mOperandTwoEditText);\n        } catch (NumberFormatException nfe) {\n            Log.e(TAG, \"NumberFormatException\", nfe);\n            mResultTextView.setText(getString(R.string.computationError));\n            return;\n        }\n\n        String result;\n        switch (operator) {\n            case ADD:\n                result = String.valueOf(mCalculator.add(operandOne, operandTwo));\n                break;\n            case SUB:\n                result = String.valueOf(mCalculator.sub(operandOne, operandTwo));\n                break;\n            case DIV:\n                result = String.valueOf(mCalculator.div(operandOne, operandTwo));\n                break;\n            case MUL:\n                result = String.valueOf(mCalculator.mul(operandOne, operandTwo));\n                break;\n            default:\n                result = getString(R.string.computationError);\n                break;\n        }\n        mResultTextView.setText(result);\n    }\n\n    /**\n     * @return the operand value which was entered in an {@link EditText} as a double\n     */\n    private static Double getOperand(EditText operandEditText) {\n        String operandText = getOperandText(operandEditText);\n        return Double.valueOf(operandText);\n    }\n\n    /**\n     * @return the operand text which was entered in an {@link EditText}.\n     */\n    private static String getOperandText(EditText operandEditText) {\n        String operandText = operandEditText.getText().toString();\n        if (TextUtils.isEmpty(operandText)) {\n            throw new NumberFormatException(\"operand cannot be empty!\");\n        }\n        return operandText;\n    }\n}\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/app/src/main/res/layout/activity_calculator.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2020 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n    android:paddingRight=\"@dimen/activity_horizontal_margin\"\n    android:paddingTop=\"@dimen/activity_vertical_margin\"\n    android:paddingBottom=\"@dimen/activity_vertical_margin\"\n    android:orientation=\"vertical\"\n    tools:context=\".CalculatorActivity\">\n\n    <EditText android:id=\"@+id/operand_one_edit_text\"\n        android:hint=\"@string/type_operand_one_hint\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:inputType=\"numberDecimal\"/>\n\n    <EditText android:id=\"@+id/operand_two_edit_text\"\n        android:hint=\"@string/type_operant_two_hint\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:inputType=\"numberDecimal\"/>\n\n    <RelativeLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\">\n\n        <Button android:id=\"@+id/operation_add_btn\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/add_operation_text\"\n            android:onClick=\"onAdd\"/>\n\n        <Button android:id=\"@+id/operation_sub_btn\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/sub_operation_text\"\n            android:layout_toRightOf=\"@id/operation_add_btn\"\n            android:layout_toEndOf=\"@id/operation_add_btn\"\n            android:onClick=\"onSub\"/>\n\n        <Button android:id=\"@+id/operation_div_btn\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/div_operation_text\"\n            android:layout_below=\"@id/operation_add_btn\"\n            android:onClick=\"onDiv\"/>\n\n        <Button android:id=\"@+id/operation_mul_btn\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/mul_operation_text\"\n            android:layout_below=\"@id/operation_add_btn\"\n            android:layout_toRightOf=\"@id/operation_add_btn\"\n            android:layout_toEndOf=\"@id/operation_add_btn\"\n            android:onClick=\"onMul\"/>\n\n    </RelativeLayout>\n\n    <TextView android:id=\"@+id/operation_result_text_view\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"@dimen/activity_vertical_margin\"/>\n\n</LinearLayout>\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2020 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2020 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n\n    <string name=\"app_name\">AndroidTestOrchestratorSample</string>\n    <string name=\"type_operand_one_hint\">Type Operand 1</string>\n    <string name=\"type_operant_two_hint\">Type Operand 2</string>\n    <string name=\"add_operation_text\">Add</string>\n    <string name=\"sub_operation_text\">Sub</string>\n    <string name=\"div_operation_text\">Div</string>\n    <string name=\"mul_operation_text\">Mul</string>\n    <string name=\"computationError\">Error</string>\n\n</resources>\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2020 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Black\"/>\n</resources>\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/app/src/main/res/values-v14/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2020 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Holo\"/>\n</resources>\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2020 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <style name=\"AppTheme\" parent=\"android:ThemeOverlay.Material.Dark\"/>\n</resources>\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  Copyright 2020 The Android Open Source Project\n\n  Licensed under the Apache License, Version 2.0 (the \"License\");\n  you may not use this file except in compliance with the License.\n  You may obtain a copy of the License at\n\n      http://www.apache.org/licenses/LICENSE-2.0\n\n  Unless required by applicable law or agreed to in writing, software\n  distributed under the License is distributed on an \"AS IS\" BASIS,\n  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  See the License for the specific language governing permissions and\n  limitations under the License.\n  -->\n\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.agpVersion = \"8.1.1\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    androidxAnnotationVersion = \"1.2.0\"\n    guavaVersion = \"30.1.1-android\"\n    coreVersion = \"1.6.0-alpha01\"\n    extJUnitVersion = \"1.2.0-alpha01\"\n    runnerVersion = \"1.6.0-alpha03\"\n    rulesVersion = \"1.6.0-alpha01\"\n    testServicesVersion = \"1.5.0-alpha01\"\n    orchestratorVersion = \"1.5.0-alpha01\"\n    espressoVersion = \"3.6.0-alpha01\"\n    truthVersion = \"1.1.3\"\n}\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "#Wed Jun 01 11:09:45 PDT 2022\ndistributionBase=GRADLE_USER_HOME\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.useAndroidX=true\nandroid.enableAdditionalTestOutput=false\nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonTransitiveRClass=false\nandroid.nonFinalResIds=false"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "runner/AndroidTestOrchestratorWithTestCoverageSample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "test_all.sh",
    "content": "#!/bin/bash\n\nset -e  # Exit immediately if a command exits with a non-zero status.\n\nfor p in $(cat projects.conf); do\n   echo\n   echo\n   echo Running unit and Android tests in $p\n   echo \"=====================================================================\"\n\n   pushd $p > /dev/null  # Silent pushd\n   ./gradlew $@ testDebug nexusOneApi30DebugAndroidTest --info --no-watch-fs | sed \"s@^@$p @\"  # Prefix every line with directory\n   code=${PIPESTATUS[0]}\n   if [ \"$code\" -ne \"0\" ]; then\n       exit $code\n   fi\n   popd > /dev/null  # Silent popd\ndone\n\necho\necho \"ALL TESTS PASS\"\n"
  },
  {
    "path": "ui/PreviewScreenshot/.gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/caches\n/.idea/libraries\n/.idea/modules.xml\n/.idea/workspace.xml\n/.idea/navEditor.xml\n/.idea/assetWizardSettings.xml\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n.cxx\nlocal.properties\n"
  },
  {
    "path": "ui/PreviewScreenshot/README.md",
    "content": "# Compose Preview Screenshot Testing tool\n\nExperimental: Compose Preview Screenshot Testing is still in development. Its\nfeatures and APIs are subject to change substantially during the alpha phase.\nReport any feedback and issues through the [issue tracker](https://d.android.com/studio/report-bugs).\n\nSee [Compose Preview Screenshot Testing](https://d.android.com/studio/preview/compose-screenshot-testing).\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/.gitignore",
    "content": "/build"
  },
  {
    "path": "ui/PreviewScreenshot/app/build.gradle.kts",
    "content": "/*\n * Copyright (C) 2024 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nplugins {\n    alias(libs.plugins.android.application)\n    alias(libs.plugins.jetbrains.kotlin.android)\n    alias(libs.plugins.screenshot)\n}\n\nandroid {\n    namespace = \"com.example.compose.previewscreenshot\"\n    compileSdk = 34\n\n    defaultConfig {\n        applicationId = \"com.example.compose.previewscreenshot\"\n        minSdk = 24\n        targetSdk = 34\n        versionCode = 1\n        versionName = \"1.0\"\n\n        testInstrumentationRunner = \"androidx.test.runner.AndroidJUnitRunner\"\n        vectorDrawables {\n            useSupportLibrary = true\n        }\n    }\n\n    buildTypes {\n        release {\n            isMinifyEnabled = false\n            proguardFiles(\n                getDefaultProguardFile(\"proguard-android-optimize.txt\"),\n                \"proguard-rules.pro\"\n            )\n        }\n    }\n    compileOptions {\n        sourceCompatibility = JavaVersion.VERSION_1_8\n        targetCompatibility = JavaVersion.VERSION_1_8\n    }\n    kotlinOptions {\n        jvmTarget = \"1.8\"\n    }\n    buildFeatures {\n        compose = true\n    }\n    composeOptions {\n        kotlinCompilerExtensionVersion = \"1.5.13\"\n    }\n\n    experimentalProperties[\"android.experimental.enableScreenshotTest\"] = true\n\n    packaging {\n        resources {\n            excludes += \"/META-INF/{AL2.0,LGPL2.1}\"\n        }\n    }\n}\n\ndependencies {\n\n    implementation(libs.androidx.core.ktx)\n    implementation(libs.androidx.lifecycle.runtime.ktx)\n    implementation(libs.androidx.activity.compose)\n    implementation(platform(libs.androidx.compose.bom))\n    implementation(libs.androidx.ui)\n    implementation(libs.androidx.ui.graphics)\n    implementation(libs.androidx.ui.tooling.preview)\n    implementation(libs.androidx.material3)\n    testImplementation(libs.junit)\n    androidTestImplementation(libs.androidx.junit)\n    androidTestImplementation(libs.androidx.espresso.core)\n    androidTestImplementation(platform(libs.androidx.compose.bom))\n    androidTestImplementation(libs.androidx.ui.test.junit4)\n    debugImplementation(libs.androidx.ui.tooling)\n    debugImplementation(libs.androidx.ui.test.manifest)\n}\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguardFiles setting in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n\n# Uncomment this to preserve the line number information for\n# debugging stack traces.\n#-keepattributes SourceFile,LineNumberTable\n\n# If you keep the line number information, uncomment this to\n# hide the original source file name.\n#-renamesourcefileattribute SourceFile"
  },
  {
    "path": "ui/PreviewScreenshot/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2024 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\">\n\n    <application\n        android:allowBackup=\"false\"\n        android:dataExtractionRules=\"@xml/data_extraction_rules\"\n        android:fullBackupContent=\"@xml/backup_rules\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:roundIcon=\"@mipmap/ic_launcher_round\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/Theme.ComposePreviewScreenshotTestingSample\"\n        tools:targetApi=\"31\">\n        <activity\n            android:name=\".MainActivity\"\n            android:exported=\"true\"\n            android:label=\"@string/app_name\"\n            android:theme=\"@style/Theme.ComposePreviewScreenshotTestingSample\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/src/main/java/com/example/compose/previewscreenshot/MainActivity.kt",
    "content": "/*\n * Copyright (C) 2024 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.                            \n */\n\npackage com.example.compose.previewscreenshot\n\nimport android.content.res.Configuration\nimport android.os.Bundle\nimport androidx.activity.ComponentActivity\nimport androidx.activity.compose.setContent\nimport androidx.activity.enableEdgeToEdge\nimport androidx.compose.foundation.layout.fillMaxSize\nimport androidx.compose.foundation.layout.padding\nimport androidx.compose.material3.Scaffold\nimport androidx.compose.material3.Surface\nimport androidx.compose.material3.Text\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.Modifier\nimport androidx.compose.ui.res.stringResource\nimport androidx.compose.ui.tooling.preview.Preview\nimport com.example.compose.previewscreenshot.ui.theme.SampleTheme\n\nclass MainActivity : ComponentActivity() {\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        enableEdgeToEdge()\n        setContent {\n            SampleTheme {\n                Scaffold(modifier = Modifier.fillMaxSize()) { innerPadding ->\n                    Greeting(\n                        modifier = Modifier.padding(innerPadding)\n                    )\n                }\n            }\n        }\n    }\n}\n\n@Composable\nfun Greeting(modifier: Modifier = Modifier) {\n    Surface {\n        Text(\n            text = stringResource(id = R.string.greeting),\n            modifier = modifier\n        )\n    }\n}\n\n@Preview(showBackground = true)\n@Preview(showBackground = true, locale = \"es\")\n@Preview(showBackground = true, name = \"Dark\" , uiMode = Configuration.UI_MODE_NIGHT_YES)\n@Composable\nfun GreetingPreview() {\n    SampleTheme {\n        Greeting()\n    }\n}\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/src/main/java/com/example/compose/previewscreenshot/ui/theme/Color.kt",
    "content": "/*\n * Copyright (C) 2024 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.compose.previewscreenshot.ui.theme\n\nimport androidx.compose.ui.graphics.Color\n\nval Purple80 = Color(0xFFD0BCFF)\nval PurpleGrey80 = Color(0xFFCCC2DC)\nval Pink80 = Color(0xFFEFB8C8)\n\nval Purple40 = Color(0xFF6650a4)\nval PurpleGrey40 = Color(0xFF625b71)\nval Pink40 = Color(0xFF7D5260)\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/src/main/java/com/example/compose/previewscreenshot/ui/theme/Theme.kt",
    "content": "/*\n * Copyright (C) 2024 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.compose.previewscreenshot.ui.theme\n\nimport android.os.Build\nimport androidx.compose.foundation.isSystemInDarkTheme\nimport androidx.compose.material3.MaterialTheme\nimport androidx.compose.material3.darkColorScheme\nimport androidx.compose.material3.dynamicDarkColorScheme\nimport androidx.compose.material3.dynamicLightColorScheme\nimport androidx.compose.material3.lightColorScheme\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.platform.LocalContext\n\nprivate val DarkColorScheme = darkColorScheme(\n    primary = Purple80,\n    secondary = PurpleGrey80,\n    tertiary = Pink80\n)\n\nprivate val LightColorScheme = lightColorScheme(\n    primary = Purple40,\n    secondary = PurpleGrey40,\n    tertiary = Pink40\n\n    /* Other default colors to override\n    background = Color(0xFFFFFBFE),\n    surface = Color(0xFFFFFBFE),\n    onPrimary = Color.White,\n    onSecondary = Color.White,\n    onTertiary = Color.White,\n    onBackground = Color(0xFF1C1B1F),\n    onSurface = Color(0xFF1C1B1F),\n    */\n)\n\n@Composable\nfun SampleTheme(\n    darkTheme: Boolean = isSystemInDarkTheme(),\n    // Dynamic color is available on Android 12+\n    dynamicColor: Boolean = true,\n    content: @Composable () -> Unit\n) {\n    val colorScheme = when {\n        dynamicColor && Build.VERSION.SDK_INT >= Build.VERSION_CODES.S -> {\n            val context = LocalContext.current\n            if (darkTheme) dynamicDarkColorScheme(context) else dynamicLightColorScheme(context)\n        }\n\n        darkTheme -> DarkColorScheme\n        else -> LightColorScheme\n    }\n\n    MaterialTheme(\n        colorScheme = colorScheme,\n        typography = Typography,\n        content = content\n    )\n}\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/src/main/java/com/example/compose/previewscreenshot/ui/theme/Type.kt",
    "content": "/*\n * Copyright (C) 2024 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.compose.previewscreenshot.ui.theme\n\nimport androidx.compose.material3.Typography\nimport androidx.compose.ui.text.TextStyle\nimport androidx.compose.ui.text.font.FontFamily\nimport androidx.compose.ui.text.font.FontWeight\nimport androidx.compose.ui.unit.sp\n\n// Set of Material typography styles to start with\nval Typography = Typography(\n    bodyLarge = TextStyle(\n        fontFamily = FontFamily.Default,\n        fontWeight = FontWeight.Normal,\n        fontSize = 16.sp,\n        lineHeight = 24.sp,\n        letterSpacing = 0.5.sp\n    )\n    /* Other default text styles to override\n    titleLarge = TextStyle(\n        fontFamily = FontFamily.Default,\n        fontWeight = FontWeight.Normal,\n        fontSize = 22.sp,\n        lineHeight = 28.sp,\n        letterSpacing = 0.sp\n    ),\n    labelSmall = TextStyle(\n        fontFamily = FontFamily.Default,\n        fontWeight = FontWeight.Medium,\n        fontSize = 11.sp,\n        lineHeight = 16.sp,\n        letterSpacing = 0.5.sp\n    )\n    */\n)\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/src/main/res/drawable/ic_launcher_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2024 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\">\n    <path\n        android:fillColor=\"#3DDC84\"\n        android:pathData=\"M0,0h108v108h-108z\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M9,0L9,108\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,0L19,108\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M29,0L29,108\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M39,0L39,108\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M49,0L49,108\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M59,0L59,108\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M69,0L69,108\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M79,0L79,108\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M89,0L89,108\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M99,0L99,108\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,9L108,9\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,19L108,19\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,29L108,29\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,39L108,39\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,49L108,49\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,59L108,59\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,69L108,69\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,79L108,79\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,89L108,89\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M0,99L108,99\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,29L89,29\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,39L89,39\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,49L89,49\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,59L89,59\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,69L89,69\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M19,79L89,79\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M29,19L29,89\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M39,19L39,89\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M49,19L49,89\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M59,19L59,89\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M69,19L69,89\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n    <path\n        android:fillColor=\"#00000000\"\n        android:pathData=\"M79,19L79,89\"\n        android:strokeColor=\"#33FFFFFF\"\n        android:strokeWidth=\"0.8\" />\n</vector>\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/src/main/res/drawable/ic_launcher_foreground.xml",
    "content": "<!--\n  ~ Copyright (C) 2024 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:aapt=\"http://schemas.android.com/aapt\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportWidth=\"108\"\n    android:viewportHeight=\"108\">\n    <path android:pathData=\"M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z\">\n        <aapt:attr name=\"android:fillColor\">\n            <gradient\n                android:endX=\"85.84757\"\n                android:endY=\"92.4963\"\n                android:startX=\"42.9492\"\n                android:startY=\"49.59793\"\n                android:type=\"linear\">\n                <item\n                    android:color=\"#44000000\"\n                    android:offset=\"0.0\" />\n                <item\n                    android:color=\"#00000000\"\n                    android:offset=\"1.0\" />\n            </gradient>\n        </aapt:attr>\n    </path>\n    <path\n        android:fillColor=\"#FFFFFF\"\n        android:fillType=\"nonZero\"\n        android:pathData=\"M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z\"\n        android:strokeColor=\"#00000000\"\n        android:strokeWidth=\"1\" />\n</vector>\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2024 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\" />\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n    <monochrome android:drawable=\"@drawable/ic_launcher_foreground\" />\n</adaptive-icon>\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2024 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <background android:drawable=\"@drawable/ic_launcher_background\" />\n    <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n    <monochrome android:drawable=\"@drawable/ic_launcher_foreground\" />\n</adaptive-icon>\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2024 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<resources>\n    <color name=\"purple_200\">#FFBB86FC</color>\n    <color name=\"purple_500\">#FF6200EE</color>\n    <color name=\"purple_700\">#FF3700B3</color>\n    <color name=\"teal_200\">#FF03DAC5</color>\n    <color name=\"teal_700\">#FF018786</color>\n    <color name=\"black\">#FF000000</color>\n    <color name=\"white\">#FFFFFFFF</color>\n</resources>\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/src/main/res/values/strings.xml",
    "content": "<!--\n  ~ Copyright (C) 2024 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<resources>\n    <string name=\"app_name\" translatable=\"false\">Compose Preview Screenshot Testing sample</string>\n    <string name=\"greeting\">Hello!</string>\n</resources>\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/src/main/res/values/themes.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2024 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<resources>\n    <style name=\"Theme.ComposePreviewScreenshotTestingSample\" parent=\"android:Theme.Material.Light.NoActionBar\" />\n</resources>\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/src/main/res/values-es/strings.xml",
    "content": "<!--\n  ~ Copyright (C) 2024 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<resources>\n    <string name=\"greeting\">¡Hola!</string>\n</resources>\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/src/main/res/xml/backup_rules.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?><!--\n  ~ Copyright (C) 2024 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!--\n   Sample backup rules file; uncomment and customize as necessary.\n   See https://developer.android.com/guide/topics/data/autobackup\n   for details.\n   Note: This file is ignored for devices older that API 31\n   See https://developer.android.com/about/versions/12/backup-restore\n-->\n<full-backup-content>\n    <!--\n   <include domain=\"sharedpref\" path=\".\"/>\n   <exclude domain=\"sharedpref\" path=\"device.xml\"/>\n-->\n</full-backup-content>\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/src/main/res/xml/data_extraction_rules.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?><!--\n  ~ Copyright (C) 2024 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!--\n   Sample data extraction rules file; uncomment and customize as necessary.\n   See https://developer.android.com/about/versions/12/backup-restore#xml-changes\n   for details.\n-->\n<data-extraction-rules>\n    <cloud-backup>\n        <!-- TODO: Use <include> and <exclude> to control what is backed up.\n        <include .../>\n        <exclude .../>\n        -->\n    </cloud-backup>\n    <!--\n    <device-transfer>\n        <include .../>\n        <exclude .../>\n    </device-transfer>\n    -->\n</data-extraction-rules>\n"
  },
  {
    "path": "ui/PreviewScreenshot/app/src/screenshotTest/kotlin/com/example/compose/previewscreenshot/MainScreen.kt",
    "content": "/*\n * Copyright (C) 2024 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.compose.previewscreenshot\n\nimport android.content.res.Configuration.UI_MODE_NIGHT_YES\nimport androidx.compose.runtime.Composable\nimport androidx.compose.ui.tooling.preview.Preview\nimport com.example.compose.previewscreenshot.ui.theme.SampleTheme\n\nclass MainScreen {\n    @Preview(showBackground = true)\n    @Preview(showBackground = true, locale = \"es\")\n    @Preview(showBackground = true, uiMode = UI_MODE_NIGHT_YES)\n    @Composable\n    fun GreetingPreview() {\n        SampleTheme {\n            Greeting()\n        }\n    }\n\n}\n"
  },
  {
    "path": "ui/PreviewScreenshot/build.gradle.kts",
    "content": "/*\n * Copyright (C) 2024 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Top-level build file where you can add configuration options common to all sub-projects/modules.\nplugins {\n    alias(libs.plugins.android.application) apply false\n    alias(libs.plugins.jetbrains.kotlin.android) apply false\n}\n"
  },
  {
    "path": "ui/PreviewScreenshot/gradle/libs.versions.toml",
    "content": "[versions]\nagp = \"8.5.0-beta01\"\nkotlin = \"1.9.23\"\ncoreKtx = \"1.13.1\"\njunit = \"4.13.2\"\njunitVersion = \"1.1.5\"\nespressoCore = \"3.5.1\"\nlifecycleRuntimeKtx = \"2.7.0\"\nactivityCompose = \"1.9.0\"\ncomposeBom = \"2024.05.00\"\nscreenshot = \"0.0.1-alpha01\"\n\n[libraries]\nandroidx-core-ktx = { group = \"androidx.core\", name = \"core-ktx\", version.ref = \"coreKtx\" }\njunit = { group = \"junit\", name = \"junit\", version.ref = \"junit\" }\nandroidx-junit = { group = \"androidx.test.ext\", name = \"junit\", version.ref = \"junitVersion\" }\nandroidx-espresso-core = { group = \"androidx.test.espresso\", name = \"espresso-core\", version.ref = \"espressoCore\" }\nandroidx-lifecycle-runtime-ktx = { group = \"androidx.lifecycle\", name = \"lifecycle-runtime-ktx\", version.ref = \"lifecycleRuntimeKtx\" }\nandroidx-activity-compose = { group = \"androidx.activity\", name = \"activity-compose\", version.ref = \"activityCompose\" }\nandroidx-compose-bom = { group = \"androidx.compose\", name = \"compose-bom\", version.ref = \"composeBom\" }\nandroidx-ui = { group = \"androidx.compose.ui\", name = \"ui\" }\nandroidx-ui-graphics = { group = \"androidx.compose.ui\", name = \"ui-graphics\" }\nandroidx-ui-tooling = { group = \"androidx.compose.ui\", name = \"ui-tooling\" }\nandroidx-ui-tooling-preview = { group = \"androidx.compose.ui\", name = \"ui-tooling-preview\" }\nandroidx-ui-test-manifest = { group = \"androidx.compose.ui\", name = \"ui-test-manifest\" }\nandroidx-ui-test-junit4 = { group = \"androidx.compose.ui\", name = \"ui-test-junit4\" }\nandroidx-material3 = { group = \"androidx.compose.material3\", name = \"material3\" }\n\n[plugins]\nandroid-application = { id = \"com.android.application\", version.ref = \"agp\" }\njetbrains-kotlin-android = { id = \"org.jetbrains.kotlin.android\", version.ref = \"kotlin\" }\nscreenshot = { id = \"com.android.compose.screenshot\", version.ref = \"screenshot\"}\n\n"
  },
  {
    "path": "ui/PreviewScreenshot/gradle/wrapper/gradle-wrapper.properties",
    "content": "#\n# Copyright (C) 2024 The Android Open Source Project\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n#Tue May 14 09:02:08 UTC 2024\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "ui/PreviewScreenshot/gradle.properties",
    "content": "#\n# Copyright (C) 2024 The Android Open Source Project\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. For more details, visit\n# https://developer.android.com/r/tools/gradle-multi-project-decoupled-projects\n# org.gradle.parallel=true\n\n# AndroidX package structure to make it clearer which packages are bundled with the\n# Android operating system, and which are packaged with your app's APK\n# https://developer.android.com/topic/libraries/support-library/androidx-rn\nandroid.useAndroidX=true\n# Kotlin code style for this project: \"official\" or \"obsolete\":\nkotlin.code.style=official\n\n# Enables namespacing of each library's R class so that its R class includes only the\n# resources declared in the library itself and none from the library's dependencies,\n# thereby reducing the size of the R class for that library\nandroid.nonTransitiveRClass=true\n\n# Enable the `screenshotTest` source set for Compose Preview Screenshot Testing\nandroid.experimental.enableScreenshotTest=true\n"
  },
  {
    "path": "ui/PreviewScreenshot/gradlew",
    "content": "#!/usr/bin/env sh\n\n#\n# Copyright (C) 2024 The Android Open Source Project\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn () {\n    echo \"$*\"\n}\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" -a \"$nonstop\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif [ \"$cygwin\" = \"true\" -o \"$msys\" = \"true\" ] ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=`expr $i + 1`\n    done\n    case $i in\n        0) set -- ;;\n        1) set -- \"$args0\" ;;\n        2) set -- \"$args0\" \"$args1\" ;;\n        3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=`save \"$@\"`\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "ui/PreviewScreenshot/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "ui/PreviewScreenshot/settings.gradle.kts",
    "content": "/*\n * Copyright (C) 2024 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npluginManagement {\n    repositories {\n        google {\n            content {\n                includeGroupByRegex(\"com\\\\.android.*\")\n                includeGroupByRegex(\"com\\\\.google.*\")\n                includeGroupByRegex(\"androidx.*\")\n            }\n        }\n        mavenCentral()\n        gradlePluginPortal()\n    }\n}\ndependencyResolutionManagement {\n    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n    repositories {\n        google()\n        mavenCentral()\n    }\n}\n\nrootProject.name = \"Compose Preview Screenshot Testing sample\"\ninclude(\":app\")\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/.gitignore",
    "content": ".gradle\nlocal.properties\n.idea\n.DS_Store\nbuild\n*.iml\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/BUILD.bazel",
    "content": "licenses([\"notice\"])  # Apache 2.0\n\nload(\"//:common_defs.bzl\", \"minSdkVersion\", \"targetSdkVersion\")\nload(\"@rules_jvm_external//:defs.bzl\", \"artifact\")\n\nandroid_library(\n    name = \"BasicSampleLib\",\n    srcs = glob([\"app/src/main/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.AccessibilitySample\",\n    manifest = \"app/src/main/AndroidManifest.xml\",\n    resource_files = glob([\"app/src/main/res/**/*\"]),\n    deps = [\n        artifact(\"com.google.guava:guava\")\n    ],\n)\n\nandroid_binary(\n    name = \"BasicSample\",\n    custom_package = \"com.example.android.testing.espresso.AccessibilitySample\",\n    manifest = \"app/src/main/AppManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":BasicSampleLib\"],\n)\n\nandroid_library(\n    name = \"BasicSampleTestLib\",\n    srcs = glob([\"app/src/androidTest/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.AccessibilitySample.test\",\n    deps = [\n        artifact(\"androidx.viewpager:viewpager\"),\n        artifact(\"androidx.test.espresso:espresso-accessibility\"),\n        artifact(\"com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework\"),\n        \":BasicSampleLib\",\n        \"//:test_deps\",\n    ],\n)\n\nandroid_binary(\n    name = \"BasicSampleTest\",\n    custom_package = \"com.example.android.testing.espresso.AccessibilitySample.test\",\n    instruments = \":BasicSample\",\n    manifest = \"app/src/androidTest/AndroidManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\n        artifact(\"androidx.viewpager:viewpager\"),\n        artifact(\"androidx.test.espresso:espresso-accessibility\"),\n        artifact(\"com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework\"),\n        \":BasicSampleTestLib\",\n    ],\n)\n\nAPI_LEVELS = [\n    \"19_x86\",\n    \"21_x86\",\n    \"22_x86\",\n    \"23_x86\",\n]\n\n[android_instrumentation_test(\n    name = \"BasicSampleInstrumentationTest_%s\" % API_LEVEL,\n    target_device = \"@android_test_support//tools/android/emulated_devices/generic_phone:android_%s_qemu2\" % API_LEVEL,\n    test_app = \":BasicSampleTest\",\n) for API_LEVEL in API_LEVELS]\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/README.md",
    "content": "# Basic sample for Espresso\n\n*If you are new to Espresso, try this sample first.*\n\nThis project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio 3.4 is recommended.\n\n1. Download the project code, preferably using `git clone`.\n1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n1. Check out the relevant code:\n    * The application under test is located in `src/main/java`\n    * Instrumentation Tests are in `src/androidTest/java`\n    * Local Tests are in `src/test/java` \n1. Create and run the Instrumented test configuration\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *Android Instrumented Tests* configuration\n    * Choose the `app` module\n    * Connect a device or start an emulator\n    * Turn animations off.\n    (On your device, under Settings->Developer options disable the following 3 settings: \"Window animation scale\", \"Transition animation scale\" and \"Animator duration scale\")\n    * Run the newly created configuration\n    * The application will be started on the device/emulator and a series of actions will be performed automatically.\n1. Create and run the local Test configuration\n    * Open Run menu | Edit Configurations\n    * Add a new *Android JUnit * configuration\n    * Set `Use classpath of module` to `app`\n    * Set `Class` to `ChangeTextBehaviorLocalTest`\n    * Run the configuration    \n    * The test will run on local host\n\nIf you are using Android Studio, the *Run* window will show the test results.\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\nandroid {\n    compileSdk 34\n    defaultConfig {\n        applicationId \"com.example.android.testing.espresso.AccessibilitySample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n\n        multiDexEnabled true\n    }\n    productFlavors {\n    }\n    testOptions {\n        unitTests {\n            includeAndroidResources = true\n        }\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // TODO: switch to aosp-atd image once it supports browser intents\n                    systemImageSource = \"aosp\"\n                }\n            }\n        }\n    }\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_8\n        targetCompatibility JavaVersion.VERSION_1_8\n    }\n    namespace \"com.example.android.testing.espresso.AccessibilitySample\"\n    testNamespace \"com.example.android.testing.espresso.AccessibilitySample.test\"\n    lint {\n        abortOnError false\n    }\n}\n\n\n\ntasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {\n    kotlinOptions {\n        jvmTarget = \"1.8\"\n    }\n}\n\ndependencies {\n    // App dependencies\n    implementation \"androidx.annotation:annotation:\" + rootProject.androidxAnnotationVersion;\n    implementation \"com.google.guava:guava:\" + rootProject.guavaVersion\n    implementation \"androidx.multidex:multidex:2.0.1\"\n\n    // Testing-only dependencies\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion\n    androidTestImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion\n    androidTestImplementation(\"androidx.test.espresso:espresso-accessibility:\" + rootProject.espressoVersion) {\n        // workaround for https://github.com/android/android-test/issues/861\n        exclude group: \"org.checkerframework\", module: \"checker\"\n    }\n    androidTestImplementation \"com.google.truth:truth:1.1.3\"\n}\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/app/src/androidTest/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2018 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      xmlns:tools=\"http://schemas.android.com/tools\"\n    android:versionCode=\"1\"\n      android:versionName=\"1.0\">\n\n    <instrumentation android:targetPackage=\"com.example.android.testing.espresso.AccessibilitySample\"\n                     android:name=\"androidx.test.runner.AndroidJUnitRunner\"/>\n\n    <application tools:replace=\"label\" android:label=\"AccessibilitySampleTest\" />\n</manifest>\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/app/src/androidTest/java/com/example/android/testing/espresso/AccessibilitySample/AccessibilityChecksTest.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.AccessibilitySample;\n\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.action.ViewActions.click;\nimport static androidx.test.espresso.matcher.ViewMatchers.withId;\n\nimport androidx.test.core.app.ActivityScenario;\nimport androidx.test.espresso.accessibility.AccessibilityChecks;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.filters.LargeTest;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\n\n/**\n * Basic tests showcasing espresso AccessibilityChecks.\n */\n@RunWith(AndroidJUnit4.class)\n@LargeTest\npublic class AccessibilityChecksTest {\n\n    @Test\n    public void accessibilityChecks() {\n        AccessibilityChecks.enable();\n        try (ActivityScenario scenario = ActivityScenario.launch(MainActivity.class)) {\n            onView(withId(R.id.openBrowserButton)).perform(click());\n        }\n    }\n}"
  },
  {
    "path": "ui/espresso/AccessibilitySample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2015 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.example.android.testing.espresso.AccessibilitySample.MainActivity\"\n            android:label=\"@string/app_name\"\n            android:exported=\"true\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/app/src/main/AppManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2018 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example.android.testing.espresso.AccessibilitySample\" >\n\n    <uses-sdk android:minSdkVersion=\"14\" android:targetSdkVersion=\"28\" />\n</manifest>\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/app/src/main/java/com/example/android/testing/espresso/AccessibilitySample/MainActivity.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.AccessibilitySample;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.net.Uri;\nimport android.os.Bundle;\nimport android.view.View;\nimport android.widget.EditText;\nimport android.widget.TextView;\n\n/**\n * An {@link Activity} that gets a text string from the user and displays it back when the user\n * clicks on one of the two buttons. The first one shows it in the same activity and the second\n * one opens another activity and displays the message.\n */\npublic class MainActivity extends Activity implements View.OnClickListener {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n    }\n\n    @Override\n    public void onClick(View view) {\n        // fire a intent\n        Intent intent = new Intent(Intent.ACTION_VIEW);\n        intent.setData(Uri.parse(\"http://developer.android.com\"));\n        startActivity(intent);\n    }\n}\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n              xmlns:tools=\"http://schemas.android.com/tools\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"match_parent\"\n              android:orientation=\"vertical\"\n              android:padding=\"@dimen/activity_horizontal_margin\"\n              tools:context=\".MainActivity\">\n\n\n    <TextView\n            android:id=\"@+id/textToBeChanged\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginBottom=\"@dimen/header_margin\"\n            android:layout_marginTop=\"@dimen/header_margin\"\n            android:text=\"@string/hello_world\"\n            android:textAppearance=\"?android:attr/textAppearanceLarge\"/>\n\n\n    <Button\n      android:id=\"@+id/openBrowserButton\"\n      style=\"?android:attr/buttonStyleSmall\"\n      android:layout_width=\"wrap_content\"\n      android:layout_height=\"wrap_content\"\n      android:layout_gravity=\"center_horizontal\"\n      android:onClick=\"onClick\"\n      android:text=\"@string/open_browser_text\" />\n</LinearLayout>\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"header_margin\">32dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2019 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <string name=\"app_name\">Espresso Accessibility sample</string>\n    <string name=\"hello_world\">Hello Espresso!</string>\n    <string name=\"open_browser_text\">Open browser</string>\n</resources>\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Light\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/AccessibilitySample/app/src/main/res/values-v13/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Holo.Light\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/AccessibilitySample/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Material\"/>\n</resources>\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.kotlinVersion = \"1.9.22\"\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    androidxAnnotationVersion = \"1.5.0\"\n    robolectricVersion = \"4.13\"\n    extTruthVersion = \"1.6.0\"\n    coreVersion = \"1.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    runnerVersion = \"1.6.1\"\n    espressoVersion = \"3.6.1\"\n    guavaVersion = \"31.1-android\"\n}\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonFinalResIds=false\nandroid.nonTransitiveRClass=false\nandroid.useAndroidX=true\n\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "ui/espresso/AccessibilitySample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "ui/espresso/BasicSample/.gitignore",
    "content": ".gradle\nlocal.properties\n.idea\n.DS_Store\nbuild\n*.iml\n"
  },
  {
    "path": "ui/espresso/BasicSample/BUILD.bazel",
    "content": "licenses([\"notice\"])  # Apache 2.0\n\nload(\"//:common_defs.bzl\", \"minSdkVersion\", \"targetSdkVersion\")\nload(\"@rules_jvm_external//:defs.bzl\", \"artifact\")\n\nandroid_library(\n    name = \"BasicSampleLib\",\n    srcs = glob([\"app/src/main/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.BasicSample\",\n    manifest = \"app/src/main/AndroidManifest.xml\",\n    resource_files = glob([\"app/src/main/res/**/*\"]),\n    deps = [\n        artifact(\"com.google.guava:guava\")\n    ],\n)\n\nandroid_binary(\n    name = \"BasicSample\",\n    custom_package = \"com.example.android.testing.espresso.BasicSample\",\n    manifest = \"app/src/main/AppManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":BasicSampleLib\"],\n)\n\nandroid_library(\n    name = \"BasicSampleTestLib\",\n    srcs = glob([\"app/src/androidTest/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.BasicSample.test\",\n    deps = [\n        \":BasicSampleLib\",\n        \"//:test_deps\",\n    ],\n)\n\nandroid_binary(\n    name = \"BasicSampleTest\",\n    custom_package = \"com.example.android.testing.espresso.BasicSample.test\",\n    instruments = \":BasicSample\",\n    manifest = \"app/src/androidTest/AndroidManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":BasicSampleTestLib\"],\n)\n\nAPI_LEVELS = [\n    \"19_x86\",\n    \"21_x86\",\n    \"22_x86\",\n    \"23_x86\",\n]\n\n[android_instrumentation_test(\n    name = \"BasicSampleInstrumentationTest_%s\" % API_LEVEL,\n    target_device = \"@android_test_support//tools/android/emulated_devices/generic_phone:android_%s_qemu2\" % API_LEVEL,\n    test_app = \":BasicSampleTest\",\n) for API_LEVEL in API_LEVELS]\n"
  },
  {
    "path": "ui/espresso/BasicSample/README.md",
    "content": "# Basic sample for Espresso\n\n*If you are new to Espresso, try this sample first.*\n\nThis project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio 3.4 is recommended.\n\n1. Download the project code, preferably using `git clone`.\n1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n1. Check out the relevant code:\n    * The application under test is located in `src/main/java`\n    * Instrumentation Tests are in `src/androidTest/java`\n    * Local Tests are in `src/test/java` \n1. Create and run the Instrumented test configuration\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *Android Instrumented Tests* configuration\n    * Choose the `app` module\n    * Connect a device or start an emulator\n    * Turn animations off.\n    (On your device, under Settings->Developer options disable the following 3 settings: \"Window animation scale\", \"Transition animation scale\" and \"Animator duration scale\")\n    * Run the newly created configuration\n    * The application will be started on the device/emulator and a series of actions will be performed automatically.\n1. Create and run the local Test configuration\n    * Open Run menu | Edit Configurations\n    * Add a new *Android JUnit * configuration\n    * Set `Use classpath of module` to `app`\n    * Set `Class` to `ChangeTextBehaviorLocalTest`\n    * Run the configuration    \n    * The test will run on local host\n\nIf you are using Android Studio, the *Run* window will show the test results.\n"
  },
  {
    "path": "ui/espresso/BasicSample/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\napply plugin: \"kotlin-android\"\n\nandroid {\n    compileSdk 34\n    defaultConfig {\n        applicationId \"com.example.android.testing.espresso.BasicSample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    productFlavors {\n    }\n    testOptions {\n        unitTests {\n            includeAndroidResources = true\n        }\n        managedDevices {\n            devices {\n\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    namespace \"com.example.android.testing.espresso.BasicSample\"\n    testNamespace \"com.example.android.testing.espresso.BasicSample.test\"\n    lint {\n        abortOnError false\n    }\n}\n\ntasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {\n    kotlinOptions {\n        jvmTarget = \"1.8\"\n    }\n}\n\ndependencies {\n    // App dependencies\n    implementation \"androidx.annotation:annotation:\" + rootProject.androidxAnnotationVersion;\n    implementation \"com.google.guava:guava:\" + rootProject.guavaVersion\n\n    // Testing-only dependencies\n    androidTestImplementation \"org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion\"\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion\n    androidTestImplementation \"androidx.test:core-ktx:\" + rootProject.coreVersion\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion\n    androidTestImplementation \"androidx.test.ext:junit-ktx:\" + rootProject.extJUnitVersion\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion\n    androidTestImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion\n\n    testImplementation \"androidx.test:core:\" + rootProject.coreVersion;\n    testImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion\n    testImplementation \"junit:junit:4.12\"\n    testImplementation \"org.robolectric:robolectric:\" + rootProject.robolectricVersion\n    testImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion\n    testImplementation \"androidx.test.espresso:espresso-intents:\" + rootProject.espressoVersion\n    testImplementation \"androidx.test.ext:truth:\" + rootProject.extTruthVersion\n}\n"
  },
  {
    "path": "ui/espresso/BasicSample/app/src/androidTest/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2018 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      xmlns:tools=\"http://schemas.android.com/tools\"\n    android:versionCode=\"1\"\n      android:versionName=\"1.0\">\n\n    <instrumentation android:targetPackage=\"com.example.android.testing.espresso.BasicSample\"\n                     android:name=\"androidx.test.runner.AndroidJUnitRunner\"/>\n\n    <application tools:replace=\"label\" android:label=\"BasicSampleTest\" />\n</manifest>\n"
  },
  {
    "path": "ui/espresso/BasicSample/app/src/androidTest/java/com/example/android/testing/espresso/BasicSample/ChangeTextBehaviorKtTest.kt",
    "content": "/*\n * Copyright 2018, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.BasicSample\n\nimport androidx.test.ext.junit.rules.activityScenarioRule\nimport android.app.Activity\nimport androidx.test.core.app.ActivityScenario\nimport androidx.test.core.app.launchActivity\nimport androidx.test.espresso.Espresso.onView\nimport androidx.test.espresso.action.ViewActions\nimport androidx.test.espresso.action.ViewActions.*\nimport androidx.test.espresso.assertion.ViewAssertions.matches\nimport androidx.test.espresso.matcher.ViewMatchers\nimport androidx.test.espresso.matcher.ViewMatchers.withId\nimport androidx.test.espresso.matcher.ViewMatchers.withText\nimport androidx.test.ext.junit.runners.AndroidJUnit4\nimport androidx.test.filters.LargeTest\nimport org.junit.Before\nimport org.junit.Rule\nimport org.junit.Test\nimport org.junit.runner.RunWith\n\n\n/**\n * The kotlin equivalent to the ChangeTextBehaviorTest, that\n * showcases simple view matchers and actions like [ViewMatchers.withId],\n * [ViewActions.click] and [ViewActions.typeText], and ActivityScenarioRule\n *\n *\n * Note that there is no need to tell Espresso that a view is in a different [Activity].\n */\n@RunWith(AndroidJUnit4::class)\n@LargeTest\nclass ChangeTextBehaviorKtTest {\n\n    /**\n     * Use [ActivityScenarioRule] to create and launch the activity under test before each test,\n     * and close it after each test. This is a replacement for\n     * [androidx.test.rule.ActivityTestRule].\n     */\n    @get:Rule var activityScenarioRule = activityScenarioRule<MainActivity>()\n\n    @Test\n    fun changeText_sameActivity() {\n\n        // Type text and then press the button.\n        onView(withId(R.id.editTextUserInput))\n                .perform(typeText(STRING_TO_BE_TYPED), closeSoftKeyboard())\n        onView(withId(R.id.changeTextBt)).perform(click())\n\n        // Check that the text was changed.\n        onView(withId(R.id.textToBeChanged)).check(matches(withText(STRING_TO_BE_TYPED)))\n    }\n\n    @Test\n    fun changeText_newActivity() {\n        // Type text and then press the button.\n        onView(withId(R.id.editTextUserInput)).perform(typeText(STRING_TO_BE_TYPED),\n                closeSoftKeyboard())\n        onView(withId(R.id.activityChangeTextBtn)).perform(click())\n\n        // This view is in a different Activity, no need to tell Espresso.\n        onView(withId(R.id.show_text_view)).check(matches(withText(STRING_TO_BE_TYPED)))\n    }\n\n    companion object {\n\n        val STRING_TO_BE_TYPED = \"Espresso\"\n    }\n}"
  },
  {
    "path": "ui/espresso/BasicSample/app/src/androidTest/java/com/example/android/testing/espresso/BasicSample/ChangeTextBehaviorTest.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.BasicSample;\n\nimport android.app.Activity;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport androidx.test.espresso.action.ViewActions;\nimport androidx.test.espresso.matcher.ViewMatchers;\nimport androidx.test.ext.junit.rules.ActivityScenarioRule;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.filters.LargeTest;\n\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.action.ViewActions.click;\nimport static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;\nimport static androidx.test.espresso.action.ViewActions.typeText;\nimport static androidx.test.espresso.assertion.ViewAssertions.matches;\nimport static androidx.test.espresso.matcher.ViewMatchers.withId;\nimport static androidx.test.espresso.matcher.ViewMatchers.withText;\n\n\n/**\n * Basic tests showcasing simple view matchers and actions like {@link ViewMatchers#withId},\n * {@link ViewActions#click} and {@link ViewActions#typeText}.\n * <p>\n * Note that there is no need to tell Espresso that a view is in a different {@link Activity}.\n */\n@RunWith(AndroidJUnit4.class)\n@LargeTest\npublic class ChangeTextBehaviorTest {\n\n    public static final String STRING_TO_BE_TYPED = \"Espresso\";\n\n    /**\n     * Use {@link ActivityScenarioRule} to create and launch the activity under test, and close it\n     * after test completes. This is a replacement for {@link androidx.test.rule.ActivityTestRule}.\n     */\n    @Rule public ActivityScenarioRule<MainActivity> activityScenarioRule\n            = new ActivityScenarioRule<>(MainActivity.class);\n\n    @Test\n    public void changeText_sameActivity() {\n        // Type text and then press the button.\n        onView(withId(R.id.editTextUserInput))\n                .perform(typeText(STRING_TO_BE_TYPED), closeSoftKeyboard());\n        onView(withId(R.id.changeTextBt)).perform(click());\n\n        // Check that the text was changed.\n        onView(withId(R.id.textToBeChanged)).check(matches(withText(STRING_TO_BE_TYPED)));\n    }\n\n    @Test\n    public void changeText_newActivity() {\n        // Type text and then press the button.\n        onView(withId(R.id.editTextUserInput)).perform(typeText(STRING_TO_BE_TYPED),\n                closeSoftKeyboard());\n        onView(withId(R.id.activityChangeTextBtn)).perform(click());\n\n        // This view is in a different Activity, no need to tell Espresso.\n        onView(withId(R.id.show_text_view)).check(matches(withText(STRING_TO_BE_TYPED)));\n    }\n}"
  },
  {
    "path": "ui/espresso/BasicSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2015 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.example.android.testing.espresso.BasicSample.MainActivity\"\n            android:label=\"@string/app_name\"\n            android:exported=\"true\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n        <activity android:name=\"com.example.android.testing.espresso.BasicSample.ShowTextActivity\"/>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/BasicSample/app/src/main/AppManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2018 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example.android.testing.espresso.BasicSample\" >\n\n    <uses-sdk android:minSdkVersion=\"14\" android:targetSdkVersion=\"28\" />\n</manifest>\n"
  },
  {
    "path": "ui/espresso/BasicSample/app/src/main/java/com/example/android/testing/espresso/BasicSample/MainActivity.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.BasicSample;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.view.View;\nimport android.widget.EditText;\nimport android.widget.TextView;\n\n/**\n * An {@link Activity} that gets a text string from the user and displays it back when the user\n * clicks on one of the two buttons. The first one shows it in the same activity and the second\n * one opens another activity and displays the message.\n */\npublic class MainActivity extends Activity implements View.OnClickListener {\n\n    // The TextView used to display the message inside the Activity.\n    private TextView mTextView;\n\n    // The EditText where the user types the message.\n    private EditText mEditText;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        // Set the listeners for the buttons.\n        findViewById(R.id.changeTextBt).setOnClickListener(this);\n        findViewById(R.id.activityChangeTextBtn).setOnClickListener(this);\n\n        mTextView = (TextView) findViewById(R.id.textToBeChanged);\n        mEditText = (EditText) findViewById(R.id.editTextUserInput);\n    }\n\n    @Override\n    public void onClick(View view) {\n        // Get the text from the EditText view.\n        final String text = mEditText.getText().toString();\n\n        final int changeTextBtId = R.id.changeTextBt;\n        final int activityChangeTextBtnId = R.id.activityChangeTextBtn;\n\n        if (view.getId() == changeTextBtId) {\n          // First button's interaction: set a text in a text view.\n          mTextView.setText(text);\n        } else if (view.getId() == activityChangeTextBtnId) {\n          // Second button's interaction: start an activity and send a message to it.\n          Intent intent = com.example.android.testing.espresso.BasicSample.ShowTextActivity\n              .newStartIntent(this, text);\n          startActivity(intent);\n        }\n    }\n}\n"
  },
  {
    "path": "ui/espresso/BasicSample/app/src/main/java/com/example/android/testing/espresso/BasicSample/ShowTextActivity.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.BasicSample;\n\nimport com.google.common.base.Strings;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.widget.TextView;\n\n/**\n * A simple {@link Activity} that shows a message.\n */\npublic class ShowTextActivity extends Activity {\n\n    // The name of the extra data sent through an {@link Intent}.\n    public final static String KEY_EXTRA_MESSAGE =\n            \"com.example.android.testing.espresso.basicsample.MESSAGE\";\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_show_text);\n\n        // Get the message from the Intent.\n        Intent intent = getIntent();\n        String message = Strings.nullToEmpty(intent.getStringExtra(KEY_EXTRA_MESSAGE));\n\n        // Show message.\n        ((TextView)findViewById(R.id.show_text_view)).setText(message);\n    }\n\n    /**\n     * Creates an {@link Intent} for {@link ShowTextActivity} with the message to be displayed.\n     * @param context the {@link Context} where the {@link Intent} will be used\n     * @param message a {@link String} with text to be displayed\n     * @return an {@link Intent} used to start {@link ShowTextActivity}\n     */\n    static protected Intent newStartIntent(Context context, String message) {\n        Intent newIntent = new Intent(context, ShowTextActivity.class);\n        newIntent.putExtra(KEY_EXTRA_MESSAGE, message);\n        return newIntent;\n    }\n}\n"
  },
  {
    "path": "ui/espresso/BasicSample/app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n              xmlns:tools=\"http://schemas.android.com/tools\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"match_parent\"\n              android:orientation=\"vertical\"\n              android:padding=\"@dimen/activity_horizontal_margin\"\n              tools:context=\".MainActivity\">\n\n\n    <TextView\n            android:id=\"@+id/textToBeChanged\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginBottom=\"@dimen/header_margin\"\n            android:layout_marginTop=\"@dimen/header_margin\"\n            android:text=\"@string/hello_world\"\n            android:textAppearance=\"?android:attr/textAppearanceLarge\"/>\n\n\n    <EditText\n            android:id=\"@+id/editTextUserInput\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:hint=\"@string/type_something\"/>\n\n    <Button\n            style=\"?android:attr/buttonStyleSmall\"\n            android:id=\"@+id/changeTextBt\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/change_text\"\n            android:layout_gravity=\"center_horizontal\"/>\n\n\n    <Button\n            style=\"?android:attr/buttonStyleSmall\"\n            android:id=\"@+id/activityChangeTextBtn\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:text=\"@string/open_activity_and_change_text\"/>\n</LinearLayout>\n"
  },
  {
    "path": "ui/espresso/BasicSample/app/src/main/res/layout/activity_show_text.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<merge xmlns:android=\"http://schemas.android.com/apk/res/android\"\n             xmlns:tools=\"http://schemas.android.com/tools\"\n             android:layout_width=\"match_parent\"\n             android:layout_height=\"match_parent\"\n             tools:context=\".ShowTextActivity\">\n\n    <TextView\n            android:id=\"@+id/show_text_view\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/hello_world\"\n            android:layout_gravity=\"center\"/>\n\n</merge>\n"
  },
  {
    "path": "ui/espresso/BasicSample/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"header_margin\">32dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/BasicSample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <string name=\"app_name\">Basic Espresso sample</string>\n    <string name=\"hello_world\">Hello Espresso!</string>\n    <string name=\"change_text\">Change text</string>\n    <string name=\"type_something\">type something…</string>\n    <string name=\"open_activity_and_change_text\">Open activity and change text</string>\n</resources>\n"
  },
  {
    "path": "ui/espresso/BasicSample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Light\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/BasicSample/app/src/main/res/values-v13/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Holo.Light\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/BasicSample/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Material\"/>\n</resources>\n"
  },
  {
    "path": "ui/espresso/BasicSample/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/BasicSample/app/src/test/java/com/example/android/testing/espresso/BasicSample/ChangeTextBehaviorLocalTest.java",
    "content": "package com.example.android.testing.espresso.BasicSample;\n\n\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.action.ViewActions.click;\nimport static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;\nimport static androidx.test.espresso.action.ViewActions.typeText;\nimport static androidx.test.espresso.assertion.ViewAssertions.matches;\nimport static androidx.test.espresso.matcher.ViewMatchers.withId;\nimport static androidx.test.espresso.matcher.ViewMatchers.withText;\nimport static androidx.test.ext.truth.content.IntentSubject.assertThat;\n\nimport androidx.test.espresso.intent.Intents;\nimport androidx.test.ext.junit.rules.ActivityScenarioRule;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport com.google.common.collect.Iterables;\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\n@RunWith(AndroidJUnit4.class)\npublic final class ChangeTextBehaviorLocalTest {\n\n  public static final String STRING_TO_BE_TYPED = \"Espresso\";\n\n  /**\n   * Use {@link ActivityScenarioRule} to create and launch the activity under test.\n   */\n  @Rule public ActivityScenarioRule<MainActivity> activityScenarioRule =\n      new ActivityScenarioRule<MainActivity>(MainActivity.class);\n\n  @Before\n  public void intentsInit() {\n    // initialize Espresso Intents capturing\n    Intents.init();\n  }\n\n  @After\n  public void intentsTeardown() {\n    // release Espresso Intents capturing\n    Intents.release();\n  }\n\n  @Test\n  public void changeText_sameActivity() {\n    // Type text and then press the button.\n    onView(withId(R.id.editTextUserInput))\n            .perform(typeText(STRING_TO_BE_TYPED), closeSoftKeyboard());\n\n    onView(withId(R.id.changeTextBt)).perform(click());\n\n    // Check that the text was changed.\n    onView(withId(R.id.textToBeChanged)).check(matches(withText(STRING_TO_BE_TYPED)));\n  }\n\n  @Test\n  public void changeText_newActivity() {\n    // Type text and then press the button.\n    onView(withId(R.id.editTextUserInput)).perform(typeText(STRING_TO_BE_TYPED),\n        closeSoftKeyboard());\n    onView(withId(R.id.activityChangeTextBtn)).perform(click());\n\n    // An intent is fired to launch a different Activity. Robolectric doesn't currently\n    // support launching a new Activity, so use Espresso Intents to verify intent was sent\n    assertThat(Iterables.getOnlyElement(Intents.getIntents())).hasComponentClass(\n        ShowTextActivity.class);\n  }\n}\n"
  },
  {
    "path": "ui/espresso/BasicSample/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.kotlinVersion = \"1.9.22\"\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    androidxAnnotationVersion = \"1.5.0\"\n    robolectricVersion = \"4.13\"\n    guavaVersion = \"31.1-android\"\n    extTruthVersion = \"1.6.0\"\n    coreVersion = \"1.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    runnerVersion = \"1.6.1\"\n    espressoVersion = \"3.6.1\"\n}\n"
  },
  {
    "path": "ui/espresso/BasicSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "ui/espresso/BasicSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonFinalResIds=false\nandroid.nonTransitiveRClass=false\nandroid.useAndroidX=true\n"
  },
  {
    "path": "ui/espresso/BasicSample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "ui/espresso/BasicSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "ui/espresso/BasicSample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/.gitignore",
    "content": ".gradle\nlocal.properties\n.idea\n.DS_Store\nbuild\n*.iml\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/BUILD.bazel",
    "content": "load(\"@rules_jvm_external//:defs.bzl\", \"artifact\")\nload(\"//:common_defs.bzl\", \"minSdkVersion\", \"targetSdkVersion\")\n\nlicenses([\"notice\"])  # Apache 2.0\n\nandroid_library(\n    name = \"CustomMatcherSampleLib\",\n    srcs = glob([\"app/src/main/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.CustomMatcherSample\",\n    manifest = \"app/src/main/AndroidManifest.xml\",\n    resource_files = glob([\"app/src/main/res/**/*\"]),\n    deps = [\n        artifact(\"androidx.annotation:annotation\"),\n        artifact(\"com.google.guava:guava\"),\n    ],\n)\n\nandroid_binary(\n    name = \"CustomMatcherSample\",\n    custom_package = \"com.example.android.testing.espresso.CustomMatcherSample\",\n    manifest = \"app/src/main/AppManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":CustomMatcherSampleLib\"],\n)\n\nandroid_library(\n    name = \"CustomMatcherSampleTestLib\",\n    srcs = glob([\"app/src/sharedTest/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.CustomMatcherSample.test\",\n    deps = [\n        \":CustomMatcherSampleLib\",\n        \"//:test_deps\",\n        \"@maven//:org_robolectric_robolectric\",\n        \"@maven//:org_robolectric_annotations\",\n        \"@maven//:junit_junit\",\n    ],\n)\n\nandroid_binary(\n    name = \"CustomMatcherSampleTest\",\n    custom_package = \"com.example.android.testing.espresso.CustomMatcherSample.test\",\n    instruments = \":CustomMatcherSample\",\n    manifest = \"app/src/androidTest/AndroidManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":CustomMatcherSampleTestLib\"],\n)\n\nAPI_LEVELS = [\n    \"19_x86\",\n    \"21_x86\",\n    \"22_x86\",\n    \"23_x86\",\n]\n\n[android_instrumentation_test(\n    name = \"CustomMatcherSampleInstrumentationTest_%s\" % API_LEVEL,\n    target_device = \"@android_test_support//tools/android/emulated_devices/generic_phone:android_%s_qemu2\" % API_LEVEL,\n    test_app = \":CustomMatcherSampleTest\",\n) for API_LEVEL in API_LEVELS]\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/README.md",
    "content": "# Custom matchers sample for Espresso\n\n*Extending Espresso is easy! This sample shows how to match the \"hint\" property of an EditText.*\n\nThis project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio is recommended.\n\n1. Download the project code, preferably using `git clone`.\n1. Open the Android SDK Manager (*Tools* Menu | *Android*) and make sure you have installed the *Android testing support library Repository* under *Extras*.\n1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n1. Check out the relevant code:\n    * The application under test is located in `src/main/java`\n    * Tests are in `src/androidTest/java`\n1. Create the test configuration with a custom runner: `androidx.test.runner.AndroidJUnitRunner`\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *Android Tests* configuration\n    * Choose a module\n    * Add a *Specific instrumentation runner*: `androidx.test.runner.AndroidJUnitRunner`\n1. Connect a device or start an emulator\n    * Turn animations off.\n    (On your device, under Settings->Developer options disable the following 3 settings: \"Window animation scale\", \"Transition animation scale\" and \"Animator duration scale\")\n1. Run the newly created configuration\n\nThe application will be started on the device/emulator and a series of actions will be performed automatically.\n\nIf you are using Android Studio, the *Run* window will show the test results.\n\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\nandroid {\n    compileSdk 34\n    defaultConfig {\n        applicationId \"com.example.android.testing.espresso.CustomMatcherSample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n        }\n    }\n    productFlavors {\n    }\n    // Configure the `test` and `android` variants to share the same test source\n    sourceSets {\n        test {\n            java.srcDir \"src/sharedTest/java\"\n        }\n        androidTest {\n            java.srcDir \"src/sharedTest/java\"\n        }\n    }\n    testOptions {\n        unitTests {\n            includeAndroidResources = true\n        }\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    namespace \"com.example.android.testing.espresso.CustomMatcherSample\"\n    testNamespace \"com.example.android.testing.espresso.CustomMatcherSample.test\"\n    lint {\n        abortOnError false\n    }\n}\n\ndependencies {\n    // App dependencies\n    implementation \"androidx.annotation:annotation:\" + rootProject.androidxAnnotationVersion\n    implementation \"com.google.guava:guava:\" + rootProject.guavaVersion\n\n    // Testing-only dependencies\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion;\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion;\n    androidTestImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion;\n    androidTestImplementation \"org.robolectric:annotations:\" + rootProject.robolectricVersion;\n\n    testImplementation \"androidx.test:core:\" + rootProject.coreVersion;\n    testImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    testImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion;\n    testImplementation \"org.robolectric:robolectric:\" + rootProject.robolectricVersion;\n}\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/app/src/androidTest/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      xmlns:tools=\"http://schemas.android.com/tools\"\n    android:versionCode=\"1\"\n      android:versionName=\"1.0\">\n    <instrumentation android:targetPackage=\"com.example.android.testing.espresso.CustomMatcherSample\"\n                     android:name=\"androidx.test.runner.AndroidJUnitRunner\"/>\n\n    <application tools:replace=\"label\" android:label=\"CustomMatcherSampleTest\" />\n</manifest>\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n            android:icon=\"@drawable/ic_launcher\"\n            android:label=\"@string/app_name\"\n            android:theme=\"@style/AppTheme\">\n        <activity\n                android:name=\"com.example.android.testing.espresso.CustomMatcherSample.MainActivity\"\n                android:label=\"@string/app_name\"\n                android:exported=\"true\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\"/>\n                <category android:name=\"android.intent.category.LAUNCHER\"/>\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/app/src/main/AppManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n          package=\"com.example.android.testing.espresso.CustomMatcherSample\">\n\n    <uses-sdk android:minSdkVersion=\"14\" android:targetSdkVersion=\"28\" />\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/app/src/main/java/com/example/android/testing/espresso/CustomMatcherSample/MainActivity.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.CustomMatcherSample;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport androidx.annotation.VisibleForTesting;\nimport android.view.View;\nimport android.widget.EditText;\n\nimport java.util.Arrays;\nimport java.util.List;\n\n/**\n * Asks the user for a coffee preparation and shows if it is valid.\n * <p>Valid inputs are anything ending in \"coffee\" or strings listed in\n * {@link MainActivity#COFFEE_PREPARATIONS} The check is always case-insensitive.\n * </p>\n */\npublic class MainActivity extends Activity implements View.OnClickListener {\n\n    @VisibleForTesting\n    public static final List<String> COFFEE_PREPARATIONS =\n            Arrays.asList(\"Espresso\", \"Latte\", \"Mocha\", \"Café con leche\", \"Cold brew\");\n\n    @VisibleForTesting\n    public static final String VALID_ENDING = \"coffee\";\n\n    private EditText mInputText;\n    private View mSuccessView;\n    private View mErrorView;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        // Sets the listener for the button.\n        findViewById(R.id.button).setOnClickListener(this);\n\n        // Get references to the EditText and views showing the result.\n        mInputText = (EditText) findViewById(R.id.editText);\n        mSuccessView = findViewById(R.id.inputValidationSuccess);\n        mErrorView = findViewById(R.id.inputValidationError);\n    }\n\n    @Override\n    public void onClick(View view) {\n        if (view.getId() == R.id.button) {\n            // The View to display depends on whether the input is valid or not.\n            final String inputText = mInputText.getText().toString();\n\n            // Validate the input and show the result.\n            showResult(validateText(inputText));\n        }\n    }\n\n    private void showResult(boolean isValidResult) {\n        mSuccessView.setVisibility(isValidResult ? View.VISIBLE : View.GONE);\n        mErrorView.setVisibility(isValidResult ? View.GONE : View.VISIBLE);\n    }\n\n    private static boolean validateText(String inputText) {\n        // Every input ending in VALID_ENDING will return true.\n        if (inputText.toLowerCase().endsWith(VALID_ENDING)) {\n            return true;\n        }\n\n        // Check if the string is in the list.\n        for (String preparation : COFFEE_PREPARATIONS) {\n            if (preparation.equalsIgnoreCase(inputText)) {\n                return true;\n            }\n        }\n        return false;\n    }\n}\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/app/src/main/res/drawable/correct.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright 2015, The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <item>\n        <shape android:shape=\"rectangle\" >\n            <solid android:color=\"@android:color/transparent\" />\n        </shape>\n    </item>\n\n    <item android:top=\"-2dp\" android:right=\"-2dp\" android:left=\"-2dp\">\n        <shape>\n            <solid android:color=\"@android:color/transparent\" />\n            <stroke\n                android:width=\"1dp\"\n                android:color=\"#00C853\" />\n        </shape>\n    </item>\n\n</layer-list>"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/app/src/main/res/drawable/incorrect.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright 2015, The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n<layer-list xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <item>\n        <shape android:shape=\"rectangle\" >\n            <solid android:color=\"@android:color/transparent\" />\n        </shape>\n    </item>\n\n    <item android:top=\"-2dp\" android:right=\"-2dp\" android:left=\"-2dp\">\n        <shape>\n            <solid android:color=\"@android:color/transparent\" />\n            <stroke\n                android:width=\"1dp\"\n                android:color=\"#D84315\" />\n        </shape>\n    </item>\n\n</layer-list>"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/app/src/main/res/layout/activity_main.xml",
    "content": "<!--\n Copyright 2015, The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n              xmlns:tools=\"http://schemas.android.com/tools\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"match_parent\"\n              android:paddingBottom=\"@dimen/activity_vertical_margin\"\n              android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n              android:paddingRight=\"@dimen/activity_horizontal_margin\"\n              android:paddingTop=\"@dimen/activity_vertical_margin\"\n              android:orientation=\"vertical\"\n              tools:context=\".MainActivity\">\n\n    <EditText\n            android:id=\"@+id/editText\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginTop=\"48dp\"\n            android:ems=\"10\"\n            android:hint=\"@string/hint\"/>\n\n    <Button\n            android:id=\"@+id/button\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/validate\"\n            android:layout_gravity=\"end\"/>\n\n    <TextView\n            android:id=\"@+id/instructionsText\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginTop=\"36dp\"\n            android:text=\"@string/instructions\"\n            android:textAppearance=\"?android:attr/textAppearanceSmall\"/>\n\n    <TextView\n            android:id=\"@+id/inputValidationSuccess\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginTop=\"48dp\"\n            android:background=\"@drawable/correct\"\n            android:text=\"@string/good_choice\"\n            android:textAppearance=\"?android:attr/textAppearanceLarge\"\n            android:visibility=\"gone\"\n            android:layout_gravity=\"center_horizontal\"/>\n\n    <TextView\n            android:id=\"@+id/inputValidationError\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginTop=\"48dp\"\n            android:background=\"@drawable/incorrect\"\n            android:text=\"@string/bad_choice\"\n            android:textAppearance=\"?android:attr/textAppearanceLarge\"\n            android:visibility=\"gone\"\n            android:layout_gravity=\"center_horizontal\"/>\n\n</LinearLayout>\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n Copyright 2015, The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright 2015, The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n<resources>\n\n    <string name=\"app_name\">Custom Matcher EditText Sample</string>\n    <string name=\"instructions\">See MainActivity.java for valid options or type something ending\n        in \\\"coffee\\\".\n    </string>\n    <string name=\"hint\">How do you like your coffee?</string>\n    <string name=\"validate\">Validate</string>\n    <string name=\"good_choice\">Good choice!</string>\n    <string name=\"bad_choice\">Bad choice!</string>\n\n</resources>\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright 2015, The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Light\"/>\n\n</resources>\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/app/src/main/res/values-v13/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright 2015, The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n<resources>\n\n    <style name=\"AppTheme\" parent=\"android:Theme.Holo.Light.NoActionBar\">\n        <!-- Customize your theme here. -->\n    </style>\n</resources>"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright 2015, The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Material.Light.NoActionBar\"/>\n</resources>\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<!--\n Copyright 2015, The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/app/src/sharedTest/java/com/example/android/testing/espresso/CustomMatcherSample/HintMatcher.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.CustomMatcherSample;\n\nimport static com.google.common.base.Preconditions.checkNotNull;\nimport static org.hamcrest.Matchers.is;\n\nimport android.view.View;\nimport android.widget.EditText;\nimport androidx.test.espresso.matcher.BoundedMatcher;\nimport org.hamcrest.Description;\nimport org.hamcrest.Matcher;\n\n/**\n * A custom matcher that checks the hint property of an {@link EditText}. It\n * accepts either a {@link String} or a {@link Matcher}.\n */\npublic class HintMatcher {\n\n    static Matcher<View> withHint(final String substring) {\n        return withHint(is(substring));\n    }\n\n    static Matcher<View> withHint(final Matcher<String> stringMatcher) {\n        checkNotNull(stringMatcher);\n        return new BoundedMatcher<View, EditText>(EditText.class) {\n\n            @Override\n            public boolean matchesSafely(EditText view) {\n                final CharSequence hint = view.getHint();\n                return hint != null && stringMatcher.matches(hint.toString());\n            }\n\n            @Override\n            public void describeTo(Description description) {\n                description.appendText(\"with hint: \");\n                stringMatcher.describeTo(description);\n            }\n        };\n    }\n}\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/app/src/sharedTest/java/com/example/android/testing/espresso/CustomMatcherSample/HintMatchersTest.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.CustomMatcherSample;\n\nimport static androidx.test.core.app.ApplicationProvider.getApplicationContext;\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.action.ViewActions.click;\nimport static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;\nimport static androidx.test.espresso.action.ViewActions.typeText;\nimport static androidx.test.espresso.assertion.ViewAssertions.matches;\nimport static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;\nimport static androidx.test.espresso.matcher.ViewMatchers.withId;\nimport static androidx.test.espresso.matcher.ViewMatchers.withText;\nimport static org.hamcrest.Matchers.anyOf;\nimport static org.hamcrest.Matchers.endsWith;\nimport static org.hamcrest.Matchers.not;\n\nimport androidx.test.ext.junit.rules.ActivityScenarioRule;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.filters.LargeTest;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.robolectric.annotation.LooperMode;\nimport org.robolectric.annotation.TextLayoutMode;\n\n/**\n * Tests for {@link MainActivity} showcasing the use of custom matchers (see\n * {@link HintMatcher#withHint}).\n */\n@RunWith(AndroidJUnit4.class)\n@LargeTest\n// Configure Robolectric to use the more realistic text layout and threading model.\n// These annotations can be removed once this is default behavior in Robolectric\n@TextLayoutMode(TextLayoutMode.Mode.REALISTIC)\n@LooperMode(LooperMode.Mode.PAUSED)\npublic class HintMatchersTest {\n\n    private static final String INVALID_STRING_TO_BE_TYPED = \"Earl Grey\";\n\n    private static final String COFFEE_ENDING = \"coffee?\";\n\n    private static final String COFFEE_INVALID_ENDING = \"tea?\";\n\n    // A valid string with a valid ending\n    private String mStringWithValidEnding;\n\n    // A valid string from the coffee preparations\n    private String mValidStringToBeTyped;\n\n    /**\n     * {@link ActivityScenarioRule} will create and launch of the activity for you.\n     */\n    @Rule public ActivityScenarioRule<MainActivity> activityScenarioRule =\n        new ActivityScenarioRule<MainActivity>(MainActivity.class);\n\n    @Before\n    public void initValidStrings() {\n        // Produce a string with valid ending.\n        mStringWithValidEnding = \"Random \" + MainActivity.VALID_ENDING;\n\n        // Get one of the available coffee preparations.\n        mValidStringToBeTyped = MainActivity.COFFEE_PREPARATIONS.get(0);\n    }\n\n    /**\n     * Uses a custom matcher {@link HintMatcher#withHint}, with a {@link String} as the argument.\n     */\n    @Test\n    public void hint_isDisplayedInEditText() {\n        String hintText = getApplicationContext().getResources().getString(R.string.hint);\n\n        onView(withId(R.id.editText)).check(matches(HintMatcher.withHint(hintText)));\n    }\n\n    /**\n     * Same as above but using a {@link org.hamcrest.Matcher} as the argument.\n     */\n    @SuppressWarnings(\"unchecked\")\n    @Test\n    public void hint_endsWith() {\n        // This check will probably fail if the app is localized and the language is changed. Avoid\n        // string literals in code!\n        onView(withId(R.id.editText)).check(matches(HintMatcher.withHint(anyOf(\n                endsWith(COFFEE_ENDING), endsWith(COFFEE_INVALID_ENDING)))));\n    }\n\n    @Test\n    public void editText_canBeTypedInto() {\n        onView(withId(R.id.editText))\n                .perform(typeText(mValidStringToBeTyped), closeSoftKeyboard())\n                .check(matches(withText(mValidStringToBeTyped)));\n    }\n\n    @Test\n    public void validation_resultIsOneOfTheValidStrings() {\n        // Type a valid string and click on the button.\n        onView(withId(R.id.editText))\n                .perform(typeText(mValidStringToBeTyped), closeSoftKeyboard());\n        onView(withId(R.id.button)).perform(click());\n\n        // Check that the correct sign is displayed.\n        onView(withId(R.id.inputValidationSuccess)).check(matches(isDisplayed()));\n        onView(withId(R.id.inputValidationError)).check(matches(not(isDisplayed())));\n    }\n\n    @Test\n    public void validation_resultHasCorrectEnding() {\n        // Type a string with a valid ending and click on the button.\n        onView(withId(R.id.editText))\n                .perform(typeText(mStringWithValidEnding), closeSoftKeyboard());\n        onView(withId(R.id.button)).perform(click());\n\n        // Check that the correct sign is displayed.\n        onView(withId(R.id.inputValidationSuccess)).check(matches(isDisplayed()));\n        onView(withId(R.id.inputValidationError)).check(matches(not(isDisplayed())));\n    }\n\n    @Test\n    public void validation_resultIsIncorrect() {\n        // Type a valid string and click on the button.\n        onView(withId(R.id.editText))\n                .perform(typeText(INVALID_STRING_TO_BE_TYPED), closeSoftKeyboard());\n        onView(withId(R.id.button)).perform(click());\n\n        // Check that the correct sign is displayed.\n        onView(withId(R.id.inputValidationError)).check(matches(isDisplayed()));\n        onView(withId(R.id.inputValidationSuccess)).check(matches(not(isDisplayed())));\n    }\n}"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    androidxAnnotationVersion = \"1.5.0\"\n    guavaVersion = \"31.1-android\"\n    coreVersion = \"1.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    runnerVersion = \"1.6.1\"\n    rulesVersion = \"1.6.1\"\n    espressoVersion = \"3.6.1\"\n    robolectricVersion = \"4.13\"\n}\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonFinalResIds=false\nandroid.nonTransitiveRClass=false\nandroid.useAndroidX=true\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "ui/espresso/CustomMatcherSample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "ui/espresso/DataAdapterSample/.gitignore",
    "content": ".gradle\nlocal.properties\n.idea\n.DS_Store\nbuild\n*.iml"
  },
  {
    "path": "ui/espresso/DataAdapterSample/BUILD.bazel",
    "content": "load(\"@rules_jvm_external//:defs.bzl\", \"artifact\")\nload(\"//:common_defs.bzl\", \"minSdkVersion\", \"targetSdkVersion\")\n\nlicenses([\"notice\"])  # Apache 2.0\n\nandroid_library(\n    name = \"DataAdapterSampleLib\",\n    srcs = glob([\"app/src/main/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.DataAdapterSample\",\n    manifest = \"app/src/main/AndroidManifest.xml\",\n    resource_files = glob([\"app/src/main/res/**/*\"]),\n    deps = [\n        artifact(\"androidx.annotation:annotation\"),\n        artifact(\"com.google.guava:guava\"),\n    ],\n)\n\nandroid_binary(\n    name = \"DataAdapterSample\",\n    custom_package = \"com.example.android.testing.espresso.DataAdapterSample\",\n    manifest = \"app/src/main/AppManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":DataAdapterSampleLib\"],\n)\n\nandroid_library(\n    name = \"DataAdapterSampleTestLib\",\n    srcs = glob([\"app/src/sharedTest/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.DataAdapterSample.test\",\n    deps = [\n        \":DataAdapterSampleLib\",\n        \"//:test_deps\",\n    ],\n)\n\nandroid_binary(\n    name = \"DataAdapterSampleTest\",\n    custom_package = \"com.example.android.testing.espresso.DataAdapterSample.test\",\n    instruments = \":DataAdapterSample\",\n    manifest = \"app/src/androidTest/AndroidManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":DataAdapterSampleTestLib\"],\n)\n\nAPI_LEVELS = [\n    \"19_x86\",\n    \"21_x86\",\n    \"22_x86\",\n    \"23_x86\",\n]\n\n[android_instrumentation_test(\n    name = \"DataAdapterSampleInstrumentationTest_%s\" % API_LEVEL,\n    target_device = \"@android_test_support//tools/android/emulated_devices/generic_phone:android_%s_qemu2\" % API_LEVEL,\n    test_app = \":DataAdapterSampleTest\",\n) for API_LEVEL in API_LEVELS]\n"
  },
  {
    "path": "ui/espresso/DataAdapterSample/README.md",
    "content": "# Data Adapter sample for Espresso\n\nAn AdapterView (like ListView, GridView, etc.) is a view bound to an Adapter that determines the\nview's children. In Espresso, you can match these children views using the onData() method instead of\nonView() as you would do normally. Instead of matching views, onData() matches the data that is\nbound to each view item.\n\nThis project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio is recommended.\n\n1. Download the project code, preferably using `git clone`.\n1. Open the Android SDK Manager (*Tools* Menu | *Android*) and make sure you have installed the *Android testing support library Repository* under *Extras*.\n1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n1. Check out the relevant code:\n    * The application under test is located in `src/main/java`\n    * Tests are in `src/androidTest/java`\n1. Create the test configuration with a custom runner: `androidx.test.runner.AndroidJUnitRunner`\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *Android Tests* configuration\n    * Choose a module\n    * Add a *Specific instrumentation runner*: `androidx.test.runner.AndroidJUnitRunner`\n1. Connect a device or start an emulator\n    * Turn animations off.\n    (On your device, under Settings->Developer options disable the following 3 settings: \"Window animation scale\", \"Transition animation scale\" and \"Animator duration scale\")\n1. Run the newly created configuration\n\nThe application will be started on the device/emulator and a series of actions will be performed automatically.\n\nIf you are using Android Studio, the *Run* window will show the test results.\n"
  },
  {
    "path": "ui/espresso/DataAdapterSample/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\nandroid {\n    compileSdk 34\n    defaultConfig {\n        applicationId \"com.example.android.testing.espresso.DataAdapterSample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n\n    }\n    productFlavors {\n    }\n    testOptions {\n        unitTests {\n            includeAndroidResources = true\n        }\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    // share test source between local test and androidTest\n    sourceSets {\n        test {\n            java.srcDir \"src/sharedTest/java\"\n        }\n        androidTest {\n            java.srcDir \"src/sharedTest/java\"\n        }\n    }\n    namespace \"com.example.android.testing.espresso.DataAdapterSample\"\n    testNamespace \"com.example.android.testing.espresso.DataAdapterSample.test\"\n}\n\ndependencies {\n    // App dependencies\n    implementation \"androidx.annotation:annotation:\" + rootProject.androidxAnnotationVersion;\n    implementation \"com.google.guava:guava:\" + rootProject.guavaVersion\n\n    // Testing-only dependencies\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion;\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion;\n    androidTestImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion;\n\n    testImplementation \"androidx.test:core:\" + rootProject.coreVersion;\n    testImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    testImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion;\n    testImplementation \"org.robolectric:robolectric:\" + rootProject.robolectricVersion\n}\n"
  },
  {
    "path": "ui/espresso/DataAdapterSample/app/src/androidTest/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      xmlns:tools=\"http://schemas.android.com/tools\"\n    android:versionCode=\"1\"\n      android:versionName=\"1.0\">\n\n    <instrumentation android:targetPackage=\"com.example.android.testing.espresso.DataAdapterSample\"\n                     android:name=\"androidx.test.runner.AndroidJUnitRunner\"/>\n\n    <application tools:replace=\"label\" android:label=\"DataAdapterSampleTest\" />\n</manifest>\n"
  },
  {
    "path": "ui/espresso/DataAdapterSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.example.android.testing.espresso.DataAdapterSample.LongListActivity\"\n            android:label=\"@string/app_name\"\n            android:exported=\"true\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/DataAdapterSample/app/src/main/AppManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2018 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example.android.testing.espresso.DataAdapterSample\" >\n\n    <uses-sdk android:minSdkVersion=\"14\" android:targetSdkVersion=\"28\" />\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/DataAdapterSample/app/src/main/java/com/example/android/testing/espresso/DataAdapterSample/LongListActivity.java",
    "content": "/*\n * Copyright (C) 2015 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.DataAdapterSample;\n\nimport com.google.common.collect.Maps;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport androidx.annotation.VisibleForTesting;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.ListAdapter;\nimport android.widget.ListView;\nimport android.widget.SimpleAdapter;\nimport android.widget.TextView;\n\nimport java.util.ArrayList;\nimport java.util.List;\nimport java.util.Map;\n\n/**\n * An activity displaying a long list with a text view and a toggle button. The last clicked row is\n * displayed at the top.\n */\npublic class LongListActivity extends Activity {\n\n    @VisibleForTesting\n    protected static final String ROW_TEXT = \"ROW_TEXT\";\n\n    @VisibleForTesting\n    protected static final String ROW_ENABLED = \"ROW_ENABLED\";\n\n    @VisibleForTesting\n    protected static final int NUMBER_OF_ITEMS = 100;\n\n    @VisibleForTesting\n    protected static final String ITEM_TEXT_FORMAT = \"item: %d\";\n\n    private List<Map<String, Object>> data = new ArrayList<Map<String, Object>>();\n\n    private LayoutInflater layoutInflater;\n\n    @Override\n    public void onCreate(Bundle bundle) {\n        super.onCreate(bundle);\n        setContentView(R.layout.list_activity);\n        populateData();\n\n        ListView listView = (ListView) findViewById(R.id.list);\n        String[] from = new String[]{ROW_TEXT, ROW_ENABLED};\n        int[] to = new int[]{R.id.rowContentTextView, R.id.rowToggleButton};\n        layoutInflater = getLayoutInflater();\n\n        // Create the adapter for the list.\n        ListAdapter adapter = new LongListAdapter(from, to);\n\n        // Send the data to the list.\n        listView.setAdapter(adapter);\n    }\n\n    @VisibleForTesting\n    protected static Map<String, Object> makeItem(int forRow) {\n        Map<String, Object> dataRow = Maps.newHashMap();\n        dataRow.put(ROW_TEXT, String.format(ITEM_TEXT_FORMAT, forRow));\n        dataRow.put(ROW_ENABLED, forRow == 1);\n        return dataRow;\n    }\n\n    private void populateData() {\n        for (int i = 0; i < NUMBER_OF_ITEMS; i++) {\n            data.add(makeItem(i));\n        }\n    }\n\n    private class LongListAdapter extends SimpleAdapter {\n\n        public LongListAdapter(String[] from, int[] to) {\n            super(LongListActivity.this, LongListActivity.this.data, R.layout.list_item, from, to);\n        }\n\n        @Override\n        public View getView(final int position, View convertView, ViewGroup parent) {\n            // Inflate list items.\n            if (null == convertView) {\n                convertView = layoutInflater.inflate(R.layout.list_item, null);\n            }\n\n            convertView.setOnClickListener(new View.OnClickListener() {\n                @Override\n                public void onClick(View v) {\n                    ((TextView) findViewById(R.id.selection_row_value)).setText(\n                            String.valueOf(position));\n                }\n            });\n\n            return super.getView(position, convertView, parent);\n        }\n    }\n}"
  },
  {
    "path": "ui/espresso/DataAdapterSample/app/src/main/res/layout/list_activity.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<!-- XML for a screen with a list view. -->\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\"\n    android:paddingBottom=\"@dimen/activity_vertical_margin\"\n    android:paddingTop=\"@dimen/activity_vertical_margin\" >\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"@dimen/list_activity_click_header_height\" >\n\n        <TextView\n            android:id=\"@+id/selection_row\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/row_label\" />\n\n        <TextView\n            android:id=\"@+id/selection_row_value\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_marginLeft=\"@dimen/selection_row_value_margin\"\n            android:layout_marginStart=\"@dimen/selection_row_value_margin\" />\n    </LinearLayout>\n\n    <ListView\n        android:id=\"@+id/list\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\" />\n\n</LinearLayout>"
  },
  {
    "path": "ui/espresso/DataAdapterSample/app/src/main/res/layout/list_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n              android:id=\"@+id/item_wrapper\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"wrap_content\"\n              android:minHeight=\"@dimen/list_item_min_height\"\n              android:padding=\"@dimen/list_item_padding\"\n              android:orientation=\"horizontal\">\n\n    <TextView\n            android:id=\"@+id/rowContentTextView\"\n            android:layout_width=\"0dp\"\n            android:layout_height=\"wrap_content\"\n            android:textSize=\"16sp\"\n            android:layout_weight=\"1\"/>\n\n    <ToggleButton\n            android:id=\"@+id/rowToggleButton\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"\"/>\n\n</LinearLayout>"
  },
  {
    "path": "ui/espresso/DataAdapterSample/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n    <dimen name=\"list_activity_click_header_height\">24dp</dimen>\n    <dimen name=\"selection_row_value_margin\">12dp</dimen>\n    <dimen name=\"list_item_min_height\">56dp</dimen>\n    <dimen name=\"list_item_padding\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/DataAdapterSample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <string name=\"app_name\">Data Adapter Sample</string>\n    <string name=\"row_label\">Clicked on row</string>\n</resources>\n"
  },
  {
    "path": "ui/espresso/DataAdapterSample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/DataAdapterSample/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:ThemeOverlay.Material.Dark\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/DataAdapterSample/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/DataAdapterSample/app/src/sharedTest/java/com/example/android/testing/espresso/DataAdapterSample/LongListActivityTest.java",
    "content": "/*\n * Copyright (C) 2015 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.DataAdapterSample;\n\nimport androidx.test.ext.junit.rules.ActivityScenarioRule;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport androidx.test.core.app.ActivityScenario;\nimport androidx.test.espresso.DataInteraction;\nimport androidx.test.espresso.Espresso;\nimport androidx.test.espresso.action.ViewActions;\nimport androidx.test.espresso.matcher.ViewMatchers;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.filters.LargeTest;\n\nimport static androidx.test.espresso.Espresso.onData;\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.action.ViewActions.click;\nimport static androidx.test.espresso.assertion.ViewAssertions.doesNotExist;\nimport static androidx.test.espresso.assertion.ViewAssertions.matches;\nimport static androidx.test.espresso.matcher.ViewMatchers.isChecked;\nimport static androidx.test.espresso.matcher.ViewMatchers.isCompletelyDisplayed;\nimport static androidx.test.espresso.matcher.ViewMatchers.withId;\nimport static androidx.test.espresso.matcher.ViewMatchers.withText;\nimport static org.hamcrest.Matchers.equalTo;\nimport static org.hamcrest.Matchers.hasEntry;\nimport static org.hamcrest.Matchers.is;\n\n/**\n * Tests to verify that the behavior of {@link LongListActivity} is correct.\n * <p>\n * Note that in order to scroll the list you shouldn't use {@link ViewActions#scrollTo()} as\n * {@link Espresso#onData(org.hamcrest.Matcher)} handles scrolling.</p>\n *\n * @see #onRow(String)\n */\n@RunWith(AndroidJUnit4.class)\n@LargeTest\npublic class LongListActivityTest {\n\n    private static final String TEXT_ITEM_30 = \"item: 30\";\n\n    private static final String TEXT_ITEM_30_SELECTED = \"30\";\n\n    private static final String TEXT_ITEM_60 = \"item: 60\";\n\n    // Match the last item by matching its text.\n    private static final String LAST_ITEM_ID = \"item: 99\";\n\n    /**\n     * Use {@link ActivityScenarioRule} to create and launch the activity under test. This is a\n     * replacement for {@link androidx.test.rule.ActivityTestRule}.\n     */\n    @Rule\n    public ActivityScenarioRule<LongListActivity> rule = new ActivityScenarioRule<>(\n        LongListActivity.class);\n\n    /**\n     * Test that the list is long enough for this sample, the last item shouldn't appear.\n     */\n    @Test\n    public void lastItem_NotDisplayed() {\n        // Last item should not exist if the list wasn't scrolled down.\n        onView(withText(LAST_ITEM_ID)).check(doesNotExist());\n    }\n\n    /**\n     * Check that the item is created. onData() takes care of scrolling.\n     */\n    @Test\n    public void list_Scrolls() {\n        onRow(LAST_ITEM_ID).check(matches(isCompletelyDisplayed()));\n    }\n\n    /**\n     * Clicks on a row and checks that the activity detected the click.\n     */\n    @Test\n    public void row_Click() {\n        // Click on one of the rows.\n        onRow(TEXT_ITEM_30).onChildView(withId(R.id.rowContentTextView)).perform(click());\n\n        // Check that the activity detected the click on the first column.\n        onView(ViewMatchers.withId(R.id.selection_row_value))\n                .check(matches(withText(TEXT_ITEM_30_SELECTED)));\n    }\n\n    /**\n     * Checks that a toggle button is checked after clicking on it.\n     */\n    @Test\n    public void toggle_Click() {\n        // Click on a toggle button.\n        onRow(TEXT_ITEM_30).onChildView(withId(R.id.rowToggleButton)).perform(click());\n\n        // Check that the toggle button is checked.\n        onRow(TEXT_ITEM_30).onChildView(withId(R.id.rowToggleButton)).check(matches(isChecked()));\n    }\n\n    /**\n     * Make sure that clicking on the toggle button doesn't trigger a click on the row.\n     */\n    @Test\n    public void toggle_ClickDoesntPropagate() {\n        // Click on one of the rows.\n        onRow(TEXT_ITEM_30).onChildView(withId(R.id.rowContentTextView)).perform(click());\n\n        // Click on the toggle button, in a different row.\n        onRow(TEXT_ITEM_60).onChildView(withId(R.id.rowToggleButton)).perform(click());\n\n        // Check that the activity didn't detect the click on the first column.\n        onView(ViewMatchers.withId(R.id.selection_row_value))\n                .check(matches(withText(TEXT_ITEM_30_SELECTED)));\n    }\n\n    /**\n     * Uses {@link Espresso#onData(org.hamcrest.Matcher)} to get a reference to a specific row.\n     * <p>\n     * Note: A custom matcher can be used to match the content and have more readable code.\n     * See the Custom Matcher Sample.\n     * </p>\n     *\n     * @param str the content of the field\n     * @return a {@link DataInteraction} referencing the row\n     */\n    private static DataInteraction onRow(String str) {\n        return onData(hasEntry(equalTo(LongListActivity.ROW_TEXT), is(str)));\n    }\n}"
  },
  {
    "path": "ui/espresso/DataAdapterSample/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    androidxAnnotationVersion = \"1.5.0\"\n    guavaVersion = \"31.1-android\"\n    coreVersion = \"1.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    runnerVersion = \"1.6.1\"\n    espressoVersion = \"3.6.1\"\n    robolectricVersion = \"4.13\"\n}\n"
  },
  {
    "path": "ui/espresso/DataAdapterSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "ui/espresso/DataAdapterSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonFinalResIds=false\nandroid.nonTransitiveRClass=false\nandroid.useAndroidX=true\n\n"
  },
  {
    "path": "ui/espresso/DataAdapterSample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "ui/espresso/DataAdapterSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "ui/espresso/DataAdapterSample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/.gitignore",
    "content": ".gradle\nlocal.properties\n.idea\n.DS_Store\nbuild\n*.iml\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/BUILD.bazel",
    "content": "licenses([\"notice\"])  # Apache 2.0\n\nload(\"//:common_defs.bzl\", \"minSdkVersion\", \"targetSdkVersion\")\nload(\"@rules_jvm_external//:defs.bzl\", \"artifact\")\n\nandroid_library(\n    name = \"EspressoDeviceSampleLib\",\n    srcs = glob([\"app/src/main/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.EspressoDeviceSample\",\n    manifest = \"app/src/main/AndroidManifest.xml\",\n    resource_files = glob([\"app/src/main/res/**/*\"]),\n)\n\nandroid_binary(\n    name = \"EspressoDeviceSample\",\n    custom_package = \"com.example.android.testing.espresso.EspressoDeviceSample\",\n    manifest = \"app/src/main/AppManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":EspressoDeviceSampleLib\"],\n)\n\nandroid_library(\n    name = \"EspressoDeviceSampleTestLib\",\n    srcs = glob([\"app/src/androidTest/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.EspressoDeviceSample.test\",\n    deps = [\n        \":EspressoDeviceSampleLib\",\n        \"//:test_deps\",\n    ],\n)\n\nandroid_binary(\n    name = \"EspressoDeviceSampleTest\",\n    custom_package = \"com.example.android.testing.espresso.EspressoDeviceSample.test\",\n    instruments = \":EspressoDeviceSample\",\n    manifest = \"app/src/androidTest/AndroidManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":EspressoDeviceSampleTestLib\"],\n)\n\nAPI_LEVELS = [\n    \"19_x86\",\n    \"21_x86\",\n    \"22_x86\",\n    \"23_x86\",\n]\n\n[android_instrumentation_test(\n    name = \"EspressoDeviceSampleInstrumentationTest_%s\" % API_LEVEL,\n    target_device = \"@android_test_support//tools/android/emulated_devices/generic_phone:android_%s_qemu2\" % API_LEVEL,\n    test_app = \":EspressoDeviceSampleTest\",\n) for API_LEVEL in API_LEVELS]\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/README.md",
    "content": "# Basic sample for Espresso Device\n\nThe Espresso Device API enables synchronized interactions with the test device. This API is experimental and subject to change. Currently, it is only supported on instrumentation tests run on emulators.\n\nTo skip tests on devices that do not have certain display attributes, such as display width and height, annotate your test with @RequiresDisplay. This annotation takes in a WidthSizeClassEnum and a HeightSizeClassEnum. It can be applied to test classes or test methods. For details on these size classes, see https://developer.android.com/guide/topics/large-screens/support-different-screen-sizes.\n\nThis project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio 3.4 is recommended.\n\n1. Download the project code, preferably using `git clone`.\n1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n1. Check out the relevant code:\n   * The application under test is located in `src/main/java`\n   * Instrumentation Tests are in `src/androidTest/java`\n   * Local Tests are in `src/test/java`\n1. Create and run the Instrumented test configuration\n   * Open *Run* menu | *Edit Configurations*\n   * Add a new *Android Instrumented Tests* configuration\n   * Choose the `app` module\n   * Connect a device or start an emulator\n   * Turn animations off.\n     (On your device, under Settings->Developer options disable the following 3 settings: \"Window animation scale\", \"Transition animation scale\" and \"Animator duration scale\")\n   * Run the newly created configuration\n   * The application will be started on the device/emulator and a series of actions will be performed automatically.\n\nIf you are using Android Studio, the *Run* window will show the test results."
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\napply plugin: \"kotlin-android\"\n\nandroid {\n    compileSdk 34\n    defaultConfig {\n        applicationId \"com.example.android.testing.espresso.EspressoDeviceSample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    productFlavors {\n    }\n    testOptions {\n\n        emulatorControl {\n            enable = true\n        }\n        unitTests {\n            includeAndroidResources = true\n        }\n        managedDevices {\n            devices {\n                // run with ./gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    // The androidx.test screenshot APIs will automatically enable hardware rendering\n                    // to take a screenshot\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    namespace \"com.example.android.testing.espresso.EspressoDeviceSample\"\n    testNamespace \"com.example.android.testing.espresso.EspressoDeviceSample.test\"\n    lint {\n        abortOnError false\n    }\n}\n\ntasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {\n    kotlinOptions {\n        jvmTarget = \"1.8\"\n    }\n}\n\ndependencies {\n    androidTestImplementation \"org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion\"\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion\n    androidTestImplementation \"androidx.test.ext:junit-ktx:\" + rootProject.extJUnitVersion\n    androidTestImplementation \"androidx.test.espresso:espresso-device:\" + rootProject.espressoDeviceVersion\n\n    testImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion\n    testImplementation \"junit:junit:4.12\"\n    testImplementation \"org.robolectric:robolectric:\" + rootProject.robolectricVersion\n}\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/app/src/androidTest/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2022 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      xmlns:tools=\"http://schemas.android.com/tools\"\n    android:versionCode=\"1\"\n      android:versionName=\"1.0\">\n\n    <instrumentation android:targetPackage=\"com.example.android.testing.espresso.EspressoDeviceSample\"\n                     android:name=\"androidx.test.runner.AndroidJUnitRunner\"/>\n\n    <application tools:replace=\"label\" android:label=\"EspressoDeviceSampleTest\" />\n</manifest>\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/app/src/androidTest/java/com/example/android/testing/espresso/EspressoDeviceSample/RequiresDisplayTest.kt",
    "content": "/*\n * Copyright 2022, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.example.android.testing.espresso.EspressoDeviceSample\n\nimport androidx.test.espresso.device.filter.RequiresDisplay\nimport androidx.test.espresso.device.sizeclass.HeightSizeClass\nimport androidx.test.espresso.device.sizeclass.WidthSizeClass\nimport androidx.test.ext.junit.runners.AndroidJUnit4\nimport org.junit.Test\nimport org.junit.runner.RunWith\n\n/*\n * Illustrates usage of @RequiresDisplay API to filter tests based on display attributes such a screen size.\n */\n@RunWith(AndroidJUnit4::class)\nclass RequiresDisplayTest {\n    @RequiresDisplay(\n        widthSizeClass = WidthSizeClass.Companion.WidthSizeClassEnum.COMPACT,\n        heightSizeClass = HeightSizeClass.Companion.HeightSizeClassEnum.COMPACT\n    )\n    @Test\n    fun testOnDevicesWithCompactWidthAndHeight() {}\n\n    @RequiresDisplay(\n        widthSizeClass = WidthSizeClass.Companion.WidthSizeClassEnum.COMPACT,\n        heightSizeClass = HeightSizeClass.Companion.HeightSizeClassEnum.MEDIUM\n    )\n    @Test\n    fun testOnDevicesWithCompactWidthAndMediumHeight() {}\n\n    @RequiresDisplay(\n        widthSizeClass = WidthSizeClass.Companion.WidthSizeClassEnum.MEDIUM,\n        heightSizeClass = HeightSizeClass.Companion.HeightSizeClassEnum.COMPACT\n    )\n    @Test\n    fun testOnDevicesWithMediumWidthAndCompactHeight() {}\n\n    @RequiresDisplay(\n        widthSizeClass = WidthSizeClass.Companion.WidthSizeClassEnum.COMPACT,\n        heightSizeClass = HeightSizeClass.Companion.HeightSizeClassEnum.EXPANDED\n    )\n    @Test\n    fun testOnDevicesWithCompactWidthAndExpandedHeight() {}\n\n    @RequiresDisplay(\n        widthSizeClass = WidthSizeClass.Companion.WidthSizeClassEnum.EXPANDED,\n        heightSizeClass = HeightSizeClass.Companion.HeightSizeClassEnum.COMPACT\n    )\n    @Test\n    fun testOnDevicesWithExpandedWidthAndCompactHeight() {}\n\n    @RequiresDisplay(\n        widthSizeClass = WidthSizeClass.Companion.WidthSizeClassEnum.MEDIUM,\n        heightSizeClass = HeightSizeClass.Companion.HeightSizeClassEnum.MEDIUM\n    )\n    @Test\n    fun testOnDevicesWithMediumWidthAndHeight() {}\n\n    @RequiresDisplay(\n        widthSizeClass = WidthSizeClass.Companion.WidthSizeClassEnum.EXPANDED,\n        heightSizeClass = HeightSizeClass.Companion.HeightSizeClassEnum.MEDIUM,\n    )\n    @Test\n    fun testOnDevicesWithExpandedWidthAndMediumHeight() {}\n\n\n    @RequiresDisplay(\n        widthSizeClass = WidthSizeClass.Companion.WidthSizeClassEnum.MEDIUM,\n        heightSizeClass = HeightSizeClass.Companion.HeightSizeClassEnum.EXPANDED\n    )\n    @Test\n    fun testOnDevicesWithMediumWidthAndExpandedHeight() {}\n\n    @RequiresDisplay(\n        widthSizeClass = WidthSizeClass.Companion.WidthSizeClassEnum.EXPANDED,\n        heightSizeClass = HeightSizeClass.Companion.HeightSizeClassEnum.EXPANDED\n    )\n    @Test\n    fun testOnDevicesWithExpandedWidthAndHeight() {}\n}"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/app/src/androidTest/java/com/example/android/testing/espresso/EspressoDeviceSample/ResizeDisplayTest.kt",
    "content": "/*\n * Copyright (C) 2022 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *   http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.EspressoDeviceSample\n\nimport androidx.test.espresso.device.DeviceInteraction.Companion.setDisplaySize\nimport androidx.test.espresso.device.EspressoDevice.Companion.onDevice\nimport androidx.test.espresso.device.filter.RequiresDisplay\nimport androidx.test.espresso.device.rules.DisplaySizeRule\nimport androidx.test.espresso.device.sizeclass.HeightSizeClass\nimport androidx.test.espresso.device.sizeclass.WidthSizeClass\nimport androidx.test.espresso.device.sizeclass.WidthSizeClass.Companion.WidthSizeClassEnum\nimport androidx.test.espresso.device.sizeclass.HeightSizeClass.Companion.HeightSizeClassEnum\nimport androidx.test.ext.junit.rules.activityScenarioRule\nimport androidx.test.ext.junit.runners.AndroidJUnit4\nimport org.junit.Rule\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport androidx.test.espresso.device.sizeclass.WidthSizeClass.Companion.WidthSizeClassEnum.EXPANDED as EXPANDED1\n\n/*\n * Illustrates usage of [onDevice] API to change the display size.\n */\n@RunWith(AndroidJUnit4::class)\nclass ResizeDisplayTest {\n\n    @get:Rule(order = 1) var activityScenarioRule = activityScenarioRule<MainActivity>()\n\n    // Test rule for restoring device to its starting display size when a test case finishes\n    @get:Rule(order = 2) var displaySizeRule: DisplaySizeRule = DisplaySizeRule()\n\n    @Test\n    fun resizeWindow_compact() {\n        onDevice().setDisplaySize(\n            widthSizeClass = WidthSizeClass.COMPACT,\n            heightSizeClass = HeightSizeClass.COMPACT\n        )\n        // Verify visual attributes or state restoration\n    }\n\n    /**\n     * Setting the display size to EXPANDED would fail in small devices, so the [RequiresDisplay]\n     * annotation prevents this test from being run on devices outside the EXPANDED buckets.\n     */\n    @RequiresDisplay(\n        widthSizeClass = WidthSizeClassEnum.EXPANDED,\n        heightSizeClass = HeightSizeClassEnum.EXPANDED\n    )\n    @Test\n    fun resizeWindow_expanded() {\n        onDevice().setDisplaySize(\n            widthSizeClass = WidthSizeClass.EXPANDED,\n            heightSizeClass = HeightSizeClass.EXPANDED\n        )\n        // Verify visual attributes or state restoration\n    }\n}\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2022 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <uses-permission android:name=\"android.permission.INTERNET\" />\n\n    <application\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.example.android.testing.espresso.EspressoDeviceSample.MainActivity\"\n            android:label=\"@string/app_name\"\n            android:exported=\"true\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/app/src/main/AppManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2022 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example.android.testing.espresso.EspressoDeviceSample\" >\n\n    <uses-sdk android:minSdkVersion=\"14\" android:targetSdkVersion=\"28\" />\n</manifest>\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/app/src/main/java/com/example/android/testing/espresso/EspressoDeviceSample/MainActivity.java",
    "content": "/*\n * Copyright 2022, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.EspressoDeviceSample;\n\nimport android.app.Activity;\nimport android.os.Bundle;\n\n/**\n * An empty {@link Activity} that Espresso Device APIs are tested against.\n */\npublic class MainActivity extends Activity {\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n    }\n}\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2022 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n              xmlns:tools=\"http://schemas.android.com/tools\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"match_parent\"\n              android:orientation=\"vertical\"\n              android:padding=\"@dimen/activity_horizontal_margin\"\n              tools:context=\".MainActivity\">\n</LinearLayout>\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"header_margin\">32dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2022 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <string name=\"app_name\">Basic Espresso Device sample</string>\n    <string name=\"hello_world\">Hello Espresso!</string>\n</resources>\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Light\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/app/src/main/res/values-v13/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Holo.Light\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Material\"/>\n</resources>\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.kotlinVersion = \"1.9.22\"\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    robolectricVersion = \"4.13\"\n    extTruthVersion = \"1.6.0\"\n    extJUnitVersion = \"1.2.1\"\n    espressoDeviceVersion = \"1.0.0-alpha09\"\n}\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonFinalResIds=false\nandroid.nonTransitiveRClass=false\nandroid.useAndroidX=true\nandroid.experimental.androidTest.enableEmulatorControl=true\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "ui/espresso/EspressoDeviceSample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/.gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/caches\n/.idea/libraries\n/.idea/modules.xml\n/.idea/workspace.xml\n/.idea/navEditor.xml\n/.idea/assetWizardSettings.xml\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/README.md",
    "content": "# Sample for FragmentScenario with Espresso\n\n*A simple example that shows use of FragmentScenario with Espresso.*\n\nThis project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio 3.4 is recommended.\n\n1. Download the project code, preferably using `git clone`.\n1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n1. Check out the relevant code:\n    * The application under test is located in `src/main/java`\n    * The test source is located in `src/sharedTest/java`. There is a single set of test source that can be executed\n    either on local host using Robolectric or on emulator/device.\n1. Create and run the Android Instrumented Test configuration\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *Android Instrumented Tests* configuration\n    * Choose the `app` module\n    * Connect a device or start an emulator\n    * Turn animations off.\n    (On your device, under Settings->Developer options disable the following 3 settings: \"Window animation scale\", \"Transition animation scale\" and \"Animator duration scale\")\n    * Run the newly created configuration\n1. Create and run the local Test configuration\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *Android JUnit* configuration\n    * Set `Use classpath of module` to `app`\n    * Set `Class` to FragmentScenarioTest\n    * Run the configuration\n\nIf you are using Android Studio, the *Run* window will show the test results.\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\napply plugin: \"kotlin-android\"\n\nandroid {\n    compileSdk 34\n    defaultConfig {\n        applicationId \"com.example.android.testing.espresso.FragmentScenarioSample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile(\"proguard-android-optimize.txt\"), \"proguard-rules.pro\"\n        }\n    }\n    // share the unified tests\n    sourceSets {\n        test {\n            java.srcDir \"src/sharedTest/java\"\n        }\n        androidTest {\n            java.srcDir \"src/sharedTest/java\"\n        }\n    }\n    testOptions {\n        unitTests {\n            includeAndroidResources = true\n        }\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_8\n        targetCompatibility JavaVersion.VERSION_1_8\n    }\n    kotlinOptions {\n        jvmTarget = \"1.8\"\n    }\n    namespace \"com.example.android.testing.espresso.fragmentscenario\"\n}\n\ndependencies {\n    implementation fileTree(dir: \"libs\", include: [\"*.jar\"])\n    implementation \"org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion\"\n    implementation \"androidx.appcompat:appcompat:\" + rootProject.androidxCompatVersion\n    implementation \"androidx.core:core-ktx:\" + rootProject.androidxCoreVersion\n    implementation \"androidx.fragment:fragment-ktx:\" + rootProject.androidxFragmentVersion\n\n    // TODO: ideally this would only be present in test scope\n    debugImplementation \"androidx.fragment:fragment-testing:\" + rootProject.androidxFragmentVersion\n    debugImplementation \"androidx.test:core:\" + rootProject.coreVersion\n\n    testImplementation \"junit:junit:4.12\"\n    testImplementation \"org.robolectric:robolectric:\" + rootProject.robolectricVersion\n    testImplementation \"androidx.test:core:\" + rootProject.coreVersion\n    testImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion\n    testImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion\n    testImplementation \"com.google.truth:truth:\" + rootProject.truthVersion\n    testAnnotationProcessor \"com.google.auto.service:auto-service:1.0-rc4\"\n\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion\n    androidTestImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion\n    androidTestImplementation \"androidx.fragment:fragment-testing:\" + rootProject.androidxFragmentVersion\n    androidTestImplementation \"com.google.truth:truth:\" + rootProject.truthVersion\n    androidTestImplementation \"org.robolectric:annotations:\" + rootProject.robolectricVersion\n}\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguardFiles setting in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n\n# Uncomment this to preserve the line number information for\n# debugging stack traces.\n#-keepattributes SourceFile,LineNumberTable\n\n# If you keep the line number information, uncomment this to\n# hide the original source file name.\n#-renamesourcefileattribute SourceFile\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/app/src/main/AndroidManifest.xml",
    "content": "<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application android:allowBackup=\"true\"\n                 android:label=\"@string/app_name\"\n                 android:supportsRtl=\"true\"\n                 android:theme=\"@style/AppTheme\"/>\n</manifest>\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/app/src/main/java/com/example/android/testing/espresso/fragmentscenario/SampleDialogFragment.kt",
    "content": "package com.example.android.testing.espresso.fragmentscenario\n\nimport android.os.Bundle\nimport android.view.LayoutInflater\nimport android.view.View\nimport android.view.ViewGroup\nimport androidx.fragment.app.DialogFragment\n\n/**\n * A simple [DialogFragment] subclass.\n */\nclass SampleDialogFragment : DialogFragment() {\n\n  override fun onCreateView(\n    inflater: LayoutInflater, container: ViewGroup?,\n    savedInstanceState: Bundle?\n  ): View? = inflater.inflate(R.layout.fragment_sample, container, false)\n\n}\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/app/src/main/java/com/example/android/testing/espresso/fragmentscenario/SampleFragment.kt",
    "content": "package com.example.android.testing.espresso.fragmentscenario\n\nimport android.os.Bundle\nimport androidx.fragment.app.Fragment\nimport android.view.LayoutInflater\nimport android.view.View\nimport android.view.ViewGroup\n\n\n/**\n * A simple [Fragment] subclass.\n */\nclass SampleFragment : Fragment() {\n\n    override fun onCreateView(\n        inflater: LayoutInflater, container: ViewGroup?,\n        savedInstanceState: Bundle?\n    ): View? {\n        // Inflate the layout for this fragment\n        return inflater.inflate(R.layout.fragment_sample, container, false)\n    }\n\n}\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/app/src/main/res/layout/fragment_sample.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n             xmlns:tools=\"http://schemas.android.com/tools\"\n             android:layout_width=\"match_parent\"\n             android:layout_height=\"match_parent\"\n             tools:context=\".SampleFragment\">\n\n    <TextView\n            android:id=\"@+id/textView\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:text=\"@string/hello_fragment\"/>\n\n</FrameLayout>"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n    <color name=\"colorPrimary\">#008577</color>\n    <color name=\"colorPrimaryDark\">#00574B</color>\n    <color name=\"colorAccent\">#D81B60</color>\n</resources>\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/app/src/main/res/values/strings.xml",
    "content": "<resources>\n    <string name=\"app_name\">Sample Fragment</string>\n\n    <string name=\"hello_fragment\">I am a fragment</string>\n</resources>\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/app/src/main/res/values/styles.xml",
    "content": "<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"Theme.AppCompat.Light.DarkActionBar\">\n        <!-- Customize your theme here. -->\n        <item name=\"colorPrimary\">@color/colorPrimary</item>\n        <item name=\"colorPrimaryDark\">@color/colorPrimaryDark</item>\n        <item name=\"colorAccent\">@color/colorAccent</item>\n    </style>\n\n</resources>\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleDialogFragmentTest.kt",
    "content": "package com.example.android.testing.espresso.fragmentscenario\n\nimport androidx.fragment.app.testing.launchFragment\nimport androidx.fragment.app.testing.launchFragmentInContainer\nimport androidx.test.espresso.Espresso\nimport androidx.test.espresso.assertion.ViewAssertions\nimport androidx.test.espresso.matcher.RootMatchers.isDialog\nimport androidx.test.espresso.matcher.ViewMatchers\nimport androidx.test.ext.junit.runners.AndroidJUnit4\nimport com.google.common.truth.Truth.assertThat\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.robolectric.annotation.LooperMode\n\n/**\n * A test using the androidx.test unified API, which can execute on an Android device or locally using Robolectric.\n *\n * See [testing documentation](http://d.android.com/tools/testing).\n */\n@RunWith(AndroidJUnit4::class)\nclass SampleDialogFragmentTest {\n\n  @Test\n  fun launchDialogFragmentAndVerifyUI() {\n    // Use launchFragment to launch the dialog fragment in a dialog.\n    val scenario = launchFragment<SampleDialogFragment>()\n\n    scenario.onFragment { fragment ->\n      assertThat(fragment.dialog).isNotNull()\n      assertThat(fragment.requireDialog().isShowing).isTrue()\n    }\n\n    // Now use espresso to look for the fragment's text view and verify it is displayed.\n    Espresso.onView(ViewMatchers.withId(R.id.textView)).inRoot(isDialog())\n      .check(ViewAssertions.matches(ViewMatchers.withText(\"I am a fragment\")));\n  }\n\n  @Test\n  fun launchDialogFragmentEmbeddedToHostActivityAndVerifyUI() {\n    // Use launchFragmentInContainer to inflate a dialog fragment's view into Activity's content view.\n    val scenario = launchFragmentInContainer<SampleDialogFragment>()\n\n    scenario.onFragment { fragment ->\n      // Dialog is not created because you use launchFragmentInContainer and the view is inflated\n      // into the Activity's content view.\n      assertThat(fragment.dialog).isNull()\n    }\n\n    // Now use espresso to look for the fragment's text view and verify it is displayed.\n    Espresso.onView(ViewMatchers.withId(R.id.textView))\n      .check(ViewAssertions.matches(ViewMatchers.withText(\"I am a fragment\")));\n  }\n}\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/app/src/sharedTest/java/com/example/android/testing/espresso/fragmentscenario/SampleFragmentTest.kt",
    "content": "package com.example.android.testing.espresso.fragmentscenario\n\nimport androidx.fragment.app.testing.launchFragmentInContainer\nimport androidx.test.espresso.Espresso.onView\nimport androidx.test.espresso.assertion.ViewAssertions.matches\nimport androidx.test.espresso.matcher.ViewMatchers.withId\nimport androidx.test.espresso.matcher.ViewMatchers.withText\nimport androidx.test.ext.junit.runners.AndroidJUnit4\n\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.robolectric.annotation.LooperMode\n\n/**\n * A test using the androidx.test unified API, which can execute on an Android device or locally using Robolectric.\n *\n * See [testing documentation](http://d.android.com/tools/testing).\n */\n@RunWith(AndroidJUnit4::class)\nclass SampleFragmentTest {\n    @Test\n    fun launchFragmentAndVerifyUI() {\n        // use launchInContainer to launch the fragment with UI\n        launchFragmentInContainer<SampleFragment>()\n\n        // now use espresso to look for the fragment's text view and verify it is displayed\n        onView(withId(R.id.textView)).check(matches(withText(\"I am a fragment\")));\n    }\n}\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.kotlinVersion = \"1.9.22\"\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        google()\n        mavenCentral()\n        \n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\"\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n        mavenCentral()\n        \n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n\next {\n    buildToolsVersion = \"32.0.0\"\n    androidxCoreVersion = \"1.9.0\"\n    androidxCompatVersion = \"1.5.1\"\n    androidxFragmentVersion = \"1.5.3\"\n    coreVersion = \"1.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    runnerVersion = \"1.6.1\"\n    rulesVersion = \"1.6.1\"\n    espressoVersion = \"3.6.1\"\n    robolectricVersion = \"4.13\"\n    truthVersion = \"1.1.3\"\n}\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "#Sat Apr 27 14:01:24 PDT 2019\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx1536m\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n# AndroidX package structure to make it clearer which packages are bundled with the\n# Android operating system, and which are packaged with your app's APK\n# https://developer.android.com/topic/libraries/support-library/androidx-rn\nandroid.useAndroidX=true\n# Automatically convert third-party libraries to use AndroidX\nandroid.enableJetifier=true\n# Kotlin code style for this project: \"official\" or \"obsolete\":\nkotlin.code.style=official\nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonTransitiveRClass=false\nandroid.nonFinalResIds=false\n# use compiled resources for Robolectric. See http://robolectric.org/migrating/#migrating-to-40\n# Not needed for Android Studio 3.4+\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/gradlew",
    "content": "#!/usr/bin/env sh\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn () {\n    echo \"$*\"\n}\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" -a \"$nonstop\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=$(save \"$@\")\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\n# by default we should be in the correct project dir, but when run from Finder on Mac, the cwd is wrong\nif [ \"$(uname)\" = \"Darwin\" ] && [ \"$HOME\" = \"$PWD\" ]; then\n  cd \"$(dirname \"$0\")\"\nfi\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windows variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "ui/espresso/FragmentScenarioSample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/.gitignore",
    "content": ".gradle\nlocal.properties\n.idea\n.DS_Store\nbuild\n*.iml\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/BUILD.bazel",
    "content": "load(\"@rules_jvm_external//:defs.bzl\", \"artifact\")\nload(\"//:common_defs.bzl\", \"minSdkVersion\", \"targetSdkVersion\")\n\nlicenses([\"notice\"])  # Apache 2.0\n\nandroid_library(\n    name = \"IdlingResourceSampleLib\",\n    srcs = glob([\"app/src/main/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.IdlingResourceSample\",\n    manifest = \"app/src/main/AndroidManifest.xml\",\n    resource_files = glob([\"app/src/main/res/**/*\"]),\n    deps = [\n        artifact(\"androidx.annotation:annotation\"),\n        artifact(\"androidx.test.espresso:espresso-idling-resource\"),\n        artifact(\"com.google.guava:guava\"),\n    ],\n)\n\nandroid_binary(\n    name = \"IdlingResourceSample\",\n    custom_package = \"com.example.android.testing.espresso.IdlingResourceSample\",\n    manifest = \"app/src/main/AppManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":IdlingResourceSampleLib\"],\n)\n\nandroid_library(\n    name = \"IdlingResourceSampleTestLib\",\n    srcs = glob([\"app/src/androidTest/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.IdlingResourceSample.test\",\n    deps = [\n        artifact(\"androidx.test.espresso:espresso_idling_resource\"),\n        \":IdlingResourceSampleLib\",\n        \"//:test_deps\",\n    ],\n)\n\nandroid_binary(\n    name = \"IdlingResourceSampleTest\",\n    custom_package = \"com.example.android.testing.espresso.IdlingResourceSample.test\",\n    instruments = \":IdlingResourceSample\",\n    manifest = \"app/src/androidTest/AndroidManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":IdlingResourceSampleTestLib\"],\n)\n\nAPI_LEVELS = [\n    \"19_x86\",\n    \"21_x86\",\n    \"22_x86\",\n    \"23_x86\",\n]\n\n[android_instrumentation_test(\n    name = \"IdlingResourceSampleInstrumentationTest_%s\" % API_LEVEL,\n    target_device = \"@android_test_support//tools/android/emulated_devices/generic_phone:android_%s_qemu2\" % API_LEVEL,\n    test_app = \":IdlingResourceSampleTest\",\n) for API_LEVEL in API_LEVELS]\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/README.md",
    "content": "# Basic Idling Resource sample for Espresso\n\nThe centerpiece of Espresso is its ability to seamlessly synchronize all test operations with the application under test. By default, Espresso waits for UI events in the current message queue to be processed and default AsyncTasks* to complete before it moves on to the next test operation. This should address the majority of application/test synchronization in your application.\n\nHowever, there are instances where applications perform background operations (such as communicating with web services) via non-standard means; for example: direct creation and management of threads.\n\nThis sample showcases how to implement a very simple IdlingResource interface and expose it to a test. The application shows a message to the user after a delay that is executed on a different thread.\n\nConsider using the CountingIdlingResource class from the espresso-contrib package. It's a very easy to use Idling Resource implementation that can handle multiple parallel operations keeping track of the number of pending operations.\n\nNote that the `espresso-idling-resource` dependency is added into the `implementation` scope.\n\nThis sample use AndroidX:\n\n```\n    androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'\n    implementation 'androidx.test.espresso:espresso-idling-resource:3.1.1'\n```\n\nIf you haven't yet migrated to AndroidX:\n\n```\n\tandroidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'\n\timplementation 'com.android.support.test.espresso:espresso-idling-resource:3.0.2'\n```\n\n\nThis dependency and its implementation are added to the app under test but are not needed in production. This bloats the released app but it's kept this way to simplify the sample. You can:\n * ProGuard/shrink your release build to minimize impact\n * Use a build type or product flavor for tests and remove the Idling Resource classes in the production/release variant.\n * Add the dependency to `androidTestCompile` and inject an IdlingResource-aware MessageDelayer from the test.\n * Keep them, since the added methods and size are insignificant.\n\n\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/app/build.gradle",
    "content": "/*\n * Copyright 2016, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\napply plugin: \"com.android.application\"\n\nandroid {\n    compileSdk 34\n\n    defaultConfig {\n        applicationId \"com.example.android.testing.espresso.IdlingResourceSample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    testOptions {\n        unitTests {\n            includeAndroidResources = true\n        }\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    namespace \"com.example.android.testing.espresso.IdlingResourceSample\"\n    testNamespace \"com.example.android.testing.espresso.IdlingResourceSample.test\"\n    lint {\n        abortOnError false\n    }\n}\n\ndependencies {\n    // App dependencies\n    implementation \"androidx.annotation:annotation:\" + rootProject.androidxAnnotationVersion\n    implementation \"com.google.guava:guava:\" + rootProject.guavaVersion\n\n    // Testing-only dependencies\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion\n    androidTestImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion\n    // Note that espresso-idling-resource is used in the code under test.\n    implementation \"androidx.test.espresso:espresso-idling-resource:\" + rootProject.espressoVersion\n}\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/app/src/androidTest/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      xmlns:tools=\"http://schemas.android.com/tools\"\n    android:versionCode=\"1\"\n      android:versionName=\"1.0\">\n\n    <instrumentation android:targetPackage=\"com.example.android.testing.espresso.IdlingResourceSample\"\n                     android:name=\"androidx.test.runner.AndroidJUnitRunner\"/>\n\n    <application tools:replace=\"label\" android:label=\"IdlingResourceSampleTest\" />\n</manifest>\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/app/src/androidTest/java/com/example/android/testing/espresso/IdlingResourceSample/ChangeTextBehaviorTest.java",
    "content": "/*\n * Copyright 2016, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.IdlingResourceSample;\n\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.action.ViewActions.click;\nimport static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;\nimport static androidx.test.espresso.action.ViewActions.typeText;\nimport static androidx.test.espresso.assertion.ViewAssertions.matches;\nimport static androidx.test.espresso.matcher.ViewMatchers.withId;\nimport static androidx.test.espresso.matcher.ViewMatchers.withText;\n\nimport androidx.test.core.app.ActivityScenario;\nimport androidx.test.espresso.IdlingRegistry;\nimport androidx.test.espresso.IdlingResource;\nimport androidx.test.filters.LargeTest;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\n\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\n\n/**\n * Same as Espresso's BasicSample, but with an Idling Resource to help with synchronization.\n */\n@RunWith(AndroidJUnit4.class)\n@LargeTest\npublic class ChangeTextBehaviorTest {\n\n    private static final String STRING_TO_BE_TYPED = \"Espresso\";\n\n    private IdlingResource mIdlingResource;\n\n\n    /**\n     * Use {@link ActivityScenario to launch and get access to the activity.\n     * {@link ActivityScenario#onActivity(ActivityScenario.ActivityAction)} provides a thread-safe\n     * mechanism to access the activity.\n     */\n    @Before\n    public void registerIdlingResource() {\n        ActivityScenario activityScenario = ActivityScenario.launch(MainActivity.class);\n        activityScenario.onActivity(new ActivityScenario.ActivityAction<MainActivity>() {\n            @Override\n            public void perform(MainActivity activity) {\n                mIdlingResource = activity.getIdlingResource();\n                // To prove that the test fails, omit this call:\n                IdlingRegistry.getInstance().register(mIdlingResource);\n            }\n        });\n    }\n\n    @Test\n    public void changeText_sameActivity() {\n        // Type text and then press the button.\n        onView(withId(R.id.editTextUserInput))\n                .perform(typeText(STRING_TO_BE_TYPED), closeSoftKeyboard());\n        onView(withId(R.id.changeTextBt)).perform(click());\n\n        // Check that the text was changed.\n        onView(withId(R.id.textToBeChanged)).check(matches(withText(STRING_TO_BE_TYPED)));\n    }\n\n    @After\n    public void unregisterIdlingResource() {\n        if (mIdlingResource != null) {\n            IdlingRegistry.getInstance().unregister(mIdlingResource);\n        }\n    }\n}"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2016, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n    <application android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.example.android.testing.espresso.IdlingResourceSample.MainActivity\"\n            android:label=\"@string/app_name\"\n            android:exported=\"true\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/app/src/main/AppManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2018, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example.android.testing.espresso.IdlingResourceSample\" >\n\n    <uses-sdk android:minSdkVersion=\"14\" android:targetSdkVersion=\"28\" />\n\n    <application\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.example.android.testing.espresso.IdlingResourceSample.MainActivity\"\n            android:label=\"@string/app_name\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/app/src/main/java/com/example/android/testing/espresso/IdlingResourceSample/IdlingResource/SimpleIdlingResource.java",
    "content": "/*\n * Copyright 2016, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.IdlingResourceSample.IdlingResource;\n\nimport androidx.annotation.Nullable;\nimport androidx.test.espresso.IdlingResource;\n\nimport java.util.concurrent.atomic.AtomicBoolean;\n\n/**\n * A very simple implementation of {@link IdlingResource}.\n * <p>\n * Consider using CountingIdlingResource from espresso-contrib package if you use this class from\n * multiple threads or need to keep a count of pending operations.\n */\n\npublic class SimpleIdlingResource implements IdlingResource {\n\n    @Nullable private volatile ResourceCallback mCallback;\n\n    // Idleness is controlled with this boolean.\n    private AtomicBoolean mIsIdleNow = new AtomicBoolean(true);\n\n    @Override\n    public String getName() {\n        return this.getClass().getName();\n    }\n\n    @Override\n    public boolean isIdleNow() {\n        return mIsIdleNow.get();\n    }\n\n    @Override\n    public void registerIdleTransitionCallback(ResourceCallback callback) {\n        mCallback = callback;\n    }\n\n    /**\n     * Sets the new idle state, if isIdleNow is true, it pings the {@link ResourceCallback}.\n     * @param isIdleNow false if there are pending operations, true if idle.\n     */\n    public void setIdleState(boolean isIdleNow) {\n        mIsIdleNow.set(isIdleNow);\n        if (isIdleNow && mCallback != null) {\n            mCallback.onTransitionToIdle();\n        }\n    }\n}\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/app/src/main/java/com/example/android/testing/espresso/IdlingResourceSample/MainActivity.java",
    "content": "/*\n * Copyright 2016, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.IdlingResourceSample;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport androidx.annotation.NonNull;\nimport androidx.annotation.Nullable;\nimport androidx.annotation.VisibleForTesting;\nimport androidx.test.espresso.IdlingResource;\nimport android.view.View;\nimport android.widget.EditText;\nimport android.widget.TextView;\n\nimport com.example.android.testing.espresso.IdlingResourceSample.IdlingResource.SimpleIdlingResource;\n\n/**\n * Gets a text String from the user and displays it back after a while.\n */\npublic class MainActivity extends Activity implements View.OnClickListener,\n        MessageDelayer.DelayerCallback {\n\n    // The TextView used to display the message inside the Activity.\n    private TextView mTextView;\n\n    // The EditText where the user types the message.\n    private EditText mEditText;\n\n    // The Idling Resource which will be null in production.\n    @Nullable private SimpleIdlingResource mIdlingResource;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        // Set the listeners for the buttons.\n        findViewById(R.id.changeTextBt).setOnClickListener(this);\n\n        mTextView = (TextView) findViewById(R.id.textToBeChanged);\n        mEditText = (EditText) findViewById(R.id.editTextUserInput);\n    }\n\n    @Override\n    public void onClick(View view) {\n        // Get the text from the EditText view.\n        final String text = mEditText.getText().toString();\n\n        if (view.getId() == R.id.changeTextBt) {\n            // Set a temporary text.\n            mTextView.setText(R.string.waiting_msg);\n            // Submit the message to the delayer.\n            MessageDelayer.processMessage(text, this, mIdlingResource);\n        }\n    }\n\n    @Override\n    public void onDone(String text) {\n        // The delayer notifies the activity via a callback.\n        mTextView.setText(text);\n    }\n\n    /**\n     * Only called from test, creates and returns a new {@link SimpleIdlingResource}.\n     */\n    @VisibleForTesting\n    @NonNull\n    public IdlingResource getIdlingResource() {\n        if (mIdlingResource == null) {\n            mIdlingResource = new SimpleIdlingResource();\n        }\n        return mIdlingResource;\n    }\n}\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/app/src/main/java/com/example/android/testing/espresso/IdlingResourceSample/MessageDelayer.java",
    "content": "/*\n * Copyright 2016, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.IdlingResourceSample;\n\nimport android.os.Handler;\nimport androidx.annotation.Nullable;\nimport androidx.test.espresso.IdlingResource;\n\nimport com.example.android.testing.espresso.IdlingResourceSample.IdlingResource.SimpleIdlingResource;\n\n/**\n * Takes a String and returns it after a while via a callback.\n * <p>\n * This executes a long-running operation on a different thread that results in problems with\n * Espresso if an {@link IdlingResource} is not implemented and registered.\n */\nclass MessageDelayer {\n\n    private static final int DELAY_MILLIS = 3000;\n\n    interface DelayerCallback {\n        void onDone(String text);\n    }\n\n    /**\n     * Takes a String and returns it after {@link #DELAY_MILLIS} via a {@link DelayerCallback}.\n     * @param message the String that will be returned via the callback\n     * @param callback used to notify the caller asynchronously\n     */\n    static void processMessage(final String message, final DelayerCallback callback,\n            @Nullable final SimpleIdlingResource idlingResource) {\n        // The IdlingResource is null in production.\n        if (idlingResource != null) {\n            idlingResource.setIdleState(false);\n        }\n\n        // Delay the execution, return message via callback.\n        Handler handler = new Handler();\n        handler.postDelayed(new Runnable() {\n            @Override\n            public void run() {\n                if (callback != null) {\n                    callback.onDone(message);\n                    if (idlingResource != null) {\n                        idlingResource.setIdleState(true);\n                    }\n                }\n            }\n        }, DELAY_MILLIS);\n    }\n}\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2016, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n              xmlns:tools=\"http://schemas.android.com/tools\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"match_parent\"\n              android:orientation=\"vertical\"\n              android:padding=\"@dimen/activity_horizontal_margin\"\n              tools:context=\".MainActivity\">\n\n\n    <TextView\n            android:id=\"@+id/textToBeChanged\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginBottom=\"@dimen/header_margin\"\n            android:layout_marginTop=\"@dimen/header_margin\"\n            android:text=\"@string/hello_world\"\n            android:textAppearance=\"?android:attr/textAppearanceLarge\"/>\n\n\n    <EditText\n            android:id=\"@+id/editTextUserInput\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:hint=\"@string/type_something\"/>\n\n    <Button\n            style=\"?android:attr/buttonStyleSmall\"\n            android:id=\"@+id/changeTextBt\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/change_text\"\n            android:layout_gravity=\"center_horizontal\"/>\n\n</LinearLayout>\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2016, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"header_margin\">32dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2016, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <string name=\"app_name\">Basic Idling Resource sample</string>\n    <string name=\"hello_world\">Hello Espresso!</string>\n    <string name=\"change_text\">Change text taking some time</string>\n    <string name=\"type_something\">type something…</string>\n    <string name=\"waiting_msg\">Waiting for message…</string>\n</resources>\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2016, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Light\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/app/src/main/res/values-v13/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2016, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Holo.Light\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2016, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Material\"/>\n</resources>\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2016, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/build.gradle",
    "content": "/*\n * Copyright 2016, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    androidxAnnotationVersion = \"1.5.0\"\n    guavaVersion = \"31.1-android\"\n    coreVersion = \"1.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    runnerVersion = \"1.6.1\"\n    espressoVersion = \"3.6.1\"\n}\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonFinalResIds=false\nandroid.nonTransitiveRClass=false\nandroid.useAndroidX=true"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "ui/espresso/IdlingResourceSample/settings.gradle",
    "content": "/*\n * Copyright 2016, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ninclude ':app'\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/BUILD.bazel",
    "content": "load(\"@rules_jvm_external//:defs.bzl\", \"artifact\")\nload(\"//:common_defs.bzl\", \"minSdkVersion\", \"targetSdkVersion\")\n\nlicenses([\"notice\"])  # Apache 2.0\n\nandroid_library(\n    name = \"IntentsAdvancedSampleLib\",\n    srcs = glob([\"app/src/main/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.intents.AdvancedSample\",\n    manifest = \"app/src/main/AndroidManifest.xml\",\n    resource_files = glob([\"app/src/main/res/**/*\"]),\n    deps = [\n        artifact(\"androidx.annotation:annotation\"),\n        artifact(\"com.google.guava:guava\"),\n    ],\n)\n\nandroid_binary(\n    name = \"IntentsAdvancedSample\",\n    custom_package = \"com.example.android.testing.espresso.intents.AdvancedSample\",\n    manifest = \"app/src/main/AppManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":IntentsAdvancedSampleLib\"],\n)\n\nandroid_library(\n    name = \"IntentsAdvancedSampleTestLib\",\n    srcs = glob([\"app/src/androidTest/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.intents.AdvancedSample.test\",\n    deps = [\n        artifact(\"androidx.test.espresso:espresso-intents\"),\n        \":IntentsAdvancedSampleLib\",\n        \"//:test_deps\",\n    ],\n)\n\nandroid_binary(\n    name = \"IntentsAdvancedSampleTest\",\n    custom_package = \"com.example.android.testing.espresso.intents.AdvancedSample.test\",\n    instruments = \":IntentsAdvancedSample\",\n    manifest = \"app/src/androidTest/AndroidManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":IntentsAdvancedSampleTestLib\"],\n)\n\nAPI_LEVELS = [\n    \"19_x86\",\n    \"21_x86\",\n    \"22_x86\",\n    \"23_x86\",\n]\n\n[android_instrumentation_test(\n    name = \"IntentsAdvancedSampleInstrumentationTest_%s\" % API_LEVEL,\n    target_device = \"@android_test_support//tools/android/emulated_devices/generic_phone:android_%s_qemu2\" % API_LEVEL,\n    test_app = \":IntentsAdvancedSampleTest\",\n) for API_LEVEL in API_LEVELS]\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/README.md",
    "content": "# Advanced sample for Espresso Intents\n\nEspresso Intents is a great way to do hermetic inter app testing. It works essentially like mockito and allows for Intent\nverification and stubbing. This sample shows how to stub an Intent and simulate that a picture is fetched\nfrom the camera without leaving the main app.\n\nThis project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio is recommended.\n\n1. Download the project code, preferably using `git clone`.\n1. Open the Android SDK Manager (*Tools* Menu | *Android*) and make sure you have installed the *Android testing support library Repository* under *Extras*.\n1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n1. Check out the relevant code:\n    * The application under test is located in `src/main/java`\n    * Tests are in `src/androidTest/java`\n1. Create the test configuration with a custom runner: `androidx.test.runner.AndroidJUnitRunner`\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *Android Tests* configuration\n    * Choose a module\n    * Add a *Specific instrumentation runner*: `androidx.test.runner.AndroidJUnitRunner`\n1. Connect a device or start an emulator\n    * Turn animations off.\n    (On your device, under Settings->Developer options disable the following 3 settings: \"Window animation scale\", \"Transition animation scale\" and \"Animator duration scale\")\n1. Run the newly created configuration\n\nThe application will be started on the device/emulator and a series of actions will be performed automatically.\n\nIf you are using Android Studio, the *Run* window will show the test results.\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\nandroid {\n    compileSdkVersion 33\n    buildToolsVersion = rootProject.buildToolsVersion\n    defaultConfig {\n        applicationId \"com.example.android.testing.espresso.intents.AdvancedSample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    productFlavors {\n    }\n    testOptions {\n        unitTests {\n            includeAndroidResources = true\n        }\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    namespace \"com.example.android.testing.espresso.intents.AdvancedSample\"\n    testNamespace \"com.example.android.testing.espresso.intents.AdvancedSample.test\"\n    lint {\n        abortOnError false\n    }\n}\n\ndependencies {\n    // App dependencies\n    implementation \"androidx.annotation:annotation:\" + rootProject.androidxAnnotationVersion;\n    // Testing-only dependencies\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion;\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion;\n    androidTestImplementation \"androidx.test:rules:\" + rootProject.rulesVersion;\n    androidTestImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion;\n    androidTestImplementation \"androidx.test.espresso:espresso-intents:\" + rootProject.espressoVersion;\n}\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/app/src/androidTest/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      xmlns:tools=\"http://schemas.android.com/tools\"\n    android:versionCode=\"1\"\n      android:versionName=\"1.0\">\n\n    <uses-feature\n        android:name=\"android.hardware.camera\"\n        android:required=\"true\"/>\n\n    <instrumentation android:targetPackage=\"com.example.android.testing.espresso.intents.AdvancedSample\"\n                     android:name=\"androidx.test.runner.AndroidJUnitRunner\"/>\n\n    <application tools:replace=\"label\" android:label=\"IntentsBasicSampleTest\" />\n</manifest>\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/app/src/androidTest/java/com/example/android/testing/espresso/intents/AdvancedSample/ImageViewHasDrawableMatcher.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.intents.AdvancedSample;\n\nimport androidx.test.espresso.matcher.BoundedDiagnosingMatcher;\nimport android.view.View;\nimport android.widget.ImageView;\n\nimport org.hamcrest.Description;\nimport org.hamcrest.Matcher;\n\n/**\n * A Matcher for Espresso that checks if an ImageView has a drawable applied to it.\n */\npublic class ImageViewHasDrawableMatcher {\n\n    public static Matcher<View> hasDrawable() {\n        return new BoundedDiagnosingMatcher<View, ImageView>(ImageView.class) {\n            @Override\n            protected void describeMoreTo(Description description) {\n                description.appendText(\"has drawable\");\n            }\n\n            @Override\n            protected boolean matchesSafely(ImageView imageView, Description mismatchDescription) {\n                return imageView.getDrawable() != null;\n            }\n        };\n    }\n}\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/app/src/androidTest/java/com/example/android/testing/espresso/intents/AdvancedSample/ImageViewerActivityTest.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.intents.AdvancedSample;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.graphics.BitmapFactory;\nimport android.os.Bundle;\nimport android.provider.MediaStore;\n\nimport androidx.test.espresso.intent.Intents;\nimport androidx.test.ext.junit.rules.ActivityScenarioRule;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.filters.LargeTest;\nimport androidx.test.platform.app.InstrumentationRegistry;\n\nimport org.junit.After;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static android.app.Instrumentation.ActivityResult;\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.action.ViewActions.click;\nimport static androidx.test.espresso.assertion.ViewAssertions.matches;\nimport static androidx.test.espresso.intent.Intents.intending;\nimport static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction;\nimport static androidx.test.espresso.matcher.ViewMatchers.withId;\nimport static com.example.android.testing.espresso.intents.AdvancedSample.ImageViewHasDrawableMatcher.hasDrawable;\nimport static org.hamcrest.Matchers.not;\n\n/**\n * Espresso tests for {@link ImageViewerActivity}.\n */\n@RunWith(AndroidJUnit4.class)\n@LargeTest\npublic class ImageViewerActivityTest {\n\n    /**\n     * Use {@link ActivityScenarioRule} to create and launch the activity under test, and close it\n     * after test completes. This is a replacement for {@link androidx.test.rule.ActivityTestRule}.\n     */\n    @Rule\n    public ActivityScenarioRule<ImageViewerActivity> mActivityScenarioRule = new ActivityScenarioRule<>(\n            ImageViewerActivity.class);\n\n    @Before\n    public void stubCameraIntent() {\n        // Initializes Intents and begins recording intents.\n        Intents.init();\n\n        ActivityResult result = createImageCaptureActivityResultStub();\n\n        // Stub the Intent.\n        intending(hasAction(MediaStore.ACTION_IMAGE_CAPTURE)).respondWith(result);\n    }\n\n    @After\n    public void tearDown() {\n        // Clears Intents state.\n        Intents.release();\n    }\n\n    @Test\n    public void takePhoto_drawableIsApplied() {\n        // Check that the ImageView doesn't have a drawable applied.\n        onView(withId(R.id.imageView)).check(matches(not(hasDrawable())));\n\n        // Click on the button that will trigger the stubbed intent.\n        onView(withId(R.id.button_take_photo)).perform(click());\n\n        // With no user interaction, the ImageView will have a drawable.\n        onView(withId(R.id.imageView)).check(matches(hasDrawable()));\n    }\n\n    private ActivityResult createImageCaptureActivityResultStub() {\n        // Put the drawable in a bundle.\n        Bundle bundle = new Bundle();\n        bundle.putParcelable(ImageViewerActivity.KEY_IMAGE_DATA, BitmapFactory.decodeResource(\n                InstrumentationRegistry.getInstrumentation().getTargetContext().getResources(),\n                R.drawable.ic_launcher));\n\n        // Create the Intent that will include the bundle.\n        Intent resultData = new Intent();\n        resultData.putExtras(bundle);\n\n        // Create the ActivityResult with the Intent.\n        return new ActivityResult(Activity.RESULT_OK, resultData);\n    }\n}"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2015 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <uses-feature\n        android:name=\"android.hardware.camera\"\n        android:required=\"true\"/>\n\n    <application\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\">\n        <activity\n            android:name=\".ImageViewerActivity\"\n            android:label=\"@string/app_name\"\n            android:exported=\"true\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\"/>\n                <category android:name=\"android.intent.category.LAUNCHER\"/>\n            </intent-filter>\n        </activity>\n\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/app/src/main/AppManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2018 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n\n<manifest package=\"com.example.android.testing.espresso.intents.AdvancedSample\"\n          xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <uses-sdk android:minSdkVersion=\"14\" android:targetSdkVersion=\"28\" />\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/app/src/main/java/com/example/android/testing/espresso/intents/AdvancedSample/ImageViewerActivity.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.intents.AdvancedSample;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.graphics.Bitmap;\nimport android.os.Bundle;\nimport android.provider.MediaStore;\nimport androidx.annotation.VisibleForTesting;\nimport android.view.View;\nimport android.widget.ImageView;\n\n/**\n * Captures an image and displays a thumbnail of the result.\n */\npublic class ImageViewerActivity extends Activity {\n\n    @VisibleForTesting\n    protected static final String KEY_IMAGE_DATA = \"data\";\n\n    private static final int REQUEST_IMAGE_CAPTURE = 1;\n\n    private ImageView mImageView;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_image_viewer);\n        mImageView = (ImageView) findViewById(R.id.imageView);\n    }\n\n    private void dispatchTakePictureIntent() {\n        // Open the camera to take a photo.\n        Intent takePictureIntent = new Intent(MediaStore.ACTION_IMAGE_CAPTURE);\n        startActivityForResult(takePictureIntent, REQUEST_IMAGE_CAPTURE);\n\n    }\n\n    public void onOpenCamera(View view) {\n        dispatchTakePictureIntent();\n    }\n\n    @Override\n    protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n        // If an image is received, display it on the ImageView.\n        if (requestCode == REQUEST_IMAGE_CAPTURE && resultCode == RESULT_OK) {\n            Bundle extras = data.getExtras();\n            if (extras == null || !extras.containsKey(KEY_IMAGE_DATA)) {\n                return;\n            }\n            Bitmap imageBitmap = (Bitmap) extras.get(KEY_IMAGE_DATA);\n            mImageView.setImageBitmap(imageBitmap);\n        }\n    }\n}"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/app/src/main/res/layout/activity_image_viewer.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n              xmlns:tools=\"http://schemas.android.com/tools\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"match_parent\"\n              android:orientation=\"vertical\"\n              android:padding=\"@dimen/activity_horizontal_margin\"\n              tools:context=\".ImageViewerActivity\">\n\n    <Button android:id=\"@+id/button_take_photo\"\n            style=\"?android:attr/buttonStyleSmall\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/button_open_camera\"\n            android:layout_gravity=\"center_horizontal\"\n            android:onClick=\"onOpenCamera\"\n            android:layout_marginTop=\"32dp\"/>\n\n    <ImageView\n        android:layout_width=\"128dp\"\n        android:layout_height=\"128dp\"\n        android:id=\"@+id/imageView\"\n        android:layout_gravity=\"center_horizontal\"\n        android:layout_marginTop=\"32dp\"\n        android:background=\"#ffdbdbdb\"/>\n\n</LinearLayout>\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <string name=\"app_name\">Intents Advanced Sample</string>\n        <string name=\"button_open_camera\">Take photo</string>\n</resources>\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Light\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/app/src/main/res/values-v13/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2015 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Holo.Light\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Material.Light\"/>\n</resources>\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    buildToolsVersion = \"32.0.0\"\n    androidxAnnotationVersion = \"1.5.0\"\n    coreVersion = \"1.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    runnerVersion = \"1.6.1\"\n    rulesVersion = \"1.6.1\"\n    espressoVersion = \"3.6.1\"\n}\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonFinalResIds=false\nandroid.nonTransitiveRClass=false\nandroid.useAndroidX=true"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "ui/espresso/IntentsAdvancedSample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/BUILD.bazel",
    "content": "load(\"@rules_jvm_external//:defs.bzl\", \"artifact\")\nload(\"//:common_defs.bzl\", \"minSdkVersion\", \"targetSdkVersion\")\n\nlicenses([\"notice\"])  # Apache 2.0\n\nandroid_library(\n    name = \"IntentsBasicSampleLib\",\n    srcs = glob([\"app/src/main/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.IntentsBasicSample\",\n    manifest = \"app/src/main/AndroidManifest.xml\",\n    resource_files = glob([\"app/src/main/res/**/*\"]),\n    deps = [\n        \"@maven//:androidx_annotation_annotation\",\n        \"@maven//:androidx_core_core\",\n        \"@maven//:com_google_guava_guava\",\n    ],\n)\n\nandroid_binary(\n    name = \"IntentsBasicSample\",\n    custom_package = \"com.example.android.testing.espresso.IntentsBasicSample\",\n    manifest = \"app/src/main/AppManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":IntentsBasicSampleLib\"],\n)\n\nandroid_library(\n    name = \"IntentsBasicSampleTestLib\",\n    srcs = glob([\"app/src/sharedTest/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.IntentsBasicSample.test\",\n    deps = [\n        \":IntentsBasicSampleLib\",\n        \"//:test_deps\",\n        \"@maven//:androidx_test_espresso_espresso_intents\",\n        \"@maven//:androidx_test_ext_truth\",\n        \"@maven//:com_google_truth_truth\",\n        \"@maven//:org_robolectric_robolectric\",\n        \"@maven//:org_robolectric_annotations\",\n        \"@maven//:junit_junit\",\n    ],\n)\n\nandroid_binary(\n    name = \"IntentsBasicSampleTest\",\n    custom_package = \"com.example.android.testing.espresso.IntentsBasicSample.test\",\n    instruments = \":IntentsBasicSample\",\n    manifest = \"app/src/androidTest/AndroidManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":IntentsBasicSampleTestLib\"],\n)\n\nAPI_LEVELS = [\n    \"19_x86\",\n    \"21_x86\",\n    \"22_x86\",\n    \"23_x86\",\n]\n\n[android_instrumentation_test(\n    name = \"IntentsBasicSampleInstrumentationTest_%s\" % API_LEVEL,\n    target_device = \"@android_test_support//tools/android/emulated_devices/generic_phone:android_%s_qemu2\" % API_LEVEL,\n    test_app = \":IntentsBasicSampleTest\",\n) for API_LEVEL in API_LEVELS]\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/README.md",
    "content": "# Basic sample for Espresso Intents\n\nEspresso Intents is a great way to do hermetic inter app testing. It works essentially like mockito and allows for Intent\nverification and stubbing.\n\nThis project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio 3.4 is recommended.\n\n1. Download the project code, preferably using `git clone`.\n1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n1. Check out the relevant code:\n    * The application under test is located in `src/main/java`\n    * Instrumentation Tests are in `src/androidTest/java`\n    * Local Tests are in `src/test/java` \n1. Create and run the Instrumented test configuration\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *Android Instrumented Tests* configuration\n    * Choose the `app` module\n    * Connect a device or start an emulator\n    * Turn animations off.\n    (On your device, under Settings->Developer options disable the following 3 settings: \"Window animation scale\", \"Transition animation scale\" and \"Animator duration scale\")\n    * Run the newly created configuration\n    * The application will be started on the device/emulator and a series of actions will be performed automatically.\n1. Create and run the local Test configuration\n    * Open Run menu | Edit Configurations\n    * Add a new *Android JUnit * configuration\n    * Set `Use classpath of module` to `app`\n    * Set `Class` to `DialerActivityTest`\n    * Run the configuration    \n    * The test will run on local host\n\nIf you are using Android Studio, the *Run* window will show the test results.\n\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\nandroid {\n    compileSdk 34\n    defaultConfig {\n        applicationId \"com.example.android.testing.espresso.IntentsBasicSample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    productFlavors {\n    }\n    testOptions {\n        unitTests {\n            includeAndroidResources = true\n        }\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    // share test source between local test and androidTest\n    sourceSets {\n        test {\n            java.srcDir \"src/sharedTest/java\"\n        }\n        androidTest {\n            java.srcDir \"src/sharedTest/java\"\n        }\n    }\n    namespace \"com.example.android.testing.espresso.IntentsBasicSample\"\n    testNamespace \"com.example.android.testing.espresso.IntentsBasicSample.test\"\n    lint {\n        abortOnError false\n    }\n}\n\ndependencies {\n\n    // App dependencies\n    implementation \"androidx.annotation:annotation:\" + rootProject.androidxAnnotationVersion;\n    implementation \"androidx.core:core:\" + rootProject.androidxCoreVersion;\n\n    // Testing-only dependencies\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion;\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion;\n    androidTestImplementation \"androidx.test:rules:\" + rootProject.rulesVersion;\n    androidTestImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion;\n    androidTestImplementation \"androidx.test.espresso:espresso-intents:\" + rootProject.espressoVersion;\n    androidTestImplementation \"androidx.test.ext:truth:\" + rootProject.extTruthVersion;\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    androidTestImplementation \"org.robolectric:annotations:\" + rootProject.robolectricVersion;\n\n    testImplementation \"androidx.test:core:\" + rootProject.coreVersion;\n    testImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    testImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion;\n    testImplementation \"androidx.test.espresso:espresso-intents:\" + rootProject.espressoVersion;\n    testImplementation \"androidx.test.ext:truth:\" + rootProject.extTruthVersion;\n    testImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    testImplementation \"org.robolectric:robolectric:\" + rootProject.robolectricVersion;\n\n}\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/app/src/androidTest/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      xmlns:tools=\"http://schemas.android.com/tools\"\n    android:versionCode=\"1\"\n      android:versionName=\"1.0\">\n    <uses-sdk android:minSdkVersion=\"14\" android:targetSdkVersion=\"28\" />\n\n    <uses-permission android:name=\"android.permission.CALL_PHONE\"/>\n\n    <instrumentation android:targetPackage=\"com.example.android.testing.espresso.IntentsBasicSample\"\n                     android:name=\"androidx.test.runner.AndroidJUnitRunner\"/>\n\n    <application tools:replace=\"label\" android:label=\"IntentsBasicSampleTest\" />\n</manifest>\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2015 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <uses-permission android:name=\"android.permission.CALL_PHONE\"/>\n\n    <application\n            android:icon=\"@drawable/ic_launcher\"\n            android:label=\"@string/app_name\"\n            android:theme=\"@style/AppTheme\">\n        <activity\n                android:name=\".DialerActivity\"\n                android:label=\"@string/app_name\"\n                android:exported=\"true\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\"/>\n                <category android:name=\"android.intent.category.LAUNCHER\"/>\n            </intent-filter>\n        </activity>\n        <activity\n                android:name=\".ContactsActivity\"\n                android:label=\"@string/app_name\"/>\n\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/app/src/main/AppManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2018 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n          package=\"com.example.android.testing.espresso.IntentsBasicSample\">\n\n    <uses-sdk android:minSdkVersion=\"14\" android:targetSdkVersion=\"28\" />\n\n    <uses-permission android:name=\"android.permission.CALL_PHONE\"/>\n</manifest>\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/app/src/main/java/com/example/android/testing/espresso/IntentsBasicSample/ContactsActivity.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.IntentsBasicSample;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport androidx.annotation.VisibleForTesting;\n\n/**\n * This a placeholder Activity for a contacts screen. This activity is never opened and does not\n * contain any real contact data for keeping this sample simple and focused.\n */\npublic class ContactsActivity extends Activity {\n\n    static final String KEY_PHONE_NUMBER = \"key_phone_number\";\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_contacts);\n        setResult(Activity.RESULT_OK, createResultData(\"896-745-231\"));\n        finish();\n    }\n\n    @VisibleForTesting\n    static Intent createResultData(String phoneNumber) {\n        final Intent resultData = new Intent();\n        resultData.putExtra(KEY_PHONE_NUMBER, phoneNumber);\n        return resultData;\n    }\n}\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/app/src/main/java/com/example/android/testing/espresso/IntentsBasicSample/DialerActivity.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.IntentsBasicSample;\n\nimport android.Manifest;\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.content.pm.PackageManager;\nimport android.net.Uri;\nimport android.os.Bundle;\nimport androidx.core.content.ContextCompat;\nimport android.view.View;\nimport android.widget.EditText;\nimport android.widget.Toast;\n\n/**\n * Simple Dialer Activity which shows an {@link EditText} field to enter a phone number. Upon\n * pressing the call button the number entered in the input field is send to the native Android\n * Dialer app via {@link Intent#ACTION_CALL}.\n *\n * <p>\n * Furthermore this Activity contains a pick number button to starts dummy contacts activity to\n * demonstrate Intent stubbing.\n */\npublic class DialerActivity extends Activity {\n\n    private static final int REQUEST_CODE_PICK = 16;\n\n    private EditText mCallerNumber;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_dialer);\n        mCallerNumber = (EditText) findViewById(R.id.edit_text_caller_number);\n    }\n\n    public void onCall(View view) {\n        boolean hasCallPhonePermission = ContextCompat.checkSelfPermission(this,\n            Manifest.permission.CALL_PHONE) == PackageManager.PERMISSION_GRANTED;\n\n        if (hasCallPhonePermission)\n            startActivity(createCallIntentFromNumber());\n        else\n            Toast.makeText(this, R.string.warning_call_phone_permission, Toast.LENGTH_SHORT).show();\n    }\n\n    public void onPickContact(View view) {\n        final Intent pickContactIntent = new Intent(this, ContactsActivity.class);\n        startActivityForResult(pickContactIntent, REQUEST_CODE_PICK);\n    }\n\n    private Intent createCallIntentFromNumber() {\n        final Intent intentToCall = new Intent(Intent.ACTION_CALL);\n        String number = mCallerNumber.getText().toString();\n        intentToCall.setData(Uri.parse(\"tel:\" + number));\n        return intentToCall;\n    }\n\n    @Override\n    protected void onActivityResult(int requestCode, int resultCode, Intent data) {\n        if (requestCode == REQUEST_CODE_PICK) {\n            if (resultCode == RESULT_OK) {\n                mCallerNumber.setText(data.getExtras()\n                        .getString(ContactsActivity.KEY_PHONE_NUMBER));\n            }\n        }\n    }\n}"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/app/src/main/res/layout/activity_contacts.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<TextView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n          android:layout_width=\"wrap_content\"\n          android:layout_height=\"wrap_content\"\n          android:padding=\"@dimen/activity_horizontal_margin\"\n          android:text=\"@string/contacts_activity_placeholder\" />\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/app/src/main/res/layout/activity_dialer.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n              xmlns:tools=\"http://schemas.android.com/tools\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"match_parent\"\n              android:orientation=\"vertical\"\n              android:padding=\"@dimen/activity_horizontal_margin\"\n              tools:context=\".MainActivity\">\n\n    <EditText android:id=\"@+id/edit_text_caller_number\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:hint=\"@string/type_a_phone_number\"\n            android:inputType=\"phone\" />\n\n    <Button android:id=\"@+id/button_call_number\"\n            style=\"?android:attr/buttonStyleSmall\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/button_dial_number\"\n            android:layout_gravity=\"center_horizontal\"\n            android:onClick=\"onCall\"/>\n\n    <Button android:id=\"@+id/button_pick_contact\"\n            style=\"?android:attr/buttonStyleSmall\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/button_pick_contact\"\n            android:layout_gravity=\"center_horizontal\"\n            android:onClick=\"onPickContact\"/>\n\n</LinearLayout>\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <string name=\"app_name\">Intents Basic Sample</string>\n    <string name=\"type_a_phone_number\">Please enter a number…</string>\n    <string name=\"button_dial_number\">Call Number</string>\n    <string name=\"button_pick_contact\">Pick Number</string>\n    <string name=\"contacts_activity_placeholder\">This a placeholder Activity for a contacts screen.\n        This activity is never opened and does not contain any real contact data for\n        keeping this sample simple and focused.\n    </string>\n    <string name=\"warning_call_phone_permission\">This app requires \\'call phone\\' permission to run</string>\n</resources>\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Light\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/app/src/main/res/values-v13/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2015 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Holo.Light\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Material.Light\"/>\n</resources>\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/app/src/sharedTest/java/com/example/android/testing/espresso/IntentsBasicSample/DialerActivityTest.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.IntentsBasicSample;\n\nimport static android.app.Instrumentation.ActivityResult;\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.action.ViewActions.click;\nimport static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;\nimport static androidx.test.espresso.action.ViewActions.typeText;\nimport static androidx.test.espresso.assertion.ViewAssertions.matches;\nimport static androidx.test.espresso.intent.Intents.intended;\nimport static androidx.test.espresso.intent.Intents.intending;\nimport static androidx.test.espresso.intent.matcher.ComponentNameMatchers.hasShortClassName;\nimport static androidx.test.espresso.intent.matcher.IntentMatchers.hasAction;\nimport static androidx.test.espresso.intent.matcher.IntentMatchers.hasComponent;\nimport static androidx.test.espresso.intent.matcher.IntentMatchers.hasData;\nimport static androidx.test.espresso.intent.matcher.IntentMatchers.isInternal;\nimport static androidx.test.espresso.intent.matcher.IntentMatchers.toPackage;\nimport static androidx.test.espresso.matcher.ViewMatchers.withId;\nimport static androidx.test.espresso.matcher.ViewMatchers.withText;\nimport static androidx.test.ext.truth.content.IntentSubject.assertThat;\nimport static org.hamcrest.Matchers.not;\nimport static org.hamcrest.core.AllOf.allOf;\nimport static org.robolectric.annotation.TextLayoutMode.Mode.REALISTIC;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.net.Uri;\nimport android.os.Build;\nimport androidx.test.espresso.intent.Intents;\nimport androidx.test.espresso.intent.rule.IntentsTestRule;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.filters.LargeTest;\nimport androidx.test.rule.ActivityTestRule;\nimport androidx.test.rule.GrantPermissionRule;\nimport com.google.common.collect.Iterables;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.robolectric.annotation.TextLayoutMode;\n\n@RunWith(AndroidJUnit4.class)\n@LargeTest\npublic class DialerActivityTest {\n\n    private static final String VALID_PHONE_NUMBER = \"123-345-6789\";\n\n    private static final Uri INTENT_DATA_PHONE_NUMBER = Uri.parse(\"tel:\" + VALID_PHONE_NUMBER);\n\n    @Rule public GrantPermissionRule grantPermissionRule = GrantPermissionRule.grant(\"android.permission.CALL_PHONE\");\n\n    /**\n     * A JUnit {@link Rule @Rule} to init and release Espresso Intents before and after each\n     * test run.\n     * <p>\n     * Rules are interceptors which are executed for each test method and will run before\n     * any of your setup code in the {@link Before @Before} method.\n     * <p>\n     * This rule is based on {@link ActivityTestRule} and will create and launch the activity\n     * for you and also expose the activity under test.\n     */\n    @Rule\n    public IntentsTestRule<DialerActivity> mActivityRule = new IntentsTestRule<>(\n            DialerActivity.class);\n\n    @Before\n    public void stubAllExternalIntents() {\n        // By default Espresso Intents does not stub any Intents. Stubbing needs to be setup before\n        // every test run. In this case all external Intents will be blocked.\n        intending(not(isInternal())).respondWith(new ActivityResult(Activity.RESULT_OK, null));\n    }\n\n    @Test\n    public void typeNumber_ValidInput_InitiatesCall() {\n        // Types a phone number into the dialer edit text field and presses the call button.\n        onView(withId(R.id.edit_text_caller_number))\n                .perform(typeText(VALID_PHONE_NUMBER), closeSoftKeyboard());\n        onView(withId(R.id.button_call_number)).perform(click());\n\n        // Verify that an intent to the dialer was sent with the correct action, phone\n        // number and package. Think of Intents intended API as the equivalent to Mockito's verify.\n        intended(allOf(\n                hasAction(Intent.ACTION_CALL),\n                hasData(INTENT_DATA_PHONE_NUMBER)));\n    }\n\n    /**\n     * Duplicate typeNumber_ValidInput_InitiatesCall, but using truth assertions\n     */\n    @Test\n    public void typeNumber_ValidInput_InitiatesCall_truth() {\n        // Types a phone number into the dialer edit text field and presses the call button.\n        onView(withId(R.id.edit_text_caller_number))\n                .perform(typeText(VALID_PHONE_NUMBER), closeSoftKeyboard());\n        onView(withId(R.id.button_call_number)).perform(click());\n\n        // Verify that an intent to the dialer was sent with the correct action, phone\n        // number and package.\n        Intent receivedIntent = Iterables.getOnlyElement(Intents.getIntents());\n        assertThat(receivedIntent).hasAction(Intent.ACTION_CALL);\n        assertThat(receivedIntent).hasData(INTENT_DATA_PHONE_NUMBER);\n    }\n\n    @Test\n    public void pickContactButton_click_SelectsPhoneNumber() {\n        // Stub all Intents to ContactsActivity to return VALID_PHONE_NUMBER. Note that the Activity\n        // is never launched and result is stubbed.\n        intending(hasComponent(hasShortClassName(\".ContactsActivity\")))\n                .respondWith(new ActivityResult(Activity.RESULT_OK,\n                        ContactsActivity.createResultData(VALID_PHONE_NUMBER)));\n\n        // Click the pick contact button.\n        onView(withId(R.id.button_pick_contact)).perform(click());\n\n        // Check that the number is displayed in the UI.\n        onView(withId(R.id.edit_text_caller_number))\n                .check(matches(withText(VALID_PHONE_NUMBER)));\n    }\n}\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    androidxAnnotationVersion = \"1.5.0\"\n    androidxCoreVersion = \"1.9.0\"\n    coreVersion = \"1.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    runnerVersion = \"1.6.1\"\n    rulesVersion = \"1.6.1\"\n    espressoVersion = \"3.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    extTruthVersion = \"1.6.0\"\n    robolectricVersion = \"4.13\"\n}\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.useAndroidX=true\nandroid.enableJetifier=true\nandroid.useAndroidX=true\nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonTransitiveRClass=false\nandroid.nonFinalResIds=false\n\n\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "ui/espresso/IntentsBasicSample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/.gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/README.md",
    "content": "# Multiprocess Espresso Sample\n\nTo test app components in a non-default processes, you can use the functionality of Multiprocess Espresso. This tool, available on Android O (API level 26) and higher, allows you to seamlessly test your app's UI interactions that cross your app's process boundaries while maintaining Espresso's synchronization guarantees.\n\n1. Download the project code, preferably using `git clone`.\n1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n1. Check out the relevant code:\n    * The application under test is located in `src/main/java`\n    * Tests are in `src/androidTest/java`\n1. Create the test configuration:\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *Android Tests* configuration\n    * Choose a module\n1. Connect a device or start an emulator\n    * Turn animations off.\n    (On your device, under Settings->Developer options disable the following 3 settings: \"Window animation scale\", \"Transition animation scale\" and \"Animator duration scale\")\n1. Run the newly created configuration\n\nThe application will be started on the device/emulator and a series of actions will be performed automatically.\n\nIf you are using Android Studio, the *Run* window will show the test results.\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/app/.gitignore",
    "content": "/build\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/app/build.gradle",
    "content": "/*\n * Copyright (C) 2017 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\napply plugin: \"com.android.application\"\n\nandroid {\n    compileSdk 34\n    defaultConfig {\n        applicationId \"com.example.android.testing.espresso.multiprocesssample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n        }\n    }\n    testOptions {\n        unitTests {\n            includeAndroidResources = true\n        }\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    namespace \"com.example.android.testing.espresso.multiprocesssample\"\n    testNamespace \"com.example.android.testing.espresso.multiprocesssample.test\"\n}\n\ndependencies {\n    testImplementation \"junit:junit:4.12\"\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion\n    androidTestImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion\n    androidTestImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion\n    androidTestImplementation \"androidx.test.espresso:espresso-remote:\" + rootProject.espressoVersion\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion\n}\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/app/src/androidTest/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n\n<!--\n  ~ Copyright (C) 2017 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <!-- Multi-Process Espresso only works on API level 26 and above-->\n    <uses-sdk\n        android:minSdkVersion=\"26\"\n        android:targetSdkVersion=\"28\"/>\n\n    <!--\n      This custom androidTest/AndroidManifest.xml is required because the current Gradle DSL\n      doesn't support the ability to define the new \"targetProcesses\" Instrumentation attribute and\n      to define custom \"meta-data\" tags that are required in this case.\n    -->\n\n    <instrumentation\n        android:name=\"androidx.test.runner.AndroidJUnitRunner\"\n        android:targetPackage=\"com.example.android.testing.espresso.multiprocesssample\"\n        android:targetProcesses=\"*\" > <!-- The instrumentation attribute introduced in O -->\n\n        <!--\n          The following is used by AndroidJUnitRunner (AJUR) to init Espresso in the new PID. This\n          is mandatory and is required because AJUR is automatically instantiated by the Android\n          framework itself since it's simply an Instrumentation. However, Espresso is just a testing\n          framework that is used by AJUR so it's responsible to instantiate it on the remote process\n          in order for handle all the actions from the original process.\n        -->\n        <meta-data\n            android:name=\"remoteMethod\"\n            android:value=\"androidx.test.espresso.remote.EspressoRemote#remoteInit\"/>\n\n    </instrumentation>\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/app/src/androidTest/java/com/example/android/testing/espresso/multiprocesssample/ExampleInstrumentedTest.java",
    "content": "/*\n * Copyright (C) 2017 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.multiprocesssample;\n\nimport androidx.test.core.app.ActivityScenario;\nimport androidx.test.filters.LargeTest;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport android.util.Log;\n\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static androidx.test.espresso.Espresso.onData;\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.action.ViewActions.click;\nimport static androidx.test.espresso.assertion.ViewAssertions.matches;\nimport static androidx.test.espresso.matcher.ViewMatchers.withId;\nimport static androidx.test.espresso.matcher.ViewMatchers.withText;\nimport static org.hamcrest.Matchers.allOf;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\n\n\n@RunWith(AndroidJUnit4.class)\n@LargeTest\npublic class ExampleInstrumentedTest {\n    private static final String TAG = \"ExampleInstrumentedTest\";\n\n    private static final String DEFAULT_PROC_NAME =\n            \"com.example.android.testing.espresso.multiprocesssample\";\n\n    @Before\n    public void launchActivity() {\n        ActivityScenario.launch(DefaultProcessActivity.class);\n    }\n\n    @Test\n    public void verifyAssertingOnViewInRemoteProcessIsSuccessful() {\n        Log.d(TAG, \"Checking main process name...\");\n        onView(withId(R.id.textNamedProcess)).check(matches(withText(is(DEFAULT_PROC_NAME))));\n\n        Log.d(TAG, \"Starting activity in a secondary process...\");\n        onView(withId(R.id.startActivityBtn)).perform(click());\n\n        Log.d(TAG, \"Checking private process name...\");\n        onView(withId(R.id.textPrivateProcessName))\n                .check(matches(withText(is(DEFAULT_PROC_NAME + \":PID2\"))));\n\n        Log.d(TAG, \"Clicking list item in private process activity...\");\n        onData(allOf(instanceOf(String.class), is(\"Doppio\"))).perform(click());\n\n        Log.d(TAG, \"Check selected text appears...\");\n        onView(withId(R.id.selectedListItemText)).check(matches(withText(\"Selected: Doppio\")));\n    }\n}\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2017 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n        android:allowBackup=\"true\"\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:roundIcon=\"@mipmap/ic_launcher_round\"\n        android:supportsRtl=\"true\"\n        android:theme=\"@style/AppTheme\">\n        <activity android:name=\".DefaultProcessActivity\"\n            android:exported=\"true\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n        <activity\n            android:name=\".PrivateProcessActivity\"\n            android:process=\":PID2\">>\n        </activity>\n    </application>\n</manifest>\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/app/src/main/java/com/example/android/testing/espresso/multiprocesssample/DefaultProcessActivity.java",
    "content": "/*\n * Copyright (C) 2017 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.multiprocesssample;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.view.View;\nimport android.widget.TextView;\n\nimport static com.example.android.testing.espresso.multiprocesssample.Util.setCurrentRunningProcess;\n\n/**\n * Activity running in the default process which matches the application package\n */\npublic class DefaultProcessActivity extends Activity {\n\n    private TextView textView;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_default_process);\n        textView = (TextView) findViewById(R.id.textNamedProcess);\n        setCurrentRunningProcess(textView, this);\n    }\n\n    public void onStartActivityBtnClick(View view) {\n        Intent intent = new Intent(this, PrivateProcessActivity.class);\n        startActivity(intent);\n    }\n}\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/app/src/main/java/com/example/android/testing/espresso/multiprocesssample/PrivateProcessActivity.java",
    "content": "/*\n * Copyright (C) 2017 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.multiprocesssample;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.view.View;\nimport android.widget.AdapterView;\nimport android.widget.AdapterView.OnItemClickListener;\nimport android.widget.ArrayAdapter;\nimport android.widget.ListView;\nimport android.widget.TextView;\n\nimport static com.example.android.testing.espresso.multiprocesssample.Util.setCurrentRunningProcess;\n\n/**\n * Activity running in a private process which is manually defined in the AndroidManifest.xml using\n * the android:process attribute.\n * <p>\n * <p>From D.A.C: \"If the name assigned to this attribute begins with a colon (':'), a new process,\n * private to the application, is created when it's needed and the activity runs in that process.\"\n */\npublic class PrivateProcessActivity extends Activity implements OnItemClickListener {\n\n    private TextView privateProcessNameTextView;\n    private TextView selectedListItemTextView;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_private_process);\n        privateProcessNameTextView = findViewById(R.id.textPrivateProcessName);\n        setCurrentRunningProcess(privateProcessNameTextView, this);\n\n        selectedListItemTextView = findViewById(R.id.selectedListItemText);\n        ListView listView = findViewById(R.id.list);\n        String[] listItems = getResources().getStringArray(R.array.list_items);\n        ArrayAdapter<String> adapter =\n                new ArrayAdapter<>(this, android.R.layout.simple_list_item_1, listItems);\n        listView.setAdapter(adapter);\n        listView.setOnItemClickListener(this);\n    }\n\n    public void onBtnClick(View view) {\n        TextView v = findViewById(R.id.displayTextView);\n        v.setText(R.string.button_clicked);\n    }\n\n    @Override\n    public void onItemClick(AdapterView<?> parent, View view, int position, long id) {\n        selectedListItemTextView.setText(\n                String.format(getString(R.string.list_selection), ((TextView) view).getText()));\n    }\n}\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/app/src/main/java/com/example/android/testing/espresso/multiprocesssample/Util.java",
    "content": "/*\n * Copyright (C) 2017 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.multiprocesssample;\n\nimport static android.os.Process.myPid;\n\nimport android.app.ActivityManager;\nimport android.app.ActivityManager.RunningAppProcessInfo;\nimport android.content.Context;\nimport android.util.Log;\nimport android.widget.TextView;\n\n/**\n * Class contains static util methods for reuse\n */\npublic class Util {\n\n    private static final String TAG = \"Util\";\n\n    /**\n     * Utility method to update given TextView with the current process string.\n     */\n    public static void setCurrentRunningProcess(TextView textView, Context activityContext) {\n        String currentProcName;\n        ActivityManager manager =\n                (ActivityManager) activityContext.getSystemService(Context.ACTIVITY_SERVICE);\n        for (RunningAppProcessInfo processInfo : manager.getRunningAppProcesses()) {\n            if (processInfo.pid == myPid()) {\n                currentProcName = processInfo.processName;\n                Log.i(TAG, currentProcName);\n                textView.setText(currentProcName);\n                break;\n            }\n        }\n    }\n\n}"
  },
  {
    "path": "ui/espresso/MultiProcessSample/app/src/main/res/layout/activity_default_process.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2017 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\"\n    android:padding=\"32dp\"\n    tools:context=\".DefaultProcessActivity\">\n\n    <TextView\n        android:id=\"@+id/textNamedProcess\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center_horizontal\"\n        android:layout_marginBottom=\"32dp\"\n        android:layout_marginTop=\"32dp\"/>\n\n    <Button\n        android:id=\"@+id/startActivityBtn\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"@string/start_private_activity\"\n        android:onClick=\"onStartActivityBtnClick\"/>\n\n</LinearLayout>\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/app/src/main/res/layout/activity_private_process.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2017 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\"\n    android:padding=\"32dp\"\n    tools:context=\".PrivateProcessActivity\">\n\n\n    <TextView\n        android:id=\"@+id/textPrivateProcessName\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center_horizontal\"\n        android:layout_marginBottom=\"32dp\"\n        android:layout_marginTop=\"32dp\"/>\n\n    <Button\n        android:id=\"@+id/displayBtn\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:onClick=\"onBtnClick\"\n        android:text=\"@string/click_me\"/>\n\n    <TextView\n        android:id=\"@+id/displayTextView\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center\"\n        android:layout_marginTop=\"8dp\"/>\n\n    <TextView\n        android:id=\"@+id/selectedListItemText\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center\"\n        android:layout_marginTop=\"8dp\"/>\n\n    <ListView\n        android:id=\"@+id/list\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_marginTop=\"8dp\"/>\n\n</LinearLayout>\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2017 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<resources>\n    <color name=\"colorPrimary\">#3F51B5</color>\n    <color name=\"colorPrimaryDark\">#303F9F</color>\n    <color name=\"colorAccent\">#FF4081</color>\n</resources>\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/app/src/main/res/values/strings.xml",
    "content": "<!--\n  ~ Copyright (C) 2017 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<resources>\n    <string name=\"app_name\">MultiProcessSample</string>\n    <string name=\"start_private_activity\">Start Private Process Activity</string>\n    <string name=\"click_me\">Click Me!</string>\n    <string name=\"button_clicked\">Button clicked!</string>\n    <string name=\"hello_world\">Hello Espresso!</string>\n    <string name=\"change_text\">Change text taking some time</string>\n    <string name=\"type_something\">type something…</string>\n    <string name=\"waiting_msg\">Waiting for message…</string>\n    <string name=\"list_selection\">Selected: %1$s</string>\n\n    <string-array name=\"list_items\">\n        <item>Espresso</item>\n        <item>Doppio</item>\n        <item>Macchiato</item>\n        <item>Cappuccino</item>\n        <item>Americano</item>\n        <item>Mocha</item>\n        <item>Latte</item>\n    </string-array>\n\n</resources>\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/app/src/main/res/values/styles.xml",
    "content": "<!--\n  ~ Copyright (C) 2017 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~     http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<resources>\n\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Material.Light.DarkActionBar\">\n        <!-- Customize your theme here. -->\n    </style>\n\n</resources>\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/build.gradle",
    "content": "/*\n * Copyright (C) 2017 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n\next {\n    androidxAnnotationVersion = \"1.5.0\"\n    coreVersion = \"1.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    runnerVersion = \"1.6.1\"\n    rulesVersion = \"1.6.1\"\n    espressoVersion = \"3.6.1\"\n}\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "#Mon Jul 16 13:09:42 PDT 2018\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/gradle.properties",
    "content": "#\n# Copyright (C) 2017 The Android Open Source Project\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#     http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx1536m\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.useAndroidX=true\nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonTransitiveRClass=false\nandroid.nonFinalResIds=false\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/gradlew",
    "content": "#!/usr/bin/env bash\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS=\"\"\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn ( ) {\n    echo \"$*\"\n}\n\ndie ( ) {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\nesac\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin, switch paths to Windows format before running java\nif $cygwin ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=$((i+1))\n    done\n    case $i in\n        (0) set -- ;;\n        (1) set -- \"$args0\" ;;\n        (2) set -- \"$args0\" \"$args1\" ;;\n        (3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        (4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        (5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        (6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        (7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        (8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        (9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules\nfunction splitJvmOpts() {\n    JVM_OPTS=(\"$@\")\n}\neval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\nJVM_OPTS[${#JVM_OPTS[*]}]=\"-Dorg.gradle.appname=$APP_BASE_NAME\"\n\nexec \"$JAVACMD\" \"${JVM_OPTS[@]}\" -classpath \"$CLASSPATH\" org.gradle.wrapper.GradleWrapperMain \"$@\"\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/gradlew.bat",
    "content": "@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto init\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:init\r\n@rem Get command-line arguments, handling Windowz variants\r\n\r\nif not \"%OS%\" == \"Windows_NT\" goto win9xME_args\r\nif \"%@eval[2+2]\" == \"4\" goto 4NT_args\r\n\r\n:win9xME_args\r\n@rem Slurp the command line arguments.\r\nset CMD_LINE_ARGS=\r\nset _SKIP=2\r\n\r\n:win9xME_args_slurp\r\nif \"x%~1\" == \"x\" goto execute\r\n\r\nset CMD_LINE_ARGS=%*\r\ngoto execute\r\n\r\n:4NT_args\r\n@rem Get arguments from the 4NT Shell from JP Software\r\nset CMD_LINE_ARGS=%$\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "ui/espresso/MultiProcessSample/settings.gradle",
    "content": "/*\n * Copyright (C) 2017 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *     http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ninclude ':app'\n"
  },
  {
    "path": "ui/espresso/MultiWindowSample/.gitignore",
    "content": ".gradle\nlocal.properties\n.idea\n.DS_Store\nbuild\n*.iml"
  },
  {
    "path": "ui/espresso/MultiWindowSample/BUILD.bazel",
    "content": "load(\"@rules_jvm_external//:defs.bzl\", \"artifact\")\nload(\"//:common_defs.bzl\", \"minSdkVersion\", \"targetSdkVersion\")\n\nlicenses([\"notice\"])  # Apache 2.0\n\nandroid_library(\n    name = \"MultiWindowSampleLib\",\n    srcs = glob([\"app/src/main/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.MultiWindowSample\",\n    manifest = \"app/src/main/AndroidManifest.xml\",\n    resource_files = glob([\"app/src/main/res/**/*\"]),\n    deps = [\n        artifact(\"androidx.annotation:annotation\"),\n        artifact(\"com.google.guava:guava\"),\n    ],\n)\n\nandroid_binary(\n    name = \"MultiWindowSample\",\n    custom_package = \"com.example.android.testing.espresso.MultiWindowSample\",\n    manifest = \"app/src/main/AppManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":MultiWindowSampleLib\"],\n)\n\nandroid_library(\n    name = \"MultiWindowSampleTestLib\",\n    srcs = glob([\"app/src/androidTest/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.MultiWindowSample.test\",\n    deps = [\n        \":MultiWindowSampleLib\",\n        \"//:test_deps\",\n    ],\n)\n\nandroid_binary(\n    name = \"MultiWindowSampleTest\",\n    custom_package = \"com.example.android.testing.espresso.MultiWindowSample.test\",\n    instruments = \":MultiWindowSample\",\n    manifest = \"app/src/androidTest/AndroidManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":MultiWindowSampleTestLib\"],\n)\n\nAPI_LEVELS = [\n    \"19_x86\",\n    \"21_x86\",\n    \"22_x86\",\n    \"23_x86\",\n]\n\n[android_instrumentation_test(\n    name = \"MultiWindowSampleInstrumentationTest_%s\" % API_LEVEL,\n    target_device = \"@android_test_support//tools/android/emulated_devices/generic_phone:android_%s_qemu2\" % API_LEVEL,\n    test_app = \":MultiWindowSampleTest\",\n) for API_LEVEL in API_LEVELS]\n"
  },
  {
    "path": "ui/espresso/MultiWindowSample/README.md",
    "content": "# Multi-window sample for Espresso\n\nAndroid's Window system allows multiple view hierarchies to layer on top of each other.\n\nA real world analogy would be an overhead projector with multiple transparencies placed\non top of each other. Each Window is a transparency, and what is drawn on top of this\ntransparency is the view hierarchy.\n\nBy default Espresso uses a heuristic to guess which Window you intend to interact with.\nThis heuristic is normally 'good enough' however if you want to interact with a Window\nthat it does not select then you'll have to swap in your own root window matcher.\nInitially there's only one window, but typing into the auto-complete text view creates another\nwindow that will be layered on top of the screen. Espresso ignores this layer because it is\nnot connected to the keyboard/ime.\n\nEspresso provides the ability to switch the default window matcher used in both onView and onData\ninteractions.\n\nThis project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio is recommended.\n\n1. Download the project code, preferably using `git clone`.\n1. Open the Android SDK Manager (*Tools* Menu | *Android*) and make sure you have installed the *Android testing support library Repository* under *Extras*.\n1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n1. Check out the relevant code:\n    * The application under test is located in `src/main/java`\n    * Tests are in `src/androidTest/java`\n1. Create the test configuration with a custom runner: `androidx.test.runner.AndroidJUnitRunner`\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *Android Tests* configuration\n    * Choose a module\n    * Add a *Specific instrumentation runner*: `androidx.test.runner.AndroidJUnitRunner`\n1. Connect a device or start an emulator\n    * Turn animations off.\n    (On your device, under Settings->Developer options disable the following 3 settings: \"Window animation scale\", \"Transition animation scale\" and \"Animator duration scale\")\n1. Run the newly created configuration\n\nThe application will be started on the device/emulator and a series of actions will be performed automatically.\n\nIf you are using Android Studio, the *Run* window will show the test results.\n"
  },
  {
    "path": "ui/espresso/MultiWindowSample/app/build.gradle",
    "content": "\napply plugin: \"com.android.application\"\n\nandroid {\n    compileSdk 34\n    defaultConfig {\n        applicationId \"com.example.android.testing.espresso.MultiWindowSample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n        }\n    }\n    productFlavors {\n    }\n    testOptions {\n        unitTests {\n            includeAndroidResources = true\n        }\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    namespace \"com.example.android.testing.espresso.MultiWindowSample\"\n    testNamespace \"com.example.android.testing.espresso.MultiWindowSample.test\"\n    lint {\n        abortOnError false\n    }\n}\n\ndependencies {\n    // App dependencies\n    implementation \"androidx.annotation:annotation:\" + rootProject.androidxAnnotationVersion;\n    implementation \"com.google.guava:guava:\" + rootProject.guavaVersion\n    // Testing-only dependencies\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion;\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion;\n    androidTestImplementation \"androidx.test:rules:\" + rootProject.rulesVersion;\n    androidTestImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion;\n}\n"
  },
  {
    "path": "ui/espresso/MultiWindowSample/app/src/androidTest/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      xmlns:tools=\"http://schemas.android.com/tools\"\n    android:versionCode=\"1\"\n      android:versionName=\"1.0\">\n\n    <instrumentation android:targetPackage=\"com.example.android.testing.espresso.MultiWindowSample\"\n                     android:name=\"androidx.test.runner.AndroidJUnitRunner\"/>\n\n    <application tools:replace=\"label\" android:label=\"IntentsMultiWindowSampleTest\" />\n</manifest>\n"
  },
  {
    "path": "ui/espresso/MultiWindowSample/app/src/androidTest/java/com/example/android/testing/espresso/MultiWindowSample/MultiWindowTest.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.example.android.testing.espresso.MultiWindowSample;\n\nimport androidx.test.filters.LargeTest;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.rule.ActivityTestRule;\n\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport static androidx.test.espresso.Espresso.onData;\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.action.ViewActions.click;\nimport static androidx.test.espresso.action.ViewActions.closeSoftKeyboard;\nimport static androidx.test.espresso.action.ViewActions.typeText;\nimport static androidx.test.espresso.action.ViewActions.typeTextIntoFocusedView;\nimport static androidx.test.espresso.assertion.ViewAssertions.doesNotExist;\nimport static androidx.test.espresso.assertion.ViewAssertions.matches;\nimport static androidx.test.espresso.matcher.RootMatchers.withDecorView;\nimport static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;\nimport static androidx.test.espresso.matcher.ViewMatchers.withId;\nimport static androidx.test.espresso.matcher.ViewMatchers.withText;\nimport static org.hamcrest.Matchers.allOf;\nimport static org.hamcrest.Matchers.instanceOf;\nimport static org.hamcrest.Matchers.is;\nimport static org.hamcrest.Matchers.not;\n\n/**\n * Demonstrates dealing with multiple windows.\n * <p/>\n * Android's Window system allows multiple view hierarchies to layer on top of each other.\n * <p/>\n * A real world analogy would be an overhead projector with multiple transparencies placed\n * on top of each other. Each Window is a transparency, and what is drawn on top of this\n * transparency is the view hierarchy.\n * <p/>\n * By default Espresso uses a heuristic to guess which Window you intend to interact with.\n * This heuristic is normally 'good enough' however if you want to interact with a Window\n * that it does not select then you'll have to swap in your own root window matcher.\n * Initially we only have 1 window, but by typing into the auto complete text view another\n * window will be layered on top of the screen. Espresso ignores this layer because it is\n * not connected to the keyboard/ime.\n * <p/>\n * Espresso provides the ability to switch the default window matcher used in both onView and\n * onData\n * interactions.\n *\n * @see androidx.test.espresso.Espresso#onView\n * @see androidx.test.espresso.Espresso#onData\n */\n@RunWith(AndroidJUnit4.class)\n@LargeTest\npublic class MultiWindowTest {\n\n    /**\n     * A JUnit {@link Rule @Rule} to launch your activity under test. This is a replacement\n     * for {@link android.test.ActivityInstrumentationTestCase2}.\n     * <p>\n     * Rules are interceptors which are executed for each test method and will run before\n     * any of your setup code in the {@link Before @Before} method.\n     * <p>\n     * {@link ActivityTestRule} will create and launch of the activity for you and also expose\n     * the activity under test. To get a reference to the activity you can use\n     * the {@link ActivityTestRule#getActivity()} method.\n     */\n    @Rule\n    public ActivityTestRule<SuggestActivity> mActivityRule = new ActivityTestRule<>(\n            SuggestActivity.class);\n\n    private SuggestActivity mActivity = null;\n\n    @Before\n    public void setActivity() {\n        mActivity = mActivityRule.getActivity();\n    }\n\n    @Test\n    public void autoCompleteTextView_twoSuggestions() {\n        // Type \"So\" to trigger two suggestions.\n        onView(withId(R.id.auto_complete_text_view))\n                .perform(typeText(\"So\"), closeSoftKeyboard());\n\n        // Check that both suggestions are displayed.\n        onView(withText(\"South China Sea\"))\n                .inRoot(withDecorView(not(is(mActivity.getWindow().getDecorView()))))\n                .check(matches(isDisplayed()));\n        onView(withText(\"Southern Ocean\"))\n                .inRoot(withDecorView(not(is(mActivity.getWindow().getDecorView()))))\n                .check(matches(isDisplayed()));\n    }\n\n    @Test\n    public void autoCompleteTextView_oneSuggestion() {\n        // Type \"South\" to trigger one suggestion.\n        onView(withId(R.id.auto_complete_text_view))\n                .perform(typeTextIntoFocusedView(\"South \"), closeSoftKeyboard());\n\n        // Should be displayed\n        onView(withText(\"South China Sea\"))\n                .inRoot(withDecorView(not(is(mActivity.getWindow().getDecorView()))))\n                .check(matches(isDisplayed()));\n\n        // Should not be displayed.\n        onView(withText(\"Southern Ocean\"))\n                .inRoot(withDecorView(not(is(mActivity.getWindow().getDecorView()))))\n                .check(doesNotExist());\n    }\n\n    @Test\n    public void autoCompleteTextView_clickAndCheck() {\n        // Type text into the text view\n        onView(withId(R.id.auto_complete_text_view))\n                .perform(typeTextIntoFocusedView(\"South \"), closeSoftKeyboard());\n\n        // Tap on a suggestion.\n        onView(withText(\"South China Sea\"))\n                .inRoot(withDecorView(not(is(mActivity.getWindow().getDecorView()))))\n                .perform(click());\n\n        // By clicking on the auto complete term, the text should be filled in.\n        onView(withId(R.id.auto_complete_text_view))\n                .check(matches(withText(\"South China Sea\")));\n    }\n\n    @Test\n    public void autoCompleteTextView_onDataClickAndCheck() {\n        // NB: The autocompletion box is implemented with a ListView, so the preferred way\n        // to interact with it is onData(). We can use inRoot here too!\n        onView(withId(R.id.auto_complete_text_view))\n                .perform(typeText(\"S\"), closeSoftKeyboard());\n\n        // This is useful because some of the completions may not be part of the View Hierarchy\n        // unless you scroll around the list.\n        onData(allOf(instanceOf(String.class), is(\"Baltic Sea\")))\n                .inRoot(withDecorView(not(is(mActivity.getWindow().getDecorView()))))\n                .perform(click());\n\n        // The text should be filled in.\n        onView(withId(R.id.auto_complete_text_view))\n                .check(matches(withText(\"Baltic Sea\")));\n    }\n}\n\n\n"
  },
  {
    "path": "ui/espresso/MultiWindowSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.example.android.testing.espresso.MultiWindowSample.SuggestActivity\"\n            android:label=\"@string/app_name\" \n            android:exported=\"true\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/MultiWindowSample/app/src/main/AppManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example.android.testing.espresso.MultiWindowSample\" >\n\n    <uses-sdk android:minSdkVersion=\"14\" android:targetSdkVersion=\"28\" />\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/MultiWindowSample/app/src/main/java/com/example/android/testing/espresso/MultiWindowSample/SuggestActivity.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.example.android.testing.espresso.MultiWindowSample;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.widget.ArrayAdapter;\nimport android.widget.AutoCompleteTextView;\n\n/**\n * An {@link android.app.Activity} that shows an editable text and gives suggestions to the user.\n */\npublic class SuggestActivity extends Activity {\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.suggest_activity);\n\n        setUpAutoCompleteTextView();\n    }\n\n    /**\n     * Creates an adapter and sets it to an {@link AutoCompleteTextView} to enable suggestions.\n     */\n    private void setUpAutoCompleteTextView() {\n        String[] completions = getResources().getStringArray(R.array.bodies_of_water);\n        ArrayAdapter<String> adapter = new ArrayAdapter<String>(\n                this,\n                android.R.layout.simple_dropdown_item_1line,\n                completions);\n\n        AutoCompleteTextView autoComplete =\n                (AutoCompleteTextView) findViewById(R.id.auto_complete_text_view);\n        autoComplete.setAdapter(adapter);\n    }\n}\n"
  },
  {
    "path": "ui/espresso/MultiWindowSample/app/src/main/res/layout/suggest_activity.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    android:orientation=\"vertical\">\n\n    <AutoCompleteTextView\n        android:id=\"@+id/auto_complete_text_view\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:layout_gravity=\"center\"\n        android:layout_margin=\"16dp\"\n        android:completionThreshold=\"1\"\n        android:hint=\"@string/pick_water\"\n        android:textAppearance=\"?android:attr/textAppearanceLarge\" />\n\n</LinearLayout>\n\n"
  },
  {
    "path": "ui/espresso/MultiWindowSample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <string name=\"app_name\">Multiwindow Sample</string>\n    <string name=\"pick_water\">Pick body of water</string>\n    <string-array name=\"bodies_of_water\">\n        <item>Pacific Ocean</item>\n        <item>Atlantic Ocean</item>\n        <item>Indian Ocean</item>\n        <item>Southern Ocean</item>\n        <item>Arctic Ocean</item>\n        <item>Mediterranean Sea</item>\n        <item>Caribbean Sea</item>\n        <item>South China Sea</item>\n        <item>Bering Sea</item>\n        <item>Gulf of Mexico</item>\n        <item>Okhotsk Sea</item>\n        <item>East China Sea</item>\n        <item>Hudson Bay</item>\n        <item>Japan Sea</item>\n        <item>Andaman Sea</item>\n        <item>North Sea</item>\n        <item>Red Sea</item>\n        <item>Baltic Sea</item>\n    </string-array>\n</resources>\n"
  },
  {
    "path": "ui/espresso/MultiWindowSample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"AppTheme\">\n        <!-- Customize your theme here. -->\n    </style>\n</resources>\n"
  },
  {
    "path": "ui/espresso/MultiWindowSample/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    buildToolsVersion = \"32.0.0\"\n    androidxAnnotationVersion = \"1.5.0\"\n    guavaVersion = \"31.1-android\"\n    coreVersion = \"1.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    runnerVersion = \"1.6.1\"\n    rulesVersion = \"1.6.1\"\n    espressoVersion = \"3.6.1\"\n}\n\n"
  },
  {
    "path": "ui/espresso/MultiWindowSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "ui/espresso/MultiWindowSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonFinalResIds=false\nandroid.nonTransitiveRClass=false\nandroid.useAndroidX=true"
  },
  {
    "path": "ui/espresso/MultiWindowSample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "ui/espresso/MultiWindowSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "ui/espresso/MultiWindowSample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/.gitignore",
    "content": ".gradle\nlocal.properties\n.idea\n.DS_Store\nbuild\n*.iml\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/BUILD.bazel",
    "content": "load(\"@rules_jvm_external//:defs.bzl\", \"artifact\")\nload(\"//:common_defs.bzl\", \"minSdkVersion\", \"targetSdkVersion\")\n\nlicenses([\"notice\"])  # Apache 2.0\n\nandroid_library(\n    name = \"RecyclerViewSampleLib\",\n    srcs = glob([\"app/src/main/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.RecyclerViewSample\",\n    manifest = \"app/src/main/AndroidManifest.xml\",\n    resource_files = glob([\"app/src/main/res/**/*\"]),\n    deps = [\n        artifact(\"androidx.recyclerview:recyclerview\"),\n        artifact(\"androidx.annotation:annotation\"),\n        artifact(\"com.google.guava:guava\"),\n    ],\n)\n\nandroid_binary(\n    name = \"RecyclerViewSample\",\n    custom_package = \"com.example.android.testing.espresso.RecyclerViewSample\",\n    manifest = \"app/src/main/AppManifest.xml\",\n    deps = [\":RecyclerViewSampleLib\"],\n)\n\nandroid_library(\n    name = \"RecyclerViewSampleTestLib\",\n    srcs = glob([\"app/src/androidTest/**/*.java\"]),\n    custom_package = \"com.example.android.testing.espresso.RecyclerViewSample.test\",\n    deps = [\n        artifact(\"androidx.test.espresso:espresso-contrib\"),\n        \":RecyclerViewSampleLib\",\n        \"//:test_deps\",\n    ],\n)\n\nandroid_binary(\n    name = \"RecyclerViewSampleTest\",\n    custom_package = \"com.example.android.testing.espresso.RecyclerViewSample.test\",\n    instruments = \":RecyclerViewSample\",\n    manifest = \"app/src/androidTest/AndroidManifest.xml\",\n    manifest_values = {\n        \"minSdkVersion\": minSdkVersion,\n        \"targetSdkVersion\": targetSdkVersion,\n    },\n    deps = [\":RecyclerViewSampleTestLib\"],\n)\n\nAPI_LEVELS = [\n    \"19_x86\",\n    \"21_x86\",\n    \"22_x86\",\n    \"23_x86\",\n]\n\n[android_instrumentation_test(\n    name = \"RecyclerViewSampleInstrumentationTest_%s\" % API_LEVEL,\n    target_device = \"@android_test_support//tools/android/emulated_devices/generic_phone:android_%s_qemu2\" % API_LEVEL,\n    test_app = \":RecyclerViewSampleTest\",\n) for API_LEVEL in API_LEVELS]\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/README.md",
    "content": "# RecyclerView sample for Espresso\n\nEspresso has a special entry point to interact with AdapterViews, `onData()`, however, RecyclerViews work differently than AdapterViews.\n\nIn order to interact with RecyclerViews using Espresso, the `espresso-contrib` package has a collection of `RecyclerViewActions` that can be used to scroll to positions or perform actions on items.\n\nIn this example you'll find a basic Activity that shows a list and an example of how to scroll through it, perform some ViewActions and check ViewAssertions using Espresso.\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/app/build.gradle",
    "content": "/*\n * Copyright 2016, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\napply plugin: \"com.android.application\"\n\nandroid {\n    compileSdk 34\n    defaultConfig {\n        applicationId \"com.example.android.testing.espresso.RecyclerViewSample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n\n\tmultiDexEnabled true\n    }\n    compileOptions {\n        sourceCompatibility 1.8\n        targetCompatibility 1.8\n    }\n\n    testOptions {\n        unitTests {\n            includeAndroidResources = true\n        }\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    namespace \"com.example.android.testing.espresso.RecyclerViewSample\"\n    testNamespace \"com.example.android.testing.espresso.RecyclerViewSample.test\"\n    lint {\n        abortOnError false\n    }\n}\n\ndependencies {\n    // App dependencies\n    implementation \"androidx.annotation:annotation:\" + rootProject.androidxAnnotationVersion;\n    implementation \"androidx.recyclerview:recyclerview:\" + rootProject.androidxRecyclerVersion;\n    implementation \"androidx.multidex:multidex:2.0.1\"\n\n    // Testing-only dependencies\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion;\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion;\n    androidTestImplementation \"androidx.test.espresso:espresso-core:\" + rootProject.espressoVersion;\n    androidTestImplementation \"androidx.test.espresso:espresso-contrib:\" + rootProject.espressoVersion;\n\n}\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/app/src/androidTest/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      xmlns:tools=\"http://schemas.android.com/tools\"\n    android:versionCode=\"1\"\n      android:versionName=\"1.0\">\n\n    <instrumentation android:targetPackage=\"com.example.android.testing.espresso.RecyclerViewSample\"\n                     android:name=\"androidx.test.runner.AndroidJUnitRunner\"/>\n\n    <application tools:replace=\"label\" android:label=\"RecyclerViewSampleTest\" />\n</manifest>\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/app/src/androidTest/java/com/example/android/testing/espresso/RecyclerViewSample/RecyclerViewSampleTest.java",
    "content": "/*\n * Copyright 2016, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.RecyclerViewSample;\n\nimport static androidx.test.core.app.ApplicationProvider.getApplicationContext;\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.action.ViewActions.click;\nimport static androidx.test.espresso.assertion.ViewAssertions.matches;\nimport static androidx.test.espresso.matcher.ViewMatchers.hasDescendant;\nimport static androidx.test.espresso.matcher.ViewMatchers.isDisplayed;\nimport static androidx.test.espresso.matcher.ViewMatchers.withText;\n\nimport androidx.test.core.app.ActivityScenario;\nimport androidx.test.espresso.contrib.RecyclerViewActions;\nimport androidx.test.espresso.matcher.ViewMatchers;\nimport androidx.test.espresso.PerformException;\nimport androidx.test.ext.junit.rules.ActivityScenarioRule;\nimport androidx.test.filters.LargeTest;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\n\nimport org.hamcrest.Description;\nimport org.hamcrest.Matcher;\nimport org.hamcrest.TypeSafeMatcher;\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\n\n/**\n * Test class showcasing some {@link RecyclerViewActions} from Espresso.\n */\n@RunWith(AndroidJUnit4.class)\n@LargeTest\npublic class RecyclerViewSampleTest {\n\n    private static final int ITEM_BELOW_THE_FOLD = 40;\n\n    /**\n     * Use {@link ActivityScenario} to create and launch the activity under test. This is a\n     * replacement for {@link androidx.test.rule.ActivityTestRule}.\n     */\n    @Rule\n    public ActivityScenarioRule<MainActivity> activityScenarioRule =\n        new ActivityScenarioRule<MainActivity>(MainActivity.class);\n\n    @Test(expected = PerformException.class)\n    public void itemWithText_doesNotExist() {\n        // Attempt to scroll to an item that contains the special text.\n        onView(ViewMatchers.withId(R.id.recyclerView))\n                // scrollTo will fail the test if no item matches.\n                .perform(RecyclerViewActions.scrollTo(\n                        hasDescendant(withText(\"not in the list\"))\n                ));\n    }\n\n    @Test\n    public void scrollToItemBelowFold_checkItsText() {\n        // First scroll to the position that needs to be matched and click on it.\n        onView(ViewMatchers.withId(R.id.recyclerView))\n                .perform(RecyclerViewActions.actionOnItemAtPosition(ITEM_BELOW_THE_FOLD, click()));\n\n        // Match the text in an item below the fold and check that it's displayed.\n        String itemElementText = getApplicationContext().getResources().getString(\n                R.string.item_element_text) + String.valueOf(ITEM_BELOW_THE_FOLD);\n        onView(withText(itemElementText)).check(matches(isDisplayed()));\n    }\n\n    @Test\n    public void itemInMiddleOfList_hasSpecialText() {\n        // First, scroll to the view holder using the isInTheMiddle matcher.\n        onView(ViewMatchers.withId(R.id.recyclerView))\n                .perform(RecyclerViewActions.scrollToHolder(isInTheMiddle()));\n\n        // Check that the item has the special text.\n        String middleElementText =\n                getApplicationContext().getResources().getString(R.string.middle);\n        onView(withText(middleElementText)).check(matches(isDisplayed()));\n    }\n\n    /**\n     * Matches the {@link CustomAdapter.ViewHolder}s in the middle of the list.\n     */\n    private static Matcher<CustomAdapter.ViewHolder> isInTheMiddle() {\n        return new TypeSafeMatcher<CustomAdapter.ViewHolder>() {\n            @Override\n            protected boolean matchesSafely(CustomAdapter.ViewHolder customHolder) {\n                return customHolder.getIsInTheMiddle();\n            }\n\n            @Override\n            public void describeTo(Description description) {\n                description.appendText(\"item in the middle\");\n            }\n        };\n    }\n}\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2016, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.example.android.testing.espresso.RecyclerViewSample.MainActivity\"\n            android:label=\"@string/app_name\" \n            android:exported=\"true\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/app/src/main/AppManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2018, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example.android.testing.espresso.RecyclerViewSample\" >\n\n    <uses-sdk android:minSdkVersion=\"14\" android:targetSdkVersion=\"28\" />\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/app/src/main/java/com/example/android/testing/espresso/RecyclerViewSample/CustomAdapter.java",
    "content": "/*\n * Copyright 2016, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.RecyclerViewSample;\n\nimport android.content.Context;\nimport androidx.recyclerview.widget.RecyclerView;\nimport android.view.LayoutInflater;\nimport android.view.View;\nimport android.view.ViewGroup;\nimport android.widget.TextView;\n\nimport java.util.List;\n\n/**\n * Provides views to {@link RecyclerView} with data from a data set.\n */\npublic class CustomAdapter extends RecyclerView.Adapter<CustomAdapter.ViewHolder> {\n\n    private final List<String> mDataSet;\n\n    private final Context mContext;\n\n    /**\n     * Provide a reference to the type of views that you are using\n     * (custom {@link RecyclerView.ViewHolder}).\n     */\n    static class ViewHolder extends RecyclerView.ViewHolder {\n        private final TextView textView;\n\n        // We'll use this field to showcase matching the holder from the test.\n        private boolean mIsInTheMiddle = false;\n\n        ViewHolder(View v) {\n            super(v);\n            textView = (TextView) v.findViewById(R.id.textView);\n        }\n\n        TextView getTextView() {\n            return textView;\n        }\n\n        boolean getIsInTheMiddle() {\n            return mIsInTheMiddle;\n        }\n\n        void setIsInTheMiddle(boolean isInTheMiddle) {\n            mIsInTheMiddle = isInTheMiddle;\n        }\n    }\n\n    /**\n     * Initialize the dataset of the Adapter.\n     *\n     * @param dataSet String[] containing the data to populate views to be used by RecyclerView.\n     */\n    CustomAdapter(List<String> dataSet, Context context) {\n        mDataSet = dataSet;\n        mContext = context;\n    }\n\n    @Override\n    public ViewHolder onCreateViewHolder(ViewGroup viewGroup, int viewType) {\n        // Create a new view.\n        View v = LayoutInflater.from(viewGroup.getContext())\n                .inflate(R.layout.text_row_item, viewGroup, false);\n\n        return new ViewHolder(v);\n    }\n\n    @Override\n    public void onBindViewHolder(ViewHolder viewHolder, final int position) {\n        if (position == mDataSet.size() / 2 /* calculate middle element position */) {\n            viewHolder.setIsInTheMiddle(true);\n            viewHolder.getTextView().setText(mContext.getResources().getString(R.string.middle));\n        } else {\n            viewHolder.setIsInTheMiddle(false);\n            viewHolder.getTextView().setText(mDataSet.get(position));\n        }\n    }\n\n    // Return the size of your data set (invoked by the layout manager)\n    @Override\n    public int getItemCount() {\n        return mDataSet.size();\n    }\n}\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/app/src/main/java/com/example/android/testing/espresso/RecyclerViewSample/MainActivity.java",
    "content": "/*\n * Copyright 2016, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.RecyclerViewSample;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport androidx.recyclerview.widget.LinearLayoutManager;\nimport androidx.recyclerview.widget.RecyclerView;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Shows a list using a RecyclerView.\n */\npublic class MainActivity extends Activity {\n\n    private static final int DATASET_COUNT = 50;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        // Create a RecyclerView, a LayoutManager, a data Adapter and wire everything up.\n        RecyclerView recyclerView = (RecyclerView) findViewById(R.id.recyclerView);\n\n        LinearLayoutManager layoutManager = new LinearLayoutManager(getApplicationContext());\n        recyclerView.setLayoutManager(layoutManager);\n\n        List<String> dataSet = new ArrayList<>(DATASET_COUNT);\n        for (int i = 0; i < DATASET_COUNT; i++) {\n            dataSet.add(getString(R.string.item_element_text) + i);\n        }\n        CustomAdapter adapter = new CustomAdapter(dataSet, getApplicationContext());\n        recyclerView.setAdapter(adapter);\n    }\n}\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2016, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n              xmlns:tools=\"http://schemas.android.com/tools\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"match_parent\"\n              android:orientation=\"vertical\"\n              android:padding=\"@dimen/activity_horizontal_margin\"\n              tools:context=\".MainActivity\">\n\n    <androidx.recyclerview.widget.RecyclerView\n        android:id=\"@+id/recyclerView\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"match_parent\"/>\n\n</LinearLayout>\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/app/src/main/res/layout/text_row_item.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n Copyright 2014 The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"@dimen/list_item_height\"\n    android:layout_marginLeft=\"@dimen/margin_medium\"\n    android:layout_marginRight=\"@dimen/margin_medium\"\n    android:gravity=\"center_vertical\">\n\n    <TextView\n        android:id=\"@+id/textView\"\n        android:layout_width=\"wrap_content\"\n        android:layout_height=\"wrap_content\"\n        android:text=\"@string/element_text\"/>\n</FrameLayout>"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2016, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"list_item_height\">72dp</dimen>\n    <dimen name=\"margin_medium\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2016, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <string name=\"app_name\">Basic RecyclerView sample</string>\n    <string name=\"element_text\">Element</string>\n    <string name=\"item_element_text\">This is element #</string>\n    <string name=\"middle\">This is the middle!</string>\n</resources>\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2016, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Light\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/app/src/main/res/values-v13/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2016, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Holo.Light\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2016, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Material\"/>\n</resources>\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright 2016, The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~      http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/build.gradle",
    "content": "/*\n * Copyright 2016, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    androidxAnnotationVersion = \"1.5.0\"\n    androidxRecyclerVersion = \"1.2.1\"\n    guavaVersion = \"31.1-android\"\n    coreVersion = \"1.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    runnerVersion = \"1.6.1\"\n    rulesVersion = \"1.6.1\"\n    espressoVersion = \"3.6.1\"\n}\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.useAndroidX=true\nandroid.enableJetifier=true\nandroid.useAndroidX=true\nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonTransitiveRClass=false\nandroid.nonFinalResIds=false\n\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "ui/espresso/RecyclerViewSample/settings.gradle",
    "content": "/*\n * Copyright 2016, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\ninclude ':app'\n"
  },
  {
    "path": "ui/espresso/ScreenshotSample/.gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/caches\n/.idea/libraries\n/.idea/modules.xml\n/.idea/workspace.xml\n/.idea/navEditor.xml\n/.idea/assetWizardSettings.xml\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n.cxx\nlocal.properties\n\n"
  },
  {
    "path": "ui/espresso/ScreenshotSample/app/.gitignore",
    "content": "/build"
  },
  {
    "path": "ui/espresso/ScreenshotSample/app/build.gradle",
    "content": "plugins {\n    id \"com.android.application\"\n    id \"kotlin-android\"\n}\napply plugin: \"kotlin-android\"\n\nandroid {\n    compileSdk 34\n\n    defaultConfig {\n        applicationId \"com.example.android.testing.espresso.screenshotsample\"\n        minSdk 19\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n        testInstrumentationRunnerArguments useTestStorageService: \"true\"\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile(\"proguard-android-optimize.txt\"), \"proguard-rules.pro\"\n        }\n    }\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_8\n        targetCompatibility JavaVersion.VERSION_1_8\n    }\n    kotlinOptions {\n        jvmTarget = \"1.8\"\n    }\n    testOptions {\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    // The androidx.test screenshot APIs will automatically enable hardware rendering\n                    // to take a screenshot\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    namespace \"com.example.android.testing.espresso.screenshotsample\"\n}\n\ndependencies {\n\n    implementation \"androidx.core:core-ktx:$androidxCoreVersion\"\n    implementation \"androidx.appcompat:appcompat:$androidxCompatVersion\"\n    implementation \"com.google.android.material:material:1.4.0\"\n    implementation \"androidx.constraintlayout:constraintlayout:2.1.1\"\n    // force upgrade to 1.1.0 because its required by androidTestImplementation,\n    // and without this statement AGP will silently downgrade to tracing:1.0.0\n    implementation \"androidx.tracing:tracing:1.1.0\"\n    testImplementation \"junit:junit:4.13.2\"\n    androidTestImplementation \"androidx.test.ext:junit-ktx:$extJUnitVersion\"\n    androidTestImplementation \"androidx.test.espresso:espresso-core:$espressoVersion\"\n    androidTestUtil \"androidx.test.services:test-services:$servicesVersion\"\n    implementation \"org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion\"\n}\n"
  },
  {
    "path": "ui/espresso/ScreenshotSample/app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguardFiles setting in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n\n# Uncomment this to preserve the line number information for\n# debugging stack traces.\n#-keepattributes SourceFile,LineNumberTable\n\n# If you keep the line number information, uncomment this to\n# hide the original source file name.\n#-renamesourcefileattribute SourceFile\n\n"
  },
  {
    "path": "ui/espresso/ScreenshotSample/app/src/androidTest/java/com/example/android/testing/espresso/screenshotsample/ScreenshotJavaTest.java",
    "content": "package com.example.android.testing.espresso.screenshotsample;\n\nimport static androidx.test.core.app.DeviceCapture.takeScreenshot;\nimport static androidx.test.core.graphics.BitmapStorage.writeToTestStorage;\nimport static androidx.test.espresso.Espresso.onView;\nimport static androidx.test.espresso.action.ViewActions.captureToBitmap;\nimport static androidx.test.espresso.matcher.ViewMatchers.isRoot;\nimport static androidx.test.espresso.matcher.ViewMatchers.withText;\n\nimport android.graphics.Bitmap;\n\nimport androidx.test.espresso.action.ViewActions;\nimport androidx.test.ext.junit.rules.ActivityScenarioRule;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\n\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.rules.TestName;\nimport org.junit.runner.RunWith;\n\nimport java.io.IOException;\n\n/**\n * Equivalent of {@link ScreenshotTest} for java.\n */\n@RunWith(AndroidJUnit4.class)\npublic class ScreenshotJavaTest {\n    // a handy JUnit rule that stores the method name\n    @Rule\n    public TestName nameRule = new TestName();\n\n    @Rule\n    public ActivityScenarioRule<MainActivity> activityScenarioRule =\n            new ActivityScenarioRule<>(MainActivity.class);\n\n    /**\n     * Captures and saves an image of the entire {@link MainActivity} contents.\n     */\n    @Test\n    public void saveActivityBitmap() throws IOException {\n        onView(isRoot()).perform(captureToBitmap(new ViewActions.BitmapReceiver() {\n            @Override\n            public void onBitmapCaptured(Bitmap bitmap) {\n                try {\n                    writeToTestStorage(bitmap, ScreenshotJavaTest.class.getSimpleName() + \"_\" + nameRule.getMethodName());\n                } catch (IOException e) {\n                    throw new RuntimeException(e);\n                }\n            }\n        }));\n    }\n\n    /**\n     * Captures and saves an image of the 'Hello world' view.\n     */\n    @Test\n    public void saveViewBitmap() throws IOException {\n        onView(withText(\"Hello World!\")).perform(captureToBitmap(new ViewActions.BitmapReceiver() {\n            @Override\n            public void onBitmapCaptured(Bitmap bitmap) {\n                try {\n                    writeToTestStorage(bitmap, ScreenshotJavaTest.class.getSimpleName() + \"_\" + nameRule.getMethodName());\n                } catch (IOException e) {\n                    throw new RuntimeException(e);\n                }\n            }\n        }));\n\n\n    }\n\n    /**\n     * Captures and saves an image of the entire device screen to storage.\n     */\n    @Test\n    public void saveDeviceScreenBitmap() throws IOException {\n        writeToTestStorage(takeScreenshot(), getClass().getSimpleName() + \"_\" + nameRule.getMethodName());\n    }\n}\n"
  },
  {
    "path": "ui/espresso/ScreenshotSample/app/src/androidTest/java/com/example/android/testing/espresso/screenshotsample/ScreenshotTest.kt",
    "content": "package com.example.android.testing.espresso.screenshotsample\n\nimport android.graphics.Bitmap\nimport androidx.test.core.app.takeScreenshot\nimport androidx.test.core.graphics.writeToTestStorage\nimport androidx.test.espresso.Espresso.onView\nimport androidx.test.espresso.action.ViewActions\nimport androidx.test.espresso.action.ViewActions.captureToBitmap\nimport androidx.test.espresso.matcher.ViewMatchers.isRoot\nimport androidx.test.espresso.matcher.ViewMatchers.withText\n\nimport androidx.test.ext.junit.rules.activityScenarioRule\nimport androidx.test.ext.junit.runners.AndroidJUnit4\nimport org.junit.Rule\nimport org.junit.Test\nimport org.junit.rules.TestName\nimport org.junit.runner.RunWith\nimport java.io.IOException\n\n/*\n * Illustrates usage of APIs to capture a bitmap from view and saving it to test storage.\n *\n * When this test is executed via gradle managed devices, the saved image files will be stored at\n * build/outputs/managed_device_android_test_additional_output/debugAndroidTest/managedDevice/nexusOneApi30/\n */\n@RunWith(AndroidJUnit4::class)\nclass ScreenshotTest {\n\n    // a handy JUnit rule that stores the method name, so it can be used to generate unique\n    // screenshot files per test method\n    @get:Rule\n    var nameRule = TestName()\n\n    @get:Rule\n    val activityScenarioRule = activityScenarioRule<MainActivity>()\n\n    /**\n     * Captures and saves an image of the entire [MainActivity] contents.\n     */\n    @Test\n    @Throws(IOException::class)\n    fun saveActivityBitmap() {\n        onView(isRoot())\n            .perform(captureToBitmap({ bitmap: Bitmap -> bitmap.writeToTestStorage(\"${javaClass.simpleName}_${nameRule.methodName}\") }))\n    }\n\n    /**\n     * Captures and saves an image of the 'Hello world' view.\n     */\n    @Test\n    @Throws(IOException::class)\n    fun saveViewBitmap() {\n        onView(withText(\"Hello World!\"))\n            .perform(captureToBitmap({ bitmap: Bitmap -> bitmap.writeToTestStorage(\"${javaClass.simpleName}_${nameRule.methodName}\") }))\n    }\n\n    /**\n     * Captures and saves an image of the entire device screen to storage.\n     */\n    @Test\n    @Throws(IOException::class)\n    fun saveDeviceScreenBitmap() {\n        takeScreenshot()\n            .writeToTestStorage(\"${javaClass.simpleName}_${nameRule.methodName}\")\n    }\n}\n"
  },
  {
    "path": "ui/espresso/ScreenshotSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n  <application\n      android:allowBackup=\"true\"\n      android:icon=\"@mipmap/ic_launcher\"\n      android:label=\"@string/app_name\"\n      android:roundIcon=\"@mipmap/ic_launcher_round\"\n      android:supportsRtl=\"true\"\n      android:theme=\"@style/Theme.ScreenshotSample\">\n    <activity\n        android:name=\".MainActivity\"\n        android:exported=\"true\">\n      <intent-filter>\n        <action android:name=\"android.intent.action.MAIN\" />\n        <category android:name=\"android.intent.category.LAUNCHER\" />\n      </intent-filter>\n    </activity>\n  </application>\n\n</manifest>"
  },
  {
    "path": "ui/espresso/ScreenshotSample/app/src/main/java/com/example/android/testing/espresso/screenshotsample/MainActivity.kt",
    "content": "package com.example.android.testing.espresso.screenshotsample\n\nimport androidx.appcompat.app.AppCompatActivity\nimport android.os.Bundle\n\n/**\n * A simple [Activity], autogenerated via Studio's 'Empty Activity' wizard.\n */\nclass MainActivity : AppCompatActivity() {\n  override fun onCreate(savedInstanceState: Bundle?) {\n    super.onCreate(savedInstanceState)\n    setContentView(R.layout.activity_main)\n  }\n}\n"
  },
  {
    "path": "ui/espresso/ScreenshotSample/app/src/main/res/drawable/ic_launcher_background.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportHeight=\"108\"\n    android:viewportWidth=\"108\">\n  <path\n      android:fillColor=\"#3DDC84\"\n      android:pathData=\"M0,0h108v108h-108z\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M9,0L9,108\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M19,0L19,108\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M29,0L29,108\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M39,0L39,108\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M49,0L49,108\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M59,0L59,108\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M69,0L69,108\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M79,0L79,108\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M89,0L89,108\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M99,0L99,108\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M0,9L108,9\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M0,19L108,19\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M0,29L108,29\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M0,39L108,39\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M0,49L108,49\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M0,59L108,59\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M0,69L108,69\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M0,79L108,79\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M0,89L108,89\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M0,99L108,99\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M19,29L89,29\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M19,39L89,39\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M19,49L89,49\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M19,59L89,59\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M19,69L89,69\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M19,79L89,79\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M29,19L29,89\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M39,19L39,89\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M49,19L49,89\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M59,19L59,89\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M69,19L69,89\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n  <path\n      android:fillColor=\"#00000000\"\n      android:pathData=\"M79,19L79,89\"\n      android:strokeColor=\"#33FFFFFF\"\n      android:strokeWidth=\"0.8\" />\n</vector>\n"
  },
  {
    "path": "ui/espresso/ScreenshotSample/app/src/main/res/drawable-v24/ic_launcher_foreground.xml",
    "content": "<vector xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:aapt=\"http://schemas.android.com/aapt\"\n    android:width=\"108dp\"\n    android:height=\"108dp\"\n    android:viewportHeight=\"108\"\n    android:viewportWidth=\"108\">\n  <path android:pathData=\"M31,63.928c0,0 6.4,-11 12.1,-13.1c7.2,-2.6 26,-1.4 26,-1.4l38.1,38.1L107,108.928l-32,-1L31,63.928z\">\n    <aapt:attr name=\"android:fillColor\">\n      <gradient\n          android:endX=\"85.84757\"\n          android:endY=\"92.4963\"\n          android:startX=\"42.9492\"\n          android:startY=\"49.59793\"\n          android:type=\"linear\">\n        <item\n            android:color=\"#44000000\"\n            android:offset=\"0.0\" />\n        <item\n            android:color=\"#00000000\"\n            android:offset=\"1.0\" />\n      </gradient>\n    </aapt:attr>\n  </path>\n  <path\n      android:fillColor=\"#FFFFFF\"\n      android:fillType=\"nonZero\"\n      android:pathData=\"M65.3,45.828l3.8,-6.6c0.2,-0.4 0.1,-0.9 -0.3,-1.1c-0.4,-0.2 -0.9,-0.1 -1.1,0.3l-3.9,6.7c-6.3,-2.8 -13.4,-2.8 -19.7,0l-3.9,-6.7c-0.2,-0.4 -0.7,-0.5 -1.1,-0.3C38.8,38.328 38.7,38.828 38.9,39.228l3.8,6.6C36.2,49.428 31.7,56.028 31,63.928h46C76.3,56.028 71.8,49.428 65.3,45.828zM43.4,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2c-0.3,-0.7 -0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C45.3,56.528 44.5,57.328 43.4,57.328L43.4,57.328zM64.6,57.328c-0.8,0 -1.5,-0.5 -1.8,-1.2s-0.1,-1.5 0.4,-2.1c0.5,-0.5 1.4,-0.7 2.1,-0.4c0.7,0.3 1.2,1 1.2,1.8C66.5,56.528 65.6,57.328 64.6,57.328L64.6,57.328z\"\n      android:strokeColor=\"#00000000\"\n      android:strokeWidth=\"1\" />\n</vector>"
  },
  {
    "path": "ui/espresso/ScreenshotSample/app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<androidx.constraintlayout.widget.ConstraintLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:app=\"http://schemas.android.com/apk/res-auto\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"match_parent\"\n    tools:context=\".MainActivity\">\n  <TextView\n      android:id=\"@+id/hello_world\"\n      android:layout_width=\"wrap_content\"\n      android:layout_height=\"wrap_content\"\n      android:text=\"Hello World!\"\n      app:layout_constraintBottom_toBottomOf=\"parent\"\n      app:layout_constraintLeft_toLeftOf=\"parent\"\n      app:layout_constraintRight_toRightOf=\"parent\"\n      app:layout_constraintTop_toTopOf=\"parent\" />\n\n</androidx.constraintlayout.widget.ConstraintLayout>"
  },
  {
    "path": "ui/espresso/ScreenshotSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <background android:drawable=\"@drawable/ic_launcher_background\" />\n  <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n</adaptive-icon>"
  },
  {
    "path": "ui/espresso/ScreenshotSample/app/src/main/res/mipmap-anydpi-v26/ic_launcher_round.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<adaptive-icon xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <background android:drawable=\"@drawable/ic_launcher_background\" />\n  <foreground android:drawable=\"@drawable/ic_launcher_foreground\" />\n</adaptive-icon>"
  },
  {
    "path": "ui/espresso/ScreenshotSample/app/src/main/res/values/colors.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<resources>\n  <color name=\"purple_200\">#FFBB86FC</color>\n  <color name=\"purple_500\">#FF6200EE</color>\n  <color name=\"purple_700\">#FF3700B3</color>\n  <color name=\"teal_200\">#FF03DAC5</color>\n  <color name=\"teal_700\">#FF018786</color>\n  <color name=\"black\">#FF000000</color>\n  <color name=\"white\">#FFFFFFFF</color>\n</resources>"
  },
  {
    "path": "ui/espresso/ScreenshotSample/app/src/main/res/values/strings.xml",
    "content": "<resources>\n  <string name=\"app_name\">ScreenshotSample</string>\n</resources>"
  },
  {
    "path": "ui/espresso/ScreenshotSample/app/src/main/res/values/themes.xml",
    "content": "<resources xmlns:tools=\"http://schemas.android.com/tools\">\n  <!-- Base application theme. -->\n  <style name=\"Theme.ScreenshotSample\" parent=\"Theme.MaterialComponents.DayNight.DarkActionBar\">\n    <!-- Primary brand color. -->\n    <item name=\"colorPrimary\">@color/purple_500</item>\n    <item name=\"colorPrimaryVariant\">@color/purple_700</item>\n    <item name=\"colorOnPrimary\">@color/white</item>\n    <!-- Secondary brand color. -->\n    <item name=\"colorSecondary\">@color/teal_200</item>\n    <item name=\"colorSecondaryVariant\">@color/teal_700</item>\n    <item name=\"colorOnSecondary\">@color/black</item>\n    <!-- Status bar color. -->\n    <item name=\"android:statusBarColor\" tools:targetApi=\"l\">\n      ?attr/colorPrimaryVariant\n    </item>\n    <!-- Customize your theme here. -->\n  </style>\n</resources>"
  },
  {
    "path": "ui/espresso/ScreenshotSample/app/src/main/res/values-night/themes.xml",
    "content": "<resources xmlns:tools=\"http://schemas.android.com/tools\">\n  <!-- Base application theme. -->\n  <style name=\"Theme.ScreenshotSample\" parent=\"Theme.MaterialComponents.DayNight.DarkActionBar\">\n    <!-- Primary brand color. -->\n    <item name=\"colorPrimary\">@color/purple_200</item>\n    <item name=\"colorPrimaryVariant\">@color/purple_700</item>\n    <item name=\"colorOnPrimary\">@color/black</item>\n    <!-- Secondary brand color. -->\n    <item name=\"colorSecondary\">@color/teal_200</item>\n    <item name=\"colorSecondaryVariant\">@color/teal_200</item>\n    <item name=\"colorOnSecondary\">@color/black</item>\n    <!-- Status bar color. -->\n    <item name=\"android:statusBarColor\" tools:targetApi=\"l\">\n      ?attr/colorPrimaryVariant\n    </item>\n    <!-- Customize your theme here. -->\n  </style>\n</resources>"
  },
  {
    "path": "ui/espresso/ScreenshotSample/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\nbuildscript {\n    ext.agpVersion = \"8.5.0\"\n    ext.kotlinVersion = \"1.9.22\"\n    ext.androidxCoreVersion = \"1.9.0\"\n    ext.buildToolsVersion = \"32.0.0\"\n    ext.androidxCompatVersion = \"1.5.1\"\n    ext.coreVersion = \"1.6.1\"\n    ext.extJUnitVersion = \"1.2.1\"\n    ext.runnerVersion = \"1.6.1\"\n    ext.rulesVersion = \"1.6.1\"\n    ext.espressoVersion = \"3.6.1\"\n    ext.servicesVersion = \"1.5.0\"\n    ext.truthVersion = \"1.1.3\"\n\n    repositories {\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "ui/espresso/ScreenshotSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "#Thu Aug 01 20:15:00 UTC 2024\ndistributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "ui/espresso/ScreenshotSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n# AndroidX package structure to make it clearer which packages are bundled with the\n# Android operating system, and which are packaged with your app\"s APK\n# https://developer.android.com/topic/libraries/support-library/androidx-rn\nandroid.useAndroidX=true\n# Automatically convert third-party libraries to use AndroidX\nandroid.enableJetifier=true\n# Kotlin code style for this project: \"official\" or \"obsolete\":\nkotlin.code.style=official\nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonTransitiveRClass=false\nandroid.nonFinalResIds=false"
  },
  {
    "path": "ui/espresso/ScreenshotSample/gradlew",
    "content": "#!/usr/bin/env sh\n\n#\n# Copyright 2015 the original author or authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn () {\n    echo \"$*\"\n}\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" -a \"$nonstop\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif [ \"$cygwin\" = \"true\" -o \"$msys\" = \"true\" ] ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=`expr $i + 1`\n    done\n    case $i in\n        0) set -- ;;\n        1) set -- \"$args0\" ;;\n        2) set -- \"$args0\" \"$args1\" ;;\n        3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=`save \"$@\"`\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "ui/espresso/ScreenshotSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "ui/espresso/ScreenshotSample/settings.gradle",
    "content": "dependencyResolutionManagement {\n    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n    repositories {\n        google()\n        mavenCentral()\n    }\n}\nrootProject.name = \"ScreenshotSample\"\ninclude ':app'\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/.gitignore",
    "content": ".gradle\nlocal.properties\n.idea\n.DS_Store\nbuild\n*.iml\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/README.md",
    "content": "# Basic sample for Espresso Web\n\nEspresso Web is an API that can be used to write automated tests for hybrid applications which\ncontain one or more WebViews. Similar to onData, WebView interactions are actually composed of\nseveral ViewActions, however ViewActions in Espresso Web are composed of Web Driver Atoms.\nEspresso Web takes care of synchronization and tries to minimize boilerplate to a bare minimum,\nwhile still giving you an Espresso-like feel to interacting with WebViews.\n\nThis project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio is recommended.\n\n1. Download the project code, preferably using `git clone`.\n1. Open the Android SDK Manager (*Tools* Menu | *Android*) and make sure you have installed the *Android Support Repository* under *Extras*. (For more Information click [here](http://developer.android.com/tools/testing-support-library/index.html#setup))\n1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n1. Check out the relevant code:\n    * The application under test is located in `src/main/java`\n    * Tests are in `src/androidTest/java`\n1. Create the test configuration with a custom runner: `androidx.test.runner.AndroidJUnitRunner`\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *Android Tests* configuration\n    * Choose a module\n    * Add a *Specific instrumentation runner*: `androidx.test.runner.AndroidJUnitRunner`\n1. Connect a device or start an emulator\n    * Turn animations off.\n    (On your device, under Settings->Developer options disable the following 3 settings: \"Window animation scale\", \"Transition animation scale\" and \"Animator duration scale\")\n1. Run the newly created configuration\n\nThe application will be started on the device/emulator and a series of actions will be performed automatically.\n\nIf you are using Android Studio, the *Run* window will show the test results.\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\nandroid {\n    compileSdk 34\n    defaultConfig {\n        applicationId \"com.example.android.testing.espresso.web.BasicSample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    productFlavors {\n    }\n    packagingOptions {\n        resources {\n            excludes += [\"META-INF/maven/com.google.guava/guava/pom.properties\", \"META-INF/maven/com.google.guava/guava/pom.xml\"]\n        }\n    }\n    testOptions {\n        unitTests {\n            includeAndroidResources = true\n        }\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    namespace \"com.example.android.testing.espresso.web.BasicSample\"\n    lint {\n        abortOnError false\n    }\n}\n\ndependencies {\n    // App dependencies\n    implementation \"androidx.annotation:annotation:\"+ rootProject.androidxAnnotationVersion;\n    implementation \"com.google.guava:guava:\" + rootProject.guavaVersion\n    // Testing-only dependencies\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion;\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion;\n    androidTestImplementation \"androidx.test:rules:\" + rootProject.rulesVersion;\n    androidTestImplementation \"androidx.test.espresso:espresso-web:\" + rootProject.espressoVersion;\n}\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/app/src/androidTest/java/com/example/android/testing/espresso/web/BasicSample/WebViewActivityTest.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.web.BasicSample;\n\nimport org.junit.Before;\nimport org.junit.Rule;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport android.content.Intent;\n\nimport androidx.test.core.app.ActivityScenario;\nimport androidx.test.espresso.web.sugar.Web;\nimport androidx.test.espresso.web.webdriver.DriverAtoms;\nimport androidx.test.espresso.web.webdriver.Locator;\nimport androidx.test.filters.LargeTest;\nimport androidx.test.rule.ActivityTestRule;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport android.webkit.WebView;\n\nimport static androidx.test.espresso.web.assertion.WebViewAssertions.webMatches;\nimport static androidx.test.espresso.web.sugar.Web.onWebView;\nimport static androidx.test.espresso.web.webdriver.DriverAtoms.clearElement;\nimport static androidx.test.espresso.web.webdriver.DriverAtoms.findElement;\nimport static androidx.test.espresso.web.webdriver.DriverAtoms.getText;\nimport static androidx.test.espresso.web.webdriver.DriverAtoms.webClick;\nimport static org.hamcrest.Matchers.containsString;\n\n/**\n * Basic sample that shows the usage of Espresso web showcasing {@link Web#onWebView()} API.\n * <p>\n * The sample has a simple layout which contains a single {@link WebView}. The HTML page displays\n * a form with an input tag and buttons to submit the form.\n */\n@LargeTest\n@RunWith(AndroidJUnit4.class)\npublic class WebViewActivityTest {\n\n    private static final String MACCHIATO = \"Macchiato\";\n    private static final String DOPPIO = \"Doppio\";\n\n    /**\n     * A JUnit {@link Rule @Rule} to launch your activity under test. This is a replacement\n     * for {@link android.test.ActivityInstrumentationTestCase2}.\n     * <p>\n     * Rules are interceptors which are executed for each test method and will run before\n     * any of your setup code in the {@link Before @Before} method.\n     * <p>\n     * {@link ActivityTestRule} will create and launch of the activity for you and also expose\n     * the activity under test. To get a reference to the activity you can use\n     * the {@link ActivityTestRule#getActivity()} method.\n     */\n    @Rule\n    public ActivityTestRule<WebViewActivity> mActivityRule = new ActivityTestRule<WebViewActivity>(\n            WebViewActivity.class, false, false) {\n        @Override\n        protected void afterActivityLaunched() {\n            // Technically we do not need to do this - WebViewActivity has javascript turned on.\n            // Other WebViews in your app may have javascript turned off, however since the only way\n            // to automate WebViews is through javascript, it must be enabled.\n            onWebView().forceJavascriptEnabled();\n        }\n    };\n\n    @Test\n    public void typeTextInInput_clickButton_SubmitsForm() {\n        // Lazily launch the Activity with a custom start Intent per test\n        mActivityRule.launchActivity(withWebFormIntent());\n\n        // Selects the WebView in your layout. If you have multiple WebViews you can also use a\n        // matcher to select a given WebView, onWebView(withId(R.id.web_view)).\n        onWebView()\n                // Find the input element by ID\n                .withElement(findElement(Locator.ID, \"text_input\"))\n                // Clear previous input\n                .perform(clearElement())\n                // Enter text into the input element\n                .perform(DriverAtoms.webKeys(MACCHIATO))\n                // Find the submit button\n                .withElement(findElement(Locator.ID, \"submitBtn\"))\n                // Simulate a click via javascript\n                .perform(webClick())\n                // Find the response element by ID\n                .withElement(findElement(Locator.ID, \"response\"))\n                // Verify that the response page contains the entered text\n                .check(webMatches(getText(), containsString(MACCHIATO)));\n    }\n\n    @Test\n    public void typeTextInInput_clickButton_ChangesText() {\n        // Lazily launch the Activity with a custom start Intent per test\n        mActivityRule.launchActivity(withWebFormIntent());\n\n        // Selects the WebView in your layout. If you have multiple WebViews you can also use a\n        // matcher to select a given WebView, onWebView(withId(R.id.web_view)).\n        onWebView()\n                // Find the input element by ID\n                .withElement(findElement(Locator.ID, \"text_input\"))\n                // Clear previous input\n                .perform(clearElement())\n                // Enter text into the input element\n                .perform(DriverAtoms.webKeys(DOPPIO))\n                // Find the change text button.\n                .withElement(findElement(Locator.ID, \"changeTextBtn\"))\n                // Click on it.\n                .perform(webClick())\n                // Find the message element by ID\n                .withElement(findElement(Locator.ID, \"message\"))\n                // Verify that the text is displayed\n                .check(webMatches(getText(), containsString(DOPPIO)));\n    }\n\n    /**\n     * @return start {@link Intent} for the simple web form URL.\n     */\n    private static Intent withWebFormIntent() {\n        Intent basicFormIntent = new Intent();\n        basicFormIntent.putExtra(WebViewActivity.KEY_URL_TO_LOAD, WebViewActivity.WEB_FORM_URL);\n        return basicFormIntent;\n    }\n\n}\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2015 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.example.android.testing.espresso.web.BasicSample.WebViewActivity\"\n            android:label=\"@string/app_name\" \n            android:exported=\"true\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/app/src/main/assets/web_form.html",
    "content": "<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<!doctype html>\n<html>\n<head>\n    <title>Hello Espresso Web</title>\n\n    <meta charset=\"utf-8\"/>\n    <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\"/>\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\"/>\n    <style type=\"text/css\">\n        body {\n        background-color: #f0f0f2;\n        margin: 0;\n        padding: 0;\n        font-family: \"Open Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n        }\n        div {\n        width: 600px;\n        margin: 5em auto;\n        padding: 50px;\n        background-color: #fff;\n        border-radius: 1em;\n        }\n        #message {\n        margin: 0 auto 12px auto;\n        }\n        a:link, a:visited {\n        color: #38488f;\n        text-decoration: none;\n        }\n        @media (max-width: 700px) {\n        body {\n        background-color: #fff;\n        }\n        div {\n        width: auto;\n        margin: 0 auto;\n        border-radius: 0;\n        padding: 1em;\n        }\n        }\n    </style>\n</head>\n<body>\n<div>\n    <h1>Hello Espresso Web!</h1>\n\n    <form action=\"web_form_response.html\" method=\"GET\">\n        <p id=\"message\">Need some Espresso</p>\n        <input type=\"text\" name=\"text_input\" id=\"text_input\" placeholder=\"type something\"/><br>\n        <input type=\"button\" value=\"Change Text\" onclick=\"changeText()\" id=\"changeTextBtn\"/><br>\n        <input type=\"submit\" value=\"Change Text And Submit\" id=\"submitBtn\"/><br>\n    </form>\n</div>\n<script>\n    function changeText() {\n        var typedText = document.getElementById('text_input').value;\n        document.getElementById('message').innerHTML=typedText;\n    }\n</script>\n</body>\n</html>\n\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/app/src/main/assets/web_form_response.html",
    "content": "<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<!doctype html>\n<html>\n<head>\n    <title>The end of the line!</title>\n\n    <meta charset=\"utf-8\" />\n    <meta http-equiv=\"Content-type\" content=\"text/html; charset=utf-8\" />\n    <meta name=\"viewport\" content=\"width=device-width, initial-scale=1\" />\n    <style type=\"text/css\">\n    body {\n        background-color: #f0f0f2;\n        margin: 0;\n        padding: 0;\n        font-family: \"Open Sans\", \"Helvetica Neue\", Helvetica, Arial, sans-serif;\n    }\n    div {\n        width: 600px;\n        margin: 5em auto;\n        padding: 50px;\n        background-color: #fff;\n        border-radius: 1em;\n    }\n    a:link, a:visited {\n        color: #38488f;\n        text-decoration: none;\n    }\n    @media (max-width: 700px) {\n        body {\n            background-color: #fff;\n        }\n        div {\n            width: auto;\n            margin: 0 auto;\n            border-radius: 0;\n            padding: 1em;\n        }\n    }\n    </style>\n</head>\n<body>\n<div>\n    <p id=\"response\"><p>\n    <script>\n      var query = document.location.href.substring(document.location.href.indexOf(\"?\") + 1);\n      var text_input = query.split(\"&\")[0].split(\"=\")[1];\n      document.getElementById('response').innerHTML=text_input;\n    </script>\n</div>\n</body>\n</html>\n\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/app/src/main/java/com/example/android/testing/espresso/web/BasicSample/WebViewActivity.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.espresso.web.BasicSample;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport androidx.annotation.NonNull;\nimport androidx.annotation.VisibleForTesting;\nimport android.text.TextUtils;\nimport android.webkit.WebView;\nimport android.webkit.WebViewClient;\n\nimport static com.google.common.base.Preconditions.checkNotNull;\n\n/**\n * An {@link Activity} that gets a text string from the user and displays it back when the user\n * clicks on one of the two buttons. The first one shows it in the same activity and the second\n * one opens another activity and displays the message.\n */\npublic class WebViewActivity extends Activity {\n\n    public static final String KEY_URL_TO_LOAD = \"KEY_URL_TO_LOAD\";\n\n    @VisibleForTesting\n    protected static final String WEB_FORM_URL = \"file:///android_asset/web_form.html\";\n\n    private WebView mWebView;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_web_view);\n        mWebView = (WebView) findViewById(R.id.web_view);\n        mWebView.getSettings().setJavaScriptEnabled(true);\n        mWebView.loadUrl(urlFromIntent(getIntent()));\n        mWebView.requestFocus();\n        mWebView.setWebViewClient(new WebViewClient() {\n            @Override\n            public boolean shouldOverrideUrlLoading(WebView view, String url) {\n                return false;\n            }\n        });\n    }\n\n    private static String urlFromIntent(@NonNull Intent intent) {\n        checkNotNull(intent, \"Intent cannot be null!\");\n        String url = intent.getStringExtra(KEY_URL_TO_LOAD);\n        return !TextUtils.isEmpty(url) ? url : WEB_FORM_URL;\n    }\n\n}\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/app/src/main/res/layout/activity_web_view.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<FrameLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n              xmlns:tools=\"http://schemas.android.com/tools\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"match_parent\"\n              android:orientation=\"vertical\"\n              android:padding=\"@dimen/activity_horizontal_margin\"\n              tools:context=\".WebViewActaivity\">\n\n    <WebView\n            android:id=\"@+id/web_view\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"match_parent\"\n            android:focusable=\"true\"\n            android:focusableInTouchMode=\"true\"/>\n\n</FrameLayout>\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <string name=\"app_name\">Basic Espresso Web sample</string>\n</resources>\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Light\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/WebBasicSample/app/src/main/res/values-v13/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Holo.Light\"/>\n</resources>"
  },
  {
    "path": "ui/espresso/WebBasicSample/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Material\"/>\n</resources>\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    androidxAnnotationVersion = \"1.5.0\"\n    guavaVersion = \"31.1-android\"\n    coreVersion = \"1.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    runnerVersion = \"1.6.1\"\n    rulesVersion = \"1.6.1\"\n    espressoVersion = \"3.6.1\"\n}\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonFinalResIds=false\nandroid.nonTransitiveRClass=false\nandroid.useAndroidX=true"
  },
  {
    "path": "ui/espresso/WebBasicSample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "ui/espresso/WebBasicSample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/.gitignore",
    "content": ".gradle\nlocal.properties\n.idea\n.DS_Store\nbuild\n*.iml\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/BUILD.bazel",
    "content": "load(\"@rules_jvm_external//:defs.bzl\", \"artifact\")\nload(\"//:common_defs.bzl\", \"uiAutomatorVersion\")\n\nlicenses([\"notice\"])  # Apache 2.0\n\nandroid_library(\n    name = \"BasicSampleLib\",\n    srcs = glob([\"app/src/main/**/*.java\"]),\n    custom_package = \"com.example.android.testing.uiautomator.BasicSample\",\n    manifest = \"app/src/main/AndroidManifest.xml\",\n    resource_files = glob([\"app/src/main/res/**/*\"]),\n    deps = [artifact(\"com.google.guava:guava\")],\n)\n\nandroid_binary(\n    name = \"BasicSample\",\n    custom_package = \"com.example.android.testing.uiautomator.BasicSample\",\n    manifest = \"app/src/main/AppManifest.xml\",\n    deps = [\":BasicSampleLib\"],\n)\n\nandroid_library(\n    name = \"BasicSampleTestLib\",\n    srcs = glob([\"app/src/androidTest/**/*.java\"]),\n    custom_package = \"com.example.android.testing.uiautomator.BasicSample.test\",\n    deps = [\n        \":BasicSampleLib\",\n        \"//:test_deps\",\n        artifact(\"androidx.test.uiautomator:uiautomator\"),\n    ],\n)\n\nandroid_binary(\n    name = \"BasicSampleTest\",\n    custom_package = \"com.example.android.testing.uiautomator.BasicSample.test\",\n    instruments = \":BasicSample\",\n    manifest = \"app/src/androidTest/AndroidManifest.xml\",\n    deps = [\":BasicSampleTestLib\"],\n)\n\nAPI_LEVELS = [\n    \"19_x86\",\n    \"21_x86\",\n    \"22_x86\",\n    \"23_x86\",\n]\n\n[android_instrumentation_test(\n    name = \"BasicSampleInstrumentationTest_%s\" % API_LEVEL,\n    target_device = \"@android_test_support//tools/android/emulated_devices/generic_phone:android_%s_qemu2\" % API_LEVEL,\n    test_app = \":BasicSampleTest\",\n) for API_LEVEL in API_LEVELS]\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/README.md",
    "content": "# Basic sample for UiAutomator\n\n*If you are new to UiAutomator, try this sample first.*\n\nThis project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio is recommended.\n\n1. Download the project code, preferably using `git clone`.\n1. Open the Android SDK Manager (*Tools* Menu | *Android*) and make sure you have installed the *Android testing support library Repository* under *Extras*.\n1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n1. Check out the relevant code:\n    * The application under test is located in `src/main/java`\n    * Tests are in `src/androidTest/java`\n1. Create the test configuration with a custom runner: `androidx.test.runner.AndroidJUnitRunner`\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *Android Tests* configuration\n    * Choose a module\n    * Add a *Specific instrumentation runner*: `androidx.test.runner.AndroidJUnitRunner`\n1. Run the newly created configuration\n\nThe application will be started on the device/emulator and a series of actions will be performed automatically.\n\nIf you are using Android Studio, the *Run* window will show the test results.\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\nandroid {\n    compileSdk 34\n    defaultConfig {\n        applicationId \"com.example.android.testing.uiautomator.BasicSample\"\n        minSdkVersion 21\n        targetSdkVersion 34\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile(\"proguard-android.txt\"), \"proguard-rules.pro\"\n        }\n    }\n    productFlavors {\n    }\n    testOptions {\n        unitTests {\n            includeAndroidResources = true\n        }\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    namespace \"com.example.android.testing.uiautomator.BasicSample\"\n    testNamespace \"com.example.android.testing.uiautomator.BasicSample.test\"\n}\n\ndependencies {\n    implementation \"com.google.guava:guava:\" + rootProject.guavaVersion\n    // Testing-only dependencies\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion;\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion;\n    // UiAutomator Testing\n    androidTestImplementation \"androidx.test.uiautomator:uiautomator:\" + rootProject.uiAutomatorVersion;\n    androidTestImplementation \"org.hamcrest:hamcrest-integration:1.3\"\n}\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/app/src/androidTest/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n      xmlns:tools=\"http://schemas.android.com/tools\"\n    android:versionCode=\"1\"\n      android:versionName=\"1.0\">\n    <uses-sdk android:minSdkVersion=\"18\" android:targetSdkVersion=\"28\" />\n\n    <instrumentation android:targetPackage=\"com.example.android.testing.uiautomator.BasicSample\"\n                     android:name=\"androidx.test.runner.AndroidJUnitRunner\"/>\n\n    <application tools:replace=\"label\" android:label=\"BasicSampleTest\" />\n</manifest>\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/app/src/androidTest/java/com/example/android/testing/uiautomator/BasicSample/ChangeTextBehaviorTest.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.uiautomator.BasicSample;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport android.content.Context;\nimport android.content.Intent;\nimport android.content.pm.PackageManager;\nimport android.content.pm.ResolveInfo;\n\nimport static androidx.test.core.app.ApplicationProvider.getApplicationContext;\nimport static androidx.test.platform.app.InstrumentationRegistry.getInstrumentation;\nimport androidx.test.filters.SdkSuppress;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport androidx.test.uiautomator.By;\nimport androidx.test.uiautomator.UiDevice;\nimport androidx.test.uiautomator.UiObject2;\nimport androidx.test.uiautomator.Until;\n\nimport static org.hamcrest.CoreMatchers.equalTo;\nimport static org.hamcrest.CoreMatchers.is;\nimport static org.hamcrest.CoreMatchers.notNullValue;\nimport static org.junit.Assert.assertThat;\n\n/**\n * Basic sample for unbundled UiAutomator.\n */\n@RunWith(AndroidJUnit4.class)\n@SdkSuppress(minSdkVersion = 18)\npublic class ChangeTextBehaviorTest {\n\n    private static final String BASIC_SAMPLE_PACKAGE\n            = \"com.example.android.testing.uiautomator.BasicSample\";\n\n    private static final int LAUNCH_TIMEOUT = 5000;\n\n    private static final String STRING_TO_BE_TYPED = \"UiAutomator\";\n\n    private UiDevice mDevice;\n\n    @Before\n    public void startMainActivityFromHomeScreen() {\n        // Initialize UiDevice instance\n        mDevice = UiDevice.getInstance(getInstrumentation());\n\n        // Start from the home screen\n        mDevice.pressHome();\n\n        // Wait for launcher\n        final String launcherPackage = getLauncherPackageName();\n        assertThat(launcherPackage, notNullValue());\n        mDevice.wait(Until.hasObject(By.pkg(launcherPackage).depth(0)), LAUNCH_TIMEOUT);\n\n        // Launch the blueprint app\n        Context context = getApplicationContext();\n        final Intent intent = context.getPackageManager()\n                .getLaunchIntentForPackage(BASIC_SAMPLE_PACKAGE);\n        intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK);    // Clear out any previous instances\n        context.startActivity(intent);\n\n        // Wait for the app to appear\n        mDevice.wait(Until.hasObject(By.pkg(BASIC_SAMPLE_PACKAGE).depth(0)), LAUNCH_TIMEOUT);\n    }\n\n    @Test\n    public void checkPreconditions() {\n        assertThat(mDevice, notNullValue());\n    }\n\n    @Test\n    public void testChangeText_sameActivity() {\n        // Type text and then press the button.\n        mDevice.findObject(By.res(BASIC_SAMPLE_PACKAGE, \"editTextUserInput\"))\n                .setText(STRING_TO_BE_TYPED);\n        mDevice.findObject(By.res(BASIC_SAMPLE_PACKAGE, \"changeTextBt\"))\n                .click();\n\n        // Verify the test is displayed in the Ui\n        UiObject2 changedText = mDevice\n                .wait(Until.findObject(By.res(BASIC_SAMPLE_PACKAGE, \"textToBeChanged\")),\n                        500 /* wait 500ms */);\n        assertThat(changedText.getText(), is(equalTo(STRING_TO_BE_TYPED)));\n    }\n\n    @Test\n    public void testChangeText_newActivity() {\n        // Type text and then press the button.\n        mDevice.findObject(By.res(BASIC_SAMPLE_PACKAGE, \"editTextUserInput\"))\n                .setText(STRING_TO_BE_TYPED);\n        mDevice.findObject(By.res(BASIC_SAMPLE_PACKAGE, \"activityChangeTextBtn\"))\n                .click();\n\n        // Verify the test is displayed in the Ui\n        UiObject2 changedText = mDevice\n                .wait(Until.findObject(By.res(BASIC_SAMPLE_PACKAGE, \"show_text_view\")),\n                        500 /* wait 500ms */);\n        assertThat(changedText.getText(), is(equalTo(STRING_TO_BE_TYPED)));\n    }\n\n    /**\n     * Uses package manager to find the package name of the device launcher. Usually this package\n     * is \"com.android.launcher\" but can be different at times. This is a generic solution which\n     * works on all platforms.`\n     */\n    private String getLauncherPackageName() {\n        // Create launcher Intent\n        final Intent intent = new Intent(Intent.ACTION_MAIN);\n        intent.addCategory(Intent.CATEGORY_HOME);\n\n        // Use PackageManager to get the launcher package name\n        PackageManager pm = getApplicationContext().getPackageManager();\n        ResolveInfo resolveInfo = pm.resolveActivity(intent, PackageManager.MATCH_DEFAULT_ONLY);\n        return resolveInfo.activityInfo.packageName;\n    }\n}\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2015 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.example.android.testing.uiautomator.BasicSample.MainActivity\"\n            android:label=\"@string/app_name\" \n            android:exported=\"true\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n        <activity android:name=\"com.example.android.testing.uiautomator.BasicSample.ShowTextActivity\"/>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/app/src/main/AppManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2018 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n\n<manifest package=\"com.example.android.testing.uiautomator.BasicSample\" />\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/app/src/main/java/com/example/android/testing/uiautomator/BasicSample/MainActivity.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.uiautomator.BasicSample;\n\nimport android.app.Activity;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.view.View;\nimport android.widget.EditText;\nimport android.widget.TextView;\n\n/**\n * An {@link Activity} that gets a text string from the user and displays it back when the user\n * clicks on one of the two buttons. The first one shows it in the same activity and the second\n * one opens another activity and displays the message.\n */\npublic class MainActivity extends Activity implements View.OnClickListener {\n\n    // The TextView used to display the message inside the Activity.\n    private TextView mTextView;\n\n    // The EditText where the user types the message.\n    private EditText mEditText;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        // Set the listeners for the buttons.\n        findViewById(R.id.changeTextBt).setOnClickListener(this);\n        findViewById(R.id.activityChangeTextBtn).setOnClickListener(this);\n\n        mTextView = (TextView) findViewById(R.id.textToBeChanged);\n        mEditText = (EditText) findViewById(R.id.editTextUserInput);\n    }\n\n    @Override\n    public void onClick(View view) {\n        // Get the text from the EditText view.\n        final String text = mEditText.getText().toString();\n\n        final int changeTextBtId = R.id.changeTextBt;\n        final int activityChangeTextBtnId = R.id.activityChangeTextBtn;\n\n        if (view.getId() == changeTextBtId) {\n          // First button's interaction: set a text in a text view.\n          mTextView.setText(text);\n        } else if (view.getId() == activityChangeTextBtnId) {\n          // Second button's interaction: start an activity and send a message to it.\n          Intent intent = ShowTextActivity.newStartIntent(this, text);\n          startActivity(intent);\n        }\n    }\n}\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/app/src/main/java/com/example/android/testing/uiautomator/BasicSample/ShowTextActivity.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.uiautomator.BasicSample;\n\nimport com.google.common.base.Strings;\n\nimport android.app.Activity;\nimport android.content.Context;\nimport android.content.Intent;\nimport android.os.Bundle;\nimport android.widget.TextView;\n\n/**\n * A simple {@link Activity} that shows a message.\n */\npublic class ShowTextActivity extends Activity {\n\n    // The name of the extra data sent through an {@link Intent}.\n    public final static String KEY_EXTRA_MESSAGE =\n            \"com.example.android.testing.uiautomator.basicsample.MESSAGE\";\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_show_text);\n\n        // Get the message from the Intent.\n        Intent intent = getIntent();\n        String message = Strings.nullToEmpty(intent.getStringExtra(KEY_EXTRA_MESSAGE));\n\n        // Show message.\n        ((TextView)findViewById(R.id.show_text_view)).setText(message);\n    }\n\n    /**\n     * Creates an {@link Intent} for {@link ShowTextActivity} with the message to be displayed.\n     * @param context the {@link Context} where the {@link Intent} will be used\n     * @param message a {@link String} with text to be displayed\n     * @return an {@link Intent} used to start {@link ShowTextActivity}\n     */\n    static protected Intent newStartIntent(Context context, String message) {\n        Intent newIntent = new Intent(context, ShowTextActivity.class);\n        newIntent.putExtra(KEY_EXTRA_MESSAGE, message);\n        return newIntent;\n    }\n}\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n              xmlns:tools=\"http://schemas.android.com/tools\"\n              android:layout_width=\"match_parent\"\n              android:layout_height=\"match_parent\"\n              android:orientation=\"vertical\"\n              android:padding=\"@dimen/activity_horizontal_margin\"\n              tools:context=\".MainActivity\">\n\n\n    <TextView\n            android:id=\"@+id/textToBeChanged\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginBottom=\"@dimen/header_margin\"\n            android:layout_marginTop=\"@dimen/header_margin\"\n            android:text=\"@string/hello_world\"\n            android:textAppearance=\"?android:attr/textAppearanceLarge\"/>\n\n\n    <EditText\n            android:id=\"@+id/editTextUserInput\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:hint=\"@string/type_something\"/>\n\n    <Button\n            style=\"?android:attr/buttonStyleSmall\"\n            android:id=\"@+id/changeTextBt\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/change_text\"\n            android:layout_gravity=\"center_horizontal\"/>\n\n\n    <Button\n            style=\"?android:attr/buttonStyleSmall\"\n            android:id=\"@+id/activityChangeTextBtn\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:text=\"@string/open_activity_and_change_text\"/>\n</LinearLayout>\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/app/src/main/res/layout/activity_show_text.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<merge xmlns:android=\"http://schemas.android.com/apk/res/android\"\n             xmlns:tools=\"http://schemas.android.com/tools\"\n             android:layout_width=\"match_parent\"\n             android:layout_height=\"match_parent\"\n             tools:context=\".ShowTextActivity\">\n\n    <TextView\n            android:id=\"@+id/show_text_view\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/hello_world\"\n            android:layout_gravity=\"center\"/>\n\n</merge>\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"header_margin\">32dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <string name=\"app_name\">Basic UiAutomator sample</string>\n    <string name=\"hello_world\">Hello UiAutomator!</string>\n    <string name=\"change_text\">Change text</string>\n    <string name=\"type_something\">type something…</string>\n    <string name=\"open_activity_and_change_text\">Open activity and change text</string>\n</resources>\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Light\"/>\n</resources>"
  },
  {
    "path": "ui/uiautomator/BasicSample/app/src/main/res/values-v13/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2015 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Holo.Light.NoActionBar\"/>\n</resources>"
  },
  {
    "path": "ui/uiautomator/BasicSample/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <style name=\"AppTheme\" parent=\"android:Theme.Material.Dialog.NoActionBar\"/>\n</resources>\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.agpVersion = \"8.5.0\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    buildToolsVersion = \"32.0.0\"\n    androidxAnnotationVersion = \"1.5.0\"\n    guavaVersion = \"31.1-android\"\n    coreVersion = \"1.6.1\"\n    extJUnitVersion = \"1.2.1\"\n    runnerVersion = \"1.6.1\"\n    rulesVersion = \"1.6.1\"\n    espressoVersion = \"3.6.1\"\n    uiAutomatorVersion = \"2.3.0\"\n}\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonFinalResIds=false\nandroid.nonTransitiveRClass=false\nandroid.useAndroidX=true"
  },
  {
    "path": "ui/uiautomator/BasicSample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "ui/uiautomator/BasicSample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "unit/BasicNativeAndroidTest/.gitignore",
    "content": "*.iml\n.gradle\n/local.properties\n/.idea/*\n.DS_Store\n/build\n/captures\n.externalNativeBuild\n.cxx\nlocal.properties\n\n"
  },
  {
    "path": "unit/BasicNativeAndroidTest/README.md",
    "content": "# Basic sample for writing C/C++ GTest tests and running them on Android emulators / devices.\n\nThis project uses the Gradle build system. You don't need an IDE to build and execute it but Android Studio is recommended.\n\n1. Download the project code, preferably using `git clone`.\n2. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n3. Check out the relevant code:\n   * The C++ sources and tests are in `src/main/cpp`\n   * The device tests (which wrap the native tests) are in `src/androidTest/java`\n4. Create and run the Instrumented test configuration\n   * Open the `AdderTest` file, and click the run icon in the gutter, or\n   * Manually create a configuration.\n      * Open *Run* menu | *Edit Configurations*\n      * Add a new *Android Instrumented Tests* configuration\n      * Choose the `app` module\n      * Connect a device or start an emulator\n      * Run the newly created configuration\n\nIf you are using Android Studio, the *Run* window will show the test results.\n"
  },
  {
    "path": "unit/BasicNativeAndroidTest/app/.gitignore",
    "content": "/build"
  },
  {
    "path": "unit/BasicNativeAndroidTest/app/build.gradle",
    "content": "plugins {\n    id \"com.android.application\"\n    id \"kotlin-android\"\n}\napply plugin: \"kotlin-android\"\n\nandroid {\n    compileSdk 33\n\n    defaultConfig {\n        applicationId \"com.example.android.testing.nativesample\"\n        minSdk 18\n        targetSdk 33\n        versionCode 1\n        versionName \"1.0\"\n\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n        externalNativeBuild {\n            cmake {\n                arguments \"-DANDROID_STL=c++_shared\"\n            }\n        }\n    }\n    externalNativeBuild {\n        cmake {\n            path \"src/main/cpp/CMakeLists.txt\"\n        }\n    }\n\n    buildFeatures {\n        prefab true\n    }\n\n    buildTypes {\n        release {\n            minifyEnabled false\n            proguardFiles getDefaultProguardFile(\"proguard-android-optimize.txt\"), \"proguard-rules.pro\"\n        }\n    }\n    compileOptions {\n        sourceCompatibility JavaVersion.VERSION_1_8\n        targetCompatibility JavaVersion.VERSION_1_8\n    }\n    kotlinOptions {\n        jvmTarget = \"1.8\"\n    }\n    testOptions {\n        managedDevices {\n            devices {\n                // run with ../gradlew  nexusOneApi30DebugAndroidTest\n                nexusOneApi30(com.android.build.api.dsl.ManagedVirtualDevice) {\n                    // A lower resolution device is used here for better emulator performance\n                    device = \"Nexus One\"\n                    apiLevel = 30\n                    // Also use the AOSP ATD image for better emulator performance\n                    systemImageSource = \"aosp-atd\"\n                }\n            }\n        }\n    }\n    namespace \"com.example.android.testing.nativesample\"\n}\n\ndependencies {\n    androidTestImplementation \"junit:junit:$rootProject.junitVersion\"\n    implementation \"androidx.test.ext:junit-gtest:$rootProject.junitGtestVersion\"\n    implementation \"com.android.ndk.thirdparty:googletest:$rootProject.googletestVersion\"\n    androidTestImplementation \"androidx.test:runner:$rootProject.runnerVersion\"\n    androidTestImplementation \"androidx.test.ext:junit-ktx:$extJUnitVersion\"\n}\n"
  },
  {
    "path": "unit/BasicNativeAndroidTest/app/proguard-rules.pro",
    "content": "# Add project specific ProGuard rules here.\n# You can control the set of applied configuration files using the\n# proguardFiles setting in build.gradle.\n#\n# For more details, see\n#   http://developer.android.com/guide/developing/tools/proguard.html\n\n# If your project uses WebView with JS, uncomment the following\n# and specify the fully qualified class name to the JavaScript interface\n# class:\n#-keepclassmembers class fqcn.of.javascript.interface.for.webview {\n#   public *;\n#}\n\n# Uncomment this to preserve the line number information for\n# debugging stack traces.\n#-keepattributes SourceFile,LineNumberTable\n\n# If you keep the line number information, uncomment this to\n# hide the original source file name.\n#-renamesourcefileattribute SourceFile\n\n"
  },
  {
    "path": "unit/BasicNativeAndroidTest/app/src/androidTest/java/com/example/android/testing/nativesample/AdderTest.kt",
    "content": "package com.example.android.testing.nativesample\n\nimport androidx.test.ext.junitgtest.GtestRunner\nimport androidx.test.ext.junitgtest.TargetLibrary\nimport org.junit.runner.RunWith\n\n\n// Run our tests with the `GtestRunner`, which knows how to load and run GTest suites.\n@RunWith(GtestRunner::class)\n// Specify the name of the artifact which contains our tests, as configured in CMakeLists.txt\n@TargetLibrary(libraryName = \"adder-test\")\nclass AdderTest"
  },
  {
    "path": "unit/BasicNativeAndroidTest/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n  <application>\n  </application>\n</manifest>"
  },
  {
    "path": "unit/BasicNativeAndroidTest/app/src/main/cpp/CMakeLists.txt",
    "content": "cmake_minimum_required(VERSION 3.10.2)\n\nproject(junit-gtest-example LANGUAGES CXX)\n\nfind_package(googletest REQUIRED CONFIG)\nfind_package(junit-gtest REQUIRED CONFIG)\n\ninclude_directories(include)\n\nadd_library(adder SHARED src/adder.cpp)\n\nadd_library(adder-test SHARED test/adder_test.cpp)\n\ntarget_link_libraries(adder-test\n        PRIVATE\n        adder\n        googletest::gtest\n        junit-gtest::junit-gtest\n)"
  },
  {
    "path": "unit/BasicNativeAndroidTest/app/src/main/cpp/include/adder",
    "content": "int add(int a, int b);"
  },
  {
    "path": "unit/BasicNativeAndroidTest/app/src/main/cpp/src/adder.cpp",
    "content": "int add(int a, int b) {\n    return a + b;\n}"
  },
  {
    "path": "unit/BasicNativeAndroidTest/app/src/main/cpp/test/adder_test.cpp",
    "content": "#include \"adder\"\n#include \"gtest/gtest.h\"\n\nTEST(adder, pass) {\n    ASSERT_EQ(42, add(40, 2));\n}\n\nTEST(foo, fail) {\n    ASSERT_EQ(-42, add(-40, -2));\n}"
  },
  {
    "path": "unit/BasicNativeAndroidTest/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\nbuildscript {\n    ext.agpVersion = \"8.1.1\"\n    ext.kotlinVersion = \"1.7.10\"\n    ext.androidxCoreVersion = \"1.9.0\"\n    ext.buildToolsVersion = \"32.0.0\"\n    ext.androidxCompatVersion = \"1.5.1\"\n    ext.coreVersion = \"1.6.0-alpha01\"\n    ext.extJUnitVersion = \"1.2.0-alpha01\"\n    ext.runnerVersion = \"1.6.0-alpha03\"\n    ext.rulesVersion = \"1.6.0-alpha01\"\n    ext.espressoVersion = \"3.6.0-alpha01\"\n    ext.servicesVersion = \"1.5.0-alpha01\"\n    ext.truthVersion = \"1.1.3\"\n    ext.googletestVersion = \"1.11.0-beta-1\"\n    ext.junitGtestVersion = \"1.0.0-alpha01\"\n    ext.junitVersion = \"4.13.2\"\n\n    repositories {\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\ntask clean(type: Delete) {\n    delete rootProject.buildDir\n}\n"
  },
  {
    "path": "unit/BasicNativeAndroidTest/gradle/wrapper/gradle-wrapper.properties",
    "content": "#Thu Sep 30 12:30:46 PDT 2021\ndistributionBase=GRADLE_USER_HOME\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.2-all.zip\ndistributionPath=wrapper/dists\nzipStorePath=wrapper/dists\nzipStoreBase=GRADLE_USER_HOME\n"
  },
  {
    "path": "unit/BasicNativeAndroidTest/gradle.properties",
    "content": "# Project-wide Gradle settings.\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\norg.gradle.jvmargs=-Xmx2048m -Dfile.encoding=UTF-8\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true\n# AndroidX package structure to make it clearer which packages are bundled with the\n# Android operating system, and which are packaged with your app\"s APK\n# https://developer.android.com/topic/libraries/support-library/androidx-rn\nandroid.useAndroidX=true\n# Kotlin code style for this project: \"official\" or \"obsolete\":\nkotlin.code.style=official\nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonTransitiveRClass=false\nandroid.nonFinalResIds=false"
  },
  {
    "path": "unit/BasicNativeAndroidTest/gradlew",
    "content": "#!/usr/bin/env sh\n\n#\n# Copyright 2015 the original author or authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n##\n##  Gradle start up script for UN*X\n##\n##############################################################################\n\n# Attempt to set APP_HOME\n# Resolve links: $0 may be a link\nPRG=\"$0\"\n# Need this for relative symlinks.\nwhile [ -h \"$PRG\" ] ; do\n    ls=`ls -ld \"$PRG\"`\n    link=`expr \"$ls\" : '.*-> \\(.*\\)$'`\n    if expr \"$link\" : '/.*' > /dev/null; then\n        PRG=\"$link\"\n    else\n        PRG=`dirname \"$PRG\"`\"/$link\"\n    fi\ndone\nSAVED=\"`pwd`\"\ncd \"`dirname \\\"$PRG\\\"`/\" >/dev/null\nAPP_HOME=\"`pwd -P`\"\ncd \"$SAVED\" >/dev/null\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=`basename \"$0\"`\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=\"maximum\"\n\nwarn () {\n    echo \"$*\"\n}\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n}\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"`uname`\" in\n  CYGWIN* )\n    cygwin=true\n    ;;\n  Darwin* )\n    darwin=true\n    ;;\n  MINGW* )\n    msys=true\n    ;;\n  NONSTOP* )\n    nonstop=true\n    ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=\"$JAVA_HOME/jre/sh/java\"\n    else\n        JAVACMD=\"$JAVA_HOME/bin/java\"\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=\"java\"\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif [ \"$cygwin\" = \"false\" -a \"$darwin\" = \"false\" -a \"$nonstop\" = \"false\" ] ; then\n    MAX_FD_LIMIT=`ulimit -H -n`\n    if [ $? -eq 0 ] ; then\n        if [ \"$MAX_FD\" = \"maximum\" -o \"$MAX_FD\" = \"max\" ] ; then\n            MAX_FD=\"$MAX_FD_LIMIT\"\n        fi\n        ulimit -n $MAX_FD\n        if [ $? -ne 0 ] ; then\n            warn \"Could not set maximum file descriptor limit: $MAX_FD\"\n        fi\n    else\n        warn \"Could not query maximum file descriptor limit: $MAX_FD_LIMIT\"\n    fi\nfi\n\n# For Darwin, add options to specify how the application appears in the dock\nif $darwin; then\n    GRADLE_OPTS=\"$GRADLE_OPTS \\\"-Xdock:name=$APP_NAME\\\" \\\"-Xdock:icon=$APP_HOME/media/gradle.icns\\\"\"\nfi\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif [ \"$cygwin\" = \"true\" -o \"$msys\" = \"true\" ] ; then\n    APP_HOME=`cygpath --path --mixed \"$APP_HOME\"`\n    CLASSPATH=`cygpath --path --mixed \"$CLASSPATH\"`\n\n    JAVACMD=`cygpath --unix \"$JAVACMD\"`\n\n    # We build the pattern for arguments to be converted via cygpath\n    ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`\n    SEP=\"\"\n    for dir in $ROOTDIRSRAW ; do\n        ROOTDIRS=\"$ROOTDIRS$SEP$dir\"\n        SEP=\"|\"\n    done\n    OURCYGPATTERN=\"(^($ROOTDIRS))\"\n    # Add a user-defined pattern to the cygpath arguments\n    if [ \"$GRADLE_CYGPATTERN\" != \"\" ] ; then\n        OURCYGPATTERN=\"$OURCYGPATTERN|($GRADLE_CYGPATTERN)\"\n    fi\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    i=0\n    for arg in \"$@\" ; do\n        CHECK=`echo \"$arg\"|egrep -c \"$OURCYGPATTERN\" -`\n        CHECK2=`echo \"$arg\"|egrep -c \"^-\"`                                 ### Determine if an option\n\n        if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then                    ### Added a condition\n            eval `echo args$i`=`cygpath --path --ignore --mixed \"$arg\"`\n        else\n            eval `echo args$i`=\"\\\"$arg\\\"\"\n        fi\n        i=`expr $i + 1`\n    done\n    case $i in\n        0) set -- ;;\n        1) set -- \"$args0\" ;;\n        2) set -- \"$args0\" \"$args1\" ;;\n        3) set -- \"$args0\" \"$args1\" \"$args2\" ;;\n        4) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" ;;\n        5) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" ;;\n        6) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" ;;\n        7) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" ;;\n        8) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" ;;\n        9) set -- \"$args0\" \"$args1\" \"$args2\" \"$args3\" \"$args4\" \"$args5\" \"$args6\" \"$args7\" \"$args8\" ;;\n    esac\nfi\n\n# Escape application args\nsave () {\n    for i do printf %s\\\\n \"$i\" | sed \"s/'/'\\\\\\\\''/g;1s/^/'/;\\$s/\\$/' \\\\\\\\/\" ; done\n    echo \" \"\n}\nAPP_ARGS=`save \"$@\"`\n\n# Collect all arguments for the java command, following the shell quoting and substitution rules\neval set -- $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS \"\\\"-Dorg.gradle.appname=$APP_BASE_NAME\\\"\" -classpath \"\\\"$CLASSPATH\\\"\" org.gradle.wrapper.GradleWrapperMain \"$APP_ARGS\"\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "unit/BasicNativeAndroidTest/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "unit/BasicNativeAndroidTest/settings.gradle",
    "content": "dependencyResolutionManagement {\n    repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)\n    repositories {\n        google()\n        mavenCentral()\n    }\n}\nrootProject.name = \"BasicNativeAndroidTest\"\ninclude ':app'\n"
  },
  {
    "path": "unit/BasicSample/.google/packaging.yaml",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n# This file is used by Google as part of our samples packaging process.\n# End users may safely ignore this file. It has no relevance to other systems.\n---\nstatus:       PUBLISHED\ntechnologies: [Android]\ncategories:   [Getting Started]\nlanguages:    [Java]\nsolutions:    [Mobile, Testing]\ngithub:       android-testing\nlevel:        BEGINNER\nlicense:      apache2\n"
  },
  {
    "path": "unit/BasicSample/README.md",
    "content": "# Basic sample for writing unit tests that mocks the Android framework\n\n*If you are new to unit testing on Android, try this sample first.*\n\nThis project uses the Gradle build system and the Android gradle plugin support for unit testing.\nYou can either benefit from IDEs integration such as Android studio or run the tests on the command\nline.\n\nUnit tests run on a local JVM on your development machine. The Android Gradle plugin will compile\nyour app's source code and execute it using gradle test task. Tests are executed against a modified\nversion of android.jar where all final modifiers have been stripped off. This lets you use popular\nmocking libraries, like Mockito.\n\nFor more information see http://tools.android.com/tech-docs/unit-testing-support\n\n## Setup the project in Android studio and run tests.\n\n1. Download the project code, preferably using `git clone`.\n1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n1. Make sure you select \"Unit Tests\" as the test artifact in the \"Build Variants\" panel in Android Studio. \n1. Check out the relevant code:\n    * The application code is located in `src/main/java`\n    * Unit Tests are in `src/test/java`\n1. Create a test configuration with the JUnit4 runner: `org.junit.runners.JUnit4`\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *JUnit* configuration\n    * Choose module *app*\n    * Select the class to run by using the *...* button\n1. Run the newly created configuration\n\nThe unit test will be ran automatically.\n\n## Use Gradle on the command line.\n\nAfter downloading the projects code using `git clone` you'll be able to run the\nunit tests using the command line:\n\n    ./gradlew test\n\nIf all the unit tests have been successful you will get a `BUILD SUCCESSFUL`\nmessage.\n\n## See the report.\n\nA report in HTML format is generated in `app/build/reports/tests`\n"
  },
  {
    "path": "unit/BasicSample/app/build.gradle",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\napply plugin: \"com.android.application\"\n\nandroid {\n    compileSdkVersion 30\n    buildToolsVersion = rootProject.buildToolsVersion\n    defaultConfig {\n        applicationId \"com.example.android.testing.unittesting.BasicSample\"\n        minSdkVersion 14\n        versionCode 1\n        versionName \"1.0\"\n        targetSdkVersion 30\n    }\n    productFlavors {\n    }\n}\n\ndependencies {\n    // Unit testing dependencies.\n    testImplementation \"junit:junit:\" + rootProject.junitVersion;\n    testImplementation \"org.mockito:mockito-core:\" + rootProject.mockitoVersion;\n}\n"
  },
  {
    "path": "unit/BasicSample/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2015 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example.android.testing.unittesting.BasicSample\" >\n\n    <application\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.example.android.testing.unittesting.BasicSample.MainActivity\"\n            android:label=\"@string/app_name\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "unit/BasicSample/app/src/main/java/com/example/android/testing/unittesting/BasicSample/EmailValidator.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.unittesting.BasicSample;\n\nimport android.text.Editable;\nimport android.text.TextWatcher;\n\nimport java.util.regex.Pattern;\n\n/**\n * An Email format validator for {@link android.widget.EditText}.\n */\npublic class EmailValidator implements TextWatcher {\n\n    /**\n     * Email validation pattern.\n     */\n    public static final Pattern EMAIL_PATTERN = Pattern.compile(\n            \"[a-zA-Z0-9\\\\+\\\\.\\\\_\\\\%\\\\-\\\\+]{1,256}\" +\n                    \"\\\\@\" +\n                    \"[a-zA-Z0-9][a-zA-Z0-9\\\\-]{0,64}\" +\n                    \"(\" +\n                    \"\\\\.\" +\n                    \"[a-zA-Z0-9][a-zA-Z0-9\\\\-]{0,25}\" +\n                    \")+\"\n    );\n\n    private boolean mIsValid = false;\n\n    public boolean isValid() {\n        return mIsValid;\n    }\n\n    /**\n     * Validates if the given input is a valid email address.\n     *\n     * @param email        The email to validate.\n     * @return {@code true} if the input is a valid email. {@code false} otherwise.\n     */\n    public static boolean isValidEmail(CharSequence email) {\n        return email != null && EMAIL_PATTERN.matcher(email).matches();\n    }\n\n    @Override\n    final public void afterTextChanged(Editable editableText) {\n        mIsValid = isValidEmail(editableText);\n    }\n\n    @Override\n    final public void beforeTextChanged(CharSequence s, int start, int count, int after) {/*No-op*/}\n\n    @Override\n    final public void onTextChanged(CharSequence s, int start, int before, int count) {/*No-op*/}\n}\n"
  },
  {
    "path": "unit/BasicSample/app/src/main/java/com/example/android/testing/unittesting/BasicSample/MainActivity.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.unittesting.BasicSample;\n\nimport android.app.Activity;\nimport android.content.SharedPreferences;\nimport android.os.Bundle;\nimport android.preference.PreferenceManager;\nimport android.util.Log;\nimport android.view.View;\nimport android.widget.DatePicker;\nimport android.widget.EditText;\nimport android.widget.Toast;\n\nimport java.util.Calendar;\n\n/**\n * An {@link Activity} that represents an input form page where the user can provide his name, date\n * of birth and email address. The personal information can be saved to {@link SharedPreferences}\n * by clicking a button.\n */\npublic class MainActivity extends Activity {\n\n    // Logger for this class.\n    private static final String TAG = \"MainActivity\";\n\n    // The helper that manages writing to SharedPreferences.\n    private SharedPreferencesHelper mSharedPreferencesHelper;\n\n    // The input field where the user enters his name.\n    private EditText mNameText;\n\n    // The date picker where the user enters his date of birth.\n    private DatePicker mDobPicker;\n\n    // The input field where the user enters his email.\n    private EditText mEmailText;\n\n    // The validator for the email input field.\n    private EmailValidator mEmailValidator;\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        // Shortcuts to input fields.\n        mNameText = (EditText) findViewById(R.id.userNameInput);\n        mDobPicker = (DatePicker) findViewById(R.id.dateOfBirthInput);\n        mEmailText = (EditText) findViewById(R.id.emailInput);\n\n        // Setup field validators.\n        mEmailValidator = new EmailValidator();\n        mEmailText.addTextChangedListener(mEmailValidator);\n\n        // Instantiate a SharedPreferencesHelper.\n        SharedPreferences sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this);\n        mSharedPreferencesHelper = new SharedPreferencesHelper(sharedPreferences);\n\n        // Fill input fields from data retrieved from the SharedPreferences.\n        populateUi();\n    }\n\n    /**\n     * Initialize all fields from the personal info saved in the SharedPreferences.\n     */\n    private void populateUi() {\n        SharedPreferenceEntry sharedPreferenceEntry;\n        sharedPreferenceEntry = mSharedPreferencesHelper.getPersonalInfo();\n        mNameText.setText(sharedPreferenceEntry.getName());\n        Calendar dateOfBirth = sharedPreferenceEntry.getDateOfBirth();\n        mDobPicker.init(dateOfBirth.get(Calendar.YEAR), dateOfBirth.get(Calendar.MONTH),\n                dateOfBirth.get(Calendar.DAY_OF_MONTH), null);\n        mEmailText.setText(sharedPreferenceEntry.getEmail());\n    }\n\n\n    /**\n     * Called when the \"Save\" button is clicked.\n     */\n    public void onSaveClick(View view) {\n        // Don't save if the fields do not validate.\n        if (!mEmailValidator.isValid()) {\n            mEmailText.setError(\"Invalid email\");\n            Log.w(TAG, \"Not saving personal information: Invalid email\");\n            return;\n        }\n\n        // Get the text from the input fields.\n        String name = mNameText.getText().toString();\n        Calendar dateOfBirth = Calendar.getInstance();\n        dateOfBirth.set(mDobPicker.getYear(), mDobPicker.getMonth(), mDobPicker.getDayOfMonth());\n        String email = mEmailText.getText().toString();\n\n        // Create a Setting model class to persist.\n        SharedPreferenceEntry sharedPreferenceEntry =\n                new SharedPreferenceEntry(name, dateOfBirth, email);\n\n        // Persist the personal information.\n        boolean isSuccess = mSharedPreferencesHelper.savePersonalInfo(sharedPreferenceEntry);\n        if (isSuccess) {\n            Toast.makeText(this, \"Personal information saved\", Toast.LENGTH_LONG).show();\n            Log.i(TAG, \"Personal information saved\");\n        } else {\n            Log.e(TAG, \"Failed to write personal information to SharedPreferences\");\n        }\n    }\n\n    /**\n     * Called when the \"Revert\" button is clicked.\n     */\n    public void onRevertClick(View view) {\n        populateUi();\n        Toast.makeText(this, \"Personal information reverted\", Toast.LENGTH_LONG).show();\n        Log.i(TAG, \"Personal information reverted\");\n    }\n}\n"
  },
  {
    "path": "unit/BasicSample/app/src/main/java/com/example/android/testing/unittesting/BasicSample/SharedPreferenceEntry.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.unittesting.BasicSample;\n\nimport java.util.Calendar;\n\n/**\n * Model class containing personal information that will be saved to SharedPreferences.\n */\npublic class SharedPreferenceEntry {\n\n    // Name of the user.\n    private final String mName;\n\n    // Date of Birth of the user.\n    private final Calendar mDateOfBirth;\n\n    // Email address of the user.\n    private final String mEmail;\n\n    public SharedPreferenceEntry(String name, Calendar dateOfBirth, String email) {\n        mName = name;\n        mDateOfBirth = dateOfBirth;\n        mEmail = email;\n    }\n\n    public String getName() {\n        return mName;\n    }\n\n    public Calendar getDateOfBirth() {\n        return mDateOfBirth;\n    }\n\n    public String getEmail() {\n        return mEmail;\n    }\n}\n"
  },
  {
    "path": "unit/BasicSample/app/src/main/java/com/example/android/testing/unittesting/BasicSample/SharedPreferencesHelper.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.unittesting.BasicSample;\n\nimport android.content.SharedPreferences;\n\nimport java.util.Calendar;\n\n/**\n *  Helper class to manage access to {@link SharedPreferences}.\n */\npublic class SharedPreferencesHelper {\n\n    // Keys for saving values in SharedPreferences.\n    static final String KEY_NAME = \"key_name\";\n    static final String KEY_DOB = \"key_dob_millis\";\n    static final String KEY_EMAIL = \"key_email\";\n\n    // The injected SharedPreferences implementation to use for persistence.\n    private final SharedPreferences mSharedPreferences;\n\n    /**\n     * Constructor with dependency injection.\n     *\n     * @param sharedPreferences The {@link SharedPreferences} that will be used in this DAO.\n     */\n    public SharedPreferencesHelper(SharedPreferences sharedPreferences) {\n        mSharedPreferences = sharedPreferences;\n    }\n\n    /**\n     * Saves the given {@link SharedPreferenceEntry} that contains the user's settings to\n     * {@link SharedPreferences}.\n     *\n     * @param sharedPreferenceEntry contains data to save to {@link SharedPreferences}.\n     * @return {@code true} if writing to {@link SharedPreferences} succeeded. {@code false}\n     *         otherwise.\n     */\n    public boolean savePersonalInfo(SharedPreferenceEntry sharedPreferenceEntry){\n        // Start a SharedPreferences transaction.\n        SharedPreferences.Editor editor = mSharedPreferences.edit();\n        editor.putString(KEY_NAME, sharedPreferenceEntry.getName());\n        editor.putLong(KEY_DOB, sharedPreferenceEntry.getDateOfBirth().getTimeInMillis());\n        editor.putString(KEY_EMAIL, sharedPreferenceEntry.getEmail());\n\n        // Commit changes to SharedPreferences.\n        return editor.commit();\n    }\n\n    /**\n     * Retrieves the {@link SharedPreferenceEntry} containing the user's personal information from\n     * {@link SharedPreferences}.\n     *\n     * @return the Retrieved {@link SharedPreferenceEntry}.\n     */\n    public SharedPreferenceEntry getPersonalInfo() {\n        // Get data from the SharedPreferences.\n        String name = mSharedPreferences.getString(KEY_NAME, \"\");\n        Long dobMillis =\n                mSharedPreferences.getLong(KEY_DOB, Calendar.getInstance().getTimeInMillis());\n        Calendar dateOfBirth = Calendar.getInstance();\n        dateOfBirth.setTimeInMillis(dobMillis);\n        String email = mSharedPreferences.getString(KEY_EMAIL, \"\");\n\n        // Create and fill a SharedPreferenceEntry model object.\n        return new SharedPreferenceEntry(name, dateOfBirth, email);\n    }\n}\n"
  },
  {
    "path": "unit/BasicSample/app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n            xmlns:tools=\"http://schemas.android.com/tools\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:orientation=\"vertical\"\n            android:padding=\"@dimen/activity_horizontal_margin\"\n            tools:context=\".MainActivity\">\n    <LinearLayout android:layout_width=\"match_parent\"\n                  android:layout_height=\"wrap_content\"\n                  android:orientation=\"vertical\"\n                  android:padding=\"@dimen/activity_horizontal_margin\"\n                  tools:context=\".MainActivity\">\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginBottom=\"@dimen/header_margin\"\n            android:text=\"@string/settings_title\"\n            android:textAppearance=\"?android:attr/textAppearanceLarge\"/>\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"start\"\n            android:text=\"@string/name_label\"\n            android:layout_marginTop=\"@dimen/activity_vertical_margin\"\n            android:textAppearance=\"?android:attr/textAppearanceMedium\"/>\n\n        <EditText\n            android:id=\"@+id/userNameInput\"\n            android:hint=\"@string/name_hint\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"/>\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"start\"\n            android:text=\"@string/dob_label\"\n            android:layout_marginTop=\"@dimen/activity_vertical_margin\"\n            android:textAppearance=\"?android:attr/textAppearanceMedium\"/>\n\n        <DatePicker\n            android:id=\"@+id/dateOfBirthInput\"\n            android:inputType=\"text|date\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:datePickerMode=\"spinner\"\n            android:calendarViewShown=\"false\"\n            android:layout_gravity=\"center_horizontal\"/>\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"start\"\n            android:text=\"@string/email_label\"\n            android:layout_marginTop=\"@dimen/activity_vertical_margin_small\"\n            android:textAppearance=\"?android:attr/textAppearanceMedium\"/>\n\n        <EditText\n            android:id=\"@+id/emailInput\"\n            android:hint=\"@string/email_hint\"\n            android:inputType=\"textEmailAddress\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"/>\n\n        <LinearLayout\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:orientation=\"horizontal\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginTop=\"@dimen/activity_vertical_margin\">\n\n            <Button\n                android:id=\"@+id/saveButton\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:textSize=\"@dimen/buttonTextSize\"\n                android:text=\"@string/save\"\n                android:onClick=\"onSaveClick\"\n                android:layout_marginRight=\"@dimen/activity_horizontal_margin\"\n                android:layout_marginEnd=\"@dimen/activity_horizontal_margin\"\n                android:layout_gravity=\"center_horizontal\"/>\n\n            <Button\n                android:id=\"@+id/revertButton\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:textSize=\"@dimen/buttonTextSize\"\n                android:onClick=\"onRevertClick\"\n                android:text=\"@string/revert\"\n                android:layout_gravity=\"center_horizontal\"/>\n\n        </LinearLayout>\n\n    </LinearLayout>\n</ScrollView>\n"
  },
  {
    "path": "unit/BasicSample/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">22dp</dimen>\n    <dimen name=\"activity_vertical_margin_small\">18dp</dimen>\n    <dimen name=\"header_margin\">18dp</dimen>\n    <dimen name=\"buttonTextSize\">22sp</dimen>\n</resources>\n"
  },
  {
    "path": "unit/BasicSample/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <string name=\"app_name\">Basic unittest sample</string>\n    <string name=\"name_label\">Your name:</string>\n    <string name=\"dob_label\">Your date of birth:</string>\n    <string name=\"email_label\">Your Email address:</string>\n    <string name=\"settings_title\">My Settings</string>\n    <string name=\"save\">Save</string>\n    <string name=\"revert\">Revert</string>\n    <string name=\"name_hint\">Enter your name</string>\n    <string name=\"email_hint\">Enter your Email</string>\n</resources>\n"
  },
  {
    "path": "unit/BasicSample/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Light.NoTitleBar\"/>\n</resources>\n"
  },
  {
    "path": "unit/BasicSample/app/src/main/res/values-v21/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <dimen name=\"activity_vertical_margin\">18dp</dimen>\n    <dimen name=\"activity_vertical_margin_small\">0dp</dimen>\n    <dimen name=\"header_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "unit/BasicSample/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Material.Light.NoActionBar\"/>\n</resources>\n"
  },
  {
    "path": "unit/BasicSample/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "unit/BasicSample/app/src/test/java/com/example/android/testing/unittesting/BasicSample/EmailValidatorTest.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.unittesting.BasicSample;\n\nimport org.junit.Test;\n\nimport static org.junit.Assert.assertFalse;\nimport static org.junit.Assert.assertTrue;\n\n\n/**\n * Unit tests for the EmailValidator logic.\n */\npublic class EmailValidatorTest {\n\n\n    @Test\n    public void emailValidator_CorrectEmailSimple_ReturnsTrue() {\n        assertTrue(EmailValidator.isValidEmail(\"name@email.com\"));\n    }\n\n    @Test\n    public void emailValidator_CorrectEmailSubDomain_ReturnsTrue() {\n        assertTrue(EmailValidator.isValidEmail(\"name@email.co.uk\"));\n    }\n\n    @Test\n    public void emailValidator_InvalidEmailNoTld_ReturnsFalse() {\n        assertFalse(EmailValidator.isValidEmail(\"name@email\"));\n    }\n\n    @Test\n    public void emailValidator_InvalidEmailDoubleDot_ReturnsFalse() {\n        assertFalse(EmailValidator.isValidEmail(\"name@email..com\"));\n    }\n\n    @Test\n    public void emailValidator_InvalidEmailNoUsername_ReturnsFalse() {\n        assertFalse(EmailValidator.isValidEmail(\"@email.com\"));\n    }\n\n    @Test\n    public void emailValidator_EmptyString_ReturnsFalse() {\n        assertFalse(EmailValidator.isValidEmail(\"\"));\n    }\n\n    @Test\n    public void emailValidator_NullEmail_ReturnsFalse() {\n        assertFalse(EmailValidator.isValidEmail(null));\n    }\n}\n"
  },
  {
    "path": "unit/BasicSample/app/src/test/java/com/example/android/testing/unittesting/BasicSample/SharedPreferencesHelperTest.java",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.unittesting.BasicSample;\n\nimport static org.hamcrest.MatcherAssert.assertThat;\nimport static org.hamcrest.CoreMatchers.*;\nimport static org.mockito.Mockito.*;\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\nimport org.mockito.Mock;\nimport org.mockito.runners.MockitoJUnitRunner;\n\nimport android.content.SharedPreferences;\n\nimport java.util.Calendar;\n\n\n/**\n * Unit tests for the {@link SharedPreferencesHelper} that mocks {@link SharedPreferences}.\n */\n@RunWith(MockitoJUnitRunner.class)\npublic class SharedPreferencesHelperTest {\n\n    private static final String TEST_NAME = \"Test name\";\n\n    private static final String TEST_EMAIL = \"test@email.com\";\n\n    private static final Calendar TEST_DATE_OF_BIRTH = Calendar.getInstance();\n\n    static {\n        TEST_DATE_OF_BIRTH.set(1980, 1, 1);\n    }\n\n    private SharedPreferenceEntry mSharedPreferenceEntry;\n\n    private SharedPreferencesHelper mMockSharedPreferencesHelper;\n\n    private SharedPreferencesHelper mMockBrokenSharedPreferencesHelper;\n\n    @Mock\n    SharedPreferences mMockSharedPreferences;\n\n    @Mock\n    SharedPreferences mMockBrokenSharedPreferences;\n\n    @Mock\n    SharedPreferences.Editor mMockEditor;\n\n    @Mock\n    SharedPreferences.Editor mMockBrokenEditor;\n\n    @Before\n    public void initMocks() {\n        // Create SharedPreferenceEntry to persist.\n        mSharedPreferenceEntry = new SharedPreferenceEntry(TEST_NAME, TEST_DATE_OF_BIRTH,\n                TEST_EMAIL);\n\n        // Create a mocked SharedPreferences.\n        mMockSharedPreferencesHelper = createMockSharedPreference();\n\n        // Create a mocked SharedPreferences that fails at saving data.\n        mMockBrokenSharedPreferencesHelper = createBrokenMockSharedPreference();\n    }\n\n    @Test\n    public void sharedPreferencesHelper_SaveAndReadPersonalInformation() {\n        // Save the personal information to SharedPreferences\n        boolean success = mMockSharedPreferencesHelper.savePersonalInfo(mSharedPreferenceEntry);\n\n        assertThat(\"Checking that SharedPreferenceEntry.save... returns true\",\n                success, is(true));\n\n        // Read personal information from SharedPreferences\n        SharedPreferenceEntry savedSharedPreferenceEntry =\n                mMockSharedPreferencesHelper.getPersonalInfo();\n\n        // Make sure both written and retrieved personal information are equal.\n        assertThat(\"Checking that SharedPreferenceEntry.name has been persisted and read correctly\",\n                mSharedPreferenceEntry.getName(),\n                is(equalTo(savedSharedPreferenceEntry.getName())));\n        assertThat(\"Checking that SharedPreferenceEntry.dateOfBirth has been persisted and read \"\n                + \"correctly\",\n                mSharedPreferenceEntry.getDateOfBirth(),\n                is(equalTo(savedSharedPreferenceEntry.getDateOfBirth())));\n        assertThat(\"Checking that SharedPreferenceEntry.email has been persisted and read \"\n                + \"correctly\",\n                mSharedPreferenceEntry.getEmail(),\n                is(equalTo(savedSharedPreferenceEntry.getEmail())));\n    }\n\n    @Test\n    public void sharedPreferencesHelper_SavePersonalInformationFailed_ReturnsFalse() {\n        // Read personal information from a broken SharedPreferencesHelper\n        boolean success =\n                mMockBrokenSharedPreferencesHelper.savePersonalInfo(mSharedPreferenceEntry);\n        assertThat(\"Makes sure writing to a broken SharedPreferencesHelper returns false\", success,\n                is(false));\n    }\n\n    /**\n     * Creates a mocked SharedPreferences.\n     */\n    private SharedPreferencesHelper createMockSharedPreference() {\n        // Mocking reading the SharedPreferences as if mMockSharedPreferences was previously written\n        // correctly.\n        when(mMockSharedPreferences.getString(eq(SharedPreferencesHelper.KEY_NAME), anyString()))\n                .thenReturn(mSharedPreferenceEntry.getName());\n        when(mMockSharedPreferences.getString(eq(SharedPreferencesHelper.KEY_EMAIL), anyString()))\n                .thenReturn(mSharedPreferenceEntry.getEmail());\n        when(mMockSharedPreferences.getLong(eq(SharedPreferencesHelper.KEY_DOB), anyLong()))\n                .thenReturn(mSharedPreferenceEntry.getDateOfBirth().getTimeInMillis());\n\n        // Mocking a successful commit.\n        when(mMockEditor.commit()).thenReturn(true);\n\n        // Return the MockEditor when requesting it.\n        when(mMockSharedPreferences.edit()).thenReturn(mMockEditor);\n        return new SharedPreferencesHelper(mMockSharedPreferences);\n    }\n\n    /**\n     * Creates a mocked SharedPreferences that fails when writing.\n     */\n    private SharedPreferencesHelper createBrokenMockSharedPreference() {\n        // Mocking a commit that fails.\n        when(mMockBrokenEditor.commit()).thenReturn(false);\n\n        // Return the broken MockEditor when requesting it.\n        when(mMockBrokenSharedPreferences.edit()).thenReturn(mMockBrokenEditor);\n        return new SharedPreferencesHelper(mMockBrokenSharedPreferences);\n    }\n}\n"
  },
  {
    "path": "unit/BasicSample/build.gradle",
    "content": "/*\n * Copyright 2015, The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Top-level build file where you can add configuration options common to all sub-projects/modules.\nbuildscript {\n    ext.agpVersion = \"7.3.0-alpha07\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    buildToolsVersion = \"31.0.0\"\n    junitVersion = \"4.12\"\n    mockitoVersion = \"1.10.19\"\n}\n"
  },
  {
    "path": "unit/BasicSample/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-7.4-all.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "unit/BasicSample/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.useAndroidX=true"
  },
  {
    "path": "unit/BasicSample/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "unit/BasicSample/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "unit/BasicSample/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/.google/packaging.yaml",
    "content": "# Copyright 2018 Google Inc.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      http://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n# This file is used by Google as part of our samples packaging process.\n# End users may safely ignore this file. It has no relevance to other systems.\n---\nstatus:       PUBLISHED\ntechnologies: [Android]\ncategories:   [Getting Started]\nlanguages:    [Kotlin]\nsolutions:    [Mobile, Testing]\ngithub:       android-testing\nlevel:        BEGINNER\nlicense:      apache2\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/README.md",
    "content": "# Basic sample (in Kotlin) for writing unit tests that mocks the Android framework\n\n*If you are new to unit testing on Android, try this sample first.*\n\nThis project uses the Gradle build system and the Android gradle plugin support for unit testing.\nYou can either benefit from IDEs integration such as Android studio or run the tests on the command\nline.\n\nUnit tests run on a local JVM on your development machine. The Android Gradle plugin will compile\nyour app's source code and execute it using gradle test task. Tests are executed against a modified\nversion of android.jar where all final modifiers have been stripped off. This lets you use popular\nmocking libraries, like Mockito.\n\nFor more information see http://tools.android.com/tech-docs/unit-testing-support\n\n## Setup the project in Android studio and run tests.\n\n1. Download the project code, preferably using `git clone`.\n1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n1. Make sure you select \"Unit Tests\" as the test artifact in the \"Build Variants\" panel in Android Studio. \n1. Check out the relevant code:\n    * The application code is located in `src/main/java`\n    * Unit Tests are in `src/test/java`\n1. Create a test configuration with the JUnit4 runner: `org.junit.runners.JUnit4`\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *JUnit* configuration\n    * Choose module *app*\n    * Select the class to run by using the *...* button\n1. Run the newly created configuration\n\nThe unit test will be ran automatically.\n\n## Use Gradle on the command line.\n\nAfter downloading the projects code using `git clone` you'll be able to run the\nunit tests using the command line:\n\n    ./gradlew test\n\nIf all the unit tests have been successful you will get a `BUILD SUCCESSFUL`\nmessage.\n\n## See the report.\n\nA report in HTML format is generated in `app/build/reports/tests`\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\napply plugin: \"kotlin-android\"\n\napply plugin: \"kotlin-android-extensions\"\n\nandroid {\n    compileSdkVersion 27\n    defaultConfig {\n        applicationId \"com.example.android.testing.unittesting.BasicSample\"\n        minSdkVersion 14\n        versionCode 1\n        versionName \"1.0\"\n        targetSdkVersion 27\n    }\n}\n\ndependencies {\n    implementation \"org.jetbrains.kotlin:kotlin-stdlib-jre7:$kotlinVersion\"\n\n    // Unit testing dependencies.\n    testImplementation \"junit:junit:4.12\"\n    testImplementation \"org.mockito:mockito-core:2.8.9\"\n}\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n~ Copyright (C) 2015 The Android Open Source Project\n~\n~ Licensed under the Apache License, Version 2.0 (the \"License\");\n~ you may not use this file except in compliance with the License.\n~ You may obtain a copy of the License at\n~\n~   http://www.apache.org/licenses/LICENSE-2.0\n~\n~ Unless required by applicable law or agreed to in writing, software\n~ distributed under the License is distributed on an \"AS IS\" BASIS,\n~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n~ See the License for the specific language governing permissions and\n~ limitations under the License.\n-->\n\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    package=\"com.example.android.testing.unittesting.BasicSample\" >\n\n    <application\n        android:icon=\"@drawable/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.example.android.testing.unittesting.BasicSample.MainActivity\"\n            android:label=\"@string/app_name\" >\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/app/src/main/java/com/example/android/testing/unittesting/BasicSample/EmailValidator.kt",
    "content": "/*\n * Copyright (C) 2017 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.unittesting.BasicSample\n\nimport android.text.Editable\nimport android.text.TextWatcher\n\nimport java.util.regex.Pattern\n\n/**\n * An Email format validator for [android.widget.EditText].\n */\nclass EmailValidator : TextWatcher {\n\n    internal var isValid = false\n\n    override fun afterTextChanged(editableText: Editable) {\n        isValid = isValidEmail(editableText)\n    }\n\n    override fun beforeTextChanged(s: CharSequence, start: Int, count: Int, after: Int) = Unit\n\n    override fun onTextChanged(s: CharSequence, start: Int, before: Int, count: Int) = Unit\n\n    companion object {\n\n        /**\n         * Email validation pattern.\n         */\n        private val EMAIL_PATTERN = Pattern.compile(\n                \"[a-zA-Z0-9\\\\+\\\\.\\\\_\\\\%\\\\-\\\\+]{1,256}\" +\n                        \"\\\\@\" +\n                        \"[a-zA-Z0-9][a-zA-Z0-9\\\\-]{0,64}\" +\n                        \"(\" +\n                        \"\\\\.\" +\n                        \"[a-zA-Z0-9][a-zA-Z0-9\\\\-]{0,25}\" +\n                        \")+\"\n        )\n\n        /**\n         * Validates if the given input is a valid email address.\n         *\n         * @param email    The email to validate.\n         * @return `true`  if the input is a valid email, `false` otherwise.\n         */\n        fun isValidEmail(email: CharSequence?): Boolean {\n            return email != null && EMAIL_PATTERN.matcher(email).matches()\n        }\n    }\n}\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/app/src/main/java/com/example/android/testing/unittesting/BasicSample/MainActivity.kt",
    "content": "/*\n * Copyright (C) 2017 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.unittesting.BasicSample\n\nimport android.app.Activity\nimport android.content.SharedPreferences\nimport android.os.Bundle\nimport android.preference.PreferenceManager\nimport android.util.Log\nimport android.view.View\nimport android.widget.DatePicker\nimport android.widget.EditText\nimport android.widget.Toast\nimport java.util.Calendar\n\n/**\n * An [Activity] that represents an input form page where the user can provide their name, date\n * of birth, and email address. The personal information can be saved to [SharedPreferences]\n * by clicking a button.\n */\nclass MainActivity : Activity() {\n\n    private val TAG = \"MainActivity\"\n\n    // The helper that manages writing to SharedPreferences.\n    private lateinit var sharedPreferencesHelper: SharedPreferencesHelper\n\n    // The input field where the user enters their name.\n    private lateinit var nameText: EditText\n\n    // The date picker where the user enters their date of birth.\n    private lateinit var dobPicker: DatePicker\n\n    // The input field where the user enters their email.\n    private lateinit var emailText: EditText\n\n    // The validator for the email input field.\n    private var emailValidator = EmailValidator()\n\n    override fun onCreate(savedInstanceState: Bundle?) {\n        super.onCreate(savedInstanceState)\n        setContentView(R.layout.activity_main)\n\n        // Shortcuts to input fields.\n        nameText = findViewById(R.id.userNameInput)\n        dobPicker = findViewById(R.id.dateOfBirthInput)\n        emailText = findViewById(R.id.emailInput)\n\n        // Setup email field validator.\n        emailText.addTextChangedListener(emailValidator)\n\n        // Instantiate a SharedPreferencesHelper.\n        val sharedPreferences = PreferenceManager.getDefaultSharedPreferences(this)\n        sharedPreferencesHelper = SharedPreferencesHelper(sharedPreferences)\n\n        // Fill input fields from data retrieved from the SharedPreferences.\n        populateUi()\n    }\n\n    /**\n     * Initialize all fields from the personal info saved in the SharedPreferences.\n     */\n    private fun populateUi() {\n        val sharedPreferenceEntry = sharedPreferencesHelper.getPersonalInfo()\n        nameText.setText(sharedPreferenceEntry.name)\n        val dateOfBirth = sharedPreferenceEntry.dateOfBirth\n        dobPicker.init(dateOfBirth.get(Calendar.YEAR), dateOfBirth.get(Calendar.MONTH),\n                dateOfBirth.get(Calendar.DAY_OF_MONTH), null)\n        emailText.setText(sharedPreferenceEntry.email)\n    }\n\n    /**\n     * Called when the \"Save\" button is clicked.\n     */\n    fun onSaveClick(@Suppress(\"UNUSED_PARAMETER\") view: View) {\n        // Don't save if the fields do not validate.\n        if (!emailValidator.isValid) {\n            emailText.error = \"Invalid email\"\n            Log.w(TAG, \"Not saving personal information: Invalid email\")\n            return\n        }\n\n        // Get the text from the input fields.\n        val name = nameText.text.toString()\n        val dateOfBirth = Calendar.getInstance()\n        dateOfBirth.set(dobPicker.year, dobPicker.month, dobPicker.dayOfMonth)\n        val email = emailText.text.toString()\n\n        // Create a Setting model class to persist.\n        val sharedPreferenceEntry = SharedPreferenceEntry(name, dateOfBirth, email)\n\n        // Persist the personal information.\n        val isSuccess = sharedPreferencesHelper.savePersonalInfo(sharedPreferenceEntry)\n        if (isSuccess) {\n            Toast.makeText(this, \"Personal information saved\", Toast.LENGTH_LONG).show()\n            Log.i(TAG, \"Personal information saved\")\n        } else {\n            Log.e(TAG, \"Failed to write personal information to SharedPreferences\")\n        }\n    }\n\n    /**\n     * Called when the \"Revert\" button is clicked.\n     */\n    fun onRevertClick(@Suppress(\"UNUSED_PARAMETER\") view: View) {\n        populateUi()\n        Toast.makeText(this, \"Personal information reverted\", Toast.LENGTH_LONG).show()\n        Log.i(TAG, \"Personal information reverted\")\n    }\n\n}\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/app/src/main/java/com/example/android/testing/unittesting/BasicSample/SharedPreferenceEntry.kt",
    "content": "/*\n * Copyright (C) 2017 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.unittesting.BasicSample\n\nimport java.util.Calendar\n\n/**\n * Model class containing personal information that will be saved to SharedPreferences.\n */\nclass SharedPreferenceEntry(val name: String, val dateOfBirth: Calendar, val email: String)\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/app/src/main/java/com/example/android/testing/unittesting/BasicSample/SharedPreferencesHelper.kt",
    "content": "/*\n * Copyright (C) 2017 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.unittesting.BasicSample\n\nimport android.content.SharedPreferences\nimport java.util.Calendar\n\n/**\n * Helper class to manage access to [SharedPreferences].\n *\n * @param sharedPreferences The injected [SharedPreferences] that will be used in this DAO.\n */\nclass SharedPreferencesHelper(private val sharedPreferences: SharedPreferences) {\n\n    /**\n     * Retrieves the [SharedPreferenceEntry] containing the user's personal information from\n     * [SharedPreferences].\n     *\n     * @return the Retrieved [SharedPreferenceEntry].\n     */\n    // Get data from the SharedPreferences.\n    // Create and fill a SharedPreferenceEntry model object.\n    fun getPersonalInfo(): SharedPreferenceEntry {\n        val name = sharedPreferences.getString(KEY_NAME, \"\")\n        val dobMillis = sharedPreferences.getLong(KEY_DOB, Calendar.getInstance().timeInMillis)\n        val dateOfBirth = Calendar.getInstance().apply { timeInMillis = dobMillis }\n        val email = sharedPreferences.getString(KEY_EMAIL, \"\")\n        return SharedPreferenceEntry(name, dateOfBirth, email)\n    }\n\n    /**\n     * Saves the given [SharedPreferenceEntry] that contains the user's settings to\n     * [SharedPreferences].\n     *\n     * @param sharedPreferenceEntry contains data to save to [SharedPreferences].\n     * @return `true` if writing to [SharedPreferences] succeeded, `false` otherwise.\n     */\n    fun savePersonalInfo(sharedPreferenceEntry: SharedPreferenceEntry): Boolean {\n        // Start a SharedPreferences transaction.\n        val editor = sharedPreferences.edit().apply() {\n            putString(KEY_NAME, sharedPreferenceEntry.name)\n            putLong(KEY_DOB, sharedPreferenceEntry.dateOfBirth.timeInMillis)\n            putString(KEY_EMAIL, sharedPreferenceEntry.email)\n        }\n\n        // Commit changes to SharedPreferences.\n        return editor.commit()\n    }\n\n    companion object {\n        // Keys for saving values in SharedPreferences.\n        internal val KEY_NAME = \"key_name\"\n        internal val KEY_DOB = \"key_dob_millis\"\n        internal val KEY_EMAIL = \"key_email\"\n    }\n}\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright 2017 The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n\n<ScrollView xmlns:android=\"http://schemas.android.com/apk/res/android\"\n    xmlns:tools=\"http://schemas.android.com/tools\"\n    android:layout_width=\"match_parent\"\n    android:layout_height=\"wrap_content\"\n    android:orientation=\"vertical\"\n    android:padding=\"@dimen/activity_horizontal_margin\"\n    tools:context=\".MainActivity\">\n\n    <LinearLayout\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"vertical\"\n        android:padding=\"@dimen/activity_horizontal_margin\"\n        tools:context=\".MainActivity\">\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginBottom=\"@dimen/header_margin\"\n            android:text=\"@string/settings_title\"\n            android:textAppearance=\"?android:attr/textAppearanceLarge\"/>\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"start\"\n            android:text=\"@string/name_label\"\n            android:layout_marginTop=\"@dimen/activity_vertical_margin\"\n            android:textAppearance=\"?android:attr/textAppearanceMedium\"/>\n\n        <EditText\n            android:id=\"@+id/userNameInput\"\n            android:hint=\"@string/name_hint\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"/>\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"start\"\n            android:text=\"@string/dob_label\"\n            android:layout_marginTop=\"@dimen/activity_vertical_margin\"\n            android:textAppearance=\"?android:attr/textAppearanceMedium\"/>\n\n        <DatePicker\n            android:id=\"@+id/dateOfBirthInput\"\n            android:inputType=\"text|date\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:datePickerMode=\"spinner\"\n            android:calendarViewShown=\"false\"\n            android:layout_gravity=\"center_horizontal\"/>\n\n        <TextView\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"start\"\n            android:text=\"@string/email_label\"\n            android:layout_marginTop=\"@dimen/activity_vertical_margin_small\"\n            android:textAppearance=\"?android:attr/textAppearanceMedium\"/>\n\n        <EditText\n            android:id=\"@+id/emailInput\"\n            android:hint=\"@string/email_hint\"\n            android:inputType=\"textEmailAddress\"\n            android:layout_width=\"match_parent\"\n            android:layout_height=\"wrap_content\"\n            android:layout_gravity=\"center_horizontal\"/>\n\n        <LinearLayout\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:orientation=\"horizontal\"\n            android:layout_gravity=\"center_horizontal\"\n            android:layout_marginTop=\"@dimen/activity_vertical_margin\">\n\n            <Button\n                android:id=\"@+id/saveButton\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:textSize=\"@dimen/buttonTextSize\"\n                android:text=\"@string/save\"\n                android:onClick=\"onSaveClick\"\n                android:layout_marginRight=\"@dimen/activity_horizontal_margin\"\n                android:layout_marginEnd=\"@dimen/activity_horizontal_margin\"\n                android:layout_gravity=\"center_horizontal\"/>\n\n            <Button\n                android:id=\"@+id/revertButton\"\n                android:layout_width=\"wrap_content\"\n                android:layout_height=\"wrap_content\"\n                android:textSize=\"@dimen/buttonTextSize\"\n                android:onClick=\"onRevertClick\"\n                android:text=\"@string/revert\"\n                android:layout_gravity=\"center_horizontal\"/>\n\n        </LinearLayout>\n\n    </LinearLayout>\n\n</ScrollView>\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright 2017 The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n\n<resources>\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">22dp</dimen>\n    <dimen name=\"activity_vertical_margin_small\">18dp</dimen>\n    <dimen name=\"header_margin\">18dp</dimen>\n    <dimen name=\"buttonTextSize\">22sp</dimen>\n</resources>\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright 2017 The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n\n<resources>\n    <string name=\"app_name\">Basic unittest sample</string>\n    <string name=\"name_label\">Your name:</string>\n    <string name=\"dob_label\">Your date of birth:</string>\n    <string name=\"email_label\">Your Email address:</string>\n    <string name=\"settings_title\">My Settings</string>\n    <string name=\"save\">Save</string>\n    <string name=\"revert\">Revert</string>\n    <string name=\"name_hint\">Enter your name</string>\n    <string name=\"email_hint\">Enter your Email</string>\n</resources>\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright 2017 The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Light.NoTitleBar\"/>\n</resources>\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/app/src/main/res/values-v21/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright 2017 The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n\n<resources>\n    <dimen name=\"activity_vertical_margin\">18dp</dimen>\n    <dimen name=\"activity_vertical_margin_small\">0dp</dimen>\n    <dimen name=\"header_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright 2017 The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Material.Light.NoActionBar\"/>\n</resources>\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<!--\n Copyright 2017 The Android Open Source Project\n\n Licensed under the Apache License, Version 2.0 (the \"License\");\n you may not use this file except in compliance with the License.\n You may obtain a copy of the License at\n\n     http://www.apache.org/licenses/LICENSE-2.0\n\n Unless required by applicable law or agreed to in writing, software\n distributed under the License is distributed on an \"AS IS\" BASIS,\n WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n See the License for the specific language governing permissions and\n limitations under the License.\n-->\n\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/app/src/test/java/com/example/android/testing/unittesting/BasicSample/EmailValidatorTest.kt",
    "content": "/*\n * Copyright (C) 2017 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.unittesting.BasicSample\n\nimport org.junit.Assert.assertFalse\nimport org.junit.Assert.assertTrue\nimport org.junit.Test\n\n/**\n * Unit tests for the EmailValidator logic.\n */\nclass EmailValidatorTest {\n\n    @Test fun emailValidator_CorrectEmailSimple_ReturnsTrue() {\n        assertTrue(EmailValidator.isValidEmail(\"name@email.com\"))\n    }\n\n    @Test fun emailValidator_CorrectEmailSubDomain_ReturnsTrue() {\n        assertTrue(EmailValidator.isValidEmail(\"name@email.co.uk\"))\n    }\n\n    @Test fun emailValidator_InvalidEmailNoTld_ReturnsFalse() {\n        assertFalse(EmailValidator.isValidEmail(\"name@email\"))\n    }\n\n    @Test fun emailValidator_InvalidEmailDoubleDot_ReturnsFalse() {\n        assertFalse(EmailValidator.isValidEmail(\"name@email..com\"))\n    }\n\n    @Test fun emailValidator_InvalidEmailNoUsername_ReturnsFalse() {\n        assertFalse(EmailValidator.isValidEmail(\"@email.com\"))\n    }\n\n    @Test fun emailValidator_EmptyString_ReturnsFalse() {\n        assertFalse(EmailValidator.isValidEmail(\"\"))\n    }\n\n    @Test fun emailValidator_NullEmail_ReturnsFalse() {\n        assertFalse(EmailValidator.isValidEmail(null))\n    }\n\n}\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/app/src/test/java/com/example/android/testing/unittesting/BasicSample/SharedPreferencesHelperTest.kt",
    "content": "/*\n * Copyright (C) 2017 The Android Open Source Project\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.unittesting.BasicSample\n\nimport android.content.SharedPreferences\nimport org.junit.Assert.assertEquals\nimport org.junit.Assert.assertFalse\nimport org.junit.Assert.assertTrue\nimport org.junit.Before\nimport org.junit.Test\nimport org.junit.runner.RunWith\nimport org.mockito.ArgumentMatchers.anyLong\nimport org.mockito.ArgumentMatchers.anyString\nimport org.mockito.ArgumentMatchers.eq\nimport org.mockito.BDDMockito.given\nimport org.mockito.Mock\nimport org.mockito.junit.MockitoJUnitRunner\nimport java.util.Calendar\n\n/**\n * Unit tests for the [SharedPreferencesHelper] that mocks [SharedPreferences].\n */\n@RunWith(MockitoJUnitRunner::class)\nclass SharedPreferencesHelperTest {\n\n    private val TEST_NAME = \"Test name\"\n    private val TEST_EMAIL = \"test@email.com\"\n    private val TEST_DATE_OF_BIRTH = Calendar.getInstance().apply { set(1980, 1, 1) }\n\n    private lateinit var sharedPreferenceEntry: SharedPreferenceEntry\n    private lateinit var mockSharedPreferencesHelper: SharedPreferencesHelper\n    private lateinit var mockBrokenSharedPreferencesHelper: SharedPreferencesHelper\n\n    @Mock private lateinit var mockSharedPreferences: SharedPreferences\n    @Mock private lateinit var mockBrokenSharedPreferences: SharedPreferences\n    @Mock private lateinit var mockEditor: SharedPreferences.Editor\n    @Mock private lateinit var mockBrokenEditor: SharedPreferences.Editor\n\n    @Before fun initMocks() {\n        // Create SharedPreferenceEntry to persist.\n        sharedPreferenceEntry = SharedPreferenceEntry(TEST_NAME, TEST_DATE_OF_BIRTH, TEST_EMAIL)\n\n        // Create a mocked SharedPreferences.\n        mockSharedPreferencesHelper = createMockSharedPreference()\n\n        // Create a mocked SharedPreferences that fails at saving data.\n        mockBrokenSharedPreferencesHelper = createBrokenMockSharedPreference()\n    }\n\n    @Test fun sharedPreferencesHelper_SaveAndReadPersonalInformation() {\n        // Save the personal information to SharedPreferences\n        assertTrue(mockSharedPreferencesHelper.savePersonalInfo(sharedPreferenceEntry))\n\n        // Read personal information from SharedPreferences\n        val savedEntry = mockSharedPreferencesHelper.getPersonalInfo()\n\n        // Make sure both written and retrieved personal information are equal.\n        assertEquals(sharedPreferenceEntry.name, savedEntry.name)\n        assertEquals(sharedPreferenceEntry.dateOfBirth, savedEntry.dateOfBirth)\n        assertEquals(sharedPreferenceEntry.email, savedEntry.email)\n    }\n\n    @Test fun sharedPreferencesHelper_SavePersonalInformationFailed_ReturnsFalse() {\n        // Read personal information from a broken SharedPreferencesHelper\n        assertFalse(mockBrokenSharedPreferencesHelper.savePersonalInfo(sharedPreferenceEntry))\n    }\n\n    /**\n     * Creates a mocked SharedPreferences.\n     */\n    private fun createMockSharedPreference(): SharedPreferencesHelper {\n        // Mocking reading the SharedPreferences as if mockSharedPreferences was previously written\n        // correctly.\n        given(mockSharedPreferences.getString(eq(SharedPreferencesHelper.KEY_NAME), anyString()))\n                .willReturn(sharedPreferenceEntry.name)\n        given(mockSharedPreferences.getString(eq(SharedPreferencesHelper.KEY_EMAIL), anyString()))\n                .willReturn(sharedPreferenceEntry.email)\n        given(mockSharedPreferences.getLong(eq(SharedPreferencesHelper.KEY_DOB), anyLong()))\n                .willReturn(sharedPreferenceEntry.dateOfBirth.timeInMillis)\n\n        // Mocking a successful commit.\n        given(mockEditor.commit()).willReturn(true)\n\n        // Return the MockEditor when requesting it.\n        given(mockSharedPreferences.edit()).willReturn(mockEditor)\n        return SharedPreferencesHelper(mockSharedPreferences)\n    }\n\n    /**\n     * Creates a mocked SharedPreferences that fails when writing.\n     */\n    private fun createBrokenMockSharedPreference(): SharedPreferencesHelper {\n        // Mocking a commit that fails.\n        given(mockBrokenEditor.commit()).willReturn(false)\n\n        // Return the broken MockEditor when requesting it.\n        given(mockBrokenSharedPreferences.edit()).willReturn(mockBrokenEditor)\n        return SharedPreferencesHelper(mockBrokenSharedPreferences)\n    }\n\n}\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/build.gradle",
    "content": "buildscript {\n    ext {\n        kotlinVersion = \"1.3.61\"\n    }\n    repositories {\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:3.5.2\"\n        classpath \"org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion\"\n    }\n}\n\nallprojects {\n    repositories {\n        google()\n        mavenCentral()\n    }\n}\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-7.4-all.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.useAndroidX=true\n\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "unit/BasicSample-kotlinApp/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "unit/BasicUnitAndroidTest/.gitignore",
    "content": ".gradle\n/local.properties\n/.idea/workspace.xml\n/.idea/libraries\n.DS_Store\nbuild\n"
  },
  {
    "path": "unit/BasicUnitAndroidTest/README.md",
    "content": "# Basic sample for unit testing on device or emulator\n\nAn *Unit Android Test* is a test that needs an Android device or emulator but it's different\nfrom a UI test because it doesn't start any activities.\n\nIn this sample the test can't run without the Android Framework because the Parcel class is used in\none of the methods of the Parcelable interface and the way data is written into a Parcel and read\nfrom it is not trivial enough to be stubbed.\n\nNote that the unit test is placed in `/androidTest/` instead of `/test/`.\n\nThis project uses the Gradle build system. You can either benefit from IDEs\nintegration such as Android studio or run the tests on the command line.\n\n## Setup the project in Android studio and run the tests.\n\n1. Download the project code, preferably using `git clone`.\n1. In Android Studio, select *File* | *Open...* and point to the `./build.gradle` file.\n1. Check out the relevant code:\n    * `LogHistory.java` is the class under test. It implements Parcelable.\n    * `LogHistoryAndroidUnitTest` is the Android unit test\n    * `MainActivity.java` shows the Parcelable in action but note that the test is not showing any\nactivities on the device or emulator.\n1. Create the test configuration with a custom runner: `androidx.test.runner.AndroidJUnitRunner`\n    * Open *Run* menu | *Edit Configurations*\n    * Add a new *Android Tests* configuration\n    * Choose a module\n    * Add a *Specific instrumentation runner*: `androidx.test.runner.AndroidJUnitRunner`\n1. Connect a device or start an emulator\n1. Run the newly created configuration\n\nThe unit test will be ran automatically.\n\n## Use Gradle on the command line.\n\nAfter downloading the projects code using `git clone` you'll be able to run the\nunit tests using the command line:\n\n    ./gradlew connectedCheck\n\nIf all the unit tests have been successful you will get a `BUILD SUCCESSFUL`\nmessage.\n\n## See the report.\n\nA report in HTML format is generated in `app/build/outputs/reports/androidTests/connected`\n"
  },
  {
    "path": "unit/BasicUnitAndroidTest/app/build.gradle",
    "content": "apply plugin: \"com.android.application\"\n\nandroid {\n    compileSdk 33\n    buildToolsVersion = rootProject.buildToolsVersion\n\n    defaultConfig {\n        applicationId \"com.example.android.testing.unittesting.basicunitandroidtest\"\n        minSdkVersion 14\n        targetSdkVersion 33\n        versionCode 1\n        versionName \"1.0\"\n        testInstrumentationRunner \"androidx.test.runner.AndroidJUnitRunner\"\n    }\n    namespace \"com.example.android.testing.unittesting.basicunitandroidtest\"\n}\n\ndependencies {\n    // Testing-only dependencies\n    androidTestImplementation \"androidx.test:core:\" + rootProject.coreVersion;\n    androidTestImplementation \"androidx.test.ext:junit:\" + rootProject.extJUnitVersion;\n    androidTestImplementation \"androidx.test:runner:\" + rootProject.runnerVersion;\n    androidTestImplementation \"com.google.truth:truth:\" + rootProject.truthVersion\n}\n"
  },
  {
    "path": "unit/BasicUnitAndroidTest/app/src/androidTest/java/com/example/android/testing/unittesting/basicunitandroidtest/LogHistoryAndroidUnitTest.java",
    "content": "/*\n * Copyright 2015 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.unittesting.basicunitandroidtest;\n\nimport android.os.Parcel;\nimport androidx.test.filters.SmallTest;\nimport androidx.test.ext.junit.runners.AndroidJUnit4;\nimport android.util.Pair;\n\nimport org.junit.Before;\nimport org.junit.Test;\nimport org.junit.runner.RunWith;\n\nimport java.util.List;\n\nimport static com.google.common.truth.Truth.assertThat;\n\n/**\n * Tests that the parcelable interface is implemented correctly.\n */\n@RunWith(AndroidJUnit4.class)\n@SmallTest\npublic class LogHistoryAndroidUnitTest {\n\n    public static final String TEST_STRING = \"This is a string\";\n    public static final long TEST_LONG = 12345678L;\n    private LogHistory mLogHistory;\n\n    @Before\n    public void createLogHistory() {\n        mLogHistory = new LogHistory();\n    }\n\n    @Test\n    public void logHistory_ParcelableWriteRead() {\n        // Set up the Parcelable object to send and receive.\n        mLogHistory.addEntry(TEST_STRING, TEST_LONG);\n\n        // Write the data\n        Parcel parcel = Parcel.obtain();\n        mLogHistory.writeToParcel(parcel, mLogHistory.describeContents());\n\n        // After you're done with writing, you need to reset the parcel for reading.\n        parcel.setDataPosition(0);\n\n        // Read the data\n        LogHistory createdFromParcel = LogHistory.CREATOR.createFromParcel(parcel);\n        List<Pair<String, Long>> createdFromParcelData = createdFromParcel.getData();\n\n        // Verify that the received data is correct.\n        assertThat(createdFromParcelData.size()).isEqualTo(1);\n        assertThat(createdFromParcelData.get(0).first).isEqualTo(TEST_STRING);\n        assertThat(createdFromParcelData.get(0).second).isEqualTo(TEST_LONG);\n    }\n}\n"
  },
  {
    "path": "unit/BasicUnitAndroidTest/app/src/main/AndroidManifest.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<manifest xmlns:android=\"http://schemas.android.com/apk/res/android\">\n\n    <application\n        android:icon=\"@mipmap/ic_launcher\"\n        android:label=\"@string/app_name\"\n        android:theme=\"@style/AppTheme\" >\n        <activity\n            android:name=\"com.example.android.testing.unittesting.basicunitandroidtest.MainActivity\"\n            android:windowSoftInputMode=\"adjustResize\"\n            android:label=\"@string/app_name\"\n            android:exported=\"true\">\n            <intent-filter>\n                <action android:name=\"android.intent.action.MAIN\" />\n\n                <category android:name=\"android.intent.category.LAUNCHER\" />\n            </intent-filter>\n        </activity>\n    </application>\n\n</manifest>\n"
  },
  {
    "path": "unit/BasicUnitAndroidTest/app/src/main/java/com/example/android/testing/unittesting/basicunitandroidtest/LogHistory.java",
    "content": "/*\n * Copyright 2015 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\npackage com.example.android.testing.unittesting.basicunitandroidtest;\n\nimport android.os.Parcel;\nimport android.os.Parcelable;\nimport android.util.Pair;\n\nimport java.util.ArrayList;\nimport java.util.List;\n\n/**\n * Model that stores a parcelable log of entries, each with a timestamp.\n */\npublic class LogHistory implements Parcelable {\n\n    // Used to store the data to be used by the activity.\n    private final List<Pair<String, Long>> mData = new ArrayList<>();\n\n    // Creates an empty log.\n    public LogHistory() { }\n\n    @Override\n    public int describeContents() {\n        return 0;\n    }\n\n    @Override\n    public void writeToParcel(Parcel out, int flags) {\n        // Prepare an array of strings and an array of timestamps.\n        String[] texts = new String[mData.size()];\n        long[] timestamps = new long[mData.size()];\n\n        // Store the data in the arrays.\n        for (int i = 0; i < mData.size(); i++) {\n            texts[i] = mData.get(i).first;\n            timestamps[i] = mData.get(i).second;\n        }\n        // Write the size of the arrays first.\n        out.writeInt(texts.length);\n\n        // Write the two arrays in a specific order.\n        out.writeStringArray(texts);\n        out.writeLongArray(timestamps);\n    }\n\n    public static final Parcelable.Creator<LogHistory> CREATOR\n            = new Parcelable.Creator<LogHistory>() {\n\n        @Override\n        public LogHistory createFromParcel(Parcel in) {\n            return new LogHistory(in);\n        }\n\n        @Override\n        public LogHistory[] newArray(int size) {\n            return new LogHistory[size];\n        }\n    };\n\n    /**\n     * Returns a copy of the current data used by the activity.\n     */\n    public List<Pair<String, Long>> getData() {\n        return new ArrayList<>(mData);\n    }\n\n    /**\n     * Adds a new entry to the log.\n     * @param text the text to be stored in the log\n     * @param timestamp the current time in milliseconds since January 1, 1970 00:00:00.0 UTC.\n     */\n    public void addEntry(String text, long timestamp) {\n        mData.add(new Pair<String, Long>(text, timestamp));\n    }\n\n    // Constructor used from the CREATOR field that unpacks a Parcel.\n    private LogHistory(Parcel in) {\n        // First, read the size of the arrays that contain the data.\n        int length = in.readInt();\n\n        // Create the arrays to store the data.\n        String[] texts = new String[length];\n        long[] timestamps = new long[length];\n\n        // Read the arrays in a specific order.\n        in.readStringArray(texts);\n        in.readLongArray(timestamps);\n\n        // The lengths of both arrays should match or the data is corrupted.\n        if (texts.length != timestamps.length) {\n            throw new IllegalStateException(\"Error reading from saved state.\");\n        }\n\n        // Reset the data container and update the data.\n        mData.clear();\n        for (int i = 0; i < texts.length; i++) {\n            Pair<String, Long> pair = new Pair<>(texts[i], timestamps[i]);\n            mData.add(pair);\n        }\n    }\n}"
  },
  {
    "path": "unit/BasicUnitAndroidTest/app/src/main/java/com/example/android/testing/unittesting/basicunitandroidtest/MainActivity.java",
    "content": "/*\n * Copyright 2015 Google Inc. All rights reserved.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n *      http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\npackage com.example.android.testing.unittesting.basicunitandroidtest;\n\nimport android.app.Activity;\nimport android.os.Bundle;\nimport android.util.Pair;\nimport android.view.View;\nimport android.widget.EditText;\nimport android.widget.TextView;\n\nimport java.text.DateFormat;\nimport java.text.SimpleDateFormat;\nimport java.util.Date;\nimport java.util.Locale;\n\n/**\n * Lets the user add lines to a multi-line log. When the device is rotated, the state is saved\n * and restored.\n */\npublic class MainActivity extends Activity {\n\n    private static final String KEY_HISTORY_DATA = \"KEY_HISTORY_DATA\";\n\n    LogHistory mLogHistory;\n    boolean mIsHistoryEmpty = true;\n    private TextView mHistoryTextView;\n    private DateFormat mSimpleDateFormatter;\n\n    /**\n     * Called when the user wants to append an entry to the history.\n     */\n    public void updateHistory(View view) {\n        // Get the text to add and timestamp.\n        EditText editText = (EditText) view.getRootView().findViewById(R.id.editText);\n        CharSequence textToAdd = editText.getText();\n        long timestamp = System.currentTimeMillis();\n\n        // Show it back to the user.\n        appendEntryToView(textToAdd.toString(), timestamp);\n\n        // Update the history.\n        mLogHistory.addEntry(textToAdd.toString(), timestamp);\n\n        // Reset the EditText.\n        editText.setText(\"\");\n    }\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_main);\n\n        mLogHistory = new LogHistory();\n\n        mHistoryTextView = ((TextView) findViewById(R.id.history));\n        mSimpleDateFormatter = new SimpleDateFormat(\"HH:mm:ss:SSS\", Locale.getDefault());\n\n        if (savedInstanceState != null) {\n            // We've got a past state, apply it to the UI.\n            mLogHistory = savedInstanceState.getParcelable(KEY_HISTORY_DATA);\n            for (Pair<String, Long> entry : mLogHistory.getData()) {\n                appendEntryToView(entry.first, entry.second);\n            }\n        }\n    }\n\n    @Override\n    protected void onRestoreInstanceState(Bundle savedInstanceState) {\n        super.onRestoreInstanceState(savedInstanceState);\n    }\n\n    @Override\n    protected void onSaveInstanceState(Bundle outState) {\n        super.onSaveInstanceState(outState);\n        outState.putParcelable(KEY_HISTORY_DATA, mLogHistory);\n    }\n\n    private void appendEntryToView(String text, long timestamp) {\n        Date date = new Date(timestamp);\n        // Add a newline if needed or clear the text view (to get rid of the hint).\n        if (!mIsHistoryEmpty) {\n            mHistoryTextView.append(\"\\n\");\n        } else {\n            mHistoryTextView.setText(\"\");\n        }\n        // Add the representation of the new entry to the text view.\n        mHistoryTextView.append(String.format(\"%s [%s]\", text, mSimpleDateFormatter.format(date)));\n\n        mIsHistoryEmpty = false;\n    }\n}\n"
  },
  {
    "path": "unit/BasicUnitAndroidTest/app/src/main/res/layout/activity_main.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<LinearLayout xmlns:android=\"http://schemas.android.com/apk/res/android\"\n                xmlns:tools=\"http://schemas.android.com/tools\"\n                android:layout_width=\"match_parent\"\n                android:layout_height=\"match_parent\"\n                android:paddingLeft=\"@dimen/activity_horizontal_margin\"\n                android:paddingRight=\"@dimen/activity_horizontal_margin\"\n                android:paddingTop=\"@dimen/activity_vertical_margin\"\n                android:paddingBottom=\"@dimen/activity_vertical_margin\"\n                android:orientation=\"vertical\"\n                tools:context=\".MainActivity\">\n\n    <TextView\n        android:id=\"@+id/history\"\n        android:layout_width=\"match_parent\"\n        android:layout_height=\"0dp\"\n        android:text=\"@string/new_text\"\n        android:minLines=\"4\"\n        android:layout_weight=\"1\"/>\n\n    <LinearLayout\n        android:layout_width=\"fill_parent\"\n        android:layout_height=\"wrap_content\"\n        android:orientation=\"horizontal\"\n        android:gravity=\"bottom\">\n\n        <EditText\n            android:id=\"@+id/editText\"\n            android:layout_width=\"0dp\"\n            android:layout_height=\"wrap_content\"\n            android:hint=\"@string/input_text_hint\"\n            android:layout_weight=\"1\"/>\n\n        <Button\n            android:id=\"@+id/button\"\n            android:layout_width=\"wrap_content\"\n            android:layout_height=\"wrap_content\"\n            android:text=\"@string/update_text\"\n            android:layout_gravity=\"end\"\n            android:onClick=\"updateHistory\"/>\n    </LinearLayout>\n</LinearLayout>\n"
  },
  {
    "path": "unit/BasicUnitAndroidTest/app/src/main/res/values/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Default screen margins, per the Android Design guidelines. -->\n    <dimen name=\"activity_horizontal_margin\">16dp</dimen>\n    <dimen name=\"activity_vertical_margin\">16dp</dimen>\n</resources>\n"
  },
  {
    "path": "unit/BasicUnitAndroidTest/app/src/main/res/values/strings.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <string name=\"app_name\">BasicUnitAndroidTest</string>\n    <string name=\"update_text\">Update history</string>\n    <string name=\"input_text_hint\">Text to add</string>\n    <string name=\"new_text\">Empty log</string>\n</resources>\n"
  },
  {
    "path": "unit/BasicUnitAndroidTest/app/src/main/res/values/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Light\"/>\n</resources>"
  },
  {
    "path": "unit/BasicUnitAndroidTest/app/src/main/res/values-v21/styles.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Base application theme. -->\n    <style name=\"AppTheme\" parent=\"android:Theme.Material.Light.NoActionBar\"/>\n</resources>"
  },
  {
    "path": "unit/BasicUnitAndroidTest/app/src/main/res/values-w820dp/dimens.xml",
    "content": "<?xml version=\"1.0\" encoding=\"utf-8\"?>\n<!--\n  ~ Copyright (C) 2015 The Android Open Source Project\n  ~\n  ~ Licensed under the Apache License, Version 2.0 (the \"License\");\n  ~ you may not use this file except in compliance with the License.\n  ~ You may obtain a copy of the License at\n  ~\n  ~   http://www.apache.org/licenses/LICENSE-2.0\n  ~\n  ~ Unless required by applicable law or agreed to in writing, software\n  ~ distributed under the License is distributed on an \"AS IS\" BASIS,\n  ~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n  ~ See the License for the specific language governing permissions and\n  ~ limitations under the License.\n  -->\n<resources>\n    <!-- Example customization of dimensions originally defined in res/values/dimens.xml\n         (such as screen margins) for screens with more than 820dp of available width. This\n         would include 7\" and 10\" devices in landscape (~960dp and ~1280dp respectively). -->\n    <dimen name=\"activity_horizontal_margin\">64dp</dimen>\n</resources>\n"
  },
  {
    "path": "unit/BasicUnitAndroidTest/build.gradle",
    "content": "// Top-level build file where you can add configuration options common to all sub-projects/modules.\n\nbuildscript {\n    ext.agpVersion = \"8.1.1\"\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n    dependencies {\n        classpath \"com.android.tools.build:gradle:$agpVersion\"\n\n        // NOTE: Do not place your application dependencies here; they belong\n        // in the individual module build.gradle files\n    }\n}\n\nallprojects {\n    repositories {\n        // Insert local test repo here\n        google()\n        mavenCentral()\n    }\n}\n\next {\n    buildToolsVersion = \"31.0.0\"\n    androidxAnnotationVersion = \"1.2.0\"\n    coreVersion = \"1.5.0\"\n    extJUnitVersion = \"1.1.4\"\n    runnerVersion = \"1.5.0\"\n    hamcrestVersion = \"1.3\"\n    truthVersion = \"1.1.3\"\n}\n"
  },
  {
    "path": "unit/BasicUnitAndroidTest/gradle/wrapper/gradle-wrapper.properties",
    "content": "distributionBase=GRADLE_USER_HOME\ndistributionPath=wrapper/dists\ndistributionUrl=https\\://services.gradle.org/distributions/gradle-8.7-bin.zip\nzipStoreBase=GRADLE_USER_HOME\nzipStorePath=wrapper/dists\n"
  },
  {
    "path": "unit/BasicUnitAndroidTest/gradle.properties",
    "content": "# Project-wide Gradle settings.\n\n# IDE (e.g. Android Studio) users:\n# Gradle settings configured through the IDE *will override*\n# any settings specified in this file.\n\n# For more details on how to configure your build environment visit\n# http://www.gradle.org/docs/current/userguide/build_environment.html\n\n# Specifies the JVM arguments used for the daemon process.\n# The setting is particularly useful for tweaking memory settings.\n# Default value: -Xmx10248m -XX:MaxPermSize=256m\n# org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8\n\n# When configured, Gradle will run in incubating parallel mode.\n# This option should only be used with decoupled projects. More details, visit\n# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects\n# org.gradle.parallel=true \nandroid.defaults.buildfeatures.buildconfig=true\nandroid.nonFinalResIds=false\nandroid.nonTransitiveRClass=false\nandroid.useAndroidX=true"
  },
  {
    "path": "unit/BasicUnitAndroidTest/gradlew",
    "content": "#!/bin/sh\n\n#\n# Copyright © 2015-2021 the original authors.\n#\n# Licensed under the Apache License, Version 2.0 (the \"License\");\n# you may not use this file except in compliance with the License.\n# You may obtain a copy of the License at\n#\n#      https://www.apache.org/licenses/LICENSE-2.0\n#\n# Unless required by applicable law or agreed to in writing, software\n# distributed under the License is distributed on an \"AS IS\" BASIS,\n# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n# See the License for the specific language governing permissions and\n# limitations under the License.\n#\n\n##############################################################################\n#\n#   Gradle start up script for POSIX generated by Gradle.\n#\n#   Important for running:\n#\n#   (1) You need a POSIX-compliant shell to run this script. If your /bin/sh is\n#       noncompliant, but you have some other compliant shell such as ksh or\n#       bash, then to run this script, type that shell name before the whole\n#       command line, like:\n#\n#           ksh Gradle\n#\n#       Busybox and similar reduced shells will NOT work, because this script\n#       requires all of these POSIX shell features:\n#         * functions;\n#         * expansions «$var», «${var}», «${var:-default}», «${var+SET}»,\n#           «${var#prefix}», «${var%suffix}», and «$( cmd )»;\n#         * compound commands having a testable exit status, especially «case»;\n#         * various built-in commands including «command», «set», and «ulimit».\n#\n#   Important for patching:\n#\n#   (2) This script targets any POSIX shell, so it avoids extensions provided\n#       by Bash, Ksh, etc; in particular arrays are avoided.\n#\n#       The \"traditional\" practice of packing multiple parameters into a\n#       space-separated string is a well documented source of bugs and security\n#       problems, so this is (mostly) avoided, by progressively accumulating\n#       options in \"$@\", and eventually passing that to Java.\n#\n#       Where the inherited environment variables (DEFAULT_JVM_OPTS, JAVA_OPTS,\n#       and GRADLE_OPTS) rely on word-splitting, this is performed explicitly;\n#       see the in-line comments for details.\n#\n#       There are tweaks for specific operating systems such as AIX, CygWin,\n#       Darwin, MinGW, and NonStop.\n#\n#   (3) This script is generated from the Groovy template\n#       https://github.com/gradle/gradle/blob/master/subprojects/plugins/src/main/resources/org/gradle/api/internal/plugins/unixStartScript.txt\n#       within the Gradle project.\n#\n#       You can find Gradle at https://github.com/gradle/gradle/.\n#\n##############################################################################\n\n# Attempt to set APP_HOME\n\n# Resolve links: $0 may be a link\napp_path=$0\n\n# Need this for daisy-chained symlinks.\nwhile\n    APP_HOME=${app_path%\"${app_path##*/}\"}  # leaves a trailing /; empty if no leading path\n    [ -h \"$app_path\" ]\ndo\n    ls=$( ls -ld \"$app_path\" )\n    link=${ls#*' -> '}\n    case $link in             #(\n      /*)   app_path=$link ;; #(\n      *)    app_path=$APP_HOME$link ;;\n    esac\ndone\n\nAPP_HOME=$( cd \"${APP_HOME:-./}\" && pwd -P ) || exit\n\nAPP_NAME=\"Gradle\"\nAPP_BASE_NAME=${0##*/}\n\n# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\nDEFAULT_JVM_OPTS='\"-Xmx64m\" \"-Xms64m\"'\n\n# Use the maximum available, or set MAX_FD != -1 to use that value.\nMAX_FD=maximum\n\nwarn () {\n    echo \"$*\"\n} >&2\n\ndie () {\n    echo\n    echo \"$*\"\n    echo\n    exit 1\n} >&2\n\n# OS specific support (must be 'true' or 'false').\ncygwin=false\nmsys=false\ndarwin=false\nnonstop=false\ncase \"$( uname )\" in                #(\n  CYGWIN* )         cygwin=true  ;; #(\n  Darwin* )         darwin=true  ;; #(\n  MSYS* | MINGW* )  msys=true    ;; #(\n  NONSTOP* )        nonstop=true ;;\nesac\n\nCLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar\n\n\n# Determine the Java command to use to start the JVM.\nif [ -n \"$JAVA_HOME\" ] ; then\n    if [ -x \"$JAVA_HOME/jre/sh/java\" ] ; then\n        # IBM's JDK on AIX uses strange locations for the executables\n        JAVACMD=$JAVA_HOME/jre/sh/java\n    else\n        JAVACMD=$JAVA_HOME/bin/java\n    fi\n    if [ ! -x \"$JAVACMD\" ] ; then\n        die \"ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\n    fi\nelse\n    JAVACMD=java\n    which java >/dev/null 2>&1 || die \"ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\n\nPlease set the JAVA_HOME variable in your environment to match the\nlocation of your Java installation.\"\nfi\n\n# Increase the maximum file descriptors if we can.\nif ! \"$cygwin\" && ! \"$darwin\" && ! \"$nonstop\" ; then\n    case $MAX_FD in #(\n      max*)\n        MAX_FD=$( ulimit -H -n ) ||\n            warn \"Could not query maximum file descriptor limit\"\n    esac\n    case $MAX_FD in  #(\n      '' | soft) :;; #(\n      *)\n        ulimit -n \"$MAX_FD\" ||\n            warn \"Could not set maximum file descriptor limit to $MAX_FD\"\n    esac\nfi\n\n# Collect all arguments for the java command, stacking in reverse order:\n#   * args from the command line\n#   * the main class name\n#   * -classpath\n#   * -D...appname settings\n#   * --module-path (only if needed)\n#   * DEFAULT_JVM_OPTS, JAVA_OPTS, and GRADLE_OPTS environment variables.\n\n# For Cygwin or MSYS, switch paths to Windows format before running java\nif \"$cygwin\" || \"$msys\" ; then\n    APP_HOME=$( cygpath --path --mixed \"$APP_HOME\" )\n    CLASSPATH=$( cygpath --path --mixed \"$CLASSPATH\" )\n\n    JAVACMD=$( cygpath --unix \"$JAVACMD\" )\n\n    # Now convert the arguments - kludge to limit ourselves to /bin/sh\n    for arg do\n        if\n            case $arg in                                #(\n              -*)   false ;;                            # don't mess with options #(\n              /?*)  t=${arg#/} t=/${t%%/*}              # looks like a POSIX filepath\n                    [ -e \"$t\" ] ;;                      #(\n              *)    false ;;\n            esac\n        then\n            arg=$( cygpath --path --ignore --mixed \"$arg\" )\n        fi\n        # Roll the args list around exactly as many times as the number of\n        # args, so each arg winds up back in the position where it started, but\n        # possibly modified.\n        #\n        # NB: a `for` loop captures its iteration list before it begins, so\n        # changing the positional parameters here affects neither the number of\n        # iterations, nor the values presented in `arg`.\n        shift                   # remove old arg\n        set -- \"$@\" \"$arg\"      # push replacement arg\n    done\nfi\n\n# Collect all arguments for the java command;\n#   * $DEFAULT_JVM_OPTS, $JAVA_OPTS, and $GRADLE_OPTS can contain fragments of\n#     shell script including quotes and variable substitutions, so put them in\n#     double quotes to make sure that they get re-expanded; and\n#   * put everything else in single quotes, so that it's not re-expanded.\n\nset -- \\\n        \"-Dorg.gradle.appname=$APP_BASE_NAME\" \\\n        -classpath \"$CLASSPATH\" \\\n        org.gradle.wrapper.GradleWrapperMain \\\n        \"$@\"\n\n# Use \"xargs\" to parse quoted args.\n#\n# With -n1 it outputs one arg per line, with the quotes and backslashes removed.\n#\n# In Bash we could simply go:\n#\n#   readarray ARGS < <( xargs -n1 <<<\"$var\" ) &&\n#   set -- \"${ARGS[@]}\" \"$@\"\n#\n# but POSIX shell has neither arrays nor command substitution, so instead we\n# post-process each arg (as a line of input to sed) to backslash-escape any\n# character that might be a shell metacharacter, then use eval to reverse\n# that process (while maintaining the separation between arguments), and wrap\n# the whole thing up as a single \"set\" statement.\n#\n# This will of course break if any of these variables contains a newline or\n# an unmatched quote.\n#\n\neval \"set -- $(\n        printf '%s\\n' \"$DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS\" |\n        xargs -n1 |\n        sed ' s~[^-[:alnum:]+,./:=@_]~\\\\&~g; ' |\n        tr '\\n' ' '\n    )\" '\"$@\"'\n\nexec \"$JAVACMD\" \"$@\"\n"
  },
  {
    "path": "unit/BasicUnitAndroidTest/gradlew.bat",
    "content": "@rem\r\n@rem Copyright 2015 the original author or authors.\r\n@rem\r\n@rem Licensed under the Apache License, Version 2.0 (the \"License\");\r\n@rem you may not use this file except in compliance with the License.\r\n@rem You may obtain a copy of the License at\r\n@rem\r\n@rem      https://www.apache.org/licenses/LICENSE-2.0\r\n@rem\r\n@rem Unless required by applicable law or agreed to in writing, software\r\n@rem distributed under the License is distributed on an \"AS IS\" BASIS,\r\n@rem WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r\n@rem See the License for the specific language governing permissions and\r\n@rem limitations under the License.\r\n@rem\r\n\r\n@if \"%DEBUG%\" == \"\" @echo off\r\n@rem ##########################################################################\r\n@rem\r\n@rem  Gradle startup script for Windows\r\n@rem\r\n@rem ##########################################################################\r\n\r\n@rem Set local scope for the variables with windows NT shell\r\nif \"%OS%\"==\"Windows_NT\" setlocal\r\n\r\nset DIRNAME=%~dp0\r\nif \"%DIRNAME%\" == \"\" set DIRNAME=.\r\nset APP_BASE_NAME=%~n0\r\nset APP_HOME=%DIRNAME%\r\n\r\n@rem Resolve any \".\" and \"..\" in APP_HOME to make it shorter.\r\nfor %%i in (\"%APP_HOME%\") do set APP_HOME=%%~fi\r\n\r\n@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.\r\nset DEFAULT_JVM_OPTS=\"-Xmx64m\" \"-Xms64m\"\r\n\r\n@rem Find java.exe\r\nif defined JAVA_HOME goto findJavaFromJavaHome\r\n\r\nset JAVA_EXE=java.exe\r\n%JAVA_EXE% -version >NUL 2>&1\r\nif \"%ERRORLEVEL%\" == \"0\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:findJavaFromJavaHome\r\nset JAVA_HOME=%JAVA_HOME:\"=%\r\nset JAVA_EXE=%JAVA_HOME%/bin/java.exe\r\n\r\nif exist \"%JAVA_EXE%\" goto execute\r\n\r\necho.\r\necho ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%\r\necho.\r\necho Please set the JAVA_HOME variable in your environment to match the\r\necho location of your Java installation.\r\n\r\ngoto fail\r\n\r\n:execute\r\n@rem Setup the command line\r\n\r\nset CLASSPATH=%APP_HOME%\\gradle\\wrapper\\gradle-wrapper.jar\r\n\r\n\r\n@rem Execute Gradle\r\n\"%JAVA_EXE%\" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% \"-Dorg.gradle.appname=%APP_BASE_NAME%\" -classpath \"%CLASSPATH%\" org.gradle.wrapper.GradleWrapperMain %*\r\n\r\n:end\r\n@rem End local scope for the variables with windows NT shell\r\nif \"%ERRORLEVEL%\"==\"0\" goto mainEnd\r\n\r\n:fail\r\nrem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of\r\nrem the _cmd.exe /c_ return code!\r\nif  not \"\" == \"%GRADLE_EXIT_CONSOLE%\" exit 1\r\nexit /b 1\r\n\r\n:mainEnd\r\nif \"%OS%\"==\"Windows_NT\" endlocal\r\n\r\n:omega\r\n"
  },
  {
    "path": "unit/BasicUnitAndroidTest/settings.gradle",
    "content": "include ':app'\n"
  },
  {
    "path": "update_versions.sh",
    "content": "#!/bin/bash\n\n# Simple script to update the androidx.test versions used in this project.\n\nset -ex  # Exit immediately if a command exits with a non-zero status.\n\n#repourl=\"\" # Leave empty to be ignored\n#repourl=\"file:\\/\\/\\/tmp\\/test_repo\\/m2repository\"\n#repourl=\"https:\\/\\/oss.sonatype.org\\/content\\/repositories\\/orgrobolectric-1216\"\n#repourl=\"http:\\/\\/localhost:1480\"\n# Versions:                             # axt_versions.bzl equivalents\nagpVersion=\"8.5.0\"\nkotlinVersion=\"1.9.22\"                  # KOTLIN_VERSION\ncompileSdk=\"34\"\nminSdkVersion=\"21\"\ntargetSdkVersion=\"34\"\nandroidxAnnotationVersion=\"1.5.0\"       # ANDROIDX_ANNOTATION_VERSION\nandroidxCompatVersion=\"1.5.1\"           # ANDROIDX_COMPAT_VERSION\nandroidxCoreVersion=\"1.9.0\"             # ANDROIDX_CORE_VERSION\nandroidxFragmentVersion=\"1.5.3\"         # ANDROIDX_FRAGMENT_VERSION\nandroidxRecyclerVersion=\"1.2.1\"         # ANDROIDX_RECYCLERVIEW_VERSION\nguavaVersion=\"31.1-android\"           # GUAVA_VERSION\ntruthVersion=\"1.1.3\"                    # TRUTH_VERSION\nrunnerVersion=\"1.6.1\"           # RUNNER_VERSION\nmonitorVersion=\"1.7.1\"          # MONITOR_VERSION\nrulesVersion=\"1.6.1\"            # RULES_VERSION\nservicesVersion=\"1.5.0\"         # SERVICES_VERSION\norchestratorVersion=\"1.5.0\"     # ORCHESTRATOR_VERSION\ncoreVersion=\"1.6.1\"             # CORE_VERSION\nextJUnitVersion=\"1.2.1\"         # ANDROIDX_JUNIT_VERSION\nextTruthVersion=\"1.6.0\"         # ANDROIDX_TRUTH_VERSION\nespressoVersion=\"3.6.1\"         # ESPRESSO_VERSION\nespressoDeviceVersion=\"1.0.1\"  # ESPRESSO_DEVICE_VERSION\nrobolectricVersion=\"4.13\"\nuiAutomatorVersion=\"2.3.0\"              # UIAUTOMATOR_VERSION\n\nfor p in $(cat projects.conf); do\n   echo\n   echo\n   echo Updating version in $p\n   echo \"=====================================================================\"\n   pushd $p > /dev/null  # Silent pushd\n\n   # Replace versions\n   sed -i \"s/agpVersion = \\([\\\"']\\).*\\1/agpVersion = \\\"$agpVersion\\\"/\" build.gradle\n   sed -i \"s/kotlinVersion = \\([\\\"']\\).*\\1/kotlinVersion = \\\"$kotlinVersion\\\"/\" build.gradle\n   sed -i \"s/coreVersion = \\([\\\"']\\).*\\1/coreVersion = \\\"$coreVersion\\\"/\" build.gradle\n   sed -i \"s/extJUnitVersion = \\([\\\"']\\).*\\1/extJUnitVersion = \\\"$extJUnitVersion\\\"/\" build.gradle\n   sed -i \"s/extTruthVersion = \\([\\\"']\\).*\\1/extTruthVersion = \\\"$extTruthVersion\\\"/\" build.gradle\n   sed -i \"s/monitorVersion = \\([\\\"']\\).*\\1/monitorVersion = \\\"$monitorVersion\\\"/\" build.gradle\n   sed -i \"s/runnerVersion = \\([\\\"']\\).*\\1/runnerVersion = \\\"$runnerVersion\\\"/\" build.gradle\n   sed -i \"s/rulesVersion = \\([\\\"']\\).*\\1/rulesVersion = \\\"$rulesVersion\\\"/\" build.gradle\n   sed -i \"s/servicesVersion = \\([\\\"']\\).*\\1/servicesVersion = \\\"$servicesVersion\\\"/\" build.gradle\n   sed -i \"s/orchestratorVersion = \\([\\\"']\\).*\\1/orchestratorVersion = \\\"$orchestratorVersion\\\"/\" build.gradle\n   sed -i \"s/espressoVersion = \\([\\\"']\\).*\\1/espressoVersion = \\\"$espressoVersion\\\"/\" build.gradle\n   sed -i \"s/androidxAnnotationVersion = \\([\\\"']\\).*\\1/androidxAnnotationVersion = \\\"$androidxAnnotationVersion\\\"/\" build.gradle\n   sed -i \"s/androidxCompatVersion = \\([\\\"']\\).*\\1/androidxCompatVersion = \\\"$androidxCompatVersion\\\"/\" build.gradle\n   sed -i \"s/androidxCoreVersion = \\([\\\"']\\).*\\1/androidxCoreVersion = \\\"$androidxCoreVersion\\\"/\" build.gradle\n   sed -i \"s/androidxFragmentVersion = \\([\\\"']\\).*\\1/androidxFragmentVersion = \\\"$androidxFragmentVersion\\\"/\" build.gradle\n   sed -i \"s/androidxRecyclerVersion = \\([\\\"']\\).*\\1/androidxRecyclerVersion = \\\"$androidxRecyclerVersion\\\"/\" build.gradle\n   sed -i \"s/guavaVersion = \\([\\\"']\\).*\\1/guavaVersion = \\\"$guavaVersion\\\"/\" build.gradle\n   sed -i \"s/truthVersion = \\([\\\"']\\).*\\1/truthVersion = \\\"$truthVersion\\\"/\" build.gradle\n   sed -i \"s/compileSdk .*/compileSdk $compileSdk/\" app/build.gradle\n   sed -i \"s/minSdkVersion .*/minSdkVersion $minSdkVersion/\" app/build.gradle\n   sed -i \"s/targetSdkVersion .*/targetSdkVersion $targetSdkVersion/\" app/build.gradle\n   sed -i \"s/uiAutomatorVersion = \\([\\\"']\\).*\\1/uiAutomatorVersion = \\\"$uiAutomatorVersion\\\"/\" build.gradle\n   sed -i \"s/robolectricVersion = \\([\\\"']\\).*\\1/robolectricVersion = \\\"$robolectricVersion\\\"/\" build.gradle\n   if [ ! -z \"$repourl\" ]\n   then\n      for G in build.gradle settings.gradle; do\n          sed -i \"s/.*google()/        google()\\n        maven {\\n            url \\\"$repourl\\\"\\n          allowInsecureProtocol=true\\n        }/\" $G\n      done\n   fi\n   popd > /dev/null  # Silent popd\n  done\necho\necho \"All Converted\"\n\n"
  }
]