android
android copied to clipboard
Add Logs For Passed File Sizes
- [x] Tests written, or not not needed
What is the Problem?
App sometimes throws TransactionTooLargeException. Back trace not helping too much.
e.g. Backtrace
Exception java.lang.RuntimeException:
at android.app.servertransaction.PendingTransactionActions$StopInfo.run (PendingTransactionActions.java:146)
at android.os.Handler.handleCallback (Handler.java:958)
at android.os.Handler.dispatchMessage (Handler.java:99)
at android.os.Looper.loopOnce (Looper.java:230)
at android.os.Looper.loop (Looper.java:319)
at android.app.ActivityThread.main (ActivityThread.java:8893)
at java.lang.reflect.Method.invoke
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run (RuntimeInit.java:608)
at com.android.internal.os.ZygoteInit.main (ZygoteInit.java:1103)
Caused by android.os.TransactionTooLargeException: data parcel size 594696 bytes
at android.os.BinderProxy.transactNative
at android.os.BinderProxy.transact (BinderProxy.java:662)
at android.app.IActivityClientController$Stub$Proxy.activityStopped (IActivityClientController.java:1507)
at android.app.ActivityClient.activityStopped (ActivityClient.java:100)
at android.app.servertransaction.PendingTransactionActions$StopInfo.run (PendingTransactionActions.java:135)
The TransactionTooLargeException can be thrown due to the following reasons:
- Including large objects in Bundles or Intents.
- Using
onSaveInstanceStateto save the UI state with large data.
What this PR does?
Add logs to print file size so that we can check passed file sizes.
Codacy
Lint
| Type | master | PR |
| Warnings | 63 | 63 |
| Errors | 3 | 3 |
SpotBugs
| Category | Base | New |
|---|---|---|
| Bad practice | 64 | 64 |
| Correctness | 65 | 65 |
| Dodgy code | 315 | 315 |
| Experimental | 1 | 1 |
| Internationalization | 7 | 7 |
| Multithreaded correctness | 6 | 6 |
| Performance | 55 | 53 |
| Security | 18 | 18 |
| Total | 531 | 529 |
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/13151.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.