Support Android 6 direct share.
BUG:362266
BackgroundService is a SIngleton now. This should only be used if strictly necessary.
Details
- Reviewers
albertvaka - Group Reviewers
KDE Connect - Commits
- R225:bea90521c5d9: Direct Share
Pick a random app with a share button, look for device entries in Sharing options (might not be there because other sharing options have higher priority)
Diff Detail
- Repository
- R225 KDE Connect - Android application
- Lint
Automatic diff as part of commit; lint not applicable. - Unit
Automatic diff as part of commit; unit tests not applicable.
Made BackgroundService a Singleton. Could not find any obvious problems. Using this approach could simplify the code on many places.
I'm already running it on my phone :) But I also don't like the way to get the devices from the background service... I was waiting to have a bit more of time to try other solutions, but I haven't really looked into it yet.
I'll try to work on it this week.
I try to avoid statics (and hence singletons) in Android, because Android can decide to unload classes when it's low on memory, and then static variables on that class become null.
Unfortunately, I can't find any way of doing it without having a singleton class, because the ChooserTargetService has no way to access anything...
So, I guess we will have to stick with this approach.
src/org/kde/kdeconnect/Plugins/SharePlugin/ShareActivity.java | ||
---|---|---|
176 | I think here we can use the BackgroundService.RunCommand construct, instead of using the singleton... I would prefer if we only use the singleton when it's 100% necessary (ie: only from the ChooserTargetService). |