Commit graph android_packages_modules_Co.../core
Message SHA1
Merge "Move ApfFilter from ConnectivityService to IpManager" into nyc-dev am: 732340c
am: ebdf3f0

* commit 'ebdf3f006854b04de2508314be7ac0788b6faa99':
  Move ApfFilter from ConnectivityService to IpManager

Paul Jensen   authored and   android-build-merger   commited 2016-03-25 13:01:09 +00:00
7e35dac240
Move ApfFilter from ConnectivityService to IpManager
There's a few advantages to having ApfFilter in IpManager:
1. If things go wrong, crashing a particular transport is less bad then
   crashing ConnectivityService.  We also don't want to use
   ConnectivityService as a dumping ground for transport-specific logic.
2. This makes implementing WifiManager.MulticastLock a lot simpler and
   safer because enabling/disabling it doesn't have to go through the
   NetworkAgent, which could risk various races (e.g. installing a filter
   into the wrong WiFi network).
3. IpManager is the ultimate source for LinkProperties for a particular
   transport and since ApfFilter uses the LinkProperties it's better to
   have it closely paired with the IpManager. Likewise, ApfFilter needs
   to know the APF capabilities of the transport, so having it in
   the transport avoids having to parcel this information through the
   NetworkAgent.

Bug: 26238573
Change-Id: I99b85f2b64972f0e7572170ec5d1926081aa3429

Paul Jensen   commited 2016-03-25 07:46:07 -04:00
6b7f7a0852
Merge "Add a null check for the OnStartTetheringCallback."
Jeremy Klein   authored and   Android (Google) Code Review   commited 2016-03-23 18:52:16 +00:00
407e2a51e0
Merge "Improve NetworkCapabilities command chaining." into nyc-dev
Pierre Imai   authored and   Android (Google) Code Review   commited 2016-03-23 01:11:15 +00:00
9b71d6659d
Merge changes Iddeebeb8,Idd1e37a3 into nyc-dev
* changes:
  WifiManager: Use ConnectivityThread
  Create ConnectivityThread

Paul Stewart   authored and   Android (Google) Code Review   commited 2016-03-22 22:23:48 +00:00
e611bda1e2
Improve NetworkCapabilities command chaining.
setNetworkSpecifier() now returns this.
BUG: 26797290

Change-Id: Ia8bd0836d9ac715408eca102bf4a2d23f044fa72

Pierre Imai   commited 2016-03-22 22:29:22 +09:00
aabd22dad9
Support registering a request for the default network
Change-Id: I079f5be97b585cf5692dd4c7a144b993d168a9a5

Erik Kline   commited 2016-03-22 15:44:16 +09:00
23bf99c956
Remove framework code that calls SIOCKILLADDR
Bug: 26976388
Change-Id: I652361d9e650a77085070d6c26b28b7638ba2dfe

Lorenzo Colitti   commited 2016-03-22 12:54:32 +09:00
d8332d1a1b
Create ConnectivityThread
Create a common singleton thread to be shared among all
connectivity tasks.  Instead of launching separate threads to
handle downstream messages from the various service instances used
in connectivity, these managers can choose to share this instance.

Bug: 27695292

Change-Id: Idd1e37a3e793c5485091509c3d7351e4d29288f0

Paul Stewart   commited 2016-03-19 10:05:06 -07:00
1f6a458995
Add a null check for the OnStartTetheringCallback.
This avoids a NullPointerException when trying to call the callback
and gives a more readable error message.

Change-Id: Id0353ef541c76efcb4a9a12c082e1b6ec9389f02

Jeremy Klein   commited 2016-03-14 12:57:17 -07:00
35e99ea8ef
NetworkStats.Bucket API polish.
-Add @IntDef constants for STATE_ and ROAMING_.
-Expand docs for ROAMING_ constants.
-Use ROAMING_NO/YES instead of ROAMING_DEFAULT/ROAMING.

Bug: 27531260
Change-Id: I54ecfb4148caa549214df0bee9983036ffa4cb55

Jeff Davidson   commited 2016-03-14 11:24:12 -07:00
43e43a99c9
Have ConnectivityService install packet filters when possible
am: 9eca1f6072

* commit '9eca1f6072':
  Have ConnectivityService install packet filters when possible

Paul Jensen   authored and   android-build-merger   commited 2016-03-03 14:48:45 +00:00
1d411461ef
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
9eca1f6072
Merge changes Ic366b532,I0179b45b into nyc-dev
* changes:
  Move PinningNetworkCallback out to a new NetworkPinner class.
  Use MessageUtils in ConnectivityManager.

Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2016-03-02 04:18:03 +00:00
fd38423bd4
When system server goes down, crash apps more.
Apps making calls into the system server may end up persisting
internal state or making security decisions based on the perceived
success or failure of a call, or the default values returned.

The reality is that if the system process just died, init will be
along shortly to kill all running apps, so we should have no problem
rethrowing the RemoteException as a RuntimeException.

Bug: 27364859
Change-Id: Ife0bcb079636c88d54c44d17eb580409fd79028b

Jeff Sharkey   commited 2016-03-01 19:29:16 -07:00
c78f85ca53
Use MessageUtils in ConnectivityManager.
Change-Id: I0179b45bc54ffced8e5647d6f005b891b5de93ab

Lorenzo Colitti   commited 2016-03-01 22:57:29 +09:00
b027e6e92b
Delete all NetworkUtils DHCP-related code.
am: af0170a562

* commit 'af0170a562':
  Delete all NetworkUtils DHCP-related code.

Erik Kline   authored and   android-build-merger   commited 2016-02-22 09:16:16 +00:00
866306752b
Delete all NetworkUtils DHCP-related code.
Bug: 26991160
Change-Id: I2c74e0161f43f65c1b6a85dc9f294b64c8f1ae6e

Erik Kline   commited 2016-02-22 15:14:31 +09:00
af0170a562
Merge "Created a ACTION_RESTRICT_BACKGROUND_CHANGED intent."
Felipe Leme   authored and   Android (Google) Code Review   commited 2016-02-02 23:59:30 +00:00
e6303009b0
Created a ACTION_RESTRICT_BACKGROUND_CHANGED intent.
This intent will be broadcasted when:

- Global restrict background setting is changed (sent to all packages)
- An individual uid is added to or removed from the whitelist (sent just
  to the packages belonging to that uid).

This intent is only sent to registered receivers.

BUG: 26451391
Change-Id: Ic0a5771f88baa52076ad04764f29098a386463cc

Felipe Leme   commited 2016-01-28 13:28:11 -08:00
d34c9af3e2
Merge "Allow NetworkFactories to match any network specifier on a request" into mm-wireless-dev
am: 9c28a90451

* commit '9c28a90451':
  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
e2131c4d88
Merge "Allow NetworkFactories to match any network specifier on a request" into mm-wireless-dev
Etan Cohen   authored and   Android Partner Code Review   commited 2016-01-28 18:20:09 +00:00
9c28a90451
Merge changes from topic '2016 GPS Changes'
* changes:
  Framework support to read newly added fields
  Added an API to query GPS hardware version info
  GPS Measurement and Navigation APIs go public
  Supported GNSS multi-constellation in frameworks

Lifu Tang   authored and   Android (Google) Code Review   commited 2016-01-28 02:02:17 +00:00
4cbe078ac0
Unhiding MSIM APIs.
1. Unhide MSIM APIs in TelephonyManager that already have non-MSIM equivalent
   APIs public.
2. Make MSIM API naming consistent (overloaded, no suffix).
3. Unhide APIs in SubscriptionManager that are necessary for MSIM.

Bug: 26772894
Change-Id: Ibebab7379ea79c8e4812bbd190342827048e30e2

Shishir Agrawal   commited 2016-01-26 13:47:27 -08:00
35759f9151
DO NOT MERGE : Unhiding MSIM APIs.
1. Unhide MSIM APIs in TelephonyManager that already have non-MSIM equivalent
   APIs public.
2. Make MSIM API naming consistent (overloaded, no suffix).
3. Unhide APIs in SubscriptionManager that are necessary for MSIM.

Bug: 26772894
Change-Id: Ibebab7379ea79c8e4812bbd190342827048e30e2

Shishir Agrawal   commited 2016-01-26 09:29:24 -08:00
77d691763f
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
3dabcb9434
Supported GNSS multi-constellation in frameworks
Change-Id: I82574afd3697c47e806d2cfaedc33756d0353b73

Lifu Tang   commited 2016-01-25 15:15:14 -08:00
0a922fd0db
Fixed RestrictBackgroundStatus signature by adding @hide.
BUG: 26082535
Change-Id: I2e4b63327a8f791db01ee0c1ab090557170857fa

Felipe Leme   commited 2016-01-25 12:09:03 -08:00
7e4c185b15
Created new public API so applications can customize its metered network
usage while running in background.

The new API is 'int getRestrictBackgroundStatus()' and returns the
following values:

 - RESTRICT_BACKGROUND_STATUS_DISABLED: no restrictions
 - RESTRICT_BACKGROUND_STATUS_WHITELISTED: restriction but app is
   whitelisted
 - RESTRICT_BACKGROUND_STATUS_ENABLED: full restriction

The proper way to interprete these values for using metered networks
while running on background is:

 - When disabled, there is no restriction and the application could use the
   metered networks freely.

 - When whitelisted, the application can use the metered network, but should try
   to minimize the usage.

 - When enabled, the application should not try to use metered networks at
   all, since the usage will be denied.

BUG: 26451391
Change-Id: If07d42bb88e4c02802df0234861f38aef2cfead7

Felipe Leme   commited 2016-01-22 10:50:11 -08:00
3051135227
Merge "Implement roaming tracking in NetworkStats summary queries."
Jeff Davidson   authored and   Android (Google) Code Review   commited 2016-01-20 01:43:02 +00:00
d6c5e33f82
Implement roaming tracking in NetworkStats summary queries.
Whether a network is deemed roaming or not was already being tracked
as part of the NetworkIdentitySet, so the underlying data store
already tracks roaming and native data separately. However, this data
was being aggregated together in NetworkStatsCollection#getSummary,
since the NetworkIdentitySet is converted to an iface name for the
purposes of matching, and the iface name will be identical whether or
not the iface is considered roaming. Now it is separated.

Also fixes a long-standing bug in NetworkIdentitySet where an identity
read from a saved file would always be considered roaming == false,
even if it wasn't at the time it was written.

Bug: 25813438
Change-Id: I11ab5b51182ed8da7af8fde468df065f9fdc3dad

Jeff Davidson   commited 2016-01-19 16:57:51 -08:00
2fd68b3a3e
Merge "Always-on app VPNs"
Robin Lee   authored and   Android (Google) Code Review   commited 2016-01-14 11:37:18 +00:00
e7a3e95319
Always-on app VPNs
Bug: 22547950
Change-Id: I46b204170bfac58d944f39b22f815b080de71a58

Robin Lee   commited 2016-01-12 19:54:54 +00:00
e5d5ed5872
Merge "Makes captive portal server calculation in one place."
Udam Saini   authored and   Android (Google) Code Review   commited 2016-01-12 18:40:45 +00:00
bc61def71d
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
cd6454606c
Add a TETHER_PRIVILEGED permission and use it where needed.
BUG: 26247383
Change-Id: I73f7227d77926faa9081e83eccb83c8ddee33e08

Jeremy Klein   commited 2016-01-07 10:11:24 -08:00
434835af8b
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
9786d92050
DO NOT MERGE Hotspot 2.0 relase 2 first cut.
CP mods to take a URL as a parameter, and new ScanInfo object.

Cherry-picked from 032e267212
Change-Id: Idbb2d4751c575ba07a56942771e2b2955b624635

Jan Nordqvist   authored and   Randy Pan   commited 2015-12-10 16:06:50 -08:00
6e0af2ced5
Don't match network requests to legacy API requests.
Currently, we look at network requests that are created by the
current requestNetwork API to see if they look like requests
that could have been created using the legacy
startUsingNetworkFeature API.

This causes those networks to be added to LegacyTypeTracker,
and so cause CONNECTIVITY_ACTION broadcasts, be accessible
using getNetworkInfo(int type), etc. This was done in the L
timeframe so that apps could request networks using the
then-new requestNetwork APIs and still use them using legacy
APIs such as requestRouteToHost.

However, the resulting CONNECTIVITY_ACTION broadcasts are
expensive. requestRouteToHost has been deprecated since L, and
mixing the old and new APIs was never recommended, so it's time
to delete this hack.

Bug: 22513439
Bug: 23350688
Bug: 25295964
Change-Id: Id867058446e5ee44396743d126d26fa57da0c990

Lorenzo Colitti   commited 2015-11-27 11:46:19 +09:00
4acc378b5e
Merge "Fix javadoc for the NetworkRequest version of requestNetwork."
Lorenzo Colitti   authored and   Android (Google) Code Review   commited 2015-11-26 08:16:51 +00:00
3999ca3d84
Fix javadoc for the NetworkRequest version of requestNetwork.
The documentation for this method says that the request can be
released using releaseNetworkRequest, but that's not true.
releaseNetworkRequest only takes a PendingIntent, and can only be
used to release a request filed with a PendingIntent.

Fix the docs to say that the request needs to be released using
unregisterNetworkCallback.

Change-Id: If044fd2d463ab8d09874172d5d56946251057a3c

Lorenzo Colitti   commited 2015-11-26 17:06:20 +09:00
5a97ed19a8
Make the new NetworkRequest flavour consistent with the others.
Change-Id: I491eb0b6d2fa0f1c472c97ef403488407e71803e

Lorenzo Colitti   commited 2015-11-25 15:47:14 +09:00
318e8eec0e
Temporarily add a requestNetwork flavour that takes a legacy type
This method is public @hide to support progressive refactoring of
tethering away from startUsingNetworkFeature to requestNetwork,
without getting in the way of the CONNECTIVITY_ACTION cleanup in
b/22513439 .

Bug: 9580643
Bug: 22513439
Change-Id: I9053ec746cc8f415a2d5849f044667eeb14e1b19

Lorenzo Colitti   commited 2015-11-25 12:00:52 +09:00
6653c4dc9c
Also treat loss of IPv6 as a loss of provisioning.
Bug: 23226635
Change-Id: Icebb7d83ed5b3b796901b9f023909a02eb461941

Erik Kline   commited 2015-10-27 17:11:27 +09:00
aa8f8f33b5
Merge "Reinstate CHANGE_NETWORK_STATE as a normal permission." into mnc-dr-dev am: 809dcade99 am: bdc458048a am: bb8f652372
am: 550cc7cfd2

* commit '550cc7cfd2':
  Reinstate CHANGE_NETWORK_STATE as a normal permission.

Lorenzo Colitti   authored and   android-build-merger   commited 2015-10-22 06:33:09 +00:00
44e6ace9c3
Merge "Reinstate CHANGE_NETWORK_STATE as a normal permission." into mnc-dr-dev am: 809dcade99 am: bdc458048a
am: bb8f652372

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

Lorenzo Colitti   authored and   android-build-merger   commited 2015-10-22 06:28:24 +00:00
550cc7cfd2
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
0b40c87afc
Add a null check to hasIPv4AddressOnInterface.
Change-Id: Ie38505ec0a93f4060348d92db341c536b7d60ed0

Lorenzo Colitti   commited 2015-10-09 12:36:30 +09:00
28bb16c366
am 9653a1d4: am 830ed7c8: resolved conflicts for a884d81e to stage-aosp-master
* commit '9653a1d4b1':
  constify JNINativeMethod function pointer tables

Elliott Hughes   authored and   Android Git Automerger   commited 2015-09-24 17:23:00 +00:00
10b521a490
am 830ed7c8: resolved conflicts for a884d81e to stage-aosp-master
* commit '830ed7c82f':
  constify JNINativeMethod function pointer tables

Elliott Hughes   authored and   Android Git Automerger   commited 2015-09-24 17:14:10 +00:00
9653a1d4b1