Commit graph android_packages_modules_Co.../core/java/android
Message SHA1
Merge "Enable EMERGENCY mobile connections." into mnc-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2015-07-10 18:23:24 +00:00
4ab39690aa
Merge "Add android.net.CaptivePortal class for captive-portal-handling-app callbacks" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-07-10 14:57:13 +00:00
f2479b9d50
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

Robert Greenwalt   commited 2015-07-09 14:49:35 -07:00
b1f7f75874
Add android.net.CaptivePortal class for captive-portal-handling-app callbacks
This new class replaces the awkward string token and ConnectivityManager APIs
used by apps handling captive portals.

Bug:21343774
Change-Id: I1a2c69edb17322715bf8422bb4216b0ea60bfd59

Paul Jensen   commited 2015-07-09 10:47:34 -04:00
75e0adb220
Revive NetworkInfo's SUSPENDED state.
This got lost in the multinetwork work for L.  It means
that if telephony stops having the ability to pass packets for a while
the rest of the platform doesn't know.

Telephony enters the suspended state if it enters a telephony call
while using certain radio access technologies, or if it switches to
one of those RATs while in a call.  It also can enter this state if
it temporarily loses contact with the network - the modem will
not report the loss of the data call for an indeterminant time in
the hope that regaining the network will restore the connection
without harm to any ongoing ip layer interactions.  For example
passing through a tunnel or taking an elevator trip may use this
mechanism.

bug: 19637156
Change-Id: If9fde68175e8561c19323c81fbfcb02a6e5a00fb

Robert Greenwalt   commited 2015-07-08 20:42:55 -07:00
7fb8adcd51
Add ConnectivityManager.unregisterNetworkCallback(PendingIntent) API
This better pairs up with
registerNetworkCallback(NetworkRequest, PendingIntent).

Bug:22175708
Change-Id: I336df3f48a0b814f1cbeba6d00afc4e6cc536483

Paul Jensen   commited 2015-06-30 14:29:18 -04:00
169f662203
Fix use of reachable DNS server logic
Move reachable DNS server computation out of ConnectivityService
and split it into LinkProperties#isReachable() and a companion
change in WifiStateMachine's makeLinkProperties().

Restore previous ConnectivityService#updateDnses() behaviour, as
the pruning is done in WifiStateMachine now.

Bug: 19470192
Bug: 20733156
Bug: 22098233
Change-Id: I810ef74d504e5dc1ca2017d435cdadd6b82171e6

Erik Kline   commited 2015-06-30 12:12:37 +09:00
a923dbae3a
Disallow requesting networks with mutable NetworkCapabilities.
It's not clear what it means to request a network with a mutable
NetworkCapability like NET_CAPABILITY_VALIDATED or
NET_CAPABILITY_CAPTIVE_PORTAL.  Presently requesting such a network
would fail in a number of different ways:
1. The NetworkFactories would fail to match the request against their
   filter which doesn't include stateful NetworkCapabilities.
2. If the NetworkFactories did match, they'd bring up networks to try
   and satisfy the requests, but the networks would not have any
   mutable NetworkCapabilities initially so they'd be reaped.
Because of these problems it's safest to simply disallow these
requests.

Bug: 21343774
Change-Id: I56303242b81d39b370b8d5d1e32059bfcfc25949

Paul Jensen   commited 2015-06-23 14:13:10 -04:00
ee52d2375f
Add NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL
Bug: 21343774
Bug: 20898908
Change-Id: I23069a6cba346999d1b2eeaa445023bd6bf4ef94

Paul Jensen   commited 2015-06-23 14:09:01 -04:00
53f089581a
Merge "Re-hide onPreCheck and unhide NET_CAPABILITY_VALIDATED." into mnc-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2015-06-23 14:41:57 +00:00
fd62bcfdca
Merge "Add ConnectivityManager.registerNetworkCallback(NetworkRequest, PendingIntent)" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-06-20 01:13:18 +00:00
d44e41088d
Add ConnectivityManager.registerNetworkCallback(NetworkRequest, PendingIntent)
Without this API we're more or less encouraging apps to have long running
processes (battery draining) to receive NetworkCallbacks for the stateful
NetworkCapabilities NET_CAPABILITIES_VALIDATED and
NET_CAPABILITIES_CAPTIVE_PORTAL.  With this API they can instead using
PendingIntents which outlive their apps.

Bug: 21343774
Change-Id: I168d0ac3757729acf7ca5546079846f575a0eedd

Paul Jensen   commited 2015-06-18 20:00:44 -04:00
c8873fcfe5
Merge "Remove dead hidden ConnectivityManager and NetworkInfo APIs." into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-06-16 11:30:51 +00:00
278bc59082
Remove dead hidden ConnectivityManager and NetworkInfo APIs.
- There are no callers of
  NetworkInfo.setIsConnectedToProvisioningNetwork(), so remove all the
  code that deals with mIsConnectedToProvisioningNetwork being true,
  including the two ConnectiviyManager APIs.
- There are no callers of
  ConnectivityManager.getMobileRedirectedProvisioningUrl(), so remove
  the code that reads this URL.
- There are no callers of
  ConnectivityManager.captivePortalCheckCompleted(), so remove this
  API which is currently a no-op.

Change-Id: Ifa44c7553c7c45ebe261a2a124d9bf8d6f96c690

Paul Jensen   commited 2015-06-16 02:07:36 +00:00
c6b3de1e4a
Add a test that Network#getNetworkHandle() behaves sanely.
Additionally:
    - make zero more obvious for debugging, rather than emitting
      some inscrutable magic value.

Bug: 19537384
Change-Id: Iac9a3297a0dda1ba3d69fd01cf6de81f01fd837e

Erik Kline   commited 2015-06-15 15:18:38 +09:00
cc00792876
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

Lorenzo Colitti   commited 2015-06-11 15:30:13 +09:00
3a9df1a8cd
Make public Network#bindSocket(FileDescriptor).
Code that uses android.system.Os to create sockets as FileDescriptors
should be able to bind them to networks.  Note that FileDescriptors
could already be marked as "protected from VPNs" via
NetworkUtils#protectFromVpn(), but heretofore were not easily bound
to any particular network.

Bug: 21449922
Change-Id: I4bb86db5d95d5a55bb2d7e245848d11eaa351e65

Erik Kline   commited 2015-06-09 16:19:24 +09:00
94fd615d1f
Merge "Add javadoc comments mentioning ConnectivityManager API permissions." into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-05-26 17:37:33 +00:00
16d8795df6
LinkProperties function to compare provisioning and remove DNS servers
Adds:
    - enum ProvisioningChange
    - LinkProperties#compareProvisioning()
          return a ProvisioningChange value describing the delta in
          provisioning between two LinkProperties objects
    - LinkProperties#removeDnsServer()
    - make "@hide public" isIPv4Provisioned() and isIPv6Provisioned()

Bug: 18581716
Change-Id: I3df90b2b89617f693346f2dbe72e77c88ce91ffd

Erik Kline   commited 2015-05-21 20:43:47 +09:00
04612b0692
Merge "LCE feature enhancement" into mnc-dev
fenglu   authored and   Android (Google) Code Review   commited 2015-05-20 21:09:09 +00:00
c7830c6dcf
Merge "Undeprecate android.net.ProxyInfo as it's still used." into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-05-20 10:49:04 +00:00
60472854d2
Merge "Add a hidden method to clear the capabilities of a NetworkRequest" into mnc-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2015-05-20 05:49:03 +00:00
892a7e1885
LCE feature enhancement
- space pollLceData calls every 500ms
- cluster multiple pending pollLceData calls into one
- cherry pick from mwd to mnc-dev

Bug: 21307957
Change-Id: I04513011db3ae29af02bd54fe91cb8e0d4ab9f12

fenglu   commited 2015-05-19 17:08:00 -07:00
fcc8c9b5f4
Undeprecate android.net.ProxyInfo as it's still used.
It was deprecated as part of the Apache deprecation, however it is used
by ConnectivityManager.getLinkProperties() and .getDefaultProxy().
The alternatives (e.g. java.net.Proxy) do not offer a complete
replacement as they lack certain fields (e.g. PAC URL).

Bug:21274137
Change-Id: I99163a2611a738f337fb9907349ef6255dbed6d6

Paul Jensen   commited 2015-05-19 15:09:17 -04:00
81c7260a93
Add javadoc comments mentioning ConnectivityManager API permissions.
Also move permissions comments above @param and @return to fix indent.

bug:20499587
Change-Id: If82ff2367fdbce06e696e494439b31cb100d768f

Paul Jensen   commited 2015-05-19 14:03:03 -04:00
08f9dbbfa1
Merge "Query HTTP proxy for network via a new API to avoid permissions exceptions" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-05-19 17:58:11 +00:00
1916861976
Add a hidden method to clear the capabilities of a NetworkRequest
Change-Id: I41d4f2229259d0bf9d68aa00f92f3bf4e2e71fbc

Lorenzo Colitti   commited 2015-05-20 00:35:24 +09:00
1aa80c66de
Merge "Make NET_CAPABILITY_VALIDATED (almost) a first-class citizen." into mnc-dev
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2015-05-19 10:29:48 +00:00
a3a771b3d7
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

Lorenzo Colitti   commited 2015-05-19 18:29:02 +09:00
e97685a88f
Support cross-user VPN calls (with permission)
Settings and SystemUI need to act on other users than USER_OWNER.

This is gated by INTERACT_ACROSS_USERS_FULL in addition to the existing
CONTROL_VPN checks, so the number of processes able to interfere with
other profiles' VPNs should be quite small.

Bug: 20692490
Bug: 20747154
Bug: 20872408
Change-Id: I6e5d7220f73435bec350719e7b4715935caf4e19

Robin Lee   commited 2015-05-18 23:35:31 +01:00
1e71fc8356
Query HTTP proxy for network via a new API to avoid permissions exceptions
Add @hidden ConnectivityManager.getProxyForNetwork() API.

Bug:20470604
Change-Id: I6a9bc4afc8273bc43b14cdeccfedbbf3ff66be40

Paul Jensen   commited 2015-05-18 17:05:51 +00:00
db93dd93c5
Deprecate ConnectivityManager.isNetworkTypeValid as it's unneeded.
All ConnectivityManager APIs taking a network type have been
deprecated so there should be no need to validate a network type.

bug:20647016
Change-Id: I2dcf24f58016e94aa814dda38cfc848366cc461c

Paul Jensen   commited 2015-05-12 10:36:56 -04:00
bbb61094b2
am ad44d814: am 3dc08220: am b57f236e: Merge changes Icf7d67e2,Ia914ec88,I2490ad75,Ie79f2d28 into mnc-dev
* commit 'ad44d81457971085a0b20fb42388010d76c79132':
  Add a hidden method to clear NetworkCapabilities.
  Fix javadoc error for requestNetwork.
  Simplify network callback handling code.
  Document and unhide CALLBACK_PRECHECK.

Lorenzo Colitti   authored and   Android Git Automerger   commited 2015-05-01 04:19:07 +00:00
a8851ab1fb
Add a hidden method to clear NetworkCapabilities.
Change-Id: Icf7d67e24a09113340e9bff2c72526760914ef48

Lorenzo Colitti   commited 2015-05-01 12:36:29 +09:00
c5647c2eda
Fix javadoc error for requestNetwork.
The ConnectivityManager documentation uses {@link requestNetwork}
without specifying which version of that method it refers to.
This results in javadoc incorrectly linking to the version of the
method that takes a PendingIntent instead of the version that
takes a callback.

Change-Id: Ia914ec88005a6401b6391c5b4fc92f988baa3922

Lorenzo Colitti   commited 2015-05-01 12:36:29 +09:00
7f6a2bfffa
Simplify network callback handling code.
Change-Id: I2490ad754bf2a1282f27302c8556fb19983cc6b1

Lorenzo Colitti   commited 2015-05-01 12:36:28 +09:00
68e02363c7
Document and unhide CALLBACK_PRECHECK.
Bug: 20038463
Change-Id: Ie79f2d28c06cf611289504e49c471b55ffb9890f

Lorenzo Colitti   commited 2015-05-01 12:36:28 +09:00
145745967f
Fix the javadoc for requestBandwidthUpdate(...)
Change-Id: I6673dd219ef832acb15ce9b6398caa1c8503320b

fenglu   commited 2015-04-27 14:28:04 -07:00
ea2d928abe
Merge "API review for requestBandwidthUpdate()"
fenglu   authored and   Android (Google) Code Review   commited 2015-04-27 20:34:01 +00:00
faa4bcf5e3
Merge commit '60df4aa' into merge2
Change-Id: I116a9dbf19e95651a7c50393e4dcd7fb59ca3f3f

Etan Cohen   commited 2015-04-24 13:58:45 -07:00
856f4a7d05
Merge commit '9561e74' into merge2
Etan Cohen   commited 2015-04-24 13:43:36 -07:00
2fcb05cd8b
@removed requestRouteToHost and {start,stop}UsingNetworkFeature
Bug: 20482461
Change-Id: Ic59fc1271e664d85102dc7945c0c2ea82c0d6f6b

Lorenzo Colitti   commited 2015-04-23 17:44:05 +09:00
21e9a15571
Don't require ACCESS_NETWORK_STATE in setProcessDefaultNetwork
The documentation for setProcessDefaultNetwork does not
mention that it requires ACCESS_NETWORK_STATE, but a process
without ACCESS_NETWORK_STATE that calls it will crash because
we can't fetch the proxy properties.

Because ACCESS_NETWORK_STATE is not required to obtain a Network
object (Network objects can come from broadcasts too), it may not
be reasonable to require the permission. We did not do so in L.

For now, ignore the failure and don't crash the app. I've filed
http://b/20470604 to track a longer term fix.

Bug: 20081183
Bug: 20423580
Bug: 20470604
Change-Id: I158016130b4afb1d300357fe703804d2e7bc609b

Lorenzo Colitti   commited 2015-04-22 12:27:33 +09:00
41b1fbca30
API review for requestBandwidthUpdate()
Change-Id: I53dc3b95b1f989541e06d9b2c2ef8871bac81344

fenglu   commited 2015-04-21 18:57:15 -07:00
da75d5e866
Merge "update API name to requestBandwidthUpdate()"
fenglu   authored and   Android (Google) Code Review   commited 2015-04-22 01:32:19 +00:00
3595251977
update API name to requestBandwidthUpdate()
Change-Id: If26942978ffcc43f06f17dfad5da790f34758395

fenglu   commited 2015-04-21 17:12:05 -07:00
b00f48834e
Merge "Revert "requestBwUpdate() public API review""
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2015-04-21 23:59:35 +00:00
f780ac8cd6
Revert "requestBwUpdate() public API review"
This reverts commit 85d7af1f8b.

Change-Id: I8c22d285ff1f56f1bd31a0fa9f2e6a79959347b1

Robert Greenwalt   commited 2015-04-21 23:59:14 +00:00
d915d64bd6
Merge "requestBwUpdate() public API review"
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2015-04-21 23:55:48 +00:00
3d9f44446a
requestBwUpdate() public API review
Change-Id: I1e780b2705d13bfc85a0a8712ac1dbd623b474a1

fenglu   commited 2015-04-21 15:33:19 -07:00
85d7af1f8b