Commit Graph

3279 Commits

Author SHA1 Message Date
nharold
29d6c4367c Merge "Require NETWORK_STACK Permission for IpSec Tunnel Mode" am: 43699e90f3 am: e736f83caf
am: 0f7857e587

Change-Id: Ib33ccecfe2fc600c05a208d24df10a474addb0e5
2018-02-10 02:11:15 +00:00
nharold
0f7857e587 Merge "Require NETWORK_STACK Permission for IpSec Tunnel Mode" am: 43699e90f3
am: e736f83caf

Change-Id: If7330b4fdf5d2ccbddb590ab81a4b19c1f612b66
2018-02-10 01:57:50 +00:00
Nathan Harold
5a920ca377 Require NETWORK_STACK Permission for IpSec Tunnel Mode
At least until further permissions are agreed upon,
the NETWORK_STACK permission is sufficient to ensure
that access to the tunnel mode APIs is secure, and
this permission will always be a sufficient condition.
Thus, adding NETWORK_STACK.

Bug: 66955045
Test: compilation
Change-Id: I2dc36896a52d2e71fad55041507d68ca91191ffc
2018-02-08 21:16:51 +00:00
Jong Wook Kim
2dcd15de37 Merge "MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator" am: 9f16828767 am: 775861bb12
am: b6b2957b8e

Change-Id: I5f2d395705841b7da03b1552b16507466e47ef84
2018-02-07 09:26:56 +00:00
Jong Wook Kim
b6b2957b8e Merge "MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator" am: 9f16828767
am: 775861bb12

Change-Id: I6dba4e244c660d29f107e471250d39e9caafb17e
2018-02-07 05:32:01 +00:00
Jong Wook Kim
f0a55cc9ed MacAddress: Use SecureRandom and add a 46 bit randomized MAC generator
Use SecureRandom instead of Random since Random is time based and can
increase the chance of generating same MAC address across multiple
devices.

createRandomUnicastAddress should randomize all bits of the address,
except for locally assigned bit and unicast bit. The previous method
that only randomizes NIC and use Google Base OUI is renamed to
createRandomUnicastAddressWithGoogleBase.

Bug: 72450936
Test: runtest frameworks-net
Change-Id: Icda650638c2c1c9fd90d509a87e86347c0e05f2d
2018-02-07 01:28:46 +00:00
Hugo Benichi
fbbd75839d Merge "Update OWNER files for connectivity" am: 771e229a23 am: ce0c31d392
am: 9a70530107

Change-Id: I1754c7bd602db58bd6c4e72d5f0dd77786d730da
2018-02-05 00:54:50 +00:00
Hugo Benichi
9a70530107 Merge "Update OWNER files for connectivity" am: 771e229a23
am: ce0c31d392

Change-Id: I5a995856aa347874b534312212ca73ffff0193c0
2018-02-05 00:39:54 +00:00
Hugo Benichi
771e229a23 Merge "Update OWNER files for connectivity" 2018-02-04 23:18:52 +00:00
Pavel Maltsev
9c70dc79dd Merge "Enable multiple active Ethernet interfaces" am: 0a6c539901 am: ac908d6728
am: 3379a3eff9

Change-Id: Ibd84c2ba3252e3d65ba4a63a0be912747ea18df9
2018-02-04 01:06:51 +00:00
Jeff Sharkey
c7dc046e0e Merge "Polished rapid data usage alerting." 2018-02-03 22:07:34 +00:00
Jeff Sharkey
bfb43ea9e6 Polished rapid data usage alerting.
Switch to reading limit information from NetworkPolicy, which is
typically populated from SubscriptionPlan.  This lets users have
direct control over the limits we're using to trigger rapid usage
alerts, and makes the feature work without requiring that the carrier
wire up SubscriptionPlan information.

Let the user "snooze" the rapid usage alerting for a day at a time,
so we're less annoying to them.  Send the snooze broadcasts as
foreground, so that we don't re-post notifications while working
through a long background broadcast queue.

Fix notifications to use the "ALERTS" channel, since these alerts
really are higher priority than simple "STATUS" updates; this also
gives us HUN behavior when in full-screen apps.

Update both service and unit tests to work directly with
NotificationManager, instead of the raw AIDL.

Test: bit FrameworksServicesTests:com.android.server.NetworkPolicyManagerServiceTest
Bug: 72444638, 72436702
Change-Id: I8d9138522a7779cc68eb9fa4777b50facb6567b7
2018-02-03 12:49:30 -07:00
Jeff Sharkey
ad357d1839 Pass in the user defined by Context.
The majority of Manager-style classes already use Context.getUserId()
when making calls into the OS, so clean up the remaining callers to
unify behind this strategy.

This gives @SystemApi developers a nice clean interface to interact
across user boundaries, instead of manually adding "AsUser" or
"ForUser" method variants, which would quickly become unsustainable.

Test: builds, boots
Bug: 72863821
Exempt-From-Owner-Approval: trivial changes
Change-Id: Ib772ec4438e57a2ad4950821b9432f9842998451
2018-02-03 02:11:45 +00:00
Pavel Maltsev
3379a3eff9 Merge "Enable multiple active Ethernet interfaces" am: 0a6c539901
am: ac908d6728

Change-Id: I95a4e5d519857950297f5948525990c4808cd5fd
2018-02-03 01:25:34 +00:00
Treehugger Robot
0a6c539901 Merge "Enable multiple active Ethernet interfaces" 2018-02-02 23:13:54 +00:00
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
Hugo Benichi
1c8756154a Update OWNER files for connectivity
Test: no functional change
Change-Id: I25276c769468c37970cb1915660fee29e589008c
2018-02-02 12:49:45 +09: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
Pavel Maltsev
c07a96d1e4 Enable multiple active Ethernet interfaces
- add Ethernet interface configurations to config.xml; no vendors can
specify network capabilities (in particular they can mark network as
restricted which make sense for embedded applications + static IP
configuration)
- extend EthernetManager to support multiple interfaces, use interface
name as an identificator
- extend IpConfigStore to store IP configuration based on string
identifier (e.g. ethernet name)

Test: runtest -x frameworks/base/services/tests/servicestests/ -c com.android.server.net.IpConfigStoreTest
Change-Id: Ic1e70003f2380ca8edb4469d6b34e27c5e8cf059
2018-01-29 10:11:05 -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