Snap for 5925869 from 0daa29786ea849635f098b2b08fa346cbd6be332 to sdk-release

Change-Id: Iae4dcd349a91bdbcb9b48a845e837c3d2eb45dc4
diff --git a/overlay/frameworks/base/core/res/res/values-as/strings.xml b/overlay/frameworks/base/core/res/res/values-as/strings.xml
new file mode 100644
index 0000000..cdb6d20
--- /dev/null
+++ b/overlay/frameworks/base/core/res/res/values-as/strings.xml
@@ -0,0 +1,20 @@
+<?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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="accessibility_shortcut_toogle_warning" msgid="7758891516165017413">"শ্বৰ্টকাট অন হৈ থকাৰ সময়ত দুয়োটা ভলিউম বুটামত ৩ ছেকেণ্ডৰ বাবে টিপি থাকিলে সাধ্য সুবিধা এটা আৰম্ভ হ\'ব।\n\n এতিয়া ব্য়ৱহাৰ কৰি থকা সাধ্য সুবিধাবোৰ হৈছে:\n <xliff:g id="SERVICE_NAME">%1$s</xliff:g>\n\n আপুনি এই সুবিধাটো ছেটিংসমূহত &gt;; সাধ্য সুবিধাসমূহত সলনি কৰিব পাৰে।"</string>
+</resources>
diff --git a/overlay/frameworks/base/core/res/res/values-hy/strings.xml b/overlay/frameworks/base/core/res/res/values-hy/strings.xml
index 22e6fcd..350e4d1 100644
--- a/overlay/frameworks/base/core/res/res/values-hy/strings.xml
+++ b/overlay/frameworks/base/core/res/res/values-hy/strings.xml
@@ -16,5 +16,5 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="accessibility_shortcut_toogle_warning" msgid="7758891516165017413">"Եթե դյուրանցումը միացված է, ապա հետ և ներքև կոճակները միասին 3 վայրկյան սեղմած պահելու դեպքում կգործարկվի մատչելիության գործառույթը:\n\n Մատչելիության ակտիվ գործառույթը՝\n <xliff:g id="SERVICE_NAME">%1$s</xliff:g>\n\n Այն փոփոխելու համար անցեք Կարգավորումներ &gt; Մատչելիություն:"</string>
+    <string name="accessibility_shortcut_toogle_warning" msgid="7758891516165017413">"Եթե դյուրանցումը միացված է, ապա հետ և ներքև կոճակները միասին 3 վայրկյան սեղմած պահելու դեպքում կգործարկվի մատչելիության գործառույթը:\n\n Մատչելիության ակտիվ գործառույթը՝\n <xliff:g id="SERVICE_NAME">%1$s</xliff:g>\n\n Այն փոփոխելու համար անցեք Կարգավորումներ &gt; Հատուկ գործառույթներ:"</string>
 </resources>
diff --git a/overlay/frameworks/base/core/res/res/values-or/strings.xml b/overlay/frameworks/base/core/res/res/values-or/strings.xml
new file mode 100644
index 0000000..d5a98b9
--- /dev/null
+++ b/overlay/frameworks/base/core/res/res/values-or/strings.xml
@@ -0,0 +1,20 @@
+<?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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+    <string name="accessibility_shortcut_toogle_warning" msgid="7758891516165017413">"ସର୍ଟକଟ୍‌ ଅନ୍‌ ଥିବା ବେଳେ, ଉଭୟ ବ୍ୟାକ୍‍ ଓ ଡାଉନ୍‍ ବଟନ୍‍ 3 ସେକେଣ୍ଡ ପାଇଁ ଦବାଇବା ଦ୍ୱାରା ଦିବ୍ୟାଙ୍ଗମାନଙ୍କ ପାଇଁ ବୈଶିଷ୍ଟ ଆରମ୍ଭ ହେବ।\n\n ସମ୍ପ୍ରତି ଦିବ୍ୟାଙ୍ଗମାନଙ୍କ ପାଇଁ ସୁବିଧା:\n <xliff:g id="SERVICE_NAME">%1$s</xliff:g>\n\n ଆପଣ ସେଟିଂସ ଏବଂ ଆକ୍ସେସବିଲିଟିରେ ସୁବିଧା ବଦଳାଇ ପାରିବେ।"</string>
+</resources>
diff --git a/overlay/frameworks/base/core/res/res/values-vi/strings.xml b/overlay/frameworks/base/core/res/res/values-vi/strings.xml
index b5e29d3..b01cfbc 100644
--- a/overlay/frameworks/base/core/res/res/values-vi/strings.xml
+++ b/overlay/frameworks/base/core/res/res/values-vi/strings.xml
@@ -16,5 +16,5 @@
 
 <resources xmlns:android="http://schemas.android.com/apk/res/android"
     xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
-    <string name="accessibility_shortcut_toogle_warning" msgid="7758891516165017413">"Khi đã bật phím tắt, nhấn vào cả hai nút quay lại và xuống trong 3 giây sẽ bắt đầu một tính năng trợ năng.\n\n Tính năng trợ năng hiện tại:\n <xliff:g id="SERVICE_NAME">%1$s</xliff:g>\n\n Bạn có thể thay đổi tính năng trong Cài đặt &gt; Trợ năng."</string>
+    <string name="accessibility_shortcut_toogle_warning" msgid="7758891516165017413">"Khi đã bật phím tắt, nhấn vào cả hai nút quay lại và xuống trong 3 giây sẽ bắt đầu một tính năng hỗ trợ tiếp cận.\n\n Tính năng hỗ trợ tiếp cận hiện tại:\n <xliff:g id="SERVICE_NAME">%1$s</xliff:g>\n\n Bạn có thể thay đổi tính năng này trong Cài đặt &gt; Hỗ trợ tiếp cận."</string>
 </resources>
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml
index b73fa4a..1786bc8 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -15,9 +15,6 @@
 -->
 
 <resources>
-    <!-- Known ATV devices do not support rotation, force no rotation by default. -->
-    <bool name="config_forceDefaultOrientation">true</bool>
-
     <!-- Flag indicating that the media framework should support playing of sounds on volume
          key usage.  This adds noticeable additional overhead to volume key processing, so
          is disableable for products for which it is irrelevant. -->
@@ -106,4 +103,8 @@
     <string-array translatable="false" name="config_allowedManagedServicesOnLowRamDevices">
         <item>com.google.android.tvrecommendations</item>
     </string-array>
+
+    <!-- Enable doze mode -->
+    <bool name="config_enableAutoPowerModes">true</bool>
+    <bool name="config_autoPowerModeUseMotionSensor">false</bool>
 </resources>
diff --git a/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml b/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
index 7dd68c6..be6b533 100644
--- a/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
+++ b/overlay/frameworks/base/packages/SettingsProvider/res/values/defaults.xml
@@ -28,4 +28,15 @@
     <!-- Do not give up on DHCP -->
     <integer name="def_max_dhcp_retries">0</integer>
 
+    <!-- disable network monitoring support
+         NOTE: we may need to reenable this in a future release
+         to support new developer oriented monitoring tools -->
+    <bool name="def_netstats_enabled">false</bool>
+
+    <!-- ms until the system goes to sleep, 3 hours default for TV devices -->
+    <integer name="def_sleep_timeout">10800000</integer>
+
+    <!-- Default screen timeout set when setting screensaver. Currently (15 * 60 * 1000) = 15 min -->
+    <integer name="def_screen_off_timeout">900000</integer>
+
 </resources>
diff --git a/overlay/frameworks/base/packages/SystemUI/res/layout/volume_dialog.xml b/overlay/frameworks/base/packages/SystemUI/res/layout/volume_dialog.xml
new file mode 100644
index 0000000..eb110b1
--- /dev/null
+++ b/overlay/frameworks/base/packages/SystemUI/res/layout/volume_dialog.xml
@@ -0,0 +1,104 @@
+<!--
+     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.
+-->
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:layout_width="wrap_content"
+    android:layout_height="wrap_content"
+    android:background="@android:color/transparent"
+    android:theme="@style/qs_theme">
+    <LinearLayout
+        android:id="@+id/volume_dialog"
+        android:minWidth="@dimen/volume_dialog_row_width"
+        android:layout_height="wrap_content"
+        android:layout_width="wrap_content"
+        android:layout_gravity="center_horizontal|bottom"
+        android:background="@android:color/transparent"
+        android:paddingLeft="@dimen/volume_dialog_panel_transparent_padding"
+        android:paddingRight="@dimen/volume_dialog_panel_transparent_padding"
+        android:orientation="horizontal"
+        android:clipToPadding="false" >
+
+        <FrameLayout
+            android:id="@+id/ringer"
+            android:layout_width="@dimen/volume_dialog_ringer_size"
+            android:layout_height="@dimen/volume_dialog_ringer_size"
+            android:layout_marginBottom="@dimen/volume_dialog_spacer"
+            android:translationZ="@dimen/volume_dialog_elevation"
+            android:layout_gravity="right"
+            android:clipToPadding="false"
+            android:visibility="gone"
+            android:background="@drawable/rounded_bg_full">
+            <com.android.keyguard.AlphaOptimizedImageButton
+                android:id="@+id/ringer_icon"
+                style="@style/VolumeButtons"
+                android:background="@drawable/rounded_ripple"
+                android:layout_width="match_parent"
+                android:layout_height="match_parent"
+                android:tint="@color/accent_tint_color_selector"
+                android:layout_gravity="center"
+                android:visibility="gone"
+                android:soundEffectsEnabled="false" />
+
+            <include layout="@layout/volume_dnd_icon"
+                     android:layout_width="match_parent"
+                     android:layout_height="wrap_content"
+                     android:layout_marginRight="@dimen/volume_dialog_stream_padding"
+                     android:visibility="gone"
+                     android:layout_marginTop="6dp"/>
+        </FrameLayout>
+
+        <LinearLayout
+            android:id="@+id/main"
+            android:layout_height="wrap_content"
+            android:minWidth="@dimen/volume_dialog_row_width"
+            android:layout_width="wrap_content"
+            android:orientation="horizontal"
+            android:translationZ="@dimen/volume_dialog_elevation"
+            android:clipToPadding="false"
+            android:alpha="0.5"
+            android:background="@drawable/rounded_bg_full" >
+            <LinearLayout
+                android:id="@+id/volume_dialog_rows"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:gravity="center"
+                android:orientation="vertical"
+                android:paddingRight="@dimen/volume_dialog_stream_padding"
+                android:paddingLeft="@dimen/volume_dialog_stream_padding">
+                    <!-- volume rows added and removed here! :-) -->
+            </LinearLayout>
+            <FrameLayout
+                android:id="@+id/settings_container"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:visibility="gone"
+                android:background="@drawable/rounded_bg_bottom_background">
+                <com.android.keyguard.AlphaOptimizedImageButton
+                    android:id="@+id/settings"
+                    android:src="@drawable/ic_settings_16dp"
+                    android:layout_width="@dimen/volume_dialog_tap_target_size"
+                    android:layout_height="@dimen/volume_dialog_tap_target_size"
+                    android:layout_gravity="center"
+                    android:contentDescription="@string/accessibility_volume_settings"
+                    android:background="@drawable/ripple_drawable_20dp"
+                    android:tint="?android:attr/textColorSecondary"
+                    android:soundEffectsEnabled="false"
+                    android:visibility="gone" />
+            </FrameLayout>
+        </LinearLayout>
+
+    </LinearLayout>
+</FrameLayout>
diff --git a/overlay/frameworks/base/packages/SystemUI/res/layout/volume_dialog_row.xml b/overlay/frameworks/base/packages/SystemUI/res/layout/volume_dialog_row.xml
new file mode 100644
index 0000000..08209ab
--- /dev/null
+++ b/overlay/frameworks/base/packages/SystemUI/res/layout/volume_dialog_row.xml
@@ -0,0 +1,69 @@
+<!--
+     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.
+-->
+<FrameLayout
+    xmlns:android="http://schemas.android.com/apk/res/android"
+    android:tag="row"
+    android:layout_width="@dimen/volume_dialog_row_width"
+    android:layout_height="wrap_content"
+    android:background="@android:color/transparent"
+    android:clipChildren="false"
+    android:clipToPadding="false"
+    android:theme="@style/qs_theme">
+
+    <LinearLayout
+        android:layout_width="wrap_content"
+        android:layout_height="match_parent"
+        android:background="@android:color/transparent"
+        android:gravity="center"
+        android:layout_gravity="center"
+        android:orientation="horizontal" >
+        <com.android.keyguard.AlphaOptimizedImageButton
+            android:id="@+id/volume_row_icon"
+            style="@style/VolumeButtons"
+            android:layout_width="@dimen/volume_dialog_tap_target_size"
+            android:layout_height="@dimen/volume_dialog_tap_target_size"
+            android:background="@drawable/ripple_drawable_20dp"
+            android:tint="@color/accent_tint_color_selector"
+            android:soundEffectsEnabled="false" />
+        <TextView
+            android:id="@+id/volume_row_header"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:ellipsize="end"
+            android:maxLength="10"
+            android:maxLines="1"
+            android:visibility="gone"
+            android:textColor="?android:attr/colorControlNormal"
+            android:textAppearance="@style/TextAppearance.Volume.Header" />
+        <FrameLayout
+            android:id="@+id/volume_row_slider_frame"
+            android:layout_height="match_parent"
+            android:layoutDirection="ltr"
+            android:layout_width="@dimen/volume_dialog_row_width">
+            <SeekBar
+                android:id="@+id/volume_row_slider"
+                android:clickable="false"
+                android:layout_width="@dimen/volume_dialog_row_width"
+                android:layout_height="match_parent"
+                android:layoutDirection="ltr"
+                android:layout_gravity="center"
+                android:rotation="0" />
+        </FrameLayout>
+    </LinearLayout>
+
+    <include layout="@layout/volume_dnd_icon"/>
+
+</FrameLayout>
diff --git a/overlay/frameworks/base/packages/SystemUI/res/values-as/config.xml b/overlay/frameworks/base/packages/SystemUI/res/values-as/config.xml
new file mode 100644
index 0000000..9c7cfc9
--- /dev/null
+++ b/overlay/frameworks/base/packages/SystemUI/res/values-as/config.xml
@@ -0,0 +1,23 @@
+<?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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+  <string-array name="recents_tv_blacklist_array">
+    <item msgid="9050240242608018713">"com.google.android.tv.remote.service"</item>
+    <item msgid="8901636675968723687">"com.google.android.apps.mediashell"</item>
+  </string-array>
+</resources>
diff --git a/overlay/frameworks/base/packages/SystemUI/res/values-or/config.xml b/overlay/frameworks/base/packages/SystemUI/res/values-or/config.xml
new file mode 100644
index 0000000..9c7cfc9
--- /dev/null
+++ b/overlay/frameworks/base/packages/SystemUI/res/values-or/config.xml
@@ -0,0 +1,23 @@
+<?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.
+ -->
+
+<resources xmlns:android="http://schemas.android.com/apk/res/android"
+    xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+  <string-array name="recents_tv_blacklist_array">
+    <item msgid="9050240242608018713">"com.google.android.tv.remote.service"</item>
+    <item msgid="8901636675968723687">"com.google.android.apps.mediashell"</item>
+  </string-array>
+</resources>
diff --git a/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml b/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml
new file mode 100644
index 0000000..499341c
--- /dev/null
+++ b/overlay/frameworks/base/packages/SystemUI/res/values/dimens.xml
@@ -0,0 +1,21 @@
+<?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.
+-->
+
+<resources>
+  <!-- Width of volume bar -->
+  <dimen name="volume_dialog_row_width">252dp</dimen>
+  <dimen name="volume_dialog_tap_target_size">36dp</dimen>
+</resources>
diff --git a/permissions/privapp-permissions-atv-gsi.xml b/permissions/privapp-permissions-atv-gsi.xml
new file mode 100644
index 0000000..92550a9
--- /dev/null
+++ b/permissions/privapp-permissions-atv-gsi.xml
@@ -0,0 +1,41 @@
+<?xml version="1.0" encoding="utf-8"?>
+<permissions>
+    <privapp-permissions package="com.android.connectivity.metrics">
+        <permission name="android.permission.DUMP"/>
+        <permission name="android.permission.MODIFY_PHONE_STATE"/>
+        <permission name="android.permission.PACKAGE_USAGE_STATS"/>
+    </privapp-permissions>
+
+    <privapp-permissions package="com.android.tv.provision">
+        <permission name="android.permission.MANAGE_USERS"/>
+        <permission name="android.permission.WRITE_SECURE_SETTINGS"/>
+    </privapp-permissions>
+
+    <privapp-permissions package="com.android.tv.settings">
+        <permission name="android.permission.BACKUP"/>
+        <permission name="android.permission.DELETE_CACHE_FILES"/>
+        <permission name="android.permission.DUMP"/>
+        <permission name="android.permission.FORCE_STOP_PACKAGES"/>
+        <permission name="android.permission.GET_ACCOUNTS_PRIVILEGED"/>
+        <permission name="android.permission.MANAGE_USERS"/>
+        <permission name="android.permission.OVERRIDE_WIFI_CONFIG"/>
+        <permission name="android.permission.REBOOT"/>
+        <permission name="android.permission.SET_TIME"/>
+        <permission name="android.permission.SET_TIME_ZONE"/>
+        <permission name="android.permission.USE_RESERVED_DISK"/>
+        <permission name="android.permission.WRITE_MEDIA_STORAGE"/>
+        <permission name="android.permission.WRITE_SECURE_SETTINGS"/>
+    </privapp-permissions>
+
+    <privapp-permissions package="com.google.android.tv">
+        <permission name="android.permission.CHANGE_HDMI_CEC_ACTIVE_SOURCE"/>
+        <permission name="android.permission.DVB_DEVICE"/>
+        <permission name="android.permission.HDMI_CEC"/>
+        <permission name="android.permission.MODIFY_PARENTAL_CONTROLS"/>
+        <permission name="android.permission.READ_CONTENT_RATING_SYSTEMS"/>
+    </privapp-permissions>
+
+    <privapp-permissions package="com.example.sampleleanbacklauncher">
+        <permission name="android.permission.ACCESS_NOTIFICATIONS"/>
+    </privapp-permissions>
+</permissions>
diff --git a/permissions/tv_core_hardware.xml b/permissions/tv_core_hardware.xml
index d9d4eb1..3f01e14 100644
--- a/permissions/tv_core_hardware.xml
+++ b/permissions/tv_core_hardware.xml
@@ -32,7 +32,7 @@
     <feature name="android.software.live_tv" />
     <feature name="android.software.picture_in_picture" notLowRam="true" />
     <feature name="android.software.activities_on_secondary_displays" notLowRam="true" />
-    <feature name="android.software.voice_recognizers" />
+    <feature name="android.software.voice_recognizers" notLowRam="true" />
     <feature name="android.software.input_methods" />
     <feature name="android.software.autofill" />
 
diff --git a/products/AndroidProducts.mk b/products/AndroidProducts.mk
index 8c1ed22..2f13dac 100644
--- a/products/AndroidProducts.mk
+++ b/products/AndroidProducts.mk
@@ -32,5 +32,7 @@
 #
 
 PRODUCT_MAKEFILES := \
+    $(LOCAL_DIR)/aosp_atv_arm.mk \
     $(LOCAL_DIR)/aosp_atv_arm_ab.mk \
+    $(LOCAL_DIR)/aosp_atv_arm64.mk \
     $(LOCAL_DIR)/aosp_atv_arm64_ab.mk
diff --git a/products/aosp_atv_arm.mk b/products/aosp_atv_arm.mk
new file mode 100644
index 0000000..878a0ae
--- /dev/null
+++ b/products/aosp_atv_arm.mk
@@ -0,0 +1,33 @@
+#
+# 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.
+#
+
+# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
+# /vendor/[build|default].prop when build split is on. In order to have sysprops
+# on the generic system image, place them in build/make/target/board/
+# treble_system.prop.
+
+include device/google/atv/products/treble_atv_common_32.mk
+
+AB_OTA_UPDATER := true
+AB_OTA_PARTITIONS := system
+PRODUCT_PACKAGES += \
+    update_engine \
+    update_verifier
+
+PRODUCT_NAME := aosp_atv_arm
+PRODUCT_DEVICE := generic
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := AOSP ATV on ARM32
diff --git a/products/aosp_atv_arm64.mk b/products/aosp_atv_arm64.mk
new file mode 100644
index 0000000..37c3b30
--- /dev/null
+++ b/products/aosp_atv_arm64.mk
@@ -0,0 +1,33 @@
+#
+# 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.
+#
+
+# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
+# /vendor/[build|default].prop when build split is on. In order to have sysprops
+# on the generic system image, place them in build/make/target/board/
+# treble_system.prop.
+
+include device/google/atv/products/treble_atv_common_64.mk
+
+AB_OTA_UPDATER := true
+AB_OTA_PARTITIONS := system
+PRODUCT_PACKAGES += \
+    update_engine \
+    update_verifier
+
+PRODUCT_NAME := aosp_atv_arm64
+PRODUCT_DEVICE := generic_arm64
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := AOSP ATV on ARM64
diff --git a/products/aosp_atv_arm64_ab.mk b/products/aosp_atv_arm64_ab.mk
index 56b0cf1..f76aae8 100644
--- a/products/aosp_atv_arm64_ab.mk
+++ b/products/aosp_atv_arm64_ab.mk
@@ -14,20 +14,11 @@
 # limitations under the License.
 #
 
-# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
-# /vendor/[build|default].prop when build split is on. In order to have sysprops
-# on the generic system image, place them in build/make/target/board/
-# treble_system.prop.
+# This is an alias target of aosp_atv_arm64
 
-include device/google/atv/products/treble_atv_common_64.mk
-
-AB_OTA_UPDATER := true
-AB_OTA_PARTITIONS := system
-PRODUCT_PACKAGES += \
-    update_engine \
-    update_verifier
+include device/google/atv/products/aosp_atv_arm64.mk
 
 PRODUCT_NAME := aosp_atv_arm64_ab
-PRODUCT_DEVICE := generic_arm64_ab
+PRODUCT_DEVICE := generic_arm64
 PRODUCT_BRAND := Android
 PRODUCT_MODEL := AOSP ATV on ARM64
diff --git a/products/aosp_atv_arm_ab.mk b/products/aosp_atv_arm_ab.mk
index d359582..c93a298 100644
--- a/products/aosp_atv_arm_ab.mk
+++ b/products/aosp_atv_arm_ab.mk
@@ -14,20 +14,11 @@
 # limitations under the License.
 #
 
-# PRODUCT_PROPERTY_OVERRIDES cannot be used here because sysprops will be at
-# /vendor/[build|default].prop when build split is on. In order to have sysprops
-# on the generic system image, place them in build/make/target/board/
-# treble_system.prop.
+# This is an alias target of aosp_atv_arm64
 
-include device/google/atv/products/treble_atv_common_32.mk
-
-AB_OTA_UPDATER := true
-AB_OTA_PARTITIONS := system
-PRODUCT_PACKAGES += \
-    update_engine \
-    update_verifier
+include device/google/atv/products/aosp_atv_arm.mk
 
 PRODUCT_NAME := aosp_atv_arm_ab
-PRODUCT_DEVICE := generic_arm_ab
+PRODUCT_DEVICE := generic
 PRODUCT_BRAND := Android
 PRODUCT_MODEL := AOSP ATV on ARM32
diff --git a/products/atv_base.mk b/products/atv_base.mk
index 7909c1b..32d9b48 100644
--- a/products/atv_base.mk
+++ b/products/atv_base.mk
@@ -43,7 +43,6 @@
     CalendarProvider \
     CaptivePortalLogin \
     CertInstaller \
-    DocumentsUIMinimal \
     ExternalStorageProvider \
     FusedLocation \
     InputDevices \
@@ -53,7 +52,8 @@
     ProxyHandler \
     SharedStorageBackup \
     VpnDialogs \
-    com.android.media.tv.remoteprovider
+    com.android.media.tv.remoteprovider \
+    PackageInstaller
 
 # From build/target/product/generic_no_telephony.mk
 PRODUCT_PACKAGES += \
@@ -66,8 +66,20 @@
     local_time.default \
     screenrecord
 
-PRODUCT_PACKAGES += \
-    cameraserver
+# PRODUCT_SUPPORTS_CAMERA: Whether the product supports cameras at all
+# (built-in or external USB camera). When 'false', we drop cameraserver, which
+# saves ~3 MiB of RAM. When 'true', additional settings are required for
+# external webcams to work, see "External USB Cameras" documentation.
+#
+# Defaults to true to mimic legacy behaviour.
+PRODUCT_SUPPORTS_CAMERA ?= true
+ifeq ($(PRODUCT_SUPPORTS_CAMERA),true)
+    PRODUCT_PACKAGES += cameraserver
+else
+    # When cameraserver is not included, we need to configure Camera API to not
+    # connect to it.
+    PRODUCT_PROPERTY_OVERRIDES += config.disable_cameraservice=true
+endif
 
 PRODUCT_COPY_FILES += \
     frameworks/av/media/libeffects/data/audio_effects.conf:system/etc/audio_effects.conf
@@ -76,6 +88,21 @@
 PRODUCT_PROPERTY_OVERRIDES += \
     persist.sys.media.avsync=true
 
+
+# SDK builds needs to build layoutlib-legacy that depends on debug info
+ifneq ($(PRODUCT_IS_ATV_SDK),true)
+    # Strip the local variable table and the local variable type table to reduce
+    # the size of the system image. This has no bearing on stack traces, but will
+    # leave less information available via JDWP.
+    # From //build/make/target/product/go_defaults_common.mk
+    PRODUCT_MINIMIZE_JAVA_DEBUG_INFO := true
+
+    # Do not generate libartd.
+    # From //build/make/target/product/go_defaults_common.mk
+    PRODUCT_ART_TARGET_INCLUDE_DEBUG_BUILD := false
+endif
+
+
 # Do not include the Live Channels app if USE_OEM_TV_APP flag is set.
 # The feature com.google.android.tv.installed is used to tell whether a device
 # has the pre-installed Live Channels app. This is necessary for the Play Store
diff --git a/products/atv_x86.mk b/products/atv_x86.mk
index f6d2ece..1f33a25 100644
--- a/products/atv_x86.mk
+++ b/products/atv_x86.mk
@@ -14,7 +14,7 @@
 # limitations under the License.
 #
 
-PRODUCT_PACKAGES := \
+PRODUCT_HOST_PACKAGES := \
     bios.bin \
     vgabios-cirrus.bin
 
diff --git a/products/treble_atv_common.mk b/products/treble_atv_common.mk
index d0540d4..c7d64ce 100644
--- a/products/treble_atv_common.mk
+++ b/products/treble_atv_common.mk
@@ -62,10 +62,8 @@
 PRODUCT_PACKAGES += \
     netutils-wrapper-1.0
 
-# Support for the devices with no VNDK enforcing
 PRODUCT_COPY_FILES += \
-    build/make/target/product/vndk/init.gsi.rc:system/etc/init/init.gsi.rc \
-    build/make/target/product/vndk/init.noenforce.rc:system/etc/init/gsi/init.noenforce.rc
+    build/make/target/product/gsi/init.gsi.rc:system/etc/init/init.gsi.rc
 
 # Name space configuration file for non-enforcing VNDK
 PRODUCT_PACKAGES += \
@@ -77,5 +75,4 @@
 
 # privapp-permissions whitelisting
 PRODUCT_COPY_FILES += \
-    vendor/google/data/etc/permissions/privapp-permissions-google.xml:system/etc/permissions/privapp-permissions-google.xml \
-    vendor/google/data/etc/permissions/privapp-permissions-atv.xml:system/etc/permissions/privapp-permissions-atv.xml
+    device/google/atv/permissions/privapp-permissions-atv-gsi.xml:system/etc/permissions/privapp-permissions-atv-gsi.xml
diff --git a/sdk/images_armeabi-v7a_source.prop_template b/sdk/images_armeabi-v7a_source.prop_template
index f65eaed..3c6a41e 100644
--- a/sdk/images_armeabi-v7a_source.prop_template
+++ b/sdk/images_armeabi-v7a_source.prop_template
@@ -1,6 +1,6 @@
 Pkg.Desc=Android SDK Platform ${PLATFORM_VERSION}
 Pkg.UserSrc=false
-Pkg.Revision=5
+Pkg.Revision=3
 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
 AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
 SystemImage.Abi=armeabi-v7a
diff --git a/sdk/images_x86_source.prop_template b/sdk/images_x86_source.prop_template
index 636280d..2395179 100644
--- a/sdk/images_x86_source.prop_template
+++ b/sdk/images_x86_source.prop_template
@@ -1,6 +1,7 @@
 Pkg.Desc=Android SDK Platform ${PLATFORM_VERSION}
 Pkg.UserSrc=false
-Pkg.Revision=5
+Pkg.Revision=3
+Pkg.Dependencies=emulator#28.1.6
 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
 AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
 SystemImage.Abi=x86