You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: post_sleep.sh
+17-40Lines changed: 17 additions & 40 deletions
Original file line number
Diff line number
Diff line change
@@ -26,21 +26,16 @@ function reprobe_module_if_loaded()
26
26
MODULE_RELOAD_LIST=""
27
27
# set RESTART_WIFI to true if a wifi module is going to be reloaded, note that users will have to manually turn on wifi again after a wificond restart
28
28
RESTART_WIFI=false
29
-
# set RESET_BT to true if a bluetooth module is going to be reloaded, note that user might have to manually turn on bluetooth again after bthal restart
# usually bluetooth breaks when waking from s3 resets the device, then bthal continues to communicate to it with existing sockets as if the reset had never happened
41
-
# while disabling bthal before suspend then starting it after is enough on the steamdeck, reprobing the module should make it work better in a more general sense
42
-
RESTART_BT=true
43
-
MODULE_RELOAD_LIST="$MODULE_RELOAD_LIST btusb"
37
+
# note that btusb is unloaded in pre_sleep.sh, since it takes more than 10+ seconds to unload btusb right after wake
38
+
# ie. do not put btusb into the reload list
44
39
45
40
# users can use this to flag wificond restart
46
41
USER_RESTART_WIFI_FLAG=/data/etc/wake_reload_wifi
@@ -49,31 +44,11 @@ then
49
44
RESTART_WIFI=true
50
45
fi
51
46
52
-
# users can use this to flag bluetooth restart
53
-
USER_RESTART_BT_FLAG=/data/etc/wake_reload_bt
54
-
if [ -e$USER_RESTART_BT_FLAG ]
55
-
then
56
-
RESTART_BT=true
57
-
fi
58
-
59
-
# stop services if requested
60
-
if$RESTART_BT
61
-
then
62
-
setprop ctl.stop btlinux-1.1
63
-
setprop ctl.stop vendor.bluetooth-1-1
64
-
fi
65
-
66
47
if$RESTART_WIFI
67
48
then
68
49
setprop ctl.stop wificond
69
50
fi
70
51
71
-
# setprop ctl.stop should be instant, but just in case
72
-
if$RESTART_WIFI||$RESTART_BT
73
-
then
74
-
sleep 0.2
75
-
fi
76
-
77
52
# perform module reprobe
78
53
MODULE_RELOAD_LOG=/data/wake_module_reload_log
79
54
rm -f $MODULE_RELOAD_LOG
@@ -101,18 +76,20 @@ then
101
76
setprop ctl.start wificond
102
77
fi
103
78
104
-
if$RESTART_BT
105
-
then
106
-
bthal=$(getprop ro.bliss.bthal)
107
-
case$bthalin
108
-
"btlinux")
109
-
setprop ctl.start btlinux-1.1
110
-
;;
111
-
"celadon")
112
-
setprop ctl.start vendor.bluetooth-1-1
113
-
;;
114
-
esac
115
-
fi
79
+
# probe btusb since it was unloaded in pre_sleep.sh
80
+
modprobe btusb
81
+
82
+
# bthal and com.android.bluetooth were disabled in pre_sleep.sh
0 commit comments