[BUG] Receiving ANR When Scrolling Pictures
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 4.2k
- Forks
- 3.1k
- Avg merge
- 1d 12h
- Merged PRs (30d)
- 7
Description
Actual behaviour
-Opening Folder with offline photos, opening a photo and then swiping right until receiving ANR
Expected behaviour
-App should not ANR
Steps to reproduce
- Download folder of photos offline
- Open application offline so that server is unreachable
- Open pictures and scroll through one by one
Can this problem be reproduced with the official owncloud server?
(url: https://ocis.ocis.master.owncloud.works, user: einstein, password: relativity)
Environment data
Android version:
16
Device model:
Google Pixel 10
Stock or customized system:
Stock
ownCloud app version:
4.7.0
ownCloud server version:
10.16
Logs
Web server error log
Subject: Input dispatching timed out (ceb1142 com.owncloud.android.debug/com.owncloud.android.ui.preview.PreviewImageActivity is not responding. Waited 5001ms for MotionEvent).
RssHwmKb: 393848
RssKb: 382136
RssAnonKb: 206880
RssShmemKb: 23276
VmSwapKb: 31644
--- CriticalEventLog ---
capacity: 20
timestamp_ms: 1767742697528
window_ms: 300000
----- dumping pid: 14340 at 66974993
----- pid 14340 at 2026-01-06 18:38:17.507649195-0500 -----
Cmd line: com.owncloud.android.debug
Build fingerprint: 'google/frankel/frankel:16/BP4A.251205.006.E1/14586962:user/release-keys'
ABI: 'arm64'
Build type: optimized
Debug Store: 3,32,66975055::ID:26,C:E,T:66941521||ID:26,C:S,T:66941521,N:SvcBind,D:mid=12aab6d||ID:25,C:E,T:66941520||ID:25,C:S,T:66941518,N:SvcCreate,D:mid=56f5784||ID:0,C:P,T:6
6941305,N:SchSvcBind,D:tname=binder:14340_8;tid=74;act=null;cmp=com.owncloud.android.debug/com.owncloud.android.services.OperationsService;mid=12aab6d||ID:0,C:P,T:66941305,N:SchS
vcCreate,D:tname=binder:14340_8;tid=74;name=com.owncloud.android.services.OperationsService;mid=56f5784||ID:24,C:E,T:66935927||ID:24,C:S,T:66935919,N:JobStart,D:mid=e809094||ID:0
,C:P,T:66935919,N:SchJobStart,D:tname=binder:14340_4;tid=57;jobid=17839;jobns=null;mid=e809094||ID:23,C:E,T:66935918||ID:23,C:S,T:66935916,N:SvcBind,D:mid=9c24aa6||ID:22,C:E,T:66
935916||ID:22,C:S,T:66935903,N:SvcCreate,D:mid=69b7c01||ID:0,C:P,T:66935900,N:SchSvcBind,D:tname=binder:14340_4;tid=57;act=null;cmp=com.owncloud.android.debug/androidx.work.impl.
background.systemjob.SystemJobService;mid=9c24aa6||ID:0,C:P,T:66935894,N:SchSvcCreate,D:tname=binder:14340_4;tid=57;name=androidx.work.impl.background.systemjob.SystemJobService;
mid=69b7c01||ID:21,C:E,T:66843993||ID:21,C:S,T:66843980,N:JobStop,D:mid=2cc664||ID:0,C:P,T:66843979,N:SchJobStop,D:tname=binder:14340_4;tid=57;jobid=17838;jobns=null;mid=2cc664||
ID:20,C:E,T:66716434||ID:20,C:S,T:66716434,N:JobStart,D:mid=eecefd4||ID:19,C:E,T:66716432||ID:19,C:S,T:66716426,N:JobStart,D:mid=84de127||ID:0,C:P,T:66716412,N:SchJobStart,D:tnam
e=binder:14340_4;tid=57;jobid=17838;jobns=null;mid=eecefd4||ID:0,C:P,T:66716411,N:SchJobStart,D:tname=binder:14340_3;tid=44;jobid=17835;jobns=null;mid=84de127||ID:18,C:E,T:667164
11||ID:18,C:S,T:66716410,N:SvcBind,D:mid=ab52641||ID:17,C:E,T:66716410||ID:0,C:P,T:66716396,N:SchSvcBind,D:tname=binder:14340_3;tid=44;act=null;cmp=com.owncloud.android.debug/and
roidx.work.impl.background.systemjob.SystemJobService;mid=ab52641||ID:17,C:S,T:66716396,N:SvcCreate,D:mid=3066928||ID:0,C:P,T:66716395,N:SchSvcCreate,D:tname=binder:14340_3;tid=4
4;name=androidx.work.impl.background.systemjob.SystemJobService;mid=3066928||ID:16,C:E,T:66589816||ID:16,C:S,T:66589776,N:JobStop,D:mid=6c65ec2;;
suspend all histogram: Sum: 1.921ms 99% C.I. 0.189us-711.199us Avg: 73.884us Max: 775us
DALVIK THREADS (116):
"main" prio=5 tid=1 TimedWaiting
| group="main" sCount=1 ucsCount=0 flags=1 obj=0x73618810 self=0xb400006d56307be0
| sysTid=14340 nice=-10 cgrp=default sched=1073741824/0 handle=0x700322b060
| state=S schedstat=( 8625097492 1268419417 11475 ) utm=693 stm=169 core=5 HZ=100
| stack=0x7ffd477000-0x7ffd479000 stackSize=8188KB
| held mutexes=
at jdk.internal.misc.Unsafe.park(Native method)
- waiting on an unknown object
at java.util.concurrent.locks.LockSupport.parkNanos(LockSupport.java:269)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:98)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:69)
at kotlinx.coroutines.BuildersKt.runBlocking(unavailable:1)
at com.owncloud.android.datamodel.FileDataStorageManager.getFileById(FileDataStorageManager.kt:84)
at com.owncloud.android.ui.preview.PreviewImageFragment.onPrepareOptionsMenu(PreviewImageFragment.kt:196)
at androidx.fragment.app.Fragment.performPrepareOptionsMenu(Fragment.java:3258)
at androidx.fragment.app.FragmentManager.dispatchPrepareOptionsMenu(FragmentManager.java:3099)
at androidx.fragment.app.FragmentManager$2.onPrepareMenu(FragmentManager.java:475)
at androidx.core.view.MenuHostHelper.onPrepareMenu(MenuHostHelper.java:80)
at androidx.activity.ComponentActivity.onPreparePanel(ComponentActivity.java:513)
at androidx.appcompat.view.WindowCallbackWrapper.onPreparePanel(WindowCallbackWrapper.java:100)
at androidx.appcompat.app.AppCompatDelegateImpl$AppCompatWindowCallback.onPreparePanel(AppCompatDelegateImpl.java:3477)
at androidx.appcompat.app.AppCompatDelegateImpl.preparePanel(AppCompatDelegateImpl.java:2054)
at androidx.appcompat.app.AppCompatDelegateImpl.doInvalidatePanelMenu(AppCompatDelegateImpl.java:2313)
at androidx.appcompat.app.AppCompatDelegateImpl$2.run(AppCompatDelegateImpl.java:278)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1630)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1639)
at android.view.Choreographer.doCallbacks(Choreographer.java:1235)
at android.view.Choreographer.doFrame(Choreographer.java:1160)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1613)
at android.os.Handler.handleCallback(Handler.java:1070)
at android.os.Handler.dispatchMessage(Handler.java:125)
at android.os.Looper.dispatchMessage(Looper.java:333)
at android.os.Looper.loopOnce(Looper.java:263)
at android.os.Looper.loop(Looper.java:367)
at android.app.ActivityThread.main(ActivityThread.java:9287)
at java.lang.reflect.Method.invoke(Native method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:566)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:929)
DumpLatencyMs: 13.8819
Full ANR Log:
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the offline photo-scrolling flow and start with the ANR stack in PreviewImageFragment.kt:196 and FileDataStorageManager.kt:84, reached from PreviewImageActivity. Trace why getFileById blocks during onPrepareOptionsMenu, then verify that repeatedly swiping through offline pictures no longer produces an ANR.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- android, kotlin
- Domain
- mobile, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 52/100