3231 Commits

Author SHA1 Message Date
Tobias Thierer
4bd017d6a5 frameworks/base: Avoid Long object allocations in Long.valueOf()
Replace usages where the Long is immediately unboxed or thrown
away with Long.parseLong().
In TaskRecord.java, I also fixed up similar uses of
{Boolean,Integer}.valueOf()

Tested: built frameworks/base successfully.

Bug: 28289401
Change-Id: I1fad536853a68c7b0707cbf02989aca155064843
2016-04-21 16:23:56 +01:00
Stephen Hines
8a49cf4cae Merge "Fix some errors in errorCalculator.rs." 2016-03-10 22:46:22 +00:00
Stephen Hines
74be0c9b43 Fix some errors in errorCalculator.rs.
Bug: http://b/26987366

This code was accidentally casting a uchar4 to a single integer, which
the latest llvm-rs-cc will flag as an error. The comparison was also
incorrectly using a single integer comparison, instead of looking at all
4 uchar vector components.

Change-Id: Id680d642cb0079461429f3910343c6dbe8d488ef
2016-03-09 16:42:40 -08:00
Stephen Hines
8272a345ec Merge "Remove graphics-related RenderScript tests."
am: 766e20506c

* commit '766e20506c85fef052b3dec668c079a1ad9b9eb2':
  Remove graphics-related RenderScript tests.
2016-01-07 22:05:13 +00:00
Stephen Hines
766e20506c Merge "Remove graphics-related RenderScript tests." 2016-01-07 21:57:21 +00:00
Chad Brubaker
15ea45c848 Merge "Check for null hostnames in RootTrustManager"
am: 49ce7dc2ba

* commit '49ce7dc2baa9ee867fc7b78301c65fab2168a9b2':
  Check for null hostnames in RootTrustManager
2015-12-14 11:55:05 -08:00
Chad Brubaker
49ce7dc2ba Merge "Check for null hostnames in RootTrustManager" 2015-12-14 19:30:44 +00:00
Chad Brubaker
dd586a46c9 Check for null hostnames in RootTrustManager
Even if the hostname aware method is called if the hostname is null then
the destination is unknown and the configuration can be ambiguous.

Change-Id: I7cacbd57a42604933fdc882371f143dc0a20902d
2015-12-10 18:32:40 -08:00
Chad Brubaker
f1870eee34 Merge "Expose findByIssuerAndSignature"
am: b27d820920

* commit 'b27d8209206e0aad76a257636417341c6f69fbb5':
  Expose findByIssuerAndSignature
2015-12-09 21:05:50 +00:00
Stephen Hines
b029bfbf4c Remove graphics-related RenderScript tests.
Bug: http://b/25497185

These APIs have been deprecated for quite some time, and it makes sense
to remove the obsolete tests.

Change-Id: Ief413633c49b304042e191fbc200901bf9a794ad
2015-12-09 11:03:38 -08:00
Chad Brubaker
bb670fc3ea Merge "Expose findTrustAnchorBySubjectAndPublicKey" am: 6fea66116c
am: 3c096b3a88

* commit '3c096b3a88617aa21bcb5cd1e496760f5898dd34':
  Expose findTrustAnchorBySubjectAndPublicKey
2015-12-01 20:27:47 +00:00
Chad Brubaker
fa9beebb83 Expose findByIssuerAndSignature
This will be used to create a custom conscrypt TrustedCertificateStore
to avoid loading all of the trusted certificates into memory in a
keystore.

Change-Id: Iaf54b691393ecadae6c7ff56b8adc6a2a2923d29
2015-12-01 12:19:39 -08:00
Chad Brubaker
d3af962081 Expose findTrustAnchorBySubjectAndPublicKey
This allows for faster lookups of TrustAnchors when checking pin
overrides without needing to iterate over all certificates.

Currently only the system and user trusted certificate store are
optimized to avoid reading the entire source before doing the trust
anchor lookup, improvements to the resource source will come in a later
commit.

This also refactors System/UserCertificateSource to avoid code
duplication.

Change-Id: Ice00c5e047140f3d102306937556b761faaf0d0e
2015-11-30 17:20:00 -08:00
Kevin Neas
28c7363e8d Merge "DO NOT MERGE. Cherrypick UiBench from Master" into cw-e-dev am: 4dbb586585 am: b6ae32162e
am: 32a7d85f64

* commit '32a7d85f64a193745de81ee94b7b4d7adefb3f02':
  DO NOT MERGE. Cherrypick UiBench from Master
2015-11-24 02:54:07 +00:00
Stephen Hines
7ea808b177 Merge "Remove unsupported RS graphics API tests." 2015-11-17 22:16:35 +00:00
Kevin Neas
0972c26243 DO NOT MERGE. Cherrypick UiBench from Master
UiBench apk for Jank tests for Emerald

Change-Id: Ib58a2b8ff76b18b9c41cbd513c8a16571b7a37a0
2015-11-13 01:09:58 +00:00
Chad Brubaker
5a1078f40d Add NetworkSecurityConfigProvider
Change-Id: I321e3ca94cc2a8d5e0e5d82a83b255ff5b8a71d2
2015-11-11 10:54:54 -08:00
Chad Brubaker
08d36202da Add support for debug-overrides configuration
Debug overrides are only used if the application is debuggable in
order to help local debugging and development by trusting additional
CAs. In a non-debuggable version of the application the debug-overrides
are ignored.

Trust anchors in the debug override configuration have two key
differences from those in base-config and domain-config:
1) trust anchors in the debug-overrides are trusted for all connections
in addition to any trust anchors included in the relevant base/domain
configs.
2) By default trust anchors in the debug config override pins, as their
purpose is for connecting to non-standard servers for debugging and
testing and those servers should not be pinned in the production
configuration.

Change-Id: I15ee98eae182be0ffaa49b06bc5e1c6c3d22baee
2015-11-10 12:40:00 -08:00
Chad Brubaker
bd173c28fc Support nested domain-config elements
Nested domain-config inherit unset parameters from the domain-config
they are nested in. This helps avoid copy and pasted configs that are
almost the same except a few minor differences for a domain with
slightly different requirements.

For example: Consider a domain-config for example.com that, among other
settings, does not enforce hsts. Now if you want the rules for
example.com to apply to secure.example.com except that hsts _is_
enforced you can make a nested domain-config for secure.example.com
under example.com that sets hstsEnforced="true" and nothing else.

Change-Id: I9e33f7e62127fd7f4f15c3560fff2f2626477bd4
2015-11-07 13:31:04 -08:00
Chad Brubaker
5f96702f58 Add xml source for network security configuration
XmlConfigSource parses an ApplicationConfig from an xml resource.
Currently this supports app-wide default configuration via the
base-config element, per domain via the domain-config element and
inheritance of unset properties at parse time.

Inheritance of unset properties is currently only:
domain-config -> base-config -> platform default configuration
Where the most specific value is used.
For example: If the base-config specifies trust anchors, all connections
will use those anchors except for connections to a domain which has a
domain-config that specifies trust anchors, in which case the
domain-config's trust anchors will be used. If the domain-config or
base-config don't set trust anchors, or don't exist, then the platform
default trust anchors will be used.

Nested domain-config entries, debug-overrides, and thorough
documentation of the xml format will follow in later commits.

Change-Id: I1232ff1e8079a81b340bc12e142f0889f6947aa0
2015-11-06 22:24:01 -08:00
Chad Brubaker
7e98f2e697 Merge "Use a builder for NetworkSecurityConfig" 2015-11-06 20:21:29 +00:00
Chad Brubaker
80a73f5939 Use a builder for NetworkSecurityConfig
The builder supports all the standard builder set* methods as well as
setting a parent builder to use when values are not set (recursively).
This allows us to have a level of inheretence in configurations without
complicating the lookup and trust checking logic by doing inheretence
when building the configs.

Change-Id: I054af83451e52761227479eadf9cb9803437505f
2015-11-05 12:50:30 -08:00
Chad Brubaker
8c35820720 Merge "Add initial network security config implementation" 2015-11-05 18:46:24 +00:00
Stephen Hines
eebe899f5d Remove unsupported RS graphics API tests.
Bug: 25497185

These tests all use deprecated graphics APIs along with unsupported
pragmas. Removing them first will make our pragma cleanup simpler.

Change-Id: Icd0f2690d79dd8deb709724b47607483d6e3dea2
2015-11-05 10:31:10 -08:00
Chad Brubaker
6bc1e3966c Add initial network security config implementation
Initial implementation of a unified application wide static
network security configuration.

This currently encompases:
* Trust decisions such as what trust anchors to use as well as static
  certificate pinning.
* Policy on what to do with cleartext traffic.

In order to prevent issues due to interplay of various components in an
application and their potentially different security requirements
configuration can be specified at a per-domain granularity in addition
to application wide defaults.

This change contains the internal data structures and trust management
code, hooking these up in application startup will come in a future
commit.

Change-Id: I53ce5ba510a4221d58839e61713262a8f4c6699c
2015-11-04 14:31:18 -08:00
Jorim Jaggi
c594e9354a am f9f9999d: am b7b9b31f: am ad26dc5f: Merge "Deliver camera launch source for analytics" into mnc-dr-dev
* commit 'f9f9999d3245dffc8463a1f3f5f74dc900aa0196':
  Deliver camera launch source for analytics
2015-09-25 18:07:52 +00:00
Jorim Jaggi
40aa8811bc Deliver camera launch source for analytics
Bug: 24304031
Change-Id: I606bccf4b62b651e17c6e6d9472648deeab703da
2015-09-24 16:32:09 -07:00
Dianne Hackborn
564e87a36f am 1058bf0f: am e2fd2850: am 9e398eb5: am 81f3a85a: Merge "Fix issue #22940169: "pm grant" can no longer grant permissions..." into mnc-dev
* commit '1058bf0f998ad07c94ac0ba6ee22c3c484cc7821':
  Fix issue #22940169: "pm grant" can no longer grant permissions...
2015-08-14 17:35:22 +00:00
Dianne Hackborn
3ffc0f1e81 am 81f3a85a: Merge "Fix issue #22940169: "pm grant" can no longer grant permissions..." into mnc-dev
* commit '81f3a85aa29d83ed1a5de4de1006587d375a1c77':
  Fix issue #22940169: "pm grant" can no longer grant permissions...
2015-08-14 17:15:10 +00:00
Dianne Hackborn
9f5b0a2735 Fix issue #22940169: "pm grant" can no longer grant permissions...
...with protection flag PROTECTION_FLAG_DEVELOPMENT

Bring back the old grant/revoke code for development permissions.

Also some more dumpsys output to help debugging.

And new dumpsys command for checking a permission.

Change-Id: I6e27e62a9ca5ec1ecc0f102714a448ea02f0f41c
2015-08-13 18:25:20 -07:00
Dianne Hackborn
b44cdfdd10 am afacdbe1: am 09e77852: am 5cf89a01: am b2b02092: Merge "Fix issue #23037899: Support for Battery Optimization permission + Dialog" into mnc-dev
* commit 'afacdbe1e824845917d038a5848ae515d44393bb':
  Fix issue #23037899: Support for Battery Optimization permission + Dialog
2015-08-11 00:42:58 +00:00
Dianne Hackborn
919e7cad27 am b2b02092: Merge "Fix issue #23037899: Support for Battery Optimization permission + Dialog" into mnc-dev
* commit 'b2b020922fb51b88d34a6478209fc232702de318':
  Fix issue #23037899: Support for Battery Optimization permission + Dialog
2015-08-11 00:22:58 +00:00
Dianne Hackborn
c7b57b1e65 Fix issue #23037899: Support for Battery Optimization permission + Dialog
New permission, new Intent action.

Change-Id: I1d9ba55be8f72074e29d33ad7a0a12a820bbac39
2015-08-10 14:52:52 -07:00
Dianne Hackborn
6835ef095a am d9b0f843: Merge "Fix issue #22860466: viapi security bug - rubber stamping in nested VIs" into mnc-dev
* commit 'd9b0f8435ba9b099512288729af24858a95fd013':
  Fix issue #22860466: viapi security bug - rubber stamping in nested VIs
2015-08-04 03:10:41 +00:00
Dianne Hackborn
d4b8064e42 am 14bafef5: am 24922798: am b20a8ed9: am d9b0f843: Merge "Fix issue #22860466: viapi security bug - rubber stamping in nested VIs" into mnc-dev
* commit '14bafef5b050f14c0fed3bfed8b137862139e627':
  Fix issue #22860466: viapi security bug - rubber stamping in nested VIs
2015-08-04 01:37:57 +00:00
Dianne Hackborn
fb81d09d35 Fix issue #22860466: viapi security bug - rubber stamping in nested VIs
Add new Activity.isVoiceInteractionRoot() API that an activity can use
to determine whether it is the root activity of a voice interaction
session started by the user's designated voice interaction service.

This is a special new API that apps must explicitly check, because as
with visual activities the model behind an activity should usually be
that it accomplishes its task by interacting with the user (implicitly
getting their approval) rather than trusting that whoever invoked it
is telling it to do what the user once.  In the voice world, however,
there are some cases where quick interactions want to allow for immediate
execution without further user involvement, so this API allows for that
without opening up security holes from other applications.

Change-Id: Ie02d2458f16cb0b12af825641bcf8beaf086931b
2015-08-03 17:33:38 -07:00
Dianne Hackborn
2b38a45bf3 am 44ffe9cb: am cba2c596: am 6aa0843e: am fb68b0ad: Merge "Fix issue #21895842: Add is_assist_blocked to assist.ViewNode.NodeProperties" into mnc-dev
* commit '44ffe9cb33b0ec51d411b7413d222ab251777529':
  Fix issue #21895842: Add is_assist_blocked to assist.ViewNode.NodeProperties
2015-08-01 17:05:39 +00:00
Dianne Hackborn
e3047ddcce am fb68b0ad: Merge "Fix issue #21895842: Add is_assist_blocked to assist.ViewNode.NodeProperties" into mnc-dev
* commit 'fb68b0ad344edbba15b961dc444cb24dcfc29995':
  Fix issue #21895842: Add is_assist_blocked to assist.ViewNode.NodeProperties
2015-07-31 22:36:46 +00:00
Dianne Hackborn
afb308d651 Fix issue #21895842: Add is_assist_blocked to assist.ViewNode.NodeProperties
Change-Id: I928882d42d0546cc6a12e803d96131beaba76d4e
2015-07-31 13:10:55 -07:00
Dianne Hackborn
0091e2c03d am 639fd0e9: am 025a5dc6: am 108f5493: am 3551a59b: Merge "Work on issue #21516866: Implement voice interaction in ResolverActivity" into mnc-dev
* commit '639fd0e9d8ecb59f8d15b3f1e5ec7a6ae6cc3161':
  Work on issue #21516866: Implement voice interaction in ResolverActivity
2015-07-28 21:03:15 +00:00
Dianne Hackborn
8b679bfa36 am 3551a59b: Merge "Work on issue #21516866: Implement voice interaction in ResolverActivity" into mnc-dev
* commit '3551a59b277fd4dc924f48116c153a50fb0913eb':
  Work on issue #21516866: Implement voice interaction in ResolverActivity
2015-07-28 19:58:52 +00:00
Dianne Hackborn
57dd737443 Work on issue #21516866: Implement voice interaction in ResolverActivity
The main change here is to not allow the dialog to go in to its "focus
on the last app the user selected" when running in voice interaction mode,
instead just always giving a simple list.

This also fixes some problems with cleaning up active commands when
an activity finishes and not forcing the current session to go away
when the screen is turned off.

Also added some debug help, having activity print the state of the
voice interactor.

Change-Id: Ifebee9c74d78398a730a280bb4970f47789dadf5
2015-07-28 12:52:11 -07:00
Jorim Jaggi
f30c5f5618 am 93a25f77: am fba92611: am fcf9acb9: am 20df6234: Merge "Add callback to voice interaction session for lockscreen shown" into mnc-dev
* commit '93a25f77bb4b4aeb7b3a1313fe3117f4c9781dc8':
  Add callback to voice interaction session for lockscreen shown
2015-07-23 21:48:48 +00:00
Jorim Jaggi
3bda57a05f am 20df6234: Merge "Add callback to voice interaction session for lockscreen shown" into mnc-dev
* commit '20df62345910ad390a3bb321990987757db0831d':
  Add callback to voice interaction session for lockscreen shown
2015-07-22 20:17:14 +00:00
Jorim Jaggi
20df623459 Merge "Add callback to voice interaction session for lockscreen shown" into mnc-dev 2015-07-21 22:46:30 +00:00
Jorim Jaggi
19695d9711 Add callback to voice interaction session for lockscreen shown
Bug: 22402726
Change-Id: Iaf83e2f2b0389d74b6ecf480aa91a34443803f7b
2015-07-21 12:35:16 -07:00
Jorim Jaggi
b3d17db144 am 997ebda4: am 4cb9ccc7: am c0469f99: am 55786e11: Merge "Test app to emit all AccessibilityEvents to logcat." into mnc-dev
* commit '997ebda43513dbb6da7ddeb54d3eb2a972ed2e1f':
  Test app to emit all AccessibilityEvents to logcat.
2015-07-21 00:37:38 +00:00
Jorim Jaggi
1bc4330209 am 55786e11: Merge "Test app to emit all AccessibilityEvents to logcat." into mnc-dev
* commit '55786e1164d522d878d1f493c30330669b1fd868':
  Test app to emit all AccessibilityEvents to logcat.
2015-07-20 23:57:15 +00:00
Jorim Jaggi
55786e1164 Merge "Test app to emit all AccessibilityEvents to logcat." into mnc-dev 2015-07-20 23:43:51 +00:00
Dianne Hackborn
01fda52778 am ed3b4253: am 5cdc7f04: am 3aefa438: am 78ead58d: Merge "Fix issue #22531747: Assist info should declare if user has disabled..." into mnc-dev
* commit 'ed3b42539a4d883533177d008c7ffb2a58e50af6':
  Fix issue #22531747: Assist info should declare if user has disabled...
2015-07-20 20:42:32 +00:00