OSDN Git Service

Revert "Disable forced orientation"
[android-x86/device-generic-common.git] / init.sh
diff --git a/init.sh b/init.sh
index e587424..7e85495 100644 (file)
--- a/init.sh
+++ b/init.sh
@@ -49,6 +49,7 @@ function init_hal_bluetooth()
                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
@@ -77,6 +78,16 @@ function init_hal_bluetooth()
                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()
@@ -96,6 +107,9 @@ function set_drm_mode()
                ET1602*)
                        drm_mode=1366x768
                        ;;
+               VMware*)
+                       [ -n "$video" ] && drm_mode=$video
+                       ;;
                *)
                        ;;
        esac
@@ -121,8 +135,9 @@ function init_hal_gralloc()
 {
        case "$(cat /proc/fb | head -1)" in
                *virtiodrmfb)
-#                      set_property ro.hardware.hwcomposer drm
-                       ;&
+                       set_property ro.hardware.hwcomposer drm
+                       set_property ro.hardware.gralloc gbm
+                       ;;
                0*inteldrmfb|0*radeondrmfb|0*nouveaufb|0*svgadrmfb|0*amdgpudrmfb)
                        set_property ro.hardware.gralloc drm
                        set_drm_mode
@@ -236,7 +251,7 @@ function init_hal_sensors()
                        set_property hal.sensors.iio.accel.matrix 0,1,0,1,0,0,0,0,-1
                        ;;
                *)
-                       #has_sensors=false
+                       has_sensors=false
                        ;;
        esac
 
@@ -397,6 +412,7 @@ function do_bootcomplete()
                        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