Commit graph android_packages_modules_Co.../services/core/java
Message SHA1
Skip lockdown setup if user is not up yet
Sometimes USER_UNLOCKED can be sent before USER_STARTED. This puts
lockdown in a bad state as it needs a fully-functioning user to tie
itself to and listen for connectivity events.

Bug: 27637943
Change-Id: I41a784a75a8c8674cb61dbba10693dd56c9396dd

Robin Lee   commited 2016-03-14 13:19:14 +00:00
b402c02f3c
Turn down the logging a little bit.
Change-Id: Ib6e0e6f3577afac3b9bfe9a9b1cce70fb16d9d04

Joe Onorato   commited 2016-03-04 12:21:30 -08:00
549c01ec10
Have ConnectivityService install packet filters when possible
am: 69b7682a46

* commit '69b7682a46':
  Have ConnectivityService install packet filters when possible

Paul Jensen   authored and   android-build-merger   commited 2016-03-03 14:48:45 +00:00
38ac9019d9
Support 464xlat on Ethernet.
am: bc241263b5

* commit 'bc241263b5':
  Support 464xlat on Ethernet.

Lorenzo Colitti   authored and   android-build-merger   commited 2016-03-03 08:39:16 +00:00
81cf43c087
Have ConnectivityService install packet filters when possible
Listen for ICMP6 router advertisements on networks that support
packet filters.  Construct packet filters and install them to
ignore redundant future ICMP6 router advertisements.

Bug: 26238573
Change-Id: If78300b9fda257c21f3ee6533e1da7de9f897cb4

Paul Jensen   authored and   Lorenzo Colitti   commited 2016-03-03 17:32:01 +09:00
69b7682a46
Support 464xlat on Ethernet.
Bug: 26991160
Change-Id: I848c9e86e1ed337e95cfddda46723a9a1dcaed30

Lorenzo Colitti   commited 2016-03-03 17:31:57 +09:00
bc241263b5
ConnectivityService: listen to USER_UNLOCKED too
When the credential-encrypted private storage for the target user is
unlocked, we should try to start up VPN for them.

Bug: 27357283
Change-Id: Id9079230d00e3cea08a49ae66bd1f553416b4f54

Robin Lee   commited 2016-02-29 16:29:44 +00:00
224743c6b7
Expose measurement results to interested callers.
am: 41e3340ade

* commit '41e3340ade':
  Expose measurement results to interested callers.

Erik Kline   authored and   android-build-merger   commited 2016-02-10 15:58:17 +00:00
b1ec885b3b
Expose measurement results to interested callers.
With this it's possible for callers to:

    Network network = ...
    LinkProperties lp = ...

    NetworkDiagnostics netdiag = new NetworkDiagnostics(network, lp, 5000);
    netdiag.startMeasurements();
    netdiag.waitForMeasurements();

    boolean result = true;
    for (Measurement m : netdiag.getMeasurements()) {
        if (!m.checkSucceeded()) {
            result = false;
            // Additional error handling here.
        }
    }

    return result;

Bug: 21832299
Bug: 26780890
Change-Id: Iaf7ff029e2c6a998b574c23d0dcde8d57a467a22

Erik Kline   commited 2016-02-11 00:28:27 +09:00
41e3340ade
Remove several TetherUtil functions which are no longer needed.
Slowly chipping away at TetherUtil to clean up this code.
This CL also adds an admin check to
ConnectivityService.isTetheringSupported to get parity with the
TetherUtil function before removing it.

Change-Id: Ibe7c5c9fb420d57e5458f77dad30e8a1e751a3e2

Jeremy Klein   commited 2016-02-04 19:06:59 -08:00
24d06b2ee8
Notify NetworkStatsService of roaming status changes.
When the roaming status of the cell network changes, it is handled as
follows:

-DcActiveState gets an event (either EVENT_DATA_CONNECTION_ROAM_ON or
 EVENT_DATA_CONNECTION_ROAM_OFF) and calls
 NetworkAgent#sendNetworkInfo with updated NetworkInfo.
-ConnectivityService then gets an EVENT_NETWORK_INFO_CHANGED and calls
 updateNetworkInfo with the new info.

With the previous code, the NetworkAgent's NetworkInfo object would be
updated internally, but because the state of the connection had not
changed from CONNECTED, the change would be considered a duplicate and
otherwise ignored.

With the new code, we call notifyIfacesChanged() when the state is the
same but the roaming status has changed. That should be all that is
necessary, as roaming is not exposed as a link property or network
capability today.

Bug: 26545456
Change-Id: I33d32d1fa84ce41dbe01542e5b498eda4b744b74

Jeff Davidson   commited 2016-01-29 10:13:18 -08:00
9804c89aab
Merge "Allow NetworkFactories to match any network specifier on a request" into mm-wireless-dev
am: c4752acb32

* commit 'c4752acb32':
  Allow NetworkFactories to match any network specifier on a request

Etan Cohen   authored and   android-build-merger   commited 2016-01-28 18:24:23 +00:00
a19d34ba18
Add the network handle to the NetworkAgentInfo#toString() output.
This will make it possible to find nethandles via, e.g.
 "dumpsys connectivity --short".

Without this, native multinetwork API debugging requires running
"dumpsys connectivity --diag" in order to see the nethandle values.

Bug: 19537384
Change-Id: Icdd2b112523d4ecf88d5339f229e714a56d248f8

Erik Kline   commited 2016-01-28 15:06:56 +09:00
b6b7ce4446
Remove the unused Looper param from Tethering constructor.
Tethering just constructs its own Looper right below where it
assigns the looper param to mLooper.

Change-Id: I2d522942eff2ad3439bb3961e78ab0625d3fa9df

Jeremy Klein   commited 2016-01-26 11:10:55 -08:00
2ada3deec1
Expose a simple tethering API which includes provision checks.
This CL exposes startTethering and stopTethering functions which also
encapsulate all provisioning check logic. Right now, only silent checks
are implemented, but UI checks will come in a follow-up CL. GTS tests
and Settings changes are under the same topic ID.

BUG: 26247383
Change-Id: I65f61d899594cb3f9035d8496366af17a57a090f

Jeremy Klein   commited 2016-01-25 16:37:09 -08:00
9a36ec8c25
Merge "Debug logging for when getActiveNetworkInfo returns BLOCKED." into mnc-dr1.5-dev am: a6855a1faa am: d841d71593
am: 228c56e200

* commit '228c56e200':
  Debug logging for when getActiveNetworkInfo returns BLOCKED.

Lorenzo Colitti   authored and   android-build-merger   commited 2016-01-22 18:50:49 +00:00
592da45e75
Debug logging for when getActiveNetworkInfo returns BLOCKED.
Bug: 26488100
Change-Id: I991581732d35aed18392bed2f3d69ca8fb231f5e

Lorenzo Colitti   commited 2016-01-22 05:21:34 +09:00
600e9a2d68
[VPN] start lockdown before user is unlocked
Removed the dependency on KeyStore encryption by removing that flag for
VPN profiles which don't use secure credentials when saving in Settings.

Old encrypted profiles will simply fail to load untile USER_PRESENT is
sent, as before.

Bug: 26108660
Change-Id: I2677d741d54252f15cb772c94ce1b39041f1e19c

Robin Lee   commited 2016-01-19 16:40:20 +00:00
4908ef3e42
Merge "Always-on app VPNs"
Robin Lee   authored and   Android (Google) Code Review   commited 2016-01-14 11:37:18 +00:00
5c1c2fa073
Always-on app VPNs
Bug: 22547950
Change-Id: I46b204170bfac58d944f39b22f815b080de71a58

Robin Lee   commited 2016-01-12 19:54:54 +00:00
33c73e2424
Makes captive portal server calculation in one place.
This also creates a hidden api for the captive portal server calculation
so that the Setup Wizard can use this as well.

bug:13246857
Change-Id: I4dfd0916df97cfce13252c7cc15f7bd05ed95f77

Udam Saini   commited 2016-01-08 14:38:31 -08:00
53b71ee34b
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

Etan Cohen   commited 2015-12-15 08:06:54 -08:00
d988de60d7
Merge "Remove defunct EVENT_SEND_STICKY_BROADCAST_INTENT."
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2015-12-15 13:24:52 +00:00
50461077fe
Add new target SDK filtering feature to BroadcastOptions.
You can now control the range of target SDKs that receivers
will be need to have in order to receive your broadcast.

Use this for CONNECTIVITY_ACTION to not allow N+ applications
to receive these broadcasts through their manifest.

Also tweak the broadcast debug output code to now include the
disposition of each receiver in the list.  This is becoming
important as skipping receivers is becoming a more common
thing to have happen.

Change-Id: I251daf68575c07cbb447536286ab4e68b7015148

Dianne Hackborn   commited 2015-12-10 12:12:00 -08:00
6782e22930
Remove defunct EVENT_SEND_STICKY_BROADCAST_INTENT.
http://ag/572619 , which removed the 3-second CONNECTIVITY_ACTION delay,
removed its only caller, but missed removing the message declaration
and processing code.

Bug: 20013379
Change-Id: Ice573569715ba424b8bf66d1dd08184d2b4a60f1

Lorenzo Colitti   commited 2015-12-10 13:08:35 +00:00
048896e466
Merge "Reinstate CHANGE_NETWORK_STATE as a normal permission." into mnc-dr-dev am: 809dcade99 am: bdc458048a am: bb8f652372
am: c41cfe3335

* commit 'c41cfe3335':
  Reinstate CHANGE_NETWORK_STATE as a normal permission.

Lorenzo Colitti   authored and   android-build-merger   commited 2015-10-22 06:33:09 +00:00
93a2f99192
Reinstate CHANGE_NETWORK_STATE as a normal permission.
This is a partial revert of http://ag/738523 , but not a full
revert because M apps that have gone through the WRITE_SETTINGS
route to obtain permission to change network state should
continue to have permission to do so.

Specifically:

1. Change the protection level of CHANGE_NETWORK_STATE back from
   "signature|preinstalled|appop|pre23" to "normal". This allows
   apps that declare CHANGE_NETWORK_STATE in their manifest to
   acquire it, even if they target the M SDK or above.
2. Change the ConnectivityManager permission checks so that they
   first check CHANGE_NETWORK_STATE, and then ask Settings
   if the app has the WRITE_SETTINGS runtime permission.
3. Slightly simplify the code in the Settings provider code that
   deals specifically with the ability to change network state.
4. Make the ConnectivityService permissions checks use the
   ConnectivityManager code to avoid code duplication.
5. Update the ConnectivityManager public Javadoc to list both
   CHANGE_NETWORK_STATE and WRITE_SETTINGS.

Bug: 21588539
Bug: 23597341
Change-Id: Ic06a26517c95f9ad94183f6d126fd0de45de346e

Lorenzo Colitti   commited 2015-10-22 08:33:45 +09:00
91de63b074
Merge "Don\'t buzz when automatically connecting to captive portals" into mnc-dr-dev am: d214496319 am: 5c09f31e49 am: 18ec0b5187
am: aea9258396

* commit 'aea9258396':
  Don't buzz when automatically connecting to captive portals

Lorenzo Colitti   authored and   android-build-merger   commited 2015-10-21 02:28:06 +00:00
d1023e8476
Don't buzz when automatically connecting to captive portals
Play a sound and vibrate (by setting DEFAULT_ALL) only if the
user manually selected the network. This applies to both captive
portals and networks with no Internet access.

Bug: 24126143
Change-Id: Idf075d5c85f9f4b07a3431a25d1a3f7089cf1ee2

Lorenzo Colitti   commited 2015-10-21 09:59:31 +09:00
c22996447c
am bc68bc37: am 9c8abd1d: am f23eece2: am f90627d4: Merge "Don\'t crash if an invalid always-on VPN profile is configured." into mnc-dr-dev
* commit 'bc68bc37c4':
  Don't crash if an invalid always-on VPN profile is configured.

Erik Kline   authored and   Android Git Automerger   commited 2015-10-14 18:01:48 +00:00
818b1622e7
Merge "Don't crash if an invalid always-on VPN profile is configured." into mnc-dr-dev
Erik Kline   authored and   Android (Google) Code Review   commited 2015-10-14 17:37:57 +00:00
f90627d40b
Don't crash if an invalid always-on VPN profile is configured.
This is currently being hit because Settings does not clear the
always-on VPN configuration when the corresponding VPN profile is
deleted. This will be fixed in Settings, but there's no harm in
being robust to invalid configurations here.

Bug: 23625458
Change-Id: Id185a54d5892339197cd40026df5174debd957cf

Lorenzo Colitti   commited 2015-10-13 15:29:14 +09:00
f5e2883d41
resolved conflicts for a8f0bb0f to master
Change-Id: I1f13a63c3680901fac58ef709118c9242032b11f

Jeff Sharkey   commited 2015-10-12 17:51:45 -07:00
025424f274
Merge "Push firewall rules up to ConnectivityService." into mnc-dr-dev
Jeff Sharkey   authored and   Android (Google) Code Review   commited 2015-10-12 16:34:19 +00:00
22d9b51ce0
Log UID and PID of legacy route requests.
Bug: 23801105
Change-Id: I1722af0424f5b9bbd7276b77ce1571842fa541b3

Lorenzo Colitti   commited 2015-10-09 13:08:34 +09:00
ce3a70be65
Fixed VPN support for restricted profiles in split system user model
In a new split system user model, owner of a restricted profile is not limited
to just user0. restrictedProfileParentId field should be used to get an owner.

Bug: 22950929
Change-Id: I928319a9450e543972237a42267eb2404e117c83

Fyodor Kupolov   commited 2015-09-28 16:44:04 -07:00
188d3bda6e
Framework fixes for RSSI offload.
1. When registering a NetworkCallback, only update RSSI
   thresholds if the request specifies a signal strength.
2. When releasing a NetworkCallback, only update RSSI
   thresholds if the request specified a signal strength.
3. Add logging.

Add logging.
Bug: 21405941
Bug: 23679346
Bug: 23815756
Change-Id: I4bc42d0ab02285a7a9d14e09f8a1cd868f4d9d7f

Lorenzo Colitti   commited 2015-09-15 16:00:39 +09:00
71ec67ddf7
Push firewall rules up to ConnectivityService.
getActiveNetworkInfo() and friends already know how to augment their
results to help apps detect when network access is blocked.  This
change wires up the new app-idle and device-idle firewall rules to
be reported through these APIs.

This also causes other platform tools like DownloadManager and
SyncManager to respect these new policies.

Bug: 24050462
Change-Id: Id9517b0b70be7e3ca2ab27bed8049db916e4d829

Jeff Sharkey   commited 2015-09-14 15:49:36 -07:00
baefe062f7
NetworkDiagnostics: ping default router from all global addreses.
This will hopefully allow us to determine if the router does not
have our global addresses in its neighbour cache.

Bug: 23661687
Change-Id: I46734c3c719003939cfccf038457ec309a9ff967

Lorenzo Colitti   commited 2015-09-10 15:49:54 +09:00
db30ceba87
Require the new PACKET_KEEPALIVE_OFFLOAD permission.
Bug: 23884210
Change-Id: I50a1a647a69deaba92e73021ee7d6cc0f3eb1eee

Lorenzo Colitti   commited 2015-09-09 00:16:57 +09:00
520287e881
Fix bugs and crashes in PacketKeepalive API.
Bug: 22606153
Bug: 23820819
Bug: 23884210
Change-Id: I1bf82094ec664baed345e9fb137fada0cbf4b7a0

Lorenzo Colitti   commited 2015-09-09 00:16:56 +09:00
f99389f155
Add tests for the PacketKeepalive API.
This currently fails in many different ways, but it tells us what
to fix.

Bug: 22606153
Bug: 23884210
Change-Id: If2e5ee0a8d7b26cad67d3d566ed5b1383e0db096

Lorenzo Colitti   commited 2015-09-09 00:16:56 +09:00
b793d607a5
Get rid of shortSleep() in ConnectivityServiceTest.
Instead, use IdleHandler to wait for things to become idle.

Bug: 22606153
Change-Id: Ic6ab93ad4d336b40962f9be1096629a44b63ee2f

Lorenzo Colitti   commited 2015-09-08 16:41:47 +09:00
1b8b5cdfad
Cut down some logs.
bug:23623327
Change-Id: I737d4e6c384bf4da62c65ad2abe0c9b5dca0067a

Robert Greenwalt   commited 2015-09-03 17:53:42 -07:00
9b33077561
Add SUPL-specific network bcast
Move SUPL CONNECTIVITY_ACTION bcasts to a different, hidden intent
to reduce the churn of apps when SUPL comes/goes.

Short term hack until SUPL moves to use the new APIs and there's
no bcast.

bug:23350688
Change-Id: I3dc14b42afa72465260aa41ccedfe1df27baabd9

Robert Greenwalt   commited 2015-09-01 15:06:04 -07:00
e577c8181d
am 886e7a63: Merge "Change default cellular activity timeout to 10" into mnc-dev
* commit '886e7a63b122a30c69c663d32e3e5f880a07593e':
  Change default cellular activity timeout to 10

Adam Lesinski   authored and   Android Git Automerger   commited 2015-08-19 00:53:35 +00:00
01ed50f414
Change default cellular activity timeout to 10
LTE radios take 10 seconds to power down, so we should set the
activity timeout to 10 seconds.

Bug:23294704
Change-Id: I7478b77f134b0fe2d82e39acd5c370add12735ca

Adam Lesinski   commited 2015-08-18 11:47:07 -07:00
3961c0efb7
am 746d1e33: Merge "Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS" into mnc-dev
* commit '746d1e3321':
  Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS

Billy Lau   authored and   Android Git Automerger   commited 2015-08-07 22:22:24 +00:00
29ea9fd5c4
Merge "Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS" into mnc-dev
Billy Lau   authored and   Android (Google) Code Review   commited 2015-08-07 22:16:03 +00:00
746d1e3321
Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS
Merge the CHANGE_NETWORK_STATE permission with WRITE_SETTINGS.

AndroidManifest.xml:
Raised the protection level of CHANGE_NETWORK_STATE permission from
normal to signature|appops and pre23|preinstall for compatibility

provider/Settings:
Wrote new helper methods to check if app is allowed to change network
state.

ConnectivityManager.java & ConnectivityService.java:
Replace enforcement checks for CHANGE_NETWORK_STATE with
checkAndNoteChangeNetworkStateOperations instead.

Change-Id: If8c2dd3c76a5324ca43f1d90fa17973216c2bcc5

Billy Lau   commited 2015-08-07 19:29:51 +01:00
16c5d9a6a7