mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-12-03 03:25:39 +00:00
Compare commits
8
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8cf1e60cc2 | ||
|
|
e3faee459f | ||
|
|
20df8b1858 | ||
|
|
4ab9635ceb | ||
|
|
34fff40b56 | ||
|
|
5d05c36033 | ||
|
|
ec281db0d1 | ||
|
|
1a7a116939 |
No files matched your search
@@ -7,7 +7,7 @@ on:
|
||||
push:
|
||||
branches: [main]
|
||||
workflow_run:
|
||||
workflows: [Build APK]
|
||||
workflows: [Build APK, Unit tests]
|
||||
types: [completed]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
@@ -21,6 +21,12 @@ permissions:
|
||||
pull-requests: read
|
||||
statuses: write
|
||||
|
||||
# Build APK and Unit tests each trigger a validation, and the last one to post sets the status. Queued runs for a
|
||||
# commit wait, so the newest one reads both results and posts last.
|
||||
concurrency:
|
||||
group: build-validation-${{ github.event.pull_request.head.sha || github.event.workflow_run.head_sha || inputs.pr_number || github.sha }}
|
||||
cancel-in-progress: false
|
||||
|
||||
jobs:
|
||||
validate:
|
||||
name: Validate source and build result
|
||||
|
||||
+10
-120
@@ -1,5 +1,5 @@
|
||||
name: Build APK
|
||||
run-name: ${{ github.event_name == 'pull_request' && format('building pr {0} on {1}', github.event.pull_request.number, github.event.pull_request.head.sha) || format('building {0} on {1}', github.ref_name, github.sha) }}
|
||||
run-name: ${{ github.event_name == 'pull_request' && format('building pr {0} on {1} against {2}', github.event.pull_request.number, github.event.pull_request.head.sha, github.event.pull_request.base.sha) || format('building {0} on {1}', github.ref_name, github.sha) }}
|
||||
|
||||
on:
|
||||
push:
|
||||
@@ -57,15 +57,18 @@ jobs:
|
||||
- name: Pin and merge the APK source
|
||||
id: merge
|
||||
if: github.event_name == 'pull_request'
|
||||
env:
|
||||
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git fetch --no-tags origin main
|
||||
echo "base-sha=$(git rev-parse origin/main)" >> "$GITHUB_OUTPUT"
|
||||
# Unit tests uses the same event snapshot, including when either workflow is rerun.
|
||||
git fetch --no-tags origin "$PR_BASE_SHA"
|
||||
echo "base-sha=$PR_BASE_SHA" >> "$GITHUB_OUTPUT"
|
||||
git config user.name "ci"
|
||||
git config user.email "ci@users.noreply.github.com"
|
||||
# Partial clone: a merged blob that only exists in a fork's history can't be lazily fetched (GitHub: "not our ref"); merge-tree writes it locally first.
|
||||
git merge-tree --write-tree HEAD origin/main >/dev/null || true
|
||||
git merge --no-ff --no-edit origin/main
|
||||
git merge-tree --write-tree HEAD FETCH_HEAD >/dev/null || true
|
||||
git merge --no-ff --no-edit FETCH_HEAD
|
||||
- name: Resolve trusted manifest base
|
||||
id: trusted
|
||||
if: github.event_name != 'pull_request'
|
||||
@@ -349,7 +352,7 @@ jobs:
|
||||
|
||||
build:
|
||||
needs: [source, components, xbox, build-runner]
|
||||
name: Compile APK and Android tests
|
||||
name: Compile APK
|
||||
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
|
||||
runs-on: ${{ fromJSON(needs.build-runner.outputs.labels) }}
|
||||
timeout-minutes: 45
|
||||
@@ -507,23 +510,7 @@ jobs:
|
||||
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
BUILD_REF: ${{ github.ref_name }}
|
||||
BUILD_SHA: ${{ github.sha }}
|
||||
run: |
|
||||
if [[ -n "$(git status --porcelain)" ]]; then
|
||||
tree_state=dirty
|
||||
else
|
||||
tree_state=clean
|
||||
fi
|
||||
echo "DROIDDECK_BUILD_TREE_STATE=$tree_state" >> "$GITHUB_ENV"
|
||||
if [[ -n "$PR_NUMBER" ]]; then
|
||||
label="pr${PR_NUMBER} at ${PR_HEAD_SHA:0:7}"
|
||||
else
|
||||
label="${BUILD_REF} at ${BUILD_SHA:0:7}"
|
||||
fi
|
||||
echo "label=$label" >> "$GITHUB_OUTPUT"
|
||||
echo "DROIDDECK_SOURCE_COMMIT=${PR_HEAD_SHA:-$BUILD_SHA}" >> "$GITHUB_ENV"
|
||||
echo "DROIDDECK_PR_NUMBER=${PR_NUMBER:-0}" >> "$GITHUB_ENV"
|
||||
echo "DROIDDECK_PR_TITLE=${PR_TITLE//$'\n'/ }" >> "$GITHUB_ENV"
|
||||
echo "Build: \`$label\`" >> "$GITHUB_STEP_SUMMARY"
|
||||
run: bash tools/ci/build-label.sh
|
||||
|
||||
- name: Rust toolchain for the store engines (aarch64-linux-android)
|
||||
id: rust
|
||||
@@ -734,101 +721,6 @@ jobs:
|
||||
if-no-files-found: ignore
|
||||
overwrite: true
|
||||
|
||||
- name: Resolve the Robolectric version
|
||||
id: robolectric
|
||||
run: |
|
||||
echo "version=$(grep -o "org.robolectric:robolectric:[0-9.]*" app/build.gradle | cut -d: -f3)" >> "$GITHUB_OUTPUT"
|
||||
# Robolectric downloads these from Maven Central on first use without retrying, and 429s fail whole test classes.
|
||||
# The cache path sits beside the workspace because runner homes are at different depths from it, and
|
||||
# actions/cache stores paths relative to the workspace. It is passed as an absolute path: the save action rejects
|
||||
# "..". Runners that keep their own ~/.m2 skip the cache.
|
||||
- name: Place Robolectric's Android jars beside the workspace
|
||||
id: robolectric-jars
|
||||
run: |
|
||||
set -euo pipefail
|
||||
jars="$GITHUB_WORKSPACE/../robolectric-jars"
|
||||
m2="$HOME/.m2/repository/org/robolectric/android-all-instrumented"
|
||||
if [ -d "$m2" ] && [ ! -L "$m2" ]; then
|
||||
echo "cache=false" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
mkdir -p "$jars" "$(dirname "$m2")"
|
||||
jars=$(cd "$jars" && pwd)
|
||||
ln -sfn "$jars" "$m2"
|
||||
echo "path=$jars" >> "$GITHUB_OUTPUT"
|
||||
echo "cache=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
- name: Restore Robolectric's Android jars
|
||||
id: robolectric-cache
|
||||
if: steps.robolectric-jars.outputs.cache == 'true'
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ${{ steps.robolectric-jars.outputs.path }}
|
||||
key: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-${{ github.run_id }}
|
||||
restore-keys: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-
|
||||
- name: Count the restored Robolectric jars
|
||||
if: steps.robolectric-jars.outputs.cache == 'true'
|
||||
run: echo "ROBOLECTRIC_JARS_BEFORE=$(find "$GITHUB_WORKSPACE/../robolectric-jars" -name '*.jar' | wc -l)" >> "$GITHUB_ENV"
|
||||
- name: Unit tests
|
||||
id: unit-tests
|
||||
env:
|
||||
DROIDDECK_BUILD_LABEL: ${{ steps.build-label.outputs.label }}
|
||||
SGDB_API_KEY: ${{ secrets.SGDB_API_KEY }}
|
||||
run: |
|
||||
set -o pipefail
|
||||
mkdir -p app/build
|
||||
# A Maven 429 fails every test class that needs the missing jar. The jars an attempt did get stay for the next.
|
||||
for wait in 60 180 0; do
|
||||
status=0
|
||||
./gradlew testReleaseUnitTest --console=plain --info --stacktrace -Drobolectric.logging=stderr -PndkVersion="$NDK_VERSION" 2>&1 | tee app/build/unit-tests.log || status=$?
|
||||
if [ "$status" = 0 ] || [ "$wait" = 0 ] || ! grep -Eq '^[[:space:]]*(Caused by: org\.gradle\.internal\.resource\.transport\.http\.HttpErrorStatusCodeException: Could not GET .*https://repo\.maven\.apache\.org/.*Received status code 429 from server|Caused by: java\.io\.IOException: Server returned HTTP response code: 429 for URL: https://repo\.maven\.apache\.org/)' app/build/unit-tests.log; then
|
||||
exit "$status"
|
||||
fi
|
||||
echo "::warning::Maven Central answered 429; running the unit tests again in ${wait}s"
|
||||
sleep "$wait"
|
||||
done
|
||||
|
||||
# actions/cache only saves when the job succeeds, so a run whose tests died on a Maven 429 never filled the cache.
|
||||
# Save the complete jars even after a failed test step, when this run added some; a partial download is dropped first.
|
||||
- name: Save Robolectric's Android jars
|
||||
id: robolectric-jars-final
|
||||
if: always() && steps.robolectric-jars.outputs.cache == 'true'
|
||||
run: |
|
||||
python3 - <<'PY'
|
||||
import glob, os, zipfile
|
||||
root = os.path.join(os.environ['GITHUB_WORKSPACE'], '..', 'robolectric-jars')
|
||||
for f in glob.glob(os.path.join(root, '**', '*'), recursive=True):
|
||||
if not os.path.isfile(f):
|
||||
continue
|
||||
try:
|
||||
ok = f.endswith('.jar') and zipfile.ZipFile(f).testzip() is None
|
||||
except Exception:
|
||||
ok = False
|
||||
if not ok:
|
||||
os.remove(f)
|
||||
PY
|
||||
after=$(find "$GITHUB_WORKSPACE/../robolectric-jars" -name '*.jar' | wc -l)
|
||||
[ "$after" -gt "${ROBOLECTRIC_JARS_BEFORE:-0}" ] && echo "save=true" >> "$GITHUB_OUTPUT" || true
|
||||
- name: Store Robolectric's Android jars
|
||||
if: always() && steps.robolectric-jars-final.outputs.save == 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: ${{ steps.robolectric-jars.outputs.path }}
|
||||
key: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-${{ github.run_id }}
|
||||
|
||||
- name: Upload unit test diagnostics
|
||||
id: unit-test-diagnostics
|
||||
if: always() && steps.unit-tests.outcome != 'skipped'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: unit-test-results
|
||||
path: |
|
||||
app/build/unit-tests.log
|
||||
app/build/test-results/testReleaseUnitTest/
|
||||
app/build/reports/tests/testReleaseUnitTest/
|
||||
if-no-files-found: ignore
|
||||
retention-days: 14
|
||||
overwrite: true
|
||||
|
||||
- name: Sign with the testkey (v1 + v2 + v3)
|
||||
run: |
|
||||
set -euo pipefail
|
||||
@@ -884,8 +776,6 @@ jobs:
|
||||
PR: ${{ github.event.pull_request.number }}
|
||||
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
|
||||
BUILD_OUTCOME: ${{ steps.build.outcome }}
|
||||
UNIT_TEST_OUTCOME: ${{ steps.unit-tests.outcome }}
|
||||
TEST_DIAGNOSTICS_URL: ${{ steps.unit-test-diagnostics.outputs.artifact-url }}
|
||||
APK_OUTCOME: ${{ steps.apk-upload.outcome }}
|
||||
run: bash tools/release/report-build.sh
|
||||
|
||||
|
||||
@@ -47,6 +47,13 @@ jobs:
|
||||
echo "::error::main ${GITHUB_SHA::7} has no successful Build APK run yet: wait for it, then release"
|
||||
exit 1
|
||||
fi
|
||||
tests=$(gh run list -R "$GITHUB_REPOSITORY" --workflow unit-tests.yml --branch main --commit "$GITHUB_SHA" \
|
||||
--json conclusion,event,headSha -L 20 |
|
||||
jq -r --arg sha "$GITHUB_SHA" '[.[] | select(.headSha == $sha and (.event == "push" or .event == "workflow_dispatch"))][0].conclusion // empty')
|
||||
if [ "$tests" != success ]; then
|
||||
echo "::error::main ${GITHUB_SHA::7} has no passing Unit tests run (${tests:-none yet}): fix or wait for it, then release"
|
||||
exit 1
|
||||
fi
|
||||
variants=$(awk '!/^#/ && NF { print $1 }' tools/release/variants.txt | jq -R . | jq -sc .)
|
||||
echo "run_id=$id" >> "$GITHUB_OUTPUT"
|
||||
echo "variants=$variants" >> "$GITHUB_OUTPUT"
|
||||
|
||||
@@ -0,0 +1,182 @@
|
||||
name: Unit tests
|
||||
run-name: ${{ github.event_name == 'pull_request' && format('unit tests for pr {0} on {1} against {2}', github.event.pull_request.number, github.event.pull_request.head.sha, github.event.pull_request.base.sha) || format('unit tests for {0} on {1}', github.ref_name, github.sha) }}
|
||||
|
||||
# Runs beside Build APK rather than inside it, so a test build is published as soon as the APK compiles.
|
||||
# Build validation folds this workflow's result into the "Build APK" commit status, and Release APKs requires it.
|
||||
on:
|
||||
push:
|
||||
branches: [ main ]
|
||||
paths-ignore:
|
||||
- '**/*.md'
|
||||
- 'LICENSE'
|
||||
- '.gitignore'
|
||||
- 'docs/**'
|
||||
- '.github/ISSUE_TEMPLATE/**'
|
||||
pull_request:
|
||||
branches: [ main ]
|
||||
types: [ opened, synchronize, reopened, ready_for_review ]
|
||||
paths-ignore:
|
||||
- '**/*.md'
|
||||
- 'LICENSE'
|
||||
- '.gitignore'
|
||||
- 'docs/**'
|
||||
- '.github/ISSUE_TEMPLATE/**'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: read
|
||||
|
||||
concurrency:
|
||||
group: unit-tests-${{ github.event.pull_request.number || (github.event_name == 'push' && 'main') || github.run_id }}
|
||||
cancel-in-progress: ${{ github.event_name == 'pull_request' || github.event_name == 'push' }}
|
||||
|
||||
jobs:
|
||||
unit-tests:
|
||||
name: Unit tests
|
||||
if: ${{ github.event_name != 'pull_request' || !github.event.pull_request.draft }}
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 45
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
|
||||
fetch-depth: 0
|
||||
sparse-checkout: |
|
||||
/*
|
||||
!/docs/releases/media/
|
||||
sparse-checkout-cone-mode: false
|
||||
persist-credentials: false
|
||||
|
||||
- name: Merge the pinned APK base
|
||||
if: github.event_name == 'pull_request'
|
||||
env:
|
||||
PR_BASE_SHA: ${{ github.event.pull_request.base.sha }}
|
||||
run: |
|
||||
set -euo pipefail
|
||||
git config user.name "ci"
|
||||
git config user.email "ci@users.noreply.github.com"
|
||||
git fetch --no-tags origin "$PR_BASE_SHA"
|
||||
git merge-tree --write-tree HEAD FETCH_HEAD >/dev/null || true
|
||||
git merge --no-ff --no-edit FETCH_HEAD || { echo "::error::the pull request conflicts with main; Build APK lists the files"; exit 1; }
|
||||
|
||||
- name: Check out MaliBridge
|
||||
run: git submodule update --init external/MaliBridge
|
||||
|
||||
- uses: actions/setup-java@v4
|
||||
with:
|
||||
distribution: temurin
|
||||
java-version: '17'
|
||||
|
||||
- uses: gradle/actions/setup-gradle@v4
|
||||
with:
|
||||
cache-read-only: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name != github.repository }}
|
||||
cache-cleanup: ${{ github.event_name == 'pull_request' && 'never' || 'on-success' }}
|
||||
|
||||
- name: Resolve the pinned Android NDK
|
||||
run: bash tools/ci/resolve-ndk.sh
|
||||
|
||||
- name: Set the APK build label
|
||||
id: build-label
|
||||
env:
|
||||
PR_NUMBER: ${{ github.event.pull_request.number }}
|
||||
PR_TITLE: ${{ github.event.pull_request.title }}
|
||||
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
|
||||
BUILD_REF: ${{ github.ref_name }}
|
||||
BUILD_SHA: ${{ github.sha }}
|
||||
run: bash tools/ci/build-label.sh
|
||||
|
||||
- name: Resolve the Robolectric version
|
||||
id: robolectric
|
||||
run: |
|
||||
echo "version=$(grep -o "org.robolectric:robolectric:[0-9.]*" app/build.gradle | cut -d: -f3)" >> "$GITHUB_OUTPUT"
|
||||
# Robolectric downloads these from Maven Central on first use without retrying, and 429s fail whole test classes.
|
||||
# The cache path sits beside the workspace because runner homes are at different depths from it, and
|
||||
# actions/cache stores paths relative to the workspace. It is passed as an absolute path: the save action rejects
|
||||
# "..". Runners that keep their own ~/.m2 skip the cache.
|
||||
- name: Place Robolectric's Android jars beside the workspace
|
||||
id: robolectric-jars
|
||||
run: |
|
||||
set -euo pipefail
|
||||
jars="$GITHUB_WORKSPACE/../robolectric-jars"
|
||||
m2="$HOME/.m2/repository/org/robolectric/android-all-instrumented"
|
||||
if [ -d "$m2" ] && [ ! -L "$m2" ]; then
|
||||
echo "cache=false" >> "$GITHUB_OUTPUT"
|
||||
else
|
||||
mkdir -p "$jars" "$(dirname "$m2")"
|
||||
jars=$(cd "$jars" && pwd)
|
||||
ln -sfn "$jars" "$m2"
|
||||
echo "path=$jars" >> "$GITHUB_OUTPUT"
|
||||
echo "cache=true" >> "$GITHUB_OUTPUT"
|
||||
fi
|
||||
- name: Restore Robolectric's Android jars
|
||||
id: robolectric-cache
|
||||
if: steps.robolectric-jars.outputs.cache == 'true'
|
||||
uses: actions/cache/restore@v4
|
||||
with:
|
||||
path: ${{ steps.robolectric-jars.outputs.path }}
|
||||
key: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-${{ github.run_id }}
|
||||
restore-keys: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-
|
||||
- name: Count the restored Robolectric jars
|
||||
if: steps.robolectric-jars.outputs.cache == 'true'
|
||||
run: echo "ROBOLECTRIC_JARS_BEFORE=$(find "$GITHUB_WORKSPACE/../robolectric-jars" -name '*.jar' | wc -l)" >> "$GITHUB_ENV"
|
||||
- name: Unit tests
|
||||
id: unit-tests
|
||||
env:
|
||||
DROIDDECK_BUILD_LABEL: ${{ steps.build-label.outputs.label }}
|
||||
SGDB_API_KEY: ${{ secrets.SGDB_API_KEY }}
|
||||
run: |
|
||||
set -o pipefail
|
||||
mkdir -p app/build
|
||||
# A Maven 429 fails every test class that needs the missing jar. The jars an attempt did get stay for the next.
|
||||
for wait in 60 180 0; do
|
||||
status=0
|
||||
./gradlew testReleaseUnitTest --console=plain --info --stacktrace -Drobolectric.logging=stderr -PskipRust=true -PunitTestsOnly=true -PndkVersion="$NDK_VERSION" 2>&1 | tee app/build/unit-tests.log || status=$?
|
||||
if [ "$status" = 0 ] || [ "$wait" = 0 ] || ! grep -Eq '^[[:space:]]*(Caused by: org\.gradle\.internal\.resource\.transport\.http\.HttpErrorStatusCodeException: Could not GET .*https://(repo\.maven\.apache\.org|repo1\.maven\.org)/.*Received status code 429 from server|Caused by: java\.io\.IOException: Server returned HTTP response code: 429 for URL: https://(repo\.maven\.apache\.org|repo1\.maven\.org)/)' app/build/unit-tests.log; then
|
||||
exit "$status"
|
||||
fi
|
||||
echo "::warning::Maven Central answered 429; running the unit tests again in ${wait}s"
|
||||
sleep "$wait"
|
||||
done
|
||||
|
||||
# actions/cache only saves when the job succeeds, so a run whose tests died on a Maven 429 never filled the cache.
|
||||
# Save the complete jars even after a failed test step, when this run added some; a partial download is dropped first.
|
||||
- name: Save Robolectric's Android jars
|
||||
id: robolectric-jars-final
|
||||
if: always() && steps.robolectric-jars.outputs.cache == 'true'
|
||||
run: |
|
||||
python3 - <<'PY'
|
||||
import glob, os, zipfile
|
||||
root = os.path.join(os.environ['GITHUB_WORKSPACE'], '..', 'robolectric-jars')
|
||||
for f in glob.glob(os.path.join(root, '**', '*'), recursive=True):
|
||||
if not os.path.isfile(f):
|
||||
continue
|
||||
try:
|
||||
ok = f.endswith('.jar') and zipfile.ZipFile(f).testzip() is None
|
||||
except Exception:
|
||||
ok = False
|
||||
if not ok:
|
||||
os.remove(f)
|
||||
PY
|
||||
after=$(find "$GITHUB_WORKSPACE/../robolectric-jars" -name '*.jar' | wc -l)
|
||||
[ "$after" -gt "${ROBOLECTRIC_JARS_BEFORE:-0}" ] && echo "save=true" >> "$GITHUB_OUTPUT" || true
|
||||
- name: Store Robolectric's Android jars
|
||||
if: always() && steps.robolectric-jars-final.outputs.save == 'true'
|
||||
uses: actions/cache/save@v4
|
||||
with:
|
||||
path: ${{ steps.robolectric-jars.outputs.path }}
|
||||
key: robolectric-android-all-v3-${{ steps.robolectric.outputs.version }}-${{ github.run_id }}
|
||||
|
||||
- name: Upload unit test diagnostics
|
||||
id: unit-test-diagnostics
|
||||
if: always() && steps.unit-tests.outcome != 'skipped'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: unit-test-results
|
||||
path: |
|
||||
app/build/unit-tests.log
|
||||
app/build/test-results/testReleaseUnitTest/
|
||||
app/build/reports/tests/testReleaseUnitTest/
|
||||
if-no-files-found: ignore
|
||||
retention-days: 14
|
||||
overwrite: true
|
||||
@@ -7,7 +7,7 @@
|
||||
- For an install-and-look iteration, use `tools/quick_deploy.sh` (build without lint, sign, install, about 30 s). Run `tools/build_local.sh` once to prepare the runtime and again only before a PR. It is not a per-change step.
|
||||
- `tools/build_local.sh` reuses the components a main CI run prepared when every recipe identity matches the local tree (it prints `components: … reusing`). It builds them locally when no usable CI artifact matches (after you change their inputs, or when the lookup fails) or with `DROIDDECK_CI_COMPONENTS=0`.
|
||||
- Helper scripts (`tools/linuxfs/overlay`, `tools/linuxfs/desktop`) are staged on every Gradle build, so editing them needs no `build_local.sh`. After preloads or other runtime components change, the fast loop warns and reuses the old binaries; run `tools/build_local.sh` when those matter. "Missing or changed runtime input" means the prepared files themselves changed: run `tools/build_local.sh` once. Do not revert scripts or copy `app/build` between checkouts; `tools/seed_worktree.sh` seeds a new worktree from the main checkout.
|
||||
- Every build defaults to the NDK in `tools/ci/toolchains.env`, as CI does. CI runs `testReleaseUnitTest`; when a test fails only in CI, run the release variant locally.
|
||||
- Every build defaults to the NDK in `tools/ci/toolchains.env`, as CI does. CI runs `testReleaseUnitTest` in the `Unit tests` workflow, beside Build APK; when a test fails only in CI, run the release variant locally.
|
||||
- Run the tests that cover what you changed, including unchanged tests of code you edited: `./gradlew -PskipRust=true :app:testDebugUnitTest --tests '<class>'` and `python3 -m unittest discover -s tools/tests -p 'test_<area>*.py'`. The full Python suite takes about 9 minutes, and some preload tests fail on any host without zram/ntsync. Leave full runs to CI.
|
||||
- For UI screenshots without a device, run `./gradlew -PskipRust=true :app:testDebugUnitTest --tests '*PreviewRenderTest'` and read `app/build/preview-renders/{handheld,portrait}/`. Add cases per `docs/compose-previews.md`. Check portrait, not just landscape.
|
||||
- After changing `SettingsIndex`, regenerate the doc: `UPDATE_SETTINGS_MAP=1 ./gradlew -PskipRust=true :app:testDebugUnitTest --tests '*SettingsMapTest*'`.
|
||||
@@ -31,7 +31,7 @@
|
||||
- CI builds the PR merged onto `main`. Before pushing, merge or rebase onto `origin/main` and compile: most "works locally" Kotlin failures come from that merge.
|
||||
- Before a PR that touches strings or resources, run `./gradlew :app:lintVitalRelease`. The fast loop skips lint, and lint catches `ExtraTranslation` and missing-locale errors.
|
||||
- Commit messages and PR bodies must not carry `Co-Authored-By` or other bot trailers. `tools/release/check_authorship.py` fails the build on them.
|
||||
- `gh run view --log-failed` truncates the unit-test log, so the failing test may not show. Read the whole job log with `gh api repos/Droid-Deck/DroidDeck/actions/jobs/<job-id>/logs`, or `gh run download <run> -n unit-test-results`. Don't call a failure a runner problem until you have read it.
|
||||
- `gh run view --log-failed` truncates the unit-test log, so the failing test may not show. Read the whole job log with `gh api repos/Droid-Deck/DroidDeck/actions/jobs/<job-id>/logs`, or `gh run download <run> -n unit-test-results` from the `Unit tests` workflow run. Don't call a failure a runner problem until you have read it.
|
||||
- Only these are known flakes worth a `gh run rerun <run> --failed`: `ProtonMenuAutoTest` "Proton work did not finish", Robolectric `HTTP response code: 429` from Maven, `Gradle Test Executor N finished with non-zero exit value 2`, apt mirror and GitHub API rate-limit errors. Treat any other failure as real.
|
||||
- A workflow step that names a script your branch lacks means the branch predates a CI change. Rebase onto `main`.
|
||||
|
||||
|
||||
+5
-1
@@ -82,6 +82,8 @@ def buildBranch = providers.environmentVariable('GITHUB_HEAD_REF').getOrNull()?.
|
||||
?: gitValue(['branch', '--show-current']) ?: ''
|
||||
def escapeJava = { String value -> value.replace('\\', '\\\\').replace('"', '\\"').replace('\n', ' ').replace('\r', ' ') }
|
||||
def ciBuild = providers.environmentVariable('GITHUB_ACTIONS').getOrNull() == 'true'
|
||||
// The Unit tests workflow compiles no APK, so it has no add-on packs to pin.
|
||||
def unitTestsOnly = project.findProperty('unitTestsOnly')?.toString()?.toBoolean() ?: false
|
||||
def releaseSigner = rootProject.file('keystore/release-signer.sha256').text.trim()
|
||||
def commitTime = (gitValue(['show', '-s', '--format=%ct', '--end-of-options', sourceCommit]) ?: '0').with { it.isLong() ? it : '0' }
|
||||
def desktopKde = rootProject.file('tools/desktop-kde/release.env').readLines()
|
||||
@@ -96,10 +98,12 @@ def prootPackPin = rootProject.file('tools/packs/proot/release.env').readLines()
|
||||
def addonPacks = ['proot', 'directaudio', 'tracking', 'xbox', 'comet', 'butler', 'powervr', 'ubisoft', 'rockstar', 'dirt', 'epic'].collectEntries { name ->
|
||||
def pack = file("build/packs/${name}.tar.zst")
|
||||
if (!pack.isFile()) {
|
||||
if (ciBuild) throw new GradleException("Add-on pack ${pack} is missing: run tools/packs/build.sh app/build/packs")
|
||||
if (ciBuild && !unitTestsOnly) throw new GradleException("Add-on pack ${pack} is missing: run tools/packs/build.sh app/build/packs")
|
||||
if (name == 'proot' && prootPackPin.PROOT_PACK_SHA256) {
|
||||
return [(name): [sha256: prootPackPin.PROOT_PACK_SHA256, size: (prootPackPin.PROOT_PACK_SIZE ?: '0') as long]]
|
||||
}
|
||||
// A CI APK pins every pack, and CI_BUILD code assumes that, so the tests see a placeholder pin.
|
||||
if (unitTestsOnly) return [(name): [sha256: '0' * 64, size: 0L]]
|
||||
return [(name): [sha256: '', size: 0L]]
|
||||
}
|
||||
def digest = java.security.MessageDigest.getInstance('SHA-256')
|
||||
|
||||
@@ -1,13 +1,17 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.foundation.layout.Column
|
||||
import androidx.compose.foundation.layout.fillMaxSize
|
||||
import androidx.compose.foundation.layout.padding
|
||||
import androidx.compose.foundation.layout.size
|
||||
import androidx.compose.ui.unit.dp
|
||||
import androidx.compose.ui.unit.sp
|
||||
import androidx.compose.material.icons.filled.Settings
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.graphics.Brush
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import com.droiddeck.launcher.R
|
||||
import com.droiddeck.launcher.input.SecondScreenMode
|
||||
@@ -26,6 +30,50 @@ private fun Launcher(tab: String, games: List<com.droiddeck.launcher.frontend.Li
|
||||
@DroidDeckPreviews @Composable private fun SettingsPreview() = Launcher("setup")
|
||||
@DroidDeckPreviews @Composable private fun RuntimeMissingPreview() = Launcher("setup", ready = false)
|
||||
|
||||
/** [content] over a stand-in wallpaper as the frost shows it, with see-through [cards] or solid ones. */
|
||||
@Composable
|
||||
private fun Frosted(transparency: Int = FROST_WALLPAPER_DEFAULT, cards: Boolean = false, cardTransparency: Int = FROST_DEFAULT, content: @Composable () -> Unit) =
|
||||
DroidDeckTheme(frost = FrostChoice(transparency, cards, cardTransparency)) {
|
||||
val wallpaper = Brush.linearGradient(listOf(Color(0xFFE2725B), Color(0xFF7A4BC2), Color(0xFF2A9D8F)))
|
||||
Box(Modifier.fillMaxSize().background(wallpaper).background(LocalFrost.current ?: Color.Transparent)) { content() }
|
||||
}
|
||||
|
||||
@Composable
|
||||
private fun FrostedLauncher(tab: String, transparency: Int = FROST_WALLPAPER_DEFAULT, cards: Boolean = false, cardTransparency: Int = FROST_DEFAULT) =
|
||||
Frosted(transparency, cards, cardTransparency) { FrontEndScreen(sampleState(navigate = tab), sampleActions) }
|
||||
|
||||
/** A settings step opened over frosted page text with see-through cards: the step is solid, so none of the text shows through it. */
|
||||
@Composable
|
||||
private fun FrostedStepOut() = Frosted(cards = true) {
|
||||
val text: @Composable (Int) -> String = { androidx.compose.ui.res.stringResource(it) }
|
||||
Column(Modifier.padding(24.dp)) {
|
||||
val line = List(8) { text(R.string.stores_shelf_new) }.joinToString(" ")
|
||||
repeat(14) { androidx.compose.material3.Text(line, fontSize = 24.sp, color = LocalPalette.current.onBackground, maxLines = 1, softWrap = false) }
|
||||
}
|
||||
androidx.compose.foundation.layout.BoxWithConstraints(Modifier.fillMaxSize()) {
|
||||
val pill = with(androidx.compose.ui.platform.LocalDensity.current) {
|
||||
androidx.compose.ui.geometry.Rect(androidx.compose.ui.geometry.Offset((maxWidth - 68.dp).toPx(), 16.dp.toPx()), androidx.compose.ui.geometry.Size(44.dp.toPx(), 44.dp.toPx()))
|
||||
}
|
||||
val accent = LocalPalette.current.signal
|
||||
StepOut(
|
||||
open = true, pill = pill, preferredSide = StepSide.Left, accent = accent, onDismiss = {}, onClosed = {}, items = 2, maxWidth = 440.dp,
|
||||
handle = { androidx.compose.material3.Icon(androidx.compose.material.icons.Icons.Filled.Settings, null, tint = accent, modifier = Modifier.size(20.dp)) },
|
||||
) {
|
||||
StepTitle(text(R.string.stores_settings_eyebrow))
|
||||
Column(Modifier.stepItem(1)) {
|
||||
SettingsRow(text(R.string.stores_show_mature), null) { ToggleSwitch(true, label = text(R.string.stores_show_mature)) {} }
|
||||
SettingsRow(text(R.string.gog_achievements), text(R.string.gog_achievements_hint)) { ToggleSwitch(false, label = text(R.string.gog_achievements)) {} }
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@DroidDeckPreviews @Composable private fun FrostedSteamTabPreview() = FrostedLauncher("steam")
|
||||
@DroidDeckPreviews @Composable private fun FrostedLibraryPreview() = FrostedLauncher("games")
|
||||
@DroidDeckPreviews @Composable private fun FrostedSettingsCardsPreview() = FrostedLauncher("setup", cards = true)
|
||||
@DroidDeckPreviews @Composable private fun FrostedSettingsClearestPreview() = FrostedLauncher("setup", transparency = FROST_MAX, cards = true, cardTransparency = FROST_MAX)
|
||||
@DroidDeckPreviews @Composable private fun FrostedStepOutPreview() = FrostedStepOut()
|
||||
|
||||
/** The in-game menu on one page, as a session shows it. */
|
||||
@Composable
|
||||
private fun SessionMenu(page: SessionDrawerPage, steam: Boolean = true, desktop: Boolean = false) = PreviewHost {
|
||||
@@ -72,6 +120,11 @@ internal val previewCases: List<PreviewCase> = listOf(
|
||||
PreviewCase("downloads") { Launcher("downloads") },
|
||||
PreviewCase("settings") { Launcher("setup") },
|
||||
PreviewCase("runtime-missing") { Launcher("setup", ready = false) },
|
||||
PreviewCase("frosted-steam-tab") { FrostedLauncher("steam") },
|
||||
PreviewCase("frosted-library", storesLoaded) { FrostedLauncher("games") },
|
||||
PreviewCase("frosted-settings-cards") { FrostedLauncher("setup", cards = true) },
|
||||
PreviewCase("frosted-settings-clearest") { FrostedLauncher("setup", transparency = FROST_MAX, cards = true, cardTransparency = FROST_MAX) },
|
||||
PreviewCase("frosted-step-out") { FrostedStepOut() },
|
||||
PreviewCase("session-menu-controller") { SessionMenu(SessionDrawerPage.CONTROLLER) },
|
||||
PreviewCase("session-menu-display") { SessionMenu(SessionDrawerPage.DISPLAY) },
|
||||
PreviewCase("session-menu-hud") { SessionMenu(SessionDrawerPage.HUD) },
|
||||
|
||||
@@ -481,5 +481,69 @@
|
||||
<service android:name=".runtime.GuestWorker61" android:exported="false" android:process=":g61" />
|
||||
<service android:name=".runtime.GuestWorker62" android:exported="false" android:process=":g62" />
|
||||
<service android:name=".runtime.GuestWorker63" android:exported="false" android:process=":g63" />
|
||||
<service android:name=".runtime.GuestWorker64" android:exported="false" android:process=":g64" />
|
||||
<service android:name=".runtime.GuestWorker65" android:exported="false" android:process=":g65" />
|
||||
<service android:name=".runtime.GuestWorker66" android:exported="false" android:process=":g66" />
|
||||
<service android:name=".runtime.GuestWorker67" android:exported="false" android:process=":g67" />
|
||||
<service android:name=".runtime.GuestWorker68" android:exported="false" android:process=":g68" />
|
||||
<service android:name=".runtime.GuestWorker69" android:exported="false" android:process=":g69" />
|
||||
<service android:name=".runtime.GuestWorker70" android:exported="false" android:process=":g70" />
|
||||
<service android:name=".runtime.GuestWorker71" android:exported="false" android:process=":g71" />
|
||||
<service android:name=".runtime.GuestWorker72" android:exported="false" android:process=":g72" />
|
||||
<service android:name=".runtime.GuestWorker73" android:exported="false" android:process=":g73" />
|
||||
<service android:name=".runtime.GuestWorker74" android:exported="false" android:process=":g74" />
|
||||
<service android:name=".runtime.GuestWorker75" android:exported="false" android:process=":g75" />
|
||||
<service android:name=".runtime.GuestWorker76" android:exported="false" android:process=":g76" />
|
||||
<service android:name=".runtime.GuestWorker77" android:exported="false" android:process=":g77" />
|
||||
<service android:name=".runtime.GuestWorker78" android:exported="false" android:process=":g78" />
|
||||
<service android:name=".runtime.GuestWorker79" android:exported="false" android:process=":g79" />
|
||||
<service android:name=".runtime.GuestWorker80" android:exported="false" android:process=":g80" />
|
||||
<service android:name=".runtime.GuestWorker81" android:exported="false" android:process=":g81" />
|
||||
<service android:name=".runtime.GuestWorker82" android:exported="false" android:process=":g82" />
|
||||
<service android:name=".runtime.GuestWorker83" android:exported="false" android:process=":g83" />
|
||||
<service android:name=".runtime.GuestWorker84" android:exported="false" android:process=":g84" />
|
||||
<service android:name=".runtime.GuestWorker85" android:exported="false" android:process=":g85" />
|
||||
<service android:name=".runtime.GuestWorker86" android:exported="false" android:process=":g86" />
|
||||
<service android:name=".runtime.GuestWorker87" android:exported="false" android:process=":g87" />
|
||||
<service android:name=".runtime.GuestWorker88" android:exported="false" android:process=":g88" />
|
||||
<service android:name=".runtime.GuestWorker89" android:exported="false" android:process=":g89" />
|
||||
<service android:name=".runtime.GuestWorker90" android:exported="false" android:process=":g90" />
|
||||
<service android:name=".runtime.GuestWorker91" android:exported="false" android:process=":g91" />
|
||||
<service android:name=".runtime.GuestWorker92" android:exported="false" android:process=":g92" />
|
||||
<service android:name=".runtime.GuestWorker93" android:exported="false" android:process=":g93" />
|
||||
<service android:name=".runtime.GuestWorker94" android:exported="false" android:process=":g94" />
|
||||
<service android:name=".runtime.GuestWorker95" android:exported="false" android:process=":g95" />
|
||||
<service android:name=".runtime.GuestWorker96" android:exported="false" android:process=":g96" />
|
||||
<service android:name=".runtime.GuestWorker97" android:exported="false" android:process=":g97" />
|
||||
<service android:name=".runtime.GuestWorker98" android:exported="false" android:process=":g98" />
|
||||
<service android:name=".runtime.GuestWorker99" android:exported="false" android:process=":g99" />
|
||||
<service android:name=".runtime.GuestWorker100" android:exported="false" android:process=":g100" />
|
||||
<service android:name=".runtime.GuestWorker101" android:exported="false" android:process=":g101" />
|
||||
<service android:name=".runtime.GuestWorker102" android:exported="false" android:process=":g102" />
|
||||
<service android:name=".runtime.GuestWorker103" android:exported="false" android:process=":g103" />
|
||||
<service android:name=".runtime.GuestWorker104" android:exported="false" android:process=":g104" />
|
||||
<service android:name=".runtime.GuestWorker105" android:exported="false" android:process=":g105" />
|
||||
<service android:name=".runtime.GuestWorker106" android:exported="false" android:process=":g106" />
|
||||
<service android:name=".runtime.GuestWorker107" android:exported="false" android:process=":g107" />
|
||||
<service android:name=".runtime.GuestWorker108" android:exported="false" android:process=":g108" />
|
||||
<service android:name=".runtime.GuestWorker109" android:exported="false" android:process=":g109" />
|
||||
<service android:name=".runtime.GuestWorker110" android:exported="false" android:process=":g110" />
|
||||
<service android:name=".runtime.GuestWorker111" android:exported="false" android:process=":g111" />
|
||||
<service android:name=".runtime.GuestWorker112" android:exported="false" android:process=":g112" />
|
||||
<service android:name=".runtime.GuestWorker113" android:exported="false" android:process=":g113" />
|
||||
<service android:name=".runtime.GuestWorker114" android:exported="false" android:process=":g114" />
|
||||
<service android:name=".runtime.GuestWorker115" android:exported="false" android:process=":g115" />
|
||||
<service android:name=".runtime.GuestWorker116" android:exported="false" android:process=":g116" />
|
||||
<service android:name=".runtime.GuestWorker117" android:exported="false" android:process=":g117" />
|
||||
<service android:name=".runtime.GuestWorker118" android:exported="false" android:process=":g118" />
|
||||
<service android:name=".runtime.GuestWorker119" android:exported="false" android:process=":g119" />
|
||||
<service android:name=".runtime.GuestWorker120" android:exported="false" android:process=":g120" />
|
||||
<service android:name=".runtime.GuestWorker121" android:exported="false" android:process=":g121" />
|
||||
<service android:name=".runtime.GuestWorker122" android:exported="false" android:process=":g122" />
|
||||
<service android:name=".runtime.GuestWorker123" android:exported="false" android:process=":g123" />
|
||||
<service android:name=".runtime.GuestWorker124" android:exported="false" android:process=":g124" />
|
||||
<service android:name=".runtime.GuestWorker125" android:exported="false" android:process=":g125" />
|
||||
<service android:name=".runtime.GuestWorker126" android:exported="false" android:process=":g126" />
|
||||
<service android:name=".runtime.GuestWorker127" android:exported="false" android:process=":g127" />
|
||||
</application>
|
||||
</manifest>
|
||||
@@ -25,6 +25,7 @@ import android.widget.EditText
|
||||
import androidx.activity.ComponentActivity
|
||||
import androidx.activity.compose.setContent
|
||||
import androidx.activity.result.contract.ActivityResultContracts
|
||||
import androidx.compose.foundation.background
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.collectAsState
|
||||
import androidx.compose.runtime.getValue
|
||||
@@ -207,6 +208,12 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
private var launcherOrientation by mutableStateOf(android.content.pm.ActivityInfo.SCREEN_ORIENTATION_USER)
|
||||
private var homePage by mutableStateOf(com.droiddeck.launcher.core.AppUiPrefs.HOME_PAGE_STEAM)
|
||||
private var launcherFullscreen by mutableStateOf(true)
|
||||
private var launcherFrost by mutableStateOf(false)
|
||||
private var frostWallpaper by mutableStateOf(true)
|
||||
private var frostCards by mutableStateOf(true)
|
||||
private var frostTransparency by mutableStateOf(com.droiddeck.launcher.ui.FROST_WALLPAPER_DEFAULT)
|
||||
private var frostCardTransparency by mutableStateOf(com.droiddeck.launcher.ui.FROST_DEFAULT)
|
||||
private val frost = com.droiddeck.launcher.ui.LauncherFrost(this)
|
||||
private var controllerHaptics by mutableStateOf(true)
|
||||
private var downloadSource by mutableStateOf(DownloadSource.MODE_AUTO)
|
||||
private var downloadMirror by mutableStateOf("")
|
||||
@@ -1372,6 +1379,14 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
requestedOrientation = launcherOrientation
|
||||
homePage = com.droiddeck.launcher.core.AppUiPrefs.homePage(this)
|
||||
launcherFullscreen = SessionPrefs.launcherFullscreen(this)
|
||||
launcherFrost = SessionPrefs.launcherFrost(this)
|
||||
frostWallpaper = SessionPrefs.frostWallpaper(this)
|
||||
frostCards = SessionPrefs.frostCards(this)
|
||||
frostTransparency = SessionPrefs.frostTransparency(this)
|
||||
frostCardTransparency = SessionPrefs.frostCardTransparency(this)
|
||||
frost.start()
|
||||
frost.prepare(launcherFrost && frostWallpaper)
|
||||
frost.show(frostShown())
|
||||
controllerHaptics = SessionPrefs.controllerHaptics(this)
|
||||
downloadSource = DownloadSource.mode(this)
|
||||
downloadMirror = DownloadSource.mirror(this)
|
||||
@@ -1396,8 +1411,14 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
}
|
||||
val appsTabShown = "android-apps" !in com.droiddeck.launcher.ui.NavTabs.hidden
|
||||
androidx.compose.runtime.LaunchedEffect(appsTabShown) { if (appsTabShown && androidApps.isEmpty()) refreshAndroidApps() }
|
||||
DroidDeckTheme(theme, appScale = appScale) {
|
||||
com.droiddeck.launcher.ui.FocusGlideHost(androidx.compose.ui.Modifier.fillMaxSize().exposeTestTags()) {
|
||||
val frostShown = frostShown()
|
||||
androidx.compose.runtime.LaunchedEffect(frostShown) { frost.show(frostShown) }
|
||||
val frostChoice = if (frostShown) com.droiddeck.launcher.ui.FrostChoice(frostTransparency, frostCards, frostCardTransparency) else null
|
||||
DroidDeckTheme(theme, appScale = appScale, frost = frostChoice) {
|
||||
val palette = com.droiddeck.launcher.ui.LocalPalette.current
|
||||
val veil = com.droiddeck.launcher.ui.LocalFrost.current
|
||||
val ground = if (frost.prepared) androidx.compose.ui.Modifier.background(veil ?: palette.background) else androidx.compose.ui.Modifier
|
||||
com.droiddeck.launcher.ui.FocusGlideHost(androidx.compose.ui.Modifier.fillMaxSize().then(ground).exposeTestTags()) {
|
||||
if (decky.deckyPendingZip != null) com.droiddeck.launcher.ui.DeckyZipWarningDialog(
|
||||
onConfirm = { decky.confirmPluginZip() }, onCancel = { decky.cancelPluginZip() },
|
||||
)
|
||||
@@ -1473,6 +1494,12 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
launcherOrientation = launcherOrientation,
|
||||
homePage = homePage,
|
||||
launcherFullscreen = launcherFullscreen,
|
||||
launcherFrost = launcherFrost,
|
||||
frostWallpaper = frostWallpaper,
|
||||
frostCards = frostCards,
|
||||
frostTransparency = frostTransparency,
|
||||
frostCardTransparency = frostCardTransparency,
|
||||
frostSupported = frost.supported,
|
||||
controllerHaptics = controllerHaptics,
|
||||
downloadSource = downloadSource,
|
||||
downloadMirror = downloadMirror,
|
||||
@@ -1808,6 +1835,28 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
launcherFullscreen = on
|
||||
applyLauncherFullscreen()
|
||||
},
|
||||
onLauncherFrost = { on ->
|
||||
SessionPrefs.setLauncherFrost(this, on)
|
||||
launcherFrost = on
|
||||
if (on && frostWallpaper && !frost.prepared) restartLauncher()
|
||||
},
|
||||
onFrostWallpaper = { on ->
|
||||
SessionPrefs.setFrostWallpaper(this, on)
|
||||
frostWallpaper = on
|
||||
if (on && !frost.prepared) restartLauncher()
|
||||
},
|
||||
onFrostCards = { on ->
|
||||
SessionPrefs.setFrostCards(this, on)
|
||||
frostCards = on
|
||||
},
|
||||
onFrostTransparency = { percent ->
|
||||
SessionPrefs.setFrostTransparency(this, percent)
|
||||
frostTransparency = SessionPrefs.frostTransparency(this)
|
||||
},
|
||||
onFrostCardTransparency = { percent ->
|
||||
SessionPrefs.setFrostCardTransparency(this, percent)
|
||||
frostCardTransparency = SessionPrefs.frostCardTransparency(this)
|
||||
},
|
||||
onGameStoresSpeedTier = { tier -> SessionPrefs.setGameStoresSpeedTier(this, tier); gameStoresSpeedTier = tier },
|
||||
onNavigated = { navRequest = null },
|
||||
onStoresShowMature = { show -> SessionPrefs.setStoresShowMature(this, show); storesShowMature = show },
|
||||
@@ -2114,6 +2163,9 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
}
|
||||
}
|
||||
|
||||
private fun frostShown(): Boolean =
|
||||
launcherFrost && frostWallpaper && frost.prepared && frost.available && theme != com.droiddeck.launcher.ui.Themes.TRUE_BLACK
|
||||
|
||||
private fun applyLauncherFullscreen() {
|
||||
@Suppress("DEPRECATION")
|
||||
window.decorView.systemUiVisibility = if (launcherFullscreen) {
|
||||
@@ -2461,6 +2513,7 @@ class FrontEndActivity : ComponentActivity(), com.droiddeck.launcher.ui.AgentPet
|
||||
launchCoordinator.cancelAll()
|
||||
cancelCompatLaunch()
|
||||
updates.unregister()
|
||||
frost.stop()
|
||||
runCatching { unregisterReceiver(shortcutsInstallStatus) }
|
||||
super.onDestroy()
|
||||
}
|
||||
|
||||
@@ -12,6 +12,7 @@ import com.droiddeck.launcher.core.TarZst;
|
||||
import java.io.File;
|
||||
import java.io.InputStream;
|
||||
import java.net.URL;
|
||||
import java.nio.file.AtomicMoveNotSupportedException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.StandardCopyOption;
|
||||
import java.util.ArrayList;
|
||||
@@ -36,9 +37,15 @@ public class PulseAudioComponent extends SessionPart {
|
||||
private final HostLifecycle host = new HostLifecycle(Process::killProcess);
|
||||
|
||||
static final class HostLifecycle {
|
||||
static final int MAX_STARTUP_CRASH_RESTARTS = 4;
|
||||
private static final long[] STARTUP_RESTART_DELAYS_MS = {250L, 1000L, 2000L, 4000L};
|
||||
|
||||
volatile int pid = -1;
|
||||
private long generation;
|
||||
private long launches;
|
||||
private boolean preferStandardPerformanceMode;
|
||||
private boolean sinkReady;
|
||||
private int startupCrashRestarts;
|
||||
private final IntConsumer terminate;
|
||||
final ReentrantReadWriteLock commands = new ReentrantReadWriteLock();
|
||||
|
||||
@@ -48,6 +55,9 @@ public class PulseAudioComponent extends SessionPart {
|
||||
|
||||
synchronized long begin() {
|
||||
stop();
|
||||
preferStandardPerformanceMode = false;
|
||||
sinkReady = false;
|
||||
startupCrashRestarts = 0;
|
||||
return generation;
|
||||
}
|
||||
|
||||
@@ -55,6 +65,7 @@ public class PulseAudioComponent extends SessionPart {
|
||||
generation++;
|
||||
if (pid > 1) terminate.accept(pid);
|
||||
pid = -1;
|
||||
sinkReady = false;
|
||||
}
|
||||
|
||||
boolean launch(long expected, IntSupplier launch) {
|
||||
@@ -63,6 +74,7 @@ public class PulseAudioComponent extends SessionPart {
|
||||
synchronized (this) {
|
||||
if (expected != generation) return false;
|
||||
launches++;
|
||||
sinkReady = false;
|
||||
pid = launch.getAsInt();
|
||||
return true;
|
||||
}
|
||||
@@ -93,11 +105,45 @@ public class PulseAudioComponent extends SessionPart {
|
||||
return token == launches && pid > 1;
|
||||
}
|
||||
|
||||
synchronized boolean preferStandardPerformanceMode() {
|
||||
return preferStandardPerformanceMode;
|
||||
}
|
||||
|
||||
synchronized void markLowLatencyFailed(long token) {
|
||||
if (token == launches && pid > 1) preferStandardPerformanceMode = true;
|
||||
}
|
||||
|
||||
synchronized void markSinkReady(long token) {
|
||||
if (token == launches && pid > 1) {
|
||||
sinkReady = true;
|
||||
startupCrashRestarts = 0;
|
||||
}
|
||||
}
|
||||
|
||||
synchronized boolean exited(long expected) {
|
||||
if (expected != generation || pid <= 1) return false;
|
||||
pid = -1;
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Decides whether a dead host should be restarted and after how many milliseconds.
|
||||
* Returns 0 for immediate recovery of a host that had a working sink, a positive backoff
|
||||
* while falling back to standard AAudio mode after a startup crash, or -1 to stop retrying.
|
||||
*/
|
||||
synchronized long nextRestartDelayMs(long expected) {
|
||||
if (expected != generation) return -1L;
|
||||
if (sinkReady) {
|
||||
sinkReady = false;
|
||||
startupCrashRestarts = 0;
|
||||
return 0L;
|
||||
}
|
||||
preferStandardPerformanceMode = true;
|
||||
if (startupCrashRestarts >= MAX_STARTUP_CRASH_RESTARTS) return -1L;
|
||||
long delay = STARTUP_RESTART_DELAYS_MS[Math.min(startupCrashRestarts, STARTUP_RESTART_DELAYS_MS.length - 1)];
|
||||
startupCrashRestarts++;
|
||||
return delay;
|
||||
}
|
||||
}
|
||||
|
||||
public PulseAudioComponent(Context context) {
|
||||
@@ -167,11 +213,14 @@ public class PulseAudioComponent extends SessionPart {
|
||||
if (micFifoPath != null && !micFifoPath.isEmpty()) {
|
||||
new File(micFifoPath).delete();
|
||||
}
|
||||
boolean standardMode = host.preferStandardPerformanceMode();
|
||||
String initialPerformanceMode = standardMode ? "0" : "1";
|
||||
ArrayList<String> config = new ArrayList<>();
|
||||
config.add("load-module module-native-protocol-unix auth-anonymous=1 auth-cookie-enabled=0 socket=\""
|
||||
+ socket().getAbsolutePath() + "\"");
|
||||
config.add(".nofail");
|
||||
config.add("load-module module-directaudio-native-sink sink_name=DirectAudio performance_mode=1 adaptive=1 decay=0 limiter=1 watchdog=1 volume=1.0 control_dir=" + deviceControls);
|
||||
config.add("load-module module-directaudio-native-sink sink_name=DirectAudio performance_mode="
|
||||
+ initialPerformanceMode + " adaptive=1 decay=0 limiter=1 watchdog=1 volume=1.0 control_dir=" + deviceControls);
|
||||
config.add("set-default-sink DirectAudio");
|
||||
config.add(".fail");
|
||||
if (micFifoPath != null && !micFifoPath.isEmpty()) {
|
||||
@@ -197,7 +246,25 @@ public class PulseAudioComponent extends SessionPart {
|
||||
final java.io.PrintWriter out = openLog();
|
||||
if (!host.launch(generation, () -> HostProcess.startUncounted(command, env.toArray(new String[0]), workingDir, status -> {
|
||||
if (host.exited(generation)) {
|
||||
Log.w(TAG, "audio host exited with status " + status + "; restarting");
|
||||
long delayMs = host.nextRestartDelayMs(generation);
|
||||
if (delayMs < 0) {
|
||||
String msg = "audio host exited with status " + status
|
||||
+ " before a client sink came up too many times; not restarting again in this session";
|
||||
Log.w(TAG, msg);
|
||||
note(out, msg);
|
||||
return;
|
||||
}
|
||||
Log.w(TAG, "audio host exited with status " + status + "; restarting"
|
||||
+ (host.preferStandardPerformanceMode() ? " with standard AAudio mode" : "")
|
||||
+ (delayMs > 0 ? " in " + delayMs + " ms" : ""));
|
||||
if (delayMs > 0) {
|
||||
try {
|
||||
Thread.sleep(delayMs);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
return;
|
||||
}
|
||||
}
|
||||
start(generation);
|
||||
}
|
||||
},
|
||||
@@ -211,6 +278,24 @@ public class PulseAudioComponent extends SessionPart {
|
||||
guard.start();
|
||||
}
|
||||
|
||||
private boolean loadDirectAudioSink(long token, String performanceMode) {
|
||||
if ("0".equals(performanceMode)) pactlOk(token, "unload-module", "module-directaudio-native-sink");
|
||||
String loaded = pactlFor(token, "load-module", "module-directaudio-native-sink", "sink_name=DirectAudio",
|
||||
"performance_mode=" + performanceMode,
|
||||
"adaptive=1", "decay=0", "limiter=1", "watchdog=1", "volume=1.0", "control_dir=" + deviceControls);
|
||||
if (loaded == null) return false;
|
||||
if (pactlOk(token, "set-default-sink", "DirectAudio")) return true;
|
||||
String moduleId = loaded.trim();
|
||||
pactlOk(token, "unload-module", moduleId.matches("\\d+") ? moduleId : "module-directaudio-native-sink");
|
||||
return false;
|
||||
}
|
||||
|
||||
private boolean loadPlainAAudioSink(long token, String performanceMode) {
|
||||
return pactlOk(token, "load-module", "module-aaudio-sink", "sink_name=AAudioSink",
|
||||
"performance_mode=" + performanceMode, "adaptive=1", "volume=1.0", "control_dir=" + deviceControls)
|
||||
&& pactlOk(token, "set-default-sink", "AAudioSink");
|
||||
}
|
||||
|
||||
private void ensureClientSink(java.io.PrintWriter out, long token) {
|
||||
try {
|
||||
// Nothing that may block (a sink whose AAudio open hangs: a Galaxy S24 FE (US) hung the
|
||||
@@ -232,27 +317,42 @@ public class PulseAudioComponent extends SessionPart {
|
||||
if (sinks == null) {
|
||||
line = "== client sink: the daemon did not answer in 30 s; no fallback attempted";
|
||||
} else if (sinks.contains("\tDirectAudio\t") || sinks.startsWith("DirectAudio\t") || sinks.contains("\tDirectAudio\n") || sinks.matches("(?s).*\\bDirectAudio\\b.*")) {
|
||||
line = "== client sink: DirectAudio (module-directaudio-native-sink)";
|
||||
host.markSinkReady(token);
|
||||
line = "== client sink: DirectAudio (module-directaudio-native-sink"
|
||||
+ (host.preferStandardPerformanceMode() ? ", standard mode" : "") + ")";
|
||||
} else {
|
||||
// AAudio can refuse the first open with AAUDIO_ERROR_DISCONNECTED while Android is
|
||||
// still switching the output route as the session starts (seen on a Galaxy S24 FE):
|
||||
// try DirectAudio again, then the plain sink, a few times over ten seconds.
|
||||
// still switching the output route (Galaxy S24 FE) or when low-latency MMAP output
|
||||
// is rejected by the HAL (Samsung One UI). Retry low-latency once if it hasn't been
|
||||
// disqualified yet, then fall back to performance_mode=0 (non-MMAP) on DirectAudio
|
||||
// before trying the plain AAudio sink.
|
||||
String loadedAs = null;
|
||||
for (int attempt = 1; attempt <= 5 && loadedAs == null && host.live(token); attempt++) {
|
||||
try { Thread.sleep(2000L); } catch (InterruptedException e) { Thread.currentThread().interrupt(); return; }
|
||||
if (pactlOk(token, "load-module", "module-directaudio-native-sink", "sink_name=DirectAudio", "performance_mode=1",
|
||||
"adaptive=1", "decay=0", "limiter=1", "watchdog=1", "volume=1.0", "control_dir=" + deviceControls)
|
||||
&& pactlOk(token, "set-default-sink", "DirectAudio")) {
|
||||
loadedAs = "DirectAudio on attempt " + attempt;
|
||||
} else if (pactlOk(token, "load-module", "module-aaudio-sink", "sink_name=AAudioSink",
|
||||
"performance_mode=" + (attempt == 1 ? "1" : "0"), "adaptive=1", "volume=1.0", "control_dir=" + deviceControls)
|
||||
&& pactlOk(token, "set-default-sink", "AAudioSink")) {
|
||||
loadedAs = "the plain AAudio sink (AAudioSink) on attempt " + attempt;
|
||||
if (!host.live(token)) break;
|
||||
if (attempt == 1 && !host.preferStandardPerformanceMode()) {
|
||||
if (loadDirectAudioSink(token, "1")) {
|
||||
loadedAs = "DirectAudio on attempt " + attempt;
|
||||
break;
|
||||
}
|
||||
if (!host.live(token)) break;
|
||||
host.markLowLatencyFailed(token);
|
||||
}
|
||||
if (loadDirectAudioSink(token, "0")) {
|
||||
loadedAs = "DirectAudio (standard mode) on attempt " + attempt;
|
||||
} else if (host.live(token) && loadPlainAAudioSink(token, "0")) {
|
||||
loadedAs = "the plain AAudio sink (AAudioSink, standard mode) on attempt " + attempt;
|
||||
}
|
||||
}
|
||||
line = loadedAs != null ? "== client sink: DirectAudio did not come up at start; retried and got " + loadedAs
|
||||
: "== client sink: DirectAudio did not come up and the AAudio fallback failed too after 5 retries - no client sound."
|
||||
+ " If audio.log shows AAUDIO_ERROR_DISCONNECTED, Android refused the audio output: rebooting the phone usually fixes this";
|
||||
if (loadedAs != null) {
|
||||
host.markSinkReady(token);
|
||||
line = "== client sink: DirectAudio did not come up at start; retried and got " + loadedAs;
|
||||
} else if (!host.live(token)) {
|
||||
line = "== client sink: audio host exited during sink recovery";
|
||||
} else {
|
||||
line = "== client sink: DirectAudio did not come up and the AAudio fallback failed too after 5 retries - no client sound."
|
||||
+ " If audio.log shows AAUDIO_ERROR_DISCONNECTED, Android refused the audio output: rebooting the phone usually fixes this";
|
||||
}
|
||||
Log.w(TAG, line);
|
||||
}
|
||||
Log.i(TAG, line);
|
||||
@@ -407,11 +507,22 @@ public class PulseAudioComponent extends SessionPart {
|
||||
continue;
|
||||
}
|
||||
File destination = new File(workingDir, lib);
|
||||
File temp = null;
|
||||
try (InputStream in = resource.openStream()) {
|
||||
Files.copy(in, destination.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
FileUtils.chmod(destination, 0771);
|
||||
temp = File.createTempFile(lib + ".", ".tmp", workingDir);
|
||||
Files.copy(in, temp.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
FileUtils.chmod(temp, 0771);
|
||||
try {
|
||||
Files.move(temp.toPath(), destination.toPath(),
|
||||
StandardCopyOption.ATOMIC_MOVE, StandardCopyOption.REPLACE_EXISTING);
|
||||
} catch (AtomicMoveNotSupportedException e) {
|
||||
Files.move(temp.toPath(), destination.toPath(), StandardCopyOption.REPLACE_EXISTING);
|
||||
}
|
||||
temp = null;
|
||||
} catch (Exception e) {
|
||||
Log.w(TAG, "copy " + lib, e);
|
||||
} finally {
|
||||
if (temp != null) temp.delete();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -224,6 +224,70 @@ class GuestWorker60 : GuestWorker()
|
||||
class GuestWorker61 : GuestWorker()
|
||||
class GuestWorker62 : GuestWorker()
|
||||
class GuestWorker63 : GuestWorker()
|
||||
class GuestWorker64 : GuestWorker()
|
||||
class GuestWorker65 : GuestWorker()
|
||||
class GuestWorker66 : GuestWorker()
|
||||
class GuestWorker67 : GuestWorker()
|
||||
class GuestWorker68 : GuestWorker()
|
||||
class GuestWorker69 : GuestWorker()
|
||||
class GuestWorker70 : GuestWorker()
|
||||
class GuestWorker71 : GuestWorker()
|
||||
class GuestWorker72 : GuestWorker()
|
||||
class GuestWorker73 : GuestWorker()
|
||||
class GuestWorker74 : GuestWorker()
|
||||
class GuestWorker75 : GuestWorker()
|
||||
class GuestWorker76 : GuestWorker()
|
||||
class GuestWorker77 : GuestWorker()
|
||||
class GuestWorker78 : GuestWorker()
|
||||
class GuestWorker79 : GuestWorker()
|
||||
class GuestWorker80 : GuestWorker()
|
||||
class GuestWorker81 : GuestWorker()
|
||||
class GuestWorker82 : GuestWorker()
|
||||
class GuestWorker83 : GuestWorker()
|
||||
class GuestWorker84 : GuestWorker()
|
||||
class GuestWorker85 : GuestWorker()
|
||||
class GuestWorker86 : GuestWorker()
|
||||
class GuestWorker87 : GuestWorker()
|
||||
class GuestWorker88 : GuestWorker()
|
||||
class GuestWorker89 : GuestWorker()
|
||||
class GuestWorker90 : GuestWorker()
|
||||
class GuestWorker91 : GuestWorker()
|
||||
class GuestWorker92 : GuestWorker()
|
||||
class GuestWorker93 : GuestWorker()
|
||||
class GuestWorker94 : GuestWorker()
|
||||
class GuestWorker95 : GuestWorker()
|
||||
class GuestWorker96 : GuestWorker()
|
||||
class GuestWorker97 : GuestWorker()
|
||||
class GuestWorker98 : GuestWorker()
|
||||
class GuestWorker99 : GuestWorker()
|
||||
class GuestWorker100 : GuestWorker()
|
||||
class GuestWorker101 : GuestWorker()
|
||||
class GuestWorker102 : GuestWorker()
|
||||
class GuestWorker103 : GuestWorker()
|
||||
class GuestWorker104 : GuestWorker()
|
||||
class GuestWorker105 : GuestWorker()
|
||||
class GuestWorker106 : GuestWorker()
|
||||
class GuestWorker107 : GuestWorker()
|
||||
class GuestWorker108 : GuestWorker()
|
||||
class GuestWorker109 : GuestWorker()
|
||||
class GuestWorker110 : GuestWorker()
|
||||
class GuestWorker111 : GuestWorker()
|
||||
class GuestWorker112 : GuestWorker()
|
||||
class GuestWorker113 : GuestWorker()
|
||||
class GuestWorker114 : GuestWorker()
|
||||
class GuestWorker115 : GuestWorker()
|
||||
class GuestWorker116 : GuestWorker()
|
||||
class GuestWorker117 : GuestWorker()
|
||||
class GuestWorker118 : GuestWorker()
|
||||
class GuestWorker119 : GuestWorker()
|
||||
class GuestWorker120 : GuestWorker()
|
||||
class GuestWorker121 : GuestWorker()
|
||||
class GuestWorker122 : GuestWorker()
|
||||
class GuestWorker123 : GuestWorker()
|
||||
class GuestWorker124 : GuestWorker()
|
||||
class GuestWorker125 : GuestWorker()
|
||||
class GuestWorker126 : GuestWorker()
|
||||
class GuestWorker127 : GuestWorker()
|
||||
|
||||
/** The pool of [GuestWorker] processes, and the socket guests ask it through (`droiddeck-spawn`). */
|
||||
object GuestWorkers {
|
||||
@@ -250,7 +314,28 @@ object GuestWorkers {
|
||||
GuestWorker54::class.java, GuestWorker55::class.java, GuestWorker56::class.java,
|
||||
GuestWorker57::class.java, GuestWorker58::class.java, GuestWorker59::class.java,
|
||||
GuestWorker60::class.java, GuestWorker61::class.java, GuestWorker62::class.java,
|
||||
GuestWorker63::class.java,
|
||||
GuestWorker63::class.java, GuestWorker64::class.java, GuestWorker65::class.java,
|
||||
GuestWorker66::class.java, GuestWorker67::class.java, GuestWorker68::class.java,
|
||||
GuestWorker69::class.java, GuestWorker70::class.java, GuestWorker71::class.java,
|
||||
GuestWorker72::class.java, GuestWorker73::class.java, GuestWorker74::class.java,
|
||||
GuestWorker75::class.java, GuestWorker76::class.java, GuestWorker77::class.java,
|
||||
GuestWorker78::class.java, GuestWorker79::class.java, GuestWorker80::class.java,
|
||||
GuestWorker81::class.java, GuestWorker82::class.java, GuestWorker83::class.java,
|
||||
GuestWorker84::class.java, GuestWorker85::class.java, GuestWorker86::class.java,
|
||||
GuestWorker87::class.java, GuestWorker88::class.java, GuestWorker89::class.java,
|
||||
GuestWorker90::class.java, GuestWorker91::class.java, GuestWorker92::class.java,
|
||||
GuestWorker93::class.java, GuestWorker94::class.java, GuestWorker95::class.java,
|
||||
GuestWorker96::class.java, GuestWorker97::class.java, GuestWorker98::class.java,
|
||||
GuestWorker99::class.java, GuestWorker100::class.java, GuestWorker101::class.java,
|
||||
GuestWorker102::class.java, GuestWorker103::class.java, GuestWorker104::class.java,
|
||||
GuestWorker105::class.java, GuestWorker106::class.java, GuestWorker107::class.java,
|
||||
GuestWorker108::class.java, GuestWorker109::class.java, GuestWorker110::class.java,
|
||||
GuestWorker111::class.java, GuestWorker112::class.java, GuestWorker113::class.java,
|
||||
GuestWorker114::class.java, GuestWorker115::class.java, GuestWorker116::class.java,
|
||||
GuestWorker117::class.java, GuestWorker118::class.java, GuestWorker119::class.java,
|
||||
GuestWorker120::class.java, GuestWorker121::class.java, GuestWorker122::class.java,
|
||||
GuestWorker123::class.java, GuestWorker124::class.java, GuestWorker125::class.java,
|
||||
GuestWorker126::class.java, GuestWorker127::class.java,
|
||||
)
|
||||
|
||||
private class Slot(val index: Int) {
|
||||
|
||||
@@ -35,9 +35,40 @@ object LegacyNames {
|
||||
@Synchronized
|
||||
fun migrateEtc(root: File) {
|
||||
for ((old, new) in LINKED_DIRS) moveAndLink(File(root, old), File(root, new))
|
||||
File(root, "etc/droiddeck/empty").mkdirs()
|
||||
clearEmptyStandIn(root)
|
||||
File(root, NO_THERMAL).mkdirs()
|
||||
}
|
||||
|
||||
/**
|
||||
* It stands in for /sys/bus/pci/devices, and libpci exits the whole process on an entry it cannot
|
||||
* parse; older builds let thermal bind mount points leak into it. The guest can write here, so a
|
||||
* link is never followed: one in place of the folder is removed, and one above it stops the cleanup.
|
||||
*/
|
||||
private fun clearEmptyStandIn(root: File) {
|
||||
val linkedAbove = listOf("etc", "etc/droiddeck").firstOrNull { Files.isSymbolicLink(File(root, it).toPath()) }
|
||||
if (linkedAbove != null) {
|
||||
Log.w(TAG, "not clearing the empty stand-in: $linkedAbove is a link")
|
||||
return
|
||||
}
|
||||
val empty = File(root, "etc/droiddeck/empty")
|
||||
if (Files.isSymbolicLink(empty.toPath())) runCatching { Files.delete(empty.toPath()) }
|
||||
.onFailure { Log.w(TAG, "could not remove the link at $empty", it); return }
|
||||
empty.mkdirs()
|
||||
empty.listFiles()?.forEach { entry ->
|
||||
runCatching { deleteWithoutFollowing(entry.toPath()) }.onFailure { Log.w(TAG, "could not clear $entry", it) }
|
||||
}
|
||||
}
|
||||
|
||||
private fun deleteWithoutFollowing(path: java.nio.file.Path) {
|
||||
if (Files.isDirectory(path, java.nio.file.LinkOption.NOFOLLOW_LINKS)) {
|
||||
Files.newDirectoryStream(path).use { entries -> entries.forEach(::deleteWithoutFollowing) }
|
||||
}
|
||||
Files.deleteIfExists(path)
|
||||
}
|
||||
|
||||
/** Stands in for a /sys/class/thermal the kernel won't list; proot adds the bound zones' mount points to it. */
|
||||
const val NO_THERMAL = "etc/droiddeck/no-thermal"
|
||||
|
||||
@Synchronized
|
||||
fun migrateRootfs(root: File) {
|
||||
migrateEtc(root)
|
||||
|
||||
@@ -248,7 +248,7 @@ public final class LinuxRuntime {
|
||||
// A kernel that refuses to list /sys/class/thermal (Pixel 10, Android 17) made mangoapp abort
|
||||
// at start ("filesystem_error ... Permission denied: '/sys/class/thermal/'") until its
|
||||
// wrapper gave up: it lists the directory for CPU temperatures. Empty there instead.
|
||||
if (new File("/sys/class/thermal").list() == null) bind(cmd, new File(root, "etc/droiddeck/empty").getPath() + ":/sys/class/thermal");
|
||||
if (new File("/sys/class/thermal").list() == null) bind(cmd, new File(root, LegacyNames.NO_THERMAL).getPath() + ":/sys/class/thermal");
|
||||
bind(cmd, context.getFilesDir().getPath());
|
||||
bind(cmd, context.getCacheDir().getPath());
|
||||
bind(cmd, liveDir(context).getPath());
|
||||
|
||||
@@ -118,6 +118,39 @@ object SessionPrefs {
|
||||
prefs(context).edit().putBoolean("launcherFullscreen", on).apply()
|
||||
}
|
||||
|
||||
fun launcherFrost(context: Context): Boolean = prefs(context).getBoolean("launcherFrost", false)
|
||||
|
||||
fun setLauncherFrost(context: Context, on: Boolean) {
|
||||
prefs(context).edit().putBoolean("launcherFrost", on).apply()
|
||||
}
|
||||
|
||||
fun frostWallpaper(context: Context): Boolean = prefs(context).getBoolean("frostWallpaper", true)
|
||||
|
||||
fun setFrostWallpaper(context: Context, on: Boolean) {
|
||||
prefs(context).edit().putBoolean("frostWallpaper", on).apply()
|
||||
}
|
||||
|
||||
fun frostCards(context: Context): Boolean = prefs(context).getBoolean("frostCards", true)
|
||||
|
||||
fun setFrostCards(context: Context, on: Boolean) {
|
||||
prefs(context).edit().putBoolean("frostCards", on).apply()
|
||||
}
|
||||
|
||||
fun frostTransparency(context: Context): Int = frostPercent(context, "frostTransparency", com.droiddeck.launcher.ui.FROST_WALLPAPER_DEFAULT)
|
||||
|
||||
fun setFrostTransparency(context: Context, percent: Int) = setFrostPercent(context, "frostTransparency", percent)
|
||||
|
||||
fun frostCardTransparency(context: Context): Int = frostPercent(context, "frostCardTransparency", com.droiddeck.launcher.ui.FROST_DEFAULT)
|
||||
|
||||
fun setFrostCardTransparency(context: Context, percent: Int) = setFrostPercent(context, "frostCardTransparency", percent)
|
||||
|
||||
private fun frostPercent(context: Context, key: String, default: Int): Int =
|
||||
prefs(context).getInt(key, default).coerceIn(0, com.droiddeck.launcher.ui.FROST_MAX)
|
||||
|
||||
private fun setFrostPercent(context: Context, key: String, percent: Int) {
|
||||
prefs(context).edit().putInt(key, percent.coerceIn(0, com.droiddeck.launcher.ui.FROST_MAX)).apply()
|
||||
}
|
||||
|
||||
fun controllerHaptics(context: Context): Boolean = prefs(context).getBoolean("controllerHaptics", true)
|
||||
|
||||
fun setControllerHaptics(context: Context, on: Boolean) {
|
||||
|
||||
@@ -12,7 +12,7 @@ object SettingsReset {
|
||||
private const val TAG = "SettingsReset"
|
||||
|
||||
internal val SESSION_KEYS = setOf(
|
||||
"orientation", "launcherFullscreen", "controllerHaptics", "animations", "lowStorageWarning", "theme", "runSteamAtStartup", "startupSession", "addedGamesArt",
|
||||
"orientation", "launcherFullscreen", "launcherFrost", "frostWallpaper", "frostCards", "frostTransparency", "frostCardTransparency", "controllerHaptics", "animations", "lowStorageWarning", "theme", "runSteamAtStartup", "startupSession", "addedGamesArt",
|
||||
"drawerWidthDp", "dualScreenMode", "dualScreenSessionMode", "dualScreenLauncher", "dualScreenSessionControls", "androidTextFieldKeyboard",
|
||||
"soundtracksIngame", "gameStoresSpeedTier", "gameStoresParallel", "storesOpenTab", "storesShowMature",
|
||||
"storesInstallLanguage",
|
||||
|
||||
@@ -41,8 +41,73 @@ internal fun FrameGenMenu(
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val engines = listOf(FrameGen.ENGINE_LSFG to "LSFG", FrameGen.ENGINE_DDFG to "DDFG")
|
||||
|
||||
if (legacyButtons) {
|
||||
val context = LocalContext.current
|
||||
val options = buildList {
|
||||
add(FrameGen.Mode.OFF.copy(multiplier = mode.multiplier))
|
||||
(2..4).forEach { add(FrameGen.Mode(FrameGen.ENGINE_DDFG, it)) }
|
||||
(2..4).forEach { add(FrameGen.Mode(FrameGen.ENGINE_LSFG, it)) }
|
||||
FrameGen.ADAPTIVE_TARGETS.forEach { add(FrameGen.Mode(FrameGen.ENGINE_LSFG, target = it)) }
|
||||
}
|
||||
Column(Modifier.fillMaxWidth().padding(start = 10.dp, end = 10.dp, bottom = 8.dp)) {
|
||||
options.forEachIndexed { index, option ->
|
||||
val selected = mode == option ||
|
||||
(option.engine == FrameGen.ENGINE_OFF && selectedEngine == null)
|
||||
val enabled = option.engine != FrameGen.ENGINE_LSFG || lossless.ready || selected
|
||||
val pick = { onPick(option) }
|
||||
OutlinedButton(
|
||||
onClick = pick,
|
||||
enabled = enabled,
|
||||
modifier = (if (index == 0) focusModifier else Modifier).fillMaxWidth()
|
||||
.padding(top = if (index == 0) 0.dp else 6.dp)
|
||||
.controllerConfirm(enabled = enabled, 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(FrameGen.label(context, option)) }
|
||||
}
|
||||
if (selectedEngine == FrameGen.ENGINE_LSFG && !lossless.ready) {
|
||||
Text(
|
||||
need.orEmpty(),
|
||||
color = colors.onSurfaceVariant,
|
||||
style = MaterialTheme.typography.bodySmall,
|
||||
modifier = Modifier.padding(top = 6.dp),
|
||||
)
|
||||
}
|
||||
if (gameProfileId != null) {
|
||||
val resetGame = onResetGame
|
||||
OutlinedButton(
|
||||
onClick = resetGame,
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 6.dp)
|
||||
.controllerConfirm(onClick = resetGame),
|
||||
contentPadding = PaddingValues(horizontal = 12.dp, vertical = 8.dp),
|
||||
) {
|
||||
Text(stringResource(R.string.comp_game_use_general) + if (hasGameOverride) "" else " ✓")
|
||||
}
|
||||
}
|
||||
if (lossless.owned) {
|
||||
val using = when (lossless.source) {
|
||||
Lossless.Source.STEAM -> stringResource(R.string.lsfg_using_steam)
|
||||
Lossless.Source.IMPORT -> stringResource(R.string.lsfg_using_import)
|
||||
Lossless.Source.NONE -> null
|
||||
}
|
||||
OutlinedButton(
|
||||
onClick = onImportLossless,
|
||||
modifier = Modifier.fillMaxWidth().padding(top = 6.dp)
|
||||
.controllerConfirm(onClick = onImportLossless),
|
||||
contentPadding = PaddingValues(horizontal = 12.dp, vertical = 8.dp),
|
||||
) {
|
||||
Text(stringResource(R.string.lsfg_import) + (using?.let { " · $it" } ?: ""))
|
||||
}
|
||||
}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Column(Modifier.fillMaxWidth().padding(start = 10.dp, end = 10.dp, top = 0.dp, bottom = 8.dp)) {
|
||||
if (!legacyButtons) OutlinedButton(
|
||||
OutlinedButton(
|
||||
onClick = { onPick(FrameGen.Mode.OFF.copy(multiplier = mode.multiplier)) },
|
||||
modifier = Modifier.fillMaxWidth().controllerConfirm(
|
||||
onClick = { onPick(FrameGen.Mode.OFF.copy(multiplier = mode.multiplier)) },
|
||||
@@ -54,7 +119,7 @@ internal fun FrameGenMenu(
|
||||
),
|
||||
) { Text(offLabel) }
|
||||
|
||||
Row(Modifier.fillMaxWidth().then(if (legacyButtons) Modifier else Modifier.padding(top = 8.dp)), horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
Row(Modifier.fillMaxWidth().padding(top = 8.dp), horizontalArrangement = Arrangement.spacedBy(8.dp)) {
|
||||
val focusIndex = engines.indexOfFirst { (engine, _) ->
|
||||
selectedEngine == engine || engine != FrameGen.ENGINE_LSFG || lossless.ready
|
||||
}
|
||||
|
||||
@@ -177,6 +177,12 @@ class FrontEndState(
|
||||
val launcherOrientation: Int = android.content.pm.ActivityInfo.SCREEN_ORIENTATION_USER,
|
||||
val homePage: String = com.droiddeck.launcher.core.AppUiPrefs.HOME_PAGE_STEAM,
|
||||
val launcherFullscreen: Boolean = true,
|
||||
val launcherFrost: Boolean = false,
|
||||
val frostWallpaper: Boolean = true,
|
||||
val frostCards: Boolean = true,
|
||||
val frostTransparency: Int = FROST_WALLPAPER_DEFAULT,
|
||||
val frostCardTransparency: Int = FROST_DEFAULT,
|
||||
val frostSupported: Boolean = false,
|
||||
val controllerHaptics: Boolean = true,
|
||||
val downloadSource: String = DownloadSource.MODE_AUTO,
|
||||
val downloadMirror: String = "",
|
||||
@@ -284,6 +290,11 @@ class FrontEndActions(
|
||||
val onLauncherOrientation: (Int) -> Unit = {},
|
||||
val onHomePage: (String) -> Unit = {},
|
||||
val onLauncherFullscreen: (Boolean) -> Unit = {},
|
||||
val onLauncherFrost: (Boolean) -> Unit = {},
|
||||
val onFrostWallpaper: (Boolean) -> Unit = {},
|
||||
val onFrostCards: (Boolean) -> Unit = {},
|
||||
val onFrostTransparency: (Int) -> Unit = {},
|
||||
val onFrostCardTransparency: (Int) -> Unit = {},
|
||||
val onControllerHaptics: (Boolean) -> Unit = {},
|
||||
val onAnimationsEnabled: (Boolean) -> Unit = {},
|
||||
val onLowStorageWarning: (Boolean) -> Unit = {},
|
||||
@@ -693,7 +704,7 @@ private fun FrontEndScreenBody(s: FrontEndState, a: FrontEndActions, page: (@Com
|
||||
}
|
||||
}
|
||||
androidx.compose.foundation.layout.BoxWithConstraints(
|
||||
modifier = Modifier.fillMaxSize().background(colors.background)
|
||||
modifier = Modifier.fillMaxSize().background(if (LocalFrost.current != null) Color.Transparent else colors.background)
|
||||
.windowInsetsPadding(if (s.launcherFullscreen) WindowInsets.displayCutout else WindowInsets.systemBars)
|
||||
.onFocusChanged { anyFocused = it.hasFocus },
|
||||
) {
|
||||
|
||||
@@ -156,6 +156,7 @@ internal fun SetupPanel(
|
||||
) {
|
||||
val host = rememberMenuHost()
|
||||
val ctx = LocalContext.current
|
||||
val frostRow = s.frostSupported && s.theme != Themes.TRUE_BLACK
|
||||
var steamOrientation by remember { mutableStateOf(SessionPrefs.orientation(ctx, "steam")) }
|
||||
var desktopOrientation by remember { mutableStateOf(SessionPrefs.orientation(ctx, "desktop")) }
|
||||
val lifecycleOwner = LocalLifecycleOwner.current
|
||||
@@ -268,7 +269,7 @@ internal fun SetupPanel(
|
||||
val listing = searching && query.isNotBlank()
|
||||
val fixed = tab == CONTROLLER_TAB && !listing
|
||||
Column(modifier = Modifier.weight(1f).fillMaxWidth().then(if (fixed) Modifier else Modifier.verticalScroll(rememberScrollState())).padding(bottom = if (fixed) 0.dp else 24.dp)) {
|
||||
if (listing) SettingsSearchResults(query) { section -> pick(section.ordinal) }
|
||||
if (listing) SettingsSearchResults(query, frostRow) { section -> pick(section.ordinal) }
|
||||
else when (tab) {
|
||||
OVERVIEW_TAB -> {
|
||||
OnboardingCard(limitBlocks, a.onShowPhantomGate)
|
||||
@@ -465,6 +466,35 @@ internal fun SetupPanel(
|
||||
if (s.theme == Themes.GRADIENT) GradientColorRows()
|
||||
if (s.theme == Themes.CUSTOM) CustomColorRows()
|
||||
if (s.theme == Themes.TRUE_BLACK) HighlightColorRow()
|
||||
if (frostRow) {
|
||||
ToggleRow(
|
||||
host, "launcher-frost", stringResource(R.string.setup_frosted_background),
|
||||
stringResource(R.string.setup_frosted_background_hint), s.launcherFrost, onChange = a.onLauncherFrost,
|
||||
)
|
||||
if (s.launcherFrost) {
|
||||
val ctx = androidx.compose.ui.platform.LocalContext.current
|
||||
val percent: (Int) -> String = { ctx.getString(R.string.ctrl_percent, it) }
|
||||
ToggleRow(
|
||||
host, "launcher-frost-wallpaper", stringResource(R.string.setup_frosted_wallpaper), null,
|
||||
s.frostWallpaper, onChange = a.onFrostWallpaper,
|
||||
)
|
||||
SliderRow(
|
||||
stringResource(R.string.setup_frost_transparency), stringResource(R.string.setup_frost_transparency_hint),
|
||||
s.frostTransparency, 0..FROST_MAX, step = FROST_STEP, enabled = s.frostWallpaper, format = percent,
|
||||
onChange = a.onFrostTransparency,
|
||||
)
|
||||
ToggleRow(
|
||||
host, "launcher-frost-cards", stringResource(R.string.setup_frosted_cards),
|
||||
stringResource(if (s.frostWallpaper) R.string.setup_frosted_cards_hint else R.string.setup_frosted_cards_needs_wallpaper),
|
||||
s.frostCards, enabled = s.frostWallpaper, onChange = a.onFrostCards,
|
||||
)
|
||||
SliderRow(
|
||||
stringResource(R.string.setup_frost_card_transparency), stringResource(R.string.setup_frost_card_transparency_hint),
|
||||
s.frostCardTransparency, 0..FROST_MAX, step = FROST_STEP, enabled = s.frostWallpaper && s.frostCards, format = percent,
|
||||
onChange = a.onFrostCardTransparency,
|
||||
)
|
||||
}
|
||||
}
|
||||
ChoiceRow(
|
||||
host, "app-scale", stringResource(R.string.setup_app_scale), stringResource(R.string.setup_app_scale_hint),
|
||||
com.droiddeck.launcher.core.AppUiPrefs.scales.map { percent ->
|
||||
@@ -857,6 +887,34 @@ internal fun LaunchSettings(s: FrontEndState, a: FrontEndActions, host: MenuHost
|
||||
val steamCard: (@Composable (Modifier) -> Unit)? = if (game != null && steamScope != null) { m ->
|
||||
Box(m) { GameSettingsCard(host, game, steamScope) }
|
||||
} else null
|
||||
val frameGenMenuContent: @Composable () -> Unit = {
|
||||
FrameGenMenu(
|
||||
mode = if (frameGenProfileKey != null) gameFrameGenMode else s.frameGen,
|
||||
lossless = s.lossless,
|
||||
onPick = { mode ->
|
||||
val key = frameGenProfileKey
|
||||
if (key == null) {
|
||||
a.onFrameGenPick(mode)
|
||||
} else {
|
||||
com.droiddeck.launcher.gpu.FrameGen.setForGame(context, key, mode)
|
||||
gameFrameGenMode = mode
|
||||
gameFrameGenOverride = true
|
||||
}
|
||||
},
|
||||
onImportLossless = a.onImportLossless,
|
||||
legacyButtons = true,
|
||||
gameProfileId = frameGenProfileKey,
|
||||
hasGameOverride = gameFrameGenOverride,
|
||||
onResetGame = {
|
||||
val key = frameGenProfileKey
|
||||
if (key != null) {
|
||||
com.droiddeck.launcher.gpu.FrameGen.clearGame(context, key)
|
||||
gameFrameGenMode = com.droiddeck.launcher.gpu.FrameGen.mode(context)
|
||||
gameFrameGenOverride = false
|
||||
}
|
||||
},
|
||||
)
|
||||
}
|
||||
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)
|
||||
@@ -878,33 +936,7 @@ internal fun LaunchSettings(s: FrontEndState, a: FrontEndActions, host: MenuHost
|
||||
) {
|
||||
host.open = if (host.open == "fg") null else "fg"
|
||||
}
|
||||
if (host.open == "fg") FrameGenMenu(
|
||||
mode = if (frameGenProfileKey != null) gameFrameGenMode else s.frameGen,
|
||||
lossless = s.lossless,
|
||||
onPick = { mode ->
|
||||
val key = frameGenProfileKey
|
||||
if (key == null) {
|
||||
a.onFrameGenPick(mode)
|
||||
} else {
|
||||
com.droiddeck.launcher.gpu.FrameGen.setForGame(context, key, mode)
|
||||
gameFrameGenMode = mode
|
||||
gameFrameGenOverride = true
|
||||
}
|
||||
},
|
||||
onImportLossless = a.onImportLossless,
|
||||
legacyButtons = true,
|
||||
gameProfileId = frameGenProfileKey,
|
||||
hasGameOverride = gameFrameGenOverride,
|
||||
onResetGame = {
|
||||
val key = frameGenProfileKey
|
||||
if (key != null) {
|
||||
com.droiddeck.launcher.gpu.FrameGen.clearGame(context, key)
|
||||
gameFrameGenMode =
|
||||
com.droiddeck.launcher.gpu.FrameGen.mode(context)
|
||||
gameFrameGenOverride = false
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
}
|
||||
}
|
||||
if (controller != null) add { m -> SettingCard(stringResource(R.string.setup_card_controls), stringResource(R.string.setup_card_controls_hint), "card:controls", m, controller.onMapping) }
|
||||
@@ -936,6 +968,11 @@ internal fun LaunchSettings(s: FrontEndState, a: FrontEndActions, host: MenuHost
|
||||
repeat(columns - row.size) { Spacer(Modifier.weight(1f)) }
|
||||
}
|
||||
}
|
||||
if (host.open == "fg") {
|
||||
Box(Modifier.fillMaxWidth().padding(top = 4.dp)) {
|
||||
frameGenMenuContent()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ internal fun WindowDialog(
|
||||
content: @Composable () -> Unit,
|
||||
) {
|
||||
if (!LocalPresentationWindow.current) {
|
||||
Dialog(onDismissRequest, properties, content)
|
||||
Dialog(onDismissRequest, properties) { SolidSurfaces(content) }
|
||||
return
|
||||
}
|
||||
Popup(
|
||||
@@ -87,7 +87,7 @@ internal fun WindowDialog(
|
||||
Modifier.fillMaxSize().background(androidx.compose.ui.graphics.Color.Black.copy(alpha = 0.6f))
|
||||
.tapOutside { if (properties.dismissOnClickOutside) onDismissRequest() },
|
||||
contentAlignment = Alignment.Center,
|
||||
) { content() }
|
||||
) { SolidSurfaces(content) }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -150,7 +150,7 @@ internal fun GlidePopup(
|
||||
) {
|
||||
Popup(popupPositionProvider, onDismissRequest, properties) {
|
||||
if (properties.focusable) TrackKeyWindow()
|
||||
FocusGlideHost(content = content)
|
||||
SolidSurfaces { FocusGlideHost(content = content) }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,130 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import android.app.Activity
|
||||
import android.graphics.drawable.ColorDrawable
|
||||
import android.os.Build
|
||||
import android.os.PowerManager
|
||||
import android.view.WindowManager
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.compose.runtime.mutableStateOf
|
||||
import androidx.compose.runtime.setValue
|
||||
import androidx.compose.runtime.staticCompositionLocalOf
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.compositeOver
|
||||
import androidx.compose.ui.graphics.lerp
|
||||
import androidx.compose.ui.graphics.luminance
|
||||
import java.util.function.Consumer
|
||||
|
||||
internal val LocalFrost = staticCompositionLocalOf<Color?> { null }
|
||||
|
||||
internal const val FROST_MAX = 100
|
||||
internal const val FROST_STEP = 10
|
||||
internal const val FROST_DEFAULT = 50
|
||||
internal const val FROST_WALLPAPER_DEFAULT = 80
|
||||
private const val FROST_TEXT_LIFT = 0.5f
|
||||
private const val FROST_LIFT_STEPS = 5
|
||||
private const val FROST_TINT_MAX = 0.9f
|
||||
private const val FROST_SEARCH_STEPS = 12
|
||||
private const val FROST_BLUR_DP = 28
|
||||
|
||||
private class FrostScale(val solid: Float, val default: Float, val clear: Float) {
|
||||
fun at(percent: Int): Float {
|
||||
val t = percent.coerceIn(0, FROST_MAX) / FROST_DEFAULT.toFloat()
|
||||
return if (t <= 1f) solid + (default - solid) * t else default + (clear - default) * (t - 1f)
|
||||
}
|
||||
}
|
||||
|
||||
private val TINT_DARK = FrostScale(0.9f, 0.58f, 0.32f)
|
||||
private val TINT_LIGHT = FrostScale(0.94f, 0.7f, 0.48f)
|
||||
private val CARD_DARK = FrostScale(1f, 0.6f, 0.3f)
|
||||
private val CARD_LIGHT = FrostScale(1f, 0.74f, 0.45f)
|
||||
private val TEXT_LIFT_MAX = FrostScale(FROST_TEXT_LIFT, FROST_TEXT_LIFT, 1f)
|
||||
|
||||
class FrostChoice(
|
||||
val transparency: Int = FROST_WALLPAPER_DEFAULT,
|
||||
val cards: Boolean = false,
|
||||
val cardTransparency: Int = FROST_DEFAULT,
|
||||
)
|
||||
|
||||
internal class FrostLook(val veil: Color, val lift: Float, val cardAlpha: Float)
|
||||
|
||||
internal fun frostLook(palette: Palette, choice: FrostChoice): FrostLook {
|
||||
val light = palette.background.luminance() > 0.5f
|
||||
val cardAlpha = if (!choice.cards) 1f else (if (light) CARD_LIGHT else CARD_DARK).at(choice.cardTransparency)
|
||||
val maxLift = maxOf(TEXT_LIFT_MAX.at(choice.transparency), if (choice.cards) TEXT_LIFT_MAX.at(choice.cardTransparency) else 0f)
|
||||
// Android reports only the wallpaper's main colours, and any part of it can sit behind text.
|
||||
fun readable(alpha: Float, lift: Float): Boolean = listOf(Color.Black, Color.White).all { behind ->
|
||||
val page = palette.background.copy(alpha = alpha).compositeOver(behind)
|
||||
val card = palette.surface.copy(alpha = cardAlpha).compositeOver(page)
|
||||
val hint = lerp(palette.onSurfaceVariant, palette.onBackground, lift)
|
||||
minOf(ThemeColors.contrast(hint, page), ThemeColors.contrast(hint, card)) >= ThemeColors.MIN_CONTRAST
|
||||
}
|
||||
var low = 0f
|
||||
var high = FROST_TINT_MAX
|
||||
if (readable(low, maxLift)) high = low
|
||||
else if (!readable(high, maxLift)) high = 1f
|
||||
else repeat(FROST_SEARCH_STEPS) {
|
||||
val mid = (low + high) / 2
|
||||
if (readable(mid, maxLift)) high = mid else low = mid
|
||||
}
|
||||
val lifts = (0..FROST_LIFT_STEPS).map { FROST_TEXT_LIFT + (maxLift - FROST_TEXT_LIFT) * it / FROST_LIFT_STEPS }
|
||||
val tint = maxOf((if (light) TINT_LIGHT else TINT_DARK).at(choice.transparency), kotlin.math.ceil(high * 255f) / 255f)
|
||||
val alpha = if (lifts.any { readable(tint, it) }) tint else 1f
|
||||
val lift = lifts.firstOrNull { readable(alpha, it) } ?: maxLift
|
||||
return FrostLook(palette.background.copy(alpha = alpha), lift, cardAlpha)
|
||||
}
|
||||
|
||||
internal fun Palette.frosted(look: FrostLook): Palette = Palette(
|
||||
id, label, detail,
|
||||
background = background,
|
||||
surface = if (look.cardAlpha < 1f) surface.copy(alpha = look.cardAlpha) else surface,
|
||||
surfaceVariant = if (look.cardAlpha < 1f) surfaceVariant.copy(alpha = look.cardAlpha) else surfaceVariant,
|
||||
line = line, line2 = line2,
|
||||
onBackground = onBackground, onSurfaceVariant = lerp(onSurfaceVariant, onBackground, look.lift),
|
||||
primary = primary, primary2 = primary2, onPrimary = onPrimary, signal = signal,
|
||||
good = good, error = error, warning = warning,
|
||||
)
|
||||
|
||||
|
||||
internal class LauncherFrost(private val activity: Activity) {
|
||||
var available by mutableStateOf(false)
|
||||
private set
|
||||
var prepared = false
|
||||
private set
|
||||
|
||||
private var stopListening: (() -> Unit)? = null
|
||||
|
||||
val supported: Boolean
|
||||
get() = Build.VERSION.SDK_INT >= 31 &&
|
||||
(available || activity.getSystemService(PowerManager::class.java)?.isPowerSaveMode == true)
|
||||
|
||||
fun start() {
|
||||
if (Build.VERSION.SDK_INT < 31 || stopListening != null) return
|
||||
val windows = activity.windowManager
|
||||
val blur = Consumer<Boolean> { available = it }
|
||||
available = windows.isCrossWindowBlurEnabled
|
||||
windows.addCrossWindowBlurEnabledListener(blur)
|
||||
stopListening = { windows.removeCrossWindowBlurEnabledListener(blur) }
|
||||
}
|
||||
|
||||
fun stop() {
|
||||
stopListening?.invoke()
|
||||
stopListening = null
|
||||
}
|
||||
|
||||
// A window made see-through after its first frame keeps drawing over its old frames, so this runs before setContent.
|
||||
fun prepare(on: Boolean) {
|
||||
prepared = on && Build.VERSION.SDK_INT >= 31
|
||||
if (prepared) activity.window.setBackgroundDrawable(ColorDrawable(android.graphics.Color.TRANSPARENT))
|
||||
}
|
||||
|
||||
fun show(on: Boolean) {
|
||||
if (!prepared || Build.VERSION.SDK_INT < 31) return
|
||||
val window = activity.window
|
||||
val flags = WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER or WindowManager.LayoutParams.FLAG_BLUR_BEHIND
|
||||
if (on) window.addFlags(flags) else window.clearFlags(flags)
|
||||
window.attributes = window.attributes.apply {
|
||||
blurBehindRadius = if (on) (FROST_BLUR_DP * activity.resources.displayMetrics.density).toInt() else 0
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,6 +39,7 @@ internal class SettingsEntry(
|
||||
val words: List<String> = emptyList(),
|
||||
val developer: Boolean = false,
|
||||
val tab: String? = null,
|
||||
val frost: Boolean = false,
|
||||
) {
|
||||
val within: Int? get() = section?.title ?: tab?.let { railLabelIcon(it).first } ?: group
|
||||
|
||||
@@ -100,6 +101,10 @@ internal object SettingsIndex {
|
||||
s(SettingsSection.GLASSES, R.string.setup_tab_glasses, "xreal", "viture", "vr", "ar"),
|
||||
|
||||
s(SettingsSection.LAUNCHER, R.string.setup_theme, "color", "dark"),
|
||||
SettingsEntry(
|
||||
SettingsPlace.SETTINGS, R.string.setup_frosted_background, section = SettingsSection.LAUNCHER, frost = true,
|
||||
words = listOf("blur", "wallpaper", "background", "cards", "transparent", "transparency", "opacity", "glass"),
|
||||
),
|
||||
s(SettingsSection.LAUNCHER, R.string.setup_app_scale, "size", "zoom"),
|
||||
s(SettingsSection.LAUNCHER, R.string.setup_launcher_icon),
|
||||
s(SettingsSection.LAUNCHER, R.string.setup_animations),
|
||||
@@ -151,6 +156,6 @@ internal object SettingsIndex {
|
||||
sh(R.string.stores_tab_library, R.string.stores_tab_library, "second library", "sd card", "steam library"),
|
||||
)
|
||||
|
||||
fun search(context: Context, query: String): List<SettingsEntry> =
|
||||
entries.filter { (!it.developer || DeveloperTools.on) && it.matches(context, query) }
|
||||
fun search(context: Context, query: String, frost: Boolean = false): List<SettingsEntry> =
|
||||
entries.filter { (!it.developer || DeveloperTools.on) && (!it.frost || frost) && it.matches(context, query) }
|
||||
}
|
||||
@@ -96,9 +96,9 @@ internal fun SettingsPillSearch(
|
||||
}
|
||||
|
||||
@Composable
|
||||
internal fun SettingsSearchResults(query: String, onOpen: (SettingsSection) -> Unit) {
|
||||
internal fun SettingsSearchResults(query: String, frost: Boolean, onOpen: (SettingsSection) -> Unit) {
|
||||
val ctx = LocalContext.current
|
||||
val found = remember(query) { SettingsIndex.search(ctx, query) }
|
||||
val found = remember(query, frost) { SettingsIndex.search(ctx, query, frost) }
|
||||
if (found.isEmpty()) {
|
||||
Note(stringResource(R.string.settings_search_none, query.trim()))
|
||||
return
|
||||
|
||||
@@ -307,7 +307,7 @@ fun AnchoredMenu(
|
||||
runCatching { firstItemFocus.requestFocus() }
|
||||
}
|
||||
}
|
||||
CompositionLocalProvider(LocalDensity provides density, LocalConfiguration provides configuration) {
|
||||
SolidSurfaces { CompositionLocalProvider(LocalDensity provides density, LocalConfiguration provides configuration) {
|
||||
AnimatedVisibility(
|
||||
visibleState = state,
|
||||
enter = fadeIn(Motion.tw(180)) + scaleIn(Motion.sp(0.7f), initialScale = 0.94f, transformOrigin = TransformOrigin(if (compact) 0f else 1f, 0f)),
|
||||
@@ -363,7 +363,7 @@ fun AnchoredMenu(
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} }
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2,7 +2,10 @@ package com.droiddeck.launcher.ui
|
||||
|
||||
import androidx.compose.foundation.layout.Box
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.ui.Modifier
|
||||
import androidx.compose.ui.focus.focusRequester
|
||||
import androidx.compose.ui.res.stringResource
|
||||
import androidx.compose.ui.unit.dp
|
||||
import com.droiddeck.launcher.R
|
||||
|
||||
|
||||
@@ -12,8 +15,30 @@ internal fun FrameGenGroup(s: FrontEndState, a: FrontEndActions) {
|
||||
SettingsGroup(stringResource(R.string.frame_gen_title)) {
|
||||
SettingsRow(stringResource(R.string.frame_gen_title), stringResource(R.string.frame_gen_hint), highlighted = host.open == "fg") {
|
||||
Box {
|
||||
ValueChip(s.frameGenLabel, host.open == "fg") { host.open = if (host.open == "fg") null else "fg" }
|
||||
if (host.open == "fg") FrameGenMenu(s.frameGen, s.lossless, a.onFrameGenPick, a.onImportLossless)
|
||||
val open = host.open == "fg"
|
||||
ValueChip(s.frameGenLabel, open) { host.open = if (open) null else "fg" }
|
||||
AnchoredMenu(
|
||||
open = open,
|
||||
onDismiss = { if (host.open == "fg") host.open = null },
|
||||
title = stringResource(R.string.frame_gen_title),
|
||||
compact = true,
|
||||
minWidth = 220.dp,
|
||||
) { firstItemFocus ->
|
||||
FrameGenMenu(
|
||||
mode = s.frameGen,
|
||||
lossless = s.lossless,
|
||||
onPick = { mode ->
|
||||
a.onFrameGenPick(mode)
|
||||
host.open = null
|
||||
},
|
||||
onImportLossless = {
|
||||
a.onImportLossless()
|
||||
host.open = null
|
||||
},
|
||||
focusModifier = Modifier.focusRequester(firstItemFocus),
|
||||
legacyButtons = true,
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,7 +149,6 @@ private val OutPull = 6.dp
|
||||
private val OutBoxCorner = 16.dp
|
||||
private val OutFillet = 10.dp
|
||||
|
||||
@OptIn(ExperimentalComposeUiApi::class)
|
||||
@Composable
|
||||
internal fun StepOut(
|
||||
open: Boolean,
|
||||
@@ -163,6 +162,22 @@ internal fun StepOut(
|
||||
items: Int = 4,
|
||||
handle: @Composable () -> Unit,
|
||||
content: @Composable StepOutScope.() -> Unit,
|
||||
) = SolidSurfaces { StepOutPanel(open, pill, preferredSide, accent, onDismiss, onClosed, pillCorner, maxWidth, items, handle, content) }
|
||||
|
||||
@OptIn(ExperimentalComposeUiApi::class)
|
||||
@Composable
|
||||
private fun StepOutPanel(
|
||||
open: Boolean,
|
||||
pill: Rect,
|
||||
preferredSide: StepSide,
|
||||
accent: Color,
|
||||
onDismiss: () -> Unit,
|
||||
onClosed: () -> Unit,
|
||||
pillCorner: Dp?,
|
||||
maxWidth: Dp,
|
||||
items: Int,
|
||||
handle: @Composable () -> Unit,
|
||||
content: @Composable StepOutScope.() -> Unit,
|
||||
) {
|
||||
val colors = MaterialTheme.colorScheme
|
||||
val density = LocalDensity.current
|
||||
|
||||
@@ -230,35 +230,51 @@ val LocalPalette = staticCompositionLocalOf { Themes.byId(Themes.GRAPHITE) }
|
||||
|
||||
val Palette.onSignal: Color get() = if (signal.luminance() > 0.18f) Color(0xFF03111F) else Color.White
|
||||
|
||||
internal val LocalSolidPalette = staticCompositionLocalOf<Palette?> { null }
|
||||
|
||||
@Composable
|
||||
fun DroidDeckTheme(theme: String? = null, appScale: Int = AppUiPrefs.DEFAULT_SCALE, content: @Composable () -> Unit) {
|
||||
fun DroidDeckTheme(theme: String? = null, appScale: Int = AppUiPrefs.DEFAULT_SCALE, frost: FrostChoice? = null, content: @Composable () -> Unit) {
|
||||
val context = LocalContext.current
|
||||
remember(context) { Themes.loadGradient(context) }
|
||||
val id = theme ?: SessionPrefs.theme(context)
|
||||
if (id == Themes.INNER_GAMER) InnerGamerHue(Themes.rgbSpeed)
|
||||
val p = Themes.byId(id)
|
||||
val scheme = darkColorScheme(
|
||||
primary = p.primary, onPrimary = p.onPrimary, secondary = p.onSurfaceVariant,
|
||||
background = p.background, onBackground = p.onBackground,
|
||||
surface = p.surface, onSurface = p.onBackground,
|
||||
surfaceVariant = p.surfaceVariant, onSurfaceVariant = p.onSurfaceVariant,
|
||||
error = p.error,
|
||||
)
|
||||
val solid = Themes.byId(id)
|
||||
val look = frost?.let { frostLook(solid, it) }
|
||||
val p = if (look == null) solid else solid.frosted(look)
|
||||
val baseDensity = LocalDensity.current
|
||||
val baseConfiguration = LocalConfiguration.current
|
||||
val density = remember(baseDensity, appScale) { scaledAppDensity(baseDensity, appScale) }
|
||||
val configuration = remember(baseConfiguration, appScale) { scaledAppConfiguration(baseConfiguration, appScale) }
|
||||
CompositionLocalProvider(
|
||||
LocalPalette provides p,
|
||||
LocalSolidPalette provides solid.takeIf { look != null },
|
||||
LocalFrost provides look?.veil,
|
||||
LocalDensity provides density,
|
||||
LocalConfiguration provides configuration,
|
||||
) {
|
||||
MaterialTheme(colorScheme = scheme, typography = ContentDirected) {
|
||||
MaterialTheme(colorScheme = p.scheme(), typography = ContentDirected) {
|
||||
FocusGlideHost { ProvideTextStyle(TextStyle(textDirection = TextDirection.Content), content) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun Palette.scheme() = darkColorScheme(
|
||||
primary = primary, onPrimary = onPrimary, secondary = onSurfaceVariant,
|
||||
background = background, onBackground = onBackground,
|
||||
surface = surface, onSurface = onBackground,
|
||||
surfaceVariant = surfaceVariant, onSurfaceVariant = onSurfaceVariant,
|
||||
error = error,
|
||||
)
|
||||
|
||||
@Composable
|
||||
internal fun SolidSurfaces(content: @Composable () -> Unit) {
|
||||
val solid = LocalSolidPalette.current
|
||||
if (solid == null) content()
|
||||
else CompositionLocalProvider(LocalPalette provides solid, LocalSolidPalette provides null, LocalFrost provides null) {
|
||||
MaterialTheme(colorScheme = solid.scheme(), typography = MaterialTheme.typography, content = content)
|
||||
}
|
||||
}
|
||||
|
||||
private val ContentDirected = Typography().run {
|
||||
fun TextStyle.byContent() = copy(textDirection = TextDirection.Content)
|
||||
Typography(
|
||||
|
||||
@@ -69,7 +69,7 @@ internal object ThemeColors {
|
||||
|
||||
private val DARK_INK = Color(0xFF03111F)
|
||||
|
||||
private fun contrast(a: Color, b: Color): Float {
|
||||
internal fun contrast(a: Color, b: Color): Float {
|
||||
val x = a.luminance()
|
||||
val y = b.luminance()
|
||||
return (max(x, y) + 0.05f) / (min(x, y) + 0.05f)
|
||||
@@ -80,7 +80,7 @@ internal object ThemeColors {
|
||||
return if (worst(DARK_INK) >= worst(Color.White)) DARK_INK else Color.White
|
||||
}
|
||||
|
||||
private const val MIN_CONTRAST = 4.5f
|
||||
internal const val MIN_CONTRAST = 4.5f
|
||||
|
||||
private fun fitTo(ink: Color, argb: Int): Int {
|
||||
fun short(color: Int) = contrast(ink, Color(color)) < MIN_CONTRAST
|
||||
|
||||
@@ -1350,6 +1350,16 @@
|
||||
<string name="ctrl_joycon_vr">أجهزة Joy-Con كوحدات تحكم VR</string>
|
||||
<string name="ctrl_joycon_vr_hint">أثناء تشغيل SteamVR، يصبح كل Joy-Con يدًا. وجّهه إلى الأمام واضغط مطولًا على Home أو Capture لإعادة توسيطه.</string>
|
||||
<string name="setup_animations">الرسوم المتحركة</string>
|
||||
<string name="setup_frosted_background">مصنفر</string>
|
||||
<string name="setup_frosted_background_hint">يعرض خلفية الشاشة مموّهة خلف المشغّل. يستهلك طاقة بطارية أكثر.</string>
|
||||
<string name="setup_frosted_wallpaper">خلفية مصنفرة</string>
|
||||
<string name="setup_frosted_cards">بطاقات مصنفرة</string>
|
||||
<string name="setup_frosted_cards_hint">تُظهر البطاقات والمجموعات قليلًا من الخلفية. تبقى القوائم والحوارات معتمة.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">يتطلب الخلفية المصنفرة.</string>
|
||||
<string name="setup_frost_transparency">شفافية الخلفية</string>
|
||||
<string name="setup_frost_transparency_hint">مقدار ما يظهر من الخلفية.</string>
|
||||
<string name="setup_frost_card_transparency">شفافية البطاقات</string>
|
||||
<string name="setup_frost_card_transparency_hint">مقدار ما يظهر من الخلفية عبر البطاقات.</string>
|
||||
<string name="setup_low_storage_warning">التحذير عند انخفاض مساحة التخزين</string>
|
||||
<string name="setup_low_storage_warning_hint">اسأل قبل تشغيل Steam عندما تكون المساحة الحرة أقل من 10 جيجابايت.</string>
|
||||
<string name="ctrl_layout">التخطيط</string>
|
||||
|
||||
@@ -1399,6 +1399,16 @@
|
||||
<string name="glasses_xreal_experimental">Compatibilidad experimental con XREAL 1S, One, One Pro, One Pro+ y Aura. Usa el modo Follow y desactiva la estabilización en el menú de las gafas; en Aura, desactiva también Spatial Anchor. El seguimiento de cabeza y el cambio entre 2D/3D se han probado en Aura y One Pro+.</string>
|
||||
<string name="glasses_pro2_experimental">Seguimiento de cabeza experimental para Pro 2. Los ajustes de brillo y volumen y el cambio de modo de pantalla aún no son compatibles.</string>
|
||||
<string name="setup_animations">Animaciones</string>
|
||||
<string name="setup_frosted_background">Esmerilado</string>
|
||||
<string name="setup_frosted_background_hint">Muestra tu fondo de pantalla difuminado detrás del launcher. Consume más batería.</string>
|
||||
<string name="setup_frosted_wallpaper">Fondo de pantalla esmerilado</string>
|
||||
<string name="setup_frosted_cards">Tarjetas esmeriladas</string>
|
||||
<string name="setup_frosted_cards_hint">Las tarjetas y los grupos dejan ver un poco del fondo de pantalla. Los menús y diálogos siguen sólidos.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Necesita el fondo de pantalla esmerilado.</string>
|
||||
<string name="setup_frost_transparency">Transparencia del fondo de pantalla</string>
|
||||
<string name="setup_frost_transparency_hint">Cuánto se ve el fondo de pantalla.</string>
|
||||
<string name="setup_frost_card_transparency">Transparencia de las tarjetas</string>
|
||||
<string name="setup_frost_card_transparency_hint">Cuánto se ve el fondo de pantalla a través de las tarjetas.</string>
|
||||
<string name="setup_low_storage_warning">Avisar cuando queda poco almacenamiento</string>
|
||||
<string name="setup_low_storage_warning_hint">Preguntar antes de iniciar Steam cuando el espacio libre es menor a 10 GB.</string>
|
||||
<string name="ctrl_layout">Disposición</string>
|
||||
|
||||
@@ -1322,6 +1322,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Con като VR контролери</string>
|
||||
<string name="ctrl_joycon_vr_hint">Докато SteamVR работи, всеки Joy-Con става ръка. Насочете го напред и задръжте Home или Capture, за да го центрирате отново.</string>
|
||||
<string name="setup_animations">Анимации</string>
|
||||
<string name="setup_frosted_background">Матово</string>
|
||||
<string name="setup_frosted_background_hint">Показва тапета ви размазан зад лаунчъра. Изразходва повече батерия.</string>
|
||||
<string name="setup_frosted_wallpaper">Матов тапет</string>
|
||||
<string name="setup_frosted_cards">Матови карти</string>
|
||||
<string name="setup_frosted_cards_hint">Картите и групите пропускат малко от тапета. Менютата и диалозите остават плътни.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Изисква матов тапет.</string>
|
||||
<string name="setup_frost_transparency">Прозрачност на тапета</string>
|
||||
<string name="setup_frost_transparency_hint">Колко от тапета се вижда.</string>
|
||||
<string name="setup_frost_card_transparency">Прозрачност на картите</string>
|
||||
<string name="setup_frost_card_transparency_hint">Колко от тапета се вижда през картите.</string>
|
||||
<string name="setup_low_storage_warning">Предупреждение при малко място</string>
|
||||
<string name="setup_low_storage_warning_hint">Питай преди стартиране на Steam, когато свободното място е под 10 GB.</string>
|
||||
<string name="ctrl_layout">Разположение</string>
|
||||
|
||||
@@ -1336,6 +1336,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Cony jako ovladače VR</string>
|
||||
<string name="ctrl_joycon_vr_hint">Když běží SteamVR, každý Joy-Con slouží jako ruka. Namiřte ho dopředu a podržením Home nebo Capture ho znovu vycentrujete.</string>
|
||||
<string name="setup_animations">Animace</string>
|
||||
<string name="setup_frosted_background">Matné</string>
|
||||
<string name="setup_frosted_background_hint">Zobrazí za spouštěčem rozmazanou tapetu. Spotřebuje více baterie.</string>
|
||||
<string name="setup_frosted_wallpaper">Matná tapeta</string>
|
||||
<string name="setup_frosted_cards">Matné karty</string>
|
||||
<string name="setup_frosted_cards_hint">Karty a skupiny nechají prosvítat trochu tapety. Nabídky a dialogy zůstanou neprůhledné.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Vyžaduje matnou tapetu.</string>
|
||||
<string name="setup_frost_transparency">Průhlednost tapety</string>
|
||||
<string name="setup_frost_transparency_hint">Kolik tapety prosvítá.</string>
|
||||
<string name="setup_frost_card_transparency">Průhlednost karet</string>
|
||||
<string name="setup_frost_card_transparency_hint">Kolik tapety prosvítá kartami.</string>
|
||||
<string name="setup_low_storage_warning">Upozornit na nedostatek úložiště</string>
|
||||
<string name="setup_low_storage_warning_hint">Zeptat se před spuštěním Steamu, když je volné místo pod 10 GB.</string>
|
||||
<string name="ctrl_layout">Rozložení</string>
|
||||
|
||||
@@ -1322,6 +1322,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Cons som VR-controllere</string>
|
||||
<string name="ctrl_joycon_vr_hint">Mens SteamVR kører, bliver hver Joy-Con en hånd. Peg den fremad, og hold Home eller Capture nede for at centrere den igen.</string>
|
||||
<string name="setup_animations">Animationer</string>
|
||||
<string name="setup_frosted_background">Mat</string>
|
||||
<string name="setup_frosted_background_hint">Viser din baggrund sløret bag launcheren. Bruger mere batteri.</string>
|
||||
<string name="setup_frosted_wallpaper">Mat baggrundsbillede</string>
|
||||
<string name="setup_frosted_cards">Matte kort</string>
|
||||
<string name="setup_frosted_cards_hint">Kort og grupper lader lidt af baggrundsbilledet skinne igennem. Menuer og dialoger forbliver faste.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Kræver mat baggrundsbillede.</string>
|
||||
<string name="setup_frost_transparency">Baggrundens gennemsigtighed</string>
|
||||
<string name="setup_frost_transparency_hint">Hvor meget af baggrundsbilledet der skinner igennem.</string>
|
||||
<string name="setup_frost_card_transparency">Kortenes gennemsigtighed</string>
|
||||
<string name="setup_frost_card_transparency_hint">Hvor meget af baggrundsbilledet der skinner gennem kortene.</string>
|
||||
<string name="setup_low_storage_warning">Advar, når lagerpladsen er lav</string>
|
||||
<string name="setup_low_storage_warning_hint">Spørg, før Steam startes, når den ledige plads er under 10 GB.</string>
|
||||
<string name="ctrl_layout">Layout</string>
|
||||
|
||||
@@ -1314,6 +1314,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Cons als VR-Controller</string>
|
||||
<string name="ctrl_joycon_vr_hint">Während SteamVR läuft, wird jeder Joy-Con zu einer Hand. Richte ihn nach vorn und halte HOME oder Capture gedrückt, um ihn neu auszurichten.</string>
|
||||
<string name="setup_animations">Animationen</string>
|
||||
<string name="setup_frosted_background">Milchglas</string>
|
||||
<string name="setup_frosted_background_hint">Zeigt dein Hintergrundbild unscharf hinter dem Launcher. Verbraucht mehr Akku.</string>
|
||||
<string name="setup_frosted_wallpaper">Milchglas-Hintergrundbild</string>
|
||||
<string name="setup_frosted_cards">Milchglas-Karten</string>
|
||||
<string name="setup_frosted_cards_hint">Karten und Gruppen lassen etwas vom Hintergrundbild durch. Menüs und Dialoge bleiben deckend.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Erfordert das Milchglas-Hintergrundbild.</string>
|
||||
<string name="setup_frost_transparency">Transparenz des Hintergrundbilds</string>
|
||||
<string name="setup_frost_transparency_hint">Wie viel vom Hintergrundbild durchscheint.</string>
|
||||
<string name="setup_frost_card_transparency">Transparenz der Karten</string>
|
||||
<string name="setup_frost_card_transparency_hint">Wie viel vom Hintergrundbild durch die Karten scheint.</string>
|
||||
<string name="setup_low_storage_warning">Bei knappem Speicher warnen</string>
|
||||
<string name="setup_low_storage_warning_hint">Vor dem Start von Steam nachfragen, wenn weniger als 10 GB frei sind.</string>
|
||||
<string name="ctrl_layout">Layout</string>
|
||||
|
||||
@@ -1322,6 +1322,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Con ως χειριστήρια VR</string>
|
||||
<string name="ctrl_joycon_vr_hint">Όσο εκτελείται το SteamVR, κάθε Joy-Con γίνεται χέρι. Στρέψτε το μπροστά και κρατήστε πατημένο το Home ή το Capture για να το επανακεντράρετε.</string>
|
||||
<string name="setup_animations">Κινήσεις</string>
|
||||
<string name="setup_frosted_background">Θαμπό</string>
|
||||
<string name="setup_frosted_background_hint">Εμφανίζει την ταπετσαρία σας θολή πίσω από τον εκκινητή. Καταναλώνει περισσότερη μπαταρία.</string>
|
||||
<string name="setup_frosted_wallpaper">Θαμπή ταπετσαρία</string>
|
||||
<string name="setup_frosted_cards">Θαμπές κάρτες</string>
|
||||
<string name="setup_frosted_cards_hint">Οι κάρτες και οι ομάδες αφήνουν να φαίνεται λίγη από την ταπετσαρία. Τα μενού και οι διάλογοι μένουν συμπαγείς.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Χρειάζεται θαμπή ταπετσαρία.</string>
|
||||
<string name="setup_frost_transparency">Διαφάνεια ταπετσαρίας</string>
|
||||
<string name="setup_frost_transparency_hint">Πόση από την ταπετσαρία φαίνεται.</string>
|
||||
<string name="setup_frost_card_transparency">Διαφάνεια καρτών</string>
|
||||
<string name="setup_frost_card_transparency_hint">Πόση από την ταπετσαρία φαίνεται μέσα από τις κάρτες.</string>
|
||||
<string name="setup_low_storage_warning">Προειδοποίηση για χαμηλό χώρο αποθήκευσης</string>
|
||||
<string name="setup_low_storage_warning_hint">Ερώτηση πριν από την εκκίνηση του Steam όταν ο ελεύθερος χώρος είναι κάτω από 10 GB.</string>
|
||||
<string name="ctrl_layout">Διάταξη</string>
|
||||
|
||||
@@ -1329,6 +1329,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Con como mandos de RV</string>
|
||||
<string name="ctrl_joycon_vr_hint">Mientras SteamVR está activo, cada Joy-Con es una mano. Apúntalo al frente y mantén Home o Captura para recentrarlo.</string>
|
||||
<string name="setup_animations">Animaciones</string>
|
||||
<string name="setup_frosted_background">Esmerilado</string>
|
||||
<string name="setup_frosted_background_hint">Muestra tu fondo de pantalla difuminado detrás del launcher. Consume más batería.</string>
|
||||
<string name="setup_frosted_wallpaper">Fondo de pantalla esmerilado</string>
|
||||
<string name="setup_frosted_cards">Tarjetas esmeriladas</string>
|
||||
<string name="setup_frosted_cards_hint">Las tarjetas y los grupos dejan ver un poco del fondo de pantalla. Los menús y diálogos siguen opacos.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Necesita el fondo de pantalla esmerilado.</string>
|
||||
<string name="setup_frost_transparency">Transparencia del fondo de pantalla</string>
|
||||
<string name="setup_frost_transparency_hint">Cuánto se ve el fondo de pantalla.</string>
|
||||
<string name="setup_frost_card_transparency">Transparencia de las tarjetas</string>
|
||||
<string name="setup_frost_card_transparency_hint">Cuánto se ve el fondo de pantalla a través de las tarjetas.</string>
|
||||
<string name="setup_low_storage_warning">Avisar cuando queda poco almacenamiento</string>
|
||||
<string name="setup_low_storage_warning_hint">Preguntar antes de iniciar Steam cuando el espacio libre es inferior a 10 GB.</string>
|
||||
<string name="ctrl_layout">Disposición</string>
|
||||
|
||||
@@ -1322,6 +1322,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Conit VR-ohjaimina</string>
|
||||
<string name="ctrl_joycon_vr_hint">Kun SteamVR on käynnissä, jokainen Joy-Con toimii kätenä. Osoita sillä eteenpäin ja pidä Home- tai Capture-painiketta pohjassa keskittääksesi sen uudelleen.</string>
|
||||
<string name="setup_animations">Animaatiot</string>
|
||||
<string name="setup_frosted_background">Huurrettu</string>
|
||||
<string name="setup_frosted_background_hint">Näyttää taustakuvasi sumennettuna käynnistimen takana. Kuluttaa enemmän akkua.</string>
|
||||
<string name="setup_frosted_wallpaper">Huurrettu taustakuva</string>
|
||||
<string name="setup_frosted_cards">Huurretut kortit</string>
|
||||
<string name="setup_frosted_cards_hint">Kortit ja ryhmät päästävät hieman taustakuvaa läpi. Valikot ja valintaikkunat pysyvät peittävinä.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Vaatii huurretun taustakuvan.</string>
|
||||
<string name="setup_frost_transparency">Taustakuvan läpinäkyvyys</string>
|
||||
<string name="setup_frost_transparency_hint">Kuinka paljon taustakuvaa näkyy läpi.</string>
|
||||
<string name="setup_frost_card_transparency">Korttien läpinäkyvyys</string>
|
||||
<string name="setup_frost_card_transparency_hint">Kuinka paljon taustakuvaa näkyy korttien läpi.</string>
|
||||
<string name="setup_low_storage_warning">Varoita, kun tallennustila on vähissä</string>
|
||||
<string name="setup_low_storage_warning_hint">Kysy ennen Steamin käynnistämistä, kun vapaata tilaa on alle 10 Gt.</string>
|
||||
<string name="ctrl_layout">Asettelu</string>
|
||||
|
||||
@@ -1328,6 +1328,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Con comme manettes VR</string>
|
||||
<string name="ctrl_joycon_vr_hint">Pendant que SteamVR tourne, chaque Joy-Con devient une main. Pointez-le devant vous et maintenez Home ou Capture pour le recentrer.</string>
|
||||
<string name="setup_animations">Animations</string>
|
||||
<string name="setup_frosted_background">Givré</string>
|
||||
<string name="setup_frosted_background_hint">Affiche votre fond d’écran flouté derrière le lanceur. Consomme plus de batterie.</string>
|
||||
<string name="setup_frosted_wallpaper">Fond d’écran givré</string>
|
||||
<string name="setup_frosted_cards">Cartes givrées</string>
|
||||
<string name="setup_frosted_cards_hint">Les cartes et les groupes laissent transparaître un peu du fond d’écran. Les menus et les boîtes de dialogue restent opaques.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Nécessite le fond d’écran givré.</string>
|
||||
<string name="setup_frost_transparency">Transparence du fond d’écran</string>
|
||||
<string name="setup_frost_transparency_hint">La part du fond d’écran visible à travers.</string>
|
||||
<string name="setup_frost_card_transparency">Transparence des cartes</string>
|
||||
<string name="setup_frost_card_transparency_hint">La part du fond d’écran visible à travers les cartes.</string>
|
||||
<string name="setup_low_storage_warning">Avertir quand l\'espace de stockage est faible</string>
|
||||
<string name="setup_low_storage_warning_hint">Demander avant de lancer Steam lorsque l\'espace libre est inférieur à 10 Go.</string>
|
||||
<string name="ctrl_layout">Disposition</string>
|
||||
|
||||
@@ -1322,6 +1322,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Con को VR कंट्रोलर की तरह</string>
|
||||
<string name="ctrl_joycon_vr_hint">SteamVR चलते समय हर Joy-Con एक हाथ बन जाता है। उसे सामने की ओर करें और फिर से केंद्रित करने के लिए Home या Capture दबाए रखें।</string>
|
||||
<string name="setup_animations">एनिमेशन</string>
|
||||
<string name="setup_frosted_background">फ़्रॉस्टेड</string>
|
||||
<string name="setup_frosted_background_hint">लॉन्चर के पीछे आपका वॉलपेपर धुंधला दिखाता है। ज़्यादा बैटरी खर्च होती है।</string>
|
||||
<string name="setup_frosted_wallpaper">फ़्रॉस्टेड वॉलपेपर</string>
|
||||
<string name="setup_frosted_cards">फ़्रॉस्टेड कार्ड</string>
|
||||
<string name="setup_frosted_cards_hint">कार्ड और समूह वॉलपेपर का थोड़ा हिस्सा दिखाते हैं। मेन्यू और डायलॉग ठोस रहते हैं।</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">फ़्रॉस्टेड वॉलपेपर ज़रूरी है।</string>
|
||||
<string name="setup_frost_transparency">वॉलपेपर की पारदर्शिता</string>
|
||||
<string name="setup_frost_transparency_hint">वॉलपेपर कितना दिखता है।</string>
|
||||
<string name="setup_frost_card_transparency">कार्ड की पारदर्शिता</string>
|
||||
<string name="setup_frost_card_transparency_hint">कार्ड के पार वॉलपेपर कितना दिखता है।</string>
|
||||
<string name="setup_low_storage_warning">स्टोरेज कम होने पर चेतावनी दें</string>
|
||||
<string name="setup_low_storage_warning_hint">खाली जगह 10 GB से कम होने पर Steam शुरू करने से पहले पूछें।</string>
|
||||
<string name="ctrl_layout">लेआउट</string>
|
||||
|
||||
@@ -1322,6 +1322,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Conok VR-kontrollerként</string>
|
||||
<string name="ctrl_joycon_vr_hint">Amíg a SteamVR fut, minden Joy-Con egy kéz lesz. Irányítsa előre, és tartsa lenyomva a Home vagy a Capture gombot az újraközpontosításhoz.</string>
|
||||
<string name="setup_animations">Animációk</string>
|
||||
<string name="setup_frosted_background">Matt</string>
|
||||
<string name="setup_frosted_background_hint">A háttérképet elmosva jeleníti meg az indítóalkalmazás mögött. Több akkumulátort használ.</string>
|
||||
<string name="setup_frosted_wallpaper">Matt háttérkép</string>
|
||||
<string name="setup_frosted_cards">Matt kártyák</string>
|
||||
<string name="setup_frosted_cards_hint">A kártyák és csoportok átengednek egy kicsit a háttérképből. A menük és párbeszédablakok átlátszatlanok maradnak.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Matt háttérkép szükséges hozzá.</string>
|
||||
<string name="setup_frost_transparency">Háttérkép átlátszósága</string>
|
||||
<string name="setup_frost_transparency_hint">Mennyi látszik át a háttérképből.</string>
|
||||
<string name="setup_frost_card_transparency">Kártyák átlátszósága</string>
|
||||
<string name="setup_frost_card_transparency_hint">Mennyi látszik a háttérképből a kártyákon át.</string>
|
||||
<string name="setup_low_storage_warning">Figyelmeztetés kevés tárhely esetén</string>
|
||||
<string name="setup_low_storage_warning_hint">Rákérdezés a Steam indítása előtt, ha 10 GB-nál kevesebb a szabad hely.</string>
|
||||
<string name="ctrl_layout">Elrendezés</string>
|
||||
|
||||
@@ -1316,6 +1316,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Con sebagai pengontrol VR</string>
|
||||
<string name="ctrl_joycon_vr_hint">Saat SteamVR berjalan, setiap Joy-Con menjadi tangan. Arahkan ke depan lalu tahan Home atau Capture untuk memusatkannya kembali.</string>
|
||||
<string name="setup_animations">Animasi</string>
|
||||
<string name="setup_frosted_background">Buram</string>
|
||||
<string name="setup_frosted_background_hint">Menampilkan wallpaper Anda yang diburamkan di belakang peluncur. Memakai lebih banyak baterai.</string>
|
||||
<string name="setup_frosted_wallpaper">Wallpaper buram</string>
|
||||
<string name="setup_frosted_cards">Kartu buram</string>
|
||||
<string name="setup_frosted_cards_hint">Kartu dan grup menampilkan sedikit wallpaper. Menu dan dialog tetap solid.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Memerlukan wallpaper buram.</string>
|
||||
<string name="setup_frost_transparency">Transparansi wallpaper</string>
|
||||
<string name="setup_frost_transparency_hint">Seberapa banyak wallpaper yang terlihat.</string>
|
||||
<string name="setup_frost_card_transparency">Transparansi kartu</string>
|
||||
<string name="setup_frost_card_transparency_hint">Seberapa banyak wallpaper yang terlihat melalui kartu.</string>
|
||||
<string name="setup_low_storage_warning">Peringatkan saat penyimpanan hampir penuh</string>
|
||||
<string name="setup_low_storage_warning_hint">Tanya sebelum memulai Steam saat ruang kosong di bawah 10 GB.</string>
|
||||
<string name="ctrl_layout">Tata letak</string>
|
||||
|
||||
@@ -1320,6 +1320,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Con come controller VR</string>
|
||||
<string name="ctrl_joycon_vr_hint">Mentre SteamVR è in esecuzione, ogni Joy-Con diventa una mano. Puntalo in avanti e tieni premuto Home o Capture per ricentrarlo.</string>
|
||||
<string name="setup_animations">Animazioni</string>
|
||||
<string name="setup_frosted_background">Satinato</string>
|
||||
<string name="setup_frosted_background_hint">Mostra il tuo sfondo sfocato dietro il launcher. Consuma più batteria.</string>
|
||||
<string name="setup_frosted_wallpaper">Sfondo satinato</string>
|
||||
<string name="setup_frosted_cards">Schede satinate</string>
|
||||
<string name="setup_frosted_cards_hint">Schede e gruppi lasciano trasparire un po’ dello sfondo. Menu e finestre di dialogo restano opachi.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Richiede lo sfondo satinato.</string>
|
||||
<string name="setup_frost_transparency">Trasparenza dello sfondo</string>
|
||||
<string name="setup_frost_transparency_hint">Quanto dello sfondo si vede attraverso.</string>
|
||||
<string name="setup_frost_card_transparency">Trasparenza delle schede</string>
|
||||
<string name="setup_frost_card_transparency_hint">Quanto dello sfondo si vede attraverso le schede.</string>
|
||||
<string name="setup_low_storage_warning">Avvisa quando lo spazio è scarso</string>
|
||||
<string name="setup_low_storage_warning_hint">Chiedi conferma prima di avviare Steam quando lo spazio libero è inferiore a 10 GB.</string>
|
||||
<string name="ctrl_layout">Layout</string>
|
||||
|
||||
@@ -1316,6 +1316,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-ConをVRコントローラーとして使う</string>
|
||||
<string name="ctrl_joycon_vr_hint">SteamVRの実行中は各Joy-Conが手になります。前に向けてHOMEボタンかキャプチャーボタンを長押しすると、向きを合わせ直します。</string>
|
||||
<string name="setup_animations">アニメーション</string>
|
||||
<string name="setup_frosted_background">すりガラス</string>
|
||||
<string name="setup_frosted_background_hint">ランチャーの背後に壁紙をぼかして表示します。バッテリーの消費が増えます。</string>
|
||||
<string name="setup_frosted_wallpaper">すりガラスの壁紙</string>
|
||||
<string name="setup_frosted_cards">すりガラスのカード</string>
|
||||
<string name="setup_frosted_cards_hint">カードやグループから壁紙が少し透けて見えます。メニューとダイアログは不透明のままです。</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">すりガラスの壁紙が必要です。</string>
|
||||
<string name="setup_frost_transparency">壁紙の透明度</string>
|
||||
<string name="setup_frost_transparency_hint">壁紙がどれだけ透けて見えるか。</string>
|
||||
<string name="setup_frost_card_transparency">カードの透明度</string>
|
||||
<string name="setup_frost_card_transparency_hint">カード越しに壁紙がどれだけ透けて見えるか。</string>
|
||||
<string name="setup_low_storage_warning">ストレージ残量が少ないときに警告する</string>
|
||||
<string name="setup_low_storage_warning_hint">空き容量が 10 GB 未満のとき、Steam を起動する前に確認します。</string>
|
||||
<string name="ctrl_layout">レイアウト</string>
|
||||
|
||||
@@ -1316,6 +1316,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Con을 VR 컨트롤러로 사용</string>
|
||||
<string name="ctrl_joycon_vr_hint">SteamVR이 실행되는 동안 각 Joy-Con이 손이 됩니다. 앞을 향하게 한 채 HOME 또는 캡처 버튼을 길게 누르면 다시 가운데로 맞춥니다.</string>
|
||||
<string name="setup_animations">애니메이션</string>
|
||||
<string name="setup_frosted_background">반투명</string>
|
||||
<string name="setup_frosted_background_hint">런처 뒤에 배경화면을 흐리게 표시합니다. 배터리를 더 많이 사용합니다.</string>
|
||||
<string name="setup_frosted_wallpaper">반투명 배경화면</string>
|
||||
<string name="setup_frosted_cards">반투명 카드</string>
|
||||
<string name="setup_frosted_cards_hint">카드와 그룹에 배경화면이 살짝 비쳐 보입니다. 메뉴와 대화상자는 불투명하게 유지됩니다.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">반투명 배경화면이 필요합니다.</string>
|
||||
<string name="setup_frost_transparency">배경화면 투명도</string>
|
||||
<string name="setup_frost_transparency_hint">배경화면이 얼마나 비쳐 보이는지 정합니다.</string>
|
||||
<string name="setup_frost_card_transparency">카드 투명도</string>
|
||||
<string name="setup_frost_card_transparency_hint">카드 너머로 배경화면이 얼마나 비쳐 보이는지 정합니다.</string>
|
||||
<string name="setup_low_storage_warning">저장 공간이 부족할 때 경고</string>
|
||||
<string name="setup_low_storage_warning_hint">여유 공간이 10GB 미만이면 Steam을 시작하기 전에 확인합니다.</string>
|
||||
<string name="ctrl_layout">레이아웃</string>
|
||||
|
||||
@@ -1316,6 +1316,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Con sebagai pengawal VR</string>
|
||||
<string name="ctrl_joycon_vr_hint">Semasa SteamVR berjalan, setiap Joy-Con menjadi tangan. Halakan ke hadapan dan tahan Home atau Capture untuk memusatkannya semula.</string>
|
||||
<string name="setup_animations">Animasi</string>
|
||||
<string name="setup_frosted_background">Kabur</string>
|
||||
<string name="setup_frosted_background_hint">Memaparkan kertas dinding anda yang dikaburkan di belakang pelancar. Menggunakan lebih banyak bateri.</string>
|
||||
<string name="setup_frosted_wallpaper">Kertas dinding kabur</string>
|
||||
<string name="setup_frosted_cards">Kad kabur</string>
|
||||
<string name="setup_frosted_cards_hint">Kad dan kumpulan menampakkan sedikit kertas dinding. Menu dan dialog kekal padu.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Memerlukan kertas dinding kabur.</string>
|
||||
<string name="setup_frost_transparency">Ketelusan kertas dinding</string>
|
||||
<string name="setup_frost_transparency_hint">Berapa banyak kertas dinding yang kelihatan.</string>
|
||||
<string name="setup_frost_card_transparency">Ketelusan kad</string>
|
||||
<string name="setup_frost_card_transparency_hint">Berapa banyak kertas dinding yang kelihatan melalui kad.</string>
|
||||
<string name="setup_low_storage_warning">Beri amaran apabila storan rendah</string>
|
||||
<string name="setup_low_storage_warning_hint">Tanya sebelum memulakan Steam apabila ruang kosong kurang daripada 10 GB.</string>
|
||||
<string name="ctrl_layout">Susun atur</string>
|
||||
|
||||
@@ -1322,6 +1322,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Con som VR-kontrollere</string>
|
||||
<string name="ctrl_joycon_vr_hint">Mens SteamVR kjører, blir hver Joy-Con en hånd. Pek den fremover og hold inne Home eller Capture for å sentrere den på nytt.</string>
|
||||
<string name="setup_animations">Animasjoner</string>
|
||||
<string name="setup_frosted_background">Matt</string>
|
||||
<string name="setup_frosted_background_hint">Viser bakgrunnsbildet ditt uskarpt bak launcheren. Bruker mer batteri.</string>
|
||||
<string name="setup_frosted_wallpaper">Matt bakgrunnsbilde</string>
|
||||
<string name="setup_frosted_cards">Matte kort</string>
|
||||
<string name="setup_frosted_cards_hint">Kort og grupper slipper litt av bakgrunnsbildet gjennom. Menyer og dialoger forblir heldekkende.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Krever matt bakgrunnsbilde.</string>
|
||||
<string name="setup_frost_transparency">Bakgrunnens gjennomsiktighet</string>
|
||||
<string name="setup_frost_transparency_hint">Hvor mye av bakgrunnsbildet som synes gjennom.</string>
|
||||
<string name="setup_frost_card_transparency">Kortenes gjennomsiktighet</string>
|
||||
<string name="setup_frost_card_transparency_hint">Hvor mye av bakgrunnsbildet som synes gjennom kortene.</string>
|
||||
<string name="setup_low_storage_warning">Advar når lagringsplassen er lav</string>
|
||||
<string name="setup_low_storage_warning_hint">Spør før Steam startes når ledig plass er under 10 GB.</string>
|
||||
<string name="ctrl_layout">Oppsett</string>
|
||||
|
||||
@@ -1322,6 +1322,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Cons als VR-controllers</string>
|
||||
<string name="ctrl_joycon_vr_hint">Zolang SteamVR draait, wordt elke Joy-Con een hand. Richt hem naar voren en houd Home of Capture ingedrukt om hem opnieuw te centreren.</string>
|
||||
<string name="setup_animations">Animaties</string>
|
||||
<string name="setup_frosted_background">Matglas</string>
|
||||
<string name="setup_frosted_background_hint">Toont je achtergrond wazig achter de launcher. Verbruikt meer batterij.</string>
|
||||
<string name="setup_frosted_wallpaper">Matglazen achtergrond</string>
|
||||
<string name="setup_frosted_cards">Matglazen kaarten</string>
|
||||
<string name="setup_frosted_cards_hint">Kaarten en groepen laten iets van de achtergrond door. Menu’s en dialogen blijven dekkend.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Vereist de matglazen achtergrond.</string>
|
||||
<string name="setup_frost_transparency">Transparantie van de achtergrond</string>
|
||||
<string name="setup_frost_transparency_hint">Hoeveel van de achtergrond doorschijnt.</string>
|
||||
<string name="setup_frost_card_transparency">Transparantie van de kaarten</string>
|
||||
<string name="setup_frost_card_transparency_hint">Hoeveel van de achtergrond door de kaarten schijnt.</string>
|
||||
<string name="setup_low_storage_warning">Waarschuwen bij weinig opslagruimte</string>
|
||||
<string name="setup_low_storage_warning_hint">Vragen voordat Steam start als er minder dan 10 GB vrij is.</string>
|
||||
<string name="ctrl_layout">Indeling</string>
|
||||
|
||||
@@ -1336,6 +1336,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Cony jako kontrolery VR</string>
|
||||
<string name="ctrl_joycon_vr_hint">Gdy działa SteamVR, każdy Joy-Con staje się dłonią. Skieruj go przed siebie i przytrzymaj Home lub Capture, aby go wyśrodkować.</string>
|
||||
<string name="setup_animations">Animacje</string>
|
||||
<string name="setup_frosted_background">Matowe</string>
|
||||
<string name="setup_frosted_background_hint">Pokazuje rozmytą tapetę za aplikacją. Zużywa więcej baterii.</string>
|
||||
<string name="setup_frosted_wallpaper">Matowa tapeta</string>
|
||||
<string name="setup_frosted_cards">Matowe karty</string>
|
||||
<string name="setup_frosted_cards_hint">Karty i grupy przepuszczają trochę tapety. Menu i okna dialogowe pozostają nieprzezroczyste.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Wymaga matowej tapety.</string>
|
||||
<string name="setup_frost_transparency">Przezroczystość tapety</string>
|
||||
<string name="setup_frost_transparency_hint">Ile tapety prześwituje.</string>
|
||||
<string name="setup_frost_card_transparency">Przezroczystość kart</string>
|
||||
<string name="setup_frost_card_transparency_hint">Ile tapety prześwituje przez karty.</string>
|
||||
<string name="setup_low_storage_warning">Ostrzegaj o małej ilości miejsca</string>
|
||||
<string name="setup_low_storage_warning_hint">Pytaj przed uruchomieniem Steam, gdy wolne miejsce wynosi mniej niż 10 GB.</string>
|
||||
<string name="ctrl_layout">Układ</string>
|
||||
|
||||
@@ -1320,6 +1320,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Con como comandos de RV</string>
|
||||
<string name="ctrl_joycon_vr_hint">Enquanto o SteamVR está a correr, cada Joy-Con torna-se uma mão. Aponte-o para a frente e mantenha Home ou Capture premido para o recentrar.</string>
|
||||
<string name="setup_animations">Animações</string>
|
||||
<string name="setup_frosted_background">Fosco</string>
|
||||
<string name="setup_frosted_background_hint">Mostra a imagem de fundo desfocada atrás do iniciador. Gasta mais bateria.</string>
|
||||
<string name="setup_frosted_wallpaper">Fundo fosco</string>
|
||||
<string name="setup_frosted_cards">Cartões foscos</string>
|
||||
<string name="setup_frosted_cards_hint">Os cartões e grupos deixam ver um pouco do fundo. Os menus e caixas de diálogo continuam opacos.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Requer o fundo fosco.</string>
|
||||
<string name="setup_frost_transparency">Transparência do fundo</string>
|
||||
<string name="setup_frost_transparency_hint">Quanto do fundo se vê através.</string>
|
||||
<string name="setup_frost_card_transparency">Transparência dos cartões</string>
|
||||
<string name="setup_frost_card_transparency_hint">Quanto do fundo se vê através dos cartões.</string>
|
||||
<string name="setup_low_storage_warning">Avisar quando o armazenamento estiver baixo</string>
|
||||
<string name="setup_low_storage_warning_hint">Perguntar antes de iniciar o Steam quando o espaço livre for inferior a 10 GB.</string>
|
||||
<string name="ctrl_layout">Esquema</string>
|
||||
|
||||
@@ -1328,6 +1328,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Cons como controles de RV</string>
|
||||
<string name="ctrl_joycon_vr_hint">Enquanto o SteamVR está rodando, cada Joy-Con vira uma mão. Aponte-o para a frente e segure Home ou Capture para recentralizá-lo.</string>
|
||||
<string name="setup_animations">Animações</string>
|
||||
<string name="setup_frosted_background">Fosco</string>
|
||||
<string name="setup_frosted_background_hint">Mostra seu papel de parede desfocado atrás do inicializador. Usa mais bateria.</string>
|
||||
<string name="setup_frosted_wallpaper">Papel de parede fosco</string>
|
||||
<string name="setup_frosted_cards">Cartões foscos</string>
|
||||
<string name="setup_frosted_cards_hint">Cartões e grupos deixam ver um pouco do papel de parede. Menus e caixas de diálogo continuam opacos.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Requer o papel de parede fosco.</string>
|
||||
<string name="setup_frost_transparency">Transparência do papel de parede</string>
|
||||
<string name="setup_frost_transparency_hint">Quanto do papel de parede aparece.</string>
|
||||
<string name="setup_frost_card_transparency">Transparência dos cartões</string>
|
||||
<string name="setup_frost_card_transparency_hint">Quanto do papel de parede aparece através dos cartões.</string>
|
||||
<string name="setup_low_storage_warning">Avisar quando o armazenamento estiver baixo</string>
|
||||
<string name="setup_low_storage_warning_hint">Perguntar antes de iniciar o Steam quando o espaço livre for inferior a 10 GB.</string>
|
||||
<string name="ctrl_layout">Layout</string>
|
||||
|
||||
@@ -1329,6 +1329,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Con ca controllere VR</string>
|
||||
<string name="ctrl_joycon_vr_hint">Cât timp rulează SteamVR, fiecare Joy-Con devine o mână. Îndreaptă-l înainte și ține apăsat Home sau Capture pentru a-l recentra.</string>
|
||||
<string name="setup_animations">Animații</string>
|
||||
<string name="setup_frosted_background">Mat</string>
|
||||
<string name="setup_frosted_background_hint">Afișează imaginea de fundal estompată în spatele launcherului. Consumă mai multă baterie.</string>
|
||||
<string name="setup_frosted_wallpaper">Imagine de fundal mată</string>
|
||||
<string name="setup_frosted_cards">Carduri mate</string>
|
||||
<string name="setup_frosted_cards_hint">Cardurile și grupurile lasă să se vadă puțin din imaginea de fundal. Meniurile și dialogurile rămân opace.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Necesită imaginea de fundal mată.</string>
|
||||
<string name="setup_frost_transparency">Transparența imaginii de fundal</string>
|
||||
<string name="setup_frost_transparency_hint">Cât din imaginea de fundal se vede.</string>
|
||||
<string name="setup_frost_card_transparency">Transparența cardurilor</string>
|
||||
<string name="setup_frost_card_transparency_hint">Cât din imaginea de fundal se vede prin carduri.</string>
|
||||
<string name="setup_low_storage_warning">Avertizează când spațiul de stocare este redus</string>
|
||||
<string name="setup_low_storage_warning_hint">Întreabă înainte de pornirea Steam când spațiul liber este sub 10 GB.</string>
|
||||
<string name="ctrl_layout">Aranjament</string>
|
||||
|
||||
@@ -1336,6 +1336,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Con как VR-контроллеры</string>
|
||||
<string name="ctrl_joycon_vr_hint">Пока работает SteamVR, каждый Joy-Con становится рукой. Направьте его вперёд и удерживайте Home или Capture, чтобы снова его отцентрировать.</string>
|
||||
<string name="setup_animations">Анимации</string>
|
||||
<string name="setup_frosted_background">Матовое стекло</string>
|
||||
<string name="setup_frosted_background_hint">Показывает размытые обои за лаунчером. Расходует больше заряда.</string>
|
||||
<string name="setup_frosted_wallpaper">Матовые обои</string>
|
||||
<string name="setup_frosted_cards">Матовые карточки</string>
|
||||
<string name="setup_frosted_cards_hint">Сквозь карточки и группы немного просвечивают обои. Меню и диалоги остаются непрозрачными.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Нужны матовые обои.</string>
|
||||
<string name="setup_frost_transparency">Прозрачность обоев</string>
|
||||
<string name="setup_frost_transparency_hint">Насколько просвечивают обои.</string>
|
||||
<string name="setup_frost_card_transparency">Прозрачность карточек</string>
|
||||
<string name="setup_frost_card_transparency_hint">Насколько обои просвечивают сквозь карточки.</string>
|
||||
<string name="setup_low_storage_warning">Предупреждать о нехватке места</string>
|
||||
<string name="setup_low_storage_warning_hint">Спрашивать перед запуском Steam, если свободно меньше 10 ГБ.</string>
|
||||
<string name="ctrl_layout">Раскладка</string>
|
||||
|
||||
@@ -1322,6 +1322,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Con som VR-handkontroller</string>
|
||||
<string name="ctrl_joycon_vr_hint">Medan SteamVR körs blir varje Joy-Con en hand. Rikta den framåt och håll in Home eller Capture för att centrera den igen.</string>
|
||||
<string name="setup_animations">Animationer</string>
|
||||
<string name="setup_frosted_background">Frostat</string>
|
||||
<string name="setup_frosted_background_hint">Visar din bakgrundsbild suddig bakom startprogrammet. Drar mer batteri.</string>
|
||||
<string name="setup_frosted_wallpaper">Frostad bakgrundsbild</string>
|
||||
<string name="setup_frosted_cards">Frostade kort</string>
|
||||
<string name="setup_frosted_cards_hint">Kort och grupper släpper igenom lite av bakgrundsbilden. Menyer och dialogrutor förblir täckande.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Kräver frostad bakgrundsbild.</string>
|
||||
<string name="setup_frost_transparency">Bakgrundsbildens genomskinlighet</string>
|
||||
<string name="setup_frost_transparency_hint">Hur mycket av bakgrundsbilden som syns igenom.</string>
|
||||
<string name="setup_frost_card_transparency">Kortens genomskinlighet</string>
|
||||
<string name="setup_frost_card_transparency_hint">Hur mycket av bakgrundsbilden som syns genom korten.</string>
|
||||
<string name="setup_low_storage_warning">Varna när lagringsutrymmet är lågt</string>
|
||||
<string name="setup_low_storage_warning_hint">Fråga innan Steam startas när det lediga utrymmet är under 10 GB.</string>
|
||||
<string name="ctrl_layout">Layout</string>
|
||||
|
||||
@@ -1316,6 +1316,16 @@
|
||||
<string name="ctrl_joycon_vr">ใช้ Joy-Con เป็นคอนโทรลเลอร์ VR</string>
|
||||
<string name="ctrl_joycon_vr_hint">ขณะที่ SteamVR ทำงาน Joy-Con แต่ละตัวจะกลายเป็นมือ ชี้ไปข้างหน้าแล้วกด Home หรือ Capture ค้างไว้เพื่อจัดให้อยู่ตรงกลางอีกครั้ง</string>
|
||||
<string name="setup_animations">ภาพเคลื่อนไหว</string>
|
||||
<string name="setup_frosted_background">แบบฝ้า</string>
|
||||
<string name="setup_frosted_background_hint">แสดงวอลเปเปอร์แบบเบลอไว้ด้านหลังตัวเปิดแอป ใช้แบตเตอรี่มากขึ้น</string>
|
||||
<string name="setup_frosted_wallpaper">วอลเปเปอร์แบบฝ้า</string>
|
||||
<string name="setup_frosted_cards">การ์ดแบบฝ้า</string>
|
||||
<string name="setup_frosted_cards_hint">การ์ดและกลุ่มจะเห็นวอลเปเปอร์เล็กน้อย เมนูและกล่องโต้ตอบยังคงทึบ</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">ต้องเปิดวอลเปเปอร์แบบฝ้า</string>
|
||||
<string name="setup_frost_transparency">ความโปร่งใสของวอลเปเปอร์</string>
|
||||
<string name="setup_frost_transparency_hint">ปริมาณวอลเปเปอร์ที่มองทะลุได้</string>
|
||||
<string name="setup_frost_card_transparency">ความโปร่งใสของการ์ด</string>
|
||||
<string name="setup_frost_card_transparency_hint">ปริมาณวอลเปเปอร์ที่มองทะลุการ์ดได้</string>
|
||||
<string name="setup_low_storage_warning">เตือนเมื่อพื้นที่เก็บข้อมูลเหลือน้อย</string>
|
||||
<string name="setup_low_storage_warning_hint">ถามก่อนเริ่ม Steam เมื่อพื้นที่ว่างน้อยกว่า 10 GB</string>
|
||||
<string name="ctrl_layout">การจัดวาง</string>
|
||||
|
||||
@@ -1314,6 +1314,16 @@
|
||||
<string name="ctrl_joycon_vr">VR kumandası olarak Joy-Con\'lar</string>
|
||||
<string name="ctrl_joycon_vr_hint">SteamVR çalışırken her Joy-Con bir el olur. Öne doğrultun ve yeniden ortalamak için Home veya Capture düğmesini basılı tutun.</string>
|
||||
<string name="setup_animations">Animasyonlar</string>
|
||||
<string name="setup_frosted_background">Buzlu</string>
|
||||
<string name="setup_frosted_background_hint">Duvar kâğıdınızı başlatıcının arkasında bulanık gösterir. Daha fazla pil kullanır.</string>
|
||||
<string name="setup_frosted_wallpaper">Buzlu duvar kâğıdı</string>
|
||||
<string name="setup_frosted_cards">Buzlu kartlar</string>
|
||||
<string name="setup_frosted_cards_hint">Kartlar ve gruplar duvar kâğıdının bir kısmını gösterir. Menüler ve iletişim kutuları opak kalır.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Buzlu duvar kâğıdı gerekir.</string>
|
||||
<string name="setup_frost_transparency">Duvar kâğıdı saydamlığı</string>
|
||||
<string name="setup_frost_transparency_hint">Duvar kâğıdının ne kadar göründüğü.</string>
|
||||
<string name="setup_frost_card_transparency">Kart saydamlığı</string>
|
||||
<string name="setup_frost_card_transparency_hint">Duvar kâğıdının kartların ardından ne kadar göründüğü.</string>
|
||||
<string name="setup_low_storage_warning">Depolama azaldığında uyar</string>
|
||||
<string name="setup_low_storage_warning_hint">Boş alan 10 GB\'ın altındayken Steam\'i başlatmadan önce sor.</string>
|
||||
<string name="ctrl_layout">Düzen</string>
|
||||
|
||||
@@ -1336,6 +1336,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Con як VR-контролери</string>
|
||||
<string name="ctrl_joycon_vr_hint">Поки працює SteamVR, кожен Joy-Con стає рукою. Спрямуйте його вперед і утримуйте Home або Capture, щоб знову його відцентрувати.</string>
|
||||
<string name="setup_animations">Анімації</string>
|
||||
<string name="setup_frosted_background">Матове скло</string>
|
||||
<string name="setup_frosted_background_hint">Показує розмиті шпалери за лаунчером. Витрачає більше заряду.</string>
|
||||
<string name="setup_frosted_wallpaper">Матові шпалери</string>
|
||||
<string name="setup_frosted_cards">Матові картки</string>
|
||||
<string name="setup_frosted_cards_hint">Крізь картки та групи трохи просвічують шпалери. Меню й діалоги лишаються непрозорими.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Потрібні матові шпалери.</string>
|
||||
<string name="setup_frost_transparency">Прозорість шпалер</string>
|
||||
<string name="setup_frost_transparency_hint">Наскільки просвічують шпалери.</string>
|
||||
<string name="setup_frost_card_transparency">Прозорість карток</string>
|
||||
<string name="setup_frost_card_transparency_hint">Наскільки шпалери просвічують крізь картки.</string>
|
||||
<string name="setup_low_storage_warning">Попереджати про брак місця</string>
|
||||
<string name="setup_low_storage_warning_hint">Питати перед запуском Steam, якщо вільно менше 10 ГБ.</string>
|
||||
<string name="ctrl_layout">Розкладка</string>
|
||||
|
||||
@@ -1316,6 +1316,16 @@
|
||||
<string name="ctrl_joycon_vr">Dùng Joy-Con làm tay cầm VR</string>
|
||||
<string name="ctrl_joycon_vr_hint">Khi SteamVR đang chạy, mỗi Joy-Con trở thành một bàn tay. Hướng nó về phía trước rồi giữ Home hoặc Capture để căn giữa lại.</string>
|
||||
<string name="setup_animations">Hiệu ứng chuyển động</string>
|
||||
<string name="setup_frosted_background">Mờ</string>
|
||||
<string name="setup_frosted_background_hint">Hiển thị hình nền được làm mờ phía sau launcher. Tốn pin hơn.</string>
|
||||
<string name="setup_frosted_wallpaper">Hình nền mờ</string>
|
||||
<string name="setup_frosted_cards">Thẻ mờ</string>
|
||||
<string name="setup_frosted_cards_hint">Thẻ và nhóm để lộ một chút hình nền. Menu và hộp thoại vẫn đặc.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Cần bật Hình nền mờ.</string>
|
||||
<string name="setup_frost_transparency">Độ trong suốt của hình nền</string>
|
||||
<string name="setup_frost_transparency_hint">Mức hình nền hiện qua.</string>
|
||||
<string name="setup_frost_card_transparency">Độ trong suốt của thẻ</string>
|
||||
<string name="setup_frost_card_transparency_hint">Mức hình nền hiện qua các thẻ.</string>
|
||||
<string name="setup_low_storage_warning">Cảnh báo khi dung lượng lưu trữ thấp</string>
|
||||
<string name="setup_low_storage_warning_hint">Hỏi trước khi khởi động Steam khi dung lượng trống dưới 10 GB.</string>
|
||||
<string name="ctrl_layout">Bố cục</string>
|
||||
|
||||
@@ -1399,6 +1399,16 @@
|
||||
<string name="ctrl_joycon_vr">将 Joy-Con 用作 VR 手柄</string>
|
||||
<string name="ctrl_joycon_vr_hint">SteamVR 运行时,每个 Joy-Con 都会成为一只手。将其指向前方并按住 HOME 键或截图键即可重新居中。</string>
|
||||
<string name="setup_animations">动画</string>
|
||||
<string name="setup_frosted_background">毛玻璃</string>
|
||||
<string name="setup_frosted_background_hint">在启动器后方显示模糊的壁纸。耗电更多。</string>
|
||||
<string name="setup_frosted_wallpaper">毛玻璃壁纸</string>
|
||||
<string name="setup_frosted_cards">毛玻璃卡片</string>
|
||||
<string name="setup_frosted_cards_hint">卡片和分组会透出少许壁纸。菜单和对话框保持不透明。</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">需要开启毛玻璃壁纸。</string>
|
||||
<string name="setup_frost_transparency">壁纸透明度</string>
|
||||
<string name="setup_frost_transparency_hint">壁纸透出的程度。</string>
|
||||
<string name="setup_frost_card_transparency">卡片透明度</string>
|
||||
<string name="setup_frost_card_transparency_hint">卡片透出壁纸的程度。</string>
|
||||
<string name="setup_low_storage_warning">存储空间不足时提醒</string>
|
||||
<string name="setup_low_storage_warning_hint">可用空间不足 10 GB 时,启动 Steam 前先询问。</string>
|
||||
<string name="ctrl_layout">布局</string>
|
||||
|
||||
@@ -1315,6 +1315,16 @@
|
||||
<string name="ctrl_joycon_vr">將 Joy-Con 用作 VR 控制器</string>
|
||||
<string name="ctrl_joycon_vr_hint">SteamVR 執行時,每個 Joy-Con 都會變成一隻手。將它指向前方並按住 HOME 鍵或擷取鍵,即可重新置中。</string>
|
||||
<string name="setup_animations">動畫</string>
|
||||
<string name="setup_frosted_background">毛玻璃</string>
|
||||
<string name="setup_frosted_background_hint">在啟動器後方顯示模糊的桌布。耗電較多。</string>
|
||||
<string name="setup_frosted_wallpaper">毛玻璃桌布</string>
|
||||
<string name="setup_frosted_cards">毛玻璃卡片</string>
|
||||
<string name="setup_frosted_cards_hint">卡片和群組會透出少許桌布。選單和對話框保持不透明。</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">需要開啟毛玻璃桌布。</string>
|
||||
<string name="setup_frost_transparency">桌布透明度</string>
|
||||
<string name="setup_frost_transparency_hint">桌布透出的程度。</string>
|
||||
<string name="setup_frost_card_transparency">卡片透明度</string>
|
||||
<string name="setup_frost_card_transparency_hint">卡片透出桌布的程度。</string>
|
||||
<string name="setup_low_storage_warning">儲存空間不足時提醒</string>
|
||||
<string name="setup_low_storage_warning_hint">可用空間少於 10 GB 時,啟動 Steam 前先詢問。</string>
|
||||
<string name="ctrl_layout">佈局</string>
|
||||
|
||||
@@ -1315,6 +1315,16 @@
|
||||
<string name="ctrl_joycon_vr">將 Joy-Con 當作 VR 控制器</string>
|
||||
<string name="ctrl_joycon_vr_hint">SteamVR 執行時,每個 Joy-Con 都會變成一隻手。將它指向前方並按住 HOME 鍵或擷取鍵,即可重新置中。</string>
|
||||
<string name="setup_animations">動畫</string>
|
||||
<string name="setup_frosted_background">毛玻璃</string>
|
||||
<string name="setup_frosted_background_hint">在啟動器後方顯示模糊的桌布。較為耗電。</string>
|
||||
<string name="setup_frosted_wallpaper">毛玻璃桌布</string>
|
||||
<string name="setup_frosted_cards">毛玻璃卡片</string>
|
||||
<string name="setup_frosted_cards_hint">卡片和群組會透出少許桌布。選單和對話方塊保持不透明。</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">需要開啟毛玻璃桌布。</string>
|
||||
<string name="setup_frost_transparency">桌布透明度</string>
|
||||
<string name="setup_frost_transparency_hint">桌布透出的程度。</string>
|
||||
<string name="setup_frost_card_transparency">卡片透明度</string>
|
||||
<string name="setup_frost_card_transparency_hint">卡片透出桌布的程度。</string>
|
||||
<string name="setup_low_storage_warning">儲存空間不足時提醒</string>
|
||||
<string name="setup_low_storage_warning_hint">可用空間少於 10 GB 時,啟動 Steam 前先詢問。</string>
|
||||
<string name="ctrl_layout">版面配置</string>
|
||||
|
||||
@@ -1493,6 +1493,16 @@
|
||||
<string name="ctrl_joycon_vr">Joy-Cons as VR controllers</string>
|
||||
<string name="ctrl_joycon_vr_hint">While SteamVR runs, each Joy-Con becomes a hand. Point it ahead and hold Home or Capture to recenter it.</string>
|
||||
<string name="setup_animations">Animations</string>
|
||||
<string name="setup_frosted_background">Frosted</string>
|
||||
<string name="setup_frosted_background_hint">Shows your wallpaper, blurred, behind the launcher. Uses more battery.</string>
|
||||
<string name="setup_frosted_wallpaper">Frosted wallpaper</string>
|
||||
<string name="setup_frosted_cards">Frosted cards</string>
|
||||
<string name="setup_frosted_cards_hint">Cards and groups let a little of the wallpaper through. Menus and dialogs stay solid.</string>
|
||||
<string name="setup_frosted_cards_needs_wallpaper">Needs Frosted wallpaper.</string>
|
||||
<string name="setup_frost_transparency">Wallpaper transparency</string>
|
||||
<string name="setup_frost_transparency_hint">How much of the wallpaper shows through.</string>
|
||||
<string name="setup_frost_card_transparency">Card transparency</string>
|
||||
<string name="setup_frost_card_transparency_hint">How much of the wallpaper shows through cards.</string>
|
||||
<string name="setup_low_storage_warning">Warn when storage is low</string>
|
||||
<string name="setup_low_storage_warning_hint">Ask before starting Steam when free space is under 10 GB.</string>
|
||||
<string name="ctrl_layout">Layout</string>
|
||||
|
||||
@@ -176,4 +176,68 @@ class PulseAudioComponentTest {
|
||||
pool.shutdownNow()
|
||||
}
|
||||
}
|
||||
|
||||
@Test
|
||||
fun startupCrashDowngradesToStandardModeAndCapsRestartLoop() {
|
||||
val host = PulseAudioComponent.HostLifecycle { }
|
||||
val generation = host.begin()
|
||||
assertFalse(host.preferStandardPerformanceMode())
|
||||
|
||||
var pid = 31500
|
||||
for (i in 0 until PulseAudioComponent.HostLifecycle.MAX_STARTUP_CRASH_RESTARTS) {
|
||||
assertTrue(host.launch(generation) { pid++ })
|
||||
assertTrue(host.exited(generation))
|
||||
val delay = host.nextRestartDelayMs(generation)
|
||||
assertTrue("expected positive backoff on startup crash #$i, got $delay", delay > 0L)
|
||||
assertTrue(host.preferStandardPerformanceMode())
|
||||
}
|
||||
|
||||
// One more crash before any sink comes up must stop the hot crash-restart loop.
|
||||
assertTrue(host.launch(generation) { pid++ })
|
||||
assertTrue(host.exited(generation))
|
||||
assertEquals(-1L, host.nextRestartDelayMs(generation))
|
||||
|
||||
// A fresh session resets both the fallback preference and the crash counter.
|
||||
val next = host.begin()
|
||||
assertFalse(host.preferStandardPerformanceMode())
|
||||
assertTrue(host.launch(next) { pid++ })
|
||||
assertTrue(host.exited(next))
|
||||
assertTrue(host.nextRestartDelayMs(next) > 0L)
|
||||
}
|
||||
|
||||
@Test
|
||||
fun healthySinkResetsCrashCounterAndRestartsImmediately() {
|
||||
val host = PulseAudioComponent.HostLifecycle { }
|
||||
val generation = host.begin()
|
||||
|
||||
// First startup crashes -> switches to standard mode with backoff.
|
||||
assertTrue(host.launch(generation) { 31600 })
|
||||
assertTrue(host.exited(generation))
|
||||
assertTrue(host.nextRestartDelayMs(generation) > 0L)
|
||||
assertTrue(host.preferStandardPerformanceMode())
|
||||
|
||||
// Replacement host brings up a working sink -> later runtime exit restarts immediately.
|
||||
assertTrue(host.launch(generation) { 31601 })
|
||||
host.markSinkReady(host.token())
|
||||
assertTrue(host.exited(generation))
|
||||
assertEquals(0L, host.nextRestartDelayMs(generation))
|
||||
assertTrue(host.preferStandardPerformanceMode())
|
||||
}
|
||||
|
||||
@Test
|
||||
fun markLowLatencyFailedIgnoresStaleTokens() {
|
||||
val host = PulseAudioComponent.HostLifecycle { }
|
||||
val generation = host.begin()
|
||||
assertTrue(host.launch(generation) { 31700 })
|
||||
val first = host.token()
|
||||
val next = host.begin()
|
||||
// Before the replacement launches, token still equals launches, but pid is stopped.
|
||||
host.markLowLatencyFailed(first)
|
||||
assertFalse(host.preferStandardPerformanceMode())
|
||||
assertTrue(host.launch(next) { 31701 })
|
||||
host.markLowLatencyFailed(first)
|
||||
assertFalse(host.preferStandardPerformanceMode())
|
||||
host.markLowLatencyFailed(host.token())
|
||||
assertTrue(host.preferStandardPerformanceMode())
|
||||
}
|
||||
}
|
||||
@@ -35,6 +35,37 @@ class LegacyNamesTest {
|
||||
assertEquals("droiddeck", link("etc/bannerlator"))
|
||||
}
|
||||
|
||||
@Test fun theEmptyStandInIsEmptiedAndThermalZonesGetTheirOwn() {
|
||||
write("etc/droiddeck/empty/thermal_zone26/temp", "")
|
||||
LegacyNames.migrateEtc(root)
|
||||
assertEquals(emptyList<String>(), File(root, "etc/droiddeck/empty").list()!!.toList())
|
||||
assertTrue(File(root, LegacyNames.NO_THERMAL).isDirectory)
|
||||
}
|
||||
|
||||
@Test fun clearingTheEmptyStandInRemovesLinksWithoutTouchingWhatTheyPointAt() {
|
||||
write("home/keep/file", "kept")
|
||||
val links = File(root, "etc/droiddeck/empty").apply { mkdirs() }
|
||||
val made = runCatching {
|
||||
Files.createSymbolicLink(File(links, "dir").toPath(), File(root, "home/keep").toPath())
|
||||
Files.createSymbolicLink(File(links, "dangling").toPath(), File(root, "missing").toPath())
|
||||
}.isSuccess
|
||||
org.junit.Assume.assumeTrue("this file system cannot make symbolic links", made)
|
||||
LegacyNames.migrateEtc(root)
|
||||
assertEquals(emptyList<String>(), links.list()!!.toList())
|
||||
assertEquals("kept", File(root, "home/keep/file").readText())
|
||||
}
|
||||
|
||||
@Test fun aLinkInPlaceOfTheEmptyStandInIsReplacedWithoutTouchingItsTarget() {
|
||||
write("home/keep/file", "kept")
|
||||
val empty = File(root, "etc/droiddeck/empty").also { it.parentFile!!.mkdirs() }
|
||||
val made = runCatching { Files.createSymbolicLink(empty.toPath(), File(root, "home/keep").toPath()) }.isSuccess
|
||||
org.junit.Assume.assumeTrue("this file system cannot make symbolic links", made)
|
||||
LegacyNames.migrateEtc(root)
|
||||
assertFalse(Files.isSymbolicLink(empty.toPath()))
|
||||
assertEquals(emptyList<String>(), empty.list()!!.toList())
|
||||
assertEquals("kept", File(root, "home/keep/file").readText())
|
||||
}
|
||||
|
||||
@Test fun aFreshRuntimeGetsNoOldNames() {
|
||||
write("usr/local/bin/droiddeck-session", "new")
|
||||
LegacyNames.migrateRootfs(root)
|
||||
|
||||
@@ -0,0 +1,166 @@
|
||||
package com.droiddeck.launcher.ui
|
||||
|
||||
import android.app.Activity
|
||||
import android.content.Context
|
||||
import android.view.WindowManager
|
||||
import androidx.compose.ui.graphics.Color
|
||||
import androidx.compose.ui.graphics.compositeOver
|
||||
import androidx.compose.ui.graphics.luminance
|
||||
import com.droiddeck.launcher.session.SessionPrefs
|
||||
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.Robolectric
|
||||
import org.robolectric.RobolectricTestRunner
|
||||
import org.robolectric.RuntimeEnvironment
|
||||
import org.robolectric.annotation.Config
|
||||
|
||||
@RunWith(RobolectricTestRunner::class)
|
||||
@Config(sdk = [34])
|
||||
class LauncherFrostTest {
|
||||
private val app get() = RuntimeEnvironment.getApplication()
|
||||
private val graphite get() = Themes.byId(Themes.GRAPHITE)
|
||||
private val whiteRed get() = Themes.byId(Themes.WHITE_RED)
|
||||
|
||||
@Before fun clear() {
|
||||
app.getSharedPreferences("session", Context.MODE_PRIVATE).edit().clear().commit()
|
||||
}
|
||||
|
||||
private fun contrast(a: Color, b: Color) = (maxOf(a.luminance(), b.luminance()) + 0.05f) / (minOf(a.luminance(), b.luminance()) + 0.05f)
|
||||
|
||||
private val wallpapers = listOf(Color.White, Color.Black, Color(0xFF808080), Color(0xFFFFE600), Color(0xFF00008B), Color(0xFF20AA96), Color(0xFFE2725B))
|
||||
|
||||
private val steps = (0..FROST_MAX step FROST_STEP).toList()
|
||||
|
||||
private fun look(theme: Palette, transparency: Int = FROST_WALLPAPER_DEFAULT, cards: Boolean = false, cardTransparency: Int = FROST_DEFAULT) =
|
||||
frostLook(theme, FrostChoice(transparency, cards, cardTransparency))
|
||||
|
||||
@Test fun hintTextStaysReadableOnThePageAndOnCardsOverAnyPartOfAnyWallpaper() {
|
||||
for (theme in Themes.all) for (t in steps) for (c in listOf(0, FROST_DEFAULT, FROST_MAX)) {
|
||||
val look = look(theme, t, cards = true, cardTransparency = c)
|
||||
val frosted = theme.frosted(look)
|
||||
assertTrue("${theme.id} $t/$c veil ${look.veil.alpha}", look.veil.alpha in 0.31f..0.95f)
|
||||
for (wallpaper in wallpapers) {
|
||||
val page = look.veil.compositeOver(wallpaper)
|
||||
val card = frosted.surface.compositeOver(page)
|
||||
val at = "${theme.id} $t/$c over $wallpaper"
|
||||
assertTrue("$at page", contrast(frosted.onSurfaceVariant, page) >= 4.5f)
|
||||
assertTrue("$at card", contrast(frosted.onSurfaceVariant, card) >= 4.5f)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private fun custom(bg: Color, text: Color) = Palette(
|
||||
"custom", graphite.label, graphite.detail,
|
||||
background = bg, surface = bg, surfaceVariant = bg, line = bg, line2 = bg,
|
||||
onBackground = text, onSurfaceVariant = text,
|
||||
primary = text, primary2 = text, onPrimary = bg, signal = text, good = text,
|
||||
)
|
||||
|
||||
@Test fun aMidGreyCustomPaletteStaysReadableOverBlackAndWhiteWallpaper() {
|
||||
val grey = custom(Color(0xFF999999), Color.Black)
|
||||
val look = look(grey, cards = false)
|
||||
for (wallpaper in listOf(Color.Black, Color.White)) {
|
||||
assertTrue("over $wallpaper", contrast(Color.Black, look.veil.compositeOver(wallpaper)) >= 4.5f)
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun whenNoTintIsReadableTheVeilTurnsSolid() {
|
||||
val dim = custom(Color.Black, Color(0xFF777777))
|
||||
assertEquals(1f, look(dim, cards = false).veil.alpha)
|
||||
}
|
||||
|
||||
@Test fun aTintThatLosesTheTextOverOneWallpaperTurnsSolid() {
|
||||
val grey = custom(Color.Black, Color(0xFF757575))
|
||||
val look = look(grey, cards = false)
|
||||
for (wallpaper in listOf(Color.Black, Color.White)) {
|
||||
assertTrue("over $wallpaper", contrast(Color(0xFF757575), look.veil.compositeOver(wallpaper)) >= 4.5f)
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun atTheDefaultTransparencyTheVeilStaysUnderThreeQuarters() {
|
||||
for (theme in Themes.all) assertTrue(theme.id, look(theme, cards = true).veil.alpha <= 0.75f)
|
||||
}
|
||||
|
||||
@Test fun moreTransparencyNeverThickensTheVeilOrTheCards() {
|
||||
for (theme in Themes.all) {
|
||||
val veils = steps.map { look(theme, it).veil.alpha }
|
||||
assertTrue("${theme.id}: $veils", veils.zipWithNext().all { (a, b) -> b <= a + 0.005f })
|
||||
val cards = steps.map { look(theme, cards = true, cardTransparency = it).cardAlpha }
|
||||
assertTrue("${theme.id} cards: $cards", cards.zipWithNext().all { (a, b) -> b <= a })
|
||||
}
|
||||
assertTrue(look(graphite, FROST_MAX).veil.alpha < look(graphite).veil.alpha)
|
||||
assertTrue(look(whiteRed, FROST_MAX).veil.alpha < look(whiteRed).veil.alpha)
|
||||
}
|
||||
|
||||
@Test fun withoutCardsTheFrostOnlyMovesHintTextTowardTheMainText() {
|
||||
val frosted = graphite.frosted(look(graphite))
|
||||
assertEquals(graphite.background, frosted.background)
|
||||
assertEquals(graphite.surface, frosted.surface)
|
||||
assertEquals(graphite.surfaceVariant, frosted.surfaceVariant)
|
||||
assertEquals(graphite.onBackground, frosted.onBackground)
|
||||
assertTrue(frosted.onSurfaceVariant.luminance() > graphite.onSurfaceVariant.luminance())
|
||||
assertTrue(frosted.onSurfaceVariant.luminance() < graphite.onBackground.luminance())
|
||||
}
|
||||
|
||||
@Test fun cardsGoSeeThroughByTheirOwnTransparencyAndAreSolidAtZero() {
|
||||
for (theme in Themes.all) {
|
||||
val frosted = theme.frosted(look(theme, cards = true))
|
||||
assertTrue(theme.id, frosted.surface.alpha in 0.5f..0.8f && frosted.surfaceVariant.alpha == frosted.surface.alpha)
|
||||
assertEquals(theme.surface, frosted.surface.copy(alpha = 1f))
|
||||
assertEquals(theme.background, frosted.background)
|
||||
assertEquals(1f, look(theme, cards = true, cardTransparency = 0).cardAlpha)
|
||||
}
|
||||
}
|
||||
|
||||
@Test fun firstTurningTheFrostOnFrostsTheWallpaperAndCardsAtTheDefaults() {
|
||||
assertFalse(SessionPrefs.launcherFrost(app))
|
||||
assertTrue(SessionPrefs.frostWallpaper(app))
|
||||
assertTrue(SessionPrefs.frostCards(app))
|
||||
assertEquals(FROST_WALLPAPER_DEFAULT, SessionPrefs.frostTransparency(app))
|
||||
assertEquals(FROST_DEFAULT, SessionPrefs.frostCardTransparency(app))
|
||||
SessionPrefs.setLauncherFrost(app, true)
|
||||
SessionPrefs.setFrostWallpaper(app, false)
|
||||
SessionPrefs.setFrostCards(app, false)
|
||||
SessionPrefs.setFrostTransparency(app, 999)
|
||||
SessionPrefs.setFrostCardTransparency(app, -5)
|
||||
assertTrue(SessionPrefs.launcherFrost(app))
|
||||
assertFalse(SessionPrefs.frostWallpaper(app))
|
||||
assertFalse(SessionPrefs.frostCards(app))
|
||||
assertEquals(FROST_MAX, SessionPrefs.frostTransparency(app))
|
||||
assertEquals(0, SessionPrefs.frostCardTransparency(app))
|
||||
}
|
||||
|
||||
@Test fun searchFindsTheFrostOnlyWhereSettingsShowsIt() {
|
||||
val frosted = SettingsIndex.entries.single { it.frost }
|
||||
assertTrue(frosted in SettingsIndex.search(app, "transparency", frost = true))
|
||||
assertFalse(frosted in SettingsIndex.search(app, "transparency", frost = false))
|
||||
assertTrue(SettingsIndex.search(app, "theme", frost = false).isNotEmpty())
|
||||
}
|
||||
|
||||
@Test fun theWindowIsPreparedWhileBlurIsOffAndShowsNoWallpaperUntilShown() {
|
||||
val activity = Robolectric.buildActivity(Activity::class.java).setup().get()
|
||||
val frost = LauncherFrost(activity)
|
||||
val flags = WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER or WindowManager.LayoutParams.FLAG_BLUR_BEHIND
|
||||
frost.prepare(true)
|
||||
assertFalse(frost.available)
|
||||
assertTrue(frost.prepared)
|
||||
assertEquals(0, activity.window.attributes.flags and flags)
|
||||
frost.show(true)
|
||||
assertEquals(flags, activity.window.attributes.flags and flags)
|
||||
}
|
||||
|
||||
@Test fun aWindowThatWasNotPreparedKeepsItsBackgroundAndShowsNoWallpaper() {
|
||||
val activity = Robolectric.buildActivity(Activity::class.java).setup().get()
|
||||
val before = activity.window.decorView.background
|
||||
val frost = LauncherFrost(activity)
|
||||
frost.prepare(false)
|
||||
frost.show(true)
|
||||
assertFalse(frost.prepared)
|
||||
assertEquals(before, activity.window.decorView.background)
|
||||
assertEquals(0, activity.window.attributes.flags and (WindowManager.LayoutParams.FLAG_SHOW_WALLPAPER or WindowManager.LayoutParams.FLAG_BLUR_BEHIND))
|
||||
}
|
||||
}
|
||||
@@ -24,7 +24,9 @@ ways:
|
||||
| `app/src/testDebug/.../ui/PreviewRenderTest.kt` | The render test |
|
||||
|
||||
Previews cover the launcher on each tab (Steam, Library, Library with no games, Stores, Downloads, Settings, Settings with
|
||||
no runtime) and the in-game menu's pages (Controller, Display, HUD, Session, and the Desktop menu).
|
||||
no runtime), the in-game menu's pages (Controller, Display, HUD, Session, and the Desktop menu), and the frosted
|
||||
background: the Steam and Library tabs, Settings with frosted cards and with both transparencies at 100 %, and a
|
||||
settings step opened over frosted page text.
|
||||
|
||||
## Adding one
|
||||
|
||||
|
||||
@@ -42,3 +42,37 @@ Gradient in the list, and Setup shows a Speed slider (1 to 10, `SessionPrefs.rgb
|
||||
Compose applies Android's animator scale to it, and the colour holds still when animations are off in the app (`Motion.scale`) or in Android's own settings. The hue is written to `Themes.rgbHue` in 3° steps, which restyles the
|
||||
app only when the colour visibly moves; a slow cycle costs few recompositions.
|
||||
|
||||
## Frosted background
|
||||
|
||||
Setup › Launcher › Frosted (`SessionPrefs.launcherFrost`, off by default) is the master switch. Under it, while it is
|
||||
on, sit Frosted wallpaper and Frosted cards (`frostWallpaper`, `frostCards`, both on by default, so the first time
|
||||
Frosted is turned on both apply at their defaults), each with its own transparency from 0 to 100 % in steps of 10
|
||||
(`frostTransparency` from 80 %, `frostCardTransparency` from 50 %). Frosted cards is greyed out while Frosted wallpaper is
|
||||
off, since a card can only show the wallpaper the page behind it shows; each slider stays in place and is greyed out
|
||||
while it has nothing to set.
|
||||
|
||||
Frosted wallpaper shows the device's wallpaper, blurred, behind the launcher. Android draws it: the launcher's window
|
||||
is see-through and carries `FLAG_SHOW_WALLPAPER` and `FLAG_BLUR_BEHIND`, so the app never reads the wallpaper and needs
|
||||
no permission (`ui/LauncherFrost.kt`). It works with any theme except True black, which keeps the page unlit.
|
||||
|
||||
Over the wallpaper sits one veil of the theme's `background` (`frostLook`). 0 % is nearly solid and 100 % shows the most
|
||||
wallpaper. While the frost shows, the theme moves `onSurfaceVariant` toward `onBackground` (`Palette.frosted`): halfway
|
||||
up to 50 %, and further above it, all the way at 100 %. The veil grows past the chosen transparency only as far as that
|
||||
hint text needs to keep 4.5:1, on the page and on a card (the rail and the bottom bar are cards here), as far as the
|
||||
theme's own colours allow: a Custom theme whose hint text matches its background stays unreadable with or without the
|
||||
frost. Android reports only a wallpaper's main colours, and any part of it can sit behind text, so the check takes the
|
||||
worst wallpaper there is: white under a dark theme and black under the light one. The veil is then about 0.7 at 50 %,
|
||||
0.63 at 80 % and 0.6 at 100 % on a dark theme, and 0.7, 0.57 and 0.52 on the light one. The wallpaper slider starts at
|
||||
80 % so the wallpaper shows about as much as the game page's glass (0.58) does.
|
||||
|
||||
`LocalFrost` carries the veil and the launcher's root steps aside. With Frosted cards on, the theme hands out `surface`
|
||||
and `surfaceVariant` see-through by the card transparency (0.6 on a dark theme and 0.74 on the light one at 50 %, solid at 0 %), and dialogs, popups, menus and
|
||||
settings steps take the solid palette back (`SolidSurfaces`), so no page text shows through them. The rail and the bottom bar draw
|
||||
`surface`, so they follow the cards: see-through with them and solid without.
|
||||
|
||||
The rows show on Android 12 and later when the system can blur behind windows, and also while Battery Saver pauses the
|
||||
blur, when the page shows the plain background until the blur returns. A window is see-through or not from its first
|
||||
frame, so the launcher prepares its window whenever the wallpaper frost is on at start, whether or not the blur is
|
||||
available then. Turning the wallpaper frost on restarts the launcher once only if the window was not prepared at start;
|
||||
otherwise turning it off and on, and the blur pausing and coming back, switch between the frost and the plain
|
||||
background at once.
|
||||
@@ -172,7 +172,7 @@ there.
|
||||
|
||||
### B. Exec-in-place workers for long-lived processes
|
||||
|
||||
Declare a pool of `android:process` services (`:g0`…`:g95`). Each long-lived program runs as the
|
||||
Declare a pool of `android:process` services (`:g0`…`:g127`). Each long-lived program runs as the
|
||||
main process of one worker (Gap 2): full app privileges, direct GPU, normal signals and `/proc`
|
||||
(same uid and SELinux domain), and the app hears its exit through binder death. Costs and limits:
|
||||
|
||||
@@ -262,8 +262,29 @@ vfork-safe (Python's subprocess execs under `vfork`). Details that mattered:
|
||||
session (KDE Plasma, 17–19 counted at rest), a Konsole running 40 `sleep 600 &` jobs peaked at
|
||||
61 counted and lost 27 processes to Android's limit (Konsole, D-Bus, the portal) before this, and
|
||||
at 20 with no kills after. Still counted, and not handed off: a terminal's foreground jobs (a
|
||||
`make -j` and its compilers), the D-Bus daemon's activation helpers (forks that never exec) and
|
||||
the desktop's own programs started by KDE's launchers.
|
||||
`make -j` and its compilers) and the D-Bus daemon's activation helpers (forks that never exec).
|
||||
- **The desktop.** Plasma's own programs are listed (`startplasma-wayland`, `plasma_session`,
|
||||
KWin, `kded6`, `ksmserver`, `plasmashell`, PowerDevil, KDE Connect, the KIO workers, the D-Bus
|
||||
activated portal, dconf and activity manager) along with DroidDeck's desktop helpers. Discover's
|
||||
update notifier, GeoClue's demo agent and the global-menu proxy are off in the user's Autostart.
|
||||
A program a desktop launcher starts (`DD_HANDOFF_LAUNCHERS`: Plasma's shell, KRunner, Dolphin)
|
||||
goes to a worker when it is a plain fork and exec: in the launcher's process group and session,
|
||||
with no controlling terminal. Those launchers are Qt programs, which wait with `waitpid()` once
|
||||
the hook has taken their pidfds away. A terminal's shell (its own session and terminal) stays.
|
||||
Firefox runs with fission off, at most two web content processes and no crash helper. The
|
||||
desktop and its apps use about 80 workers with Steam and a game running, hence 128.
|
||||
|
||||
Counted children on the Thor (main: the session as #3338 and #3594 left it):
|
||||
|
||||
| | main | this |
|
||||
|---|---|---|
|
||||
| desktop at rest | 30 | 0 |
|
||||
| Dolphin, Konsole, Firefox, Kate and System Settings open | not measured (49 on a Pocket FIT without Firefox, the terminal running 40 jobs) | 7 |
|
||||
| those, the desktop's Steam client and Bully running | not measured | 20 (30 with 64 workers: Wine's services were refused one) |
|
||||
|
||||
With Bully running, six scans forced with the stock limit of 32 killed nothing. What stays
|
||||
counted then: Steam's client and launch chain (10), Firefox's helpers (6), Konsole's shell,
|
||||
Proton's script and `wineserver`.
|
||||
|
||||
Default list: the portals, at-spi, `python3`, PipeWire, WirePlumber, Decky's PluginLoader, the log's
|
||||
`gnudd`, `xprop -spy`, the web helper's renderers, `wine`, `wine-preloader`, `wineserver`.
|
||||
@@ -510,6 +531,35 @@ the old behavior and the old requirement.
|
||||
7. A (the isolated tier) only if B stops working on a future Android; it needs a file and socket
|
||||
broker and keeps the GPU outside.
|
||||
|
||||
## Zombies
|
||||
|
||||
Every session process is a child subreaper (`tools/linuxfs/preload/subreaper.c`, so that a
|
||||
double-forked Xwayland is not left to init, which some vendor kernels kill), and most programs
|
||||
never wait for a child they did not fork. What they adopted stayed a zombie: the grandchildren of
|
||||
Qt's `startDetached()` under Plasma's shell, KWin and kaccess, Wine's double-forked processes,
|
||||
wlroots' Xwayland under gamescope. A parent that never waits at all (Plasma's shell, for what it
|
||||
launches) also kept the forked child of each program it handed off. On the Thor, main had 4
|
||||
zombies in Steam mode at rest and 19 in Bully, and the desktop gained one per app closed.
|
||||
|
||||
The hook now reaps them from SIGCHLD (`ddh_reap_unclaimed()`):
|
||||
|
||||
- **Adopted:** each process records, at its pid, the parent that started it and its own start
|
||||
time, in one file for the session (`DD_PARENTS`). A fork's child does it at the fork, any other
|
||||
program at its start. A zombie child whose record names another parent was adopted. An own child
|
||||
(recorded with this parent, or with no record, such as a static program a `vfork()` started) is
|
||||
left for its program's wait.
|
||||
- **A handed-off program's forked child,** as a wait's look reaps it: the program's exit stays in
|
||||
the table for the parent's wait.
|
||||
|
||||
The program's SIGCHLD action runs first, and `sigaction()` shows it as the program set it.
|
||||
`SIG_IGN` and `SA_NOCLDWAIT` stay the kernel's. A program that leaves SIGCHLD alone gets the
|
||||
handler only when `DD_REAP_ADOPTED` names it (Plasma's programs, D-Bus, gamescope, Wine's
|
||||
launchers, Decky's loader): with a handler, `poll()`, `sleep()` and the like return `EINTR` when a
|
||||
child exits. With these changes there are no zombies left in either mode, Bully included.
|
||||
|
||||
qemu-user has no `PR_SET_CHILD_SUBREAPER`, so the adoption tests skip under it (CI) and were run on
|
||||
the Thor's kernel.
|
||||
|
||||
## Robustness
|
||||
|
||||
- Gap 1's path mismatch is a bug that could be fixed; the app-zygote skip is deliberate. Use app
|
||||
|
||||
@@ -36,6 +36,7 @@ Links of the form `droiddeck://settings/<section>` open a Settings section direc
|
||||
| Controller | Settings › Controller (`droiddeck://settings/controller`) | gamepad, buttons, mapping, profile, remap |
|
||||
| Smart glasses | Settings › Smart glasses (`droiddeck://settings/glasses`) | xreal, viture, vr, ar |
|
||||
| Theme | Settings › Launcher (`droiddeck://settings/launcher`) | color, dark |
|
||||
| Frosted | Settings › Launcher (`droiddeck://settings/launcher`) | blur, wallpaper, background, cards, transparent, transparency, opacity, glass |
|
||||
| App scale | Settings › Launcher (`droiddeck://settings/launcher`) | size, zoom |
|
||||
| App icon | Settings › Launcher (`droiddeck://settings/launcher`) | |
|
||||
| Animations | Settings › Launcher (`droiddeck://settings/launcher`) | |
|
||||
|
||||
@@ -87,6 +87,11 @@ static const char *rewrite_path(const char *path, char *out, size_t size) {
|
||||
return path;
|
||||
}
|
||||
|
||||
// The native hook's SIGCHLD handling (hook/signals.c) is not part of this shim: its programs record their
|
||||
// first parent for the session's subreapers, and reap nothing themselves.
|
||||
static void ddnatv_manage_sigchld(void) {}
|
||||
static void ddh_reap_unclaimed(void) __attribute__((unused));
|
||||
|
||||
#include "../nativeguest/hook/kept.c"
|
||||
#include "../nativeguest/hook/handoff.c"
|
||||
|
||||
@@ -315,12 +320,14 @@ pid_t fork(void) {
|
||||
}
|
||||
ddh_prepare();
|
||||
pid_t forker = (pid_t)syscall(SYS_gettid);
|
||||
pid_t forking = (pid_t)syscall(SYS_getpid);
|
||||
pid_t pid = orig_fork();
|
||||
if (pid == 0) {
|
||||
kept_forked();
|
||||
kept_close_forked();
|
||||
ddh_drop_worker_binder();
|
||||
ddh_forked(forker);
|
||||
ddh_record_parent((pid_t)syscall(SYS_getpid), forking);
|
||||
} else if (pid > 0) {
|
||||
ddh_child_created(pid, 1);
|
||||
}
|
||||
|
||||
Executable
+19
@@ -0,0 +1,19 @@
|
||||
#!/usr/bin/env bash
|
||||
# Exports the build metadata Gradle bakes into BuildConfig and prints the label for DROIDDECK_BUILD_LABEL.
|
||||
set -euo pipefail
|
||||
if [[ -n "$(git status --porcelain)" ]]; then
|
||||
tree_state=dirty
|
||||
else
|
||||
tree_state=clean
|
||||
fi
|
||||
echo "DROIDDECK_BUILD_TREE_STATE=$tree_state" >> "$GITHUB_ENV"
|
||||
if [[ -n "${PR_NUMBER:-}" ]]; then
|
||||
label="pr${PR_NUMBER} at ${PR_HEAD_SHA:0:7}"
|
||||
else
|
||||
label="${BUILD_REF} at ${BUILD_SHA:0:7}"
|
||||
fi
|
||||
echo "label=$label" >> "$GITHUB_OUTPUT"
|
||||
echo "DROIDDECK_SOURCE_COMMIT=${PR_HEAD_SHA:-$BUILD_SHA}" >> "$GITHUB_ENV"
|
||||
echo "DROIDDECK_PR_NUMBER=${PR_NUMBER:-0}" >> "$GITHUB_ENV"
|
||||
echo "DROIDDECK_PR_TITLE=${PR_TITLE//$'\n'/ }" >> "$GITHUB_ENV"
|
||||
echo "Build: \`$label\`" >> "$GITHUB_STEP_SUMMARY"
|
||||
@@ -10,13 +10,18 @@ flowchart LR
|
||||
Source[Pin source tree] --> Components[Prepare verified components]
|
||||
Source --> Xbox[Xbox ARM64 backend]
|
||||
Source --> Tests[Python and native tests]
|
||||
Components --> APK[Compile APK and Android tests]
|
||||
Components --> APK[Compile APK]
|
||||
Xbox --> APK
|
||||
APK --> Gate[Compile and test APK gate]
|
||||
Tests --> Gate
|
||||
Gate --> Publish[Main only: signing and publishing]
|
||||
```
|
||||
|
||||
Kotlin unit tests run in the separate `Unit tests` workflow (`unit-tests.yml`), so a
|
||||
PR test build is published as soon as the APK compiles. Build validation folds both
|
||||
workflows into the `Build APK` commit status, and Release APKs requires both for the
|
||||
released commit.
|
||||
|
||||
All workers verify the same source tree. The component artifact records that tree,
|
||||
recipe identities and every output hash; the APK worker verifies the inventory
|
||||
before building. This handoff verifies consistency within the same CI run. It is
|
||||
|
||||
@@ -9,7 +9,7 @@ export MOZ_ENABLE_WAYLAND=1 MOZ_USE_XINPUT2=1
|
||||
export SHELL=/bin/bash
|
||||
export MOZ_DISABLE_CONTENT_SANDBOX=1 MOZ_DISABLE_GMP_SANDBOX=1 MOZ_DISABLE_RDD_SANDBOX=1
|
||||
export MOZ_DISABLE_SOCKET_PROCESS_SANDBOX=1 MOZ_DISABLE_UTILITY_SANDBOX=1
|
||||
export MOZ_SHM_NO_SEALS=1
|
||||
export MOZ_SHM_NO_SEALS=1 MOZ_CRASHREPORTER_DISABLE=1
|
||||
export QTWEBENGINE_DISABLE_SANDBOX=1
|
||||
export KWIN_COMPOSE=Q QT_QUICK_BACKEND=software LIBGL_ALWAYS_SOFTWARE=1 GALLIUM_DRIVER=llvmpipe
|
||||
export KWIN_USE_OVERLAYS=0
|
||||
@@ -142,11 +142,10 @@ Exec=konsole -e /usr/local/bin/droiddeck-steam-x64
|
||||
Icon=steam
|
||||
Categories=System;
|
||||
ENTRY
|
||||
python3 /usr/local/bin/droiddeck-pad-defaults 2>&1 | sed 's/^/[pads] /'
|
||||
( while sleep 30; do python3 /usr/local/bin/droiddeck-pad-defaults 2>&1 | sed 's/^/[pads] /'; done ) &
|
||||
python3 /usr/local/bin/droiddeck-pad-defaults --every 30 &
|
||||
python3 /usr/local/bin/droiddeck-desktop-gpu 2>&1 | sed 's/^/[gpu] /'
|
||||
/usr/local/bin/droiddeck-desktop-window-rules 2>&1 | sed 's/^/[rules] /'
|
||||
( python3 /usr/local/bin/droiddeck-library-perms 2>&1 | sed 's/^/[perms] /' ) &
|
||||
python3 /usr/local/bin/droiddeck-library-perms 2>&1 &
|
||||
mkdir -p /usr/local/share/applications
|
||||
cat > /usr/local/share/applications/droiddeck-ime.desktop <<'ENTRY'
|
||||
[Desktop Entry]
|
||||
@@ -175,6 +174,15 @@ fi
|
||||
if command -v flatpak >/dev/null 2>&1 && [ ! -d /var/lib/pacman ]; then
|
||||
FLATPAK_BWRAP=/usr/local/bin/droiddeck-bwrap flatpak remote-add --user --if-not-exists flathub https://dl.flathub.org/repo/flathub.flatpakrepo >/dev/null 2>&1 &
|
||||
fi
|
||||
# Android counts the desktop's programs against an app's limit of 32. Off unless the user turns them
|
||||
# back on in Autostart: Discover's update notifier (the packages follow DroidDeck's releases, and it
|
||||
# keeps PackageKit running as root), GeoClue's demo agent (nothing asks for a location) and the
|
||||
# global-menu proxy (the panel has no global menu).
|
||||
mkdir -p "$HOME/.config/autostart"
|
||||
for entry in org.kde.discover.notifier geoclue-demo-agent gmenudbusmenuproxy; do
|
||||
[ -e "$HOME/.config/autostart/$entry.desktop" ] ||
|
||||
printf '[Desktop Entry]\nType=Application\nName=%s\nHidden=true\n' "$entry" > "$HOME/.config/autostart/$entry.desktop"
|
||||
done
|
||||
skel_done=$HOME/.local/share/droiddeck/skel-copied
|
||||
if [ -d /etc/skel ] && [ ! -e "$skel_done" ]; then
|
||||
cp -rn /etc/skel/. "$HOME/" 2>/dev/null
|
||||
|
||||
@@ -9,3 +9,11 @@ pref("datareporting.policy.dataSubmissionEnabled", false);
|
||||
pref("browser.aboutwelcome.enabled", false);
|
||||
pref("browser.startup.homepage", "about:blank");
|
||||
pref("layout.css.devPixelsPerPx", "1.25");
|
||||
// Android counts each of Firefox's processes against the app's limit of 32: one web content process
|
||||
// per two tabs' worth of sites rather than one per site, none started ahead, and extensions and
|
||||
// about: pages in the processes that already exist.
|
||||
pref("fission.autostart", false);
|
||||
pref("dom.ipc.processCount", 2);
|
||||
pref("dom.ipc.processPrelaunch.enabled", false);
|
||||
pref("browser.tabs.remote.separatePrivilegedContentProcess", false);
|
||||
pref("extensions.webextensions.remote", false);
|
||||
@@ -1,6 +1,8 @@
|
||||
#!/usr/bin/python3
|
||||
import glob
|
||||
import os
|
||||
import sys
|
||||
import time
|
||||
|
||||
HOME = os.environ.get("HOME", "/root")
|
||||
CONFIG = os.environ.get("XDG_CONFIG_HOME", os.path.join(HOME, ".config"))
|
||||
@@ -1048,8 +1050,19 @@ def switch_emulators():
|
||||
print(f"droiddeck-pad-defaults: {name}: Player 1 on the controller ({cfg})")
|
||||
|
||||
|
||||
for step in (rpcs3, duckstation, pcsx2, armsx2, dolphin, cemu, melonds, ppsspp, retroarch, switch_emulators):
|
||||
try:
|
||||
step()
|
||||
except Exception as e:
|
||||
print(f"droiddeck-pad-defaults: {step.__name__}: {e}")
|
||||
def run_all():
|
||||
for step in (rpcs3, duckstation, pcsx2, armsx2, dolphin, cemu, melonds, ppsspp, retroarch, switch_emulators):
|
||||
try:
|
||||
step()
|
||||
except Exception as e:
|
||||
print(f"droiddeck-pad-defaults: {step.__name__}: {e}", flush=True)
|
||||
|
||||
|
||||
# --every SECONDS: again at that interval, for emulators set up while the desktop runs. One process
|
||||
# for the whole desktop session rather than a shell loop starting a new one each time.
|
||||
sys.stdout.reconfigure(line_buffering=True)
|
||||
run_all()
|
||||
if len(sys.argv) == 3 and sys.argv[1] == "--every":
|
||||
while True:
|
||||
time.sleep(float(sys.argv[2]))
|
||||
run_all()
|
||||
@@ -63,9 +63,16 @@ dd_job() {
|
||||
# window's app by walking its process's parents) or its utility processes (the client only accepts
|
||||
# its transport from its own children).
|
||||
if [ "${DD_SPAWN_DAEMONS:-1}" = 1 ] && [ -n "${DD_SPAWN:-}" ]; then
|
||||
export DD_HANDOFF=${DD_HANDOFF-xdg-desktop-portal:xdg-permission-store:xdg-desktop-portal-gtk:at-spi-bus-launcher:at-spi2-registryd:plasma_waitforname:bash+dd-job:droiddeck-log-writer:gamescope:gamescopereaper:droiddeck-session+steam:Xwayland:dbus-launch:droiddeck-agent:droiddeck-launcher-cores:droiddeck-pace-cores:droiddeck-documents:droiddeck-steam-games+watch:droiddeck-steam-compat:dbus-daemon+--nofork:proton:pipewire:wireplumber:PluginLoader:PluginLoader.real:xprop+-spy:gnudd:steamwebhelper+--type=renderer:wine:wine-preloader:wine64:wine64-preloader:wineserver}
|
||||
export DD_HANDOFF=${DD_HANDOFF-xdg-desktop-portal:xdg-permission-store:xdg-desktop-portal-gtk:at-spi-bus-launcher:at-spi2-registryd:plasma_waitforname:bash+dd-job:droiddeck-log-writer:gamescope:gamescopereaper:droiddeck-session+steam:Xwayland:dbus-launch:droiddeck-agent:droiddeck-launcher-cores:droiddeck-pace-cores:droiddeck-documents:droiddeck-steam-games+watch:droiddeck-steam-compat:dbus-daemon+--nofork:proton:pipewire:wireplumber:PluginLoader:PluginLoader.real:xprop+-spy:gnudd:steamwebhelper+--type=renderer:wine:wine-preloader:wine64:wine64-preloader:wineserver:droiddeck-login1:droiddeck-snapd:droiddeck-polkitd:droiddeck-root+/usr/libexec/packagekitd:droiddeck-desktop-clipboard:droiddeck-ime:droiddeck-pad-defaults+--every:droiddeck-library-perms:droiddeck-clipboard:dbus-run-session:startplasma-wayland:plasma_session:kwin_wayland_wrapper:kwin_wayland:kded6:ksmserver:kglobalacceld:plasmashell:krunner:org_kde_powerdevil:xembedsniproxy:kaccess:xsettingsd:kdeconnectd:kunifiedpush-distributor:kactivitymanagerd:xdg-desktop-portal-kde:dconf-service:polkit-kde-authentication-agent-1:plasma-welcome:kioworker}
|
||||
# The programs these start for the user (an app from the panel, a file opened in Dolphin)
|
||||
export DD_HANDOFF_LAUNCHERS=${DD_HANDOFF_LAUNCHERS-plasmashell:krunner:dolphin}
|
||||
# Each process's first parent, so that a process can reap the zombies it adopts as a subreaper, and
|
||||
# the programs that reap them even while they leave SIGCHLD alone (hook/signals.c)
|
||||
rm -f /run/droiddeck-parents.* 2>/dev/null
|
||||
export DD_PARENTS=/run/droiddeck-parents.$$
|
||||
export DD_REAP_ADOPTED=${DD_REAP_ADOPTED-plasmashell:plasma_session:kwin_wayland:kwin_wayland_wrapper:kaccess:ksmserver:kded6:krunner:dolphin:dbus-daemon:startplasma-wayland:gamescope:wine:wine64:wine-preloader:wine64-preloader:wineserver:PluginLoader:PluginLoader.real}
|
||||
else
|
||||
unset DD_HANDOFF
|
||||
unset DD_HANDOFF DD_HANDOFF_LAUNCHERS DD_PARENTS DD_REAP_ADOPTED
|
||||
fi
|
||||
steam_setup_failed() {
|
||||
echo "== steam: the Steam client could not be set up (status $1)"
|
||||
|
||||
@@ -661,12 +661,14 @@ pid_t fork(void) {
|
||||
}
|
||||
ddh_prepare();
|
||||
pid_t forker = (pid_t)syscall(SYS_gettid);
|
||||
pid_t forking = (pid_t)syscall(SYS_getpid);
|
||||
pid_t pid = orig_fork();
|
||||
if (pid == 0) {
|
||||
kept_forked();
|
||||
kept_close_forked();
|
||||
ddh_drop_worker_binder();
|
||||
ddh_forked(forker);
|
||||
ddh_record_parent((pid_t)syscall(SYS_getpid), forking);
|
||||
} else if (pid > 0) {
|
||||
ddh_child_created(pid, 1);
|
||||
}
|
||||
|
||||
@@ -878,6 +878,9 @@ static void ddh_apply_inherited(void) {
|
||||
}
|
||||
}
|
||||
|
||||
static void ddh_open_parents(void);
|
||||
static void ddh_record_own_parent(void);
|
||||
|
||||
__attribute__((constructor)) static void ddh_init(void) {
|
||||
ddh_apply_inherited();
|
||||
ddh_find_worker_binder();
|
||||
@@ -885,6 +888,9 @@ __attribute__((constructor)) static void ddh_init(void) {
|
||||
ddh_find_parent_table();
|
||||
// tests only: as when the table could not be made here, and the first fork makes it
|
||||
if (!getenv("DDH_TEST_LATE_TABLE")) ddh_prepare();
|
||||
ddh_open_parents();
|
||||
ddh_record_own_parent();
|
||||
ddnatv_manage_sigchld();
|
||||
}
|
||||
|
||||
static int ddh_has_arg(char *const argv[], const char *prefix, size_t len) {
|
||||
@@ -1274,6 +1280,30 @@ static int ddh_job_control_job(void) {
|
||||
return ddh_waiter(parent) && (pid_t)syscall(SYS_getpgid, 0) != (pid_t)syscall(SYS_getpgid, parent);
|
||||
}
|
||||
|
||||
// Whether this is a program a desktop launcher starts for the user (DD_HANDOFF_LAUNCHERS names the
|
||||
// launchers: Plasma's shell, KRunner, Dolphin): a plain fork and exec, still in the launcher's process
|
||||
// group and session, with no controlling terminal. Those launchers are Qt programs, which wait with
|
||||
// waitpid() once they have no pidfds (privileged.c), so the program's exit reaches them. A child the
|
||||
// launcher set up as a terminal's (a session and a terminal of its own) stays its own child.
|
||||
static int ddh_launched(const char *filename, char *const argv[], char *const envp[]) {
|
||||
const char *list = ddh_env(envp, "DD_HANDOFF_LAUNCHERS");
|
||||
if (!list || !*list || ddh_exec_stub(filename) || ddh_pressure_keeps(filename, argv)) return 0;
|
||||
pid_t parent = (pid_t)syscall(SYS_getppid);
|
||||
char path[48], name[32];
|
||||
snprintf(path, sizeof(path), "/proc/%d/comm", (int)parent);
|
||||
if (ddh_read_proc(path, name, sizeof(name)) <= 0) return 0;
|
||||
name[strcspn(name, "\n")] = 0;
|
||||
if (!ddh_listed(list, name, NULL)) return 0;
|
||||
if ((pid_t)syscall(SYS_getpgid, 0) != (pid_t)syscall(SYS_getpgid, parent) ||
|
||||
(pid_t)syscall(SYS_getsid, 0) != (pid_t)syscall(SYS_getsid, parent))
|
||||
return 0;
|
||||
// /dev/tty opens only for a process with a controlling terminal
|
||||
int tty = (int)call_orig_syscall(SYS_openat, (unsigned long)AT_FDCWD, (unsigned long)"/dev/tty",
|
||||
O_RDONLY | O_NOCTTY | O_NONBLOCK | O_CLOEXEC, 0, 0, 0);
|
||||
if (tty >= 0) syscall(SYS_close, tty);
|
||||
return tty < 0;
|
||||
}
|
||||
|
||||
static int ddh_pressed(const char *filename, char *const argv[], char *const envp[]) {
|
||||
if (ddh_exec_stub(filename) || ddh_pressure_keeps(filename, argv) || !ddh_waiter((pid_t)syscall(SYS_getppid))) return 0;
|
||||
// Not a job in the foreground of its controlling terminal: a handed-off program has none (the
|
||||
@@ -1302,7 +1332,11 @@ static void ddh_debug(char *const envp[], const char *what, const char *filename
|
||||
struct ddh_buf b = {line, 0, sizeof(line) - 1};
|
||||
ddh_puts(&b, "ddnatv handoff: ");
|
||||
ddh_putint(&b, getpid());
|
||||
ddh_puts(&b, " ");
|
||||
ddh_puts(&b, " (parent ");
|
||||
ddh_putint(&b, (long)syscall(SYS_getppid));
|
||||
ddh_puts(&b, ", session ");
|
||||
ddh_putint(&b, (long)syscall(SYS_getsid, 0));
|
||||
ddh_puts(&b, ") ");
|
||||
ddh_puts(&b, what);
|
||||
ddh_puts(&b, " ");
|
||||
ddh_puts(&b, filename ? filename : "?");
|
||||
@@ -1364,7 +1398,8 @@ static void ddh_try_as(const char *filename, char *const argv[], char *const env
|
||||
ddh_debug(envp, "a job-control job:", filename);
|
||||
return;
|
||||
}
|
||||
if (!ddh_program_listed(list, match_file, match_argv) && !ddh_pressed(match_file, match_argv, envp)) {
|
||||
if (!ddh_program_listed(list, match_file, match_argv) && !ddh_launched(match_file, match_argv, envp) &&
|
||||
!ddh_pressed(match_file, match_argv, envp)) {
|
||||
ddh_debug(envp, "not listed:", filename);
|
||||
return;
|
||||
}
|
||||
@@ -1644,6 +1679,158 @@ static int32_t ddh_gen_of(const struct ddh_entry *e, pid_t child) {
|
||||
return (st == DDH_HANDED || st == DDH_EXITED || st == DDH_TAKEN) && e->child == child ? gen : 0;
|
||||
}
|
||||
|
||||
// ---- children no wait will come for ------------------------------------------------------------
|
||||
//
|
||||
// Every session process is a child subreaper (tools/linuxfs/preload/subreaper.c): a process whose
|
||||
// parent exits goes to its nearest ancestor in the session, not to init, which some vendor kernels
|
||||
// kill. Most programs never wait for a child they did not fork, so what they adopt stays a zombie (the
|
||||
// grandchildren of Qt's startDetached() under Plasma's shell, KWin and kaccess). Each process records
|
||||
// here, at its pid, the parent that started it and its own start time (DD_PARENTS, one file for the
|
||||
// session): a zombie whose record names another parent was adopted.
|
||||
static uint64_t *g_ddh_parents;
|
||||
|
||||
static void ddh_open_parents(void) {
|
||||
const char *name = getenv("DD_PARENTS");
|
||||
if (!name || !*name || __atomic_load_n(&g_ddh_parents, __ATOMIC_ACQUIRE)) return;
|
||||
char path[PATH_MAX];
|
||||
const char *real = rewrite_path(name, path, sizeof(path));
|
||||
int fd = (int)call_orig_syscall(SYS_openat, (unsigned long)AT_FDCWD, (unsigned long)real,
|
||||
O_RDWR | O_CREAT | O_CLOEXEC, 0600, 0, 0);
|
||||
if (fd < 0) return;
|
||||
size_t size = (size_t)DDH_FORKS * sizeof(uint64_t);
|
||||
struct stat st;
|
||||
if (call_orig_syscall(SYS_fstat, (unsigned long)fd, (unsigned long)&st, 0, 0, 0, 0) == 0 && (size_t)st.st_size < size)
|
||||
call_orig_syscall(SYS_ftruncate, (unsigned long)fd, size, 0, 0, 0, 0);
|
||||
// past the file's end a page would fault (SIGBUS): mapped only once the file has its size
|
||||
void *map = MAP_FAILED;
|
||||
if (call_orig_syscall(SYS_fstat, (unsigned long)fd, (unsigned long)&st, 0, 0, 0, 0) == 0 && (size_t)st.st_size >= size)
|
||||
map = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
|
||||
syscall(SYS_close, fd);
|
||||
if (map == MAP_FAILED) return;
|
||||
uint64_t *none = NULL;
|
||||
if (!__atomic_compare_exchange_n(&g_ddh_parents, &none, (uint64_t *)map, 0, __ATOMIC_ACQ_REL, __ATOMIC_ACQUIRE))
|
||||
munmap(map, size);
|
||||
}
|
||||
|
||||
static uint64_t ddh_parent_record(pid_t parent, long start) { return (uint64_t)(uint32_t)parent << 32 | (uint32_t)start; }
|
||||
|
||||
static void ddh_record_parent(pid_t me, pid_t parent) {
|
||||
uint64_t *map = __atomic_load_n(&g_ddh_parents, __ATOMIC_ACQUIRE);
|
||||
if (!map || me <= 0) return;
|
||||
int saved = errno;
|
||||
long start = ddh_start_time(me);
|
||||
errno = saved;
|
||||
if (start > 0) __atomic_store_n(&map[(uint32_t)me % DDH_FORKS], ddh_parent_record(parent, start), __ATOMIC_RELEASE);
|
||||
}
|
||||
|
||||
// At a program's start, unless its fork recorded it: the child of a vfork(), of glibc's own
|
||||
// posix_spawn() (popen(), system()) or of a raw clone() records the parent it has now, which is
|
||||
// still the one that started it (a vfork()'s waits for the exec).
|
||||
static void ddh_record_own_parent(void) {
|
||||
uint64_t *map = __atomic_load_n(&g_ddh_parents, __ATOMIC_ACQUIRE);
|
||||
if (!map) return;
|
||||
pid_t me = (pid_t)syscall(SYS_getpid);
|
||||
int saved = errno;
|
||||
long start = ddh_start_time(me);
|
||||
errno = saved;
|
||||
if (start <= 0) return;
|
||||
uint64_t r = __atomic_load_n(&map[(uint32_t)me % DDH_FORKS], __ATOMIC_ACQUIRE);
|
||||
if ((uint32_t)r == (uint32_t)start && r >> 32) return;
|
||||
__atomic_store_n(&map[(uint32_t)me % DDH_FORKS], ddh_parent_record((pid_t)syscall(SYS_getppid), start), __ATOMIC_RELEASE);
|
||||
}
|
||||
|
||||
// /proc/PID/stat's state and start time, from a signal handler: 0 when it cannot be read.
|
||||
static int ddh_proc_state(pid_t pid, char *state, long *start, pid_t *ppid) {
|
||||
char path[48] = "/proc/", digits[16], stat[512];
|
||||
int n = 0, len = 6;
|
||||
for (unsigned int v = (unsigned int)pid; v || !n; v /= 10) digits[n++] = (char)('0' + v % 10);
|
||||
while (n) path[len++] = digits[--n];
|
||||
memcpy(path + len, "/stat", 6);
|
||||
int fd = (int)call_orig_syscall(SYS_openat, (unsigned long)AT_FDCWD, (unsigned long)path, O_RDONLY | O_CLOEXEC, 0, 0, 0);
|
||||
if (fd < 0) return 0;
|
||||
long got = call_orig_syscall(SYS_read, (unsigned long)fd, (unsigned long)stat, sizeof(stat) - 1, 0, 0, 0);
|
||||
call_orig_syscall(SYS_close, (unsigned long)fd, 0, 0, 0, 0, 0);
|
||||
if (got <= 0) return 0;
|
||||
stat[got] = 0;
|
||||
char *p = strrchr(stat, ')');
|
||||
if (!p || p[1] != ' ' || !p[2]) return 0;
|
||||
*state = p[2];
|
||||
// ") S PPID": field 4; starttime is field 22
|
||||
long parent = 0;
|
||||
for (const char *q = p + 4; *q >= '0' && *q <= '9'; q++) parent = parent * 10 + (*q - '0');
|
||||
*ppid = (pid_t)parent;
|
||||
for (int field = 2; p && field < 22; field++) p = strchr(p + 1, ' ');
|
||||
long t = 0;
|
||||
for (const char *q = p ? p + 1 : ""; *q >= '0' && *q <= '9'; q++) t = t * 10 + (*q - '0');
|
||||
*start = t;
|
||||
return 1;
|
||||
}
|
||||
|
||||
// Reaps child if no wait will come for it: the forked child of a handed-off program (its program's
|
||||
// exit stays in the table for the program's own waits, as when a wait reaps it), or a child this
|
||||
// process adopted. 1 when it did.
|
||||
static int ddh_reap_unwaited(pid_t me, pid_t child) {
|
||||
char state = 0;
|
||||
long start = 0;
|
||||
pid_t ppid = 0;
|
||||
if (!ddh_proc_state(child, &state, &start, &ppid) || state != 'Z' || ppid != me) return 0;
|
||||
struct ddh_entry *e = ddh_find(child);
|
||||
int32_t gen = e ? ddh_gen_of(e, child) : 0;
|
||||
if (gen) {
|
||||
if (ddh_reaped(e) || call_orig_syscall(SYS_wait4, (unsigned long)child, 0, WNOHANG, 0, 0, 0) != child) return 0;
|
||||
ddh_mark_reaped(e, gen);
|
||||
return 1;
|
||||
}
|
||||
uint64_t *map = __atomic_load_n(&g_ddh_parents, __ATOMIC_ACQUIRE);
|
||||
uint64_t r = map ? __atomic_load_n(&map[(uint32_t)child % DDH_FORKS], __ATOMIC_ACQUIRE) : 0;
|
||||
if (!r || (uint32_t)r != (uint32_t)start || (pid_t)(r >> 32) == me || !(r >> 32)) return 0;
|
||||
return call_orig_syscall(SYS_wait4, (unsigned long)child, 0, WNOHANG, 0, 0, 0) == child;
|
||||
}
|
||||
|
||||
// From the SIGCHLD handler (signals.c): the zombies among this process's children that no wait will
|
||||
// come for. The kernel names one zombie at a time; past one the program will reap itself, /proc.
|
||||
static void ddh_reap_unclaimed(void) {
|
||||
if (!__atomic_load_n(&g_ddh_parents, __ATOMIC_ACQUIRE) && !__atomic_load_n(&g_ddh, __ATOMIC_ACQUIRE)) return;
|
||||
int saved = errno;
|
||||
pid_t me = (pid_t)call_orig_syscall(SYS_getpid, 0, 0, 0, 0, 0, 0);
|
||||
// past 64 reaped this way, the rest from /proc too
|
||||
int scan = 1;
|
||||
for (int i = 0; i < 64; i++) {
|
||||
siginfo_t si;
|
||||
memset(&si, 0, sizeof(si));
|
||||
if (call_orig_syscall(SYS_waitid, P_ALL, 0, (unsigned long)&si, WEXITED | WNOHANG | WNOWAIT, 0, 0) != 0 || si.si_pid <= 0) {
|
||||
scan = 0;
|
||||
break;
|
||||
}
|
||||
if (!ddh_reap_unwaited(me, si.si_pid)) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
int dir = scan ? (int)call_orig_syscall(SYS_openat, (unsigned long)AT_FDCWD, (unsigned long)"/proc",
|
||||
O_RDONLY | O_DIRECTORY | O_CLOEXEC, 0, 0, 0) : -1;
|
||||
char buf[2048];
|
||||
while (dir >= 0) {
|
||||
long n = call_orig_syscall(SYS_getdents64, (unsigned long)dir, (unsigned long)buf, sizeof(buf), 0, 0, 0);
|
||||
if (n <= 0) break;
|
||||
for (long off = 0; off < n;) {
|
||||
struct ddh_reap_dirent {
|
||||
uint64_t ino;
|
||||
int64_t off;
|
||||
unsigned short reclen;
|
||||
unsigned char type;
|
||||
char name[];
|
||||
} *d = (struct ddh_reap_dirent *)(buf + off);
|
||||
off += d->reclen;
|
||||
long pid = 0;
|
||||
const char *c = d->name;
|
||||
for (; *c >= '0' && *c <= '9'; c++) pid = pid * 10 + (*c - '0');
|
||||
if (!*c && pid > 0 && pid != me) ddh_reap_unwaited(me, (pid_t)pid);
|
||||
}
|
||||
}
|
||||
if (dir >= 0) call_orig_syscall(SYS_close, (unsigned long)dir, 0, 0, 0, 0, 0);
|
||||
errno = saved;
|
||||
}
|
||||
|
||||
// Takes e's exit for one waiter (EXITED to TAKEN): 0 when another waiter has it.
|
||||
static int ddh_take(struct ddh_entry *e) {
|
||||
int expected = DDH_EXITED;
|
||||
|
||||
@@ -339,6 +339,13 @@ __asm__(".globl setrlimit64\n" ".set setrlimit64, setrlimit\n");
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifndef CLONE_PIDFD
|
||||
#define CLONE_PIDFD 0x00001000
|
||||
#endif
|
||||
#ifndef P_PIDFD
|
||||
#define P_PIDFD 3
|
||||
#endif
|
||||
|
||||
#ifndef SECCOMP_SET_MODE_STRICT
|
||||
#define SECCOMP_SET_MODE_STRICT 0
|
||||
#endif
|
||||
@@ -639,6 +646,20 @@ long syscall(long number, ...) {
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __NR_clone
|
||||
if (number == __NR_clone && (arg1 & CLONE_PIDFD)) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __NR_waitid
|
||||
if (number == __NR_waitid && (int)arg1 == P_PIDFD) {
|
||||
errno = EINVAL;
|
||||
return -1;
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef __NR_clone3
|
||||
if (number == __NR_clone3) {
|
||||
errno = ENOSYS;
|
||||
|
||||
@@ -174,10 +174,83 @@ __attribute__((constructor(101))) static void install_sigsys_handler(void) {
|
||||
real_sig(SIGSYS, &sa, NULL);
|
||||
}
|
||||
|
||||
// SIGCHLD in a session with a parents file (handoff.c, DD_PARENTS): the program's action as it set it
|
||||
// runs from ddnatv_sigchld_handler(), which then reaps the children no wait will come for
|
||||
// (ddh_reap_unclaimed()). sigaction() shows the program its own action. A program that leaves SIGCHLD
|
||||
// alone gets the handler only when DD_REAP_ADOPTED names it: with a handler, poll(), sleep() and the
|
||||
// like return EINTR when a child exits, which a program that never had one may not expect.
|
||||
static struct sigaction g_app_sigchld;
|
||||
static int g_sigchld_managed;
|
||||
static int g_sigchld_on_default;
|
||||
|
||||
static void ddh_reap_unclaimed(void);
|
||||
static int ddh_listed(const char *list, const char *name, char *const argv[]);
|
||||
static int ddnatv_apply_sigchld(int (*real_sig)(int, const struct sigaction *, struct sigaction *));
|
||||
|
||||
static void ddnatv_sigchld_handler(int sig, siginfo_t *info, void *ctx) {
|
||||
struct sigaction app = g_app_sigchld;
|
||||
if (app.sa_handler != SIG_DFL && app.sa_handler != SIG_IGN) {
|
||||
if (app.sa_flags & SA_RESETHAND) {
|
||||
// as the kernel would: the default from now on, with the handler only for a named program
|
||||
g_app_sigchld.sa_handler = SIG_DFL;
|
||||
g_app_sigchld.sa_flags &= ~(SA_SIGINFO | SA_RESETHAND);
|
||||
int (*real_sig)(int, const struct sigaction *, struct sigaction *) = get_real_sigaction();
|
||||
int saved = errno;
|
||||
if (real_sig) ddnatv_apply_sigchld(real_sig);
|
||||
errno = saved;
|
||||
}
|
||||
if (app.sa_flags & SA_SIGINFO) app.sa_sigaction(sig, info, ctx);
|
||||
else app.sa_handler(sig);
|
||||
}
|
||||
ddh_reap_unclaimed();
|
||||
}
|
||||
|
||||
// Puts g_app_sigchld into effect: as it is where the kernel reaps every child itself (SIG_IGN,
|
||||
// SA_NOCLDWAIT) or the program wants no handler and is not named, else through the handler above.
|
||||
static int ddnatv_apply_sigchld(int (*real_sig)(int, const struct sigaction *, struct sigaction *)) {
|
||||
const struct sigaction *app = &g_app_sigchld;
|
||||
int handler = app->sa_handler != SIG_DFL && app->sa_handler != SIG_IGN;
|
||||
if (app->sa_handler == SIG_IGN || (app->sa_flags & SA_NOCLDWAIT) || (!handler && !g_sigchld_on_default))
|
||||
return real_sig(SIGCHLD, app, NULL);
|
||||
struct sigaction k;
|
||||
memset(&k, 0, sizeof(k));
|
||||
k.sa_sigaction = ddnatv_sigchld_handler;
|
||||
k.sa_mask = app->sa_mask;
|
||||
k.sa_flags = SA_SIGINFO | (handler ? (app->sa_flags & ~(SA_SIGINFO | SA_RESETHAND)) : (SA_RESTART | SA_NOCLDSTOP));
|
||||
return real_sig(SIGCHLD, &k, NULL);
|
||||
}
|
||||
|
||||
static int ddnatv_sigchld_action(int (*real_sig)(int, const struct sigaction *, struct sigaction *),
|
||||
const struct sigaction *act, struct sigaction *oldact) {
|
||||
struct sigaction prev = g_app_sigchld;
|
||||
if (act) {
|
||||
g_app_sigchld = *act;
|
||||
if (ddnatv_apply_sigchld(real_sig) != 0) {
|
||||
int err = errno;
|
||||
g_app_sigchld = prev;
|
||||
errno = err;
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
if (oldact) *oldact = prev;
|
||||
return 0;
|
||||
}
|
||||
|
||||
// From the hook's start (handoff.c), once the parents file is open
|
||||
static void ddnatv_manage_sigchld(void) {
|
||||
if (!getenv("DD_PARENTS")) return;
|
||||
int (*real_sig)(int, const struct sigaction *, struct sigaction *) = get_real_sigaction();
|
||||
if (!real_sig || real_sig(SIGCHLD, NULL, &g_app_sigchld) != 0) return;
|
||||
const char *named = getenv("DD_REAP_ADOPTED");
|
||||
g_sigchld_on_default = named && ddh_listed(named, program_invocation_short_name, NULL);
|
||||
if (ddnatv_apply_sigchld(real_sig) == 0) g_sigchld_managed = 1;
|
||||
}
|
||||
|
||||
int sigaction(int signum, const struct sigaction *act, struct sigaction *oldact) {
|
||||
int (*real_sig)(int, const struct sigaction *, struct sigaction *) = get_real_sigaction();
|
||||
if (!real_sig) return -1;
|
||||
|
||||
if (signum == SIGCHLD && g_sigchld_managed) return ddnatv_sigchld_action(real_sig, act, oldact);
|
||||
if (signum == SIGSYS) {
|
||||
if (act && act->sa_sigaction == ddnatv_sigsys_handler) {
|
||||
return real_sig(signum, act, oldact);
|
||||
@@ -192,6 +265,7 @@ int rt_sigaction(int signum, const struct sigaction *act, struct sigaction *olda
|
||||
static int (*orig_rt_sigaction)(int, const struct sigaction *, struct sigaction *, size_t) = NULL;
|
||||
if (!orig_rt_sigaction) orig_rt_sigaction = (int (*)(int, const struct sigaction *, struct sigaction *, size_t))dlsym(RTLD_NEXT, "rt_sigaction");
|
||||
|
||||
if (signum == SIGCHLD && g_sigchld_managed) return sigaction(signum, act, oldact);
|
||||
if (signum == SIGSYS) {
|
||||
if (act && act->sa_sigaction == ddnatv_sigsys_handler) {
|
||||
return orig_rt_sigaction ? orig_rt_sigaction(signum, act, oldact, sigsetsize) : 0;
|
||||
@@ -210,6 +284,16 @@ typedef void (*sighandler_t)(int);
|
||||
sighandler_t signal(int signum, sighandler_t handler) {
|
||||
static sighandler_t (*orig_signal)(int, sighandler_t) = NULL;
|
||||
if (!orig_signal) orig_signal = (sighandler_t (*)(int, sighandler_t))dlsym(RTLD_NEXT, "signal");
|
||||
if (signum == SIGCHLD && g_sigchld_managed) {
|
||||
// glibc's signal(): BSD semantics
|
||||
struct sigaction act, old;
|
||||
memset(&act, 0, sizeof(act));
|
||||
act.sa_handler = handler;
|
||||
act.sa_flags = SA_RESTART;
|
||||
sigemptyset(&act.sa_mask);
|
||||
sigaddset(&act.sa_mask, SIGCHLD);
|
||||
return sigaction(SIGCHLD, &act, &old) == 0 ? old.sa_handler : SIG_ERR;
|
||||
}
|
||||
if (signum == SIGSYS) {
|
||||
struct sigaction act, old;
|
||||
memset(&act, 0, sizeof(act));
|
||||
|
||||
@@ -7,37 +7,21 @@ MARK="<!-- droiddeck-pr-build -->"
|
||||
echo
|
||||
[ -f /tmp/pr-merge.md ] && cat /tmp/pr-merge.md
|
||||
echo
|
||||
case "$BUILD_OUTCOME:$UNIT_TEST_OUTCOME:$APK_OUTCOME" in
|
||||
success:success:success)
|
||||
case "$BUILD_OUTCOME:$APK_OUTCOME" in
|
||||
success:success)
|
||||
echo "### Build passed"
|
||||
echo
|
||||
echo "The \`droiddeck-apk\` artifact is [on this run]($RUN_URL), signed with the public test key."
|
||||
echo "The \`droiddeck-apk\` artifact is [on this run]($RUN_URL), signed with the public test key. Unit tests run in the separate **Unit tests** workflow and must pass before merging."
|
||||
echo
|
||||
echo "Same-repository PRs and PRs opened by contributors listed in \`.github/trusted-test-builds.txt\` are eligible for automatic release-signed test builds after the full build passes. Label the PR \`no-test-build\` to skip that."
|
||||
echo "Same-repository PRs and PRs opened by contributors listed in \`.github/trusted-test-builds.txt\` are eligible for automatic release-signed test builds once the APK compiles. Label the PR \`no-test-build\` to skip that."
|
||||
echo "For other PRs, a maintainer can add the \`publish-test\` label to request a signed build."
|
||||
echo
|
||||
echo "Fallback: [open **PR Release Publish**]($GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/workflows/pr-release-publish.yml) on \`main\` and enter PR \`$PR\`."
|
||||
;;
|
||||
success:success:*)
|
||||
success:*)
|
||||
echo "### APK publication incomplete"
|
||||
echo
|
||||
echo "Compilation and unit tests passed, but APK publication did not complete. See [the run]($RUN_URL)."
|
||||
;;
|
||||
success:failure:*)
|
||||
echo "### ERROR: Unit tests failed"
|
||||
echo
|
||||
echo "The APK compiled, but unit tests failed. No installable artifact was published."
|
||||
echo
|
||||
if [ -n "$TEST_DIAGNOSTICS_URL" ]; then
|
||||
echo "The [unit-test-results]($TEST_DIAGNOSTICS_URL) artifact contains the test log and any generated reports."
|
||||
else
|
||||
echo "The test diagnostics upload did not complete. See [the test log]($RUN_URL)."
|
||||
fi
|
||||
;;
|
||||
success:*)
|
||||
echo "### Build incomplete"
|
||||
echo
|
||||
echo "The APK compiled, but unit tests did not complete successfully. See [the run]($RUN_URL)."
|
||||
echo "Compilation passed, but APK publication did not complete. See [the run]($RUN_URL)."
|
||||
;;
|
||||
failure:*)
|
||||
echo "### ERROR: Build failed"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
#!/usr/bin/env python3
|
||||
import json
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
@@ -40,6 +41,39 @@ def compilation_state(run, jobs):
|
||||
return "failure" if run["status"] == "completed" else "pending"
|
||||
|
||||
|
||||
def run_state(run):
|
||||
if run["status"] != "completed":
|
||||
return "pending"
|
||||
return "success" if run["conclusion"] == "success" else "failure"
|
||||
|
||||
|
||||
def latest_run(repo, workflow, sha, source_event):
|
||||
query = urlencode({"head_sha": sha, "event": source_event, "per_page": 20})
|
||||
runs = api(f"repos/{repo}/actions/workflows/{workflow}/runs?{query}")["workflow_runs"]
|
||||
runs = [item for item in runs if item["head_sha"] == sha]
|
||||
return max(runs, key=lambda item: item["id"]) if runs else None
|
||||
|
||||
|
||||
def pull_request_run_base(run, sha):
|
||||
# A PR can reopen at the same head SHA after main advances. Do not mix results
|
||||
# from different event snapshots, even if both workflows individually passed.
|
||||
title = run.get("display_title") or ""
|
||||
match = re.search(rf" on {re.escape(sha)} against ([0-9a-f]{{40}})$", title)
|
||||
return match[1] if match else None
|
||||
|
||||
|
||||
def combined_state(build, tests):
|
||||
if build == "failure":
|
||||
return "failure", "APK compilation failed"
|
||||
if tests == "failure":
|
||||
return "failure", "Unit tests failed"
|
||||
if build == "pending":
|
||||
return "pending", "Source validated; awaiting APK compilation"
|
||||
if tests == "pending":
|
||||
return "pending", "APK compiled; awaiting unit tests"
|
||||
return "success", "Source validation, APK compilation and unit tests passed"
|
||||
|
||||
|
||||
def fetch_source(ref, sha):
|
||||
subprocess.run(["git", "fetch", "--no-tags", "origin", ref], check=True)
|
||||
fetched = subprocess.check_output(["git", "rev-parse", "FETCH_HEAD"], text=True).strip()
|
||||
@@ -123,19 +157,25 @@ def main():
|
||||
state = "success"
|
||||
description = "Source validated; no APK source changes"
|
||||
return
|
||||
query = urlencode({"head_sha": sha, "event": source_event, "per_page": 20})
|
||||
runs = api(f"repos/{repo}/actions/workflows/build.yml/runs?{query}")["workflow_runs"]
|
||||
runs = [item for item in runs if item["head_sha"] == sha]
|
||||
if runs:
|
||||
latest = max(runs, key=lambda item: item["id"])
|
||||
build_state = tests_state = "pending"
|
||||
latest = latest_run(repo, "build.yml", sha, source_event)
|
||||
if latest:
|
||||
jobs = api(f"repos/{repo}/actions/runs/{latest['id']}/jobs?per_page=100")["jobs"]
|
||||
state = compilation_state(latest, jobs)
|
||||
build_state = compilation_state(latest, jobs)
|
||||
target = latest["html_url"]
|
||||
else:
|
||||
state = "pending"
|
||||
description = {"pending": "Source validated; awaiting APK compilation",
|
||||
"success": "Source validation and APK compilation passed",
|
||||
"failure": "APK compilation failed"}[state]
|
||||
tests = latest_run(repo, "unit-tests.yml", sha, source_event)
|
||||
if tests:
|
||||
if pr and latest and build_state == "success":
|
||||
build_base = pull_request_run_base(latest, sha)
|
||||
tests_base = pull_request_run_base(tests, sha)
|
||||
if not build_base or build_base != tests_base:
|
||||
state = "pending"
|
||||
description = "APK and unit tests must run against the same main commit"
|
||||
return
|
||||
tests_state = run_state(tests)
|
||||
if tests_state == "failure" and build_state != "failure":
|
||||
target = tests["html_url"]
|
||||
state, description = combined_state(build_state, tests_state)
|
||||
finally:
|
||||
api(f"repos/{repo}/statuses/{sha}", "--method", "POST",
|
||||
"-f", "context=Build APK", "-f", f"state={state}",
|
||||
|
||||
@@ -25,7 +25,7 @@ class CiChecksTest(unittest.TestCase):
|
||||
self.assertIn("gitValue(['show', '-s', '--format=%ct', '--end-of-options', sourceCommit])", gradle)
|
||||
|
||||
def test_robolectric_cache_saves_and_restores_the_same_absolute_path(self):
|
||||
steps = yaml.safe_load((ROOT / '.github/workflows/build.yml').read_text())['jobs']['build']['steps']
|
||||
steps = yaml.safe_load((ROOT / '.github/workflows/unit-tests.yml').read_text())['jobs']['unit-tests']['steps']
|
||||
caches = [step['with'] for step in steps if step.get('uses', '').startswith('actions/cache')]
|
||||
for cache in caches:
|
||||
for path in cache['path'].split('\n'):
|
||||
@@ -34,13 +34,17 @@ class CiChecksTest(unittest.TestCase):
|
||||
self.assertEqual(robolectric, ['${{ steps.robolectric-jars.outputs.path }}'] * 2)
|
||||
|
||||
def test_unit_test_retry_requires_maven_exception(self):
|
||||
steps = yaml.safe_load((ROOT / '.github/workflows/build.yml').read_text())['jobs']['build']['steps']
|
||||
steps = yaml.safe_load((ROOT / '.github/workflows/unit-tests.yml').read_text())['jobs']['unit-tests']['steps']
|
||||
run = next(step['run'] for step in steps if step.get('id') == 'unit-tests')
|
||||
line = next(line for line in run.splitlines() if 'grep -Eq' in line)
|
||||
pattern = shlex.split(line)[shlex.split(line).index('-Eq') + 1]
|
||||
for log, expected in (
|
||||
("Caused by: org.gradle.internal.resource.transport.http.HttpErrorStatusCodeException: Could not GET 'https://repo.maven.apache.org/maven2/a.jar'. Received status code 429 from server: Too Many Requests", 0),
|
||||
("Caused by: java.io.IOException: Server returned HTTP response code: 429 for URL: https://repo.maven.apache.org/maven2/a.jar", 0),
|
||||
("Caused by: org.gradle.internal.resource.transport.http.HttpErrorStatusCodeException: Could not GET 'https://repo1.maven.org/maven2/a.jar'. Received status code 429 from server: Too Many Requests", 0),
|
||||
("Caused by: java.io.IOException: Server returned HTTP response code: 429 for URL: https://repo1.maven.org/maven2/a.pom.sha512", 0),
|
||||
("Caused by: java.io.IOException: Server returned HTTP response code: 429 for URL: https://example.org/a.jar", 1),
|
||||
("Caused by: java.io.IOException: Server returned HTTP response code: 500 for URL: https://repo1.maven.org/maven2/a.jar", 1),
|
||||
("SomeTest > test FAILED: Too Many Requests", 1),
|
||||
("Caused by: java.lang.AssertionError: HTTP 429", 1),
|
||||
):
|
||||
@@ -59,15 +63,46 @@ class CiChecksTest(unittest.TestCase):
|
||||
self.assertEqual(result.strip(), '2')
|
||||
|
||||
def test_build_and_tests_use_identical_generated_metadata(self):
|
||||
jobs = yaml.safe_load((ROOT / '.github/workflows/build.yml').read_text())['jobs']
|
||||
steps = {step.get('id'): step for step in jobs['build']['steps']}
|
||||
self.assertEqual(steps['build']['env'], steps['unit-tests']['env'])
|
||||
self.assertIn('DROIDDECK_BUILD_LABEL', steps['unit-tests']['env'])
|
||||
self.assertIn('SGDB_API_KEY', steps['unit-tests']['env'])
|
||||
build = {step.get('id'): step for step in
|
||||
yaml.safe_load((ROOT / '.github/workflows/build.yml').read_text())['jobs']['build']['steps']}
|
||||
tests = {step.get('id'): step for step in
|
||||
yaml.safe_load((ROOT / '.github/workflows/unit-tests.yml').read_text())['jobs']['unit-tests']['steps']}
|
||||
self.assertEqual(build['build']['env'], tests['unit-tests']['env'])
|
||||
self.assertIn('DROIDDECK_BUILD_LABEL', tests['unit-tests']['env'])
|
||||
self.assertIn('SGDB_API_KEY', tests['unit-tests']['env'])
|
||||
self.assertEqual(build['build-label'], tests['build-label'])
|
||||
gradle = (ROOT / 'app/build.gradle').read_text()
|
||||
self.assertIn("outputs.doNotCacheIf('CI executes the test suite on every run') { true }", gradle)
|
||||
self.assertIn('outputs.upToDateWhen { false }', gradle)
|
||||
|
||||
def test_unit_tests_do_not_hold_up_the_apk(self):
|
||||
build = yaml.safe_load((ROOT / '.github/workflows/build.yml').read_text())
|
||||
for step in build['jobs']['build']['steps']:
|
||||
self.assertNotIn('UnitTest', step.get('run', ''))
|
||||
tests = yaml.safe_load((ROOT / '.github/workflows/unit-tests.yml').read_text())
|
||||
for event in ('push', 'pull_request'):
|
||||
self.assertEqual(tests[True][event], build[True][event])
|
||||
authorship = yaml.safe_load((ROOT / '.github/workflows/authorship.yml').read_text())
|
||||
self.assertEqual(set(authorship[True]['workflow_run']['workflows']), {build['name'], tests['name']})
|
||||
self.assertIn('workflow_run.head_sha', authorship['concurrency']['group'])
|
||||
self.assertFalse(authorship['concurrency']['cancel-in-progress'])
|
||||
self.assertIn('unit-tests.yml', (ROOT / '.github/workflows/release.yml').read_text())
|
||||
run = next(step['run'] for step in tests['jobs']['unit-tests']['steps'] if step.get('id') == 'unit-tests')
|
||||
self.assertIn('-PunitTestsOnly=true', run)
|
||||
|
||||
def test_apk_and_unit_tests_pin_the_same_pr_event_base(self):
|
||||
for filename, job, name in (
|
||||
("build.yml", "source", "Pin and merge the APK source"),
|
||||
("unit-tests.yml", "unit-tests", "Merge the pinned APK base"),
|
||||
):
|
||||
with self.subTest(workflow=filename):
|
||||
workflow = yaml.safe_load((ROOT / ".github/workflows" / filename).read_text())
|
||||
step = next(step for step in workflow["jobs"][job]["steps"] if step.get("name") == name)
|
||||
self.assertEqual(step["env"]["PR_BASE_SHA"], "${{ github.event.pull_request.base.sha }}")
|
||||
self.assertIn('git fetch --no-tags origin "$PR_BASE_SHA"', step["run"])
|
||||
self.assertIn("git merge --no-ff --no-edit FETCH_HEAD", step["run"])
|
||||
self.assertIn("github.event.pull_request.base.sha", workflow["run-name"])
|
||||
|
||||
def test_independent_jobs_wait_only_for_the_pinned_source(self):
|
||||
jobs = yaml.safe_load((ROOT / '.github/workflows/build.yml').read_text())['jobs']
|
||||
for name in ('xbox', 'python-tests', 'components-runner'):
|
||||
|
||||
@@ -1025,6 +1025,19 @@ int main(int argc, char **argv) {
|
||||
errno = 0;
|
||||
printf("intmin\t%d\n", (int)waitpid(-2147483647 - 1, &status, WNOHANG) == -1 && errno == ESRCH);
|
||||
}
|
||||
if (strcmp(argv[1], "nowait") == 0) {
|
||||
// no wait until the program has long exited, as Plasma's shell never waits for what it launches
|
||||
usleep(2000000);
|
||||
char path[64], line[256] = "";
|
||||
snprintf(path, sizeof(path), "/proc/%d/stat", (int)pid);
|
||||
FILE *f = fopen(path, "r");
|
||||
if (f) {
|
||||
if (!fgets(line, sizeof(line), f)) line[0] = 0;
|
||||
fclose(f);
|
||||
}
|
||||
char *s = strrchr(line, ')');
|
||||
printf("zombie\t%d\n", s && s[1] == ' ' && s[2] == 'Z');
|
||||
}
|
||||
int group = strcmp(argv[1], "group") == 0;
|
||||
if (group) {
|
||||
setpgid(pid, pid);
|
||||
@@ -1111,6 +1124,121 @@ int main(void) {
|
||||
# A worker's program with its table at fd 1000 (kept, as 900 and 901 are): a dup2() onto the pidfd
|
||||
# lets go of 900 while another thread's close_range(899, 2000) is between its parts, held there by the
|
||||
# hook's test gate. The kept fds above 900 stay open.
|
||||
PIDFD_PROBE = r"""
|
||||
#define _GNU_SOURCE
|
||||
#include <errno.h>
|
||||
#include <limits.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <sys/syscall.h>
|
||||
#include <sys/wait.h>
|
||||
#include <unistd.h>
|
||||
|
||||
int main(void) {
|
||||
errno = 0;
|
||||
long r = syscall(SYS_waitid, 3, INT_MAX, NULL, WEXITED | WNOHANG, NULL);
|
||||
printf("waitid\t%ld %d\n", r, errno);
|
||||
int pidfd = -1;
|
||||
errno = 0;
|
||||
r = syscall(SYS_clone, 0x00001000 | SIGCHLD, NULL, &pidfd, NULL, 0);
|
||||
if (r == 0) _exit(9);
|
||||
printf("clone\t%ld %d %d\n", r < 0 ? -1L : 1L, errno, pidfd);
|
||||
if (r > 0) waitpid((pid_t)r, NULL, 0);
|
||||
r = syscall(SYS_clone, SIGCHLD, NULL, NULL, NULL, 0);
|
||||
if (r == 0) _exit(7);
|
||||
int status = 0;
|
||||
printf("fork\t%d\n", r > 0 && waitpid((pid_t)r, &status, 0) == r && WIFEXITED(status) ? WEXITSTATUS(status) : -1);
|
||||
return 0;
|
||||
}
|
||||
"""
|
||||
|
||||
# A child subreaper, as every session process is (preload/subreaper.c), that never waits for a child
|
||||
# it did not fork. adopt: a child that exits at once leaves a grandchild, which exits once the child is
|
||||
# gone; own: its own child, which it waits for only later; vfork: one vfork() made, its program static
|
||||
# (no hook, so no record of it); handler: as adopt, with a SIGCHLD handler of its own; ignore: SIGCHLD
|
||||
# ignored, so the kernel reaps.
|
||||
ORPHANS = r"""
|
||||
#define _GNU_SOURCE
|
||||
#include <errno.h>
|
||||
#include <signal.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <sys/prctl.h>
|
||||
#include <sys/wait.h>
|
||||
#include <time.h>
|
||||
#include <unistd.h>
|
||||
|
||||
static volatile sig_atomic_t calls;
|
||||
static void counted(int sig) { (void)sig; calls++; }
|
||||
|
||||
static void nap(long ms) {
|
||||
struct timespec t = {ms / 1000, (ms % 1000) * 1000000L};
|
||||
while (nanosleep(&t, &t) != 0 && errno == EINTR) {}
|
||||
}
|
||||
|
||||
static int zombie(pid_t pid) {
|
||||
char path[64], line[256] = "";
|
||||
snprintf(path, sizeof(path), "/proc/%d/stat", (int)pid);
|
||||
FILE *f = fopen(path, "r");
|
||||
if (!f) return 0;
|
||||
if (!fgets(line, sizeof(line), f)) line[0] = 0;
|
||||
fclose(f);
|
||||
char *s = strrchr(line, ')');
|
||||
return s && s[1] == ' ' && s[2] == 'Z';
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
const char *mode = argv[1];
|
||||
int subreaper = 0;
|
||||
printf("subreaper\t%d\n", prctl(PR_SET_CHILD_SUBREAPER, 1) == 0 && prctl(PR_GET_CHILD_SUBREAPER, &subreaper) == 0 && subreaper);
|
||||
fflush(stdout);
|
||||
if (strcmp(mode, "handler") == 0) {
|
||||
struct sigaction sa, seen;
|
||||
memset(&sa, 0, sizeof(sa));
|
||||
sa.sa_handler = counted;
|
||||
sa.sa_flags = SA_RESTART;
|
||||
sigaction(SIGCHLD, &sa, NULL);
|
||||
sigaction(SIGCHLD, NULL, &seen);
|
||||
printf("view\t%d\n", seen.sa_handler == counted);
|
||||
}
|
||||
if (strcmp(mode, "ignore") == 0) signal(SIGCHLD, SIG_IGN);
|
||||
if (strcmp(mode, "own") == 0 || strcmp(mode, "vfork") == 0) {
|
||||
pid_t child = strcmp(mode, "vfork") == 0 ? vfork() : fork();
|
||||
if (child == 0) {
|
||||
if (argc > 2) execl(argv[2], "target", "7", (char *)NULL);
|
||||
_exit(7);
|
||||
}
|
||||
nap(1500);
|
||||
int status = 0;
|
||||
pid_t r = waitpid(child, &status, 0);
|
||||
printf("own\t%d\n", r == child && WIFEXITED(status) ? WEXITSTATUS(status) : -1);
|
||||
return 0;
|
||||
}
|
||||
int pipefd[2];
|
||||
if (pipe(pipefd) != 0) return 1;
|
||||
pid_t middle = fork();
|
||||
if (middle == 0) {
|
||||
pid_t grandchild = fork();
|
||||
if (grandchild == 0) {
|
||||
nap(300); // its parent is gone by then
|
||||
_exit(5);
|
||||
}
|
||||
if (write(pipefd[1], &grandchild, sizeof(grandchild)) != sizeof(grandchild)) _exit(1);
|
||||
_exit(0);
|
||||
}
|
||||
pid_t grandchild = 0;
|
||||
if (read(pipefd[0], &grandchild, sizeof(grandchild)) != sizeof(grandchild)) return 1;
|
||||
int status = 0;
|
||||
printf("middle\t%d\n", waitpid(middle, &status, 0) == middle);
|
||||
nap(1500);
|
||||
printf("orphan\t%d\n", zombie(grandchild));
|
||||
printf("adopted\t%d\n", waitpid(grandchild, &status, WNOHANG) == grandchild);
|
||||
if (strcmp(mode, "handler") == 0) printf("calls\t%d\n", calls > 0);
|
||||
return 0;
|
||||
}
|
||||
"""
|
||||
|
||||
DUPRACE = r"""
|
||||
#define _GNU_SOURCE
|
||||
#include <fcntl.h>
|
||||
@@ -1452,7 +1580,7 @@ class NativeHookHandoffTest(unittest.TestCase):
|
||||
raise RuntimeError("workers that may still run: %s" % failed)
|
||||
|
||||
def run_parent(self, *argv, handoff="target", hook=True, reports=True, pressure=None, as_shell=False, terminal=False,
|
||||
delay=0, extra_env=None):
|
||||
delay=0, extra_env=None, parent_name=None):
|
||||
name = "dd-handoff-test-%d-%s-%s-%d" % (os.getpid(), self.id().rsplit(".", 1)[-1], handoff, hook)
|
||||
spawner = FakeSpawner(name, self.prefix or [], self.root, reports, delay)
|
||||
spawner.start()
|
||||
@@ -1468,9 +1596,9 @@ class NativeHookHandoffTest(unittest.TestCase):
|
||||
hook_env["QEMU_LD_PREFIX"] = self.prefix[self.prefix.index("-L") + 1]
|
||||
env = {k: v for k, v in os.environ.items() if k not in hook_env}
|
||||
prefix, parent = list(self.prefix or []), str(self.parent)
|
||||
if as_shell:
|
||||
# the hook tells a shell's child by its parent's name (qemu-user takes the program's)
|
||||
shell = Path(self.tmp.name) / ("shell-%s" % self.id().rsplit(".", 1)[-1]) / "bash"
|
||||
if as_shell or parent_name:
|
||||
# the hook tells a shell's or a launcher's child by its parent's name (qemu-user takes the program's)
|
||||
shell = Path(self.tmp.name) / ("shell-%s" % self.id().rsplit(".", 1)[-1]) / (parent_name or "bash")
|
||||
shell.parent.mkdir(exist_ok=True)
|
||||
shutil.copy(parent, shell)
|
||||
parent = str(shell)
|
||||
@@ -1679,6 +1807,41 @@ class NativeHookHandoffTest(unittest.TestCase):
|
||||
self.assertEqual([], requests)
|
||||
self.assertEqual(self.child_status, result.get("exit"), out.stdout)
|
||||
|
||||
def run_launcher(self, *argv, parent_name="plasmashell", **kwargs):
|
||||
return self.run_parent(*argv, handoff="other", pressure=1000, parent_name=parent_name,
|
||||
extra_env={"DD_HANDOFF_LAUNCHERS": "plasmashell:krunner"}, **kwargs)
|
||||
|
||||
def test_a_program_a_desktop_launcher_starts_is_handed_off(self):
|
||||
# an app from Plasma's panel: unlisted, far from the limit, still its own app process
|
||||
result, requests, out = self.run_launcher("wait", "7")
|
||||
self.assertEqual(1, len(requests), out.stderr)
|
||||
self.assertEqual(["target", "7"], requests[0]["argv"])
|
||||
self.assertEqual("7", result.get("exit"), out.stdout)
|
||||
|
||||
def test_a_child_of_a_program_not_named_a_launcher_is_not(self):
|
||||
result, requests, out = self.run_launcher("wait", "3", parent_name="konsole")
|
||||
self.assertEqual([], requests, out.stderr)
|
||||
self.assertEqual(self.child_status, result.get("exit"), out.stdout)
|
||||
|
||||
def test_a_launchers_child_in_a_process_group_of_its_own_is_not(self):
|
||||
result, requests, out = self.run_launcher("group", "4")
|
||||
self.assertEqual([], requests, out.stderr)
|
||||
self.assertEqual("4" if self.child_status == "3" else "127", result.get("exit"), out.stdout)
|
||||
|
||||
def test_a_launchers_child_on_a_terminal_is_not(self):
|
||||
# a terminal's shell, set up by its launcher (Konsole's part in Dolphin): the terminal is its own
|
||||
result, requests, out = self.run_launcher("wait", "3", terminal=True)
|
||||
self.assertEqual([], requests, out.stderr)
|
||||
self.assertEqual(self.child_status, result.get("exit"), out.stdout)
|
||||
|
||||
def test_the_steam_client_a_launcher_starts_is_not(self):
|
||||
steam = self.root / "bin/steam"
|
||||
if not steam.exists():
|
||||
shutil.copy(self.root / "bin/target", steam)
|
||||
result, requests, out = self.run_launcher("wait", "3", "/bin/steam")
|
||||
self.assertEqual([], requests, out.stderr)
|
||||
self.assertEqual(self.child_status, result.get("exit"), out.stdout)
|
||||
|
||||
def test_near_the_limit_a_child_of_another_program_is_not(self):
|
||||
result, requests, out = self.run_parent("wait", "3", handoff="other", pressure=0)
|
||||
self.assertEqual([], requests)
|
||||
@@ -2217,6 +2380,86 @@ class NativeHookHandoffTest(unittest.TestCase):
|
||||
pass_fds=(table,))
|
||||
return parent, dict(line.split("\t", 1) for line in out.stdout.splitlines() if "\t" in line), out
|
||||
|
||||
def run_orphans(self, mode, named=True, parents=True, *args):
|
||||
tmp = Path(self.tmp.name)
|
||||
probe = tmp / "orphans"
|
||||
if not probe.exists():
|
||||
(tmp / "orphans.c").write_text(ORPHANS)
|
||||
subprocess.run([self.cc, "-O1", "-o", str(probe), str(tmp / "orphans.c")], check=True)
|
||||
(self.root / "run").mkdir(exist_ok=True)
|
||||
env = {"LD_PRELOAD": str(self.hook), "DDNATV_ROOT": str(self.root)}
|
||||
if parents:
|
||||
env["DD_PARENTS"] = "/run/parents-%s" % self.id().rsplit(".", 1)[-1]
|
||||
if named:
|
||||
env["DD_REAP_ADOPTED"] = "other:orphans"
|
||||
# not a session's own settings, when run inside one
|
||||
inherited = {k: v for k, v in os.environ.items() if k not in ("DD_PARENTS", "DD_REAP_ADOPTED")}
|
||||
if self.prefix:
|
||||
cmd = list(self.prefix) + [arg for key, value in env.items() for arg in ("-E", f"{key}={value}")]
|
||||
run_env = inherited
|
||||
else:
|
||||
cmd = []
|
||||
run_env = dict(inherited, **env)
|
||||
out = subprocess.run(cmd + [str(probe), mode, *args], env=run_env, capture_output=True, text=True, timeout=60)
|
||||
result = dict(line.split("\t", 1) for line in out.stdout.splitlines() if "\t" in line)
|
||||
if mode == "adopt" and result.get("subreaper") != "1":
|
||||
self.skipTest("no child subreaper here (qemu-user has no PR_SET_CHILD_SUBREAPER)")
|
||||
return result, out
|
||||
|
||||
def test_a_subreaper_reaps_the_zombie_it_adopted(self):
|
||||
result, out = self.run_orphans("adopt")
|
||||
self.assertEqual(0, out.returncode, out.stderr)
|
||||
self.assertEqual("1", result.get("middle"), out.stdout)
|
||||
self.assertEqual("0", result.get("orphan"), out.stdout + out.stderr)
|
||||
self.assertEqual("0", result.get("adopted"), out.stdout)
|
||||
|
||||
def test_a_program_not_named_keeps_its_default_sigchld_and_its_adopted_zombie(self):
|
||||
result, out = self.run_orphans("adopt", False)
|
||||
self.assertEqual("1", result.get("orphan"), out.stdout + out.stderr)
|
||||
self.assertEqual("1", result.get("adopted"), out.stdout)
|
||||
|
||||
def test_without_a_parents_file_nothing_is_reaped(self):
|
||||
result, out = self.run_orphans("adopt", True, False)
|
||||
self.assertEqual("1", result.get("orphan"), out.stdout + out.stderr)
|
||||
|
||||
def test_a_subreapers_own_child_waits_for_its_wait(self):
|
||||
result, out = self.run_orphans("own")
|
||||
self.assertEqual("7", result.get("own"), out.stdout + out.stderr)
|
||||
|
||||
def test_a_vfork_child_with_no_record_waits_for_its_parents_wait(self):
|
||||
result, out = self.run_orphans("vfork", True, True, "/bin/target")
|
||||
self.assertEqual("7", result.get("own"), out.stdout + out.stderr)
|
||||
|
||||
def test_a_programs_own_sigchld_handler_runs_and_shows_as_its_own(self):
|
||||
result, out = self.run_orphans("handler", False)
|
||||
self.assertEqual("1", result.get("view"), out.stdout + out.stderr)
|
||||
self.assertEqual("1", result.get("calls"), out.stdout)
|
||||
if result.get("subreaper") == "1":
|
||||
self.assertEqual("0", result.get("orphan"), out.stdout)
|
||||
|
||||
def test_an_ignored_sigchld_stays_the_kernels(self):
|
||||
result, out = self.run_orphans("ignore")
|
||||
self.assertEqual(0, out.returncode, out.stderr)
|
||||
self.assertEqual("0", result.get("orphan"), out.stdout + out.stderr)
|
||||
|
||||
def test_an_unwaited_handoffs_child_is_reaped(self):
|
||||
# a parent that never waits until its program has long exited, as Plasma's shell
|
||||
(self.root / "run").mkdir(exist_ok=True)
|
||||
env = {"DD_PARENTS": "/run/parents-nowait", "DD_REAP_ADOPTED": "parent"}
|
||||
result, requests, out = self.run_parent("nowait", "6", extra_env=env)
|
||||
self.assertEqual(1, len(requests), out.stderr)
|
||||
self.assertEqual("0", result.get("zombie"), out.stdout + out.stderr)
|
||||
# its program's exit, still there for the wait that comes at last
|
||||
self.assertEqual("1", result.get("same"), out.stdout)
|
||||
self.assertEqual("6", result.get("exit"), out.stdout)
|
||||
|
||||
def test_a_guest_sees_no_pidfd_support_so_its_waits_go_through_the_handoff(self):
|
||||
parent, result, out = self.run_worker_program("pidfd", PIDFD_PROBE)
|
||||
self.assertEqual(0, out.returncode, out.stderr)
|
||||
self.assertEqual("-1 %d" % errno.EINVAL, result.get("waitid"), out.stdout + out.stderr)
|
||||
self.assertEqual("-1 %d -1" % errno.EINVAL, result.get("clone"), out.stdout)
|
||||
self.assertEqual("7", result.get("fork"), out.stdout)
|
||||
|
||||
def test_a_dup2_onto_the_parents_pidfd_while_a_close_range_runs_closes_no_kept_fd(self):
|
||||
parent, result, out = self.run_worker_program("duprace", DUPRACE, table_fd=1000)
|
||||
self.assertEqual(0, out.returncode, out.stderr)
|
||||
|
||||
@@ -28,7 +28,7 @@ class ValidateApkTest(unittest.TestCase):
|
||||
def git(self, *args):
|
||||
return subprocess.check_output(["git", "-C", self.root, *args], text=True).strip()
|
||||
|
||||
def validate(self, message="Source change", body="", result="success", stale=False, completed=False, filename="source.kt", permission="write", role_name="write", fork=False):
|
||||
def validate(self, message="Source change", body="", result="success", stale=False, completed=False, filename="source.kt", permission="write", role_name="write", fork=False, tests="success", build_base="a" * 40, tests_base="a" * 40):
|
||||
(self.root / filename).parent.mkdir(parents=True, exist_ok=True)
|
||||
(self.root / filename).write_text(message)
|
||||
self.git("add", filename)
|
||||
@@ -56,7 +56,16 @@ class ValidateApkTest(unittest.TestCase):
|
||||
if path.endswith("/pulls?state=open&head=contributor%3Afix%2Fbranch"):
|
||||
return [pr]
|
||||
if "workflows/build.yml/runs?" in path:
|
||||
return {"workflow_runs": [{"id": 7, "head_sha": sha, "status": "completed", "html_url": "https://example.org/build"}]}
|
||||
title = f"building pr 1 on {sha}" + (f" against {build_base}" if build_base else "")
|
||||
return {"workflow_runs": [{"id": 7, "head_sha": sha, "status": "completed",
|
||||
"display_title": title, "html_url": "https://example.org/build"}]}
|
||||
if "workflows/unit-tests.yml/runs?" in path:
|
||||
if tests is None:
|
||||
return {"workflow_runs": []}
|
||||
title = f"unit tests for pr 1 on {sha}" + (f" against {tests_base}" if tests_base else "")
|
||||
return {"workflow_runs": [{"id": 9, "head_sha": sha, "html_url": "https://example.org/tests",
|
||||
"display_title": title, "status": "in_progress" if tests == "pending" else "completed",
|
||||
"conclusion": None if tests == "pending" else tests}]}
|
||||
if path.endswith("/jobs?per_page=100"):
|
||||
return {"jobs": [{"name": "Compile and test APK", "status": "in_progress" if result == "pending" else "completed", "conclusion": result}]}
|
||||
raise AssertionError(path)
|
||||
@@ -85,6 +94,25 @@ class ValidateApkTest(unittest.TestCase):
|
||||
self.validate(result=result)
|
||||
self.assertEqual(self.statuses[-1]["state"], result)
|
||||
|
||||
def test_unit_tests_must_pass_too(self):
|
||||
for tests, state in (("pending", "pending"), (None, "pending"), ("failure", "failure"), ("cancelled", "failure")):
|
||||
with self.subTest(tests=tests):
|
||||
self.validate(tests=tests)
|
||||
self.assertEqual(self.statuses[-1]["state"], state)
|
||||
self.assertEqual(self.statuses[-1]["target_url"], "https://example.org/tests")
|
||||
|
||||
def test_successful_runs_must_use_the_same_pr_base(self):
|
||||
for build_base, tests_base in (("a" * 40, "b" * 40), ("a" * 40, None), (None, "a" * 40)):
|
||||
with self.subTest(build_base=build_base, tests_base=tests_base):
|
||||
self.validate(build_base=build_base, tests_base=tests_base)
|
||||
self.assertEqual(self.statuses[-1]["state"], "pending")
|
||||
self.assertIn("same main commit", self.statuses[-1]["description"])
|
||||
|
||||
def test_a_compile_failure_is_reported_before_test_results(self):
|
||||
self.validate(result="failure", tests="failure")
|
||||
self.assertEqual(self.statuses[-1]["description"], "APK compilation failed")
|
||||
self.assertEqual(self.statuses[-1]["target_url"], "https://example.org/build")
|
||||
|
||||
def test_superseded_event_cannot_replace_current_status(self):
|
||||
self.validate(stale=True)
|
||||
self.assertEqual(self.statuses, [])
|
||||
|
||||
@@ -11,8 +11,10 @@ class XboxBuildSourceTest(unittest.TestCase):
|
||||
import yaml
|
||||
except ImportError:
|
||||
self.fail('PyYAML is required to execute workflow steps')
|
||||
workflow = yaml.safe_load((Path(__file__).resolve().parents[2] / '.github/workflows/build.yml').read_text())
|
||||
jobs = workflow['jobs']
|
||||
workflows = Path(__file__).resolve().parents[2] / '.github/workflows'
|
||||
jobs = yaml.safe_load((workflows / 'build.yml').read_text())['jobs']
|
||||
unit_jobs = yaml.safe_load((workflows / 'unit-tests.yml').read_text())['jobs']
|
||||
jobs.update(unit_jobs)
|
||||
step = lambda job, name: next(s['run'] for s in jobs[job]['steps'] if s.get('name') == name)
|
||||
with tempfile.TemporaryDirectory() as directory:
|
||||
root = Path(directory)
|
||||
@@ -31,13 +33,17 @@ class XboxBuildSourceTest(unittest.TestCase):
|
||||
git('switch', '-q', 'main')
|
||||
(root / 'backend').write_text('merged backend')
|
||||
git('commit', '-qam', 'backend changed after branch')
|
||||
for name in ('source', 'xbox', 'components', 'apk', 'tests', 'dispatch'):
|
||||
event_base = git('rev-parse', 'HEAD')
|
||||
for name in ('source', 'xbox', 'components', 'apk', 'tests', 'unit-tests', 'dispatch'):
|
||||
git('clone', '-q', str(root), str(root / name))
|
||||
git('checkout', '-q', head, cwd=root / name)
|
||||
output = root / 'output'
|
||||
env['GITHUB_OUTPUT'] = str(output)
|
||||
env.update(GITHUB_OUTPUT=str(output), PR_BASE_SHA=event_base)
|
||||
(root / 'backend').write_text('newer main, after PR event')
|
||||
git('commit', '-qam', 'main advanced before source pinning')
|
||||
subprocess.run(['bash', '-c', step('source', 'Pin and merge the APK source')], cwd=root / 'source', env=env, check=True, capture_output=True)
|
||||
base = output.read_text().strip().split('=', 1)[1]
|
||||
self.assertEqual(base, event_base)
|
||||
tree = git('rev-parse', 'HEAD^{tree}', cwd=root / 'source')
|
||||
(root / 'backend').write_text('newer main, after backend build')
|
||||
git('commit', '-qam', 'main advanced again')
|
||||
@@ -51,6 +57,10 @@ class XboxBuildSourceTest(unittest.TestCase):
|
||||
subprocess.run(['bash', '-c', step('python-tests', 'Verify backend and test source match')], cwd=root / 'tests', env=env, check=True, capture_output=True)
|
||||
self.assertEqual(git('rev-parse', 'HEAD^{tree}', cwd=root / 'tests'), tree)
|
||||
|
||||
subprocess.run(['bash', '-c', step('unit-tests', 'Merge the pinned APK base')], cwd=root / 'unit-tests', env=env, check=True, capture_output=True)
|
||||
self.assertEqual((root / 'unit-tests/backend').read_text(), 'merged backend')
|
||||
self.assertEqual(git('rev-parse', 'HEAD^{tree}', cwd=root / 'unit-tests'), tree)
|
||||
|
||||
env['SOURCE_TREE'] = tree
|
||||
for job in ('xbox', 'components'):
|
||||
subprocess.run(['bash', '-c', step(job, 'Merge the pinned APK base')], cwd=root / job, env=env, check=True, capture_output=True)
|
||||
|
||||
Reference in new issue
Block a user