Commit Graph

279557 Commits

Author SHA1 Message Date
Felipe Leme
6173d88dce DO NOT MERGE: Use @Ignore to explicitly disable a @Test method. am: 2026ca147b -s ours am: b296948b3b -s ours
am: 153604cd9a

Change-Id: Icaa4e18775b6e810738fb9d180ea20f7ce5c4506
2016-12-09 10:27:35 +00:00
Felipe Leme
05b9f210af DO NOT MERGE: Fixed NetworkStatsServiceTest and converted it to JUnit4. am: 77cba4bdf6 -s ours am: 82393f7b98 -s ours
am: 854038fcd8

Change-Id: I4acc3df60493e5ac388772f8c0e22ac92bc3ce4c
2016-12-09 10:26:08 +00:00
Jeremy Joslin
483611214d DO NOT MERGE: VPN network stat accounting changes. am: ffe5a46b3e -s ours am: 12bb3f057b -s ours
am: 4d145b01ee

Change-Id: Ie33371e7e4e47071aa9f74fef93ddf2cff2ec57a
2016-12-09 10:25:17 +00:00
Hugo Benichi
a9bbff0d2b DO NOT MERGE: ConnectivityThread: use lazy holder idiom am: ce765b7a51 -s ours am: f6cb43ae32 -s ours
am: de53b117b5

Change-Id: I121ad24bed0fa12b80110b1058ad4279ec9c0107
2016-12-09 10:24:20 +00:00
Hugo Benichi
274806b011 DO NOT MERGE: ConnectivityManager: use ConnectivityThread looper am: 1853f78d76 -s ours am: 7337239702 -s ours
am: 57b372d6da

Change-Id: If52ab02bd501d4b071f24ddf8abdfe344e7358eb
2016-12-09 10:23:28 +00:00
Hugo Benichi
d51cb6eb83 DO NOT MERGE: ConnectivityManager: a simpler CallbackHandler am: 4983e55853 -s ours am: ef148edaa2 -s ours
am: c869826359

Change-Id: I7c177123057676622e1aa43c68676ee06ed60ee6
2016-12-09 10:22:25 +00:00
Philip P. Moltmann
6c6a790ddc DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service. am: 29154b000f -s ours am: 6e8a33a583 -s ours
am: 6771c6abe1

Change-Id: Id16463e4621b4012cc6c7c2bf5d7b2cc07de1b0d
2016-12-09 10:20:59 +00:00
Jeremy Klein
4d96cee757 DO NOT MERGE: Add a null check for the OnStartTetheringCallback. am: c8e4cc8e99 -s ours am: 3cd1ae2261 -s ours
am: a5373c3eeb

Change-Id: I897f28d2b002e1a2aa6be8ec423a1c9b1d5b761b
2016-12-09 10:20:04 +00:00
Felipe Leme
153604cd9a DO NOT MERGE: Use @Ignore to explicitly disable a @Test method. am: 2026ca147b -s ours
am: b296948b3b  -s ours

Change-Id: I43b77614b0ccdd573cf8b29b08ef518bad617aff
2016-12-09 09:55:47 +00:00
Felipe Leme
854038fcd8 DO NOT MERGE: Fixed NetworkStatsServiceTest and converted it to JUnit4. am: 77cba4bdf6 -s ours
am: 82393f7b98  -s ours

Change-Id: I175601094ae486700c8a6886470abb3147b6ef4e
2016-12-09 09:54:55 +00:00
Jeremy Joslin
4d145b01ee DO NOT MERGE: VPN network stat accounting changes. am: ffe5a46b3e -s ours
am: 12bb3f057b  -s ours

Change-Id: Id9d26bf1b9512a85cd9b6a3253b86b77a6f62e77
2016-12-09 09:54:07 +00:00
Hugo Benichi
de53b117b5 DO NOT MERGE: ConnectivityThread: use lazy holder idiom am: ce765b7a51 -s ours
am: f6cb43ae32  -s ours

Change-Id: I08a03dd249d30bc474a5d16472883737d12fec37
2016-12-09 09:53:16 +00:00
Hugo Benichi
57b372d6da DO NOT MERGE: ConnectivityManager: use ConnectivityThread looper am: 1853f78d76 -s ours
am: 7337239702  -s ours

Change-Id: Ida0d76b540e800db215569717a1c5d26e0f583b0
2016-12-09 09:52:26 +00:00
Hugo Benichi
c869826359 DO NOT MERGE: ConnectivityManager: a simpler CallbackHandler am: 4983e55853 -s ours
am: ef148edaa2  -s ours

Change-Id: Ie8ebf41835e62b64ceb22e552208c77482d96c73
2016-12-09 09:50:57 +00:00
Philip P. Moltmann
6771c6abe1 DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service. am: 29154b000f -s ours
am: 6e8a33a583  -s ours

Change-Id: I95d1b3e8b676572dd3fb78aa750731e4c4c6a31f
2016-12-09 09:50:04 +00:00
Jeremy Klein
a5373c3eeb DO NOT MERGE: Add a null check for the OnStartTetheringCallback. am: c8e4cc8e99 -s ours
am: 3cd1ae2261  -s ours

Change-Id: I3c471a8971c21cdbf1ebf7e1302524b038b20375
2016-12-09 09:48:50 +00:00
Felipe Leme
b296948b3b DO NOT MERGE: Use @Ignore to explicitly disable a @Test method.
am: 2026ca147b  -s ours

Change-Id: I17818101fa8f47d285cf772a0f67373c1dda5e30
2016-12-09 09:25:12 +00:00
Felipe Leme
82393f7b98 DO NOT MERGE: Fixed NetworkStatsServiceTest and converted it to JUnit4.
am: 77cba4bdf6  -s ours

Change-Id: I907010456f9bb9674748222fd5e82b8b64dce46f
2016-12-09 09:24:24 +00:00
Jeremy Joslin
12bb3f057b DO NOT MERGE: VPN network stat accounting changes.
am: ffe5a46b3e  -s ours

Change-Id: Ic42723be04158feafd268b3859f0e938d3e36d01
2016-12-09 09:23:37 +00:00
Hugo Benichi
f6cb43ae32 DO NOT MERGE: ConnectivityThread: use lazy holder idiom
am: ce765b7a51  -s ours

Change-Id: I0625013f14e4a2c24a238677a3de50961d114619
2016-12-09 09:22:57 +00:00
Hugo Benichi
7337239702 DO NOT MERGE: ConnectivityManager: use ConnectivityThread looper
am: 1853f78d76  -s ours

Change-Id: Ia41bae1435c94e042358e8b88b42f83cd5359a6e
2016-12-09 09:22:16 +00:00
Hugo Benichi
ef148edaa2 DO NOT MERGE: ConnectivityManager: a simpler CallbackHandler
am: 4983e55853  -s ours

Change-Id: I806d5d79994785357390707d77760af3af725477
2016-12-09 09:21:22 +00:00
Philip P. Moltmann
6e8a33a583 DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service.
am: 29154b000f  -s ours

Change-Id: I5c7c11dc4f8112f0ca89b482c2ba10a6a94abfba
2016-12-09 09:20:02 +00:00
Jeremy Klein
3cd1ae2261 DO NOT MERGE: Add a null check for the OnStartTetheringCallback.
am: c8e4cc8e99  -s ours

Change-Id: I3290e0f17c8d29f7e7216687f85b7487a3b85ac5
2016-12-09 09:19:21 +00:00
Felipe Leme
2026ca147b DO NOT MERGE: Use @Ignore to explicitly disable a @Test method.
BUG: 30839080
BUG: 31007021

(cherry picked from commit fc7d7a359f)

Change-Id: I35942e60493adebb22871541a34240368c691ee7
2016-12-09 13:59:10 +09:00
Felipe Leme
77cba4bdf6 DO NOT MERGE: Fixed NetworkStatsServiceTest and converted it to JUnit4.
Most tests were failing because due to a null NetworkCapabilities.
Example:

1) testNetworkStatsWifi(com.android.server.net.NetworkStatsServiceTest)
java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.net.NetworkCapabilities.hasCapability(int)' on a null object reference
	at
	com.android.server.net.NetworkStatsService.updateIfacesLocked(NetworkStatsService.java:983)

BUG: 30839080

(cherry picked from commit 574f370c6d)

Change-Id: Ie09b2f43cf6ec745e404d5ec98bd0b072d211ea3
2016-12-09 13:59:04 +09:00
Jeremy Joslin
ffe5a46b3e DO NOT MERGE: 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

(cherry picked from commit 8b436d865c)

Change-Id: I06f01aa8fe5fdc06b2d36cfb9c68feb244c2e5de
2016-12-09 13:42:29 +09:00
Hugo Benichi
ce765b7a51 DO NOT MERGE: 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

(cherry picked from commit c4fe5d373c)

Change-Id: If13b363889a8e9396273a90c3d9f9421a48aecbc
2016-12-09 13:42:26 +09:00
Hugo Benichi
1853f78d76 DO NOT MERGE: 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

(cherry picked from commit 7724cdd8b9)

Change-Id: If956addbf8e7b11b36a4b966de7fca00e8f362c1
2016-12-09 13:42:24 +09:00
Hugo Benichi
4983e55853 DO NOT MERGE: 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

(cherry picked from commit d42650faaa)

Change-Id: I1b5fe2a361b5f623a8310ae698497c83d72f3034
2016-12-09 13:42:20 +09:00
Philip P. Moltmann
29154b000f DO NOT MERGE: Indicate the NsdServiceInfo attributes are only filled in for a resolved service.
Fixes: 28530428

(cherry picked from commit 7d5da4b044)

Change-Id: If2bfc06589adb361f11b89cd5923cb5c255cb680
2016-12-09 13:42:09 +09:00
Jeremy Klein
c8e4cc8e99 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 5f277e1667)

Change-Id: Ia419ff68ef10f308f9e44be47420e27099ee6070
2016-12-09 13:42:02 +09:00
Hugo Benichi
28adf7f32d Merge changes from topic 'framework-net-aosp' am: 25afce88a6 am: 5910f412bd
am: 933fb9f3b3

Change-Id: I8cd4afc5e1381f5b69e4b6dd598c9fee76dc785e
2016-12-09 04:02:17 +00:00
Hugo Benichi
0b84a7310f DO NOT MERGE: IpConnectivityMetrics: rate limit ApfProgramEvents am: f99a33a1b4 -s ours am: 6765bc08d0 -s ours
am: 44675b01b1

Change-Id: Ia32470ecf8c0dd918994f9d0bccb20248c3b02d1
2016-12-09 04:01:20 +00:00
Hugo Benichi
9bb4dad35c DO NOT MERGE: TokenBucket for rate-limiting and throttling am: 05ad47add8 -s ours am: c50e9972dd -s ours
am: e3876f699c

Change-Id: I439c24b223ce0664a15c9615e08a9e8900e5a3ac
2016-12-09 04:00:29 +00:00
Hugo Benichi
dcede2d2d6 DO NOT MERGE: IpConnectivityMetrics reads buffer size in settings am: 8c9e4b68f0 -s ours am: f3b4c26453 -s ours
am: 5b4a49ea37

Change-Id: Ib8045e9d97c0928baa0c0a4a752f544aaa1fe790
2016-12-09 03:59:36 +00:00
Lorenzo Colitti
a5c3078e10 DO NOT MERGE: CaptivePortalLogin: set mixed content policy to compatibility. am: b55bf38351 -s ours am: d1c92f25b3 -s ours
am: f32347ef25

Change-Id: I6bd4db2039a0f0e9467f757118278bc990596803
2016-12-09 03:58:17 +00:00
Hugo Benichi
97534738e6 DO NOT MERGE: Add IP conn metrics to dumpsys and bug reports am: 5635c270a1 -s ours am: a67ede1e15 -s ours
am: af7c2d6c96

Change-Id: I9ff57e92e269ad0d6c7b820c06c83a8e3b5491bf
2016-12-09 03:57:25 +00:00
Hugo Benichi
cf065d81a8 DO NOT MERGE: IpConnectivity metrics: add version number am: 9df2ae138b -s ours am: 0e67ef7d3f -s ours
am: f567aa22ff

Change-Id: I5b970302c258569638890a49b3455e43614ec63a
2016-12-09 03:56:29 +00:00
Hugo Benichi
933fb9f3b3 Merge changes from topic 'framework-net-aosp' am: 25afce88a6
am: 5910f412bd

Change-Id: I919fd8d8075c89aa9eb42b505017c075f61824ff
2016-12-09 03:47:48 +00:00
Hugo Benichi
44675b01b1 DO NOT MERGE: IpConnectivityMetrics: rate limit ApfProgramEvents am: f99a33a1b4 -s ours
am: 6765bc08d0  -s ours

Change-Id: I9e3ca112a654018d9d0b72ba1b0963e7fb678cf0
2016-12-09 03:46:50 +00:00
Hugo Benichi
e3876f699c DO NOT MERGE: TokenBucket for rate-limiting and throttling am: 05ad47add8 -s ours
am: c50e9972dd  -s ours

Change-Id: Iaaf4c3b0b335bf741452eb5bcd05c03f45d419fc
2016-12-09 03:45:57 +00:00
Hugo Benichi
5b4a49ea37 DO NOT MERGE: IpConnectivityMetrics reads buffer size in settings am: 8c9e4b68f0 -s ours
am: f3b4c26453  -s ours

Change-Id: I7f2eee043702be1a8878851793b9b17bdb89766b
2016-12-09 03:45:08 +00:00
Lorenzo Colitti
f32347ef25 DO NOT MERGE: CaptivePortalLogin: set mixed content policy to compatibility. am: b55bf38351 -s ours
am: d1c92f25b3  -s ours

Change-Id: I441369366958f6bc55776a4f449715103ed61cc0
2016-12-09 03:43:42 +00:00
Hugo Benichi
af7c2d6c96 DO NOT MERGE: Add IP conn metrics to dumpsys and bug reports am: 5635c270a1 -s ours
am: a67ede1e15  -s ours

Change-Id: I5b363f1f5a3b4dae5de156ea9014d9d259219bcd
2016-12-09 03:42:53 +00:00
Hugo Benichi
f567aa22ff DO NOT MERGE: IpConnectivity metrics: add version number am: 9df2ae138b -s ours
am: 0e67ef7d3f  -s ours

Change-Id: I05ffe76ca4f266bd341fc298cbc03da62991e4bb
2016-12-09 03:41:57 +00:00
Hugo Benichi
5910f412bd Merge changes from topic 'framework-net-aosp'
am: 25afce88a6

Change-Id: I04262e6b654c8ce0fd44139d5568783d75ccbe7b
2016-12-09 03:31:44 +00:00
Hugo Benichi
6765bc08d0 DO NOT MERGE: IpConnectivityMetrics: rate limit ApfProgramEvents
am: f99a33a1b4  -s ours

Change-Id: Iedfe60899226b6007963b0852f87ecebb5bc987e
2016-12-09 03:31:37 +00:00
Hugo Benichi
c50e9972dd DO NOT MERGE: TokenBucket for rate-limiting and throttling
am: 05ad47add8  -s ours

Change-Id: I7f5a7a47d7e430fc503612bfd0a844b5ffe1bde9
2016-12-09 03:30:56 +00:00
Hugo Benichi
f3b4c26453 DO NOT MERGE: IpConnectivityMetrics reads buffer size in settings
am: 8c9e4b68f0  -s ours

Change-Id: Ie3265557cacf2014ace63fcd73f1334330558631
2016-12-09 03:29:58 +00:00