Commit graph android_packages_modules_Co.../services/core/java
Message SHA1
Move notification code out of ConnectivityService. am: 7d31cc0021 am: 622b5fbbf5
am: 28707247f4

Change-Id: I6e3290891f322c1caca3ff70a3aa39dd140d6256

Lorenzo Colitti   authored and   android-build-merger   commited 2016-08-23 17:20:59 +00:00
2caa412d20
Move notification code out of ConnectivityService.
Bug: 31025214
Change-Id: I4190be6b57f92298b79bea8868f1876ecbfd2d75

Lorenzo Colitti   commited 2016-08-23 15:31:59 +09:00
7d31cc0021
IpConnectivityMetrics: no metrics upload in tests am: 638621a1f9
am: ae048d8363

Change-Id: I4171f72e27f39f2c10e4607b84934676337c1b4e

Hugo Benichi   authored and   android-build-merger   commited 2016-07-29 09:34:35 +00:00
89218fdd83
IpConnectivityMetrics: no metrics upload in tests
Similarly to ApfTest, this patch changes ConnectivityServiceTest to use
a mock object instead of IpConnectivityLog so that running
ConnectivityServiceTest does not generate android.net.metrics events.

Bug: 30450301
Change-Id: Ibc0479f381f26e60baefbae15407c62aecbf6666

Hugo Benichi   commited 2016-07-29 16:58:35 +09:00
638621a1f9
resolve merge conflicts of c489935 to nyc-mr1-dev-plus-aosp
Change-Id: Ib1c01241fece36f660d27f3450ba8059b3b2809f

Hugo Benichi   commited 2016-07-26 13:08:14 +09:00
8850477c85
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

Hugo Benichi   commited 2016-07-25 10:24:42 +09:00
c4899354b0
Merge \"Add an isListen method to NetworkRequests.\" into nyc-mr1-dev
am: b5239329b1

Change-Id: Ib712c3c7b44d3a623d5f5facf0c7f6844c3ebb82

Lorenzo Colitti   authored and   android-build-merger   commited 2016-07-18 15:08:54 +00:00
56b3b700f2
Add an isListen method to NetworkRequests.
This allows simplification of the ConnectivityService code.

Bug: 23113288
Change-Id: I124544b99c5a920124e9a3d31cda8c6d2abc21fd

Lorenzo Colitti   commited 2016-07-18 18:42:26 +09:00
6737b64741
ConnectivityService dump: add apps blocked logs
am: 7b3bf37ac3

Change-Id: I50c87dc35ef219844a5337768ec2526aeff4f1ca

Hugo Benichi   authored and   android-build-merger   commited 2016-07-12 04:39:05 +00:00
6fef6d72f2
ConnectivityService dump: add apps blocked logs
This patch adds NetworkInfo BLOCKED/UNBLOCKED status of apps to
ConnectivityService's dump logs.

The BLOCKED or UNBLOCKED status of an app is logged with the app uid
when the app calls getActiveNetworkInfo().

Examples:
mNetworkInfoBlockingLogs (most recent first):
  07-11 11:04:43.139 - BLOCKED 10060
  07-11 11:04:39.056 - UNBLOCKED 10061
  07-11 11:04:38.851 - BLOCKED 10061

Bug: 29981766
Change-Id: I6e2fde446702b92b0964ed894409b5d733d8f8a7

Hugo Benichi   commited 2016-07-12 11:39:48 +09:00
7b3bf37ac3
Support requesting async LinkProperties/NetworkCapabilities updates
am: aec3f5ef5b

Change-Id: Icc048323debbbe641941c5c0d993f4c9782c5d3e

Erik Kline   authored and   android-build-merger   commited 2016-07-11 11:01:42 +00:00
95d433f07a
Support requesting async LinkProperties/NetworkCapabilities updates
Bug: 9580643
Change-Id: I1d7ba7645c20d7d53f6eef777dfce43727940f13

Erik Kline   commited 2016-07-11 19:17:41 +09:00
aec3f5ef5b
Merge \"Rewrite lingering.\" into nyc-mr1-dev
am: 49b4492b33

Change-Id: I62d69f20101318b42d4d333b104dcf4f64dc1725

Lorenzo Colitti   authored and   android-build-merger   commited 2016-07-07 11:01:19 +00:00
d1cf630685
Merge \"Prepare to delete useless loop in handleReleaseNetworkRequest.\" into nyc-mr1-dev
am: 540ee120e5

Change-Id: I8cd95575e7758ee94417ec15e407f396434f4c04

Lorenzo Colitti   authored and   android-build-merger   commited 2016-07-07 07:40:46 +00:00
bebd1cf7fe
Rewrite lingering.
The two major changes here are:

- Move lingering out of NetworkMonitor. The fact that lingering
  is currently its own state in NetworkMonitor complicates the
  logic there: while a network is lingering it cannot be in any
  other state, we have to take care not to leave LingeringState
  for the wrong reason, etc.
- Instead of keeping a single per-network boolean to indicate
  whether a network is lingered or not, keep a linger timer for
  every request. This allows us to fix various corner-case bugs
  in lingering.

The changes in behaviour compared to the current code can be seen
in the unit test changes. Specifically:

1. Bug fix: when a network is lingered, and a request is added
   and removed to it, the existing code tears the network down
   immediately. The new code just sends another CALLBACK_LOSING
   and resumes lingering with the original timeout.
2. Bug fix: if cell is unvalidated and wifi comes up and
   validates before cell does (as might happen on boot), the
   existing code immediately tears down cell. The new code
   lingers cell, which is correct because unvalidated cell was
   the default network, so an app might have been using it.
3. Correctness improvement: always send CALLBACK_AVAILABLE for
   the new network before sending CALLBACK_LOSING. This was not
   really an issue in practice, because the usual flow is:
    - Network A is the default.
    - Network B connects, CALLBACK_AVAILABLE.
    - Network B validates, CALLBACK_LOSING.

Bug: 23113288
Change-Id: I2f1e779ff6eb869e62921a95aa9d356f380cf30a

Lorenzo Colitti   commited 2016-07-07 16:18:57 +09:00
70c70fa7e2
Prepare to delete useless loop in handleReleaseNetworkRequest.
As explained in the TODO, the loop serves no purpose since only
one network can be satisfying a given request at a time.

Instead of looping, look up the nai in the mNetworkForRequestId
array that exists for this purpose.

Keep the loop around with an Slog.wtf statement on it so we can
see if we ever hit it, and add a TODO to delete it if we don't.

Bug: 23113288
Change-Id: I173de4bd45c5a4169b7a062a981f2ecccaa44143

Lorenzo Colitti   commited 2016-07-07 14:50:12 +09:00
daeb6109e1
Merge \"Unbreak unregisterNetworkCallback.\" into nyc-mr1-dev
am: 04401f0e0f

Change-Id: I35ee16554e17c503b1f5628629c2c0a48d85d399

Lorenzo Colitti   authored and   android-build-merger   commited 2016-07-05 02:19:18 +00:00
3e1d024327
Merge "Unbreak unregisterNetworkCallback." into nyc-mr1-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2016-07-05 02:07:06 +00:00
04401f0e0f
Unbreak unregisterNetworkCallback.
http://ag/1194313 broke unregisterNetworkCallback because the
system does not parcel the type of the request back to the app.
So when the app calls unregisterNetworkCallback, the
NetworkRequest that's passed in does not have a type and thus
doesn't match the request in mNetworkRequests.

Fix this by parceling over the type as well.

This was not caught by the unit test because the unit test all
runs in the same process with no parceling.

Bug: 23113288
Change-Id: I58b2ed651b9bf5cbdcca5b25c3ca24db53cffdf1

Lorenzo Colitti   commited 2016-07-05 01:59:49 +09:00
cef9c490ad
Merge \"Annotate public methods in ConnectivityService.\" into nyc-mr1-dev
am: ad7755209c

Change-Id: I065e2ceb351ea8af4310f6ef11f1af232fa2fc79

Lorenzo Colitti   authored and   android-build-merger   commited 2016-07-04 16:21:10 +00:00
aa9dd65e57
Merge "Annotate public methods in ConnectivityService." into nyc-mr1-dev
TreeHugger Robot   authored and   Android (Google) Code Review   commited 2016-07-04 16:07:33 +00:00
ad7755209c
Make registerDefaultNetwork work on metered networks.
am: 34eda2aa6f

Change-Id: I2d5edc273df22e5c787f227820c1ce956adfe42c

Lorenzo Colitti   authored and   android-build-merger   commited 2016-07-04 16:06:51 +00:00
005ce5a697
Make registerDefaultNetwork work on metered networks.
Bug: 29927488
Change-Id: I3b705c2ab0d1493546ffa5185bb5b07d5e25c897

Lorenzo Colitti   commited 2016-07-04 23:18:12 +09:00
34eda2aa6f
Annotate public methods in ConnectivityService.
Ensure every public method is annotated with why it's public.
This can be either an @Override or @VisibleForTesting annotation
or a comment explaining why it's public.

Bug: 29927488
Change-Id: I3582aef7997dc0d723718ca5e3dd115647d22979

Lorenzo Colitti   commited 2016-07-04 12:58:29 +09:00
10e796c35d
Merge changes from topic \'networkrequest_private\' into nyc-mr1-dev
am: 0317e03dc3

Change-Id: Ia063c378bd32fdb056c0ecdc0f721d32e9fa49af

Lorenzo Colitti   authored and   android-build-merger   commited 2016-07-01 15:20:21 +00:00
6c9dbf4d48
Make the NetworkRequest list private to NetworkAgentInfo.
This allows us to keep track of how many live requests a network
is satisfying without having to count them every time.

Bug: 23113288
Change-Id: Ic4756676491e09071dbf80b7c48da3be028d68eb

Lorenzo Colitti   commited 2016-07-01 21:14:26 +09:00
e0d1a03d4e
Move the request type from NetworkRequestInfo to NetworkRequest.
This will allow us to simplify code that deals with
NetworkRequests outside ConnectivityService.

Bug: 23113288
Change-Id: I9b3a859d0c68cad73d7f6baa4b584d13ffd2ae36

Lorenzo Colitti   commited 2016-07-01 20:15:19 +09:00
a4505cafab
Refactor IP connectivity event logging
am: 3bdc8357fe

Change-Id: I8de880edc4a8c7f12527218788cb44f263acb56f

Hugo Benichi   authored and   android-build-merger   commited 2016-06-29 07:18:28 +00:00
2229b20b34
Refactor IP connectivity event logging
This patch removes static methods for logging IP connectivity events
defined in android.net.metrics and replaces them with a single log()
instance method defined on IpConnectivityLog. Event constructors are
now public also. Every classes logging such events now create an
instance of IpConnectivityLog for logging event objects directly
instantiated with new.

Removing static dependencies allow straightforward testing of logging.

This patch also removes the base IpConnectivityEvent class which is not
needed any more.

Bug: 29035129
Change-Id: I3de700f93f46deaa48a759f938f7d00e1d8bff98

Hugo Benichi   commited 2016-06-29 14:28:51 +09:00
3bdc8357fe
Merge \"Fix unsafe concurrent access in LegacyTypeTracker\" into nyc-mr1-dev
am: 90b2c781ff

Change-Id: I6af8e185a165009f2b7b6efef764c883488bd7bf

Hugo Benichi   authored and   android-build-merger   commited 2016-06-27 08:02:44 +00:00
dd0d4300e5
Fix unsafe concurrent access in LegacyTypeTracker
This patch adds synchronization inside LegacyTypeTracker so that
getNetworkForType() can safely run concurrently with remove().

Without synchronization if remove() removes the last network for a
given type while getNetworkForType() runs for the same type, it is
possible that getNetworkForType tries to access the head of an empty
list, resulting in a runtime exception.

This issue was found by zoran.jovanovic@sonymobile.com who proposed a
fix in AOSP (Change-Id: Ia963662edb9d643790e8d9439e4dbdcac4c2187b).

This patch differs from the fix proposed by the bug reporter and tries
instead to do the minimum amount of locking to make getNetworkForType
safe.

Bug: 29030387
Change-Id: I915aac527fc8828b32bf35fee870add2dfb11d8d

Hugo Benichi   commited 2016-06-27 15:04:27 +09:00
9c807fdcd4
resolve merge conflicts of c65d475 to nyc-mr1-dev-plus-aosp
Change-Id: Ic75a6926e4bd2b8199e4feb7af315e84659d03a2

Felipe Leme   commited 2016-06-21 13:41:22 -07:00
632e3ab174
resolve merge conflicts of fa2715e to nyc-mr1-dev
Change-Id: If0a1e7e70aa33e99f05694a37c2a54c567449507

Felipe Leme   commited 2016-06-21 13:12:53 -07:00
7d0177d5d7
Merge \"Ignore system apps on enforceMeteredApnPolicy().\" into nyc-dev
am: fa2715e03b

Change-Id: I98440b2ae3371661ed8b1b2f29b0ba18e1b6e6c3

Felipe Leme   authored and   android-build-merger   commited 2016-06-21 19:59:53 +00:00
c65d475906
Ignore system apps on enforceMeteredApnPolicy().
BUG: 29514913
Fixes: 29448383
Change-Id: I19eb004c937e1c872bbf82caa7a919e43d48a259

Felipe Leme   commited 2016-06-20 17:15:46 -07:00
ff76014fe8
Merge \\"Move \\'is already always-on\\' check into Vpn.java\\" into nyc-dev am: 6a58c98cef
am: b4f3bf969d

Change-Id: I897c48083f8e6786182d023c58f9861996c6d25c

Robin Lee   authored and   android-build-merger   commited 2016-06-16 10:14:06 +00:00
f99a160ca1
Merge \"Move \'is already always-on\' check into Vpn.java\" into nyc-dev
am: 6a58c98cef

Change-Id: I6532f2e654cfd9df8ee6c649344b0b915a8381c1

Robin Lee   authored and   android-build-merger   commited 2016-06-16 10:10:23 +00:00
f062d0b193
Merge \"Move \'is already always-on\' check into Vpn.java\" into nyc-dev
am: 6a58c98cef

Change-Id: Id363cef8369d63ce4739089d94139e34ed25f665

Robin Lee   authored and   android-build-merger   commited 2016-06-16 10:10:23 +00:00
b4f3bf969d
Merge "Move 'is already always-on' check into Vpn.java" into nyc-dev
Robin Lee   authored and   Android (Google) Code Review   commited 2016-06-16 10:06:11 +00:00
6a58c98cef
Move 'is already always-on' check into Vpn.java
It's with the rest of the logic now and allows checking whether the
lockdown state matches, too, which led to a lot of misunderstandings.

Fix: 29199431
Change-Id: I94a2c38c4837f9c33b5b9c2becb52eeb7e2a2534

Robin Lee   commited 2016-06-14 13:24:17 +00:00
a4325d282c
Merge \\"Show sign-in to network notification to all users, not just owner.\\" into nyc-dev am: 634bd0eb4e
am: 6715499061

Change-Id: I82726a61541da890dea12448b2823f3dd7e367d2

Paul Jensen   authored and   android-build-merger   commited 2016-06-14 11:21:12 +00:00
7a68a26148
Merge \"Show sign-in to network notification to all users, not just owner.\" into nyc-dev
am: 634bd0eb4e

Change-Id: Ic8f99cb7c7fa7ed1f40c73342840f82c56f9f90f

Paul Jensen   authored and   android-build-merger   commited 2016-06-14 11:16:15 +00:00
601f877903
Merge \"Show sign-in to network notification to all users, not just owner.\" into nyc-dev
am: 634bd0eb4e

Change-Id: I4522f765c6166bd1c8216088b1605eac4c69d869

Paul Jensen   authored and   android-build-merger   commited 2016-06-14 11:16:12 +00:00
6715499061
Merge "Show sign-in to network notification to all users, not just owner." into nyc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2016-06-14 11:05:32 +00:00
634bd0eb4e
Show sign-in to network notification to all users, not just owner.
All users should be made aware a captive portal is in place and be
given the opportunity to sign into the network.  Without this fix
other users are not notified and given a chance to sign-in.

Change-Id: I1bf823d5f6a36f391dca4be5f6a584e8562a72a7
Fixes: 23079964

Paul Jensen   commited 2016-06-13 09:39:28 -04:00
efffb79661
Merge \\"Package changed/removed listeners for always-on VPN\\" into nyc-dev am: ee5e4cc836
am: 198d78012d

Change-Id: I64ab86a9133d524865bed8c7824634e0539c1212

Robin Lee   authored and   android-build-merger   commited 2016-06-08 10:54:52 +00:00
0e79a48a5f
Merge \"Package changed/removed listeners for always-on VPN\" into nyc-dev
am: ee5e4cc836

Change-Id: Idd2e019feb73bd580aa7d8baba03c27083e26b02

Robin Lee   authored and   android-build-merger   commited 2016-06-08 10:50:43 +00:00
f187518b18
Merge \"Package changed/removed listeners for always-on VPN\" into nyc-dev
am: ee5e4cc836

Change-Id: I8f7054b5a2ac69677a0e124e9a616b3d58b604af

Robin Lee   authored and   android-build-merger   commited 2016-06-08 10:50:42 +00:00
198d78012d
Merge changes Ic98e3bcb,Idb0c55fc,Ia8649061,I5e7e5a87 into nyc-mr1-dev
am: ec79b10313

Change-Id: I2305c4019f56896d741caa509df41416368e5642

Lorenzo Colitti   authored and   android-build-merger   commited 2016-06-08 06:39:18 +00:00
e9aac55615
Merge changes Ic98e3bcb,Idb0c55fc,Ia8649061,I5e7e5a87 into nyc-mr1-dev
* changes:
  Give WakeupMessage the ability to transport an object as well.
  Don't treat the lingerExpired broadcast specially.
  Add a test for mobile data always on.
  Add a FakeSettingsProvider and use it in ConnectivityServiceTest.

TreeHugger Robot   authored and   Android (Google) Code Review   commited 2016-06-08 06:35:32 +00:00
ec79b10313