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

Issue 1391703003: Create network change notifier. (Closed)

Created:
5 years, 2 months ago by honghaiz3
Modified:
5 years, 2 months ago
Reviewers:
AlexG, pthatcher1
CC:
webrtc-reviews_webrtc.org, yujie_mao (webrtc), Andrew MacDonald, tterriberry_mozilla.com, qiang.lu, niklas.enbom, peah-webrtc, juberti
Base URL:
https://chromium.googlesource.com/external/webrtc@master
Target Ref:
refs/pending/heads/master
Project:
webrtc
Visibility:
Public.

Description

Create network change notifier and pass the event to NetworkManager BUG= Committed: https://crrev.com/023f3ef0296511f12897c503d6fc2ed063712474 Cr-Commit-Position: refs/heads/master@{#10325}

Patch Set 1 #

Patch Set 2 : Added tests #

Patch Set 3 : Minor fix on the comment #

Total comments: 14

Patch Set 4 : #

Total comments: 26

Patch Set 5 : Address comments #

Patch Set 6 : Merge and fix trybot errors #

Patch Set 7 : Add access-network right in AndroidManifest.xml #

Total comments: 2

Patch Set 8 : Add Android tests #

Total comments: 6

Patch Set 9 : #

Patch Set 10 : Merge with master #

Total comments: 4

Patch Set 11 : Changed base class name to NetworkMonitorInterface #

Patch Set 12 : Add options to disable network monitor. #

Patch Set 13 : Changed comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1359 lines, -26 lines) Patch
M talk/app/webrtc/androidtests/AndroidManifest.xml View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
A talk/app/webrtc/androidtests/src/org/webrtc/NetworkMonitorTest.java View 1 2 3 4 5 6 7 8 1 chunk +288 lines, -0 lines 0 comments Download
A talk/app/webrtc/java/android/org/webrtc/NetworkMonitor.java View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +228 lines, -0 lines 0 comments Download
A talk/app/webrtc/java/android/org/webrtc/NetworkMonitorAutoDetect.java View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +424 lines, -0 lines 0 comments Download
A + talk/app/webrtc/java/jni/androidnetworkmonitor_jni.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +26 lines, -18 lines 0 comments Download
A talk/app/webrtc/java/jni/androidnetworkmonitor_jni.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +85 lines, -0 lines 0 comments Download
M talk/app/webrtc/java/jni/classreferenceholder.cc View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M talk/app/webrtc/java/jni/peerconnection_jni.cc View 1 2 3 4 5 6 7 8 9 10 11 12 8 chunks +37 lines, -2 lines 0 comments Download
M talk/app/webrtc/java/src/org/webrtc/PeerConnectionFactory.java View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download
M talk/app/webrtc/peerconnectioninterface.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +2 lines, -0 lines 0 comments Download
M talk/libjingle.gyp View 1 2 3 4 5 2 chunks +4 lines, -0 lines 0 comments Download
M webrtc/base/BUILD.gn View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M webrtc/base/base.gyp View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M webrtc/base/network.h View 1 2 3 4 5 6 7 8 9 10 5 chunks +15 lines, -3 lines 0 comments Download
M webrtc/base/network.cc View 1 2 3 4 6 chunks +36 lines, -3 lines 0 comments Download
M webrtc/base/network_unittest.cc View 1 2 3 4 5 6 7 8 9 10 4 chunks +52 lines, -0 lines 0 comments Download
A webrtc/base/networkmonitor.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +91 lines, -0 lines 0 comments Download
A webrtc/base/networkmonitor.cc View 1 2 3 4 5 6 7 8 9 10 1 chunk +62 lines, -0 lines 0 comments Download
M webrtc/examples/androidapp/AndroidManifest.xml View 1 2 3 4 5 6 1 chunk +1 line, -0 lines 0 comments Download
M webrtc/examples/androidtests/src/org/appspot/apprtc/test/PeerConnectionClientTest.java View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 54 (31 generated)
honghaiz3
I largely borrowed the java file from the Chromium file, so I used the name ...
5 years, 2 months ago (2015-10-08 23:33:54 UTC) #10
pthatcher1
https://codereview.webrtc.org/1391703003/diff/220001/webrtc/base/network.cc File webrtc/base/network.cc (right): https://codereview.webrtc.org/1391703003/diff/220001/webrtc/base/network.cc#newcode66 webrtc/base/network.cc:66: const uint32 kUpdateNetworksMessage = 1; Similarly, kUpdateNetworksContinuallyMessage https://codereview.webrtc.org/1391703003/diff/220001/webrtc/base/network.cc#newcode334 webrtc/base/network.cc:334: ...
5 years, 2 months ago (2015-10-09 23:11:30 UTC) #12
honghaiz3
Removed delegate but kept factory for testing and for not exposing jni namespace in rtc ...
5 years, 2 months ago (2015-10-13 23:19:56 UTC) #16
pthatcher1
I still need to look over the Java files, but it's looking much better on ...
5 years, 2 months ago (2015-10-15 08:11:44 UTC) #19
honghaiz3
Addressed comments. https://codereview.webrtc.org/1391703003/diff/340001/talk/app/webrtc/java/android/org/webrtc/NetworkMonitorAutoDetect.java File talk/app/webrtc/java/android/org/webrtc/NetworkMonitorAutoDetect.java (right): https://codereview.webrtc.org/1391703003/diff/340001/talk/app/webrtc/java/android/org/webrtc/NetworkMonitorAutoDetect.java#newcode73 talk/app/webrtc/java/android/org/webrtc/NetworkMonitorAutoDetect.java:73: private final int subtype; On 2015/10/15 08:11:43, ...
5 years, 2 months ago (2015-10-15 19:02:42 UTC) #20
honghaiz3
Alex, Can you take a look at the CL, especially on the Java part of ...
5 years, 2 months ago (2015-10-15 19:07:02 UTC) #22
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1391703003/540001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1391703003/540001
5 years, 2 months ago (2015-10-16 18:52:58 UTC) #30
AlexG
https://codereview.webrtc.org/1391703003/diff/500001/talk/app/webrtc/java/android/org/webrtc/NetworkMonitor.java File talk/app/webrtc/java/android/org/webrtc/NetworkMonitor.java (right): https://codereview.webrtc.org/1391703003/diff/500001/talk/app/webrtc/java/android/org/webrtc/NetworkMonitor.java#newcode62 talk/app/webrtc/java/android/org/webrtc/NetworkMonitor.java:62: private final ArrayList<NetworkObserver> networkObservers; Are you planning to use ...
5 years, 2 months ago (2015-10-16 19:25:42 UTC) #31
commit-bot: I haz the power
Dry run: Try jobs failed on following builders: android_arm64_rel on tryserver.webrtc (JOB_TIMED_OUT, no build URL) ...
5 years, 2 months ago (2015-10-16 20:53:16 UTC) #33
honghaiz3
Thanks. PTAL. Note that I have put the createMonitorTest in the UI thread (as done ...
5 years, 2 months ago (2015-10-16 21:54:28 UTC) #34
commit-bot: I haz the power
Dry run: CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1391703003/560001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1391703003/560001
5 years, 2 months ago (2015-10-16 21:54:41 UTC) #36
AlexG
lgtm
5 years, 2 months ago (2015-10-16 22:10:33 UTC) #37
pthatcher1
lgtm, assuming you change the name to NetworkMonitorInterface https://codereview.webrtc.org/1391703003/diff/580001/webrtc/base/networkmonitor.h File webrtc/base/networkmonitor.h (right): https://codereview.webrtc.org/1391703003/diff/580001/webrtc/base/networkmonitor.h#newcode39 webrtc/base/networkmonitor.h:39: class ...
5 years, 2 months ago (2015-10-16 22:37:07 UTC) #38
honghaiz3
https://codereview.webrtc.org/1391703003/diff/580001/webrtc/base/networkmonitor.h File webrtc/base/networkmonitor.h (right): https://codereview.webrtc.org/1391703003/diff/580001/webrtc/base/networkmonitor.h#newcode39 webrtc/base/networkmonitor.h:39: class NetworkMonitor { On 2015/10/16 22:37:07, pthatcher1 wrote: > ...
5 years, 2 months ago (2015-10-16 23:00:33 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1391703003/600001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1391703003/600001
5 years, 2 months ago (2015-10-16 23:00:58 UTC) #42
honghaiz3
I added an option to disable network monitor if needed. We need to disable network ...
5 years, 2 months ago (2015-10-19 06:04:26 UTC) #44
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1391703003/640001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1391703003/640001
5 years, 2 months ago (2015-10-19 16:38:13 UTC) #47
commit-bot: I haz the power
Committed patchset #13 (id:640001)
5 years, 2 months ago (2015-10-19 16:39:36 UTC) #48
commit-bot: I haz the power
Patchset 13 (id:??) landed as https://crrev.com/023f3ef0296511f12897c503d6fc2ed063712474 Cr-Commit-Position: refs/heads/master@{#10325}
5 years, 2 months ago (2015-10-19 16:39:48 UTC) #49
AlexG
On 2015/10/19 06:04:26, honghaiz3 wrote: > I added an option to disable network monitor if ...
5 years, 2 months ago (2015-10-19 17:28:44 UTC) #50
honghaiz3
On 2015/10/19 17:28:44, AlexG wrote: > On 2015/10/19 06:04:26, honghaiz3 wrote: > > I added ...
5 years, 2 months ago (2015-10-19 19:12:35 UTC) #52
AlexG
On 2015/10/19 19:12:35, honghaiz3 wrote: > On 2015/10/19 17:28:44, AlexG wrote: > > On 2015/10/19 ...
5 years, 2 months ago (2015-10-19 19:37:51 UTC) #53
honghaiz3
5 years, 2 months ago (2015-10-19 22:26:27 UTC) #54
Message was sent while issue was closed.
On 2015/10/19 19:37:51, AlexG wrote:
> On 2015/10/19 19:12:35, honghaiz3 wrote:
> > On 2015/10/19 17:28:44, AlexG wrote:
> > > On 2015/10/19 06:04:26, honghaiz3 wrote:
> > > > I added an option to disable network monitor if needed. We need to
disable
> > > > network monitor in PeerConnectionClientTest.java (otherwise it caused
some
> > > test
> > > > errors due to some special settings of that test ).
> > > 
> > > Did we understand the root case why PeerConnectionClientTest requires
> network
> > > monitor disabling? This test is supposed to exercise loopback mode - it
> should
> > > not depend on network monitor enabling/disabling.
> > The error message was:
> > W/System.err(32447): java.lang.SecurityException: Given caller package
> > org.appspot.apprtc.test is not running in process ProcessRecord{16731df5
> > 32447:org.appspot.apprtc/u0a114}
> > W/System.err(32447):  at android.os.Parcel.readException(Parcel.java:1546)
> > W/System.err(32447):  at android.os.Parcel.readException(Parcel.java:1499)
> > W/System.err(32447):  at
> >
>
android.app.ActivityManagerProxy.registerReceiver(ActivityManagerNative.java:2782)
> > W/System.err(32447):  at
> > android.app.ContextImpl.registerReceiverInternal(ContextImpl.java:1655)
> > W/System.err(32447):  at
> > android.app.ContextImpl.registerReceiver(ContextImpl.java:1623)
> > W/System.err(32447):  at
> > android.app.ContextImpl.registerReceiver(ContextImpl.java:1617)
> > W/System.err(32447):  at
> >
>
org.webrtc.NetworkMonitorAutoDetect$WifiManagerDelegate.getWifiSSID(NetworkMonitorAutoDetect.java:222)
> > ....
> > The cause is that the AppRTCDemoTest loaded AppRTCDemo.apk and when
> registering
> > the BroadcastReceiver in AppRTCDemo, the context has 
> > package org.appspt.apprtc.test but the the App does not contain that
package.
> It
> > raised a security exception in Android 4 and above. 
> > There are similar discussions here:
> > https://groups.google.com/forum/#!topic/android-developers/axLHaXJtonk
> 
> Shouldn't this exception need to be caught in NetworkMonitorAutoDetect.java?
> I am not sure it is worth to add special public configuration options for this
> case so in order to run the tests properly we need to do some extra
> configurations.

Had an offline discussion and we agree to keep this as is because that may
potentially
catch and ignore other SecurityExceptions that we don't want to ignore.  
Thanks for the suggestion!
which we

Powered by Google App Engine
This is Rietveld 408576698