I/flutter (12482): [I] 10-27 13:45:19.842 12598 12598 I adb : task_runner.cpp:120 waitable_task called I/flutter (12482): [I] 10-27 13:45:19.842 12598 12598 I adb : task_runner.cpp:113 task called I/flutter (12482): [I] fdsan: failed to exchange ownership of file descriptor: fd 7 is owned by unique_fd 0x7959de91b8, was expected to be unowned
voidAdbOspTaskRunner::PostPackagedTaskWithDelay(Task task, Clock::duration delay){ auto now = std::chrono::steady_clock::now(); auto target_time = now + delay; { std::lock_guard<std::mutex> lock(mutex_); auto target_time_ms = std::chrono::duration_cast<std::chrono::milliseconds>(target_time.time_since_epoch()).count(); LOG(INFO) << "tasks_.emplace called now + delay -> " << target_time_ms << " ms since epoch"; tasks_.emplace(now + delay, std::move(task)); } cv_.notify_one(); }
仍然二分日志找调用
根据日志和代码
1 2 3
I/flutter (12482): [I] 10-27 13:45:19.840 12598 12598 I adb : main.cpp:143 init_mdns_transport_discovery invoke I/flutter (12482): [I] 10-27 13:45:19.841 12598 12598 I adb : task_runner.cpp:57 tasks_.emplace called now + delay -> 3369119 ms since epoch I/flutter (12482): [I] 10-27 13:45:19.841 12598 12598 I adb : main.cpp:145 init_mdns_transport_discovery invoke done
➜ ~ adb shell cmd display Display manager commands: help Print this help text.
set-brightness BRIGHTNESS Sets the current brightness to BRIGHTNESS (a number between 0 and 1). reset-brightness-configuration Reset the brightness to its default configuration. ab-logging-enable Enable auto-brightness logging. ab-logging-disable Disable auto-brightness logging. dwb-logging-enable Enable display white-balance logging. dwb-logging-disable Disable display white-balance logging. dmd-logging-enable Enable display mode director logging. dmd-logging-disable Disable display mode director logging. dwb-set-cct CCT Sets the ambient color temperature override to CCT (use -1 to disable). set-user-preferred-display-mode WIDTH HEIGHT REFRESH-RATE DISPLAY_ID (optional) Sets the user preferred display mode which has fields WIDTH, HEIGHT and REFRESH-RATE. If DISPLAY_ID is passed, the mode change is applied to displaywith id = DISPLAY_ID, else mode change is applied globally. clear-user-preferred-display-mode DISPLAY_ID (optional) Clears the user preferred display mode. If DISPLAY_ID is passed, the mode is cleared for display with id = DISPLAY_ID, else mode is cleared globally. get-user-preferred-display-mode DISPLAY_ID (optional) Returns the user preferred display mode or null if no mode is set by user.If DISPLAY_ID is passed, the mode for display with id = DISPLAY_ID is returned, else global display mode is returned. get-active-display-mode-at-start DISPLAY_ID Returns the display mode which was found at boot time of display with id = DISPLAY_ID set-match-content-frame-rate-pref PREFERENCE Sets the match content frame rate preference as PREFERENCE adb shell cmd display get-match-content-frame-rate-pref get-match-content-frame-rate-pref Returns the match content frame rate preference set-user-disabled-hdr-types TYPES... Sets the user disabled HDR types as TYPES get-user-disabled-hdr-types Returns the user disabled HDR types get-displays [CATEGORY] Returns the current displays. Can specify string category among DisplayManager.DISPLAY_CATEGORY_*; must use the actual string value. dock Sets brightness to docked + idle screen brightness mode undock Sets brightness to active (normal) screen brightness mode ...more ➜ ~
publicstaticvoidsetBootDisplayMode(IBinder displayToken, int displayModeId) { if (displayToken == null) { thrownewIllegalArgumentException("displayToken must not be null"); }
SCRIPTNAME=termux-toast show_usage () { echo"Usage: termux-toast [-b bgcolor] [-c color] [-g gravity] [-s] [text]" echo"Show text in a Toast (a transient popup)." echo"The toast text is either supplied as arguments or read from stdin" echo"if no arguments are given. Arguments will take precedence over stdin." echo"If toast text is not passed as arguments or with stdin, then there will" echo"be a 3s delay." echo" -h show this help" echo" -b set background color (default: gray)" echo" -c set text color (default: white)" echo" -g set position of toast: [top, middle, or bottom] (default: middle)" echo" -s only show the toast for a short while" echo"NOTE: color can be a standard name (i.e. red) or 6 / 8 digit hex value (i.e. \"#FF0000\" or \"#FFFF0000\") where order is (AA)RRGGBB. Invalid color will revert to default value" exit 0 }
PARAMS="" whilegetopts :hsc:b:g: option do case"$option"in h) show_usage;; s) PARAMS+=" --ez short true";; c) PARAMS+=" --es text_color $OPTARG";; b) PARAMS+=" --es background $OPTARG";; g) PARAMS+=" --es gravity $OPTARG";; ?) echo"$SCRIPTNAME: illegal option -$OPTARG"; exit 1; esac done shift $((OPTIND-1))
# If toast text was not passed as an argument, then attempt to read from STDIN with a 3s timeout # Toast text arguments takes precedence over STDIN if [ $# = 0 ]; then set +e; IFS= read -t 3 -r -d '' TOAST_TEXT; set -e; else TOAST_TEXT="$*" fi
# Trim trailing newlines TOAST_TEXT="$(echo "$TOAST_TEXT")"
// Try to connect over the listen socket first if running on Android `< 14`. // On Android `>= 14`, if termux-api app process was started previously // and it started the socket server, but later Android froze the // process, the socket will still be connectable, but no response // will be received until the app process is unfrozen agin and // `read()` call below will hang indefinitely until that happens, // so use legacy `am broadcast` command, which will also unfreeze // the app process to deliver the intent. // - https://github.com/termux/termux-api/issues/638#issuecomment-1813233924
SCRIPTNAME=termux-usb show_usage () { echo"Usage: $SCRIPTNAME [-l | [-r] [-E] [-e command] [device | vendorId productId]]" echo"List or access USB devices. Devices cannot be accessed directly," echo" only using $SCRIPTNAME." echo" -l list available devices" echo" -r show permission request dialog if necessary" echo" -e command execute the specified command with a file descriptor" echo" referring to the device as an argument (unless -E" echo" argument is given)" echo" -E transfer file descriptor as env var instead of as" echo" command line argument" exit 0 }
if [ "$ACTION" == "list" ] then if [ $# -gt 0 ]; thenecho"$SCRIPTNAME: too many arguments"; exit 1; fi else if [ $# -lt 1 ]; then echo"$SCRIPTNAME: missing -l or device path" exit 1 elif [ $# -eq 1 ]; then # The device's usbfs path has been provided PARAMS="$PARAMS --es device $1" elif [ $# -eq 2 ]; then # A vendorId and ProductId of the device has been provided PARAMS="$PARAMS --es vendorId $1" PARAMS="$PARAMS --es productId $2" else echo"$SCRIPTNAME: too many arguments" exit 1 fi fi echo"TERMUX_CALLBACK:$TERMUX_CALLBACK" echo"TERMUX_EXPORT_FD:$TERMUX_EXPORT_FD" CMD="termux-api Usb -a $ACTION$PARAMS" termux-toast "CMD:$CMD" echo"CMD:$CMD"
if [ "$ACTION" == "permission" ] then if [ "$($CMD)" == "yes" ] then echo"Access granted." exit 0 else echo"Access denied." exit 1 fi else $CMD fi