Snap for 6001391 from ad5b3d3bbde13635356a44c75aba05837e1e69dd to qt-aml-networking-release

Change-Id: I6b8a13402aa5dcc103b2f4925348e3332f0e1fdb
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 7b87fb1..07000cc 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -95,7 +95,7 @@
         <service
             android:name=".QsService"
             android:enabled="false"
-            android:icon="@drawable/stat_sys_adb"
+            android:icon="@drawable/bugfood_icon"
             android:label="@string/record_trace"
             android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
             <intent-filter>
diff --git a/res/drawable-nodpi/bugfood_icon.xml b/res/drawable-nodpi/bugfood_icon.xml
new file mode 100644
index 0000000..3b5c619
--- /dev/null
+++ b/res/drawable-nodpi/bugfood_icon.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2019 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
+  -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24.0dp"
+        android:height="24.0dp"
+        android:viewportWidth="24.0"
+        android:viewportHeight="24.0">
+    <path
+        android:pathData="M5.76 12.89c0 3.28 2.54 5.97 5.76 6.22v-8.26h-5.4c-.23.64-.36 1.33-.36 2.04zm9.27-5.45l1.01-1.59c.19-.29.1-.67-.19-.86-.29-.19-.68-.1-.86.19l-1.12 1.76c-.59-.19-1.22-.29-1.87-.29s-1.28.1-1.87.29L9.01 5.18c-.18-.29-.57-.38-.86-.19-.29.18-.38.57-.19.86l1.01 1.59c-1.02.57-1.86 1.43-2.43 2.45h10.92c-.57-1.02-1.41-1.88-2.43-2.45zm2.85 3.41h-5.4v8.26c3.22-.25 5.76-2.93 5.76-6.22 0-.71-.13-1.4-.36-2.04z"
+        android:fillColor="#FFFFFF"/>
+</vector>
diff --git a/res/drawable-nodpi/bugfood_icon_green.xml b/res/drawable-nodpi/bugfood_icon_green.xml
new file mode 100644
index 0000000..6894377
--- /dev/null
+++ b/res/drawable-nodpi/bugfood_icon_green.xml
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+  ~ Copyright (C) 2019 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
+  -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:width="24.0dp"
+        android:height="24.0dp"
+        android:viewportWidth="24.0"
+        android:viewportHeight="24.0">
+    <path
+        android:pathData="M5.76 12.89c0 3.28 2.54 5.97 5.76 6.22v-8.26h-5.4c-.23.64-.36 1.33-.36 2.04zm9.27-5.45l1.01-1.59c.19-.29.1-.67-.19-.86-.29-.19-.68-.1-.86.19l-1.12 1.76c-.59-.19-1.22-.29-1.87-.29s-1.28.1-1.87.29L9.01 5.18c-.18-.29-.57-.38-.86-.19-.29.18-.38.57-.19.86l1.01 1.59c-1.02.57-1.86 1.43-2.43 2.45h10.92c-.57-1.02-1.41-1.88-2.43-2.45zm2.85 3.41h-5.4v8.26c3.22-.25 5.76-2.93 5.76-6.22 0-.71-.13-1.4-.36-2.04z"
+        android:fillColor="@android:color/holo_green_light"/>
+</vector>
diff --git a/res/drawable-nodpi/stat_sys_adb.xml b/res/drawable-nodpi/stat_sys_adb.xml
deleted file mode 100644
index 0020ac5..0000000
--- a/res/drawable-nodpi/stat_sys_adb.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (C) 2015 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
-  -->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="24.0dp"
-        android:height="24.0dp"
-        android:viewportWidth="24.0"
-        android:viewportHeight="24.0">
-    <path
-        android:pathData="M19.000000,10.000000c0.000000,3.866000 -3.134000,7.000000 -7.000000,7.000000s-7.000000,-3.134000 -7.000000,-7.000000c0.000000,-2.318000 1.131000,-4.367000 2.867000,-5.641000L5.778000,2.270000l0.824000,-0.825000l2.290000,2.290000C9.830000,3.269000 10.882000,3.000000 12.000000,3.000000c1.118000,0.000000 2.170000,0.269000 3.107000,0.734000l2.290000,-2.290000l0.824000,0.825000l-2.089000,2.090000C17.868000,5.633000 19.000000,7.682000 19.000000,10.000000zM10.000000,8.000000c0.000000,-0.552000 -0.447000,-1.000000 -1.000000,-1.000000S8.000000,7.448000 8.000000,8.000000s0.447000,1.000000 1.000000,1.000000S10.000000,8.552000 10.000000,8.000000zM16.000000,8.000000c0.000000,-0.552000 -0.447000,-1.000000 -1.000000,-1.000000s-1.000000,0.448000 -1.000000,1.000000s0.447000,1.000000 1.000000,1.000000S16.000000,8.552000 16.000000,8.000000z"
-        android:fillColor="#FFFFFF"/>
-    <path
-        android:pathData="M11,18l2,0l0,5l-2,0z"
-        android:fillColor="#FFFFFF"/>
-</vector>
diff --git a/res/drawable-nodpi/stat_sys_adb_green.xml b/res/drawable-nodpi/stat_sys_adb_green.xml
deleted file mode 100644
index 0e0b447..0000000
--- a/res/drawable-nodpi/stat_sys_adb_green.xml
+++ /dev/null
@@ -1,28 +0,0 @@
-<?xml version="1.0" encoding="utf-8"?>
-<!--
-  ~ Copyright (C) 2015 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
-  -->
-<vector xmlns:android="http://schemas.android.com/apk/res/android"
-        android:width="24.0dp"
-        android:height="24.0dp"
-        android:viewportWidth="24.0"
-        android:viewportHeight="24.0">
-    <path
-        android:pathData="M19.000000,10.000000c0.000000,3.866000 -3.134000,7.000000 -7.000000,7.000000s-7.000000,-3.134000 -7.000000,-7.000000c0.000000,-2.318000 1.131000,-4.367000 2.867000,-5.641000L5.778000,2.270000l0.824000,-0.825000l2.290000,2.290000C9.830000,3.269000 10.882000,3.000000 12.000000,3.000000c1.118000,0.000000 2.170000,0.269000 3.107000,0.734000l2.290000,-2.290000l0.824000,0.825000l-2.089000,2.090000C17.868000,5.633000 19.000000,7.682000 19.000000,10.000000zM10.000000,8.000000c0.000000,-0.552000 -0.447000,-1.000000 -1.000000,-1.000000S8.000000,7.448000 8.000000,8.000000s0.447000,1.000000 1.000000,1.000000S10.000000,8.552000 10.000000,8.000000zM16.000000,8.000000c0.000000,-0.552000 -0.447000,-1.000000 -1.000000,-1.000000s-1.000000,0.448000 -1.000000,1.000000s0.447000,1.000000 1.000000,1.000000S16.000000,8.552000 16.000000,8.000000z"
-        android:fillColor="@android:color/holo_green_light"/>
-    <path
-        android:pathData="M11,18l2,0l0,5l-2,0z"
-        android:fillColor="@android:color/holo_green_light"/>
-</vector>
diff --git a/src/com/android/traceur/FileSender.java b/src/com/android/traceur/FileSender.java
index b069521..051ecc6 100644
--- a/src/com/android/traceur/FileSender.java
+++ b/src/com/android/traceur/FileSender.java
@@ -57,7 +57,7 @@
 
         final Notification.Builder builder =
             new Notification.Builder(context, Receiver.NOTIFICATION_CHANNEL_OTHER)
-                .setSmallIcon(R.drawable.stat_sys_adb)
+                .setSmallIcon(R.drawable.bugfood_icon)
                 .setContentTitle(context.getString(R.string.trace_saved))
                 .setTicker(context.getString(R.string.trace_saved))
                 .setContentText(context.getString(R.string.tap_to_share))
diff --git a/src/com/android/traceur/QsService.java b/src/com/android/traceur/QsService.java
index 0ddbf36..dc2c711 100644
--- a/src/com/android/traceur/QsService.java
+++ b/src/com/android/traceur/QsService.java
@@ -53,7 +53,7 @@
 
         String titleString = getString(tracingOn ? R.string.stop_tracing: R.string.record_trace);
 
-        getQsTile().setIcon(Icon.createWithResource(this, R.drawable.stat_sys_adb));
+        getQsTile().setIcon(Icon.createWithResource(this, R.drawable.bugfood_icon));
         getQsTile().setState(tracingOn ? Tile.STATE_ACTIVE : Tile.STATE_INACTIVE);
         getQsTile().setLabel(titleString);
         getQsTile().updateTile();
diff --git a/src/com/android/traceur/Receiver.java b/src/com/android/traceur/Receiver.java
index b58dec6..402ba67 100644
--- a/src/com/android/traceur/Receiver.java
+++ b/src/com/android/traceur/Receiver.java
@@ -225,7 +225,7 @@
         String msg = TextUtils.join(", ", getActiveUnavailableTags(context, prefs));
         final Notification.Builder builder =
             new Notification.Builder(context, NOTIFICATION_CHANNEL_OTHER)
-                .setSmallIcon(R.drawable.stat_sys_adb)
+                .setSmallIcon(R.drawable.bugfood_icon)
                 .setContentTitle(title)
                 .setTicker(title)
                 .setContentText(msg)
diff --git a/src/com/android/traceur/StorageProvider.java b/src/com/android/traceur/StorageProvider.java
index 1a92b61..37cf073 100644
--- a/src/com/android/traceur/StorageProvider.java
+++ b/src/com/android/traceur/StorageProvider.java
@@ -89,7 +89,7 @@
         row.add(Root.COLUMN_ROOT_ID, DOC_ID_ROOT);
         row.add(Root.COLUMN_FLAGS, Root.FLAG_LOCAL_ONLY);
         row.add(Root.COLUMN_MIME_TYPES, MIME_TYPE);
-        row.add(Root.COLUMN_ICON, R.drawable.stat_sys_adb_green);
+        row.add(Root.COLUMN_ICON, R.drawable.bugfood_icon_green);
         row.add(Root.COLUMN_TITLE,
             getContext().getString(R.string.system_traces_storage_title));
         row.add(Root.COLUMN_DOCUMENT_ID, DOC_ID_ROOT);
diff --git a/src/com/android/traceur/TraceService.java b/src/com/android/traceur/TraceService.java
index dc567b6..f2551ca 100644
--- a/src/com/android/traceur/TraceService.java
+++ b/src/com/android/traceur/TraceService.java
@@ -111,7 +111,7 @@
 
         Notification.Builder notification =
             new Notification.Builder(context, Receiver.NOTIFICATION_CHANNEL_TRACING)
-                .setSmallIcon(R.drawable.stat_sys_adb)
+                .setSmallIcon(R.drawable.bugfood_icon)
                 .setContentTitle(title)
                 .setTicker(title)
                 .setContentText(msg)
@@ -150,7 +150,7 @@
 
         Notification.Builder notification =
             new Notification.Builder(this, Receiver.NOTIFICATION_CHANNEL_OTHER)
-                .setSmallIcon(R.drawable.stat_sys_adb)
+                .setSmallIcon(R.drawable.bugfood_icon)
                 .setContentTitle(getString(R.string.saving_trace))
                 .setTicker(getString(R.string.saving_trace))
                 .setLocalOnly(true)
diff --git a/uitests/src/com/android/traceur/uitest/TraceurAppTests.java b/uitests/src/com/android/traceur/uitest/TraceurAppTests.java
index ef7445c..1048001 100644
--- a/uitests/src/com/android/traceur/uitest/TraceurAppTests.java
+++ b/uitests/src/com/android/traceur/uitest/TraceurAppTests.java
@@ -24,6 +24,7 @@
 import android.platform.test.annotations.Presubmit;
 import android.support.test.uiautomator.By;
 import android.support.test.uiautomator.UiDevice;
+import android.support.test.uiautomator.UiObjectNotFoundException;
 import android.support.test.uiautomator.UiSelector;
 import android.support.test.uiautomator.UiScrollable;
 import android.support.test.uiautomator.Until;
@@ -104,7 +105,11 @@
                 TIMEOUT));
 
         UiScrollable mainScreen = new UiScrollable(new UiSelector().scrollable(true));
-        mainScreen.scrollToEnd(2);
+        try {
+            mainScreen.scrollToEnd(2);
+        } catch (UiObjectNotFoundException e) {
+          // if the screen is not scrollable, all elements should be visible already
+        }
 
         assertNotNull("Clear saved traces element not found.",
                 mDevice.wait(Until.findObject(By.text("Clear saved traces")),