Commit graph android_packages_modules_Co.../core/java/android
Message SHA1
Support multiple Vpn ManageDialogs
Move away from storing the configs in the Intent to prevent issues with
PendingIntents and multiple configs.

The Dialog now queries ConnectivityService for the configuration to
display in the management dialog.

Change-Id: I0e0ef52db840152914d117a24f776d8106e836ff

Chad Brubaker   commited 2013-07-16 18:59:12 -07:00
7dcfa2a06b
Move markSocketAsUser to the top of IConnectivityManager.aidl
Move markSocketAsUser to the top of IConnectivityManager.aidl to make
calls from
framework/native/services/connectivitymanager less fragile

Change-Id: Iba92c21dfef175b570521f34e7ee2732e5a0a9c9

Chad Brubaker   commited 2013-07-16 11:29:11 -07:00
b24810e7f7
Support routing sockets as another user
Add support for routing sockets as if they were another user's.
This is for services that handle delegated network tasks like MediaServer and DownloadManager.

Change-Id: Id20efc1f5c2cce6f8838d777762f6c0a703a9437

Chad Brubaker   commited 2013-07-15 12:14:10 -07:00
31de0b69b0
Add NetworkUtil function for marking sockets
Add NetworkUtil function for setting the SO_MARK field of sockets

Change-Id: I94389b64296d87ee928293f24a26f8dd08c3bf37

Chad Brubaker   authored and   Geremy Condra   commited 2013-07-12 19:48:32 +00:00
fa15058755
Merge commit '68513498' into fix-merge-conflict
* commit '68513498':
  Add checkMobileProvisioning to ConnectivityService.

Conflicts:
	services/java/com/android/server/ConnectivityService.java

Change-Id: Ieceb9c8f4aa4fa99258e56a720b4c74512369458

Wink Saville   commited 2013-07-01 16:12:31 -07:00
2e63bb7ef5
Add checkMobileProvisioning to ConnectivityService.
Bug: 9279964
Change-Id: I42c326a21e05aa301e9d974ed9ac1d59472780ec

Wink Saville   commited 2013-06-29 21:10:57 -07:00
690cb18254
Explicit locale when formatting machine strings.
Bug: 9390451
Change-Id: I3581c53407554a1dffd541fb42b06d68f20a7be0

Jeff Sharkey   commited 2013-06-11 14:36:41 -07:00
cf6e4d80e8
Accumulate network statistics based on deltas.
Network stats are now read out of the kernel in one sweep, instead of
reading per-UID.  We now accumulate the delta traffic between each
stats snapshot using the well-tested SamplingCounter pattern.

Since Wi-Fi and mobile traffic have different costs, track each
separately.  Avoids counting misc interfaces like loopback and
ethernet under total.

Bug: 5543387
Change-Id: I642004dc530113c27ef79f2abbae51d8af30117f

Jeff Sharkey   commited 2013-06-06 14:35:34 -07:00
e9bda1dd68
Merge "Listen for network disconnect." into jb-mr2-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2013-04-22 21:33:29 +00:00
665c912a4c
Listen for network disconnect.
VPN used to just watch the interface, but that is insufficient.  There
is no promise that the interface will go down when we're done with it.
Now that wifi stays on in scan-only mode despite user turning it off
it seems that the interface is left up, even in AP mode.

Now listening for ConnectivityService broadcast that the network we were on
has disconnected and tearing down the VPN then or when the interface
goes away.

bug:8550083
Change-Id: Icf414497bc55bead69de04e91f39f90ac2e6578a

Robert Greenwalt   commited 2013-04-22 14:13:51 -07:00
308b9acca1
Remove STOPSHIP and defer removal.
bug:8657300
Change-Id: Ia855fdc0db7a33502838648ee002d4929b224960

Robert Greenwalt   commited 2013-04-19 09:31:24 -07:00
a07f1f2d07
Add new route.hasGateway() api
Fixes issues brought in by change to isHostRoute.  isHostRoute
was technically correct, but the callers really wanted hasNextHop
behavior.

bug:8597268
Change-Id: I360761ccfa98b2ba34642f717a78fa71ec1bae4f

Robert Greenwalt   commited 2013-04-12 11:22:52 -07:00
24bc534c2e
Use CONNECTIVITY_INTERNAL for global proxy
The Global http proxy shouldn't be used by apps, but can be useful in certain
conditions.

bug:8264794
bug:8557674
Change-Id: Ia3cbe542e448d9e74d0492626a13e9fd34ad797a

Robert Greenwalt   commited 2013-04-10 15:32:18 -07:00
aa4677cfa0
Fix LinkProperties's equals() method.
LinkProperties's equals() method was broken by the addition of
stacked interfaces. The reason was that equals() was checking
the equality of mStackedInterfaces.keys(), which is just an
enumeration, instead of mStackedInterfaces.keySet(), which
actually contains the keys. The test was failing, but I didn't
notice.

Fix the bug and make the test check the objects more in depth
so it can give more detailed error messages when equals() fails.

Bug: 8276725
Change-Id: Ie990bd75f641c28e63e54d953dcd0f4de13f7c9f

Lorenzo Colitti   commited 2013-04-02 10:08:59 +09:00
c3787faa2a
Merge "Add BT - DataTracker connection" into jb-mr2-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2013-03-28 16:45:33 +00:00
2e3f7f04fc
Merge "Cleanup some debug in LinkCapabilities and Properties." into jb-mr2-dev
Wink Saville   authored and   Android (Google) Code Review   commited 2013-03-28 16:09:26 +00:00
f98a515fd1
Cleanup some debug in LinkCapabilities and Properties.
Change-Id: I5fe0124d0943f5e538e451645f32533a74c75a47

Wink Saville   commited 2013-03-27 16:21:43 -07:00
2accd693ee
Add BT - DataTracker connection
Allows the external BT stack the means to communicate with
ConnectivityService during reverse tethering.

bug:8445208
Change-Id: Ice7dfb0b50c9481d359aed14a51372878185171c

Robert Greenwalt   commited 2013-03-27 15:45:12 -07:00
030e1d3e9b
Make isHostRoute match only host routes
Currently, isHostRoute returns true iff the gateway address is
the unspecified address (0.0.0.0 or ::). Thus, it will return
true for any route that has no gateway (e.g., a route pointing at
a point-to-point interface), even if the route is not a host
route.

Fix this by checking the prefix length instead. This should be
safe because:

1. mDestination cannot be null, since it's created using new.
2. Host routes created using makeHostRoute (which is what
   ConnectivityService calls) always have the correct prefix
   lengths (/32 or /128) set.

Bug: 8276725
Change-Id: I14285398823fa6c312349128c7cc216cad4a84c9

Lorenzo Colitti   commited 2013-03-27 19:41:06 +09:00
cdc56fea29
Prevent NPE in new API.
bug:8455284
Change-Id: I26ecbd024d1fe001f3af792c4e66409b2968c7ec

Robert Greenwalt   commited 2013-03-22 12:00:17 -07:00
e1b73b7953
Reset connections on all stacked interfaces.
Bug: 8276725
Change-Id: I7fe99c6ea123037cef3e89e3c2c17ed43cc0b1ea

Lorenzo Colitti   commited 2013-03-20 19:22:58 +09:00
a546d7ef93
Revert of Ifd0c4081a. Turning off logging.
Found our bug, so switching the logging back off.
bug:8377625

Change-Id: I254bd83c48f1dd8dd62db1fcb162d460328169c5

Robert Greenwalt   commited 2013-03-15 20:20:11 +00:00
fa4e867061
Don't return an unmod collection.
It's not needed as people can mess with this, and people do, so this fixes the build.
bug:8398355

Change-Id: Iddd00af41009c88b67fb7f9a8789bb416c377922

Robert Greenwalt   commited 2013-03-15 11:28:50 -07:00
26ce4b57d5
Add stacked interfaces to LinkProperties.
Bug: 8276725
Change-Id: I2f592d4c690e9af0459ae742ab16107a10d89353

Lorenzo Colitti   commited 2013-03-15 14:35:32 +09:00
66e01c9f7f
Add logging to track down bug
bug:8377625
Change-Id: Ifd0c4081a2f1238dbbc39c6904b993e2fb95455a

Robert Greenwalt   commited 2013-03-13 16:38:46 -07:00
b9f53aa687
Unit test routes with interfaces in LinkProperties
Change-Id: Ie41a56bc9863ee72f4d7a8f72e436fc57e57b1af

Lorenzo Colitti   commited 2013-03-12 15:01:05 -07:00
aaacefbd89
Unbreak documentation build.
Change-Id: I1e904b111e23d221dcb5f917201d4c27f0c1c05b

Lorenzo Colitti   commited 2013-03-12 04:30:47 +09:00
ab7ad3a458
Always specify an interface for host routes.
Change-Id: I05b4d87e7d7e8237c6f4a70f1fedae00f416f581

Lorenzo Colitti   commited 2013-03-08 16:41:25 -08:00
697e1c0748
RouteInfo changes.
- Add the interface name.
- Fix a bug where a default route would match an address of
  another protocol (e.g., 0.0.0.0/0 would match 2001::).
- Tweak the hashCode method.
- Write a unit test.

Change-Id: Ida8266de440a9b1d9eaa132f182b9f1ce8978c44

Lorenzo Colitti   commited 2013-03-08 16:41:25 -08:00
0580598772
Revert "Add default route constants to RouteInfo."
This reverts commit b00860f1ad

Change-Id: Ide6d7f3b935da41477b736ef0ef20ec9872563e1

Robert Greenwalt   authored and   Android (Google) Code Review   commited 2013-03-07 20:11:18 +00:00
ddf54416c5
Add default route constants to RouteInfo.
Bug: 8276725
Change-Id: I9c3ad7393430de9275f5b1c0189a94e5a27975fc

Lorenzo Colitti   commited 2013-03-07 11:08:08 -08:00
b00860f1ad
Improve ConnectivityManager docs
Also fix some permission problems.
bug:5738328

Change-Id: Ib32c223f425b1fc03b8cce528456bcb50b540fdf

Robert Greenwalt   commited 2013-02-22 10:39:20 -08:00
26744a5f52
Improve notification UI for lockdown VPN.
Bug: 7064111
Change-Id: I9554f6a426697b4abeb2ddd0827d314920e88ed6

Jeff Sharkey   commited 2013-02-21 09:47:11 -08:00
6932ff654e
Adjust captive portal test for setup wizard
During setup wizard, perform captive portal test without the typical
delays.

Change-Id: If596948e732966817aae6201440e87e19be0c2f8

Russell Brenner   commited 2013-02-14 11:02:10 -08:00
4774b0208e
Expose roaming flag for testing.
Change-Id: I29ef6fc59926a97f4e97c561387ac9bc0e4e4769

Jeff Sharkey   commited 2013-01-03 14:07:46 -08:00
e35bff840d
Fix javadoc break
Change-Id: Ia69a5cbead61747537269e267dcd8da320d61ba3

Robert Greenwalt   commited 2012-12-07 09:56:50 -08:00
1ee3d2c33e
Refactor getPersistedNetworkPreference
Optimize for updating mNetworkPreference according to device's networkAttributes
setting from overlay config.xml when connectivityservice start.

Change-Id: I90286332d4f453038f1ddac7dd9d1265d96b4859
Signed-off-by: Jianzheng Zhou <jianzheng.zhou@freescale.com>

Jianzheng Zhou   authored and   Robert Greenwalt   commited 2012-12-06 12:00:04 -08:00
a8aa160836
Support for dns domain.
bug:6799630
Change-Id: I10070eddb65b7b60f0bc2b3e1e320e1aa4ec6e98

Robert Greenwalt   commited 2012-11-16 11:25:32 -08:00
0bc6c967cc
Remove DhcpInfoInternal
First step in accepting a set of patches.
bug:6799630

Change-Id: I6c894c60aeb3022960c2aaa45451bb1dde2b493b

Robert Greenwalt   commited 2012-11-09 09:46:32 -08:00
e110d00751
Migrate more Secure settings to Global.
Migrate networking, storage, battery, DropBox, and PackageManager
related Secure settings to Global table.

Bug: 7232014, 7231331, 7231198
Change-Id: I772c2a9586a2f708c9db95622477f235064b8f4d

Jeff Sharkey   commited 2012-09-27 16:22:53 -07:00
5eccd9c147
Captive portal handling
We now notify the user of a captive portal before switching to the network as default.
This allows background applications to continue to work until the user confirms he
wants to sign in to the captive portal.

Also, moved out captive portal handling out of wifi as a seperate component.

Change-Id: I7c7507481967e33a1afad0b4961688bd192f0d31

Irfan Sheriff   commited 2012-08-27 22:27:06 -07:00
ba8388bf7a
Always-on VPN.
Adds support for always-on VPN profiles, also called "lockdown." When
enabled, LockdownVpnTracker manages the netd firewall to prevent
unencrypted traffic from leaving the device. It creates narrow rules
to only allow traffic to the selected VPN server. When an egress
network becomes available, LockdownVpnTracker will try bringing up
the VPN connection, and will reconnect if disconnected.

ConnectivityService augments any NetworkInfo based on the lockdown
VPN status to help apps wait until the VPN is connected.

This feature requires that VPN profiles use an IP address for both
VPN server and DNS. It also blocks non-default APN access when
enabled. Waits for USER_PRESENT after boot to check KeyStore status.

Bug: 5756357
Change-Id: If615f206b1634000d78a8350a17e88bfcac8e0d0

Jeff Sharkey   commited 2012-08-27 12:35:05 -07:00
f2e722a507
Migrate legacy VPN arguments to system_server.
Generate the racoon and mtpd daemon arguments in system_server,
instead of accepting them from Settings.

Bug: 5756357
Change-Id: I42c1a644f6add477fe4222342640d7db15982cb8

Jeff Sharkey   commited 2012-08-24 11:29:58 -07:00
c2a8e40c7a
Include network type that caused broadcast.
Network type can be obtained through EXTRA_NETWORK_INFO, but offer
it as first-class extra since the returned NetworkInfo is deprecated.

Bug: 6936247
Change-Id: Ief59577afd2bd930f0f4c5650b413feef86bfbc3

Jeff Sharkey   commited 2012-08-06 11:45:01 -07:00
47905d1f1d
Network data activity change intent for network interfaces.
The activity notification is received from netd, an intent
DATA_ACTIVITY_CHANGE is then raised for other part of the system to
consume.

Change-Id: Idfcc4763c51c5b314c57f546c12557082f06bebf

Haoyu Bai   commited 2012-07-17 17:13:03 -07:00
b5da575fc7
Added or fixed doctrings for required permissions.
Bug: 6591338
Change-Id: Ia2092f9994854701b5fa1425c371817367ae07ec

Nicolas Falliere   commited 2012-06-18 17:22:34 -07:00
7842df58d0
Begin collecting xtables iface counters.
Add method to parse new iface_stat_fmt proc stats, or return null
when kernel support is unavailable. Add test and remove older, unused
parsing code. Create new "xt" recorder to persist the new xtables
counters when available.

Add SSID support to NetworkIdentity to fix policy tests.

Bug: 6422414
Change-Id: I77f70e9acb79a559ab626f3af5c4f3599801ed43

Jeff Sharkey   commited 2012-05-01 21:04:26 -07:00
5cc4da38f0
API to report if active network is metered.
Report to developers if active network is "metered" and define it
as the user being sensitive to heavy data usage.

Bug: 3001465
Change-Id: I855ca3cd3eb1de3c4814148d70ccf24957af898a

Jeff Sharkey   commited 2012-04-16 11:20:27 -07:00
d00b130332
Migrate to @Override to remove warnings.
Bug: 6303344
Change-Id: I0d33b2ed448467379d576ccd71fb5ae20c878852

Jeff Sharkey   commited 2012-04-09 10:57:21 -07:00
078d356a9b
Support metered Wi-Fi NetworkPolicy.
Add networkId field to NetworkIdentity to identify Wi-Fi networks by
SSID.  Add support for policies without usage cycles.

Only apply mobile policies when SIM state is ready, which is cleaner
than just checking for airplane mode.  Also avoids creating no-op
default policies when subscriberId is null.

Bug: 3001465, 3291052
Change-Id: I1f8aaa49a5db306df022c402ea7f3f5d4bc0cfc7

Jeff Sharkey   commited 2012-04-05 16:02:25 -07:00
2d9e5a5f9e