Commit Graph

3072 Commits

Author SHA1 Message Date
Michal Karpinski
5d4cf49095 DO NOT MERGE Extending DNS event reporting am: ba9dbc0a6d
am: 661283930f  -s ours

Change-Id: Icd67ff044613a33d938f6c21b8a19e95c06c05aa
2016-12-06 11:51:24 +00:00
Michal Karpinski
661283930f DO NOT MERGE Extending DNS event reporting
am: ba9dbc0a6d

Change-Id: Iaccaa3697f14ef111985c87ecbad3b9af81a0760
2016-12-06 11:40:23 +00:00
Michal Karpinski
ba9dbc0a6d 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 33fa018898)

Change-Id: I3941b8d6fc1dd578e2af6ed4d3c3d0a722c39918
2016-12-02 17:21:28 +00:00
Michal Karpinski
c47f876734 resolve merge conflicts of 3899d92 to nyc-mr2-dev-plus-aosp
am: 5696ebae40

Change-Id: Icb1db24d5e8727efba92badd310095ff803111af
2016-12-02 11:56:00 +00:00
Michal Karpinski
5696ebae40 resolve merge conflicts of 3899d92 to nyc-mr2-dev-plus-aosp
Change-Id: I9c08147c7a39f3121b5d817c2f498c9ad93066f3
2016-12-02 11:43:02 +00:00
Michal Karpinski
3899d9257b 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
d4be485c2d Merge "ConnectivityServiceTest: fix testAvoidBadWifiSettings" 2016-11-24 03:57:01 +00:00
TreeHugger Robot
f8e0f14007 Merge "Captive portal systel log improvements" 2016-11-24 03:45:57 +00:00
Hugo Benichi
6fe7d3cdb3 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
f57f2972fb Merge remote-tracking branch 'goog/cw-f-dev' into fix_merger am: 5dd0b48410 -s ours
am: 7f3f74c179

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

Change-Id: I915d9c44742a9e4193a5c405e0d4cfae770aaaf7
2016-11-23 18:26:38 +00:00
TreeHugger Robot
023f28d2af Merge "Fix ConnectivityServiceTest testRequestBenchmark" 2016-11-23 11:24:15 +00:00
Hugo Benichi
ccf7f00258 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
cf7db79028 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
5dd0b48410 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
88087226a6 [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
83f7a13fd7 Merge "Fix flaky IpPrefixTest." 2016-11-13 11:58:38 +00:00
Hugo Benichi
b3ac7ab583 Fix flaky IpPrefixTest.
Test: IpPrefixTest passes
Bug: 32561414
Change-Id: Ib4bffe9d33a6d4f5c2bd97798073de0f66d77645
2016-11-13 20:51:05 +09:00
Hugo Benichi
6e92ac355f DO NOT MERGE ANYWHERE Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission am: 4f299984a2 -s ours am: 37f3c58a0c -s ours am: 5a58c696f6 -s ours am: 5fec21d5e0 -s ours am: 70cd6f9877 -s ours am: d7e4af9ed6 -s ours am: 8fe310892b -s ours
am: 89683767de  -s ours

Change-Id: I2f2216c438756b0655d9183a98cee21cc642ec17
2016-11-10 19:02:03 +00:00
Hugo Benichi
89683767de DO NOT MERGE ANYWHERE Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission am: 4f299984a2 -s ours am: 37f3c58a0c -s ours am: 5a58c696f6 -s ours am: 5fec21d5e0 -s ours am: 70cd6f9877 -s ours am: d7e4af9ed6 -s ours
am: 8fe310892b  -s ours

Change-Id: I63236413fa5272bbfb8c4fba83879089007694bc
2016-11-10 18:55:34 +00:00
Hugo Benichi
d7e4af9ed6 DO NOT MERGE ANYWHERE Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission am: 4f299984a2 -s ours am: 37f3c58a0c -s ours am: 5a58c696f6 -s ours am: 5fec21d5e0 -s ours
am: 70cd6f9877  -s ours

Change-Id: I5bb53669285c0878905f8a2a70ff2dbe06c09ab2
2016-11-10 18:42:57 +00:00
Hugo Benichi
70cd6f9877 DO NOT MERGE ANYWHERE Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission am: 4f299984a2 -s ours am: 37f3c58a0c -s ours am: 5a58c696f6 -s ours
am: 5fec21d5e0  -s ours

Change-Id: I42aabc35fa30e242125015eac1b7d32790cc4528
2016-11-10 18:36:30 +00:00
Hugo Benichi
5fec21d5e0 DO NOT MERGE ANYWHERE Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission am: 4f299984a2 -s ours am: 37f3c58a0c -s ours
am: 5a58c696f6  -s ours

Change-Id: Ibe074076d22a736394a01d27aa9e1c7ed73458b2
2016-11-10 18:23:58 +00:00
Hugo Benichi
5a58c696f6 DO NOT MERGE ANYWHERE Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission am: 4f299984a2 -s ours
am: 37f3c58a0c  -s ours

Change-Id: If1903ace2a31d8ccf3c66916211a07ac342fc360
2016-11-10 18:11:02 +00:00
Hugo Benichi
37f3c58a0c DO NOT MERGE ANYWHERE Add CONNECTIVITY_USE_RESTRICTED_NETWORKS permission
am: 4f299984a2  -s ours

Change-Id: I2ba3b591df623298f41e92e6f0d067a6fcf30533
2016-11-10 18:04:26 +00:00
Hugo Benichi
4f299984a2 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
792b79610b 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
f233f3a95f Merge "frameworks-test: adding missing @SmallTest" 2016-11-07 00:09:56 +00:00
Etan Cohen
aee533d295 Merge "[NAN-AWARE] Rename NAN to Aware" am: d5cfbc15de am: 518e755712 am: 517e26e2db
am: 2ad6b14d50  -s ours

Change-Id: Id51e99533ce8ab29bd40170f8eafc0f9702c16fb
2016-11-06 03:38:18 +00:00
Etan Cohen
517e26e2db Merge "[NAN-AWARE] Rename NAN to Aware" am: d5cfbc15de
am: 518e755712

Change-Id: Ief54b313dc5ca5d30645b55ed2ad0333036a1671
2016-11-06 03:21:37 +00:00
Etan Cohen
518e755712 Merge "[NAN-AWARE] Rename NAN to Aware"
am: d5cfbc15de

Change-Id: I2e788e19a11f2709f2e542dbdc4b58433a3574bf
2016-11-06 03:13:31 +00:00
Etan Cohen
d5cfbc15de Merge "[NAN-AWARE] Rename NAN to Aware" 2016-11-06 03:05:40 +00:00
Etan Cohen
e32acff815 [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 a61b9fb569153917a650f1d48efa20ba8846a9f3)

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
e88f7fe854 [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 cb25e91426)
(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
7581e6d766 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
174b398594 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
aab195a223 [NAN-AWARE] Rename NAN to Aware [DO NOT MERGE]
am: cb25e91426  -s ours

Change-Id: I40abb81290d255c0369f4356bd78b46f5479a857
2016-11-03 20:03:59 +00:00
Michal Karpinski
bcf1936090 [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
cb25e91426 [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
384a9cb1f9 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
f59c92bb17 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
1de880a8fa 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
ea584abdc5 Extending DNS event reporting am: 59af05d744 am: 4dfa5eb908
am: 9351835591

Change-Id: Id482e6a300de49cc1d37ec6e38b9c651ec671f3e
2016-10-27 17:48:27 +00:00
Michal Karpinski
4dfa5eb908 Extending DNS event reporting
am: 59af05d744

Change-Id: I64e6a48fbbaa734447069b073c3499ef71af907c
2016-10-27 17:28:15 +00:00
Michal Karpinski
59af05d744 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 33fa018898)
2016-10-27 16:39:21 +00:00
Glen Kuhne
6543f1534f Merge "Move ipconnectivity.proto to services-proto.jar" 2016-10-27 16:27:27 +00:00
Hugo Benichi
72753055a8 Merge "ConnectivityServiceTest: mark flaky test as such" 2016-10-27 05:21:33 +00:00
Hugo Benichi
6d278a5693 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
3935ae9967 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
ab83d5b80c Merge "Add unit tests for Tethering.isTetherProvisioningRequired" am: 836ffa6e1c am: 4942a15e19 am: 1e0ea3cc22
am: 2ae41619ae

Change-Id: Iee7c8575ee22a494e2657e15e1aaae9b05a37045
2016-10-25 18:43:16 +00:00