-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
FtpService improvements #4379
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: release/4.0
Are you sure you want to change the base?
FtpService improvements #4379
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Copilot reviewed 6 out of 8 changed files in this pull request and generated 1 comment.
Files not reviewed (2)
- app/build.gradle: Language not supported
- app/src/main/AndroidManifest.xml: Language not supported
Comments suppressed due to low confidence (1)
gradle/libs.versions.toml:37
- Verify that the updated alias 'kotlinxCoroutines' for the kotlinx-coroutine-test dependency is intentional and that it aligns with the expected versioning across the project.
+kotlinxCoroutines = "1.7.3"
app/src/main/java/com/amaze/filemanager/asynchronous/services/ftp/FtpService.kt
Outdated
Show resolved
Hide resolved
- Replace EventBus with kotlinx.coroutines - FtpServerFragment update code to recommended - FtpService explicitly acquires wakelock and enforces START_STICKY to ensure it's still running in the background even in the doze mode. Fixes TeamAmaze#4125 - Upgrade ACRA to 2.13 for fixing square/leakcanary#2568
5abbb83
to
c2b8a7b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When pressing the tile I get:
2025-04-15 19:07:45.696 4747-4747 FtpReceiver com.amaze.filemanager.debug E Failed to start/stop on intent startForegroundService() not allowed due to mAllowStartForeground false: service com.amaze.filemanager.debug/com.amaze.filemanager.asynchronous.services.ftp.FtpService
And when starting from the app it crashes:
2025-04-15 19:09:26.452 4747-4747 AndroidRuntime com.amaze.filemanager.debug E FATAL EXCEPTION: main
Process: com.amaze.filemanager.debug, PID: 4747
java.lang.RuntimeException: Unable to start service com.amaze.filemanager.asynchronous.services.ftp.FtpService@95ee603 with Intent { cmp=com.amaze.filemanager.debug/com.amaze.filemanager.asynchronous.services.ftp.FtpService }: java.lang.IllegalArgumentException: foregroundServiceType 0x00000001 is not a subset of foregroundServiceType attribute 0x00000000 in service element of manifest file
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4962)
at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2393)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loopOnce(Looper.java:242)
at android.os.Looper.loop(Looper.java:362)
at android.app.ActivityThread.main(ActivityThread.java:8393)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:992)
Caused by: java.lang.IllegalArgumentException: foregroundServiceType 0x00000001 is not a subset of foregroundServiceType attribute 0x00000000 in service element of manifest file
at android.os.Parcel.createExceptionOrNull(Parcel.java:3083)
at android.os.Parcel.createException(Parcel.java:3063)
at android.os.Parcel.readException(Parcel.java:3046)
at android.os.Parcel.readException(Parcel.java:2988)
at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:7154)
at java.lang.reflect.Method.invoke(Native Method)
at leakcanary.ServiceWatcher$install$4$2.invoke(ServiceWatcher.kt:93)
at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
at $Proxy4.setServiceForeground(Unknown Source)
at android.app.Service.startForeground(Service.java:862)
at androidx.core.app.ServiceCompat$Api34Impl.startForeground(ServiceCompat.java:241)
at androidx.core.app.ServiceCompat.startForeground(ServiceCompat.java:172)
at com.amaze.filemanager.asynchronous.services.ftp.FtpService.onStartCommand(FtpService.kt:132)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4944)
at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2393)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loopOnce(Looper.java:242)
at android.os.Looper.loop(Looper.java:362)
at android.app.ActivityThread.main(ActivityThread.java:8393)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:992)
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.am.ActiveServices.setServiceForegroundInnerLocked(ActiveServices.java:2061)
at com.android.server.am.ActiveServices.setServiceForegroundLocked(ActiveServices.java:1687)
at com.android.server.am.ActivityManagerService.setServiceForeground(ActivityManagerService.java:13761)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3500)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2834)
2025-04-15 19:09:26.454 4747-4747 ACRA com.amaze.filemanager.debug E ACRA caught a RuntimeException for com.amaze.filemanager.debug
java.lang.RuntimeException: Unable to start service com.amaze.filemanager.asynchronous.services.ftp.FtpService@95ee603 with Intent { cmp=com.amaze.filemanager.debug/com.amaze.filemanager.asynchronous.services.ftp.FtpService }: java.lang.IllegalArgumentException: foregroundServiceType 0x00000001 is not a subset of foregroundServiceType attribute 0x00000000 in service element of manifest file
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4962)
at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2393)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loopOnce(Looper.java:242)
at android.os.Looper.loop(Looper.java:362)
at android.app.ActivityThread.main(ActivityThread.java:8393)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:992)
Caused by: java.lang.IllegalArgumentException: foregroundServiceType 0x00000001 is not a subset of foregroundServiceType attribute 0x00000000 in service element of manifest file
at android.os.Parcel.createExceptionOrNull(Parcel.java:3083)
at android.os.Parcel.createException(Parcel.java:3063)
at android.os.Parcel.readException(Parcel.java:3046)
at android.os.Parcel.readException(Parcel.java:2988)
at android.app.IActivityManager$Stub$Proxy.setServiceForeground(IActivityManager.java:7154)
at java.lang.reflect.Method.invoke(Native Method)
at leakcanary.ServiceWatcher$install$4$2.invoke(ServiceWatcher.kt:93)
at java.lang.reflect.Proxy.invoke(Proxy.java:1006)
at $Proxy4.setServiceForeground(Unknown Source)
at android.app.Service.startForeground(Service.java:862)
at androidx.core.app.ServiceCompat$Api34Impl.startForeground(ServiceCompat.java:241)
at androidx.core.app.ServiceCompat.startForeground(ServiceCompat.java:172)
at com.amaze.filemanager.asynchronous.services.ftp.FtpService.onStartCommand(FtpService.kt:132)
at android.app.ActivityThread.handleServiceArgs(ActivityThread.java:4944)
at android.app.ActivityThread.-$$Nest$mhandleServiceArgs(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2393)
at android.os.Handler.dispatchMessage(Handler.java:111)
at android.os.Looper.loopOnce(Looper.java:242)
at android.os.Looper.loop(Looper.java:362)
at android.app.ActivityThread.main(ActivityThread.java:8393)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:552)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:992)
Caused by: android.os.RemoteException: Remote stack trace:
at com.android.server.am.ActiveServices.setServiceForegroundInnerLocked(ActiveServices.java:2061)
at com.android.server.am.ActiveServices.setServiceForegroundLocked(ActiveServices.java:1687)
at com.android.server.am.ActivityManagerService.setServiceForeground(ActivityManagerService.java:13761)
at android.app.IActivityManager$Stub.onTransact(IActivityManager.java:3500)
at com.android.server.am.ActivityManagerService.onTransact(ActivityManagerService.java:2834)
Device: Moto G73 5G
Need to pass #4378 first to fix the foregroundService problem. |
Filezilla is not able to connect to the server. I have rebased to release/4.0 head:
Device: Moto G73 5G |
SFTP is not FTPS which we have here - a FTP server with TLS support 👀 |
Description
START_STICKY
to ensure it's still running in the background even in the doze modeIssue tracker
Fixes #4125
Automatic tests
Manual tests
Device: Fairphone 5 running LineageOS 22 (Android 15)
Build tasks success
Successfully running following tasks on local:
./gradlew assembledebug
./gradlew spotlessCheck
Related PR
Depends on PR #4378