342 Commits

Author SHA1 Message Date
Roozbeh Pournader
1c686f2ce6 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
2016-01-04 13:53:54 -08:00
Tao Bai
1375e5f180 Add test to cover loading shared-lib with appAsLib as true.
This patch made AppAsLib_test use its own resource

Bug 22487604

Change-Id: Iac4cc949f1b25c326a287a49e0b031bf6831e9e9
2015-11-06 14:33:49 -08:00
Tao Bai
ab5bca1519 Merge "Load app resource as shared library." 2015-09-09 16:08:12 +00:00
Tao Bai
a6d7e3fb9c 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
2015-09-08 18:48:42 -07:00
Dan Willemsen
a3e05c4ccb am 83533a23: am 13786e28: am 60dd5d59: Merge "Remove USE_MINGW, whitelist windows modules"
* commit '83533a235c64a3b3cbecf152b678585f1e6b3577':
  Remove USE_MINGW, whitelist windows modules
2015-09-01 17:05:59 +00:00
Dan Willemsen
13786e281e am 60dd5d59: Merge "Remove USE_MINGW, whitelist windows modules"
* commit '60dd5d5966ebe993f5a81c46d9dea62c207abfd3':
  Remove USE_MINGW, whitelist windows modules
2015-09-01 16:37:10 +00:00
Dan Willemsen
4aa679ff96 Remove USE_MINGW, whitelist windows modules
Bug: 23566667
Change-Id: Ie6b8c51e2b6d6273f99f4e361c440136d7c6915c
2015-08-28 15:28:26 -07:00
Dan Albert
344e838d22 am 598319d0: am 16e5aba9: am 4a2a890b: Merge "Fix mismatched new[]/delete."
* commit '598319d01743427aa67faf4f54ae6d837c8c6d2e':
  Fix mismatched new[]/delete.
2015-08-14 21:49:13 +00:00
Dan Albert
598319d017 am 16e5aba9: am 4a2a890b: Merge "Fix mismatched new[]/delete."
* commit '16e5aba9c8157b3ffdcdceda378896a43f074748':
  Fix mismatched new[]/delete.
2015-08-14 21:43:19 +00:00
Dan Albert
f13f1efab2 am 16e5aba9: am 4a2a890b: Merge "Fix mismatched new[]/delete."
* commit '16e5aba9c8157b3ffdcdceda378896a43f074748':
  Fix mismatched new[]/delete.
2015-08-14 21:43:16 +00:00
Dan Albert
8dc8313c3e Fix mismatched new[]/delete.
The new clang will emit a warning for this.

Change-Id: Ie0edc46461eb5edb2a7ad33a3a7f6cef2d825c36
2015-08-14 14:12:29 -07:00
Elliott Hughes
4c807349bd am 344d347a: am 39669d7f: am 6fdc6333: Merge "Lose HAVE_ANDROID_OS from frameworks/base."
* commit '344d347af22705aa2fa80602d27a5682a72b5f69':
  Lose HAVE_ANDROID_OS from frameworks/base.
2015-08-12 23:56:18 +00:00
Elliott Hughes
344d347af2 am 39669d7f: am 6fdc6333: Merge "Lose HAVE_ANDROID_OS from frameworks/base."
* commit '39669d7f6b8fedef3468ab3d417c93a21df528af':
  Lose HAVE_ANDROID_OS from frameworks/base.
2015-08-12 23:28:30 +00:00
Elliott Hughes
17b4be07fe am 39669d7f: am 6fdc6333: Merge "Lose HAVE_ANDROID_OS from frameworks/base."
* commit '39669d7f6b8fedef3468ab3d417c93a21df528af':
  Lose HAVE_ANDROID_OS from frameworks/base.
2015-08-12 23:21:56 +00:00
Elliott Hughes
ba3fe56edc Lose HAVE_ANDROID_OS from frameworks/base.
Change-Id: I713881fdbaec7cbbb5e7f2f4be6f9b8be3d2ca4e
2015-08-12 14:49:53 -07:00
Filip Gruszczynski
2349332f9f 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
2015-08-10 13:47:31 -07:00
Yusuke Sato
3a4d02220f am 61234dea: am bd4c482b: Merge "Clean up AssetManager::scanAndMergeZipLocked"
* commit '61234deafe78ded05569edfab24536cdb4bd7720':
  Clean up AssetManager::scanAndMergeZipLocked
2015-08-06 01:40:24 +00:00
Yusuke Sato
e15a5871bd am 61234dea: am bd4c482b: Merge "Clean up AssetManager::scanAndMergeZipLocked"
* commit '61234deafe78ded05569edfab24536cdb4bd7720':
  Clean up AssetManager::scanAndMergeZipLocked
2015-08-06 01:39:44 +00:00
Yusuke Sato
c1efd41f3f Fix build breakage caused by I5ebe0438019958d883a7fda6bd92ea4484211d23 (AOSP)
Change-Id: Icea0ac00c56b5c8aa21134fc49b518cda4759e36
2015-08-05 14:41:52 -07:00
Yusuke Sato
fa451e3776 am 5387f60b: Merge "Fix build breakage caused by r.android.com/162907" into mnc-dr-dev-plus-aosp
* commit '5387f60ba26ae89e31e776202fbf13287dc620a8':
  Fix build breakage caused by r.android.com/162907
2015-08-05 20:44:58 +00:00
Yusuke Sato
6120883971 am 3251f2aa: am 3383b141: am a024acb8: Merge "Let findSupportedAbi and hasRenderscriptBitcode scan only relevant files"
* commit '3251f2aab75c8c905cc59b428d99812b5575ebdb':
  Let findSupportedAbi and hasRenderscriptBitcode scan only relevant files
2015-08-05 20:36:43 +00:00
Yusuke Sato
ead2088efe Fix build breakage caused by r.android.com/162907
Change-Id: Ifeb7b57ce79f3d8c0edadf03d14853e72840d49e
2015-08-05 13:14:53 -07:00
Yusuke Sato
3251f2aab7 am 3383b141: am a024acb8: Merge "Let findSupportedAbi and hasRenderscriptBitcode scan only relevant files"
* commit '3383b141c3ac4426279e649ebcee535890203c3f':
  Let findSupportedAbi and hasRenderscriptBitcode scan only relevant files
2015-08-05 19:09:41 +00:00
Yusuke Sato
eb24da62ac am 3383b141: am a024acb8: Merge "Let findSupportedAbi and hasRenderscriptBitcode scan only relevant files"
* commit '3383b141c3ac4426279e649ebcee535890203c3f':
  Let findSupportedAbi and hasRenderscriptBitcode scan only relevant files
2015-08-05 19:05:17 +00:00
Yusuke Sato
05f648e1d3 Clean up AssetManager::scanAndMergeZipLocked
Now that ZipFileRO::startIteration supports prefix/suffix matching,
we can pass dirName to the function for simpler code and slightly
better performance.

(cherry-pick of c796ad0a8be6df4a3b354690dfe5ce1df8136c09)

Change-Id: I0e2ac58de28020c2af8d8e569a97592b09596185
2015-08-03 17:24:42 -07:00
Yusuke Sato
957c23775f Let findSupportedAbi and hasRenderscriptBitcode scan only relevant files
for better performance. Without the optimization, these two functions
may check more than 100k file names in the pre-installed APK files,
which can take a few seconds to finish even on a recent device.

(cherry-pick of 34fe3df8519523dbb4bc27010fa57f259d5e868d)

Bug: 21957428
Change-Id: I5ebe0438019958d883a7fda6bd92ea4484211d23
2015-08-03 17:24:32 -07:00
Yusuke Sato
7bfd7048f2 Merge "Clean up AssetManager::scanAndMergeZipLocked" 2015-08-03 17:41:19 +00:00
Elliott Hughes
1db1b5821f am 204b4157: am f8a6a2f6: Merge "Use _WIN32 rather than HAVE_WINSOCK."
* commit '204b4157b3fdbeea8859c4ad0e29be18d74e6f5f':
  Use _WIN32 rather than HAVE_WINSOCK.
2015-07-30 15:47:11 +00:00
Elliott Hughes
d065fd415c am 204b4157: am f8a6a2f6: Merge "Use _WIN32 rather than HAVE_WINSOCK."
* commit '204b4157b3fdbeea8859c4ad0e29be18d74e6f5f':
  Use _WIN32 rather than HAVE_WINSOCK.
2015-07-30 15:46:55 +00:00
Elliott Hughes
59cbe8d107 Use _WIN32 rather than HAVE_WINSOCK.
Change-Id: I0821d2af8473c359e8b73aec455000cb7c42f690
2015-07-29 17:49:27 -07:00
Adam Lesinski
3ab63f637f am 68d982da: am f02a02c2: am e1e94c7d: am fd44b56d: Merge "AAPT: Fix printing of resource configurations" into mnc-dev
* commit '68d982dab9ebba2accb7aa37f55cf68548d24818':
  AAPT: Fix printing of resource configurations
2015-07-28 00:57:35 +00:00
Adam Lesinski
33d4bd4a9b am fd44b56d: Merge "AAPT: Fix printing of resource configurations" into mnc-dev
* commit 'fd44b56d599bc6c6e7397dcdfaa6d613805a88cb':
  AAPT: Fix printing of resource configurations
2015-07-28 00:35:46 +00:00
Adam Lesinski
5b0f1be0a2 AAPT: Fix printing of resource configurations
Print out proper, copied configuration. We add fields to ResTable_config
and if we don't copy and fill in defaults when reading old configurations,
we end up with garbage values. This can potentially cause a crash as well.

Bug:22773426
Change-Id: I64f5ebe73ee72453bcdad3a19e48f8e7ad58e9c2
2015-07-27 17:04:43 -07:00
Yusuke Sato
c796ad0a8b Clean up AssetManager::scanAndMergeZipLocked
Now that ZipFileRO::startIteration supports prefix/suffix matching,
we can pass dirName to the function for simpler code and slightly
better performance.

Change-Id: Ia93c3ab3fa688ce013dd9febbf0f4bd3ee1f3e5e
2015-07-22 15:29:43 -07:00
Yusuke Sato
53a19bb967 resolved conflicts for merge of d3d6e9a3 to mnc-dev-plus-aosp
Change-Id: Ie32db11e6c1062df32b16a5cd6fcd219e0bdc017
2015-06-29 13:09:51 -07:00
Yusuke Sato
f162faaa12 Rename ZipEntryName to ZipString
Also add a 4th parameter to StartIteration(). This is for
https://android-review.googlesource.com/#/c/156771/.

Bug: 21957428
Change-Id: Ifbf9aec2f04b214b57e99c306282d7c0d39675a9
2015-06-25 14:58:16 -07:00
Yusuke Sato
34fe3df851 Let findSupportedAbi and hasRenderscriptBitcode scan only relevant files
for better performance. Without the optimization, these two functions
may check more than 100k file names in the pre-installed APK files,
which can take a few seconds to finish even on a recent device.

Bug: 21957428
Change-Id: I315fd3c6d5aa1076b993752525de449a9933de12
2015-06-22 16:11:32 -07:00
Narayan Kamath
407753c456 ZipFileRO: Use precise widths for zip file types.
getEntryInfo crashes on 64-bit devices because "long" types
were being passed int pointers (that pointed to a stack frame)
that were reinterpret_cast'ed to long* (sigh.). To fix this issue
once and for all, use types with explicitly defined widths.

This change also removes some dead invariant checking from
Asset.cpp instead of cleaning it up.

Note that we've introduced a wart in NativeLibraryHelper, where
we need to deal with zlib's uLong type, which is "at least 32 bits
wide".

bug: 21622286

(cherry picked from commit 4600dd053dbdbd4b95f3b11057a1cc55b99f9c77)

Change-Id: I7886cb37a229cc27c625699c80e6a6a6117d2203
2015-06-17 13:13:16 +00:00
Narayan Kamath
4600dd053d ZipFileRO: Use precise widths for zip file types.
getEntryInfo crashes on 64-bit devices because "long" types
were being passed int pointers (that pointed to a stack frame)
that were reinterpret_cast'ed to long* (sigh.). To fix this issue
once and for all, use types with explicitly defined widths.

This change also removes some dead invariant checking from
Asset.cpp instead of cleaning it up.

Note that we've introduced a wart in NativeLibraryHelper, where
we need to deal with zlib's uLong type, which is "at least 32 bits
wide".

bug: 21622286

Change-Id: Iae675a9601db7aae03a8b80b40321d2cc1d97f50
2015-06-17 08:40:25 +00:00
Adam Lesinski
2738c96d99 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
2015-05-15 15:10:58 -07:00
Narayan Kamath
5a7587fa90 Fix file descriptor leak when opening invalid archives.
I've inspected all other callers of OpenArchive and this seems
to be the only broken one. The easiest way to reproduce this is
by using getPackageArchiveInfo or by adding an asset path that
isn't a valid APK.

bug: https://code.google.com/p/android/issues/detail?id=171099
Change-Id: I41cd85d20f26ad47968e2a6f1384cc03330b558b
2015-05-12 10:37:18 +00:00
Alan Viverette
e54d245b99 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
2015-05-06 10:41:43 -07:00
Alan Viverette
261208e002 Merge "Add API for obtaining changing configurations bitmask from Theme" into mnc-dev 2015-05-05 16:50:29 +00:00
Alan Viverette
c1d527926e 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
2015-05-05 09:49:03 -07:00
Narayan Kamath
bb4ed9aa3a am 815d9bb1: Merge "Add a static dependency on libbase."
* commit '815d9bb178a0488ed1579cd230d447630ad0891b':
  Add a static dependency on libbase.
2015-04-29 14:38:15 +00:00
Narayan Kamath
9c8ba9666d Add a static dependency on libbase.
Used by libziparchive.

Change-Id: I120494b620c72b36a725b01f1f274f5dc862a9a3
2015-04-29 14:07:41 +00:00
Nick Kralevich
2eb10c0075 am 05ad674a: am 00e165ae: am e8101c04: Merge "fix compiler error under FORTIFY_SOURCE=2"
* commit '05ad674aa888e3f9217de0e5c3176161dd8e31aa':
  fix compiler error under FORTIFY_SOURCE=2
2015-04-25 22:05:25 +00:00
Nick Kralevich
9709a1f04c fix compiler error under FORTIFY_SOURCE=2
frameworks/base/libs/androidfw/ObbFile.cpp:340:5: error: ignoring return value of function declared with warn_unused_result attribute [-Werror,-Wunused-result]
    ftruncate(fd, mFooterStart);
    ^~~~~~~~~ ~~~~~~~~~~~~~~~~
1 error generated.
amake: *** [out/host/linux-x86/obj/STATIC_LIBRARIES/libandroidfw_intermediates/ObbFile.o] Error 1

Change-Id: I7080d64e7a830a10b41c1ebf33c60d32b7c8356e
2015-04-24 20:27:06 -07:00
Dan Albert
39606e9f78 am 7b09e7a9: am 44d7989a: am 571c5a26: Merge "Fix UB in ResourceTable::stringToInt."
* commit '7b09e7a9f3ef804e9cd159023b64eac1ef8b7931':
  Fix UB in ResourceTable::stringToInt.
2015-04-15 00:07:01 +00:00
Dan Albert
1b4f316651 Fix UB in ResourceTable::stringToInt.
Was here because UBsan found integer overflow in the parsing for hex
numbers, since hex numbers here are actually unsigned but assigned to
a signed integer.

Also fixes a number of missing error conditions.

Change-Id: Iaea576daedfc6c75521cde02de3fe9dd0198a3b7
2015-04-08 14:12:21 -07:00