Add launch screen

quantum_launchscreen_contacts.xml files are generated by following
go/launch-screens

All added drawables are copied from:
java/com/google/android/assets/product/res/*/*.png
java/com/google/android/assets/googlelogo/res/*/*.png

All added dimens are copied from:
java/com/google/android/assets/launchscreens/res/*/dimens.xml

Bug: 30255034
Bug: 35360058

Test: on nexus 5x and 9, observe launch screen shown correctly.

Change-Id: If9a659b65ef9d0ea38b377b8ecdb5382314570f5
diff --git a/AndroidManifest.xml b/AndroidManifest.xml
index 779230f..7478bb6 100644
--- a/AndroidManifest.xml
+++ b/AndroidManifest.xml
@@ -74,7 +74,7 @@
             android:alwaysRetainTaskState="true"
             android:launchMode="singleTop"
             android:resizeableActivity="true"
-            android:theme="@style/PeopleActivityTheme"
+            android:theme="@style/LaunchScreenTheme"
             >
             <intent-filter>
                 <action android:name="android.intent.action.MAIN"/>
diff --git a/res/drawable-hdpi/googlelogo_dark20_color_132x44.png b/res/drawable-hdpi/googlelogo_dark20_color_132x44.png
new file mode 100644
index 0000000..078c8a8
--- /dev/null
+++ b/res/drawable-hdpi/googlelogo_dark20_color_132x44.png
Binary files differ
diff --git a/res/drawable-hdpi/googlelogo_dark20_color_184x60.png b/res/drawable-hdpi/googlelogo_dark20_color_184x60.png
new file mode 100644
index 0000000..9d25e3d
--- /dev/null
+++ b/res/drawable-hdpi/googlelogo_dark20_color_184x60.png
Binary files differ
diff --git a/res/drawable-hdpi/product_logo_contacts_color_144.png b/res/drawable-hdpi/product_logo_contacts_color_144.png
new file mode 100644
index 0000000..d26a363
--- /dev/null
+++ b/res/drawable-hdpi/product_logo_contacts_color_144.png
Binary files differ
diff --git a/res/drawable-hdpi/product_logo_contacts_color_192.png b/res/drawable-hdpi/product_logo_contacts_color_192.png
new file mode 100644
index 0000000..ebd8a8b
--- /dev/null
+++ b/res/drawable-hdpi/product_logo_contacts_color_192.png
Binary files differ
diff --git a/res/drawable-mdpi/googlelogo_dark20_color_132x44.png b/res/drawable-mdpi/googlelogo_dark20_color_132x44.png
new file mode 100644
index 0000000..a045dab
--- /dev/null
+++ b/res/drawable-mdpi/googlelogo_dark20_color_132x44.png
Binary files differ
diff --git a/res/drawable-mdpi/googlelogo_dark20_color_184x60.png b/res/drawable-mdpi/googlelogo_dark20_color_184x60.png
new file mode 100644
index 0000000..d1181a9
--- /dev/null
+++ b/res/drawable-mdpi/googlelogo_dark20_color_184x60.png
Binary files differ
diff --git a/res/drawable-mdpi/product_logo_contacts_color_144.png b/res/drawable-mdpi/product_logo_contacts_color_144.png
new file mode 100644
index 0000000..e28097c
--- /dev/null
+++ b/res/drawable-mdpi/product_logo_contacts_color_144.png
Binary files differ
diff --git a/res/drawable-mdpi/product_logo_contacts_color_192.png b/res/drawable-mdpi/product_logo_contacts_color_192.png
new file mode 100644
index 0000000..a8fcbf0
--- /dev/null
+++ b/res/drawable-mdpi/product_logo_contacts_color_192.png
Binary files differ
diff --git a/res/drawable-sw600dp/quantum_launchscreen_contacts.xml b/res/drawable-sw600dp/quantum_launchscreen_contacts.xml
new file mode 100755
index 0000000..5cc35d5
--- /dev/null
+++ b/res/drawable-sw600dp/quantum_launchscreen_contacts.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2017 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.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
+    android:opacity="opaque">
+    <item android:drawable="@android:color/white" />
+    <item
+        android:id="@+id/launchscreens_product_logo"
+        android:bottom="@dimen/launchscreens_product_logo_bottom">
+        <bitmap
+            android:gravity="center"
+            android:src="@drawable/product_logo_contacts_color_192" />
+    </item>
+    <item
+        android:id="@+id/launchscreens_logo_text"
+        android:bottom="@dimen/launchscreens_google_logo_bottom">
+        <bitmap
+            android:gravity="center_horizontal|bottom"
+            android:src="@drawable/googlelogo_dark20_color_184x60" />
+    </item>
+</layer-list>
diff --git a/res/drawable-xhdpi/googlelogo_dark20_color_132x44.png b/res/drawable-xhdpi/googlelogo_dark20_color_132x44.png
new file mode 100644
index 0000000..437f083
--- /dev/null
+++ b/res/drawable-xhdpi/googlelogo_dark20_color_132x44.png
Binary files differ
diff --git a/res/drawable-xhdpi/googlelogo_dark20_color_184x60.png b/res/drawable-xhdpi/googlelogo_dark20_color_184x60.png
new file mode 100644
index 0000000..2bd813f
--- /dev/null
+++ b/res/drawable-xhdpi/googlelogo_dark20_color_184x60.png
Binary files differ
diff --git a/res/drawable-xhdpi/product_logo_contacts_color_144.png b/res/drawable-xhdpi/product_logo_contacts_color_144.png
new file mode 100644
index 0000000..ebd8a8b
--- /dev/null
+++ b/res/drawable-xhdpi/product_logo_contacts_color_144.png
Binary files differ
diff --git a/res/drawable-xhdpi/product_logo_contacts_color_192.png b/res/drawable-xhdpi/product_logo_contacts_color_192.png
new file mode 100644
index 0000000..690bbd0
--- /dev/null
+++ b/res/drawable-xhdpi/product_logo_contacts_color_192.png
Binary files differ
diff --git a/res/drawable-xxhdpi/googlelogo_dark20_color_132x44.png b/res/drawable-xxhdpi/googlelogo_dark20_color_132x44.png
new file mode 100644
index 0000000..b22fba6
--- /dev/null
+++ b/res/drawable-xxhdpi/googlelogo_dark20_color_132x44.png
Binary files differ
diff --git a/res/drawable-xxhdpi/googlelogo_dark20_color_184x60.png b/res/drawable-xxhdpi/googlelogo_dark20_color_184x60.png
new file mode 100644
index 0000000..6e4193e
--- /dev/null
+++ b/res/drawable-xxhdpi/googlelogo_dark20_color_184x60.png
Binary files differ
diff --git a/res/drawable-xxhdpi/product_logo_contacts_color_144.png b/res/drawable-xxhdpi/product_logo_contacts_color_144.png
new file mode 100644
index 0000000..8ff6a14
--- /dev/null
+++ b/res/drawable-xxhdpi/product_logo_contacts_color_144.png
Binary files differ
diff --git a/res/drawable-xxhdpi/product_logo_contacts_color_192.png b/res/drawable-xxhdpi/product_logo_contacts_color_192.png
new file mode 100644
index 0000000..c32d9cd
--- /dev/null
+++ b/res/drawable-xxhdpi/product_logo_contacts_color_192.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/googlelogo_dark20_color_132x44.png b/res/drawable-xxxhdpi/googlelogo_dark20_color_132x44.png
new file mode 100644
index 0000000..7372b47
--- /dev/null
+++ b/res/drawable-xxxhdpi/googlelogo_dark20_color_132x44.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/googlelogo_dark20_color_184x60.png b/res/drawable-xxxhdpi/googlelogo_dark20_color_184x60.png
new file mode 100644
index 0000000..60de38b
--- /dev/null
+++ b/res/drawable-xxxhdpi/googlelogo_dark20_color_184x60.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/product_logo_contacts_color_144.png b/res/drawable-xxxhdpi/product_logo_contacts_color_144.png
new file mode 100644
index 0000000..c32d9cd
--- /dev/null
+++ b/res/drawable-xxxhdpi/product_logo_contacts_color_144.png
Binary files differ
diff --git a/res/drawable-xxxhdpi/product_logo_contacts_color_192.png b/res/drawable-xxxhdpi/product_logo_contacts_color_192.png
new file mode 100644
index 0000000..1346cbc
--- /dev/null
+++ b/res/drawable-xxxhdpi/product_logo_contacts_color_192.png
Binary files differ
diff --git a/res/drawable/quantum_launchscreen_contacts.xml b/res/drawable/quantum_launchscreen_contacts.xml
new file mode 100755
index 0000000..1995899
--- /dev/null
+++ b/res/drawable/quantum_launchscreen_contacts.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2017 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.
+-->
+
+<layer-list xmlns:android="http://schemas.android.com/apk/res/android"
+    android:opacity="opaque">
+  <item android:drawable="@android:color/white" />
+  <item
+      android:id="@+id/launchscreens_product_logo"
+      android:bottom="@dimen/launchscreens_product_logo_bottom">
+    <bitmap
+        android:gravity="center"
+        android:src="@drawable/product_logo_contacts_color_144" />
+  </item>
+  <item
+      android:id="@+id/launchscreens_logo_text"
+      android:bottom="@dimen/launchscreens_google_logo_bottom">
+    <bitmap
+        android:gravity="center_horizontal|bottom"
+        android:src="@drawable/googlelogo_dark20_color_132x44" />
+  </item>
+</layer-list>
diff --git a/res/layout/contact_list_card.xml b/res/layout/contact_list_card.xml
index c20dbe7..c2b66a4 100644
--- a/res/layout/contact_list_card.xml
+++ b/res/layout/contact_list_card.xml
@@ -24,4 +24,4 @@
             android:layout_width="match_parent"
             android:layout_height="match_parent"
             android:background="@color/contact_all_list_background_color"/>
-</LinearLayout>
+</LinearLayout>
\ No newline at end of file
diff --git a/res/values-land/dimens.xml b/res/values-land/dimens.xml
index 64b87e9..067f88c 100644
--- a/res/values-land/dimens.xml
+++ b/res/values-land/dimens.xml
@@ -14,6 +14,10 @@
      limitations under the License.
 -->
 <resources>
+    <!-- Copied from java/com/google/android/assets/launchscreens/res/values-land/dimens.xml -->
+    <!-- Adjusted higher to deal with the smaller total height we have to deal with on phones -->
+    <dimen name="launchscreens_product_logo_bottom">48dp</dimen>
+
     <dimen name="editor_type_label_width">120dip</dimen>
 
     <!-- Top padding for the image for empty group view-->
diff --git a/res/values-sw600dp-land/dimens.xml b/res/values-sw600dp-land/dimens.xml
index f978596..7d9eb33 100644
--- a/res/values-sw600dp-land/dimens.xml
+++ b/res/values-sw600dp-land/dimens.xml
@@ -14,6 +14,11 @@
      limitations under the License.
 -->
 <resources>
+    <!-- Copied from java/com/google/android/assets/launchscreens/res/values-sw600dp-land-v21/dimens.xml -->
+    <!-- Values adjusted for nav bar size due to windowDrawsSystemBarBackgrounds -->
+    <dimen name="launchscreens_product_logo_bottom">72dp</dimen>
+    <dimen name="launchscreens_google_logo_bottom">96dp</dimen>
+
     <!-- Height for the image for empty group view-->
     <dimen name="empty_view_image_height">180dp</dimen>
 
diff --git a/res/values-sw600dp/dimens.xml b/res/values-sw600dp/dimens.xml
index 7753d7d..a38364c 100644
--- a/res/values-sw600dp/dimens.xml
+++ b/res/values-sw600dp/dimens.xml
@@ -14,6 +14,11 @@
      limitations under the License.
 -->
 <resources>
+    <!-- Copied from java/com/google/android/assets/launchscreens/res/values-sw600dp-port-v21/dimens.xml -->
+    <!-- Values adjusted for nav bar size due to windowDrawsSystemBarBackgrounds -->
+    <dimen name="launchscreens_product_logo_bottom">72dp</dimen>
+    <dimen name="launchscreens_google_logo_bottom">96dp</dimen>
+
     <dimen name="editor_type_label_width">122dip</dimen>
     <dimen name="shortcut_icon_size">64dip</dimen>
     <dimen name="contact_browser_list_item_text_size">18sp</dimen>
diff --git a/res/values/dimens.xml b/res/values/dimens.xml
index a117ca3..e9fe2ad 100644
--- a/res/values/dimens.xml
+++ b/res/values/dimens.xml
@@ -14,6 +14,11 @@
      limitations under the License.
 -->
 <resources>
+    <!-- Copied from java/com/google/android/assets/launchscreens/res/values-port-v21/dimens.xml -->
+    <!-- Values adjusted for nav bar size due to windowDrawsSystemBarBackgrounds -->
+    <dimen name="launchscreens_product_logo_bottom">64dp</dimen>
+    <dimen name="launchscreens_google_logo_bottom">104dp</dimen>
+
     <!-- Initial height of transparent space above QuickContacts -->
     <dimen name="quickcontact_starting_empty_height">150dp</dimen>
     <!-- Initial size of QuickContact's title size -->
diff --git a/res/values/styles.xml b/res/values/styles.xml
index 50971b0..4c78136 100644
--- a/res/values/styles.xml
+++ b/res/values/styles.xml
@@ -89,6 +89,13 @@
         <item name="android:popupMenuStyle">@style/PopupMenuStyle</item>
     </style>
 
+    <style name="LaunchScreenTheme" parent="Theme.AppCompat.Light.DarkActionBar">
+        <item name="android:windowBackground">@drawable/quantum_launchscreen_contacts</item>
+        <!-- Ensure the status bar color matches the background (grey 500) -->
+        <!-- TODO(yaolu): Switch to use quantum_grey if in Google3 -->
+        <item name="android:colorPrimaryDark">#9e9e9e</item>
+    </style>
+
     <style name="PeopleActivityTheme" parent="@style/PeopleThemeAppCompat">
         <item name="windowActionBar">false</item>
         <item name="windowNoTitle">true</item>
@@ -585,5 +592,4 @@
         <item name="android:paddingStart">@dimen/drawer_side_padding</item>
         <item name="android:paddingEnd">@dimen/drawer_label_header_end_padding</item>
     </style>
-
 </resources>
diff --git a/src/com/android/contacts/activities/PeopleActivity.java b/src/com/android/contacts/activities/PeopleActivity.java
index e5ae3a3..00b2810 100644
--- a/src/com/android/contacts/activities/PeopleActivity.java
+++ b/src/com/android/contacts/activities/PeopleActivity.java
@@ -345,7 +345,11 @@
         if (Log.isLoggable(Constants.PERFORMANCE_TAG, Log.DEBUG)) {
             Log.d(Constants.PERFORMANCE_TAG, "PeopleActivity.onCreate start");
         }
+
+        // Make sure this is *before* calling super.onCreate
+        setTheme(R.style.PeopleActivityTheme);
         super.onCreate(savedState);
+
         mAccountTypeManager = AccountTypeManager.getInstance(this);
         mContactListFilterController = ContactListFilterController.getInstance(this);