Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(355)

Issue 1358163004: [Android] Introduce RegistrationPolicy for NetworkChangeNotifier. (Closed)

Created:
5 years, 2 months ago by timvolodine
Modified:
5 years, 2 months ago
Reviewers:
pauljensen, jkarlin
CC:
chromium-reviews, cbentzel+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Android] Introduce RegistrationPolicy for NetworkChangeNotifier. Currently the NetworkChangeNotifier.setAutoDetectConnectivityState(true) uses ApplicationState to determine when to listen to network changes. However the ApplicationStatus class does not work as such in the context of WebView. To make the NetworkChangeNotifier more flexible this patch introduces a RegistrationPolicy class which can be passed to the overloaded setAutoDetectConnectivityState method. We make sure to keep the overall API compatible, such that existing users of the NetworkChangeNotifier do not have to provide a policy, which is set behind the screens instead. To this end this patch includes two concrete implementations of the RegistrationPolicy. BUG=520088 Committed: https://crrev.com/97997f341e5e7205b5311a5f1ed66f8cd0d66454 Cr-Commit-Position: refs/heads/master@{#353071}

Patch Set 1 #

Patch Set 2 : clean-up and rebase #

Total comments: 16

Patch Set 3 : address comments #

Total comments: 6

Patch Set 4 : rebase + address comments #

Patch Set 5 : rebase #

Patch Set 6 : rebase once more #

Patch Set 7 : fix compile of tests #

Messages

Total messages: 19 (3 generated)
timvolodine
5 years, 2 months ago (2015-09-25 15:16:31 UTC) #2
timvolodine
friendly ping ;) pauljensen@ : would you be able to review? we need this patch ...
5 years, 2 months ago (2015-09-29 16:30:08 UTC) #3
pauljensen
I can review.
5 years, 2 months ago (2015-09-29 16:38:33 UTC) #4
pauljensen
https://codereview.chromium.org/1358163004/diff/20001/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java File net/android/java/src/org/chromium/net/NetworkChangeNotifier.java (right): https://codereview.chromium.org/1358163004/diff/20001/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java#newcode153 net/android/java/src/org/chromium/net/NetworkChangeNotifier.java:153: boolean shouldAutoDetect, RegistrationPolicy policy) { It looks like you ...
5 years, 2 months ago (2015-10-01 12:06:37 UTC) #5
timvolodine
thanks for the comments! I think I've addressed most of them, PTAL. https://codereview.chromium.org/1358163004/diff/20001/net/android/java/src/org/chromium/net/NetworkChangeNotifier.java File net/android/java/src/org/chromium/net/NetworkChangeNotifier.java ...
5 years, 2 months ago (2015-10-05 17:26:46 UTC) #6
pauljensen
lgtm assuming my three small comments are addressed. BTW you'll probably have to fix some ...
5 years, 2 months ago (2015-10-06 12:50:01 UTC) #7
timvolodine
Thanks for the review pauljensen@! https://codereview.chromium.org/1358163004/diff/40001/net/android/java/src/org/chromium/net/RegistrationPolicyAlwaysRegister.java File net/android/java/src/org/chromium/net/RegistrationPolicyAlwaysRegister.java (right): https://codereview.chromium.org/1358163004/diff/40001/net/android/java/src/org/chromium/net/RegistrationPolicyAlwaysRegister.java#newcode12 net/android/java/src/org/chromium/net/RegistrationPolicyAlwaysRegister.java:12: protected void init(NetworkChangeNotifierAutoDetect notifier) ...
5 years, 2 months ago (2015-10-07 15:12:12 UTC) #8
pauljensen
Looks like it needs another rebase; the patch fails to apply.
5 years, 2 months ago (2015-10-07 15:14:03 UTC) #9
timvolodine
On 2015/10/07 15:14:03, pauljensen wrote: > Looks like it needs another rebase; the patch fails ...
5 years, 2 months ago (2015-10-07 15:22:31 UTC) #10
timvolodine
On 2015/10/07 15:22:31, timvolodine wrote: > On 2015/10/07 15:14:03, pauljensen wrote: > > Looks like ...
5 years, 2 months ago (2015-10-07 17:08:41 UTC) #11
timvolodine
+ jkarlin@ as owner for BackgroundSyncNetworkObserver.java
5 years, 2 months ago (2015-10-07 17:09:08 UTC) #12
jkarlin
lgtm
5 years, 2 months ago (2015-10-07 17:20:15 UTC) #13
timvolodine
On 2015/10/07 17:20:15, jkarlin wrote: > lgtm thanks for the reviews!
5 years, 2 months ago (2015-10-08 16:15:03 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1358163004/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1358163004/120001
5 years, 2 months ago (2015-10-08 16:19:15 UTC) #17
commit-bot: I haz the power
Committed patchset #7 (id:120001)
5 years, 2 months ago (2015-10-08 16:25:45 UTC) #18
commit-bot: I haz the power
5 years, 2 months ago (2015-10-08 16:26:40 UTC) #19
Message was sent while issue was closed.
Patchset 7 (id:??) landed as
https://crrev.com/97997f341e5e7205b5311a5f1ed66f8cd0d66454
Cr-Commit-Position: refs/heads/master@{#353071}

Powered by Google App Engine
This is Rietveld 408576698