vendor: helpers for creating bliss emulator builds
Precondition: android SDK must be installed in ~/Android/SDK
lunch bliss_emulator-userdebug
make
if you want to run on the same host
vendor/bliss/utils/emulator/start_emulator_local.sh
if you need to copy on a different host
vendor/bliss/utils/emulator/create_emulator_image.sh
cp /tmp/bliss_emulator.zip to the device where you have installed android SDK
unzip into /tmp
run /tmp/generic_x86/start_emulator_image.sh
Change-Id: I1b2abeb769a21d2da21e058d9767974cad99bed7
diff --git a/utils/emulator/Android.mk b/utils/emulator/Android.mk
new file mode 100644
index 0000000..20bfbaf
--- /dev/null
+++ b/utils/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/emulator/GoldfishParts/Android.mk b/utils/emulator/GoldfishParts/Android.mk
new file mode 100644
index 0000000..29c3764
--- /dev/null
+++ b/utils/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/emulator/GoldfishParts/AndroidManifest.xml b/utils/emulator/GoldfishParts/AndroidManifest.xml
new file mode 100644
index 0000000..2cf898d
--- /dev/null
+++ b/utils/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.bliss.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.bliss.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/emulator/GoldfishParts/res/drawable-hdpi/ic_launcher.png b/utils/emulator/GoldfishParts/res/drawable-hdpi/ic_launcher.png
new file mode 100644
index 0000000..1e6b480
--- /dev/null
+++ b/utils/emulator/GoldfishParts/res/drawable-hdpi/ic_launcher.png
Binary files differ
diff --git a/utils/emulator/GoldfishParts/res/drawable-mdpi/ic_launcher.png b/utils/emulator/GoldfishParts/res/drawable-mdpi/ic_launcher.png
new file mode 100644
index 0000000..89d59c6
--- /dev/null
+++ b/utils/emulator/GoldfishParts/res/drawable-mdpi/ic_launcher.png
Binary files differ
diff --git a/utils/emulator/GoldfishParts/res/drawable-xhdpi/ic_launcher.png b/utils/emulator/GoldfishParts/res/drawable-xhdpi/ic_launcher.png
new file mode 100644
index 0000000..6445baa
--- /dev/null
+++ b/utils/emulator/GoldfishParts/res/drawable-xhdpi/ic_launcher.png
Binary files differ
diff --git a/utils/emulator/GoldfishParts/res/drawable-xxhdpi/ic_launcher.png b/utils/emulator/GoldfishParts/res/drawable-xxhdpi/ic_launcher.png
new file mode 100644
index 0000000..2a5bb38
--- /dev/null
+++ b/utils/emulator/GoldfishParts/res/drawable-xxhdpi/ic_launcher.png
Binary files differ
diff --git a/utils/emulator/GoldfishParts/res/drawable/ic_camera.xml b/utils/emulator/GoldfishParts/res/drawable/ic_camera.xml
new file mode 100644
index 0000000..8294f4b
--- /dev/null
+++ b/utils/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/emulator/GoldfishParts/res/drawable/ic_disabled.xml b/utils/emulator/GoldfishParts/res/drawable/ic_disabled.xml
new file mode 100644
index 0000000..1c5152b
--- /dev/null
+++ b/utils/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/emulator/GoldfishParts/res/drawable/ic_flashlight.xml b/utils/emulator/GoldfishParts/res/drawable/ic_flashlight.xml
new file mode 100644
index 0000000..213a7f6
--- /dev/null
+++ b/utils/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/emulator/GoldfishParts/res/drawable/ic_music_next.xml b/utils/emulator/GoldfishParts/res/drawable/ic_music_next.xml
new file mode 100644
index 0000000..baad21d
--- /dev/null
+++ b/utils/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/emulator/GoldfishParts/res/drawable/ic_music_play.xml b/utils/emulator/GoldfishParts/res/drawable/ic_music_play.xml
new file mode 100644
index 0000000..d8c3ba8
--- /dev/null
+++ b/utils/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/emulator/GoldfishParts/res/drawable/ic_music_prev.xml b/utils/emulator/GoldfishParts/res/drawable/ic_music_prev.xml
new file mode 100644
index 0000000..199fcd1
--- /dev/null
+++ b/utils/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/emulator/GoldfishParts/res/layout/applist_preference.xml b/utils/emulator/GoldfishParts/res/layout/applist_preference.xml
new file mode 100644
index 0000000..62c9137
--- /dev/null
+++ b/utils/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/emulator/GoldfishParts/res/layout/applist_preference_icon.xml b/utils/emulator/GoldfishParts/res/layout/applist_preference_icon.xml
new file mode 100644
index 0000000..1d6425d
--- /dev/null
+++ b/utils/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/emulator/GoldfishParts/res/layout/preference_dialog_vibrator_strength.xml b/utils/emulator/GoldfishParts/res/layout/preference_dialog_vibrator_strength.xml
new file mode 100644
index 0000000..0284852
--- /dev/null
+++ b/utils/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/emulator/GoldfishParts/res/values/arrays.xml b/utils/emulator/GoldfishParts/res/values/arrays.xml
new file mode 100644
index 0000000..16ce0dd
--- /dev/null
+++ b/utils/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/emulator/GoldfishParts/res/values/config.xml b/utils/emulator/GoldfishParts/res/values/config.xml
new file mode 100644
index 0000000..6cfe41f
--- /dev/null
+++ b/utils/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/emulator/GoldfishParts/res/values/strings.xml b/utils/emulator/GoldfishParts/res/values/strings.xml
new file mode 100644
index 0000000..e7d7d64
--- /dev/null
+++ b/utils/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">< gesture</string>
+ <string name="category_right_arrow_gesture">> 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/emulator/GoldfishParts/res/xml/main.xml b/utils/emulator/GoldfishParts/res/xml/main.xml
new file mode 100644
index 0000000..b28c71b
--- /dev/null
+++ b/utils/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/emulator/GoldfishParts/src/org/bliss/device/DeviceSettings.java b/utils/emulator/GoldfishParts/src/org/bliss/device/DeviceSettings.java
new file mode 100644
index 0000000..e4d2268
--- /dev/null
+++ b/utils/emulator/GoldfishParts/src/org/bliss/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.bliss.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/emulator/GoldfishParts/src/org/bliss/device/KeyHandler.java b/utils/emulator/GoldfishParts/src/org/bliss/device/KeyHandler.java
new file mode 100644
index 0000000..9fcc116
--- /dev/null
+++ b/utils/emulator/GoldfishParts/src/org/bliss/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.bliss.device;
+
+import android.content.Context;
+import android.content.Intent;
+import android.util.Log;
+import android.view.KeyEvent;
+
+import com.android.internal.util.bliss.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/emulator/advancedFeatures.ini b/utils/emulator/advancedFeatures.ini
new file mode 100644
index 0000000..7f0bfe9
--- /dev/null
+++ b/utils/emulator/advancedFeatures.ini
@@ -0,0 +1,9 @@
+GrallocSync = on
+GLDMA = on
+LogcatPipe = on
+GLAsyncSwap = on
+GLESDynamicVersion = on
+EncryptUserData = on
+IntelPerformanceMonitoringUnit = on
+SystemAsRoot = on
+Wifi = on
diff --git a/utils/emulator/bliss_emulator.mk b/utils/emulator/bliss_emulator.mk
new file mode 100644
index 0000000..61e9b9f
--- /dev/null
+++ b/utils/emulator/bliss_emulator.mk
@@ -0,0 +1,16 @@
+PRODUCT_COPY_FILES += \
+ vendor/bliss/utils/emulator/fstab.ranchu:vendor/etc/fstab.ranchu \
+ vendor/bliss/prebuilt/common/etc/apns-conf.xml:system/etc/apns-conf.xml
+
+$(call inherit-product, build/target/product/sdk_x86.mk)
+
+$(call inherit-product, vendor/bliss/config/common.mk)
+
+$(call inherit-product, vendor/bliss/utils/emulator/common.mk)
+
+# Override product naming for Omni
+PRODUCT_NAME := bliss_emulator
+
+DEVICE_PACKAGE_OVERLAYS += vendor/bliss/utils/emulator/overlay
+
+ALLOW_MISSING_DEPENDENCIES := true
diff --git a/utils/emulator/common.mk b/utils/emulator/common.mk
new file mode 100644
index 0000000..3bab7f0
--- /dev/null
+++ b/utils/emulator/common.mk
@@ -0,0 +1,3 @@
+PRODUCT_BRAND ?= bliss
+
+WITH_DEXPREOPT_BOOT_IMG_AND_SYSTEM_SERVER_ONLY := true
diff --git a/utils/emulator/create_emulator_image.sh b/utils/emulator/create_emulator_image.sh
new file mode 100755
index 0000000..a918eaf
--- /dev/null
+++ b/utils/emulator/create_emulator_image.sh
@@ -0,0 +1,26 @@
+#!/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_BUILD_TOP
+cp -r vendor/bliss/utils/emulator/skins $ANDROID_PRODUCT_OUT
+cp -r vendor/bliss/utils/emulator/start_emulator_image.sh $ANDROID_PRODUCT_OUT
+cp -r vendor/bliss/utils/emulator/advancedFeatures.ini $ANDROID_PRODUCT_OUT
+
+cd $ANDROID_PRODUCT_OUT/..
+rm /tmp/bliss_emulator.zip
+zip -r /tmp/bliss_emulator.zip generic_x86/skins generic_x86/system-qemu.img generic_x86/system/build.prop generic_x86/cache.img generic_x86/userdata.img generic_x86/start_emulator_image.sh generic_x86/advancedFeatures.ini generic_x86/vendor-qemu.img generic_x86/encryptionkey.img generic_x86/kernel-ranchu-64 generic_x86/ramdisk.img
diff --git a/utils/emulator/fstab.ranchu b/utils/emulator/fstab.ranchu
new file mode 100644
index 0000000..0c83d59
--- /dev/null
+++ b/utils/emulator/fstab.ranchu
@@ -0,0 +1,6 @@
+# Android fstab file.
+#<src> <mnt_point> <type> <mnt_flags and options> <fs_mgr_flags>
+# The filesystem that contains the filesystem checker binary (typically /system) cannot
+# specify MF_CHECK, and must come before any filesystems that do specify MF_CHECK
+/dev/block/vdc /data ext4 noatime,nosuid,nodev,nomblk_io_submit,errors=panic wait,check,quota,forceencrypt=/dev/block/vdd
+/devices/*/block/vdf auto auto defaults voldmanaged=sdcard:auto,encryptable=userdata
diff --git a/utils/emulator/overlay/frameworks/base/core/res/res/values/config.xml b/utils/emulator/overlay/frameworks/base/core/res/res/values/config.xml
new file mode 100644
index 0000000..d62442c
--- /dev/null
+++ b/utils/emulator/overlay/frameworks/base/core/res/res/values/config.xml
@@ -0,0 +1,32 @@
+<?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">
+ <!-- The list absolute paths of jar/apk files containing the device specific handlers,
+ delimited by File.pathSeparator, which defaults to ":" on Android -->
+ <string name="config_deviceKeyHandlerLib" translatable="false">/system/app/GoldfishParts/GoldfishParts.apk</string>
+ <!-- Full qualified name of the class that implements
+ com.android.internal.os.DeviceKeyHandler interface. -->
+ <string name="config_deviceKeyHandlerClass" translatable="false">org.omnirom.device.KeyHandler</string>
+ <!-- make sure you enable this only if your device supports deep slepp
+ with active proximity sensor event listener -->
+ <bool name="config_proxiSensorWakupCheck">true</bool>
+ <bool name="config_showNavigationBar">true</bool>
+ <bool name="config_haveHigherAspectRatioScreen">true</bool>
+</resources>
diff --git a/utils/emulator/packages.mk b/utils/emulator/packages.mk
new file mode 100644
index 0000000..493d4b5
--- /dev/null
+++ b/utils/emulator/packages.mk
@@ -0,0 +1,17 @@
+# Additional tools
+PRODUCT_PACKAGES += \
+ bash \
+ e2fsck \
+ fsck.exfat \
+ htop \
+ lsof \
+ mke2fs \
+ mount.exfat \
+ nano \
+ openvpn \
+ powertop \
+ tune2fs \
+ vim \
+ mkfs.ntfs \
+ mount.ntfs \
+ fsck.ntfs
diff --git a/utils/emulator/skins/pixel_2_xl/hardware.ini b/utils/emulator/skins/pixel_2_xl/hardware.ini
new file mode 100644
index 0000000..4b7959e
--- /dev/null
+++ b/utils/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/emulator/skins/pixel_2_xl/land_back.webp b/utils/emulator/skins/pixel_2_xl/land_back.webp
new file mode 100644
index 0000000..45de491
--- /dev/null
+++ b/utils/emulator/skins/pixel_2_xl/land_back.webp
Binary files differ
diff --git a/utils/emulator/skins/pixel_2_xl/land_fore.webp b/utils/emulator/skins/pixel_2_xl/land_fore.webp
new file mode 100644
index 0000000..7ee7fe9
--- /dev/null
+++ b/utils/emulator/skins/pixel_2_xl/land_fore.webp
Binary files differ
diff --git a/utils/emulator/skins/pixel_2_xl/land_shadow.webp b/utils/emulator/skins/pixel_2_xl/land_shadow.webp
new file mode 100644
index 0000000..0db57b3
--- /dev/null
+++ b/utils/emulator/skins/pixel_2_xl/land_shadow.webp
Binary files differ
diff --git a/utils/emulator/skins/pixel_2_xl/layout b/utils/emulator/skins/pixel_2_xl/layout
new file mode 100644
index 0000000..abd5cd8
--- /dev/null
+++ b/utils/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/emulator/skins/pixel_2_xl/port_back.webp b/utils/emulator/skins/pixel_2_xl/port_back.webp
new file mode 100644
index 0000000..914325d
--- /dev/null
+++ b/utils/emulator/skins/pixel_2_xl/port_back.webp
Binary files differ
diff --git a/utils/emulator/skins/pixel_2_xl/port_fore.webp b/utils/emulator/skins/pixel_2_xl/port_fore.webp
new file mode 100644
index 0000000..bdc562f
--- /dev/null
+++ b/utils/emulator/skins/pixel_2_xl/port_fore.webp
Binary files differ
diff --git a/utils/emulator/skins/pixel_2_xl/port_shadow.webp b/utils/emulator/skins/pixel_2_xl/port_shadow.webp
new file mode 100644
index 0000000..0009913
--- /dev/null
+++ b/utils/emulator/skins/pixel_2_xl/port_shadow.webp
Binary files differ
diff --git a/utils/emulator/skins/pixel_xl/hardware.ini b/utils/emulator/skins/pixel_xl/hardware.ini
new file mode 100644
index 0000000..eeaae5c
--- /dev/null
+++ b/utils/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/emulator/skins/pixel_xl/land_back.webp b/utils/emulator/skins/pixel_xl/land_back.webp
new file mode 100644
index 0000000..5c5ee80
--- /dev/null
+++ b/utils/emulator/skins/pixel_xl/land_back.webp
Binary files differ
diff --git a/utils/emulator/skins/pixel_xl/land_fore.webp b/utils/emulator/skins/pixel_xl/land_fore.webp
new file mode 100644
index 0000000..ca70d12
--- /dev/null
+++ b/utils/emulator/skins/pixel_xl/land_fore.webp
Binary files differ
diff --git a/utils/emulator/skins/pixel_xl/land_shadow.webp b/utils/emulator/skins/pixel_xl/land_shadow.webp
new file mode 100644
index 0000000..1718061
--- /dev/null
+++ b/utils/emulator/skins/pixel_xl/land_shadow.webp
Binary files differ
diff --git a/utils/emulator/skins/pixel_xl/layout b/utils/emulator/skins/pixel_xl/layout
new file mode 100644
index 0000000..debc6f7
--- /dev/null
+++ b/utils/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/emulator/skins/pixel_xl/port_back.webp b/utils/emulator/skins/pixel_xl/port_back.webp
new file mode 100644
index 0000000..4020161
--- /dev/null
+++ b/utils/emulator/skins/pixel_xl/port_back.webp
Binary files differ
diff --git a/utils/emulator/skins/pixel_xl/port_fore.webp b/utils/emulator/skins/pixel_xl/port_fore.webp
new file mode 100644
index 0000000..f010e9c
--- /dev/null
+++ b/utils/emulator/skins/pixel_xl/port_fore.webp
Binary files differ
diff --git a/utils/emulator/skins/pixel_xl/port_shadow.webp b/utils/emulator/skins/pixel_xl/port_shadow.webp
new file mode 100644
index 0000000..c82477a
--- /dev/null
+++ b/utils/emulator/skins/pixel_xl/port_shadow.webp
Binary files differ
diff --git a/utils/emulator/start_emulator_image.sh b/utils/emulator/start_emulator_image.sh
new file mode 100755
index 0000000..916a6ae
--- /dev/null
+++ b/utils/emulator/start_emulator_image.sh
@@ -0,0 +1,6 @@
+#!/bin/sh
+
+export ANDROID_BUILD_TOP=`pwd`
+export ANDROID_PRODUCT_OUT=`pwd`
+
+/home/maxl/Android/Sdk/emulator/emulator -verbose -skindir $ANDROID_BUILD_TOP/skins/ -skin pixel_2_xl -gpu host -writable-system -qemu -cpu qemu64
diff --git a/utils/emulator/start_emulator_local.sh b/utils/emulator/start_emulator_local.sh
new file mode 100755
index 0000000..ee09e40
--- /dev/null
+++ b/utils/emulator/start_emulator_local.sh
@@ -0,0 +1,5 @@
+#!/bin/sh
+
+# assumes the image zip has been extracted in /tmp
+
+emulator -verbose -skindir $ANDROID_BUILD_TOP/vendor/bliss/utils/emulator/skins/ -skin pixel_xl -writable-system