History log of /frameworks/base/core/java/android/net/NetworkCapabilities.java
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
f0e9a33435c02001836a359a37aae56a7eeee2ad 18-Jul-2016 Lorenzo Colitti <lorenzo@google.com> Add a NET_CAPABILITY_FOREGROUND capability.

Bug: 23113288
Change-Id: I90cb9ffb5751f0d9ec822933f37680c401e49966
/frameworks/base/core/java/android/net/NetworkCapabilities.java
5df9d729f6c78215f287701d7e136dfc922e2bd3 25-Apr-2016 Hugo Benichi <hugobenichi@google.com> Better ConnectivityMetricsEvent printing

This patch adds more information printing for IpConnectivity event
classes in android.net.metrics.

example:

ConnectivityMetricsEvent(14:36:35.799, 0, 1026): DhcpClientEvent(wlan0, DhcpRequestingState)
ConnectivityMetricsEvent(14:36:35.805, 0, 1026): DhcpClientEvent(wlan0, DhcpHaveAddressState)
ConnectivityMetricsEvent(14:36:35.809, 0, 4096): IpManagerEvent(wlan0, PROVISIONING_OK, 155ms)
ConnectivityMetricsEvent(14:36:35.810, 0, 1026): DhcpClientEvent(wlan0, DhcpBoundState)
ConnectivityMetricsEvent(14:36:35.871, 0, 2048): NetworkEvent(101, NETWORK_CONNECTED, 0ms)
ConnectivityMetricsEvent(14:36:35.874, 0, 2051): ValidationProbeEvent(101, PROBE_HTTP:599, 3ms)
ConnectivityMetricsEvent(14:36:35.874, 0, 2048): NetworkEvent(101, NETWORK_VALIDATION_FAILED, 0ms)
ConnectivityMetricsEvent(14:36:35.928, 0, 3072): DefaultNetworkEvent(0 -> 101, [WIFI], IPv4: false, IPv6: false)
ConnectivityMetricsEvent(14:36:37.008, 0, 2051): ValidationProbeEvent(101, PROBE_HTTP:204, 134ms)
ConnectivityMetricsEvent(14:36:37.008, 0, 2050): NetworkEvent(101, NETWORK_VALIDATED, 1137ms)

Also fixes a couple of event logging issues:
- do no record spurious receive DhcpErrorEvent when a network goes down.
- add an eventType field to IpManagerEvent instead of using the
loggger component tag.

Bug: 28204408
Change-Id: Ia6f4ccfd7a0c63a5ccec18825f226c0b5781217b
/frameworks/base/core/java/android/net/NetworkCapabilities.java
c8419a87174e8b7b1e8253e58d05702dbba2425f 22-Mar-2016 Pierre Imai <imaipi@google.com> Improve NetworkCapabilities command chaining.

setNetworkSpecifier() now returns this.
BUG: 26797290

Change-Id: Ia8bd0836d9ac715408eca102bf4a2d23f044fa72
/frameworks/base/core/java/android/net/NetworkCapabilities.java
ddb9ef0357e3ee609e188fb9e1e461f95aa601fa 18-Nov-2015 Etan Cohen <etancohen@google.com> Allow NetworkFactories to match any network specifier on a request

Current usage of NetworkSpecifier: network factory will match a request
if the request has either a (1) empty network specifier, or (2) a
network specifier which is identical to that of the network factory.
Note: 'matching' w.r.t. network specifier - all other matching rules
are still in effect.

Change: add rule (3) or the network specifier of the network factory
is the special string (which is defined as "*" and which user-facing
network requests aren't allowed to use).

Rationale: allows on-demand network creation.

Example:
- Can specify a Wi-Fi NetworkRequest with NetworkSpecifier="ssid"
- It will match a Wi-Fi network factory specifying NetworkSpecifier="*"
- That network factory will bring up a Wi-Fi network, connecting to the
specified SSID.
- Once the network is created it will create a NetworkAgent which will
now have a NetworkSpecifier matching that of the request (not the
match-all special string!)

That final step of making sure that the NetworkAgent matches the request
and not the match-all is critical to delivering any subsequent callbacks
correctly. I.e. your network will only get callbacks which match it.

Bug: 26192833
Change-Id: I49e3b492e0bb48a3f6e9a34e3f94f0e1cf89741f
/frameworks/base/core/java/android/net/NetworkCapabilities.java
0257c82fa122243e97e4a1f4ef4bc4b8c21bd692 19-Aug-2015 Lorenzo Colitti <lorenzo@google.com> am 11e84bde: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into mnc-dev

* commit '11e84bde9e98cb4b777a67208989d259883e9375':
Don't mark NetworkRequests restricted when they don't have restricted caps
aae613d96134245af7c55976731a49fa59e77470 19-Aug-2015 Paul Jensen <pauljensen@google.com> Don't mark NetworkRequests restricted when they don't have restricted caps

Requests without NET_CAPABILITIES_INTERNET and just the default network
capabilities should not be marked restricted. Without this fix apps
can hit permissions exceptions if they inadvertently make requests
without NET_CAPABILITIES_INTERNET.

Bug:23164917
Change-Id: I4c7136821315bcb05dfc42ffbc505a5d4f6109e6
/frameworks/base/core/java/android/net/NetworkCapabilities.java
86e7d135acbdb0055de6a687817d44ac60603c9f 05-Aug-2015 Paul Jensen <pauljensen@google.com> resolved conflicts for merge of dbc4edcc to mnc-dr-dev

Change-Id: I3a8624b2b375e0d174983d7690082e0e6932c4de
dbc4edccfced5cb739bae75e8cd15cecc39cf16e 05-Aug-2015 Paul Jensen <pauljensen@google.com> Merge "Fix NOT_RESTRICTED network capability and enforce it." into mnc-dev
487ffe7d3d84bf65212158f7098e8a84b5b55e09 24-Jul-2015 Paul Jensen <pauljensen@google.com> Fix NOT_RESTRICTED network capability and enforce it.

With this change:
1. NOT_RESTRICTED should be removed from NetworkRequests that bring up
special restricted carrier networks (e.g. IMS, FOTA).
2. NetworkRequests without NOT_RESTRICTED require CONNECTIVITY_INTERNAL
permission to register
3. Binding sockets to networks without NOT_RESTRICTED requires
CONNECTIVITY_INTERNAL permission

Bug:21637535
Change-Id: I5991d39facaa6b690e969fe15dcbeec52e918321
/frameworks/base/core/java/android/net/NetworkCapabilities.java
682fd6aedea87e345f033b489ef9f6008bd19c30 30-Jul-2015 Paul Jensen <pauljensen@google.com> am a991c66c: Merge "Fix missing onLost NetworkCallbacks when network loses capability" into mnc-dev

* commit 'a991c66c12da30d0240ac6c98736edee93d95977':
Fix missing onLost NetworkCallbacks when network loses capability
cf4c2c637268b1a2979e20a8b5644916777a02a4 01-Jul-2015 Paul Jensen <pauljensen@google.com> Fix missing onLost NetworkCallbacks when network loses capability

If a network no longer satisfies a NetworkRequest, send the onLost
NetworkCallback. If it was a real request (not listen) then update
the NetworkFactories.

To test this change I created a little infrastructure to fake
different Internet connectivity probe results during tests. This
allowed me to rewrite some of ConnectivityServiceTest's logic for
validating networks. This brought to light a couple issues that
I had to address to keep tests passing:
1. testUnlingeringDoesNotValidate was relying on a bad side-effect
of my old method of ConnectivityServiceTest's logic for
validating networks, so I rewrote the test.
2. ConnectivityService was not sending out NetworkCallbacks for
WiFi when Cellular was validated. I'm including a fix for this
in this CL also.

Bug:22220234
Change-Id: I29314f38189817f8b2561a213c4f9e8522696663
/frameworks/base/core/java/android/net/NetworkCapabilities.java
c3f21f3b8b01508f5dc01b2e5fa4c3d652bb67bb 06-Jul-2015 Lorenzo Colitti <lorenzo@google.com> Support NetworkCallbacks based on signal strength.

Bug: 21405941
Change-Id: I2ed8a5aeb8dac464a4305671ed22abcacb485bc9
/frameworks/base/core/java/android/net/NetworkCapabilities.java
260a36d1b20469d39490b61fca610271bfa53df2 07-Jul-2015 Lorenzo Colitti <lorenzo@google.com> Make immutable NetworkCapabilities more explicit.

Bug: 21405941
Change-Id: Iafd738c31747b0f5f9356bed1c97f5f282830af1
/frameworks/base/core/java/android/net/NetworkCapabilities.java
4bd4389616fae01439a44920286a70806526d8c0 09-Jul-2015 Robert Greenwalt <rgreenwalt@google.com> Enable EMERGENCY mobile connections.

Hooks the ConnectivityManager.TYPE_MOBILE_EMERGENCY,
PhoneConstants.APN_TYPE_EMERGENCY, and NetworkCapabilities.NET_CAPABILITY_EIMS
together so carrier apps can request connections to this APN.

bug:21785357
Change-Id: Id92a5e28d19407cc7a8f8b5478b23457f2f7f89d
/frameworks/base/core/java/android/net/NetworkCapabilities.java
3d194eae6f658ed865b2d3b748f8b83834c877ab 16-Jun-2015 Paul Jensen <pauljensen@google.com> Add NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL

Bug: 21343774
Bug: 20898908
Change-Id: I23069a6cba346999d1b2eeaa445023bd6bf4ef94
/frameworks/base/core/java/android/net/NetworkCapabilities.java
662761224c93cf060a356284101354031cb80dc2 11-Jun-2015 Lorenzo Colitti <lorenzo@google.com> Re-hide onPreCheck and unhide NET_CAPABILITY_VALIDATED.

The API review comments in http://b/21343774 point out that the
suggested use case for onPreCheck (captive portal login apps) is
not a good use case as it requires that the app always be
running.

Also, unhide NET_CAPABILITY_VALIDATED, which is useful to apps
that want to detect captive portals and network connectivity
failures.

Bug: 21343774
Change-Id: Iad7c839bcc136b0fa9581dccc5fd97a28efed4ab
/frameworks/base/core/java/android/net/NetworkCapabilities.java
76f67797032981ccb63e12e808ebc8bda636a740 14-May-2015 Lorenzo Colitti <lorenzo@google.com> Make NET_CAPABILITY_VALIDATED (almost) a first-class citizen.

1. Always keep ConnectivityService's validated bits current:
- Apply the validated bit whenever a NetworkAgent updates its
NetworkCapabilities.
- Set or clear the validated bit whenever lastValidated changes.
2. Send callbacks when the validation state of a network changes.
3. Delete getNetworkCapabilitiesAndValidation, removing code
duplication with getNetworkCapabilities.
4. Add the validated bit to NetworkCapabilities#toString.

Bug: 18591282
Bug: 20081183
Change-Id: I6aa53b61c15cc137f203f9fc6bbd4c16894be750
/frameworks/base/core/java/android/net/NetworkCapabilities.java
f7058f5d1d9df1c5c49b06d8693a49e36ce358ca 27-Apr-2015 Lorenzo Colitti <lorenzo@google.com> Add a hidden method to clear NetworkCapabilities.

Change-Id: Icf7d67e24a09113340e9bff2c72526760914ef48
/frameworks/base/core/java/android/net/NetworkCapabilities.java
76b610a9a105097e11bf6293b716bcefb8d8a2a2 18-Mar-2015 Paul Jensen <pauljensen@google.com> Make NetworkCapabilities.NOT_VPN javadoc visible.

Also adjust wording to be more suitable for NetworkRequests and NetworkAgents.

Change-Id: I1cc93cb20779cf02d6ffa0fa11ad2916c199b365
/frameworks/base/core/java/android/net/NetworkCapabilities.java
403aa2684e0e93b4792aabc0bbe1f32ac5e417af 28-Nov-2014 Lorenzo Colitti <lorenzo@google.com> Make StatusBar display all default networks.

The basic principle is: if an app's traffic could possibly go
over a network without the app using the multinetwork APIs (hence
"by default"), then the status bar should show that network's
connectivity.

In the normal case, app traffic only goes over the system's default
network connection, so that's the only network returned.

With a VPN in force, some app traffic may go into the VPN, and thus over
whatever underlying networks the VPN specifies, while other app traffic
may go over the system default network (e.g.: a split-tunnel VPN, or an
app disallowed by the VPN), so the set of networks returned includes the
VPN's underlying networks and the system default.

Specifically:

1. Add a NETWORK_CAPABILITY_VALIDATED bit to NetworkCapabilities.
2. Add a hidden API to retrieve the NetworkCapabilities of
all default networks for a given macro-user.
3. Modify the status bar code that used getActiveNetworkInfo to
determine which network was active, and make it consider all
validated networks instead.
4. Because the set of active networks depends on which VPN app
the user is running, make the status bar re-evaluate the
networking situation when the active user changes.

Bug: 17460017
Change-Id: Ie4965f35fb5936b088e6060ee06e362c22297ab2
/frameworks/base/core/java/android/net/NetworkCapabilities.java
06314e4eab4b78d971ff878de3984f2dc673c2d3 29-Oct-2014 Robert Greenwalt <rgreenwalt@google.com> Fix Legacy typing of net-specific requests.

We're starting to get network requests for specific SIMs
and the Legacy Type Inference was broken because the incoming
request included a network specifier while the legacy requests
it was compared with did not. Only compare the things we care
about.

bug:18031008
Change-Id: If107042828c152ede51a2497a3859bc1a6c83694
/frameworks/base/core/java/android/net/NetworkCapabilities.java
4e2dea77dcaa0b7b940d881bbc25e13e35e2ea49 20-Sep-2014 Wink Saville <wink@google.com> Cleanup NetworkCapabilities.

Remove unused imports and variables.
Fix misspellings.
Added @Overrides.

Change-Id: I81f4adb0504e92d01c5465a0e14bc46d5ec3987e
/frameworks/base/core/java/android/net/NetworkCapabilities.java
94badcc8cea8f428501e9ca819a2fe7a45af8b59 10-Jul-2014 Robert Greenwalt <rgreenwalt@google.com> Missed an entry in the copy constructor.

bug:15755597
Change-Id: Iee17ca88404a6a50258d204a12cd0c04cd15e34e
/frameworks/base/core/java/android/net/NetworkCapabilities.java
5f90bccd96397f23b988c5e668b13f5344fd104b 10-Jul-2014 Robert Greenwalt <rgreenwalt@google.com> Add networkSpecifier string to NetworkCapabilties.

Allows transport specific network selectivity where multi-sim or sta+sta
is supported.

bug:1575597
Change-Id: I9c60fe7710e988c17d63236788b492a3ddd264a1
/frameworks/base/core/java/android/net/NetworkCapabilities.java
6bc2c2c34f2b23eae79ad733c97a691734055c4f 07-May-2014 Paul Jensen <pauljensen@google.com> Convert Vpn from NetworkStateTracker to NetworkAgent.

This eliminates the need for the ConnectivityService.VpnCallback class.
This requires shifting VPNs to the new "network" netd API.
VpnService.protect() is modified to no longer go through ConnectivityService.
NetworkCapabilities is extended to add a transport type for VPNs and a
capability requiring a non-VPN (so the default NetworkRequest isn't satisfied
by a VPN).

bug:15409918
Change-Id: Ic4498f1961582208add6f375ad16ce376ee9eb95
/frameworks/base/core/java/android/net/NetworkCapabilities.java
16e12abbef5b84b75e3180b3d1ba5244b7e2557d 09-Jul-2014 Robert Greenwalt <rgreenwalt@google.com> Add Trust to NetworkCapabilities.

Indicates the user has indicated implicit trust of a network. This
generally means it's a sim-selected carrier, a plugged in ethernet,
a paired BT device or a wifi they've asked to connect to. Untrusted
networks are probably limited to unknown wifi AP.

Change-Id: I89490bdaa3c2d63d33f876c72d8b088dc155fa3d
/frameworks/base/core/java/android/net/NetworkCapabilities.java
7569f1811f6061b2a6605c69bca1bb7af72ae1a0 09-Jun-2014 Robert Greenwalt <rgreenwalt@google.com> Make NetworkCapabilities publicly immutable.

Applying API council comments.

bug: 15142362

(cherry picked from commit Ie0bde68b72656a676d90c0343b9756fe9268d8d6)
Change-Id: Ie0bde68b72656a676d90c0343b9756fe9268d8d6
/frameworks/base/core/java/android/net/NetworkCapabilities.java
01d004ef427c89fd04ab8a6d99cfb7ed81c6c962 19-May-2014 Robert Greenwalt <rgreenwalt@google.com> Update the docs for NetworkCapabilities

Preparing for ConnectivityService API update

Change-Id: I397e375b9254d4271183cf34c4a689deea1e198e
/frameworks/base/core/java/android/net/NetworkCapabilities.java
c9c90c771c9cd1381a49b714df9a2bc392959fcc 14-May-2014 Robert Greenwalt <rgreenwalt@google.com> Add networks and requests to CS.dump

Adds debugging.

Change-Id: I352dfe970c990fd210f3d1598519e321bbdd6ed5
(cherry picked from commit 9bdf6bd99db56c652ba9a62d91f258d11d19ca9f)
/frameworks/base/core/java/android/net/NetworkCapabilities.java
5152c0987db69dad24259a8316fb819755bfda77 13-May-2014 Robert Greenwalt <rgreenwalt@google.com> Merge "Add has* utility functions to NetworkCapabilities"
5c55e3335caf5200669e961aef557238282f59d7 08-May-2014 Robert Greenwalt <rgreenwalt@google.com> Add has* utility functions to NetworkCapabilities

Change-Id: Icf735b778a3956812be522db39c29cf54c757a25
/frameworks/base/core/java/android/net/NetworkCapabilities.java
0b38f08ede62cbfead15639c29d7f3ef0265dc0e 21-Apr-2014 Lorenzo Colitti <lorenzo@google.com> Fix reboot loop.

The multinetwork branch is rebooting on startup with:

E/AndroidRuntime( 1024): *** FATAL EXCEPTION IN SYSTEM PROCESS: NetworkStats
[...]
E/AndroidRuntime( 1024): Caused by: java.lang.NullPointerException: Attempt to read from field 'long android.net.NetworkCapabilities.mNetworkCapabilities' on a null object reference
E/AndroidRuntime( 1024): at android.net.NetworkCapabilities.<init>(NetworkCapabilities.java:235)
E/AndroidRuntime( 1024): at android.net.BaseNetworkStateTracker.getNetworkCapabilities(BaseNetworkStateTracker.java:103)
E/AndroidRuntime( 1024): at com.android.server.ConnectivityService.getAllNetworkState(ConnectivityService.java:1134)
E/AndroidRuntime( 1024): at com.android.server.net.NetworkStatsService.updateIfacesLocked(NetworkStatsService.java:877)
E/AndroidRuntime( 1024): at com.android.server.net.NetworkStatsService.updateIfaces(NetworkStatsService.java:849)
E/AndroidRuntime( 1024): at com.android.server.net.NetworkStatsService.access$600(NetworkStatsService.java:139)
E/AndroidRuntime( 1024): at com.android.server.net.NetworkStatsService$2.onReceive(NetworkStatsService.java:717)
E/AndroidRuntime( 1024): at android.app.LoadedApk$ReceiverDispatcher$Args.run(LoadedApk.java:766)
E/AndroidRuntime( 1024): ... 4 more

This seems to be due to NetworkCapabilities' copy constructor
not null-checking its argument. Unbreak things by ignoring null.

Change-Id: Iff3c38e6d72390fa86e51bfce534ebd42a262e19
/frameworks/base/core/java/android/net/NetworkCapabilities.java
1448f0540ba3898080aaf599dcebe51c4fd6287d 08-Apr-2014 Robert Greenwalt <rgreenwalt@google.com> Add NetworkCapabilities part of API.

Merging to master, adding @hide until we're ready to reveal the API change.

bug:13885501
Change-Id: Ib40e28092e092630bfec557bde77f58eec8ae1c8
/frameworks/base/core/java/android/net/NetworkCapabilities.java