Merge "Add emulator pipe integration"
diff --git a/car-lib/api/current.txt b/car-lib/api/current.txt
index 4d000ee..3eda0a5 100644
--- a/car-lib/api/current.txt
+++ b/car-lib/api/current.txt
@@ -1,9 +1,11 @@
 package android.car {
 
   public final class Car {
-    method public void connect() throws java.lang.IllegalStateException;
-    method public static android.car.Car createCar(android.content.Context, android.content.ServiceConnection, android.os.Handler);
-    method public static android.car.Car createCar(android.content.Context, android.content.ServiceConnection);
+    method public deprecated void connect() throws java.lang.IllegalStateException;
+    method public static deprecated android.car.Car createCar(android.content.Context, android.content.ServiceConnection, android.os.Handler);
+    method public static deprecated android.car.Car createCar(android.content.Context, android.content.ServiceConnection);
+    method public static android.car.Car createCar(android.content.Context);
+    method public static android.car.Car createCar(android.content.Context, android.os.Handler);
     method public void disconnect();
     method public int getCarConnectionType();
     method public java.lang.Object getCarManager(java.lang.String) throws android.car.CarNotConnectedException;
diff --git a/car-lib/src/android/car/Car.java b/car-lib/src/android/car/Car.java
index e262e91..b4c4509 100644
--- a/car-lib/src/android/car/Car.java
+++ b/car-lib/src/android/car/Car.java
@@ -45,6 +45,7 @@
 import android.os.IBinder;
 import android.os.Looper;
 import android.os.RemoteException;
+import android.os.ServiceManager;
 import android.os.UserHandle;
 import android.util.Log;
 
@@ -537,7 +538,10 @@
      * service's main thread. Note: the service connection listener will be always on the main
      * thread regardless of the handler given.
      * @return Car instance if system is in car environment and returns {@code null} otherwise.
+     *
+     * @deprecated use {@link #createCar(Context, Handler)} instead.
      */
+    @Deprecated
     public static Car createCar(Context context, ServiceConnection serviceConnectionListener,
             @Nullable Handler handler) {
         if (!context.getPackageManager().hasSystemFeature(PackageManager.FEATURE_AUTOMOTIVE)) {
@@ -557,11 +561,44 @@
      * Looper}.
      *
      * @see #createCar(Context, ServiceConnection, Handler)
+     *
+     * @deprecated use {@link #createCar(Context, Handler)} instead.
      */
+    @Deprecated
     public static Car createCar(Context context, ServiceConnection serviceConnectionListener) {
       return createCar(context, serviceConnectionListener, null);
     }
 
+    /**
+     * Creates new {@link Car} object which connected synchronously to Car Service and ready to use.
+     *
+     * @param context application's context
+     *
+     * @return Car object if operation succeeded, otherwise null.
+     */
+    @Nullable
+    public static Car createCar(Context context) {
+        return createCar(context, (Handler) null);
+    }
+
+    /**
+     * Creates new {@link Car} object which connected synchronously to Car Service and ready to use.
+     *
+     * @param context application's context
+     * @param handler the handler on which the manager's callbacks will be executed, or null to
+     * execute on the application's main thread.
+     *
+     * @return Car object if operation succeeded, otherwise null.
+     */
+    @Nullable
+    public static Car createCar(Context context, @Nullable Handler handler) {
+        IBinder service = ServiceManager.getService("car_service");
+        if (service == null) {
+            return null;
+        }
+        return new Car(context, ICar.Stub.asInterface(service), handler);
+    }
+
     private Car(Context context, ServiceConnection serviceConnectionListener,
             @Nullable Handler handler) {
         mContext = context;
@@ -606,7 +643,11 @@
      * Connect to car service. This can be called while it is disconnected.
      * @throws IllegalStateException If connection is still on-going from previous
      *         connect call or it is already connected
+     *
+     * @deprecated this method is not need if this object is created via
+     * {@link #createCar(Context, Handler)}.
      */
+    @Deprecated
     public void connect() throws IllegalStateException {
         synchronized (this) {
             if (mConnectionState != STATE_DISCONNECTED) {
diff --git a/car_product/build/car.mk b/car_product/build/car.mk
index 1e67b47..c2161bc 100644
--- a/car_product/build/car.mk
+++ b/car_product/build/car.mk
@@ -111,8 +111,9 @@
 PRODUCT_SYSTEM_SERVER_JARS += car-frameworks-service
 
 # Boot animation
+# Use the G boot animation zip file for faster boot
 PRODUCT_COPY_FILES += \
-    packages/services/Car/car_product/bootanimations/bootanimation-832.zip:system/media/bootanimation.zip
+    vendor/google/products/sailfish/bootanimation-1080-256col.zip:system/media/bootanimation.zip
 
 PRODUCT_LOCALES := en_US af_ZA am_ET ar_EG bg_BG bn_BD ca_ES cs_CZ da_DK de_DE el_GR en_AU en_GB en_IN es_ES es_US et_EE eu_ES fa_IR fi_FI fr_CA fr_FR gl_ES hi_IN hr_HR hu_HU hy_AM in_ID is_IS it_IT iw_IL ja_JP ka_GE km_KH ko_KR ky_KG lo_LA lt_LT lv_LV km_MH kn_IN mn_MN ml_IN mk_MK mr_IN ms_MY my_MM ne_NP nb_NO nl_NL pl_PL pt_BR pt_PT ro_RO ru_RU si_LK sk_SK sl_SI sr_RS sv_SE sw_TZ ta_IN te_IN th_TH tl_PH tr_TR uk_UA vi_VN zh_CN zh_HK zh_TW zu_ZA en_XA ar_XB
 
diff --git a/car_product/overlay/frameworks/base/core/res/res/values/styles_device_default.xml b/car_product/overlay/frameworks/base/core/res/res/values/styles_device_default.xml
index c0c979c..32783b9 100644
--- a/car_product/overlay/frameworks/base/core/res/res/values/styles_device_default.xml
+++ b/car_product/overlay/frameworks/base/core/res/res/values/styles_device_default.xml
@@ -94,4 +94,8 @@
         <item name="thumb">@drawable/car_seekbar_thumb</item>
     </style>
 
+    <style name="Widget.DeviceDefault.ActionBar.Solid" parent="Widget.Material.ActionBar.Solid">
+        <item name="textSize">@dimen/car_body3_size</item>
+    </style>
+
 </resources>
diff --git a/car_product/overlay/frameworks/base/core/res/res/values/themes_device_defaults.xml b/car_product/overlay/frameworks/base/core/res/res/values/themes_device_defaults.xml
index 228079e..4c2e2eb 100644
--- a/car_product/overlay/frameworks/base/core/res/res/values/themes_device_defaults.xml
+++ b/car_product/overlay/frameworks/base/core/res/res/values/themes_device_defaults.xml
@@ -41,6 +41,7 @@
         <item name="textAppearanceListItem">@style/TextAppearance.DeviceDefault.Large</item>
         <item name="textAppearanceListItemSmall">@style/TextAppearance.DeviceDefault.Large</item>
         <item name="textAppearanceListItemSecondary">@style/TextAppearance.DeviceDefault.Small</item>
+        <item name="actionBarSize">@dimen/car_app_bar_height</item>
     </style>
     <style name="Theme.DeviceDefault.Dialog" parent="Theme.Material.Dialog">
         <item name="textAppearanceLarge">@style/TextAppearance.DeviceDefault.Large</item>