Commit Graph

6692 Commits

Author SHA1 Message Date
Mark Chien
5ca20d48aa Merge "Some cleanups for Tethering" am: 7cf4907b89 am: 997009af45
am: e28dc820e4

Change-Id: I0f5c8f33f13dfa2366992a2b2e0ada7667b90e2f
2019-04-03 03:54:42 -07:00
Treehugger Robot
e121a329b8 Merge "Fix NetworkMonitor won't do private dns resolution" 2019-04-03 10:50:09 +00:00
Mark Chien
e28dc820e4 Merge "Some cleanups for Tethering" am: 7cf4907b89
am: 997009af45

Change-Id: I0e00187f9a5eee9e55f961ce0458c9b91af19fb7
2019-04-03 03:45:05 -07:00
Mark Chien
997009af45 Merge "Some cleanups for Tethering"
am: 7cf4907b89

Change-Id: Ifb60c76855a2bea5a1cccf26034e6c582ad16021
2019-04-03 03:35:42 -07:00
Mark Chien
7cf4907b89 Merge "Some cleanups for Tethering" 2019-04-03 10:16:25 +00:00
Remi NGUYEN VAN
49b15870a9 Add common tests for FrameworksBaseTests and CTS
The common package covers tests that should be included both in CTS and
unit tests.

Test: atest FrameworksBaseTests
Bug: 129199908
Change-Id: I9c138d49ce010edde095e4bd3c47e36ca301634a
2019-04-03 18:53:04 +09:00
paulhu
fd7c030082 Move attach*Filter() and addArpEntry() methods to NetworkStack
The SocketUtils.attach*Filter and SocketUtils.addArpEntry methods
were added there because they could not be added as JNI inside
the NetworkStack. This was not possible because on Go devices,
the NetworkStack was a jar library. But now, Go also uses an APK.
Hence, move these methods to the NetworkStack.

Change-Id: I1d88a0f0be23f2b15d5103fa092b9bf982329d7c
Fix: 129433183
Test: atest NetworkStackTests FrameworksNetTests
2019-04-03 17:49:36 +08:00
Remi NGUYEN VAN
99d282d2f6 Merge "Fix API in CaptivePortal, StaticIpConfiguration" am: cf0f380f4e am: fb943d00ca
am: 69528af3db

Change-Id: Icda65fe4a009a754b6a1a763d402820652d55391
2019-04-03 02:28:11 -07:00
Chenbo Feng
ade2fe930a Merge "Add tests for PermissionMonitor" am: 4e39721f18 am: e11632e768
am: 073ca45f14

Change-Id: Ifcb29bfded1b1675231c397ed886506a70267279
2019-04-03 02:19:30 -07:00
Remi NGUYEN VAN
69528af3db Merge "Fix API in CaptivePortal, StaticIpConfiguration" am: cf0f380f4e
am: fb943d00ca

Change-Id: I82eee20855710de2b4fb541dd5e2b887140ed364
2019-04-03 02:12:22 -07:00
lucaslin
45e639b041 Fix NetworkMonitor won't do private dns resolution
NetworkMonitor cannot do the private dns resolution due to lack
"mNetworkCapabilities". ConnectivityService will call
NetworkStackService#notifyPrivateDnsChanged() before doing
network validation. After NetworkMonitor received
CMD_PRIVATE_DNS_SETTINGS_CHANGED, it will call
isValidationRequired to check if the validation is required.
But mNetworkCapabilities didn't be set, so the
mPrivateDnsProviderHostname will be set to empty and make
EvaluatingPrivateDnsState doesn't do private dns resolution.

Bug: 129375892
Test: 1. Build pass
      2. atest FrameworksNetTests
      3. atest NetworkStackTests

Change-Id: I637212fb4746bb2e9a2f4a4457fd36c4c2701149
2019-04-03 17:09:28 +08:00
Chenbo Feng
073ca45f14 Merge "Add tests for PermissionMonitor" am: 4e39721f18
am: e11632e768

Change-Id: I9be22991bd590a7aee4d0a4b2908e0023870d0b6
2019-04-03 02:05:07 -07:00
Remi NGUYEN VAN
fb943d00ca Merge "Fix API in CaptivePortal, StaticIpConfiguration"
am: cf0f380f4e

Change-Id: Ia36ba5946e8dc956c5c71cbebe7dc02658fdb7a0
2019-04-03 01:21:38 -07:00
Chenbo Feng
e11632e768 Merge "Add tests for PermissionMonitor"
am: 4e39721f18

Change-Id: I2079c4ce13aae962c1d907009edc107e861bb3b5
2019-04-03 01:10:07 -07:00
Remi NGUYEN VAN
9ed32081bf Fix comment on StaticIpConfiguration#getDomains
Add consistency with setDomains().

Test: m
Change-Id: I9ff2de98cec2caf903310d7e8eb7b32362c0e151
2019-04-03 15:55:15 +09:00
Remi NGUYEN VAN
cf0f380f4e Merge "Fix API in CaptivePortal, StaticIpConfiguration" 2019-04-03 06:51:35 +00:00
Chalard Jean
8472116bff Straighten AIDL interface for the memory store
Some names were still wrong somehow, and the wrappers were
missing.

Test: NetworkStack & FrameworkNetTests
Change-Id: I475bd011ad9bc714a07021a9dfd85c4876f8e9ad
2019-04-03 15:18:08 +09:00
Treehugger Robot
4e39721f18 Merge "Add tests for PermissionMonitor" 2019-04-03 06:12:12 +00:00
markchien
42e22097c3 Some cleanups for Tethering
Bug: 126481523
Test: -build, flash, boot
      -FrameworksNetTests

Change-Id: I904646efa87eb5434124c7828aca4ab09c5dc38e
2019-04-03 13:56:00 +08:00
Chenbo Feng
fe00494c97 Clean up permissions when uids are no longer used
The kernel eBPF maps have a blacklist to store all the uids that doesn't
have internet permission. When an app is unintalled from the device and
it is the last package on device that uses that uid, make sure we
cleaned the uid from the map and do not add no longer used uids into the
eBPF map. This action helps reduce the number of entries stored in the
map and reduce the chance of overflow the eBPF map.

Bug: 128944261
Test: PermissionMonitorTest
Change-Id: I10dd0113d00d6cf9ca39902d9721f2591d387d4a
2019-04-02 20:31:57 -07:00
Chenbo Feng
1401715e6f Add tests for PermissionMonitor
Add more tests to PermissionMonitor to verify the functionality related
to INTERNET permission and UPDATE_DEVIE_STATS permission. Modified some
of the class design of PermissionMonitor so that it is easier to test
the new functionalities.

Bug: 111560570
Test: PermissionMonitorTest

Change-Id: Ic5585f337db5de48e2f87bf4f01ed7d85c349827
2019-04-02 20:31:49 -07:00
Junyu Lai
ee1e583e36 Merge "Ignore the asynchronous result while stopping keepalive" am: ea6508f9b7 am: 8680cda689
am: 22f2976c84

Change-Id: I5f1709f35a5faec7d9a110f3fa24e89ed1b05fbe
2019-04-02 04:24:18 -07:00
Junyu Lai
22f2976c84 Merge "Ignore the asynchronous result while stopping keepalive" am: ea6508f9b7
am: 8680cda689

Change-Id: I25daef8b1bbbbe93e636c320a032a486751ebcc9
2019-04-02 04:15:07 -07:00
Junyu Lai
8680cda689 Merge "Ignore the asynchronous result while stopping keepalive"
am: ea6508f9b7

Change-Id: Idc6d76ca412f7bbae3b32e81756c419d84dc2c80
2019-04-02 04:05:49 -07:00
Junyu Lai
ea6508f9b7 Merge "Ignore the asynchronous result while stopping keepalive" 2019-04-02 10:48:23 +00:00
Paul Hu
6aeeca832f Merge "Address leftover comments on 923337 and 930217." am: a9b8e31cf8 am: bc8ca075ef
am: 6106d1e017

Change-Id: I75eadb66c81d72c768e77feddd383d60f8accd65
2019-04-02 01:29:08 -07:00
Paul Hu
6106d1e017 Merge "Address leftover comments on 923337 and 930217." am: a9b8e31cf8
am: bc8ca075ef

Change-Id: Ibbc8dd7bb869f76515c9f57793db02953dd07804
2019-04-02 01:14:24 -07:00
Paul Hu
bc8ca075ef Merge "Address leftover comments on 923337 and 930217."
am: a9b8e31cf8

Change-Id: I733160ae51b8f0e80f78ab375cdb0a547b74f68d
2019-04-02 00:58:18 -07:00
Paul Hu
a9b8e31cf8 Merge "Address leftover comments on 923337 and 930217." 2019-04-02 07:39:04 +00:00
Paul Hu
777b96dcad Merge "Fix IpPrefixTest#testContainsInetAddress fail." am: 9c58ddc48e am: b9cffc513e
am: 736189fc88

Change-Id: I9e74dc9bf30a53ce78395e502a52891ba488f4b1
2019-04-01 19:24:38 -07:00
Paul Hu
736189fc88 Merge "Fix IpPrefixTest#testContainsInetAddress fail." am: 9c58ddc48e
am: b9cffc513e

Change-Id: I257b51a4f0be974eacf8a6c0f12b5d5aacdc7a5f
2019-04-01 18:59:35 -07:00
Paul Hu
b9cffc513e Merge "Fix IpPrefixTest#testContainsInetAddress fail."
am: 9c58ddc48e

Change-Id: I0926ee39c306fefdd158e1c4c7e4c1ba4b7c5f7d
2019-04-01 18:47:42 -07:00
Remi NGUYEN VAN
04c58fe907 Fix API in CaptivePortal, StaticIpConfiguration
- Add documentation to CaptivePortal#logEvent
 - Add paragraph breaks to StaticIpConfiguration class javadoc
 - Format javadoc for API documentation
 - Move setters to a builder and hide fields for apps targeting P or
   older
 - Document StaticIpConfiguration getters and builder setters
 - Add documentation for StaticIpConfiguration#getRoutes

Bug: 129362244
Bug: 129433304
Test: built, flashed, booted, WiFi working
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: Ia66c1097f01ca87d02eba3456547aedb1e480186
2019-04-02 10:43:04 +09:00
Paul Hu
9c58ddc48e Merge "Fix IpPrefixTest#testContainsInetAddress fail." 2019-04-02 01:33:02 +00:00
Chalard Jean
7c4f7c5fe3 Merge "Cleanup SystemReady in the network stack" am: ff23b6dce0 am: c1e58995da
am: d1a85fe60c

Change-Id: I0e57236ede9dd176cd30ea034d05205776662c91
2019-04-01 18:13:24 -07:00
Chalard Jean
d1a85fe60c Merge "Cleanup SystemReady in the network stack" am: ff23b6dce0
am: c1e58995da

Change-Id: Id1348ffa1406adf08b94eec18b3b1e6da40e84be
2019-04-01 17:41:35 -07:00
Chalard Jean
c1e58995da Merge "Cleanup SystemReady in the network stack"
am: ff23b6dce0

Change-Id: I1a55078b74d5f94afde94da0dc5f6e1d2af10de3
2019-04-01 17:12:06 -07:00
Chalard Jean
ff23b6dce0 Merge "Cleanup SystemReady in the network stack" 2019-04-01 23:28:47 +00:00
paulhu
207037a243 Fix IpPrefixTest#testContainsInetAddress fail.
The argument of IpPreFix#contains() has been marked as @NonNull.
So the IpPrefixTest#testContainsInetAddress should not test
contains() method wiht null object.

Bug: None
Test: atest FrameworksNetTests
      atest IpPrefixTest#testContainsInetAddress

Change-Id: I2f6bee19514dc47702f64d2a2bbf02d8b7b1b407
2019-04-02 00:49:00 +08:00
Xiao Ma
2476c3f532 Merge "Add DHCP address lease expiry in IpMemoryStore." am: 98aa76e2e8 am: bdb1f90f32
am: 77bd196428

Change-Id: Ib09ee6a702fb25a682d4782a8822237ebb9a0dfb
2019-04-01 06:35:34 -07:00
Xiao Ma
77bd196428 Merge "Add DHCP address lease expiry in IpMemoryStore." am: 98aa76e2e8
am: bdb1f90f32

Change-Id: I690d6c1602292731f27b3f2d0a1a36cf95849d2e
2019-04-01 06:27:18 -07:00
Xiao Ma
bdb1f90f32 Merge "Add DHCP address lease expiry in IpMemoryStore."
am: 98aa76e2e8

Change-Id: Idb73423aaf875bb77d19f9661e243f152f734fa3
2019-04-01 06:16:08 -07:00
Xiao Ma
98aa76e2e8 Merge "Add DHCP address lease expiry in IpMemoryStore." 2019-04-01 12:59:20 +00:00
paulhu
1a40765101 Address leftover comments on 923337 and 930217.
- Restrict unprivileged apps to use
  NetworkRequest.Builder#setSignalStrength.

- Remove the "throws NullPointerException" in
  CaptivePortalProbeSpec constructor.

- Remove the null check in LinkProperties.

- Add annotataion into all ConnectivityManager.NetworkCallback
  methods.

Change-Id: Id275cac1d6a30d7515cd7b113394f5e8a0179314
Fix: 129097486
Test: atest FrameworksNetTests
2019-04-01 16:24:10 +08:00
junyulai
646ee4621c Ignore the asynchronous result while stopping keepalive
Currently, onStopped callback are synchronizely triggered when
stop() was called, since the framework don't really care
about the result of stopping keepalive.

However, if keepalive failed to stop for some reason, the
handleStopKeepalive was called mistakenly and trigger additional
callback that fail the test case.

This commit is the behavior change prior to state machine
refactoring, and introduce a stopping state for ignoring the
result in the stopping state.

Bug: 129512753
Bug: 123988249
Test: 1. atest com.android.server.ConnectivityServiceTest \
         #testNattSocketKeepalives --generate-new-metrics 100
      2. atest FrameworksNetTests

Change-Id: I4fa94e0740ba488fb5fe7ac7c3812c195dd0ec4c
2019-04-01 16:22:02 +08:00
Paul Hu
614b2571b6 Merge "Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues." am: 1f041d1443 am: 9420c284b5
am: ea2bcdfa4e

Change-Id: I599dcdb2312a3e1bb1de8e03f349df207c7cc075
2019-04-01 00:52:53 -07:00
Paul Hu
ea2bcdfa4e Merge "Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues." am: 1f041d1443
am: 9420c284b5

Change-Id: I171e667dd279e008708fbc84972f63cbd5b55625
2019-04-01 00:43:33 -07:00
Paul Hu
9420c284b5 Merge "Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues."
am: 1f041d1443

Change-Id: I8d848c559e1c1e021a72bf525876aad9bddb3374
2019-04-01 00:34:26 -07:00
Paul Hu
1f041d1443 Merge "Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues." 2019-04-01 07:20:53 +00:00
Remi NGUYEN VAN
c8f93bca44 Merge "Fix race when starting NetworkMonitor" am: ef8485cc65 am: ea71c49a0e
am: 3a8102ab8e

Change-Id: I595ecdbf0b8e91fec4287c3476239a1e6c9c80a7
2019-03-31 21:35:25 -07:00