Permalink
Cannot retrieve contributors at this time
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
409 lines (387 sloc)
12.5 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/app/Android.mk b/app/Android.mk | |
index 0807688..61784b7 100644 | |
--- a/app/Android.mk | |
+++ b/app/Android.mk | |
@@ -23,7 +23,7 @@ LOCAL_MODULE_SUFFIX := $$(suffix $(1)) | |
LOCAL_BUILT_MODULE_STEM := package.apk | |
LOCAL_CERTIFICATE := PRESIGNED | |
LOCAL_SRC_FILES := $(1) | |
-LOCAL_DEX_PREOPT := false | |
+LOCAL_DEX_PREOPT := true | |
LOCAL_MODULE_TARGET_ARCH := $$(call get-prebuilt-src-arch,$$(notdir $$(patsubst %/,%,$$(dir $$(LOCAL_LIBS))))) | |
LOCAL_PREBUILT_JNI_LIBS := $$(addprefix @,$$(filter lib/$$(LOCAL_MODULE_TARGET_ARCH)/%,$$(LOCAL_LIBS))) | |
#$$(info $$(LOCAL_MODULE) LOCAL_MODULE_TARGET_ARCH=$$(LOCAL_MODULE_TARGET_ARCH)) | |
diff --git a/device.mk b/device.mk | |
index 3d3468b..20131e9 100644 | |
--- a/device.mk | |
+++ b/device.mk | |
@@ -14,6 +14,20 @@ | |
# limitations under the License. | |
# | |
+GAPPS_VARIANT := pico | |
+ | |
+PRODUCT_PACKAGES += \ | |
+ Chrome \ | |
+ YouTube \ | |
+ Velvet | |
+ | |
+GAPPS_FORCE_BROWSER_OVERRIDES := true | |
+ | |
+GAPPS_EXCLUDED_PACKAGES := \ | |
+ FaceLock \ | |
+ AndroidPlatformServices \ | |
+ PrebuiltGmsCoreInstantApps | |
+ | |
PRODUCT_DIR := $(dir $(lastword $(filter-out device/common/%,$(filter device/%,$(ALL_PRODUCTS))))) | |
PRODUCT_PROPERTY_OVERRIDES := \ | |
@@ -28,6 +42,12 @@ PRODUCT_PROPERTY_OVERRIDES := \ | |
PRODUCT_DEFAULT_PROPERTY_OVERRIDES := \ | |
ro.arch=x86 \ | |
persist.rtc_local_time=1 \ | |
+ ro.product.model=GPDWin \ | |
+ ro.product.brand=GPD \ | |
+ ro.product.name=GPDWin \ | |
+ ro.product.device=Win \ | |
+ ro.product.manufacturer=GPD \ | |
+ ro.build.product=Win | |
PRODUCT_COPY_FILES := \ | |
$(if $(wildcard $(PRODUCT_DIR)init.rc),$(PRODUCT_DIR)init.rc:root/init.rc) \ | |
@@ -77,6 +97,15 @@ PRODUCT_COPY_FILES += \ | |
$(foreach f,$(wildcard $(LOCAL_PATH)/alsa/*),$(f):$(subst $(LOCAL_PATH),system/etc,$(f))) \ | |
$(foreach f,$(wildcard $(LOCAL_PATH)/idc/*.idc $(LOCAL_PATH)/keylayout/*.kl),$(f):$(subst $(LOCAL_PATH),system/usr,$(f))) | |
+PRODUCT_COPY_FILES += \ | |
+ $(LOCAL_PATH)/media/bootanimation.zip:system/media/bootanimation.zip | |
+ | |
+PRODUCT_COPY_FILES += \ | |
+ $(LOCAL_PATH)/bin/headphone-listener:system/bin/headphone-listener | |
+ | |
+PRODUCT_COPY_FILES += \ | |
+ $(LOCAL_PATH)/etc/houdini8_y.sfs:system/etc/houdini8_y.sfs | |
+ | |
PRODUCT_TAGS += dalvik.gc.type-precise | |
PRODUCT_CHARACTERISTICS := tablet | |
@@ -84,6 +113,8 @@ PRODUCT_CHARACTERISTICS := tablet | |
PRODUCT_AAPT_CONFIG := normal large xlarge mdpi hdpi | |
PRODUCT_AAPT_PREF_CONFIG := mdpi | |
+PRODUCT_PROPERTY_OVERRIDES += ro.sf.lcd_density=268 | |
+ | |
DEVICE_PACKAGE_OVERLAYS := $(LOCAL_PATH)/overlay | |
# Get Android 8.0 HIDL HALs | |
@@ -111,7 +142,7 @@ $(call inherit-product-if-exists,hardware/libsensors/sensors.mk) | |
$(call inherit-product,frameworks/native/build/tablet-10in-xhdpi-2048-dalvik-heap.mk) | |
# Get GMS | |
-$(call inherit-product-if-exists,vendor/google/products/gms.mk) | |
+$(call inherit-product-if-exists,vendor/opengapps/build/opengapps-packages.mk) | |
# Get native bridge settings | |
$(call inherit-product-if-exists,$(LOCAL_PATH)/nativebridge/nativebridge.mk) | |
diff --git a/init.sh b/init.sh | |
index c92f375..96caf60 100644 | |
--- a/init.sh | |
+++ b/init.sh | |
@@ -25,6 +25,20 @@ function init_misc() | |
# enable sdcardfs if /data is not mounted on tmpfs or 9p | |
mount | grep /data\ | grep -qE 'tmpfs|9p' | |
[ $? -ne 0 ] && modprobe sdcardfs | |
+ | |
+ # fix the eMMC & micro sd lag spikes | |
+ echo -n -1 > /sys/block/mmcblk0/device/power/autosuspend_delay_ms | |
+ echo -n on > /sys/block/mmcblk0/device/power/control | |
+ echo -n -1 > /sys/block/mmcblk2/device/power/autosuspend_delay_ms | |
+ echo -n on > /sys/block/mmcblk2/device/power/control | |
+ | |
+ # fix the sleep reboot issue | |
+ set_property sleep.state none | |
+ | |
+ # place a magisk su symlink | |
+ mount -o remount,rw / | |
+ ln -s /sbin/magisk /sbin/su | |
+ mount -o remount,ro / | |
} | |
function init_hal_audio() | |
@@ -48,50 +62,6 @@ function init_hal_bluetooth() | |
type=$(cat $r/type) | |
[ "$type" = "wlan" -o "$type" = "bluetooth" ] && echo 1 > $r/state | |
done | |
- | |
- case "$PRODUCT" in | |
- T10*TA|HP*Omni*) | |
- BTUART_PORT=/dev/ttyS1 | |
- set_property hal.bluetooth.uart.proto bcm | |
- [ -z "$(getprop sleep.state)" ] && set_property sleep.state none | |
- ;; | |
- MacBookPro8*) | |
- rmmod b43 | |
- modprobe b43 btcoex=0 | |
- modprobe btusb | |
- ;; | |
- # FIXME | |
- # Fix MacBook 2013-2015 (Air6/7&Pro11/12) BCM4360 ssb&wl conflict. | |
- MacBookPro11* | MacBookPro12* | MacBookAir6* | MacBookAir7*) | |
- rmmod b43 | |
- rmmod ssb | |
- rmmod bcma | |
- rmmod wl | |
- modprobe wl | |
- modprobe btusb | |
- ;; | |
- *) | |
- for bt in $(busybox lsusb -v | awk ' /Class:.E0/ { print $9 } '); do | |
- chown 1002.1002 $bt && chmod 660 $bt | |
- done | |
- ;; | |
- esac | |
- | |
- if [ -n "$BTUART_PORT" ]; then | |
- set_property hal.bluetooth.uart $BTUART_PORT | |
- chown bluetooth.bluetooth $BTUART_PORT | |
- start btattach | |
- fi | |
- | |
- # rtl8723bs bluetooth | |
- if dmesg -t | grep -qE '8723bs.*BT'; then | |
- TTYSTRING=`dmesg -t | grep -E 'tty.*MMIO' | awk '{print $2}' | head -1` | |
- if [ -n "$TTYSTRING" ]; then | |
- echo "RTL8723BS BT uses $TTYSTRING for Bluetooth." | |
- ln -sf $TTYSTRING /dev/rtk_h5 | |
- start rtk_hciattach | |
- fi | |
- fi | |
} | |
function init_hal_camera() | |
@@ -191,94 +161,8 @@ function init_hal_sensors() | |
local hal_sensors=kbd | |
local has_sensors=true | |
- case "$(cat $DMIPATH/uevent)" in | |
- *Lucid-MWE*) | |
- set_property ro.ignore_atkbd 1 | |
- hal_sensors=hdaps | |
- ;; | |
- *ICONIA*W5*) | |
- hal_sensors=w500 | |
- ;; | |
- *S10-3t*) | |
- hal_sensors=s103t | |
- ;; | |
- *Inagua*) | |
- #setkeycodes 0x62 29 | |
- #setkeycodes 0x74 56 | |
- set_property ro.ignore_atkbd 1 | |
- set_property hal.sensors.kbd.type 2 | |
- ;; | |
- *TEGA*|*2010:svnIntel:*) | |
- set_property ro.ignore_atkbd 1 | |
- set_property hal.sensors.kbd.type 1 | |
- io_switch 0x0 0x1 | |
- setkeycodes 0x6d 125 | |
- ;; | |
- *DLI*) | |
- set_property ro.ignore_atkbd 1 | |
- set_property hal.sensors.kbd.type 1 | |
- setkeycodes 0x64 1 | |
- setkeycodes 0x65 172 | |
- setkeycodes 0x66 120 | |
- setkeycodes 0x67 116 | |
- setkeycodes 0x68 114 | |
- setkeycodes 0x69 115 | |
- setkeycodes 0x6c 114 | |
- setkeycodes 0x6d 115 | |
- ;; | |
- *tx2*) | |
- setkeycodes 0xb1 138 | |
- setkeycodes 0x8a 152 | |
- set_property hal.sensors.kbd.type 6 | |
- set_property poweroff.doubleclick 0 | |
- set_property qemu.hw.mainkeys 1 | |
- ;; | |
- *MS-N0E1*) | |
- set_property ro.ignore_atkbd 1 | |
- set_property poweroff.doubleclick 0 | |
- setkeycodes 0xa5 125 | |
- setkeycodes 0xa7 1 | |
- setkeycodes 0xe3 142 | |
- ;; | |
- *Aspire1*25*) | |
- modprobe lis3lv02d_i2c | |
- echo -n "enabled" > /sys/class/thermal/thermal_zone0/mode | |
- ;; | |
- *ThinkPad*Tablet*) | |
- modprobe hdaps | |
- hal_sensors=hdaps | |
- ;; | |
- *i7Stylus*) | |
- set_property hal.sensors.iio.accel.matrix 1,0,0,0,-1,0,0,0,-1 | |
- ;; | |
- *ST70416-6*) | |
- set_property hal.sensors.iio.accel.matrix 0,-1,0,-1,0,0,0,0,-1 | |
- ;; | |
- *ONDATablet*) | |
- set_property hal.sensors.iio.accel.matrix 0,1,0,1,0,0,0,0,-1 | |
- ;; | |
- *Surface.3*|*svnOEMB*) | |
- set_property ro.iio.accel.y.opt_scale -1 | |
- ;& | |
- *T10*TA*) | |
- set_property ro.iio.accel.x.opt_scale -1 | |
- set_property ro.iio.accel.z.opt_scale -1 | |
- ;; | |
- *) | |
- has_sensors=false | |
- ;; | |
- esac | |
- | |
- # has iio sensor-hub? | |
- if [ -n "`ls /sys/bus/iio/devices/iio:device* 2> /dev/null`" ]; then | |
- busybox chown -R 1000.1000 /sys/bus/iio/devices/iio:device*/ | |
- hal_sensors=iio | |
- elif lsmod | grep -q lis3lv02d_i2c; then | |
- hal_sensors=hdaps | |
- fi | |
set_property ro.hardware.sensors $hal_sensors | |
- [ "$hal_sensors" != "kbd" ] && has_sensors=true | |
set_property config.override_forced_orient $has_sensors | |
} | |
@@ -410,28 +294,29 @@ function do_bootcomplete() | |
;; | |
esac | |
-# [ -d /proc/asound/card0 ] || modprobe snd-dummy | |
+ # Initialize ALSA | |
for c in $(grep '\[.*\]' /proc/asound/cards | awk '{print $1}'); do | |
f=/system/etc/alsa/$(cat /proc/asound/card$c/id).state | |
if [ -e $f ]; then | |
alsa_ctl -f $f restore $c | |
- else | |
- alsa_ctl init $c | |
- alsa_amixer -c $c set Master on | |
- alsa_amixer -c $c set Master 100% | |
- alsa_amixer -c $c set Headphone on | |
- alsa_amixer -c $c set Headphone 100% | |
- alsa_amixer -c $c set Speaker 100% | |
- alsa_amixer -c $c set Capture 100% | |
- alsa_amixer -c $c set Capture cap | |
- alsa_amixer -c $c set PCM 100 unmute | |
- alsa_amixer -c $c set SPO unmute | |
- alsa_amixer -c $c set IEC958 on | |
- alsa_amixer -c $c set 'Mic Boost' 3 | |
- alsa_amixer -c $c set 'Internal Mic Boost' 3 | |
fi | |
done | |
+ # Default to the speaker route (aka. merge channels) | |
+ alsa_amixer -c 0 set "Stereo DAC MIXL DAC R1" on | |
+ alsa_amixer -c 0 set "Stereo DAC MIXR DAC R1" off | |
+ alsa_amixer -c 0 set Headphone off | |
+ alsa_amixer -c 0 set "Headphone Channel" off | |
+ alsa_amixer -c 0 set "Ext Spk" on | |
+ alsa_amixer -c 0 set "Speaker Channel" on | |
+ alsa_amixer -c 0 set "Speaker" 31 | |
+ | |
+ # Start the headphone listener (which takes care of switching our inputs) | |
+ headphone-listener & | |
+ | |
+ # Enable Houdini | |
+ start nativebridge | |
+ | |
post_bootcomplete | |
} | |
diff --git a/nativebridge/bin/enable_nativebridge b/nativebridge/bin/enable_nativebridge | |
index 2e3a926..bf33b73 100644 | |
--- a/nativebridge/bin/enable_nativebridge | |
+++ b/nativebridge/bin/enable_nativebridge | |
@@ -5,39 +5,17 @@ PATH=/system/bin:/system/xbin | |
houdini_bin=0 | |
dest_dir=/system/lib$1/arm$1 | |
binfmt_misc_dir=/proc/sys/fs/binfmt_misc | |
+v=8_y | |
-if [ -z "$1" ]; then | |
- if [ "`uname -m`" = "x86_64" ]; then | |
- v=8_y | |
- url=http://goo.gl/v6c4Co | |
- else | |
- v=8_x | |
- url=http://goo.gl/96BPKe | |
- fi | |
-else | |
- v=8_z | |
- url=http://goo.gl/CtKjxx | |
+if [ ! -e /data/arm/houdini$v.sfs ]; then | |
+ mkdir /data/arm | |
+ cp /system/etc/houdini$v.sfs /data/arm/houdini$v.sfs | |
fi | |
if [ -s /system/lib$1/libhoudini.so ]; then | |
log -pi -thoudini "found /system/lib$1/libhoudini.so" | |
-elif [ -e /system/etc/houdini$v.sfs ]; then | |
- mount /system/etc/houdini$v.sfs $dest_dir | |
else | |
- if mountpoint -q $dest_dir; then | |
- kill -9 `fuser -m $dest_dir` | |
- umount -f $dest_dir | |
- fi | |
- mkdir -p /data/arm | |
- cd /data/arm | |
- while ! mount houdini$v.sfs $dest_dir; do | |
- while [ "$(getprop net.dns1)" = "" ]; do | |
- sleep 10 | |
- done | |
- wget $url -cO houdini$v.sfs && continue | |
- rm -f houdini$v.sfs | |
- sleep 30 | |
- done | |
+ mount /data/arm/houdini$v.sfs $dest_dir | |
fi | |
[ -s /system/lib$1/libhoudini.so ] || mount --bind $dest_dir/libhoudini.so /system/lib$1/libhoudini.so | |
diff --git a/overlay/frameworks/base/core/res/res/values/config.xml b/overlay/frameworks/base/core/res/res/values/config.xml | |
index 3e0fe2b..6c0e044 100644 | |
--- a/overlay/frameworks/base/core/res/res/values/config.xml | |
+++ b/overlay/frameworks/base/core/res/res/values/config.xml | |
@@ -107,7 +107,25 @@ | |
<!-- Flag indicating that this device does not rotate and will always remain in its default | |
orientation. Activities that desire to run in a non-compatible orientation will be run | |
from an emulated display within the physical display. --> | |
- <bool name="config_forceDefaultOrientation">true</bool> | |
+ <bool name="config_forceDefaultOrientation">false</bool> | |
+ | |
+ <!-- If true, enables auto-rotation features using the accelerometer. | |
+ Otherwise, auto-rotation is disabled. Applications may still request | |
+ to use specific orientations but the sensor is ignored and sensor-based | |
+ orientations are not available. Furthermore, all auto-rotation related | |
+ settings are omitted from the system UI. In certain situations we may | |
+ still use the accelerometer to determine the orientation, such as when | |
+ docked if the dock is configured to enable the accelerometer. --> | |
+ <bool name="config_supportAutoRotation">false</bool> | |
+ | |
+ <!-- Indicate whether closing the lid causes the lockscreen to appear. | |
+ The default is false. --> | |
+ <bool name="config_lidControlsScreenLock">true</bool> | |
+ | |
+ <!-- Indicate whether closing the lid causes the device to go to sleep and opening | |
+ it causes the device to wake up. | |
+ The default is false. --> | |
+ <bool name="config_lidControlsSleep">true</bool> | |
<!-- The device supports freeform window management. Windows have title bars and can be moved | |
and resized. If you set this to true, you also need to add | |
@@ -116,6 +134,10 @@ | |
available to the system.--> | |
<bool name="config_freeformWindowManagement">true</bool> | |
+ <!-- Allow the gesture to double tap the power button twice to start the camera while the device | |
+ is non-interactive. --> | |
+ <bool name="config_cameraDoubleTapPowerGestureEnabled">false</bool> | |
+ | |
<!-- Controls the opacity of the navigation bar depending on the visibility of the | |
various workspace stacks. | |
0 - Nav bar is always opaque when either the freeform stack or docked stack is visible. | |
diff --git a/packages.mk b/packages.mk | |
index 665a344..a5b7ffc 100644 | |
--- a/packages.mk | |
+++ b/packages.mk | |
@@ -27,12 +27,8 @@ PRODUCT_PACKAGES := \ | |
LiveWallpapers \ | |
LiveWallpapersPicker \ | |
MagicSmokeWallpapers \ | |
- NotePad \ | |
PhaseBeam \ | |
- PinyinIME \ | |
Provision \ | |
- RSSReader \ | |
- Taskbar \ | |
VisualizationWallpapers \ | |
WallpaperPicker \ | |
camera.x86 \ |