Merge remote-tracking branch 'origin/main' into frozen-session-disk-spill

This commit is contained in:
Kurt Himebauch committed 2026-12-05 04:08:34 -05:00
commit 088e9994a0
104 files changed
+15184 -317

No files matched your search

+2
View File
@@ -40,6 +40,8 @@
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.MANAGE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />
<uses-permission android:name="android.permission.READ_MEDIA_VISUAL_USER_SELECTED" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.POST_NOTIFICATIONS" />
<uses-permission android:name="android.permission.HIGH_SAMPLING_RATE_SENSORS" />
+24 -10
View File
@@ -329,16 +329,28 @@ static constexpr int kWatchedFds = 1 << 16;
static constexpr int kWatchedBits = sizeof(unsigned long) * 8;
static std::atomic<unsigned long> watched_fds[kWatchedFds / kWatchedBits];
static std::atomic<bool> watched_beyond{false};
static std::atomic<int> watched_count{0};
static void watch_fd(int fd) {
if (fd < 0) return;
if (fd >= kWatchedFds) watched_beyond.store(true, std::memory_order_release);
else watched_fds[fd / kWatchedBits].fetch_or(1UL << (fd % kWatchedBits), std::memory_order_release);
if (fd >= kWatchedFds) {
watched_beyond.store(true, std::memory_order_release);
return;
}
const unsigned long bit = 1UL << (fd % kWatchedBits);
if (!(watched_fds[fd / kWatchedBits].fetch_or(bit, std::memory_order_acq_rel) & bit))
watched_count.fetch_add(1, std::memory_order_acq_rel);
}
static void unwatch_fd(int fd) {
if (fd >= 0 && fd < kWatchedFds)
watched_fds[fd / kWatchedBits].fetch_and(~(1UL << (fd % kWatchedBits)), std::memory_order_release);
if (fd < 0 || fd >= kWatchedFds) return;
const unsigned long bit = 1UL << (fd % kWatchedBits);
if (watched_fds[fd / kWatchedBits].fetch_and(~bit, std::memory_order_acq_rel) & bit)
watched_count.fetch_sub(1, std::memory_order_acq_rel);
}
static bool any_watched() {
return watched_count.load(std::memory_order_acquire) > 0 || watched_beyond.load(std::memory_order_acquire);
}
static bool watched(int fd) {
@@ -4269,7 +4281,7 @@ static int poll_fake(struct pollfd *fds, nfds_t nfds, int timeout,
const auto my_poll = next_symbol<decltype(&::poll)>(Next::poll);
const auto my_ppoll = next_symbol<decltype(&::ppoll)>(Next::ppoll);
nfds_t first = 0;
nfds_t first = any_watched() ? 0 : nfds;
while (first < nfds && !watched(fds[first].fd)) first++;
bool has_fake_fds = false;
std::vector<struct pollfd> real_fds;
@@ -4372,12 +4384,12 @@ EXPORT int poll(struct pollfd *fds, nfds_t nfds, int timeout) {
EXPORT int ppoll(struct pollfd *fds, nfds_t nfds,
const struct timespec *timeout, const sigset_t *sigmask) {
const auto my_ppoll = next_symbol<decltype(&::ppoll)>(Next::ppoll);
if (timeout && (timeout->tv_sec < 0 || timeout->tv_nsec < 0 || timeout->tv_nsec >= 1000000000L)) {
errno = EINVAL;
return -1;
}
for (nfds_t i = 0; i < nfds; ++i) {
for (nfds_t i = 0; any_watched() && i < nfds; ++i) {
if (!is_fake_input_fd(fds[i].fd)) continue;
if (timeout && (timeout->tv_sec < 0 || timeout->tv_nsec < 0 || timeout->tv_nsec >= 1000000000L)) {
errno = EINVAL;
return -1;
}
if (!sigmask)
return poll_fake(fds, nfds, static_cast<int>(timespec_to_ms(timeout)), nullptr);
sigset_t all_signals, original_mask;
@@ -4410,6 +4422,8 @@ EXPORT int __ppoll_chk(struct pollfd *fds, nfds_t nfds, const struct timespec *t
EXPORT int select(int nfds, fd_set *readfds, fd_set *writefds,
fd_set *exceptfds, struct timeval *timeout) {
const auto my_select = next_symbol<decltype(&::select)>(Next::select);
if (!any_watched())
return my_select ? my_select(nfds, readfds, writefds, exceptfds, timeout) : -1;
fd_set original_readfds;
fd_set original_writefds;
+20 -4
View File
@@ -343,6 +343,7 @@ volatile int g_hide_shell;
volatile int g_zero_copy;
static int g_zero_copy_paused;
static int g_mirror_capture;
extern volatile int g_display_buffer_driver;
extern void droiddeck_on_overlay_planes(int planes);
static int g_overlay_planes_told = -1;
@@ -2961,7 +2962,7 @@ static void hdr_note_route(int route, const struct hdr_scene *hs) {
static int said = -1, said_tm = -1;
static const char *said_why;
const int tm = route != 0 && !droiddeck_color_output();
if (route == said && tm == said_tm && (route != 1 || hs->why == said_why)) return;
if (route == said && tm == said_tm && (route < 1 || route > 2 || hs->why == said_why)) return;
int was = said;
said = route; said_why = hs->why; said_tm = tm;
char name[160] = "the HDR game";
@@ -2978,6 +2979,10 @@ static void hdr_note_route(int route, const struct hdr_scene *hs) {
"BT2020_PQ", name, hs->why ? hs->why : "?", droiddeck_color_sdr_white());
break;
case 2:
if (g_mirror_capture) {
droiddeck_log("color", "Mirror: %s is composed through the screen swapchain", name);
break;
}
if (tm)
droiddeck_log("color", "HDR with frame generation for %s, HDR output switched off: the scene is tone-mapped to "
"SDR and presented through an SDR screen swapchain", name);
@@ -3198,6 +3203,11 @@ static void render_scene(void) {
const int cardboard = vkp_cardboard_active();
struct hdr_scene hs;
int hdr_route = hdr_plan(&dl, w, h, fx_on, framegen, &hs);
/* Mirror's PixelCopy cannot see the separate game layer. Keep unimportable frames visible on top. */
if (g_mirror_capture && hdr_route != 3 && hs.n_hdr > 0) {
hdr_route = 2;
hs.why = "Mirror needs the screen swapchain";
}
const char *hdr_copy = NULL;
if (droiddeck_color_hdr_open()) {
hdr_note_route(hdr_route, &hs);
@@ -3263,16 +3273,16 @@ static void render_scene(void) {
else if (rendered && how == 2) droiddeck_color_frame_shown(hs.color, DROIDDECK_HDR_TONEMAPPED, 0);
else if (rendered) hdr_copy = "the HDR composition pass is unavailable on this driver";
}
if (hdr_route == 0 && vkp_quest_layer_presentation() && !framegen && !cardboard && !cursor_on &&
if (hdr_route == 0 && !g_mirror_capture && vkp_quest_layer_presentation() && !framegen && !cardboard && !cursor_on &&
!ahb_only) {
settle_unwaited();
rendered = vkp_render(w, h, dl.d, dl.n) == 0;
} else if (hdr_route == 0 || hdr_route == 3) {
const int pass_on = fx_on || framegen;
tell_overlay_planes();
const int fg_layer = framegen && hdr_route == 0 && framegen_fits_layer();
const int fg_layer = framegen && !g_mirror_capture && hdr_route == 0 && framegen_fits_layer();
g_framegen_layer = fg_layer;
int li = (g_zero_copy && (!framegen || fg_layer) && !bfi && !cardboard && !cursor_on) ? layer_candidate(&dl, w, h) : -1;
int li = (g_zero_copy && !g_mirror_capture && (!framegen || fg_layer) && !bfi && !cardboard && !cursor_on) ? layer_candidate(&dl, w, h) : -1;
int over = li >= 0 ? dl.n - 1 - li : 0;
const int fx_blocks = (li >= 0 && fx_on && over > 0);
if (fx_blocks) { li = -1; over = 0; }
@@ -5002,6 +5012,12 @@ const char *droiddeck_client_name(struct wl_client *client) { return client_name
struct wl_display *droiddeck_get_display(void) { return g_display; }
void droiddeck_request_redraw(void) { schedule_render(); }
void droiddeck_set_mirror_capture(int on) {
if (g_mirror_capture == on) return;
g_mirror_capture = on;
schedule_render();
}
struct wl_resource *droiddeck_ime_target(void) {
struct surface *s;
if (g_ime_click && g_ime_click->mapped) return g_ime_click->resource;
@@ -11,7 +11,7 @@
#include "ahb_swapchain.h"
#include "droiddeck_color.h"
enum host_kind { HOST_CLIPBOARD = 1, HOST_TEXT_COMMIT, HOST_TEXT_PREEDIT, HOST_TEXT_DELETE, HOST_ZERO_COPY, HOST_HDR_OUTPUT, HOST_KEY, HOST_SELECT_GAME_FIELD };
enum host_kind { HOST_CLIPBOARD = 1, HOST_TEXT_COMMIT, HOST_TEXT_PREEDIT, HOST_TEXT_DELETE, HOST_ZERO_COPY, HOST_HDR_OUTPUT, HOST_KEY, HOST_SELECT_GAME_FIELD, HOST_MIRROR_CAPTURE };
struct host_msg {
enum host_kind kind;
@@ -91,6 +91,9 @@ void droiddeck_host_text_delete(int before, int after) {
void droiddeck_host_zero_copy(int on, int live) {
host_post(HOST_ZERO_COPY, NULL, 0, on, live);
}
void droiddeck_host_mirror_capture(int on) {
host_post(HOST_MIRROR_CAPTURE, NULL, 0, on, 0);
}
void droiddeck_host_hdr_output(int on) {
host_post(HOST_HDR_OUTPUT, NULL, 0, on, 0);
}
@@ -271,6 +274,9 @@ static int on_wake(int fd, uint32_t mask, void *data) {
case HOST_ZERO_COPY:
ahb_swapchain_set_mode(m->a, m->b);
break;
case HOST_MIRROR_CAPTURE:
droiddeck_set_mirror_capture(m->a);
break;
case HOST_HDR_OUTPUT:
droiddeck_color_set_output(m->a);
break;
@@ -29,6 +29,8 @@ void droiddeck_host_text_commit_and_submit(const char *utf8, int len);
void droiddeck_host_text_preedit(const char *utf8, int len, int cursor_begin, int cursor_end);
void droiddeck_host_text_delete(int before, int after);
void droiddeck_host_zero_copy(int on, int live);
void droiddeck_host_mirror_capture(int on);
void droiddeck_set_mirror_capture(int on);
void droiddeck_host_hdr_output(int on);
void droiddeck_host_key(int evdev, int state);
void droiddeck_host_select_game_field(int copy);
@@ -461,6 +461,11 @@ Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSetZeroCopy(JNIEnv *
__android_log_print(ANDROID_LOG_INFO, TAG, "zero-copy layer mode %s%s", on ? "on" : "off", live ? " (live)" : "");
}
JNIEXPORT void JNICALL
Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSetMirrorCapture(JNIEnv *env, jclass clazz, jboolean on) {
droiddeck_host_mirror_capture(on ? 1 : 0);
}
JNIEXPORT void JNICALL
Java_com_droiddeck_launcher_wayland_WaylandCompositor_nativeSetDisplayBufferDriver(JNIEnv *env, jclass clazz, jboolean on) {
g_display_buffer_driver = on ? 1 : 0;
@@ -661,6 +661,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
private var effects by mutableStateOf(ScreenEffects.OFF)
private var observedScreenEffectsProfileId by mutableStateOf<String?>(null)
private var screenEffectsTarget by mutableStateOf(SCREEN_EFFECTS_TARGET_AUTO)
private var screenEffectsProfileRevision by mutableIntStateOf(0)
private var cardboard by mutableStateOf(Cardboard.OFF)
private var headTracker: HeadTracker? = null
private var steamVrStatus by mutableStateOf<SteamVr.Status?>(null)
@@ -1641,8 +1642,11 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
effects = effects,
screenEffectsTarget = screenEffectsTarget,
screenEffectsTargets = screenEffectsTargetOptions(),
screenEffectsCanDelete = screenEffectsProfileIdForTarget(screenEffectsTarget)?.let {
SessionPrefs.hasScreenEffectsOverride(this@SessionActivity, it)
screenEffectsCanDelete = screenEffectsProfileRevision.let {
screenEffectsProfileIdForTarget(screenEffectsTarget)?.let {
SessionPrefs.hasScreenEffectsOverride(this@SessionActivity, it) ||
SessionPrefs.hasScreenEffectsUpscalerOverride(this@SessionActivity, it)
}
} == true,
cardboard = cardboard,
cardboardSensor = hasRotationSensor,
@@ -1748,6 +1752,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
} else {
val profileId = screenEffectsProfileIdForTarget(target)
SessionPrefs.setScreenEffectsUpscaler(this@SessionActivity, profileId, m)
screenEffectsProfileRevision++
if (target == screenEffectsTarget) {
upscaler = m
@@ -1783,6 +1788,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
} else {
val profileId = screenEffectsProfileIdForTarget(target)
SessionPrefs.setScreenEffectsUpscaler(this@SessionActivity, profileId, m)
screenEffectsProfileRevision++
if (target == screenEffectsTarget) {
upscaler = m
if (screenEffectsUpscalerTargetAppliesToLiveOutput(target)) {
@@ -1829,7 +1835,22 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
val profileId = screenEffectsProfileIdForTarget(editorTarget)
SessionPrefs.setScreenEffects(this@SessionActivity, profileId, e)
effects = e
if (screenEffectsTargetAppliesToLiveOutput(editorTarget)) e.push(upscaler)
if (screenEffectsTargetAppliesToLiveOutput(editorTarget)) {
val upscalerAppliesToLiveOutput =
screenEffectsUpscalerTargetAppliesToLiveOutput(editorTarget)
val liveUpscaler = if (upscalerAppliesToLiveOutput) {
SessionPrefs.screenEffectsUpscaler(
this@SessionActivity,
screenEffectsProfileIdForTarget(editorTarget)
)
} else {
SessionPrefs.screenEffectsUpscaler(
this@SessionActivity,
currentScreenEffectsProfileId()
)
}
e.push(liveUpscaler)
}
}
}
},
@@ -2648,10 +2669,21 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
val targetUpscaler = SessionPrefs.screenEffectsUpscaler(this, profileId)
effects = targetEffects
upscaler = targetUpscaler
val upscalerAppliesToLiveOutput = screenEffectsUpscalerTargetAppliesToLiveOutput(target)
val liveUpscaler = if (upscalerAppliesToLiveOutput) {
targetUpscaler
} else {
SessionPrefs.screenEffectsUpscaler(this, currentScreenEffectsProfileId())
}
if (upscalerAppliesToLiveOutput) {
WaylandCompositor.nativeSetUpscaler(liveUpscaler)
}
if (screenEffectsTargetAppliesToLiveOutput(target)) {
WaylandCompositor.nativeSetUpscaler(targetUpscaler)
WaylandCompositor.nativeSetLookName(ScreenEffectLooks.match(targetEffects, targetUpscaler)?.name)
targetEffects.push(targetUpscaler)
WaylandCompositor.nativeSetLookName(ScreenEffectLooks.match(targetEffects, liveUpscaler)?.name)
targetEffects.push(liveUpscaler)
} else if (upscalerAppliesToLiveOutput) {
val liveEffects = SessionPrefs.screenEffects(this, currentScreenEffectsProfileId())
WaylandCompositor.nativeSetLookName(ScreenEffectLooks.match(liveEffects, liveUpscaler)?.name)
}
}
@@ -2664,6 +2696,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
private fun resetScreenEffectsTarget(target: String) {
if (target != screenEffectsTarget) return
SessionPrefs.resetScreenEffectsProfile(this, screenEffectsProfileIdForTarget(target))
screenEffectsProfileRevision++
syncScreenEffectsTarget(target)
}
@@ -2671,6 +2704,7 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
if (target != screenEffectsTarget) return
val profileId = screenEffectsProfileIdForTarget(target) ?: return
SessionPrefs.deleteScreenEffectsProfile(this, profileId)
screenEffectsProfileRevision++
syncScreenEffectsTarget(target)
}
@@ -6348,7 +6382,12 @@ class SessionActivity : ComponentActivity(), SurfaceHolder.Callback, com.droidde
}
private fun holdComposedOutput(hold: Boolean) {
val wasHeld = composedHolds > 0
composedHolds = (composedHolds + if (hold) 1 else -1).coerceAtLeast(0)
val held = composedHolds > 0
if (held == wasHeld) return
WaylandCompositor.nativeSetMirrorCapture(held)
// Importable HDR is redirected by the compositor hold. Keep its layer-only fallback available.
if (zeroCopyActive()) WaylandCompositor.nativeSetZeroCopy(composedOutputFree())
}
@@ -22,6 +22,12 @@ object AgentAttachments {
/** True while the file picker is open over a session: it answers the drawer's agent page, so the drawer must stay. */
@Volatile var picking = false
/** Launches a system screen that answers the agent page, keeping the drawer for it; the result callback clears [picking]. */
fun pick(launch: () -> Unit) {
picking = true
if (runCatching(launch).isFailure) picking = false
}
private const val NEW = "new"
private const val GUEST_DIR = "/root/.cache/droiddeck/attachments"
private val IMAGE = setOf("png", "jpg", "jpeg", "webp", "gif", "bmp")
@@ -38,14 +44,17 @@ object AgentAttachments {
val folder = chat ?: NEW
val dir = File(hostDir(app), folder).apply { mkdirs() }
return uris.mapNotNull { uri ->
var target: File? = null
runCatching {
val name = displayName(app, uri).replace(Regex("[^A-Za-z0-9._-]"), "_").ifEmpty { "file" }
var target = File(dir, name)
var candidate = File(dir, name)
var n = 1
while (target.exists()) target = File(dir, "${name.substringBeforeLast('.')}-${n++}${name.substringAfterLast('.', "").let { if (it.isEmpty()) "" else ".$it" }}")
app.contentResolver.openInputStream(uri)!!.use { input -> target.outputStream().use { input.copyTo(it) } }
"$GUEST_DIR/$folder/${target.name}"
}.getOrNull()
// Created atomically, so copies running side by side never pick the same name.
while (!candidate.createNewFile()) candidate = File(dir, "${name.substringBeforeLast('.')}-${n++}${name.substringAfterLast('.', "").let { if (it.isEmpty()) "" else ".$it" }}")
target = candidate
app.contentResolver.openInputStream(uri)!!.use { input -> candidate.outputStream().use { input.copyTo(it) } }
"$GUEST_DIR/$folder/${candidate.name}"
}.onFailure { target?.delete() }.getOrNull()
}
}
@@ -66,11 +66,14 @@ object ProtonExtras {
internal fun installedIn(dir: File, tool: Tool): List<String> =
dir.listFiles()
?.filter { it.isDirectory && it.name.startsWith(tool.prefix) && usable(it) }
?.filter { it.isDirectory && it.name.startsWith(tool.prefix) && !x86_64Build(it) && usable(it) }
?.map { it.name }
?.sortedWith { a, b -> compareVersions(a, b) }
?: emptyList()
internal fun x86_64Build(dir: File): Boolean =
File(dir, "files/lib/wine/x86_64-unix").isDirectory && !File(dir, "files/bin-arm64").isDirectory
private fun usable(dir: File): Boolean {
val manifest = runCatching { File(dir, "toolmanifest.vdf").readText() }.getOrNull() ?: return false
val command = Regex("\\\"commandline\\\"\\s+\\\"/?([^\\\" ]+)").find(manifest)?.groupValues?.getOrNull(1) ?: return false
@@ -2014,24 +2014,84 @@ object SessionPrefs {
sessionPrefs.edit().putString(SCREEN_EFFECTS_PROFILES_KEY, profiles.toString()).apply()
}
private const val GAME_UPSCALER_OVERRIDES_KEY = "upscaler.gameOverrides"
private fun gameUpscalerOverrides(context: Context): JSONObject = runCatching {
JSONObject(prefs(context).getString(GAME_UPSCALER_OVERRIDES_KEY, null) ?: "{}")
}.getOrDefault(JSONObject())
private fun legacyScreenEffectsUpscaler(context: Context, profileId: String): Int? =
runCatching {
val profiles = JSONObject(prefs(context).getString(SCREEN_EFFECTS_PROFILES_KEY, null) ?: "{}")
val profile = profiles.optJSONObject(profileId)
if (profile?.has(SCREEN_EFFECTS_PROFILE_UPSCALER_KEY) == true) {
profile.optInt(SCREEN_EFFECTS_PROFILE_UPSCALER_KEY, -1).takeIf { it >= 0 }
} else null
}.getOrNull()?.let(::canonicalUpscaler)
private fun clearLegacyScreenEffectsUpscaler(context: Context, profileId: String) {
val sessionPrefs = prefs(context)
val profiles = runCatching {
JSONObject(sessionPrefs.getString(SCREEN_EFFECTS_PROFILES_KEY, null) ?: "{}")
}.getOrNull() ?: return
val profile = profiles.optJSONObject(profileId) ?: return
if (!profile.has(SCREEN_EFFECTS_PROFILE_UPSCALER_KEY)) return
profile.remove(SCREEN_EFFECTS_PROFILE_UPSCALER_KEY)
if (profile.length() == 0) profiles.remove(profileId)
sessionPrefs.edit().apply {
if (profiles.length() == 0) remove(SCREEN_EFFECTS_PROFILES_KEY)
else putString(SCREEN_EFFECTS_PROFILES_KEY, profiles.toString())
}.apply()
}
fun hasGameUpscalerOverride(context: Context, gameId: String): Boolean {
if (gameId.isBlank()) return false
val stored = gameUpscalerOverrides(context)
return (stored.has(gameId) && stored.optInt(gameId, -1) >= 0) ||
legacyScreenEffectsUpscaler(context, "game:$gameId") != null
}
fun setGameUpscaler(context: Context, gameId: String, mode: Int) {
if (gameId.isBlank()) return
val overrides = gameUpscalerOverrides(context)
overrides.put(gameId, canonicalUpscaler(mode))
prefs(context).edit().putString(GAME_UPSCALER_OVERRIDES_KEY, overrides.toString()).apply()
clearLegacyScreenEffectsUpscaler(context, "game:$gameId")
}
fun clearGameUpscaler(context: Context, gameId: String) {
if (gameId.isBlank()) return
val sessionPrefs = prefs(context)
val overrides = gameUpscalerOverrides(context)
if (overrides.has(gameId)) {
overrides.remove(gameId)
sessionPrefs.edit().apply {
if (overrides.length() == 0) remove(GAME_UPSCALER_OVERRIDES_KEY)
else putString(GAME_UPSCALER_OVERRIDES_KEY, overrides.toString())
}.apply()
}
clearLegacyScreenEffectsUpscaler(context, "game:$gameId")
}
fun hasScreenEffectsUpscalerOverride(context: Context, profileId: String?): Boolean {
if (profileId.isNullOrBlank()) return false
return runCatching {
val profiles = JSONObject(prefs(context).getString(SCREEN_EFFECTS_PROFILES_KEY, null) ?: "{}")
profiles.optJSONObject(profileId)?.has(SCREEN_EFFECTS_PROFILE_UPSCALER_KEY) == true
}.getOrDefault(false)
if (profileId.startsWith("game:")) {
return hasGameUpscalerOverride(context, profileId.removePrefix("game:"))
}
return legacyScreenEffectsUpscaler(context, profileId) != null
}
fun screenEffectsUpscaler(context: Context, profileId: String?): Int {
if (profileId.isNullOrBlank()) return upscaler(context)
val stored = runCatching {
val profiles = JSONObject(prefs(context).getString(SCREEN_EFFECTS_PROFILES_KEY, null) ?: "{}")
val profile = profiles.optJSONObject(profileId)
if (profile?.has(SCREEN_EFFECTS_PROFILE_UPSCALER_KEY) == true) {
profile.optInt(SCREEN_EFFECTS_PROFILE_UPSCALER_KEY, -1)
} else -1
}.getOrDefault(-1)
return if (stored >= 0) canonicalUpscaler(stored) else upscaler(context)
if (profileId.startsWith("game:")) {
val gameId = profileId.removePrefix("game:")
val overrides = gameUpscalerOverrides(context)
if (overrides.has(gameId)) {
val stored = overrides.optInt(gameId, -1)
if (stored >= 0) return canonicalUpscaler(stored)
}
}
return legacyScreenEffectsUpscaler(context, profileId) ?: upscaler(context)
}
fun setScreenEffectsUpscaler(context: Context, profileId: String?, mode: Int) {
@@ -2039,6 +2099,10 @@ object SessionPrefs {
setUpscaler(context, mode)
return
}
if (profileId.startsWith("game:")) {
setGameUpscaler(context, profileId.removePrefix("game:"), mode)
return
}
val sessionPrefs = prefs(context)
val profiles = runCatching {
JSONObject(sessionPrefs.getString(SCREEN_EFFECTS_PROFILES_KEY, null) ?: "{}")
@@ -2075,6 +2139,7 @@ object SessionPrefs {
val profiles = runCatching {
JSONObject(sessionPrefs.getString(SCREEN_EFFECTS_PROFILES_KEY, null) ?: "{}")
}.getOrElse { JSONObject() }
if (profileId.startsWith("game:")) clearGameUpscaler(context, profileId.removePrefix("game:"))
if (!profiles.has(profileId)) return
profiles.remove(profileId)
sessionPrefs.edit().apply {
@@ -5,7 +5,9 @@ import android.content.ContextWrapper
import android.os.Build
import android.view.KeyEvent
import android.view.WindowManager
import androidx.activity.compose.BackHandler
import androidx.activity.compose.LocalActivityResultRegistryOwner
import androidx.activity.compose.LocalOnBackPressedDispatcherOwner
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.animation.expandVertically
@@ -50,12 +52,12 @@ import androidx.compose.foundation.text.KeyboardOptions
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.automirrored.outlined.Send
import androidx.compose.material.icons.outlined.Extension
import androidx.compose.material.icons.outlined.PhotoCamera
import androidx.compose.material.icons.outlined.MicOff
import androidx.compose.material.icons.outlined.Mic
import androidx.compose.material.icons.outlined.Add
import androidx.compose.material.icons.outlined.ArrowDownward
import androidx.compose.material.icons.outlined.AttachFile
import androidx.compose.material.icons.outlined.Keyboard
import androidx.compose.material.icons.outlined.Terminal
import androidx.compose.material.icons.outlined.Build
import androidx.compose.material.icons.outlined.Close
@@ -79,6 +81,7 @@ import androidx.compose.runtime.MutableState
import androidx.compose.runtime.Stable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableIntStateOf
import androidx.compose.runtime.mutableStateMapOf
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.rememberCoroutineScope
@@ -108,6 +111,7 @@ import androidx.compose.ui.input.pointer.pointerInput
import androidx.compose.ui.layout.onGloballyPositioned
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalDensity
import androidx.compose.ui.platform.LocalConfiguration
import androidx.compose.ui.platform.LocalFocusManager
import androidx.compose.ui.platform.LocalView
import androidx.compose.ui.platform.testTag
@@ -301,7 +305,7 @@ private fun AgentPageContent(
readingBack = false
scope.launch { list.scrollToItem(maxOf(0, list.layoutInfo.totalItemsCount - 1), Int.MAX_VALUE / 2) }
}
val hidden = !composer.focused && !composer.hasUnconsumedFocusRequest() && readingBack && AgentHost.entries.isNotEmpty() &&
val hidden = !composer.focused && !composer.tray && !composer.hasUnconsumedFocusRequest() && readingBack && AgentHost.entries.isNotEmpty() &&
AgentHost.approvals.isEmpty()
var listHeight by remember { mutableIntStateOf(0) }
Box(
@@ -319,6 +323,7 @@ private fun AgentPageContent(
awaitEachGesture {
awaitFirstDown(requireUnconsumed = false, pass = PointerEventPass.Initial)
if (panel == AgentPanel.MODEL || panel == AgentPanel.USAGE) panel = AgentPanel.NONE
composer.tray = false
// Forced: the unforced path walks the focus chain and throws ("ActiveParent with no focused child") when a tap lands while focus is moving.
if (composer.focused) focusManager.clearFocus(force = true)
}
@@ -344,6 +349,12 @@ private fun AgentPageContent(
@Stable
private class ComposerState {
var focused by mutableStateOf(false)
/** The photo tray stands in for the keyboard, at the height the keyboard last had. */
var tray by mutableStateOf(false)
var keyboardHeight by mutableStateOf(0.dp)
/** Tray photos copied, or being copied, for this conversation, so reopening the tray keeps their marks and copies nothing twice. */
val photoCopies = mutableStateMapOf<android.net.Uri, String>()
val photosCopying = mutableStateMapOf<android.net.Uri, Any>()
var focusRequests by mutableIntStateOf(0)
private set
private var consumedFocusRequests by mutableIntStateOf(0)
@@ -390,7 +401,7 @@ private fun ModelChip(panel: AgentPanel, onPanel: (AgentPanel) -> Unit, firstCon
.clickable { onPanel(AgentPanel.MODEL) }.padding(horizontal = 8.dp).testTag("agent-model"),
) {
val mode = AgentHost.harness.permissions.drop(1).firstOrNull { it.id == AgentHost.permission }?.let { stringResource(it.label) }
val parts = if (compact) listOfNotNull(mode ?: model)
val parts = if (compact) listOf(model)
else listOfNotNull(
AgentHost.harness.name, model, AgentHost.effort, mode,
stringResource(R.string.agent_plan_short).takeIf { AgentHost.plan && AgentHost.harness.plans },
@@ -748,6 +759,8 @@ private fun AgentComposer(
if (text.isEmpty() && AgentAttachments.pending.isEmpty()) return@send
AgentHost.send(context, text, AgentAttachments.pending.toList())
AgentAttachments.pending.clear()
composer.photosCopying.clear()
composer.tray = false
onSent()
}
}
@@ -813,7 +826,34 @@ private fun AgentEditor(composer: ComposerState, draftState: MutableState<String
var focused by remember { mutableStateOf(false) }
val field = remember { FocusRequester() }
LaunchedEffect(composer.focusRequests) { if (composer.hasUnconsumedFocusRequest()) runCatching { field.requestFocus() } }
val attach = LocalActivityResultRegistryOwner.current != null
val picks = LocalActivityResultRegistryOwner.current != null
val density = LocalDensity.current
val imeHeight = WindowInsets.ime.getBottom(density)
LaunchedEffect(imeHeight) {
val height = with(density) { imeHeight.toDp() }
if (height > composer.keyboardHeight) composer.keyboardHeight = height
}
LaunchedEffect(hideAttach) { if (hideAttach) composer.tray = false }
LaunchedEffect(AgentHost.chat) {
composer.photoCopies.clear()
composer.photosCopying.clear()
}
// BackHandler throws where the host provides no back dispatcher: the front end and the floating pet.
if (LocalOnBackPressedDispatcherOwner.current != null) BackHandler(composer.tray) { composer.tray = false }
val focusManager = LocalFocusManager.current
val files = if (picks) rememberLauncherForActivityResult(ActivityResultContracts.OpenMultipleDocuments()) {
AgentAttachments.picking = false
attachUris(context, it)
} else null
val toggleTray = {
if (composer.tray) {
composer.tray = false
composer.open()
} else {
focusManager.clearFocus(force = true)
composer.tray = true
}
}
BoxWithConstraints(
Modifier.fillMaxWidth().padding(top = 8.dp).clip(Shape16).background(colors.surface)
.border(if (focused) 2.dp else 1.dp, if (focused) pal.primary else pal.line, Shape16).padding(6.dp),
@@ -841,6 +881,7 @@ private fun AgentEditor(composer: ComposerState, draftState: MutableState<String
Modifier.fillMaxWidth().focusRequester(field).onFocusChanged {
focused = it.isFocused
composer.focused = it.isFocused
if (it.isFocused) composer.tray = false
if (it.isFocused) composer.consumeFocusRequest()
}.testTag("agent-input"),
textStyle = TextStyle(fontSize = 16.sp, color = colors.onSurface),
@@ -866,19 +907,22 @@ private fun AgentEditor(composer: ComposerState, draftState: MutableState<String
if (stacked) Column {
text(Modifier.fillMaxWidth())
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.fillMaxWidth()) {
AnimatedVisibility(attach && !hideAttach, enter = expandHorizontally() + fadeIn(), exit = shrinkHorizontally() + fadeOut()) { AttachButton() }
AnimatedVisibility(AgentAttachments.gameFrame != null && !hideAttach, enter = expandHorizontally() + fadeIn(), exit = shrinkHorizontally() + fadeOut()) { GameFrameButton() }
AnimatedVisibility(!hideAttach, enter = expandHorizontally() + fadeIn(), exit = shrinkHorizontally() + fadeOut()) { AttachButton(composer.tray, toggleTray) }
Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.weight(1f).height(42.dp).horizontalScroll(rememberScrollState(), reverseScrolling = true)) { if (controls != null && !focused) controls() }
actions()
}
} else Row(verticalAlignment = Alignment.Bottom) {
AnimatedVisibility(attach && !hideAttach, enter = expandHorizontally() + fadeIn(), exit = shrinkHorizontally() + fadeOut()) { AttachButton() }
AnimatedVisibility(AgentAttachments.gameFrame != null && !hideAttach, enter = expandHorizontally() + fadeIn(), exit = shrinkHorizontally() + fadeOut()) { GameFrameButton() }
AnimatedVisibility(!hideAttach, enter = expandHorizontally() + fadeIn(), exit = shrinkHorizontally() + fadeOut()) { AttachButton(composer.tray, toggleTray) }
text(Modifier.weight(1f))
if (controls != null && !focused) Row(verticalAlignment = Alignment.CenterVertically, modifier = Modifier.height(42.dp)) { controls() }
actions()
}
}
AnimatedVisibility(composer.tray, enter = expandVertically() + fadeIn(), exit = shrinkVertically() + fadeOut()) {
val most = LocalConfiguration.current.screenHeightDp.dp * 0.45f
val height = (if (composer.keyboardHeight > 0.dp) composer.keyboardHeight else 280.dp).coerceAtLeast(160.dp).coerceAtMost(most)
AgentPhotoTray(height, composer.photoCopies, composer.photosCopying, files?.let { { AgentAttachments.pick { it.launch(arrayOf("*/*")) } } })
}
}
/**
@@ -974,53 +1018,15 @@ private fun VoiceButton(voice: AgentVoice, onStart: () -> Unit, onSend: () -> Un
}
}
/** Attaches what the running game shows, taken from its own surface so nothing drawn over it is in the picture. */
/** Opens the photo tray in place of the keyboard; while it is open, brings the keyboard back. */
@Composable
private fun GameFrameButton() {
val context = LocalContext.current
private fun AttachButton(trayOpen: Boolean, onClick: () -> Unit) {
val pal = LocalPalette.current
RoundButton(Icons.Outlined.PhotoCamera, stringResource(R.string.agent_attach_game), pal.surfaceVariant, pal.onBackground, "agent-game-frame") {
val grab = AgentAttachments.gameFrame ?: return@RoundButton
val chat = AgentHost.chat
grab frame@{ frame ->
if (frame == null) {
android.widget.Toast.makeText(context, R.string.agent_attach_game_failed, android.widget.Toast.LENGTH_SHORT).show()
return@frame
}
Thread({
val path = AgentAttachments.saveFrame(context, chat, frame)
frame.recycle()
android.os.Handler(android.os.Looper.getMainLooper()).post {
when {
path == null -> android.widget.Toast.makeText(context, R.string.agent_attach_game_failed, android.widget.Toast.LENGTH_SHORT).show()
AgentHost.chat == chat -> AgentAttachments.pending.add(path)
else -> AgentAttachments.discard(context, listOf(path))
}
}
}, "agent-game-frame").start()
}
}
}
@Composable
private fun AttachButton() {
val context = LocalContext.current
val pal = LocalPalette.current
val picker = rememberLauncherForActivityResult(ActivityResultContracts.OpenMultipleDocuments()) { uris ->
AgentAttachments.picking = false
if (uris.isEmpty()) return@rememberLauncherForActivityResult
val chat = AgentHost.chat
Thread({
val paths = AgentAttachments.copy(context, chat, uris)
android.os.Handler(android.os.Looper.getMainLooper()).post {
if (AgentHost.chat == chat) AgentAttachments.pending.addAll(paths) else AgentAttachments.discard(context, paths)
}
}, "agent-attach").start()
}
RoundButton(Icons.Outlined.AttachFile, stringResource(R.string.agent_attach), pal.surfaceVariant, pal.onBackground, "agent-attach") {
AgentAttachments.picking = true
if (runCatching { picker.launch(arrayOf("*/*")) }.isFailure) AgentAttachments.picking = false
}
RoundButton(
if (trayOpen) Icons.Outlined.Keyboard else Icons.Outlined.AttachFile,
stringResource(if (trayOpen) R.string.agent_keyboard else R.string.agent_attach),
if (trayOpen) pal.primary else pal.surfaceVariant, if (trayOpen) pal.onPrimary else pal.onBackground, "agent-attach", onClick = onClick,
)
}
@Composable
@@ -0,0 +1,280 @@
package com.droiddeck.launcher.ui
import android.Manifest
import android.content.ContentUris
import android.content.Context
import android.content.Intent
import android.content.pm.PackageManager
import android.net.Uri
import android.os.Build
import android.os.Environment
import android.provider.MediaStore
import android.provider.Settings
import android.widget.Toast
import androidx.activity.compose.LocalActivityResultRegistryOwner
import androidx.activity.compose.rememberLauncherForActivityResult
import androidx.activity.result.contract.ActivityResultContracts
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.aspectRatio
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.lazy.grid.GridCells
import androidx.compose.foundation.lazy.grid.GridItemSpan
import androidx.compose.foundation.lazy.grid.LazyVerticalGrid
import androidx.compose.foundation.lazy.grid.items
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.material.icons.Icons
import androidx.compose.material.icons.outlined.Check
import androidx.compose.material.icons.outlined.FolderOpen
import androidx.compose.material.icons.outlined.PhotoCamera
import androidx.compose.material.icons.outlined.PhotoLibrary
import androidx.compose.material3.Icon
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.DisposableEffect
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.runtime.snapshots.SnapshotStateMap
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.vector.ImageVector
import androidx.compose.ui.layout.ContentScale
import androidx.compose.ui.platform.LocalContext
import androidx.compose.ui.platform.LocalLifecycleOwner
import androidx.compose.ui.platform.testTag
import androidx.compose.ui.semantics.contentDescription
import androidx.compose.ui.semantics.selected
import androidx.compose.ui.semantics.semantics
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleEventObserver
import coil.compose.AsyncImage
import coil.request.ImageRequest
import com.droiddeck.launcher.R
import com.droiddeck.launcher.agent.AgentAttachments
import com.droiddeck.launcher.agent.AgentHost
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.withContext
/** The device's photos, newest first, as MediaStore lets the app see them. */
internal object AgentPhotos {
enum class Access { NONE, SELECTED, ALL }
/** Android stops showing the request after repeated denials and answers it at once, so a denied request sends later ones to Settings. */
var refused = false
fun permissions(sdk: Int = Build.VERSION.SDK_INT): Array<String> = when {
sdk >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE -> arrayOf(Manifest.permission.READ_MEDIA_IMAGES, Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED)
sdk >= Build.VERSION_CODES.TIRAMISU -> arrayOf(Manifest.permission.READ_MEDIA_IMAGES)
else -> arrayOf(Manifest.permission.READ_EXTERNAL_STORAGE)
}
fun access(context: Context): Access {
fun granted(permission: String) = context.checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED
val all = permissions().first()
return when {
Build.VERSION.SDK_INT >= Build.VERSION_CODES.R && Environment.isExternalStorageManager() -> Access.ALL
granted(all) -> Access.ALL
Build.VERSION.SDK_INT >= Build.VERSION_CODES.UPSIDE_DOWN_CAKE && granted(Manifest.permission.READ_MEDIA_VISUAL_USER_SELECTED) -> Access.SELECTED
else -> Access.NONE
}
}
class Photo(val uri: Uri, val name: String)
fun recent(context: Context, limit: Int = 300): List<Photo> = runCatching {
val images = MediaStore.Images.Media.EXTERNAL_CONTENT_URI
context.contentResolver.query(
images, arrayOf(MediaStore.Images.Media._ID, MediaStore.Images.Media.DISPLAY_NAME), null, null, "${MediaStore.Images.Media.DATE_ADDED} DESC",
)?.use { c ->
buildList {
while (size < limit && c.moveToNext()) add(Photo(ContentUris.withAppendedId(images, c.getLong(0)), c.getString(1).orEmpty()))
}
}.orEmpty()
}.getOrDefault(emptyList())
}
/**
* Copies [uris] into the conversation's attachments off the main thread, then hands [onCopied] what was attached: nothing if the
* conversation changed meanwhile or [current] says the copy was superseded.
*/
internal fun attachUris(context: Context, uris: List<Uri>, current: () -> Boolean = { true }, onCopied: (List<Pair<Uri, String>>) -> Unit = {}) {
if (uris.isEmpty()) return
val chat = AgentHost.chat
Thread({
val copied = uris.mapNotNull { uri -> AgentAttachments.copy(context, chat, listOf(uri)).firstOrNull()?.let { uri to it } }
android.os.Handler(android.os.Looper.getMainLooper()).post {
val paths = copied.map { it.second }
if (AgentHost.chat == chat && current()) {
AgentAttachments.pending.addAll(paths)
onCopied(copied)
} else {
AgentAttachments.discard(context, paths)
onCopied(emptyList())
}
}
}, "agent-attach").start()
}
/** Attaches what the running game shows, taken from its own surface so nothing drawn over it is in the picture. */
private fun attachGameFrame(context: Context) {
val grab = AgentAttachments.gameFrame ?: return
val chat = AgentHost.chat
grab frame@{ frame ->
if (frame == null) {
Toast.makeText(context, R.string.agent_attach_game_failed, Toast.LENGTH_SHORT).show()
return@frame
}
Thread({
val path = AgentAttachments.saveFrame(context, chat, frame)
frame.recycle()
android.os.Handler(android.os.Looper.getMainLooper()).post {
when {
path == null -> Toast.makeText(context, R.string.agent_attach_game_failed, Toast.LENGTH_SHORT).show()
AgentHost.chat == chat -> AgentAttachments.pending.add(path)
else -> AgentAttachments.discard(context, listOf(path))
}
}
}, "agent-game-frame").start()
}
}
/** Shown in place of the keyboard: recent photos to tap onto the message, and the system picker for anything else. */
@Composable
internal fun AgentPhotoTray(height: Dp, copies: SnapshotStateMap<Uri, String>, copying: SnapshotStateMap<Uri, Any>, onFiles: (() -> Unit)?) {
val context = LocalContext.current
val pal = LocalPalette.current
var access by remember { mutableStateOf(AgentPhotos.access(context)) }
var photos by remember { mutableStateOf<List<AgentPhotos.Photo>?>(null) }
var reloads by remember { mutableStateOf(0) }
// A window no activity owns (the floating pet's chat) cannot ask for a permission, so it sends the user to the app's settings.
val launcher = if (LocalActivityResultRegistryOwner.current != null) {
rememberLauncherForActivityResult(ActivityResultContracts.RequestMultiplePermissions()) {
AgentAttachments.picking = false
access = AgentPhotos.access(context)
if (access == AgentPhotos.Access.NONE) AgentPhotos.refused = true
reloads++
}
} else null
val request = {
if (launcher != null && !AgentPhotos.refused) {
AgentAttachments.pick { launcher.launch(AgentPhotos.permissions()) }
} else {
val details = Intent(Settings.ACTION_APPLICATION_DETAILS_SETTINGS, Uri.parse("package:" + context.packageName)).addFlags(Intent.FLAG_ACTIVITY_NEW_TASK)
runCatching { context.startActivity(details) }
}
Unit
}
// Access can change in Settings, and new pictures arrive, while the app is in the background.
val lifecycle = LocalLifecycleOwner.current.lifecycle
DisposableEffect(lifecycle) {
val observer = LifecycleEventObserver { _, event ->
if (event == Lifecycle.Event.ON_RESUME) {
access = AgentPhotos.access(context)
reloads++
}
}
lifecycle.addObserver(observer)
onDispose { lifecycle.removeObserver(observer) }
}
LaunchedEffect(access, reloads) {
photos = if (access == AgentPhotos.Access.NONE) emptyList() else withContext(Dispatchers.IO) { AgentPhotos.recent(context) }
}
LazyVerticalGrid(
GridCells.Adaptive(96.dp),
Modifier.fillMaxWidth().height(height).padding(top = 8.dp).testTag("agent-photo-tray"),
horizontalArrangement = Arrangement.spacedBy(4.dp),
verticalArrangement = Arrangement.spacedBy(4.dp),
) {
if (AgentAttachments.gameFrame != null) item {
TrayTile(Icons.Outlined.PhotoCamera, stringResource(R.string.agent_attach_game), "agent-game-frame") { attachGameFrame(context) }
}
if (onFiles != null) item { TrayTile(Icons.Outlined.FolderOpen, stringResource(R.string.agent_attach_files), "agent-attach-files", onFiles) }
if (access != AgentPhotos.Access.ALL) item {
TrayTile(
Icons.Outlined.PhotoLibrary,
stringResource(if (access == AgentPhotos.Access.NONE) R.string.agent_photos_allow else R.string.agent_photos_more),
"agent-photos-allow",
onClick = request,
)
}
val list = photos
if (list != null && list.isEmpty() && access != AgentPhotos.Access.NONE) item(span = { GridItemSpan(maxLineSpan) }) {
Text(
stringResource(R.string.agent_photos_empty), fontSize = 13.sp, color = pal.onSurfaceVariant, textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth().padding(16.dp),
)
}
items(list.orEmpty(), key = { it.uri.toString() }) { photo ->
val uri = photo.uri
val path = copies[uri]
val selected = path != null && path in AgentAttachments.pending
Box(
Modifier.aspectRatio(1f).clip(Shape12).background(pal.surfaceVariant)
.then(if (selected) Modifier.border(3.dp, pal.primary, Shape12) else Modifier)
.clickable {
when {
selected -> AgentAttachments.pending.remove(path)
path != null && AgentAttachments.host(context, path).exists() -> AgentAttachments.pending.add(path)
uri in copying -> Unit
else -> {
// Leaving the conversation clears the markers, so a copy started before that is no longer current even back in it.
val copy = Any()
copying[uri] = copy
attachUris(context, listOf(uri), current = { copying[uri] === copy }) { copied ->
copied.forEach { (u, p) -> copies[u] = p }
if (copying[uri] === copy) copying.remove(uri)
}
}
}
}.semantics {
contentDescription = photo.name
this.selected = selected
}.testTag("agent-photo"),
) {
AsyncImage(
model = ImageRequest.Builder(context).data(uri).size(320).build(), contentDescription = null,
contentScale = ContentScale.Crop, modifier = Modifier.fillMaxSize(),
)
if (selected) Box(
contentAlignment = Alignment.Center,
modifier = Modifier.align(Alignment.TopEnd).padding(6.dp).size(22.dp).clip(CircleShape).background(pal.primary),
) {
Icon(Icons.Outlined.Check, null, tint = pal.onPrimary, modifier = Modifier.size(16.dp))
}
}
}
}
}
@Composable
private fun TrayTile(icon: ImageVector, label: String, tag: String, onClick: () -> Unit) {
val pal = LocalPalette.current
Column(
horizontalAlignment = Alignment.CenterHorizontally, verticalArrangement = Arrangement.Center,
modifier = Modifier.aspectRatio(1f).clip(Shape12).background(pal.surfaceVariant).clickable(onClick = onClick).padding(8.dp).testTag(tag),
) {
Icon(icon, null, tint = pal.onBackground, modifier = Modifier.size(26.dp))
Text(
label, fontSize = 12.sp, color = pal.onBackground, textAlign = TextAlign.Center, maxLines = 3, overflow = TextOverflow.Ellipsis,
modifier = Modifier.padding(top = 6.dp),
)
}
}
@@ -881,6 +881,28 @@ internal fun LaunchSettings(s: FrontEndState, a: FrontEndActions, host: MenuHost
com.droiddeck.launcher.gpu.FrameGen.hasGameOverride(context, it)
} ?: false)
}
val scalingFilterChoices = SessionPrefs.upscalerChoices(context)
var gameUpscaler by remember(frameGenProfileKey) {
mutableStateOf(frameGenProfileKey?.let {
SessionPrefs.screenEffectsUpscaler(context, "game:$it")
} ?: SessionPrefs.upscaler(context))
}
var gameUpscalerOverride by remember(frameGenProfileKey) {
mutableStateOf(frameGenProfileKey?.let { SessionPrefs.hasGameUpscalerOverride(context, it) } ?: false)
}
val lifecycleOwner = LocalLifecycleOwner.current
DisposableEffect(lifecycleOwner, frameGenProfileKey) {
val observer = LifecycleEventObserver { _, event ->
if (event == Lifecycle.Event.ON_RESUME) {
frameGenProfileKey?.let { key ->
gameUpscaler = SessionPrefs.screenEffectsUpscaler(context, "game:$key")
gameUpscalerOverride = SessionPrefs.hasGameUpscalerOverride(context, key)
}
}
}
lifecycleOwner.lifecycle.addObserver(observer)
onDispose { lifecycleOwner.lifecycle.removeObserver(observer) }
}
var wincompOpen by remember(wincompKey) { mutableStateOf<Boolean?>(null) }
val wincompPicks = remember(wincompKey, wincompOpen) { wincompKey?.let { com.droiddeck.launcher.session.WinComponents.picks(context, it) }.orEmpty() }
val steamScope = game?.let { com.droiddeck.launcher.session.NoSteamLaunch.scope(it) }
@@ -914,6 +936,25 @@ internal fun LaunchSettings(s: FrontEndState, a: FrontEndActions, host: MenuHost
},
)
}
val scalingFilterMenuContent: @Composable () -> Unit = {
val key = frameGenProfileKey
if (key != null) ScalingFilterMenu(
mode = gameUpscaler,
options = scalingFilterChoices,
hasGameOverride = gameUpscalerOverride,
onPick = { mode ->
SessionPrefs.setGameUpscaler(context, key, mode)
gameUpscaler = SessionPrefs.screenEffectsUpscaler(context, "game:$key")
gameUpscalerOverride = SessionPrefs.hasGameUpscalerOverride(context, key)
},
onResetGame = {
SessionPrefs.clearGameUpscaler(context, key)
gameUpscaler = SessionPrefs.upscaler(context)
gameUpscalerOverride = false
},
gameName = game?.name,
)
}
val cards = if (game?.library == com.droiddeck.launcher.frontend.Library.EPIC_LAUNCHER) listOfNotNull(steamCard) else buildList<@Composable (Modifier) -> Unit> {
add { m ->
val back = stringResource(R.string.hop_from_games)
@@ -938,6 +979,17 @@ internal fun LaunchSettings(s: FrontEndState, a: FrontEndActions, host: MenuHost
}
}
if (frameGenProfileKey != null) add { m ->
Box(m) {
SettingCard(
stringResource(R.string.display_filter),
scalingFilterChoices.firstOrNull { it.first == gameUpscaler }?.second ?: scalingFilterChoices.first().second,
"card:scaling-filter", Modifier.fillMaxSize(),
) {
host.open = if (host.open == "scaling-filter") null else "scaling-filter"
}
}
}
if (controller != null) add { m -> SettingCard(stringResource(R.string.setup_card_controls), stringResource(R.string.setup_card_controls_hint), "card:controls", m, controller.onMapping) }
if (steamCard != null) add(steamCard)
val cardStore = com.droiddeck.launcher.stores.Store.byId(game?.source.orEmpty())?.takeIf { it == com.droiddeck.launcher.stores.Store.EPIC || it == com.droiddeck.launcher.stores.Store.GOG }
@@ -972,6 +1024,11 @@ internal fun LaunchSettings(s: FrontEndState, a: FrontEndActions, host: MenuHost
frameGenMenuContent()
}
}
if (host.open == "scaling-filter") {
Box(Modifier.fillMaxWidth().padding(top = 4.dp)) {
scalingFilterMenuContent()
}
}
}
}
@@ -0,0 +1,69 @@
package com.droiddeck.launcher.ui
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material3.ButtonDefaults
import androidx.compose.material3.MaterialTheme
import androidx.compose.material3.OutlinedButton
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.droiddeck.launcher.R
@Composable
internal fun ScalingFilterMenu(
mode: Int,
options: List<Pair<Int, String>>,
hasGameOverride: Boolean,
onPick: (Int) -> Unit,
onResetGame: () -> Unit,
gameName: String? = null,
) {
val colors = MaterialTheme.colorScheme
Column(Modifier.fillMaxWidth().padding(start = 10.dp, end = 10.dp, bottom = 8.dp)) {
val selectedLabel = options.firstOrNull { it.first == mode }?.second ?: mode.toString()
Text(
stringResource(
if (hasGameOverride) R.string.display_filter_game_profile else R.string.display_filter_default_profile,
if (hasGameOverride) gameName.orEmpty() else selectedLabel,
selectedLabel,
),
color = colors.onSurfaceVariant,
style = MaterialTheme.typography.bodySmall,
modifier = Modifier.padding(bottom = 6.dp),
)
options.forEachIndexed { index, (option, label) ->
val selected = mode == option
val pick = { onPick(option) }
OutlinedButton(
onClick = pick,
modifier = Modifier.fillMaxWidth()
.padding(top = if (index == 0) 0.dp else 6.dp)
.controllerConfirm(onClick = pick),
contentPadding = PaddingValues(horizontal = 12.dp, vertical = 8.dp),
colors = ButtonDefaults.outlinedButtonColors(
containerColor = if (selected) colors.primary.copy(alpha = 0.16f) else colors.surface,
contentColor = if (selected) colors.primary else colors.onSurface,
),
) { Text(label) }
}
Text(
stringResource(R.string.display_filter_note),
color = colors.onSurfaceVariant,
style = MaterialTheme.typography.bodySmall,
modifier = Modifier.padding(top = 6.dp),
)
OutlinedButton(
onClick = onResetGame,
modifier = Modifier.fillMaxWidth().padding(top = 6.dp)
.controllerConfirm(onClick = onResetGame),
contentPadding = PaddingValues(horizontal = 12.dp, vertical = 8.dp),
) {
Text(stringResource(R.string.comp_game_use_general) + if (hasGameOverride) "" else " ✓")
}
}
}
@@ -706,7 +706,8 @@ private fun TestList(tests: List<Release>, me: AppUpdates.Installed, u: UpdatesS
val followed = u.follow.pr.takeIf { u.follow.channel == Channel.TEST }
val rowShown = followed != null && (ready.any { it.pr == followed } || (oldShown && old.any { it.pr == followed }))
Column(verticalArrangement = Arrangement.spacedBy(10.dp)) {
if (!rowShown) status(false)
// A followed test's row carries the status; browsing Tests while following Stable or Preview shows it only for an install running or failed.
if (if (followed != null) !rowShown else u.stage != null || u.error != null) status(false)
Column(Modifier.padding(start = 18.dp), verticalArrangement = Arrangement.spacedBy(6.dp)) {
if (tests.size > 5 || query.isNotEmpty()) AdbTextField(
value = query, onValueChange = { query = it }, label = stringResource(R.string.upd_tests_find),
@@ -333,6 +333,8 @@ public final class WaylandCompositor {
public static native void nativeSetZeroCopy(boolean on);
public static native void nativeSetMirrorCapture(boolean on);
public static native void nativeSetDisplayBufferDriver(boolean on);
public static native int nativeZeroCopyFrames();
+7
View File
@@ -1180,6 +1180,11 @@
<string name="agent_tools_missing">أدوات الوكيل غير مثبتة: %1$s</string>
<string name="agent_unqueue">لا تُرسل</string>
<string name="agent_attach">إرفاق</string>
<string name="agent_attach_files">الملفات</string>
<string name="agent_photos_allow">السماح بالوصول إلى الصور</string>
<string name="agent_photos_more">اختيار المزيد من الصور</string>
<string name="agent_photos_empty">لا توجد صور بعد</string>
<string name="agent_keyboard">لوحة المفاتيح</string>
<string name="agent_remove_attachment">إزالة</string>
<string name="agent_model_default">الافتراضي</string>
<string name="agent_effort">جهد الاستدلال</string>
@@ -4325,4 +4330,6 @@
<string name="glasses_shortcut_group">اختصار داخل اللعبة</string>
<string name="glasses_show_shortcut">إظهار اختصار النظارات الذكية</string>
<string name="glasses_show_shortcut_hint">إظهار زر النظارات الذكية العائم فوق اللعبة.</string>
<string name="display_filter_game_profile">استخدام ملف تعريف %1$s: %2$s</string>
<string name="display_filter_default_profile">استخدام الملف التعريفي الافتراضي: %1$s</string>
</resources>
@@ -1198,6 +1198,11 @@
<string name="agent_tools_missing">Herramientas del agente sin instalar: %1$s</string>
<string name="agent_unqueue">No enviar</string>
<string name="agent_attach">Adjuntar</string>
<string name="agent_attach_files">Archivos</string>
<string name="agent_photos_allow">Permitir acceso a fotos</string>
<string name="agent_photos_more">Elegir más fotos</string>
<string name="agent_photos_empty">Aún no hay fotos</string>
<string name="agent_keyboard">Teclado</string>
<string name="agent_remove_attachment">Quitar</string>
<string name="agent_model_default">Predeterminado</string>
<string name="agent_effort">Esfuerzo de razonamiento</string>
@@ -4203,4 +4208,6 @@
<string name="glasses_shortcut_group">Acceso directo en el juego</string>
<string name="glasses_show_shortcut">Mostrar acceso directo de Smart Glasses</string>
<string name="glasses_show_shortcut_hint">Mostrar el botón flotante de Smart Glasses sobre el juego.</string>
<string name="display_filter_game_profile">Usando el perfil %1$s: %2$s</string>
<string name="display_filter_default_profile">Usando el perfil predeterminado: %1$s</string>
</resources>
+7
View File
@@ -1168,6 +1168,11 @@
<string name="agent_tools_missing">Инструментите на агента не са инсталирани: %1$s</string>
<string name="agent_unqueue">Не изпращай</string>
<string name="agent_attach">Прикачи</string>
<string name="agent_attach_files">Файлове</string>
<string name="agent_photos_allow">Разрешаване на достъп до снимки</string>
<string name="agent_photos_more">Избор на още снимки</string>
<string name="agent_photos_empty">Все още няма снимки</string>
<string name="agent_keyboard">Клавиатура</string>
<string name="agent_remove_attachment">Премахни</string>
<string name="agent_model_default">По подразбиране</string>
<string name="agent_effort">Усилие за разсъждение</string>
@@ -4165,4 +4170,6 @@
<string name="glasses_shortcut_group">Пряк път в играта</string>
<string name="glasses_show_shortcut">Показване на прекия път за Smart Glasses</string>
<string name="glasses_show_shortcut_hint">Показва плаващия бутон за Smart Glasses върху играта.</string>
<string name="display_filter_game_profile">Използва се профил %1$s: %2$s</string>
<string name="display_filter_default_profile">Използва се профилът по подразбиране: %1$s</string>
</resources>
+7
View File
@@ -1174,6 +1174,11 @@
<string name="agent_tools_missing">Nástroje agenta nejsou nainstalované: %1$s</string>
<string name="agent_unqueue">Neposílat</string>
<string name="agent_attach">Přiložit</string>
<string name="agent_attach_files">Soubory</string>
<string name="agent_photos_allow">Povolit přístup k fotkám</string>
<string name="agent_photos_more">Vybrat další fotky</string>
<string name="agent_photos_empty">Zatím žádné fotky</string>
<string name="agent_keyboard">Klávesnice</string>
<string name="agent_remove_attachment">Odebrat</string>
<string name="agent_model_default">Výchozí</string>
<string name="agent_effort">Náročnost uvažování</string>
@@ -4245,4 +4250,6 @@
<string name="glasses_shortcut_group">Zkratka ve hře</string>
<string name="glasses_show_shortcut">Zobrazit zkratku Smart Glasses</string>
<string name="glasses_show_shortcut_hint">Zobrazit plovoucí tlačítko Smart Glasses nad hrou.</string>
<string name="display_filter_game_profile">Používá se profil %1$s: %2$s</string>
<string name="display_filter_default_profile">Používá se výchozí profil: %1$s</string>
</resources>
+7
View File
@@ -1168,6 +1168,11 @@
<string name="agent_tools_missing">Agentens værktøjer er ikke installeret: %1$s</string>
<string name="agent_unqueue">Send ikke</string>
<string name="agent_attach">Vedhæft</string>
<string name="agent_attach_files">Filer</string>
<string name="agent_photos_allow">Tillad adgang til billeder</string>
<string name="agent_photos_more">Vælg flere billeder</string>
<string name="agent_photos_empty">Ingen billeder endnu</string>
<string name="agent_keyboard">Tastatur</string>
<string name="agent_remove_attachment">Fjern</string>
<string name="agent_model_default">Standard</string>
<string name="agent_effort">Ræsonneringsindsats</string>
@@ -4165,4 +4170,6 @@
<string name="glasses_shortcut_group">Genvej i spillet</string>
<string name="glasses_show_shortcut">Vis Smart Glasses-genvej</string>
<string name="glasses_show_shortcut_hint">Vis den flydende Smart Glasses-knap oven på spillet.</string>
<string name="display_filter_game_profile">Bruger profilen %1$s: %2$s</string>
<string name="display_filter_default_profile">Bruger standardprofilen: %1$s</string>
</resources>
+7
View File
@@ -1160,6 +1160,11 @@
<string name="agent_tools_missing">Agent-Werkzeuge nicht installiert: %1$s</string>
<string name="agent_unqueue">Nicht senden</string>
<string name="agent_attach">Anhängen</string>
<string name="agent_attach_files">Dateien</string>
<string name="agent_photos_allow">Zugriff auf Fotos erlauben</string>
<string name="agent_photos_more">Weitere Fotos auswählen</string>
<string name="agent_photos_empty">Noch keine Fotos</string>
<string name="agent_keyboard">Tastatur</string>
<string name="agent_remove_attachment">Entfernen</string>
<string name="agent_model_default">Standard</string>
<string name="agent_effort">Denkaufwand</string>
@@ -4165,4 +4170,6 @@
<string name="glasses_shortcut_group">Ingame-Verknüpfung</string>
<string name="glasses_show_shortcut">Smart-Glasses-Verknüpfung anzeigen</string>
<string name="glasses_show_shortcut_hint">Die schwebende Smart-Glasses-Schaltfläche über dem Spiel anzeigen.</string>
<string name="display_filter_game_profile">Profil %1$s wird verwendet: %2$s</string>
<string name="display_filter_default_profile">Standardprofil wird verwendet: %1$s</string>
</resources>
+7
View File
@@ -1168,6 +1168,11 @@
<string name="agent_tools_missing">Τα εργαλεία του πράκτορα δεν εγκαταστάθηκαν: %1$s</string>
<string name="agent_unqueue">Να μην σταλεί</string>
<string name="agent_attach">Επισύναψη</string>
<string name="agent_attach_files">Αρχεία</string>
<string name="agent_photos_allow">Να επιτρέπεται η πρόσβαση στις φωτογραφίες</string>
<string name="agent_photos_more">Επιλογή περισσότερων φωτογραφιών</string>
<string name="agent_photos_empty">Δεν υπάρχουν φωτογραφίες ακόμα</string>
<string name="agent_keyboard">Πληκτρολόγιο</string>
<string name="agent_remove_attachment">Αφαίρεση</string>
<string name="agent_model_default">Προεπιλογή</string>
<string name="agent_effort">Προσπάθεια συλλογισμού</string>
@@ -4165,4 +4170,6 @@
<string name="glasses_shortcut_group">Συντόμευση μέσα στο παιχνίδι</string>
<string name="glasses_show_shortcut">Εμφάνιση συντόμευσης Smart Glasses</string>
<string name="glasses_show_shortcut_hint">Εμφάνιση του αιωρούμενου κουμπιού Smart Glasses πάνω από το παιχνίδι.</string>
<string name="display_filter_game_profile">Χρήση προφίλ %1$s: %2$s</string>
<string name="display_filter_default_profile">Χρήση προεπιλεγμένου προφίλ: %1$s</string>
</resources>
+7
View File
@@ -1171,6 +1171,11 @@
<string name="agent_tools_missing">Herramientas del agente sin instalar: %1$s</string>
<string name="agent_unqueue">No enviar</string>
<string name="agent_attach">Adjuntar</string>
<string name="agent_attach_files">Archivos</string>
<string name="agent_photos_allow">Permitir acceso a las fotos</string>
<string name="agent_photos_more">Elegir más fotos</string>
<string name="agent_photos_empty">Aún no hay fotos</string>
<string name="agent_keyboard">Teclado</string>
<string name="agent_remove_attachment">Quitar</string>
<string name="agent_model_default">Predeterminado</string>
<string name="agent_effort">Esfuerzo de razonamiento</string>
@@ -4205,4 +4210,6 @@
<string name="glasses_shortcut_group">Acceso directo en el juego</string>
<string name="glasses_show_shortcut">Mostrar acceso directo de Smart Glasses</string>
<string name="glasses_show_shortcut_hint">Mostrar el botón flotante de Smart Glasses sobre el juego.</string>
<string name="display_filter_game_profile">Usando el perfil %1$s: %2$s</string>
<string name="display_filter_default_profile">Usando el perfil predeterminado: %1$s</string>
</resources>
+7
View File
@@ -1168,6 +1168,11 @@
<string name="agent_tools_missing">Agentin työkaluja ei ole asennettu: %1$s</string>
<string name="agent_unqueue">Älä lähetä</string>
<string name="agent_attach">Liitä</string>
<string name="agent_attach_files">Tiedostot</string>
<string name="agent_photos_allow">Salli kuvien käyttö</string>
<string name="agent_photos_more">Valitse lisää kuvia</string>
<string name="agent_photos_empty">Ei vielä kuvia</string>
<string name="agent_keyboard">Näppäimistö</string>
<string name="agent_remove_attachment">Poista</string>
<string name="agent_model_default">Oletus</string>
<string name="agent_effort">Päättelyteho</string>
@@ -4165,4 +4170,6 @@
<string name="glasses_shortcut_group">Pelin aikainen pikakuvake</string>
<string name="glasses_show_shortcut">Näytä Smart Glasses -pikakuvake</string>
<string name="glasses_show_shortcut_hint">Näytä pelin päällä kelluva Smart Glasses -painike.</string>
<string name="display_filter_game_profile">Käytössä profiili %1$s: %2$s</string>
<string name="display_filter_default_profile">Käytössä oletusprofiili: %1$s</string>
</resources>
+7
View File
@@ -1171,6 +1171,11 @@
<string name="agent_tools_missing">Outils de l’agent non installés : %1$s</string>
<string name="agent_unqueue">Ne pas envoyer</string>
<string name="agent_attach">Joindre</string>
<string name="agent_attach_files">Fichiers</string>
<string name="agent_photos_allow">Autoriser l\'accès aux photos</string>
<string name="agent_photos_more">Choisir d\'autres photos</string>
<string name="agent_photos_empty">Aucune photo pour l\'instant</string>
<string name="agent_keyboard">Clavier</string>
<string name="agent_remove_attachment">Supprimer</string>
<string name="agent_model_default">Par défaut</string>
<string name="agent_effort">Effort de raisonnement</string>
@@ -4204,4 +4209,6 @@
<string name="glasses_shortcut_group">Raccourci en jeu</string>
<string name="glasses_show_shortcut">Afficher le raccourci Smart Glasses</string>
<string name="glasses_show_shortcut_hint">Afficher le bouton flottant Smart Glasses par-dessus le jeu.</string>
<string name="display_filter_game_profile">Profil %1$s utilisé : %2$s</string>
<string name="display_filter_default_profile">Profil par défaut utilisé : %1$s</string>
</resources>
+7
View File
@@ -1168,6 +1168,11 @@
<string name="agent_tools_missing">एजेंट टूल इंस्टॉल नहीं हुए: %1$s</string>
<string name="agent_unqueue">न भेजें</string>
<string name="agent_attach">संलग्न करें</string>
<string name="agent_attach_files">फ़ाइलें</string>
<string name="agent_photos_allow">फ़ोटो की अनुमति दें</string>
<string name="agent_photos_more">और फ़ोटो चुनें</string>
<string name="agent_photos_empty">अभी कोई फ़ोटो नहीं</string>
<string name="agent_keyboard">कीबोर्ड</string>
<string name="agent_remove_attachment">हटाएँ</string>
<string name="agent_model_default">डिफ़ॉल्ट</string>
<string name="agent_effort">सोचने का स्तर</string>
@@ -4165,4 +4170,6 @@
<string name="glasses_shortcut_group">गेम में शॉर्टकट</string>
<string name="glasses_show_shortcut">Smart Glasses शॉर्टकट दिखाएँ</string>
<string name="glasses_show_shortcut_hint">गेम के ऊपर तैरता हुआ Smart Glasses बटन दिखाएँ।</string>
<string name="display_filter_game_profile">%1$s प्रोफ़ाइल का उपयोग: %2$s</string>
<string name="display_filter_default_profile">डिफ़ॉल्ट प्रोफ़ाइल का उपयोग: %1$s</string>
</resources>
+7
View File
@@ -1168,6 +1168,11 @@
<string name="agent_tools_missing">Az ügynök eszközei nincsenek telepítve: %1$s</string>
<string name="agent_unqueue">Ne küldd el</string>
<string name="agent_attach">Csatolás</string>
<string name="agent_attach_files">Fájlok</string>
<string name="agent_photos_allow">Fotókhoz való hozzáférés engedélyezése</string>
<string name="agent_photos_more">További fotók kiválasztása</string>
<string name="agent_photos_empty">Még nincsenek fotók</string>
<string name="agent_keyboard">Billentyűzet</string>
<string name="agent_remove_attachment">Eltávolítás</string>
<string name="agent_model_default">Alapértelmezett</string>
<string name="agent_effort">Gondolkodási erőfeszítés</string>
@@ -4165,4 +4170,6 @@
<string name="glasses_shortcut_group">Játékon belüli parancsikon</string>
<string name="glasses_show_shortcut">Smart Glasses parancsikon megjelenítése</string>
<string name="glasses_show_shortcut_hint">A játék fölött lebegő Smart Glasses gomb megjelenítése.</string>
<string name="display_filter_game_profile">Használt profil: %1$s – %2$s</string>
<string name="display_filter_default_profile">Alapértelmezett profil használata: %1$s</string>
</resources>
+7
View File
@@ -1165,6 +1165,11 @@
<string name="agent_tools_missing">Alat agen tidak terpasang: %1$s</string>
<string name="agent_unqueue">Jangan kirim</string>
<string name="agent_attach">Lampirkan</string>
<string name="agent_attach_files">File</string>
<string name="agent_photos_allow">Izinkan akses foto</string>
<string name="agent_photos_more">Pilih foto lainnya</string>
<string name="agent_photos_empty">Belum ada foto</string>
<string name="agent_keyboard">Keyboard</string>
<string name="agent_remove_attachment">Hapus</string>
<string name="agent_model_default">Default</string>
<string name="agent_effort">Upaya penalaran</string>
@@ -4135,4 +4140,6 @@
<string name="glasses_shortcut_group">Pintasan dalam game</string>
<string name="glasses_show_shortcut">Tampilkan pintasan Smart Glasses</string>
<string name="glasses_show_shortcut_hint">Tampilkan tombol Smart Glasses mengambang di atas game.</string>
<string name="display_filter_game_profile">Menggunakan profil %1$s: %2$s</string>
<string name="display_filter_default_profile">Menggunakan profil default: %1$s</string>
</resources>
+7
View File
@@ -1163,6 +1163,11 @@
<string name="agent_tools_missing">Strumenti dell’agente non installati: %1$s</string>
<string name="agent_unqueue">Non inviare</string>
<string name="agent_attach">Allega</string>
<string name="agent_attach_files">File</string>
<string name="agent_photos_allow">Consenti accesso alle foto</string>
<string name="agent_photos_more">Scegli altre foto</string>
<string name="agent_photos_empty">Ancora nessuna foto</string>
<string name="agent_keyboard">Tastiera</string>
<string name="agent_remove_attachment">Rimuovi</string>
<string name="agent_model_default">Predefinito</string>
<string name="agent_effort">Livello di ragionamento</string>
@@ -4204,4 +4209,6 @@
<string name="glasses_shortcut_group">Scorciatoia nel gioco</string>
<string name="glasses_show_shortcut">Mostra scorciatoia Smart Glasses</string>
<string name="glasses_show_shortcut_hint">Mostra il pulsante mobile Smart Glasses sopra il gioco.</string>
<string name="display_filter_game_profile">Profilo %1$s in uso: %2$s</string>
<string name="display_filter_default_profile">Profilo predefinito in uso: %1$s</string>
</resources>
+7
View File
@@ -1165,6 +1165,11 @@
<string name="agent_tools_missing">エージェントのツールが未インストール: %1$s</string>
<string name="agent_unqueue">送信しない</string>
<string name="agent_attach">添付</string>
<string name="agent_attach_files">ファイル</string>
<string name="agent_photos_allow">写真へのアクセスを許可</string>
<string name="agent_photos_more">写真をさらに選択</string>
<string name="agent_photos_empty">まだ写真がありません</string>
<string name="agent_keyboard">キーボード</string>
<string name="agent_remove_attachment">削除</string>
<string name="agent_model_default">デフォルト</string>
<string name="agent_effort">推論レベル</string>
@@ -4135,4 +4140,6 @@
<string name="glasses_shortcut_group">ゲーム内ショートカット</string>
<string name="glasses_show_shortcut">Smart Glasses のショートカットを表示</string>
<string name="glasses_show_shortcut_hint">ゲーム画面上に Smart Glasses のフローティングボタンを表示します。</string>
<string name="display_filter_game_profile">%1$s プロファイルを使用中: %2$s</string>
<string name="display_filter_default_profile">デフォルトプロファイルを使用中: %1$s</string>
</resources>
+7
View File
@@ -1165,6 +1165,11 @@
<string name="agent_tools_missing">에이전트 도구가 설치되지 않음: %1$s</string>
<string name="agent_unqueue">보내지 않기</string>
<string name="agent_attach">첨부</string>
<string name="agent_attach_files">파일</string>
<string name="agent_photos_allow">사진 접근 허용</string>
<string name="agent_photos_more">사진 더 선택</string>
<string name="agent_photos_empty">아직 사진이 없습니다</string>
<string name="agent_keyboard">키보드</string>
<string name="agent_remove_attachment">제거</string>
<string name="agent_model_default">기본</string>
<string name="agent_effort">추론 수준</string>
@@ -4135,4 +4140,6 @@
<string name="glasses_shortcut_group">게임 내 바로가기</string>
<string name="glasses_show_shortcut">Smart Glasses 바로가기 표시</string>
<string name="glasses_show_shortcut_hint">게임 위에 떠 있는 Smart Glasses 버튼을 표시합니다.</string>
<string name="display_filter_game_profile">%1$s 프로필 사용 중: %2$s</string>
<string name="display_filter_default_profile">기본 프로필 사용 중: %1$s</string>
</resources>
+7
View File
@@ -1165,6 +1165,11 @@
<string name="agent_tools_missing">Alat ejen tidak dipasang: %1$s</string>
<string name="agent_unqueue">Jangan hantar</string>
<string name="agent_attach">Lampirkan</string>
<string name="agent_attach_files">Fail</string>
<string name="agent_photos_allow">Benarkan akses foto</string>
<string name="agent_photos_more">Pilih lebih banyak foto</string>
<string name="agent_photos_empty">Belum ada foto</string>
<string name="agent_keyboard">Papan kekunci</string>
<string name="agent_remove_attachment">Alih keluar</string>
<string name="agent_model_default">Lalai</string>
<string name="agent_effort">Usaha penaakulan</string>
@@ -4135,4 +4140,6 @@
<string name="glasses_shortcut_group">Pintasan dalam permainan</string>
<string name="glasses_show_shortcut">Tunjukkan pintasan Smart Glasses</string>
<string name="glasses_show_shortcut_hint">Tunjukkan butang Smart Glasses terapung di atas permainan.</string>
<string name="display_filter_game_profile">Menggunakan profil %1$s: %2$s</string>
<string name="display_filter_default_profile">Menggunakan profil lalai: %1$s</string>
</resources>
+7
View File
@@ -1168,6 +1168,11 @@
<string name="agent_tools_missing">Agentverktøy er ikke installert: %1$s</string>
<string name="agent_unqueue">Ikke send</string>
<string name="agent_attach">Legg ved</string>
<string name="agent_attach_files">Filer</string>
<string name="agent_photos_allow">Tillat tilgang til bilder</string>
<string name="agent_photos_more">Velg flere bilder</string>
<string name="agent_photos_empty">Ingen bilder ennå</string>
<string name="agent_keyboard">Tastatur</string>
<string name="agent_remove_attachment">Fjern</string>
<string name="agent_model_default">Standard</string>
<string name="agent_effort">Resonneringsinnsats</string>
@@ -4165,4 +4170,6 @@
<string name="glasses_shortcut_group">Snarvei i spillet</string>
<string name="glasses_show_shortcut">Vis Smart Glasses-snarvei</string>
<string name="glasses_show_shortcut_hint">Vis den flytende Smart Glasses-knappen over spillet.</string>
<string name="display_filter_game_profile">Bruker profilen %1$s: %2$s</string>
<string name="display_filter_default_profile">Bruker standardprofilen: %1$s</string>
</resources>
+7
View File
@@ -1168,6 +1168,11 @@
<string name="agent_tools_missing">Agenttools niet geïnstalleerd: %1$s</string>
<string name="agent_unqueue">Niet verzenden</string>
<string name="agent_attach">Bijvoegen</string>
<string name="agent_attach_files">Bestanden</string>
<string name="agent_photos_allow">Toegang tot foto\'s toestaan</string>
<string name="agent_photos_more">Meer foto\'s kiezen</string>
<string name="agent_photos_empty">Nog geen foto\'s</string>
<string name="agent_keyboard">Toetsenbord</string>
<string name="agent_remove_attachment">Verwijderen</string>
<string name="agent_model_default">Standaard</string>
<string name="agent_effort">Redeneerinspanning</string>
@@ -4165,4 +4170,6 @@
<string name="glasses_shortcut_group">Snelkoppeling in game</string>
<string name="glasses_show_shortcut">Smart Glasses-snelkoppeling tonen</string>
<string name="glasses_show_shortcut_hint">Toon de zwevende Smart Glasses-knop boven het spel.</string>
<string name="display_filter_game_profile">Profiel %1$s in gebruik: %2$s</string>
<string name="display_filter_default_profile">Standaardprofiel in gebruik: %1$s</string>
</resources>
+7
View File
@@ -1174,6 +1174,11 @@
<string name="agent_tools_missing">Narzędzia agenta nie są zainstalowane: %1$s</string>
<string name="agent_unqueue">Nie wysyłaj</string>
<string name="agent_attach">Załącz</string>
<string name="agent_attach_files">Pliki</string>
<string name="agent_photos_allow">Zezwól na dostęp do zdjęć</string>
<string name="agent_photos_more">Wybierz więcej zdjęć</string>
<string name="agent_photos_empty">Brak zdjęć</string>
<string name="agent_keyboard">Klawiatura</string>
<string name="agent_remove_attachment">Usuń</string>
<string name="agent_model_default">Domyślny</string>
<string name="agent_effort">Poziom rozumowania</string>
@@ -4245,4 +4250,6 @@
<string name="glasses_shortcut_group">Skrót w grze</string>
<string name="glasses_show_shortcut">Pokaż skrót Smart Glasses</string>
<string name="glasses_show_shortcut_hint">Pokaż pływający przycisk Smart Glasses nad grą.</string>
<string name="display_filter_game_profile">Używany profil %1$s: %2$s</string>
<string name="display_filter_default_profile">Używany profil domyślny: %1$s</string>
</resources>
@@ -1163,6 +1163,11 @@
<string name="agent_tools_missing">Ferramentas do agente não instaladas: %1$s</string>
<string name="agent_unqueue">Não enviar</string>
<string name="agent_attach">Anexar</string>
<string name="agent_attach_files">Ficheiros</string>
<string name="agent_photos_allow">Permitir acesso às fotos</string>
<string name="agent_photos_more">Escolher mais fotos</string>
<string name="agent_photos_empty">Ainda não há fotos</string>
<string name="agent_keyboard">Teclado</string>
<string name="agent_remove_attachment">Remover</string>
<string name="agent_model_default">Predefinido</string>
<string name="agent_effort">Esforço de raciocínio</string>
@@ -4204,4 +4209,6 @@
<string name="glasses_shortcut_group">Atalho no jogo</string>
<string name="glasses_show_shortcut">Mostrar atalho do Smart Glasses</string>
<string name="glasses_show_shortcut_hint">Mostrar o botão flutuante do Smart Glasses sobre o jogo.</string>
<string name="display_filter_game_profile">Perfil %1$s em utilização: %2$s</string>
<string name="display_filter_default_profile">Perfil predefinido em utilização: %1$s</string>
</resources>
+7
View File
@@ -1170,6 +1170,11 @@
<string name="agent_tools_missing">Ferramentas do agente não instaladas: %1$s</string>
<string name="agent_unqueue">Não enviar</string>
<string name="agent_attach">Anexar</string>
<string name="agent_attach_files">Arquivos</string>
<string name="agent_photos_allow">Permitir acesso às fotos</string>
<string name="agent_photos_more">Escolher mais fotos</string>
<string name="agent_photos_empty">Ainda não há fotos</string>
<string name="agent_keyboard">Teclado</string>
<string name="agent_remove_attachment">Remover</string>
<string name="agent_model_default">Padrão</string>
<string name="agent_effort">Esforço de raciocínio</string>
@@ -4212,4 +4217,6 @@
<string name="glasses_shortcut_group">Atalho durante o jogo</string>
<string name="glasses_show_shortcut">Mostrar atalho do Smart Glasses</string>
<string name="glasses_show_shortcut_hint">Mostrar o botão flutuante do Smart Glasses sobre o jogo.</string>
<string name="display_filter_game_profile">Perfil %1$s em uso: %2$s</string>
<string name="display_filter_default_profile">Perfil predefinido em uso: %1$s</string>
</resources>
+7
View File
@@ -1171,6 +1171,11 @@
<string name="agent_tools_missing">Instrumentele agentului nu sunt instalate: %1$s</string>
<string name="agent_unqueue">Nu trimite</string>
<string name="agent_attach">Atașează</string>
<string name="agent_attach_files">Fișiere</string>
<string name="agent_photos_allow">Permite accesul la fotografii</string>
<string name="agent_photos_more">Alege mai multe fotografii</string>
<string name="agent_photos_empty">Încă nu există fotografii</string>
<string name="agent_keyboard">Tastatură</string>
<string name="agent_remove_attachment">Elimină</string>
<string name="agent_model_default">Implicit</string>
<string name="agent_effort">Efort de raționament</string>
@@ -4205,4 +4210,6 @@
<string name="glasses_shortcut_group">Comandă rapidă în joc</string>
<string name="glasses_show_shortcut">Afișează comanda rapidă Smart Glasses</string>
<string name="glasses_show_shortcut_hint">Afișează butonul plutitor Smart Glasses peste joc.</string>
<string name="display_filter_game_profile">Se folosește profilul %1$s: %2$s</string>
<string name="display_filter_default_profile">Se folosește profilul implicit: %1$s</string>
</resources>
+7
View File
@@ -1174,6 +1174,11 @@
<string name="agent_tools_missing">Инструменты агента не установлены: %1$s</string>
<string name="agent_unqueue">Не отправлять</string>
<string name="agent_attach">Прикрепить</string>
<string name="agent_attach_files">Файлы</string>
<string name="agent_photos_allow">Разрешить доступ к фото</string>
<string name="agent_photos_more">Выбрать ещё фото</string>
<string name="agent_photos_empty">Пока нет фото</string>
<string name="agent_keyboard">Клавиатура</string>
<string name="agent_remove_attachment">Удалить</string>
<string name="agent_model_default">По умолчанию</string>
<string name="agent_effort">Уровень рассуждений</string>
@@ -4246,4 +4251,6 @@
<string name="glasses_shortcut_group">Ярлык в игре</string>
<string name="glasses_show_shortcut">Показывать ярлык Smart Glasses</string>
<string name="glasses_show_shortcut_hint">Показывать плавающую кнопку Smart Glasses поверх игры.</string>
<string name="display_filter_game_profile">Используется профиль %1$s: %2$s</string>
<string name="display_filter_default_profile">Используется профиль по умолчанию: %1$s</string>
</resources>
+7
View File
@@ -1168,6 +1168,11 @@
<string name="agent_tools_missing">Agentens verktyg är inte installerade: %1$s</string>
<string name="agent_unqueue">Skicka inte</string>
<string name="agent_attach">Bifoga</string>
<string name="agent_attach_files">Filer</string>
<string name="agent_photos_allow">Tillåt åtkomst till bilder</string>
<string name="agent_photos_more">Välj fler bilder</string>
<string name="agent_photos_empty">Inga bilder än</string>
<string name="agent_keyboard">Tangentbord</string>
<string name="agent_remove_attachment">Ta bort</string>
<string name="agent_model_default">Standard</string>
<string name="agent_effort">Resonemangsnivå</string>
@@ -4165,4 +4170,6 @@
<string name="glasses_shortcut_group">Genväg i spelet</string>
<string name="glasses_show_shortcut">Visa Smart Glasses-genväg</string>
<string name="glasses_show_shortcut_hint">Visa den flytande Smart Glasses-knappen ovanpå spelet.</string>
<string name="display_filter_game_profile">Använder profilen %1$s: %2$s</string>
<string name="display_filter_default_profile">Använder standardprofilen: %1$s</string>
</resources>
+7
View File
@@ -1165,6 +1165,11 @@
<string name="agent_tools_missing">ยังไม่ได้ติดตั้งเครื่องมือของเอเจนต์: %1$s</string>
<string name="agent_unqueue">ไม่ต้องส่ง</string>
<string name="agent_attach">แนบ</string>
<string name="agent_attach_files">ไฟล์</string>
<string name="agent_photos_allow">อนุญาตให้เข้าถึงรูปภาพ</string>
<string name="agent_photos_more">เลือกรูปภาพเพิ่ม</string>
<string name="agent_photos_empty">ยังไม่มีรูปภาพ</string>
<string name="agent_keyboard">แป้นพิมพ์</string>
<string name="agent_remove_attachment">นำออก</string>
<string name="agent_model_default">ค่าเริ่มต้น</string>
<string name="agent_effort">ระดับการใช้เหตุผล</string>
@@ -4135,4 +4140,6 @@
<string name="glasses_shortcut_group">ทางลัดในเกม</string>
<string name="glasses_show_shortcut">แสดงทางลัด Smart Glasses</string>
<string name="glasses_show_shortcut_hint">แสดงปุ่ม Smart Glasses แบบลอยทับบนเกม</string>
<string name="display_filter_game_profile">ใช้โปรไฟล์ %1$s: %2$s</string>
<string name="display_filter_default_profile">ใช้โปรไฟล์เริ่มต้น: %1$s</string>
</resources>
+7
View File
@@ -1160,6 +1160,11 @@
<string name="agent_tools_missing">Ajan araçları yüklenmedi: %1$s</string>
<string name="agent_unqueue">Gönderme</string>
<string name="agent_attach">Ekle</string>
<string name="agent_attach_files">Dosyalar</string>
<string name="agent_photos_allow">Fotoğraflara erişime izin ver</string>
<string name="agent_photos_more">Daha fazla fotoğraf seç</string>
<string name="agent_photos_empty">Henüz fotoğraf yok</string>
<string name="agent_keyboard">Klavye</string>
<string name="agent_remove_attachment">Kaldır</string>
<string name="agent_model_default">Varsayılan</string>
<string name="agent_effort">Akıl yürütme çabası</string>
@@ -4165,4 +4170,6 @@
<string name="glasses_shortcut_group">Oyun içi kısayol</string>
<string name="glasses_show_shortcut">Smart Glasses kısayolunu göster</string>
<string name="glasses_show_shortcut_hint">Oyun üzerinde yüzen Smart Glasses düğmesini göster.</string>
<string name="display_filter_game_profile">%1$s profili kullanılıyor: %2$s</string>
<string name="display_filter_default_profile">Varsayılan profil kullanılıyor: %1$s</string>
</resources>
+7
View File
@@ -1174,6 +1174,11 @@
<string name="agent_tools_missing">Інструменти агента не встановлено: %1$s</string>
<string name="agent_unqueue">Не надсилати</string>
<string name="agent_attach">Прикріпити</string>
<string name="agent_attach_files">Файли</string>
<string name="agent_photos_allow">Дозволити доступ до фото</string>
<string name="agent_photos_more">Вибрати ще фото</string>
<string name="agent_photos_empty">Поки немає фото</string>
<string name="agent_keyboard">Клавіатура</string>
<string name="agent_remove_attachment">Видалити</string>
<string name="agent_model_default">За замовчуванням</string>
<string name="agent_effort">Рівень міркувань</string>
@@ -4245,4 +4250,6 @@
<string name="glasses_shortcut_group">Ярлик у грі</string>
<string name="glasses_show_shortcut">Показувати ярлик Smart Glasses</string>
<string name="glasses_show_shortcut_hint">Показувати плаваючу кнопку Smart Glasses поверх гри.</string>
<string name="display_filter_game_profile">Використовується профіль %1$s: %2$s</string>
<string name="display_filter_default_profile">Використовується профіль за замовчуванням: %1$s</string>
</resources>
+7
View File
@@ -1165,6 +1165,11 @@
<string name="agent_tools_missing">Chưa cài công cụ của tác tử: %1$s</string>
<string name="agent_unqueue">Không gửi</string>
<string name="agent_attach">Đính kèm</string>
<string name="agent_attach_files">Tệp</string>
<string name="agent_photos_allow">Cho phép truy cập ảnh</string>
<string name="agent_photos_more">Chọn thêm ảnh</string>
<string name="agent_photos_empty">Chưa có ảnh</string>
<string name="agent_keyboard">Bàn phím</string>
<string name="agent_remove_attachment">Xóa</string>
<string name="agent_model_default">Mặc định</string>
<string name="agent_effort">Mức độ lập luận</string>
@@ -4135,4 +4140,6 @@
<string name="glasses_shortcut_group">Lối tắt trong trò chơi</string>
<string name="glasses_show_shortcut">Hiển thị lối tắt Smart Glasses</string>
<string name="glasses_show_shortcut_hint">Hiển thị nút Smart Glasses nổi phía trên trò chơi.</string>
<string name="display_filter_game_profile">Đang dùng hồ sơ %1$s: %2$s</string>
<string name="display_filter_default_profile">Đang dùng hồ sơ mặc định: %1$s</string>
</resources>
@@ -1248,6 +1248,11 @@
<string name="agent_tools_missing">智能体工具未安装:%1$s</string>
<string name="agent_unqueue">不发送</string>
<string name="agent_attach">添加附件</string>
<string name="agent_attach_files">文件</string>
<string name="agent_photos_allow">允许访问照片</string>
<string name="agent_photos_more">选择更多照片</string>
<string name="agent_photos_empty">还没有照片</string>
<string name="agent_keyboard">键盘</string>
<string name="agent_remove_attachment">移除</string>
<string name="agent_model_default">默认</string>
<string name="agent_effort">推理强度</string>
@@ -4133,4 +4138,6 @@
<string name="glasses_shortcut_group">游戏内快捷方式</string>
<string name="glasses_show_shortcut">显示 Smart Glasses 快捷方式</string>
<string name="glasses_show_shortcut_hint">在游戏画面上显示悬浮的 Smart Glasses 按钮。</string>
<string name="display_filter_game_profile">正在使用 %1$s 配置:%2$s</string>
<string name="display_filter_default_profile">正在使用默认配置:%1$s</string>
</resources>
@@ -1164,6 +1164,11 @@
<string name="agent_tools_missing">智能體工具未安裝:%1$s</string>
<string name="agent_unqueue">不要傳送</string>
<string name="agent_attach">附加</string>
<string name="agent_attach_files">檔案</string>
<string name="agent_photos_allow">允許存取相片</string>
<string name="agent_photos_more">選擇更多相片</string>
<string name="agent_photos_empty">尚未有相片</string>
<string name="agent_keyboard">鍵盤</string>
<string name="agent_remove_attachment">移除</string>
<string name="agent_model_default">預設</string>
<string name="agent_effort">推理強度</string>
@@ -4133,4 +4138,6 @@
<string name="glasses_shortcut_group">遊戲內捷徑</string>
<string name="glasses_show_shortcut">顯示 Smart Glasses 捷徑</string>
<string name="glasses_show_shortcut_hint">在遊戲畫面上顯示浮動的 Smart Glasses 按鈕。</string>
<string name="display_filter_game_profile">正在使用 %1$s 設定檔:%2$s</string>
<string name="display_filter_default_profile">正在使用預設設定檔:%1$s</string>
</resources>
@@ -1164,6 +1164,11 @@
<string name="agent_tools_missing">智慧代理工具未安裝:%1$s</string>
<string name="agent_unqueue">不要傳送</string>
<string name="agent_attach">附加</string>
<string name="agent_attach_files">檔案</string>
<string name="agent_photos_allow">允許存取相片</string>
<string name="agent_photos_more">選擇更多相片</string>
<string name="agent_photos_empty">還沒有相片</string>
<string name="agent_keyboard">鍵盤</string>
<string name="agent_remove_attachment">移除</string>
<string name="agent_model_default">預設</string>
<string name="agent_effort">推理強度</string>
@@ -4133,4 +4138,6 @@
<string name="glasses_shortcut_group">遊戲內捷徑</string>
<string name="glasses_show_shortcut">顯示 Smart Glasses 捷徑</string>
<string name="glasses_show_shortcut_hint">在遊戲畫面上顯示浮動的 Smart Glasses 按鈕。</string>
<string name="display_filter_game_profile">正在使用 %1$s 設定檔:%2$s</string>
<string name="display_filter_default_profile">正在使用預設設定檔:%1$s</string>
</resources>
+7
View File
@@ -1330,6 +1330,11 @@
<string name="agent_tools_missing">Agent tools not installed: %1$s</string>
<string name="agent_unqueue">Don\'t send</string>
<string name="agent_attach">Attach</string>
<string name="agent_attach_files">Files</string>
<string name="agent_photos_allow">Allow photo access</string>
<string name="agent_photos_more">Choose more photos</string>
<string name="agent_photos_empty">No photos yet</string>
<string name="agent_keyboard">Keyboard</string>
<string name="agent_remove_attachment">Remove</string>
<string name="agent_model_default">Default</string>
<string name="agent_effort">Reasoning effort</string>
@@ -2852,6 +2857,8 @@
<string name="display_filter_hint">Shared by Steam and Desktop.</string>
<string name="display_filter_live">Applies live. Shared by Steam and Desktop.</string>
<string name="display_filter_note">FSR, GSR and NIS apply when enlarging the session image. Sharpen only also works without enlargement.</string>
<string name="display_filter_game_profile">Using %1$s profile: %2$s</string>
<string name="display_filter_default_profile">Using Default profile: %1$s</string>
<string name="display_sharpness">Filter sharpness</string>
<string name="display_look_filter">%1$s Sets scaling to %2$s.</string>
<string name="display_match_screen">Match screen (%1$d×%2$d)</string>
@@ -181,6 +181,17 @@ class ProtonExtrasTest {
assertEquals(emptyList<String>(), ProtonExtras.installedIn(File(tools, "missing"), tool("ge")))
}
@Test
fun x86_64BuildsAreNotTakenForTheArm64Tool() {
val tools = temp.newFolder("compatibilitytools.d")
for (name in listOf("DroidDeck-Proton 11-7.5", "DroidDeck-Proton-11-14.2-x86_64")) installTool(tools, name)
File(tools, "DroidDeck-Proton-11-14.2-x86_64/files/lib/wine/x86_64-unix").mkdirs()
File(tools, "DroidDeck-Proton 11-7.5/files/lib/wine/x86_64-unix").mkdirs()
File(tools, "DroidDeck-Proton 11-7.5/files/bin-arm64").mkdirs()
assertEquals(listOf("DroidDeck-Proton 11-7.5"), ProtonExtras.installedIn(tools, tool("droiddeck")))
assertTrue(ProtonExtras.x86_64Build(File(tools, "DroidDeck-Proton-11-14.2-x86_64")))
}
@Test
fun interruptedBuildsAreNotReportedAsInstalled() {
val tools = temp.newFolder("compatibilitytools.d")
@@ -0,0 +1,79 @@
package com.droiddeck.launcher.session
import android.content.Context
import org.json.JSONObject
import org.junit.Assert.assertEquals
import org.junit.Assert.assertFalse
import org.junit.Assert.assertTrue
import org.junit.Before
import org.junit.Test
import org.junit.runner.RunWith
import org.robolectric.RobolectricTestRunner
import org.robolectric.RuntimeEnvironment
import org.robolectric.annotation.Config
@RunWith(RobolectricTestRunner::class)
@Config(sdk = [28], manifest = Config.NONE)
class SessionPrefsUpscalerTest {
private lateinit var context: Context
@Before fun setUp() {
context = RuntimeEnvironment.getApplication()
context.getSharedPreferences("session", Context.MODE_PRIVATE).edit().clear().commit()
}
@Test fun gameOverridesAreIsolatedAndFallBackToTheGlobalFilter() {
SessionPrefs.setUpscaler(context, 4)
SessionPrefs.setGameUpscaler(context, "12345", 7)
assertEquals(4, SessionPrefs.upscaler(context))
assertEquals(7, SessionPrefs.screenEffectsUpscaler(context, "game:12345"))
assertEquals(4, SessionPrefs.screenEffectsUpscaler(context, "game:54321"))
assertTrue(SessionPrefs.hasGameUpscalerOverride(context, "12345"))
assertFalse(SessionPrefs.hasGameUpscalerOverride(context, "54321"))
assertFalse(SessionPrefs.hasScreenEffectsOverride(context, "game:12345"))
}
@Test fun resettingGameOverrideRestoresTheGlobalFilter() {
SessionPrefs.setUpscaler(context, 3)
SessionPrefs.setGameUpscaler(context, "12345", 6)
SessionPrefs.clearGameUpscaler(context, "12345")
assertFalse(SessionPrefs.hasGameUpscalerOverride(context, "12345"))
assertEquals(3, SessionPrefs.screenEffectsUpscaler(context, "game:12345"))
}
@Test fun screenEffectsUpscalerApiKeepsGameFiltersSeparateFromScreenEffects() {
SessionPrefs.setUpscaler(context, 4)
SessionPrefs.setScreenEffectsUpscaler(context, "game:12345", 8)
assertEquals(8, SessionPrefs.screenEffectsUpscaler(context, "game:12345"))
assertFalse(SessionPrefs.hasScreenEffectsOverride(context, "game:12345"))
}
@Test fun legacyGameFilterOverridesRemainReadableAndCanBeReset() {
val profile = JSONObject().put("upscaler", 6)
val profiles = JSONObject().put("game:12345", profile)
context.getSharedPreferences("session", Context.MODE_PRIVATE).edit()
.putString("screenEffects.profiles", profiles.toString()).commit()
assertTrue(SessionPrefs.hasGameUpscalerOverride(context, "12345"))
assertEquals(6, SessionPrefs.screenEffectsUpscaler(context, "game:12345"))
SessionPrefs.clearGameUpscaler(context, "12345")
assertFalse(SessionPrefs.hasGameUpscalerOverride(context, "12345"))
assertEquals(2, SessionPrefs.screenEffectsUpscaler(context, "game:12345"))
assertFalse(SessionPrefs.hasScreenEffectsOverride(context, "game:12345"))
}
@Test fun deletingGameScreenEffectsProfileClearsUpscalerOverrideEvenWithoutEffectsProfile() {
SessionPrefs.setGameUpscaler(context, "12345", 6)
SessionPrefs.deleteScreenEffectsProfile(context, "game:12345")
assertFalse(SessionPrefs.hasGameUpscalerOverride(context, "12345"))
assertEquals(SessionPrefs.upscaler(context), SessionPrefs.screenEffectsUpscaler(context, "game:12345"))
}
}