212087 Commits

Author SHA1 Message Date
Chad Brubaker
690b5f6c0a Merge "Dedupe trust anchors" 2015-11-17 18:51:38 +00:00
Eino-Ville Talvala
9574e58027 Merge "Don't use timestamps with all zero" 2015-11-17 01:55:38 +00:00
Alex Klyubin
887d348d7e Merge "Insert Android Keystore JCA Provider at the correct position." 2015-11-16 20:14:43 +00:00
Alex Klyubin
8e028e6507 Insert Android Keystore JCA Provider at the correct position.
Security.insertProviderAt uses 1-based positions whereas the
AndroidKeyStoreProvider.install code was incorrectly passing in
0-based positions, thus installing the AndroidKeyStoreBCWorkaround
provider one level higher than intended. This change fixes the issue
in AndroidKeyStoreProvider.

Bug: 25399691
Change-Id: I4a66bf37c0d151edb9a2349db9d91939064c0574
2015-11-16 10:11:50 -08:00
Mark Salyzyn
3c54ed00f3 Merge "Revert "jni: is loggable speedup, not within signal"" 2015-11-16 16:30:57 +00:00
Mark Salyzyn
421d434818 Revert "jni: is loggable speedup, not within signal"
This reverts commit c954fde0b6e31ec99509faf0bbc33c4c9e4d012a.

Bug: 25693940
Change-Id: I568051aad39e215d677318cd5758962e562187ef
2015-11-16 16:26:44 +00:00
Calin Juravle
360e95a90d Merge "Remove obsolete profile handling from AndroidRuntime." 2015-11-16 11:08:06 +00:00
Yang Ni
c011ffd842 Merge "Various fixes in setting globals in a script group" 2015-11-13 21:11:25 +00:00
Yang Ni
263cc90345 Various fixes in setting globals in a script group
Bug: 25602504

1) Passing floating point values into a script group was broken,
since they were casted to long values. Fixed that in the frameworks
implementation by taking the raw bits instead.

2) Passing 64-bit values into a script group was broken on 32-bit
platforms, since they were casted to pointer-sized integers
(uintptr_t) in the JNI code. Fixed that by casting to int64_t
instead.

3) Setting global variables of Allocation type in a script group was
broken. The special size value -1 was used to indicate the value is an
Allocation. However, size was casted to size_t in the JNI code.
Fixed that by using signed integers.

Change-Id: Ifff099a76be7707df7b67c388395f5a00f9cae66
2015-11-13 10:00:12 -08:00
Mark Salyzyn
96e780c99c Merge "jni: is loggable speedup, not within signal" 2015-11-13 15:16:48 +00:00
Michal Piechowski
43b0a458ab Don't use timestamps with all zero
Although all zero (0000:00:00) is valid time, in most cases it means
that value is not present. According to http://www.exiv2.org/Exif2-2.PDF
in such case those values should be omitted, however
some cameras set them to 0 anyway. With this commit such timestamps
will be treated as they were empty.

Change-Id: I9c762b1fa04ea6bf9c0fba9e2459a20430c71c90
2015-11-13 10:05:06 +09:00
Casey Dahlin
376d5f350c Merge "Add hidden support for arrays of raw file descriptors" 2015-11-12 23:50:05 +00:00
Mark Salyzyn
c954fde0b6 jni: is loggable speedup, not within signal
Speedup by telling __android_is_loggable interface it will not
be called within a signal handler. This saves two system calls.

Bug: 25563384
Change-Id: Ib8188641c8c76e5aa848476da98596be6b8e5040
2015-11-12 15:40:51 -08:00
Casey Dahlin
2f974b252f Add hidden support for arrays of raw file descriptors
Change-Id: I4013e0700369764a26485d8620ebf16d8bea1951
Test: Built and ran Android in an emulator
Bug: 25242023
Signed-off-by: Casey Dahlin <sadmac@google.com>
2015-11-12 14:13:15 -08:00
Chad Brubaker
2bd2eb33c0 Dedupe trust anchors
When getting trust anchors we need to dedup them based on the
certificate to avoid having multiple trust anchors with the same cert
but different pin override behavior. If there are multiple trust anchors
with the same cert, the trust anchor which overrides pins wins.

Change-Id: Ida31f2551f56997418b8b091bb2598c5593cb069
2015-11-12 13:13:45 -08:00
Chad Brubaker
b324fb18d9 Merge "Support X509TrustManagerExtensions methods" 2015-11-12 19:28:54 +00:00
Chad Brubaker
9c3982f75d Merge "Use duck typing in X509TrustManagerExtensions" 2015-11-12 19:28:21 +00:00
Svetoslav Ganov
8f87949340 Merge "System crash fixed when turn off MagnificationGesture" 2015-11-12 16:00:28 +00:00
Wale Ogunwale
cbcafde45e Merge "Avoid configuration of callback being reset after relayout." 2015-11-12 15:55:18 +00:00
riddle_hsu
164725c652 Avoid configuration of callback being reset after relayout.
mPendingConfiguration is a parameter of IWindowSession.relayout.
And IWindowSession.aidl declared "out Configuration outConfig",
it will always create a new configuration for remote side to write.
If remote side does not write (WMS does not have config change),
the new default configuration will be returned.

In original code passes mPendingConfiguration to updateConfiguration
directly, then callbacks (sConfigCallbacks) receive the same
instance of mPendingConfiguration. And because the implementation
of callback may use the configuration after relayout has reset
the configuration to default, then it may have timing that results
"showing hybrid of portrait and landscape modes" which try to fix
in commit e36d6e27.

To avoid this, always create a copy to updateConfiguration.
MSG_RESIZED_REPORT from dispatchResized also did the same thing.

Related commit:
e36d6e277e49475076b7872d36ea6a5c5b996e9d
694f79b5d1196640d1beb680b7d1fc68e6e77cbd

Change-Id: Ic1abd596e384918224b3a7020583d9a04641cccc
2015-11-12 14:07:12 +08:00
Chad Brubaker
93962c2f01 Support X509TrustManagerExtensions methods
Change-Id: I14a405e90f139b8d73eb9f88597fac804a7c18f3
2015-11-11 14:35:46 -08:00
Chad Brubaker
bfcd67f71e Use duck typing in X509TrustManagerExtensions
X509TrustManagerExtensions assumes that the default X509TrustManager is
an instance of conscrypt's TrustManagerImpl. That's no longer going to
always be the case. Instead use duck typing to support any
X509TrustManagers that have the extra methods required for
X509TrustManagerExtensions.

Change-Id: If23471bda590d5e131bb1e802a60599957bc7f37
2015-11-11 13:38:33 -08:00
Chad Brubaker
d1c469e876 Merge "Add NetworkSecurityConfigProvider" 2015-11-11 20:25:04 +00:00
Amith Yamasani
10b0bae06f Merge "Fix system watchdog timeout when reading too many usage events." 2015-11-11 20:24:39 +00:00
Chad Brubaker
f1e813ea33 Merge "Add support for debug-overrides configuration" 2015-11-11 19:03:30 +00:00
Chad Brubaker
5a1078f40d Add NetworkSecurityConfigProvider
Change-Id: I321e3ca94cc2a8d5e0e5d82a83b255ff5b8a71d2
2015-11-11 10:54:54 -08:00
John Reck
8c85c00b5e Merge "Fix memory corruption in SpotShadow" 2015-11-11 17:52:08 +00:00
Calin Juravle
8fa7e93050 Merge "Parse method-trace properties only in debug builds." 2015-11-11 16:54:52 +00:00
Keith Mok
a1f5631340 Fix memory corruption in SpotShadow
The array list is too small and causing stack corruption

Change-Id: I0e34dad39357fb63977d2ce6f183ced7b6a632be
2015-11-11 08:49:20 -08:00
Calin Juravle
92290b8963 Parse method-trace properties only in debug builds.
Bug: 25612377
Change-Id: Ia1d8e6c5afbdd70486d5aa8c059e70e27b03367d
2015-11-11 10:36:47 +00:00
John Reck
37bf3ec9d2 Merge "Fix HWUI Path Cache dangling pointer" 2015-11-10 23:20:03 +00: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
Svetoslav Ganov
8d8515e708 Merge "Avoid NPE in printspooler when changing language" 2015-11-10 00:58:28 +00:00
Nick Kralevich
51b48b3877 Merge "system_server: allow /proc read access to other UIDs" 2015-11-09 20:05:22 +00:00
Digish Pandya
2e4f67c388 Fix HWUI Path Cache dangling pointer
When precache, PathTexture is added to PathCache, and it is released after drawn if we want to clean it.
But the PathCache LRU still holds the entry of the PathTexture object. When trim the cache in
the end of each frame, LRU finds that its mListener is not NULL and invoke the functor, however,
mListerer points to the released PathTexture object and is a dangling pointer, thus leads to crash.
Smart pointer don't help here since they only manage scopes, while PathTexture is also controled by
its cleanup field.
The fix is to also remove the LRU entry of PathTexture*, it will also release the texture object
and there won't be texture leaks.

Change-Id: Iaa0621df5dc71532e9e75b38ad94384353930b95
2015-11-09 14:22:25 +05:30
Mark Lu
4e59db328d Fix system watchdog timeout when reading too many usage events.
Symptom:
As issue link:
https://code.google.com/p/android/issues/detail?id=193100

RootCause:
UsageStatsService.onDisplayChanged executed in system main thread,
If calling UsageStatsManager.queryEvents with too many events before it
(i.e. in daily usage event file,
too many activity resume / pause events or configuration change
during monkey test),
System will be blocked then watchdog timeout.

Solution:
Let display listener executed in background thread handler

Change-Id: Ic894d112612400ed8fb7ba843b3309fdc4f66fe1
2015-11-09 07:24:48 +00:00
Nick Kralevich
368513fa99 system_server: allow /proc read access to other UIDs
Add system_server to AID_READPROC, to allow system_server to read
/proc entries associated with other UIDs.

Bug: 23310674
Change-Id: I1602b8ee30670cde4ed56e2f901524c105895352
2015-11-07 17:04:04 -08:00
Chad Brubaker
749501e88e Merge "Support nested domain-config elements" 2015-11-07 22:11:04 +00:00
Chad Brubaker
ead46ecc84 Merge "Add xml source for network security configuration" 2015-11-07 22:10:50 +00: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
1347cb81f4 Merge "Fix incorrect hstsEnforced lookup" 2015-11-07 02:37:45 +00:00
Chad Brubaker
825c3f91ed Fix incorrect hstsEnforced lookup
Change-Id: I00364d8c1d3311bebd3ad88e557860e694ba5018
2015-11-06 18:08:12 -08:00
Chad Brubaker
1483ee3aa5 Merge "Fix directory check in UserCertificateSource" 2015-11-06 21:02:23 +00:00
Chad Brubaker
c5c51dafb3 Merge "Fix incorrect hasPerDomainConfigs check" 2015-11-06 21:02:01 +00:00
Chad Brubaker
b0f8b4bb35 Fix directory check in UserCertificateSource
If the user has not added any CAs to the user trust store the user-added
directory will not have been created.

Change-Id: I8b5f73af3c0761c56969874231004fedbf7badda
2015-11-06 13:00:15 -08:00
Chad Brubaker
35de8d6d2b Fix incorrect hasPerDomainConfigs check
Change-Id: Iaeedbbcc5f12475d346a77dba84b38a1d3d8d346
2015-11-06 12:50:31 -08:00
Chad Brubaker
7e98f2e697 Merge "Use a builder for NetworkSecurityConfig" 2015-11-06 20:21:29 +00:00
Masaaki Iwaguchi
5b6d99e87a System crash fixed when turn off MagnificationGesture
Symptom:
WindowManagerService throws exception and system crashes.

Root cause:
When the MagnificationGesture is turned off during animation of scale
up/down, WindowManagerService.mAccessibilityController can be null so
exception is thrown.

Solution:
Cancel ongoing animation before turning off MagnificationGesture.

Change-Id: I469d84e024bdd453e3729a69229398233ed2eb61
2015-11-06 12:40:14 +01:00
Svetoslav Ganov
7abb36599d Merge "Take into account default app for default grants" 2015-11-06 00:34:21 +00:00