Commit Graph

3043 Commits

Author SHA1 Message Date
Etan Cohen
8e96c20ede Merge "[NAN-AWARE] Rename NAN to Aware" am: 6c75254555 am: 4ddc6321ef am: 9f1b6c3da9
am: 2ad6b14d50  -s ours

Change-Id: Id51e99533ce8ab29bd40170f8eafc0f9702c16fb
2016-11-06 03:38:18 +00:00
Etan Cohen
9f1b6c3da9 Merge "[NAN-AWARE] Rename NAN to Aware" am: 6c75254555
am: 4ddc6321ef

Change-Id: Ief54b313dc5ca5d30645b55ed2ad0333036a1671
2016-11-06 03:21:37 +00:00
Etan Cohen
4ddc6321ef Merge "[NAN-AWARE] Rename NAN to Aware"
am: 6c75254555

Change-Id: I2e788e19a11f2709f2e542dbdc4b58433a3574bf
2016-11-06 03:13:31 +00:00
Etan Cohen
6c75254555 Merge "[NAN-AWARE] Rename NAN to Aware" 2016-11-06 03:05:40 +00:00
Etan Cohen
7e93db5bda [NAN-AWARE] Rename NAN to Aware
~Rename only (and any reformatting needed to pass lint) - no
functional changes!

Remove android.net.wifi.nan.STATE_CHANGED from manifest:
redundant/remnant of an older configuration.

(cherry-pick of commit a0edbf0ac8)

Bug: 32263750
Test: All unit tests and integration (sl4a) tests pass.
Merged-In: Ie4ff675fa61041e8fcf6a9bf9900ea835d0a7614
Change-Id: I4206d2fd722dc7dec9df4aee5c818101d7f9dccc
2016-11-05 09:41:38 -07:00
Etan Cohen
018d76cb9b [NAN-AWARE] Rename NAN to Aware
~Rename only (and any reformatting needed to pass lint) - no
functional changes!

Remove android.net.wifi.nan.STATE_CHANGED from manifest:
redundant/remnant of an older configuration.

(cherry-pick of commit a0edbf0ac8)
(cherry-pick of commit b061f21e7e59a99834e163e2baa1c82229e419a6)

Bug: 32263750
Test: All unit tests and integration (sl4a) tests pass.
Change-Id: Ie4ff675fa61041e8fcf6a9bf9900ea835d0a7614
2016-11-04 15:42:08 -07:00
Stephen Chen
9369e9d105 Implement metered tracking for NetworkStats summary queries.
Dependent on ag/1550196 where API is defined.

Bug: 31015360
Bug: 26545374
Test: runtest --path
frameworks/base/core/tests/coretests/src/android/net/NetworkStatsTest.java,
other test classes.

Change-Id: I968b9e3352d7880e3fc438f12de628a2da057e0a
2016-11-04 09:55:21 -07:00
Etan Cohen
14a215edd3 [NAN-AWARE] Rename NAN to Aware [DO NOT MERGE]
am: a0edbf0ac8  -s ours

Change-Id: I40abb81290d255c0369f4356bd78b46f5479a857
2016-11-03 20:03:59 +00:00
Michal Karpinski
45fb09ff45 [DPM] DO can start network logging and listen for events
This CL adds:
1) Setter and getter in DPM to manipulate logging switch (retrieval
method to come in a subsequent CL(s)).
2) A way for DPM to register to listen for events.
3) Skeleton of NetworkLogger class (more to come in subsequent CL(s)).

Bug: 29748723
Change-Id: I5c04662ccc6febd2ba294b0eaca1ed1da9c16e47
2016-11-02 08:52:53 +00:00
Etan Cohen
a0edbf0ac8 [NAN-AWARE] Rename NAN to Aware [DO NOT MERGE]
~Rename only (and any reformatting needed to pass lint) - no
functional changes!

Remove android.net.wifi.nan.STATE_CHANGED from manifest:
redundant/remnant of an older configuration.

Bug: 32263750
Test: All unit tests and integration (sl4a) tests pass.
Change-Id: I6866f8825101a32adb9b05d83f0d9d3792b478b7
2016-10-31 15:37:59 +00:00
Lorenzo Colitti
5a7c486d70 Move the connectivity tests to frameworks/base/tests/net.
This will give us a good place to put all the networking tests.

Fix: 31479480
Test: adb  shell am instrument -w -e notClass com.android.server.connectivity.tethering.TetherInterfaceStateMachineTest 'com.android.frameworks.tests.net/android.support.test.runner.AndroidJUnitRunner'  # PASS
Change-Id: I4b389f7f4e33a996885b38670f585e58ca66f777
2016-10-28 17:12:36 +09:00
Lorenzo Colitti
6a64dd2178 De-guava BroadcastInterceptingContext and move it to testutils.
Removing the static dependency on guava reduces test compile time
by about 20 seconds on a Z840, thus substantially speeding up the
compile/test cycle.

Make FutureIntent public instead of package-private because it is
used directly by NetworkPolicyManagementServiceTest, which as of
this CL is now in a different package.

Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest  # PASS
Test: runtest frameworks-services -c com.android.server.NetworkPolicyManagerServiceTest  # PASS
Test: runtest frameworks-services -c com.android.server.net.NetworkStatsServiceTest  # PASS
Test: runtest frameworks-services -c com.android.server.NetworkManagementServiceTest  # Already failing.
Bug: 31479480
Change-Id: Ifab32c9214e9caab71dbf93b3d3ca88df6f49636
2016-10-28 17:12:36 +09:00
Lorenzo Colitti
4163f9ca8f Move FakeSettingsProvider to a common location.
Test: runtest frameworks-util -c com.android.internal.util.test.FakeSettingsProviderTest
Test: runtest frameworks-services -c com.android.server.ConnectivityServiceTest
Test: runtest frameworks-services -c com.android.server.retaildemo.PreloadAppsInstallerTest
Test: runtest frameworks-services -c com.android.server.retaildemo.RetailDemoModeServiceTest
Bug: 31479480
Change-Id: I82a1a1a7219cf1385092b84d85eddf9dda90c685
2016-10-28 17:12:31 +09:00
Michal Karpinski
877dd9b541 Extending DNS event reporting am: bca2d211f6 am: 24f2212843
am: 9351835591

Change-Id: Id482e6a300de49cc1d37ec6e38b9c651ec671f3e
2016-10-27 17:48:27 +00:00
Michal Karpinski
24f2212843 Extending DNS event reporting
am: bca2d211f6

Change-Id: I64e6a48fbbaa734447069b073c3499ef71af907c
2016-10-27 17:28:15 +00:00
Michal Karpinski
bca2d211f6 Extending DNS event reporting
This adds hostname, array of addresses, total count of IP addresses
and uid to the existing pipeline.
Currently ignores the new data it receives, further work will be
done in the subsequent CLs.

Test: for now just the benchmarking, in the future unit and CTS

Bug: 29748723
Change-Id: Ice7db208282934e74f0e1808ffbae96d476c4216
(cherry picked from commit 58a5c98b40)
2016-10-27 16:39:21 +00:00
Glen Kuhne
9318e37e71 Merge "Move ipconnectivity.proto to services-proto.jar" 2016-10-27 16:27:27 +00:00
Hugo Benichi
0f96fca5d3 Merge "ConnectivityServiceTest: mark flaky test as such" 2016-10-27 05:21:33 +00:00
Hugo Benichi
144810b6cf ConnectivityServiceTest: mark flaky test as such
This patch extracts into its own independent test a test sub-block looking
for a race condition when not waiting on handlers to become idle:
there is no way to prevent the race from not happening when looking for
it this way. This makes the test flakky.

This new independent test is tagged with @FlakkyTest(tolerance = 3).

Test: ConnectivityServiceTest passes, with higher probability.
Bug: 31479480
Change-Id: Ic0e2ffbe669f2ea8cc62e8a0d4763703368db019
2016-10-27 09:38:54 +09:00
Glen Kuhne
1f0cb8f6ab Move ipconnectivity.proto to services-proto.jar
Moved ipconnectivity.proto from services.core.jar to
framework-protos.jar.
Replaced 'mergeFrom' MessageNano base class calls, with 'parseFrom'
IpConnectivityLog calls.

This solves an issue where the services.jar would conflict with
duplicate nano proto base class definitions in other .jars
(wifi-service.jar).

Bug: 32261442
Test: Existing unit tests pass
Change-Id: I49100935fcae2e85e12eaa7f3462864f3a340b97
2016-10-26 10:18:46 -07:00
Christopher Wiley
4237636ea2 Merge "Add unit tests for Tethering.isTetherProvisioningRequired" am: 836ffa6e1c am: d2b306dee1 am: 0dcc2eccba
am: 2ae41619ae

Change-Id: Iee7c8575ee22a494e2657e15e1aaae9b05a37045
2016-10-25 18:43:16 +00:00
Christopher Wiley
0dcc2eccba Merge "Add unit tests for Tethering.isTetherProvisioningRequired" am: 836ffa6e1c
am: d2b306dee1

Change-Id: Ica704d0a64dde80ae0a9f1cef0250bfbdafcd49a
2016-10-25 18:31:02 +00:00
Christopher Wiley
d2b306dee1 Merge "Add unit tests for Tethering.isTetherProvisioningRequired"
am: 836ffa6e1c

Change-Id: I1dab386e3891c01a2917c32847d2aecdbfa10102
2016-10-25 18:23:02 +00:00
Christopher Wiley
fcc0d9fd8b Add unit tests for Tethering.isTetherProvisioningRequired
Check that we tolerate various dependencies not being available.

Bug: 31946071
Test: These are tests

Change-Id: Ic0a9cd6f255ba9ff4c774dee640df1a0bdf8dc39
2016-10-24 17:07:05 -07:00
TreeHugger Robot
70544b339b Merge changes I1a544a8d,Ie78d3fb0
* changes:
  IpConnectivityMetrics: rate limit ApfProgramEvents
  IpConnectivityMetrics reads buffer size in settings
2016-10-24 14:45:46 +00:00
Hugo Benichi
e3f7299ce2 IpConnectivityMetrics: rate limit ApfProgramEvents
This patch uses the previously introduced TokenBucket to rate limit
ApfProgramEvents, still allowing for burst of ApfProgramEvents when a
new interface is set up (due to ipv4 provisioning, multicast lock, ipv6 RAs
triggering new APF program events in short amounts of time).

Test: new test in IpConnectivityMetricsTest
Bug: 1550402
Change-Id: I1a544a8d62e6b02f0ed0088ab76c4bad338d2f44
2016-10-24 21:54:37 +09:00
Hugo Benichi
6d8c1dfe4b IpConnectivityMetrics reads buffer size in settings
Test: IpConnectivityMetricsTest passes. Also manually changed the new
setting and verified the buffer size is as expected after flushing the
buffer.
Bug: 32198637
Change-Id: Ie78d3fb03cea7883585549dac4f2063f0a8d9f4b
2016-10-24 13:52:41 +09:00
Jeremy Joslin
de4886b1bd VPN network stat accounting changes. am: adaddcd778 am: c63551df8e
am: bc3eed1e5a

Change-Id: I1edec6bf2a590f5b0ff010adfd6f2785a1aaa994
2016-10-21 23:47:35 +00:00
Jeremy Joslin
bc3eed1e5a VPN network stat accounting changes. am: adaddcd778
am: c63551df8e

Change-Id: I797ac586581f83ada0e94639dd435122c987f1c1
2016-10-21 23:43:06 +00:00
Jeremy Joslin
c63551df8e VPN network stat accounting changes.
am: adaddcd778

Change-Id: I1c65db583cdd1d5b519830e521c633cb8dee449f
2016-10-21 23:37:57 +00:00
Jeremy Joslin
adaddcd778 VPN network stat accounting changes.
Properly account for VPN apps that make heavy use of the tun
interface. Prior to this change a VPN app could be incorrectly charged
for more data than it actually used if it sent more traffic through
the tun interface than the underlying interface.

This change excludes VPN app traffic on the tun interface from the
adjustment pool and doesn't redistribute traffic to the VPN app.
Instead all of the redistributed traffic is deducted from the VPN app
which effectively represents any overhead incurred by the VPN app.

BUG: 30557871
Change-Id: I62a75a0c0c0111e052b7903baa9f5d6d94ef57fd
2016-10-21 18:47:57 +09:00
Hugo Benichi
dbac14ba69 Merge "IpConnectivity metrics: add version number" 2016-10-21 04:35:52 +00:00
TreeHugger Robot
650fa1cca6 Merge "ConnectivityManager: use ConnectivityThread looper" 2016-10-21 01:49:46 +00:00
Hugo Benichi
3b41f05d68 ConnectivityManager: use ConnectivityThread looper
This patch removes the static singleton looper used by
ConnectivityManager and instead uses the common ConnectivityThread.

This allows to removes the static atomic counter used to track
the number of registered NetworkCallback in ConnectivityManager, because
the looper is not turned off anymore when no callbacks are registered.

Also an overloaded version of sendRequestForNetwork is added taking as a
new parameter a Handler. This will allow to overload various callback
and request related API calls with user provided Handlers.

Test: ConnectivityServiceTest passes
Bug: 26749700
Bug: 28537383
Bug: 32130437
Change-Id: I431afcee7c7155bd7bac23a2e1e97fd5d6520c74
2016-10-21 08:54:34 +09:00
Hugo Benichi
12498a675e Merge "ConnectivityThread: use lazy holder idiom" 2016-10-20 23:49:03 +00:00
Hugo Benichi
55a1f6ee61 Merge "ConnectivityManager: a simpler CallbackHandler" 2016-10-20 23:46:30 +00:00
Calvin On
d6d4e341e2 Add option to skip and avoid captive portals. am: 5139717c74
am: 4376c759d4

Change-Id: I530ccb95aa97100b27d71186173645031082acc1
2016-10-20 20:26:52 +00:00
Calvin On
4376c759d4 Add option to skip and avoid captive portals.
am: 5139717c74

Change-Id: Id38d5c03d06822f9b20abd65db9dd04c90110b63
2016-10-20 20:18:10 +00:00
Calvin On
5139717c74 Add option to skip and avoid captive portals.
Test: ConnectivityServiceTest updated with test cases.
Test: Manually tested against att-wifi in B42.
Bug: 30222699
Change-Id: Ibe63942da04748ab0406e24e0f44be31d47710a0
(cherry picked from commit be96da11ccb5dd500f920c3ba90d350857293b3d)
2016-10-20 18:50:46 +00:00
Calvin On
dada145a85 Add option to skip and avoid captive portals.
Test: ConnectivityServiceTest updated with test cases.
Test: Manually tested against att-wifi in B42.
Bug: 30222699
Change-Id: Ibe63942da04748ab0406e24e0f44be31d47710a0
2016-10-20 00:51:39 -07:00
Hugo Benichi
3ab84b087a ConnectivityThread: use lazy holder idiom
This patch changes the way that the ConnectivityThread is lazily
instantiated by using the "lazy initialization holder class idiom".

The first code point that tries to obtain a reference to the unique
ConnectivityThread instance will trigger the creation of the Singleton
class, which will guarantee a thread-safe initialization of the static
INSTANCE field inside Singleton according to the language specs.

This is the Item #71 of Effective Java.

The unique static instance of ConnectivityThread is not stored directly
inside ConnectivityThread class but is stored in a static nested class.
This is to avoid triggering the creation of that unique instance when
Zygote does class preloading at phone startup. Otherwise this would lead
to Zygote creating a new OS thread during preloading, which is a fatal
error.

Test: frameworks-wifi tests pass
Bug: 26749700
Bug: 28537383
Bug: 32130437

Change-Id: I4d5672a3195d3af9a0a2c85f871695257abe782b
2016-10-20 09:30:13 +09:00
Hugo Benichi
0b42baf68a ConnectivityManager: a simpler CallbackHandler
This patch simplifies CallbackHandler in the following way:
  - CallbackHandler directly uses the static references to
    sNetworkCallback and sCallbackRefCount. This allows to remove
    instance fields in CallbackHandler.
  - CallbackHandler does not have a reference to ConnectivityManager
    anymore
  - CallbackHandler.getObject() is now generic in a type-safe way.

Test: ConnectivityServiceTest passes
Bug: 28537383
Bug: 32130437
Change-Id: I5004da5b91498e6ff7f8b05057a9e24b975bb56e
2016-10-20 09:09:02 +09:00
TreeHugger Robot
4320474eb2 Merge "Show notification for always-on app VPN" 2016-10-17 15:33:59 +00:00
Hugo Benichi
f04b01f0a0 IpConnectivity metrics: add version number
This patch adds a version field to ipconnectivity.proto and populates it
to 2, which is the logical version number for NYC-MR2.

Test: IpConnectivity{EventBuilder,Metrics}Test pass
Bug: 32127906
Change-Id: I1439f012b7f9b4211d5d5429c274ad03d2ac9d6b
2016-10-17 16:24:19 +09:00
Michal Karpinski
58a5c98b40 Extending DNS event reporting
This adds hostname, array of addresses, total count of IP addresses
and uid to the existing pipeline.
Currently ignores the new data it receives, further work will be
done in the subsequent CLs.

Test: for now just the benchmarking, in the future unit and CTS

Bug: 29748723
Change-Id: Ice7db208282934e74f0e1808ffbae96d476c4216
2016-10-10 16:49:07 +01:00
Erik Kline
d44ea3ce1e Refactor "avoid bad wifi" logic into a utility class am: 95ecfee674 am: 567fc7861d am: 23d83b031f
am: 18cc602880

Change-Id: Ie3d058d6c9da43763d10b0a2bc96171d07673e9d
2016-10-07 01:03:58 +00:00
Christopher Wiley
a996f42121 Notify NetworkPolicyManagerService on tethering changes am: cfd438e0fd am: deed245740
am: 30a5755afc

Change-Id: I063450c82f80f137cd130d384134a83820d8f084
2016-10-07 00:37:04 +00:00
Erik Kline
18cc602880 Refactor "avoid bad wifi" logic into a utility class am: 95ecfee674 am: 567fc7861d
am: 23d83b031f

Change-Id: I7db61e54c80ec836d00bf4ae087137bb296c30f1
2016-10-06 20:44:56 +00:00
Erik Kline
23d83b031f Refactor "avoid bad wifi" logic into a utility class am: 95ecfee674
am: 567fc7861d

Change-Id: Id670d13b99ab6935b67335e19d2389e5b4f61111
2016-10-06 20:16:57 +00:00
Christopher Wiley
30a5755afc Notify NetworkPolicyManagerService on tethering changes am: cfd438e0fd
am: deed245740

Change-Id: Ic1b99f8bbeffde72dd93d4879aa25954d0d98554
2016-10-06 20:08:44 +00:00