Merge Android Pie into master

Bug: 112104996
Change-Id: I53eab9cd8b5e6203f6d03e4c7471221ce2504fdb
diff --git a/TvProvision/Android.mk b/TvProvision/Android.mk
new file mode 100644
index 0000000..88026b8
--- /dev/null
+++ b/TvProvision/Android.mk
@@ -0,0 +1,15 @@
+LOCAL_PATH:= $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SRC_FILES := $(call all-subdir-java-files)
+
+LOCAL_PACKAGE_NAME := TvProvision
+LOCAL_PRIVATE_PLATFORM_APIS := true
+LOCAL_CERTIFICATE := platform
+LOCAL_PRIVILEGED_MODULE := true
+
+LOCAL_PROGUARD_FLAG_FILES := proguard.flags
+
+include $(BUILD_PACKAGE)
diff --git a/TvProvision/AndroidManifest.xml b/TvProvision/AndroidManifest.xml
new file mode 100644
index 0000000..389939e
--- /dev/null
+++ b/TvProvision/AndroidManifest.xml
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2018 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.
+ -->
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+        package="com.android.tv.provision">
+
+    <original-package android:name="com.android.tv.provision" />
+
+    <!-- For miscellaneous settings -->
+    <uses-permission android:name="android.permission.WRITE_SETTINGS" />
+    <uses-permission android:name="android.permission.WRITE_SECURE_SETTINGS" />
+    <uses-permission android:name="android.permission.MANAGE_USERS" />
+
+    <application>
+        <activity android:name="DefaultActivity"
+                android:excludeFromRecents="true">
+            <intent-filter android:priority="3">
+                <action android:name="android.intent.action.MAIN" />
+                <category android:name="android.intent.category.HOME" />
+                <category android:name="android.intent.category.DEFAULT" />
+                <category android:name="android.intent.category.SETUP_WIZARD" />
+            </intent-filter>
+        </activity>
+    </application>
+</manifest>
+
diff --git a/TvProvision/CleanSpec.mk b/TvProvision/CleanSpec.mk
new file mode 100644
index 0000000..d1b49d8
--- /dev/null
+++ b/TvProvision/CleanSpec.mk
@@ -0,0 +1,49 @@
+# Copyright (C) 2018 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.
+#
+
+# If you don't need to do a full clean build but would like to touch
+# a file or delete some intermediate files, add a clean step to the end
+# of the list.  These steps will only be run once, if they haven't been
+# run before.
+#
+# E.g.:
+#     $(call add-clean-step, touch -c external/sqlite/sqlite3.h)
+#     $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libz_intermediates)
+#
+# Always use "touch -c" and "rm -f" or "rm -rf" to gracefully deal with
+# files that are missing or have been moved.
+#
+# Use $(PRODUCT_OUT) to get to the "out/target/product/blah/" directory.
+# Use $(OUT_DIR) to refer to the "out" directory.
+#
+# If you need to re-do something that's already mentioned, just copy
+# the command and add it to the bottom of the list.  E.g., if a change
+# that you made last week required touching a file and a change you
+# made today requires touching the same file, just copy the old
+# touch step and add it to the end of the list.
+#
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
+
+# For example:
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/APPS/AndroidTests_intermediates)
+#$(call add-clean-step, rm -rf $(OUT_DIR)/target/common/obj/JAVA_LIBRARIES/core_intermediates)
+#$(call add-clean-step, find $(OUT_DIR) -type f -name "IGTalkSession*" -print0 | xargs -0 rm -f)
+#$(call add-clean-step, rm -rf $(PRODUCT_OUT)/data/*)
+
+# ************************************************
+# NEWER CLEAN STEPS MUST BE AT THE END OF THE LIST
+# ************************************************
diff --git a/TvProvision/MODULE_LICENSE_APACHE2 b/TvProvision/MODULE_LICENSE_APACHE2
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/TvProvision/MODULE_LICENSE_APACHE2
diff --git a/TvProvision/proguard.flags b/TvProvision/proguard.flags
new file mode 100644
index 0000000..a934979
--- /dev/null
+++ b/TvProvision/proguard.flags
@@ -0,0 +1 @@
+-keep class * extends android.app.Activity
diff --git a/TvProvision/src/com/android/tv/provision/DefaultActivity.java b/TvProvision/src/com/android/tv/provision/DefaultActivity.java
new file mode 100644
index 0000000..97a7ff9
--- /dev/null
+++ b/TvProvision/src/com/android/tv/provision/DefaultActivity.java
@@ -0,0 +1,61 @@
+/*
+ * Copyright (C) 2018 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.tv.provision;
+
+import android.app.Activity;
+import android.content.ComponentName;
+import android.content.Context;
+import android.content.pm.PackageManager;
+import android.content.pm.UserInfo;
+import android.os.Bundle;
+import android.os.UserHandle;
+import android.os.UserManager;
+import android.provider.Settings;
+
+/**
+ * Application that sets the provisioned bit, like SetupWizard does.
+ */
+public class DefaultActivity extends Activity {
+
+    @Override
+    protected void onCreate(Bundle icicle) {
+        super.onCreate(icicle);
+
+        // Add a persistent setting to allow other apps to know the device has been provisioned.
+        if (!isRestrictedUser()) {
+            Settings.Global.putInt(getContentResolver(), Settings.Global.DEVICE_PROVISIONED, 1);
+        }
+        Settings.Secure.putInt(getContentResolver(), Settings.Secure.USER_SETUP_COMPLETE, 1);
+        Settings.Secure.putInt(getContentResolver(), Settings.Secure.TV_USER_SETUP_COMPLETE, 1);
+
+        // remove this activity from the package manager.
+        PackageManager pm = getPackageManager();
+        ComponentName name = new ComponentName(this, DefaultActivity.class);
+        pm.setComponentEnabledSetting(name, PackageManager.COMPONENT_ENABLED_STATE_DISABLED,
+                PackageManager.DONT_KILL_APP);
+
+        // terminate the activity.
+        finish();
+    }
+
+    private boolean isRestrictedUser() {
+        UserManager userManager = (UserManager) getSystemService(Context.USER_SERVICE);
+        UserInfo userInfo = userManager.getUserInfo(UserHandle.myUserId());
+        return userInfo.isRestricted();
+    }
+}
+
diff --git a/TvSampleLeanbackLauncher/Android.mk b/TvSampleLeanbackLauncher/Android.mk
new file mode 100644
index 0000000..99c70a4
--- /dev/null
+++ b/TvSampleLeanbackLauncher/Android.mk
@@ -0,0 +1,14 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+
+LOCAL_MODULE := TvSampleLeanbackLauncher
+LOCAL_SRC_FILES := $(LOCAL_MODULE).apk
+LOCAL_CERTIFICATE := PRESIGNED
+LOCAL_PRIVILEGED_MODULE := true
+LOCAL_MODULE_CLASS := APPS
+LOCAL_MODULE_TAGS := optional
+LOCAL_MODULE_SUFFIX := $(COMMON_ANDROID_PACKAGE_SUFFIX)
+LOCAL_DEX_PREOPT := false
+
+include $(BUILD_PREBUILT)
diff --git a/TvSampleLeanbackLauncher/TvSampleLeanbackLauncher.apk b/TvSampleLeanbackLauncher/TvSampleLeanbackLauncher.apk
new file mode 100644
index 0000000..314e26a
--- /dev/null
+++ b/TvSampleLeanbackLauncher/TvSampleLeanbackLauncher.apk
Binary files differ
diff --git a/init.goldfish.rc b/init.goldfish.rc
deleted file mode 100644
index 48663bc..0000000
--- a/init.goldfish.rc
+++ /dev/null
@@ -1,99 +0,0 @@
-
-on early-init
-    mount debugfs debugfs /sys/kernel/debug
-
-on init
-
-on boot
-    setprop ARGH ARGH
-    setprop net.eth0.gw 10.0.2.2
-    setprop net.eth0.dns1 10.0.2.3
-    setprop net.dns1 10.0.2.3
-    setprop net.gprs.local-ip 10.0.2.15
-    setprop ro.radio.use-ppp no
-    setprop ro.build.product generic
-    setprop ro.product.device generic
-
-# fake some battery state
-    setprop status.battery.state Slow
-    setprop status.battery.level 5
-    setprop status.battery.level_raw  50
-    setprop status.battery.level_scale 9
-
-# set up the GPU caching
-    setprop ro.hwui.texture_cache_size 72
-    setprop ro.hwui.layer_cache_size 48
-    setprop ro.hwui.r_buffer_cache_size 8
-    setprop ro.hwui.path_cache_size 32
-    setprop ro.hwui.gradient_cache_size 1
-    setprop ro.hwui.drop_shadow_cache_size 6
-    setprop ro.hwui.texture_cache_flushrate 0.4
-    setprop ro.hwui.text_small_cache_width 1024
-    setprop ro.hwui.text_small_cache_height 1024
-    setprop ro.hwui.text_large_cache_width 2048
-    setprop ro.hwui.text_large_cache_height 1024
-
-# disable some daemons the emulator doesn't want
-    stop dund
-    stop akmd
-
-# start essential services
-    start qemud
-    start goldfish-logcat
-    start goldfish-setup
-
-    setprop ro.setupwizard.mode EMULATOR
-
-# enable Google-specific location features,
-# like NetworkLocationProvider and LocationCollector
-    setprop ro.com.google.locationfeatures 1
-
-# For the emulator, which bypasses Setup Wizard, you can specify
-# account info for the device via these two properties.  Google
-# Login Service will insert these accounts into the database when
-# it is created (ie, after a data wipe).
-#
-#   setprop ro.config.hosted_account username@hosteddomain.org:password
-#   setprop ro.config.google_account username@gmail.com:password
-#
-# You MUST have a Google account on the device, and you MAY
-# additionally have a hosted account.  No other configuration is
-# supported, and arbitrary breakage may result if you specify
-# something else.
-
-on fs
-        mount_all /fstab.goldfish
-
-service goldfish-setup /system/etc/init.goldfish.sh
-    user root
-    group root
-    oneshot
-
-# The qemu-props program is used to set various system
-# properties on boot. It must be run early during the boot
-# process to avoid race conditions with other daemons that
-# might read them (e.g. surface flinger), so define it in
-# class 'core'
-#
-service qemu-props /system/bin/qemu-props
-    class core
-    user root
-    group root
-    oneshot
-
-service qemud /system/bin/qemud
-    socket qemud    stream 666
-    oneshot
-
-# -Q is a special logcat option that forces the
-# program to check wether it runs on the emulator
-# if it does, it redirects its output to the device
-# named by the androidboot.console kernel option
-# if not, is simply exits immediately
-
-service goldfish-logcat /system/bin/logcat -Q
-    oneshot
-
-service fingerprintd /system/bin/fingerprintd
-    class late_start
-    user system
diff --git a/init.ranchu.rc b/init.ranchu.rc
deleted file mode 100644
index c5b2a83..0000000
--- a/init.ranchu.rc
+++ /dev/null
@@ -1,110 +0,0 @@
-on fs
-    mount_all /fstab.ranchu
-
-on early-init
-    mount debugfs debugfs /sys/kernel/debug mode=755
-
-on init
-
-    symlink /dev/goldfish_pipe /dev/android_pipe
-    symlink /dev/goldfish_pipe /dev/qemu_pipe
-
-on post-fs-data
-    setprop vold.post_fs_data_done 1
-
-on boot
-    setprop net.eth0.gw 10.0.2.2
-    setprop net.eth0.dns1 10.0.2.3
-    setprop net.gprs.local-ip 10.0.2.15
-    setprop ro.radio.use-ppp no
-    setprop ro.build.product generic
-    setprop ro.product.device generic
-    setprop ro.hardware.audio.primary goldfish
-    setprop ro.setupwizard.mode EMULATOR
-
-# fake some battery state
-    setprop status.battery.state Slow
-    setprop status.battery.level 5
-    setprop status.battery.level_raw  50
-    setprop status.battery.level_scale 9
-
-# set up the GPU caching
-    setprop ro.hwui.texture_cache_size 72
-    setprop ro.hwui.layer_cache_size 48
-    setprop ro.hwui.r_buffer_cache_size 8
-    setprop ro.hwui.path_cache_size 32
-    setprop ro.hwui.gradient_cache_size 1
-    setprop ro.hwui.drop_shadow_cache_size 6
-    setprop ro.hwui.texture_cache_flushrate 0.4
-    setprop ro.hwui.text_small_cache_width 1024
-    setprop ro.hwui.text_small_cache_height 1024
-    setprop ro.hwui.text_large_cache_width 2048
-    setprop ro.hwui.text_large_cache_height 1024
-
-# disable some daemons the emulator doesn't want
-    stop dund
-    stop akmd
-
-# start essential services
-# These were written for the classic emulator, but are applicable to ranchu
-    start goldfish-logcat
-    start goldfish-setup
-
-
-# enable Google-specific location features,
-# like NetworkLocationProvider and LocationCollector
-    setprop ro.com.google.locationfeatures 1
-
-#emulator is not much useful before boot complete
-#start it later
-on property:sys.boot_completed=1
-    setprop sys.usb.config adb
-    start adbd
-    start goldfish-logcat
-
-# allow goldfish-setup to take wake lock
-    chown root system /sys/power/wake_lock
-    chown root system /sys/power/wake_unlock
-
-service ranchu-setup /vendor/bin/init.ranchu-core.sh
-    class core
-    user root
-    group root
-    oneshot
-
-service ranchu-net /vendor/bin/init.ranchu-net.sh
-    class late_start
-    user root
-    group root wakelock
-    oneshot
-
-# The qemu-props program is used to set various system
-# properties on boot. It must be run early during the boot
-# process to avoid race conditions with other daemons that
-# might read them (e.g. surface flinger), so define it in
-# class 'core'
-#
-service qemu-props /vendor/bin/qemu-props
-    class core
-    user root
-    group root
-    oneshot
-
-on property:qemu.logcat=start
-    start goldfish-logcat
-
-# -Q is a special logcat option that forces the
-# program to check wether it runs on the emulator
-# if it does, it redirects its output to the device
-# named by the androidboot.console kernel option
-# if not, is simply exits immediately
-# logd user added to prevent logcat from logging content.
-# log group added to support access to read logs socket.
-service goldfish-logcat /system/bin/logcat -Q
-    user logd
-    group log
-    oneshot
-
-service fingerprintd /system/bin/fingerprintd
-    class late_start
-    user system
diff --git a/overlay/frameworks/base/core/res/res/values-b+sr+Latn/strings.xml b/overlay/frameworks/base/core/res/res/values-b+sr+Latn/strings.xml
new file mode 100644
index 0000000..98312d0
--- /dev/null
+++ b/overlay/frameworks/base/core/res/res/values-b+sr+Latn/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">"Kada je prečica uključena, pritisnite dugme Nazad i dugme sa strelicom nadole i zadržite ih 3 sekunde da biste pokrenuli funkciju pristupačnosti.\n\n Aktuelna funkcija pristupačnosti:\n <xliff:g id="SERVICE_NAME">%1$s</xliff:g>\n\n Možete da promenite funkciju u odeljku Podešavanja &gt; Pristupačnost."</string>
+</resources>
diff --git a/overlay/frameworks/base/core/res/res/values-be/strings.xml b/overlay/frameworks/base/core/res/res/values-be/strings.xml
new file mode 100644
index 0000000..d7fc019
--- /dev/null
+++ b/overlay/frameworks/base/core/res/res/values-be/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 Вы можаце змяніць гэту функцыю ў меню \"Налады &gt; Спецыяльныя магчымасці\"."</string>
+</resources>
diff --git a/overlay/frameworks/base/core/res/res/values-bs/strings.xml b/overlay/frameworks/base/core/res/res/values-bs/strings.xml
new file mode 100644
index 0000000..4d9d530
--- /dev/null
+++ b/overlay/frameworks/base/core/res/res/values-bs/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">"Kada je uključena prečica, pritiskom i držanjem dugmadi za nazad i dolje u trajanju od 3 sekunde pokrenut će se funkcija pristupačnosti.\n\n Trenutna funkcija pristupačnosti:\n <xliff:g id="SERVICE_NAME">%1$s</xliff:g>\n\n Funkciju možete promijeniti u meniju Postavke &gt; Pristupačnost."</string>
+</resources>
diff --git a/overlay/frameworks/base/core/res/res/values-en-rCA/strings.xml b/overlay/frameworks/base/core/res/res/values-en-rCA/strings.xml
new file mode 100644
index 0000000..5eca759
--- /dev/null
+++ b/overlay/frameworks/base/core/res/res/values-en-rCA/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">"When the shortcut is on, pressing both the back and down buttons for 3 seconds will start an accessibility feature.\n\n Current accessibility feature:\n <xliff:g id="SERVICE_NAME">%1$s</xliff:g>\n\n You can change the feature in Settings &gt; Accessibility."</string>
+</resources>
diff --git a/overlay/frameworks/base/core/res/res/values-en-rXC/strings.xml b/overlay/frameworks/base/core/res/res/values-en-rXC/strings.xml
new file mode 100644
index 0000000..eec9afa
--- /dev/null
+++ b/overlay/frameworks/base/core/res/res/values-en-rXC/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">"‎‏‎‎‎‎‎‏‎‏‏‏‎‎‎‎‏‏‏‏‎‏‎‎‏‎‏‏‏‏‏‏‏‏‎‏‎‏‏‏‎‏‎‏‏‎‏‎‎‎‏‏‏‏‎‏‎‏‏‏‎‎‏‏‎‏‏‏‏‏‏‏‏‎‎‏‏‏‎‏‏‎‎‏‏‏‏‎‏‎‎‎‏‎‏‎When the shortcut is on, pressing both the back and down buttons for 3 seconds will start an accessibility feature.‎‏‎‎‏‏‎\n‎‏‎‎‏‏‏‎‎‏‎‎‏‏‎\n‎‏‎‎‏‏‏‎ Current accessibility feature:‎‏‎‎‏‏‎\n‎‏‎‎‏‏‏‎ ‎‏‎‎‏‏‎<xliff:g id="SERVICE_NAME">%1$s</xliff:g>‎‏‎‎‏‏‏‎‎‏‎‎‏‏‎\n‎‏‎‎‏‏‏‎‎‏‎‎‏‏‎\n‎‏‎‎‏‏‏‎ You can change the feature in Settings &gt; Accessibility.‎‏‎‎‏‎"</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-large/config.xml b/overlay/frameworks/base/core/res/res/values-large/config.xml
new file mode 100644
index 0000000..c4ef88c
--- /dev/null
+++ b/overlay/frameworks/base/core/res/res/values-large/config.xml
@@ -0,0 +1,26 @@
+<?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>
+    <!-- Control the behavior when the user long presses the home button.
+            0 - Nothing
+            1 - Launch all apps intent
+            2 - Launch assist intent
+         This needs to match the constants in
+         policy/src/com/android/internal/policy/impl/PhoneWindowManager.java
+    -->
+    <integer name="config_longPressOnHomeBehavior">1</integer>
+</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 956f4bb..b73fa4a 100644
--- a/overlay/frameworks/base/core/res/res/values/config.xml
+++ b/overlay/frameworks/base/core/res/res/values/config.xml
@@ -15,6 +15,9 @@
 -->
 
 <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. -->
@@ -37,6 +40,9 @@
          Any other values will have surprising consequences. -->
     <integer name="config_defaultUiModeType">4</integer>
 
+    <!-- default device has recents property -->
+    <bool name="config_hasRecents">false</bool>
+
     <!-- Control the behavior when the user long presses the home button.
             0 - Nothing
             1 - Launch all apps intent
@@ -61,4 +67,43 @@
     <!-- Default service to enable with accessibility shortcut [DO NOT TRANSLATE] -->
     <string name="config_defaultAccessibilityService" translatable="false">com.google.android.marvin.talkback/.TalkBackService</string>
 
+    <!-- The component name, flattened to a string, for the default autofill service
+         to  enabled for an user. This service must be trusted, as it can be activated
+         without explicit consent of the user. If no autofill service with the
+          specified name exists on the device, autofill will be disabled by default.
+    -->
+    <string name="config_defaultAutofillService" translatable="false">com.google.android.gms/.autofill.service.AutofillService</string>
+
+   <!-- The list of IMEs which should be disabled until used.
+         This function suppresses update notifications for these pre-installed apps.
+         We need to set this configuration carefully that they should not have functionarities
+         other than "IME" or "Spell Checker". In InputMethodManagerService,
+         the listed IMEs are disabled until used when all of the following conditions are met.
+         1. Not selected as an enabled IME in the Settings
+         2. Not selected as a spell checker in the Settings
+         3. Installed
+         4. A pre-installed IME
+         5. Not enabled
+         And the disabled_until_used state for an IME is released by InputMethodManagerService
+         when the IME is selected as an enabled IME. -->
+    <string-array name="config_disabledUntilUsedPreinstalledImes" translatable="false">
+        <item>com.google.android.inputmethod.latin</item>
+        <item>com.google.android.apps.inputmethod.hindi</item>
+        <item>com.google.android.apps.inputmethod.zhuyin</item>
+        <item>com.google.android.inputmethod.japanese</item>
+        <item>com.google.android.inputmethod.korean</item>
+        <item>com.google.android.inputmethod.pinyin</item>
+    </string-array>
+
+    <!-- Whether to keep background restricted profiles running after exiting. If set to false,
+         restricted profiles may be put into stopped state as soon as the switch back to primary
+         happens.
+         Can be overridden with android.provider.Settings.Global.KEEP_PROFILE_IN_BACKGROUND. -->
+    <bool name="config_keepRestrictedProfilesInBackground">false</bool>
+
+
+    <!-- An array of packages which can listen for notifications on low ram devices. -->
+    <string-array translatable="false" name="config_allowedManagedServicesOnLowRamDevices">
+        <item>com.google.android.tvrecommendations</item>
+    </string-array>
 </resources>
diff --git a/overlay/frameworks/base/core/res/res/values/dimens.xml b/overlay/frameworks/base/core/res/res/values/dimens.xml
index dc40e96..ae0514b 100644
--- a/overlay/frameworks/base/core/res/res/values/dimens.xml
+++ b/overlay/frameworks/base/core/res/res/values/dimens.xml
@@ -17,7 +17,7 @@
 <resources>
 
     <!-- Height of the status bar -->
-    <dimen name="status_bar_height">0dp</dimen>
+    <dimen name="status_bar_height_portrait">0dp</dimen>
 
     <!-- Height of the bottom navigation / system bar -->
     <dimen name="navigation_bar_height">0dp</dimen>
diff --git a/overlay/frameworks/base/core/res/res/xml/global_keys.xml b/overlay/frameworks/base/core/res/res/xml/global_keys.xml
index f6142dc..4c0ab10 100644
--- a/overlay/frameworks/base/core/res/res/xml/global_keys.xml
+++ b/overlay/frameworks/base/core/res/res/xml/global_keys.xml
@@ -28,6 +28,7 @@
 <global_keys version="1">
     <!-- Example format: id = keycode to handle globally. component = component which will handle
          this key. -->
+    <key keyCode="KEYCODE_DVR" component="com.google.android.tv/.receiver.GlobalKeyReceiver" />
     <key keyCode="KEYCODE_GUIDE" component="com.google.android.tv/.receiver.GlobalKeyReceiver" />
     <key keyCode="KEYCODE_TV" component="com.google.android.tv/.receiver.GlobalKeyReceiver" />
     <key keyCode="KEYCODE_TV_INPUT" component="com.google.android.tv/.receiver.GlobalKeyReceiver" />
diff --git a/overlay/frameworks/base/packages/SystemUI/res/values-en-rXC/config.xml b/overlay/frameworks/base/packages/SystemUI/res/values-en-rXC/config.xml
new file mode 100644
index 0000000..f1dadfb
--- /dev/null
+++ b/overlay/frameworks/base/packages/SystemUI/res/values-en-rXC/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/config.xml b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
index af03224..a299c7e 100644
--- a/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
+++ b/overlay/frameworks/base/packages/SystemUI/res/values/config.xml
@@ -28,4 +28,6 @@
         <item>com.google.android.apps.mediashell</item>
     </string-array>
 
+    <!-- Svelte specific logic, see RecentsConfiguration.SVELTE_* constants. -->
+    <integer name="recents_svelte_level">3</integer>
 </resources>
diff --git a/permissions/tv_core_hardware.xml b/permissions/tv_core_hardware.xml
index 03d4c2f..74403e2 100644
--- a/permissions/tv_core_hardware.xml
+++ b/permissions/tv_core_hardware.xml
@@ -33,6 +33,8 @@
     <feature name="android.software.picture_in_picture" />
     <feature name="android.software.activities_on_secondary_displays" />
     <feature name="android.software.voice_recognizers" />
+    <feature name="android.software.input_methods" />
+    <feature name="android.software.autofill" />
 
     <feature name="android.software.cts" />
 
diff --git a/products/AndroidProducts.mk b/products/AndroidProducts.mk
new file mode 100644
index 0000000..6f7ebdb
--- /dev/null
+++ b/products/AndroidProducts.mk
@@ -0,0 +1,38 @@
+#
+# Copyright (C) 2018 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.
+#
+
+#
+# This file should set PRODUCT_MAKEFILES to a list of product makefiles
+# to expose to the build system.  LOCAL_DIR will already be set to
+# the directory containing this file.
+# PRODUCT_MAKEFILES is set up in AndroidProducts.mks.
+# Format of PRODUCT_MAKEFILES:
+# <product_name>:<path_to_the_product_makefile>
+# If the <product_name> is the same as the base file name (without dir
+# and the .mk suffix) of the product makefile, "<product_name>:" can be
+# omitted.
+#
+# This file may not rely on the value of any variable other than
+# LOCAL_DIR; do not use any conditionals, and do not look up the
+# value of any variable that isn't set in this file or in a file that
+# it includes.
+#
+
+PRODUCT_MAKEFILES := \
+    $(LOCAL_DIR)/aosp_atv_arm_a.mk \
+    $(LOCAL_DIR)/aosp_atv_arm_ab.mk \
+    $(LOCAL_DIR)/aosp_atv_arm64_a.mk \
+    $(LOCAL_DIR)/aosp_atv_arm64_ab.mk
diff --git a/products/aosp_atv_arm64_a.mk b/products/aosp_atv_arm64_a.mk
new file mode 100644
index 0000000..0fc76c2
--- /dev/null
+++ b/products/aosp_atv_arm64_a.mk
@@ -0,0 +1,27 @@
+#
+# Copyright (C) 2018 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
+
+PRODUCT_NAME := aosp_atv_arm64_a
+PRODUCT_DEVICE := generic_arm64_a
+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
new file mode 100644
index 0000000..56b0cf1
--- /dev/null
+++ b/products/aosp_atv_arm64_ab.mk
@@ -0,0 +1,33 @@
+#
+# Copyright (C) 2018 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_ab
+PRODUCT_DEVICE := generic_arm64_ab
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := AOSP ATV on ARM64
diff --git a/products/aosp_atv_arm_a.mk b/products/aosp_atv_arm_a.mk
new file mode 100644
index 0000000..83af0e9
--- /dev/null
+++ b/products/aosp_atv_arm_a.mk
@@ -0,0 +1,27 @@
+#
+# Copyright (C) 2018 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
+
+PRODUCT_NAME := aosp_atv_arm_a
+PRODUCT_DEVICE := generic_arm_a
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := AOSP ATV on ARM32
diff --git a/products/aosp_atv_arm_ab.mk b/products/aosp_atv_arm_ab.mk
new file mode 100644
index 0000000..d359582
--- /dev/null
+++ b/products/aosp_atv_arm_ab.mk
@@ -0,0 +1,33 @@
+#
+# Copyright (C) 2018 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_ab
+PRODUCT_DEVICE := generic_arm_ab
+PRODUCT_BRAND := Android
+PRODUCT_MODEL := AOSP ATV on ARM32
diff --git a/products/atv_base.mk b/products/atv_base.mk
index 01e18db..4b2602e 100644
--- a/products/atv_base.mk
+++ b/products/atv_base.mk
@@ -19,8 +19,13 @@
 PRODUCT_PACKAGES := \
     TvProvider \
     TvSettings \
+    SettingsIntelligence \
     tv_input.default
 
+ifneq (,$(filter userdebug eng, $(TARGET_BUILD_VARIANT)))
+PRODUCT_PACKAGES += Traceur
+endif
+
 PRODUCT_COPY_FILES := \
     device/google/atv/permissions/tv_core_hardware.xml:system/etc/permissions/tv_core_hardware.xml
 
@@ -38,6 +43,7 @@
     CalendarProvider \
     CaptivePortalLogin \
     CertInstaller \
+    DocumentsUIMinimal \
     ExternalStorageProvider \
     FusedLocation \
     InputDevices \
@@ -85,23 +91,12 @@
 # To enable access to /dev/dvb*
 BOARD_SEPOLICY_DIRS += device/google/atv/sepolicy
 
-# This property defines the tutorial content for this device
-PRODUCT_PROPERTY_OVERRIDES += \
-    ro.tutorials_content.android=android8
-
-# Content for ATV Tutorials / Post-Setup Tour
-PRODUCT_COPY_FILES += \
-    device/google/atv/tutorial-library-google.zip.etag:system/media/tutorial-library-google.zip.etag
-
-PRODUCT_COPY_FILES += \
-    device/google/atv/tutorial-library-google.zip:system/media/tutorial-library-google.zip
 
 # Copy .kl file for generic voice remotes
 PRODUCT_COPY_FILES += \
     device/google/atv/Generic.kl:system/usr/keylayout/Generic.kl
 
 $(call inherit-product-if-exists, frameworks/base/data/sounds/AudioTv.mk)
-$(call inherit-product-if-exists, external/svox/pico/lang/all_pico_languages.mk)
 $(call inherit-product-if-exists, frameworks/base/data/fonts/fonts.mk)
 $(call inherit-product-if-exists, external/google-fonts/dancing-script/fonts.mk)
 $(call inherit-product-if-exists, external/google-fonts/carrois-gothic-sc/fonts.mk)
diff --git a/products/atv_generic.mk b/products/atv_generic.mk
index bc94202..b3f4771 100644
--- a/products/atv_generic.mk
+++ b/products/atv_generic.mk
@@ -32,10 +32,5 @@
 PRODUCT_AAPT_CONFIG := normal large xlarge tvdpi hdpi xhdpi xxhdpi
 PRODUCT_AAPT_PREF_CONFIG := xhdpi
 
-# From build/target/product/full_base.mk
-PRODUCT_PACKAGES += \
-    LiveWallpapersPicker \
-    PhotoTable
-
-$(call inherit-product, $(SRC_TARGET_DIR)/product/locales_full.mk)
+$(call inherit-product, $(SRC_TARGET_DIR)/product/languages_full.mk)
 $(call inherit-product, device/google/atv/products/atv_base.mk)
diff --git a/products/sdk_atv_armv7.mk b/products/sdk_atv_armv7.mk
index 2243f4e..0803400 100644
--- a/products/sdk_atv_armv7.mk
+++ b/products/sdk_atv_armv7.mk
@@ -17,7 +17,6 @@
 PRODUCT_IS_ATV_SDK := true
 
 PRODUCT_PACKAGES := \
-    EmulatorSmokeTests \
     LeanbackSampleApp \
     TelephonyProvider \
     SdkSetup \
@@ -31,8 +30,6 @@
 PRODUCT_COPY_FILES := \
     device/generic/goldfish/data/etc/apns-conf.xml:system/etc/apns-conf.xml \
     device/generic/goldfish/camera/media_codecs.xml:system/etc/media_codecs.xml \
-    device/google/atv/init.goldfish.rc:root/init.goldfish.rc \
-    device/google/atv/init.ranchu.rc:root/init.ranchu.rc \
     frameworks/av/media/libstagefright/data/media_codecs_google_audio.xml:system/etc/media_codecs_google_audio.xml \
     frameworks/native/data/etc/android.hardware.ethernet.xml:system/etc/permissions/android.hardware.ethernet.xml \
     frameworks/av/media/libstagefright/data/media_codecs_google_telephony.xml:system/etc/media_codecs_google_telephony.xml \
@@ -59,14 +56,6 @@
 
 $(call inherit-product, device/google/atv/products/atv_base.mk)
 
-# include available languages for TTS in the system image
--include external/svox/pico/lang/PicoLangDeDeInSystem.mk
--include external/svox/pico/lang/PicoLangEnGBInSystem.mk
--include external/svox/pico/lang/PicoLangEnUsInSystem.mk
--include external/svox/pico/lang/PicoLangEsEsInSystem.mk
--include external/svox/pico/lang/PicoLangFrFrInSystem.mk
--include external/svox/pico/lang/PicoLangItItInSystem.mk
-
 # Overrides
 PRODUCT_NAME := sdk_atv_armv7
 PRODUCT_DEVICE := generic
diff --git a/products/sdk_atv_x86.mk b/products/sdk_atv_x86.mk
index 1b6f3f7..6f2d544 100644
--- a/products/sdk_atv_x86.mk
+++ b/products/sdk_atv_x86.mk
@@ -13,6 +13,16 @@
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
+PRODUCT_PROPERTY_OVERRIDES += \
+	rild.libpath=/vendor/lib/libreference-ril.so
+
+PRODUCT_COPY_FILES += \
+    device/generic/goldfish/data/etc/config.ini.tv:config.ini
+
+PRODUCT_COPY_FILES += \
+    development/sys-img/advancedFeatures.ini:advancedFeatures.ini \
+    device/generic/goldfish/data/etc/encryptionkey.img:encryptionkey.img \
+    prebuilts/qemu-kernel/x86_64/4.4/kernel-qemu2:kernel-ranchu-64
 
 # TODO: separate out a common base for arm/x86 atv SDK build.
 $(call inherit-product, device/google/atv/products/sdk_atv_armv7.mk)
diff --git a/products/treble_atv_common.mk b/products/treble_atv_common.mk
new file mode 100644
index 0000000..d0540d4
--- /dev/null
+++ b/products/treble_atv_common.mk
@@ -0,0 +1,81 @@
+#
+# Copyright (C) 2018 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.
+
+# Generic system image inherits from AOSP
+$(call inherit-product, device/google/atv/products/atv_base.mk)
+
+# Split selinux policy
+PRODUCT_FULL_TREBLE_OVERRIDE := true
+
+# Packages required for ATV GSI
+PRODUCT_PACKAGES += \
+    FrameworkPackageStubs \
+    LatinIMEGoogleTvPrebuilt \
+    TvProvision \
+    TvSampleLeanbackLauncher
+
+# All VNDK libraries (HAL interfaces, VNDK, VNDK-SP, LL-NDK)
+PRODUCT_PACKAGES += vndk_package
+
+# SP-NDK:
+PRODUCT_PACKAGES += \
+    libvulkan \
+
+# The following policy XML files are used as fallback for
+# vendors/devices not using XML to configure audio policy.
+PRODUCT_COPY_FILES += \
+    frameworks/av/services/audiopolicy/config/audio_policy_configuration_generic.xml:system/etc/audio_policy_configuration.xml \
+    frameworks/av/services/audiopolicy/config/primary_audio_policy_configuration.xml:system/etc/primary_audio_policy_configuration.xml \
+    frameworks/av/services/audiopolicy/config/r_submix_audio_policy_configuration.xml:system/etc/r_submix_audio_policy_configuration.xml \
+    frameworks/av/services/audiopolicy/config/audio_policy_volumes.xml:system/etc/audio_policy_volumes.xml \
+    frameworks/av/services/audiopolicy/config/default_volume_tables.xml:system/etc/default_volume_tables.xml \
+
+# Bluetooth:
+#   audio.a2dp.default is a system module. Generic system image includes
+#   audio.a2dp.default to support A2DP if board has the capability.
+PRODUCT_PACKAGES += \
+    audio.a2dp.default
+
+# Net:
+#   Vendors can use the platform-provided network configuration utilities (ip,
+#   iptable, etc.) to configure the Linux networking stack, but these utilities
+#   do not yet include a HIDL interface wrapper. This is a solution on
+#   Android O.
+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
+
+# Name space configuration file for non-enforcing VNDK
+PRODUCT_PACKAGES += \
+    ld.config.noenforce.txt
+
+# Set current VNDK version for GSI
+PRODUCT_SYSTEM_DEFAULT_PROPERTIES += \
+    ro.gsi.vndk.version=$(PLATFORM_VNDK_VERSION)
+
+# 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
diff --git a/products/treble_atv_common_32.mk b/products/treble_atv_common_32.mk
new file mode 100644
index 0000000..8609052
--- /dev/null
+++ b/products/treble_atv_common_32.mk
@@ -0,0 +1,22 @@
+#
+# Copyright (C) 2018 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.mk
diff --git a/products/treble_atv_common_64.mk b/products/treble_atv_common_64.mk
new file mode 100644
index 0000000..3a5b038
--- /dev/null
+++ b/products/treble_atv_common_64.mk
@@ -0,0 +1,37 @@
+#
+# Copyright (C) 2018 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.mk
+
+# For now this will allow 64-bit apps, but still compile all apps with JNI
+# for 32-bit only.
+
+# Copy different zygote settings for vendor.img to select by setting property
+# ro.zygote=zygote64_32 or ro.zygote=zygote32_64:
+#   1. 64-bit primary, 32-bit secondary OR
+#   2. 32-bit primary, 64-bit secondary
+#   3. 64-bit only is currently forbidden (b/64280459#comment6)
+PRODUCT_COPY_FILES += \
+    system/core/rootdir/init.zygote64_32.rc:root/init.zygote64_32.rc \
+    system/core/rootdir/init.zygote32_64.rc:root/init.zygote32_64.rc
+
+TARGET_SUPPORTS_32_BIT_APPS := true
+TARGET_SUPPORTS_64_BIT_APPS := true
diff --git a/sdk/images_armeabi-v7a_source.prop_template b/sdk/images_armeabi-v7a_source.prop_template
index d38fe89..c0fc670 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=1
+Pkg.Revision=4
 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 c3bc0ea..5477fcd 100644
--- a/sdk/images_x86_source.prop_template
+++ b/sdk/images_x86_source.prop_template
@@ -1,6 +1,6 @@
 Pkg.Desc=Android SDK Platform ${PLATFORM_VERSION}
 Pkg.UserSrc=false
-Pkg.Revision=1
+Pkg.Revision=4
 AndroidVersion.ApiLevel=${PLATFORM_SDK_VERSION}
 AndroidVersion.CodeName=${PLATFORM_VERSION_CODENAME}
 SystemImage.Abi=x86
diff --git a/tutorial-library-google.zip b/tutorial-library-google.zip
deleted file mode 100644
index 2c84713..0000000
--- a/tutorial-library-google.zip
+++ /dev/null
Binary files differ
diff --git a/tutorial-library-google.zip.etag b/tutorial-library-google.zip.etag
deleted file mode 100644
index 1284cd3..0000000
--- a/tutorial-library-google.zip.etag
+++ /dev/null
@@ -1 +0,0 @@
-d58d5373ae6b31929d75e223425de4fd