History log of /frameworks/base/core/jni/android_util_AssetManager.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
a55a59a4f5102c54a08aae0e2e3d38a5095666e1 10-May-2018 Nicolas Geoffray <ngeoffray@google.com> Move registration of AssetManager.mObject to zygote.

bug: 73865351
Test: m

Change-Id: I9d0f0c8ae016b8823246e25bfdbff0d4fd8eaae1
/frameworks/base/core/jni/android_util_AssetManager.cpp
1d63cc3b6d5d4c3d09ade408e975d9dce41f84fd 18-Apr-2018 Todd Kennedy <toddke@google.com> Set default reference ID

The reference ID may not be set [when the reference ID is 0x00], so,
we need to ensure it has a proper default value; instead of garbage

Change-Id: Ie1bcf062fbb1aab5832cf210f68b24732af5dc3b
Fixes: 74389717
Test: Run gReader and see that it doesn't crash
/frameworks/base/core/jni/android_util_AssetManager.cpp
bebfcc46a249a70af04bc18490a897888a142fb8 12-Feb-2018 Adam Lesinski <adamlesinski@google.com> Refactor AssetManager

Bug: 64071469
Test: atest CtsContentTestCases
Change-Id: Ia6856157e8813856268fba003e1e591d690cb26e
/frameworks/base/core/jni/android_util_AssetManager.cpp
bde1df21adf264d3398b9f3274f353faa6399008 09-Feb-2018 Adam Lesinski <adamlesinski@google.com> Revert "Replace AssetManager with AssetManager2 implementation"

This reverts commit 1187590da38457809dd368d4901c9c47ac5a6958.

Bug: 73134570
Change-Id: I59b4d714e447478ea124f086356f127f42251fb7
/frameworks/base/core/jni/android_util_AssetManager.cpp
ec7f06cc372a7298c85bf96cb4133d7dc8807419 09-Feb-2018 Adam Lesinski <adamlesinski@google.com> Revert "AssetManager2: Fix list function"

This reverts commit adc0b87ec235a71d722fb8d6aad50ceaeac8c6d5.

Bug:73134570
Change-Id: I9e652245e7661eb7a34dadb5f363a08bc8c9e57e
/frameworks/base/core/jni/android_util_AssetManager.cpp
adc0b87ec235a71d722fb8d6aad50ceaeac8c6d5 09-Feb-2018 Adam Lesinski <adamlesinski@google.com> AssetManager2: Fix list function

List was skipping directories. Include them, and add tests to ensure
the order and precedence is correct.

Bug: 72511641
Test: make libandroidfw_tests
Test: atest CtsContentTestCases:AssetManagerTest
Change-Id: Iadf45883283d3e4aae93bd7c3343745912e34fa0
/frameworks/base/core/jni/android_util_AssetManager.cpp
1187590da38457809dd368d4901c9c47ac5a6958 23-Jan-2017 Adam Lesinski <adamlesinski@google.com> Replace AssetManager with AssetManager2 implementation

Test: atest CtsContentTestCases:android.content.res.cts
Test: make libandroidfw_tests
Change-Id: I2bb6d7656d2516d371e83e541ed02f91405f6d94
/frameworks/base/core/jni/android_util_AssetManager.cpp
f7d01dd7e14e01420c39e7fb8eca3cfa0f5f31b6 26-Jan-2018 Adam Lesinski <adamlesinski@google.com> Revert "Replace AssetManager with AssetManager2 implementation"

This reverts commit dcb3c6559b09ec89771858ec27a787027da9af50.

Bug:72511998
Change-Id: I665966ca109f66f85d8665db388c71ea2303c3b8
/frameworks/base/core/jni/android_util_AssetManager.cpp
1713d9e97aada3dc695800c18b1025238a11629d 12-Jan-2018 Jaekyun Seok <jaekyun@google.com> Support /product partition

This CL will support the followings.
- installing a RRO package for framework from /product/overlay
- installing apps from /product/app
- installing priv-apps from /product/priv-app
- installing permissions from
/product/etc/[default-permissions|permissions|sysconfig]

Bug: 64195575
Test: `mm` under frameworks/base/tests/[libs|privapp]-permissions
adb sync && adb reboot
adb shell cmd package list libraries
=> confirmed com.android.test.libs.product library
adb shell cmd package dump \
com.android.framework.permission.privapp.tests.product
=> confirmed that the package is a priv-app

And I moved vendor/overlay/framework-res__auto_generated_rro.apk into
system/product/overlay/ on sailfish, and I confirmed that the RRO was
installed properly.

Change-Id: I16175933cebd9ec665d190cc5d564b5414a91827
/frameworks/base/core/jni/android_util_AssetManager.cpp
dcb3c6559b09ec89771858ec27a787027da9af50 23-Jan-2017 Adam Lesinski <adamlesinski@google.com> Replace AssetManager with AssetManager2 implementation

Test: atest CtsContentTestCases:android.content.res.cts
Test: make libandroidfw_tests
Change-Id: I572eb13c6a4372c7f656f5912821cececd5bf3d4
/frameworks/base/core/jni/android_util_AssetManager.cpp
7fb38311361390e24d7e43ce1eb220faccd251ff 23-Jan-2018 Adam Lesinski <adamlesinski@google.com> Revert "Replace AssetManager with AssetManager2 implementation"

This reverts commit b20a0ce59f59cb5ec857748e056cc341dbd13b92.
/frameworks/base/core/jni/android_util_AssetManager.cpp
b20a0ce59f59cb5ec857748e056cc341dbd13b92 23-Jan-2017 Adam Lesinski <adamlesinski@google.com> Replace AssetManager with AssetManager2 implementation

Test: Existing CTS tests pass
Test: make libandroidfw_tests
Change-Id: I858f7e1d909c08273b096601136e3f28e15eb5d4
/frameworks/base/core/jni/android_util_AssetManager.cpp
ca3872ce36c94090ae18519dc7fe0cf39d834c4a 30-Oct-2017 Dianne Hackborn <hackbod@google.com> Fully implement "install" and "install-write" in PackageManagerShellCommand.

We can use the new mechanism to ask the calling shell to open
a file in order to implement the rest of these commands, allowing
you to give the path to an apk to install. That API is thus
extended to allow you to open readable files, not just opening
file for writing.

Doing this however means we no longer can pass a file path to
AssetManager for the apk to parse, we only have an already open
fd for that. Extending AssetManager to allow adding apks from
fds is not that hard, however, since the underlying zip library
already supports this.

This main thing this changes is in AssetManager.cpp where we
retrieve the open zip file for a particular apk that has been
added. This used to look up the zip file by path every time
it was needed, but that won't work anymore now that we can have
things added by fd. Instead, we keep track of each opened zip
in the AssetManager, so we can just directly retrieve it from
the asset_path representing the item that was added. As a
side-effect, this means for normal paths we no longer need to
look up by name, but just have the opened zip file directly
accessible. (This is probably good, but it does mean that we
no longer run the logic of seeing if the zip file's timestamp
has changed and re-opening it if it has. We probably shouldn't
be relying on that for an active AssetManager anyway, and maybe
it is even good that we don't allow the zip file to change
under it?)

A follow-up change will finally remove the Pm.java implementation
and turn the pm "command" into a simple shell script that runs
cmd package.

Test: manual

Change-Id: Ie103e3bdaa5b706796cc329254f2638151a3924f
/frameworks/base/core/jni/android_util_AssetManager.cpp
5c091dc9449b583e18656a8850a61f557dfcc945 20-Jul-2017 Steven Moreland <smoreland@google.com> Merge "frameworks/base: use proper nativehelper headers"
am: 826eafd958

Change-Id: I36f10ff4d963284a313f1cc5b368f82549a4adb2
2279b2534272282a5b5152723235da397e49195c 19-Jul-2017 Steven Moreland <smoreland@google.com> frameworks/base: use proper nativehelper headers

libnativehelper exports headers under nativehelper. These were
available before incorrectly as global headers in order to give
access to jni.h.

Test: modules using frameworks/base find headers
Bug: 63762847
Change-Id: I0f9f231acdebe460f279135462f43d3e32eff64d
/frameworks/base/core/jni/android_util_AssetManager.cpp
cc5a731fd725a4687625c93cf8490b63ce99884f 23-Mar-2017 Jason Monk <jmonk@google.com> Remove "Allow persistent changes to the vendor overlay theme"

This reverts commit 2dc804be11444565e3d1d151c2a693db3ade94c0.
It also removes the related calls from UiModeManager.

Fixes: 32721178
Test: make & flash
Change-Id: Id371bccec611155cc6910e46b3277c3d27fc1c79
/frameworks/base/core/jni/android_util_AssetManager.cpp
7de2f9c73fbe93bfb7dff3c046cf7a3137599f6c 01-Mar-2017 Jaekyun Seok <jaekyun@google.com> Reinstate codes to enable RRO on system server

Test: building succeeded and tested with sailfish
Bug: 35742444
Change-Id: I99d0f1d097525d3eb46255d6cf823f6ae2a02385
/frameworks/base/core/jni/android_util_AssetManager.cpp
07acbea6534aed8f7e5d835a2a045a4195d38495 02-Mar-2017 Tim Zhang <tim.zhang@spreadtrum.com> Merge "Remove FastJNI optimization on AssetManager to avoid dead lock."
am: 4904e7ae2a

Change-Id: I38169c42b5b5600c0e3d00f0342429b3843f88f8
14e0a1e8193474b7f540e42f547c88e34d1fc0d9 16-Feb-2017 Tim Zhang <tim.zhang@spreadtrum.com> Remove FastJNI optimization on AssetManager to avoid dead lock.

I found there was a dead lock among main, android.display and GC threads
when running monkey test.
- Main thread got a mutex and was suspended by GC thread.
- Android.display thread waited for mutex held by main thread.
- GC thread waited for suspention of android.display thread.

This will lead to ANR or screen freeze.

Merged-In: I13cf1eca3cb3b7c01aa754874f2b48aab0b472e8
Change-Id: I13cf1eca3cb3b7c01aa754874f2b48aab0b472e8
/frameworks/base/core/jni/android_util_AssetManager.cpp
fe25b1adaffbc9e84e6c8c5d5f863264becb3484 16-Feb-2017 Tim Zhang <tim.zhang@spreadtrum.com> Remove FastJNI optimization on AssetManager to avoid dead lock.

I found there was a dead lock among main, android.display and GC threads
when running monkey test.
- Main thread got a mutex and was suspended by GC thread.
- Android.display thread waited for mutex held by main thread.
- GC thread waited for suspention of android.display thread.

This will lead to ANR or screen freeze.

Fixes: 32480078
Test: builds

Change-Id: I13cf1eca3cb3b7c01aa754874f2b48aab0b472e8
/frameworks/base/core/jni/android_util_AssetManager.cpp
2e0d0f311100d8e0bb40d7d60b8498237f011f0c 02-Jun-2016 Mårten Kongstad <marten.kongstad@sonymobile.com> OMS: integrate OverlayManagerService into framework

Hand over ownership of overlays to OverlayManagerService.

Changes to a package's overlays are propagated using the activity life
cycle. Affected activities will be recreated as needed. This provides a
well-defined point to modify an application's assets while the
application is paused.

Consolidate how overlays targeting the system and overlays targeting
regular applications are handled. Previously, system overlays were
handled as a special case. Now, everything is handled identically. As a
side effect, the call to idmap --scan during Zygote boot has become
obsolete and is removed.

Information on what overlays to use is recorded in
ApplicationInfo.resourceDirs. The PackageManagerService is responsible
for the creation of ApplicationInfo objects. The OverlayManagerService
is responsible for informing the PackageManagerService in advance about
what resourceDirs to use.

When launching an application, the ApplicationInfo is already populated
with up-to-date information about overlays.

When enabling or disabling an overlay for a running application, the
OverlayManagerService first notifies the PackageManagerService about the
updated resourceDirs. It then tells the ActivityManagerService to push
the new ApplicationInfo object to the application's ActivityThread.
Finally the application requests its ResourcesManager to create new
ResourcesImpl objects based on the updated paths.

Change-Id: Ib8afa05ccab4e2db558f89ce4423983c086bb61a
Co-authored-by: Martin Wallgren <martin.wallgren@sonymobile.com>
Signed-off-by: Zoran Jovanovic <zoran.jovanovic@sonymobile.com>
Bug: 31052947
Test: run tests from 'OMS: tests for OverlayManagerService'
/frameworks/base/core/jni/android_util_AssetManager.cpp
95459806920dec34abb3214ab6e1a9b9213a2a61 23-Feb-2017 Guang Zhu <guangzhu@google.com> Revert "OMS: integrate OverlayManagerService into framework"

Bug: 31052947
Bug: 35697944

This reverts commit 21a3d1ad686dee97b9cf0ed80389ee2ab0d48013.

Change-Id: I2d86931020301524c26cf8c8e80d557c97fdd6c3
/frameworks/base/core/jni/android_util_AssetManager.cpp
21a3d1ad686dee97b9cf0ed80389ee2ab0d48013 02-Jun-2016 Mårten Kongstad <marten.kongstad@sonymobile.com> OMS: integrate OverlayManagerService into framework

Hand over ownership of overlays to OverlayManagerService.

Changes to a package's overlays are propagated using the activity life
cycle. Affected activities will be recreated as needed. This provides a
well-defined point to modify an application's assets while the
application is paused.

Consolidate how overlays targeting the system and overlays targeting
regular applications are handled. Previously, system overlays were
handled as a special case. Now, everything is handled identically. As a
side effect, the call to idmap --scan during Zygote boot has become
obsolete and is removed.

Information on what overlays to use is recorded in
ApplicationInfo.resourceDirs. The PackageManagerService is responsible
for the creation of ApplicationInfo objects. The OverlayManagerService
is responsible for informing the PackageManagerService in advance about
what resourceDirs to use.

When launching an application, the ApplicationInfo is already populated
with up-to-date information about overlays.

When enabling or disabling an overlay for a running application, the
OverlayManagerService first notifies the PackageManagerService about the
updated resourceDirs. It then tells the ActivityManagerService to push
the new ApplicationInfo object to the application's ActivityThread.
Finally the application requests its ResourcesManager to create new
ResourcesImpl objects based on the updated paths.

Co-authored-by: Martin Wallgren <martin.wallgren@sonymobile.com>
Signed-off-by: Zoran Jovanovic <zoran.jovanovic@sonymobile.com>
Bug: 31052947
Test: run tests from 'OMS: tests for OverlayManagerService'
Change-Id: Idc96dae6fc075d5373aa055bbf50e919136d7353
/frameworks/base/core/jni/android_util_AssetManager.cpp
408afbf06040ea29d1a9d60e9dc50d1923068de4 25-Jan-2017 Romain Guy <romainguy@google.com> Change configuration's color mode based on the display's color mode

Bug: 32984164
Test: CtsContentTestCases

Change-Id: Iedc7d1cc488b80718576082667b6e96956c4f847
/frameworks/base/core/jni/android_util_AssetManager.cpp
f32adf447511d54c2aa0948d3c1ef44d461538ac 23-Nov-2016 John Reck <jreck@google.com> Clean up ApplyStyle JNI

Bug: 32573798

Mark input uint32_t[] as const. Use Read-only JNI
array access for input as it's faster than critical access.

Use non-movable arrays for TypedArray so that the address can
be resolved and stored, avoiding the need to do JNI array
access for the output.

Indicies is always non-null, so remove the optional checks.

Eliminate unused return value.

Benchmark results:
twelveKeyInflate 4963us -> 4713us
simpleViewInflate 73us -> 60us

Test: Device boots, benchmarks show faster

Change-Id: Ic3bde5aee31407d8903913f97f2218daf074499a
/frameworks/base/core/jni/android_util_AssetManager.cpp
2dc804be11444565e3d1d151c2a693db3ade94c0 07-Nov-2016 Jason Monk <jmonk@google.com> Allow persistent changes to the vendor overlay theme

This allows the overlay being used to be changed without a new build
but still will require a reboot to take effect. Should no longer be
needed once hierarchical resources are in place, and can be removed.

Also fix check in fd_utils to point at correct location.

Test: Manual
Bug: 32721178
Change-Id: I2a63aea0c87791c8eb845d735cb1182716c8174d
/frameworks/base/core/jni/android_util_AssetManager.cpp
404eb9ce51a07fb990556f34fdef40c071da5539 21-Oct-2016 Jakub Adamek <jakuba@google.com> Fix idmap calls when a subdir is present. am: 56b9987ed7
am: 47c7e1e9f9

Change-Id: I30a8a7531080bd52145219f62133e78198eb1006
47c7e1e9f96e47d4537de1c5e943e132fc0e7840 21-Oct-2016 Jakub Adamek <jakuba@google.com> Fix idmap calls when a subdir is present.
am: 56b9987ed7

Change-Id: Ia58f447ec6bf3b63e2922b02a794f487ec9679d0
56b9987ed749639fb3fae7f90422797c29ed1312 20-Oct-2016 Jakub Adamek <jakuba@google.com> Fix idmap calls when a subdir is present.

We need to increase the size of argv so that the last one remains
a NULL.

Bug: 32202741
Change-Id: I6636b5401fa7a61686a48c9a99b3e54e596033f9
/frameworks/base/core/jni/android_util_AssetManager.cpp
93bbe47d650b7b5e48d705257c0bdfa086300549 21-Oct-2016 Jakub Adamek <jakuba@google.com> Change name of overlay subdir 'sku'->'theme' am: 54dcaaba4f
am: 6bbb63ad91

Change-Id: I71dfaafbebaa7bd61d182405c734eef1ea7ff1eb
6bbb63ad91a707c77dd52f0b6caa12a720732ee1 21-Oct-2016 Jakub Adamek <jakuba@google.com> Change name of overlay subdir 'sku'->'theme'
am: 54dcaaba4f

Change-Id: I4536de644c20171e175cddaff0cd041fb05b3038
ac625e5e2e07896f1db8f54971a795385a554033 20-Oct-2016 TreeHugger Robot <treehugger-gerrit@google.com> Merge "Add tests for attribute resolution"
54dcaaba4fa0392c36864f99b9dc1da9c975a100 19-Oct-2016 Jakub Adamek <jakuba@google.com> Change name of overlay subdir 'sku'->'theme'

The name 'sku' does not fit well as we recommend to use the same
value for different SKUs if vendors wish to have the same colors
on those SKUs.

Bug: 32268656
Change-Id: Ib5e5a3386676453dafeb13a6a6bf91f81bb48a11
/frameworks/base/core/jni/android_util_AssetManager.cpp
3d39a99d9a32bff636aa740b522e3bbc06189dfe 18-Oct-2016 Jakub Adamek <jakuba@google.com> Search for RRO both in SKU subdir and in vendor/overlay am: 1f36a2166b
am: 27471b30de

Change-Id: I5c8655c5f9abe1375c0d53f48705709331d472d9
27471b30deaae5941480dd75f867c31576f7bc93 18-Oct-2016 Jakub Adamek <jakuba@google.com> Search for RRO both in SKU subdir and in vendor/overlay
am: 1f36a2166b

Change-Id: I3d3a3a5e7c9a39616c7289b6587717d6b37a3bf5
7a37b74d37ff79e805c9e97d977e07bfec753c5a 12-Oct-2016 Adam Lesinski <adamlesinski@google.com> Add tests for attribute resolution

- Adds unit tests for attribute resolution. These include
some test data resource tables and compiled XML files.
- Convert touched files to Google style guide.

Test: make libandroidfw_tests
Change-Id: Ib3a36061dc874de5f6a266b4e82c0a12ef435f23
/frameworks/base/core/jni/android_util_AssetManager.cpp
1f36a2166b5bfe9afa2a6379573fda58868c6e28 17-Oct-2016 Jakub Adamek <jakuba@google.com> Search for RRO both in SKU subdir and in vendor/overlay

Currently, if the "ro.boot.vendor.overlay.subdir" property is set, we
only search in the subdir. It seems more powerful to search both in
there and in the standard /vendor/overlay directory.

Also, RRO packages have the "priority" attribute in the <overlay>
attribute in AndroidManifest.xml which serves for disambiguation.

Bug: 32202741
Change-Id: I7acff1b7f0e153830924047349f003295648a53b
/frameworks/base/core/jni/android_util_AssetManager.cpp
4452e137ffc02ab4e32aab2b2ec7192b45d9f494 12-Oct-2016 Adam Lesinski <adamlesinski@google.com> Move attribute resolution from core/jni to libandroidfw

Without the entire JNI environment, testing the attribute
resolution code will be much easier and enable safer
refactoring.

Change-Id: I2815cc1e10a694a3b01bc37e191a0d5e9d0e6735
Test: Existing CTS tests pass
/frameworks/base/core/jni/android_util_AssetManager.cpp
32995223a85a3b774789091d97987dfacc1e9ef3 07-Oct-2016 John Reck <jreck@google.com> Convert utils fastjni -> @FastNative

Test: builds & boots, refactor no behavior change
Change-Id: Ieb569a70fd05b88a8d2bd7b285099c1fc1888a75
/frameworks/base/core/jni/android_util_AssetManager.cpp
e60842aba30adee4cf2057a39ac9a396790e938f 03-Oct-2016 Jakub Adamek <jakuba@google.com> Change name of overlay subdir property to sku.
am: c03d9483f0

Change-Id: I1368890b9c2dde2c5177473da3af0872c0c937a1
c03d9483f0380fb7babfdeb11d6762bc6c8d784c 30-Sep-2016 Jakub Adamek <jakuba@google.com> Change name of overlay subdir property to sku.

Also move the SKU subdirectories directly under /vendor/overlay.

Bug: 31692079
Change-Id: I68c712b13918cc99629534580ee4f77d9e5b3823
/frameworks/base/core/jni/android_util_AssetManager.cpp
ff5cb9888882f02d92ae4abf5dc03495ea5060b1 28-Sep-2016 Jakub Adamek <jakuba@google.com> Search for runtime resource overlays in subdir.
am: 1c15c63578

Change-Id: Ie6614c07851a2365b623a455b2ccc85672d4c846
1c15c635785c64aee961f895dabd184cc2e9e0b1 23-Sep-2016 Jakub Adamek <jakuba@google.com> Search for runtime resource overlays in subdir.

See go/sku-colors. This changes the directory to search for framework
overlays if the right system property is defined. This allows
OEMs to specify different resources based on device SKUs.

Bug: 31692079
Change-Id: I9cb121b286b7f52aa26de1757fde1f3110cd47fd
/frameworks/base/core/jni/android_util_AssetManager.cpp
85e0c89ba55188ecc484538efbfdb570606fc1a2 28-Apr-2016 Chih-Hung Hsieh <chh@google.com> resolve merge conflicts of 1599b981 to nyc-dev-plus-aosp

Change-Id: I90807581e10b6a0024515ff634ac8b29eaa5fc9f
c6baf563ba6aa207a48317c177b29f1d2b70cf3d 27-Apr-2016 Chih-Hung Hsieh <chh@google.com> Fix google-explicit-constructor warnings.

Bug: 28341362
Change-Id: Ibdd6a210bb7ff228e3624cc319169f77aca3b51e
/frameworks/base/core/jni/android_util_AssetManager.cpp
1c686f2ce6cbfa3fdb598f452aa31d38f3eb2320 18-Dec-2015 Roozbeh Pournader <roozbeh@google.com> Avoid matching system locales in locale negotiation

Also:
1. Add AssetManager method for finding non-system locales: This is
used in per-app locale negotiation. (Normally,
AssetManager#getLocales() returns both system and non-system
locales.)

2. Match pseudolocales correctly in locale negotiation.

Bug: 25800576
Bug: 26236938
Change-Id: I116caf3a91c290deb4ad68b291c65b7035b18dd4
/frameworks/base/core/jni/android_util_AssetManager.cpp
0d02bd8442f6c062130aa6b9e6be5f87fddf7fb3 07-Nov-2015 Roozbeh Pournader <roozbeh@google.com> Removed unused setLocale() method.

The setLocale() method in android.content.res.AssetManager was not
used. Removing it to reduce maintenance cost.

Change-Id: I1b168fe84c2465d1ebc2b62bb965eda885e1220a
/frameworks/base/core/jni/android_util_AssetManager.cpp
46cfd93aa22b5a4acab4626c140415eef922445c 03-Nov-2015 Jeff Sharkey <jsharkey@android.com> Let's sprinkle some FastJNI into Resources.

Before:

benchmark us linear runtime
GetColor 14.9 ===========
GetInteger 19.9 ===============
GetLayoutAndTraverse 38.4 =============================
GetString 38.5 ==============================

After:

benchmark us linear runtime
GetColor 13.9 ==========
GetInteger 18.8 ==============
GetLayoutAndTraverse 38.1 =============================
GetString 38.2 ==============================

Change-Id: I8c20e14182d2645bc62a0e7fc6345e298b11933c
/frameworks/base/core/jni/android_util_AssetManager.cpp
4ffea4e4da10c14203a690d67cadf5b39489f84c 13-Oct-2015 Adam Lesinski <adamlesinski@google.com> am d0c806b1: am 6029dfa8: am 7caa8f14: Merge "Make \'idmap --scan\' accept more than one input directory"

* commit 'd0c806b10c8e45dcfa950adc36742b15edababea':
Make 'idmap --scan' accept more than one input directory
83ab0d7c1824f3a29e41af8a95a954c73f48c287 20-Mar-2015 Mårten Kongstad <marten.kongstad@sonymobile.com> Make 'idmap --scan' accept more than one input directory

The 'idmap --scan' command was limited to only scan a single directory
for overlay packages. Update idmap to support any number of directories.

Change-Id: I851f5720a3c1d844235911a0833670652a20a3c8
/frameworks/base/core/jni/android_util_AssetManager.cpp
434a481b2191562582c79be29f24c2e0b5ca60d0 24-Sep-2015 Elliott Hughes <enh@google.com> am ea1831d2: am b57dd722: resolved conflicts for a884d81e to stage-aosp-master

* commit 'ea1831d211ea0e6b2d161c714bb0786369ef2df5':
constify JNINativeMethod function pointer tables
b57dd722f1dc0663417da37d3a82f8283ad3c982 24-Sep-2015 Elliott Hughes <enh@google.com> resolved conflicts for a884d81e to stage-aosp-master

Change-Id: Ice485967fa96f13786024b6939b826638e906ff0
76f6a86de25e1bf74717e047e55fd44b089673f3 19-Sep-2015 Daniel Micay <danielmicay@gmail.com> constify JNINativeMethod function pointer tables

Change-Id: I4036c924958221cbc644724f8eb01c5de3cd7954
/frameworks/base/core/jni/android_util_AssetManager.cpp
a6d7e3fb9c9233b9ae46b702d17433854c43d6a0 02-Sep-2015 Tao Bai <michaelbai@google.com> Load app resource as shared library.

- Added aapt command line flag --app-as-shared-lib to build app resources
that could be loaded as shared lib at runtime.
- Added new method AssetManager.addAssetPathAsSharedLibrary() to load an
app resource as shared library.

Bug 22487604

Change-Id: Ib9b33c35f9c2b7129f3ba205de03d4564623ea39
/frameworks/base/core/jni/android_util_AssetManager.cpp
2349332f9f69189d7889692b9aafd6f80070e352 30-Jul-2015 Filip Gruszczynski <gruszczy@google.com> Only relaunch activity on significant size configuration changes.

Currently if the configuration width/height/smallest width changes, we
relaunch the activity or invoke onConfigurationChanged callback. When it
comes to size based configuration changes it might not be necessary: if
the size change doesn't pass one of the threshold defined by the
resources, it means there is no need to relaunch the activity.

In this CL the ActivityManager will receive the thresholds from the
application and use them to decide, whether to relaunch the activity.
The application reads the thresholds from the resources, specifically
from resource qualifiers used by the app.

Change-Id: Ie3cf0a172dc1ba0b865cf30c2962e7cfd9ad8436
/frameworks/base/core/jni/android_util_AssetManager.cpp
2738c96d998dedfae5b4670d588d0cd299c4ca0f 14-May-2015 Adam Lesinski <adamlesinski@google.com> Add -round and -notround qualifier to android runtime/aapt

The round qualifier denotes a device with a screen shape that
is round. The qualifier shows up after the 'long/notlong' qualifier
and before the orientation 'port/land/square' qualifiers.

Change-Id: I3044258b2703a9165694b79725bade770fa6cea1
/frameworks/base/core/jni/android_util_AssetManager.cpp
e54d245b993e1347cb32c23a6bdc907a45fab324 06-May-2015 Alan Viverette <alanv@google.com> Improve keying for theme caches, rebase system theme on config change

Themes now use an array of applied styles rather than a String to store
their history. They are keyed based on a hash code computed from the
history of applied styles. The themed drawable cache has been abstracted
out into its own class.

Also updates system context to use DayNight as the default and ensures
that GlobalActions uses the correct context, which exercises the change.

CTS tests have been added in another CL.

Bug: 20421157
Change-Id: I9eb4b7dffd198ad24d02f656eaf0839570b59caa
/frameworks/base/core/jni/android_util_AssetManager.cpp
c1d527926e1c82828e42bdc0c7abf50f6decc0a7 05-May-2015 Alan Viverette <alanv@google.com> Add API for obtaining changing configurations bitmask from Theme

Required to know when to reload the system context's theme in response
to configuration changes, and thus needed to support the DayNight theme.

Bug: 20267825
Change-Id: I7df5e28b7a6d8b611ea030032544cf4800788514
/frameworks/base/core/jni/android_util_AssetManager.cpp
9438ad1599716176fb6c593e77a2e93b265bbcb5 03-Dec-2014 Adam Lesinski <adamlesinski@google.com> am e580d661: am e89a2865: Merge changes If2c7e09f,Ie21f227c

* commit 'e580d6617f67a1db5eff7ffe5450684cfc7e1a2b':
RRO idmap: pad with 0xffffffff, not 0x00000000
RRO: reintroduce lost ResTable insert of assets
e89a286541e242ad96705fcdd1fe2c6a9eafb4a0 02-Dec-2014 Adam Lesinski <adamlesinski@google.com> Merge changes If2c7e09f,Ie21f227c

* changes:
RRO idmap: pad with 0xffffffff, not 0x00000000
RRO: reintroduce lost ResTable insert of assets
3a091b79978caa9b5d58ae19f693279e5a717c2a 21-Nov-2014 Dan Albert <danalbert@google.com> resolved conflicts for merge of 8e0cfe7c to lmp-mr1-dev-plus-aosp

Change-Id: I068d2a0fb118d4e2b4c1e546bebfcbc2cb120d36
582bdf9a5961a32de27556832e23e0611c4d1cbb 21-Nov-2014 Dan Albert <danalbert@google.com> am d8c169fe: am 0c437fd3: Merge "Add appropriate casts for char16_t."

* commit 'd8c169fedf883491e46b354484909694fd52cfaf':
Add appropriate casts for char16_t.
8e357bf54173c3f83584c10983392f0d87e0b2b3 20-Nov-2014 Dan Albert <danalbert@google.com> Merge "Fix clang warnings in core/jni."
6698749dd4d4d6513b26aa9071af290b956b68a7 20-Nov-2014 Dan Albert <danalbert@google.com> Add appropriate casts for char16_t.

C++11 defines a real char16_t, which is not implicitly convertible to
uint16_t (and by extension jchar). Add casts as needed.

Bug: 18300613
Change-Id: I00752002ef2e938bdb57f70947e8fd53ec103293
/frameworks/base/core/jni/android_util_AssetManager.cpp
46d8444631b4b1253a76bfcc78a29d26014d022f 19-Nov-2014 Dan Albert <danalbert@google.com> Fix clang warnings in core/jni.

There are a few bugs in here too (mostly people expecting + to
concatenate C strings) :(

Change-Id: I0a243c05c4ea8b56e84896f37814d0fbea4c39d5
/frameworks/base/core/jni/android_util_AssetManager.cpp
387116f557c3d3ecf7bd82e1d9dd1910ca4c4a3d 19-Nov-2014 Andreas Gampe <agampe@google.com> am c3507d10: Merge "Frameworks/base: Replace LOG_FATAL_IF in core/jni"

* commit 'c3507d1098a444176a7270cba7e5299af7f77350':
Frameworks/base: Replace LOG_FATAL_IF in core/jni
987f79f60bb1f0a4bcd3ef22e57301c743f0b94f 19-Nov-2014 Andreas Gampe <agampe@google.com> Frameworks/base: Replace LOG_FATAL_IF in core/jni

Do not use LOG_FATAL_IF in JNI setup. This is one-time on startup
and important enough to always check.

Add a header with common helper definitions. Move to inlined functions
instead of macros to clean up the code.

Change-Id: Ib12d0eed61b110c45d748e80ec36c563e9dec7e5
/frameworks/base/core/jni/android_util_AssetManager.cpp
11bdd5b10b5f921b657283fa94463263171218d5 17-Nov-2014 Adam Lesinski <adamlesinski@google.com> Merge commit '06d8b7b8' into manualmerge

Conflicts:
core/jni/android_util_AssetManager.cpp

Change-Id: I77b72d0d3ec8184ccd97419e4c76b7d55b1a52ca
035a7b0235835e856f39623fc571668e2d6048da 14-Nov-2014 Andreas Gampe <agampe@google.com> am 0626ec58: Merge "Frameworks/base: Wall Werror in core/jni"

* commit '0626ec58243c9dc7f4812a453ef9456b1f7ff1f4':
Frameworks/base: Wall Werror in core/jni
0f0b4919667f418b249c497f5ad3e83fdf4437e5 12-Nov-2014 Andreas Gampe <agampe@google.com> Frameworks/base: Wall Werror in core/jni

Turn on -Wall -Werror in core/jni. Fix warnings.

Clang TODO: For GCC we need to turn off Wunused-but-set-variable in
the GL bindings. However, Clang doesn't have that warning and thus
complains about an unknown pragma. It is necessary to make the
pragma #ifdef-ed on the compiler being GCC.

Change-Id: I14cab48d45c2771eef0432082356c47ed44a3d7f
/frameworks/base/core/jni/android_util_AssetManager.cpp
044f323e624084de464e780828f1d7f204e4d01d 11-Nov-2014 Adam Lesinski <adamlesinski@google.com> am 24c16b7e: Merge "Frameworks/base: Fix AssetManager JNI"

* commit '24c16b7e4cdbacedd33347a01ff4944abfc86218':
Frameworks/base: Fix AssetManager JNI
328126190b053b0388ddfab778d81cc73dcff81f 11-Nov-2014 Andreas Gampe <agampe@google.com> Frameworks/base: Fix AssetManager JNI

Register the right method.

Change-Id: Ib5f5c531b4c5863eed04fe3b13f8c2662055fa5e
/frameworks/base/core/jni/android_util_AssetManager.cpp
30113131fb958850ef92c6a8f7f2aa2ed92a8ffe 07-Nov-2014 Mårten Kongstad <marten.kongstad@sonymobile.com> RRO: reintroduce lost ResTable insert of assets

With the recent introduction of AssetManager::appendPathToResTable,
overlay packages were not properly added to the AssetManager, and once
added, were not properly inserted into the ResTable.

Bug: 17765434
Change-Id: Ie21f227c654c98730f74a687d0e16ee2b80e747e
/frameworks/base/core/jni/android_util_AssetManager.cpp
a7d1d73a477fe512d9ea69ee2883084630ec24c4 02-Oct-2014 Adam Lesinski <adamlesinski@google.com> Implement back-tracking when searching for attributes in XML or resource bag

Shared libraries have their package ID assigned at run-time, so some
of the guarantees we used to have about sort order of attributes in
bags or XML elements no longer hold.

This CL adds back-tracking and can jump to the nearest attribute with the
same package ID and continue searching.

This means that attributes with the same package ID must be sorted by increasing
resource ID, as was the case before.

Attributes with the same package ID must be grouped together, but the groups can
be in any order. Ex: 0x02010001, 0x02010002, 0x01010000, 0x01010010, 0x7f010032

Bug:17666947
Change-Id: I9c198bbb6ca788849aac85b6323606ea5d9550d6
/frameworks/base/core/jni/android_util_AssetManager.cpp
f2969405020a72e282c348a6ea201d56e9f8d4ba 30-Oct-2014 Alan Viverette <alanv@google.com> Distinguish unspecified and explicit null values in resources

BUG: 17919345
Change-Id: Ic4f04f7dd0f986f58a749b5950d80c1cfdb074ea
/frameworks/base/core/jni/android_util_AssetManager.cpp
908c748096d855d47da2f5e20fd4d9d31d1e603c 01-Oct-2014 Adam Powell <adamp@google.com> Revert "Fix issue with using locally defined attrs in a shared lib"

This reverts commit 5069dd69898bd0d9c69ba2bbd37239ec8d1c9dc6.

The reverted commit caused issues loading resources supplied by static libraries.

Bug 17748356

Change-Id: I860a4f31451ee7c03c02974826472a67226b029f
/frameworks/base/core/jni/android_util_AssetManager.cpp
5069dd69898bd0d9c69ba2bbd37239ec8d1c9dc6 01-Oct-2014 Adam Lesinski <adamlesinski@google.com> Fix issue with using locally defined attrs in a shared lib

The attribute name resource IDs were never fixed up with
the runtime package ID so we weren't finding attributes
whenever the runtime package ID was different than the build
time one, which happened to be when a shared lib referenced itself
(0x00 vs 0x02).

Bug:17666947
Change-Id: Icf3e874bcea0e27eebe42d60fbed626a34bf9266
/frameworks/base/core/jni/android_util_AssetManager.cpp
607bd848269fb802550e63aa61945790616f97a7 12-Sep-2014 Alan Viverette <alanv@google.com> Update icons to vectors, fix preload theming & vector tinting

Adds a missing JNI binding to AssetManager, ensures drawables have
default tint modes as documented, and updates vector tint appropriately
when state changes.

BUG: 17385604
Change-Id: Ice92885989ebc13b95952f5dc3b7904cc956da12
/frameworks/base/core/jni/android_util_AssetManager.cpp
042ad633bc68bdda2bb0c50216706d73575a5992 04-Sep-2014 Jon Miranda <jonmiranda@google.com> Added getStyleAttributes to access all Theme attributes.

ViewDebug uses getStyleAttributes to get the attributes, and then gets the
attribute name and value so that Hierarchy Viewer can display it.

Bug: 17407087
Change-Id: I3577e32ae99668383701dc908bb46db14a75c3c4
/frameworks/base/core/jni/android_util_AssetManager.cpp
ccf25c7bf69eb8c04246e3f79da31b52c2922a80 09-Aug-2014 Adam Lesinski <adamlesinski@google.com> Fix shared library bug in bag attributes

A ResTable_map entry has a name attribute, which
could be a dynamic reference if it comes from
a shared library. It was not being patched with
the correct package id.

Bug:16795890
Change-Id: Ia8df6a943269b2fefb2132c3ed74eb1997d7701b
/frameworks/base/core/jni/android_util_AssetManager.cpp
de898ff42912bd7ca1bfb099cd439562496765a4 30-Jan-2014 Adam Lesinski <adamlesinski@google.com> Shared library resource support

Shared libraries can now export resources for applications
to use.

Exporting resources works the same way the framework exports
resources, by defining the public symbols in res/values/public.xml.

Building a shared library requires aapt to be invoked with the
--shared-lib option. Shared libraries will be assigned a package
ID of 0x00 at build-time. At runtime, all loaded shared libraries
will be assigned a new package ID.

Currently, shared libraries should not import other shared libraries,
as those dependencies will not be loaded at runtime.

At runtime, reflection is used to update the package ID of resource
symbols in the shared library's R class file. The package name of
the R class file is assumed to be the same as the shared library's
package name declared in its manifest. This will be customizable in
a future commit.

See /tests/SharedLibrary/ for examples of a shared library and its
client.

Bug:12724178
Change-Id: I60c0cb8ab87849f8f8a1a13431562fe8603020a7
/frameworks/base/core/jni/android_util_AssetManager.cpp
52b999f0721b53e9c6e18a4bd664e89aeb65b2d5 25-Mar-2014 Alan Viverette <alanv@google.com> Implement APIs for obtaining, caching themed Drawables

When Drawables are inflated during preload (or otherwise without a theme)
they cache their themeable attributes in their constant state as an array
keyed on attribute index. Drawables inflated with a theme will simply
resolve theme attributes as part of normal inflation, and they will not
cache any themeable attributes.

Drawables obtained from Resources are pulled from theme-specific cache
when possible. If an unthemed Drawable exists in the preload cache, a
new constant state will be obtained for the Drawable and the theme will
be applied by resolving the cached themeable attributes and overwriting
their respective constant state properties. If no cached version exists,
a new Drawable is inflated against the desired theme.

Constant states from themed drawables may be cached if the applied theme
is "pure" and was loaded from a style resource without any subsequent
modifications.

This CL does not handle applying themes to several Drawable types, but it
fully supports BitmapDrawable, GradientDrawable, NinePatchDrawable,
ColorDrawable, and TouchFeedbackDrawable.

BUG: 12611005
Change-Id: I4e794fbb62f7a371715f4ebdf946ee5f9a5ad1c9
/frameworks/base/core/jni/android_util_AssetManager.cpp
48d22323ce39f9aab003dce74456889b6414af55 31-Jan-2014 Mårten Kongstad <marten.kongstad@sonymobile.com> 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
/frameworks/base/core/jni/android_util_AssetManager.cpp
896043d67d3ac75760bd99db8a1561e31ebee1e1 17-Jan-2014 Ashok Bhat <ashok.bhat@arm.com> AArch64: Make AssetManager and related classes 64-bit compatible

Following changes have been done:

[x] Long is used to store native pointers as pointers can be
64-bit.

[x] AssetManager openAsset native function returned -1 if
file name was empty and java function considered any
non-zero value as success. This has been fixed by native
function throwing Illegal Argument Exception as well.

[x] AssetManager incRefsLocked and decRefsLocked now accept
long as input to support 64-bit native references.

[x] AssetManager incRefsLocked method incorrecly used
'this.hashCode()' instead of the passed parameter id.
This has been fixed.

[x] Some minor changes have been done to conform with
standard JNI practice (e.g. use of jint instead of int
in JNI function prototypes)

Change-Id: I095b9f900d49e51f43ad6afc47cbc23116a6a64a
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
/frameworks/base/core/jni/android_util_AssetManager.cpp
745d4efc8369d255341d810790132660e33d3b61 27-Jan-2014 Narayan Kamath <narayan@google.com> AssetManager cookies should be int32_t and not void*.

Cookies are really indices into vectors and arrays, so
they don't need to be void*. We choose int32_t instead
of size_t to allow their width to be well specified.

(cherry picked from commit ebfdd0f467e39c3af8d92cade78263935340acb7)
(cherry picked from commit a7fa2e592e2e579e5acdb903dba83fc074ebc215)
(cherry picked from commit a9d5701b034ed2d9771b3f0943e1add00741d7cd)

Change-Id: I2aed3db568b6fdc487bf99e2c5dd123206736fda
/frameworks/base/core/jni/android_util_AssetManager.cpp
d45c68dd24fe3dd510af5a9591b5e2f509b56772 31-Jul-2013 Dianne Hackborn <hackbod@google.com> Resource memory optimization.

Don't ever need the cached UTF-16 string conversions on the
device. Don't need to create those strings, and don't need
to create the lookup array for them at all. This requires
fixing all of the remaining places in the platform where we
interacted with the resources with the blind assumption that
the strings are UTF-16.

Change-Id: Ia0e5a150499837471e494e85b23b05fa06e0cf1d
/frameworks/base/core/jni/android_util_AssetManager.cpp
1d4cd879044578cf7e2b37d45ef29abaabf7e662 18-Jun-2013 Dianne Hackborn <hackbod@android.com> am 11cd57ca: Merge "Avoid unnecessary FindClass("java/lang/String")."

* commit '11cd57caee4058dab743b91e715d7469c59a5c2f':
Avoid unnecessary FindClass("java/lang/String").
aa5fe3d206f72c4e7ff6632e169de2d0df6672e2 17-Jun-2013 Vladimir Marko <vmarko@google.com> Avoid unnecessary FindClass("java/lang/String").

Use previously retrieved global reference instead.
Check for NULL after creating the global reference.

Change-Id: I21670d2ef0f63ddb5801dd21e7e56359e5519479
/frameworks/base/core/jni/android_util_AssetManager.cpp
f7be4800df28d7cb6a96003046bf90245e7054ab 12-Apr-2013 Dianne Hackborn <hackbod@google.com> Add new resources trace, also trace apk dex loading.

Change-Id: Ia48566efb21ee018659bd976ddb3a0f4997b9a3a
/frameworks/base/core/jni/android_util_AssetManager.cpp
1f7d30770abf0c243e7f577df785ad256b8bfcb0 12-Feb-2013 Dianne Hackborn <hackbod@google.com> Fix build.

Change-Id: Iaace063eaa65af842effa3e0b481a0629db58e42
/frameworks/base/core/jni/android_util_AssetManager.cpp
e5b50a65ad26a32f6e58588ffdcbc0389eac9257 12-Feb-2013 Dianne Hackborn <hackbod@google.com> Fix issue #8176917: Stabillity : Native Crash :

/system/lib/libandroidfw.so

Change-Id: I235470fac7ad0f5a5d3432006f4dfa69620e30d8
/frameworks/base/core/jni/android_util_AssetManager.cpp
fb5c3dba4ddac023cfd4cdcabdfdbcf343197c94 19-May-2012 Dianne Hackborn <hackbod@google.com> Fix issue #6440173: MenuItem.setIcon(Drawable) scaling incorrectly...

...when resource is aliased

We were not correctly using the final resolved configuration when
retrieving a drawable through Resources.getDrawable(). (It already
does the correct behavior when going through TypedArray.getDrawable()).

Change-Id: I9032b788b592412178e31e2e6b0181b92c20fe45
/frameworks/base/core/jni/android_util_AssetManager.cpp
b13b9bdad2baf6ad1ec2e56b6b7598fa20f55fc4 18-Feb-2012 Mathias Agopian <mathias@google.com> frameworks/base refactoring.

step 2: move libutils headers to their new home: androidfw

Change-Id: I14624ba23db92a81f2cb929f104386e1fab293ef
/frameworks/base/core/jni/android_util_AssetManager.cpp
129e19cb37b1d30f8c46f77a3853d347c3e78bb3 11-Jan-2012 Glenn Kasten <gkasten@google.com> Fix build warnings

Change-Id: I334e0a6e018bb1067c90e050cf3583c1057aacd9
/frameworks/base/core/jni/android_util_AssetManager.cpp
71f2cf116aab893e224056c38ab146bd1538dd3e 20-Oct-2011 Steve Block <steveblock@google.com> Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/143865

Bug: 5449033
Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
/frameworks/base/core/jni/android_util_AssetManager.cpp
161e67ff3ba26408eea09221734ad2e29a1eed11 20-May-2011 Dianne Hackborn <hackbod@google.com> resolved conflicts for merge of 06a8ceac to master

Change-Id: Id51574c825affddfac14ad7214c5496d6a3d6e69
69cb87576ba163b61bb0e6477a3b7c57a9b11d40 20-May-2011 Dianne Hackborn <hackbod@google.com> Add new "-swNNNdp" resource qualifier.

Change-Id: I0101e88ca9d8d44138bdcaf571f24b0352f4f6ce
/frameworks/base/core/jni/android_util_AssetManager.cpp
ebff8f92f13513ce37bd74759eb1db63f2220590 13-May-2011 Dianne Hackborn <hackbod@google.com> DO NOT MERGE. Integrate add new screen width/height in "dp" configs.

You can now specify resource configuration variants "wNNNdp"
and "hNNNdp". These are the minimum screen width/height in "dp"
units. This allows you to do things like have your app adjust
its layout based only on the about of horizontal space available.

This introduces a new configuration change flag for screen size.
Note that this configuration change happens each time the orientation
changes. Applications often say they handle the orientation change
to avoid being restarted at a screen rotation, and this will now
cause them to be restarted. To address this, we assume the app can
handle this new config change if its target SDK version is < ICS.

Change-Id: I4acb73d82677b74092c1da9e4046a4951921f9f4
/frameworks/base/core/jni/android_util_AssetManager.cpp
a3804cf77f0edd93f6247a055cdafb856b117eec 12-Apr-2011 Elliott Hughes <enh@google.com> You don't need to poke around inside FileDescriptor manually.

We can help you with that.

Note also that getParcelFileDescriptorFD did no such thing. All its callers
were passing in a regular java.io.FileDescriptor and expecting the int. No
ParcelFileDescriptors involved.

Change-Id: Idc233626f20c092e719f152562601f406cc1b64a
/frameworks/base/core/jni/android_util_AssetManager.cpp
69a017bc1d1649350f830dfada5c6ed5eac0b770 08-Apr-2011 Elliott Hughes <enh@google.com> More JNI exception-throwing cleanup.

There are a few (unimportant) bug fixes here. There were several attempts to
throw exceptions in situations where there's already a pending exception.

There were also cases where the code was wrong; it was checking for a NULL
return from Get*ArrayElements and throwing NPE, but passing NULL is an error
that causes a crash and a NULL return means an exception has already been
thrown. I didn't want to get into the Scoped* classes just yet, but that
was by far the easiest way to fix this.

Change-Id: I0b31160ee51b96e82539f6514b8412b149dba7c3
/frameworks/base/core/jni/android_util_AssetManager.cpp
3fc982f41fda1f254bfbc35490d81cd82a0ed90a 31-Mar-2011 Dianne Hackborn <hackbod@google.com> Add new resource configurations for screen width/height in "dp".

You can now specify resource configuration variants "wNNNdp"
and "hNNNdp". These are the minimum screen width/height in "dp"
units. This allows you to do things like have your app adjust
its layout based only on the about of horizontal space available.

This introduces a new configuration change flag for screen size.
Note that this configuration change happens each time the orientation
changes. Applications often say they handle the orientation change
to avoid being restarted at a screen rotation, and this will now
cause them to be restarted. To address this, we assume the app can
handle this new config change if its target SDK version is < ICS.

Change-Id: I22f8afa136b4f274423978c570fa7c9855040496
/frameworks/base/core/jni/android_util_AssetManager.cpp
c1318babb44dded89b88fb5df950b5cd6c6f83da 03-Mar-2011 Carl Shapiro <cshapiro@google.com> Establish a global reference before saving a class into a global.

A local reference is obtained to the string class for the purpose of
using it later in another routine to create string object arrays.
However, the local reference is invalid by the time it is next used.
Making the string class reference a global reference eliminates the
problem.

Change-Id: I8a04642e0ed3060f2fff2cb63996559f004aacff
/frameworks/base/core/jni/android_util_AssetManager.cpp
7fbe4d2e7445ad4db07a42c74fe2934af46d1c7f 20-Jan-2011 Kenny Root <kroot@google.com> Don't pay attention to string block on @null

When someone referenced an empty string by putting in the special value
"@null" the string block was kept, but when filtering themes this wasn't
filtered because the framework thought it was actually a null string.

Bug: 3000940
Change-Id: I1e9a0479ef761b3e388b562ae728c5da0f4b5deb
/frameworks/base/core/jni/android_util_AssetManager.cpp
ddb76c4644756b31be948d70aaa8ee541dd94999 24-Nov-2010 Kenny Root <kroot@google.com> Change assets to use 64-bit API

The asset system and supporting libraries were using off_t instead of
off64_t to access files larger than 2GB (32-bit signed). This change
replaces all off_t with off64_t and lseek64.

There is a new utils/Compat.h added for Mac OS compatibility.

Also fixed some size-related compiler warnings.

Bug: 3205336
Change-Id: I9097b3cb7a602e811fe52f245939d8975da55e9e
/frameworks/base/core/jni/android_util_AssetManager.cpp
d7c8672ccc8ccd1f99da60accc63d6817d41ac52 18-Nov-2010 Olivier Bailly <olivier@google.com> fix int vs. pointer mismatch in return statement.
Add missing include header for compilation on x86 target.

Change-Id: I3651fb3be0178b888c5ada3d3754fb379b55a847
/frameworks/base/core/jni/android_util_AssetManager.cpp
55fc850cf992cdcb0993cb109d2f716613c0dbdd 28-Oct-2010 Kenny Root <kroot@google.com> Add path to get different DPI drawables

Allow a caller to request a different density than their current display
allows. This can mean a device displaying mdpi can get a resource that's
in hdpi and have it pretend to be in mdpi resolution. If a drawable
that's returned is not in the requested density, it will set it at the
appropriate density to be scaled up later on.

The API for this is hidden currently.

Bug: 3134688
Change-Id: I6c3908cbdef4907b8d3f1576df9e3b0e7af1755a
/frameworks/base/core/jni/android_util_AssetManager.cpp
0db187a3e62074af6a22802bded52a921f69e7df 27-Aug-2010 Gilles Debunne <debunne@google.com> Broken build. Missing ;

Change-Id: Ic266e491a73fb3df00e77111a4ad9f270741c28b
/frameworks/base/core/jni/android_util_AssetManager.cpp
4d4040b7b3c46ea29a42878c14b325f09f0029ad 27-Aug-2010 Gilles Debunne <debunne@google.com> Fix for 512 limit in assetManager.list

Also replaced all doThrow by jniThrow.

OutOfMemory after string creation were removed: should have been thrown before.

Bug http://b/issue?id=2949164

Change-Id: Idea8e27fdedeb43e3976776c477766e4dcdebcf8
/frameworks/base/core/jni/android_util_AssetManager.cpp
485dd21bbefde378c392da3de48887aee9fabebe 07-May-2010 Kenny Root <kroot@google.com> Prevent local reference table overflows

If we're grabbing references to many strings in a loop, we have to
remove our local references so we don't overflow the VM's local
reference table.

Also, use env->ExceptionCheck() instead of checking for NULL value
returns on trying to allocate new items.

Bug: 2663816
Change-Id: I9cb5e17f6181dbb2f2c03d53841b2f5d8ab10f68
/frameworks/base/core/jni/android_util_AssetManager.cpp
20cb56e26e91df91bd64d4251222e0d421cdbe47 04-Mar-2010 Dianne Hackborn <hackbod@google.com> Fix some bugs.

Bug #2376231: Apps lose window focus (and back key causes ANR) if the
lock screen is dismissed while the phone is in landscape mode

This is another case where we weren't recomputing the focused window
after changing the visibility policy.

bug #2479958: Investigate source of "Resources don't contain package
for resource number 0x7f0a0000"

Um, okay, so it turns out there were bugs all over the place where
we would load an XML resource from a another application, but not
use the Resources for that application to retrieve its resources...!
I think the only reason any of this stuff was working at all was
because it typically only cared about retrieving the resource
identifiers of the items (it would look up the values later).

Bug #2401082: Passion ERE26 monkey crash - InputMethodManagerService

Add some null checks.
/frameworks/base/core/jni/android_util_AssetManager.cpp
780d2a1b714724d85227141c76b3c64f543f00b4 23-Feb-2010 Kenny Root <kroot@google.com> Use UTF-8 strings to avoid duplicate caching, part 1

StringBlock instances containing UTF-8 strings use a cache to convert
into UTF-16, but using that cache and then using a JNI call to NewString
causes the UTF-8 string as well as two copies of the UTF-16 string to
be held in memory. Getting the UTF-8 string directly from the StringPool
eliminates one copy of the UTF-16 string being held in memory.

This is part 1. Part 2 will include ResXMLParser optimizations.

Change-Id: Ibd4509a485db746d59cd4b9501f544877139276c
/frameworks/base/core/jni/android_util_AssetManager.cpp
27b28b3f62bd3b54fa13acd5d035940b9be464f3 09-Feb-2010 Tobias Haamel <haamel@google.com> Introduce special UI modes for night and car usage.

The device mode is now called ui mode. Furthermore is the order of
precedence for the resources now in such a way that the ui mode needs
to be specified after the orientation and before the density.

The ui mode can be set, like it is done for the locale, as follows:

IActivityManager am = ActivityManagerNative.getDefault();
Configuration config = am.getConfiguration();
config.uiMode = Configuration.UI_MODE_TYPE_CAR | Configuration.UI_MODE_NIGHT_ANY;
am.updateConfiguration(config);

To allow users to disable the car mode and set the night mode the IUiModeManager
interface is used.

The automatic night mode switching will be added in a separate change.
/frameworks/base/core/jni/android_util_AssetManager.cpp
dc4cc3f469097150921a20dac49a5ccb54f83788 06-Jan-2010 Joe Onorato <joeo@android.com> Stop spamming the log.
/frameworks/base/core/jni/android_util_AssetManager.cpp
b8d81679553ee33f6ae5281310abf2effca4ffcd 20-Nov-2009 Dianne Hackborn <hackbod@google.com> Debugging for issue #2228381 android.view.InflateException

Binary XML file line #37: Error inflating class <unknown> after adding a secondary account

Now that I have these debug logs, I want to keep them since they will make
debugging these kinds of issues a lot easier in the future. (Note in this
case there was no problem in the framework.)

Change-Id: If2b0bbeda4706b7c5dc1ba4a5db04b74f40e1543
/frameworks/base/core/jni/android_util_AssetManager.cpp
82e1ee93eece8fb0aec6acc3ef4ee7b1c86feec7 12-Aug-2009 Dianne Hackborn <hackbod@google.com> Fix issue #2048263: More debugging information

We now hopefully do better about generating the anr reports, and include
information about the malloc loaded assets in meminfo.
/frameworks/base/core/jni/android_util_AssetManager.cpp
0d221012ff5fd314711c00ed30e9b807b9c454c1 30-Jul-2009 Dianne Hackborn <hackbod@google.com> Fix #2018814: System cannot correctly render assets with "wrap_content" attribute in QVGA

It turns out we were not returning the density for anything retrieved from a
TypedArray... which basically means any bitmap references from a layout or style...!!!

This is now fixed.

Also fiddle with the density compatibility mode to turn on smoothing in certain situations,
helping the look of things when they need to scale and we couldn't do the scaling at
load time.
/frameworks/base/core/jni/android_util_AssetManager.cpp
c4db95c077f826585d20be2f3db4043c53d30cf5 22-Jul-2009 Dianne Hackborn <hackbod@google.com> First pass at reworking screen density/size APIs.

This changes the names of the directories in aapt, to what you see
in the list of DpiTest resources. Also adds a new "long" configuration
for wide screens, which the platform sets appropriate, and introduces
a new kind of resizeability for not large but significantly larger
than normal screens which may have compatibility issues.
/frameworks/base/core/jni/android_util_AssetManager.cpp
723738cfaec3dd7b0fe152c872c41bebf94074c4 26-Jun-2009 Dianne Hackborn <hackbod@google.com> Expand support for different screen sizes.

Applications can now declare that they support small, normal, or
large screens. Resource selection can also be done based on these
sizes. By default, pre-Donut apps are false for small and large,
and Donut or later apps are assumed to support all sizes. In either
case they can use <supports-screens> in their manifest to declare
what they actually support.
/frameworks/base/core/jni/android_util_AssetManager.cpp
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/jni/android_util_AssetManager.cpp
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
/frameworks/base/core/jni/android_util_AssetManager.cpp
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
/frameworks/base/core/jni/android_util_AssetManager.cpp
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
/frameworks/base/core/jni/android_util_AssetManager.cpp
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
/frameworks/base/core/jni/android_util_AssetManager.cpp