Commit Graph

4382 Commits

Author SHA1 Message Date
Hugo Benichi
54f2ab4cf4 Expose the MacAddress class in the api
Test: built,  flashed, $ runtest frameworks-net
Bug: 69390696
Change-Id: Ica5efdf5ffe8ad2500a87f574508a2bcd074b33d
2017-12-05 10:30:31 +09:00
Hugo Benichi
4cedf2a333 Merge "MacAddress: light refactors and improve documentation" am: d871cab32d am: 2c7122d826
am: 18f79574b4

Change-Id: Iae0e87bcc9bd9c1ba98319f3b65f18f6743c02a0
2017-12-05 00:06:50 +00:00
Hugo Benichi
18f79574b4 Merge "MacAddress: light refactors and improve documentation" am: d871cab32d
am: 2c7122d826

Change-Id: I1e9948225e7c5ad64fad2e596d03deb3524c411c
2017-12-04 23:51:41 +00:00
Hugo Benichi
2c7122d826 Merge "MacAddress: light refactors and improve documentation"
am: d871cab32d

Change-Id: I51bb8786ecd7f53e3342625c7a2625007eedfc0f
2017-12-04 23:38:27 +00:00
Hugo Benichi
e9667249da MacAddress: light refactors and improve documentation
This patch does some light refactoring in MacAddress to prepare for
exposing MacAddress in the public api:
 - documention is improved
 - some method names are renamed
 - a toSafeString method is added
 - a padding bug in the conversion methods outputting strings for
   mac addresses is fixed

Bug: 69390696
Test: runtest frameworks-net
Change-Id: I399a97dabc2dfa8df9c5518c8b12484e43ca05c9
2017-12-04 22:34:43 +09:00
Sudheer Shanka
5d4e5c4cd5 Track some event history and include it in netpolicy dump.
Bug: 66921847
Test: manual
Change-Id: I0c473790f83076def807308fe44db9cb9365769e
2017-11-28 11:33:43 -08:00
Jeff Sharkey
3406a9a6f4 Merge "Clarify docs, sanity check roaming state." am: 119611ed11 am: 2b3a7b86cc
am: 8a0d36697a

Change-Id: I59fbe09afc74e94e2f56cb6fd833fc2deb7023e5
2017-11-27 21:48:46 +00:00
Jeff Sharkey
8a0d36697a Merge "Clarify docs, sanity check roaming state." am: 119611ed11
am: 2b3a7b86cc

Change-Id: If4f09f8a0e32c245552f025f1a61d67f842b1841
2017-11-27 21:39:56 +00:00
Jeff Sharkey
2b3a7b86cc Merge "Clarify docs, sanity check roaming state."
am: 119611ed11

Change-Id: Ic30d5aaadf2c59978162c53d7e7781847244ce52
2017-11-27 21:30:57 +00:00
Jeff Sharkey
119611ed11 Merge "Clarify docs, sanity check roaming state." 2017-11-27 21:19:40 +00:00
Jeff Sharkey
d54240807c Clarify docs, sanity check roaming state.
Update public docs to hide the fact that NetworkCapabilities is only
used inside NetworkRequest as an implementation detail.

Take up less room on the wire when passing NetworkCapabilities around
via NetworkRequest.

Sanity check that the roaming state between NetworkInfo and
NetworkCapabilities is in agreement.

Test: bit FrameworksNetTests:android.net.,com.android.server.net.,com.android.server.connectivity.,com.android.server.ConnectivityServiceTest
Bug: 67040695
Change-Id: I982b4c3c41a140934bbad3b8ca8f12dc3814e86c
2017-11-27 12:47:14 -07:00
Hugo Benichi
14a2873acd Merge "IP connectivity metrics: fix LINGER/UNLINGER logging" am: aba1505896 am: f051bb1121
am: ab97c357e3

Change-Id: Ifb4911e1077f8c673052918fcd4a49e1ab7708d2
2017-11-15 22:59:32 +00:00
Hugo Benichi
ab97c357e3 Merge "IP connectivity metrics: fix LINGER/UNLINGER logging" am: aba1505896
am: f051bb1121

Change-Id: I422ef3cd6eab19cf3de2d6d9520840a7597c4a65
2017-11-15 22:50:22 +00:00
Hugo Benichi
f051bb1121 Merge "IP connectivity metrics: fix LINGER/UNLINGER logging"
am: aba1505896

Change-Id: I6f10845788ba5558637703da6d8c5c41324935cc
2017-11-15 22:42:50 +00:00
Hugo Benichi
aba1505896 Merge "IP connectivity metrics: fix LINGER/UNLINGER logging" 2017-11-15 22:31:59 +00:00
Di Lu
4a80963948 Merge "Add test case for user quota management in IpSecService" am: 9faa64ff17 am: 86c137bdd0
am: c6d1006f05

Change-Id: I84e81e261c93d2199e4932431ee57b75496ea2d5
2017-11-15 20:39:53 +00:00
Di Lu
c6d1006f05 Merge "Add test case for user quota management in IpSecService" am: 9faa64ff17
am: 86c137bdd0

Change-Id: I1022151e9317194ac45501a59f68c9bba89e16df
2017-11-15 20:31:37 +00:00
Di Lu
86c137bdd0 Merge "Add test case for user quota management in IpSecService"
am: 9faa64ff17

Change-Id: Ib1887b2395f0b1391711a9df9bebe224b6be1643
2017-11-15 20:23:14 +00:00
Di Lu
9faa64ff17 Merge "Add test case for user quota management in IpSecService" 2017-11-15 20:12:38 +00:00
Xin Li
2da8c002e6 Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master. am: 3fa5c2b1a8 -s ours
am: 803279b054  -s ours

Change-Id: Idfc0b2349f7475089373c8fdceebe7f166a5cd37
2017-11-15 02:39:52 +00:00
Xin Li
803279b054 Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.
am: 3fa5c2b1a8  -s ours

Change-Id: I2d08ca9a952babfd1480278ca6331b697be2a32e
2017-11-15 01:30:08 +00:00
Xin Li
3fa5c2b1a8 Merge commit '98e12851336b7db16e583f9afac63ecc97465980' from
oc-mr1-dev-plus-aosp-without-vendor into stage-aosp-master.

Change-Id: Ia7b8da4a00d215160e4a4fa40f6044208d1297b7
Merged-In: I19846d2a3ee27aecbae2367a74ee49082eea154d
2017-11-14 12:31:11 -08:00
Hugo Benichi
ad9dc5b6f0 IP connectivity metrics: fix LINGER/UNLINGER logging
This patch fixes a regression introduced by commit c3b3c5345a
for logging NetworkEvents when lingering and unlingering a network.

Commit c3b3c5345a removed an overloaded constructor for the
NetworkEvent class, which caused NetworkEvents with event type of
LINGER or UNLINGER logged in ConnectivityService to have incorrect
event types (set to the network id instead) and incorrect duration
(set as the event type instead).

Bug: 34901696
Test: runtest frameworks-net
Change-Id: Iab97a58ca805413617c8e8b4553404625a820ceb
2017-11-14 22:34:38 +09:00
Hugo Benichi
b1398ca799 Merge "IP connectivity metrics: NetworkEvents have transports" am: 703eca1a5d am: f3ada43f6e
am: a5cd5e8643

Change-Id: If452f742e50344e730f63b7329788b19d13280ec
2017-11-14 12:03:25 +00:00
Hugo Benichi
95915c8e30 Merge "Add L2~L4 information to packet wakeup logs and metrics" am: 6ee20ca7d3 am: ab15f7fc64
am: 3fade329de

Change-Id: Ia0b300662d4758f31ca583c9cf05f9186b8331aa
2017-11-14 11:55:45 +00:00
Hugo Benichi
a5cd5e8643 Merge "IP connectivity metrics: NetworkEvents have transports" am: 703eca1a5d
am: f3ada43f6e

Change-Id: I8cd50ea805fe3e533c0fc21b220827155cb0d23b
2017-11-14 01:46:23 +00:00
Hugo Benichi
3fade329de Merge "Add L2~L4 information to packet wakeup logs and metrics" am: 6ee20ca7d3
am: ab15f7fc64

Change-Id: I9dba29b10c824d382b08b16313e49cc8c775f7eb
2017-11-14 01:40:06 +00:00
ludi
20e1c8af67 Add test case for user quota management in IpSecService
Test: runtest frameworks-net
Bug: 65688605
Change-Id: I3210c4920d0ac1d09fecb56c25e392e2bcba641f
2017-11-13 14:14:11 -08:00
Hugo Benichi
703eca1a5d Merge "IP connectivity metrics: NetworkEvents have transports" 2017-11-13 13:13:44 +00:00
Hugo Benichi
c3b3c5345a IP connectivity metrics: NetworkEvents have transports
Also removes netId field from inside NetworkEvent and stop populating
the network_id field of the NetworkEvent field, deprecating it.

Bug: 34901696
Test: runtest frameworks-net,
      manually looking at $ adb shell dumpsys connmetrics

Change-Id: I2c36860f976898883714f72f4d18e06da250c6a6
2017-11-13 14:15:51 +09:00
Hugo Benichi
b57b87637c Add L2~L4 information to packet wakeup logs and metrics
Example of $ adb shell dumpsys connmetrics list:
...
WakeupStats(wlan0, 21851s, total: 85, root: 0, system: 4, apps: 63, non-apps: 0, no uid: 18, l2 unicast/multicast/broadcast: 85/0/0, ethertype 0x800: 23, ethertype 0x86dd: 62, ipNxtHdr 6: 74, ipNxtHdr 17: 1, ipproto 58: 10)
...
WakeupEvent(06:55:54.094, wlan0, -1, eth=0x800, dstHw=10:e:7e:26:3f:c1, ipNxtHdr=6, srcIp=216.58.200.110, dstIp=100.112.108.29, srcPort=443, dstPort=46878)
WakeupEvent(06:57:14.379, wlan0, -1, eth=0x86dd, dstHw=10:e:7e:26:3f:c1, ipNxtHdr=58, srcIp=ff02::1, dstIp=fe80::fa00:4:fd00:1)
WakeupEvent(06:57:52.786, wlan0, 1000, eth=0x800, dstHw=10:e:7e:26:3f:c1, ipNxtHdr=6, srcIp=172.217.27.67, dstIp=100.112.108.29, srcPort=80, dstPort=49360)
WakeupEvent(06:58:02.919, wlan0, 10004, eth=0x86dd, dstHw=10:e:7e:26:3f:c1, ipNxtHdr=6, srcIp=2401:fa00:4:fd00:a585:13d1:6a23:4fb4, dstIp=2404:6800:4006:809::200a, srcPort=443, dstPort=46197)
WakeupEvent(06:58:05.586, wlan0, 10004, eth=0x86dd, dstHw=10:e:7e:26:3f:c1, ipNxtHdr=6, srcIp=2401:fa00:4:fd00:a585:13d1:6a23:4fb4, dstIp=2404:6800:4006:803::200a, srcPort=443, dstPort=46096)

Bug: 66869042
Test: runtest frameworks-net
      + manual testing by monitoring $ dumpsys connmetrics list
Change-Id: I03215c0c9fb7feda3e6ceb1b916f61f4ffb15344
2017-11-12 18:51:28 +09:00
Hugo Benichi
d80d442967 Merge "MacAddress follow-up: define the core of the class" am: 812a753069 am: d39a50350a
am: bf336d1b13

Change-Id: Iaa55c54a46844428da0ddd9d0a5ee899c0aa1dfb
2017-11-09 12:55:56 +00:00
Hugo Benichi
bf336d1b13 Merge "MacAddress follow-up: define the core of the class" am: 812a753069
am: d39a50350a

Change-Id: I1063cbb5a468818f68ee5406e52b6cd74c85c4bf
2017-11-09 12:43:52 +00:00
Hugo Benichi
812a753069 Merge "MacAddress follow-up: define the core of the class" 2017-11-09 12:22:17 +00:00
Hugo Benichi
87c1532773 MacAddress follow-up: define the core of the class
Test: new unit test parts of $ runtest frameworks-net
Change-Id: I08c57d2d656802f7bdd7a93fde711a7e77247583
2017-11-09 16:36:45 +09:00
Benedict Wong
d4b8345cda Merge "Update documentation for AES-GCM-ESP keymat length" am: b772a466c4 am: 6491b03410
am: 1e0eccff43

Change-Id: Ia0e1538feea2ddb0982875c925705c3648e50c8a
2017-11-08 18:27:06 +00:00
Benedict Wong
1e0eccff43 Merge "Update documentation for AES-GCM-ESP keymat length" am: b772a466c4
am: 6491b03410

Change-Id: I5e61a9c28dac49f2dca554ce2fdf755ab7be0dab
2017-11-08 18:12:25 +00:00
Benedict Wong
b772a466c4 Merge "Update documentation for AES-GCM-ESP keymat length" 2017-11-08 17:47:40 +00:00
Hugo Benichi
c62cda64f8 Merge "Define MacAddress class" am: 925349ac8f am: 37caaaa705
am: 3a818a0049

Change-Id: I0e09e64bb2a6306c0422443038351fabf10e2d6e
2017-11-08 06:57:00 +00:00
Hugo Benichi
3a818a0049 Merge "Define MacAddress class" am: 925349ac8f
am: 37caaaa705

Change-Id: I377de35ab9ce9d8bf44bd90295a2a41fbea06d7a
2017-11-08 06:46:49 +00:00
Hugo Benichi
1881890778 Define MacAddress class
Test: new unit tests part of $ runtest frameworks-net
Change-Id: I5a6a868ff86e9bffdc551d4e2bb486b585525c30
2017-11-08 11:09:49 +09:00
Benedict Wong
698bd80129 Update documentation for AES-GCM-ESP keymat length
Added notes that keymat length must include 32 bits of salt.

Bug: 68672051
Test: Frameworks-net unit tests & IpSecManager CTS tests run
Change-Id: I0ae0c5be8a45b2374783b3bd1fa8bf930f15e687
2017-11-07 17:39:35 -08:00
Erik Kline
93f8a135dc Merge "Replace dns_tls with private_dns_mode setting" am: 32b13a9943 am: f1799116c2
am: 9250d3b593

Change-Id: Icba28e4d4e446dd6eac0f2f017957894e33084f2
2017-11-07 06:23:05 +00:00
Erik Kline
9250d3b593 Merge "Replace dns_tls with private_dns_mode setting" am: 32b13a9943
am: f1799116c2

Change-Id: I3e0448c045eb1072d0cd70a163ca355786b21cc4
2017-11-07 06:12:39 +00:00
Treehugger Robot
32b13a9943 Merge "Replace dns_tls with private_dns_mode setting" 2017-11-07 05:54:29 +00:00
Erik Kline
1ecdd96e89 Replace dns_tls with private_dns_mode setting
Also includes:
    - SettingsLib strings used in PrivateDnsModeDialogPreference
      interaction in the Settings app
    - rename ContentResolver "resolver" in methods working with
      DNS resolvers (too confusing)

Test: as follows
    - built
    - flashed
    - booted
    - runtest frameworks-net
    - no new failures in SettingsBackupTest nor in SettingsProviderTest
    - manual interaction with developer option works
Bug: 34953048
Bug: 64133961
Change-Id: Ia7502916db9ffa0792e1e500a35e34d06a88e79d
2017-11-07 12:47:36 +09:00
Hugo Benichi
413dcc46cc Merge "DefaultNetworkEvent metrics: rehaul" am: 37a0df93a0 am: d025358166
am: d42223572a

Change-Id: Ia5c19bfbdf9eea553f4517f312295c14c2f02046
2017-11-06 07:41:53 +00:00
Hugo Benichi
d42223572a Merge "DefaultNetworkEvent metrics: rehaul" am: 37a0df93a0
am: d025358166

Change-Id: If6bf966ba547a2ce50e17340e0374dd9b75b80d9
2017-11-06 07:31:39 +00:00
Hugo Benichi
37a0df93a0 Merge "DefaultNetworkEvent metrics: rehaul" 2017-11-06 07:09:49 +00:00
Hugo Benichi
6d7c63fa64 DefaultNetworkEvent metrics: rehaul
This patch changes instrumentation of default networks and default
network events:
- stop logging events for default network transitions,
  but instead consistently log one event per continuous segment
  when one given network was the default, including logging an
  event for when there is no default network.
- keep a separate rolling buffer of DefaultNetworkEvent for
  dumpsys and bug reports.

These changes allow to simplify post aggregation of default network
event metrics by removing any need to do time series processing.
Instead, metrics and counters can be implemented withouth any ambiguity
by following the recipe:

% of x = sum(duration | x = true) / sum (all durations)

where x can be various conditions such as:
- the default network was validated
- the default network was WiFi
- the default network was IPv6
- there was no default network
- ...

Most importantly, this new logging scheme allows to measure much more
reliably:
- the % of the time that a device had Internet, in the sense that the
default network was validated.
- the time transitions between default networks, keyed by previous and
new transports/link layer, which allows to derive wakelock durations
and wakelock power costs from default network switches.

This patch also simplifies the dumpsys interface of the connmetrics
service and reduces the commands to three:
- "flush" for metrics upload.
- "proto" for printing buffered event in text proto format.
- "list" for listing all events and statistics.

Bug: 34901696
Bug: 65700460
Test: runtest frameworks-net
Change-Id: I0521f1681a60cca07ac3bfd5741d64ce44de4cdd
2017-11-06 09:04:02 +09:00