Fix Bluetooth 5.x/6.x headsets, Android OBEX prompts, and refresh a1120 images
- Scope WirePlumber 50-bluetooth.conf roles to [ a2dp_sink hsp_hs hfp_hf ], lock HFP to 8 kHz CVSD for QDSP6 INTERNAL_BT_SCO, enable dummy AVRCP player, and set LDAC ABR quality. - Select BR/EDR bearer and ConnectProfile fallback for Classic Audio headsets while preserving LE bearer for HOGP devices, forward AVRCP media keys to music.so, bound discoverability to 60 s, fix SCO keepalive teardown/readiness and ATA call state sync, and suppress nokia-sparkler speaker haptic audio during BT SCO. - Advertise Smartphone Class of Device (0x5a020c / btmgmt class 2 3), handle OBEX over both L2CAP SOCK_SEQPACKET and RFCOMM SOCK_STREAM via ObexPacketReader, and add NeoUI incoming file Accept/Reject dialog and configurable target folder picker in networks.so. - Add scripts/test-bluetooth-headset.py and scripts/test-bluetooth-obex.py, and rebuild/pin verified a1120 (cocojamboo) images and release archives for nokia-argon, nokia-beatles, nokia-coconut, and nokia-sparkler.
This commit is contained in:
1 parent
0030dc3910
commit
36a5f8cb8a
29 files changed
+2011
-190
No files matched your search
@@ -1469,6 +1469,9 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
writeActiveStateFiles();
|
||||
stopRingingJobs();
|
||||
notifyCoverCall("active", callNumber, contactName, activeSimSlot);
|
||||
if (!isVoipCallId(cid)) {
|
||||
writeIntFile("/tmp/sxmo_in_call", 1);
|
||||
}
|
||||
setSpeakerRoute(false, hasBtAudioCard());
|
||||
render();
|
||||
|
||||
@@ -2063,6 +2066,18 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
if (callState != CallState::Outgoing) {
|
||||
speakerOn = false;
|
||||
btAudioOn = hasBtAudioCard();
|
||||
if (!isVoipCallId(callId)) {
|
||||
writeIntFile("/tmp/sxmo_in_call", 1);
|
||||
if (!callId.empty() && callId != "-") {
|
||||
std::string callsDir = getRuntimeFile("sxmo_calls");
|
||||
::mkdir(callsDir.c_str(), 0755);
|
||||
std::string pickPath = callsDir + "/" + callId + ".pickedupcall";
|
||||
int pfd = ::open(pickPath.c_str(), O_WRONLY | O_CREAT | O_CLOEXEC, 0644);
|
||||
if (pfd >= 0) ::close(pfd);
|
||||
}
|
||||
}
|
||||
} else if (!isVoipCallId(callId) && ::access("/tmp/sxmo_in_call", F_OK) != 0) {
|
||||
writeIntFile("/tmp/sxmo_in_call", 1);
|
||||
}
|
||||
callState = CallState::Active;
|
||||
callStartMs = nowMs();
|
||||
@@ -2396,6 +2411,18 @@ int callscreen_run_main(int argc, char** argv) {
|
||||
if (!wasOutgoing) {
|
||||
speakerOn = false;
|
||||
btAudioOn = hasBtAudioCard();
|
||||
if (!isVoipCallId(callId)) {
|
||||
writeIntFile("/tmp/sxmo_in_call", 1);
|
||||
if (!callId.empty() && callId != "-") {
|
||||
std::string callsDir = getRuntimeFile("sxmo_calls");
|
||||
::mkdir(callsDir.c_str(), 0755);
|
||||
std::string pickPath = callsDir + "/" + callId + ".pickedupcall";
|
||||
int pfd = ::open(pickPath.c_str(), O_WRONLY | O_CREAT | O_CLOEXEC, 0644);
|
||||
if (pfd >= 0) ::close(pfd);
|
||||
}
|
||||
}
|
||||
} else if (!isVoipCallId(callId) && ::access("/tmp/sxmo_in_call", F_OK) != 0) {
|
||||
writeIntFile("/tmp/sxmo_in_call", 1);
|
||||
}
|
||||
}
|
||||
ringMuted = false;
|
||||
|
||||
@@ -1327,6 +1327,31 @@ int runMusicApp(int argc, char** argv) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (sym == XF86XK_AudioPlay || sym == XF86XK_AudioPause) {
|
||||
if (queue.empty()) populateDefaultQueue();
|
||||
togglePlayPause();
|
||||
render();
|
||||
continue;
|
||||
}
|
||||
if (sym == XF86XK_AudioStop) {
|
||||
stopPlayback();
|
||||
setBanner("Playback stopped");
|
||||
render();
|
||||
continue;
|
||||
}
|
||||
if (sym == XF86XK_AudioNext) {
|
||||
if (queue.empty()) populateDefaultQueue();
|
||||
stepTrack(1);
|
||||
render();
|
||||
continue;
|
||||
}
|
||||
if (sym == XF86XK_AudioPrev) {
|
||||
if (queue.empty()) populateDefaultQueue();
|
||||
stepTrack(-1);
|
||||
render();
|
||||
continue;
|
||||
}
|
||||
|
||||
char dch = mapDialKey(sym, kc, ev.xkey.state);
|
||||
if (dch == '1') {
|
||||
activeTab = TabId::Player;
|
||||
@@ -1540,6 +1565,22 @@ int runMusicApp(int argc, char** argv) {
|
||||
} else if (cmd == "PAUSE") {
|
||||
pausePlayback();
|
||||
if (visible) render();
|
||||
} else if (cmd == "PLAYPAUSE") {
|
||||
if (queue.empty()) populateDefaultQueue();
|
||||
togglePlayPause();
|
||||
if (visible) render();
|
||||
} else if (cmd == "PLAY") {
|
||||
if (queue.empty()) populateDefaultQueue();
|
||||
if (!isPlaying || isPaused) togglePlayPause();
|
||||
if (visible) render();
|
||||
} else if (cmd == "NEXT") {
|
||||
if (queue.empty()) populateDefaultQueue();
|
||||
stepTrack(1);
|
||||
if (visible) render();
|
||||
} else if (cmd == "PREV") {
|
||||
if (queue.empty()) populateDefaultQueue();
|
||||
stepTrack(-1);
|
||||
if (visible) render();
|
||||
} else if (cmd == "STOP") {
|
||||
stopPlayback();
|
||||
if (visible) render();
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
#include <X11/Xft/Xft.h>
|
||||
#include <X11/Xutil.h>
|
||||
#include <pango/pangoxft.h>
|
||||
#include <dirent.h>
|
||||
#include <fcntl.h>
|
||||
#include <poll.h>
|
||||
#include <sys/stat.h>
|
||||
#include <clocale>
|
||||
@@ -39,6 +41,9 @@ enum class NetModal {
|
||||
ApnEditor = 3,
|
||||
BtActions = 4,
|
||||
BtNameEditor = 5,
|
||||
ObexActions = 6,
|
||||
ObexDirPicker = 7,
|
||||
ObexIncomingPrompt = 8,
|
||||
};
|
||||
|
||||
constexpr const char* kIconHeadphones = "\xef\x80\xa5"; // U+F025 headphones
|
||||
@@ -176,12 +181,12 @@ bool readSavedBtDiscoverable() {
|
||||
std::string line;
|
||||
if (in.is_open() && std::getline(in, line)) {
|
||||
std::string v = toLowerStr(trimStr(line));
|
||||
if (v == "0" || v == "off" || v == "no" || v == "false") {
|
||||
return false;
|
||||
if (v == "1" || v == "on" || v == "yes" || v == "true") {
|
||||
return true;
|
||||
}
|
||||
if (!v.empty()) return true;
|
||||
if (!v.empty()) return false;
|
||||
}
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
void writeSavedBtDiscoverable(bool disc) {
|
||||
@@ -193,6 +198,143 @@ void writeSavedBtDiscoverable(bool disc) {
|
||||
}
|
||||
}
|
||||
|
||||
constexpr const char* kObexIpcDir = "/run/bananarchy/bt-obex";
|
||||
constexpr const char* kObexPromptPath = "/run/bananarchy/bt-obex/prompt.tsv";
|
||||
constexpr const char* kObexDecisionPath = "/run/bananarchy/bt-obex/decision.tsv";
|
||||
|
||||
std::string shortenHomePath(const std::string& p) {
|
||||
if (p.empty()) return "~/Downloads";
|
||||
std::string home = getHomeDir();
|
||||
if (p == home) return "~";
|
||||
if (p.rfind(home + "/", 0) == 0) {
|
||||
return "~/" + p.substr(home.size() + 1);
|
||||
}
|
||||
return p;
|
||||
}
|
||||
|
||||
std::string readSavedObexDir() {
|
||||
std::string fallback = getHomeDir() + "/Downloads";
|
||||
if (!isDuressMode()) {
|
||||
std::string cfgPath = getHomeDirPath() + "/.config/sxmo/bt_obex_dir";
|
||||
std::ifstream in(cfgPath);
|
||||
std::string line;
|
||||
if (in.is_open() && std::getline(in, line)) {
|
||||
line = trimStr(line);
|
||||
if (!line.empty() && line[0] == '/' &&
|
||||
line.find('\t') == std::string::npos &&
|
||||
line.find("..") == std::string::npos) {
|
||||
return line;
|
||||
}
|
||||
}
|
||||
}
|
||||
::mkdir(fallback.c_str(), 0755);
|
||||
return fallback;
|
||||
}
|
||||
|
||||
void writeSavedObexDir(const std::string& rawDir) {
|
||||
std::string dir = trimStr(rawDir);
|
||||
if (dir.empty() || dir[0] != '/') {
|
||||
dir = getHomeDir() + "/Downloads";
|
||||
}
|
||||
::mkdir(dir.c_str(), 0755);
|
||||
if (isDuressMode()) return;
|
||||
std::string cfgDir = getHomeDirPath() + "/.config/sxmo";
|
||||
::mkdir(cfgDir.c_str(), 0755);
|
||||
std::ofstream out(cfgDir + "/bt_obex_dir", std::ios::trunc);
|
||||
if (out.is_open()) {
|
||||
out << dir << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
std::string formatBytesShort(int64_t b) {
|
||||
if (b <= 0) return "Unknown size";
|
||||
char buf[48];
|
||||
if (b >= 1024LL * 1024LL) {
|
||||
std::snprintf(buf, sizeof(buf), "%.1f MB", static_cast<double>(b) / (1024.0 * 1024.0));
|
||||
} else if (b >= 1024) {
|
||||
std::snprintf(buf, sizeof(buf), "%.1f KB", static_cast<double>(b) / 1024.0);
|
||||
} else {
|
||||
std::snprintf(buf, sizeof(buf), "%lld B", static_cast<long long>(b));
|
||||
}
|
||||
return buf;
|
||||
}
|
||||
|
||||
struct ObexPromptInfo {
|
||||
bool active = false;
|
||||
std::string reqId;
|
||||
std::string senderName;
|
||||
std::string senderMac;
|
||||
std::string fileName;
|
||||
int64_t fileBytes = 0;
|
||||
std::string targetDir;
|
||||
};
|
||||
|
||||
ObexPromptInfo readObexPromptFile() {
|
||||
ObexPromptInfo p;
|
||||
std::ifstream in(kObexPromptPath);
|
||||
std::string line;
|
||||
if (!in.is_open() || !std::getline(in, line)) return p;
|
||||
line = trimStr(line);
|
||||
if (line.empty()) return p;
|
||||
std::vector<std::string> cols;
|
||||
std::stringstream ss(line);
|
||||
std::string c;
|
||||
while (std::getline(ss, c, '\t')) {
|
||||
cols.push_back(c);
|
||||
}
|
||||
if (cols.size() < 4 || cols[0].empty()) return p;
|
||||
p.active = true;
|
||||
p.reqId = cols[0];
|
||||
p.senderName = cols[1];
|
||||
p.senderMac = cols[2];
|
||||
p.fileName = cols[3];
|
||||
p.fileBytes = (cols.size() >= 5) ? std::atoll(cols[4].c_str()) : 0;
|
||||
p.targetDir = (cols.size() >= 6 && !cols[5].empty()) ? cols[5] : readSavedObexDir();
|
||||
return p;
|
||||
}
|
||||
|
||||
void writeObexDecision(const std::string& reqId, bool accept, const std::string& targetDir) {
|
||||
if (reqId.empty()) return;
|
||||
::mkdir("/run/bananarchy", 0755);
|
||||
::mkdir(kObexIpcDir, 0755);
|
||||
std::string tmpPath = std::string(kObexDecisionPath) + ".tmp";
|
||||
{
|
||||
std::ofstream out(tmpPath, std::ios::trunc);
|
||||
if (out.is_open()) {
|
||||
out << reqId << "\t" << (accept ? "ACCEPT" : "REJECT") << "\t" << targetDir << "\n";
|
||||
}
|
||||
}
|
||||
::rename(tmpPath.c_str(), kObexDecisionPath);
|
||||
}
|
||||
|
||||
bool isLidClosedState() {
|
||||
std::ifstream in("/run/bananarchy/lid-state");
|
||||
std::string line;
|
||||
if (in.is_open() && std::getline(in, line)) {
|
||||
std::string low = toLowerStr(trimStr(line));
|
||||
if (low.rfind("closed", 0) == 0) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void wakeDisplayForObex(Display* dpy) {
|
||||
if (isLidClosedState()) {
|
||||
runAsyncArgv("/usr/bin/bananarchy-lid-gate.sh", "wake");
|
||||
return;
|
||||
}
|
||||
int saved = readIntFile("/tmp/sxmo_saved_brightness", -1);
|
||||
if (saved <= 1) {
|
||||
saved = readIntFile("/sys/class/backlight/backlight/max_brightness", 14);
|
||||
if (saved <= 1) saved = 14;
|
||||
}
|
||||
writeIntFile("/sys/class/backlight/backlight/bl_power", 0);
|
||||
writeIntFile("/sys/class/backlight/backlight/brightness", saved);
|
||||
writeIntFile("/sys/class/leds/white:kbd_backlight/brightness", 255);
|
||||
if (dpy) {
|
||||
XForceScreenSaver(dpy, ScreenSaverReset);
|
||||
}
|
||||
}
|
||||
|
||||
struct BtRxStatus {
|
||||
std::string state = "IDLE";
|
||||
std::string fileName;
|
||||
@@ -203,6 +345,7 @@ struct BtRxStatus {
|
||||
|
||||
BtRxStatus readBtRxStatus() {
|
||||
BtRxStatus st;
|
||||
st.detail = "Ready (" + shortenHomePath(readSavedObexDir()) + ")";
|
||||
std::ifstream in("/tmp/bananarchy_bt_rx.status");
|
||||
std::string line;
|
||||
if (!in.is_open() || !std::getline(in, line)) {
|
||||
@@ -217,7 +360,10 @@ BtRxStatus readBtRxStatus() {
|
||||
cols.push_back(c);
|
||||
}
|
||||
if (!cols.empty()) st.state = cols[0];
|
||||
if (st.state == "RECEIVING" && cols.size() >= 5) {
|
||||
if (st.state == "PENDING" && cols.size() >= 4) {
|
||||
st.fileName = cols[1];
|
||||
st.detail = cols[2] + " (" + cols[3] + ")";
|
||||
} else if (st.state == "RECEIVING" && cols.size() >= 5) {
|
||||
st.fileName = cols[1];
|
||||
st.detail = cols[4];
|
||||
st.pct = std::clamp(std::atoi(cols[4].c_str()), 0, 100);
|
||||
@@ -595,7 +741,7 @@ std::vector<BtDeviceEntry> queryBtDevices(const std::string& scanRaw = "") {
|
||||
});
|
||||
|
||||
for (const auto& d : out) {
|
||||
if (infoCount >= 12) break;
|
||||
if (infoCount >= 24) break;
|
||||
if (d.connected || d.paired || !isRawMacName(d)) {
|
||||
infoCmd += "printf '===BTDEV %s===\\n' " + shellQuote(d.mac) +
|
||||
"; timeout 1 bluetoothctl info " + shellQuote(d.mac) +
|
||||
@@ -868,6 +1014,16 @@ int runNetworksApp(int argc, char** argv) {
|
||||
// Bluetooth target device
|
||||
BtDeviceEntry targetBt;
|
||||
|
||||
// Incoming OBEX confirmation & directory picker state
|
||||
ObexPromptInfo obexPrompt;
|
||||
int obexPromptSel = 0;
|
||||
bool openedForObexPrompt = false;
|
||||
bool pendingDeferredObexPrompt = false;
|
||||
std::string obexPickerDir;
|
||||
std::vector<std::pair<std::string, std::string>> obexPickerEntries;
|
||||
int obexPickerSel = 0;
|
||||
bool obexPickerForPrompt = false;
|
||||
|
||||
// Multi-tap state for text inputs
|
||||
TextMode textMode = TextMode::Lower;
|
||||
int lastTapDigit = -1;
|
||||
@@ -935,10 +1091,98 @@ int runNetworksApp(int argc, char** argv) {
|
||||
}
|
||||
};
|
||||
|
||||
auto loadObexPickerDir = [&](const std::string& rawDir) {
|
||||
std::string target = trimStr(rawDir);
|
||||
if (target.empty() || target[0] != '/') {
|
||||
target = readSavedObexDir();
|
||||
}
|
||||
::mkdir(target.c_str(), 0755);
|
||||
char resolved[4096];
|
||||
if (::realpath(target.c_str(), resolved) != nullptr) {
|
||||
target = resolved;
|
||||
}
|
||||
if (isDuressMode()) {
|
||||
std::string root = kDuressHomeDirPath;
|
||||
if (target != root && target.rfind(root + "/", 0) != 0) {
|
||||
target = root + "/Downloads";
|
||||
::mkdir(target.c_str(), 0755);
|
||||
}
|
||||
}
|
||||
obexPickerDir = target;
|
||||
obexPickerEntries.clear();
|
||||
obexPickerEntries.push_back({"[Use This Folder]", obexPickerDir});
|
||||
|
||||
std::string minRoot = isDuressMode() ? std::string(kDuressHomeDirPath) : "/";
|
||||
if (obexPickerDir != minRoot && obexPickerDir != "/") {
|
||||
size_t sl = obexPickerDir.rfind('/');
|
||||
std::string parent = (sl == 0 || sl == std::string::npos) ? "/" : obexPickerDir.substr(0, sl);
|
||||
obexPickerEntries.push_back({".. (Parent Folder)", parent});
|
||||
}
|
||||
|
||||
if (!isDuressMode()) {
|
||||
std::string home = getHomeDirPath();
|
||||
if (obexPickerDir == home) {
|
||||
for (const char* sub : {"Downloads", "Pictures", "Music", "Documents"}) {
|
||||
std::string p = home + "/" + sub;
|
||||
::mkdir(p.c_str(), 0755);
|
||||
}
|
||||
}
|
||||
struct stat sdSt {};
|
||||
if (::stat("/media/sdcard", &sdSt) == 0 && S_ISDIR(sdSt.st_mode) &&
|
||||
obexPickerDir != "/media/sdcard") {
|
||||
obexPickerEntries.push_back({"[SD Card] /media/sdcard", "/media/sdcard"});
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> subNames;
|
||||
DIR* dir = ::opendir(obexPickerDir.c_str());
|
||||
if (dir) {
|
||||
struct dirent* ent;
|
||||
while ((ent = ::readdir(dir)) != nullptr) {
|
||||
std::string nm = ent->d_name;
|
||||
if (nm.empty() || nm[0] == '.') continue;
|
||||
std::string full = (obexPickerDir == "/") ? ("/" + nm) : (obexPickerDir + "/" + nm);
|
||||
struct stat st {};
|
||||
if (::stat(full.c_str(), &st) == 0 && S_ISDIR(st.st_mode)) {
|
||||
subNames.push_back(nm);
|
||||
}
|
||||
}
|
||||
::closedir(dir);
|
||||
}
|
||||
std::sort(subNames.begin(), subNames.end(),
|
||||
[](const std::string& a, const std::string& b) {
|
||||
return toLowerStr(a) < toLowerStr(b);
|
||||
});
|
||||
for (const auto& nm : subNames) {
|
||||
std::string full = (obexPickerDir == "/") ? ("/" + nm) : (obexPickerDir + "/" + nm);
|
||||
obexPickerEntries.push_back({"/ " + nm, full});
|
||||
}
|
||||
obexPickerSel = 0;
|
||||
};
|
||||
|
||||
auto openObexDirPicker = [&](const std::string& initialDir, bool forPrompt) {
|
||||
obexPickerForPrompt = forPrompt;
|
||||
loadObexPickerDir(initialDir.empty() ? readSavedObexDir() : initialDir);
|
||||
modal = NetModal::ObexDirPicker;
|
||||
};
|
||||
|
||||
auto commitObexPickerSelection = [&]() {
|
||||
writeSavedObexDir(obexPickerDir);
|
||||
if (obexPickerForPrompt) {
|
||||
obexPrompt.targetDir = obexPickerDir;
|
||||
modal = NetModal::ObexIncomingPrompt;
|
||||
obexPromptSel = 0;
|
||||
} else {
|
||||
btRx = readBtRxStatus();
|
||||
modal = NetModal::None;
|
||||
setBanner("OBEX folder: " + shortenHomePath(obexPickerDir));
|
||||
}
|
||||
};
|
||||
|
||||
auto applyOpenArg = [&](const std::string& arg) {
|
||||
std::string a = toLowerStr(trimStr(arg));
|
||||
modal = NetModal::None;
|
||||
if (a == "bluetooth" || a == "bt") {
|
||||
if (a == "bluetooth" || a == "bt" || a == "obex-prompt") {
|
||||
activeTab = NetTab::Bluetooth;
|
||||
} else if (a == "cell" || a == "cellular" || a == "apn" || a == "hotspot") {
|
||||
activeTab = NetTab::Cellular;
|
||||
@@ -1222,21 +1466,25 @@ int runNetworksApp(int argc, char** argv) {
|
||||
|
||||
drawPango(layoutIcon,
|
||||
btRx.state == "RECEIVED" ? &colGreen
|
||||
: (btRx.state == "RECEIVING" ? &colYellow : &colBlue),
|
||||
: ((btRx.state == "RECEIVING" || btRx.state == "PENDING") ? &colYellow : &colBlue),
|
||||
10, rxY, 22,
|
||||
btRx.state == "RECEIVED" ? kIconCheck : kIconFolderOpen);
|
||||
|
||||
if (btRx.state == "RECEIVING") {
|
||||
if (btRx.state == "PENDING") {
|
||||
drawPango(layoutSmall, &colYellow, 28, rxY, 22,
|
||||
"Incoming: " + btRx.fileName + " [Prompt]",
|
||||
kWinWidth - 34);
|
||||
} else if (btRx.state == "RECEIVING") {
|
||||
drawPango(layoutSmall, &colYellow, 28, rxY, 22,
|
||||
"Rx: " + btRx.fileName + " (" + btRx.detail + ")",
|
||||
kWinWidth - 34);
|
||||
} else if (btRx.state == "RECEIVED") {
|
||||
drawPango(layoutSmall, sel4 ? &colWhite : &colGreen, 28, rxY, 22,
|
||||
"Received: " + btRx.fileName + " [Open]",
|
||||
"Rx OK: " + btRx.fileName + " [Menu]",
|
||||
kWinWidth - 34);
|
||||
} else {
|
||||
drawPango(layoutSmall, sel4 ? &colWhite : &colMuted, 28, rxY, 22,
|
||||
"OBEX Receive: ~/Downloads [Open]",
|
||||
"OBEX Dir: " + shortenHomePath(readSavedObexDir()) + " [Set]",
|
||||
kWinWidth - 34);
|
||||
}
|
||||
|
||||
@@ -1472,6 +1720,88 @@ int runNetworksApp(int argc, char** argv) {
|
||||
"Independent from system hostname");
|
||||
|
||||
drawSoftkeyBar("Save", "Save", "Cancel");
|
||||
} else if (modal == NetModal::ObexActions) {
|
||||
XSetForeground(dpy, gc, pt.spec.bgOverlay);
|
||||
XFillRectangle(dpy, pix, gc, 10, 52, kWinWidth - 20, 162);
|
||||
XSetForeground(dpy, gc, pt.spec.accent);
|
||||
XDrawRectangle(dpy, pix, gc, 10, 52, kWinWidth - 21, 161);
|
||||
|
||||
drawPango(layoutMain, &colYellow, 18, 56, 22, "OBEX Target Folder", kWinWidth - 36);
|
||||
drawPango(layoutSmall, &colMuted, 18, 78, 18,
|
||||
tailFitPangoText(layoutSmall, shortenHomePath(readSavedObexDir()), kWinWidth - 36),
|
||||
kWinWidth - 36);
|
||||
const char* acts[3] = {
|
||||
"Set Target Directory...",
|
||||
"Open Folder in Files",
|
||||
"Reset to ~/Downloads",
|
||||
};
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
int ry = 102 + i * 34;
|
||||
bool isSel = (actionSel == i);
|
||||
XSetForeground(dpy, gc, isSel ? pt.spec.selBg : pt.spec.bgButton);
|
||||
XFillRectangle(dpy, pix, gc, 16, ry, kWinWidth - 32, 30);
|
||||
drawPango(layoutSmall, isSel ? &colWhite : &colLight,
|
||||
22, ry, 30, acts[i], kWinWidth - 44);
|
||||
}
|
||||
drawSoftkeyBar("Select", "OK", "Back");
|
||||
} else if (modal == NetModal::ObexDirPicker) {
|
||||
XSetForeground(dpy, gc, pt.spec.bgOverlay);
|
||||
XFillRectangle(dpy, pix, gc, 8, 28, kWinWidth - 16, 234);
|
||||
XSetForeground(dpy, gc, pt.spec.accent);
|
||||
XDrawRectangle(dpy, pix, gc, 8, 28, kWinWidth - 17, 233);
|
||||
|
||||
drawPango(layoutMain, &colYellow, 16, 32, 22, "Select Target Folder", kWinWidth - 32);
|
||||
drawPango(layoutSmall, &colBlue, 16, 54, 18,
|
||||
tailFitPangoText(layoutSmall, shortenHomePath(obexPickerDir), kWinWidth - 32),
|
||||
kWinWidth - 32);
|
||||
|
||||
const int listY = 76;
|
||||
const int rowH = 30;
|
||||
const int maxVis = 6;
|
||||
int startIdx = std::clamp(obexPickerSel - maxVis / 2, 0,
|
||||
std::max(0, static_cast<int>(obexPickerEntries.size()) - maxVis));
|
||||
for (int i = 0; i < maxVis && (startIdx + i) < static_cast<int>(obexPickerEntries.size()); ++i) {
|
||||
int idx = startIdx + i;
|
||||
int ry = listY + i * rowH;
|
||||
bool isSel = (obexPickerSel == idx);
|
||||
XSetForeground(dpy, gc, isSel ? pt.spec.selBg : pt.spec.bgButton);
|
||||
XFillRectangle(dpy, pix, gc, 14, ry, kWinWidth - 28, rowH - 2);
|
||||
XftColor* fg = isSel ? &colWhite : ((idx == 0) ? &colGreen : &colLight);
|
||||
drawPango(layoutSmall, fg, 20, ry, rowH - 2,
|
||||
obexPickerEntries[idx].first, kWinWidth - 40);
|
||||
}
|
||||
drawSoftkeyBar("Use Here", "Open", "Back");
|
||||
} else if (modal == NetModal::ObexIncomingPrompt) {
|
||||
XSetForeground(dpy, gc, pt.spec.bgOverlay);
|
||||
XFillRectangle(dpy, pix, gc, 8, 30, kWinWidth - 16, 230);
|
||||
XSetForeground(dpy, gc, pt.spec.accent);
|
||||
XDrawRectangle(dpy, pix, gc, 8, 30, kWinWidth - 17, 229);
|
||||
|
||||
drawPango(layoutMain, &colYellow, 16, 34, 22, "Incoming Bluetooth File", kWinWidth - 32);
|
||||
std::string fromLbl = "From: " + (obexPrompt.senderName.empty() ? obexPrompt.senderMac : obexPrompt.senderName);
|
||||
drawPango(layoutSmall, &colLight, 16, 58, 18,
|
||||
tailFitPangoText(layoutSmall, fromLbl, kWinWidth - 32), kWinWidth - 32);
|
||||
drawPango(layoutMain, &colWhite, 16, 78, 22,
|
||||
tailFitPangoText(layoutMain, obexPrompt.fileName, kWinWidth - 32), kWinWidth - 32);
|
||||
drawPango(layoutSmall, &colMuted, 16, 102, 18,
|
||||
"Size: " + formatBytesShort(obexPrompt.fileBytes), kWinWidth - 32);
|
||||
|
||||
std::string dirLabel = "Dir: " + shortenHomePath(obexPrompt.targetDir) + " [Set]";
|
||||
std::string pRows[3] = {
|
||||
"Accept & Save File",
|
||||
tailFitPangoText(layoutSmall, dirLabel, kWinWidth - 44),
|
||||
"Reject Transfer",
|
||||
};
|
||||
for (int i = 0; i < 3; ++i) {
|
||||
int ry = 126 + i * 38;
|
||||
bool isSel = (obexPromptSel == i);
|
||||
XSetForeground(dpy, gc, isSel ? pt.spec.selBg : pt.spec.bgButton);
|
||||
XFillRectangle(dpy, pix, gc, 14, ry, kWinWidth - 28, 34);
|
||||
XftColor* fg = isSel ? &colWhite
|
||||
: ((i == 0) ? &colGreen : ((i == 2) ? &colOrange : &colBlue));
|
||||
drawPango(layoutSmall, fg, 20, ry, 34, pRows[i], kWinWidth - 40);
|
||||
}
|
||||
drawSoftkeyBar("Accept", "Select", "Reject");
|
||||
}
|
||||
|
||||
if (!statusBanner.empty() && nowMs() < statusBannerUntilMs) {
|
||||
@@ -1516,6 +1846,11 @@ int runNetworksApp(int argc, char** argv) {
|
||||
|
||||
auto hideWindow = [&]() {
|
||||
if (!visible) return;
|
||||
if (modal == NetModal::ObexIncomingPrompt && obexPrompt.active) {
|
||||
writeObexDecision(obexPrompt.reqId, false, obexPrompt.targetDir);
|
||||
obexPrompt.active = false;
|
||||
}
|
||||
openedForObexPrompt = false;
|
||||
int xfdLocal = ConnectionNumber(dpy);
|
||||
int64_t drainDeadline = nowMs() + 180;
|
||||
while (nowMs() < drainDeadline && querySoftkeysDown(dpy) != 0) {
|
||||
@@ -1537,6 +1872,54 @@ int runNetworksApp(int argc, char** argv) {
|
||||
::unlink(activePidPath.c_str());
|
||||
};
|
||||
|
||||
auto resolveObexPrompt = [&](bool accept) {
|
||||
if (obexPrompt.active) {
|
||||
std::string dest = obexPrompt.targetDir.empty() ? readSavedObexDir() : obexPrompt.targetDir;
|
||||
writeObexDecision(obexPrompt.reqId, accept, dest);
|
||||
obexPrompt.active = false;
|
||||
}
|
||||
modal = NetModal::None;
|
||||
if (openedForObexPrompt) {
|
||||
openedForObexPrompt = false;
|
||||
hideWindow();
|
||||
} else {
|
||||
btRx = readBtRxStatus();
|
||||
setBanner(accept ? ("Receiving to " + shortenHomePath(obexPrompt.targetDir))
|
||||
: "Transfer rejected");
|
||||
render();
|
||||
}
|
||||
};
|
||||
|
||||
auto tryPresentObexPrompt = [&](bool forceMarkOpened = false) {
|
||||
ObexPromptInfo p = readObexPromptFile();
|
||||
if (!p.active) {
|
||||
pendingDeferredObexPrompt = false;
|
||||
return;
|
||||
}
|
||||
if (isPhonePasscodeLocked() || isPidFileAlive(getRuntimeFile("xlocker.pid")) ||
|
||||
isCallActiveOrRingingFast() || isLidClosedState()) {
|
||||
pendingDeferredObexPrompt = true;
|
||||
return;
|
||||
}
|
||||
pendingDeferredObexPrompt = false;
|
||||
bool wasVisible = visible;
|
||||
obexPrompt = p;
|
||||
if (obexPrompt.targetDir.empty()) {
|
||||
obexPrompt.targetDir = readSavedObexDir();
|
||||
}
|
||||
obexPromptSel = 0;
|
||||
if (!wasVisible) {
|
||||
openedForObexPrompt = true;
|
||||
showWindow("bluetooth");
|
||||
} else {
|
||||
if (forceMarkOpened) openedForObexPrompt = true;
|
||||
activeTab = NetTab::Bluetooth;
|
||||
}
|
||||
wakeDisplayForObex(dpy);
|
||||
modal = NetModal::ObexIncomingPrompt;
|
||||
render();
|
||||
};
|
||||
|
||||
auto connectWifiNow = [&](const std::string& ssid, const std::string& pass) {
|
||||
modal = NetModal::None;
|
||||
setBanner("Connecting to " + ssid + "...");
|
||||
@@ -1648,15 +2031,32 @@ int runNetworksApp(int argc, char** argv) {
|
||||
writeSavedBtDiscoverable(nextDisc);
|
||||
btCtrl.discoverable = nextDisc;
|
||||
if (btOn) {
|
||||
runCaptureCmd("timeout 2 bluetoothctl discoverable-timeout 0 >/dev/null 2>&1; "
|
||||
runCaptureCmd("timeout 2 bluetoothctl discoverable-timeout 60 >/dev/null 2>&1; " +
|
||||
std::string(nextDisc ? "timeout 2 bluetoothctl pairable on >/dev/null 2>&1; " : "") +
|
||||
"timeout 2 bluetoothctl discoverable " +
|
||||
std::string(nextDisc ? "on" : "off") + " >/dev/null 2>&1");
|
||||
}
|
||||
refreshCurrentTab(false);
|
||||
setBanner(nextDisc ? "Bluetooth: Visible to nearby devices"
|
||||
setBanner(nextDisc ? "Bluetooth: Visible for 60s"
|
||||
: "Bluetooth: Hidden from discovery");
|
||||
};
|
||||
|
||||
auto refreshTargetBtFromList = [&]() {
|
||||
const BtDeviceEntry* best = nullptr;
|
||||
for (const auto& d : btList) {
|
||||
bool macMatch = (d.mac == targetBt.mac);
|
||||
bool nameMatch = (!targetBt.name.empty() && d.name == targetBt.name);
|
||||
if (!macMatch && !nameMatch) continue;
|
||||
if (!best || (d.connected && !best->connected) ||
|
||||
(d.connected == best->connected && d.kind == BtDevKind::Audio &&
|
||||
best->kind != BtDevKind::Audio) ||
|
||||
(macMatch && best->mac != targetBt.mac && !d.connected)) {
|
||||
best = &d;
|
||||
}
|
||||
}
|
||||
if (best) targetBt = *best;
|
||||
};
|
||||
|
||||
auto executeBtAction = [&](int act) {
|
||||
modal = NetModal::None;
|
||||
int rc = 0;
|
||||
@@ -1667,13 +2067,8 @@ int runNetworksApp(int argc, char** argv) {
|
||||
shellQuote(targetBt.mac) + " " +
|
||||
shellQuote(targetBt.name) + " >/dev/null 2>&1", &rc);
|
||||
refreshCurrentTab(false);
|
||||
bool isConn = (rc == 0);
|
||||
for (const auto& d : btList) {
|
||||
if ((d.mac == targetBt.mac || d.name == targetBt.name) && d.connected) {
|
||||
isConn = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
refreshTargetBtFromList();
|
||||
bool isConn = (rc == 0) || targetBt.connected;
|
||||
if (isConn && targetBt.kind == BtDevKind::Audio) {
|
||||
std::ofstream ofs("/tmp/sxmo_audio_out_device", std::ios::trunc);
|
||||
if (ofs) ofs << "Bluetooth\n";
|
||||
@@ -1698,14 +2093,8 @@ int runNetworksApp(int argc, char** argv) {
|
||||
shellQuote(targetBt.mac) + " " +
|
||||
shellQuote(targetBt.name) + " >/dev/null 2>&1", &rc);
|
||||
refreshCurrentTab(false);
|
||||
bool isPairedOrConn = (rc == 0);
|
||||
for (const auto& d : btList) {
|
||||
if ((d.mac == targetBt.mac || d.name == targetBt.name) &&
|
||||
(d.connected || d.paired)) {
|
||||
isPairedOrConn = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
refreshTargetBtFromList();
|
||||
bool isPairedOrConn = (rc == 0) || targetBt.connected || targetBt.paired;
|
||||
if (isPairedOrConn && targetBt.kind == BtDevKind::Audio) {
|
||||
std::ofstream ofs("/tmp/sxmo_audio_out_device", std::ios::trunc);
|
||||
if (ofs) ofs << "Bluetooth\n";
|
||||
@@ -1791,6 +2180,45 @@ int runNetworksApp(int argc, char** argv) {
|
||||
saveBtDeviceName();
|
||||
return;
|
||||
}
|
||||
if (modal == NetModal::ObexActions) {
|
||||
if (actionSel == 0) {
|
||||
openObexDirPicker(readSavedObexDir(), false);
|
||||
} else if (actionSel == 1) {
|
||||
std::string target = (!btRx.savedPath.empty()) ? btRx.savedPath : readSavedObexDir();
|
||||
::mkdir(readSavedObexDir().c_str(), 0755);
|
||||
modal = NetModal::None;
|
||||
hideWindow();
|
||||
if (!sendPluginCommand("files", "OPEN " + target)) {
|
||||
runAsyncArgv("xfiles", target.c_str());
|
||||
}
|
||||
} else {
|
||||
std::string defDir = getHomeDir() + "/Downloads";
|
||||
writeSavedObexDir(defDir);
|
||||
btRx = readBtRxStatus();
|
||||
modal = NetModal::None;
|
||||
setBanner("OBEX folder reset to ~/Downloads");
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (modal == NetModal::ObexDirPicker) {
|
||||
if (obexPickerSel == 0) {
|
||||
commitObexPickerSelection();
|
||||
} else if (obexPickerSel >= 0 &&
|
||||
obexPickerSel < static_cast<int>(obexPickerEntries.size())) {
|
||||
loadObexPickerDir(obexPickerEntries[obexPickerSel].second);
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (modal == NetModal::ObexIncomingPrompt) {
|
||||
if (obexPromptSel == 0) {
|
||||
resolveObexPrompt(true);
|
||||
} else if (obexPromptSel == 1) {
|
||||
openObexDirPicker(obexPrompt.targetDir, true);
|
||||
} else {
|
||||
resolveObexPrompt(false);
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
if (activeTab == NetTab::Wifi) {
|
||||
if (wifiRowSel == 0) {
|
||||
@@ -1890,13 +2318,11 @@ int runNetworksApp(int argc, char** argv) {
|
||||
refreshCurrentTab(true);
|
||||
setBanner("Found " + std::to_string(btList.size()) + " device(s)");
|
||||
} else if (btRowSel == 4 && btOn) {
|
||||
std::string target = (!btRx.savedPath.empty())
|
||||
? btRx.savedPath
|
||||
: (getHomeDirPath() + "/Downloads");
|
||||
::mkdir((getHomeDirPath() + "/Downloads").c_str(), 0755);
|
||||
hideWindow();
|
||||
if (!sendPluginCommand("files", "OPEN " + target)) {
|
||||
runAsyncArgv("xfiles", target.c_str());
|
||||
if (readObexPromptFile().active) {
|
||||
tryPresentObexPrompt();
|
||||
} else {
|
||||
actionSel = 0;
|
||||
modal = NetModal::ObexActions;
|
||||
}
|
||||
} else if (btOn && btRowSel - 5 >= 0 &&
|
||||
btRowSel - 5 < static_cast<int>(btList.size())) {
|
||||
@@ -1916,6 +2342,14 @@ int runNetworksApp(int argc, char** argv) {
|
||||
saveBtDeviceName();
|
||||
return;
|
||||
}
|
||||
if (modal == NetModal::ObexDirPicker) {
|
||||
commitObexPickerSelection();
|
||||
return;
|
||||
}
|
||||
if (modal == NetModal::ObexIncomingPrompt) {
|
||||
resolveObexPrompt(true);
|
||||
return;
|
||||
}
|
||||
if (modal != NetModal::None) {
|
||||
handleEnterKey();
|
||||
return;
|
||||
@@ -1944,6 +2378,14 @@ int runNetworksApp(int argc, char** argv) {
|
||||
};
|
||||
|
||||
auto handleRightSoftkey = [&]() {
|
||||
if (modal == NetModal::ObexIncomingPrompt) {
|
||||
resolveObexPrompt(false);
|
||||
return;
|
||||
}
|
||||
if (modal == NetModal::ObexDirPicker) {
|
||||
modal = obexPickerForPrompt ? NetModal::ObexIncomingPrompt : NetModal::ObexActions;
|
||||
return;
|
||||
}
|
||||
if (modal != NetModal::None) {
|
||||
modal = NetModal::None;
|
||||
return;
|
||||
@@ -1953,6 +2395,9 @@ int runNetworksApp(int argc, char** argv) {
|
||||
|
||||
if (!isPreload) {
|
||||
showWindow(openArg);
|
||||
if (toLowerStr(trimStr(openArg)) == "obex-prompt") {
|
||||
tryPresentObexPrompt(true);
|
||||
}
|
||||
}
|
||||
|
||||
int xfd = ConnectionNumber(dpy);
|
||||
@@ -2012,7 +2457,11 @@ int runNetworksApp(int argc, char** argv) {
|
||||
}
|
||||
|
||||
if (sym == XF86XK_HangupPhone || sym == XK_Cancel) {
|
||||
hideWindow();
|
||||
if (modal == NetModal::ObexIncomingPrompt) {
|
||||
resolveObexPrompt(false);
|
||||
} else {
|
||||
hideWindow();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -2074,8 +2523,10 @@ int runNetworksApp(int argc, char** argv) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (modal == NetModal::WifiActions || modal == NetModal::BtActions) {
|
||||
int actCount = (modal == NetModal::BtActions) ? 5 : 4;
|
||||
if (modal == NetModal::WifiActions || modal == NetModal::BtActions ||
|
||||
modal == NetModal::ObexActions) {
|
||||
int actCount = (modal == NetModal::BtActions) ? 5
|
||||
: ((modal == NetModal::ObexActions) ? 3 : 4);
|
||||
if (sym == XK_Up || sym == XK_KP_Up) {
|
||||
actionSel = (actionSel + actCount - 1) % actCount;
|
||||
render();
|
||||
@@ -2089,8 +2540,65 @@ int runNetworksApp(int argc, char** argv) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (modal == NetModal::ObexDirPicker) {
|
||||
int total = static_cast<int>(obexPickerEntries.size());
|
||||
if ((sym == XK_Up || sym == XK_KP_Up) && total > 0) {
|
||||
obexPickerSel = (obexPickerSel + total - 1) % total;
|
||||
render();
|
||||
} else if ((sym == XK_Down || sym == XK_KP_Down) && total > 0) {
|
||||
obexPickerSel = (obexPickerSel + 1) % total;
|
||||
render();
|
||||
} else if (sym == XK_Left || sym == XK_KP_Left || sym == XK_BackSpace) {
|
||||
std::string minRoot = isDuressMode() ? std::string(kDuressHomeDirPath) : "/";
|
||||
if (obexPickerDir != minRoot && obexPickerDir != "/") {
|
||||
size_t sl = obexPickerDir.rfind('/');
|
||||
std::string parent = (sl == 0 || sl == std::string::npos) ? "/" : obexPickerDir.substr(0, sl);
|
||||
loadObexPickerDir(parent);
|
||||
render();
|
||||
}
|
||||
} else if (sym == XK_Right || sym == XK_KP_Right) {
|
||||
if (obexPickerSel > 0 && obexPickerSel < total) {
|
||||
loadObexPickerDir(obexPickerEntries[obexPickerSel].second);
|
||||
render();
|
||||
}
|
||||
} else if (sym == XK_Return || sym == XK_KP_Enter) {
|
||||
handleEnterKey();
|
||||
render();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (modal == NetModal::ObexIncomingPrompt) {
|
||||
char pdch = mapDialKey(sym, kc, ev.xkey.state);
|
||||
if (sym == XK_Up || sym == XK_KP_Up) {
|
||||
obexPromptSel = (obexPromptSel + 2) % 3;
|
||||
render();
|
||||
} else if (sym == XK_Down || sym == XK_KP_Down) {
|
||||
obexPromptSel = (obexPromptSel + 1) % 3;
|
||||
render();
|
||||
} else if ((sym == XK_Left || sym == XK_KP_Left ||
|
||||
sym == XK_Right || sym == XK_KP_Right || pdch == '*') &&
|
||||
obexPromptSel == 1) {
|
||||
openObexDirPicker(obexPrompt.targetDir, true);
|
||||
render();
|
||||
} else if (sym == XK_Return || sym == XK_KP_Enter) {
|
||||
handleEnterKey();
|
||||
render();
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// Main View Tab & Row Navigation
|
||||
char dch = mapDialKey(sym, kc, ev.xkey.state);
|
||||
if (dch == '#' && activeTab == NetTab::Bluetooth && btOn) {
|
||||
std::string target = (!btRx.savedPath.empty()) ? btRx.savedPath : readSavedObexDir();
|
||||
::mkdir(readSavedObexDir().c_str(), 0755);
|
||||
hideWindow();
|
||||
if (!sendPluginCommand("files", "OPEN " + target)) {
|
||||
runAsyncArgv("xfiles", target.c_str());
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (dch == '1') {
|
||||
activeTab = NetTab::Wifi;
|
||||
refreshCurrentTab(false);
|
||||
@@ -2190,6 +2698,29 @@ int runNetworksApp(int argc, char** argv) {
|
||||
}
|
||||
}
|
||||
|
||||
if (pendingDeferredObexPrompt) {
|
||||
tryPresentObexPrompt();
|
||||
if (pendingDeferredObexPrompt && (timeoutMs < 0 || timeoutMs > 300)) {
|
||||
timeoutMs = 300;
|
||||
}
|
||||
}
|
||||
if (modal == NetModal::ObexIncomingPrompt) {
|
||||
if (!readObexPromptFile().active) {
|
||||
obexPrompt.active = false;
|
||||
modal = NetModal::None;
|
||||
if (openedForObexPrompt) {
|
||||
openedForObexPrompt = false;
|
||||
hideWindow();
|
||||
} else {
|
||||
btRx = readBtRxStatus();
|
||||
setBanner("Transfer timed out or cancelled");
|
||||
render();
|
||||
}
|
||||
} else if (timeoutMs < 0 || timeoutMs > 300) {
|
||||
timeoutMs = 300;
|
||||
}
|
||||
}
|
||||
|
||||
struct pollfd pfds[2];
|
||||
pfds[0].fd = xfd;
|
||||
pfds[0].events = POLLIN;
|
||||
@@ -2210,12 +2741,17 @@ int runNetworksApp(int argc, char** argv) {
|
||||
refreshCurrentTab(false);
|
||||
}
|
||||
if (visible) render();
|
||||
} else if (cmd.rfind("OBEX_PROMPT", 0) == 0) {
|
||||
tryPresentObexPrompt();
|
||||
} else if (cmd == "TOGGLE") {
|
||||
if (visible) hideWindow();
|
||||
else showWindow();
|
||||
} else if (cmd.rfind("OPEN", 0) == 0) {
|
||||
std::string arg = (cmd.size() > 5) ? trimStr(cmd.substr(5)) : "";
|
||||
showWindow(arg);
|
||||
if (toLowerStr(arg) == "obex-prompt") {
|
||||
tryPresentObexPrompt(true);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -197,6 +197,15 @@ static int is_non_speaker_name(const char* s) {
|
||||
}
|
||||
|
||||
static int is_non_speaker_audio_route(void) {
|
||||
FILE* sco_fp = fopen("/tmp/sxmo_bt_sco_mm_active", "r");
|
||||
if (sco_fp) {
|
||||
int ch = fgetc(sco_fp);
|
||||
fclose(sco_fp);
|
||||
if (ch == '1') {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
|
||||
char buf[128];
|
||||
const char* paths[2];
|
||||
char cfg_dir[448];
|
||||
|
||||
Reference in new issue
Block a user