Commit Graph

144 Commits

Author SHA1 Message Date
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
Chiachang Wang
0e88ebfb28 Add network stack proto
Bug: 128887306
Test: Build pass
Change-Id: Iec48037771f2729fcbf741eb1c16edf08dbc70a4
2019-03-21 10:18:07 +08:00
Jack Yu
8e7b924cf8 Renamed the variable
Changed nrs (stands for NetworkRegistrationState) to
nri (stands for NetworkRegistrationInfo).

Test: Build
Bug: 127657991
Merged-In: I4deb1271818019465c55b59cd4a4a8029b514697
Change-Id: I4deb1271818019465c55b59cd4a4a8029b514697
(cherry picked from commit 1746d2582a)
2019-03-20 14:36:42 -07:00
lucaslin
4333899a41 Improve partial connectivity
Improve the design and fix some nits.

Bug: 113450764
Test: 1. Build pass
      2. atest FrameworksNetTests
      3. atest NetworkStackTests
      4. Change captive_portal_https_url to https://invalid.com
      to simulate partial connectivity.
Change-Id: Ia56645841d00d2ed8406cfeacb86a4a27fd58650
2019-03-20 18:21:59 +08:00
Lorenzo Colitti
74867d1661 Merge changes from topic "framework-no-networkstack-aidl"
* changes:
  Remove the framework dependency on netd_aidl_parcelables-java.
  Move TcpKeepalivePacketData out of the framework.
  Stop using netd parcelables in the framework.
2019-03-20 09:45:37 +00:00
Remi NGUYEN VAN
ae1ef49436 Fix targetSdkVersion for NetworkStack
targetSdkVersion was set to 28 in aosp/916713, however this was broken
by the manifest refactor in aosp/923338: the targetSdk is not preserved
in the manifest merge.

Test: aapt dump badging shows targetSdkVersion 28
Change-Id: I7d06b141856e96ef011db32094bfc62a8cd1b350
2019-03-20 17:29:10 +09:00
Lorenzo Colitti
a3f811a547 Move TcpKeepalivePacketData out of the framework.
This class is not used in framework.jar, only in services.jar.
Move it out of the framework so framework.jar can stop depending
on the NetworkStack stable AIDL interfaces.

This should really under com.android.server as well, but that's
a cross-project change to be done in another CL.

Test: m
Bug: 128804404
Change-Id: Ib2805f7fcc516a5f6989c252365d1c95b8042703
Merged-In: Ib2805f7fcc516a5f6989c252365d1c95b8042703
2019-03-20 08:56:31 +09:00
Lorenzo Colitti
b90ad24f99 Stop using netd parcelables in the framework.
The only actual users of these classes are in services.jar, not
in frameworks.jar. The only reason the framework depends on them
is that the code that converts to and from stable parcelables is
currently in the framework. Move that code to services and cut
the dependency.

These classes aren't used in the networkstack app so they don't
need to be in shared. They also can't be in shared because the
classes are not in the SDK. So put the conversion functions
directly inside their only user (NetworkManagementService).

Also remove the jarjar rules that rename the classes for use by
the NetworkStack app.

This does not actually remove the dependency from the build file,
that will be done in a future CL.

Bug: 128804404
Test: builds, boots
Test: atest FrameworksNetTests android.net.cts.ConnectivityManagerTest HostsideVpnTests
Change-Id: I027d50ba56091f5558f45e6e08f32e5912b2a82a
Merged-In: I027d50ba56091f5558f45e6e08f32e5912b2a82a
2019-03-20 08:56:24 +09:00
Lorenzo Colitti
27e59c575c Move TcpKeepalivePacketData out of the framework.
This class is not used in framework.jar, only in services.jar.
Move it out of the framework so framework.jar can stop depending
on the NetworkStack stable AIDL interfaces.

This should really under com.android.server as well, but that's
a cross-project change to be done in another CL.

Test: m
Bug: 128804404
Change-Id: Ib2805f7fcc516a5f6989c252365d1c95b8042703
2019-03-20 00:49:33 +09:00
Lorenzo Colitti
cc7f1db970 Stop using netd parcelables in the framework.
The only actual users of these classes are in services.jar, not
in frameworks.jar. The only reason the framework depends on them
is that the code that converts to and from stable parcelables is
currently in the framework. Move that code to services and cut
the dependency.

These classes aren't used in the networkstack app so they don't
need to be in shared. They also can't be in shared because the
classes are not in the SDK. So put the conversion functions
directly inside their only user (NetworkManagementService).

Also remove the jarjar rules that rename the classes for use by
the NetworkStack app.

This does not actually remove the dependency from the build file,
that will be done in a future CL.

Bug: 128804404
Test: builds, boots
Test: atest FrameworksNetTests android.net.cts.ConnectivityManagerTest HostsideVpnTests
Change-Id: I027d50ba56091f5558f45e6e08f32e5912b2a82a
2019-03-20 00:49:32 +09:00
Jack Yu
f9d06c78d8 Renamed NetworkRegistrationState to NetworkRegistrationInfo
API review changes. The class covers more information other than
registration state.

Test: Build
Bug: 127657991
Merged-In: I8af36b388182ab08257b64c37078f156d4821709
Change-Id: I8af36b388182ab08257b64c37078f156d4821709
(cherry picked from commit e27d3fde88)
2019-03-19 06:55:12 -07:00
Xiao Ma
2ce206c82d Merge "Move the IpMemoryStore to the network stack." am: 93bf5ef495 am: 5db1518bfa
am: 3176d57308

Change-Id: I243056012d2f099d96a33657c0eb63a5b66a2cfe
2019-03-19 06:54:43 -07:00
Jack Yu
1746d2582a Renamed the variable
Changed nrs (stands for NetworkRegistrationState) to
nri (stands for NetworkRegistrationInfo).

Test: Build
Bug: 127657991
Change-Id: I4deb1271818019465c55b59cd4a4a8029b514697
2019-03-18 11:01:42 -07:00
Jack Yu
e27d3fde88 Renamed NetworkRegistrationState to NetworkRegistrationInfo
API review changes. The class covers more information other than
registration state.

Test: Build
Bug: 127657991
Change-Id: I8af36b388182ab08257b64c37078f156d4821709
2019-03-18 00:17:54 -07:00
Chalard Jean
952135122d Move the IpMemoryStore to the network stack.
Test: atest FrameworksNetTests
Change-Id: Ic5bd6ff54b09a6fa92b6863f240a5b053011acb6
2019-03-18 11:33:17 +09:00
Remi NGUYEN VAN
a47b222a5f Merge "Remove NetworkParcelable" am: 205886d28f am: 7201f61c57
am: 13be9e9fcd

Change-Id: Ifec0dd683bf9c9b73c4af12835b76d284559daf8
2019-03-17 19:12:02 -07:00
Remi NGUYEN VAN
462e944ff9 Merge "Remove aidl wrappers for framework parcelables" am: 1a1396070e am: 7cf43a2f53
am: 5fd40295cb

Change-Id: I019fbbfd5dde5268cbb38bdaee1bc50a434372bc
2019-03-17 18:59:43 -07:00
Remi NGUYEN VAN
205886d28f Merge "Remove NetworkParcelable" 2019-03-18 01:30:25 +00:00
Remi NGUYEN VAN
1a1396070e Merge "Remove aidl wrappers for framework parcelables" 2019-03-18 01:30:01 +00:00
Remi NGUYEN VAN
904a38be5e Remove NetworkParcelable
With the @JavaOnlyStableParcelable annotation, Network can now be used
as-is as a framework parcelable.

Test: atest FrameworksNetTests NetworkStackTests
Bug: 126477266
Change-Id: I5d9695a31b3ac48d10edcf08ccd0c34375353b79
2019-03-16 03:51:09 +09:00
Remi NGUYEN VAN
e80be85790 Remove aidl wrappers for framework parcelables
The new @JavaOnlyStableParcelable annotation allows using the framework
parcelables directly, which removes a lot of boilerplate.

Includes new copy constructors for IpPrefix and LinkAddress so they can
be copied easily as-is into parcelables.

Test: atest FrameworksNetTests
Test: booted, WiFi works
Bug: 126477266

Change-Id: Icac8afe498d0b5ebf9a0d0b9eceb14d64a29b381
2019-03-16 03:50:58 +09:00
Jack Yu
6f7b30499c Moved transport to IntDef
Moved out from the sub class per API review feedback.

Test: Build
Bug: 128607082
Merged-In: I1b513bcaaa0ebf47c14593d962579ed48a7c6db0
Change-Id: I1b513bcaaa0ebf47c14593d962579ed48a7c6db0
2019-03-14 20:32:16 -07:00
Jack Yu
ef25faf013 Moved transport to IntDef
Moved out from the sub class per API review feedback.

Test: Build
Bug: 128607082
Change-Id: I1b513bcaaa0ebf47c14593d962579ed48a7c6db0
2019-03-14 19:24:49 -07:00
Chiachang Wang
0630d6fffa Merge "Support partial connectivity probe result option" am: da0ebedb47 am: cca7cdc8d9
am: 07b34ba935

Change-Id: I8781b8df0ec631cf4675335c30f7954254b0c617
2019-03-13 00:18:17 -07:00
Chiachang Wang
8737d25ed2 Support partial connectivity probe result option
Bug: 124629963
Test: atest NetworkStackTests
Change-Id: I1c22bad6ba94d23892e8907d6e7b28d074922339
2019-03-12 18:28:24 +08:00
Lucas Lin
fc0fbbb3af Merge "Check if network has partial connectivity" am: 174ae05817 am: 6cf91d1558
am: c0448b383f

Change-Id: Ib6c5ecc8238e1ac237eddcc00802fa5e7c0e24b9
2019-03-12 01:47:25 -07:00
lucaslin
e252a740ca Check if network has partial connectivity
In some networks, network validation may only get success
result for http probe but fail result for https probe.
For this kind of network, it may still work at some websites
or apps, but user didn't know about that. In order to fix this
issue, we will check if network has partial connectivity and
notify user to make a choice if they want to use this partial
connectivity or not.

Bug: 113450764
Test: 1. Build pass.
      2. Fake partial connectivity case for testing.
      3. atest FrameworksNetTests
      4. atest NetworkStackTests

Change-Id: I69ed00ac4850904ff708c9fef22e148879a10e92
2019-03-12 07:37:33 +00:00
Remi NGUYEN VAN
03fdf35208 Merge "Use an in-process APK for in-process NetworkStack" am: b8f2ab9362 am: 13f2f93cd3
am: ad9be46d09

Change-Id: Ic440d09c0198c8b2161c74b52cbacf884c1d3df5
2019-03-11 19:19:47 -07:00
Remi NGUYEN VAN
b8f2ab9362 Merge "Use an in-process APK for in-process NetworkStack" 2019-03-12 01:37:26 +00:00
Remi NGUYEN VAN
177caed0d1 Merge changes I9dbbf904,Iebc174ed am: 06d8067975 am: 91b2b0cc60
am: 45a41cf19d

Change-Id: I2e154179065afb9df7731cfbdb641f0d9c7dcdcf
2019-03-10 19:39:29 -07:00