Commit Graph

3172 Commits

Author SHA1 Message Date
Michal Karpinski
1a64c66489 DO NOT MERGE Extending DNS event reporting am: 274de89c51
am: 077521d4f8  -s ours

Change-Id: Icd67ff044613a33d938f6c21b8a19e95c06c05aa
2016-12-06 11:51:24 +00:00
Michal Karpinski
077521d4f8 DO NOT MERGE Extending DNS event reporting
am: 274de89c51

Change-Id: Iaccaa3697f14ef111985c87ecbad3b9af81a0760
2016-12-06 11:40:23 +00:00
Michal Karpinski
274de89c51 DO NOT MERGE 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

(cherry picked from commit 14c9d2d0df7fab2b0470c3c404f600d87d4f0f93)

Change-Id: I3941b8d6fc1dd578e2af6ed4d3c3d0a722c39918
2016-12-02 17:21:28 +00:00
Michal Karpinski
906a1e52ed resolve merge conflicts of be9ba1e to nyc-mr2-dev-plus-aosp
am: 9b69d1ab1f

Change-Id: Icb1db24d5e8727efba92badd310095ff803111af
2016-12-02 11:56:00 +00:00
Michal Karpinski
9b69d1ab1f resolve merge conflicts of be9ba1e to nyc-mr2-dev-plus-aosp
Change-Id: I9c08147c7a39f3121b5d817c2f498c9ad93066f3
2016-12-02 11:43:02 +00:00
Michal Karpinski
be9ba1ea3c DO NOT MERGE Rename the DnsEventListenerService to NetdEventListenerService
The service will be extended to include listening for connect events as well.

Test: this is just a renaming change

Bug: 29748723
Change-Id: I073187e354fc987222ec0108d7f0d3a422397d5e
2016-11-24 17:05:02 +00:00
TreeHugger Robot
cdbd2408d8 Merge "ConnectivityServiceTest: fix testAvoidBadWifiSettings" 2016-11-24 03:57:01 +00:00
TreeHugger Robot
bb88a1db50 Merge "Captive portal systel log improvements" 2016-11-24 03:45:57 +00:00
Hugo Benichi
2a3998dd05 Captive portal systel log improvements
This patch improves system logging around captive portal detection to
make inspection of bug reports sligthly easier:

- NetworkMonitor now logs by default CMD_CAPTIVE_PORTAL_RECHECK and
  CMD_CAPTIVE_PORTAL_APP_FINISHED. Other system logs are kept off with
  a new VDBG boolean contant,
- NetworkNotificationManager now prints the notification id at
  notification time. This allows to easily correlate show and clear.
- errors in NetworkNotificationManager are logged as Throwable instead
  of through their implicit toString() method.

Test: $ runtest frameworks-net
Bug: 32198726
Change-Id: Id74a9912880083d41e27753240e781595081ff7a
2016-11-24 10:36:04 +09:00
Baligh Uddin
42d3e02c67 Merge remote-tracking branch 'goog/cw-f-dev' into fix_merger am: 2ff98c432c -s ours
am: 11d6e9b422

Change-Id: Ibc6010d35accc93b8083960876281a133d266766
2016-11-23 18:34:12 +00:00
Baligh Uddin
11d6e9b422 Merge remote-tracking branch 'goog/cw-f-dev' into fix_merger
am: 2ff98c432c  -s ours

Change-Id: I915d9c44742a9e4193a5c405e0d4cfae770aaaf7
2016-11-23 18:26:38 +00:00
TreeHugger Robot
db37aeb5b8 Merge "Fix ConnectivityServiceTest testRequestBenchmark" 2016-11-23 11:24:15 +00:00
Hugo Benichi
b54c8cffa8 ConnectivityServiceTest: fix testAvoidBadWifiSettings
This patch introduces an assertEventuallyThat helper function in
ConnectivityServiceTest which given a boolean function retries until the
function returns true or until a maximum retry time is reached.

This function is used to fix flakyness of testAvoidBadWifiSetting where
the Message posted by reevaluate() could reach the Handler's
MessageQueue after waitForIdle takes effect, resulting in the test to
fail.

Instead of fixing the flakyness by introdcing hard sleep times,
assertEventuallyThat is used to reduce the overall test time.

With this change the test has been observed to pass with 100% success
rate over 50000 invocations.

Test: $ runtest frameworks-net
Bug: 32561414
Change-Id: Ib20f4656620b119456c2cb1c709a7fe8195fe44d
2016-11-23 18:29:52 +09:00
Hugo Benichi
766e564647 Fix ConnectivityServiceTest testRequestBenchmark
This patch fixes flakyness of testRequestBenchmark by adjusting time
limit for callback registration from 100ms to 180ms, and time limits for
onAvailable and onLost triggers from 30ms to 40ms.

With these timeouts the test succeeds 100% over 5000 iterations.

When using 150ms for registration timeout, running the test 5000 times
fails 2 times.

When using 30ms for onLost timeout, running the test 5000 times fails
1 times.

In addition, this patch also cleans testRequestBenchmark and uses the
more stable SystemClock.elapsedRealtime() for duration measurements.

Test: $ runtest frameworks-net
Bug: 32561414
Change-Id: I7601b2f1f11f83914f885a74c8a376173eed186b
2016-11-23 18:27:05 +09:00
Baligh Uddin
2ff98c432c Merge remote-tracking branch 'goog/cw-f-dev' into fix_merger
Bug: 32849428

* goog/cw-f-dev: (98 commits)
  Revert "Catch KeyStoreException for setting profile lock"
  Fix createConfirmDeviceCredentialIntent for wear for CTS.
  Fix default dialog background colour for watch devices.
  Catch KeyStoreException for setting profile lock
  Add cross-links between FINE and COARSE location permissions. bug: 25371600
  Fixed a bug with the emergency affordance in multi user
  Zygote: Additional whitelists for runtime overlay / other static resources.
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Zygote : Block SIGCHLD during fork.
  colors: add missing accent_material_{700,50} resources.
  Import translations. DO NOT MERGE
  Import translations. DO NOT MERGE
  Zygote : Block SIGCHLD during fork.
  DO NOT MERGE ANYWHERE Revert "DO NOT MERGE ANYWHERE libhwui: make setSurface asynchronous"
  ...

Change-Id: I63468da5bfa21ed9ac5985bbdbf3a61d4c389aa0
2016-11-22 17:19:45 -08:00
Etan Cohen
5eba9d7061 [CS] Remove timeout event after first available
Guarantees that timeouts are only delivered if a network never
becomes available. Once a network is available the timeout is
canceled.

Bug: 31402633
Test: all timeout related unit tests pass (new one added)
Change-Id: I2b7adffd82173cf8b99084cbfe5399961d51e148
2016-11-21 19:15:10 +00:00
Hugo Benichi
42664b1332 Merge "Fix flaky IpPrefixTest." 2016-11-13 11:58:38 +00:00
Hugo Benichi
f5ec69155d Fix flaky IpPrefixTest.
Test: IpPrefixTest passes
Bug: 32561414
Change-Id: Ib4bffe9d33a6d4f5c2bd97798073de0f66d77645
2016-11-13 20:51:05 +09:00
Hugo Benichi
68bf2e6cd8 DO NOT MERGE ANYWHERE Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission am: 849682f5a0 -s ours am: d55ff11c4b -s ours am: 0a159e0967 -s ours am: 24c196f55f -s ours am: ec451e5173 -s ours am: 05c86a58be -s ours am: 8fe310892b -s ours
am: 0606e70a9a  -s ours

Change-Id: I2f2216c438756b0655d9183a98cee21cc642ec17
2016-11-10 19:02:03 +00:00
Hugo Benichi
0606e70a9a DO NOT MERGE ANYWHERE Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission am: 849682f5a0 -s ours am: d55ff11c4b -s ours am: 0a159e0967 -s ours am: 24c196f55f -s ours am: ec451e5173 -s ours am: 05c86a58be -s ours
am: 8fe310892b  -s ours

Change-Id: I63236413fa5272bbfb8c4fba83879089007694bc
2016-11-10 18:55:34 +00:00
Hugo Benichi
05c86a58be DO NOT MERGE ANYWHERE Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission am: 849682f5a0 -s ours am: d55ff11c4b -s ours am: 0a159e0967 -s ours am: 24c196f55f -s ours
am: ec451e5173  -s ours

Change-Id: I5bb53669285c0878905f8a2a70ff2dbe06c09ab2
2016-11-10 18:42:57 +00:00
Hugo Benichi
ec451e5173 DO NOT MERGE ANYWHERE Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission am: 849682f5a0 -s ours am: d55ff11c4b -s ours am: 0a159e0967 -s ours
am: 24c196f55f  -s ours

Change-Id: I42aabc35fa30e242125015eac1b7d32790cc4528
2016-11-10 18:36:30 +00:00
Hugo Benichi
24c196f55f DO NOT MERGE ANYWHERE Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission am: 849682f5a0 -s ours am: d55ff11c4b -s ours
am: 0a159e0967  -s ours

Change-Id: Ibe074076d22a736394a01d27aa9e1c7ed73458b2
2016-11-10 18:23:58 +00:00
Hugo Benichi
0a159e0967 DO NOT MERGE ANYWHERE Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission am: 849682f5a0 -s ours
am: d55ff11c4b  -s ours

Change-Id: If1903ace2a31d8ccf3c66916211a07ac342fc360
2016-11-10 18:11:02 +00:00
Hugo Benichi
d55ff11c4b DO NOT MERGE ANYWHERE Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission
am: 849682f5a0  -s ours

Change-Id: I2ba3b591df623298f41e92e6f0d067a6fcf30533
2016-11-10 18:04:26 +00:00
Hugo Benichi
849682f5a0 DO NOT MERGE ANYWHERE Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission
This patch creates a new permission used by ConnectivityService to give
access to restricted networks without the NET_CAPABILITY_NOT_RESTRICTED
capability bit on.

Bug: 24497316
Change-Id: I5b6c8a9ef14395b2f1ab26cb17b24d7876ec79f1
2016-11-09 19:08:30 -08:00
Tamas Berghammer
55f36459c8 Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
2016-11-08 14:06:09 +00:00
Hugo Benichi
31720a9dc5 Merge "frameworks-test: adding missing @SmallTest" 2016-11-07 00:09:56 +00:00
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
Hugo Benichi
3664598601 frameworks-test: adding missing @SmallTest
This activates all frameworks-test tests in runs of the continuous
platform tests.

Test: $ runtest frameworks-net passes (expect Tether
Bug: 32561414
Change-Id: Ib42c4ab2d7214891cd451875ca4bf6db195538c1
2016-11-04 16:46:29 +09: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