syncthing-android icon indicating copy to clipboard operation
syncthing-android copied to clipboard

Provide notification handler in device and folder activities

Open adamszewe opened this issue 1 year ago • 2 comments

wip, waiting for https://github.com/syncthing/syncthing-android/pull/2054 to merge first

Decouples a bit FolderActivity and DeviceActivity from SyncthingService by injecting NotificationHandler into them directly instead of relying on a method in SyncthingService to provide it for them.

adamszewe avatar Feb 06 '24 20:02 adamszewe

How does this relate to #2054? Doesn't look like preferences are involved here.

With the previous way, only a single notification handler instance. Is it ok to have multiple?

imsodin avatar Feb 10 '24 20:02 imsodin

How does this relate to #2054? Doesn't look like preferences are involved here.

With the previous way, only a single notification handler instance. Is it ok to have multiple?

This PR is just waiting for the first one to get merged so I can rebase this one. I left it in draft as it's still pointing to the main branch even though it has changes on it from the first PR.

In this PR I want to refactor how the NotificationHandler is provided the FolderActivity and DeviceActivity. Currently these classes are getting a reference to the NotificationHandler from SyncthingActivity, which couples them for no good reason. We can just inject NotificationHandler into those classes. NotificationHandler is already being provided as a s Singleton by Dagger, so there is going to be only a single instance of it in the app.

adamszewe avatar Feb 15 '24 20:02 adamszewe

Are you closing this just for lack of review / feedback? Or is there some different plan?

acolomb avatar Mar 22 '24 19:03 acolomb