#!/bin/sh # Ensure the QMI BAM-DMUX data port is open on cellular up; never close it on # down because unregistering net/wwan0 causes ModemManager (qcom-soc) to drop # the modem object, and bam-dmux already runtime-suspends in 1000 ms when idle. # Unpark standby RAT immediately if Wi-Fi drops while the flip is closed. if [ "$1" = "wlan0" ]; then case "$2" in down|pre-down) /usr/bin/bananarchy-power-policy.sh unpark-rat >/dev/null 2>&1 & ;; up|dhcp4-change) /usr/bin/bananarchy-power-policy.sh wifi-up >/dev/null 2>&1 & ;; esac exit 0 fi [ "$1" = "qrtr0" ] || [ "$1" = "wwan0" ] || [ "$1" = "rmnet_data0" ] || exit 0 case "$2" in pre-up|up|vpn-up) /usr/bin/bananarchy-dpm.sh open ;; down|post-down) _pause_file="${BANANARCHY_RUNDIR:-/run/bananarchy}/dsds_paused_for_data" if [ -f "$_pause_file" ]; then "${BANANARCHY_UIM_SEL:-/usr/libexec/msm-modem-uim-selection}" restore-dsds >/dev/null 2>&1 || true fi ;; esac exit 0