Skip to content

Commit 999e450

Browse files
committed
Merge remote-tracking branch 'upstream/main'
2 parents 72cb659 + b690b0f commit 999e450

30 files changed

Lines changed: 504 additions & 172 deletions

‎.github/workflows/instrumented-tests.yml‎

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,60 @@ concurrency:
1313
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
1414

1515
jobs:
16+
changes:
17+
name: Detect instrumented test changes
18+
if: github.event_name == 'pull_request'
19+
runs-on: ubuntu-latest
20+
timeout-minutes: 5
21+
permissions:
22+
contents: read
23+
outputs:
24+
run: ${{ steps.filter.outputs.run }}
25+
steps:
26+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
27+
with:
28+
fetch-depth: 2 # PR merge commit and both parents
29+
persist-credentials: false
30+
31+
- name: Match changed files
32+
id: filter
33+
shell: bash
34+
env:
35+
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
36+
PATTERNS: |
37+
src/main/*
38+
# Translations: the emulator runs in English.
39+
!src/main/res/values-*/strings.xml
40+
!src/main/assets/help/*
41+
src/main/assets/help/en/*
42+
src/foss/*
43+
src/fossDebug/*
44+
src/androidTest/*
45+
jni/deltachat-core-rust
46+
jni/Android.mk
47+
jni/Application.mk
48+
jni/dc_wrapper.c
49+
scripts/ndk-make.sh
50+
scripts/install-toolchains.sh
51+
scripts/rust-toolchain
52+
scripts/ci-emulator-settle.sh
53+
scripts/ci-changed-files.sh
54+
*.gradle
55+
gradle.properties
56+
gradle/*
57+
.github/workflows/instrumented-tests.yml
58+
run: |
59+
if [ "$(git rev-parse HEAD^2)" != "$PR_HEAD_SHA" ]; then
60+
echo "::error::HEAD is not the expected PR merge commit"
61+
exit 1
62+
fi
63+
run=$(bash scripts/ci-changed-files.sh HEAD^1 HEAD <<< "$PATTERNS")
64+
echo "run=$run" >> "$GITHUB_OUTPUT"
65+
1666
instrumented-tests:
1767
name: Run instrumented tests
68+
needs: changes
69+
if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.run == 'true') }}
1870
runs-on: ubuntu-latest
1971
timeout-minutes: 90
2072
permissions:
@@ -24,6 +76,7 @@ jobs:
2476
EMU_TARGET: google_apis
2577
EMU_ARCH: x86_64
2678
EMU_PROFILE: pixel_10
79+
EMU_CORES: '4'
2780
outputs:
2881
results-url: ${{ steps.upload-results.outputs.artifact-url }}
2982
steps:
@@ -112,7 +165,7 @@ jobs:
112165
path: |
113166
~/.android/avd/*
114167
~/.android/adb*
115-
key: avd-${{ env.EMU_API_LEVEL }}-${{ env.EMU_TARGET }}-${{ env.EMU_ARCH }}-${{ env.EMU_PROFILE }}-v1
168+
key: avd-${{ env.EMU_API_LEVEL }}-${{ env.EMU_TARGET }}-${{ env.EMU_ARCH }}-${{ env.EMU_PROFILE }}-v2
116169

117170
- name: Create AVD and generate snapshot
118171
if: steps.avd-cache.outputs.cache-hit != 'true'
@@ -122,10 +175,11 @@ jobs:
122175
target: ${{ env.EMU_TARGET }}
123176
arch: ${{ env.EMU_ARCH }}
124177
profile: ${{ env.EMU_PROFILE }}
178+
cores: ${{ env.EMU_CORES }}
125179
force-avd-creation: false
126180
emulator-options: -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
127181
disable-animations: false
128-
script: echo "Generated AVD snapshot for caching."
182+
script: bash scripts/ci-emulator-settle.sh --dexopt
129183

130184
- name: Save AVD snapshot
131185
if: steps.avd-cache.outputs.cache-hit != 'true' && github.ref == 'refs/heads/main'
@@ -143,6 +197,7 @@ jobs:
143197
target: ${{ env.EMU_TARGET }}
144198
arch: ${{ env.EMU_ARCH }}
145199
profile: ${{ env.EMU_PROFILE }}
200+
cores: ${{ env.EMU_CORES }}
146201
force-avd-creation: false
147202
emulator-options: -no-snapshot-save -no-window -gpu swiftshader_indirect -noaudio -no-boot-anim -camera-back none
148203
disable-animations: true

‎.github/workflows/unit-tests.yml‎

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,47 @@ concurrency:
1212
cancel-in-progress: ${{ github.ref != 'refs/heads/main' }}
1313

1414
jobs:
15+
changes:
16+
name: Detect unit test changes
17+
if: github.event_name == 'pull_request'
18+
runs-on: ubuntu-latest
19+
timeout-minutes: 5
20+
permissions:
21+
contents: read
22+
outputs:
23+
run: ${{ steps.filter.outputs.run }}
24+
steps:
25+
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
with:
27+
fetch-depth: 2 # PR merge commit and both parents
28+
persist-credentials: false
29+
30+
- name: Match changed files
31+
id: filter
32+
shell: bash
33+
env:
34+
PR_HEAD_SHA: ${{ github.event.pull_request.head.sha }}
35+
PATTERNS: |
36+
src/main/java/*
37+
src/foss/java/*
38+
src/test/*
39+
*.gradle
40+
gradle.properties
41+
gradle/*
42+
scripts/ci-changed-files.sh
43+
.github/workflows/unit-tests.yml
44+
run: |
45+
if [ "$(git rev-parse HEAD^2)" != "$PR_HEAD_SHA" ]; then
46+
echo "::error::HEAD is not the expected PR merge commit"
47+
exit 1
48+
fi
49+
run=$(bash scripts/ci-changed-files.sh HEAD^1 HEAD <<< "$PATTERNS")
50+
echo "run=$run" >> "$GITHUB_OUTPUT"
51+
1552
unit-tests:
1653
name: Run unit tests
54+
needs: changes
55+
if: ${{ !cancelled() && (needs.changes.result != 'success' || needs.changes.outputs.run == 'true') }}
1756
runs-on: ubuntu-latest
1857
permissions:
1958
contents: read

‎CHANGELOG-upstream.md‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,14 @@
22

33
## Unreleased
44

5+
* Enable screen security by default to protect against leaking messages to AI assistants
6+
* Improve registration screen
7+
* Improve display of mini-apps in pinned messages banner
8+
* Replace "Me" with "You" for self-contact in chat summary, media viewer, contact list, etc
9+
* Disable high-pitch "BEEP!!!" sound when scanning QR
510
* Fix: avoid crashes for some notifications if the contact is unnamed
611
* Fix: don't say "set for everyone" when changing disappearing messages timer in "Saved Messages" chat
12+
* Message details now open in a clean, scrollable bottom sheet
713

814
## v2.69.0
915
2026-11

‎scripts/ci-changed-files.sh‎

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
#!/usr/bin/env bash
2+
# Prints "true" if any file changed between revisions matches the patterns
3+
# read from stdin.
4+
#
5+
# Usage: ci-changed-files.sh <git-diff-revisions...> < patterns
6+
# CI: ci-changed-files.sh HEAD^1 HEAD
7+
# Local: ci-changed-files.sh origin/main...HEAD
8+
#
9+
# Patterns work like GitHub on.<event>.paths: evaluated in order, a leading "!"
10+
# excludes, the last match wins.
11+
# Unlike GitHub, "*" also matches "/", so "src/main/*" covers whole subtree.
12+
set -euo pipefail
13+
14+
if (($# == 0)); then
15+
echo "usage: $0 <git-diff-revisions...> < patterns" >&2
16+
exit 2
17+
fi
18+
19+
patterns=()
20+
while IFS= read -r p || [[ -n $p ]]; do
21+
[[ -z $p || $p == \#* ]] && continue
22+
patterns+=("$p")
23+
done
24+
if ((${#patterns[@]} == 0)); then
25+
echo "no patterns given on stdin" >&2
26+
exit 2
27+
fi
28+
29+
# Use a file, so a git failure exits non-zero.
30+
changed=$(mktemp)
31+
trap 'rm -f "$changed"' EXIT
32+
git diff --name-only --no-renames -z "$@" >"$changed"
33+
34+
while IFS= read -r -d '' f; do
35+
match=false
36+
for p in "${patterns[@]}"; do
37+
# The glob matchings are on purpose.
38+
if [[ $p == '!'* ]]; then
39+
# shellcheck disable=SC2053
40+
[[ $f == ${p:1} ]] && match=false
41+
else
42+
# shellcheck disable=SC2053
43+
[[ $f == $p ]] && match=true
44+
fi
45+
done
46+
if $match; then
47+
echo "Relevant change: $f" >&2
48+
echo true
49+
exit 0
50+
fi
51+
done <"$changed"
52+
53+
echo "No relevant changes in $(tr -cd '\0' <"$changed" | wc -c) changed file(s)" >&2
54+
echo false

‎scripts/ci-emulator-settle.sh‎

Lines changed: 82 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,85 @@
11
#!/usr/bin/env bash
2-
# Wait until Android has delivered pending broadcasts (incl. BOOT_COMPLETED) after boot.
3-
if ! timeout 300 adb shell am wait-for-broadcast-idle; then
2+
# Prepare the CI emulator for tests. Also runs before AVD snapshot is saved.
3+
#
4+
# 1. Hide system error dialogs, so an ANR in System UI or launcher restarts
5+
# instead of showing an "isn't responding" dialog that takes window focus.
6+
# 2. Wait until pending broadcasts are delivered.
7+
# 3. Compile pending packages ahead of time.
8+
# 4. Log guest CPU load until it looks idle.
9+
# 5. Log the focused window and warn if an ANR dialog already holds focus.
10+
#
11+
# Usage: ci-emulator-settle.sh [--dexopt]
12+
set -u
13+
14+
CPU_IDLE_PERCENT=25
15+
CPU_IDLE_SAMPLES=3
16+
CPU_SAMPLE_SECONDS=5
17+
CPU_LOG_MAX_SECONDS=180
18+
19+
log() { echo "[settle +${SECONDS}s] $*"; }
20+
21+
timeout 60 adb shell settings put global hide_error_dialogs 1
22+
value=$(timeout 60 adb shell settings get global hide_error_dialogs | tr -d '\r')
23+
if [ "$value" != "1" ]; then
24+
echo "::error::hide_error_dialogs is '${value}', expected 1"
25+
exit 1
26+
fi
27+
log "hide_error_dialogs=1"
28+
29+
if timeout 300 adb shell am wait-for-broadcast-idle; then
30+
log "broadcast queues idle"
31+
else
432
echo "::warning::Broadcast queue not idle within 300 s; continuing anyway"
533
fi
34+
35+
if [ "${1:-}" = "--dexopt" ]; then
36+
start=$SECONDS
37+
if timeout 900 adb shell pm bg-dexopt-job; then
38+
log "pm bg-dexopt-job done in $((SECONDS - start)) s"
39+
else
40+
echo "::warning::pm bg-dexopt-job failed or timed out after $((SECONDS - start)) s; continuing"
41+
fi
42+
fi
43+
44+
read_cpu() {
45+
timeout 30 adb shell cat /proc/stat 2>/dev/null | tr -d '\r' |
46+
awk '$1 == "cpu" { t = 0; for (i = 2; i <= 9; i++) t += $i; print t - $5 - $6, t; exit }'
47+
}
48+
49+
prev=$(read_cpu)
50+
if [ -z "$prev" ]; then
51+
echo "::warning::Could not read /proc/stat; skipping CPU log"
52+
else
53+
idle_run=0
54+
result="cap reached (${CPU_LOG_MAX_SECONDS} s)"
55+
deadline=$((SECONDS + CPU_LOG_MAX_SECONDS))
56+
while [ "$SECONDS" -lt "$deadline" ]; do
57+
sleep "$CPU_SAMPLE_SECONDS"
58+
cur=$(read_cpu)
59+
if [ -z "$cur" ]; then
60+
result="stopped: could not read /proc/stat"
61+
break
62+
fi
63+
read -r b0 t0 <<< "$prev"
64+
read -r b1 t1 <<< "$cur"
65+
prev=$cur
66+
[ $((t1 - t0)) -gt 0 ] || continue
67+
busy=$((100 * (b1 - b0) / (t1 - t0)))
68+
log "guest cpu busy ${busy}%"
69+
if [ "$busy" -le "$CPU_IDLE_PERCENT" ]; then idle_run=$((idle_run + 1)); else idle_run=0; fi
70+
if [ "$idle_run" -ge "$CPU_IDLE_SAMPLES" ]; then
71+
result="looks idle"
72+
break
73+
fi
74+
done
75+
log "cpu log ${result}"
76+
fi
77+
78+
focus=$(timeout 30 adb shell dumpsys window 2>/dev/null | tr -d '\r' | grep -E 'mCurrentFocus|mFocusedApp')
79+
log "focus:"
80+
echo "$focus"
81+
if grep -q 'Application Not Responding' <<< "$focus"; then
82+
echo "::warning::A system 'isn't responding' dialog holds focus; UI tests will likely fail with RootViewWithoutFocusException"
83+
fi
84+
85+
exit 0

‎src/main/java/org/thoughtcrime/securesms/CreateProfileActivity.java‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@ private void initializeProfileAvatar() {
220220
} else {
221221
imageLoaded = false;
222222
avatar.setImageDrawable(
223-
new ResourceContactPhoto(R.drawable.ic_camera_alt_white_24dp)
223+
new ResourceContactPhoto(R.drawable.ic_camera_alt_24)
224224
.asDrawable(this, getResources().getColor(R.color.grey_400)));
225225
}
226226
avatar.setOnClickListener(
@@ -319,7 +319,7 @@ public void onClick(int type) {
319319
imageLoaded = false;
320320
avatarChanged = true;
321321
avatar.setImageDrawable(
322-
new ResourceContactPhoto(R.drawable.ic_camera_alt_white_24dp)
322+
new ResourceContactPhoto(R.drawable.ic_camera_alt_24)
323323
.asDrawable(
324324
CreateProfileActivity.this, getResources().getColor(R.color.grey_400)));
325325
break;

‎src/main/java/org/thoughtcrime/securesms/EphemeralMessagesDialog.java‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,11 @@ public static void show(
5656
container.check(container.getChildAt(preselected).getId());
5757

5858
TextView messageView = dialogView.findViewById(R.id.description);
59-
messageView.setText(context.getString(R.string.ephemeral_messages_hint));
59+
if (isSelfTalk) {
60+
messageView.setVisibility(View.GONE);
61+
} else {
62+
messageView.setText(context.getString(R.string.ephemeral_messages_hint));
63+
}
6064

6165
AlertDialog.Builder builder =
6266
new AlertDialog.Builder(context)

0 commit comments

Comments
 (0)