118171 Commits

Author SHA1 Message Date
Paul Duffin
ac5a0828c1 Improve Parcel's handling of non-primitive arrays
Treat arrays other than actual Object arrays (i.e. those whose component type
is actually Object) and the primitive arrays already handled specially by
Parcel as Serializable's.

Issue: 64583
Change-Id: I3ff797f3262e77e4de27f35709bceee5410d1ed4
2014-02-11 16:49:25 +00:00
Narayan Kamath
3aeb629d82 Merge "Use long to store pointers in GLES_JNI/EGL classes" 2014-02-11 15:39:04 +00:00
Narayan Kamath
7b7726b798 Merge "Fix in MediaMuxer's JNI code" 2014-02-11 14:33:38 +00:00
Narayan Kamath
b823bd4560 Merge "Use long to store pointers in ConsumerIrService" 2014-02-11 14:29:09 +00:00
Narayan Kamath
f44a3f1e00 Merge "Use long for pointers in EmojiFactory and PdfDocument" 2014-02-11 14:07:17 +00:00
Narayan Kamath
6d8b21a84c Merge "Fix TinyHashMap to use generic hash_type instead of hash_t" 2014-02-11 13:40:38 +00:00
Tim Murray
38d799fc7a Merge "Generic object based data copy." 2014-02-10 23:27:06 +00:00
Jason Sams
1136bb91b4 Generic object based data copy.
This change consolidates the copy paths to Object based.
The runtime now uses reflection to identify the type of
array present.  This adds support for long/double and reduces
the amount of code present.  We could also support arrays of vectors
or objects in the future with this mechanism.

Change-Id: I2297c1c01fbe6a64c375d6368f25d7db781ea788
2014-02-10 15:18:56 -08:00
Colin Cross
40545f32d3 Merge "frameworks/base: fix errors inside ALOGV" 2014-02-10 22:02:50 +00:00
Rickard Helldin
5fb5df0013 Fix, MountService now only sends one onShutDownComplete
The event onShutDownComplete are sent only when all
volumes are shutdown. (Not one for every volume.)

Change-Id: I6af521ee8285ca581efac7d3c5f013dfbff3ee30
2014-02-10 23:21:25 +09:00
Narayan Kamath
56062983f1 Merge "AArch64: Use long for pointers in RS Java/JNI code" 2014-02-10 13:33:26 +00:00
Colin Cross
d06969518b frameworks/base: fix errors inside ALOGV
Fix errors exposed by adding compile-time checking to disabled ALOGVs.

Change-Id: I9beeb5d5df498c63d6bed49734ee80a8e0afcefc
2014-02-09 21:54:01 -08:00
Christopher Tate
ff27e6bc44 Merge "Use canonical path for /vendor/app" 2014-02-07 23:30:24 +00:00
John Spurlock
cccae25fc7 Merge "Example controller app for system ui demo mode." 2014-02-07 20:58:37 +00:00
John Spurlock
c23929c3a3 Example controller app for system ui demo mode.
Demo mode is protected behind a system setting.  To enable:
$ adb shell settings put global sysui_demo_allowed 1

Change-Id: I2248e27a253bf9eac176e8be9153a2b147cefa40
2014-02-07 14:47:47 -05:00
Ashok Bhat
e9bea2a182 Fix TinyHashMap to use generic hash_type instead of hash_t
TinyHashMap used hash_t(key) to generate hashcode. This
would not work for 64-bit pointers as hash_t is declared as
an uint32_t.

Replaced the hash_t(key) call to more generic android::hash_type(key).
This function is a template function declared in TypeHelpers.h and
has a version available for all data types including pointers.

Change-Id: I612cf18b49ca7c30b63f9d6938df68fed7d80d08
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2014-02-07 19:10:04 +00:00
Jean-Luc Brouillet
11e6cabc66 Merge "Fix a typo." 2014-02-07 19:08:36 +00:00
Jean-Luc Brouillet
d60799ec84 Fix a typo.
Change-Id: I770fe97ab0635de84d15393aca6bca57552f2f10
2014-02-07 11:04:26 -08:00
Ashok Bhat
0d552f7d8b Use long to store pointers in ConsumerIrService
Change-Id: I4e6562b7dc09f87ad80b1e862b614a370d37feb5
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2014-02-07 18:12:23 +00:00
Ashok Bhat
d2507a2f3c Fix in MediaMuxer's JNI code
android_media_MediaMuxer_native_setup should return jlong. It was
incorrectly returning jint.

Change-Id: I31a475af0818f4d5dcbb39380b42612188cf3853
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2014-02-07 18:10:22 +00:00
Dan Sandler
6ea720bacb Merge "Make sure to turn off led after pulse()" 2014-02-07 15:59:08 +00:00
Stephen Smalley
d8fa586099 Convert all selinux_android_restorecon and _setfilecon calls to new API.
libselinux selinux_android_restorecon API is changing to the more
general interface with flags and dropping the older variants.

Also get rid of the old, no longer used selinux_android_setfilecon API
and rename selinux_android_setfilecon2 to it as it is the only API in use.

Change-Id: I1e71ec398ccdc24cac4ec76f1b858d0f680f4925
Signed-off-by: Stephen Smalley <sds@tycho.nsa.gov>
2014-02-07 09:36:25 -05:00
Tim Murray
67cc2d033e Add hidden minor version ID for support lib workarounds.
Change-Id: I7940e32c78caaab351fb28d92e5fadbea6292b27
2014-02-06 17:07:05 -08:00
Dave Platt
89d4c897a0 Finish fixing Zygote descriptor leakage problem
In order to prevent Zygote descriptors from leaking into the child
environment, they should be closed by the forked-off child process
before the child switches to the application UID.  These changes close
the descriptors via dup2(), substituting a descriptor open to
/dev/null in their place; this allows the Zygote Java code to close
the FileDescriptor objects cleanly.

This is a multi-project change: dalvik, art, libcore, frameworks/base,
and external/sepolicy are affected.  The CLs need to be approved
together, lest the build break or the software fail to boot.

Round 2: indent change

Bug: 12114500
Change-Id: I090402136a8a8b7d6aad6eb153026e85d7cf6ad3
2014-02-06 13:24:38 -08:00
Ashok Bhat
a3850d8f8f AArch64: Use long for pointers in SurfaceSession class
For storing pointers, long is used in SurfaceSession class,
as native pointers can be 64-bit.

Change-Id: I1535a488dfffaddd20e3beac57e558035d715cbf
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2014-02-06 16:57:49 +00:00
Chris Craik
449273e2d5 Merge "Fix for positioning of glyphs within a bitmap" 2014-02-05 21:36:42 +00:00
Ashok Bhat
0e0c0885ae AArch64: Use long for pointers in RS Java/JNI code
Changes include
[x] Some JNI functions, with return type jlong, casts
    pointer to jint before returning it. This has been fixed.

[x] Minor JNI function prototype changes where
    formal paramter type has been changed to a JNI
    type (int to jint for example).

[x] long is used for ScriptC, Sampler, Font, ProgramStore
    handles as they can be 64-bit.

[x] A new hidden constructor ScriptC(long, RenderScript)
    has been added. This should eventually replace public
    API method ScriptC(int, RenderScript).

[x] Font and FileA3D use getNativeAsset instead of getAssetInt
    to get Asset Handles. The getAssetInt method will be
    deprecated in favor of getNativeAsset, as the former does
    not support 64-bit.

[x] rsnPathCreate method accepts loop as an int. This should
    be long as the underlying RS function assumes this to be
    a pointer.

Change-Id: I919d857e5933febe63966049da83de9f9adee6f5
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
2014-02-05 11:26:38 +00:00
Stephen Hines
bc80e40b16 Merge "Add message to RS docs about application vs. library packaging." 2014-02-05 01:52:32 +00:00
Tim Murray
f5294ed57c Merge "DO NOT MERGE: Mark new util type functions as @hide in AOSP." 2014-02-03 22:37:13 +00:00
Tim Murray
3fb6feacc6 Merge "Check that bound allocations are 1D" 2014-02-03 22:37:11 +00:00
Tim Murray
0cc37f4cde Merge "Fix debug context." 2014-02-03 22:37:06 +00:00
Tim Murray
0539b7b411 Merge "Enable asynchronous destruction of BaseObjs." 2014-02-03 22:37:00 +00:00
Tim Murray
d8b4dd9555 Merge "Fix most logging macros for context pointers." 2014-02-03 22:36:54 +00:00
Tim Murray
351879df3a Merge "Fix getBytesSize for YUV allocations." 2014-02-03 22:36:53 +00:00
Tim Murray
8fced3174a Merge "Move RenderScript from graphics/ to new fw/base subdirectory rs." 2014-02-03 22:36:50 +00:00
Tim Murray
b4cf2a2aee Merge "Convert Java/JNI to 64-bit, part 2." 2014-02-03 22:36:45 +00:00
Tim Murray
e22e268e6d Merge changes If93a5d78,I1957f7ac
* changes:
  Convert Java/JNI to 64-bit, part 1.
  Add long/double read support.
2014-02-03 22:36:38 +00:00
Tim Murray
61eb6b55c6 Merge "Use Object + type in place of specific array" 2014-02-03 22:36:36 +00:00
Tim Murray
e559d7ee53 Merge "Utility API for creating types." 2014-02-03 22:36:13 +00:00
Tim Murray
b1c1518ef1 Merge "Remove old hidden API." 2014-02-03 22:36:06 +00:00
Tim Murray
aea3b5816d Merge "Remove hidden API setSurfaceTexture." 2014-02-03 22:35:15 +00:00
Mårten Kongstad
ad6ed950db Runtime resource overlay, iteration 2, test cases
Add automated test cases for runtime resource overlay, iteration 2.

The test cases are a mixture of 'adb shell' commands and regular
instrumentation tests. The device is rebooted between tests to setup
different overlay scenarios for framework-res.apk.

To verify Runtime resoure overlay, iteration 2, run
    $ frameworks/base/core/tests/overlaytests/testrunner.py

For a list of supported options, run
    $ frameworks/base/core/tests/overlaytests/testrunner.py --help

Change-Id: I692aa1a7ad073efd116b24f9ec7f197dfd65dfef
2014-02-03 11:20:33 +01:00
Mårten Kongstad
48d22323ce Runtime resource overlay, iteration 2
Support any number of overlay packages. Support any target package.

UPDATED PACKAGE MATCHING
------------------------
In Runtime resource overlay, iteration 1, only a single overlay package
was considered. Package matching was based on file paths:
/vendor/overlay/system/framework-res.apk corresponded to
/system/framework-res.apk. Introduce a more flexible matching scheme
where any package is an overlay package if its manifest includes

    <overlay targetPackage="com.target.package"/>

For security reasons, an overlay package must fulfill certain criteria
to take effect: see below.

THE IDMAP TOOL AND IDMAP FILES
------------------------------
Idmap files are created by the 'idmap' binary; idmap files must be
present when loading packages. For the Android system, Zygote calls
'idmap' as part of the resource pre-loading. For application packages,
'idmap' is invoked via 'installd' during package installation (similar
to 'dexopt').

UPDATED FLOW
------------
The following is an outline of the start-up sequences for the Android
system and Android apps. Steps marked with '+' are introduced by this
commit.

Zygote initialization
   Initial AssetManager object created
+    idmap --scan creates idmaps for overlays targeting 'android', \
           stores list of overlays in /data/resource-cache/overlays.list
   AssetManager caches framework-res.apk
+  AssetManager caches overlay packages listed in overlays.list

Android boot
   New AssetManager's ResTable acquired
     AssetManager re-uses cached framework-res.apk
+    AssetManager re-uses cached 'android' overlays (if any)

App boot
   ActivityThread prepares AssetManager to load app.apk
+  ActivityThread prepares AssetManager to load app overlays (if any)
   New AssetManager's ResTable acquired as per Android boot

SECURITY
--------
Overlay packages are required to be pre-loaded (in /vendor/overlay).
These packages are trusted by definition. A future iteration of runtime
resource overlay may add support for downloaded overlays, which would
likely require target and overlay signatures match for the overlay to
be trusted.

LOOKUP PRIORITY
---------------
During resource lookup, packages are sequentially queried to provide a
best match, given the constraints of the current configuration. If any
package provide a better match than what has been found so far, it
replaces the previous match. The target package is always queried last.

When loading a package with more than one overlay, the order in which
the overlays are added become significant if several packages overlay
the same resource.

Had downloaded overlays been supported, the install time could have been
used to determine the load order. Regardless, for pre-installed
overlays, the install time is randomly determined by the order in which
the Package Manager locates the packages during initial boot. To support
a well-defined order, pre-installed overlay packages are expected to
define an additional 'priority' attribute in their <overlay> tags:

    <overlay targetPackage="com.target.package" priority="1234"/>

Pre-installed overlays are loaded in order of their priority attributes,
sorted in ascending order.

Assigning the same priority to several overlays targeting the same base
package leads to undefined behaviour. It is the responsibility of the
vendor to avoid this.

The following example shows the ResTable and PackageGroups after loading
an application and two overlays. The resource lookup framework will
query the packages in the order C, B, A.

        +------+------+-     -+------+------+
        | 0x01 |      |  ...  |      | 0x7f |
        +------+------+-     -+------+------+
            |                           |
        "android"                Target package A
                                        |
                       Pre-installed overlay B (priority 1)
                                        |
                       Pre-installed overlay C (priority 2)

Change-Id: If49c963149369b1957f7d2303b3dd27f669ed24e
2014-02-03 11:20:30 +01:00
Mårten Kongstad
65a05fd56d New command line tool 'idmap'
Introduce a new tool 'idmap' to handle generation and verification of
idmap files. The tool is modelled on 'dexopt', and is intended to be
used similarly, notably by 'installd'.
See cmds/idmap/idmap.cpp for further documentation on 'idmap'.

Note: this commit is interdependent on a commit in project build/ to add
'idmap' to PRODUCT_PACKAGES.

Note: the changes to androidfw are only stubs. The actual implementation
will be provided in Runtime resource overlay, iteration 2.

Change-Id: I7131b74ece1e46c8a9c0a31d103e686aa07da2bb
2014-02-03 09:47:16 +01:00
Kenny Root
c064a1b5d9 Merge "Remove DRLCertFactory" 2014-01-31 22:54:44 +00:00
Kenny Root
4f2323106b Remove DRLCertFactory
No longer needed since Conscrypt is the main provider.

Change-Id: Iee741ef376af2de52db79df07e96057438778bc6
2014-01-31 14:10:15 -08:00
Tim Murray
0e3431d4c7 DO NOT MERGE: Mark new util type functions as @hide in AOSP.
Change-Id: I834e07aef142aa79ed1603535689d0b833357f6c
2014-01-31 14:05:20 -08:00
Jason Sams
cf9c894a9b Check that bound allocations are 1D
We do not support higher order bound allocations. The
stride is not available to the script so they cannot
walk the allocation correctly.

Change-Id: I9447a5d43c3ae1b88fc9522628a17bd5a317ffc6
2014-01-31 12:35:19 -08:00
Tim Murray
b75c27e870 Fix debug context.
bug 12477551

Change-Id: Icac28abc3dabce31834faa1942b596c2f207f29e
2014-01-31 12:35:19 -08:00
Tim Murray
504abb3626 Enable asynchronous destruction of BaseObjs.
Change-Id: Iaddf8041a3c870a986ec8999e6ccc3aede38fc4c

Conflicts:
	rs/java/android/renderscript/BaseObj.java
2014-01-31 12:35:18 -08:00