-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
no sticky broadcast #6748
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
no sticky broadcast #6748
Conversation
a2f0b13 to
f85a2d7
Compare
f85a2d7 to
780c443
Compare
Codecov Report
@@ Coverage Diff @@
## master #6748 +/- ##
============================================
+ Coverage 27.87% 28.30% +0.43%
Complexity 5 5
============================================
Files 427 427
Lines 34270 34667 +397
Branches 4740 4847 +107
============================================
+ Hits 9552 9812 +260
- Misses 23294 23403 +109
- Partials 1424 1452 +28
|
ezaquarii
left a comment
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.
Generally LGTM. Some trivialities.
src/main/java/com/owncloud/android/files/services/FileDownloader.java
Outdated
Show resolved
Hide resolved
| updateActionBarTitleAndHomeButton(startFile); | ||
| } | ||
|
|
||
| localBroadCastManager = LocalBroadcastManager.getInstance(this); |
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.
This is nitpicking, but Broadcast instead of BroadCast. Sorry. :)
| import com.nextcloud.client.files.downloader.TransferState; | ||
| import com.nextcloud.client.files.downloader.TransferManagerConnection; | ||
| import com.nextcloud.client.files.downloader.Request; | ||
| import com.nextcloud.client.files.downloader.TransferState; |
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.
I think this is coming from one of my previous PRs that is already merged? Not sure how it ended up here.
780c443 to
4bc5bb4
Compare
|
|
||
| intent.setPackage(mContext.getPackageName()); | ||
| mContext.sendStickyBroadcast(intent); | ||
| LocalBroadcastManager.getInstance(mContext.getApplicationContext()).sendBroadcast(intent); |
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.
@ezaquarii how could I use Dagger here?
Only via constructor, or?
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.
Yeah, dagger works only in main components. Everything else is constructor based injection or setter if 2 stage init is required (I think we have 1 case of the latter).
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.
Do you think it is worth the effort, or can we keep it this way?
After all it is a singleton, so use of Dagger is not that much needed, but mainly only for centralizing the initiation?
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.
Let us keep it now this way to get it in faster.
If we need DI for testing, we can change it anyways.
4bc5bb4 to
1edf2a4
Compare
- use local broadcast system instead - no need to remove sticky broadcasts then Signed-off-by: tobiasKaminsky <tobias@kaminsky.me>
1edf2a4 to
15dcad2
Compare
|
APK file: https://www.kaminsky.me/nc-dev/android-artifacts/15642.apk |
Codacy409Lint
SpotBugs (new)
SpotBugs (master)
|

Fix #6654
Signed-off-by: tobiasKaminsky tobias@kaminsky.me
Testing
Writing tests is very important. Please try to write some tests for your PR.
If you need help, please do not hesitate to ask in this PR for help.
unit tests
instrumented tests
UI tests