Commit graph

4,287 commits

Message SHA1
Merge "Network Service Discovery test: properly release resources" am: c9d24d203d am: e7849f69a3
am: f467db29f9

Change-Id: Id9be284a16112f999d752751a7972fd735573cda

Hugo Benichi   authored and   android-build-merger   commited 2017-09-04 12:42:56 +00:00
e91afaefd6
Merge "Network Service Discovery test: properly release resources"
am: c9d24d203d

Change-Id: If34b3770a5c0fef65d124201e0ca1374cc6b1eca

Hugo Benichi   authored and   android-build-merger   commited 2017-09-04 12:14:11 +00:00
e7849f69a3
Network Service Discovery test: properly release resources
Bug: 32561414
Bug: 62918393
Bug: 62044295
Test: runtest frameworks-net
Change-Id: If23993b5e391947ecbdc01677f0a643144794b2b

Hugo Benichi   commited 2017-09-02 14:54:29 +09:00
39ab957328
Merge "Gracefully handle integer overflows." into oc-mr1-dev
am: 4d2a8d7203

Change-Id: I6ed70a40ad3e6df55e7669fedfe5b34faf95bd9f

Jeff Sharkey   authored and   android-build-merger   commited 2017-09-02 02:07:25 +00:00
2b3e602c25
Gracefully handle integer overflows.
Try sticking with integer-based math as much as possible for speed,
but switch to double-based math if we detect that we'd end up
causing an overflow.

New tests to verify.

Test: bit FrameworksNetTests:com.android.server.net.NetworkStatsCollectionTest
Bug: 65257769
Change-Id: I1ae35599be134f81850c0a3d86928b057fba1eff

Jeff Sharkey   commited 2017-09-01 17:13:01 -06:00
92313e436a
Merge "Revert "Nat464Xlat: interface notification handler on ConnectivityService"" into oc-mr1-dev
am: b3dec17660

Change-Id: If2b714c7e74d95d4fad610772e3d74ab13b923e8

Hugo Benichi   authored and   android-build-merger   commited 2017-09-01 03:01:59 +00:00
73c3c66a8e
Merge "Revert "Nat464Xlat: interface notification handler on ConnectivityService"" into oc-mr1-dev
Hugo Benichi   authored and   Android (Google) Code Review   commited 2017-09-01 02:49:17 +00:00
b3dec17660
Merge "Revert "Nat464Xlat: interface notification handler on ConnectivityService"" am: 1d66352b40 am: 3e569a9562
am: de68a0a1af

Change-Id: Icff7a1fa8888654914fceaf324219ed6af3c95ed

Hugo Benichi   authored and   android-build-merger   commited 2017-08-31 14:58:48 +00:00
1ca09ace9b
Merge "Revert "Nat464Xlat: interface notification handler on ConnectivityService""
am: 1d66352b40

Change-Id: I691095ce56e30e2fada93bc5500453f13ac51403

Hugo Benichi   authored and   android-build-merger   commited 2017-08-31 14:39:18 +00:00
3e569a9562
Revert "Nat464Xlat: interface notification handler on ConnectivityService"
This reverts commit 39e10e2111.

Bug: 65225023
Change-Id: Id6c21682cafa86d87f66480237dd731b21f917c5

Hugo Benichi   commited 2017-08-31 14:32:54 +00:00
2984496383
Revert "Nat464Xlat: interface notification handler on ConnectivityService"
This reverts commit b2d70b403f due to b/65225023.

Change-Id: I6ca3780afb8d47b77219d6b5a06760042f684c4b

Hugo Benichi   commited 2017-08-31 14:29:51 +00:00
eda8324beb
Merge "Augment network stats based on SubscriptionPlan." into oc-mr1-dev
am: cf84220710

Change-Id: Ia6c6d5893d841f21d181363dc01f77efa6579a8f

Jeff Sharkey   authored and   android-build-merger   commited 2017-08-30 19:14:21 +00:00
3870ccbd02
Merge "Augment network stats based on SubscriptionPlan." into oc-mr1-dev
Jeff Sharkey   authored and   Android (Google) Code Review   commited 2017-08-30 19:01:18 +00:00
cf84220710
Augment network stats based on SubscriptionPlan.
When a carrier provides an "anchor" of data usage at a specific
moment in time, augment the network statistics used by warning/limit
thresholds and Settings UI.  For example, if the OS measured 500MB
of usage, but the carrier says only 400MB has been used, we "squish"
down the OS measured usage to match that anchor.

Callers using the hidden API will have their data augmented by
default, and the public API offers a way to opt-into augmentation.

Thorough testing to verify behavior.

Test: bit FrameworksNetTests:android.net.,com.android.server.net.
Test: cts-tradefed run commandAndExit cts-dev -m CtsUsageStatsTestCases -t android.app.usage.cts.NetworkUsageStatsTest
Bug: 64534190
Change-Id: Id3d4d7625bbf04f57643e51dbf376e3fa0ea8eca

Jeff Sharkey   commited 2017-08-30 10:01:10 -06:00
3c8f96ef4a
Merge changes I34c4a0c3,Iebc7d153,Ibb028886 into oc-mr1-dev
am: 3027f4720a  -s ours

Change-Id: Iff50bd84ac5d36e85bfb344c8bcc1697bca79a27

Hugo Benichi   authored and   android-build-merger   commited 2017-08-29 23:09:02 +00:00
1918c0850b
Nat464Xlat: interface notification handler on ConnectivityService
This patch adds a layer of asynchonicity to the NetworkBaseObserver
callbacks implemented by Nat464Xlat in order to allow these callbacks
to run on the main ConnectivityService handler.

This allows to run interfaceLinkStateChanged and interfaceRemoved
callbacks in the same thread context as other Nat464Xlat methods and
solves the following issues:
  - NPE risk due to race between fixupLinkProperties called on the
    ConnectivityService thread and interfaceRemoved called as a
    callback by NetworkManagementService.
  - stale LinkProperties reads in both callbacks not called on
    ConnectivityService handler.
  - removes the race between stop() and interfaceRemoved().

This patch also:
  - removes/simplifies comments related to the threading
    model which are no obsolete.
  - extract clatd management logic from ConnectivityService into
    NetworkAgentInfo

Bug: 62997041
Bug: 64571917
Test:  runtest frameworks-net
       manually connected to ipv6 network and went to test-ipv6.com
Merged-In: I889d98e47423ff3d4746d6ed8015b265286e7c52
Merged-In: I2f002cd197e2eeaaadadd747a6b33d264cd34433
Merged-In: Id3ab064cf9f4417c0e8988fff4167b65b3c8c414
Merged-In: Ib224392c9a185f6bd79fd60cd5cb5549f2a7851e
Merged-In: I9116a493ca1cbdf6a25664a1b0017aa6c9b38eb4
Merged-In: I12918d208364eef55067ae9d59fbc38477e1f1c6

(cherry picked from commit 771d5c2f0126ba692897c9716f4098ae6e3a870c)

Change-Id: I34c4a0c32ce7c9b7bd7acf8f87b932e15c573bd8

Hugo Benichi   commited 2017-08-29 15:12:32 +09:00
39e10e2111
Merge "Nat464Xlat: interface notification handler on ConnectivityService" am: 91817b3129 am: 6d5fd71e52
am: f55c1ae9b6

Change-Id: I9116a493ca1cbdf6a25664a1b0017aa6c9b38eb4

Hugo Benichi   authored and   android-build-merger   commited 2017-08-29 05:42:07 +00:00
40bb1b693a
Merge "Nat464Xlat: interface notification handler on ConnectivityService"
am: 91817b3129

Change-Id: I2f002cd197e2eeaaadadd747a6b33d264cd34433

Hugo Benichi   authored and   android-build-merger   commited 2017-08-29 05:20:32 +00:00
6d5fd71e52
Nat464Xlat: internal state guards cleanup + state enum
This patch does some cleanup of Nat464Xlat internal state guards
against the Nat464Xlat state Idle | Started | Running, which reduces
code nesting.

It also replaces introspection of internal state for distinguishing
between different stages in 464xlat lifecycle with an enum explicitly
introducing these three Idle | Started | Running states.

Bug: 62997041
Bug: 64571917
Test:  runtest frameworks-net
       manually connected to ipv6 network and went to test-ipv6.com
Merged-In: I6efc9fed2420ca488731a2b9b9c3c025b16eca10
Merged-In: I188ac4c367db11cb33b67fe92df3a120e3c6fbce
Merged-In: I7e2c5db8d537fb0ab47cde37158b7f04d7786942
Merged-In: Ic2246a97618c596dbdbf48cda39c2f5b66e3bfb6
Merged-In: Ib04b9a3d56e9daf61b299a30e24a3c8839819a00
Merged-In: Icc1558a0f0e7c299270f550897347458e2bd3188

(cherry pick from commit 4f6f139869ddadf6f9ed50967c106a10a2e8ce3f)

Change-Id: Iebc7d153d8cd0b90d074d8d6eed821fbc3f1370d

Hugo Benichi   commited 2017-08-29 10:02:24 +09:00
9cd15c7f2e
Nat464Xlat: interface notification handler on ConnectivityService
This patch adds a layer of asynchonicity to the NetworkBaseObserver
callbacks implemented by Nat464Xlat in order to allow these callbacks
to run on the main ConnectivityService handler.

This allows to run interfaceLinkStateChanged and interfaceRemoved
callbacks in the same thread context as other Nat464Xlat methods and
solves the following issues:
  - NPE risk due to race between fixupLinkProperties called on the
    ConnectivityService thread and interfaceRemoved called as a
    callback by NetworkManagementService.
  - stale LinkProperties reads in both callbacks not called on
    ConnectivityService handler.
  - removes the race between stop() and interfaceRemoved().

This patch also:
  - removes/simplifies comments related to the threading
    model which are no obsolete.
  - extract clatd management logic from ConnectivityService into
    NetworkAgentInfo

Bug: 62997041
Bug: 64571917
Test:  runtest frameworks-net
       manually connected to ipv6 network and went to test-ipv6.com
Change-Id: I889d98e47423ff3d4746d6ed8015b265286e7c52

Hugo Benichi   commited 2017-08-29 08:55:18 +09:00
b2d70b403f
Merge "Nat464Xlat: internal state guards cleanup + state enum" am: aee703e7e4 am: 6d7e12ed6e
am: 68c8b4ad5d

Change-Id: Ib04b9a3d56e9daf61b299a30e24a3c8839819a00

Hugo Benichi   authored and   android-build-merger   commited 2017-08-28 23:12:13 +00:00
b6646ba075
Merge "Nat464Xlat: internal state guards cleanup + state enum"
am: aee703e7e4

Change-Id: I188ac4c367db11cb33b67fe92df3a120e3c6fbce

Hugo Benichi   authored and   android-build-merger   commited 2017-08-28 22:49:50 +00:00
6d7e12ed6e
Nat464Xlat: clat management cleanup
This patch does some minor refactoring of clat starting/stopping code:
 - remove unused LinkProperties arguments in updateClat
 - remove unused Context argument in Nat464Xlat ctor
 - introduce ensureClatIsStarted and ensureClatIsStopped methods and
   simplify updateClat
 - add clatd to NetworkAgentInfo toString() method
 - clarify some comments

This changes prepare for moving BaseNetworkObserver callbacks to
ConnectivityService.

Bug: 62997041
Bug: 64571917
Test: runtest frameworks-net
      manually connected to IPv6 only network and went to test-ipv6.com

Merged-In: Idb204784614cfe700f73255a7a7b78c5e9ee6eca
Merged-In: Ic3808a1afe48efac745b1b378fb12cc5678918ec
Merged-In: Ia769aef6ef8b258f44f8979003d271c96264f1b5
Merged-In: I1a19e6fbb0cb13262e90b171d861062469078fb6
Merged-In: I06661bd6bd1456ba34a3bbdb52c120ac01da9d61
Merged-In: Ifccff9f3cfccdb2cdddf2f07561f0787a48bc0f8

(cherry picked from commit b577d65825e623a9868664486482ed137b98b504)

Change-Id: Ibb02888633df9643030336c4dbea6c569a47554c

Hugo Benichi   commited 2017-08-28 22:32:11 +09:00
5a5c1bb116
Merge "Nat464Xlat: clat management cleanup" am: 81b179cfdd am: bd5610af79
am: da71487a59

Change-Id: I06661bd6bd1456ba34a3bbdb52c120ac01da9d61

Hugo Benichi   authored and   android-build-merger   commited 2017-08-28 12:21:10 +00:00
7f0c130788
Merge "Nat464Xlat: clat management cleanup"
am: 81b179cfdd

Change-Id: Ic3808a1afe48efac745b1b378fb12cc5678918ec

Hugo Benichi   authored and   android-build-merger   commited 2017-08-28 12:01:25 +00:00
bd5610af79
Nat464Xlat: internal state guards cleanup + state enum
This patch does some cleanup of Nat464Xlat internal state guards
against the Nat464Xlat state Idle | Started | Running, which reduces
code nesting.

It also replaces introspection of internal state for distinguishing
between different stages in 464xlat lifecycle with an enum explicitly
introducing these three Idle | Started | Running states.

Bug: 62997041
Bug: 64571917
Test:  runtest frameworks-net
       manually connected to ipv6 network and went to test-ipv6.com
Change-Id: I6efc9fed2420ca488731a2b9b9c3c025b16eca10

Hugo Benichi   commited 2017-08-28 15:29:27 +09:00
adbbac97c5
Nat464Xlat: clat management cleanup
This patch does some minor refactoring of clat starting/stopping code:
 - remove unused LinkProperties arguments in updateClat
 - remove unused Context argument in Nat464Xlat ctor
 - introduce ensureClatIsStarted and ensureClatIsStopped methods and
   simplify updateClat
 - add clatd to NetworkAgentInfo toString() method
 - clarify some comments

This changes prepare for moving BaseNetworkObserver callbacks to
ConnectivityService.

Bug: 62997041
Bug: 64571917
Test: runtest frameworks-net
      manually connected to IPv6 only network and went to test-ipv6.com
Change-Id: Idb204784614cfe700f73255a7a7b78c5e9ee6eca

Hugo Benichi   commited 2017-08-28 15:29:23 +09:00
55d8ae3377
Merge "Make NetworkManagementServiceTest pass again." am: 29b1826ff2 am: bfe44f641d
am: c933ef6c54

Change-Id: Ic39262b1f650695cc6903c3a9e2ddb592d47b365

Hugo Benichi   authored and   android-build-merger   commited 2017-08-24 04:09:14 +00:00
2b89a6f05d
Merge "Make NetworkManagementServiceTest pass again."
am: 29b1826ff2

Change-Id: If7fafa0922fdbc499c0c911a3f88ede9c8a26c1d

Hugo Benichi   authored and   android-build-merger   commited 2017-08-24 03:46:07 +00:00
bfe44f641d
Make NetworkManagementServiceTest pass again.
1. Mock the service manager so that NMS can fetch mock versions
   of INetd and IBatteryStats.
2. Call LocalServices.removeServiceForTest to avoid a duplicate
   service registration error. // check this
3. Change the timeout from 100ms to 200ms, as otherwise the tests
   that check for IfaceClass fail.
4. Convert NetworkManagementServiceTest to JUnit 4.
5. Move NetworkManagementServiceTest to tests/net

Bug: 29337859
Bug: 32163131
Bug: 32561414
Bug: 62918393
Test: runtest frameworks-net
Change-Id: Ic7371b427b35809ccd446addf35c9d8ae99ccfd3

Lorenzo Colitti   authored and   Hugo Benichi   commited 2017-08-23 09:49:05 +09:00
3b43a4a047
Merge "Network: Use HttpURLConnectionFactory rather than OkHttp APIs" am: 811e215e2c am: 41ff948711 am: e7776bd372
am: 8f55753777

Change-Id: I1ed6962088be8a0999b81a19d84f5c1c7203dddb

Tobias Thierer   authored and   android-build-merger   commited 2017-08-22 15:40:30 +00:00
f65e355e1d
Merge "Network: Use HttpURLConnectionFactory rather than OkHttp APIs" am: 811e215e2c am: 41ff948711
am: e7776bd372

Change-Id: I048a7695ec98711163494e3dedab785e1400d1da

Tobias Thierer   authored and   android-build-merger   commited 2017-08-22 15:28:07 +00:00
8f55753777
Merge "Network: Use HttpURLConnectionFactory rather than OkHttp APIs" am: 811e215e2c
am: 41ff948711

Change-Id: I0e15e22f4e1561102012b012cdea74db63ac2163

Tobias Thierer   authored and   android-build-merger   commited 2017-08-22 15:16:31 +00:00
e7776bd372
Merge "Network: Use HttpURLConnectionFactory rather than OkHttp APIs"
am: 811e215e2c

Change-Id: I79db2f0dc0870f71ec21397545e2e6abb5c7142b

Tobias Thierer   authored and   android-build-merger   commited 2017-08-22 15:00:24 +00:00
41ff948711
Merge "Network: Use HttpURLConnectionFactory rather than OkHttp APIs"
Tobias Thierer   authored and   Gerrit Code Review   commited 2017-08-22 14:07:16 +00:00
811e215e2c
DO NOT MERGE ANYWHERE Revert "Merge "Remove gender-specific pronouns from documentation" into oc-dev" am: e811770999 -s ours am: 92363c4e9f -s ours
am: c8a6298b3f  -s ours

Change-Id: I829fae0c18276ef1da54fe537682e0480a02141a

Baligh Uddin   authored and   android-build-merger   commited 2017-08-21 23:48:39 +00:00
2899590223
DO NOT MERGE ANYWHERE Revert "Merge "Remove gender-specific pronouns from documentation" into oc-dev" am: e811770999 -s ours
am: 92363c4e9f  -s ours

Change-Id: I1a912ffd002f35c31fe5a2cd47cb43cc7a66d2aa

Baligh Uddin   authored and   android-build-merger   commited 2017-08-21 23:33:54 +00:00
c8a6298b3f
DO NOT MERGE ANYWHERE Revert "Merge "Remove gender-specific pronouns from documentation" into oc-dev"
am: e811770999  -s ours

Change-Id: I9493ada35e2b660ffdf73793e621f4b295778d63

Baligh Uddin   authored and   android-build-merger   commited 2017-08-21 22:57:31 +00:00
92363c4e9f
Merge "DO NOT MERGE ANYWHERE: Manually merge commit 'fd35d7c0a284' into oc-dev-plus-aosp am: 732df7fec9 -s ours" into oc-dr1-dev-plus-aosp
am: 6c182d2c61  -s ours

Change-Id: Ia10b79b49d7e95bb8f2aa821d3678c067b469d1b

Tyler Freeman   authored and   android-build-merger   commited 2017-08-21 22:16:03 +00:00
f39d498050
Merge "DO NOT MERGE ANYWHERE Revert "Merge "Remove gender-specific pronouns from documentation" into oc-dev" am: e811770999 -s ours am: 0a92e1584e -s ours am: a174dd26d3 -s ours" into oc-mr1-dev-plus-aosp
Android Build Merger (Role)   authored and   Android (Google) Code Review   commited 2017-08-21 22:11:17 +00:00
edb499aa82
DO NOT MERGE ANYWHERE Revert "Merge "Remove gender-specific pronouns from documentation" into oc-dev" am: e811770999 -s ours am: 0a92e1584e -s ours
am: 4a46108d0f  -s ours

Change-Id: I1b97453948c89854c0bea0c4f18fba3e400e506c

Baligh Uddin   authored and   android-build-merger   commited 2017-08-21 22:06:46 +00:00
925023b605
DO NOT MERGE ANYWHERE Revert "Merge "Remove gender-specific pronouns from documentation" into oc-dev" am: e811770999 -s ours am: 0a92e1584e -s ours
am: a174dd26d3  -s ours

Change-Id: I3d887f884e45a2c947972317fecd44c763d72ca2

Baligh Uddin   authored and   android-build-merger   commited 2017-08-21 22:06:44 +00:00
1135272742
Merge "DO NOT MERGE ANYWHERE Manually merge commit 'fd35d7c0a284' into oc-dr1-dev am: 27b9dd89db -s ours am: 20eaf1b908 -s ours" into oc-mr1-dev-plus-aosp
Android Build Merger (Role)   authored and   Android (Google) Code Review   commited 2017-08-21 22:02:54 +00:00
1d9e16f218
Merge "DO NOT MERGE ANYWHERE: Manually merge commit 'fd35d7c0a284' into oc-dev-plus-aosp am: 732df7fec9 -s ours" into oc-dr1-dev-plus-aosp
Android Build Merger (Role)   authored and   Android (Google) Code Review   commited 2017-08-21 22:02:00 +00:00
6c182d2c61
DO NOT MERGE ANYWHERE: Manually merge commit 'fd35d7c0a284' into oc-dev-plus-aosp
am: 732df7fec9  -s ours

Change-Id: I8d58d5898771aaee6729225efff0389dd8c6c1ca

Tyler Freeman   authored and   android-build-merger   commited 2017-08-21 21:57:57 +00:00
2b1ce8b6ef
DO NOT MERGE ANYWHERE Manually merge commit 'fd35d7c0a284' into oc-dr1-dev am: 27b9dd89db -s ours
am: 20eaf1b908  -s ours

Change-Id: I53cac7860d8a3da2ced232b7c429034ec6d0b746

Tyler Freeman   authored and   android-build-merger   commited 2017-08-21 21:57:56 +00:00
2436bba07d
DO NOT MERGE ANYWHERE Revert "Merge "Remove gender-specific pronouns from documentation" into oc-dev" am: e811770999 -s ours
am: 0a92e1584e  -s ours

Change-Id: I3bc8768f4790abe57ed64bb516db5dadd9a7dd9c

Baligh Uddin   authored and   android-build-merger   commited 2017-08-21 21:52:56 +00:00
4a46108d0f
DO NOT MERGE ANYWHERE Manually merge commit 'fd35d7c0a284' into oc-dr1-dev am: 27b9dd89db -s ours
am: 9e41f13ae6  -s ours

Change-Id: Idc2508e760020c4933d69c307cc27747c8c4e06d

Tyler Freeman   authored and   android-build-merger   commited 2017-08-21 21:52:56 +00:00
5930bf3296
DO NOT MERGE ANYWHERE Revert "Merge "Remove gender-specific pronouns from documentation" into oc-dev" am: e811770999 -s ours
am: 0a92e1584e  -s ours

Change-Id: Ie8381ac10bdab3e6ac56a37bd98583e03ea15451

Baligh Uddin   authored and   android-build-merger   commited 2017-08-21 21:52:52 +00:00
a174dd26d3
DO NOT MERGE ANYWHERE Manually merge commit 'fd35d7c0a284' into oc-dr1-dev
am: 27b9dd89db  -s ours

Change-Id: I6ac35f90d62b08cb6cae66b9ed001265a7496aea

Tyler Freeman   authored and   android-build-merger   commited 2017-08-21 21:41:25 +00:00
20eaf1b908