Commit Graph

1729 Commits

Author SHA1 Message Date
Erik Kline
56066f6036 am f35e9344: am ec69003d: am 9d598e11: Pass signal strength thresholds inside a Bundle
* commit 'f35e93446d5172446fa2cf37cac405a62cd54233':
  Pass signal strength thresholds inside a Bundle
2015-07-18 18:08:45 +00:00
Lorenzo Colitti
a169460950 am 1c6b02af: am da355c80: am c3f21f3b: Support NetworkCallbacks based on signal strength.
* commit '1c6b02af8b53982c2717c684e5cdd94618dff422':
  Support NetworkCallbacks based on signal strength.
2015-07-18 18:08:39 +00:00
Lorenzo Colitti
15cda089b6 am 6163290e: am e647d93d: am 8bf977d5: ConnectivityManager API for for packet keepalives.
* commit '6163290e5975b0d4ebdecc20dfa41faac4b4ba79':
  ConnectivityManager API for for packet keepalives.
2015-07-18 17:51:42 +00:00
Lorenzo Colitti
2d2a59924d am 47a47d3b: am 00365fc6: am 260a36d1: Make immutable NetworkCapabilities more explicit.
* commit '47a47d3b907325be3b851ce87f275e6032527c5e':
  Make immutable NetworkCapabilities more explicit.
2015-07-18 17:51:36 +00:00
Erik Kline
9d598e115f Pass signal strength thresholds inside a Bundle
Bug: 21407651
Change-Id: I2c80e89441e2eb15a246cb1fa9347f886cefa80f
2015-07-18 17:28:52 +00:00
Lorenzo Colitti
c3f21f3b8b Support NetworkCallbacks based on signal strength.
Bug: 21405941
Change-Id: I2ed8a5aeb8dac464a4305671ed22abcacb485bc9
2015-07-18 17:28:26 +00:00
Lorenzo Colitti
8bf977d562 ConnectivityManager API for for packet keepalives.
Bug: 21405946
Change-Id: Ie1f8f8bee684fe2bb1092a9f1bc9f5dc29b1defc
2015-07-18 17:00:13 +00:00
Lorenzo Colitti
260a36d1b2 Make immutable NetworkCapabilities more explicit.
Bug: 21405941
Change-Id: Iafd738c31747b0f5f9356bed1c97f5f282830af1
2015-07-18 16:59:47 +00:00
Neil Fuller
b662579ec0 am 3ecbca50: am 886630c0: Merge "Switch shutdownInput / shutdownOutput to using Os.shutdown."
* commit '3ecbca5081f26ca03ef6b8b68767753343e67f38':
  Switch shutdownInput / shutdownOutput to using Os.shutdown.
2015-07-13 15:26:09 +00:00
Robin Lee
f8b96edf47 am 81093dd0: am 51cfb3a4: am 2164cf4f: am f180fe31: Merge "Legacy VPN calls to require a userID" into mnc-dev
* commit '81093dd04bc1fdfe1f7389baefb891122e232ff9':
  Legacy VPN calls to require a userID
2015-07-10 20:03:02 +00:00
Robert Greenwalt
cc5cd90029 am e84c6b37: am 2cef47ff: am 66f59dc1: am 1570b6b3: Merge "Enable EMERGENCY mobile connections." into mnc-dev
* commit 'e84c6b37f4859371e274b30035a1a5ec04307f66':
  Enable EMERGENCY mobile connections.
2015-07-10 19:17:55 +00:00
Robin Lee
f180fe31de Merge "Legacy VPN calls to require a userID" into mnc-dev 2015-07-10 19:05:38 +00:00
Robert Greenwalt
1570b6b3c7 Merge "Enable EMERGENCY mobile connections." into mnc-dev 2015-07-10 18:23:24 +00:00
Paul Jensen
851bcaf2ed am ca36baaf: am 2cb16d2e: am 75a43340: am 00c64f7c: Merge "Add android.net.CaptivePortal class for captive-portal-handling-app callbacks" into mnc-dev
* commit 'ca36baafef8024973ab8aebb54913a96db3d0e77':
  Add android.net.CaptivePortal class for captive-portal-handling-app callbacks
2015-07-10 15:46:28 +00:00
Paul Jensen
00c64f7ca5 Merge "Add android.net.CaptivePortal class for captive-portal-handling-app callbacks" into mnc-dev 2015-07-10 14:57:13 +00:00
Neil Fuller
a7f7c248c7 Switch shutdownInput / shutdownOutput to using Os.shutdown.
Bug: 3106438
Change-Id: I2c4817e435c6b253d6c507ea57bdfdfe45df8862
2015-07-10 12:30:07 +01:00
Robert Greenwalt
4bd4389616 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
2015-07-09 14:49:35 -07:00
Robert Greenwalt
c3ed104c25 am 49a8822d: am 8d6620bd: am 30d822e2: am b091695b: Merge "Revive NetworkInfo\'s SUSPENDED state." into mnc-dev
* commit '49a8822db9dcf2bc2b11a6a44179b361c1f8b86b':
  Revive NetworkInfo's SUSPENDED state.
2015-07-09 18:50:16 +00:00
Paul Jensen
49e3edff51 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
2015-07-09 10:47:34 -04:00
Neil Fuller
f74d27af87 am b27c379b: am 2ca4f73e: Merge "Switch LocalSocketImpl.accept() over to using Os.accept()"
* commit 'b27c379b259d42a1e90eb4b4d79abc2426def731':
  Switch LocalSocketImpl.accept() over to using Os.accept()
2015-07-09 11:38:36 +00:00
Neil Fuller
c1eaeb9337 Switch LocalSocketImpl.accept() over to using Os.accept()
Bug: 3106438
Change-Id: I3b4a07cc2283c3cfdbaf3d2460f37264f67690e3
2015-07-09 09:45:01 +00:00
Robert Greenwalt
8d48252b80 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
2015-07-08 20:42:55 -07:00
Zoltan Szatmary-Ban
55a3a23307 am 5bc85aa8: am d426cf73: am 30871415: am 89592760: Merge "Expose time-interval detail query on INetworkStatsSession" into mnc-dev
* commit '5bc85aa8dbfdf03a5e764e74c415189c1bfa591c':
  Expose time-interval detail query on INetworkStatsSession
2015-07-08 12:55:18 +00:00
Neil Fuller
849558b727 am 26e58f09: am b05c2beb: Merge "Move listen() over to using android.system.Os"
* commit '26e58f09d9c040b8abaa5184a16ec52e5f401b4c':
  Move listen() over to using android.system.Os
2015-07-08 10:50:36 +00:00
Robin Lee
3eed5eca80 Legacy VPN calls to require a userID
This way, system applications with INTERACT_ACROSS_USERS permission will
be able to fetch the information they need.

Pre-requisite for bug 21499103

Change-Id: I7e759d5039ae6e85abc6435049016b1dcaabc834
2015-07-07 19:37:21 +00:00
Neil Fuller
b66e748577 am 23325440: am 50d11ded: Merge "Reimplement LocalSocket methods using android.system.Os"
* commit '2332544040d294ee81f64aabebe49c4f548c1337':
  Reimplement LocalSocket methods using android.system.Os
2015-07-07 16:46:44 +00:00
Zoltan Szatmary-Ban
72027d2e42 Expose time-interval detail query on INetworkStatsSession
Also, force polling when a session is opened for NetworkStatsManager.

Bug: 21864554
Bug: 21754685
Change-Id: I24ea822c2d5bc1421ec7ee65d0cfe27cf02dd69e
2015-07-07 17:36:54 +01:00
Neil Fuller
a8f4499c54 am 93bb2bf2: am 761e39e1: Merge "Switch to using android.system.Os for more calls"
* commit '93bb2bf2e835f714d09b53dea3ca5d9e4451021e':
  Switch to using android.system.Os for more calls
2015-07-04 02:58:40 +00:00
Neil Fuller
4fa438ef72 Move listen() over to using android.system.Os
Bug: 3106438
Change-Id: I9b4d1d58d84a28828555ae863e86530995191f2c
2015-07-03 17:58:00 +01:00
Neil Fuller
d2df87eb44 Reimplement LocalSocket methods using android.system.Os
InputStream.available()
OutputStream.flush()

Bug: 3106438
Change-Id: I3a9425c323229e27bb72f6232dd13f7579586840
2015-07-03 15:16:37 +01:00
Neil Fuller
c80af6d84d Switch to using android.system.Os for more calls
The methods being switched here should involve no important
semantic changes. socket.getSoTimeout() is now implemented:
previously it would have returned 0 in all cases.

Some tidy up of unimplemented / commented code.

Switching other calls to use Os would carry more risk and
will be handled separately they can be switched safely.

Bug: 3106438
Change-Id: I5526249395565fee6e43f159a2b5975b0d41d058
2015-07-03 13:02:08 +01:00
Paul Jensen
f2c1cfe4c5 Add ConnectivityManager.unregisterNetworkCallback(PendingIntent) API
This better pairs up with
registerNetworkCallback(NetworkRequest, PendingIntent).

Bug:22175708
Change-Id: I336df3f48a0b814f1cbeba6d00afc4e6cc536483
2015-06-30 14:29:18 -04:00
Erik Kline
b36a3131d1 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
2015-06-30 12:12:37 +09:00
Paul Jensen
bb2e0e9816 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
2015-06-23 14:13:10 -04:00
Paul Jensen
3d194eae6f Add NetworkCapabilities.NET_CAPABILITY_CAPTIVE_PORTAL
Bug: 21343774
Bug: 20898908
Change-Id: I23069a6cba346999d1b2eeaa445023bd6bf4ef94
2015-06-23 14:09:01 -04:00
Lorenzo Colitti
e2d921da29 Merge "Re-hide onPreCheck and unhide NET_CAPABILITY_VALIDATED." into mnc-dev 2015-06-23 14:41:57 +00:00
Paul Jensen
2f56a33041 Merge "Add ConnectivityManager.registerNetworkCallback(NetworkRequest, PendingIntent)" into mnc-dev 2015-06-20 01:13:18 +00:00
Paul Jensen
694f2b8472 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
2015-06-18 20:00:44 -04:00
Xiaohui Chen
802ece6139 Merge "system_server: add two child chains to firewall" into mnc-dev 2015-06-17 23:50:28 +00:00
Xiaohui Chen
b41c9f7f39 system_server: add two child chains to firewall
This is an attempt to speed up getting out of device idle.  It groups
uid firewall rules in these child chains so we can attach/detach a whole
chain instead of individual uid rules.

BUG:21446713
Change-Id: Ie8f392da2deabe7cc86a9ecf4ed080163861d41e
2015-06-17 15:55:37 -07:00
Paul Jensen
19769114b4 Merge "Remove dead hidden ConnectivityManager and NetworkInfo APIs." into mnc-dev 2015-06-16 11:30:51 +00:00
Jeff Sharkey
a65a1582f5 Merge "Update file size formatting." into mnc-dev 2015-06-16 04:47:21 +00:00
Jeff Sharkey
b521feaed4 Update file size formatting.
Per UX, default strings should have space between value and units
resulting in "12.3 GB".  Add a formatting variant that returns the
various components for callers who want to build their own strings.

For now there is only one mounted emulated volume at a time, and
it's always the primary storage, so give it the default rootId to
keep old Uris working.

Change-Id: Ifcc72a91a6b397ee65dc92642153286186eb64ac
2015-06-15 21:39:28 -07:00
Paul Jensen
434dde84ee 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
2015-06-16 02:07:36 +00:00
Erik Kline
e1a6cf2caa 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
2015-06-15 15:18:38 +09:00
Lorenzo Colitti
662761224c 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
2015-06-11 15:30:13 +09:00
Robert Greenwalt
3d68dee119 Add logging to help debug this issue.
Shows:
TelephonyNetworkFactories:
    {TelephonyNetworkFactory - ScoreFilter=50, Filter=[ Transports:
    CELLULAR Capabilities: MMS&SUPL&DUN&FOTA&IMS&CBS&IA&RCS&XCAP&EIMS&
    INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN Specifier: <2>],
    requests=1, refCount=0}
        {NetworkRequest [ id=1, legacyType=-1, [ Capabilities:
        INTERNET&NOT_RESTRICTED&TRUSTED&NOT_VPN] ], score=50, requested=true}

bug:20731384
Change-Id: I6a38f195609ad01ff2a2584d07945540ae421586
2015-06-10 22:17:49 -07:00
Robert Greenwalt
3cbad5c17f Merge "Remove network requests properly." into mnc-dev 2015-06-11 02:19:17 +00:00
Robert Greenwalt
348e98dba0 Remove network requests properly.
We used to only remove requests that we'd acted on but that's
just wrong.

Also adds test case which exposed the problem but passes with the fix.

bug:20731384
Change-Id: I581a005560cc71167b857abf2452769399a9e1b7
2015-06-10 14:44:34 -07:00
Erik Kline
d895999858 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
2015-06-09 16:19:24 +09:00