Commit Graph

5454 Commits

Author SHA1 Message Date
Yi Kong
bf0a3ec0fa Merge "Resolve merge conflicts of ccc5b9bbd0 to oc-dev-plus-aosp" into oc-dev-plus-aosp
am: 51ccc24d57

Change-Id: Ib6109c22c278ce00ad1a0c6d3d1e6a7903cfad2f
2017-05-02 20:00:21 +00:00
Yi Kong
087e2d46ab Resolve merge conflicts of ccc5b9bbd0 to oc-dev-plus-aosp
Test: Build
Change-Id: I7d3d6bb4c436b2025a0293f9c6475855243f4dd9
2017-05-02 12:49:25 -07:00
Jerome Gaillard
d9152e3605 Merge "Ignore density in AdaptiveIconDrawable" 2017-05-02 14:26:24 +00:00
Jerome Gaillard
106df6992a Merge "Update AccessibilityManager in layoutlib following I65db0252" 2017-05-02 14:25:33 +00:00
Calin Juravle
6958495360 Merge "SystemApi for dex module registration" 2017-05-01 22:56:31 +00:00
Yi Kong
b1d8144ef0 SymbolComparator operator() is missing const
Clean up, no functionality change.

Test: build
Bug: 37752547
Change-Id: I7b6f368c0d0776f956a8b99353df7b23cbbc388d
2017-05-01 10:57:39 -07:00
Salvador Martinez
c06c4ad71d Merge "Added dialog to notify user of thermal shutdown" into oc-dev am: 4d09adcef1
am: ba1cc4bb42

Change-Id: I6d0a0c6dc87bac1470eb4cfccee61c878bed9ee3
2017-05-01 17:01:13 +00:00
Salvador Martinez
4d09adcef1 Merge "Added dialog to notify user of thermal shutdown" into oc-dev 2017-05-01 16:45:30 +00:00
Adam Lesinski
2d838019e4 Merge "AAPT2: Fix typo in manifest validation expectation" into oc-dev am: 7cf8ca95aa
am: f43dd4b032

Change-Id: I672916a11b83dea83ae9ea0048a4c22747b53733
2017-04-30 14:45:04 +00:00
TreeHugger Robot
7cf8ca95aa Merge "AAPT2: Fix typo in manifest validation expectation" into oc-dev 2017-04-30 14:31:17 +00:00
Adam Lesinski
54fbb7ca81 Merge "AAPT2: binary parser should be more lenient with files" into oc-dev am: 557a0c50a0
am: 7ed9a3b3ad

Change-Id: Ic64fb3a0f4a1e1f9bead421012d91e004f91b78e
2017-04-29 21:50:50 +00:00
TreeHugger Robot
557a0c50a0 Merge "AAPT2: binary parser should be more lenient with files" into oc-dev 2017-04-29 21:39:29 +00:00
Adam Lesinski
e6a7ca6fb2 Merge "AAPT2: Fix string escaping" into oc-dev am: f6bc1402ed
am: 349b647b75

Change-Id: I2208380a8dbeb7df11790ebd05823f46616d2d06
2017-04-29 21:14:17 +00:00
TreeHugger Robot
f6bc1402ed Merge "AAPT2: Fix string escaping" into oc-dev 2017-04-29 21:04:38 +00:00
Adam Lesinski
42dd85aee7 Merge changes I446fb6ab,Ife3bbd29 into oc-dev am: 53c9898e79
am: 66534ef01c

Change-Id: I62d31b0d933a2f06b5a97f16447d7500b7fe71d1
2017-04-29 20:50:20 +00:00
TreeHugger Robot
53c9898e79 Merge changes I446fb6ab,Ife3bbd29 into oc-dev
* changes:
  Valid resource IDs may be negative
  AAPT2: Workaround for findViewById with package ID > 0x7f
2017-04-29 20:38:20 +00:00
Adam Lesinski
742888f0fd AAPT2: binary parser should be more lenient with files
Some APKs have file references that reference files that don't exist.

For now, just be lenient and ignore the files themselves.

Keep the actual reference until such a time as general resource
stripping is implemented.

Bug: 37749644
Test: manual
Change-Id: I773685acf41212405b71b064d64045fb4556dcfc
2017-04-28 15:34:52 -07:00
Chris Warrington
8f3a5a58e6 Merge "AAPT2: Error reporting through JNI." into oc-dev am: f49baef4b9
am: 128b206af8

Change-Id: Idc23d214eeea75c60dc1d12aef77270724f95a2e
2017-04-28 20:57:10 +00:00
Andreas Gampe
3bf6389120 Aapt2: Fix png leak
do9Patch is leaking two rows of data.

Bug: 37782695
Test: ASAN_OPTIONS= SANITIZE_HOST=address m
Change-Id: Ibd2198919cd9c24f2de9f50b23c87753f2190708
2017-04-28 13:51:39 -07:00
Adam Lesinski
c10c0d0db2 AAPT2: Fix typo in manifest validation expectation
Change expected tag from grant-uri-permissions -> grant-uri-permission

Bug: 37714102
Test: manual
Change-Id: Ic0178b83fff8de961cb3fdfe38023eaf111237ee
2017-04-28 12:54:08 -07:00
Adam Lesinski
48448e8a31 AAPT2: Fix string escaping
We were processing escaped strings too early, before
parsing of values into types. Now the escaped strings get
processed when they are being flattened.

Bug: 37715376
Test: make aapt2_tests
Change-Id: Ic59aa2e3a20c40756c219752ff74b2a4f8a602ba
2017-04-28 12:51:23 -07:00
Adam Lesinski
1e4b0e54a3 AAPT2: Workaround for findViewById with package ID > 0x7f
The entire View code base checks IDs against View.NO_ID except
findViewById(), which checks to see if the ID is negative.

Any package ID > 0x7f is interpreted as a negative number in Java
(no unsigned ints), so this check prevents the use of IDs > 0x7f.

findViewById is final, so support library workarounds are not possible.

Instead, IDs (@id/foo) are just sentinels, their values don't matter.
If building for pre-O devices, rewrite any references to these IDs of
the for 0xPPTTEEEE, where PP > 7f, to 0x7fPPEEEE.

The symbol table will check for potential collisions against the base
APK, so this should be safe.

Bug: 37498913
Test: manual
Change-Id: Ife3bbd29db287757ef8a2ffd83053d97f1db2613
2017-04-28 12:47:48 -07:00
Chris Warrington
820d72adc0 AAPT2: Error reporting through JNI.
Rather than relying on stderr being wired correctly.

Test: Tests for JNI integration in studio-master-dev.
Change-Id: I1c7e7130bc4e56d61de259a9596bee3a6b3520fb
2017-04-28 10:06:38 +01:00
Adam Lesinski
82e26c9214 Merge "AAPT2: Add workaround for non-standard package IDs" into oc-dev am: e7172ff9fb
am: 65c42a5569

Change-Id: I1238656a9edb9984d36412dba506b869f574e3d4
2017-04-28 01:27:30 +00:00
Calin Juravle
3d2af7f72a SystemApi for dex module registration
PackageManager#registerDexModule() allows apps which can call
system apis to register a dex module with the Package Manager.

The PM may optimize the modules on the spot if needed. This is
particular useful for shared dex modules (e.g. chimera modules)
which are loaded in multiple processes.

Test:  adb  shell am instrument -e class
'android.content.pm.PackageManagerTests' -w
'com.android.frameworks.coretests/android.support.test.runner.AndroidJUnitRunner'
Bug: 37290820
Change-Id: I9ea8f937a76d2549a29e90a6c84c53c2e44a1ee4
2017-04-27 17:16:16 -07:00
TreeHugger Robot
e7172ff9fb Merge "AAPT2: Add workaround for non-standard package IDs" into oc-dev 2017-04-27 23:45:44 +00:00
Salvador Martinez
a6f7b25c3d Added dialog to notify user of thermal shutdown
tldr; Have the phone check when it reboots if it last shut
down due to heat. If so, we should show the user an
notification and dialog giving them more details.

- Added hidden api to allow apps to query system_server
for the reason the phone last rebooted
- Added notification that is shown when the phone is
booted if the last shutdown was due to excessive
heat.
- Added dialog to provide more details about the
shutdown if the notification is tapped.
- Added tests to verify that file is read and
as expected.
- Updated code for high temperature warning that
is shown while the phone is running to avoid
mixups in the future.

Test: FrameworksServiceTests
Bug: 30994946
Change-Id: Ic25f42539911c89ba7f1834e206f7931d65c2865
2017-04-27 09:52:45 -07:00
Adam Lesinski
4ca56978a9 AAPT2: Add workaround for non-standard package IDs
The dynamic ref table used to map build-time IDs to runtime IDs
is mainly used for shared resource libraries and has a few built-in
mappings (app 0x7f and framework 0x01).

Using a non-standard package ID like 0x80 causes a failure in package ID
lookup. The solution is to ship the dynamic_ref_table with an identity mapping
with any resource table that uses a non-standard package ID.

Adds some tests to ensure this works correctly.

Bug: 37498913
Test: make libandroidfw_tests
Test: make aapt2_tests
Change-Id: Ic3f67942384d34e7fdcbc94ded360e940e3ebc8a
2017-04-26 21:55:31 -07:00
Siyamed Sinir
fceef5cbe9 Merge "Update fontchain to read from additional sequences" into oc-dev am: a54b89e000
am: eb161e240e

Change-Id: Ia3a37d0ef797a27b1f42c7d8e7df8228cecbda33
2017-04-25 19:53:18 +00:00
Siyamed Sinir
a54b89e000 Merge "Update fontchain to read from additional sequences" into oc-dev 2017-04-25 17:48:29 +00:00
Siyamed Sinir
6e06ad055b Update fontchain to read from additional sequences
Test: make fontchain_lint

Bug: 37520224
Bug: 37169477
Change-Id: Ie01a2aca85314701654cc2397f0bcf8eafdbe608
2017-04-25 17:32:15 +00:00
Jerome Gaillard
91d83954fe Ignore density in AdaptiveIconDrawable
This was introduced in Change Iaa9a5592.

Test: layoutlib tests
Change-Id: Id4c9f3e75de174106aa086b29cd7d12fa36b0e61
2017-04-25 18:15:27 +01:00
Jerome Gaillard
b04eec897c Update AccessibilityManager in layoutlib following I65db0252
Test: layoutlib tests
Change-Id: I279754532db1097a65a8683057f8f3893b84af84
2017-04-25 18:12:00 +01:00
Adam Lesinski
40f7202e81 Merge "AAPT2: Add better error message when processing invalid files" into oc-dev am: b9dbee430d
am: 56ee63d777

Change-Id: I87e0bf3432a0e8e7a41655eba6aa6abf1c6ec451
2017-04-25 15:43:15 +00:00
Adam Lesinski
79f962047b Merge "AAPT2: Allow <path-permission> tag in <provider>" into oc-dev am: 7beb895d75
am: 706b85e855

Change-Id: I7ae22f1f7dd0736ca83261bc6efae5543c560c59
2017-04-25 15:37:36 +00:00
TreeHugger Robot
b9dbee430d Merge "AAPT2: Add better error message when processing invalid files" into oc-dev 2017-04-25 15:26:24 +00:00
TreeHugger Robot
7beb895d75 Merge "AAPT2: Allow <path-permission> tag in <provider>" into oc-dev 2017-04-25 15:26:01 +00:00
Adam Lesinski
5afb834943 Merge changes I7d2b7e50,I784406a6 into oc-dev am: 76831f7e39
am: 085abab5ba

Change-Id: Ic5e4a29f2b81aac05cf53b99190e92989163e412
2017-04-24 23:37:13 +00:00
TreeHugger Robot
76831f7e39 Merge changes I7d2b7e50,I784406a6 into oc-dev
* changes:
  AAPT2: Allow truncating of package names
  AAPT2: Make BinaryResourceParser more lenient
2017-04-24 23:26:06 +00:00
Jeff Sharkey
f135ff5350 Merge "Bunch of new API lint rules." into oc-dev am: 57b999605c
am: 8ec71a639b

Change-Id: Iee0b9508f3eb79eb88e1748a323390283efb9494
2017-04-24 22:48:57 +00:00
Adam Lesinski
776aa959c7 AAPT2: Add better error message when processing invalid files
Instead of showing a failed mmap error, show a better error when a file
being compiled is a directory or other unsupported file type.

Bug: 37626838
Test: manual
Change-Id: Ib9acf5f48ab5da37e79411c6a9f37c51f00f925f
2017-04-24 22:19:53 +00:00
Jeff Sharkey
57b999605c Merge "Bunch of new API lint rules." into oc-dev 2017-04-24 22:18:56 +00:00
Adam Lesinski
25783cab0b AAPT2: Allow <path-permission> tag in <provider>
Fix a typo where the wrong tag name was expected under <provider>
in AndroidManifest.xml.

Bug: 37627250
Test: manual
Change-Id: I45afd09b4ff25feb320f7991e16c4172e20dd417
2017-04-24 22:18:48 +00:00
Adam Lesinski
b522f04bc2 AAPT2: Allow truncating of package names
ResTable_package header only allows 127 UTF-16 characters, so AAPT
would truncate the real package name to fit. AAPT2 would error-out
on any package name longer than 127 UTF-16 characters. This strictness
is not required except when building shared libraries, which use the
full package name as a way of identifying the runtime assigned
package ID to package name mapping.

Bug: 36940145
Test: make aapt2_tests
Change-Id: I7d2b7e50c7ab30c6a6c4f15d310e711f68e35091
2017-04-21 17:02:09 -07:00
Adam Lesinski
9431c476f3 AAPT2: Make BinaryResourceParser more lenient
Trailing data after the main RES_TABLE_TYPE should be logged but not
cause an error.

Bug: 36945869
Test: (aapt2 dump apk/attached/in/bug.apk)
Change-Id: I784406a680b79630798fdb4b7ca81f9d1f2b96d1
2017-04-21 16:09:24 -07:00
Jerome Gaillard
5ab079f4bb Merge "Update golden image following Change If9039398" 2017-04-21 10:23:12 +00:00
Chad Brubaker
a59e95a047 Merge "Address API review comments for registerReceiver" into oc-dev am: 1f4e053aef
am: 46f7f1c245

Change-Id: If4167d8458b144a73deeaceeaa51b1f8d482d6d7
2017-04-20 20:13:48 +00:00
Chad Brubaker
1f4e053aef Merge "Address API review comments for registerReceiver" into oc-dev 2017-04-20 19:52:51 +00:00
Yunlian Jiang
89547ce017 fix some memory leaks.
This fixes some warnings like

warning: Potential leak of memory pointed to by 'target'
[clang-analyzer-cplusplus.NewDeleteLeaks]

Bug: None
Test: The warnings are gone.
Change-Id: I3708671bbc9965133439664b766df3236d1b01bf
2017-04-20 10:28:00 -07:00
Svetoslav Ganov
993f63270f Merge "Address API council comments" into oc-dev am: fb4fb03cc3
am: 375d615b30

Change-Id: Ibba72870f4d4da53ab411b5e279a967a86584e19
2017-04-20 15:28:57 +00:00