Merge "Cache CarPropertyConfigs in CarPropertyService" into pi-dev
am: 50191247de

Change-Id: I9391fbba21b99188e14a6962c83bb4fe60c079b2
diff --git a/car-lib/Android.bp b/car-lib/Android.bp
index 5c719e9..806121f 100644
--- a/car-lib/Android.bp
+++ b/car-lib/Android.bp
@@ -47,3 +47,26 @@
     ],
 }
 
+java_library {
+    name: "android.car",
+    srcs: [
+        "src/**/*.java",
+        "src_feature_future/**/*.java",
+        "src/**/I*.aidl",
+    ],
+    aidl: {
+        include_dirs: [
+            "system/bt/binder",
+        ],
+    },
+    exclude_srcs: [
+        "src/android/car/storagemonitoring/IoStats.aidl",
+        "src/android/car/storagemonitoring/IoStatsEntry.aidl",
+    ],
+    product_variables: {
+        pdk: {
+            enabled: false,
+        },
+    },
+    installable: true,
+}
diff --git a/car-lib/Android.mk b/car-lib/Android.mk
index 3cb7d82..e0fa482 100644
--- a/car-lib/Android.mk
+++ b/car-lib/Android.mk
@@ -21,21 +21,8 @@
 
 include $(CLEAR_VARS)
 
-LOCAL_MODULE := android.car
-LOCAL_MODULE_TAGS := optional
-
-ifneq ($(TARGET_USES_CAR_FUTURE_FEATURES),true)
-#TODO need a tool to generate proguard rule to drop all items under @FutureFeature
-#LOCAL_PROGUARD_ENABLED := custom
-#LOCAL_PROGUARD_FLAG_FILES := proguard_drop_future.flags
-endif
-
 car_lib_sources := $(call all-java-files-under, src)
-ifeq ($(TARGET_USES_CAR_FUTURE_FEATURES),true)
 car_lib_sources += $(call all-java-files-under, src_feature_future)
-else
-car_lib_sources += $(call all-java-files-under, src_feature_current)
-endif
 
 car_lib_sources += $(call all-Iaidl-files-under, src)
 
@@ -47,24 +34,15 @@
 car_lib_sources := $(filter-out src/android/car/storagemonitoring/IoStats.aidl,$(car_lib_sources))
 car_lib_sources := $(filter-out src/android/car/storagemonitoring/IoStatsEntry.aidl,$(car_lib_sources))
 
-LOCAL_AIDL_INCLUDES += system/bt/binder
-
-LOCAL_SRC_FILES := $(car_lib_sources)
-
-ifeq ($(EMMA_INSTRUMENT_FRAMEWORK),true)
-LOCAL_EMMA_INSTRUMENT := true
-endif
-
-include $(BUILD_JAVA_LIBRARY)
-
 ifeq ($(BOARD_IS_AUTOMOTIVE), true)
-$(call dist-for-goals,dist_files,$(full_classes_jar):$(LOCAL_MODULE).jar)
+full_classes_jar := $(call intermediates-dir-for,JAVA_LIBRARIES,android.car,,COMMON)/classes.jar
+$(call dist-for-goals,dist_files,$(full_classes_jar):android.car.jar)
 endif
 
 # API Check
 # ---------------------------------------------
-car_module := $(LOCAL_MODULE)
-car_module_src_files := $(LOCAL_SRC_FILES)
+car_module := android.car
+car_module_src_files := $(car_lib_sources)
 car_module_api_dir := $(LOCAL_PATH)/api
 car_module_java_libraries := framework
 car_module_include_systemapi := true
diff --git a/car-lib/src_feature_current/com/android/car/internal/FeatureConfiguration.java b/car-lib/src_feature_current/com/android/car/internal/FeatureConfiguration.java
deleted file mode 100644
index 462f320..0000000
--- a/car-lib/src_feature_current/com/android/car/internal/FeatureConfiguration.java
+++ /dev/null
@@ -1,28 +0,0 @@
-/*
- * 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.
- */
-package com.android.car.internal;
-
-/**
- * Class to hold static boolean flag for enabling / disabling features.
- *
- * @hide
- */
-public class FeatureConfiguration {
-    /** Disable future feature by default. */
-    public static final boolean DEFAULT = false;
-    /** product configuration in CarInfoManager */
-    public static final boolean ENABLE_PRODUCT_CONFIGURATION_INFO = DEFAULT;
-}
diff --git a/car_product/build/car_base.mk b/car_product/build/car_base.mk
index 9138090..6788a49 100644
--- a/car_product/build/car_base.mk
+++ b/car_product/build/car_base.mk
@@ -20,8 +20,6 @@
 PRODUCT_PACKAGE_OVERLAYS += packages/services/Car/car_product/overlay
 
 PRODUCT_PACKAGES += \
-    ContactsProvider \
-    DefaultContainerService \
     Home \
     BasicDreams \
     CaptivePortalLogin \
@@ -46,39 +44,13 @@
     ExternalStorageProvider \
     atrace \
     libandroidfw \
-    libaudiopreprocessing \
     libaudioutils \
-    libfilterpack_imageproc \
-    libgabi++ \
     libmdnssd \
     libnfc_ndef \
     libpowermanager \
     libspeexresampler \
-    libstagefright_soft_aacdec \
-    libstagefright_soft_aacenc \
-    libstagefright_soft_amrdec \
-    libstagefright_soft_amrnbenc \
-    libstagefright_soft_amrwbenc \
-    libstagefright_soft_avcdec \
-    libstagefright_soft_avcenc \
-    libstagefright_soft_flacdec \
-    libstagefright_soft_flacenc \
-    libstagefright_soft_g711dec \
-    libstagefright_soft_gsmdec \
-    libstagefright_soft_hevcdec \
-    libstagefright_soft_mp3dec \
-    libstagefright_soft_mpeg2dec \
-    libstagefright_soft_mpeg4dec \
-    libstagefright_soft_mpeg4enc \
-    libstagefright_soft_opusdec \
-    libstagefright_soft_rawdec \
-    libstagefright_soft_vorbisdec \
-    libstagefright_soft_vpxdec \
-    libstagefright_soft_vpxenc \
     libvariablespeed \
     libwebrtc_audio_preprocessing \
-    mdnsd \
-    requestsync \
     wifi-service \
     A2dpSinkService \
 
diff --git a/evs/app/RenderDirectView.cpp b/evs/app/RenderDirectView.cpp
index f0d26e4..d7267cf 100644
--- a/evs/app/RenderDirectView.cpp
+++ b/evs/app/RenderDirectView.cpp
@@ -138,6 +138,6 @@
 
     // Wait for the rendering to finish
     glFinish();
-
+    detachRenderTarget();
     return true;
 }
diff --git a/evs/app/RenderTopView.cpp b/evs/app/RenderTopView.cpp
index 80ccb11..f09e76f 100644
--- a/evs/app/RenderTopView.cpp
+++ b/evs/app/RenderTopView.cpp
@@ -217,7 +217,7 @@
 
     // Wait for the rendering to finish
     glFinish();
-
+    detachRenderTarget();
     return true;
 }
 
diff --git a/evs/manager/HalCamera.cpp b/evs/manager/HalCamera.cpp
index 41cff24..ba2e9c6 100644
--- a/evs/manager/HalCamera.cpp
+++ b/evs/manager/HalCamera.cpp
@@ -130,6 +130,7 @@
     Return<EvsResult> result = EvsResult::OK;
 
     if (mStreamState == STOPPED) {
+        mStreamState = RUNNING;
         result = mHwCamera->startVideoStream(this);
     }
 
@@ -149,6 +150,7 @@
 
     // If not, then stop the hardware stream
     if (!stillRunning) {
+        mStreamState = STOPPED;
         mHwCamera->stopVideoStream();
     }
 }
diff --git a/service/Android.mk b/service/Android.mk
index d9ae9ec..9ab7df3 100644
--- a/service/Android.mk
+++ b/service/Android.mk
@@ -76,6 +76,8 @@
         car-systemtest \
         com.android.car.procfsinspector-client \
 
+LOCAL_MIN_SDK_VERSION := 25
+
 include frameworks/base/packages/SettingsLib/common.mk
 
 include $(BUILD_STATIC_JAVA_LIBRARY)
diff --git a/service/AndroidManifest.xml b/service/AndroidManifest.xml
index 870ed10..24c9cd7 100644
--- a/service/AndroidManifest.xml
+++ b/service/AndroidManifest.xml
@@ -231,7 +231,7 @@
     <uses-permission android:name="android.permission.LOCATION_HARDWARE" />
     <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
 
-    <application android:label="Car service"
+    <application android:label="@string/app_title"
                  android:directBootAware="true"
                  android:allowBackup="false"
                  android:persistent="true">
diff --git a/service/res/values/strings.xml b/service/res/values/strings.xml
index 9423e85..1947e43 100644
--- a/service/res/values/strings.xml
+++ b/service/res/values/strings.xml
@@ -14,6 +14,8 @@
      limitations under the License.
 -->
 <resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="app_title">Car service</string>
+
     <!--  For permissions -->
     <!-- Permission text: can access your car's information [CHAR LIMIT=NONE] -->
     <string name="car_permission_label">Car information</string>