omni: rework emulator config

Change-Id: Iae64074404a290f96c82bb304298de76eb91d6da
diff --git a/utils/omni_emulator/Android.mk b/utils/omni_emulator/Android.mk
new file mode 100644
index 0000000..20bfbaf
--- /dev/null
+++ b/utils/omni_emulator/Android.mk
@@ -0,0 +1,28 @@
+#
+# Copyright (C) 2011 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.
+#
+
+# WARNING: Everything listed here will be built on ALL platforms,
+# including x86, the emulator, and the SDK.  Modules must be uniquely
+# named (liblights.panda), and must build everywhere, or limit themselves
+# to only building on ARM if they include assembly. Individual makefiles
+# are responsible for having their own logic, for fine-grained control.
+
+LOCAL_PATH := $(call my-dir)
+
+# if some modules are built directly from this directory (not subdirectories),
+# their rules should be written here.
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/utils/omni_emulator/BoardConfig.mk b/utils/omni_emulator/BoardConfig.mk
new file mode 100644
index 0000000..f362f09
--- /dev/null
+++ b/utils/omni_emulator/BoardConfig.mk
@@ -0,0 +1,40 @@
+# 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.
+#
+
+# x86 emulator specific definitions
+TARGET_CPU_ABI := x86
+TARGET_ARCH := x86
+TARGET_ARCH_VARIANT := x86
+
+TARGET_PRELINK_MODULE := false
+
+include build/make/target/board/BoardConfigGsiCommon.mk
+include vendor/omni/utils/omni_emulator/BoardConfigEmuCommon.mk
+
+# Resize to 4G to accomodate ASAN and CTS
+BOARD_USERDATAIMAGE_PARTITION_SIZE := 4294967296
+
+BOARD_SEPOLICY_DIRS += device/generic/goldfish/sepolicy/x86
+
+# Wifi.
+BOARD_WLAN_DEVICE           := emulator
+BOARD_HOSTAPD_DRIVER        := NL80211
+BOARD_WPA_SUPPLICANT_DRIVER := NL80211
+BOARD_HOSTAPD_PRIVATE_LIB   := lib_driver_cmd_simulated
+BOARD_WPA_SUPPLICANT_PRIVATE_LIB := lib_driver_cmd_simulated
+WPA_SUPPLICANT_VERSION      := VER_0_8_X
+WIFI_DRIVER_FW_PATH_PARAM   := "/dev/null"
+WIFI_DRIVER_FW_PATH_STA     := "/dev/null"
+WIFI_DRIVER_FW_PATH_AP      := "/dev/null"
diff --git a/utils/omni_emulator/BoardConfigEmuCommon.mk b/utils/omni_emulator/BoardConfigEmuCommon.mk
new file mode 100644
index 0000000..2067770
--- /dev/null
+++ b/utils/omni_emulator/BoardConfigEmuCommon.mk
@@ -0,0 +1,71 @@
+# BoardConfigEmuCommon.mk
+#
+# Common compile-time definitions for emulator
+#
+
+HAVE_HTC_AUDIO_DRIVER := true
+BOARD_USES_GENERIC_AUDIO := true
+TARGET_BOOTLOADER_BOARD_NAME := goldfish_$(TARGET_ARCH)
+
+# No Kernel
+TARGET_NO_KERNEL := true
+
+# no hardware camera
+USE_CAMERA_STUB := true
+
+NUM_FRAMEBUFFER_SURFACE_BUFFERS := 3
+
+# Build OpenGLES emulation guest and host libraries
+BUILD_EMULATOR_OPENGL := true
+BUILD_QEMU_IMAGES := true
+
+# Build and enable the OpenGL ES View renderer. When running on the emulator,
+# the GLES renderer disables itself if host GL acceleration isn't available.
+USE_OPENGL_RENDERER := true
+
+# Emulator doesn't support sparse image format.
+TARGET_USERIMAGES_SPARSE_EXT_DISABLED := true
+
+ifeq ($(PRODUCT_USE_DYNAMIC_PARTITIONS),true)
+  # emulator is Non-A/B device
+  AB_OTA_UPDATER := false
+
+  # emulator needs super.img
+  BOARD_BUILD_SUPER_IMAGE_BY_DEFAULT := true
+
+  BOARD_EXT4_SHARE_DUP_BLOCKS := true
+
+  # 3G + header
+  BOARD_SUPER_PARTITION_SIZE := 3229614080
+  BOARD_SUPER_PARTITION_GROUPS := emulator_dynamic_partitions
+  BOARD_EMULATOR_DYNAMIC_PARTITIONS_PARTITION_LIST := \
+      system \
+      vendor
+
+  # 3G
+  BOARD_EMULATOR_DYNAMIC_PARTITIONS_SIZE := 3221225472
+
+  # in build environment to speed up make -j
+  ifeq ($(QEMU_DISABLE_AVB),true)
+    BOARD_AVB_ENABLE := false
+  endif
+else ifeq ($(PRODUCT_USE_DYNAMIC_PARTITION_SIZE),true)
+  # Enable dynamic system image size and reserved 64MB in it.
+  BOARD_SYSTEMIMAGE_PARTITION_RESERVED_SIZE := 67108864
+  BOARD_VENDORIMAGE_PARTITION_RESERVED_SIZE := 67108864
+else
+  BOARD_SYSTEMIMAGE_PARTITION_SIZE := 3221225472
+  BOARD_VENDORIMAGE_PARTITION_SIZE := 146800640
+endif
+
+# Enable chain partition for system.
+BOARD_AVB_SYSTEM_KEY_PATH := external/avb/test/data/testkey_rsa2048.pem
+BOARD_AVB_SYSTEM_ALGORITHM := SHA256_RSA2048
+BOARD_AVB_SYSTEM_ROLLBACK_INDEX := $(PLATFORM_SECURITY_PATCH_TIMESTAMP)
+BOARD_AVB_SYSTEM_ROLLBACK_INDEX_LOCATION := 1
+
+BOARD_VENDORIMAGE_FILE_SYSTEM_TYPE := ext4
+BOARD_FLASH_BLOCK_SIZE := 512
+DEVICE_MATRIX_FILE   := device/generic/goldfish/compatibility_matrix.xml
+
+BOARD_SEPOLICY_DIRS += device/generic/goldfish/sepolicy/common
diff --git a/utils/omni_emulator/GoldfishParts/Android.mk b/utils/omni_emulator/GoldfishParts/Android.mk
new file mode 100644
index 0000000..29c3764
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/Android.mk
@@ -0,0 +1,25 @@
+LOCAL_PATH := $(call my-dir)
+include $(CLEAR_VARS)
+
+LOCAL_MODULE_TAGS := optional
+LOCAL_SRC_FILES := $(call all-java-files-under, src)
+LOCAL_PACKAGE_NAME := GoldfishParts
+LOCAL_CERTIFICATE := platform
+LOCAL_AAPT_FLAGS := --auto-add-overlay
+LOCAL_RESOURCE_DIR := $(LOCAL_PATH)/res
+
+package_resource_overlays := $(strip \
+    $(wildcard $(foreach dir, $(PRODUCT_PACKAGE_OVERLAYS), \
+      $(addprefix $(dir)/, packages/apps/GoldfishParts/res))) \
+    $(wildcard $(foreach dir, $(DEVICE_PACKAGE_OVERLAYS), \
+      $(addprefix $(dir)/, packages/apps/GoldfishParts/res))))
+
+LOCAL_RESOURCE_DIR := $(package_resource_overlays) $(LOCAL_RESOURCE_DIR)
+
+LOCAL_PROGUARD_ENABLED := disabled
+LOCAL_DEX_PREOPT := false
+LOCAL_PRIVATE_PLATFORM_APIS := true
+
+include $(BUILD_PACKAGE)
+
+include $(call all-makefiles-under,$(LOCAL_PATH))
diff --git a/utils/omni_emulator/GoldfishParts/AndroidManifest.xml b/utils/omni_emulator/GoldfishParts/AndroidManifest.xml
new file mode 100644
index 0000000..6b80449
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/AndroidManifest.xml
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="utf-8"?>
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+    package="org.omnirom.device"
+    android:sharedUserId="android.uid.system" >
+
+    <uses-sdk
+        android:minSdkVersion="18"
+        android:targetSdkVersion="21" />
+    <application
+        android:icon="@drawable/ic_launcher"
+        android:label="@string/advanced_settings"
+        android:theme="@android:style/Theme.DeviceDefault.Settings"
+        android:supportsRtl="true" >
+        <activity
+            android:name="org.omnirom.device.DeviceSettings"
+            android:exported="true"
+            android:label="@string/advanced_settings"
+            android:launchMode="singleTask" >
+            <intent-filter>
+                <action android:name="android.intent.action.MAIN" />
+                <!--<category android:name="android.intent.category.LAUNCHER" />-->
+                <category android:name="android.intent.category.DEFAULT" />
+            </intent-filter>
+        </activity>
+    </application>
+</manifest>
diff --git a/utils/omni_emulator/GoldfishParts/res/drawable-hdpi/ic_launcher.png b/utils/omni_emulator/GoldfishParts/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..1e6b480
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/utils/omni_emulator/GoldfishParts/res/drawable-mdpi/ic_launcher.png b/utils/omni_emulator/GoldfishParts/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..89d59c6
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/utils/omni_emulator/GoldfishParts/res/drawable-xhdpi/ic_launcher.png b/utils/omni_emulator/GoldfishParts/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..6445baa
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/utils/omni_emulator/GoldfishParts/res/drawable-xxhdpi/ic_launcher.png b/utils/omni_emulator/GoldfishParts/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..2a5bb38
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/utils/omni_emulator/GoldfishParts/res/drawable/ic_camera.xml b/utils/omni_emulator/GoldfishParts/res/drawable/ic_camera.xml
new file mode 100644
index 0000000..8294f4b
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/drawable/ic_camera.xml
@@ -0,0 +1,9 @@
+<!-- drawable/camera.xml -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:height="32dp"
+    android:width="32dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24"
+    android:tint="?android:attr/colorAccent" >
+    <path android:fillColor="#fff" android:pathData="M4,4H7L9,2H15L17,4H20A2,2 0 0,1 22,6V18A2,2 0 0,1 20,20H4A2,2 0 0,1 2,18V6A2,2 0 0,1 4,4M12,7A5,5 0 0,0 7,12A5,5 0 0,0 12,17A5,5 0 0,0 17,12A5,5 0 0,0 12,7M12,9A3,3 0 0,1 15,12A3,3 0 0,1 12,15A3,3 0 0,1 9,12A3,3 0 0,1 12,9Z" />
+</vector>
diff --git a/utils/omni_emulator/GoldfishParts/res/drawable/ic_disabled.xml b/utils/omni_emulator/GoldfishParts/res/drawable/ic_disabled.xml
new file mode 100644
index 0000000..1c5152b
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/drawable/ic_disabled.xml
@@ -0,0 +1,8 @@
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+        android:height="32dp"
+        android:width="32dp"
+        android:viewportWidth="24"
+        android:viewportHeight="24"
+        android:tint="?android:attr/colorAccent" >
+    <path android:fillColor="#fff" android:pathData="M19,6.41L17.59,5L12,10.59L6.41,5L5,6.41L10.59,12L5,17.59L6.41,19L12,13.41L17.59,19L19,17.59L13.41,12L19,6.41Z"/>
+</vector>
diff --git a/utils/omni_emulator/GoldfishParts/res/drawable/ic_flashlight.xml b/utils/omni_emulator/GoldfishParts/res/drawable/ic_flashlight.xml
new file mode 100644
index 0000000..213a7f6
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/drawable/ic_flashlight.xml
@@ -0,0 +1,9 @@
+<!-- drawable/flashlight.xml -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:height="32dp"
+    android:width="32dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24"
+    android:tint="?android:attr/colorAccent" >
+    <path android:fillColor="#fff" android:pathData="M9,10L6,5H18L15,10H9M18,4H6V2H18V4M9,22V11H15V22H9M12,13A1,1 0 0,0 11,14A1,1 0 0,0 12,15A1,1 0 0,0 13,14A1,1 0 0,0 12,13Z" />
+</vector>
diff --git a/utils/omni_emulator/GoldfishParts/res/drawable/ic_music_next.xml b/utils/omni_emulator/GoldfishParts/res/drawable/ic_music_next.xml
new file mode 100644
index 0000000..baad21d
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/drawable/ic_music_next.xml
@@ -0,0 +1,9 @@
+<!-- drawable/skip_next.xml -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:height="32dp"
+    android:width="32dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24"
+    android:tint="?android:attr/colorAccent" >
+    <path android:fillColor="#fff" android:pathData="M16,18H18V6H16M6,18L14.5,12L6,6V18Z" />
+</vector>
diff --git a/utils/omni_emulator/GoldfishParts/res/drawable/ic_music_play.xml b/utils/omni_emulator/GoldfishParts/res/drawable/ic_music_play.xml
new file mode 100644
index 0000000..d8c3ba8
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/drawable/ic_music_play.xml
@@ -0,0 +1,9 @@
+<!-- drawable/play.xml -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:height="32dp"
+    android:width="32dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24"
+    android:tint="?android:attr/colorAccent" >
+    <path android:fillColor="#fff" android:pathData="M8,5.14V19.14L19,12.14L8,5.14Z" />
+</vector>
diff --git a/utils/omni_emulator/GoldfishParts/res/drawable/ic_music_prev.xml b/utils/omni_emulator/GoldfishParts/res/drawable/ic_music_prev.xml
new file mode 100644
index 0000000..199fcd1
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/drawable/ic_music_prev.xml
@@ -0,0 +1,9 @@
+<!-- drawable/skip_previous.xml -->
+<vector xmlns:android="http://schemas.android.com/apk/res/android"
+    android:height="32dp"
+    android:width="32dp"
+    android:viewportWidth="24"
+    android:viewportHeight="24"
+    android:tint="?android:attr/colorAccent" >
+    <path android:fillColor="#fff" android:pathData="M6,18V6H8V18H6M9.5,12L18,6V18L9.5,12Z" />
+</vector>
diff --git a/utils/omni_emulator/GoldfishParts/res/layout/applist_preference.xml b/utils/omni_emulator/GoldfishParts/res/layout/applist_preference.xml
new file mode 100644
index 0000000..62c9137
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/layout/applist_preference.xml
@@ -0,0 +1,21 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2006 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.
+-->
+
+<ImageView xmlns:android="http://schemas.android.com/apk/res/android"
+           android:id="@+id/app_icon"
+           android:layout_width="42dp"
+           android:layout_height="42dp"
+           android:padding="2dp"
+           android:scaleType="centerInside" />
diff --git a/utils/omni_emulator/GoldfishParts/res/layout/applist_preference_icon.xml b/utils/omni_emulator/GoldfishParts/res/layout/applist_preference_icon.xml
new file mode 100644
index 0000000..1d6425d
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/layout/applist_preference_icon.xml
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2006 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.
+-->
+
+<!-- Layout for a Preference in a PreferenceActivity. The
+     Preference is able to place a specific widget for its particular
+     type in the "widget_frame" layout. -->
+<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+    android:id="@android:id/widget_frame"
+    android:layout_width="match_parent"
+    android:layout_height="wrap_content"
+    android:minHeight="?android:attr/listPreferredItemHeightSmall"
+    android:gravity="center_vertical"
+    android:paddingStart="?android:attr/listPreferredItemPaddingStart"
+    android:paddingEnd="?android:attr/listPreferredItemPaddingEnd"
+    android:background="?android:attr/selectableItemBackground">
+
+    <ImageView
+        android:id="@+id/icon"
+        android:layout_width="48dp"
+        android:layout_height="48dp"
+        android:layout_marginEnd="12dip"
+        android:padding="2dp"
+        android:scaleType="centerInside"
+        android:layout_gravity="center" />
+
+    <RelativeLayout
+        android:layout_width="wrap_content"
+        android:layout_height="wrap_content"
+        android:layout_marginStart="2dip"
+        android:layout_marginEnd="6dip"
+        android:layout_marginTop="6dip"
+        android:layout_marginBottom="6dip"
+        android:layout_weight="1">
+
+        <TextView android:id="@+id/title"
+            android:layout_width="wrap_content"
+            android:layout_height="wrap_content"
+            android:singleLine="true"
+            android:textAppearance="?android:attr/textAppearanceListItem"
+            android:textColor="?android:attr/textColorPrimary"
+            android:ellipsize="marquee"
+            android:fadingEdge="horizontal" />
+
+    </RelativeLayout>
+
+</LinearLayout>
diff --git a/utils/omni_emulator/GoldfishParts/res/layout/preference_dialog_vibrator_strength.xml b/utils/omni_emulator/GoldfishParts/res/layout/preference_dialog_vibrator_strength.xml
new file mode 100644
index 0000000..0284852
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/layout/preference_dialog_vibrator_strength.xml
@@ -0,0 +1,38 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2016 The OmniROM 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.
+-->
+ <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
+        android:layout_width="match_parent"
+        android:layout_height="match_parent"
+        android:orientation="vertical"
+        android:gravity="center_horizontal"
+        android:padding="24dip">
+
+        <ImageView android:id="@android:id/icon"
+                android:layout_width="wrap_content"
+                android:layout_height="wrap_content"
+                android:visibility="gone"
+                android:contentDescription="@null" />
+
+        <SeekBar android:id="@*android:id/seekbar"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content" />
+
+        <Button android:id="@+id/vib_test"
+                android:layout_width="match_parent"
+                android:layout_height="wrap_content"
+                android:text="@string/vib_test"
+                android:layout_marginTop="10dip" />
+</LinearLayout>
diff --git a/utils/omni_emulator/GoldfishParts/res/values/arrays.xml b/utils/omni_emulator/GoldfishParts/res/values/arrays.xml
new file mode 100644
index 0000000..16ce0dd
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/values/arrays.xml
@@ -0,0 +1,34 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2017 The OmniROM 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>
+    <string-array name="slider_key_action_entries" translatable="false">
+        <item>@string/slider_mode_off</item>
+        <item>@string/slider_mode_vibrate</item>
+        <item>@string/slider_mode_silent</item>
+        <item>@string/slider_mode_priority</item>
+        <item>@string/slider_mode_alarm</item>
+        <item>@string/slider_mode_dnd</item>
+    </string-array>
+
+    <string-array name="slider_key_action_values" translatable="false">
+        <item>0</item>
+        <item>1</item>
+        <item>2</item>
+        <item>3</item>
+        <item>4</item>
+        <item>5</item>
+    </string-array>
+</resources>
diff --git a/utils/omni_emulator/GoldfishParts/res/values/config.xml b/utils/omni_emulator/GoldfishParts/res/values/config.xml
new file mode 100644
index 0000000..6cfe41f
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/values/config.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--  Copyright (C) 2016 The OmniROM Project
+
+  This program is free software: you can redistribute it and/or modify
+  it under the terms of the GNU General Public License as published by
+  the Free Software Foundation, either version 2 of the License, or
+  (at your option) any later version.
+
+  This program is distributed in the hope that it will be useful,
+  but WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  GNU General Public License for more details.
+
+  You should have received a copy of the GNU General Public License
+  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ -->
+
+<resources xmlns:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+    <bool name="config_has_oclick">false</bool>
+
+    <bool name="config_has_back_button">false</bool>
+
+</resources>
diff --git a/utils/omni_emulator/GoldfishParts/res/values/strings.xml b/utils/omni_emulator/GoldfishParts/res/values/strings.xml
new file mode 100644
index 0000000..e7d7d64
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/values/strings.xml
@@ -0,0 +1,69 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- Copyright (C) 2014-2017 The OmniROM 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>
+    <string name="app_name">Oneplus 3</string>
+    <string name="category_gestures_title">Off screen gestures</string>
+    <string name="category_vibrator">Vibrator</string>
+    <string name="vib_strength_title_head">Strength</string>
+    <string name="vib_strength_summary_head">Define the strength of the vibrator</string>
+    <string name="vib_test">Test</string>
+    <string name="advanced_settings">Advanced</string>
+    <string name="category_slider">Slider</string>
+    <string name="slider_mode_title">Slider mode</string>
+    <string name="buttons_title">Buttons</string>
+    <string name="swap_back_recents_summary"></string>
+    <string name="swap_back_recents_title">Swap back and recents button</string>
+    <string name="graphics_title">Graphics</string>
+    <string name="srgb_mode_summary"></string>
+    <string name="srgb_mode_title">sRGB mode</string>
+    <string name="hbm_mode_summary"></string>
+    <string name="hbm_mode_title">High brightness mode</string>
+    <string name="proxi_summary_head">Check proximity sensor for handling gesture and fingerprint sensor</string>
+    <string name="proxi_title_head">Proximity check</string>
+    <string name="slider_mode_off">Off</string>
+    <string name="slider_mode_vibrate">Vibrate</string>
+    <string name="slider_mode_silent">Silent</string>
+    <string name="slider_mode_priority">Priority only</string>
+    <string name="slider_mode_alarm">Alarms only</string>
+    <string name="slider_mode_dnd">Total silence</string>
+    <string name="slider_mode_title_top">Top position</string>
+    <string name="slider_mode_title_center">Center position</string>
+    <string name="slider_mode_title_bottom">Bottom position</string>
+    <string name="dci_mode_summary"></string>
+    <string name="dci_mode_title">Wide color gammut mode</string>
+
+    <string name="choose_app">Choose app</string>
+    <string name="category_double_swipe_gesture">II gesture</string>
+    <string name="gesture_app_title">Launch app</string>
+    <string name="category_circle_gesture">O gesture</string>
+    <string name="category_down_arrow_gesture">V gesture</string>
+    <string name="category_up_arrow_gesture">A gesture</string>
+    <string name="category_left_arrow_gesture">&lt; gesture</string>
+    <string name="category_right_arrow_gesture">&gt; gesture</string>
+    <string name="category_gestures_summary">Configure off screen gesture actions</string>
+    <string name="torch_entry">Flashlight</string>
+    <string name="disabled_entry">Disabled</string>
+    <string name="camera_entry">Camera</string>
+    <string name="music_play_entry">Play / pause music</string>
+    <string name="music_prev_entry">Prev track</string>
+    <string name="music_next_entry">Next track</string>
+    <string name="not_ready_summary">Resolving...</string>
+    <string name="resolve_failed_summary">Resolving app failed</string>
+    <string name="category_down_swipe_gesture">Down swipe</string>
+    <string name="category_up_swipe_gesture">Up swipe</string>
+    <string name="category_left_swipe_gesture">Left swipe</string>
+    <string name="category_right_swipe_gesture">Right swipe</string>
+</resources>
diff --git a/utils/omni_emulator/GoldfishParts/res/xml/main.xml b/utils/omni_emulator/GoldfishParts/res/xml/main.xml
new file mode 100644
index 0000000..b28c71b
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/res/xml/main.xml
@@ -0,0 +1,18 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!-- Copyright (C) 2014-2016 The OmniROM 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.
+-->
+<PreferenceScreen xmlns:android="http://schemas.android.com/apk/res/android">
+
+</PreferenceScreen>
diff --git a/utils/omni_emulator/GoldfishParts/src/org/omnirom/device/DeviceSettings.java b/utils/omni_emulator/GoldfishParts/src/org/omnirom/device/DeviceSettings.java
new file mode 100644
index 0000000..e8a7f19
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/src/org/omnirom/device/DeviceSettings.java
@@ -0,0 +1,35 @@
+/*
+* Copyright (C) 2016 The OmniROM Project
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+package org.omnirom.device;
+
+import android.content.res.Resources;
+import android.content.Intent;
+import android.os.Bundle;
+import android.preference.Preference;
+import android.preference.PreferenceActivity;
+
+public class DeviceSettings extends PreferenceActivity {
+
+    @Override
+    public void onCreate(Bundle savedInstanceState) {
+        super.onCreate(savedInstanceState);
+        getActionBar().setDisplayHomeAsUpEnabled(true);
+
+        addPreferencesFromResource(R.xml.main);
+    }
+}
diff --git a/utils/omni_emulator/GoldfishParts/src/org/omnirom/device/KeyHandler.java b/utils/omni_emulator/GoldfishParts/src/org/omnirom/device/KeyHandler.java
new file mode 100644
index 0000000..e6b562a
--- /dev/null
+++ b/utils/omni_emulator/GoldfishParts/src/org/omnirom/device/KeyHandler.java
@@ -0,0 +1,71 @@
+/*
+* Copyright (C) 2015 The OmniROM Project
+*
+* This program is free software: you can redistribute it and/or modify
+* it under the terms of the GNU General Public License as published by
+* the Free Software Foundation, either version 2 of the License, or
+* (at your option) any later version.
+*
+* This program is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+* GNU General Public License for more details.
+*
+* You should have received a copy of the GNU General Public License
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
+*
+*/
+package org.omnirom.device;
+
+import android.content.Context;
+import android.content.Intent;
+import android.util.Log;
+import android.view.KeyEvent;
+
+import com.android.internal.util.omni.DeviceKeyHandler;
+
+public class KeyHandler implements DeviceKeyHandler {
+
+    private static final String TAG = KeyHandler.class.getSimpleName();
+    private static final boolean DEBUG = true;
+
+    public KeyHandler(Context context) {
+        if (DEBUG) Log.i(TAG, "KeyHandler");
+    }
+
+    @Override
+    public boolean handleKeyEvent(KeyEvent event) {
+        if (DEBUG) Log.i(TAG, "scanCode=" + event.getScanCode());
+        return false;
+    }
+
+    @Override
+    public boolean canHandleKeyEvent(KeyEvent event) {
+        if (DEBUG) Log.i(TAG, "canHandleKeyEvent=" + event.getScanCode());
+        return false;
+    }
+
+    @Override
+    public boolean isDisabledKeyEvent(KeyEvent event) {
+        if (DEBUG) Log.i(TAG, "isDisabledKeyEvent=" + event.getScanCode());
+        return false;
+    }
+
+    @Override
+    public boolean isCameraLaunchEvent(KeyEvent event) {
+        if (DEBUG) Log.i(TAG, "isCameraLaunchEvent=" + event.getScanCode());
+        return false;
+    }
+
+    @Override
+    public boolean isWakeEvent(KeyEvent event){
+        if (DEBUG) Log.i(TAG, "isWakeEvent=" + event.getScanCode());
+        return false;
+    }
+
+    @Override
+    public Intent isActivityLaunchEvent(KeyEvent event) {
+        if (DEBUG) Log.i(TAG, "isActivityLaunchEvent=" + event.getScanCode());
+        return null;
+    }
+}
diff --git a/utils/omni_emulator/README b/utils/omni_emulator/README
new file mode 100644
index 0000000..b3e17a0
--- /dev/null
+++ b/utils/omni_emulator/README
@@ -0,0 +1,8 @@
+Precondition: android SDK must be installed in ~/Android/SDK
+
+lunch omni_emulator-userdebug
+make
+vendor/omni/utils/emulator/create_emulator_image.sh
+cp /tmp/omni_emulator.zip to the device where you have installed android SDK
+unzip into /tmp
+run /tmp/generic_x86/start_emulator_image.sh
diff --git a/utils/omni_emulator/common.mk b/utils/omni_emulator/common.mk
new file mode 100644
index 0000000..540e0be
--- /dev/null
+++ b/utils/omni_emulator/common.mk
@@ -0,0 +1,74 @@
+PRODUCT_BRAND ?= omni
+
+# use specific resolution for bootanimation
+ifneq ($(TARGET_BOOTANIMATION_SIZE),)
+PRODUCT_COPY_FILES += \
+    vendor/omni/prebuilt/bootanimation/res/$(TARGET_BOOTANIMATION_SIZE).zip:system/media/bootanimation.zip
+else
+PRODUCT_COPY_FILES += \
+    vendor/omni/prebuilt/bootanimation/bootanimation.zip:system/media/bootanimation.zip
+endif
+
+ifeq ($(PRODUCT_GMS_CLIENTID_BASE),)
+OMNI_PRODUCT_PROPERTIES += \
+    ro.com.google.clientidbase=android-google
+else
+OMNI_PRODUCT_PROPERTIES += \
+    ro.com.google.clientidbase=$(PRODUCT_GMS_CLIENTID_BASE)
+endif
+
+# general properties
+OMNI_PRODUCT_PROPERTIES += \
+    ro.url.legal=http://www.google.com/intl/%s/mobile/android/basic/phone-legal.html \
+    ro.com.android.wifi-watchlist=GoogleGuest \
+    ro.setupwizard.enterprise_mode=1 \
+    ro.build.selinux=1
+
+# Backup Tool
+PRODUCT_COPY_FILES += \
+    vendor/omni/prebuilt/bin/backuptool.sh:system/bin/backuptool.sh \
+    vendor/omni/prebuilt/bin/backuptool.functions:system/bin/backuptool.functions \
+    vendor/omni/prebuilt/bin/50-hosts.sh:system/addon.d/50-hosts.sh \
+    vendor/omni/prebuilt/bin/blacklist:system/addon.d/blacklist
+
+# Backup Services whitelist
+PRODUCT_COPY_FILES += \
+    vendor/omni/prebuilt/etc/sysconfig/backup.xml:system/etc/sysconfig/backup.xml
+
+# Init script file with omni extras
+PRODUCT_COPY_FILES += \
+    vendor/omni/prebuilt/etc/init.local.rc:root/init.omni.rc
+
+# permissions
+PRODUCT_COPY_FILES += \
+    frameworks/native/data/etc/android.software.sip.voip.xml:system/etc/permissions/android.software.sip.voip.xml \
+    vendor/omni/prebuilt/etc/permissions/privapp-permissions-omni.xml:system/etc/permissions/privapp-permissions-omni.xml
+
+# custom omni sounds
+OMNI_PRODUCT_PROPERTIES += \
+    ro.config.ringtone=omni_ringtone1.ogg \
+    ro.config.notification_sound=omni_notification1.ogg \
+    ro.config.alarm_alert=omni_alarm1.ogg
+
+PRODUCT_COPY_FILES += \
+    vendor/omni/prebuilt/sounds/camera_click_48k.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/camera_click.ogg \
+    vendor/omni/prebuilt/sounds/VideoRecord_48k.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/VideoRecord.ogg \
+    vendor/omni/prebuilt/sounds/VideoStop_48k.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/VideoStop.ogg \
+    vendor/omni/prebuilt/sounds/omni_ringtone1.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ringtones/omni_ringtone1.ogg \
+    vendor/omni/prebuilt/sounds/omni_ringtone2.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ringtones/omni_ringtone2.ogg \
+    vendor/omni/prebuilt/sounds/omni_ringtone3.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ringtones/omni_ringtone3.ogg \
+    vendor/omni/prebuilt/sounds/omni_alarm1.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/omni_alarm1.ogg \
+    vendor/omni/prebuilt/sounds/omni_alarm2.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/alarms/omni_alarm2.ogg \
+    vendor/omni/prebuilt/sounds/omni_notification1.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/notifications/omni_notification1.ogg \
+    vendor/omni/prebuilt/sounds/omni_lowbattery1.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/omni_lowbattery1.ogg \
+    vendor/omni/prebuilt/sounds/omni_lock_phone.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/omni_lock_phone.ogg \
+    vendor/omni/prebuilt/sounds/omni_unlock_phone.ogg:$(TARGET_COPY_OUT_PRODUCT)/media/audio/ui/omni_unlock_phone.ogg
+
+# Additional packages
+-include vendor/omni/utils/omni_emulator/packages.mk
+
+# Versioning
+-include vendor/omni/config/version.mk
+
+# Add our overlays
+DEVICE_PACKAGE_OVERLAYS += vendor/omni/overlay/common
\ No newline at end of file
diff --git a/utils/omni_emulator/create_emulator_image.sh b/utils/omni_emulator/create_emulator_image.sh
new file mode 100755
index 0000000..f563ad6
--- /dev/null
+++ b/utils/omni_emulator/create_emulator_image.sh
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+if [ -z $ANDROID_BUILD_TOP ]; then
+    echo $ANDROID_BUILD_TOP undefined
+    exit 1
+fi
+
+if [ -z $ANDROID_PRODUCT_OUT ]; then
+    echo $ANDROID_PRODUCT_OUT undefined
+    exit 1
+fi
+
+if [ ! -f $ANDROID_PRODUCT_OUT/system.img ]; then
+    echo "Please build before running this"
+    exit 1
+fi
+
+# creates image zip in /tmp/
+cd $ANDROID_PRODUCT_OUT/..
+DIGEST=`grep "# " $TARGET_PRODUCT/VerifiedBootParams.textproto| sed -e 's/# //'`
+
+cd $ANDROID_BUILD_TOP
+cp -r vendor/omni/utils/$TARGET_PRODUCT/skins $ANDROID_PRODUCT_OUT
+cat vendor/omni/utils/$TARGET_PRODUCT/start_emulator_image.sh | sed -e "s/vbmeta/$DIGEST/" > $ANDROID_PRODUCT_OUT/start_emulator_image.sh
+chmod 755 $ANDROID_PRODUCT_OUT/start_emulator_image.sh
+cp device/generic/goldfish/data/etc/advancedFeatures.ini $ANDROID_PRODUCT_OUT
+
+cd $ANDROID_PRODUCT_OUT/..
+rm /tmp/omni_emulator.zip
+zip -r /tmp/omni_emulator.zip $TARGET_PRODUCT/skins $TARGET_PRODUCT/system-qemu.img $TARGET_PRODUCT/system/build.prop $TARGET_PRODUCT/cache.img $TARGET_PRODUCT/userdata.img $TARGET_PRODUCT/start_emulator_image.sh $TARGET_PRODUCT/advancedFeatures.ini $TARGET_PRODUCT/encryptionkey.img $TARGET_PRODUCT/kernel-ranchu-64 $TARGET_PRODUCT/ramdisk.img $TARGET_PRODUCT/vendor-qemu.img
diff --git a/utils/omni_emulator/fstab.ranchu b/utils/omni_emulator/fstab.ranchu
new file mode 100644
index 0000000..4a5f002
--- /dev/null
+++ b/utils/omni_emulator/fstab.ranchu
@@ -0,0 +1,6 @@
+# Android fstab file.
+#<dev>  <mnt_point> <type>  <mnt_flags options> <fs_mgr_flags>
+system   /system     ext4    ro,barrier=1     wait,logical,avb=vbmeta,first_stage_mount
+vendor   /vendor     ext4    ro,barrier=1     wait,logical,first_stage_mount
+/dev/block/vdc   /data     ext4      noatime,nosuid,nodev,nomblk_io_submit,errors=panic   wait,check,quota,fileencryption=aes-256-xts:aes-256-cts,reservedsize=128M
+/devices/*/block/vdf auto   auto      defaults    voldmanaged=sdcard:auto,encryptable=userdata
diff --git a/utils/omni_emulator/fstab.ranchu.initrd b/utils/omni_emulator/fstab.ranchu.initrd
new file mode 100644
index 0000000..e792feb
--- /dev/null
+++ b/utils/omni_emulator/fstab.ranchu.initrd
@@ -0,0 +1,4 @@
+# Android fstab file for ramdisk
+#<dev>  <mnt_point> <type>  <mnt_flags options> <fs_mgr_flags>
+system   /system     ext4    ro,barrier=1     wait,logical,avb=vbmeta,first_stage_mount
+vendor   /vendor     ext4    ro,barrier=1     wait,logical,first_stage_mount
diff --git a/utils/omni_emulator/omni.dependencies b/utils/omni_emulator/omni.dependencies
new file mode 100644
index 0000000..11bc1ae
--- /dev/null
+++ b/utils/omni_emulator/omni.dependencies
@@ -0,0 +1,38 @@
+[
+  {
+    "remote": "aosp",
+    "repository": "device/generic/common",
+    "target_path": "device/generic/common",
+    "revision": "refs/tags/android-10.0.0_r14"
+  },
+  {
+    "remote": "aosp",
+    "repository": "device/generic/goldfish",
+    "target_path": "device/generic/goldfish",
+    "revision": "refs/tags/android-10.0.0_r14"
+  },
+  {
+    "remote": "aosp",
+    "repository": "device/generic/goldfish-opengl",
+    "target_path": "device/generic/goldfish-opengl",
+    "revision": "refs/tags/android-10.0.0_r14"
+  },
+  {
+    "remote": "aosp",
+    "repository": "device/generic/opengl-transport",
+    "target_path": "device/generic/opengl-transport",
+    "revision": "refs/tags/android-10.0.0_r14"
+  },
+  {
+    "remote": "aosp",
+    "repository": "device/generic/trusty",
+    "target_path": "device/generic/trusty",
+    "revision": "refs/tags/android-10.0.0_r14"
+  },
+  {
+    "remote": "aosp",
+    "repository": "device/generic/uml",
+    "target_path": "device/generic/uml",
+    "revision": "refs/tags/android-10.0.0_r14"
+  }
+]
diff --git a/utils/omni_emulator/omni_emulator.mk b/utils/omni_emulator/omni_emulator.mk
new file mode 100644
index 0000000..a832b51
--- /dev/null
+++ b/utils/omni_emulator/omni_emulator.mk
@@ -0,0 +1,24 @@
+PRODUCT_COPY_FILES += \
+    vendor/omni/utils/omni_emulator/fstab.ranchu.initrd:$(TARGET_COPY_OUT_RAMDISK)/fstab.ranchu \
+    vendor/omni/utils/omni_emulator/fstab.ranchu:$(TARGET_COPY_OUT_VENDOR)/etc/fstab.ranchu \
+    vendor/omni/prebuilt/etc/apns-conf.xml:system/etc/apns-conf.xml
+
+PRODUCT_USE_DYNAMIC_PARTITIONS := true
+TARGET_NO_VENDOR_BOOT := true
+
+$(call inherit-product, $(SRC_TARGET_DIR)/product/sdk_x86.mk)
+
+$(call inherit-product, vendor/omni/config/gsm.mk)
+
+$(call inherit-product, vendor/omni/utils/omni_emulator/common.mk)
+
+QEMU_USE_SYSTEM_EXT_PARTITIONS := false
+
+# Override product naming for Omni
+PRODUCT_NAME := omni_emulator
+PRODUCT_MANUFACTURER := OmniROM
+PRODUCT_DEVICE := omni_emulator
+
+DEVICE_PACKAGE_OVERLAYS += vendor/omni/utils/omni_emulator/overlay
+
+ALLOW_MISSING_DEPENDENCIES := true 
diff --git a/utils/omni_emulator/overlay/frameworks/base/core/res/res/values/config.xml b/utils/omni_emulator/overlay/frameworks/base/core/res/res/values/config.xml
new file mode 100644
index 0000000..f77a3aa
--- /dev/null
+++ b/utils/omni_emulator/overlay/frameworks/base/core/res/res/values/config.xml
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+/*
+** Copyright 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:xliff="urn:oasis:names:tc:xliff:document:1.2">
+
+    <bool name="config_dozeAlwaysOnDisplayAvailable">true</bool>
+    <bool name="config_dozeAlwaysOnEnabled">false</bool>
+    <string name="config_dozeComponent">com.android.systemui/com.android.systemui.doze.DozeService</string>
+    <!--<string name="config_mainBuiltInDisplayCutout">M 0,0 L -183, 0 A 24.0, 24.0, 0, 0, 1, -159.0, 22.0 A 64.0, 64.0, 0, 0, 0, -95.0, 80.0 L 95.0, 80.0 A 64.0, 64.0, 0, 0, 0, 159.0, 22.0 A 24.0, 24.0, 0, 0, 1, 183.0, 0 Z</string>-->
+    <!--<string name="config_mainBuiltInDisplayCutout">M -683,0 L -416,0 L -416,116 L -683,116 Z</string>-->
+    
+    <!-- Whether the display cutout region of the main built-in display should be forced to
+    black in software (to avoid aliasing or emulate a cutout that is not physically existent).
+    -->
+    <!--<bool name="config_fillMainBuiltInDisplayCutout">true</bool>-->
+    <bool name="config_intrusiveNotificationLed">false</bool>
+    <bool name="config_intrusiveBatteryLed">false</bool>
+
+    <integer name="config_screenBrightnessPulse">42</integer>
+
+</resources>
diff --git a/utils/omni_emulator/overlay/frameworks/base/packages/SystemUI/res/values-sw372dp/dimens.xml b/utils/omni_emulator/overlay/frameworks/base/packages/SystemUI/res/values-sw372dp/dimens.xml
new file mode 100644
index 0000000..5a90f20
--- /dev/null
+++ b/utils/omni_emulator/overlay/frameworks/base/packages/SystemUI/res/values-sw372dp/dimens.xml
@@ -0,0 +1,24 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!--
+* Copyright (c) 2006, 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>
+    
+    <dimen name="rounded_corner_radius">16dp</dimen>
+    <dimen name="rounded_corner_content_padding">8dp</dimen>
+    <dimen name="nav_content_padding">8dp</dimen>
+
+</resources>
diff --git a/utils/omni_emulator/packages.mk b/utils/omni_emulator/packages.mk
new file mode 100644
index 0000000..efa1378
--- /dev/null
+++ b/utils/omni_emulator/packages.mk
@@ -0,0 +1,53 @@
+# Additional apps
+PRODUCT_PACKAGES += \
+    MonthCalendarWidget \
+    OmniSwitch \
+    OmniJaws \
+    MatLog \
+    OmniChange \
+    OmniStyle \
+    SystemWebView \
+    Terminal
+
+ifneq ($(PRODUCT_EXCLUDE_EXTRA_PACKAGES),true)
+PRODUCT_PACKAGES += \
+    ChromeModernPublic \
+    ExactCalculator \
+    MusicFX \
+    Phonograph
+else
+PRODUCT_PACKAGES += \
+    OmniStoreInstaller
+endif
+
+#PRODUCT_PACKAGES += \
+    GoldfishParts \
+    OmniOverlayStub \
+    omni-overlays \
+    OpenDelta \
+    ThemePicker \
+
+# Additional tools
+PRODUCT_PACKAGES += \
+    bash \
+    htop \
+    vim
+
+# Telephony extension
+#PRODUCT_PACKAGES += telephony-ext
+#PRODUCT_BOOT_JARS += telephony-ext
+
+#PRODUCT_PACKAGES += \
+    ims-ext-common \
+    ims_ext_common.xml \
+    qti-telephony-hidl-wrapper \
+    qti_telephony_hidl_wrapper.xml \
+    qti-telephony-utils \
+    qti_telephony_utils.xml
+
+# for fun
+#PRODUCT_PACKAGES += \
+    EggGame
+
+$(call inherit-product-if-exists, external/google-fonts/lato/fonts.mk)
+$(call inherit-product-if-exists, vendor/omni/prebuilt/fonts/fonts.mk)
diff --git a/utils/omni_emulator/skins/pixel_2_xl/hardware.ini b/utils/omni_emulator/skins/pixel_2_xl/hardware.ini
new file mode 100644
index 0000000..4b7959e
--- /dev/null
+++ b/utils/omni_emulator/skins/pixel_2_xl/hardware.ini
@@ -0,0 +1,44 @@
+hw.cpu.arch = x86
+hw.cpu.model = qemu32
+hw.cpu.ncore = 2
+hw.ramSize = 1536
+hw.screen = multi-touch
+hw.mainKeys = false
+hw.trackBall = false
+hw.keyboard = true
+hw.keyboard.lid = false
+hw.keyboard.charmap = qwerty2
+hw.dPad = false
+hw.rotaryInput = false
+hw.gsmModem = true
+hw.gps = true
+hw.battery = true
+hw.accelerometer = true
+hw.gyroscope = true
+hw.audioInput = true
+hw.audioOutput = true
+hw.sdCard = false
+hw.lcd.width = 1440
+hw.lcd.height = 2880
+hw.lcd.depth = 16
+hw.lcd.density = 560
+hw.lcd.backlight = true
+hw.gpu.enabled = true
+hw.gpu.mode = host
+hw.gpu.blacklisted = no
+hw.initialOrientation = Portrait
+hw.camera.back = virtualscene
+hw.camera.front = emulated
+vm.heapSize = 384
+hw.sensors.light = true
+hw.sensors.pressure = true
+hw.sensors.humidity = true
+hw.sensors.proximity = true
+hw.sensors.magnetic_field = true
+hw.sensors.magnetic_field_uncalibrated = true
+hw.sensors.gyroscope_uncalibrated = true
+hw.sensors.orientation = true
+hw.sensors.temperature = true
+hw.useext4 = true
+hw.arc = false
+hw.arc.autologin = false
diff --git a/utils/omni_emulator/skins/pixel_2_xl/land_back.webp b/utils/omni_emulator/skins/pixel_2_xl/land_back.webp
new file mode 100644
index 0000000..45de491
--- /dev/null
+++ b/utils/omni_emulator/skins/pixel_2_xl/land_back.webp
Binary files differ
diff --git a/utils/omni_emulator/skins/pixel_2_xl/land_fore.webp b/utils/omni_emulator/skins/pixel_2_xl/land_fore.webp
new file mode 100644
index 0000000..7ee7fe9
--- /dev/null
+++ b/utils/omni_emulator/skins/pixel_2_xl/land_fore.webp
Binary files differ
diff --git a/utils/omni_emulator/skins/pixel_2_xl/land_shadow.webp b/utils/omni_emulator/skins/pixel_2_xl/land_shadow.webp
new file mode 100644
index 0000000..0db57b3
--- /dev/null
+++ b/utils/omni_emulator/skins/pixel_2_xl/land_shadow.webp
Binary files differ
diff --git a/utils/omni_emulator/skins/pixel_2_xl/layout b/utils/omni_emulator/skins/pixel_2_xl/layout
new file mode 100644
index 0000000..abd5cd8
--- /dev/null
+++ b/utils/omni_emulator/skins/pixel_2_xl/layout
@@ -0,0 +1,59 @@
+parts {
+  device {
+    display {
+      width 1440
+      height 2880
+      x 0
+      y 0
+    }
+  }
+  portrait {
+    background {
+      image port_back.webp
+    }
+    onion {
+      image port_fore.webp
+    }
+  }
+  landscape {
+    background {
+      image land_back.webp
+    }
+    onion {
+      image land_fore.webp
+    }
+  }
+}
+layouts {
+  portrait {
+    width 1858
+    height 3456
+    event EV_SW:0:1
+    part1 {
+      name portrait
+      x 0
+      y 0
+    }
+    part2 {
+      name device
+      x 201
+      y 245
+    }
+  }
+  landscape {
+    width 3477
+    height 1754
+    event EV_SW:0:0
+    part1 {
+      name landscape
+      x 0
+      y 0
+    }
+    part2 {
+      name device
+      x 305
+      y 108
+      rotation 3
+    }
+  }
+}
diff --git a/utils/omni_emulator/skins/pixel_2_xl/port_back.webp b/utils/omni_emulator/skins/pixel_2_xl/port_back.webp
new file mode 100644
index 0000000..914325d
--- /dev/null
+++ b/utils/omni_emulator/skins/pixel_2_xl/port_back.webp
Binary files differ
diff --git a/utils/omni_emulator/skins/pixel_2_xl/port_fore.webp b/utils/omni_emulator/skins/pixel_2_xl/port_fore.webp
new file mode 100644
index 0000000..bdc562f
--- /dev/null
+++ b/utils/omni_emulator/skins/pixel_2_xl/port_fore.webp
Binary files differ
diff --git a/utils/omni_emulator/skins/pixel_2_xl/port_shadow.webp b/utils/omni_emulator/skins/pixel_2_xl/port_shadow.webp
new file mode 100644
index 0000000..0009913
--- /dev/null
+++ b/utils/omni_emulator/skins/pixel_2_xl/port_shadow.webp
Binary files differ
diff --git a/utils/omni_emulator/skins/pixel_xl/hardware.ini b/utils/omni_emulator/skins/pixel_xl/hardware.ini
new file mode 100644
index 0000000..eeaae5c
--- /dev/null
+++ b/utils/omni_emulator/skins/pixel_xl/hardware.ini
@@ -0,0 +1,51 @@
+hw.cpu.arch = x86
+hw.cpu.model = qemu32
+hw.cpu.ncore = 2
+hw.ramSize = 1536
+hw.screen = multi-touch
+hw.mainKeys = false
+hw.trackBall = false
+hw.keyboard = true
+hw.keyboard.lid = false
+hw.keyboard.charmap = qwerty2
+hw.dPad = false
+hw.rotaryInput = false
+hw.gsmModem = true
+hw.gps = true
+hw.battery = true
+hw.accelerometer = true
+hw.gyroscope = true
+hw.audioInput = true
+hw.audioOutput = true
+hw.lcd.width = 1440
+hw.lcd.height = 2560
+hw.lcd.depth = 16
+hw.lcd.density = 560
+hw.lcd.backlight = true
+hw.gpu.enabled = true
+hw.gpu.mode = host
+hw.gpu.blacklisted = no
+hw.initialOrientation = Portrait
+hw.camera.back = emulated
+hw.camera.front = emulated
+vm.heapSize = 384
+hw.sensors.light = true
+hw.sensors.pressure = true
+hw.sensors.humidity = true
+hw.sensors.proximity = true
+hw.sensors.magnetic_field = true
+hw.sensors.magnetic_field_uncalibrated = true
+hw.sensors.gyroscope_uncalibrated = true
+hw.sensors.orientation = true
+hw.sensors.temperature = true
+hw.useext4 = true
+kernel.newDeviceNaming = yes
+kernel.supportsYaffs2 = no
+disk.vendorPartition.size = 0
+hw.sensors.magnetic_field_uncalibrated = true
+hw.sensors.gyroscope_uncalibrated = true
+hw.sdCard = false
+hw.gyroscope = true
+runtime.network.latency=none
+runtime.network.speed=full
+
diff --git a/utils/omni_emulator/skins/pixel_xl/land_back.webp b/utils/omni_emulator/skins/pixel_xl/land_back.webp
new file mode 100644
index 0000000..5c5ee80
--- /dev/null
+++ b/utils/omni_emulator/skins/pixel_xl/land_back.webp
Binary files differ
diff --git a/utils/omni_emulator/skins/pixel_xl/land_fore.webp b/utils/omni_emulator/skins/pixel_xl/land_fore.webp
new file mode 100644
index 0000000..ca70d12
--- /dev/null
+++ b/utils/omni_emulator/skins/pixel_xl/land_fore.webp
Binary files differ
diff --git a/utils/omni_emulator/skins/pixel_xl/land_shadow.webp b/utils/omni_emulator/skins/pixel_xl/land_shadow.webp
new file mode 100644
index 0000000..1718061
--- /dev/null
+++ b/utils/omni_emulator/skins/pixel_xl/land_shadow.webp
Binary files differ
diff --git a/utils/omni_emulator/skins/pixel_xl/layout b/utils/omni_emulator/skins/pixel_xl/layout
new file mode 100644
index 0000000..debc6f7
--- /dev/null
+++ b/utils/omni_emulator/skins/pixel_xl/layout
@@ -0,0 +1,59 @@
+parts {
+  device {
+    display {
+      width 1440
+      height 2560
+      x 0
+      y 0
+    }
+  }
+  portrait {
+    background {
+      image port_back.webp
+    }
+    onion {
+      image port_fore.webp
+    }
+  }
+  landscape {
+    background {
+      image land_back.webp
+    }
+    onion {
+      image land_fore.webp
+    }
+  }
+}
+layouts {
+  portrait {
+    width 1840
+    height 3297
+    event EV_SW:0:1
+    part1 {
+      name portrait
+      x 0
+      y 0
+    }
+    part2 {
+      name device
+      x 200
+      y 325
+    }
+  }
+  landscape {
+    width 3427
+    height 1654
+    event EV_SW:0:0
+    part1 {
+      name landscape
+      x 0
+      y 0
+    }
+    part2 {
+      name device
+      x 393
+      y 1532
+      rotation 3
+    }
+  }
+}
diff --git a/utils/omni_emulator/skins/pixel_xl/port_back.webp b/utils/omni_emulator/skins/pixel_xl/port_back.webp
new file mode 100644
index 0000000..4020161
--- /dev/null
+++ b/utils/omni_emulator/skins/pixel_xl/port_back.webp
Binary files differ
diff --git a/utils/omni_emulator/skins/pixel_xl/port_fore.webp b/utils/omni_emulator/skins/pixel_xl/port_fore.webp
new file mode 100644
index 0000000..f010e9c
--- /dev/null
+++ b/utils/omni_emulator/skins/pixel_xl/port_fore.webp
Binary files differ
diff --git a/utils/omni_emulator/skins/pixel_xl/port_shadow.webp b/utils/omni_emulator/skins/pixel_xl/port_shadow.webp
new file mode 100644
index 0000000..c82477a
--- /dev/null
+++ b/utils/omni_emulator/skins/pixel_xl/port_shadow.webp
Binary files differ
diff --git a/utils/omni_emulator/start_emulator_image.sh b/utils/omni_emulator/start_emulator_image.sh
new file mode 100755
index 0000000..fc63b0c
--- /dev/null
+++ b/utils/omni_emulator/start_emulator_image.sh
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+export ANDROID_BUILD_TOP=`pwd`
+export ANDROID_PRODUCT_OUT=`pwd`
+
+# -show-kernel
+
+$HOME/Android/Sdk/emulator/emulator -show-kernel -verbose -skindir $ANDROID_BUILD_TOP/skins/ -skin pixel_2_xl -gpu host -writable-system -qemu -cpu qemu64 -append "vbmeta"