OSDN Git Service

Don't unload rtl8723be wifi driver
[android-x86/device-generic-common.git] / init.sh
diff --git a/init.sh b/init.sh
index caec377..f80f58f 100644 (file)
--- a/init.sh
+++ b/init.sh
@@ -32,6 +32,10 @@ function init_hal_audio()
                *)
                        ;;
        esac
+
+       if [ "`cat /proc/asound/card0/id`" = "IntelHDMI" ]; then
+               [ -d /proc/asound/card1 ] || set_property ro.hardware.audio.primary hdmi
+       fi
 }
 
 function init_hal_bluetooth()
@@ -165,6 +169,7 @@ function init_hal_sensors()
        [ -f /system/lib/hw/sensors.${ro_hardware}.so ] && return 0
 
        local hal_sensors=kbd
+       local has_sensors=true
        case "$(cat $DMIPATH/uevent)" in
                *Lucid-MWE*)
                        set_property ro.ignore_atkbd 1
@@ -225,7 +230,14 @@ function init_hal_sensors()
                *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
+                       ;;
                *)
+                       has_sensors=false
                        ;;
        esac
 
@@ -238,6 +250,8 @@ function init_hal_sensors()
        fi
 
        set_property ro.hardware.sensors $hal_sensors
+       [ "$hal_sensors" != "kbd" ] && has_sensors=true
+       set_property config.override_forced_orient $has_sensors
 }
 
 function create_pointercal()
@@ -330,10 +344,7 @@ function do_bootcomplete()
 
        [ -z "$(getprop persist.sys.root_access)" ] && setprop persist.sys.root_access 3
 
-       # FIXME: autosleep works better on i965?
-       [ "$(getprop debug.mesa.driver)" = "i965" ] && setprop debug.autosleep 1
-
-       lsmod | grep -e brcmfmac && setprop wlan.no-unload-driver 1
+       lsmod | grep -Ehq "brcmfmac|rtl8723be" && setprop wlan.no-unload-driver 1
 
        case "$PRODUCT" in
                1866???|1867???|1869???) # ThinkPad X41 Tablet