Commit Graph

173 Commits

Author SHA1 Message Date
Remi NGUYEN VAN
6ba6b79e51 Merge "Add comment for NetworkStack permissions" am: 154a0d0b38 am: b4493ea049
am: 0737917d03

Change-Id: If9c8d887e04bf173badb6b147d9a4379daf6d93f
2019-04-01 08:13:16 -07:00
Treehugger Robot
154a0d0b38 Merge "Add comment for NetworkStack permissions" 2019-04-01 14:45:18 +00:00
Xiao Ma
60a54acbbf Merge "Add DHCP address lease expiry in IpMemoryStore." am: 17ea70c6d3 am: 23f6cd281a
am: 8e6c80f238

Change-Id: Ib09ee6a702fb25a682d4782a8822237ebb9a0dfb
2019-04-01 06:35:34 -07:00
Xiao Ma
17ea70c6d3 Merge "Add DHCP address lease expiry in IpMemoryStore." 2019-04-01 12:59:20 +00:00
Paul Hu
b2913320cd Merge "Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues." am: f9d61f1c6d am: 96f34c3151
am: bf3e6f5e75

Change-Id: I599dcdb2312a3e1bb1de8e03f349df207c7cc075
2019-04-01 00:52:53 -07:00
Paul Hu
f9d61f1c6d Merge "Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues." 2019-04-01 07:20:53 +00:00
Chiachang Wang
5640a8d124 Merge "Provide link to android experimental flags API" am: 9876efdabe am: a94479c120
am: 8724b66c2d

Change-Id: I4045d54066cf1c8270bb6eca030daf0193721723
2019-03-31 22:25:35 -07:00
Chiachang Wang
9876efdabe Merge "Provide link to android experimental flags API" 2019-04-01 04:49:33 +00:00
Remi NGUYEN VAN
b93bfa1d69 Merge "Fix race when starting NetworkMonitor" am: 78454f3c46 am: f75ba075e4
am: 940cbf970a

Change-Id: I595ecdbf0b8e91fec4287c3476239a1e6c9c80a7
2019-03-31 21:35:25 -07:00
Remi NGUYEN VAN
e799f84de0 Add comment for NetworkStack permissions
Clarify that permissions must not be in the base package to avoid
crashes on devices using a network stack running in the system server
process.

Test: m
Change-Id: Ib13df84a43e960d01217c208d1c6775d1f81edc4
2019-04-01 04:24:14 +00:00
Remi NGUYEN VAN
95c5375a85 Merge "Move permissions from base to standard manifest" 2019-04-01 04:20:41 +00:00
Remi NGUYEN VAN
78454f3c46 Merge "Fix race when starting NetworkMonitor" 2019-04-01 03:54:03 +00:00
Remi NGUYEN VAN
3962f678c3 Fix race when starting NetworkMonitor
NetworkMonitor obtained LinkProperties and NetworkCapabilities via
synchronous calls to ConnectivityManager after receiving an asynchronous
notification, which is prone to races: the network could be gone before
the LinkProperties/NetworkCapabilities can be fetched.

Fix the race by passing LinkProperties/NetworkCapabilities directly to
NetworkMonitor in the asynchronous notifications.

Test: atest FrameworksNetTests NetworkStackTests
Test: booted, WiFi works
Bug: 129375892
Change-Id: I200ac7ca6ff79590b11c9be705f650c92fd3cb63
2019-04-01 11:33:10 +09:00
paulhu
819e0aff30 Fix ApfCapabilities, LinkAddress, RouteInfo, IpPrefix API issues.
Fix: 129362082
Fix: 129361362
Fix: 129360330
Fix: 129362379
Test: atest FrameworksNetTests NetworkStackTests
Change-Id: I05fbc6f98207d5cf002e3cbc5829040af7d6be52
2019-04-01 10:23:51 +08:00
Chiachang Wang
e027ed6d24 Provide link to android experimental flags API
Add function to link to android experiemental flags API

Bug: 120013793
Test: Build and atest NetworkStackTests
Change-Id: I14b9a6f06f841a9d63e8c1954907447a9e7eb8a5
2019-04-01 09:56:05 +08:00
Remi NGUYEN VAN
2a23dfde16 Move permissions from base to standard manifest
Permissions defined in AndroidManifest_Base.xml would be inherited in
AndroidManifest_InProcess.xml and cause issues on svelte builds, since
privileged permissions are not whitelisted for
com.android.networkstack.inprocess.

The network stack running in the system_server process does not need
these permissions anyway since it has system_server permissions.

(clean cherry-pick from Ica63ce586e701b1f2415a97f63ba27cc25e4830a)

Test: flashed, booted crosshatch_svelte-eng, WiFi works
Test: flashed, booted blueline-eng, WiFi works
Fixes: 129485310
Merged-In: Ica63ce586e701b1f2415a97f63ba27cc25e4830a
Change-Id: Ib4b478fb39f43a2fd4221c7d1f1ea51de04e0fba
2019-04-01 09:54:34 +08:00
Jeff Hamilton
ad2a94770f Set the version code to 0200000000
Bug: 129093117
Change-Id: I6397511874afb47ba9c034f74ad8f748e50e23b9
2019-03-29 14:25:20 -04:00
TreeHugger Robot
60852eab5c Merge "Move permissions from base to standard manifest" 2019-03-29 13:37:20 +00:00
Aaron Huang
1b0b7d406b Merge "apf: Documentation improvements and code optimizations for keepalive filters" am: f5166d5527 am: 3eb37cda43
am: fcf00a95b0

Change-Id: Ic0e693dcdf2033abc1e976d9cc18365792181571
2019-03-29 06:35:21 -07:00
Aaron Huang
f5166d5527 Merge "apf: Documentation improvements and code optimizations for keepalive filters" 2019-03-29 13:03:20 +00:00
Remi NGUYEN VAN
d4cbba8f18 Move permissions from base to standard manifest
Permissions defined in AndroidManifest_Base.xml would be inherited in
AndroidManifest_InProcess.xml and cause issues on svelte builds, since
privileged permissions are not whitelisted for
com.android.networkstack.inprocess.

The network stack running in the system_server process does not need
these permissions anyway since it has system_server permissions.

Test: flashed, booted crosshatch_svelte-eng, WiFi works
Test: flashed, booted blueline-eng, WiFi works
Fixes: 129485310
(clean cherry-pick from aosp/937139)

Change-Id: Ica63ce586e701b1f2415a97f63ba27cc25e4830a
2019-03-29 17:39:58 +09:00
Remi NGUYEN VAN
329c4dadbe Add NetworkStackTests dependency on libdl_android
This fixes tests that were failing because of the unsatisfied
dependency.

Test: atest NetworkStackTests
Bug: 129387775
Change-Id: Ie0c1bc2b292ad7172d144d9e7ad9edeecd2232b7
2019-03-29 17:39:52 +09:00
Xiao Ma
385ccb05c8 Add DHCP address lease expiry in IpMemoryStore.
Bug:122710829
Test: atest FrameworksNetTests
Change-Id: I643fe1231edcd18923514ab66c64a6cf83e69443
2019-03-29 16:51:47 +09:00
Remi NGUYEN VAN
3049d3b682 Merge "Fix message names in dumpsys network_stack" am: 3c776e8793 am: bae08510a2
am: f93d3f9a79

Change-Id: I3caa485fb7bb8713192c6b726bc7f9e541fc7444
2019-03-27 17:49:16 -07:00
Remi NGUYEN VAN
3c776e8793 Merge "Fix message names in dumpsys network_stack" 2019-03-28 00:14:31 +00:00
Lorenzo Colitti
aef32a4811 Merge "Enable more logs for networking" am: f3736d67f8 am: 310609b8be
am: d33e31e27a

Change-Id: Icd81490cabaaf1d164ce77bda76b196b869c8721
2019-03-27 01:34:53 -07:00
Remi NGUYEN VAN
aaa7ecfd3b Fix message names in dumpsys network_stack
Constants were stripped out by ProGuard, so
MessageUtils.findMessageNames would fail to find them.

Test: flashed, dumpsys network_stack shows message names
Fixes: 124619824
Change-Id: I285ce2ab52cdff48f17b422285a635bd34243498
2019-03-27 14:12:18 +09:00
Ruoyao Liu
37293308b4 Enable more logs for networking
Sometimes we would encounter problems that happen by chance and
hard to reproduce. So we recommend to enable more logs in ENG and
UESRDEBUG load by default.

Bug: 123256412
Test: android.net.ip.IpClientTest can pass
Change-Id: Ia3363de96966a4e86ab550c768fb70317da005ed
2019-03-26 12:57:17 +08:00
Aaron Huang
75a6043bf1 apf: Documentation improvements and code optimizations for keepalive filters
Optimizing instruction to reduce code size of keepalive filters.

Bug: 123992088
Test: atest NetworkStackTests
Change-Id: I9ae55977c6d6740277ba55603ee957f33a97ecaa
2019-03-25 23:38:41 +08:00
Remi NGUYEN VAN
80ce3a3bf9 Merge "Compile NetworkStack resources only once" am: 963136ce56 am: 4aea56297c
am: b4c9d697f5

Change-Id: Ibbe585e2dd8c9df6ef99cf1aacfb899331f70a80
2019-03-25 01:11:17 -07:00
Remi NGUYEN VAN
963136ce56 Merge "Compile NetworkStack resources only once" 2019-03-25 07:40:33 +00:00
Remi NGUYEN VAN
516d750ae2 Merge "Separate NetworkMonitor/framework portal URL" am: bcd3bed561 am: 34198fac89
am: 4d975feb9f

Change-Id: I85e744d94d96ecf9ac558e62016418d8199bb98c
2019-03-24 20:23:39 -07:00
Remi NGUYEN VAN
86c45823c7 Compile NetworkStack resources only once
The current build files would compile resources both for the
android_library and the android_app build rules, since the android_app
build rule resource_dirs default to ["res"]. Set resource_dirs to [] for
these build rules so that resources are only inherited from the
android_library.

Also refactor the build file using java_defaults to avoid repeating
configuration.

Test: flashed, boots, WiFi working
Bug: 127908503
Change-Id: Ie51dd1bd1a8ee5145e3f1b95beb1de59665b4c51
2019-03-25 11:54:41 +09:00
Remi NGUYEN VAN
bcd3bed561 Merge "Separate NetworkMonitor/framework portal URL" 2019-03-25 02:50:37 +00:00
Treehugger Robot
3c959339ae Merge "Fix API in CaptivePortal and ConnectivityManager" 2019-03-25 02:37:28 +00:00
Chiachang Wang
727f8bbfc6 Merge "Add network stack proto" 2019-03-25 02:16:16 +00:00
Remi NGUYEN VAN
e2365d6644 Fix API in CaptivePortal and ConnectivityManager
- Remove CaptivePortal constructor from SystemApi. This constructor was
   added in Q timeframe and ends up being unnecessary since
   CaptivePortal creation was refactored to ConnectivityService because
   of visibility issues on ICaptivePortal.
 - Rename getAvoidBadWifi to shouldAvoidBadWifi
 - Add permission annotation for shouldAvoidBadWifi

(already merged in internal as:
I09545c00af3519dbf141dd5951b28f49e37b3e80)

Test: flashed, WiFi and captive portal works
Bug: 128935314
Bug: 128935673
Merged-In: I09545c00af3519dbf141dd5951b28f49e37b3e80
Change-Id: I7395d4a4db6a64398a827692aee1956c011873e5
2019-03-25 01:43:48 +00:00
Lorenzo Colitti
445d56756a Merge "Fix API in CaptivePortal and ConnectivityManager" 2019-03-22 11:46:21 +00:00
Remi NGUYEN VAN
a96469e370 Merge "Fix targetSdkVersion for NetworkStack" am: 42b97de9d3 am: ba2f3d2fdf
am: 1e7e29593b

Change-Id: Ic2d8c541ab6ba827d13f7d6a00a6f3b279489646
2019-03-22 04:12:02 -07:00
Chiachang Wang
8f252c1598 Merge "Add network stack proto" 2019-03-22 09:43:40 +00:00
Treehugger Robot
afa94f4664 Merge "Renamed the variable" 2019-03-22 09:14:14 +00:00
Remi NGUYEN VAN
24ec3ff006 Fix API in CaptivePortal and ConnectivityManager
- Remove CaptivePortal constructor from SystemApi. This constructor was
   added in Q timeframe and ends up being unnecessary since
   CaptivePortal creation was refactored to ConnectivityService because
   of visibility issues on ICaptivePortal.
 - Rename getAvoidBadWifi to shouldAvoidBadWifi
 - Add permission annotation for shouldAvoidBadWifi

Test: flashed, WiFi and captive portal works
Bug: 128935314
Bug: 128935673
(clean cherry-pick of AOSP I7395d4a4db6a64398a827692aee1956c011873e5)

Change-Id: I09545c00af3519dbf141dd5951b28f49e37b3e80
2019-03-22 17:16:52 +09:00
Remi NGUYEN VAN
42b97de9d3 Merge "Fix targetSdkVersion for NetworkStack" 2019-03-22 07:00:50 +00:00
Remi NGUYEN VAN
0bd294cd55 Separate NetworkMonitor/framework portal URL
The framework cannot return URLs used by the updatable NetworkStack,
which may use configurable URLs, changing URLs, or mechanisms not
involving URLs to detect captive portals. NetworkMonitor has already
been using random fallback URLs for a while that do not match the value
returned by ConnectivityManager#getCaptivePortalServerUrl.

With this change, the default value returned by the framework is
configured in framework resources as
config_networkDefaultCaptivePortalServerUrl. NetworkMonitor behavior may
change as it is an updatable component, but the current URL is
configured in NetworkMonitor resources as
config_captive_portal_http_url.

Test: flashed, booted, WiFi and captive portal working
Test: ConnectivityManager#getCaptivePortalServerUrl returns correct
      value.
Bug: 127908503
Change-Id: I371dedc5b22efa909d7fd58e1ebe9b8aaced9780
2019-03-22 15:11:14 +09:00
Paul Hu
21b9f61f6f Merge "Fix Automated API Review issues." am: 43c1ade661 am: 9e3f29037b
am: ce18c5a1ec

Change-Id: Iba1630161579571d4975aba9bbd5c767f82c8a98
2019-03-21 11:54:51 -07:00
Paul Hu
43c1ade661 Merge "Fix Automated API Review issues." 2019-03-21 17:19:26 +00:00
Chiachang Wang
4d6fe320e6 Add network stack proto
Bug: 128887306
Test: Build pass
Change-Id: I7cfccb33033afadaca608f383a94df0ef363cc77
Merged-In: Iec48037771f2729fcbf741eb1c16edf08dbc70a4
2019-03-21 20:46:02 +08:00
paulhu
d9736de38b Fix Automated API Review issues.
1. Some API's argument/return value must be marked either
@NonNull or @Nullable.
2. Change some system APIs to public APIs.
3. Modify the method name

Bug: 126700123
Bug: 126702339
Bug: 126699682
Bug: 118296575
Bug: 126699216
Bug: 126699675
Bug: 126699429
Bug: 126699193
Bug: 123586045
Test: atest FrameworksNetTests
Change-Id: Iaa2832cdcf83758ed0fec81b954a0c63bc5a7bf6
2019-03-21 13:55:37 +08:00
Lucas Lin
725b513e5d Merge "Improve partial connectivity" am: f6cbc2d533 am: 270e77d930
am: 728a68eefc

Change-Id: I25f9d056c26bf947c2e09516da51b627c3da9685
2019-03-20 21:15:34 -07:00
Lucas Lin
f6cbc2d533 Merge "Improve partial connectivity" 2019-03-21 03:34:30 +00:00