Commit Graph

3834 Commits

Author SHA1 Message Date
Jeremy Klein
d707b3716b DO NOT MERGE: Add a null check for the OnStartTetheringCallback.
This avoids a NullPointerException when trying to call the callback
and gives a more readable error message.

(cherry picked from commit 35e99ea8ef)

(cherry picked from commit fb63d5a4ef)

Change-Id: Ia5f328c4b25aa6624dc3c8493eb0c7bbab99904c
2017-01-18 19:08:14 +09:00
Etan Cohen
a814243e87 DO NOT MERGE: [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)

(cherry picked from commit 5eba9d7061)

(cherry picked from commit 3fb372fe9f)

Change-Id: I0cf1a2b7d25bc9912e03fca30621809a9071396c
2017-01-18 19:08:11 +09:00
Lorenzo Colitti
e8d1e9daa0 DO NOT MERGE: 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

(cherry picked from commit 5a7c486d70)

Change-Id: I4c417c2ba0747d2085169e47ae4a99e93c4d8814
2017-01-18 19:08:05 +09:00
Lorenzo Colitti
0c7a3c349d DO NOT MERGE: 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.

(cherry picked from commit 6a64dd2178)

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

(cherry picked from commit 834805275a)

Change-Id: I8a95d4618dced81f173d2b38b9c1dfe3860b348a
2017-01-18 19:08:02 +09:00
Lorenzo Colitti
cf31451670 DO NOT MERGE: Move FakeSettingsProvider to a common location.
(cherry picked from commit 4163f9ca8f)

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

(cherry picked from commit 4166a1fcfa)

Change-Id: Ib82b162f354b8cbb521bc0783556f3225b4d12ac
2017-01-18 19:08:00 +09:00
Hugo Benichi
30c0460727 DO NOT MERGE: 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

(cherry picked from commit 144810b6cf)

Change-Id: I32632bb763585c23f1de5bb1811a384a35bf9f64
2017-01-18 19:07:59 +09:00
Erik Kline
ee83e11aeb DO NOT MERGE: Support timeouts for requestNetwork() invocations.
(cherry-pick of 0b7a74842b)
(cherry picked from commit 155a59aa63)

Bug: 21414325

(cherry picked from commit 5791c5f681)

Change-Id: I640c43315a071ecbf881e5ce898164915e0b787f
2017-01-18 19:07:33 +09:00
Koichi, Sugimoto
45dbfe7c3e Disable always-on VPN in factoryReset
When network setting reset is started while always-on VPN is enabled,
application crash occurs with IllegalStateException in prepareVpn().

Therefore, it's necessary to also disable always-on VPN in factoryReset
before prepareVpn() when turning off VPN.

Bug: 29030858
Change-Id: I08c5406717dd7937d197c2e934a56d037477aafc
2017-01-18 10:02:58 +00:00
Pierre Imai
9e98fecd15 DO NOT MERGE: Silence the obnoxious MTU 0 error message that occur when no MTU is
specified for a given network.

Bug: 10705136

(cherry picked from commit 07c53a35ae)

(cherry picked from commit fb3178adfc)

Change-Id: I12ac6f511a6760ef26f489ba3a052ca3c125e5ee
2017-01-18 18:12:35 +09:00
Lorenzo Colitti
bcafe16d3a Merge "Enable mobile data always on." am: 7ab1654533 am: 0df74d1ee7 am: e50c60e1f1
am: f9f8abce19

Change-Id: I8d61c1a22a702cbd23638d46dfad36365b29180c
2017-01-17 06:56:53 +00:00
Hugo Benichi
bd835ce1f7 Merge "ConnectivityServiceTest: some fixes in CallbackInfo" am: 37727596cc am: ac7e9a2b47 am: 073a0ac614
am: 04d4730e15  -s ours

Change-Id: I2877281247a78e4d814a1df8bea71fd3c37b1962
2017-01-17 06:48:05 +00:00
Lorenzo Colitti
f9f8abce19 Merge "Enable mobile data always on." am: 7ab1654533 am: 0df74d1ee7
am: e50c60e1f1

Change-Id: Iaf4f84f53be65800c95a4f1b456a0d2d142c8c87
2017-01-17 04:36:21 +00:00
Lorenzo Colitti
e50c60e1f1 Merge "Enable mobile data always on." am: 7ab1654533
am: 0df74d1ee7

Change-Id: Ie2b6887021585a2e7246d66603dadc8d0fa1bd94
2017-01-17 04:31:00 +00:00
Lorenzo Colitti
0df74d1ee7 Merge "Enable mobile data always on."
am: 7ab1654533

Change-Id: I9758da5105b9a8eac66aaaf9e4a1658685a6a3f7
2017-01-17 04:25:44 +00:00
Treehugger Robot
7ab1654533 Merge "Enable mobile data always on." 2017-01-17 04:15:34 +00:00
Lorenzo Colitti
bcecc7a8ae Enable mobile data always on.
Test: has been on in fishfood several months.
Bug: 23113288
Change-Id: I73ba432f619d28dab78e2d865d56aa7e7c5a67f9
2017-01-17 11:07:50 +09:00
Hugo Benichi
1db5dfef30 Merge "IP connectivity metrics: fix tests" 2017-01-16 08:28:47 +00:00
Hugo Benichi
2d26b0e4b0 Stricter NetworkNotificationManagerTest
This patch changes NetworkNotificationManagerTest to populate extraInfo
of NetworkInfo in order to catch regressions in malformed format Strings
of log statements in NetworkNotificationManager.

Test: verified that the test fails when reintroducing the format String
bug.
Bug: 33737715

(cherry picked from commit 3cb1d2b45d)

Change-Id: Ic2f23e860a17cb83b90edcfd2ba365134cacfe36
2017-01-16 15:15:26 +09:00
Hugo Benichi
968c0ea3a3 IP connectivity metrics: fix tests
Change 4e89a026292338761838b33fc83b250f3519819c did not update the unit
tests checking serialization of ipconnectivity.proto protobufs.

This patch updates the tests expectations to make them pass again

Test: $ runtest frameworks-net
Bug: 34232829
Change-Id: Iccc4e1a7714c9ce1eba995dc47a2961216efc87d
2017-01-16 14:42:56 +09:00
Hugo Benichi
04d4730e15 Merge "ConnectivityServiceTest: some fixes in CallbackInfo" am: 37727596cc am: ac7e9a2b47
am: 073a0ac614

Change-Id: Ifc208e00e05efb29eaa2ab37abdc66d8c7ed8f4f
2017-01-16 05:13:01 +00:00
Hugo Benichi
073a0ac614 Merge "ConnectivityServiceTest: some fixes in CallbackInfo" am: 37727596cc
am: ac7e9a2b47

Change-Id: I839ed526e802b88bbed490b611f90d829b952f26
2017-01-16 05:04:39 +00:00
Hugo Benichi
ac7e9a2b47 Merge "ConnectivityServiceTest: some fixes in CallbackInfo"
am: 37727596cc

Change-Id: I636b7b0ef210aaa3e130e1c1a162a35cdc099295
2017-01-16 05:00:30 +00:00
Hugo Benichi
b573a2964c ConnectivityServiceTest: some fixes in CallbackInfo
- CallbackInfo becomes a static class so that it can be instantiated
  and looked at more easily than before.
- CallbackInfo gains hashCode() because it has equals().
- effectively final field are qualified final
- fixes bug when polling the next callback: poll() on a LinkedBlockingQueue
  returns null when timing out, which was not failing the test cleanly.

Test: ConnectivityServiceTest passes
Bug: 32561414
Change-Id: I64d382a35fe83f21bded98e6906c1ec70a8f1085
2017-01-16 11:15:04 +09:00
Etan Cohen
abccaf34c3 Merge "[AWARE] Unhide Wi-Fi Aware API (baseline)" am: dfe8f5dc13 am: 877ccf68fb am: 463d3c6e7c
am: 669e846a8a

Change-Id: Ib668ed15ccf1f05c5ed31f700b69e1f3ab8b4cac
2017-01-11 23:28:20 +00:00
Etan Cohen
669e846a8a Merge "[AWARE] Unhide Wi-Fi Aware API (baseline)" am: dfe8f5dc13 am: 877ccf68fb
am: 463d3c6e7c

Change-Id: If2a6b632cd03984921572b190745865953a8e808
2017-01-11 23:22:51 +00:00
Etan Cohen
463d3c6e7c Merge "[AWARE] Unhide Wi-Fi Aware API (baseline)" am: dfe8f5dc13
am: 877ccf68fb

Change-Id: I6f894d92451032657678639c3021eef07289a6a2
2017-01-11 23:17:19 +00:00
Etan Cohen
877ccf68fb Merge "[AWARE] Unhide Wi-Fi Aware API (baseline)"
am: dfe8f5dc13

Change-Id: I581b72ce62966f4c04427603a2b9686dcf46cc42
2017-01-11 23:12:16 +00:00
Etan Cohen
785ddc7f52 [AWARE] Unhide Wi-Fi Aware API (baseline)
Baseline Wi-Fi Aware API providing discovery and connectivity (data-path).

Bug: 30983968
Test: unit tests + integration (sl4a) tests passing.
Change-Id: Idd7c6a625f168717b083d5f13e291ce916571933
2017-01-11 11:13:26 -08:00
Tamas Berghammer
0c0c8f7825 Update package names to work with the proto3 compiler
Bug: b/28974522
Change-Id: I5f3adf4946ee4ba1e09e4f40afe83c151405972a
(cherry picked from commit 55f36459c8)
2017-01-11 11:27:38 +00:00
Lorenzo Colitti
8989d2edca Merge "Remove requestRouteToHost and {start,stop}UsingNetworkFeature." 2017-01-11 03:52:21 +00:00
Hugo Benichi
15b3116ba3 DO NOT MERGE Captive portals: login activity probes like NetworkMonitor am: 22569ca49a -s ours am: b18218fb06 -s ours am: 57c7fc11bd
am: d3a305abc6  -s ours

Change-Id: Icf2ff95f201523d52a5089db80bc2bb4f7b28088
2017-01-11 01:51:09 +00:00
Hugo Benichi
bfc2783f9b DO NOT MERGE Captive portal systel log improvements am: fce1a04cc7 -s ours am: 73c57874b9 -s ours am: f258886732
am: 553ad7bcbe  -s ours

Change-Id: Iec0a3049392c38f1cc8ebce0983ea68cfc455cbc
2017-01-11 01:43:18 +00:00
Hugo Benichi
d3a305abc6 DO NOT MERGE Captive portals: login activity probes like NetworkMonitor am: 22569ca49a -s ours am: b18218fb06 -s ours
am: 57c7fc11bd

Change-Id: I6f4c7a0c15373e56fc178f287f6a0eb54d0d4018
2017-01-11 01:42:01 +00:00
Hugo Benichi
a80c373a71 DO NOT MERGE Fix flaky IpPrefixTest. am: 79a968d619 -s ours am: 01eeebdf88 -s ours am: 5c3b167517
am: 61dce05929  -s ours

Change-Id: Ide65a8c7cad788c760c599f2569bc40922c26d60
2017-01-11 01:42:01 +00:00
Hugo Benichi
553ad7bcbe DO NOT MERGE Captive portal systel log improvements am: fce1a04cc7 -s ours am: 73c57874b9 -s ours
am: f258886732

Change-Id: Ie831b10e45cee740f519896312ede84ebb69e6f2
2017-01-11 01:32:49 +00:00
Hugo Benichi
61dce05929 DO NOT MERGE Fix flaky IpPrefixTest. am: 79a968d619 -s ours am: 01eeebdf88 -s ours
am: 5c3b167517

Change-Id: Ieeeb425675715dc9910c4901f9c1bce7dbd168ad
2017-01-11 01:31:54 +00:00
Hugo Benichi
57c7fc11bd DO NOT MERGE Captive portals: login activity probes like NetworkMonitor am: 22569ca49a -s ours
am: b18218fb06  -s ours

Change-Id: Icf09b29bfe619ee56d4e9ae0d640ed00fbb4ef31
2017-01-11 01:27:40 +00:00
Hugo Benichi
f258886732 DO NOT MERGE Captive portal systel log improvements am: fce1a04cc7 -s ours
am: 73c57874b9  -s ours

Change-Id: If06761b413cda9d3f79aa79e8ae60cf0ce306946
2017-01-11 01:23:51 +00:00
Hugo Benichi
5c3b167517 DO NOT MERGE Fix flaky IpPrefixTest. am: 79a968d619 -s ours
am: 01eeebdf88  -s ours

Change-Id: Ic492f64b8fc44dc9a8ca1abd539fe757c703acac
2017-01-11 01:22:35 +00:00
Hugo Benichi
b18218fb06 DO NOT MERGE Captive portals: login activity probes like NetworkMonitor
am: 22569ca49a  -s ours

Change-Id: I12ea7b87369c3228bb1fcc914cfdb316a3b501ce
2017-01-11 01:18:00 +00:00
Hugo Benichi
73c57874b9 DO NOT MERGE Captive portal systel log improvements
am: fce1a04cc7  -s ours

Change-Id: Ibce1d4e604e5fd8c67c012cd7f264e4585117b24
2017-01-11 01:14:04 +00:00
Hugo Benichi
01eeebdf88 DO NOT MERGE Fix flaky IpPrefixTest.
am: 79a968d619  -s ours

Change-Id: I929a0ef7a6a044d2263a04867c2701653c3634de
2017-01-11 01:12:54 +00:00
Lorenzo Colitti
443b6c4049 Temporarily restore the net.dnsX system properties.
This will limit app breakage in dogfood. The plan is to remove
these obsolete system properties again in O developer preview
builds so that application developers can move away from them.

Test: marlin boots and net.dnsX exists and is updated correctly

Bug: 33308258
Bug: 33807046
Bug: 34028616
Bug: 34115651
Change-Id: Iaf2fa213c314b7ba251c065b304e7e9869bafe9f
2017-01-06 03:09:18 +00:00
Lorenzo Colitti
84d7f0786a Remove requestRouteToHost and {start,stop}UsingNetworkFeature.
These APIs have been deprecated since L, and since M have thrown
IllegalArgumentException for apps targeting M or newer.

Test: API check passes.
Bug: 33607472
Change-Id: Ie582cac3872be21c51e1e37d16d7cfac496ed3e4
2017-01-05 17:39:21 +09:00
Hugo Benichi
22569ca49a DO NOT MERGE Captive portals: login activity probes like NetworkMonitor
This patch changes CaptivePortalLoginActivity captive portal test to be
consistent with NetworkMonitor by:
 - using Network.java to open the http connection.
 - adding a UserAgent property to the request header.

Test: manually tested.
Bug: 32369183

(cherry picked from commit 454e066e27)

Change-Id: I559eb0497475daad758ba3b3395225dcd0a27a57
2017-01-05 12:12:50 +09:00
Hugo Benichi
fce1a04cc7 DO NOT MERGE 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

(cherry picked from commit 2a3998dd05)

Change-Id: I1eaab5ea702063dde3e23324d3a1b3dc172c5ac5
2017-01-05 12:09:35 +09:00
Hugo Benichi
79a968d619 DO NOT MERGE Fix flaky IpPrefixTest.
Test: IpPrefixTest passes
Bug: 32561414

(cherry picked from commit f5ec69155d)

Change-Id: I42928da87f7f336900b3a95ebbf28563864da8d4
2017-01-05 12:07:38 +09:00
Hugo Benichi
bfcdbc7c4d NetworkNotificationManager: remove spammy log am: 02e5966fac
am: 29a41b05d1

Change-Id: I2b9b1b52e11ddf784244eedf1311f3b015841215
2016-12-22 03:07:19 +00:00
Hugo Benichi
29a41b05d1 NetworkNotificationManager: remove spammy log
am: 02e5966fac

Change-Id: I01785760854cd040c0d09f76e3832bbb7986dc4e
2016-12-22 03:02:39 +00:00
Hugo Benichi
02e5966fac NetworkNotificationManager: remove spammy log
Test: build, flashed, booted phone.
Bug: 32198726
Change-Id: I3ac2f07c756f48653195f6198aaee4d8b3939fb5
2016-12-22 09:51:01 +09:00