Merge "Snap for 5455383 from b1a0c215927dc0b9240c14892e3a041ef850dc57 to pie-cts-release" into pie-cts-release
diff --git a/common/androidx-test/Android.bp b/common/androidx-test/Android.bp
index 7450aaf..550fae4 100644
--- a/common/androidx-test/Android.bp
+++ b/common/androidx-test/Android.bp
@@ -208,6 +208,30 @@
 }
 
 android_library_import {
+    name: "androidx.test.janktesthelper-nodeps",
+    aars: ["androidx/test/janktesthelper/janktesthelper/1.0.1/janktesthelper-1.0.1.aar"],
+    sdk_version: "current",
+    // min_sdk_version: "23",
+    static_libs: [
+        "androidx.test.runner",
+        "androidx.test.rules",
+    ],
+}
+
+android_library {
+    name: "androidx.test.janktesthelper",
+    sdk_version: "current",
+    // min_sdk_version: "23",
+    manifest: "manifests/androidx.test.janktesthelper/AndroidManifest.xml",
+    static_libs: [
+        "androidx.test.janktesthelper-nodeps",
+        "androidx.test.runner",
+        "androidx.test.rules",
+    ],
+    java_version: "1.7",
+}
+
+android_library_import {
     name: "androidx.test.monitor-nodeps",
     aars: ["androidx/test/monitor/1.1.1/monitor-1.1.1.aar"],
     sdk_version: "current",
@@ -274,3 +298,24 @@
     ],
     java_version: "1.7",
 }
+
+android_library_import {
+    name: "androidx.test.uiautomator-nodeps",
+    aars: ["androidx/test/uiautomator/uiautomator/2.2.0/uiautomator-2.2.0.aar"],
+    sdk_version: "current",
+    // min_sdk_version: "18",
+    static_libs: [
+    ],
+}
+
+android_library {
+    name: "androidx.test.uiautomator",
+    sdk_version: "current",
+    // min_sdk_version: "18",
+    manifest: "manifests/androidx.test.uiautomator/AndroidManifest.xml",
+    static_libs: [
+        "androidx.test.uiautomator-nodeps",
+    ],
+    java_version: "1.7",
+}
+
diff --git a/common/androidx-test/Android.mk b/common/androidx-test/Android.mk
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/common/androidx-test/Android.mk
diff --git a/common/androidx-test/androidx/test/janktesthelper/janktesthelper/1.0.1/janktesthelper-1.0.1.aar b/common/androidx-test/androidx/test/janktesthelper/janktesthelper/1.0.1/janktesthelper-1.0.1.aar
new file mode 100644
index 0000000..6e95f9c
--- /dev/null
+++ b/common/androidx-test/androidx/test/janktesthelper/janktesthelper/1.0.1/janktesthelper-1.0.1.aar
Binary files differ
diff --git a/common/androidx-test/androidx/test/janktesthelper/janktesthelper/1.0.1/janktesthelper-1.0.1.pom b/common/androidx-test/androidx/test/janktesthelper/janktesthelper/1.0.1/janktesthelper-1.0.1.pom
new file mode 100644
index 0000000..0ee2332
--- /dev/null
+++ b/common/androidx-test/androidx/test/janktesthelper/janktesthelper/1.0.1/janktesthelper-1.0.1.pom
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+    xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>androidx.test.janktesthelper</groupId>
+  <artifactId>janktesthelper</artifactId>
+  <version>1.0.1</version>
+  <packaging>aar</packaging>
+  <name>AndroidX Test Library</name>
+  <description>The AndroidX Test Library provides an extensive framework for testing Android apps</description>
+  <url>https://developer.android.com/testing</url>
+  <inceptionYear>2015</inceptionYear>
+  <licenses>
+    <license>
+      <name>The Apache Software License, Version 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+      <distribution>repo</distribution>
+    </license>
+  </licenses>
+  <developers>
+    <developer>
+      <name>The Android Open Source Project</name>
+    </developer>
+  </developers>
+  <dependencies>
+    <dependency>
+      <groupId>androidx.test</groupId>
+      <artifactId>runner</artifactId>
+      <version>1.1.0</version>
+      <scope>compile</scope>
+    </dependency>
+    <dependency>
+      <groupId>androidx.test</groupId>
+      <artifactId>rules</artifactId>
+      <version>1.1.0</version>
+      <scope>compile</scope>
+    </dependency>
+  </dependencies>
+</project>
diff --git a/common/androidx-test/androidx/test/uiautomator/uiautomator/2.2.0/uiautomator-2.2.0.aar b/common/androidx-test/androidx/test/uiautomator/uiautomator/2.2.0/uiautomator-2.2.0.aar
new file mode 100644
index 0000000..0de0b20
--- /dev/null
+++ b/common/androidx-test/androidx/test/uiautomator/uiautomator/2.2.0/uiautomator-2.2.0.aar
Binary files differ
diff --git a/common/androidx-test/androidx/test/uiautomator/uiautomator/2.2.0/uiautomator-2.2.0.pom b/common/androidx-test/androidx/test/uiautomator/uiautomator/2.2.0/uiautomator-2.2.0.pom
new file mode 100644
index 0000000..7138ebe
--- /dev/null
+++ b/common/androidx-test/androidx/test/uiautomator/uiautomator/2.2.0/uiautomator-2.2.0.pom
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"
+    xmlns="http://maven.apache.org/POM/4.0.0"
+    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>androidx.test.uiautomator</groupId>
+  <artifactId>uiautomator</artifactId>
+  <version>2.2.0</version>
+  <packaging>aar</packaging>
+  <name>AndroidX Test Library</name>
+  <description>The AndroidX Test Library provides an extensive framework for testing Android apps</description>
+  <url>https://developer.android.com/testing</url>
+  <inceptionYear>2015</inceptionYear>
+  <licenses>
+    <license>
+      <name>The Apache Software License, Version 2.0</name>
+      <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+      <distribution>repo</distribution>
+    </license>
+  </licenses>
+  <developers>
+    <developer>
+      <name>The Android Open Source Project</name>
+    </developer>
+  </developers>
+  <dependencies>
+
+  </dependencies>
+</project>
diff --git a/common/androidx-test/manifests/androidx.test.janktesthelper/AndroidManifest.xml b/common/androidx-test/manifests/androidx.test.janktesthelper/AndroidManifest.xml
new file mode 100644
index 0000000..7443ef6
--- /dev/null
+++ b/common/androidx-test/manifests/androidx.test.janktesthelper/AndroidManifest.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="android_libs.ub_janktesthelper" >
+
+    <uses-sdk android:minSdkVersion="23" />
+
+    <application />
+
+</manifest>
\ No newline at end of file
diff --git a/common/androidx-test/manifests/androidx.test.uiautomator/AndroidManifest.xml b/common/androidx-test/manifests/androidx.test.uiautomator/AndroidManifest.xml
new file mode 100644
index 0000000..71d498b
--- /dev/null
+++ b/common/androidx-test/manifests/androidx.test.uiautomator/AndroidManifest.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+ Copyright (C) 2014 The Android Open Source Project
+
+     Licensed under the Apache License, Version 2.0 (the "License");
+     you may not use this file except in compliance with the License.
+     You may obtain a copy of the License at
+
+          http://www.apache.org/licenses/LICENSE-2.0
+
+     Unless required by applicable law or agreed to in writing, software
+     distributed under the License is distributed on an "AS IS" BASIS,
+     WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+     See the License for the specific language governing permissions and
+     limitations under the License.
+-->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="android_libs.ub_uiautomator" >
+
+    <uses-sdk android:minSdkVersion="18" />
+
+    <application />
+
+</manifest>
\ No newline at end of file
diff --git a/common/androidx-test/update-from-gmaven.py b/common/androidx-test/update-from-gmaven.py
index 04c7d5e..77a4658 100755
--- a/common/androidx-test/update-from-gmaven.py
+++ b/common/androidx-test/update-from-gmaven.py
@@ -24,11 +24,15 @@
 coreVersion="1.1.0"
 extJUnitVersion="1.1.0"
 extTruthVersion="1.1.0"
+jankTestHelperVersion="1.0.1"
+uiAutomatorVersion="2.2.0"
 
 mavenToBpPatternMap = {
     "androidx.test:" : "androidx.test.",
     "androidx.test.ext:": "androidx.test.ext.",
     "androidx.test.espresso:espresso-":"androidx.test.espresso.",
+    "androidx.test.janktesthelper:janktesthelper":"androidx.test.janktesthelper",
+    "androidx.test.uiautomator:uiautomator":"androidx.test.uiautomator",
     }
 
 def cmd(args):
@@ -97,12 +101,14 @@
 downloadArtifact("androidx.test", "runner", runnerVersion)
 downloadArtifact("androidx.test.ext", "junit", extJUnitVersion)
 downloadArtifact("androidx.test.ext", "truth", extTruthVersion)
+downloadArtifact("androidx.test.janktesthelper", "janktesthelper", jankTestHelperVersion)
+downloadArtifact("androidx.test.uiautomator", "uiautomator", uiAutomatorVersion)
 
 atxRewriteStr = ""
 for name in mavenToBpPatternMap:
   atxRewriteStr += "-rewrite %s=%s " % (name, mavenToBpPatternMap[name])
 
-cmd("pom2mk " + atxRewriteStr +
+cmd("pom2bp " + atxRewriteStr +
     # map external maven dependencies to Android module names
     "-rewrite com.google.truth:truth=truth-prebuilt " +
     "-rewrite net.sf.kxml:kxml2=kxml2-android " +
@@ -117,4 +123,4 @@
     "-rewrite androidx.core:core=androidx.core_core " +
     "-rewrite androidx.legacy:legacy-support-core-utils=androidx.legacy_legacy-support-core-utils " +
     "-sdk-version current " +
-    ". > Android.mk")
+    ". > Android.bp")