Commit graph android_packages_modules_Co.../core/java/android
Message SHA1
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 "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
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
Hotspot 2.0 relase 2 first cut.
CP mods to take a URL as a parameter, and new ScanInfo object.

Change-Id: Idbb2d4751c575ba07a56942771e2b2955b624635

Jan Nordqvist   commited 2015-09-22 17:24:22 -07:00
032e267212
Add an error code for generic hardware error.
This is necessary because currently the wifi code just returns
whatever hardware-specific integer it gets back from the HAL,
which is bad because that will be interpreted by the caller as
one of the error codes defined in this class.

In parallel we'll also modify the wifi code to return this new
error code if the hardware returns an error.

Bug: 21405946
Change-Id: Ic9fa1193ced69a4e7ff543e397221c89b10a5a13

Lorenzo Colitti   commited 2015-09-09 00:16:57 +09:00
723f82f17f
Cut down some logs.
bug:23623327
Change-Id: I737d4e6c384bf4da62c65ad2abe0c9b5dca0067a

Robert Greenwalt   commited 2015-09-03 17:53:42 -07:00
72877c2493
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
6803efe7ee
am e3bcde94: Merge "Reduce CONNECTIVITY_CHANGE bcasts" into mnc-dev
* commit 'e3bcde94caf8440d5e3958a340b3d276d03f7691':
  Reduce CONNECTIVITY_CHANGE bcasts

Robert Greenwalt   authored and   Android Git Automerger   commited 2015-08-28 21:36:39 +00:00
325c15dfe3
Reduce CONNECTIVITY_CHANGE bcasts
If an app uses the new api (requestNetwork) to bring up MMS, don't
mark it as a legacy request.  This was done because the messaging
service had to use a combination of new API and old
(requestRouteToHost) due to api problems.  This has been resolved
so don't mark these as legacy requests anymore.

The general stuff is still in for other types due to lack of testing
time but this should be removed altogether in the future.

bug:23350688
Change-Id: I41c27efb253c39d8af1357ae7916ed5315c716db

Robert Greenwalt   commited 2015-08-28 12:37:54 -07:00
1bb9827d76
am 11e84bde: Merge "Don\'t mark NetworkRequests restricted when they don\'t have restricted caps" into mnc-dev
* commit '11e84bde9e98cb4b777a67208989d259883e9375':
  Don't mark NetworkRequests restricted when they don't have restricted caps

Lorenzo Colitti   authored and   Android Git Automerger   commited 2015-08-19 20:54:48 +00:00
3e4966ed21
Don't mark NetworkRequests restricted when they don't have restricted caps
Requests without NET_CAPABILITIES_INTERNET and just the default network
capabilities should not be marked restricted.  Without this fix apps
can hit permissions exceptions if they inadvertently make requests
without NET_CAPABILITIES_INTERNET.

Bug:23164917
Change-Id: I4c7136821315bcb05dfc42ffbc505a5d4f6109e6

Paul Jensen   commited 2015-08-19 11:08:38 -04:00
5d87922526
am 0ed58c3f: Merge "Bug: 21588539 Move CHANGE_NETWORK_STATE to be in SYSTEM_SETTINGS" into mnc-dev
* commit '0ed58c3f00':
  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
a0984c71a1
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
0ed58c3f00
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
ce3f9dc328
resolved conflicts for merge of f5b01767 to mnc-dr-dev
Change-Id: I3a8624b2b375e0d174983d7690082e0e6932c4de

Paul Jensen   commited 2015-08-05 07:07:24 -04:00
4f74dbe114
Merge "Fix NOT_RESTRICTED network capability and enforce it." into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-08-05 10:03:47 +00:00
f5b0176786
Fix NOT_RESTRICTED network capability and enforce it.
With this change:
1. NOT_RESTRICTED should be removed from NetworkRequests that bring up
   special restricted carrier networks (e.g. IMS, FOTA).
2. NetworkRequests without NOT_RESTRICTED require CONNECTIVITY_INTERNAL
   permission to register
3. Binding sockets to networks without NOT_RESTRICTED requires
   CONNECTIVITY_INTERNAL permission

Bug:21637535
Change-Id: I5991d39facaa6b690e969fe15dcbeec52e918321

Paul Jensen   commited 2015-08-04 07:24:24 -04:00
1b2d980e40
am 18c1d830: Fix build.
* commit '18c1d8301d':
  Fix build.

Dianne Hackborn   authored and   Android Git Automerger   commited 2015-07-31 19:42:24 +00:00
34300e4bd4
Fix build.
Change-Id: Icdf6fa14e53a1c030d0d90205d3bf2d7610b6196

Dianne Hackborn   commited 2015-07-31 10:35:34 -07:00
18c1d8301d
am 4024ad11: Merge "Stop supporting legacy ConnectivityManager routing methods in M." into mnc-dev
* commit '4024ad1198':
  Stop supporting legacy ConnectivityManager routing methods in M.

Lorenzo Colitti   authored and   Android Git Automerger   commited 2015-07-31 05:24:49 +00:00
25c1e480f5
Stop supporting legacy ConnectivityManager routing methods in M.
The methods startUsingNetworkFeature, stopUsingNetworkFeature and
requestRouteToHost were @removed in all the M preview builds, but
internal and external developers have noted that this imposes
additional burden for applications that need to work across
multiple platform versions because it causes compile-time errors.

We switched from @removed back to @deprecated to avoid these
problems. In order to effectively deprecate these methods, which
are error-prone and insecure, make them throw
UnsupportedOperationException if the app's target SDK is M or
above.

Because there are still one or two places in system code that use
these APIs, exempt Process.SYSTEM_UID and the OMA-DM client from
the check for now.

Bug: 22728205
Change-Id: I790bd32f3aa8067cbb625962a209bb9232f4b58c

Lorenzo Colitti   commited 2015-07-31 11:08:27 +09:00
2780e4bc0b
am 13156c7d: Merge "Fix missing onLost NetworkCallbacks when network loses capability" into mnc-dev
* commit '13156c7d07':
  Fix missing onLost NetworkCallbacks when network loses capability

Paul Jensen   authored and   Android Git Automerger   commited 2015-07-30 02:20:49 +00:00
6995b9e586
Merge "Fix missing onLost NetworkCallbacks when network loses capability" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-07-30 02:10:50 +00:00
13156c7d07
resolved conflicts for merge of 2813d5ba to mnc-dr-dev
Change-Id: I8b33797528f16596f0d350ad38458baa51fcacf6

Paul Jensen   commited 2015-07-29 11:31:53 -04:00
bbfacbbc96
Merge "Disable WiFi autojoin when user decides via "Stay connected?" dialog" into mnc-dev
Paul Jensen   authored and   Android (Google) Code Review   commited 2015-07-29 13:52:02 +00:00
2813d5ba39
am f5a934b6: Merge "Un-remove legacy ConnectivityManager API." into mnc-dev
* commit 'f5a934b60c':
  Un-remove legacy ConnectivityManager API.

Robert Greenwalt   authored and   Android Git Automerger   commited 2015-07-28 19:57:31 +00:00
91892f5524
Merge "Un-remove legacy ConnectivityManager API." into mnc-dev
Robert Greenwalt   authored and   Android (Google) Code Review   commited 2015-07-28 19:39:48 +00:00
f5a934b60c
Un-remove legacy ConnectivityManager API.
These were @removed too soon.  We need to keep them @deprecated until
the bulk of devices support the new API and then we can remove them.

bug:22728205
Change-Id: If1b46ff1878f1778517624112b195c461645ddd1

Robert Greenwalt   commited 2015-07-28 11:41:31 -07:00
8c160a7614