Release a1111 (lennon): isolate nokia-argon slider from 2720 Flip cover stack
- Write /usr/share/bananarchy/lid-profile per target in apply-bananarchy-overlay.sh (slider on nokia-argon, flip on nokia-beatles, none elsewhere), disable flip runlevel services, cover udev/config, and mux module loads on non-flip builds, and exit 0 immediately in flip daemons/init scripts when lid-profile != flip - Guard startup Escape grab cleanup when locked and gate lid-state checks in display-power-sync, locker.so, and callscreen.so on lid-profile == flip so nokia-argon keeps pure a1108 sliding-lid behaviour - Ship active-high shared cover backlight (kernel_backlight_invert = 0), active-black internal panel isolation (kernel_internal_sleep = 0), pixel-centered 240x240 cover UI, SW_LID hall sync, and shared Screen blank timeout on nokia-beatles - Pin verified a1111 (lennon) image hashes for both nokia-argon and nokia-beatles and synchronize docs and host tests
This commit is contained in:
1 parent
7a2b965ce3
commit
83c8db10f1
38 files changed
+1351
-276
No files matched your search
@@ -301,6 +301,25 @@ void finalizeWavHeader(const std::string& path) {
|
||||
}
|
||||
|
||||
void wakeDisplayHardware(Display* dpy) {
|
||||
int profFd = ::open("/usr/share/bananarchy/lid-profile", O_RDONLY | O_CLOEXEC);
|
||||
bool isFlip = false;
|
||||
if (profFd >= 0) {
|
||||
char profBuf[16] {};
|
||||
ssize_t pn = ::read(profFd, profBuf, sizeof(profBuf) - 1);
|
||||
::close(profFd);
|
||||
isFlip = (pn >= 4 && std::strncmp(profBuf, "flip", 4) == 0 &&
|
||||
(profBuf[4] == '\0' || profBuf[4] == '\n' || profBuf[4] == '\r'));
|
||||
}
|
||||
int lidFd = isFlip ? ::open("/run/bananarchy/lid-state", O_RDONLY | O_CLOEXEC) : -1;
|
||||
if (lidFd >= 0) {
|
||||
char lidBuf[32] {};
|
||||
ssize_t n = ::read(lidFd, lidBuf, sizeof(lidBuf) - 1);
|
||||
::close(lidFd);
|
||||
if (n >= 6 && std::strncmp(lidBuf, "closed", 6) == 0) {
|
||||
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);
|
||||
|
||||
@@ -84,12 +84,26 @@ void writeSysfsStr(const char* path, const char* val) {
|
||||
}
|
||||
}
|
||||
|
||||
bool isLidClosed() {
|
||||
return readSmallFileTrimmed("/usr/share/bananarchy/lid-profile") == "flip" &&
|
||||
readSmallFileTrimmed("/run/bananarchy/lid-state") == "closed";
|
||||
}
|
||||
|
||||
bool isScreenBlanked() {
|
||||
if (isLidClosed()) {
|
||||
return true;
|
||||
}
|
||||
std::string br = readSmallFileTrimmed("/sys/class/backlight/backlight/brightness");
|
||||
return (!br.empty() && std::atoi(br.c_str()) <= 0);
|
||||
}
|
||||
|
||||
void blankScreenBacklight() {
|
||||
if (isLidClosed() &&
|
||||
readSmallFileTrimmed("/run/bananarchy/cover-backlight") == "1") {
|
||||
writeSysfsStr("/sys/class/leds/white:kbd_backlight/brightness", "0");
|
||||
writeSysfsStr("/sys/devices/system/cpu/cpufreq/policy0/scaling_governor", "powersave");
|
||||
return;
|
||||
}
|
||||
std::string cur = readSmallFileTrimmed("/sys/class/backlight/backlight/brightness");
|
||||
if (!cur.empty() && std::atoi(cur.c_str()) >= 1) {
|
||||
std::string line = std::to_string(std::atoi(cur.c_str())) + "\n";
|
||||
@@ -102,6 +116,10 @@ void blankScreenBacklight() {
|
||||
}
|
||||
|
||||
void wakeScreenBacklight() {
|
||||
if (isLidClosed()) {
|
||||
runAsyncArgv("/usr/bin/bananarchy-lid-gate.sh", "wake");
|
||||
return;
|
||||
}
|
||||
writeSysfsStr("/sys/devices/system/cpu/cpufreq/policy0/scaling_governor", "schedutil");
|
||||
std::string cur = readSmallFileTrimmed("/tmp/sxmo_saved_brightness");
|
||||
int val = std::atoi(cur.c_str());
|
||||
@@ -575,7 +593,9 @@ int locker_run_main(int argc, char** argv) {
|
||||
if (!visible || isCallScreenVisible()) {
|
||||
return;
|
||||
}
|
||||
XRaiseWindow(dpy, win);
|
||||
if (!isLidClosed()) {
|
||||
XRaiseWindow(dpy, win);
|
||||
}
|
||||
XSetInputFocus(dpy, win, RevertToParent, CurrentTime);
|
||||
XFlush(dpy);
|
||||
grabHeld = false;
|
||||
@@ -814,10 +834,11 @@ int locker_run_main(int argc, char** argv) {
|
||||
if (!visible) {
|
||||
XMapRaised(dpy, win);
|
||||
XMoveResizeWindow(dpy, win, 0, 0, kScreenWidth, kScreenHeight);
|
||||
XSync(dpy, False);
|
||||
visible = true;
|
||||
}
|
||||
grabLockerInput();
|
||||
if (blankDisplay) {
|
||||
if (blankDisplay || isLidClosed()) {
|
||||
setSxmoStateFile("screenoff");
|
||||
blankScreenBacklight();
|
||||
wasScreenBlanked = true;
|
||||
@@ -873,7 +894,7 @@ int locker_run_main(int argc, char** argv) {
|
||||
};
|
||||
|
||||
auto handleKeyInput = [&](unsigned int kc, unsigned int state, KeySym sym) {
|
||||
if (!visible) {
|
||||
if (!visible || isLidClosed()) {
|
||||
return;
|
||||
}
|
||||
int64_t now = nowMs();
|
||||
@@ -1035,6 +1056,10 @@ int locker_run_main(int argc, char** argv) {
|
||||
continue;
|
||||
}
|
||||
if (cmd == "WAKE") {
|
||||
if (isLidClosed()) {
|
||||
runAsyncArgv("/usr/bin/bananarchy-lid-gate.sh", "wake");
|
||||
continue;
|
||||
}
|
||||
if (::access(kLockFlagPath, F_OK) == 0 || visible) {
|
||||
if (!visible) {
|
||||
lockPhone(false);
|
||||
@@ -1119,7 +1144,8 @@ int locker_run_main(int argc, char** argv) {
|
||||
} else if (!callNow && callWasActive) {
|
||||
grabLockerInput();
|
||||
render();
|
||||
} else if (!callNow && !grabHeld && !isScreenBlanked()) {
|
||||
} else if (!callNow && !grabHeld &&
|
||||
(!isScreenBlanked() || isLidClosed())) {
|
||||
grabLockerInput();
|
||||
}
|
||||
callWasActive = callNow;
|
||||
|
||||
Reference in new issue
Block a user