Commit Graph

3262 Commits

Author SHA1 Message Date
Chenbo Feng
690a59843c Merge "Return non-negetive value in getMobileStats method" am: bb1d07e681 am: 515a54a93e
am: 7b5487cd0a

Change-Id: I304f42d473289ad876f6ceae8d6866e4248686a9
2018-02-02 17:59:53 +00:00
Chenbo Feng
7b5487cd0a Merge "Return non-negetive value in getMobileStats method" am: bb1d07e681
am: 515a54a93e

Change-Id: I54a400b4231c38db25aa1b717f302a8a52e1773e
2018-02-02 17:02:10 +00:00
Adam Vartanian
fa872759b0 Merge changes from topic "am-f1eb5cc5-7ac1-4540-b9cf-e0577f9334e7" into oc-dev am: 36c202ed80 am: cf31e066a9 am: f64dcd5bb5
am: 6e6d44012f

Change-Id: Ic105693209501df8aa09d05f993f506aeb77eca5
2018-02-02 08:31:42 +00:00
Adam Vartanian
6e6d44012f Merge changes from topic "am-f1eb5cc5-7ac1-4540-b9cf-e0577f9334e7" into oc-dev am: 36c202ed80 am: cf31e066a9
am: f64dcd5bb5

Change-Id: I5980a614656d41f648da5a57c933533705a89c63
2018-02-02 07:05:29 +00:00
Treehugger Robot
bb1d07e681 Merge "Return non-negetive value in getMobileStats method" 2018-02-02 04:22:34 +00:00
Adam Vartanian
f64dcd5bb5 Merge changes from topic "am-f1eb5cc5-7ac1-4540-b9cf-e0577f9334e7" into oc-dev am: 36c202ed80
am: cf31e066a9

Change-Id: I774ce7a4046548222c3a0d913bbfcc3e0759ede3
2018-02-02 03:46:04 +00:00
Adam Vartanian
cf31e066a9 Merge changes from topic "am-f1eb5cc5-7ac1-4540-b9cf-e0577f9334e7" into oc-dev
am: 36c202ed80

Change-Id: Ieb4b5cd2cafd20d4898bc781c43e41d3bed0d7dc
2018-02-01 23:44:18 +00:00
Benedict Wong
309cb2838f Merge "Fix minor bugs with tunnel mode implementation" am: cb9cd96c50 am: b7afa3f6fb
am: dcb9219764

Change-Id: Ie74c4edcc7586e0220ff948222010e126841e8f7
2018-02-01 04:12:18 +00:00
Benedict Wong
dcb9219764 Merge "Fix minor bugs with tunnel mode implementation" am: cb9cd96c50
am: b7afa3f6fb

Change-Id: I9c2a844d9ccc401a34d0e6318506406e8c33fab6
2018-02-01 03:49:45 +00:00
Android Build Merger (Role)
4f46378ab7 [automerger] Adjust URI host parsing to stop on \ character. am: fa3afbd0e7 am: 97668ae137 am: fddbf1b6b2 am: d3c0db66b9 am: 373cfa75c0 am: bdff04aba3 am: 7341805cac am: 885a2ecf96 am: 54f1b302ab am: 6b1b3c9bdc
Change-Id: Iceaaaec271c590da862e65002396222aab9219e8
2018-01-31 11:21:07 +00:00
Android Build Merger (Role)
6b1b3c9bdc [automerger] Adjust URI host parsing to stop on \ character. am: fa3afbd0e7 am: 97668ae137 am: fddbf1b6b2 am: d3c0db66b9 am: 373cfa75c0 am: bdff04aba3 am: 7341805cac am: 885a2ecf96 am: 54f1b302ab
Change-Id: I09260b353e45dac4c59b920b0166d40b3eb810aa
2018-01-31 11:21:02 +00:00
Android Build Merger (Role)
885a2ecf96 [automerger] Adjust URI host parsing to stop on \ character. am: fa3afbd0e7 am: 97668ae137 am: fddbf1b6b2 am: d3c0db66b9 am: 373cfa75c0 am: bdff04aba3 am: 7341805cac
Change-Id: Ib4cb67450dcb8e35693030d77e2ec815d23275d1
2018-01-31 11:20:48 +00:00
Android Build Merger (Role)
7341805cac [automerger] Adjust URI host parsing to stop on \ character. am: fa3afbd0e7 am: 97668ae137 am: fddbf1b6b2 am: d3c0db66b9 am: 373cfa75c0 am: bdff04aba3
Change-Id: Ieddabe1b12f34bd7632ce893ef4e0c298f5c44df
2018-01-31 11:20:41 +00:00
Android Build Merger (Role)
bdff04aba3 [automerger] Adjust URI host parsing to stop on \ character. am: fa3afbd0e7 am: 97668ae137 am: fddbf1b6b2 am: d3c0db66b9 am: 373cfa75c0
Change-Id: Ia7b1157fb7f2066e26dc82ec703f39cd9fa69fd7
2018-01-31 11:20:28 +00:00
Android Build Merger (Role)
373cfa75c0 [automerger] Adjust URI host parsing to stop on \ character. am: fa3afbd0e7 am: 97668ae137 am: fddbf1b6b2 am: d3c0db66b9
Change-Id: If07298bb4ecf8a55391a014568a3ea264358b0e9
2018-01-31 11:20:21 +00:00
Android Build Merger (Role)
d3c0db66b9 [automerger] Adjust URI host parsing to stop on \ character. am: fa3afbd0e7 am: 97668ae137 am: fddbf1b6b2
Change-Id: I3fd20a3ee5eaa6be1c1989f13d40aed34136557e
2018-01-31 11:20:15 +00:00
Android Build Merger (Role)
fddbf1b6b2 [automerger] Adjust URI host parsing to stop on \ character. am: fa3afbd0e7 am: 97668ae137
Change-Id: Ic336b5fafebabdd4a5ad4d775a96d76739189a09
2018-01-31 11:20:08 +00:00
Android Build Merger (Role)
97668ae137 [automerger] Adjust URI host parsing to stop on \ character. am: fa3afbd0e7
Change-Id: I20336a5786e753e6941b9a784068480475415110
2018-01-31 11:19:56 +00:00
Adam Vartanian
fa3afbd0e7 Adjust URI host parsing to stop on \ character.
The WHATWG URL parsing algorithm [1] used by browsers says that for
"special" URL schemes (which is basically all commonly-used
hierarchical schemes, including http, https, ftp, and file), the host
portion ends if a \ character is seen, whereas this class previously
continued to consider characters part of the hostname.  This meant
that a malicious URL could be seen as having a "safe" host when viewed
by an app but navigate to a different host when passed to a browser.

[1] https://url.spec.whatwg.org/#host-state

Bug: 71360761
Test: vogar frameworks/base/core/tests/coretests/src/android/net/UriTest.java (on NYC branch)
Test: cts -m CtsNetTestCases (on NYC branch)
Change-Id: Id53f7054d1be8d59bbcc7e219159e59a2425106e
2018-01-31 11:14:45 +00:00
Benedict Wong
b8ef541cbc Fix minor bugs with tunnel mode implementation
This change makes sure tunnel mode transforms are properly activated
upon construction, and corrects bugs with how policy selectors were being
generated for tunnel mode policies. Specifically, the source/destination could
not be empty strings, even for cases where an empty selector was desired.

Bug: 72457770
Test: GTS tests run
Change-Id: I9a9f64c34b07883a02a5c996614f958486d214fc
2018-01-31 01:16:53 +00:00
nharold
a325e4dac1 Merge changes from topic "cherry-pick-cell-keepalive" am: 8cabb012fa
am: 02fecd46de

Change-Id: Ib4ba3f739a91ea2700611732f71afec0cc997ae4
2018-01-30 19:52:22 +00:00
Chenbo Feng
20328e8df0 Return non-negetive value in getMobileStats method
The current implementation of getMobileRxBytes and all the similiar
method adds up the return values for multiple calls to getRxBytes so if
all of them return UNSUPPORTED for any reason, getMobileRxBytes() would
return a value such as -3. This behavior is not compliance with the cts
TrafficStatsTest which always assume getMobileRxBytes to return a
non-negetive value. The method now will check tha stats get from
getRxBytes method and add them up only if the stats is valid.

Bug: 72473294
Test: run cts -m CtsNetTestCases -t android.net.cts.TrafficStatsTest
Change-Id: I656970ebc8f6506cf17c4353ad46c0178bb65cfd
2018-01-29 12:19:26 -08:00
Nathan Harold
70224716b3 Rework KeepalivePacketData for Compatibility with Cell
KeepalivePacketData currently mixes multiple concepts: the
list of parameters that are used to generate a keepalive
packet, the keepalive packet itself, and the parameters that
are needed to send a keepalive packet over an ethernet link.

The KeepalivePacketData is now a parcelable that can be used
generically by any NetworkAgent, regardless of how that Agent
fulfills its duty to initiate and maintain a keepalive session.

Bug: 69063212
Test: verified with SL4A, additional tests pending
Merged-In: I23dc4827ae729583356a8ff0f02e39a2ad2b81f5
Change-Id: I23dc4827ae729583356a8ff0f02e39a2ad2b81f5
(cherry picked from commit 26deacfbe7)
2018-01-29 11:20:20 -08:00
Nathan Harold
26de1d3b90 Relocate KeepalivePacketData to frameworks/base
Due to an issue resolving the boot classpath, the
KeepalivePacketData structure cannot be referenced
by frameworks/opt/telephony while it is in services.

-Move KeepalivePacketData to android.net
-Also, relocate IpUtils without changing the package
 name.

Bug: 38350389
Test: compilation
Merged-In: If5fc63e9ad8b9b2d4c2fee47ff4bab2ab190a05a
Change-Id: If5fc63e9ad8b9b2d4c2fee47ff4bab2ab190a05a
(cherry picked from commit 41002e3080)
2018-01-29 11:19:43 -08:00
Android Build Merger (Role)
c7810244db Merge "Merge "Tcp socket metrics: implement INetdEventListener callback" am: 93b1787a3d am: 5ba62a2194" into oc-mr1-dev-plus-aosp
am: 0bde9c4355

Change-Id: Id17724faabe77fb7eaad7d3a7e009fb57f0d23d0
2018-01-25 23:22:31 +00:00
Hugo Benichi
65bbfa1c6c Merge "Tcp socket metrics: implement INetdEventListener callback" am: 93b1787a3d
am: 5ba62a2194

Change-Id: I6c30a47ed35394d63b266250e3525976844b0e8f
2018-01-25 22:19:53 +00:00
Treehugger Robot
93b1787a3d Merge "Tcp socket metrics: implement INetdEventListener callback" 2018-01-25 19:23:18 +00:00
nharold
f5092a106b Merge "Move Keepalive out of IpSecTransform.Builder" am: af3fb3efe4 am: bbb4b05a64
am: 461aeb4689

Change-Id: Ic554e34d9b16f522156bc7e8b176f96693e8e32c
2018-01-25 07:59:57 +00:00
nharold
461aeb4689 Merge "Move Keepalive out of IpSecTransform.Builder" am: af3fb3efe4
am: bbb4b05a64

Change-Id: I383aa402d9d570ee7c7d5a603d022d1dade267a5
2018-01-25 07:49:59 +00:00
Chalard Jean
16897eb4aa Merge "Fix a bug where a NetworkAgent gets repeatedly torn down" am: a8452ed2a6
am: 806f0191d4

Change-Id: Ifd63fdf47348dc3a1c1871deacc61470784bdbb6
2018-01-25 07:41:44 +00:00
nharold
af3fb3efe4 Merge "Move Keepalive out of IpSecTransform.Builder" 2018-01-25 05:50:33 +00:00
Chalard Jean
477e36c5fb Fix a bug where a NetworkAgent gets repeatedly torn down
mUids is not marshalled correctly when null so if the
NetworkAgent runs in another process and is not a VPN then
the system will see its allowed Uids as being the empty
list (= nobody can use this network) instead of a null
list (= everybody can use this network). This breaks
emulator networking.

Bug: 72436966
Test: runtests frameworks-net
Test: also manual testing, this does fix emulator networking
      and seems not to break phone networking
Cherry-pick of : Id2bbf3808e80b19cd055c832c11cf72372710942

Change-Id: I4b88d5eccbdea745a947d12635cd751e38632589
2018-01-25 13:57:51 +09:00
Chalard Jean
cf8c3fe19c Fix a bug where a NetworkAgent gets repeatedly torn down
mUids is not marshalled correctly when null so if the
NetworkAgent runs in another process and is not a VPN then
the system will see its allowed Uids as being the empty
list (= nobody can use this network) instead of a null
list (= everybody can use this network). This breaks
emulator networking.

Bug: 72436966
Test: runtests frameworks-net
Test: also manual testing, this does fix emulator networking
      and seems not to break phone networking
Change-Id: Id2bbf3808e80b19cd055c832c11cf72372710942
2018-01-25 04:51:44 +00:00
Hugo Benichi
f90773cf4f Tcp socket metrics: implement INetdEventListener callback
This patch implements the new INetdEventListener.onTcpSocketStatsEvent
callback added in INetdEventListener.

For the time being, tcp socket stats are tracked inside TcpMetrics only
for dumpsys printing and bug report integration as a first step.

Bug: 64147860
Test: manually tested, watching output of
      $ adb shell dumpsys connmetrics
Change-Id: I10ab24c6da4bb654d9198a4d8d00ccdc972cc0d5
2018-01-25 13:26:43 +09:00
Nathan Harold
c43e89f973 Move Keepalive out of IpSecTransform.Builder
The lifecycle of Keepalive offloading is, unfortunately
different from that of an IpSecTransform. Because starting
a keepalive is fundamentally asynchronous, and isn't valid
until after a transform exists, it will now be a separate
optional procedure that may succeed or fail. It remains
linked with a Transform by the need for a Transform to exist
in order to initiate a Keepalive.

Bug: 38350389
Test: compilation
Change-Id: Ia76fccee41f86d694dff436043293d0c0762c041
2018-01-24 19:32:04 -08:00
Nathan Harold
26deacfbe7 Rework KeepalivePacketData for Compatibility with Cell
KeepalivePacketData currently mixes multiple concepts: the
list of parameters that are used to generate a keepalive
packet, the keepalive packet itself, and the parameters that
are needed to send a keepalive packet over an ethernet link.

The KeepalivePacketData is now a parcelable that can be used
generically by any NetworkAgent, regardless of how that Agent
fulfills its duty to initiate and maintain a keepalive session.

Bug: 69063212
Test: verified with SL4A, additional tests pending
Change-Id: I23dc4827ae729583356a8ff0f02e39a2ad2b81f5
2018-01-24 11:13:19 -08:00
Nathan Harold
41002e3080 Relocate KeepalivePacketData to frameworks/base
Due to an issue resolving the boot classpath, the
KeepalivePacketData structure cannot be referenced
by frameworks/opt/telephony while it is in services.

-Move KeepalivePacketData to android.net
-Also, relocate IpUtils without changing the package
 name.

Bug: 38350389
Test: compilation
Change-Id: If5fc63e9ad8b9b2d4c2fee47ff4bab2ab190a05a
(cherry picked from commit bd4093be7cab51d6ad031854324134a9c8637c2c)
2018-01-24 10:26:04 -08:00
Benedict Wong
f68e5b63ca Merge "Add TunnelInterface API and KernelResourceRecords" am: f811dff3bc am: e1aa92f1c1
am: eacecc37e8

Change-Id: I955d5090171f08e4fa20eac5bdfe761132b87d35
2018-01-24 09:54:06 +00:00
Benedict Wong
e65d8141de Merge "Add xfrm mark in IpSecConfig" am: 73f79ceae9 am: 4077e802ad
am: 22734c40b4

Change-Id: Ibaee9700cc6befdf6bbdb792cb673611e571d19a
2018-01-24 09:48:25 +00:00
Benedict Wong
eacecc37e8 Merge "Add TunnelInterface API and KernelResourceRecords" am: f811dff3bc
am: e1aa92f1c1

Change-Id: If27d78708ce225a900ad78a82d9f323770223808
2018-01-24 09:02:56 +00:00
Benedict Wong
22734c40b4 Merge "Add xfrm mark in IpSecConfig" am: 73f79ceae9
am: 4077e802ad

Change-Id: I03ddca0611c4e0b41edc705cdb39b415205bb14b
2018-01-24 08:19:16 +00:00
Benedict Wong
8149f6eb6c Add TunnelInterface API and KernelResourceRecords
This change adds one KernelResourceRecord type (TunnelInterfaceRecord),
and adds methods for the creation of TunnelInterfaces, as well as the
application of Transforms to the given TunnelInterfaces

As part of the generation of ikeys/okeys, a ReserveKeyTracker manages a
java bitset to avoid collisions and reserve/release keys.

Bug: 63588681
Test: Compiles, CTS, unit tests all pass on AOSP_marlin
Change-Id: I9e9b6455e27073acd4491eae666aa966b3b10e0f
2018-01-24 07:24:27 +00:00
Chalard Jean
2c852db564 Resolve merge conflicts of 69791b6883 to master
Test: this is the exact code these changes were meant to give
      without conflict had the auto-merger not squashed them
      together before it tried to merge them. It was tested on
      master in this state.

Change-Id: I5cbde17fb6016e5e6b5d0b04c8f41858d708ef4a
2018-01-24 15:59:26 +09:00
Chalard Jean
69791b6883 Merge changes I3b16caad,Iaf5ea7ab,I09a94042,I69a39039,I35300309, ... am: 6568170b32
am: 84af3a7b2b

Change-Id: I3f2185330789a8b02cc5e05912e3f17256ba1b86
2018-01-24 06:11:06 +00:00
Benedict Wong
73f79ceae9 Merge "Add xfrm mark in IpSecConfig" 2018-01-24 05:53:29 +00:00
Chalard Jean
6568170b32 Merge changes I3b16caad,Iaf5ea7ab,I09a94042,I69a39039,I35300309, ...
* changes:
  Let network requests see VPNs.
  Move constants into a new file.
  Make sure listen requests from VPN apps see their own networks
  Add a test for new UID checking code.
  Remove UID_RANGES_ADDED and REMOVED.
  Move VPN allowed UIDs into NetworkCapabilities.
  Pre-import to remove a conflict.
2018-01-24 04:09:44 +00:00
Benedict Wong
cf8f8026b5 Merge "Expose applyTunnelModeTransform as a system API" am: d056f32bd9 am: c2253ff48d
am: 9aaff41725

Change-Id: Ia1f81f5696814f5b9479882e1102a5f8508a4512
2018-01-24 02:58:17 +00:00
Benedict Wong
9aaff41725 Merge "Expose applyTunnelModeTransform as a system API" am: d056f32bd9
am: c2253ff48d

Change-Id: I85c761df4b77dba0b62adfd3488f66cdcf780fa3
2018-01-24 02:50:47 +00:00
Benedict Wong
e0d448f31e Expose applyTunnelModeTransform as a system API
Simple change to expose systemAPI for applyTunnelModeTransform

Bug: 36033193
Test: All CTS, unit tests passing
Change-Id: I2d857c048bc0dc80c3949387f946b1f5adf0527e
2018-01-23 23:25:54 +00:00
Lorenzo Colitti
f5c668bf38 Add metered, roaming, and defaultNetwork info to NetworkTemplate. am: 0f9bce6883
am: e383807d7f

Change-Id: I1faf95edec0e836c69016c84ad2a2c8518f8eb53
2018-01-23 19:39:18 +00:00