android
android copied to clipboard
fix: reopening list from navigation view
- [x] Tests written, or not not needed
Fixes
E Could not dispatch event: class com.owncloud.android.ui.events.SearchEvent to subscribing class class com.owncloud.android.ui.fragment.OCFileListFragment
android.view.ViewRootImpl$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views.
at android.view.ViewRootImpl.checkThread(ViewRootImpl.java:8798)
at android.view.ViewRootImpl.requestLayout(ViewRootImpl.java:1606)
at android.view.View.requestLayout(View.java:25390)
at android.view.View.requestLayout(View.java:25390)
at android.view.View.requestLayout(View.java:25390)
at android.view.View.requestLayout(View.java:25390)
at android.view.View.requestLayout(View.java:25390)
at android.view.View.requestLayout(View.java:25390)
at androidx.drawerlayout.widget.DrawerLayout.requestLayout(DrawerLayout.java:1353)
at android.view.View.requestLayout(View.java:25390)
at android.view.View.requestLayout(View.java:25390)
at android.view.View.requestLayout(View.java:25390)
at android.view.View.requestLayout(View.java:25390)
at androidx.constraintlayout.widget.ConstraintLayout.requestLayout(ConstraintLayout.java:3842)
at android.view.View.requestLayout(View.java:25390)
at android.widget.TextView.checkForRelayout(TextView.java:9719)
at android.widget.TextView.setText(TextView.java:6311)
at android.widget.TextView.setText(TextView.java:6139)
at android.widget.TextView.setText(TextView.java:6091)
at android.widget.TextView.setText(TextView.java:6412)
at com.owncloud.android.ui.fragment.OCFileListFragment.updateSortButton(OCFileListFragment.java:1666)
at com.owncloud.android.ui.fragment.OCFileListFragment.handleSearchEvent(OCFileListFragment.java:1948)
at com.owncloud.android.ui.fragment.OCFileListFragment.onMessageEvent(OCFileListFragment.java:1919)
at java.lang.reflect.Method.invoke(Native Method)
at org.greenrobot.eventbus.EventBus.invokeSubscriber(EventBus.java:517)
at org.greenrobot.eventbus.EventBus.invokeSubscriber(EventBus.java:511)
at org.greenrobot.eventbus.BackgroundPoster.run(BackgroundPoster.java:64)
How to reproduce?
- Open favorites
- Navigate to sub favorite dir
- Go back
- Try to reload favorites from drawer menu
/backport to stable-3.35
Codacy
SpotBugs
| Category | Base | New |
|---|---|---|
| Bad practice | 43 | 43 |
| Correctness | 74 | 74 |
| Dodgy code | 258 | 258 |
| Experimental | 1 | 1 |
| Internationalization | 7 | 7 |
| Malicious code vulnerability | 3 | 3 |
| Multithreaded correctness | 34 | 34 |
| Performance | 45 | 45 |
| Security | 18 | 18 |
| Total | 483 | 483 |
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/16110.apk
To test this change/fix you can simply download above APK file and install and test it in parallel to your existing Nextcloud app.
blue-Light-Screenshot test failed, but no output was generated. Maybe a preliminary stage failed.