mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-06 04:55:44 +00:00
Merge remote-tracking branch 'droiddeck/main' into pr-3650
This commit is contained in:
commit
6be30d07b4
120 files changed
+3043
-731
No files matched your search
@@ -113,7 +113,7 @@ DroidDeck is [GPL-3.0](LICENSE). Steam and Proton belong to Valve Corporation. V
|
||||
- Steam audio goes through [@The412Banner](https://github.com/The412Banner)'s [DirectAudio](https://github.com/The412Banner/directaudio) PulseAudio sink (LGPL-2.1-or-later), built from `tools/directaudio/sink`.
|
||||
- The DroidDeck HUD is [@The412Banner](https://github.com/The412Banner)'s [FusionHUD](https://github.com/The412Banner/FusionHUD) (GPL-3.0 with an attribution term). Its readings match Valve's [MangoHud](https://github.com/flightlessmango/MangoHud) build (MIT), with frame times from gamescope patch 0125.
|
||||
- The HUD's CPU, GPU load, thermal and battery readers come from [@xXJSONDeruloXx](https://github.com/xXJSONDeruloXx)'s work.
|
||||
- LSFG frame generation comes from Camille LaVey and the [Eden](https://eden-emu.dev) project, following [lsfg-vk](https://github.com/PancakeTAS/lsfg-vk), ported by [@maxjivi05](https://github.com/maxjivi05). It needs your own copy of [Lossless Scaling](https://store.steampowered.com/app/993090/) and ships none of its shaders.
|
||||
- LSFG frame generation comes from Camille LaVey and the [Eden](https://eden-emu.dev) project, following [lsfg-vk](https://github.com/PancakeTAS/lsfg-vk), ported by [@maxjivi05](https://github.com/maxjivi05). It requires [Lossless Scaling](https://store.steampowered.com/app/993090/) installed through Steam and ships none of its shaders.
|
||||
- Black frame insertion follows the design of [@artzox](https://github.com/artzox)'s [BFI Presenter](https://github.com/artzox/BFI-Presenter) (GPL-3.0): the strobe runs on the display's refresh clock and the game is paced to the lit refresh. Both build on [Blur Busters](https://blurbusters.com)' research on MPRT and motion blur. No BFI Presenter code is used.
|
||||
- Remote Play decodes through Android's MediaCodec or the [FFmpeg](https://ffmpeg.org) (LGPL-2.1-or-later) in Steam's runtime. Qualcomm low latency settings follow [Moonlight](https://github.com/moonlight-stream/moonlight-android) (GPL-3.0).
|
||||
- [PipeWire](https://gitlab.freedesktop.org/pipewire/pipewire) (MIT) sockets use the settings in its `module-access.c`, and [WirePlumber](https://gitlab.freedesktop.org/pipewire/wireplumber) (MIT) keeps those clients at full permissions.
|
||||
|
||||
@@ -59,7 +59,7 @@ internal fun sampleState(
|
||||
internal val sampleActions: FrontEndActions = FrontEndActions(
|
||||
onPlay = {}, onPlayDesktopUi = {}, onSteamGame = {}, onDesktop = {}, onEmulator = {}, onRom = {}, onResume = {},
|
||||
onSteamSettings = {}, onDesktopSettings = {}, onInstallPackage = {}, onRemovePackage = {}, onRuntime = {},
|
||||
onFrameGenPick = {}, onImportLossless = {}, onProtons = {}, onComponents = {}, onPerformance = {}, onRoms = {},
|
||||
onFrameGenPick = {}, onProtons = {}, onComponents = {}, onPerformance = {}, onRoms = {},
|
||||
onFiles = {}, onLogs = {}, onOffline = {},
|
||||
onSetPhantomProcessLimit = { _, _ -> },
|
||||
)
|
||||
@@ -82,7 +82,7 @@ internal fun sampleDrawerActions(
|
||||
secondScreenDisplays = listOfNotNull(secondScreen?.let { SecondScreenDisplay(2, "Built-in · 1240×1080") }),
|
||||
selectedSecondScreenDisplay = if (secondScreen != null) 2 else -1, onSecondScreenDisplay = {},
|
||||
gameSwapAvailable = secondScreen != null, dashboardAvailable = secondScreen != null,
|
||||
onImportLossless = {}, onKeyboard = {}, onHardwareKeyboard = {},
|
||||
onKeyboard = {}, onHardwareKeyboard = {},
|
||||
onSteamMenu = if (steam) ({}) else null, onQam = if (steam) ({}) else null,
|
||||
onLaunchAndroidApp = { _, _ -> }, onBackground = {}, onShareLogs = {}, onStop = {}, onClose = {},
|
||||
)
|
||||
@@ -28,6 +28,19 @@ float_code() {
|
||||
[ "$result" = ok ]
|
||||
}
|
||||
|
||||
# git pushes through gh's sign-in and commits as the signed-in account, with its no-reply address.
|
||||
configure_git() {
|
||||
gh auth setup-git || return 1
|
||||
[ -n "$(git config --global user.name)" ] && [ -n "$(git config --global user.email)" ] && return 0
|
||||
local user id login name
|
||||
user=$(gh api user -q '"\(.id) \(.login) \(.name // .login)"') || return 1
|
||||
read -r id login name <<<"$user"
|
||||
[ -n "$id" ] && [ -n "$login" ] || return 1
|
||||
[ -n "$(git config --global user.name)" ] || git config --global user.name "${name:-$login}"
|
||||
[ -n "$(git config --global user.email)" ] || git config --global user.email "$id+$login@users.noreply.github.com"
|
||||
}
|
||||
if [ "${1:-}" = --git ]; then configure_git; exit; fi
|
||||
|
||||
coproc GH { BROWSER=true gh auth login --hostname github.com --git-protocol https --web 2>&1; }
|
||||
gh_pid=$GH_PID
|
||||
exec {ghout}<&"${GH[0]}" {ghin}>&"${GH[1]}"
|
||||
@@ -48,5 +61,9 @@ while IFS= read -r line <&"$ghout"; do
|
||||
done
|
||||
wait "$gh_pid"
|
||||
status=$?
|
||||
if [ $status = 0 ] && ! configure_git; then
|
||||
echo "Signed in, but git could not be set up: run dd-gh-login --git"
|
||||
status=1
|
||||
fi
|
||||
[ -n "$shown" ] && [ -n "$inbox" ] && [ -d "$inbox" ] && : > "$inbox/device-code"
|
||||
exit $status
|
||||
@@ -42,6 +42,11 @@ add_library(droiddeckwayland SHARED
|
||||
src/hudframes.c
|
||||
src/hudframes_jni.c
|
||||
)
|
||||
option(DROIDDECK_FRAME_ACQUIRE_PROBE "Build opt-in signaled producer acquire protocol support" ON)
|
||||
if (DROIDDECK_FRAME_ACQUIRE_PROBE)
|
||||
target_sources(droiddeckwayland PRIVATE generated/droiddeck-frame-acquire-v1-protocol.c)
|
||||
target_compile_definitions(droiddeckwayland PRIVATE DROIDDECK_FRAME_ACQUIRE_PROBE=1)
|
||||
endif()
|
||||
target_compile_options(droiddeckwayland PRIVATE
|
||||
$<$<COMPILE_LANGUAGE:C>:-Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers>)
|
||||
target_include_directories(droiddeckwayland PRIVATE
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
/* Generated by wayland-scanner 1.22.0 */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdint.h>
|
||||
#include "wayland-util.h"
|
||||
|
||||
#ifndef __has_attribute
|
||||
# define __has_attribute(x) 0 /* Compatibility with non-clang compilers. */
|
||||
#endif
|
||||
|
||||
#if (__has_attribute(visibility) || defined(__GNUC__) && __GNUC__ >= 4)
|
||||
#define WL_PRIVATE __attribute__ ((visibility("hidden")))
|
||||
#else
|
||||
#define WL_PRIVATE
|
||||
#endif
|
||||
|
||||
extern const struct wl_interface wl_buffer_interface;
|
||||
extern const struct wl_interface wl_surface_interface;
|
||||
|
||||
static const struct wl_interface *droiddeck_frame_acquire_v1_types[] = {
|
||||
&wl_surface_interface,
|
||||
&wl_buffer_interface,
|
||||
NULL,
|
||||
};
|
||||
|
||||
static const struct wl_message droiddeck_frame_acquire_v1_requests[] = {
|
||||
{ "destroy", "", droiddeck_frame_acquire_v1_types + 0 },
|
||||
{ "set_acquire_fence", "ooh", droiddeck_frame_acquire_v1_types + 0 },
|
||||
};
|
||||
|
||||
WL_PRIVATE const struct wl_interface droiddeck_frame_acquire_v1_interface = {
|
||||
"droiddeck_frame_acquire_v1", 1,
|
||||
2, droiddeck_frame_acquire_v1_requests,
|
||||
0, NULL,
|
||||
};
|
||||
@@ -0,0 +1,128 @@
|
||||
/* Generated by wayland-scanner 1.22.0 */
|
||||
|
||||
#ifndef DROIDDECK_FRAME_ACQUIRE_V1_SERVER_PROTOCOL_H
|
||||
#define DROIDDECK_FRAME_ACQUIRE_V1_SERVER_PROTOCOL_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stddef.h>
|
||||
#include "wayland-server.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
struct wl_client;
|
||||
struct wl_resource;
|
||||
|
||||
/**
|
||||
* @page page_droiddeck_frame_acquire_v1 The droiddeck_frame_acquire_v1 protocol
|
||||
* @section page_ifaces_droiddeck_frame_acquire_v1 Interfaces
|
||||
* - @subpage page_iface_droiddeck_frame_acquire_v1 - DroidDeck producer write completion for a single Wayland attachment
|
||||
*/
|
||||
struct droiddeck_frame_acquire_v1;
|
||||
struct wl_buffer;
|
||||
struct wl_surface;
|
||||
|
||||
#ifndef DROIDDECK_FRAME_ACQUIRE_V1_INTERFACE
|
||||
#define DROIDDECK_FRAME_ACQUIRE_V1_INTERFACE
|
||||
/**
|
||||
* @page page_iface_droiddeck_frame_acquire_v1 droiddeck_frame_acquire_v1
|
||||
* @section page_iface_droiddeck_frame_acquire_v1_desc Description
|
||||
*
|
||||
* Optional explicit acquire sideband independent of DRM syncobj and buffer
|
||||
* allocation. Binding does not opt the client out of ordinary wl_buffer
|
||||
* release or existing synchronization protocols. The server advertises it
|
||||
* only when it implements all semantics for the selected display path.
|
||||
* @section page_iface_droiddeck_frame_acquire_v1_api API
|
||||
* See @ref iface_droiddeck_frame_acquire_v1.
|
||||
*/
|
||||
/**
|
||||
* @defgroup iface_droiddeck_frame_acquire_v1 The droiddeck_frame_acquire_v1 interface
|
||||
*
|
||||
* Optional explicit acquire sideband independent of DRM syncobj and buffer
|
||||
* allocation. Binding does not opt the client out of ordinary wl_buffer
|
||||
* release or existing synchronization protocols. The server advertises it
|
||||
* only when it implements all semantics for the selected display path.
|
||||
*/
|
||||
extern const struct wl_interface droiddeck_frame_acquire_v1_interface;
|
||||
#endif
|
||||
|
||||
#ifndef DROIDDECK_FRAME_ACQUIRE_V1_ERROR_ENUM
|
||||
#define DROIDDECK_FRAME_ACQUIRE_V1_ERROR_ENUM
|
||||
enum droiddeck_frame_acquire_v1_error {
|
||||
/**
|
||||
* not the same client's pending DMA-BUF attachment
|
||||
*/
|
||||
DROIDDECK_FRAME_ACQUIRE_V1_ERROR_INVALID_ATTACHMENT = 0,
|
||||
/**
|
||||
* that attachment already has an acquire fence
|
||||
*/
|
||||
DROIDDECK_FRAME_ACQUIRE_V1_ERROR_DUPLICATE_FENCE = 1,
|
||||
/**
|
||||
* not a real successfully signaled Linux sync_file
|
||||
*/
|
||||
DROIDDECK_FRAME_ACQUIRE_V1_ERROR_INVALID_FENCE = 2,
|
||||
/**
|
||||
* not the paired test peer
|
||||
*/
|
||||
DROIDDECK_FRAME_ACQUIRE_V1_ERROR_UNAUTHORIZED_PEER = 3,
|
||||
};
|
||||
#endif /* DROIDDECK_FRAME_ACQUIRE_V1_ERROR_ENUM */
|
||||
|
||||
/**
|
||||
* @ingroup iface_droiddeck_frame_acquire_v1
|
||||
* @struct droiddeck_frame_acquire_v1_interface
|
||||
*/
|
||||
struct droiddeck_frame_acquire_v1_interface {
|
||||
/**
|
||||
*/
|
||||
void (*destroy)(struct wl_client *client,
|
||||
struct wl_resource *resource);
|
||||
/**
|
||||
* set a one-shot kernel sync_file for the pending attachment
|
||||
*
|
||||
* After wl_surface.attach of a non-null buffer, and before its
|
||||
* next wl_surface.commit, send the producer's final writer fence
|
||||
* for that exact attachment. This outer probe requires that fence
|
||||
* to have already successfully signaled. The fence must be a real
|
||||
* Linux sync_file, not a dma-buf, eventfd, or Vulkan OPAQUE_FD.
|
||||
* The server consumes its received descriptor once for that
|
||||
* attachment; the caller closes its local FD after marshalling.
|
||||
*
|
||||
* The receiver validates the matching pending surface and buffer
|
||||
* and validates the descriptor. A duplicate, invalid, pending or
|
||||
* mismatched request is a protocol error; it is never downgraded
|
||||
* to implicit sync. Another attach (even the same wl_buffer),
|
||||
* detach, surface/resource loss or supersession makes the old
|
||||
* proof inapplicable. Metadata-only commits may amend
|
||||
* receiver-side still-pending state but cannot introduce or re-use
|
||||
* a fence themselves. If no request was made, the receiver keeps
|
||||
* its established safe path. If a valid fence has been accepted
|
||||
* and later the layer is ineligible, the buffer must not be
|
||||
* copied/read before that fence is satisfied or imported as the
|
||||
* source dependency. Transport never implies readiness on missed
|
||||
* deadlines and never changes release/retirement requirements.
|
||||
* @param fence producer's native acquire sync_file
|
||||
*/
|
||||
void (*set_acquire_fence)(struct wl_client *client,
|
||||
struct wl_resource *resource,
|
||||
struct wl_resource *surface,
|
||||
struct wl_resource *buffer,
|
||||
int32_t fence);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @ingroup iface_droiddeck_frame_acquire_v1
|
||||
*/
|
||||
#define DROIDDECK_FRAME_ACQUIRE_V1_DESTROY_SINCE_VERSION 1
|
||||
/**
|
||||
* @ingroup iface_droiddeck_frame_acquire_v1
|
||||
*/
|
||||
#define DROIDDECK_FRAME_ACQUIRE_V1_SET_ACQUIRE_FENCE_SINCE_VERSION 1
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,45 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<protocol name="droiddeck_frame_acquire_v1">
|
||||
<interface name="droiddeck_frame_acquire_v1" version="1">
|
||||
<description summary="DroidDeck producer write completion for a single Wayland attachment">
|
||||
Optional explicit acquire sideband independent of DRM syncobj and buffer
|
||||
allocation. Binding does not opt the client out of ordinary wl_buffer
|
||||
release or existing synchronization protocols. The server advertises it
|
||||
only when it implements all semantics for the selected display path and
|
||||
only to the test fixture's app-authorized Gamescope worker.
|
||||
</description>
|
||||
<request name="destroy" type="destructor"/>
|
||||
<enum name="error">
|
||||
<entry name="invalid_attachment" value="0" summary="not the same client's pending DMA-BUF attachment"/>
|
||||
<entry name="duplicate_fence" value="1" summary="that attachment already has an acquire fence"/>
|
||||
<entry name="invalid_fence" value="2" summary="not a real successfully signaled Linux sync_file"/>
|
||||
<entry name="unauthorized_peer" value="3" summary="not the paired test peer"/>
|
||||
</enum>
|
||||
<request name="set_acquire_fence">
|
||||
<description summary="set a one-shot kernel sync_file for the pending attachment">
|
||||
After wl_surface.attach of a non-null buffer, and before its next
|
||||
wl_surface.commit, send the producer's final writer fence for that
|
||||
exact attachment. This outer probe requires that fence to have already
|
||||
successfully signaled. The fence must be a real Linux sync_file, not a
|
||||
dma-buf, eventfd, or Vulkan OPAQUE_FD. The server consumes its received
|
||||
descriptor once for that attachment; the caller closes its local FD
|
||||
after marshalling.
|
||||
|
||||
The receiver validates the matching pending surface and buffer and
|
||||
validates the descriptor. A duplicate, invalid, pending or mismatched
|
||||
request is a protocol error; it is never downgraded to implicit sync. Another attach (even the same
|
||||
wl_buffer), detach, surface/resource loss or supersession makes the
|
||||
old proof inapplicable. Metadata-only commits may amend receiver-side
|
||||
still-pending state but cannot introduce or re-use a fence themselves.
|
||||
If no request was made, the receiver keeps its established safe path.
|
||||
If a valid fence has been accepted and later the layer is ineligible,
|
||||
the buffer must not be copied/read before that fence is satisfied or
|
||||
imported as the source dependency. Transport never implies readiness
|
||||
on missed deadlines and never changes release/retirement requirements.
|
||||
</description>
|
||||
<arg name="surface" type="object" interface="wl_surface"/>
|
||||
<arg name="buffer" type="object" interface="wl_buffer"/>
|
||||
<arg name="fence" type="fd" summary="producer's native acquire sync_file"/>
|
||||
</request>
|
||||
</interface>
|
||||
</protocol>
|
||||
@@ -54,6 +54,7 @@ static struct wl_list g_clients;
|
||||
static uint64_t g_next_id = 1;
|
||||
static struct wl_event_loop *g_loop;
|
||||
static unsigned g_stat_zero_copy;
|
||||
static unsigned g_stat_producer_fence;
|
||||
static int g_export_failed_logged, g_import_failed_logged;
|
||||
static int g_advertised;
|
||||
static int g_mode_sent = -1;
|
||||
@@ -201,31 +202,47 @@ int ahb_swapchain_present(struct dmabuf_buffer *b, struct surface *s, int scene_
|
||||
struct ahb_buf *ab = b ? *droiddeck_dmabuf_ahb_slot(b) : NULL;
|
||||
if (!ab) return -1;
|
||||
int dmabuf_fd = droiddeck_dmabuf_fd(b);
|
||||
int acquire = -1;
|
||||
struct droiddeck_dma_buf_sync_file exp = {.flags = DROIDDECK_DMA_BUF_SYNC_READ, .fd = -1};
|
||||
if (dmabuf_fd >= 0 && ioctl(dmabuf_fd, DROIDDECK_DMA_BUF_IOCTL_EXPORT_SYNC_FILE, &exp) == 0 && exp.fd >= 0) {
|
||||
acquire = exp.fd;
|
||||
} else {
|
||||
if (!g_export_failed_logged) {
|
||||
g_export_failed_logged = 1;
|
||||
droiddeck_log("layer", "zero-copy: no acquire fence from the game's dma-buf (%s): %s",
|
||||
dmabuf_fd >= 0 ? strerror(errno) : "no dma-buf fd",
|
||||
draw ? "its frames are copied instead" : "it cannot be copied, so each frame is waited for on the CPU");
|
||||
int acquire = droiddeck_surface_dup_acquire(s, b);
|
||||
if (acquire == -2) return -1;
|
||||
#ifdef DROIDDECK_FRAME_ACQUIRE_PROBE
|
||||
const int explicit_acquire = acquire >= 0;
|
||||
#endif
|
||||
if (acquire < 0) {
|
||||
struct droiddeck_dma_buf_sync_file exp = {.flags = DROIDDECK_DMA_BUF_SYNC_READ, .fd = -1};
|
||||
if (dmabuf_fd >= 0 && ioctl(dmabuf_fd, DROIDDECK_DMA_BUF_IOCTL_EXPORT_SYNC_FILE, &exp) == 0 && exp.fd >= 0) {
|
||||
acquire = exp.fd;
|
||||
} else {
|
||||
if (!g_export_failed_logged) {
|
||||
g_export_failed_logged = 1;
|
||||
droiddeck_log("layer", "zero-copy: no acquire fence from the game's dma-buf (%s): %s",
|
||||
dmabuf_fd >= 0 ? strerror(errno) : "no dma-buf fd",
|
||||
draw ? "its frames are copied instead" : "it cannot be copied, so each frame is waited for on the CPU");
|
||||
}
|
||||
if (dmabuf_fd >= 0) {
|
||||
struct pollfd p = {.fd = dmabuf_fd, .events = POLLIN};
|
||||
int r;
|
||||
do { r = poll(&p, 1, 100); } while (r < 0 && errno == EINTR);
|
||||
}
|
||||
if (draw) return -1;
|
||||
}
|
||||
if (dmabuf_fd >= 0) {
|
||||
struct pollfd p = {.fd = dmabuf_fd, .events = POLLIN};
|
||||
int r;
|
||||
do { r = poll(&p, 1, 100); } while (r < 0 && errno == EINTR);
|
||||
}
|
||||
if (draw) return -1;
|
||||
}
|
||||
int r = sc_layer_present_ahb(ab->ahb, ab->w, ab->h, acquire, (void *)(uintptr_t)ab->id, scene_w, scene_h, draw,
|
||||
s ? droiddeck_surface_color(s) : NULL, ab->format);
|
||||
if (r < 0) return -1;
|
||||
if (r == 1) return 0;
|
||||
#ifdef DROIDDECK_FRAME_ACQUIRE_PROBE
|
||||
static int explicit_logged;
|
||||
if (explicit_acquire && !explicit_logged) {
|
||||
explicit_logged = 1;
|
||||
droiddeck_log("layer", "probe: SurfaceControl accepted a verified producer acquire fence");
|
||||
}
|
||||
#endif
|
||||
if (!ab->on_layer) {
|
||||
ab->on_layer = 1;
|
||||
g_stat_zero_copy++;
|
||||
#ifdef DROIDDECK_FRAME_ACQUIRE_PROBE
|
||||
if (explicit_acquire) g_stat_producer_fence++;
|
||||
#endif
|
||||
g_last_zero_copy_ns = now_ns();
|
||||
}
|
||||
if (s && g_announced != s) {
|
||||
@@ -265,6 +282,12 @@ unsigned ahb_swapchain_stats_take(void) {
|
||||
return n;
|
||||
}
|
||||
|
||||
unsigned ahb_swapchain_producer_fence_stats_take(void) {
|
||||
unsigned n = g_stat_producer_fence;
|
||||
g_stat_producer_fence = 0;
|
||||
return n;
|
||||
}
|
||||
|
||||
int ahb_swapchain_advertised(void) { return g_advertised; }
|
||||
|
||||
uint32_t ahb_swapchain_ahb_format(const struct dmabuf_buffer *b) {
|
||||
|
||||
@@ -20,7 +20,9 @@ int ahb_swapchain_present(struct dmabuf_buffer *b, struct surface *s, int scene_
|
||||
int ahb_swapchain_defer_release(struct dmabuf_buffer *b, struct wl_resource *buffer, struct surface *s, int paced);
|
||||
void ahb_swapchain_surface_gone(struct surface *s);
|
||||
unsigned ahb_swapchain_stats_take(void);
|
||||
unsigned ahb_swapchain_producer_fence_stats_take(void);
|
||||
int ahb_swapchain_advertised(void);
|
||||
int droiddeck_surface_dup_acquire(const struct surface *s, const struct dmabuf_buffer *b);
|
||||
uint32_t ahb_swapchain_ahb_format(const struct dmabuf_buffer *b);
|
||||
|
||||
void ahb_swapchain_layer_released(void *token, int release_fd);
|
||||
|
||||
@@ -24,6 +24,14 @@
|
||||
#include "linux-dmabuf-v1-server-protocol.h"
|
||||
#include "sc_layer.h"
|
||||
#include "ahb_swapchain.h"
|
||||
#include "frame_acquire.h"
|
||||
#ifdef DROIDDECK_FRAME_ACQUIRE_PROBE
|
||||
#include "droiddeck-frame-acquire-v1-server-protocol.h"
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/sysmacros.h>
|
||||
#include <sys/stat.h>
|
||||
#include "frame_worker_peer.h"
|
||||
#endif
|
||||
#include "display_buffers.h"
|
||||
#include "viewporter-server-protocol.h"
|
||||
#include "droiddeck-desktop-v1-server-protocol.h"
|
||||
@@ -211,6 +219,7 @@ struct surface {
|
||||
struct wl_list link;
|
||||
|
||||
struct wl_resource *pending_buffer;
|
||||
struct dd_frame_acquire pending_frame_acquire, frame_acquire;
|
||||
struct wl_listener pending_buffer_destroy;
|
||||
int pending_attach;
|
||||
int pending_src_set, pending_dst_set;
|
||||
@@ -827,6 +836,7 @@ static void unmap_toplevel(struct surface *s) {
|
||||
}
|
||||
|
||||
static void drop_dmabuf(struct surface *s, int paced) {
|
||||
dd_frame_acquire_clear(&s->frame_acquire);
|
||||
if (s->dmabuf) {
|
||||
wl_list_remove(&s->dmabuf_destroy.link);
|
||||
if (buffer_shown_elsewhere(s->dmabuf, s)) {
|
||||
@@ -842,18 +852,21 @@ static void drop_dmabuf(struct surface *s, int paced) {
|
||||
|
||||
static void on_dmabuf_destroyed(struct wl_listener *l, void *data) {
|
||||
struct surface *s = wl_container_of(l, s, dmabuf_destroy);
|
||||
dd_frame_acquire_clear(&s->frame_acquire);
|
||||
wl_list_remove(&s->dmabuf_destroy.link);
|
||||
s->dmabuf = NULL;
|
||||
}
|
||||
|
||||
static void on_pending_buffer_destroyed(struct wl_listener *l, void *data) {
|
||||
struct surface *s = wl_container_of(l, s, pending_buffer_destroy);
|
||||
dd_frame_acquire_clear(&s->pending_frame_acquire);
|
||||
wl_list_remove(&s->pending_buffer_destroy.link);
|
||||
wl_list_init(&s->pending_buffer_destroy.link);
|
||||
s->pending_buffer = NULL;
|
||||
}
|
||||
|
||||
struct surface_state {
|
||||
struct dd_frame_acquire frame_acquire;
|
||||
struct wl_resource *buffer;
|
||||
struct wl_listener buffer_destroy;
|
||||
int attach;
|
||||
@@ -866,6 +879,7 @@ struct surface_state {
|
||||
|
||||
static void on_state_buffer_destroyed(struct wl_listener *l, void *data) {
|
||||
struct surface_state *st = wl_container_of(l, st, buffer_destroy);
|
||||
dd_frame_acquire_clear(&st->frame_acquire);
|
||||
wl_list_remove(&st->buffer_destroy.link);
|
||||
wl_list_init(&st->buffer_destroy.link);
|
||||
st->buffer = NULL;
|
||||
@@ -874,6 +888,8 @@ static void on_state_buffer_destroyed(struct wl_listener *l, void *data) {
|
||||
|
||||
static void surface_state_take(struct surface *s, struct surface_state *st) {
|
||||
st->attach = s->pending_attach;
|
||||
st->frame_acquire = s->pending_frame_acquire;
|
||||
s->pending_frame_acquire.fd_plus_one = 0;
|
||||
st->buffer = s->pending_buffer;
|
||||
wl_list_init(&st->buffer_destroy.link);
|
||||
if (st->buffer) {
|
||||
@@ -1186,6 +1202,7 @@ static void surface_attach(struct wl_client *c, struct wl_resource *r,
|
||||
if (s->pending_buffer) wl_list_remove(&s->pending_buffer_destroy.link);
|
||||
wl_list_init(&s->pending_buffer_destroy.link);
|
||||
s->pending_buffer = buffer;
|
||||
dd_frame_acquire_clear(&s->pending_frame_acquire);
|
||||
s->pending_attach = 1;
|
||||
if (buffer) {
|
||||
s->pending_buffer_destroy.notify = on_pending_buffer_destroyed;
|
||||
@@ -1451,6 +1468,7 @@ static void surface_state_apply(struct surface *s, struct surface_state *st) {
|
||||
|
||||
surface_drop_idle(s);
|
||||
buf_trace_attach(buffer);
|
||||
dd_frame_acquire_clear(&s->frame_acquire);
|
||||
if (s->role == ROLE_CURSOR) {
|
||||
if (!buffer) {
|
||||
cursor_publish_hidden();
|
||||
@@ -1462,6 +1480,8 @@ static void surface_state_apply(struct surface *s, struct surface_state *st) {
|
||||
if (buffer) surface_hold_idle(s, buffer);
|
||||
} else if (db) {
|
||||
take_dmabuf(s, db, buffer);
|
||||
s->frame_acquire = st->frame_acquire;
|
||||
st->frame_acquire.fd_plus_one = 0;
|
||||
} else if (shm) {
|
||||
drop_dmabuf(s, 1);
|
||||
take_shm(s, shm, buffer);
|
||||
@@ -1474,6 +1494,7 @@ static void surface_state_apply(struct surface *s, struct surface_state *st) {
|
||||
if (buffer) send_buffer_release(buffer);
|
||||
}
|
||||
}
|
||||
dd_frame_acquire_clear(&st->frame_acquire);
|
||||
pending_releases_apply(s);
|
||||
|
||||
wl_list_for_each(child, &s->children, child_link) {
|
||||
@@ -1538,6 +1559,7 @@ static void settle_unwaited(void) {
|
||||
}
|
||||
|
||||
static void surface_state_discard(struct surface_state *st) {
|
||||
dd_frame_acquire_clear(&st->frame_acquire);
|
||||
struct wl_resource *cb, *tmp;
|
||||
wl_list_remove(&st->buffer_destroy.link);
|
||||
wl_resource_for_each_safe(cb, tmp, &st->frames) wl_resource_destroy(cb);
|
||||
@@ -1549,6 +1571,8 @@ static void surface_state_merge(struct surface_state *older, struct surface_stat
|
||||
if (older->attach && !newer->attach) {
|
||||
newer->attach = 1;
|
||||
newer->buffer = older->buffer;
|
||||
newer->frame_acquire = older->frame_acquire;
|
||||
older->frame_acquire.fd_plus_one = 0;
|
||||
wl_list_remove(&older->buffer_destroy.link);
|
||||
wl_list_init(&older->buffer_destroy.link);
|
||||
if (newer->buffer) {
|
||||
@@ -1700,6 +1724,210 @@ static const struct wl_surface_interface surface_impl = {
|
||||
.offset = surface_offset,
|
||||
};
|
||||
|
||||
int droiddeck_surface_dup_acquire(const struct surface *s, const struct dmabuf_buffer *b) {
|
||||
return s && s->dmabuf && s->dmabuf_buf == b ? dd_frame_acquire_dup(&s->frame_acquire) : -1;
|
||||
}
|
||||
|
||||
#ifdef DROIDDECK_FRAME_ACQUIRE_PROBE
|
||||
// Private signed fixture: only the app-owned worker decision may issue a grant.
|
||||
static pthread_mutex_t frame_worker_lock = PTHREAD_MUTEX_INITIALIZER;
|
||||
static char frame_worker_file[PATH_MAX];
|
||||
static struct dd_worker_grant frame_worker_grant;
|
||||
static int frame_worker_pidfd = -1;
|
||||
static bool frame_worker_map_reported;
|
||||
|
||||
static enum dd_worker_stat_result frame_worker_starttime(pid_t pid, uint64_t *out) {
|
||||
char proc[64], line[4096];
|
||||
snprintf(proc, sizeof(proc), "/proc/%d/stat", pid);
|
||||
FILE *f = fopen(proc, "re");
|
||||
if (!f) return dd_worker_open_failure(errno);
|
||||
// Proc writes one bounded line; truncation is a read failure, not invisibility.
|
||||
bool read = fgets(line, sizeof(line), f) != NULL && strchr(line, '\n') != NULL;
|
||||
fclose(f);
|
||||
return read ? dd_worker_parse_start(line, out) : DD_WORKER_STAT_READ;
|
||||
}
|
||||
|
||||
void droiddeck_frame_worker_revoke(int owner, int pid) {
|
||||
pthread_mutex_lock(&frame_worker_lock);
|
||||
if (frame_worker_grant.owner == (uint32_t)owner &&
|
||||
(!pid || frame_worker_grant.pid == (uint32_t)pid)) {
|
||||
if (frame_worker_pidfd >= 0) close(frame_worker_pidfd);
|
||||
frame_worker_pidfd = -1;
|
||||
frame_worker_grant = (struct dd_worker_grant){0};
|
||||
}
|
||||
pthread_mutex_unlock(&frame_worker_lock);
|
||||
}
|
||||
|
||||
int droiddeck_frame_worker_grant(int owner, pid_t pid, uint64_t expires, const char *path,
|
||||
uint64_t expected_dev, uint64_t expected_ino, uint64_t receipt) {
|
||||
struct stat st;
|
||||
if (owner <= 0 || pid <= 1 || !receipt || !path ||
|
||||
strlen(path) >= sizeof(frame_worker_file) || lstat(path, &st) < 0 || !S_ISREG(st.st_mode) ||
|
||||
(uint64_t)st.st_dev != expected_dev || (uint64_t)st.st_ino != expected_ino ||
|
||||
st.st_uid != getuid()) {
|
||||
droiddeck_log("probe", "worker_admission=NATIVE_FILE");
|
||||
return 0;
|
||||
}
|
||||
int pidfd = syscall(__NR_pidfd_open, pid, 0);
|
||||
if (pidfd < 0) {
|
||||
droiddeck_log("probe", "worker_admission=NATIVE_PIDFD");
|
||||
return 0; // No fallback to a recyclable PID.
|
||||
}
|
||||
struct pollfd alive = {.fd = pidfd, .events = POLLIN};
|
||||
uint64_t raw_start = 0;
|
||||
enum dd_worker_stat_result stat = frame_worker_starttime(pid, &raw_start);
|
||||
switch (stat) {
|
||||
case DD_WORKER_STAT_OK:
|
||||
if (raw_start != receipt) droiddeck_log("probe", "worker_admission=NATIVE_STAT_MISMATCH");
|
||||
break;
|
||||
case DD_WORKER_STAT_DENIED: droiddeck_log("probe", "worker_admission=NATIVE_STAT_OPEN_DENIED"); break;
|
||||
case DD_WORKER_STAT_HIDDEN: droiddeck_log("probe", "worker_admission=NATIVE_STAT_OPEN_HIDDEN"); break;
|
||||
case DD_WORKER_STAT_OPEN: droiddeck_log("probe", "worker_admission=NATIVE_STAT_OPEN_OTHER"); break;
|
||||
case DD_WORKER_STAT_READ: droiddeck_log("probe", "worker_admission=NATIVE_STAT_READ"); break;
|
||||
case DD_WORKER_STAT_PARSE: droiddeck_log("probe", "worker_admission=NATIVE_STAT_PARSE"); break;
|
||||
case DD_WORKER_STAT_ZERO: droiddeck_log("probe", "worker_admission=NATIVE_STAT_ZERO"); break;
|
||||
}
|
||||
if (!dd_worker_receipt_allows_reserve(stat, raw_start, receipt)) { close(pidfd); return 0; }
|
||||
if (poll(&alive, 1, 0) != 0) {
|
||||
droiddeck_log("probe", "worker_admission=NATIVE_PIDFD_NOT_LIVE");
|
||||
close(pidfd);
|
||||
return 0;
|
||||
}
|
||||
pthread_mutex_lock(&frame_worker_lock);
|
||||
if (frame_worker_pidfd < 0) {
|
||||
strcpy(frame_worker_file, path);
|
||||
frame_worker_grant = (struct dd_worker_grant){
|
||||
.owner = owner, .uid = getuid(), .pid = pid, .start_ticks = receipt, .expires = expires,
|
||||
.dev_major = major(st.st_dev), .dev_minor = minor(st.st_dev), .ino = st.st_ino,
|
||||
.canonical_file = frame_worker_file, .app_launch_verified = true, .final_go = true,
|
||||
};
|
||||
frame_worker_map_reported = false;
|
||||
frame_worker_pidfd = pidfd;
|
||||
pidfd = -1;
|
||||
}
|
||||
pthread_mutex_unlock(&frame_worker_lock);
|
||||
if (pidfd >= 0) {
|
||||
droiddeck_log("probe", "worker_admission=NATIVE_ALREADY_RESERVED");
|
||||
close(pidfd);
|
||||
return 0;
|
||||
}
|
||||
droiddeck_log("probe", "frame acquire reserved one app-verified worker");
|
||||
return 1;
|
||||
}
|
||||
|
||||
static bool frame_worker_verified_exec_locked(const struct dd_worker_grant *g, uint64_t now) {
|
||||
char proc[64], line[PATH_MAX + 128];
|
||||
const char *failure = "worker_admission=MAP_STARTTIME";
|
||||
uint64_t raw_start = 0;
|
||||
if (frame_worker_starttime(g->pid, &raw_start) != DD_WORKER_STAT_OK || raw_start != g->start_ticks)
|
||||
goto reject;
|
||||
snprintf(proc, sizeof(proc), "/proc/%u/maps", g->pid);
|
||||
FILE *f = fopen(proc, "re");
|
||||
failure = "worker_admission=MAP_OPEN";
|
||||
if (!f) goto reject;
|
||||
bool matched = false;
|
||||
size_t budget = 2 * 1024 * 1024;
|
||||
while (budget && fgets(line, sizeof(line), f)) {
|
||||
size_t n = strlen(line);
|
||||
if (!n || line[n - 1] != '\n' || n > budget) break;
|
||||
budget -= n;
|
||||
if (dd_worker_grant_matches(g, g->owner, g->uid, g->pid, raw_start, now, line)) {
|
||||
matched = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
if (matched) return true;
|
||||
failure = "worker_admission=MAP_IDENTITY";
|
||||
reject:
|
||||
if (!frame_worker_map_reported) {
|
||||
frame_worker_map_reported = true;
|
||||
droiddeck_log("probe", "%s", failure);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static int frame_acquire_peer_allowed(const struct wl_client *client, bool verify_exec, bool bind) {
|
||||
pid_t pid = 0;
|
||||
uid_t uid = (uid_t)-1;
|
||||
wl_client_get_credentials(client, &pid, &uid, NULL);
|
||||
struct timespec t;
|
||||
if (clock_gettime(CLOCK_BOOTTIME, &t) < 0) return 0;
|
||||
uint64_t now = (uint64_t)t.tv_sec * 1000 + (uint64_t)t.tv_nsec / 1000000;
|
||||
pthread_mutex_lock(&frame_worker_lock);
|
||||
const struct dd_worker_grant *g = &frame_worker_grant;
|
||||
struct pollfd alive = {.fd = frame_worker_pidfd, .events = POLLIN};
|
||||
bool allowed = frame_worker_pidfd >= 0 && uid == getuid() && pid > 1 &&
|
||||
g->pid == (uint32_t)pid && g->uid == uid && now < g->expires &&
|
||||
poll(&alive, 1, 0) == 0 && (!verify_exec ||
|
||||
(frame_worker_verified_exec_locked(g, now) && poll(&alive, 1, 0) == 0));
|
||||
// The short startup authorization may not be renewed by registry enumeration.
|
||||
// Only an authenticated bind activates the grant for the lifetime of this live,
|
||||
// unreplaced worker; session teardown revokes it independently of process exit.
|
||||
if (allowed && bind) frame_worker_grant.expires = UINT64_MAX;
|
||||
pthread_mutex_unlock(&frame_worker_lock);
|
||||
return allowed;
|
||||
}
|
||||
|
||||
static bool frame_acquire_global_filter(const struct wl_client *client, const struct wl_global *global, void *data) {
|
||||
return wl_global_get_interface(global) != &droiddeck_frame_acquire_v1_interface ||
|
||||
frame_acquire_peer_allowed(client, true, false);
|
||||
}
|
||||
|
||||
static void frame_acquire_destroy(struct wl_client *client, struct wl_resource *resource) {
|
||||
wl_resource_destroy(resource);
|
||||
}
|
||||
|
||||
static void frame_acquire_set(struct wl_client *client, struct wl_resource *resource,
|
||||
struct wl_resource *surface, struct wl_resource *buffer, int32_t fd) {
|
||||
if (!frame_acquire_peer_allowed(client, false, false)) {
|
||||
close(fd);
|
||||
wl_resource_post_error(resource, DROIDDECK_FRAME_ACQUIRE_V1_ERROR_UNAUTHORIZED_PEER,
|
||||
"paired capture peer is not authorized");
|
||||
return;
|
||||
}
|
||||
struct surface *s = NULL;
|
||||
if (surface && buffer && wl_resource_get_client(surface) == client &&
|
||||
wl_resource_get_client(buffer) == client &&
|
||||
wl_resource_instance_of(surface, &wl_surface_interface, &surface_impl) &&
|
||||
get_dmabuf(buffer))
|
||||
s = wl_resource_get_user_data(surface);
|
||||
if (!s || !s->pending_attach || s->pending_buffer != buffer) {
|
||||
close(fd);
|
||||
wl_resource_post_error(resource, DROIDDECK_FRAME_ACQUIRE_V1_ERROR_INVALID_ATTACHMENT,
|
||||
"fence does not match pending DMA-BUF attachment");
|
||||
return;
|
||||
}
|
||||
enum dd_frame_acquire_result result = dd_frame_acquire_set(&s->pending_frame_acquire, fd);
|
||||
if (result == DD_ACQUIRE_DUPLICATE)
|
||||
wl_resource_post_error(resource, DROIDDECK_FRAME_ACQUIRE_V1_ERROR_DUPLICATE_FENCE,
|
||||
"pending attachment already has a fence");
|
||||
else if (result == DD_ACQUIRE_INVALID)
|
||||
wl_resource_post_error(resource, DROIDDECK_FRAME_ACQUIRE_V1_ERROR_INVALID_FENCE,
|
||||
"expected an already signaled Linux sync_file");
|
||||
}
|
||||
|
||||
static const struct droiddeck_frame_acquire_v1_interface frame_acquire_impl = {
|
||||
.destroy = frame_acquire_destroy,
|
||||
.set_acquire_fence = frame_acquire_set,
|
||||
};
|
||||
|
||||
static void bind_frame_acquire(struct wl_client *client, void *data, uint32_t version, uint32_t id) {
|
||||
if (!frame_acquire_peer_allowed(client, true, true)) {
|
||||
wl_client_post_implementation_error(client, "paired capture peer is not authorized");
|
||||
return;
|
||||
}
|
||||
struct wl_resource *resource =
|
||||
wl_resource_create(client, &droiddeck_frame_acquire_v1_interface, 1, id);
|
||||
if (!resource) {
|
||||
wl_client_post_no_memory(client);
|
||||
return;
|
||||
}
|
||||
wl_resource_set_implementation(resource, &frame_acquire_impl, NULL, NULL);
|
||||
droiddeck_log("probe", "frame acquire bound to app-issued worker and exact executable map");
|
||||
}
|
||||
#endif
|
||||
|
||||
static void detach_from_parent(struct surface *s) {
|
||||
if (!s->parent) return;
|
||||
wl_list_remove(&s->child_link);
|
||||
@@ -1709,6 +1937,7 @@ static void detach_from_parent(struct surface *s) {
|
||||
|
||||
static void surface_resource_destroy(struct wl_resource *r) {
|
||||
struct surface *s = wl_resource_get_user_data(r);
|
||||
dd_frame_acquire_clear(&s->pending_frame_acquire);
|
||||
struct surface *child, *tmp;
|
||||
struct wl_resource *cb, *cbtmp;
|
||||
|
||||
@@ -4804,6 +5033,7 @@ static int on_stats_timer(void *data) {
|
||||
struct surface *s;
|
||||
wl_list_for_each(s, &g_toplevels, toplevel_link) windows++;
|
||||
unsigned zero_copy = ahb_swapchain_stats_take();
|
||||
unsigned verified = ahb_swapchain_producer_fence_stats_take();
|
||||
unsigned layer_frames = sc_layer_frames_take();
|
||||
g_zero_copy_last = zero_copy;
|
||||
unsigned generated = vkp_framegen_stats_take();
|
||||
@@ -4812,7 +5042,8 @@ static int on_stats_timer(void *data) {
|
||||
int off = 0;
|
||||
if (g_zero_copy || zero_copy) off += snprintf(extra + off, sizeof(extra) - (size_t)off, " | %u zero-copy frames", zero_copy);
|
||||
if (layer_frames) off += snprintf(extra + off, sizeof(extra) - (size_t)off, " | %u layer frames", layer_frames);
|
||||
if (generated) snprintf(extra + off, sizeof(extra) - (size_t)off, " | %u generated frames", generated);
|
||||
if (generated) off += snprintf(extra + off, sizeof(extra) - (size_t)off, " | %u generated frames", generated);
|
||||
if (verified) snprintf(extra + off, sizeof(extra) - (size_t)off, " | %u verified acquire frames", verified);
|
||||
droiddeck_log("stats", "last 10 s: %u frames on screen (%.1f fps) | %u GPU frames from games | %u window redraws | %d windows open%s",
|
||||
g_stat_frames + generated, (g_stat_frames + generated) / 10.0, g_stat_dmabuf, g_stat_shm, windows, extra);
|
||||
}
|
||||
@@ -5013,6 +5244,12 @@ int droiddeck_wayland_run(void) {
|
||||
wl_global_create(display, &zwp_relative_pointer_manager_v1_interface, 1, NULL, bind_relative_pointer_manager);
|
||||
droiddeck_ext_init(display);
|
||||
ahb_swapchain_init(display);
|
||||
#ifdef DROIDDECK_FRAME_ACQUIRE_PROBE
|
||||
if (ahb_swapchain_advertised()) {
|
||||
wl_display_set_global_filter(display, frame_acquire_global_filter, NULL);
|
||||
wl_global_create(display, &droiddeck_frame_acquire_v1_interface, 1, NULL, bind_frame_acquire);
|
||||
}
|
||||
#endif
|
||||
display_buffers_init(display);
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
#ifndef DD_FRAME_ACQUIRE_H
|
||||
#define DD_FRAME_ACQUIRE_H
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <linux/sync_file.h>
|
||||
#include <sys/ioctl.h>
|
||||
#include <unistd.h>
|
||||
|
||||
/* A zero-initialized slot owns no descriptor. Only an already successful
|
||||
* sync_file can enter this slot; display-side release ownership is separate. */
|
||||
struct dd_frame_acquire { int fd_plus_one; };
|
||||
enum dd_frame_acquire_result { DD_ACQUIRE_OK, DD_ACQUIRE_DUPLICATE, DD_ACQUIRE_INVALID };
|
||||
|
||||
static inline void dd_frame_acquire_clear(struct dd_frame_acquire *f) {
|
||||
if (f->fd_plus_one) close(f->fd_plus_one - 1);
|
||||
f->fd_plus_one = 0;
|
||||
}
|
||||
|
||||
static inline enum dd_frame_acquire_result
|
||||
dd_frame_acquire_set(struct dd_frame_acquire *f, int fd) {
|
||||
enum dd_frame_acquire_result result;
|
||||
struct sync_file_info info = {0};
|
||||
if (f->fd_plus_one) result = DD_ACQUIRE_DUPLICATE;
|
||||
else if (fd < 0 || fd == INT_MAX || ioctl(fd, SYNC_IOC_FILE_INFO, &info) != 0 ||
|
||||
info.status != 1 || info.num_fences == 0) result = DD_ACQUIRE_INVALID;
|
||||
else {
|
||||
f->fd_plus_one = fd + 1;
|
||||
return DD_ACQUIRE_OK;
|
||||
}
|
||||
if (fd >= 0) close(fd);
|
||||
return result;
|
||||
}
|
||||
|
||||
static inline int dd_frame_acquire_dup(const struct dd_frame_acquire *f) {
|
||||
if (!f->fd_plus_one) return -1; /* Legacy: no explicit attachment proof. */
|
||||
int fd = fcntl(f->fd_plus_one - 1, F_DUPFD_CLOEXEC, 0);
|
||||
return fd < 0 ? -2 : fd; /* Do not re-enter the legacy direct path. */
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,81 @@
|
||||
#ifndef DD_WORKER_PEER_H
|
||||
#define DD_WORKER_PEER_H
|
||||
#include <stdbool.h>
|
||||
#include <stdint.h>
|
||||
#include <inttypes.h>
|
||||
#include <errno.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
/* Model of one app-issued, session-bound authorization record. No callers,
|
||||
* property access, proc traversal, or authorization is installed by this file. */
|
||||
struct dd_worker_grant {
|
||||
uint32_t owner, uid, pid, dev_major, dev_minor;
|
||||
uint64_t start_ticks, ino, expires;
|
||||
const char *canonical_file;
|
||||
bool app_launch_verified, final_go;
|
||||
};
|
||||
|
||||
enum dd_worker_stat_result {
|
||||
DD_WORKER_STAT_OK, DD_WORKER_STAT_DENIED, DD_WORKER_STAT_HIDDEN, DD_WORKER_STAT_OPEN,
|
||||
DD_WORKER_STAT_READ, DD_WORKER_STAT_PARSE, DD_WORKER_STAT_ZERO,
|
||||
};
|
||||
|
||||
static inline enum dd_worker_stat_result dd_worker_parse_start(const char *line, uint64_t *out) {
|
||||
const char *p = strrchr(line, ')');
|
||||
if (!p || p[1] != ' ' || !p[2] || p[3] != ' ') return DD_WORKER_STAT_PARSE;
|
||||
p += 2;
|
||||
// State is field 3. The starttime (22) is always followed by vsize (23).
|
||||
for (int field = 3; field < 22; ++field) {
|
||||
p = strchr(p, ' ');
|
||||
if (!p) return DD_WORKER_STAT_PARSE;
|
||||
while (*p == ' ') ++p;
|
||||
}
|
||||
char *end;
|
||||
if (*p < '0' || *p > '9') return DD_WORKER_STAT_PARSE;
|
||||
errno = 0;
|
||||
uint64_t value = strtoull(p, &end, 10);
|
||||
if (errno || end == p || *end != ' ') return DD_WORKER_STAT_PARSE;
|
||||
if (!value) return DD_WORKER_STAT_ZERO;
|
||||
*out = value;
|
||||
return DD_WORKER_STAT_OK;
|
||||
}
|
||||
|
||||
static inline enum dd_worker_stat_result dd_worker_open_failure(int error) {
|
||||
if (error == EACCES || error == EPERM) return DD_WORKER_STAT_DENIED;
|
||||
if (error == ENOENT || error == ESRCH) return DD_WORKER_STAT_HIDDEN;
|
||||
return DD_WORKER_STAT_OPEN;
|
||||
}
|
||||
|
||||
static inline bool dd_worker_receipt_allows_reserve(enum dd_worker_stat_result stat,
|
||||
uint64_t raw, uint64_t receipt) {
|
||||
if (!receipt) return false;
|
||||
if (stat == DD_WORKER_STAT_OK) return raw == receipt;
|
||||
// Only a visibility denial can defer the broker-side stat check, not any
|
||||
// bad read, malformed record, mismatched timestamp, or other open error.
|
||||
return stat == DD_WORKER_STAT_DENIED || stat == DD_WORKER_STAT_HIDDEN;
|
||||
}
|
||||
|
||||
static inline bool dd_worker_map_matches(const struct dd_worker_grant *g, const char *line) {
|
||||
unsigned major, minor;
|
||||
uint64_t lo, hi, off, ino;
|
||||
int prefix = 0;
|
||||
char mode[5];
|
||||
if (!g->canonical_file || !*g->canonical_file ||
|
||||
sscanf(line, "%" SCNx64 "-%" SCNx64 " %4s %" SCNx64 " %x:%x %" SCNu64 " %n",
|
||||
&lo,&hi,mode,&off,&major,&minor,&ino,&prefix)!=7 ||
|
||||
prefix <= 0 || hi <= lo || strlen(mode)!=4 || mode[2]!='x' ||
|
||||
major!=g->dev_major || minor!=g->dev_minor || !ino || ino!=g->ino)
|
||||
return false;
|
||||
size_t path_len=strcspn(line+prefix,"\r\n");
|
||||
return strlen(g->canonical_file)==path_len && !memcmp(line+prefix,g->canonical_file,path_len);
|
||||
}
|
||||
|
||||
static inline bool dd_worker_grant_matches(const struct dd_worker_grant *g, uint32_t owner,
|
||||
uint32_t uid, uint32_t pid, uint64_t start, uint64_t now, const char *executable_map) {
|
||||
return g && g->app_launch_verified && g->final_go && owner && owner==g->owner &&
|
||||
uid==g->uid && pid>1 && pid==g->pid && start && start==g->start_ticks &&
|
||||
now<g->expires && executable_map && dd_worker_map_matches(g,executable_map);
|
||||
}
|
||||
#endif
|
||||
@@ -916,3 +916,42 @@ JNIEXPORT jint JNICALL
|
||||
Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeStreamFrames(JNIEnv *env, jclass clazz) {
|
||||
return (jint)droiddeck_stream_frames();
|
||||
}
|
||||
|
||||
|
||||
#ifdef DROIDDECK_FRAME_ACQUIRE_PROBE
|
||||
extern int droiddeck_frame_worker_grant(int owner, pid_t pid, uint64_t expires, const char *path,
|
||||
uint64_t dev, uint64_t ino, uint64_t receipt);
|
||||
extern void droiddeck_frame_worker_revoke(int owner, int pid);
|
||||
#endif
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_droiddeck_launcher_wayland_WaylandCompositor_frameWorkerProbeEnabled(JNIEnv *env, jclass c) {
|
||||
#ifdef DROIDDECK_FRAME_ACQUIRE_PROBE
|
||||
return JNI_TRUE;
|
||||
#else
|
||||
return JNI_FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
JNIEXPORT jboolean JNICALL
|
||||
Java_com_droiddeck_launcher_wayland_WaylandCompositor_frameWorkerProbeGrant(JNIEnv *env, jclass c,
|
||||
jint owner, jint pid, jlong expires, jstring path, jlong dev, jlong ino, jlong start_ticks) {
|
||||
#ifdef DROIDDECK_FRAME_ACQUIRE_PROBE
|
||||
if (!path || expires <= 0 || ino <= 0 || start_ticks <= 0) return JNI_FALSE;
|
||||
const char *name = (*env)->GetStringUTFChars(env, path, NULL);
|
||||
if (!name) return JNI_FALSE;
|
||||
int granted = droiddeck_frame_worker_grant(owner, pid, (uint64_t)expires, name, (uint64_t)dev, (uint64_t)ino, (uint64_t)start_ticks);
|
||||
(*env)->ReleaseStringUTFChars(env, path, name);
|
||||
return granted ? JNI_TRUE : JNI_FALSE;
|
||||
#else
|
||||
return JNI_FALSE;
|
||||
#endif
|
||||
}
|
||||
|
||||
JNIEXPORT void JNICALL
|
||||
Java_com_droiddeck_launcher_wayland_WaylandCompositor_frameWorkerProbeRevoke(JNIEnv *env, jclass c,
|
||||
jint owner, jint pid) {
|
||||
#ifdef DROIDDECK_FRAME_ACQUIRE_PROBE
|
||||
droiddeck_frame_worker_revoke(owner, pid);
|
||||
#endif
|
||||
}
|
||||
@@ -304,9 +304,6 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
protons.installExperimental { progress -> com.droiddeck.launcher.session.ExperimentalProtons.installFromFile(this, zip, progress) }
|
||||
}
|
||||
}
|
||||
private val pickLossless = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { r ->
|
||||
if (r.resultCode == RESULT_OK) InAppFilePicker.pickedFile(r.data)?.let { importLossless(it) }
|
||||
}
|
||||
private val pickSaveZip = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { r ->
|
||||
val then = onSavePicked.also { onSavePicked = null } ?: return@registerForActivityResult
|
||||
if (r.resultCode == RESULT_OK) InAppFilePicker.pickedFile(r.data)?.let(then)
|
||||
@@ -517,17 +514,6 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
bootMovieCustomName = com.droiddeck.launcher.session.BootMovie.customName(this)
|
||||
}
|
||||
|
||||
private fun importLossless(dll: File) {
|
||||
Thread({
|
||||
val message = Lossless.message(this, Lossless.import(this, dll))
|
||||
val state = Lossless.state(this)
|
||||
ui.post {
|
||||
lossless = state
|
||||
android.widget.Toast.makeText(this, message, android.widget.Toast.LENGTH_LONG).show()
|
||||
}
|
||||
}, "lossless-import").start()
|
||||
}
|
||||
|
||||
private fun importSaves(name: String, game: () -> GameSaves.Game) {
|
||||
if (SessionState.running) {
|
||||
android.widget.Toast.makeText(this, R.string.main_saves_close_session, android.widget.Toast.LENGTH_LONG).show()
|
||||
@@ -625,6 +611,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
private var appScale by mutableStateOf(com.droiddeck.launcher.core.AppUiPrefs.DEFAULT_SCALE)
|
||||
private var hdrOn by mutableStateOf(false)
|
||||
private var zeroCopyOn by mutableStateOf(true)
|
||||
private var producerAcquireFences by mutableStateOf(false)
|
||||
private var upscaler by mutableStateOf(0)
|
||||
private var upscaleSharpness by mutableStateOf(75)
|
||||
private var hdrReason by mutableStateOf<String?>(null)
|
||||
@@ -1100,6 +1087,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
} else {
|
||||
putExtra(SessionService.EXTRA_STEAM_URL,
|
||||
com.droiddeck.launcher.frontend.GameLaunchLink.steamUrl(game.gameIdString))
|
||||
putExtra(SessionService.EXTRA_FRONTEND_STEAM_GAME, true)
|
||||
}
|
||||
}
|
||||
.playing(game), steamSession = true)
|
||||
@@ -1658,9 +1646,6 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
FrameGen.set(this, mode)
|
||||
frameGenLabel = FrameGen.label(this)
|
||||
},
|
||||
onImportLossless = {
|
||||
pickLossless.launch(InAppFilePicker.buildIntent(this, listOf("dll"), getString(R.string.lsfg_pick_title)))
|
||||
},
|
||||
onProtons = { openProtons() },
|
||||
onComponents = { focusContent -> openComponents(focusContent) },
|
||||
onGameComponents = { game -> openComponents(gameKey = game.profileKey) },
|
||||
@@ -2937,6 +2922,10 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
mode = mode, resolution = resolution, resolutionPortrait = resolutionPortrait,
|
||||
panelSize = com.droiddeck.launcher.session.SessionDisplay.panelSize(this),
|
||||
hdr = hdrOn, hdrReason = hdrReason, hdrDisplay = hdrDisplay, zeroCopy = zeroCopyOn,
|
||||
producerAcquireFences = producerAcquireFences.takeIf {
|
||||
mode == SessionService.MODE_STEAM &&
|
||||
com.droiddeck.launcher.runtime.FrameAcquireWorkerProbe.available(this)
|
||||
},
|
||||
upscaler = upscaler, upscaleSharpness = upscaleSharpness,
|
||||
gpuDrivers = drivers.summary(),
|
||||
touchMode = touchMode,
|
||||
@@ -3001,6 +2990,10 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
SessionPrefs.prefMode(SessionState.mode) == SessionPrefs.prefMode(mode))
|
||||
com.droiddeck.launcher.wayland.WaylandCompositor.nativeSetZeroCopy(on)
|
||||
},
|
||||
onProducerAcquireFences = {
|
||||
SessionPrefs.setProducerAcquireFences(this, it)
|
||||
producerAcquireFences = it
|
||||
},
|
||||
onGpuDrivers = { openComponents(focusContent = true, tab = com.droiddeck.launcher.ui.GPU_TAB) },
|
||||
onUpscaler = { m -> SessionPrefs.setUpscaler(this, m); upscaler = m },
|
||||
onUpscaleSharpness = { pct -> SessionPrefs.setUpscaleSharpness(this, pct); upscaleSharpness = pct },
|
||||
@@ -3362,6 +3355,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
loadBootMovie()
|
||||
hdrOn = SessionPrefs.hdr(this, mode)
|
||||
zeroCopyOn = SessionPrefs.zeroCopy(this, mode)
|
||||
producerAcquireFences = SessionPrefs.producerAcquireFences(this)
|
||||
upscaler = SessionPrefs.upscaler(this)
|
||||
upscaleSharpness = SessionPrefs.upscaleSharpness(this)
|
||||
hdrReason = com.droiddeck.launcher.wayland.HdrSupport.blocked(this)
|
||||
|
||||
@@ -230,6 +230,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}
|
||||
private var unfoldedPanel by mutableStateOf<OnScreenControls?>(null)
|
||||
private var unfoldedColumn: android.widget.LinearLayout? = null
|
||||
private var unfoldedKeys: View? = null
|
||||
private var unfoldedDeckSurface: com.droiddeck.launcher.ui.InputSurfaceView? = null
|
||||
private var swappedInputSurface: com.droiddeck.launcher.ui.InputSurfaceView? = null
|
||||
private var unfoldedDeckPanel by mutableStateOf<com.droiddeck.launcher.input.DeckPanel?>(null)
|
||||
@@ -717,9 +718,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
private var drawerTextureAnisotropy by mutableStateOf<Int?>(null)
|
||||
private var drawerTextureLodBias by mutableStateOf<String?>(null)
|
||||
private var lossless by mutableStateOf(Lossless.State.NONE)
|
||||
private val pickLossless = registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { r ->
|
||||
if (r.resultCode == RESULT_OK) InAppFilePicker.pickedFile(r.data)?.let { importLossless(it) }
|
||||
}
|
||||
private var frameGen by mutableStateOf(FrameGen.Mode.OFF)
|
||||
private var frameGenActiveGameId by mutableStateOf<Long?>(null)
|
||||
private var frameGenActiveGameName by mutableStateOf<String?>(null)
|
||||
@@ -1902,10 +1900,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
readPrefs()
|
||||
applyFrameGen(force = true)
|
||||
},
|
||||
onImportLossless = {
|
||||
pickLossless.launch(InAppFilePicker.buildIntent(
|
||||
this@SessionActivity, listOf("dll"), getString(R.string.lsfg_pick_title)))
|
||||
},
|
||||
onKeyboard = { drawerOpen = false; pcKeyboardOpen = false; togglePrimaryKeyboard() },
|
||||
onHardwareKeyboard = ::togglePcKeyboard,
|
||||
wowChatShown = com.droiddeck.launcher.ui.WowChat.isWow(AgentGuest.gameProgram),
|
||||
@@ -2056,6 +2050,8 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
},
|
||||
unfoldedControls = unfoldedControls,
|
||||
onUnfoldedControls = ::chooseUnfoldedControls,
|
||||
deckPanel = unfoldedDeckPanel,
|
||||
onDeckPanel = ::selectDeckPanel,
|
||||
adaptiveSticks = adaptiveSticks.takeIf {
|
||||
unfoldedPanel != null || oscMode != SessionPrefs.OSC_NEVER && oscMode != SessionPrefs.OSC_STEAM_QAM && !steamTouchInUse
|
||||
},
|
||||
@@ -3119,6 +3115,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
intent.getStringArrayExtra(SessionService.EXTRA_PROGRAM_ARGS),
|
||||
intent.getStringExtra(SessionService.EXTRA_GAME_ID),
|
||||
sessionActivityDisplayId,
|
||||
frontendSteamGame = intent.getBooleanExtra(SessionService.EXTRA_FRONTEND_STEAM_GAME, false),
|
||||
)
|
||||
intent.getStringExtra(EXTRA_PLAYED_GAME)?.let { com.droiddeck.launcher.frontend.Library.recordPlayed(this, it) }
|
||||
}
|
||||
@@ -3587,19 +3584,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
}, "lossless-sync").start()
|
||||
}
|
||||
|
||||
private fun importLossless(dll: File) {
|
||||
Thread({
|
||||
val result = Lossless.import(this, dll)
|
||||
val message = Lossless.message(this, result)
|
||||
val state = Lossless.state(this)
|
||||
runOnUiThread {
|
||||
lossless = state
|
||||
Toast.makeText(this, message, Toast.LENGTH_LONG).show()
|
||||
applyFrameGen(force = result == Lossless.ImportResult.UPDATED)
|
||||
}
|
||||
}, "lossless-import").start()
|
||||
}
|
||||
|
||||
|
||||
private fun watchSession() {
|
||||
val handler = Handler(Looper.getMainLooper())
|
||||
@@ -4077,7 +4061,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
steamTouchControls?.let { takes(it, it::takesTouchAt) } == true ||
|
||||
unfoldedPanel?.let { takes(it, it::takesTouchAt) } == true ||
|
||||
unfoldedDeckSurface?.let { takes(it, it::takesTouchAt) } == true ||
|
||||
unfoldedColumn?.getChildAt(0)?.let { takes(it) { _, _ -> true } } == true
|
||||
unfoldedKeys?.let { takes(it) { _, _ -> true } } == true
|
||||
}
|
||||
|
||||
override fun dispatchTouchEvent(event: MotionEvent): Boolean {
|
||||
@@ -5121,12 +5105,9 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
val width = rootContentWidth()
|
||||
val height = rootContentHeight()
|
||||
val wanted = controlsBelowWanted()
|
||||
val tabRow = unfoldedColumn?.getChildAt(0)?.height?.let {
|
||||
it - (com.droiddeck.launcher.ui.BAR_HEIGHT.value * resources.displayMetrics.density + 0.5f).toInt()
|
||||
} ?: 0
|
||||
val outputAspect = if (!wanted || SessionState.followScreen) 0f
|
||||
else outputSize().let { it.first.toFloat() / it.second.coerceAtLeast(1) }
|
||||
val gameHeight = if (wanted) com.droiddeck.launcher.session.SessionDisplay.unfoldedGameHeight(width, height, tabRow, outputAspect)
|
||||
val gameHeight = if (wanted) com.droiddeck.launcher.session.SessionDisplay.unfoldedGameHeight(width, height, aspect = outputAspect)
|
||||
else FrameLayout.LayoutParams.MATCH_PARENT
|
||||
val params = surfaceView.layoutParams as FrameLayout.LayoutParams
|
||||
if (params.height != gameHeight) {
|
||||
@@ -5143,6 +5124,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
if (panel != null && (!wanted || panel.dock != dock)) {
|
||||
sessionRoot.removeView(unfoldedColumn)
|
||||
unfoldedColumn = null
|
||||
unfoldedKeys = null
|
||||
unfoldedDeckSurface = null
|
||||
unfoldedDeckPanel = null
|
||||
unfoldedPanel = null
|
||||
@@ -5154,13 +5136,14 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
panel = OnScreenControls(this, padBridge, dock).also { it.updateLayout(primaryInputLayout) }
|
||||
val column = android.widget.LinearLayout(this).apply {
|
||||
orientation = android.widget.LinearLayout.VERTICAL
|
||||
addView(unfoldedBar().apply {
|
||||
addOnLayoutChangeListener { _, _, top, _, bottom, _, oldTop, _, oldBottom ->
|
||||
if (bottom - top != oldBottom - oldTop) post { applyUnfoldedControls() }
|
||||
}
|
||||
}, android.widget.LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
android.widget.LinearLayout.LayoutParams.WRAP_CONTENT))
|
||||
addView(panel, android.widget.LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT, 0, 1f))
|
||||
unfoldedKeys = com.droiddeck.launcher.ui.padKeysView(
|
||||
this@SessionActivity, SessionState.mode == SessionService.MODE_STEAM,
|
||||
{ releasePads(); drawerOpen = true }, ::tapSteamButton, ::tapQam,
|
||||
).also {
|
||||
addView(it, android.widget.LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT,
|
||||
android.widget.LinearLayout.LayoutParams.WRAP_CONTENT))
|
||||
}
|
||||
}
|
||||
sessionRoot.addView(column, sessionRoot.indexOfChild(surfaceView) + 1)
|
||||
unfoldedColumn = column
|
||||
@@ -5171,13 +5154,6 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
unfoldedColumn?.layoutParams = FrameLayout.LayoutParams(FrameLayout.LayoutParams.MATCH_PARENT, height - gameHeight, Gravity.BOTTOM)
|
||||
}
|
||||
|
||||
private fun unfoldedBar(): View = com.droiddeck.launcher.ui.bottomScreenBarView(this) {
|
||||
val deck = unfoldedDeckPanel
|
||||
com.droiddeck.launcher.ui.sessionBarModel(getString(if (deck != null) R.string.second_mode_deck_controls else R.string.deck_tab_gamepad),
|
||||
{ chooseUnfoldedControls(false) }, { drawerOpen = true }, ::tapSteamButton, ::tapQam,
|
||||
tabs = deck?.let { com.droiddeck.launcher.ui.deckPanelTabs(this, it, ::selectDeckPanel) })
|
||||
}
|
||||
|
||||
private fun showUnfoldedDeckPanel() {
|
||||
val column = unfoldedColumn
|
||||
val panel = unfoldedPanel
|
||||
@@ -5193,7 +5169,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
|
||||
panel.visibility = View.GONE
|
||||
unfoldedDeckSurface = com.droiddeck.launcher.ui.InputSurfaceView(this, padBridge, layout.elements, InputRole.PRIMARY, layout.style, haptics = true).also {
|
||||
it.tag = layout
|
||||
column.addView(it, android.widget.LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT, 0, 1f))
|
||||
column.addView(it, column.indexOfChild(panel) + 1, android.widget.LinearLayout.LayoutParams(android.widget.LinearLayout.LayoutParams.MATCH_PARENT, 0, 1f))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -75,7 +75,9 @@ object AgentHost {
|
||||
"Never kill by a command-line pattern (pkill -f, pgrep -f piped to kill): your own command line holds the user's message, so the pattern matches you. " +
|
||||
"Files the user attaches are listed at the end of their message, under /root/.cache/droiddeck/attachments. " +
|
||||
"To have the user pick between options, end your reply with a fenced code block whose language is choices, one short option per line, " +
|
||||
"and end your turn: DroidDeck shows them as buttons and sends the one picked as the next message."
|
||||
"and end your turn: DroidDeck shows them as buttons and sends the one picked as the next message. " +
|
||||
"To show the user an image (a screenshot, a mockup, a chart), put  on a line of its own: " +
|
||||
"DroidDeck draws the file in the chat."
|
||||
|
||||
val entries = mutableStateListOf<Entry>()
|
||||
val queue = mutableStateListOf<Queued>()
|
||||
|
||||
@@ -226,7 +226,18 @@ object AgentSetup {
|
||||
/** The whole output of a step's last run; the card shows only its last line. */
|
||||
fun logFile(app: Context, step: Step) = File(app.filesDir, "agent/setup-${step.name.lowercase()}.log")
|
||||
|
||||
fun buildToolsInstalled(app: Context) = AgentHost.guestFileExists(app, "/root/aapt2/aapt2") && AgentHost.guestFileExists(app, "$CHECKOUT/.git")
|
||||
/**
|
||||
* An install set up before setup wrote the Gradle init script gets the step again, but only
|
||||
* once the checkout's setup writes it: the step runs that script, and an older one never would.
|
||||
*/
|
||||
fun buildToolsInstalled(app: Context) = AgentHost.guestFileExists(app, "/root/aapt2/aapt2") && AgentHost.guestFileExists(app, "$CHECKOUT/.git") &&
|
||||
(AgentHost.guestFileExists(app, GRADLE_INIT) || !setupWritesGradleInit(app))
|
||||
|
||||
private const val GRADLE_INIT = "/root/.gradle/init.d/droiddeck-device.gradle"
|
||||
|
||||
private fun setupWritesGradleInit(app: Context) = runCatching {
|
||||
File(LinuxRuntime.rootDir(app), "$CHECKOUT/tools/agent/setup".removePrefix("/")).readText().contains(GRADLE_INIT.substringAfterLast('/'))
|
||||
}.getOrDefault(false)
|
||||
|
||||
/** dd-lab-build compiled this install's commit, so a Lab build compiles only what changed. */
|
||||
private fun prepared(app: Context) = runCatching {
|
||||
|
||||
@@ -111,7 +111,7 @@ object FrameGen {
|
||||
if (status != LsfgNative.STATUS_OK || cachePath == null) {
|
||||
WaylandCompositor.nativeSetFrameGenArmed(false, 0, 0)
|
||||
val problem = context.getString(
|
||||
if (status == LsfgNative.STATUS_NOT_INSTALLED) R.string.lsfg_problem_missing else R.string.lsfg_problem_failed,
|
||||
if (status == LsfgNative.STATUS_NOT_INSTALLED) R.string.lsfg_needs_steam else R.string.lsfg_problem_failed,
|
||||
)
|
||||
Log.w(TAG, "$problem (status $status)")
|
||||
return problem
|
||||
|
||||
@@ -2,22 +2,16 @@ package com.droiddeck.launcher.gpu
|
||||
|
||||
import android.content.Context
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.R
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import com.droiddeck.launcher.session.GameStorage
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
import java.io.File
|
||||
import java.security.DigestOutputStream
|
||||
import java.security.MessageDigest
|
||||
|
||||
object Lossless {
|
||||
enum class Source { NONE, STEAM, IMPORT }
|
||||
|
||||
enum class ImportResult { UPDATED, UNCHANGED, NOT_OWNED, INVALID, FAILED }
|
||||
|
||||
data class State(val owned: Boolean, val ready: Boolean, val source: Source) {
|
||||
data class State(val owned: Boolean, val ready: Boolean) {
|
||||
companion object {
|
||||
val NONE = State(owned = false, ready = false, source = Source.NONE)
|
||||
val NONE = State(owned = false, ready = false)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,15 +20,13 @@ object Lossless {
|
||||
private const val KEY_OWNED = "owned"
|
||||
private const val KEY_ID = "id"
|
||||
private const val KEY_SOURCE = "source"
|
||||
private const val SOURCE_STEAM = "STEAM"
|
||||
private const val KEY_STEAM_STAMP = "steamStamp"
|
||||
private const val STEAM_MANIFEST = "steamapps/appmanifest_993090.acf"
|
||||
private const val STEAM_DLL = "steamapps/common/Lossless Scaling/Lossless.dll"
|
||||
private const val UNCHANGED = -1
|
||||
|
||||
fun state(context: Context): State {
|
||||
val source = prefs(context).getString(KEY_SOURCE, null)
|
||||
?.let { name -> Source.entries.firstOrNull { it.name == name } } ?: Source.NONE
|
||||
return State(owned(context), cacheFile(context)?.isFile == true, source)
|
||||
}
|
||||
fun state(context: Context) = State(owned(context), cacheFile(context)?.isFile == true)
|
||||
|
||||
fun owned(context: Context): Boolean {
|
||||
if (prefs(context).getBoolean(KEY_OWNED, false)) return true
|
||||
@@ -43,61 +35,46 @@ object Lossless {
|
||||
return true
|
||||
}
|
||||
|
||||
fun cacheFile(context: Context): File? = prefs(context).getString(KEY_ID, null)?.let { cacheFor(context, it) }
|
||||
fun cacheFile(context: Context): File? = steamCacheId(context)?.let { cacheFor(context, it) }
|
||||
|
||||
private fun steamCacheId(context: Context): String? = prefs(context).let {
|
||||
if (it.getString(KEY_SOURCE, null) == SOURCE_STEAM) it.getString(KEY_ID, null) else null
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun sync(context: Context): Int {
|
||||
val settings = prefs(context)
|
||||
if (steamCacheId(context) == null && settings.contains(KEY_ID)) {
|
||||
settings.edit().remove(KEY_ID).remove(KEY_SOURCE).remove(KEY_STEAM_STAMP).apply()
|
||||
}
|
||||
val steam = steamDll(context)
|
||||
if (steam != null) {
|
||||
markOwned(context)
|
||||
val stamp = "${steam.length()}:${steam.lastModified()}"
|
||||
if (stamp != prefs(context).getString(KEY_STEAM_STAMP, null)) {
|
||||
val status = adopt(context, steam, Source.STEAM)
|
||||
if (stamp != settings.getString(KEY_STEAM_STAMP, null)) {
|
||||
val status = adoptSteamDll(context, steam)
|
||||
if (status != LsfgNative.STATUS_OK && status != UNCHANGED) {
|
||||
Log.w(TAG, "Steam copy $steam not taken: ${statusName(status)}")
|
||||
}
|
||||
prefs(context).edit().putString(KEY_STEAM_STAMP, stamp).apply()
|
||||
settings.edit().putString(KEY_STEAM_STAMP, stamp).apply()
|
||||
}
|
||||
}
|
||||
return ensureBuilt(context)
|
||||
}
|
||||
|
||||
@Synchronized
|
||||
fun import(context: Context, dll: File): ImportResult {
|
||||
if (!owned(context)) return ImportResult.NOT_OWNED
|
||||
return when (adopt(context, dll, Source.IMPORT)) {
|
||||
UNCHANGED -> ImportResult.UNCHANGED
|
||||
LsfgNative.STATUS_OK -> ImportResult.UPDATED
|
||||
LsfgNative.STATUS_UNREADABLE_FILE, LsfgNative.STATUS_NOT_PORTABLE_EXECUTABLE,
|
||||
LsfgNative.STATUS_MISSING_SHADERS -> ImportResult.INVALID
|
||||
else -> ImportResult.FAILED
|
||||
}
|
||||
}
|
||||
|
||||
fun message(context: Context, result: ImportResult): String = context.getString(
|
||||
when (result) {
|
||||
ImportResult.UPDATED -> R.string.lsfg_imported
|
||||
ImportResult.UNCHANGED -> R.string.lsfg_import_unchanged
|
||||
ImportResult.NOT_OWNED -> R.string.lsfg_import_not_owned
|
||||
ImportResult.INVALID -> R.string.lsfg_import_invalid
|
||||
ImportResult.FAILED -> R.string.lsfg_import_failed
|
||||
},
|
||||
)
|
||||
|
||||
private fun ensureBuilt(context: Context): Int {
|
||||
val id = prefs(context).getString(KEY_ID, null) ?: return LsfgNative.STATUS_NOT_INSTALLED
|
||||
val cache = cacheFor(context, id)
|
||||
val cache = cacheFile(context) ?: return LsfgNative.STATUS_NOT_INSTALLED
|
||||
if (usable(cache)) return LsfgNative.STATUS_OK
|
||||
val dll = storedDll(context)
|
||||
if (!dll.isFile) return LsfgNative.STATUS_NOT_INSTALLED
|
||||
return build(dll, cache)
|
||||
}
|
||||
|
||||
private fun adopt(context: Context, source: File, from: Source): Int {
|
||||
private fun adoptSteamDll(context: Context, source: File): Int {
|
||||
val staged = File(dir(context).apply { mkdirs() }, "Lossless.dll.staged")
|
||||
try {
|
||||
val id = copyHashing(source, staged)
|
||||
if (id == prefs(context).getString(KEY_ID, null) && usable(cacheFor(context, id))) return UNCHANGED
|
||||
if (id == steamCacheId(context) && usable(cacheFor(context, id))) return UNCHANGED
|
||||
val cache = cacheFor(context, id)
|
||||
var status = LsfgNative.nativeValidateDll(staged.path)
|
||||
if (status == LsfgNative.STATUS_OK) status = build(staged, cache)
|
||||
@@ -109,9 +86,9 @@ object Lossless {
|
||||
cache.delete()
|
||||
return LsfgNative.STATUS_CACHE_UNUSABLE
|
||||
}
|
||||
prefs(context).edit().putString(KEY_ID, id).putString(KEY_SOURCE, from.name).apply()
|
||||
prefs(context).edit().putString(KEY_ID, id).putString(KEY_SOURCE, SOURCE_STEAM).apply()
|
||||
removeStale(context, id)
|
||||
Log.i(TAG, "Lossless.dll from $source ($from) ready as $id")
|
||||
Log.i(TAG, "Steam Lossless.dll from $source ready as $id")
|
||||
return LsfgNative.STATUS_OK
|
||||
} catch (e: java.io.IOException) {
|
||||
Log.w(TAG, "could not copy $source", e)
|
||||
@@ -158,9 +135,13 @@ object Lossless {
|
||||
GameStorage.effective(context)?.path?.let(::File),
|
||||
GameStorage.x64CardLibrary(context),
|
||||
) + com.droiddeck.launcher.frontend.AddedGames.roots(context).map { it.host }
|
||||
return libraries.map { File(it, STEAM_DLL) }.filter { it.isFile }.maxByOrNull { it.lastModified() }
|
||||
return installedSteamDll(libraries)
|
||||
}
|
||||
|
||||
internal fun installedSteamDll(libraries: List<File>): File? =
|
||||
libraries.asSequence().filter { File(it, STEAM_MANIFEST).isFile }
|
||||
.map { File(it, STEAM_DLL) }.filter { it.isFile }.maxByOrNull { it.lastModified() }
|
||||
|
||||
private fun markOwned(context: Context) {
|
||||
if (!prefs(context).getBoolean(KEY_OWNED, false)) prefs(context).edit().putBoolean(KEY_OWNED, true).apply()
|
||||
}
|
||||
|
||||
@@ -46,7 +46,14 @@ internal class ControllerPortraitGeometry(
|
||||
}
|
||||
row(shoulders, top + pad + buttonHeight / 2f, buttonHeight, 4f * unit)
|
||||
var bodyTop = top + pad + buttonHeight + gap
|
||||
if (presented.any { it.control in REAR && isStock(it) }) {
|
||||
if (presented.any { it.control in REAR && isStock(it) } && docked) {
|
||||
val chipHeight = 36f * unit
|
||||
val cell = (w - 2f * pad - 5f * gap) / 6f
|
||||
listOf(0, 1, 4, 5).zip(REAR).forEach { (index, control) ->
|
||||
put(control, Box(safe.left + pad + cell / 2f + index * (cell + gap), bodyTop + chipHeight / 2f, cell, chipHeight))
|
||||
}
|
||||
bodyTop += chipHeight + gap
|
||||
} else if (presented.any { it.control in REAR && isStock(it) }) {
|
||||
val rearHeight = min(56f * unit, (panel - bodyTop + top) * .12f).coerceAtLeast(buttonHeight)
|
||||
row(REAR, bodyTop + rearHeight / 2f, rearHeight, gap)
|
||||
bodyTop += rearHeight + gap
|
||||
|
||||
@@ -36,6 +36,13 @@ object OnScreenLayout {
|
||||
fun elements(context: Context, saved: SavedInputLayout?, width: Int, height: Int, safe: Rect,
|
||||
buttonsOnly: Boolean = false, dock: Dock? = null, rearButtons: Boolean? = null,
|
||||
trackpads: Boolean? = null): List<InputSurfaceElement> {
|
||||
val placed = placeElements(context, saved, width, height, safe, buttonsOnly, dock, rearButtons, trackpads)
|
||||
// Below the game a stick covers nothing, so it keeps its base in view instead of appearing only under the thumb.
|
||||
return if (dock == null) placed else placed.map { if (it.kind == InputElementKind.STICK) it.copy(hideWhenIdle = false) else it }
|
||||
}
|
||||
|
||||
private fun placeElements(context: Context, saved: SavedInputLayout?, width: Int, height: Int, safe: Rect,
|
||||
buttonsOnly: Boolean, dock: Dock?, rearButtons: Boolean?, trackpads: Boolean?): List<InputSurfaceElement> {
|
||||
if (saved == null) return emptyList()
|
||||
if (width <= 0 || height <= 0) return saved.elements
|
||||
val layout = oriented(saved, dock?.portrait ?: (height > width))
|
||||
|
||||
@@ -0,0 +1,271 @@
|
||||
package com.droiddeck.launcher.runtime
|
||||
|
||||
import android.content.Context
|
||||
import android.os.SystemClock
|
||||
import android.system.Os
|
||||
import android.system.OsConstants
|
||||
import android.util.Log
|
||||
import com.droiddeck.launcher.wayland.WaylandCompositor
|
||||
import java.io.File
|
||||
import java.io.InputStream
|
||||
import java.nio.file.Files
|
||||
import java.nio.file.LinkOption.NOFOLLOW_LINKS
|
||||
import java.security.MessageDigest
|
||||
|
||||
/** One app-issued Steam session and one attested Gamescope worker. This is not an
|
||||
* isolation boundary against arbitrary code already running as the Android app UID. */
|
||||
internal object FrameAcquireWorkerProbe {
|
||||
private const val SESSION_SCRIPT = "/usr/local/bin/droiddeck-session"
|
||||
private const val PATH = "/usr/local/bin/gamescope"
|
||||
private const val CAPABILITY = "linuxfs/usr/local/share/droiddeck/gamescope-producer-acquire-v1"
|
||||
internal const val GAMESCOPE_ENABLE = "GAMESCOPE_DROIDDECK_PRODUCER_ACQUIRE=1"
|
||||
internal const val GAME_ENABLE = "DROIDDECK_GAME_DROIDDECK_GAME_FRAME_ACQUIRE=1"
|
||||
private const val MAX_BINARY_BYTES = 32L * 1024L * 1024L
|
||||
internal const val RECEIPT_TAG = 0x44445046
|
||||
internal const val RECEIPT_BYTES = Int.SIZE_BYTES + Long.SIZE_BYTES
|
||||
private const val TTL_MS = 90_000L
|
||||
|
||||
internal data class Ticket(
|
||||
val owner: Int, val root: File, val configuredRoot: File, val binary: File,
|
||||
val expected: ByteArray, val expires: Long, val steamGameUrl: String?,
|
||||
)
|
||||
internal data class Qualified(val ticket: Ticket, val dev: Long, val ino: Long, val mtime: Long, val ctime: Long)
|
||||
private var intent: Ticket? = null
|
||||
private var nativeOwner = 0
|
||||
private var nativePid = 0
|
||||
|
||||
private enum class Stage { ARM, MATCH, PUBLISH }
|
||||
private enum class Reason {
|
||||
ENABLED, MATCH_ACK, MATCH_OWNER, MATCH_EXPIRED, MATCH_PATH, MATCH_ROOT,
|
||||
MATCH_ARGV, MATCH_FILE, MATCH_DIGEST, QUALIFIED, PUBLISH_TICKET, PUBLISH_RESTAT,
|
||||
PUBLISH_NATIVE, PUBLISH_RECEIPT, RESERVED
|
||||
}
|
||||
private val reported = mutableSetOf<Stage>()
|
||||
@Synchronized private fun breadcrumb(stage: Stage, reason: Reason) {
|
||||
if (reported.add(stage)) Log.i("FrameAcquireWorkerProbe", "worker_admission=" + reason.name)
|
||||
}
|
||||
|
||||
internal fun validEnvironment(agentEnvironment: List<String>, customEnvironment: List<String>): Boolean {
|
||||
// AgentEnv supplies a replacement PATH whenever any executable override is staged.
|
||||
// Custom env is user-editable, including names not known to this build; it is not a trust root.
|
||||
return agentEnvironment.isEmpty() && customEnvironment.isEmpty()
|
||||
}
|
||||
|
||||
fun available(context: Context): Boolean =
|
||||
android.os.Build.VERSION.SDK_INT >= 30 && com.droiddeck.launcher.core.DeviceSupport.adreno() &&
|
||||
runCatching { context.assets.open(CAPABILITY).use { it.readBytes().decodeToString() } }
|
||||
.getOrNull() == "droiddeck-producer-acquire-v1\n"
|
||||
|
||||
private fun digest(input: InputStream, maxBytes: Long): ByteArray {
|
||||
val out = MessageDigest.getInstance("SHA-256")
|
||||
val buffer = ByteArray(64 * 1024)
|
||||
var size = 0L
|
||||
while (true) {
|
||||
val n = input.read(buffer)
|
||||
if (n == -1) break
|
||||
require(n > 0)
|
||||
size += n
|
||||
require(size <= maxBytes)
|
||||
out.update(buffer, 0, n)
|
||||
}
|
||||
require(size > 0)
|
||||
return out.digest()
|
||||
}
|
||||
|
||||
// Compute asset identity outside SessionService's stop lock and before a worker
|
||||
// exists. The resulting ticket still has to be assigned to that exact owner.
|
||||
private const val STEAM_RUN_PREFIX = "steam://rungameid/"
|
||||
|
||||
internal fun permittedLaunch(url: String?, frontendGame: Boolean): Boolean =
|
||||
if (url == null) !frontendGame else frontendGame && url.startsWith(STEAM_RUN_PREFIX) &&
|
||||
com.droiddeck.launcher.frontend.GameLaunchLink.validId(url.removePrefix(STEAM_RUN_PREFIX))
|
||||
|
||||
internal fun prepare(context: Context, steamGameUrl: String?, frontendGame: Boolean): Ticket? {
|
||||
if (!permittedLaunch(steamGameUrl, frontendGame) ||
|
||||
!available(context) || !WaylandCompositor.frameWorkerProbeEnabled()) return null
|
||||
return runCatching {
|
||||
val configuredRoot = LinuxRuntime.rootDir(context).absoluteFile
|
||||
val root = configuredRoot.canonicalFile
|
||||
val file = File(root.path + PATH)
|
||||
require(file.canonicalFile == file && Files.isRegularFile(file.toPath(), NOFOLLOW_LINKS))
|
||||
val script = File(root.path + SESSION_SCRIPT)
|
||||
require(exactSteamScript(SESSION_SCRIPT, root, configuredRoot))
|
||||
val stagedScript = script.inputStream().use { digest(it, 1024L * 1024L) }
|
||||
val signedScript = context.assets.open("linuxfs" + SESSION_SCRIPT).use { digest(it, 1024L * 1024L) }
|
||||
require(MessageDigest.isEqual(stagedScript, signedScript))
|
||||
val expected = context.assets.open("linuxfs" + PATH).use { digest(it, MAX_BINARY_BYTES) }
|
||||
Ticket(0, root, configuredRoot, file, expected, SystemClock.elapsedRealtime() + TTL_MS, steamGameUrl)
|
||||
}.getOrNull()
|
||||
}
|
||||
|
||||
@Synchronized fun arm(owner: Int, prepared: Ticket): Boolean {
|
||||
if (owner <= 0 || SystemClock.elapsedRealtime() >= prepared.expires) return false
|
||||
reported.clear()
|
||||
intent = prepared.copy(owner = owner)
|
||||
breadcrumb(Stage.ARM, Reason.ENABLED)
|
||||
return true
|
||||
}
|
||||
|
||||
/** Native shebang handling can give Bash the staged host filename as its $0. */
|
||||
internal fun exactSteamScript(token: String, root: File, configuredRoot: File): Boolean {
|
||||
if (token != SESSION_SCRIPT && token != root.path + SESSION_SCRIPT &&
|
||||
token != configuredRoot.path + SESSION_SCRIPT) return false
|
||||
return runCatching {
|
||||
val expected = File(root.path + SESSION_SCRIPT)
|
||||
val supplied = if (token == SESSION_SCRIPT) expected else File(token)
|
||||
// Reject symlinks within the authorized root, including a symlink replacing the script.
|
||||
// Android's configured root itself may be an alias of its app-issued canonical root.
|
||||
require(configuredRoot.canonicalFile == root && expected.canonicalFile == expected &&
|
||||
supplied.canonicalFile == expected &&
|
||||
Files.isRegularFile(expected.toPath(), NOFOLLOW_LINKS) &&
|
||||
Files.isRegularFile(supplied.toPath(), NOFOLLOW_LINKS))
|
||||
Files.isSameFile(supplied.toPath(), expected.toPath())
|
||||
}.getOrDefault(false)
|
||||
}
|
||||
|
||||
internal fun exactGamescopeArgs(
|
||||
argv: List<String>, steamGameUrl: String? = null, script: (String) -> Boolean,
|
||||
): Boolean {
|
||||
if (argv.firstOrNull() !in listOf("gamescope", PATH)) return false
|
||||
val delimiter = argv.indexOf("--")
|
||||
val tailSize = if (steamGameUrl == null) 3 else 4
|
||||
if (delimiter < 4 || argv.size != delimiter + tailSize || argv[delimiter + 2] != "steam" ||
|
||||
!script(argv[delimiter + 1]) ||
|
||||
(steamGameUrl != null && (!permittedLaunch(steamGameUrl, true) || argv.last() != steamGameUrl))) return false
|
||||
val opts = argv.subList(1, delimiter)
|
||||
if (opts.take(4) != listOf("--backend", "wayland", "--expose-wayland", "-f")) return false
|
||||
val dimensions = setOf("-W", "-H", "-w", "-h")
|
||||
val seen = mutableSetOf<String>()
|
||||
var i = 4
|
||||
while (i < opts.size) {
|
||||
val option = opts[i++]
|
||||
if (!seen.add(option)) return false
|
||||
when (option) {
|
||||
"-e", "--hdr-enabled", "--mangoapp" -> Unit
|
||||
"-S" -> if (opts.getOrNull(i++) != "stretch") return false
|
||||
"--default-touch-mode" -> if (opts.getOrNull(i++) != "4") return false
|
||||
"-W", "-H", "-w", "-h", "-r", "--xwayland-count" -> {
|
||||
val value = opts.getOrNull(i++) ?: return false
|
||||
if (value.length !in 1..6 || value.any { it !in '0'..'9' } ||
|
||||
value.toIntOrNull()?.let { it > 0 } != true) return false
|
||||
}
|
||||
else -> return false
|
||||
}
|
||||
}
|
||||
return seen.containsAll(dimensions)
|
||||
}
|
||||
|
||||
fun match(owner: Int, root: File, file: String, argv: List<String>, ack: Boolean): Qualified? {
|
||||
val t = synchronized(this) { intent } ?: return null
|
||||
// Startup's --version worker and unrelated workers must not consume the one diagnostic.
|
||||
val candidate = "--version" !in argv && (file.substringAfterLast('/') == "gamescope" ||
|
||||
argv.firstOrNull()?.substringAfterLast('/') == "gamescope")
|
||||
val rejection = when {
|
||||
!ack -> Reason.MATCH_ACK
|
||||
t.owner != owner -> Reason.MATCH_OWNER
|
||||
SystemClock.elapsedRealtime() >= t.expires -> Reason.MATCH_EXPIRED
|
||||
file != PATH -> Reason.MATCH_PATH
|
||||
runCatching { root.canonicalFile }.getOrNull() != t.root -> Reason.MATCH_ROOT
|
||||
!exactGamescopeArgs(argv, t.steamGameUrl) { exactSteamScript(it, t.root, t.configuredRoot) } -> Reason.MATCH_ARGV
|
||||
else -> null
|
||||
}
|
||||
if (rejection != null) {
|
||||
if (candidate) breadcrumb(Stage.MATCH, rejection)
|
||||
return null
|
||||
}
|
||||
// Hash an actual descriptor rather than two pathname opens. Check both the
|
||||
// descriptor and pathname identity; a race or substituted executable denies the grant.
|
||||
val qualified = runCatching {
|
||||
require(t.binary.canonicalFile == t.binary)
|
||||
val before = Os.lstat(t.binary.path)
|
||||
require(OsConstants.S_ISREG(before.st_mode) && before.st_size in 1..MAX_BINARY_BYTES)
|
||||
val fd = Os.open(t.binary.path, OsConstants.O_RDONLY or OsConstants.O_NOFOLLOW or OsConstants.O_CLOEXEC, 0)
|
||||
val sum = try {
|
||||
require(stillSame(before, Os.fstat(fd)))
|
||||
android.os.ParcelFileDescriptor.AutoCloseInputStream(android.os.ParcelFileDescriptor.dup(fd)).use {
|
||||
digest(it, MAX_BINARY_BYTES)
|
||||
}.also { require(stillSame(before, Os.fstat(fd))) }
|
||||
} finally {
|
||||
Os.close(fd)
|
||||
}
|
||||
val after = Os.lstat(t.binary.path)
|
||||
require(stillSame(before, after))
|
||||
if (!MessageDigest.isEqual(sum, t.expected)) {
|
||||
breadcrumb(Stage.MATCH, Reason.MATCH_DIGEST)
|
||||
return null
|
||||
}
|
||||
Qualified(t, after.st_dev, after.st_ino, after.st_mtime, after.st_ctime)
|
||||
}.getOrNull()
|
||||
breadcrumb(Stage.MATCH, if (qualified == null) Reason.MATCH_FILE else Reason.QUALIFIED)
|
||||
return qualified
|
||||
}
|
||||
|
||||
private fun stillSame(a: android.system.StructStat, b: android.system.StructStat): Boolean =
|
||||
a.st_dev == b.st_dev && a.st_ino == b.st_ino && a.st_size == b.st_size &&
|
||||
a.st_mtime == b.st_mtime && a.st_ctime == b.st_ctime &&
|
||||
OsConstants.S_ISREG(b.st_mode)
|
||||
|
||||
internal fun validReceipt(pid: Int, workerPid: Int, ticks: Long, bytes: Int): Long =
|
||||
if (pid > 1 && pid == workerPid && ticks > 0 && bytes == RECEIPT_BYTES) ticks else 0L
|
||||
|
||||
internal fun parseSelfStat(stat: String, pid: Int): Long {
|
||||
if (pid <= 1 || !stat.startsWith("$pid (")) return 0L
|
||||
val comm = stat.lastIndexOf(')')
|
||||
if (comm < 3 || stat.getOrNull(comm + 1) != ' ') return 0L
|
||||
val fields = stat.substring(comm + 2).split(' ').filter { it.isNotEmpty() }
|
||||
if (fields.firstOrNull()?.length != 1 || fields.size < 21) return 0L
|
||||
val value = fields[19] // field 22 from field 3 (the single-character task state).
|
||||
return value.takeIf { it.isNotEmpty() && it.all { ch -> ch in '0'..'9' } }
|
||||
?.toLongOrNull()?.takeIf { it > 0 } ?: 0L
|
||||
}
|
||||
|
||||
internal fun selfStartTicks(pid: Int): Long = runCatching {
|
||||
File("/proc/self/stat").inputStream().use { input ->
|
||||
val bytes = ByteArray(4096)
|
||||
var used = 0
|
||||
while (used < bytes.size) {
|
||||
val n = input.read(bytes, used, bytes.size - used)
|
||||
if (n < 0) break
|
||||
if (n == 0) return@runCatching 0L
|
||||
used += n
|
||||
}
|
||||
if (used == bytes.size || used == 0 || bytes[used-1] != '\n'.code.toByte()) 0L
|
||||
else parseSelfStat(String(bytes, 0, used, Charsets.US_ASCII), pid)
|
||||
}
|
||||
}.getOrDefault(0L)
|
||||
|
||||
/** Runs just before the final GO byte. Failure never changes ordinary launch. */
|
||||
@Synchronized fun publish(q: Qualified, pid: Int, startTicks: Long) {
|
||||
val t = q.ticket
|
||||
if (intent !== t || pid <= 1 || SystemClock.elapsedRealtime() >= t.expires) {
|
||||
if (intent === t) breadcrumb(Stage.PUBLISH, Reason.PUBLISH_TICKET)
|
||||
return
|
||||
}
|
||||
intent = null // At most one candidate per explicitly armed session.
|
||||
if (startTicks <= 0L) {
|
||||
breadcrumb(Stage.PUBLISH, Reason.PUBLISH_RECEIPT)
|
||||
return
|
||||
}
|
||||
val status = runCatching {
|
||||
val st = Os.lstat(t.binary.path)
|
||||
require(OsConstants.S_ISREG(st.st_mode) && st.st_dev == q.dev && st.st_ino == q.ino &&
|
||||
st.st_mtime == q.mtime && st.st_ctime == q.ctime)
|
||||
if (WaylandCompositor.frameWorkerProbeGrant(t.owner, pid, t.expires, t.binary.path, st.st_dev, st.st_ino, startTicks)) {
|
||||
nativeOwner = t.owner
|
||||
nativePid = pid
|
||||
Reason.RESERVED
|
||||
} else Reason.PUBLISH_NATIVE
|
||||
}.getOrDefault(Reason.PUBLISH_RESTAT)
|
||||
breadcrumb(Stage.PUBLISH, status)
|
||||
}
|
||||
|
||||
@Synchronized fun revoke(owner: Int, pid: Int = 0) {
|
||||
if (owner <= 0) return
|
||||
if (pid == 0 && intent?.owner == owner) intent = null
|
||||
if (nativeOwner == owner && (pid == 0 || pid == nativePid)) {
|
||||
WaylandCompositor.frameWorkerProbeRevoke(owner, pid)
|
||||
nativeOwner = 0
|
||||
nativePid = 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -45,7 +45,16 @@ open class GuestWorker : Service() {
|
||||
val fillBinderFd = data.readInt() != 0
|
||||
val go = data.readFileDescriptor()
|
||||
val nice = data.readInt()
|
||||
reply?.writeInt(Process.myPid())
|
||||
val pid = Process.myPid()
|
||||
reply?.writeInt(pid)
|
||||
// Optional fixed-size receipt, on the exact local, non-exported worker's Binder.
|
||||
// Nothing in the guest socket request populates these fields.
|
||||
if (reply != null &&
|
||||
Binder.getCallingUid() == Process.myUid() &&
|
||||
data.dataAvail() == Int.SIZE_BYTES && data.readInt() == FrameAcquireWorkerProbe.RECEIPT_TAG) {
|
||||
reply.writeInt(pid)
|
||||
reply.writeLong(FrameAcquireWorkerProbe.selfStartTicks(pid))
|
||||
}
|
||||
Handler(Looper.getMainLooper()).post {
|
||||
// The app writes a byte once it has the reply and has taken the launch on: an exec
|
||||
// before then would end this process with the reply undelivered, and with none (the
|
||||
@@ -437,7 +446,8 @@ object GuestWorkers {
|
||||
private fun start(context: Context, argv: List<String>, env: List<String>, fds: List<ParcelFileDescriptor>, targets: IntArray,
|
||||
guest: Boolean, onExit: (Int) -> Unit, commit: (Int) -> Boolean = { true },
|
||||
confirmed: () -> Boolean = { true }, owner: Int = session,
|
||||
nice: Int = Process.getThreadPriority(Process.myTid())): Int {
|
||||
nice: Int = Process.getThreadPriority(Process.myTid()),
|
||||
testWorker: FrameAcquireWorkerProbe.Qualified? = null): Int {
|
||||
val app = context.applicationContext
|
||||
if (guest && owner <= stopped) {
|
||||
Log.w(TAG, (if (owner == 0) "a request naming no session" else "session $owner is stopping") +
|
||||
@@ -473,13 +483,21 @@ object GuestWorkers {
|
||||
data.writeInt(if (guest) 0 else 1)
|
||||
data.writeFileDescriptor(go[0].fileDescriptor)
|
||||
data.writeInt(nice)
|
||||
slot.service!!.transact(GuestWorker.RUN, data, reply, 0)
|
||||
val service = checkNotNull(slot.service)
|
||||
if (testWorker != null) data.writeInt(FrameAcquireWorkerProbe.RECEIPT_TAG)
|
||||
check(service.transact(GuestWorker.RUN, data, reply, 0))
|
||||
// The worker has its own copy: with ours closed (and the request's, which holds one too),
|
||||
// a worker that gave up leaves no reader
|
||||
data.recycle()
|
||||
data = null
|
||||
go[0].close()
|
||||
val pid = reply.readInt()
|
||||
val startTicks = if (testWorker != null) {
|
||||
val size = reply.dataAvail()
|
||||
if (size == FrameAcquireWorkerProbe.RECEIPT_BYTES)
|
||||
FrameAcquireWorkerProbe.validReceipt(pid, reply.readInt(), reply.readLong(), size)
|
||||
else 0L
|
||||
} else 0L
|
||||
// Once a session's teardown has begun (stopGuests), none of its programs may start: it
|
||||
// would not find them.
|
||||
val stopping = { guest && owner <= stopped }
|
||||
@@ -508,7 +526,12 @@ object GuestWorkers {
|
||||
// launching slot), or never.
|
||||
val answered = Os.poll(arrayOf(answer), ANSWER_TIMEOUT_MS) > 0 && Os.read(go[1].fileDescriptor, ByteArray(1), 0, 1) == 1
|
||||
val accepted = answered && synchronized(authorizing) {
|
||||
!stopping() && confirmed() && Os.write(go[1].fileDescriptor, byteArrayOf(1), 0, 1) == 1
|
||||
if (stopping() || !confirmed()) false
|
||||
else {
|
||||
if (testWorker != null) FrameAcquireWorkerProbe.publish(testWorker, pid,
|
||||
if (slot.service === service) startTicks else 0L)
|
||||
Os.write(go[1].fileDescriptor, byteArrayOf(1), 0, 1) == 1
|
||||
}
|
||||
}
|
||||
val endedRunning = synchronized(slots) {
|
||||
slot.launching = false
|
||||
@@ -685,6 +708,7 @@ object GuestWorkers {
|
||||
}
|
||||
}
|
||||
context?.let { app -> drained.forEach { release(app, it) } }
|
||||
FrameAcquireWorkerProbe.revoke(of)
|
||||
val pids = guestPids(of)
|
||||
if (pids.isEmpty()) return
|
||||
pids.forEach { Process.sendSignal(it, OsConstants.SIGTERM) }
|
||||
@@ -902,16 +926,19 @@ object GuestWorkers {
|
||||
val owner = request.optInt("session", 0).coerceAtLeast(0)
|
||||
// The sender is the forked child (or droiddeck-spawn): its priority is the one the program would inherit
|
||||
val nice = runCatching { Process.getThreadPriority(client.peerCredentials.pid) }.getOrDefault(Process.THREAD_PRIORITY_DEFAULT)
|
||||
val testWorker = FrameAcquireWorkerProbe.match(owner, root, file, argv, ack)
|
||||
val pid = start(app, command, env.map { (k, v) -> "$k=$v" }, programFds, targets, true, owner = owner, nice = nice, onExit = { code ->
|
||||
if (testWorker != null && worker > 1) FrameAcquireWorkerProbe.revoke(owner, worker)
|
||||
status = code
|
||||
if (table != null && slot >= 0) reportExit(table, slot, code, parent, child, worker)
|
||||
exited.countDown()
|
||||
}, confirmed = {
|
||||
!ack || runCatching {
|
||||
val confirmed = !ack || runCatching {
|
||||
out.write("ok\n".toByteArray())
|
||||
out.flush()
|
||||
confirmedToHook = true
|
||||
}.isSuccess
|
||||
confirmed
|
||||
}, commit = { started ->
|
||||
worker = started
|
||||
if (!ack) return@start true
|
||||
@@ -930,7 +957,8 @@ object GuestWorkers {
|
||||
}
|
||||
ended && line.toString() == "go"
|
||||
}.getOrDefault(false)
|
||||
})
|
||||
}, testWorker = testWorker)
|
||||
if (pid <= 0 && testWorker != null && worker > 1) FrameAcquireWorkerProbe.revoke(owner, worker)
|
||||
handedOver = true
|
||||
programFds.filter { it !== table }.forEach { runCatching { it.close() } }
|
||||
if (pid <= 0) table?.let { runCatching { it.close() } }
|
||||
|
||||
@@ -1874,6 +1874,13 @@ object SessionPrefs {
|
||||
prefs(context).edit().putBoolean(hdrKey(mode), on).apply()
|
||||
}
|
||||
|
||||
/** Restart-scoped opt-in; not inferred from Zero-copy (which defaults on). */
|
||||
fun producerAcquireFences(context: Context): Boolean = prefs(context).getBoolean("producerAcquireFences", false)
|
||||
|
||||
fun setProducerAcquireFences(context: Context, on: Boolean) {
|
||||
prefs(context).edit().putBoolean("producerAcquireFences", on).apply()
|
||||
}
|
||||
|
||||
fun zeroCopy(context: Context, mode: String): Boolean = prefs(context).getBoolean("zeroCopy.${prefMode(mode)}", true)
|
||||
|
||||
fun setZeroCopy(context: Context, mode: String, on: Boolean) {
|
||||
|
||||
@@ -394,8 +394,10 @@ class SessionService : Service() {
|
||||
SessionState.program = intent?.getStringExtra(EXTRA_PROGRAM)
|
||||
SessionState.programArgs = intent?.getStringArrayExtra(EXTRA_PROGRAM_ARGS)?.toList().orEmpty()
|
||||
SessionState.steamUi = intent?.getStringExtra(EXTRA_STEAM_UI)
|
||||
SessionState.steamUrl = intent?.getStringExtra(EXTRA_STEAM_URL)
|
||||
val steamUrlGameId = SessionState.steamUrl
|
||||
val launchSteamUrl = intent?.getStringExtra(EXTRA_STEAM_URL)
|
||||
val frontendSteamGame = intent?.getBooleanExtra(EXTRA_FRONTEND_STEAM_GAME, false) == true
|
||||
SessionState.steamUrl = launchSteamUrl
|
||||
val steamUrlGameId = launchSteamUrl
|
||||
?.let { url ->
|
||||
when {
|
||||
url.startsWith(GAME_URL_PREFIX) ->
|
||||
@@ -447,7 +449,7 @@ class SessionService : Service() {
|
||||
Thread({
|
||||
OrphanReaper.reap("session starting")
|
||||
ProtonExtras.awaitReplacement(120_000)
|
||||
runSession(gen)
|
||||
runSession(gen, launchSteamUrl, frontendSteamGame)
|
||||
}, "session-start").start()
|
||||
return START_NOT_STICKY
|
||||
}
|
||||
@@ -500,7 +502,7 @@ class SessionService : Service() {
|
||||
}
|
||||
|
||||
|
||||
private fun runSession(gen: Int) {
|
||||
private fun runSession(gen: Int, launchSteamUrl: String?, frontendSteamGame: Boolean) {
|
||||
SessionPrefs.ensurePowerVrAutoDriversAfterGpuQuery(this)
|
||||
if (!com.droiddeck.launcher.core.DeviceSupport.adreno()) {
|
||||
com.droiddeck.launcher.gpu.VulkanInfo.query()["api"]?.let { SessionPrefs.setHostVulkanApi(this, it) }
|
||||
@@ -555,9 +557,10 @@ class SessionService : Service() {
|
||||
return
|
||||
}
|
||||
}
|
||||
val agentEnvironment = runCatching { com.droiddeck.launcher.agent.AgentEnv.beginSession(this) }
|
||||
val nextAgentEnvironment = runCatching { com.droiddeck.launcher.agent.AgentEnv.beginSession(this) }
|
||||
.onFailure { Log.w(TAG, "agent environment skipped", it) }
|
||||
.getOrDefault(emptyList())
|
||||
val agentEnvironment = nextAgentEnvironment.getOrDefault(emptyList())
|
||||
val customEnvironment = extraEnv()
|
||||
try {
|
||||
if (systemVulkan) {
|
||||
SystemVulkanDriver.prepare(this)
|
||||
@@ -623,7 +626,7 @@ class SessionService : Service() {
|
||||
.onFailure { Log.w(TAG, "forced components", it) }
|
||||
}
|
||||
try {
|
||||
SessionEvents.step("client-environment") { addClientEnvironment(guest, steamHere, agentEnvironment) }
|
||||
SessionEvents.step("client-environment") { addClientEnvironment(guest, steamHere, agentEnvironment, customEnvironment) }
|
||||
} catch (e: IllegalStateException) {
|
||||
Log.e(TAG, "Could not resolve the selected Linux Vulkan driver", e)
|
||||
failSession(gen, "VULKAN_DRIVER_UNAVAILABLE", e.message ?: "Selected Linux Vulkan driver is unavailable", -1)
|
||||
@@ -708,15 +711,28 @@ class SessionService : Service() {
|
||||
// this session's worker number: the shared field may be a newer session's by the time it is used
|
||||
var ownWorkers = 0
|
||||
if (com.droiddeck.launcher.runtime.GuestWorkers.enabled(this)) {
|
||||
val fenceWorker = com.droiddeck.launcher.runtime.FrameAcquireWorkerProbe
|
||||
val preparedFence = if (steamHere && !systemVulkan && !VenusComponent.wanted(this) &&
|
||||
SessionPrefs.zeroCopy(this, MODE_STEAM) && SessionPrefs.producerAcquireFences(this) &&
|
||||
nextAgentEnvironment.isSuccess && fenceWorker.validEnvironment(agentEnvironment, customEnvironment)
|
||||
) fenceWorker.prepare(this, launchSteamUrl, frontendSteamGame) else null
|
||||
var fenceArmed = false
|
||||
// Under the lock a stop takes its number with: a stop either comes first (and this session
|
||||
// starts no workers) or owns them
|
||||
ownWorkers = synchronized(stopLock) {
|
||||
if (gen != sessionGen || !SessionState.running) 0
|
||||
else com.droiddeck.launcher.runtime.GuestWorkers.serve(this).also { guestWorkerSession = it }
|
||||
else com.droiddeck.launcher.runtime.GuestWorkers.serve(this).also {
|
||||
guestWorkerSession = it
|
||||
if (preparedFence != null) fenceArmed = fenceWorker.arm(it, preparedFence)
|
||||
}
|
||||
}
|
||||
if (ownWorkers > 0) {
|
||||
guest.add("DD_SPAWN=" + com.droiddeck.launcher.runtime.GuestWorkers.socketName(this))
|
||||
guest.add("DD_SPAWN_SESSION=$ownWorkers")
|
||||
if (fenceArmed) {
|
||||
guest.add(fenceWorker.GAMESCOPE_ENABLE)
|
||||
guest.add(fenceWorker.GAME_ENABLE)
|
||||
}
|
||||
}
|
||||
}
|
||||
// Proton builds up to 11.12 report X11 text fields under this name.
|
||||
@@ -738,7 +754,7 @@ class SessionService : Service() {
|
||||
val desktopGuest = ArrayList(guest)
|
||||
guest.add(LinuxRuntime.SESSION_SCRIPT)
|
||||
guest.add(SessionState.mode)
|
||||
if (SessionState.mode == MODE_STEAM) SessionState.steamUrl?.takeIf { it.startsWith("steam://") }?.let {
|
||||
if (SessionState.mode == MODE_STEAM) launchSteamUrl?.takeIf { it.startsWith("steam://") }?.let {
|
||||
guest.add(it)
|
||||
Log.i(TAG, "steam: handing the client $it")
|
||||
}
|
||||
@@ -1017,7 +1033,8 @@ class SessionService : Service() {
|
||||
return com.droiddeck.launcher.input.GesturePrefs.read(this, game).relativeMouseMode
|
||||
}
|
||||
|
||||
private fun addClientEnvironment(guest: MutableList<String>, steamHere: Boolean, agentEnvironment: List<String>) {
|
||||
private fun addClientEnvironment(guest: MutableList<String>, steamHere: Boolean,
|
||||
agentEnvironment: List<String>, customEnvironment: List<String>) {
|
||||
guest.add("/usr/bin/env")
|
||||
guest.add("-i")
|
||||
guest.add("DROIDDECK_BWRAP_SOCKET=" + com.droiddeck.launcher.runtime.BwrapSpawner.socket(this))
|
||||
@@ -1135,7 +1152,7 @@ class SessionService : Service() {
|
||||
guest.add("DD_ZRAM=1")
|
||||
}
|
||||
guest.add("AUDIO_DIRECT_DECAY=0")
|
||||
val extra = extraEnv() + agentEnvironment
|
||||
val extra = customEnvironment + agentEnvironment
|
||||
guest.addAll(TurnipEnvironment.gameEnvironment(tuOverride, tuDriver, SessionPrefs.tuSysmem(this), extra))
|
||||
if (extra.none { it.startsWith("MESA_NO_ERROR=") }) guest.add("${GAME_PREFIX}MESA_NO_ERROR=")
|
||||
extra.forEach { guest.add(it) }
|
||||
@@ -2755,6 +2772,9 @@ class SessionService : Service() {
|
||||
const val EXTRA_PROGRAM_ARGS = "programArgs"
|
||||
const val EXTRA_STEAM_UI = "steamUi"
|
||||
const val EXTRA_STEAM_URL = "steamUrl"
|
||||
// Set by the first-party Library play action on the private SessionActivity/Service path.
|
||||
// Never copied from an exported intent or Agent command.
|
||||
internal const val EXTRA_FRONTEND_STEAM_GAME = "com.droiddeck.launcher.FRONTEND_STEAM_GAME"
|
||||
const val EXTRA_GAME_ID = "gameId"
|
||||
|
||||
fun start(
|
||||
@@ -2762,6 +2782,7 @@ class SessionService : Service() {
|
||||
steamUi: String? = null, steamUrl: String? = null, programArgs: Array<String>? = null,
|
||||
gameId: String? = null,
|
||||
displayId: Int = Display.DEFAULT_DISPLAY,
|
||||
frontendSteamGame: Boolean = false,
|
||||
) {
|
||||
SteamClientPrefetch.cancel()
|
||||
SessionState.activityDisplayId = displayId
|
||||
@@ -2772,6 +2793,7 @@ class SessionService : Service() {
|
||||
if (programArgs != null) intent.putExtra(EXTRA_PROGRAM_ARGS, programArgs)
|
||||
if (steamUi != null) intent.putExtra(EXTRA_STEAM_UI, steamUi)
|
||||
if (steamUrl != null) intent.putExtra(EXTRA_STEAM_URL, steamUrl)
|
||||
if (frontendSteamGame) intent.putExtra(EXTRA_FRONTEND_STEAM_GAME, true)
|
||||
if (gameId != null) intent.putExtra(EXTRA_GAME_ID, gameId)
|
||||
if (Build.VERSION.SDK_INT >= 26) context.startForegroundService(intent)
|
||||
else context.startService(intent)
|
||||
|
||||
@@ -20,7 +20,7 @@ object SettingsReset {
|
||||
"gamepadLeft", "gamepadRight", "pipAutoEnter", "unfoldedControls", "unfoldedControlsWithController",
|
||||
"stretch16x9", "avoidNotch", "picturePosition", "integerScaling", "railLabels", "developerTools", "navTabOrder", "navTabShelved", "navTabHidden", "drawerPageOrder", "drawerPageHidden", "drawerSections", "pcKeyboardSize", "pcKeyboardOpacity", "pcKeyboardHiddenKeys",
|
||||
"gpuDriverMode", "androidDriver", "linuxDriver", "linuxDriver.steam", "linuxDriver.desktop",
|
||||
"tuSysmem", "glThread", "noGlError", "zinkLazy", "mangoapp", "gpuClockPin", "gamescopeRealtime", "paceCores",
|
||||
"tuSysmem", "glThread", "noGlError", "zinkLazy", "mangoapp", "gpuClockPin", "gamescopeRealtime", "producerAcquireFences", "paceCores",
|
||||
"directAudio", "mic", "wifiDiscovery", "clientCpusOverride", "clientCpus", "gameCpus",
|
||||
"noXalia", "fastSync", "fsyncFirst", "syncFallback", "prootNoSeccomp", "prootFastPath", "nativeUserland", "cursorComposite", "mountSharedStorage",
|
||||
"guestHostname", "fexPreset", "forceSsbs", "logs", "gameDebugLogsEnabled", "enhancedDiagnosticsNext", "storageDiagnostics", "buildWatermark",
|
||||
|
||||
@@ -14,9 +14,14 @@ internal object WebCookies {
|
||||
}
|
||||
}
|
||||
|
||||
fun scopes(url: String, paths: List<String>): List<String> {
|
||||
val segments = runCatching { java.net.URI(url).path }.getOrNull().orEmpty().split('/').filter { it.isNotEmpty() }
|
||||
return (paths + segments.indices.map { i -> "/" + segments.take(i + 1).joinToString("/") }).distinct()
|
||||
}
|
||||
|
||||
fun expire(urls: List<String>, domain: String, paths: List<String>, done: (Int) -> Unit) {
|
||||
val cookies = CookieManager.getInstance()
|
||||
val lines = urls.flatMap { url -> expired(cookies.getCookie(url), domain, paths, Uri.parse(url).host).map { url to it } }
|
||||
val lines = urls.flatMap { url -> expired(cookies.getCookie(url), domain, scopes(url, paths), Uri.parse(url).host).map { url to it } }
|
||||
if (lines.isEmpty()) {
|
||||
done(0)
|
||||
return
|
||||
|
||||
@@ -44,7 +44,7 @@ object EaBackend : StoreBackend {
|
||||
signOuts.incrementAndGet()
|
||||
StoresState.post { StoresState.shelves.remove(store) }
|
||||
EaUpdates.available.clear()
|
||||
runCatching { WebCookies.expire(EaLogin.SIGN_IN_URLS, ".ea.com", listOf("/")) {} }
|
||||
EaLogin.forget {}
|
||||
}
|
||||
|
||||
override fun syncLibrary(context: Context, force: Boolean) {
|
||||
@@ -100,9 +100,7 @@ internal class EaLogin(private val pending: EaAuth.Pending, override val userAge
|
||||
|
||||
override fun isRedirect(url: String): Boolean = url.startsWith("qrc:", ignoreCase = true)
|
||||
|
||||
override fun forgetSignIn(done: () -> Unit) {
|
||||
runCatching { WebCookies.expire(SIGN_IN_URLS, ".ea.com", listOf("/")) { done() } }.onFailure { done() }
|
||||
}
|
||||
override fun forgetSignIn(done: () -> Unit) = forget(done)
|
||||
|
||||
override fun finish(activity: StoreLoginActivity, view: WebView, url: String): String? {
|
||||
val code = EaAuth.redirectValue(url, "code") ?: return activity.getString(R.string.stores_login_error_verification)
|
||||
@@ -116,7 +114,11 @@ internal class EaLogin(private val pending: EaAuth.Pending, override val userAge
|
||||
}
|
||||
|
||||
companion object {
|
||||
val SIGN_IN_URLS = listOf("https://accounts.ea.com", "https://signin.ea.com", "https://www.ea.com")
|
||||
val SIGN_IN_URLS = listOf(EaAuth.AUTH_URL, "https://signin.ea.com/p/juno/login", "https://www.ea.com")
|
||||
|
||||
fun forget(done: () -> Unit) {
|
||||
runCatching { WebCookies.expire(SIGN_IN_URLS, ".ea.com", listOf("/")) { done() } }.onFailure { done() }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -106,7 +106,7 @@ private fun PanelContent(
|
||||
onChange(settings.copy(frameGen = it))
|
||||
}
|
||||
Text("Native engine (experimental): Google's WebRTC and DroidDeck's own compositor, so DroidDeck frame generation " +
|
||||
"(DDFG) or LSFG can add frames. LSFG uses the Lossless.dll DroidDeck already uses for games. Screen effects " +
|
||||
"(DDFG) or LSFG can add frames. LSFG requires Lossless Scaling installed through Steam. Screen effects " +
|
||||
"apply to the web engine.", style = MaterialTheme.typography.bodySmall, color = MaterialTheme.colorScheme.onSurfaceVariant,
|
||||
modifier = Modifier.padding(start = 8.dp, bottom = 6.dp))
|
||||
}
|
||||
|
||||
@@ -623,11 +623,11 @@ class XboxNativePlayerActivity : ComponentActivity() {
|
||||
XboxMenuEntry((if (current.frameGen == mode) "✓ " else "") + fgName(mode), when (mode) {
|
||||
XboxNativeVideo.FG_DDFG -> "DroidDeck's own frame generation (DDFG); doubles the shown frame rate"
|
||||
XboxNativeVideo.FG_LSFG, XboxNativeVideo.FG_LSFG3, XboxNativeVideo.FG_LSFG4 ->
|
||||
"Lossless Scaling frame generation (the Lossless.dll DroidDeck uses for games); the frame-rate target caps the output"
|
||||
"Lossless Scaling frame generation from the Steam installation; the frame-rate target caps the output"
|
||||
else -> "Show the stream's own frames only"
|
||||
}, choices[i]) { current = current.copy(frameGen = mode); setFrameGen(mode) }
|
||||
}
|
||||
if (!lsfg) androidx.compose.material3.Text("LSFG appears here once DroidDeck has the Lossless.dll (frame generation settings).",
|
||||
if (!lsfg) androidx.compose.material3.Text("LSFG appears here once Lossless Scaling is installed through Steam.",
|
||||
style = androidx.compose.material3.MaterialTheme.typography.bodySmall, color = cs.onSurfaceVariant,
|
||||
modifier = androidx.compose.ui.Modifier.padding(horizontal = 16.dp, vertical = 8.dp))
|
||||
if (current.zeroCopy) androidx.compose.material3.Text(
|
||||
|
||||
@@ -78,7 +78,7 @@ internal fun AgentEntry(
|
||||
is Entry.Said -> {
|
||||
val reply = remember(entry.text) { choices(entry.text) }
|
||||
Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
if (reply.text.isNotBlank()) SelectionContainer { AgentMarkdown(reply.text, Modifier.widthIn(max = 760.dp).padding(horizontal = 4.dp)) }
|
||||
if (reply.text.isNotBlank()) SelectionContainer { AgentReply(reply.text, Modifier.widthIn(max = 760.dp).padding(horizontal = 4.dp)) }
|
||||
if (reply.options.isNotEmpty()) AgentChoices(reply.options, answerable, onSent)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,6 +37,106 @@ import org.commonmark.ext.gfm.tables.TableRow
|
||||
import org.commonmark.node.AbstractVisitor
|
||||
import org.commonmark.node.CustomNode
|
||||
import org.commonmark.node.Node
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.layout.Arrangement
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.widthIn
|
||||
import androidx.compose.material3.Text
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.ui.draw.clip
|
||||
import androidx.compose.ui.layout.ContentScale
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import coil.compose.AsyncImage
|
||||
import com.droiddeck.launcher.runtime.LinuxRuntime
|
||||
import java.io.File
|
||||
|
||||
/** Part of an agent's reply: Markdown text, or an image the agent named on a line of its own. */
|
||||
internal sealed interface ReplyPart {
|
||||
data class Prose(val text: String) : ReplyPart
|
||||
data class Picture(val alt: String, val path: String) : ReplyPart
|
||||
}
|
||||
|
||||
private val PICTURE_LINE = Regex("""^\s*!\[([^\]]*)]\(\s*(?:<(?:file://)?(/[^>]*)>|(?:file://)?(/[^)<>]*?))\s*\)\s*$""")
|
||||
private val FENCE = Regex("""^ {0,3}(`{3,}|~{3,})(.*)$""")
|
||||
|
||||
/** Splits [text] at lines that hold only an image of a local absolute path, outside code fences. */
|
||||
internal fun replyParts(text: String): List<ReplyPart> {
|
||||
val parts = mutableListOf<ReplyPart>()
|
||||
val prose = StringBuilder()
|
||||
fun flush() {
|
||||
if (prose.isNotBlank()) parts += ReplyPart.Prose(prose.toString().trimEnd('\n'))
|
||||
prose.clear()
|
||||
}
|
||||
var fence: String? = null
|
||||
for (line in text.lines()) {
|
||||
val marker = FENCE.matchEntire(line)
|
||||
val picture = if (fence == null) PICTURE_LINE.matchEntire(line) else null
|
||||
val open = fence
|
||||
when {
|
||||
picture != null -> {
|
||||
flush()
|
||||
val path = picture.groupValues[2].ifEmpty { picture.groupValues[3] }
|
||||
parts += ReplyPart.Picture(picture.groupValues[1].trim(), path.trim())
|
||||
continue
|
||||
}
|
||||
marker == null -> Unit
|
||||
open == null -> fence = marker.groupValues[1]
|
||||
marker.groupValues[1].let { it[0] == open[0] && it.length >= open.length } && marker.groupValues[2].isBlank() -> fence = null
|
||||
}
|
||||
prose.append(line).append('\n')
|
||||
}
|
||||
flush()
|
||||
return parts
|
||||
}
|
||||
|
||||
/**
|
||||
* Where the app reads a file the agent named by its guest path: the app's own folders and shared
|
||||
* storage are bound at the same paths in the guest, everything else lives in the rootfs.
|
||||
*/
|
||||
internal fun agentHostFile(context: Context, guestPath: String): File {
|
||||
val app = context.applicationContext
|
||||
val same = listOfNotNull(app.filesDir.path, app.cacheDir.path, LinuxRuntime.sharedStorage(app)?.path)
|
||||
return if (same.any { guestPath == it || guestPath.startsWith("$it/") }) File(guestPath)
|
||||
else File(LinuxRuntime.rootDir(app), guestPath.removePrefix("/"))
|
||||
}
|
||||
|
||||
/** An agent's reply, with the images it names shown in place. */
|
||||
@Composable
|
||||
internal fun AgentReply(text: String, modifier: Modifier) {
|
||||
val parts = remember(text) { replyParts(text) }
|
||||
if (parts.size == 1 && parts[0] is ReplyPart.Prose) {
|
||||
AgentMarkdown(text, modifier)
|
||||
return
|
||||
}
|
||||
Column(modifier, verticalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
parts.forEach { part ->
|
||||
when (part) {
|
||||
is ReplyPart.Prose -> AgentMarkdown(part.text, Modifier)
|
||||
is ReplyPart.Picture -> AgentPicture(part)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun AgentPicture(picture: ReplyPart.Picture) {
|
||||
val context = LocalContext.current
|
||||
val file = remember(picture.path) { agentHostFile(context, picture.path) }
|
||||
var full by remember(picture.path) { mutableStateOf(false) }
|
||||
if (!file.isFile) {
|
||||
Text(stringResource(R.string.agent_image_missing, picture.alt.ifBlank { picture.path }), color = MaterialTheme.colorScheme.onSurfaceVariant)
|
||||
return
|
||||
}
|
||||
AsyncImage(
|
||||
model = file, contentDescription = picture.alt.ifBlank { file.name }, contentScale = ContentScale.Fit,
|
||||
modifier = Modifier.widthIn(max = 560.dp).then(if (full) Modifier else Modifier.heightIn(max = 420.dp))
|
||||
.clip(Shape12).clickable { full = !full },
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun AgentMarkdown(text: String, modifier: Modifier) {
|
||||
|
||||
@@ -532,7 +532,7 @@ private fun AgentLive() {
|
||||
val pal = LocalPalette.current
|
||||
Column(verticalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
if (AgentHost.liveThinking.isNotBlank()) AgentThought(AgentHost.liveThinking, live = true)
|
||||
if (AgentHost.live.isNotBlank()) AgentMarkdown(AgentHost.live, Modifier.widthIn(max = 760.dp).padding(horizontal = 4.dp))
|
||||
if (AgentHost.live.isNotBlank()) AgentReply(AgentHost.live, Modifier.widthIn(max = 760.dp).padding(horizontal = 4.dp))
|
||||
val running = AgentHost.running()
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp), modifier = Modifier.padding(4.dp)) {
|
||||
CircularProgressIndicator(Modifier.size(14.dp), strokeWidth = 2.dp, color = pal.primary)
|
||||
|
||||
@@ -338,6 +338,24 @@ internal fun sessionBarModel(
|
||||
internal fun deckPanelTabs(context: Context, selected: DeckPanel, onSelect: (DeckPanel) -> Unit) =
|
||||
BarTabs(DeckPanel.entries.map { context.getString(it.label) }, selected.ordinal) { onSelect(DeckPanel.entries[it]) }
|
||||
|
||||
internal fun padKeysView(
|
||||
context: Context, steam: Boolean, onMenu: () -> Unit, onSteam: () -> Unit, onQam: () -> Unit,
|
||||
): ComposeView = ComposeView(context).apply {
|
||||
setContent { DroidDeckTheme { PadKeys(steam, onMenu, onSteam, onQam) } }
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun PadKeys(steam: Boolean, onMenu: () -> Unit, onSteam: () -> Unit, onQam: () -> Unit) {
|
||||
Row(
|
||||
Modifier.fillMaxWidth().padding(horizontal = 16.dp, vertical = 8.dp),
|
||||
horizontalArrangement = if (steam) Arrangement.SpaceBetween else Arrangement.Center,
|
||||
) {
|
||||
if (steam) BarActions(null, false, onSteam, null)
|
||||
BarActions(onMenu, false, null, null)
|
||||
if (steam) BarActions(null, false, null, onQam)
|
||||
}
|
||||
}
|
||||
|
||||
internal fun bottomScreenBarView(context: Context, model: () -> BottomBarModel): ComposeView = ComposeView(context).apply {
|
||||
setContent { DroidDeckTheme { BottomScreenBar(model()) } }
|
||||
}
|
||||
@@ -199,7 +199,6 @@ internal fun SessionDrawerPreview(secondScreens: List<SecondScreenDisplay>) {
|
||||
secondScreenDisplays = secondScreens,
|
||||
selectedSecondScreenDisplay = secondScreens.firstOrNull()?.id ?: -1,
|
||||
onSecondScreenDisplay = {},
|
||||
onImportLossless = {},
|
||||
onKeyboard = {}, onHardwareKeyboard = {},
|
||||
onSteamMenu = if (steam) ({}) else null,
|
||||
onQam = if (steam) ({}) else null,
|
||||
|
||||
@@ -24,18 +24,13 @@ internal fun FrameGenMenu(
|
||||
mode: FrameGen.Mode,
|
||||
lossless: Lossless.State,
|
||||
onPick: (FrameGen.Mode) -> Unit,
|
||||
onImportLossless: () -> Unit,
|
||||
gameProfileId: String? = null,
|
||||
hasGameOverride: Boolean = false,
|
||||
onResetGame: () -> Unit = {},
|
||||
focusModifier: Modifier = Modifier,
|
||||
legacyButtons: Boolean = false,
|
||||
) {
|
||||
val need = when {
|
||||
lossless.ready -> null
|
||||
lossless.owned -> stringResource(R.string.lsfg_needs_install)
|
||||
else -> stringResource(R.string.lsfg_needs_steam)
|
||||
}
|
||||
val need = stringResource(R.string.lsfg_needs_steam)
|
||||
val selectedEngine = mode.engine.takeIf { it != FrameGen.ENGINE_OFF }
|
||||
val offLabel = FrameGen.label(LocalContext.current, FrameGen.Mode.OFF)
|
||||
val colors = MaterialTheme.colorScheme
|
||||
@@ -70,7 +65,7 @@ internal fun FrameGenMenu(
|
||||
}
|
||||
if (selectedEngine == FrameGen.ENGINE_LSFG && !lossless.ready) {
|
||||
Text(
|
||||
need.orEmpty(),
|
||||
need,
|
||||
color = colors.onSurfaceVariant,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
modifier = Modifier.padding(top = 6.dp),
|
||||
@@ -87,21 +82,6 @@ internal fun FrameGenMenu(
|
||||
Text(stringResource(R.string.comp_game_use_general) + if (hasGameOverride) "" else " ✓")
|
||||
}
|
||||
}
|
||||
if (lossless.owned) {
|
||||
val using = when (lossless.source) {
|
||||
Lossless.Source.STEAM -> stringResource(R.string.lsfg_using_steam)
|
||||
Lossless.Source.IMPORT -> stringResource(R.string.lsfg_using_import)
|
||||
Lossless.Source.NONE -> null
|
||||
}
|
||||
OutlinedButton(
|
||||
onClick = onImportLossless,
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 6.dp)
|
||||
.controllerConfirm(onClick = onImportLossless),
|
||||
contentPadding = PaddingValues(horizontal = 12.dp, vertical = 8.dp),
|
||||
) {
|
||||
Text(stringResource(R.string.lsfg_import) + (using?.let { " · $it" } ?: ""))
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
@@ -200,7 +180,7 @@ internal fun FrameGenMenu(
|
||||
}
|
||||
|
||||
if (selectedEngine == FrameGen.ENGINE_LSFG && !lossless.ready) {
|
||||
Text(need.orEmpty(), color = colors.onSurfaceVariant,
|
||||
Text(need, color = colors.onSurfaceVariant,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
modifier = Modifier.padding(top = 6.dp))
|
||||
}
|
||||
@@ -217,20 +197,5 @@ internal fun FrameGenMenu(
|
||||
}
|
||||
}
|
||||
|
||||
if (lossless.owned) {
|
||||
val using = when (lossless.source) {
|
||||
Lossless.Source.STEAM -> stringResource(R.string.lsfg_using_steam)
|
||||
Lossless.Source.IMPORT -> stringResource(R.string.lsfg_using_import)
|
||||
Lossless.Source.NONE -> null
|
||||
}
|
||||
OutlinedButton(
|
||||
onClick = onImportLossless,
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 8.dp)
|
||||
.controllerConfirm(onClick = onImportLossless),
|
||||
contentPadding = PaddingValues(horizontal = 12.dp, vertical = 8.dp),
|
||||
) {
|
||||
Text(stringResource(R.string.lsfg_import) + (using?.let { " · $it" } ?: ""))
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -246,7 +246,6 @@ class FrontEndActions(
|
||||
val onVkBridgeSafe: (Boolean) -> Unit = {},
|
||||
val onBridgeProtonDxvk: (Boolean) -> Unit = {},
|
||||
val onFrameGenPick: (FrameGen.Mode) -> Unit,
|
||||
val onImportLossless: () -> Unit,
|
||||
val onProtons: () -> Unit,
|
||||
val onComponents: (focusContent: Boolean) -> Unit,
|
||||
val onGameComponents: (Library.SteamGame) -> Unit = { onComponents(true) },
|
||||
|
||||
@@ -860,7 +860,7 @@ internal fun ReadinessCard(
|
||||
|
||||
@Composable
|
||||
private fun FrameGenMenu(s: FrontEndState, a: FrontEndActions, host: MenuHost) {
|
||||
FrameGenMenu(s.frameGen, s.lossless, a.onFrameGenPick, a.onImportLossless, legacyButtons = true)
|
||||
FrameGenMenu(s.frameGen, s.lossless, a.onFrameGenPick, legacyButtons = true)
|
||||
}
|
||||
|
||||
@Composable
|
||||
@@ -901,7 +901,6 @@ internal fun LaunchSettings(s: FrontEndState, a: FrontEndActions, host: MenuHost
|
||||
gameFrameGenOverride = true
|
||||
}
|
||||
},
|
||||
onImportLossless = a.onImportLossless,
|
||||
legacyButtons = true,
|
||||
gameProfileId = frameGenProfileKey,
|
||||
hasGameOverride = gameFrameGenOverride,
|
||||
|
||||
@@ -62,6 +62,7 @@ class ModeSettings(
|
||||
val hdrReason: String?,
|
||||
val hdrDisplay: Boolean = true,
|
||||
val zeroCopy: Boolean = true,
|
||||
val producerAcquireFences: Boolean? = null,
|
||||
val gpuDrivers: String? = null,
|
||||
val upscaler: Int = 0,
|
||||
val upscaleSharpness: Int = 75,
|
||||
@@ -125,6 +126,7 @@ class ModeSettingsActions(
|
||||
val onResolutionPortrait: (String) -> Unit = {},
|
||||
val onHdr: (Boolean) -> Unit,
|
||||
val onZeroCopy: (Boolean) -> Unit = {},
|
||||
val onProducerAcquireFences: (Boolean) -> Unit = {},
|
||||
val onGpuDrivers: () -> Unit = {},
|
||||
val onUpscaler: (Int) -> Unit = {},
|
||||
val onUpscaleSharpness: (Int) -> Unit = {},
|
||||
@@ -284,6 +286,11 @@ fun ModeSheetRows(s: ModeSettings, a: ModeSettingsActions, tab: String, extras:
|
||||
stringResource(R.string.display_avoid_notch_hint), checked = enabled, onChange = a.onAvoidNotch)
|
||||
}
|
||||
ToggleRow(host, "zero-copy", stringResource(R.string.display_zero_copy), null, checked = s.zeroCopy, onChange = a.onZeroCopy)
|
||||
s.producerAcquireFences?.let { enabled ->
|
||||
ToggleRow(host, "producer-acquire-fences", stringResource(R.string.producer_acquire_fences),
|
||||
stringResource(R.string.producer_acquire_fences_summary), checked = enabled,
|
||||
onChange = a.onProducerAcquireFences)
|
||||
}
|
||||
}
|
||||
SettingsGroup(stringResource(R.string.display_image_scaling)) {
|
||||
s.integerScaling?.let { enabled ->
|
||||
|
||||
@@ -22,7 +22,12 @@ internal enum class SessionDrawerPage(val firstControl: String) {
|
||||
}
|
||||
|
||||
internal object DrawerPages {
|
||||
var order by mutableStateOf(SessionDrawerPage.entries.toList())
|
||||
private val defaultOrder = SessionDrawerPage.entries.toMutableList().apply {
|
||||
remove(SessionDrawerPage.VR)
|
||||
add(indexOf(SessionDrawerPage.MORE) + 1, SessionDrawerPage.VR)
|
||||
}.toList()
|
||||
|
||||
var order by mutableStateOf(defaultOrder)
|
||||
private set
|
||||
var hidden by mutableStateOf(emptySet<SessionDrawerPage>())
|
||||
private set
|
||||
@@ -39,6 +44,7 @@ internal object DrawerPages {
|
||||
}
|
||||
|
||||
fun arrange(saved: List<String>): List<SessionDrawerPage> {
|
||||
if (saved.isEmpty()) return defaultOrder
|
||||
val all = SessionDrawerPage.entries
|
||||
val out = saved.mapNotNull { name -> all.firstOrNull { it.name == name } }.distinct().toMutableList()
|
||||
for (page in all.filterNot { it in out }) {
|
||||
@@ -62,14 +68,14 @@ internal object DrawerPages {
|
||||
}
|
||||
|
||||
fun reset(context: Context) {
|
||||
order = SessionDrawerPage.entries.toList()
|
||||
order = defaultOrder
|
||||
hidden = emptySet()
|
||||
if (DevPreview.drawer != null) return
|
||||
SessionPrefs.setDrawerPageOrder(context, order.map { it.name })
|
||||
SessionPrefs.setDrawerPageHidden(context, emptySet())
|
||||
}
|
||||
|
||||
fun isDefault() = order == SessionDrawerPage.entries.toList() && hidden.isEmpty()
|
||||
fun isDefault() = order == defaultOrder && hidden.isEmpty()
|
||||
}
|
||||
|
||||
internal fun offeredDrawerPages(
|
||||
|
||||
@@ -316,7 +316,6 @@ class DrawerActions(
|
||||
val hdr: Boolean = false,
|
||||
val hdrAvailable: Boolean = false,
|
||||
val onHdr: (Boolean) -> Unit = {},
|
||||
val onImportLossless: () -> Unit,
|
||||
val onKeyboard: () -> Unit,
|
||||
val onHardwareKeyboard: () -> Unit,
|
||||
val wowChatShown: Boolean = false,
|
||||
@@ -391,6 +390,8 @@ class DrawerActions(
|
||||
val quickButtons: Map<com.droiddeck.launcher.input.InputCommand, Boolean> = emptyMap(),
|
||||
val onQuickButton: (com.droiddeck.launcher.input.InputCommand, Boolean) -> Unit = { _, _ -> },
|
||||
val onUnfoldedControls: (Boolean) -> Unit = {},
|
||||
val deckPanel: com.droiddeck.launcher.input.DeckPanel? = null,
|
||||
val onDeckPanel: (com.droiddeck.launcher.input.DeckPanel) -> Unit = {},
|
||||
val unfoldedControlsWithController: Boolean = false,
|
||||
val onUnfoldedControlsWithController: (Boolean) -> Unit = {},
|
||||
val onShareLogs: () -> Unit,
|
||||
@@ -769,6 +770,11 @@ private fun DrawerControllerPage(host: MenuHost, a: DrawerActions, padConnected:
|
||||
if (a.steam && a.unfoldedControls != null) ToggleRow(host, "unfolded-controls", stringResource(R.string.unfolded_controls),
|
||||
stringResource(R.string.unfolded_controls_hint), a.unfoldedControls,
|
||||
chipModifier = track("unfolded-controls"), onChange = a.onUnfoldedControls)
|
||||
a.deckPanel?.let { panel ->
|
||||
ChoiceRow(host, "deck-panel", stringResource(R.string.ctrl_layout), null,
|
||||
com.droiddeck.launcher.input.DeckPanel.entries.map { it to stringResource(it.label) }, panel,
|
||||
chipModifier = track("deck-panel"), onPick = a.onDeckPanel)
|
||||
}
|
||||
if (a.steam && a.unfoldedControls == true) ToggleRow(host, "unfolded-controls-with-controller",
|
||||
stringResource(R.string.unfolded_controls_with_controller),
|
||||
stringResource(R.string.unfolded_controls_with_controller_hint), a.unfoldedControlsWithController,
|
||||
@@ -906,7 +912,7 @@ private fun DrawerFrameGenPage(host: MenuHost, a: DrawerActions, track: (String)
|
||||
SettingsGroup(stringResource(R.string.frame_gen_title), compact = true, key = "frame-generation", detail = summary(fgLabel, scope)) {
|
||||
SettingsRow(stringResource(R.string.frame_gen_title), scope, stacked = true, tightControlSpacing = true) {
|
||||
FrameGenMenu(
|
||||
a.frameGen, a.lossless, a.onFrameGenPick, a.onImportLossless,
|
||||
a.frameGen, a.lossless, a.onFrameGenPick,
|
||||
gameProfileId = a.frameGenTargetGameId,
|
||||
hasGameOverride = a.hasGameOverride,
|
||||
onResetGame = a.onFrameGenReset,
|
||||
|
||||
@@ -31,10 +31,6 @@ internal fun FrameGenGroup(s: FrontEndState, a: FrontEndActions) {
|
||||
a.onFrameGenPick(mode)
|
||||
host.open = null
|
||||
},
|
||||
onImportLossless = {
|
||||
a.onImportLossless()
|
||||
host.open = null
|
||||
},
|
||||
focusModifier = Modifier.focusRequester(firstItemFocus),
|
||||
legacyButtons = true,
|
||||
)
|
||||
|
||||
@@ -82,17 +82,25 @@ import kotlinx.coroutines.withContext
|
||||
private const val WALL_MIN_GAMES = 4
|
||||
private const val WALL_DISTINCT = 40
|
||||
|
||||
private const val IDLE_FRAME_NS = 30_000_000L
|
||||
internal val IdleFrames = IdleFrameGate()
|
||||
|
||||
internal object IdleFrames {
|
||||
private var shown = 0L
|
||||
internal class IdleFrameGate {
|
||||
private var next = Long.MIN_VALUE
|
||||
private var shown = Long.MIN_VALUE
|
||||
|
||||
fun due(nanos: Long): Boolean {
|
||||
if (nanos == shown) return true
|
||||
if (nanos - shown < IDLE_FRAME_NS) return false
|
||||
// Allow sub-ms vsync jitter; carry the phase on panels whose refresh isn't a multiple of 60.
|
||||
if (nanos + VSYNC_TOLERANCE_NS < next) return false
|
||||
next = if (next == Long.MIN_VALUE || nanos - next >= FRAME_NS) nanos + FRAME_NS else next + FRAME_NS
|
||||
shown = nanos
|
||||
return true
|
||||
}
|
||||
|
||||
private companion object {
|
||||
const val FRAME_NS = 1_000_000_000L / 60
|
||||
const val VSYNC_TOLERANCE_NS = 500_000L
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
|
||||
@@ -9,7 +9,6 @@ import androidx.compose.animation.fadeIn
|
||||
import androidx.compose.animation.fadeOut
|
||||
import androidx.compose.animation.shrinkVertically
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.basicMarquee
|
||||
import androidx.compose.foundation.border
|
||||
import androidx.compose.foundation.clickable
|
||||
import androidx.compose.foundation.hoverable
|
||||
@@ -25,6 +24,9 @@ import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.fillMaxWidth
|
||||
import androidx.compose.foundation.layout.height
|
||||
import androidx.compose.foundation.layout.heightIn
|
||||
import androidx.compose.foundation.layout.RowScope
|
||||
import androidx.compose.foundation.selection.selectable
|
||||
import androidx.compose.foundation.selection.selectableGroup
|
||||
import androidx.compose.foundation.layout.offset
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
@@ -44,6 +46,7 @@ import androidx.compose.material.icons.outlined.Science
|
||||
import androidx.compose.material.icons.outlined.SwapHoriz
|
||||
import androidx.compose.material.icons.outlined.Sync
|
||||
import androidx.compose.material.icons.outlined.Verified
|
||||
import androidx.compose.material.icons.outlined.WarningAmber
|
||||
import androidx.compose.material3.Icon
|
||||
import androidx.compose.ui.draw.alpha
|
||||
import androidx.compose.ui.graphics.vector.ImageVector
|
||||
@@ -109,50 +112,37 @@ internal fun UpdatesPage(s: FrontEndState, a: FrontEndActions, modifier: Modifie
|
||||
val me = remember { AppUpdates.installed() }
|
||||
val colors = MaterialTheme.colorScheme
|
||||
Column(modifier = modifier) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(12.dp),
|
||||
modifier = Modifier.fillMaxWidth().padding(bottom = 10.dp),
|
||||
) {
|
||||
Text(
|
||||
stringResource(R.string.upd_build, me.version, s.buildLabel), fontSize = 12.5.sp, color = colors.onSurfaceVariant,
|
||||
maxLines = 1, modifier = Modifier.weight(1f)
|
||||
.basicMarquee(iterations = Int.MAX_VALUE, initialDelayMillis = 700, velocity = 40.dp),
|
||||
)
|
||||
val checked = u.catalog?.checkedAt?.takeIf { it > 0 }
|
||||
if (!LocalNarrowPane.current) Text(
|
||||
if (u.checking) stringResource(R.string.common_checking) else if (checked != null) stringResource(R.string.upd_checked, ago(checked).replaceFirstChar { it.lowercase() }) else stringResource(R.string.upd_not_checked),
|
||||
fontSize = 13.sp, color = colors.onSurfaceVariant,
|
||||
)
|
||||
val clipboard = LocalClipboardManager.current
|
||||
val context = LocalContext.current
|
||||
val details = buildDetails(me, s.buildLabel)
|
||||
ToolIcon(Icons.Outlined.ContentCopy, stringResource(R.string.upd_copy_build)) {
|
||||
clipboard.setText(AnnotatedString(details))
|
||||
android.widget.Toast.makeText(context, context.getString(R.string.upd_copied), android.widget.Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
ToolIcon(Icons.Outlined.Refresh, stringResource(R.string.store_check_updates), busy = u.checking, enabled = !u.checking && u.stage == null, onClick = ua.onCheck)
|
||||
}
|
||||
BoxWithConstraints(Modifier.weight(1f).fillMaxWidth()) {
|
||||
val stacked = LocalNarrowPane.current || maxWidth < 600.dp
|
||||
Column(modifier = Modifier.fillMaxSize().verticalScroll(rememberScrollState()).padding(bottom = 16.dp)) {
|
||||
SectionLabel(stringResource(R.string.upd_installed_label))
|
||||
InstalledCard(s, u, me)
|
||||
CheckRow(u, ua)
|
||||
SectionLabel(stringResource(R.string.upd_channel))
|
||||
if (stacked) {
|
||||
ChannelPicker(u, ua)
|
||||
Box(Modifier.height(14.dp))
|
||||
StatusPanel(s, u, ua, me)
|
||||
Box(Modifier.height(18.dp))
|
||||
ChannelLabel()
|
||||
ChannelPicker(u, ua, s.sessionRunning)
|
||||
} else {
|
||||
ChannelLabel()
|
||||
Row(horizontalArrangement = Arrangement.spacedBy(18.dp)) {
|
||||
Box(Modifier.weight(1f)) { ChannelPicker(u, ua, s.sessionRunning) }
|
||||
Box(Modifier.weight(1f)) { ChannelPicker(u, ua) }
|
||||
Box(Modifier.weight(1.15f)) { StatusPanel(s, u, ua, me) }
|
||||
}
|
||||
}
|
||||
Box(Modifier.padding(top = 18.dp)) {
|
||||
ToggleRow(
|
||||
host, "build-watermark", stringResource(R.string.setup_build_watermark),
|
||||
stringResource(R.string.setup_build_watermark_hint), s.buildWatermark,
|
||||
) { a.onBuildWatermark() }
|
||||
}
|
||||
SectionLabel(stringResource(R.string.upd_testers), top = 22.dp)
|
||||
ToggleRow(
|
||||
host, "build-watermark", stringResource(R.string.setup_build_watermark),
|
||||
stringResource(R.string.setup_build_watermark_hint), s.buildWatermark,
|
||||
) { a.onBuildWatermark() }
|
||||
val context = LocalContext.current
|
||||
val agentReady = com.droiddeck.launcher.agent.AgentHost.installed &&
|
||||
(com.droiddeck.launcher.agent.AgentSetup.ready || com.droiddeck.launcher.agent.AgentSetup.completed(context))
|
||||
LabBuilds(s.sessionRunning, onRebuild = if (agentReady) { info ->
|
||||
com.droiddeck.launcher.agent.AgentHost.send(context, context.getString(R.string.agent_rebuild_lab, info.label))
|
||||
context.startActivity(android.content.Intent(context, com.droiddeck.launcher.FrontEndActivity::class.java)
|
||||
.putExtra(com.droiddeck.launcher.stores.download.StoreDownloadService.EXTRA_NAV, "agent")
|
||||
.addFlags(android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP or android.content.Intent.FLAG_ACTIVITY_REORDER_TO_FRONT))
|
||||
} else null)
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -169,6 +159,112 @@ internal fun UpdatesPage(s: FrontEndState, a: FrontEndActions, modifier: Modifie
|
||||
)
|
||||
}
|
||||
|
||||
private val TEST_TINT = Color(0xFF9B6CFF)
|
||||
|
||||
@Composable
|
||||
private fun SectionLabel(text: String, top: androidx.compose.ui.unit.Dp = 4.dp) {
|
||||
Text(
|
||||
text, fontSize = 12.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 1.5.sp,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(start = 2.dp, top = top, bottom = 10.dp),
|
||||
)
|
||||
}
|
||||
|
||||
/** What is installed: which kind of build, its version and versionCode, and its commit, as the first thing on the page. */
|
||||
@Composable
|
||||
private fun InstalledCard(s: FrontEndState, u: UpdatesState, me: AppUpdates.Installed) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val catalog = u.catalog
|
||||
val lab = com.droiddeck.launcher.lab.LabOverlay.active
|
||||
val basePr = if (me.pr > 0) me.pr else Regex("""\bpr(\d+)\b""").find(s.buildLabel)?.groupValues?.get(1)?.toIntOrNull() ?: 0
|
||||
val kind = when {
|
||||
lab != null -> stringResource(R.string.upd_kind_lab)
|
||||
me.pr > 0 -> stringResource(R.string.upd_kind_test)
|
||||
catalog?.stable?.let { AppUpdates.isRunning(it, me) } == true -> stringResource(R.string.upd_stable)
|
||||
catalog?.preview?.let { AppUpdates.isRunning(it, me) } == true -> stringResource(R.string.upd_preview)
|
||||
else -> null
|
||||
}
|
||||
val tint = if (lab != null || me.pr > 0) TEST_TINT else pal.signal
|
||||
val title = when {
|
||||
lab != null -> lab.label
|
||||
me.pr > 0 -> stringResource(R.string.upd_pr, me.pr)
|
||||
else -> stringResource(R.string.upd_droiddeck_version, me.version)
|
||||
}
|
||||
val subtitle = when {
|
||||
lab != null && basePr > 0 -> stringResource(R.string.upd_lab_on_pr, basePr)
|
||||
lab != null -> stringResource(R.string.upd_lab_on_version, me.version)
|
||||
me.pr > 0 -> catalog?.tests?.firstOrNull { it.pr == me.pr }?.title?.takeIf { it.isNotBlank() }?.let(::changeTitle)
|
||||
else -> null
|
||||
}
|
||||
val built = lab?.built?.takeIf { it > 0 } ?: me.committedAt
|
||||
val meta = listOfNotNull(
|
||||
me.version.takeIf { lab != null || me.pr > 0 },
|
||||
stringResource(R.string.upd_version_code, me.versionCode),
|
||||
me.commit.take(7).takeIf { it.length == 7 },
|
||||
built.takeIf { it > 0 }?.let { stringResource(R.string.upd_built_ago, ago(it).replaceFirstChar { c -> c.lowercase() }) },
|
||||
).joinToString(" · ")
|
||||
val clipboard = LocalClipboardManager.current
|
||||
val context = LocalContext.current
|
||||
val details = buildDetails(me, s.buildLabel)
|
||||
Row(
|
||||
verticalAlignment = Alignment.Top, horizontalArrangement = Arrangement.spacedBy(12.dp),
|
||||
modifier = Modifier.fillMaxWidth().clip(Shape16).background(colors.surface).border(1.dp, pal.line, Shape16).padding(start = 18.dp, end = 12.dp, top = 14.dp, bottom = 16.dp),
|
||||
) {
|
||||
Column(Modifier.weight(1f).padding(top = 2.dp)) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp)) {
|
||||
if (kind != null) Text(
|
||||
kind.uppercase(), fontSize = 10.5.sp, fontWeight = FontWeight.Bold, letterSpacing = 0.6.sp, color = tint, maxLines = 1,
|
||||
modifier = Modifier.clip(CircleShape).background(tint.copy(alpha = 0.16f)).padding(horizontal = 8.dp, vertical = 3.dp),
|
||||
)
|
||||
Text(title, fontSize = 20.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||
}
|
||||
if (subtitle != null) Text(subtitle, fontSize = 14.sp, fontWeight = FontWeight.Medium, color = colors.onBackground, maxLines = 2,
|
||||
overflow = TextOverflow.Ellipsis, modifier = Modifier.padding(top = 6.dp))
|
||||
Text(meta, fontSize = 12.5.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(top = 4.dp))
|
||||
}
|
||||
ToolIcon(Icons.Outlined.ContentCopy, stringResource(R.string.upd_copy_build)) {
|
||||
clipboard.setText(AnnotatedString(details))
|
||||
android.widget.Toast.makeText(context, context.getString(R.string.upd_copied), android.widget.Toast.LENGTH_SHORT).show()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun CheckRow(u: UpdatesState, ua: UpdatesActions) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val src = remember { MutableInteractionSource() }
|
||||
val hot = rememberHot(src)
|
||||
val enabled = !u.checking && u.stage == null
|
||||
val checked = u.catalog?.checkedAt?.takeIf { it > 0 }
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 6.dp, bottom = 14.dp),
|
||||
) {
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp),
|
||||
modifier = Modifier.offset(x = (-6).dp).paneItem("updates:check").heightIn(min = 40.dp).clip(Shape12)
|
||||
.background(if (hot) pal.signal.copy(alpha = 0.14f) else Color.Transparent)
|
||||
.glideBorder(hot, Shape12, pal.signal)
|
||||
.hoverable(src).clickable(interactionSource = src, indication = null, enabled = enabled, role = Role.Button, onClick = ua.onCheck)
|
||||
.controllerConfirm(enabled = enabled, onClick = ua.onCheck)
|
||||
.padding(horizontal = 6.dp),
|
||||
) {
|
||||
if (u.checking) androidx.compose.material3.CircularProgressIndicator(Modifier.size(16.dp), color = pal.signal, strokeWidth = 2.dp)
|
||||
else Icon(Icons.Outlined.Refresh, contentDescription = null, tint = pal.signal.copy(alpha = if (enabled) 1f else 0.5f), modifier = Modifier.size(18.dp))
|
||||
Text(
|
||||
if (u.checking) stringResource(R.string.common_checking) else stringResource(R.string.upd_check_now),
|
||||
fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = pal.signal.copy(alpha = if (enabled || u.checking) 1f else 0.5f),
|
||||
)
|
||||
}
|
||||
Box(Modifier.weight(1f))
|
||||
Text(
|
||||
if (checked != null) stringResource(R.string.upd_checked, ago(checked).replaceFirstChar { it.lowercase() }) else stringResource(R.string.upd_not_checked),
|
||||
fontSize = 12.5.sp, color = colors.onSurfaceVariant, maxLines = 1,
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun StatusPanel(s: FrontEndState, u: UpdatesState, ua: UpdatesActions, me: AppUpdates.Installed) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
@@ -201,12 +297,18 @@ private fun StatusPanel(s: FrontEndState, u: UpdatesState, ua: UpdatesActions, m
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(7.dp)) {
|
||||
Box(Modifier.size(7.dp).clip(CircleShape).background(look.tint))
|
||||
Text(look.status, fontSize = 13.sp, fontWeight = FontWeight.SemiBold, color = look.tint)
|
||||
if (offered) Text(stringResource(R.string.upd_dot_ago, ago(release!!.publishedAt)), fontSize = 13.sp, color = colors.onSurfaceVariant)
|
||||
}
|
||||
Text(look.headline, fontSize = 22.sp, fontWeight = FontWeight.Bold, color = colors.onBackground, modifier = Modifier.padding(top = 4.dp))
|
||||
if (offered) {
|
||||
ReleaseNotes(changeTitle(release!!.title.ifBlank { release.tag }), release.summary, release.tag)
|
||||
ReleaseFacts(release)
|
||||
val size = release!!.apk?.size?.takeIf { it > 0 }?.let { megabytes(it) }
|
||||
Text(
|
||||
listOfNotNull(stringResource(R.string.upd_released_ago, ago(release.publishedAt)), size).joinToString(" · "),
|
||||
fontSize = 12.5.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(top = 2.dp),
|
||||
)
|
||||
val older = (release.committedAt.takeIf { it > 0 } ?: release.publishedAt).let { it > 0 && me.committedAt > 0 && it < me.committedAt }
|
||||
if (offer == Offer.SWITCH && older) OlderNote(me.committedAt)
|
||||
val title = changeTitle(release.title.ifBlank { release.tag })
|
||||
ReleaseNotes(title.takeUnless { it == look.headline || (release.version != null && it.endsWith(release.version)) }, release.summary, release.tag)
|
||||
}
|
||||
if (release != null && u.follow.channel == Channel.TEST && catalog != null) {
|
||||
androidx.compose.runtime.LaunchedEffect(release.tag, release.commit, release.apk?.sha256) { ua.onSeen(release) }
|
||||
@@ -228,8 +330,10 @@ private fun StatusPanel(s: FrontEndState, u: UpdatesState, ua: UpdatesActions, m
|
||||
else LinearProgressIndicator(modifier = Modifier.fillMaxWidth().height(6.dp).clip(CircleShape))
|
||||
}
|
||||
offered && installBlock != null -> Unit
|
||||
offer == Offer.UPDATE -> PrimaryButton(stringResource(R.string.upd_update_button, button), enabled = installable, main = true) { ua.onInstall(release!!) }
|
||||
offer == Offer.SWITCH -> PrimaryButton(stringResource(R.string.upd_install_button, button), enabled = installable, main = true) { ua.onInstall(release!!) }
|
||||
offer == Offer.UPDATE -> PrimaryButton(stringResource(R.string.upd_update_button, button), enabled = installable, main = true, fill = true,
|
||||
modifier = Modifier.fillMaxWidth()) { ua.onInstall(release!!) }
|
||||
offer == Offer.SWITCH -> PrimaryButton(stringResource(R.string.upd_switch_to_button, channelTitle(u.follow), button), enabled = installable, main = true,
|
||||
fill = true, modifier = Modifier.fillMaxWidth()) { ua.onInstall(release!!) }
|
||||
offer == Offer.AHEAD && u.follow.channel == Channel.STABLE && installBlock == null ->
|
||||
SecondaryButton(stringResource(R.string.upd_install_anyway, release?.version.orEmpty()), enabled = installable) { ua.onInstall(release!!) }
|
||||
offer == Offer.GONE -> PrimaryButton(stringResource(R.string.upd_follow_preview), main = true) { ua.onFollow(Follow(Channel.NIGHTLY)) }
|
||||
@@ -238,25 +342,53 @@ private fun StatusPanel(s: FrontEndState, u: UpdatesState, ua: UpdatesActions, m
|
||||
if (s.sessionRunning && (offered || offer == Offer.AHEAD)) {
|
||||
Text(stringResource(R.string.upd_stop_session), fontSize = 12.5.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(top = 8.dp))
|
||||
}
|
||||
if (offered) ReleaseFacts(release!!)
|
||||
if (u.follow.channel == Channel.NIGHTLY) {
|
||||
PreviewHistory(catalog, me, s, u, ua)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/** A switch that installs a build made before the installed one; Android keeps the app's data across it. */
|
||||
@Composable
|
||||
private fun ReleaseNotes(title: String, notes: String, key: String) {
|
||||
private fun OlderNote(installedAt: Long) {
|
||||
val context = LocalContext.current
|
||||
val date = android.text.format.DateUtils.formatDateTime(context, installedAt,
|
||||
android.text.format.DateUtils.FORMAT_SHOW_DATE or android.text.format.DateUtils.FORMAT_ABBREV_MONTH)
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(10.dp),
|
||||
modifier = Modifier.padding(top = 12.dp).fillMaxWidth().clip(Shape12).background(AttentionAmber.copy(alpha = 0.12f))
|
||||
.padding(horizontal = 12.dp, vertical = 10.dp),
|
||||
) {
|
||||
Icon(Icons.Outlined.WarningAmber, contentDescription = null, tint = AttentionAmber, modifier = Modifier.size(20.dp))
|
||||
Column {
|
||||
Text(stringResource(R.string.upd_older_than_installed, date), fontSize = 13.sp, fontWeight = FontWeight.SemiBold, color = AttentionAmber)
|
||||
Text(stringResource(R.string.upd_data_stays), fontSize = 12.5.sp, color = MaterialTheme.colorScheme.onSurfaceVariant)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun channelTitle(f: Follow) = when (f.channel) {
|
||||
Channel.STABLE -> stringResource(R.string.upd_stable)
|
||||
Channel.NIGHTLY -> stringResource(R.string.upd_preview)
|
||||
Channel.TEST -> stringResource(R.string.upd_pr, f.pr)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ReleaseNotes(title: String?, notes: String, key: String) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
var open by rememberSaveable(key) { mutableStateOf(false) }
|
||||
var cut by remember(key) { mutableStateOf(false) }
|
||||
Text(
|
||||
if (title != null) Text(
|
||||
title, fontSize = 15.sp, color = colors.onBackground, maxLines = if (open) Int.MAX_VALUE else 2, overflow = TextOverflow.Ellipsis,
|
||||
onTextLayout = { if (it.hasVisualOverflow) cut = true }, modifier = Modifier.padding(top = 10.dp),
|
||||
)
|
||||
if (notes.isNotBlank()) Text(
|
||||
notes, fontSize = 13.5.sp, color = colors.onSurfaceVariant, maxLines = if (open) Int.MAX_VALUE else 1, overflow = TextOverflow.Ellipsis,
|
||||
onTextLayout = { if (it.hasVisualOverflow) cut = true }, modifier = Modifier.padding(top = 4.dp),
|
||||
notes, fontSize = 13.5.sp, color = colors.onSurfaceVariant, maxLines = if (open) Int.MAX_VALUE else if (title == null) 3 else 1,
|
||||
overflow = TextOverflow.Ellipsis, onTextLayout = { if (it.hasVisualOverflow) cut = true },
|
||||
modifier = Modifier.padding(top = if (title == null) 10.dp else 4.dp),
|
||||
)
|
||||
if (cut || open) {
|
||||
val src = remember { MutableInteractionSource() }
|
||||
@@ -287,47 +419,76 @@ private fun changeTitle(t: String): String =
|
||||
private fun megabytes(bytes: Long) = stringResource(R.string.upd_mb, ((bytes + 524_288) / 1_048_576).toInt())
|
||||
|
||||
@Composable
|
||||
private fun ChannelLabel() {
|
||||
Text(
|
||||
stringResource(R.string.upd_channel), fontSize = 12.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 1.5.sp,
|
||||
color = MaterialTheme.colorScheme.onSurfaceVariant, modifier = Modifier.padding(start = 2.dp, top = 2.dp, bottom = 10.dp),
|
||||
)
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ChannelPicker(u: UpdatesState, ua: UpdatesActions, sessionRunning: Boolean) {
|
||||
private fun ChannelPicker(u: UpdatesState, ua: UpdatesActions) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val catalog = u.catalog
|
||||
val tests = catalog?.tests.orEmpty()
|
||||
val me = remember { AppUpdates.installed() }
|
||||
val ready = tests.count { AppUpdates.installable(it, me) }
|
||||
var showTests by rememberSaveable { mutableStateOf(false) }
|
||||
val listing = (showTests || u.follow.channel == Channel.TEST) && tests.isNotEmpty()
|
||||
val shown = if (listing || showTests) Channel.TEST else u.follow.channel
|
||||
Column(verticalArrangement = Arrangement.spacedBy(10.dp)) {
|
||||
ChannelCard(
|
||||
Icons.Outlined.Verified, stringResource(R.string.upd_stable), stringResource(R.string.upd_stable_hint),
|
||||
catalog?.stable?.let { stringResource(R.string.upd_version_ago, it.version ?: it.tag, ago(it.publishedAt)) }, u.follow.channel == Channel.STABLE,
|
||||
) { ua.onFollow(Follow(Channel.STABLE)) }
|
||||
ChannelCard(
|
||||
Icons.Outlined.Bolt, stringResource(R.string.upd_preview), stringResource(R.string.upd_preview_hint),
|
||||
catalog?.preview?.let { ago(it.publishedAt) }, u.follow.channel == Channel.NIGHTLY,
|
||||
) { ua.onFollow(Follow(Channel.NIGHTLY)) }
|
||||
ChannelCard(
|
||||
Icons.Outlined.Science, stringResource(R.string.upd_tests), stringResource(R.string.upd_tests_hint),
|
||||
if (tests.isEmpty()) stringResource(R.string.upd_tests_none) else pluralStringResource(R.plurals.upd_tests_count, ready, ready),
|
||||
u.follow.channel == Channel.TEST, enabled = tests.isNotEmpty() || u.follow.channel == Channel.TEST,
|
||||
) { showTests = !showTests }
|
||||
AnimatedVisibility((showTests || u.follow.channel == Channel.TEST) && tests.isNotEmpty(), enter = expandVertically(Motion.sp(1f)) + fadeIn(Motion.sp(1f)), exit = shrinkVertically(Motion.sp(1f)) + fadeOut(Motion.sp(1f))) {
|
||||
Row(
|
||||
horizontalArrangement = Arrangement.spacedBy(4.dp),
|
||||
modifier = Modifier.fillMaxWidth().clip(CircleShape).background(colors.surface).border(1.dp, pal.line, CircleShape)
|
||||
.padding(4.dp).selectableGroup(),
|
||||
) {
|
||||
ChannelSegment(Icons.Outlined.Verified, stringResource(R.string.upd_stable), null, shown == Channel.STABLE) {
|
||||
showTests = false; ua.onFollow(Follow(Channel.STABLE))
|
||||
}
|
||||
ChannelSegment(Icons.Outlined.Bolt, stringResource(R.string.upd_preview), null, shown == Channel.NIGHTLY) {
|
||||
showTests = false; ua.onFollow(Follow(Channel.NIGHTLY))
|
||||
}
|
||||
ChannelSegment(
|
||||
Icons.Outlined.Science, stringResource(R.string.upd_tests_short), ready.takeIf { it > 0 }?.toString(),
|
||||
shown == Channel.TEST, enabled = tests.isNotEmpty() || u.follow.channel == Channel.TEST,
|
||||
) { showTests = !showTests }
|
||||
}
|
||||
val hint = when {
|
||||
listing || u.follow.channel == Channel.TEST -> stringResource(R.string.upd_tests_hint)
|
||||
u.follow.channel == Channel.NIGHTLY -> stringResource(R.string.upd_preview_hint) +
|
||||
(catalog?.preview?.let { " · " + stringResource(R.string.upd_latest_ago, ago(it.publishedAt)) } ?: "")
|
||||
else -> stringResource(R.string.upd_stable_hint) +
|
||||
(catalog?.stable?.let { " · " + stringResource(R.string.upd_version_ago, it.version ?: it.tag, ago(it.publishedAt)) } ?: "")
|
||||
}
|
||||
Text(hint, fontSize = 12.5.sp, color = colors.onSurfaceVariant, modifier = Modifier.padding(horizontal = 4.dp))
|
||||
if (tests.isEmpty() && catalog != null && showTests) Text(stringResource(R.string.upd_tests_none), fontSize = 12.5.sp, color = colors.onSurfaceVariant)
|
||||
AnimatedVisibility(listing, enter = expandVertically(Motion.sp(1f)) + fadeIn(Motion.sp(1f)), exit = shrinkVertically(Motion.sp(1f)) + fadeOut(Motion.sp(1f))) {
|
||||
TestList(tests, me, u, ua)
|
||||
}
|
||||
val context = androidx.compose.ui.platform.LocalContext.current
|
||||
val agentReady = com.droiddeck.launcher.agent.AgentHost.installed &&
|
||||
(com.droiddeck.launcher.agent.AgentSetup.ready || com.droiddeck.launcher.agent.AgentSetup.completed(context))
|
||||
LabBuilds(sessionRunning, onRebuild = if (agentReady) { info ->
|
||||
com.droiddeck.launcher.agent.AgentHost.send(context, context.getString(R.string.agent_rebuild_lab, info.label))
|
||||
context.startActivity(android.content.Intent(context, com.droiddeck.launcher.FrontEndActivity::class.java)
|
||||
.putExtra(com.droiddeck.launcher.stores.download.StoreDownloadService.EXTRA_NAV, "agent")
|
||||
.addFlags(android.content.Intent.FLAG_ACTIVITY_SINGLE_TOP or android.content.Intent.FLAG_ACTIVITY_REORDER_TO_FRONT))
|
||||
} else null)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun RowScope.ChannelSegment(
|
||||
icon: ImageVector, title: String, badge: String?, selected: Boolean,
|
||||
enabled: Boolean = true, onClick: () -> Unit,
|
||||
) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val src = remember { MutableInteractionSource() }
|
||||
val hot = rememberHot(src)
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(6.dp, Alignment.CenterHorizontally),
|
||||
modifier = Modifier.weight(1f).heightIn(min = 44.dp).paneItem("channel:$title")
|
||||
.clip(CircleShape)
|
||||
.background(if (selected) pal.signal.copy(alpha = 0.16f) else if (hot) pal.signal.copy(alpha = 0.10f) else Color.Transparent)
|
||||
.glideBorder(hot, CircleShape, pal.signal, if (selected) pal.signal else Color.Transparent)
|
||||
.alpha(if (enabled) 1f else 0.5f)
|
||||
.hoverable(src)
|
||||
.selectable(selected = selected, interactionSource = src, indication = null, enabled = enabled, role = Role.RadioButton, onClick = onClick)
|
||||
.controllerConfirm(enabled = enabled, onClick = onClick)
|
||||
.padding(horizontal = 6.dp),
|
||||
) {
|
||||
Icon(icon, contentDescription = null, tint = if (selected) pal.signal else colors.onSurfaceVariant, modifier = Modifier.size(18.dp))
|
||||
Text(title, fontSize = 14.sp, fontWeight = FontWeight.SemiBold, color = if (selected) colors.onBackground else colors.onSurfaceVariant,
|
||||
maxLines = 1, overflow = TextOverflow.Ellipsis, modifier = Modifier.weight(1f, fill = false))
|
||||
if (badge != null) Text(
|
||||
badge, fontSize = 11.sp, fontWeight = FontWeight.Bold, color = colors.onSurfaceVariant,
|
||||
modifier = Modifier.clip(CircleShape).background(colors.surfaceVariant).padding(horizontal = 6.dp, vertical = 1.dp),
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -542,41 +703,6 @@ private fun TestList(tests: List<Release>, me: AppUpdates.Installed, u: UpdatesS
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun ChannelCard(
|
||||
icon: ImageVector, title: String, hint: String, latest: String?, selected: Boolean,
|
||||
enabled: Boolean = true, onClick: () -> Unit,
|
||||
) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val pal = LocalPalette.current
|
||||
val src = remember { MutableInteractionSource() }
|
||||
val hot = rememberHot(src)
|
||||
val fill = if (hot) pal.signal.copy(alpha = 0.14f) else Color.Transparent
|
||||
Row(
|
||||
verticalAlignment = Alignment.CenterVertically,
|
||||
horizontalArrangement = Arrangement.spacedBy(14.dp),
|
||||
modifier = Modifier.fillMaxWidth().paneItem("channel:$title")
|
||||
.clip(Shape14).background(colors.surface).background(fill).glideBorder(hot, Shape14, pal.signal, pal.line)
|
||||
.alpha(if (enabled) 1f else 0.55f)
|
||||
.hoverable(src)
|
||||
.clickable(interactionSource = src, indication = null, enabled = enabled, role = Role.RadioButton, onClick = onClick)
|
||||
.controllerConfirm(enabled = enabled, onClick = onClick)
|
||||
.padding(horizontal = 14.dp, vertical = 10.dp),
|
||||
) {
|
||||
Box(contentAlignment = Alignment.Center, modifier = Modifier.size(38.dp).clip(Shape12).background(if (selected) pal.signal.copy(alpha = 0.18f) else colors.surfaceVariant)) {
|
||||
Icon(icon, contentDescription = null, tint = if (selected) pal.signal else colors.onSurfaceVariant, modifier = Modifier.size(22.dp))
|
||||
}
|
||||
Column(modifier = Modifier.weight(1f), verticalArrangement = Arrangement.spacedBy(2.dp)) {
|
||||
Row(verticalAlignment = Alignment.CenterVertically, horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
Text(title, fontSize = 16.sp, fontWeight = FontWeight.SemiBold, color = colors.onBackground)
|
||||
if (latest != null) Text(latest, fontSize = 12.sp, fontWeight = FontWeight.Medium, color = if (selected) pal.signal else colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||
}
|
||||
Text(hint, fontSize = 12.5.sp, color = colors.onSurfaceVariant, maxLines = 1, overflow = TextOverflow.Ellipsis)
|
||||
}
|
||||
RadioDot(selected)
|
||||
}
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun RadioDot(selected: Boolean, size: androidx.compose.ui.unit.Dp = 22.dp) {
|
||||
val pal = LocalPalette.current
|
||||
|
||||
@@ -9,6 +9,10 @@ public final class WaylandCompositor {
|
||||
|
||||
private WaylandCompositor() {}
|
||||
|
||||
public static native boolean frameWorkerProbeEnabled();
|
||||
public static native boolean frameWorkerProbeGrant(int owner, int pid, long expires, String path, long dev, long ino, long startTicks);
|
||||
public static native void frameWorkerProbeRevoke(int owner, int pid);
|
||||
|
||||
private static volatile Runnable firstFrameListener;
|
||||
|
||||
public static void setFirstFrameListener(Runnable r) { firstFrameListener = r; }
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG تكيّفي %1$d</string>
|
||||
<string name="lsfg_needs_steam">يتطلب Lossless Scaling على Steam</string>
|
||||
<string name="lsfg_needs_install">ثبّت Lossless Scaling في Steam أو استورد Lossless.dll</string>
|
||||
<string name="lsfg_import">استيراد Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">يتم استخدام النسخة الموجودة في Steam</string>
|
||||
<string name="lsfg_using_import">يتم استخدام نسخة مستوردة</string>
|
||||
<string name="lsfg_pick_title">اختر Lossless.dll</string>
|
||||
<string name="lsfg_imported">تم استيراد Lossless.dll</string>
|
||||
<string name="lsfg_import_unchanged">ملف Lossless.dll هذا قيد الاستخدام بالفعل</string>
|
||||
<string name="lsfg_import_not_owned">حساب Steam هذا لا يملك Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">هذا الملف ليس Lossless.dll الخاص بـ Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">تعذّر تجهيز LSFG من ملف Lossless.dll هذا</string>
|
||||
<string name="lsfg_problem_missing">يتطلب LSFG برنامج Lossless Scaling من Steam أو ملف Lossless.dll مستوردًا</string>
|
||||
<string name="lsfg_problem_failed">تعذّر على LSFG تجهيز أدوات التظليل من Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: غير مدعوم</string>
|
||||
<string name="hud_fg_failed">%1$s: فشل المحرك</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG adaptativo %1$d</string>
|
||||
<string name="lsfg_needs_steam">Requiere Lossless Scaling en Steam</string>
|
||||
<string name="lsfg_needs_install">Instala Lossless Scaling en Steam o importa Lossless.dll</string>
|
||||
<string name="lsfg_import">Importar Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Usando la copia de Steam</string>
|
||||
<string name="lsfg_using_import">Usando una copia importada</string>
|
||||
<string name="lsfg_pick_title">Elegir Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll importado</string>
|
||||
<string name="lsfg_import_unchanged">Este Lossless.dll ya está en uso</string>
|
||||
<string name="lsfg_import_not_owned">Lossless Scaling no está en esta cuenta de Steam</string>
|
||||
<string name="lsfg_import_invalid">Este archivo no es el Lossless.dll de Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">No se pudo preparar LSFG con este Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">LSFG necesita Lossless Scaling de Steam o un Lossless.dll importado</string>
|
||||
<string name="lsfg_problem_failed">LSFG no pudo preparar sus shaders desde Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: no compatible</string>
|
||||
<string name="hud_fg_failed">%1$s: falló el motor</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Адаптивно %1$d</string>
|
||||
<string name="lsfg_needs_steam">Изисква Lossless Scaling в Steam</string>
|
||||
<string name="lsfg_needs_install">Инсталирайте Lossless Scaling в Steam или импортирайте Lossless.dll</string>
|
||||
<string name="lsfg_import">Импортиране на Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Използва се копието от Steam</string>
|
||||
<string name="lsfg_using_import">Използва се импортирано копие</string>
|
||||
<string name="lsfg_pick_title">Изберете Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll е импортиран</string>
|
||||
<string name="lsfg_import_unchanged">Този Lossless.dll вече се използва</string>
|
||||
<string name="lsfg_import_not_owned">Lossless Scaling не е закупен за този акаунт в Steam</string>
|
||||
<string name="lsfg_import_invalid">Този файл не е Lossless.dll на Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">LSFG не можа да се подготви от този Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">LSFG изисква Lossless Scaling от Steam или импортиран Lossless.dll</string>
|
||||
<string name="lsfg_problem_failed">LSFG не можа да подготви шейдърите си от Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: не се поддържа</string>
|
||||
<string name="hud_fg_failed">%1$s: грешка в двигателя</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Adaptivní %1$d</string>
|
||||
<string name="lsfg_needs_steam">Vyžaduje Lossless Scaling na Steamu</string>
|
||||
<string name="lsfg_needs_install">Nainstalujte Lossless Scaling ve Steamu nebo naimportujte Lossless.dll</string>
|
||||
<string name="lsfg_import">Importovat Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Používá se kopie ze Steamu</string>
|
||||
<string name="lsfg_using_import">Používá se importovaná kopie</string>
|
||||
<string name="lsfg_pick_title">Vyberte Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll byl importován</string>
|
||||
<string name="lsfg_import_unchanged">Tento Lossless.dll se už používá</string>
|
||||
<string name="lsfg_import_not_owned">Tento účet Steamu nevlastní Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">Tento soubor není Lossless.dll aplikace Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Z tohoto souboru Lossless.dll se nepodařilo připravit LSFG</string>
|
||||
<string name="lsfg_problem_missing">LSFG vyžaduje Lossless Scaling ze Steamu nebo importovaný Lossless.dll</string>
|
||||
<string name="lsfg_problem_failed">LSFG se nepodařilo připravit shadery z Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: nepodporováno</string>
|
||||
<string name="hud_fg_failed">%1$s: chyba enginu</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Adaptiv %1$d</string>
|
||||
<string name="lsfg_needs_steam">Kræver Lossless Scaling på Steam</string>
|
||||
<string name="lsfg_needs_install">Installer Lossless Scaling via Steam, eller importer Lossless.dll</string>
|
||||
<string name="lsfg_import">Importer Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Bruger kopien fra Steam</string>
|
||||
<string name="lsfg_using_import">Bruger en importeret kopi</string>
|
||||
<string name="lsfg_pick_title">Vælg Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll importeret</string>
|
||||
<string name="lsfg_import_unchanged">Denne Lossless.dll er allerede i brug</string>
|
||||
<string name="lsfg_import_not_owned">Lossless Scaling ejes ikke på denne Steam-konto</string>
|
||||
<string name="lsfg_import_invalid">Denne fil er ikke Lossless Scalings Lossless.dll</string>
|
||||
<string name="lsfg_import_failed">Kunne ikke forberede LSFG fra denne Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">LSFG kræver Lossless Scaling fra Steam eller en importeret Lossless.dll</string>
|
||||
<string name="lsfg_problem_failed">LSFG kunne ikke forberede sine shadere fra Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: ikke understøttet</string>
|
||||
<string name="hud_fg_failed">%1$s: motoren fejlede</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Adaptiv %1$d</string>
|
||||
<string name="lsfg_needs_steam">Benötigt Lossless Scaling auf Steam</string>
|
||||
<string name="lsfg_needs_install">Installiere Lossless Scaling in Steam oder importiere Lossless.dll</string>
|
||||
<string name="lsfg_import">Lossless.dll importieren…</string>
|
||||
<string name="lsfg_using_steam">Kopie aus Steam wird verwendet</string>
|
||||
<string name="lsfg_using_import">Importierte Kopie wird verwendet</string>
|
||||
<string name="lsfg_pick_title">Lossless.dll auswählen</string>
|
||||
<string name="lsfg_imported">Lossless.dll importiert</string>
|
||||
<string name="lsfg_import_unchanged">Diese Lossless.dll wird bereits verwendet</string>
|
||||
<string name="lsfg_import_not_owned">Dieses Steam-Konto besitzt Lossless Scaling nicht</string>
|
||||
<string name="lsfg_import_invalid">Diese Datei ist nicht die Lossless.dll von Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">LSFG konnte aus dieser Lossless.dll nicht vorbereitet werden</string>
|
||||
<string name="lsfg_problem_missing">LSFG benötigt Lossless Scaling aus Steam oder eine importierte Lossless.dll</string>
|
||||
<string name="lsfg_problem_failed">LSFG konnte seine Shader nicht aus Lossless.dll vorbereiten</string>
|
||||
<string name="hud_fg_unsupported">%1$s: nicht unterstützt</string>
|
||||
<string name="hud_fg_failed">%1$s: Engine-Fehler</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG προσαρμοστικό %1$d</string>
|
||||
<string name="lsfg_needs_steam">Απαιτεί το Lossless Scaling στο Steam</string>
|
||||
<string name="lsfg_needs_install">Εγκαταστήστε το Lossless Scaling στο Steam ή εισαγάγετε το Lossless.dll</string>
|
||||
<string name="lsfg_import">Εισαγωγή Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Χρήση του αντιγράφου από το Steam</string>
|
||||
<string name="lsfg_using_import">Χρήση ενός εισαγμένου αντιγράφου</string>
|
||||
<string name="lsfg_pick_title">Επιλογή Lossless.dll</string>
|
||||
<string name="lsfg_imported">Το Lossless.dll εισήχθη</string>
|
||||
<string name="lsfg_import_unchanged">Αυτό το Lossless.dll χρησιμοποιείται ήδη</string>
|
||||
<string name="lsfg_import_not_owned">Αυτός ο λογαριασμός Steam δεν κατέχει το Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">Αυτό το αρχείο δεν είναι το Lossless.dll του Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Δεν ήταν δυνατή η προετοιμασία του LSFG από αυτό το Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">Το LSFG απαιτεί το Lossless Scaling από το Steam ή ένα εισαγμένο Lossless.dll</string>
|
||||
<string name="lsfg_problem_failed">Το LSFG δεν μπόρεσε να προετοιμάσει τα shaders του από το Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: μη υποστηριζόμενο</string>
|
||||
<string name="hud_fg_failed">%1$s: αποτυχία μηχανής</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG adaptativo %1$d</string>
|
||||
<string name="lsfg_needs_steam">Requiere Lossless Scaling en Steam</string>
|
||||
<string name="lsfg_needs_install">Instala Lossless Scaling en Steam o importa Lossless.dll</string>
|
||||
<string name="lsfg_import">Importar Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Usando la copia de Steam</string>
|
||||
<string name="lsfg_using_import">Usando una copia importada</string>
|
||||
<string name="lsfg_pick_title">Elegir Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll importado</string>
|
||||
<string name="lsfg_import_unchanged">Este Lossless.dll ya está en uso</string>
|
||||
<string name="lsfg_import_not_owned">Lossless Scaling no está en esta cuenta de Steam</string>
|
||||
<string name="lsfg_import_invalid">Este archivo no es el Lossless.dll de Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">No se pudo preparar LSFG con este Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">LSFG necesita Lossless Scaling de Steam o un Lossless.dll importado</string>
|
||||
<string name="lsfg_problem_failed">LSFG no pudo preparar sus shaders desde Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: no compatible</string>
|
||||
<string name="hud_fg_failed">%1$s: falló el motor</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Mukautuva %1$d</string>
|
||||
<string name="lsfg_needs_steam">Vaatii Lossless Scalingin Steamista</string>
|
||||
<string name="lsfg_needs_install">Asenna Lossless Scaling Steamista tai tuo Lossless.dll</string>
|
||||
<string name="lsfg_import">Tuo Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Käytössä on Steamin kopio</string>
|
||||
<string name="lsfg_using_import">Käytössä on tuotu kopio</string>
|
||||
<string name="lsfg_pick_title">Valitse Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll tuotu</string>
|
||||
<string name="lsfg_import_unchanged">Tämä Lossless.dll on jo käytössä</string>
|
||||
<string name="lsfg_import_not_owned">Lossless Scaling ei ole tämän Steam-tilin omistuksessa</string>
|
||||
<string name="lsfg_import_invalid">Tämä tiedosto ei ole Lossless Scalingin Lossless.dll</string>
|
||||
<string name="lsfg_import_failed">LSFG:n valmistelu tästä Lossless.dll-tiedostosta epäonnistui</string>
|
||||
<string name="lsfg_problem_missing">LSFG tarvitsee Lossless Scalingin Steamista tai tuodun Lossless.dll-tiedoston</string>
|
||||
<string name="lsfg_problem_failed">LSFG ei pystynyt valmistelemaan sävyttimiään Lossless.dll-tiedostosta</string>
|
||||
<string name="hud_fg_unsupported">%1$s: ei tuettu</string>
|
||||
<string name="hud_fg_failed">%1$s: moottori epäonnistui</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Adaptatif %1$d</string>
|
||||
<string name="lsfg_needs_steam">Nécessite Lossless Scaling sur Steam</string>
|
||||
<string name="lsfg_needs_install">Installez Lossless Scaling sur Steam ou importez Lossless.dll</string>
|
||||
<string name="lsfg_import">Importer Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Utilise la version sur Steam</string>
|
||||
<string name="lsfg_using_import">Utilise la version importée</string>
|
||||
<string name="lsfg_pick_title">Sélectionner le fichier Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll importé</string>
|
||||
<string name="lsfg_import_unchanged">Ce Lossless.dll est déjà utilisé</string>
|
||||
<string name="lsfg_import_not_owned">Ce compte Steam ne possède pas Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">Ce fichier n\'est pas le Lossless.dll de Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Impossible de préparer LSFG à partir de ce Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">LSFG nécessite Lossless Scaling depuis Steam, ou un fichier Lossless.dll importé</string>
|
||||
<string name="lsfg_problem_failed">LSFG ne peut pas préparer ses shaders à partir de ce Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s : non pris en charge</string>
|
||||
<string name="hud_fg_failed">%1$s : échec du moteur</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG एडैप्टिव %1$d</string>
|
||||
<string name="lsfg_needs_steam">Steam पर Lossless Scaling की ज़रूरत है</string>
|
||||
<string name="lsfg_needs_install">Steam में Lossless Scaling इंस्टॉल करें या Lossless.dll इंपोर्ट करें</string>
|
||||
<string name="lsfg_import">Lossless.dll इंपोर्ट करें…</string>
|
||||
<string name="lsfg_using_steam">Steam वाली कॉपी का उपयोग हो रहा है</string>
|
||||
<string name="lsfg_using_import">इंपोर्ट की गई कॉपी का उपयोग हो रहा है</string>
|
||||
<string name="lsfg_pick_title">Lossless.dll चुनें</string>
|
||||
<string name="lsfg_imported">Lossless.dll इंपोर्ट हो गई</string>
|
||||
<string name="lsfg_import_unchanged">यह Lossless.dll पहले से उपयोग में है</string>
|
||||
<string name="lsfg_import_not_owned">इस Steam खाते में Lossless Scaling नहीं है</string>
|
||||
<string name="lsfg_import_invalid">यह फ़ाइल Lossless Scaling की Lossless.dll नहीं है</string>
|
||||
<string name="lsfg_import_failed">इस Lossless.dll से LSFG तैयार नहीं हो सका</string>
|
||||
<string name="lsfg_problem_missing">LSFG को Steam से Lossless Scaling या इंपोर्ट की गई Lossless.dll चाहिए</string>
|
||||
<string name="lsfg_problem_failed">LSFG अपने शेडर Lossless.dll से तैयार नहीं कर सका</string>
|
||||
<string name="hud_fg_unsupported">%1$s: असमर्थित</string>
|
||||
<string name="hud_fg_failed">%1$s: इंजन विफल</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG adaptív %1$d</string>
|
||||
<string name="lsfg_needs_steam">A Lossless Scaling szükséges a Steamen</string>
|
||||
<string name="lsfg_needs_install">Telepítse a Lossless Scalinget a Steamen, vagy importálja a Lossless.dll fájlt</string>
|
||||
<string name="lsfg_import">Lossless.dll importálása…</string>
|
||||
<string name="lsfg_using_steam">A Steamről származó másolat használatban</string>
|
||||
<string name="lsfg_using_import">Egy importált másolat használatban</string>
|
||||
<string name="lsfg_pick_title">Válassza ki a Lossless.dll fájlt</string>
|
||||
<string name="lsfg_imported">A Lossless.dll importálva</string>
|
||||
<string name="lsfg_import_unchanged">Ez a Lossless.dll már használatban van</string>
|
||||
<string name="lsfg_import_not_owned">A Lossless Scaling nincs a tulajdonában ezen a Steam-fiókon</string>
|
||||
<string name="lsfg_import_invalid">Ez a fájl nem a Lossless Scaling Lossless.dll fájlja</string>
|
||||
<string name="lsfg_import_failed">Nem sikerült előkészíteni az LSFG-t ebből a Lossless.dll fájlból</string>
|
||||
<string name="lsfg_problem_missing">Az LSFG-hez szükséges a Lossless Scaling a Steamről vagy egy importált Lossless.dll</string>
|
||||
<string name="lsfg_problem_failed">Az LSFG nem tudta előkészíteni a shadereket a Lossless.dll fájlból</string>
|
||||
<string name="hud_fg_unsupported">%1$s: nem támogatott</string>
|
||||
<string name="hud_fg_failed">%1$s: a motor hibát jelzett</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Adaptif %1$d</string>
|
||||
<string name="lsfg_needs_steam">Memerlukan Lossless Scaling di Steam</string>
|
||||
<string name="lsfg_needs_install">Instal Lossless Scaling di Steam atau impor Lossless.dll</string>
|
||||
<string name="lsfg_import">Impor Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Menggunakan salinan dari Steam</string>
|
||||
<string name="lsfg_using_import">Menggunakan salinan yang diimpor</string>
|
||||
<string name="lsfg_pick_title">Pilih Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll diimpor</string>
|
||||
<string name="lsfg_import_unchanged">Lossless.dll ini sudah digunakan</string>
|
||||
<string name="lsfg_import_not_owned">Lossless Scaling tidak dimiliki di akun Steam ini</string>
|
||||
<string name="lsfg_import_invalid">File ini bukan Lossless.dll milik Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Tidak dapat menyiapkan LSFG dari Lossless.dll ini</string>
|
||||
<string name="lsfg_problem_missing">LSFG memerlukan Lossless Scaling dari Steam atau Lossless.dll yang diimpor</string>
|
||||
<string name="lsfg_problem_failed">LSFG tidak dapat menyiapkan shader-nya dari Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: tidak didukung</string>
|
||||
<string name="hud_fg_failed">%1$s: mesin gagal</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG adattivo %1$d</string>
|
||||
<string name="lsfg_needs_steam">Richiede Lossless Scaling su Steam</string>
|
||||
<string name="lsfg_needs_install">Installa Lossless Scaling in Steam o importa Lossless.dll</string>
|
||||
<string name="lsfg_import">Importa Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">In uso la copia di Steam</string>
|
||||
<string name="lsfg_using_import">In uso una copia importata</string>
|
||||
<string name="lsfg_pick_title">Scegli Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll importato</string>
|
||||
<string name="lsfg_import_unchanged">Questo Lossless.dll è già in uso</string>
|
||||
<string name="lsfg_import_not_owned">Questo account Steam non possiede Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">Questo file non è il Lossless.dll di Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Impossibile preparare LSFG da questo Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">LSFG richiede Lossless Scaling da Steam o un Lossless.dll importato</string>
|
||||
<string name="lsfg_problem_failed">LSFG non è riuscito a preparare gli shader da Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: non supportato</string>
|
||||
<string name="hud_fg_failed">%1$s: errore del motore</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG アダプティブ %1$d</string>
|
||||
<string name="lsfg_needs_steam">Steam版のLossless Scalingが必要です</string>
|
||||
<string name="lsfg_needs_install">SteamでLossless Scalingをインストールするか、Lossless.dllをインポートしてください</string>
|
||||
<string name="lsfg_import">Lossless.dllをインポート…</string>
|
||||
<string name="lsfg_using_steam">Steam版を使用中</string>
|
||||
<string name="lsfg_using_import">インポート版を使用中</string>
|
||||
<string name="lsfg_pick_title">Lossless.dllファイルを選択</string>
|
||||
<string name="lsfg_imported">Lossless.dllをインポートしました</string>
|
||||
<string name="lsfg_import_unchanged">このLossless.dllはすでに使用されています</string>
|
||||
<string name="lsfg_import_not_owned">このSteamアカウントはLossless Scalingを所有していません</string>
|
||||
<string name="lsfg_import_invalid">このファイルはLossless ScalingのLossless.dllではありません</string>
|
||||
<string name="lsfg_import_failed">このLossless.dllからLSFGを準備できませんでした</string>
|
||||
<string name="lsfg_problem_missing">LSFGにはSteam版のLossless Scaling、またはインポートされたLossless.dllファイルが必要です</string>
|
||||
<string name="lsfg_problem_failed">LSFGはこのLossless.dllからシェーダーを準備できませんでした</string>
|
||||
<string name="hud_fg_unsupported">%1$s:サポート外</string>
|
||||
<string name="hud_fg_failed">%1$s:エンジンエラー</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG 적응형 %1$d</string>
|
||||
<string name="lsfg_needs_steam">Steam에서 Lossless Scaling이 필요합니다</string>
|
||||
<string name="lsfg_needs_install">Steam에서 Lossless Scaling을 설치하거나 Lossless.dll을 가져오세요</string>
|
||||
<string name="lsfg_import">Lossless.dll 가져오기…</string>
|
||||
<string name="lsfg_using_steam">Steam 버전 사용 중</string>
|
||||
<string name="lsfg_using_import">가져온 버전 사용 중</string>
|
||||
<string name="lsfg_pick_title">Lossless.dll 파일 선택</string>
|
||||
<string name="lsfg_imported">Lossless.dll을 가져왔습니다</string>
|
||||
<string name="lsfg_import_unchanged">이 Lossless.dll은 이미 사용 중입니다</string>
|
||||
<string name="lsfg_import_not_owned">이 Steam 계정에는 Lossless Scaling이 없습니다</string>
|
||||
<string name="lsfg_import_invalid">이 파일은 Lossless Scaling의 Lossless.dll이 아닙니다</string>
|
||||
<string name="lsfg_import_failed">이 Lossless.dll에서 LSFG를 준비할 수 없습니다</string>
|
||||
<string name="lsfg_problem_missing">LSFG에는 Steam의 Lossless Scaling 또는 가져온 Lossless.dll 파일이 필요합니다</string>
|
||||
<string name="lsfg_problem_failed">LSFG가 이 Lossless.dll에서 셰이더를 준비할 수 없습니다</string>
|
||||
<string name="hud_fg_unsupported">%1$s: 지원되지 않음</string>
|
||||
<string name="hud_fg_failed">%1$s: 엔진 실패</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Adaptif %1$d</string>
|
||||
<string name="lsfg_needs_steam">Memerlukan Lossless Scaling pada Steam</string>
|
||||
<string name="lsfg_needs_install">Pasang Lossless Scaling dalam Steam atau import Lossless.dll</string>
|
||||
<string name="lsfg_import">Import Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Menggunakan salinan daripada Steam</string>
|
||||
<string name="lsfg_using_import">Menggunakan salinan yang diimport</string>
|
||||
<string name="lsfg_pick_title">Pilih Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll diimport</string>
|
||||
<string name="lsfg_import_unchanged">Lossless.dll ini sudah digunakan</string>
|
||||
<string name="lsfg_import_not_owned">Lossless Scaling tidak dimiliki pada akaun Steam ini</string>
|
||||
<string name="lsfg_import_invalid">Fail ini bukan Lossless.dll milik Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Tidak dapat menyediakan LSFG daripada Lossless.dll ini</string>
|
||||
<string name="lsfg_problem_missing">LSFG memerlukan Lossless Scaling daripada Steam atau Lossless.dll yang diimport</string>
|
||||
<string name="lsfg_problem_failed">LSFG tidak dapat menyediakan shadernya daripada Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: tidak disokong</string>
|
||||
<string name="hud_fg_failed">%1$s: enjin gagal</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Adaptiv %1$d</string>
|
||||
<string name="lsfg_needs_steam">Krever Lossless Scaling på Steam</string>
|
||||
<string name="lsfg_needs_install">Installer Lossless Scaling via Steam, eller importer Lossless.dll</string>
|
||||
<string name="lsfg_import">Importer Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Bruker kopien fra Steam</string>
|
||||
<string name="lsfg_using_import">Bruker en importert kopi</string>
|
||||
<string name="lsfg_pick_title">Velg Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll importert</string>
|
||||
<string name="lsfg_import_unchanged">Denne Lossless.dll-filen er allerede i bruk</string>
|
||||
<string name="lsfg_import_not_owned">Lossless Scaling eies ikke av denne Steam-kontoen</string>
|
||||
<string name="lsfg_import_invalid">Denne filen er ikke Lossless Scalings Lossless.dll</string>
|
||||
<string name="lsfg_import_failed">Kunne ikke forberede LSFG fra denne Lossless.dll-filen</string>
|
||||
<string name="lsfg_problem_missing">LSFG krever Lossless Scaling fra Steam eller en importert Lossless.dll</string>
|
||||
<string name="lsfg_problem_failed">LSFG kunne ikke forberede shaderne sine fra Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: ikke støttet</string>
|
||||
<string name="hud_fg_failed">%1$s: motoren feilet</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG adaptief %1$d</string>
|
||||
<string name="lsfg_needs_steam">Vereist Lossless Scaling op Steam</string>
|
||||
<string name="lsfg_needs_install">Installeer Lossless Scaling in Steam of importeer Lossless.dll</string>
|
||||
<string name="lsfg_import">Lossless.dll importeren…</string>
|
||||
<string name="lsfg_using_steam">De kopie uit Steam wordt gebruikt</string>
|
||||
<string name="lsfg_using_import">Een geïmporteerde kopie wordt gebruikt</string>
|
||||
<string name="lsfg_pick_title">Kies Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll geïmporteerd</string>
|
||||
<string name="lsfg_import_unchanged">Deze Lossless.dll wordt al gebruikt</string>
|
||||
<string name="lsfg_import_not_owned">Lossless Scaling staat niet op dit Steam-account</string>
|
||||
<string name="lsfg_import_invalid">Dit bestand is niet de Lossless.dll van Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Kan LSFG niet voorbereiden met deze Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">LSFG vereist Lossless Scaling uit Steam of een geïmporteerde Lossless.dll</string>
|
||||
<string name="lsfg_problem_failed">LSFG kan zijn shaders niet voorbereiden uit Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: niet ondersteund</string>
|
||||
<string name="hud_fg_failed">%1$s: engine mislukt</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG adaptacyjne %1$d</string>
|
||||
<string name="lsfg_needs_steam">Wymaga Lossless Scaling ze Steam</string>
|
||||
<string name="lsfg_needs_install">Zainstaluj Lossless Scaling w Steam lub zaimportuj Lossless.dll</string>
|
||||
<string name="lsfg_import">Importuj Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Używana jest kopia ze Steam</string>
|
||||
<string name="lsfg_using_import">Używana jest zaimportowana kopia</string>
|
||||
<string name="lsfg_pick_title">Wybierz Lossless.dll</string>
|
||||
<string name="lsfg_imported">Zaimportowano Lossless.dll</string>
|
||||
<string name="lsfg_import_unchanged">Ten plik Lossless.dll jest już używany</string>
|
||||
<string name="lsfg_import_not_owned">To konto Steam nie ma Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">Ten plik to nie Lossless.dll z Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Nie udało się przygotować LSFG z tego pliku Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">LSFG wymaga Lossless Scaling ze Steam lub zaimportowanego pliku Lossless.dll</string>
|
||||
<string name="lsfg_problem_failed">Nie udało się przygotować shaderów LSFG z pliku Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: nieobsługiwane</string>
|
||||
<string name="hud_fg_failed">%1$s: błąd silnika</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Adaptativo %1$d</string>
|
||||
<string name="lsfg_needs_steam">Requer o Lossless Scaling no Steam</string>
|
||||
<string name="lsfg_needs_install">Instale o Lossless Scaling no Steam ou importe o Lossless.dll</string>
|
||||
<string name="lsfg_import">Importar Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">A utilizar a cópia do Steam</string>
|
||||
<string name="lsfg_using_import">A utilizar uma cópia importada</string>
|
||||
<string name="lsfg_pick_title">Escolher Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll importado</string>
|
||||
<string name="lsfg_import_unchanged">Este Lossless.dll já está a ser utilizado</string>
|
||||
<string name="lsfg_import_not_owned">Esta conta Steam não possui o Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">Este ficheiro não é o Lossless.dll do Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Não foi possível preparar o LSFG a partir deste Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">O LSFG requer o Lossless Scaling do Steam ou um Lossless.dll importado</string>
|
||||
<string name="lsfg_problem_failed">O LSFG não conseguiu preparar os shaders a partir do Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: não suportado</string>
|
||||
<string name="hud_fg_failed">%1$s: falha do motor</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Adaptativo %1$d</string>
|
||||
<string name="lsfg_needs_steam">Requer o Lossless Scaling na Steam</string>
|
||||
<string name="lsfg_needs_install">Instale o Lossless Scaling na Steam ou importe o Lossless.dll</string>
|
||||
<string name="lsfg_import">Importar Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Usando a cópia da Steam</string>
|
||||
<string name="lsfg_using_import">Usando uma cópia importada</string>
|
||||
<string name="lsfg_pick_title">Escolha o Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll importado</string>
|
||||
<string name="lsfg_import_unchanged">Este Lossless.dll já está em uso</string>
|
||||
<string name="lsfg_import_not_owned">Esta conta Steam não tem o Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">Este arquivo não é o Lossless.dll do Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Não foi possível preparar o LSFG com este Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">O LSFG requer o Lossless Scaling da Steam ou um Lossless.dll importado</string>
|
||||
<string name="lsfg_problem_failed">O LSFG não conseguiu preparar os shaders a partir do Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: sem suporte</string>
|
||||
<string name="hud_fg_failed">%1$s: falha no mecanismo</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Adaptiv %1$d</string>
|
||||
<string name="lsfg_needs_steam">Necesită Lossless Scaling pe Steam</string>
|
||||
<string name="lsfg_needs_install">Instalează Lossless Scaling în Steam sau importă Lossless.dll</string>
|
||||
<string name="lsfg_import">Importă Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Se folosește copia din Steam</string>
|
||||
<string name="lsfg_using_import">Se folosește o copie importată</string>
|
||||
<string name="lsfg_pick_title">Alege Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll importat</string>
|
||||
<string name="lsfg_import_unchanged">Acest Lossless.dll este deja în uz</string>
|
||||
<string name="lsfg_import_not_owned">Lossless Scaling nu este deținut pe acest cont Steam</string>
|
||||
<string name="lsfg_import_invalid">Acest fișier nu este Lossless.dll al Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Nu s-a putut pregăti LSFG din acest Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">LSFG are nevoie de Lossless Scaling din Steam sau de un Lossless.dll importat</string>
|
||||
<string name="lsfg_problem_failed">LSFG nu a putut pregăti shaderele din Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: neacceptat</string>
|
||||
<string name="hud_fg_failed">%1$s: motor eșuat</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Адаптивный %1$d</string>
|
||||
<string name="lsfg_needs_steam">Требуется Lossless Scaling из Steam</string>
|
||||
<string name="lsfg_needs_install">Установите Lossless Scaling в Steam или импортируйте Lossless.dll</string>
|
||||
<string name="lsfg_import">Импорт Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Используется копия из Steam</string>
|
||||
<string name="lsfg_using_import">Используется импортированная копия</string>
|
||||
<string name="lsfg_pick_title">Выберите файл Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll импортирован</string>
|
||||
<string name="lsfg_import_unchanged">Этот Lossless.dll уже используется</string>
|
||||
<string name="lsfg_import_not_owned">В этой учетной записи Steam нет Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">Этот файл не является Lossless.dll от Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Не удалось подготовить LSFG из этого Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">Для LSFG требуется Lossless Scaling из Steam или импортированный файл Lossless.dll</string>
|
||||
<string name="lsfg_problem_failed">LSFG не удалось подготовить шейдеры из Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: не поддерживается</string>
|
||||
<string name="hud_fg_failed">%1$s: сбой движка</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG adaptiv %1$d</string>
|
||||
<string name="lsfg_needs_steam">Kräver Lossless Scaling på Steam</string>
|
||||
<string name="lsfg_needs_install">Installera Lossless Scaling i Steam eller importera Lossless.dll</string>
|
||||
<string name="lsfg_import">Importera Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Använder kopian från Steam</string>
|
||||
<string name="lsfg_using_import">Använder en importerad kopia</string>
|
||||
<string name="lsfg_pick_title">Välj Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll har importerats</string>
|
||||
<string name="lsfg_import_unchanged">Den här Lossless.dll används redan</string>
|
||||
<string name="lsfg_import_not_owned">Lossless Scaling ägs inte på det här Steam-kontot</string>
|
||||
<string name="lsfg_import_invalid">Filen är inte Lossless.dll från Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Kunde inte förbereda LSFG från den här Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">LSFG kräver Lossless Scaling från Steam eller en importerad Lossless.dll</string>
|
||||
<string name="lsfg_problem_failed">LSFG kunde inte förbereda sina shaders från Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: stöds inte</string>
|
||||
<string name="hud_fg_failed">%1$s: motorn misslyckades</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG แบบปรับอัตโนมัติ %1$d</string>
|
||||
<string name="lsfg_needs_steam">ต้องมี Lossless Scaling บน Steam</string>
|
||||
<string name="lsfg_needs_install">ติดตั้ง Lossless Scaling ใน Steam หรือนำเข้า Lossless.dll</string>
|
||||
<string name="lsfg_import">นำเข้า Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">ใช้ชุดที่มาจาก Steam</string>
|
||||
<string name="lsfg_using_import">ใช้ชุดที่นำเข้ามา</string>
|
||||
<string name="lsfg_pick_title">เลือก Lossless.dll</string>
|
||||
<string name="lsfg_imported">นำเข้า Lossless.dll แล้ว</string>
|
||||
<string name="lsfg_import_unchanged">Lossless.dll นี้ถูกใช้งานอยู่แล้ว</string>
|
||||
<string name="lsfg_import_not_owned">บัญชี Steam นี้ไม่ได้เป็นเจ้าของ Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">ไฟล์นี้ไม่ใช่ Lossless.dll ของ Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">ไม่สามารถเตรียม LSFG จาก Lossless.dll นี้ได้</string>
|
||||
<string name="lsfg_problem_missing">LSFG ต้องใช้ Lossless Scaling จาก Steam หรือ Lossless.dll ที่นำเข้ามา</string>
|
||||
<string name="lsfg_problem_failed">LSFG ไม่สามารถเตรียมเชดเดอร์จาก Lossless.dll ได้</string>
|
||||
<string name="hud_fg_unsupported">%1$s: ไม่รองรับ</string>
|
||||
<string name="hud_fg_failed">%1$s: เอนจินล้มเหลว</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Uyarlanabilir %1$d</string>
|
||||
<string name="lsfg_needs_steam">Steam\'de Lossless Scaling gerekli</string>
|
||||
<string name="lsfg_needs_install">Lossless Scaling\'i Steam\'den yükleyin veya Lossless.dll dosyasını içe aktarın</string>
|
||||
<string name="lsfg_import">Lossless.dll içe aktar…</string>
|
||||
<string name="lsfg_using_steam">Steam\'deki kopya kullanılıyor</string>
|
||||
<string name="lsfg_using_import">İçe aktarılan kopya kullanılıyor</string>
|
||||
<string name="lsfg_pick_title">Lossless.dll seçin</string>
|
||||
<string name="lsfg_imported">Lossless.dll içe aktarıldı</string>
|
||||
<string name="lsfg_import_unchanged">Bu Lossless.dll zaten kullanılıyor</string>
|
||||
<string name="lsfg_import_not_owned">Bu Steam hesabı Lossless Scaling\'e sahip değil</string>
|
||||
<string name="lsfg_import_invalid">Bu dosya Lossless Scaling\'in Lossless.dll dosyası değil</string>
|
||||
<string name="lsfg_import_failed">Bu Lossless.dll ile LSFG hazırlanamadı</string>
|
||||
<string name="lsfg_problem_missing">LSFG için Steam\'den Lossless Scaling veya içe aktarılmış bir Lossless.dll gerekir</string>
|
||||
<string name="lsfg_problem_failed">LSFG, gölgelendiricilerini Lossless.dll dosyasından hazırlayamadı</string>
|
||||
<string name="hud_fg_unsupported">%1$s: desteklenmiyor</string>
|
||||
<string name="hud_fg_failed">%1$s: motor hatası</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG адаптивний %1$d</string>
|
||||
<string name="lsfg_needs_steam">Потрібен Lossless Scaling зі Steam</string>
|
||||
<string name="lsfg_needs_install">Установіть Lossless Scaling у Steam або імпортуйте Lossless.dll</string>
|
||||
<string name="lsfg_import">Імпортувати Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Використовується копія зі Steam</string>
|
||||
<string name="lsfg_using_import">Використовується імпортована копія</string>
|
||||
<string name="lsfg_pick_title">Виберіть Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll імпортовано</string>
|
||||
<string name="lsfg_import_unchanged">Цей Lossless.dll уже використовується</string>
|
||||
<string name="lsfg_import_not_owned">У цьому обліковому записі Steam немає Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">Цей файл не є Lossless.dll від Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Не вдалося підготувати LSFG із цього Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">Для LSFG потрібен Lossless Scaling зі Steam або імпортований Lossless.dll</string>
|
||||
<string name="lsfg_problem_failed">LSFG не вдалося підготувати шейдери з Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: не підтримується</string>
|
||||
<string name="hud_fg_failed">%1$s: збій рушія</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG thích ứng %1$d</string>
|
||||
<string name="lsfg_needs_steam">Cần Lossless Scaling trên Steam</string>
|
||||
<string name="lsfg_needs_install">Cài Lossless Scaling trong Steam hoặc nhập Lossless.dll</string>
|
||||
<string name="lsfg_import">Nhập Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Đang dùng bản sao từ Steam</string>
|
||||
<string name="lsfg_using_import">Đang dùng bản đã nhập</string>
|
||||
<string name="lsfg_pick_title">Chọn Lossless.dll</string>
|
||||
<string name="lsfg_imported">Đã nhập Lossless.dll</string>
|
||||
<string name="lsfg_import_unchanged">Lossless.dll này đã đang được dùng</string>
|
||||
<string name="lsfg_import_not_owned">Tài khoản Steam này không sở hữu Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">Tệp này không phải là Lossless.dll của Lossless Scaling</string>
|
||||
<string name="lsfg_import_failed">Không thể chuẩn bị LSFG từ Lossless.dll này</string>
|
||||
<string name="lsfg_problem_missing">LSFG cần Lossless Scaling từ Steam hoặc một Lossless.dll đã nhập</string>
|
||||
<string name="lsfg_problem_failed">LSFG không thể chuẩn bị shader từ Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: không hỗ trợ</string>
|
||||
<string name="hud_fg_failed">%1$s: engine lỗi</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG 自适应 %1$d</string>
|
||||
<string name="lsfg_needs_steam">需要 Steam 上的 Lossless Scaling</string>
|
||||
<string name="lsfg_needs_install">请在 Steam 中安装 Lossless Scaling,或导入 Lossless.dll</string>
|
||||
<string name="lsfg_import">导入 Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">正在使用 Steam 中的副本</string>
|
||||
<string name="lsfg_using_import">正在使用已导入的副本</string>
|
||||
<string name="lsfg_pick_title">选择 Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll 已导入</string>
|
||||
<string name="lsfg_import_unchanged">该 Lossless.dll 已在使用中</string>
|
||||
<string name="lsfg_import_not_owned">此 Steam 账户未拥有 Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">该文件不是 Lossless Scaling 的 Lossless.dll</string>
|
||||
<string name="lsfg_import_failed">无法由此 Lossless.dll 准备 LSFG</string>
|
||||
<string name="lsfg_problem_missing">LSFG 需要 Steam 上的 Lossless Scaling 或已导入的 Lossless.dll</string>
|
||||
<string name="lsfg_problem_failed">LSFG 无法从 Lossless.dll 准备其着色器</string>
|
||||
<string name="hud_fg_unsupported">%1$s:不支持</string>
|
||||
<string name="hud_fg_failed">%1$s:引擎失败</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG 自適應 %1$d</string>
|
||||
<string name="lsfg_needs_steam">需要 Steam 上的 Lossless Scaling</string>
|
||||
<string name="lsfg_needs_install">請在 Steam 安裝 Lossless Scaling,或匯入 Lossless.dll</string>
|
||||
<string name="lsfg_import">匯入 Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">正在使用 Steam 上的版本</string>
|
||||
<string name="lsfg_using_import">正在使用匯入的版本</string>
|
||||
<string name="lsfg_pick_title">選擇 Lossless.dll</string>
|
||||
<string name="lsfg_imported">已匯入 Lossless.dll</string>
|
||||
<string name="lsfg_import_unchanged">此 Lossless.dll 已在使用中</string>
|
||||
<string name="lsfg_import_not_owned">此 Steam 帳戶未擁有 Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">此檔案不是 Lossless Scaling 的 Lossless.dll</string>
|
||||
<string name="lsfg_import_failed">無法從此 Lossless.dll 準備 LSFG</string>
|
||||
<string name="lsfg_problem_missing">LSFG 需要 Steam 上的 Lossless Scaling 或已匯入的 Lossless.dll</string>
|
||||
<string name="lsfg_problem_failed">LSFG 無法從 Lossless.dll 準備著色器</string>
|
||||
<string name="hud_fg_unsupported">%1$s:不支援</string>
|
||||
<string name="hud_fg_failed">%1$s:引擎故障</string>
|
||||
|
||||
@@ -55,17 +55,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG 自適應 %1$d</string>
|
||||
<string name="lsfg_needs_steam">需要 Steam 上的 Lossless Scaling</string>
|
||||
<string name="lsfg_needs_install">在 Steam 中安裝 Lossless Scaling,或匯入 Lossless.dll</string>
|
||||
<string name="lsfg_import">匯入 Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">正在使用 Steam 上的版本</string>
|
||||
<string name="lsfg_using_import">正在使用匯入的版本</string>
|
||||
<string name="lsfg_pick_title">選擇 Lossless.dll 檔案</string>
|
||||
<string name="lsfg_imported">已匯入 Lossless.dll</string>
|
||||
<string name="lsfg_import_unchanged">這個 Lossless.dll 已經在使用中了</string>
|
||||
<string name="lsfg_import_not_owned">此 Steam 帳號沒有 Lossless Scaling</string>
|
||||
<string name="lsfg_import_invalid">此檔案不是 Lossless Scaling 的 Lossless.dll</string>
|
||||
<string name="lsfg_import_failed">無法從此 Lossless.dll 準備 LSFG</string>
|
||||
<string name="lsfg_problem_missing">LSFG 需要來自 Steam 的 Lossless Scaling,或是匯入的 Lossless.dll 檔案</string>
|
||||
<string name="lsfg_problem_failed">LSFG 無法從此 Lossless.dll 準備其著色器</string>
|
||||
<string name="hud_fg_unsupported">%1$s:不支援</string>
|
||||
<string name="hud_fg_failed">%1$s:引擎失敗</string>
|
||||
|
||||
@@ -83,17 +83,6 @@
|
||||
<string name="frame_gen_lsfg">LSFG %1$d×</string>
|
||||
<string name="frame_gen_lsfg_adaptive">LSFG Adaptive %1$d</string>
|
||||
<string name="lsfg_needs_steam">Needs Lossless Scaling on Steam</string>
|
||||
<string name="lsfg_needs_install">Install Lossless Scaling in Steam or import Lossless.dll</string>
|
||||
<string name="lsfg_import">Import Lossless.dll…</string>
|
||||
<string name="lsfg_using_steam">Using the copy from Steam</string>
|
||||
<string name="lsfg_using_import">Using an imported copy</string>
|
||||
<string name="lsfg_pick_title">Choose Lossless.dll</string>
|
||||
<string name="lsfg_imported">Lossless.dll imported</string>
|
||||
<string name="lsfg_import_unchanged">This Lossless.dll is already in use</string>
|
||||
<string name="lsfg_import_not_owned">Lossless Scaling is not owned on this Steam account</string>
|
||||
<string name="lsfg_import_invalid">This file is not Lossless Scaling\'s Lossless.dll</string>
|
||||
<string name="lsfg_import_failed">Could not prepare LSFG from this Lossless.dll</string>
|
||||
<string name="lsfg_problem_missing">LSFG needs Lossless Scaling from Steam or an imported Lossless.dll</string>
|
||||
<string name="lsfg_problem_failed">LSFG could not prepare its shaders from Lossless.dll</string>
|
||||
<string name="hud_fg_unsupported">%1$s: unsupported</string>
|
||||
<string name="hud_fg_failed">%1$s: engine failed</string>
|
||||
@@ -1182,6 +1171,21 @@
|
||||
<string name="upd_new_test">PR #%1$d test build</string>
|
||||
<string name="upd_mb">%1$d MB</string>
|
||||
<string name="upd_channel">UPDATE CHANNEL</string>
|
||||
<string name="upd_installed_label">INSTALLED</string>
|
||||
<string name="upd_testers">FOR TESTERS</string>
|
||||
<string name="upd_kind_test">Test build</string>
|
||||
<string name="upd_kind_lab">Lab build</string>
|
||||
<string name="upd_lab_on_pr">On the PR #%1$d test build</string>
|
||||
<string name="upd_lab_on_version">On DroidDeck %1$s</string>
|
||||
<string name="upd_droiddeck_version">DroidDeck %1$s</string>
|
||||
<string name="upd_built_ago">built %1$s</string>
|
||||
<string name="upd_check_now">Check now</string>
|
||||
<string name="upd_tests_short">Tests</string>
|
||||
<string name="upd_latest_ago">latest %1$s</string>
|
||||
<string name="upd_released_ago">Released %1$s</string>
|
||||
<string name="upd_switch_to_button">Switch to %1$s%2$s</string>
|
||||
<string name="upd_older_than_installed">Older than your installed build (%1$s)</string>
|
||||
<string name="upd_data_stays">Your games and settings stay.</string>
|
||||
<string name="upd_stable">Stable</string>
|
||||
<string name="upd_stable_hint">Tested releases, for most people</string>
|
||||
<string name="upd_version_ago">%1$s · %2$s</string>
|
||||
@@ -4387,6 +4391,7 @@
|
||||
<string name="soundtracks_volume">Volume</string>
|
||||
<string name="soundtracks_no_tracks">No audio files found in this soundtrack</string>
|
||||
<string name="stores_rockstar_launch_unavailable">Launch unavailable</string>
|
||||
<string name="agent_image_missing">Image not found: %1$s</string>
|
||||
<string name="agent_browser_unavailable">No web browser is available to open this link.</string>
|
||||
<string name="hud_hint_grab">Grab</string>
|
||||
<string name="hud_hint_drop">Drop</string>
|
||||
@@ -4515,4 +4520,6 @@
|
||||
<string name="steam_store_close_steam">Close Steam first</string>
|
||||
<string name="steam_store_session_wait">Pause the Steam download first</string>
|
||||
<string name="steam_store_linux_build">This game installs its Linux build. Install it from Steam.</string>
|
||||
<string name="producer_acquire_fences">Direct game frames (experimental)</string>
|
||||
<string name="producer_acquire_fences_summary">With Zero-copy enabled, compatible Steam games can avoid a frame copy. Takes effect next session.</string>
|
||||
</resources>
|
||||
@@ -40,9 +40,39 @@ class LosslessTest {
|
||||
assertTrue(Lossless.owned(context))
|
||||
}
|
||||
|
||||
@Test fun importIsRefusedWithoutOwnership() {
|
||||
val dll = File(context.cacheDir, "Lossless.dll").apply { writeText("not a dll") }
|
||||
assertFalse(Lossless.owned(context))
|
||||
assertEquals(Lossless.ImportResult.NOT_OWNED, Lossless.import(context, dll))
|
||||
@Test fun anOldManualImportCannotBeUsedOrRebuiltEvenWhenOwned() {
|
||||
val prefs = context.getSharedPreferences("lossless", Context.MODE_PRIVATE)
|
||||
prefs.edit().putBoolean("owned", true).putString("source", "IMPORT").putString("id", "legacy")
|
||||
.putString("steamStamp", "old stamp").commit()
|
||||
val dir = File(context.filesDir, "lsfg").apply { mkdirs() }
|
||||
File(dir, "Lossless.dll").writeText("legacy DLL")
|
||||
File(dir, "shaders-legacy.cache").writeText("legacy cache")
|
||||
|
||||
assertFalse(Lossless.state(context).ready)
|
||||
assertNull(Lossless.cacheFile(context))
|
||||
assertEquals(LsfgNative.STATUS_NOT_INSTALLED, Lossless.sync(context))
|
||||
assertFalse(prefs.contains("steamStamp"))
|
||||
assertTrue(Lossless.owned(context))
|
||||
}
|
||||
|
||||
@Test fun aPreviouslyPreparedSteamCacheRemainsAvailable() {
|
||||
val prefs = context.getSharedPreferences("lossless", Context.MODE_PRIVATE)
|
||||
prefs.edit().putBoolean("owned", true).putString("source", "STEAM").putString("id", "steam").commit()
|
||||
val cache = File(File(context.filesDir, "lsfg").apply { mkdirs() }, "shaders-steam.cache")
|
||||
cache.writeText("cache")
|
||||
|
||||
assertEquals(cache, Lossless.cacheFile(context))
|
||||
assertTrue(Lossless.state(context).ready)
|
||||
}
|
||||
|
||||
@Test fun looseDllWithoutAnInstallManifestDoesNotCountAsASteamInstall() {
|
||||
val library = File(context.cacheDir, "library")
|
||||
val dll = File(library, "steamapps/common/Lossless Scaling/Lossless.dll")
|
||||
dll.parentFile!!.mkdirs()
|
||||
dll.writeText("fixture")
|
||||
|
||||
assertNull(Lossless.installedSteamDll(listOf(library)))
|
||||
File(library, "steamapps/appmanifest_993090.acf").writeText("fixture")
|
||||
assertEquals(dll, Lossless.installedSteamDll(listOf(library)))
|
||||
}
|
||||
}
|
||||
@@ -506,6 +506,20 @@ class OnScreenLayoutTest {
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun controlsBelowTheGameKeepRearButtonsAtTheEdgesAndSticksInView() {
|
||||
SessionPrefs.setSteamController(context, SessionPrefs.CONTROLLER_DECK)
|
||||
val w = 1216
|
||||
val placed = OnScreenLayout.elements(context, gamepad(), w, 1900, Rect(), dock = OnScreenLayout.Dock.deck(true, null))
|
||||
fun centre(control: InputControl) = placed.single { it.control == control }.let { it.x + it.width / 2f }
|
||||
assertTrue(centre(InputControl.L4) < centre(InputControl.L5))
|
||||
assertTrue(centre(InputControl.L5) < .5f && centre(InputControl.R5) > .5f)
|
||||
assertTrue(centre(InputControl.R5) < centre(InputControl.R4))
|
||||
val shoulder = placed.single { it.control == InputControl.LB }
|
||||
assertTrue(placed.filter { it.control in setOf(InputControl.L4, InputControl.L5, InputControl.R4, InputControl.R5) }
|
||||
.all { it.width < shoulder.width })
|
||||
assertTrue(placed.filter { it.kind == InputElementKind.STICK }.none { it.hideWhenIdle })
|
||||
}
|
||||
|
||||
private val legacyKeys = "29+33:0.3,0.7,44::Find::0.6:1:1:1"
|
||||
|
||||
private fun importedOn(library: InputLibrary) = library.activeLayout(false, InputRole.PRIMARY)!!.elements.filter { it.id.startsWith("imported:") }
|
||||
|
||||
@@ -0,0 +1,117 @@
|
||||
package com.droiddeck.launcher.runtime
|
||||
|
||||
import java.io.File
|
||||
import java.nio.file.Files
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class FrameAcquireWorkerProbeTest {
|
||||
@Test fun requiresExactSteamScriptInTheAppIssuedGuestRoot() {
|
||||
val dir = Files.createTempDirectory("worker-probe-script").toFile().canonicalFile
|
||||
try {
|
||||
val root = File(dir, "root").apply { mkdir() }
|
||||
val configured = File(dir, "configured")
|
||||
Files.createSymbolicLink(configured.toPath(), root.toPath())
|
||||
val untrustedAlias = File(dir, "other-alias")
|
||||
Files.createSymbolicLink(untrustedAlias.toPath(), root.toPath())
|
||||
val script = "/usr/local/bin/droiddeck-session"
|
||||
val expected = File(root.path + script).apply { parentFile!!.mkdirs(); writeText("#!/bin/bash\n") }
|
||||
val otherRoot = File(dir, "sibling")
|
||||
File(otherRoot.path + script).apply { parentFile!!.mkdirs(); writeText("#!/bin/bash\n") }
|
||||
val otherScript = File(expected.parentFile, "other-script").apply { writeText("#!/bin/bash\n") }
|
||||
|
||||
val args = listOf("gamescope", "--backend", "wayland", "--expose-wayland", "-f",
|
||||
"-W", "1280", "-H", "720", "-w", "1280", "-h", "720", "-r", "60",
|
||||
"-e", "--xwayland-count", "2", "--default-touch-mode", "4", "--hdr-enabled",
|
||||
"--", script, "steam")
|
||||
fun valid(argv: List<String>) = FrameAcquireWorkerProbe.exactGamescopeArgs(argv) {
|
||||
FrameAcquireWorkerProbe.exactSteamScript(it, root, configured)
|
||||
}
|
||||
fun child(path: String) = args.dropLast(2) + listOf(path, "steam")
|
||||
|
||||
assertTrue(valid(args))
|
||||
assertTrue(valid(args.toMutableList().also { it[0] = "/usr/local/bin/gamescope" }))
|
||||
assertFalse(valid(args.toMutableList().also { it[0] = "/opt/droiddeck-agent/bin/gamescope" }))
|
||||
assertTrue(valid(child(root.path + script)))
|
||||
assertTrue(valid(child(configured.path + script)))
|
||||
for (path in listOf(otherRoot.path + script, untrustedAlias.path + script,
|
||||
root.path + "/usr/local/bin/./droiddeck-session", root.path + "/../sibling" + script,
|
||||
otherScript.path, "droiddeck-session")) {
|
||||
assertFalse(valid(child(path)))
|
||||
}
|
||||
for (bad in listOf(listOf("gamescope", "--version"), args + "",
|
||||
args + "steam://open/library", args.dropLast(1) + "desktop",
|
||||
args.take(5) + "--unknown-flag" + args.drop(5),
|
||||
args.take(5) + listOf("-W", "64") + args.drop(5))) {
|
||||
assertFalse(valid(bad))
|
||||
}
|
||||
|
||||
assertTrue(expected.delete())
|
||||
Files.createSymbolicLink(expected.toPath(), otherScript.toPath())
|
||||
assertFalse(valid(args))
|
||||
assertFalse(valid(child(configured.path + script)))
|
||||
} finally {
|
||||
// Don't follow the intentionally broken/foreign symlinks in this fixture.
|
||||
Files.walk(dir.toPath()).use { paths ->
|
||||
paths.sorted(Comparator.reverseOrder()).forEach { Files.deleteIfExists(it) }
|
||||
}
|
||||
}
|
||||
}
|
||||
@Test fun warmSteamAndExactlyExpectedFirstPartyColdLaunchOnly() {
|
||||
val probe = FrameAcquireWorkerProbe
|
||||
val script = "/usr/local/bin/droiddeck-session"
|
||||
val args = listOf("gamescope", "--backend", "wayland", "--expose-wayland", "-f",
|
||||
"-W", "1280", "-H", "720", "-w", "1280", "-h", "720", "--", script, "steam")
|
||||
val url = com.droiddeck.launcher.frontend.GameLaunchLink.steamUrl("3902570")
|
||||
fun valid(actual: List<String>, expected: String?) = probe.exactGamescopeArgs(actual, expected) { it == script }
|
||||
|
||||
assertTrue(probe.permittedLaunch(null, false))
|
||||
assertFalse(probe.permittedLaunch(null, true))
|
||||
assertTrue(probe.permittedLaunch(url, true))
|
||||
assertFalse(probe.permittedLaunch(url, false))
|
||||
assertTrue(valid(args, null))
|
||||
assertTrue(valid(args + url, url))
|
||||
assertFalse(valid(args + url, null))
|
||||
assertFalse(valid(args, url))
|
||||
assertFalse(valid(args + "steam://rungameid/3902571", url))
|
||||
assertFalse(valid(args + listOf(url, ""), url))
|
||||
assertFalse(valid(args + listOf(url, "--version"), url))
|
||||
assertFalse(valid(args + listOf(url, url), url))
|
||||
assertFalse(valid(args.dropLast(2) + listOf("/tmp/droiddeck-session", "steam", url), url))
|
||||
for (bad in listOf("steam://open/library", "steam://run/3902570", "Steam://rungameid/3902570",
|
||||
"steam://rungameid/03902570", "$url/", "$url?x=1", "$url#x", "$url%20",
|
||||
"$url --version", "steam://rungameid/18446744073709551616", "https://example.test/")) {
|
||||
assertFalse(probe.permittedLaunch(bad, true))
|
||||
assertFalse(valid(args + bad, bad))
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun selfStatAndFixedBinderReceiptRejectWrongWorkerAndExtraBytes() {
|
||||
val probe = FrameAcquireWorkerProbe
|
||||
val fields = (1..18).joinToString(" ")
|
||||
fun stat(pid: Int, ticks: String) = "$pid (guest )worker) S $fields $ticks 123\n"
|
||||
assertTrue(probe.parseSelfStat(stat(400, "125"), 400) == 125L)
|
||||
for (bad in listOf(stat(401, "125"), stat(400, "0"), stat(400, "-1"),
|
||||
stat(400, "1x"), stat(400, "9223372036854775808"), "400 (guest)")) {
|
||||
assertTrue(probe.parseSelfStat(bad, 400) == 0L)
|
||||
}
|
||||
val size = probe.RECEIPT_BYTES
|
||||
assertTrue(probe.validReceipt(400, 400, 125L, size) == 125L)
|
||||
assertTrue(probe.validReceipt(400, 401, 125L, size) == 0L)
|
||||
assertTrue(probe.validReceipt(1, 1, 125L, size) == 0L)
|
||||
assertTrue(probe.validReceipt(400, 400, 0L, size) == 0L)
|
||||
assertTrue(probe.validReceipt(400, 400, -1L, size) == 0L)
|
||||
assertTrue(probe.validReceipt(400, 400, 125L, size - 4) == 0L)
|
||||
assertTrue(probe.validReceipt(400, 400, 125L, size + 4) == 0L)
|
||||
}
|
||||
|
||||
@Test fun anyCustomOrAgentEnvironmentDisablesTheProductionTicket() {
|
||||
val probe = FrameAcquireWorkerProbe
|
||||
assertTrue(probe.validEnvironment(emptyList(), emptyList()))
|
||||
assertFalse(probe.validEnvironment(listOf("PATH=/opt/droiddeck-agent/bin"), emptyList()))
|
||||
assertFalse(probe.validEnvironment(emptyList(), listOf("LD_PRELOAD=/tmp/custom.so")))
|
||||
assertFalse(probe.validEnvironment(listOf("DD_THOR_WORKER_ACQUIRE_TEST=1"), emptyList()))
|
||||
}
|
||||
|
||||
}
|
||||
@@ -15,4 +15,19 @@ class WebCookiesTest {
|
||||
assertTrue(lines.none { it.startsWith("galaxy-login-al=c") })
|
||||
assertEquals(emptyList<String>(), WebCookies.expired(null, GogAuth.COOKIE_DOMAIN, listOf("/"), "login.gog.com"))
|
||||
}
|
||||
|
||||
@Test fun cookiesScopedUnderTheSignInPathAreExpiredAtThatPath() {
|
||||
val paths = WebCookies.scopes("https://accounts.ea.com/connect/auth", listOf("/"))
|
||||
assertEquals(listOf("/", "/connect", "/connect/auth"), paths)
|
||||
val lines = WebCookies.expired("sid=a; remid=b", ".ea.com", paths, "accounts.ea.com")
|
||||
assertTrue(lines.contains("sid=; Max-Age=0; Path=/connect; Secure"))
|
||||
assertTrue(lines.contains("remid=; Max-Age=0; Path=/connect; Secure; Domain=accounts.ea.com"))
|
||||
assertEquals(listOf("/p", "/", "/p/juno", "/p/juno/login"), WebCookies.scopes("https://signin.ea.com/p/juno/login", listOf("/p", "/")))
|
||||
}
|
||||
|
||||
@Test fun rootSignInUrlsKeepOnlyTheGivenPaths() {
|
||||
assertEquals(listOf("/"), WebCookies.scopes("https://login.gog.com/", listOf("/")))
|
||||
assertEquals(listOf("/"), WebCookies.scopes("https://connect.ubisoft.com", listOf("/")))
|
||||
assertEquals(listOf("/", "/id", "/id/login"), WebCookies.scopes("https://www.epicgames.com/id/login", listOf("/", "/id")))
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,37 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Test
|
||||
|
||||
class AgentReplyTest {
|
||||
@Test
|
||||
fun anImageOnItsOwnLineSplitsTheReply() {
|
||||
val parts = replyParts("Here it is:\n\n\n\nWant changes?")
|
||||
assertEquals(
|
||||
listOf(
|
||||
ReplyPart.Prose("Here it is:"),
|
||||
ReplyPart.Picture("Proposed Updates tab", "/tmp/updates.png"),
|
||||
ReplyPart.Prose("\nWant changes?"),
|
||||
),
|
||||
parts,
|
||||
)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun fileUrlsAndAngleBracketsNameTheSamePath() {
|
||||
assertEquals(listOf(ReplyPart.Picture("", "/root/a b.png")), replyParts(""))
|
||||
assertEquals(listOf(ReplyPart.Picture("chart", "/root/chart (1).png")), replyParts(".png>)"))
|
||||
}
|
||||
|
||||
@Test
|
||||
fun imagesInCodeInlineOrRemoteStayText() {
|
||||
val fenced = "```\n\n```"
|
||||
assertEquals(listOf(ReplyPart.Prose(fenced)), replyParts(fenced))
|
||||
val inline = "See  here"
|
||||
assertEquals(listOf(ReplyPart.Prose(inline)), replyParts(inline))
|
||||
val nested = "````\n```\n\n```python\n\n````"
|
||||
assertEquals(listOf(ReplyPart.Prose(nested)), replyParts(nested))
|
||||
val remote = ""
|
||||
assertEquals(listOf(ReplyPart.Prose(remote)), replyParts(remote))
|
||||
}
|
||||
}
|
||||
@@ -300,7 +300,7 @@ class CurseLinkTabTest {
|
||||
onPlay = {}, onPlayDesktopUi = {}, onSteamGame = {}, onDesktop = {}, onEmulator = {},
|
||||
onRom = {}, onResume = {}, onSteamSettings = {}, onDesktopSettings = {},
|
||||
onInstallPackage = {}, onRemovePackage = {}, onRuntime = {}, onFrameGenPick = {},
|
||||
onImportLossless = {}, onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onRoms = {}, onFiles = {}, onLogs = {}, onOffline = {},
|
||||
|
||||
onSetPhantomProcessLimit = { _, _ -> },
|
||||
|
||||
@@ -85,7 +85,7 @@ class DesktopUninstallTest {
|
||||
), FrontEndActions(
|
||||
onPlay = {}, onPlayDesktopUi = {}, onSteamGame = {}, onDesktop = {}, onEmulator = {}, onRom = {}, onResume = {},
|
||||
onSteamSettings = {}, onDesktopSettings = {}, onInstallPackage = {}, onRemovePackage = {},
|
||||
onRuntime = {}, onFrameGenPick = {}, onImportLossless = {}, onProtons = {}, onComponents = {},
|
||||
onRuntime = {}, onFrameGenPick = {}, onProtons = {}, onComponents = {},
|
||||
onPerformance = {}, onRoms = {}, onFiles = {}, onLogs = {}, onOffline = {},
|
||||
|
||||
onSetPhantomProcessLimit = { _, _ -> }, onRemoveDesktop = { removals++ },
|
||||
|
||||
@@ -65,7 +65,7 @@ class FlathubFocusTest {
|
||||
onPlay = {}, onPlayDesktopUi = {}, onSteamGame = {}, onDesktop = {}, onEmulator = {},
|
||||
onRom = {}, onResume = {}, onSteamSettings = {}, onDesktopSettings = {},
|
||||
onInstallPackage = {}, onRemovePackage = {}, onRuntime = {}, onFrameGenPick = {},
|
||||
onImportLossless = {}, onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onRoms = {}, onFiles = {}, onLogs = {}, onOffline = {},
|
||||
|
||||
onSetPhantomProcessLimit = { _, _ -> },
|
||||
|
||||
@@ -56,7 +56,7 @@ class GamesClientTagTest {
|
||||
onPlay = {}, onPlaySteamVr = {}, onPlayDesktopUi = {}, onSteamGame = {}, onDesktop = {}, onEmulator = {},
|
||||
onRom = {}, onResume = {}, onSteamSettings = {}, onDesktopSettings = {},
|
||||
onInstallPackage = {}, onRemovePackage = {}, onRuntime = {}, onFrameGenPick = {},
|
||||
onImportLossless = {}, onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onRoms = {}, onFiles = {}, onLogs = {}, onOffline = {},
|
||||
|
||||
onSetPhantomProcessLimit = { _, _ -> },
|
||||
|
||||
@@ -165,7 +165,7 @@ class GlobalGlassesSettingsTest {
|
||||
onPlay = {}, onPlayDesktopUi = {}, onSteamGame = {}, onDesktop = {}, onEmulator = {},
|
||||
onRom = {}, onResume = {}, onSteamSettings = {}, onDesktopSettings = {},
|
||||
onInstallPackage = {}, onRemovePackage = {}, onRuntime = {}, onFrameGenPick = {},
|
||||
onImportLossless = {}, onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onRoms = {}, onFiles = {}, onLogs = {}, onOffline = {},
|
||||
|
||||
onSetPhantomProcessLimit = { _, _ -> },
|
||||
|
||||
@@ -1,19 +1,37 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import org.junit.Assert.assertEquals
|
||||
import org.junit.Assert.assertFalse
|
||||
import org.junit.Assert.assertTrue
|
||||
import org.junit.Test
|
||||
|
||||
class IdleFramesTest {
|
||||
@Test
|
||||
fun idleLoopsDrawThirtyFramesASecondAndShareEachOne() {
|
||||
val start = 5_000_000_000L
|
||||
val frame = 8_333_333L
|
||||
val drawn = (0 until 120).count { IdleFrames.due(start + it * frame) }
|
||||
assertEquals(30, drawn)
|
||||
private val start = 5_000_000_000L
|
||||
|
||||
val later = start + 1_000_000_000L
|
||||
assertEquals(listOf(true, true, true), List(3) { IdleFrames.due(later) })
|
||||
assertEquals(listOf(false, false), List(2) { IdleFrames.due(later + frame) })
|
||||
assertEquals(listOf(true, true), List(2) { IdleFrames.due(later + 4 * frame) })
|
||||
@Test
|
||||
fun idleLoopsDrawAtSixtyOrThePanelRateIfLower() {
|
||||
for (hz in listOf(30, 60, 90, 120, 144)) {
|
||||
val gate = IdleFrameGate()
|
||||
val drawn = (0 until 10 * hz).count { gate.due(start + it * 1_000_000_000L / hz) }
|
||||
assertEquals("panel at $hz Hz", 10 * minOf(hz, 60), drawn)
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun idleLoopsShareTheDecisionForEachVsync() {
|
||||
val gate = IdleFrameGate()
|
||||
assertEquals(List(3) { true }, List(3) { gate.due(start) })
|
||||
assertEquals(List(2) { false }, List(2) { gate.due(start + 8_333_333) })
|
||||
assertEquals(List(2) { true }, List(2) { gate.due(start + 16_666_666) })
|
||||
}
|
||||
|
||||
@Test
|
||||
fun aLongPauseDoesNotCauseCatchUpDraws() {
|
||||
val gate = IdleFrameGate()
|
||||
assertTrue(gate.due(start))
|
||||
val resumed = start + 1_000_000_000L
|
||||
assertTrue(gate.due(resumed))
|
||||
assertFalse(gate.due(resumed + 8_333_333))
|
||||
assertTrue(gate.due(resumed + 16_666_666))
|
||||
}
|
||||
}
|
||||
@@ -98,7 +98,7 @@ class InputUiLayoutTest {
|
||||
onPlay = {}, onPlayDesktopUi = {}, onSteamGame = {}, onDesktop = {}, onEmulator = {},
|
||||
onRom = {}, onResume = {}, onSteamSettings = {}, onDesktopSettings = {},
|
||||
onInstallPackage = {}, onRemovePackage = {}, onRuntime = {}, onFrameGenPick = {},
|
||||
onImportLossless = {}, onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onRoms = {}, onFiles = {}, onLogs = {}, onOffline = {},
|
||||
|
||||
onSetPhantomProcessLimit = { _, _ -> }, controller = ControllerActions({}),
|
||||
|
||||
@@ -63,7 +63,7 @@ class LaunchSettingsComponentsTest {
|
||||
onPlay = {}, onPlayDesktopUi = {}, onSteamGame = {}, onDesktop = {}, onEmulator = {},
|
||||
onRom = {}, onResume = {}, onSteamSettings = {}, onDesktopSettings = {},
|
||||
onInstallPackage = {}, onRemovePackage = {}, onRuntime = {}, onFrameGenPick = {},
|
||||
onImportLossless = {}, onProtons = {}, onComponents = { defaultOpens++ },
|
||||
onProtons = {}, onComponents = { defaultOpens++ },
|
||||
onGameComponents = { openedGame = it }, onPerformance = {},
|
||||
onRoms = {}, onFiles = {}, onLogs = {}, onOffline = {},
|
||||
|
||||
|
||||
@@ -249,7 +249,7 @@ class LibraryVisibilityTest {
|
||||
onPlay = {}, onPlayDesktopUi = {}, onSteamGame = {}, onDesktop = {}, onEmulator = {},
|
||||
onRom = {}, onResume = {}, onSteamSettings = {}, onDesktopSettings = {},
|
||||
onInstallPackage = {}, onRemovePackage = {}, onRuntime = {}, onFrameGenPick = {},
|
||||
onImportLossless = {}, onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onRoms = {}, onFiles = {}, onLogs = {}, onOffline = {},
|
||||
|
||||
onSetPhantomProcessLimit = { _, _ -> },
|
||||
|
||||
@@ -286,7 +286,7 @@ class NavTabsTest {
|
||||
private fun actions() = FrontEndActions(
|
||||
onPlay = {}, onPlayDesktopUi = {}, onSteamGame = {}, onDesktop = {}, onEmulator = {}, onRom = {}, onResume = {},
|
||||
onSteamSettings = {}, onDesktopSettings = {}, onInstallPackage = {}, onRemovePackage = {},
|
||||
onRuntime = {}, onFrameGenPick = {}, onImportLossless = {}, onProtons = {}, onComponents = {},
|
||||
onRuntime = {}, onFrameGenPick = {}, onProtons = {}, onComponents = {},
|
||||
onPerformance = {}, onRoms = {}, onFiles = {}, onLogs = {}, onOffline = {},
|
||||
|
||||
onSetPhantomProcessLimit = { _, _ -> }, onRemoveDesktop = {},
|
||||
|
||||
@@ -92,7 +92,7 @@ class NavigationSelectionTest {
|
||||
onPlay = {}, onPlayDesktopUi = {}, onSteamGame = {}, onDesktop = {}, onEmulator = {},
|
||||
onRom = {}, onResume = {}, onSteamSettings = {}, onDesktopSettings = {},
|
||||
onInstallPackage = {}, onRemovePackage = {}, onRuntime = {}, onFrameGenPick = {},
|
||||
onImportLossless = {}, onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onRoms = {}, onFiles = {}, onLogs = {}, onOffline = {},
|
||||
|
||||
onSetPhantomProcessLimit = { _, _ -> },
|
||||
|
||||
@@ -95,7 +95,7 @@ class PenSettingsGroupTest {
|
||||
suspendPolicy = "auto", backActionsInverted = false,
|
||||
touchMode = "auto", touchAuto = "touchpad", pen = pen, onPen = onPen, fexPreset = "default",
|
||||
secondScreenMode = SecondScreenMode.NONE, secondScreenDisplays = emptyList(), selectedSecondScreenDisplay = 1,
|
||||
onHud = {}, onFrameGenPick = {}, onImportLossless = {}, onKeyboard = {}, onHardwareKeyboard = {},
|
||||
onHud = {}, onFrameGenPick = {}, onKeyboard = {}, onHardwareKeyboard = {},
|
||||
onSteamMenu = null, onQam = null, onOsc = {}, onSuspendPolicy = {}, onBackActionsInverted = {},
|
||||
onTouch = {}, onFexPreset = {}, onSecondScreenMode = {}, onSecondScreenDisplay = {},
|
||||
onLaunchAndroidApp = { _, _ -> }, onBackground = {}, onShareLogs = {}, onStop = {}, onClose = {})
|
||||
|
||||
@@ -150,7 +150,7 @@ class PortraitLayoutTest {
|
||||
onPlay = {}, onPlayDesktopUi = {}, onSteamGame = {}, onDesktop = {}, onEmulator = {},
|
||||
onRom = {}, onResume = {}, onSteamSettings = {}, onDesktopSettings = {},
|
||||
onInstallPackage = {}, onRemovePackage = {}, onRuntime = {}, onFrameGenPick = {},
|
||||
onImportLossless = {}, onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onRoms = {}, onFiles = {}, onLogs = {}, onOffline = {},
|
||||
|
||||
onSetPhantomProcessLimit = { _, _ -> },
|
||||
|
||||
@@ -297,9 +297,23 @@ class SecondScreenBarTest {
|
||||
} finally { panel()?.closeControls() }
|
||||
}
|
||||
|
||||
@Test fun unfoldedControlsGetTheSessionBar() {
|
||||
SessionState.mode = SessionService.MODE_STEAM
|
||||
val activity = Robolectric.buildActivity(SessionActivity::class.java).get()
|
||||
assertTrue(ReflectionHelpers.callInstanceMethod<View>(activity, "unfoldedBar") is ComposeView)
|
||||
@Test fun unfoldedPadHasSteamQuickAccessAndDrawerWithoutTheSecondScreenBar() {
|
||||
val actions = mutableListOf<String>()
|
||||
compose.setContent { DroidDeckTheme { PadKeys(true, { actions += "menu" }, { actions += "steam" }, { actions += "qam" }) } }
|
||||
compose.onNodeWithTag("bottom-bar-tabs").assertDoesNotExist()
|
||||
compose.onNodeWithTag("bottom-bar-close").assertDoesNotExist()
|
||||
compose.onNodeWithTag("bottom-bar-steam").assertIsDisplayed().performClick()
|
||||
compose.onNodeWithTag("bottom-bar-menu").assertIsDisplayed().performClick()
|
||||
compose.onNodeWithTag("bottom-bar-qam").assertIsDisplayed().performClick()
|
||||
assertEquals(listOf("steam", "menu", "qam"), actions)
|
||||
}
|
||||
|
||||
@Test fun unfoldedPadKeepsTheDrawerReachableOutsideSteam() {
|
||||
var drawerOpened = false
|
||||
compose.setContent { DroidDeckTheme { PadKeys(false, { drawerOpened = true }, {}, {}) } }
|
||||
compose.onNodeWithTag("bottom-bar-steam").assertDoesNotExist()
|
||||
compose.onNodeWithTag("bottom-bar-qam").assertDoesNotExist()
|
||||
compose.onNodeWithTag("bottom-bar-menu").assertIsDisplayed().performClick()
|
||||
assertTrue(drawerOpened)
|
||||
}
|
||||
}
|
||||
@@ -4,20 +4,22 @@ import org.junit.Assert.*
|
||||
import org.junit.Test
|
||||
|
||||
class SessionDrawerPageTest {
|
||||
@Test fun navigationRunsControllerPerformanceDisplayEffectsGameVrSession() {
|
||||
@Test fun navigationRunsControllerPerformanceFrameGenDisplayEffectsGameSessionMore() {
|
||||
val pages = sessionDrawerPages(hasAgent = false)
|
||||
assertEquals(DrawerPages.arrange(emptyList()).strip(), pages.strip())
|
||||
assertEquals(
|
||||
listOf(SessionDrawerPage.CONTROLLER, SessionDrawerPage.HUD, SessionDrawerPage.FRAMEGEN,
|
||||
SessionDrawerPage.DISPLAY, SessionDrawerPage.EFFECTS, SessionDrawerPage.GAMES,
|
||||
SessionDrawerPage.VR, SessionDrawerPage.SESSION, SessionDrawerPage.MORE),
|
||||
SessionDrawerPage.SESSION, SessionDrawerPage.MORE),
|
||||
pages.strip(),
|
||||
)
|
||||
assertEquals(SessionDrawerPage.MORE, pages.step(SessionDrawerPage.CONTROLLER, -1))
|
||||
assertEquals(SessionDrawerPage.MORE, pages.strip().step(SessionDrawerPage.CONTROLLER, -1))
|
||||
}
|
||||
|
||||
@Test fun achievementsAndTheAgentStartInsideMore() {
|
||||
@Test fun vrAchievementsAndTheAgentStartInsideMore() {
|
||||
val pages = sessionDrawerPages(hasAchievements = true, hasAgent = true)
|
||||
assertEquals(listOf(SessionDrawerPage.ACHIEVEMENTS, SessionDrawerPage.AGENT), pages.inMore())
|
||||
assertEquals(listOf(SessionDrawerPage.VR, SessionDrawerPage.ACHIEVEMENTS, SessionDrawerPage.AGENT), pages.inMore())
|
||||
assertEquals(SessionDrawerPage.MORE, pages.tabFor(SessionDrawerPage.VR))
|
||||
assertEquals(SessionDrawerPage.MORE, pages.tabFor(SessionDrawerPage.ACHIEVEMENTS))
|
||||
assertEquals(SessionDrawerPage.GAMES, pages.tabFor(SessionDrawerPage.GAMES))
|
||||
val strip = pages.strip()
|
||||
@@ -27,7 +29,7 @@ class SessionDrawerPageTest {
|
||||
@Test fun achievementsAreOfferedOnlyForAGameThatHasThem() {
|
||||
assertFalse(SessionDrawerPage.ACHIEVEMENTS in sessionDrawerPages(hasAchievements = false, hasAgent = false))
|
||||
assertFalse(SessionDrawerPage.AGENT in sessionDrawerPages(hasAgent = false))
|
||||
assertTrue(sessionDrawerPages(hasAgent = false).inMore().isEmpty())
|
||||
assertEquals(listOf(SessionDrawerPage.VR), sessionDrawerPages(hasAgent = false).inMore())
|
||||
}
|
||||
|
||||
@Test fun anOlderSavedOrderKeepsItsPagesAndGetsAMoreTabAfterSession() {
|
||||
@@ -37,6 +39,15 @@ class SessionDrawerPageTest {
|
||||
assertEquals(SessionDrawerPage.MORE, out[out.indexOf(SessionDrawerPage.SESSION) + 1])
|
||||
assertEquals(listOf(SessionDrawerPage.ACHIEVEMENTS), out.inMore())
|
||||
assertTrue(SessionDrawerPage.AGENT in out.strip())
|
||||
assertTrue(SessionDrawerPage.VR in out.strip())
|
||||
}
|
||||
|
||||
@Test fun aSavedLayoutCanKeepVrOnTheTabStrip() {
|
||||
val saved = listOf("CONTROLLER", "HUD", "VR", "FRAMEGEN", "DISPLAY", "EFFECTS",
|
||||
"GAMES", "SESSION", "MORE", "ACHIEVEMENTS", "AGENT")
|
||||
val out = DrawerPages.arrange(saved)
|
||||
assertEquals(saved, out.map { it.name })
|
||||
assertEquals(SessionDrawerPage.VR, out.tabFor(SessionDrawerPage.VR))
|
||||
}
|
||||
|
||||
@Test fun sessionCanBeKeptInsideMore() {
|
||||
|
||||
@@ -416,7 +416,7 @@ class SessionSecondScreenTest {
|
||||
suspendPolicy = "auto", backActionsInverted = false,
|
||||
touchMode = "auto", touchAuto = "trackpad", fexPreset = "default",
|
||||
secondScreenMode = mode, secondScreenDisplays = displays, selectedSecondScreenDisplay = 1, gameSwapAvailable = gameSwap,
|
||||
onHud = {}, onFrameGenPick = {}, onImportLossless = {}, onKeyboard = {}, onHardwareKeyboard = {},
|
||||
onHud = {}, onFrameGenPick = {}, onKeyboard = {}, onHardwareKeyboard = {},
|
||||
onSteamMenu = null, onQam = null, onOsc = {}, onSuspendPolicy = {}, onBackActionsInverted = {},
|
||||
onTouch = {}, onFexPreset = {}, onSecondScreenMode = select, onSecondScreenDisplay = {},
|
||||
onLaunchAndroidApp = { _, _ -> }, onBackground = {}, onShareLogs = {}, onStop = {}, onClose = onClose)
|
||||
|
||||
@@ -99,7 +99,7 @@ class SteamHomeHeadsetTest {
|
||||
onPlay = {}, onPlaySteamVr = { vrStarts++ }, onPlayDesktopUi = {}, onSteamGame = {}, onDesktop = {}, onEmulator = {},
|
||||
onRom = {}, onResume = {}, onSteamSettings = {}, onDesktopSettings = {},
|
||||
onInstallPackage = {}, onRemovePackage = {}, onRuntime = {}, onFrameGenPick = {},
|
||||
onImportLossless = {}, onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onProtons = {}, onComponents = {}, onPerformance = {},
|
||||
onRoms = {}, onFiles = {}, onLogs = {}, onOffline = {},
|
||||
|
||||
onSetPhantomProcessLimit = { _, _ -> },
|
||||
|
||||
Loaded 100 of 120 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user