Commit Graph

6012 Commits

Author SHA1 Message Date
TreeHugger Robot
ec98448f15 Merge "Implement a new section to attach LAST_KMSG to incident report This section simply gzip a large file and stores result in GZippedFileProto" 2018-02-28 03:02:16 +00:00
Adam Lesinski
2eed52ecc0 AAPT2: Fix styled string whitespace processing
Change styled string whitespace processing to be like AAPT's was.

Main changes:
- whitespace around tags is preserved.
- tags start exactly where they are supposed to, not off by one.

Bug: 72406283
Test: make aapt2_tests
Change-Id: I4d12728c493efd8c978e2e3d2718b56534ff52ef
2018-02-27 11:39:10 -08:00
Yi Jin
1a11fa1097 Implement a new section to attach LAST_KMSG to incident report
This section simply gzip a large file and stores result in GZippedFileProto

This greatly improves the size, before gzip, the last kmsg size ~500KB,
after gzip the proto size is ~60KB.

Bug: 73354384
Test: atest incidentd_test and manual on device test
Change-Id: I9bfc2cf07384487671edbffb5f0bd8495608fea6
2018-02-27 11:36:29 -08:00
Adam Lesinski
e1094a2e23 AAPT2: Fix issue with String flattening in XmlFlattener
Compiled Strings (previously not encountered) in an XML resource
were using a different StringPool than the one being referred to
in the XmlFlattener, and so the indices were all wrong.

Bug: 72700446
Test: make aapt2_tests
Change-Id: I663924f8fad50fd4c69cfa196318dc63fb641a25
2018-02-23 14:59:37 -08:00
TreeHugger Robot
868688ed16 Merge "Add annotation to atoms that represent a state change in atoms.proto" 2018-02-22 05:36:45 +00:00
Yao Chen
9c1debe330 Add annotation to atoms that represent a state change in atoms.proto
+ A state change atom can have one exclusive state field, and any
  number of primary key fields.

  When there is primary key in the atom, it means the state belongs to the primary key.
  For example,
  message UidProcessStateChanged {
    optional int32 uid = 1 [(stateFieldOption).option = PRIMARY];
    optional android.app.ProcessStateEnum state = 2 [(stateFieldOption).option = EXCLUSIVE];
  }

  When there is no primary key fields in the atom, the state is global.
  For example,
  message ScreenStateChanged {
     optional android.view.DisplayStateEnum state = 1 [(stateFieldOption).option = EXCLUSIVE];
  }

+ The annotation is consumed by stats_log_api_gen to generate a static map from the state
  atoms to its primary fields, and exclusive fields

+ stats_log.proto is splitted into 2 proto files, because statsd needs proto lite, and c++
  lite proto library cannot properly ignore the field options which requires full proto.

 This CL doesn't change any logic in the statsd yet. A separate CL will use the field option
 information to correctly track the state.

Test: added unit tests in stats_log_api_gen_test. and statsd_test pases.
Change-Id: I9e8a979fe81ba60efd4d854bb7087ce4b2b147ec
2018-02-21 16:46:56 -08:00
Yangster-mac
c4aa760428 Remove a few atoms from the timestamp truncating whitelist.
Test: statsd test
Change-Id: Ic6a152cb400bef33139357d60f6d0feca855ade2
2018-02-20 13:20:54 -08:00
TreeHugger Robot
581ff5ec0d Merge "Timestamp Truncating whitelist." 2018-02-20 20:41:29 +00:00
TreeHugger Robot
3ac786d217 Merge "AAPT2: normalize Manifest java identifiers." 2018-02-19 10:42:35 +00:00
Yangster-mac
d5c356214f Timestamp Truncating whitelist.
Test: manually tested.
Change-Id: I46da375b6c0773ffc611bc06fff12cb4f9a7fc18
2018-02-17 21:11:54 -08:00
TreeHugger Robot
983bacb959 Merge "AAPT2: Ensure output formats of files are correctly set" 2018-02-17 01:58:18 +00:00
Jeff Sharkey
ee21f695b6 Recommend ICU replacements, no clone, no Impl.
When ICU has a better replacement class, recommend that APIs use
that instead.

Yell if someone implements clone(), and point them towards a copy
constructor instead.

Yell if someone exposes "Impl" classes.

Test: manual
Bug: 73392214, 71906588, 62627348
Change-Id: I75dcba2c4ab7ca426057eefb0335c935c3ced79a
2018-02-16 13:29:32 -07:00
Adam Lesinski
a65bbdf43c AAPT2: Ensure output formats of files are correctly set
When compiling straight to proto from source, the file types
were not set correctly (binary XML or proto XML).

Bug: 73406447
Test: manual
Change-Id: I68c1881a00a2ec1ad58f7ec485af2543d262d076
2018-02-15 16:44:15 -08:00
TreeHugger Robot
f74309f5e2 Merge "AAPT2: Fix issue with deserializing binary XML" 2018-02-15 06:39:21 +00:00
TreeHugger Robot
79fe852dab Merge "Log the elapsed realtime in non-chained interface." 2018-02-15 06:11:59 +00:00
TreeHugger Robot
237b1d0cf6 Merge changes I2f594c22,I37a2b8b8
* changes:
  AAPT2: Fix compatible-screens element in AndroidManifest.xml
  AAPT2: Add order attribute to groups
2018-02-15 05:46:47 +00:00
TreeHugger Robot
f19f505772 Merge "Dump XML files in aapt2 dump" 2018-02-15 02:41:54 +00:00
Adam Lesinski
bbf429795d AAPT2: Fix issue with deserializing binary XML
We assumed that a raw text value set for an attribute meant there
were no compiled values set either.

This would only really happen for attributes that did not belong to any
namespace (no prefix:), since we always kept their raw string values
in case some code relied on it.

Bug: 72700446
Test: make aapt2_tests
Change-Id: Icba40a1d4b181bfe7cad73131c4dbe5ba7f8b085
2018-02-14 16:11:23 -08:00
Yangster-mac
31ddcde690 Log the elapsed realtime in non-chained interface.
Test: statsd test
Change-Id: I61e457bd069147fd1b1fc964b27d42d4ec19230d
2018-02-14 16:09:35 -08:00
Shane Farmer
d05b9130fd AAPT2: Fix compatible-screens element in AndroidManifest.xml
Fix an issue where the compatible-screens element was not being
populated correctly. The previous version was missing the screenSize
attribute which is mandatory. The attributes were also missing the
resource ID from the framework library as these are a part of the public
API.

Change-Id: I2f594c2259831dbbd96c58db4ba55e8288d4231e
Test: unit tests
Test: manually split an APK and dumped with aapt
2018-02-14 15:44:42 -08:00
Adam Lesinski
da9eba300b Dump XML files in aapt2 dump
Test: manual
Change-Id: Id7f656c1385f6d1fec8eaa993c8e2b36bb1ae5b0
2018-02-14 10:49:32 -08:00
Yangster-mac
330af58f2b Use elapsed realtime instead of times based on wall clock, which can jump around and go backwards.
Test: statsd unit test passed

Change-Id: Ib541df99231e171b3be2a24f75632693e36da90e
2018-02-13 23:30:39 -08:00
Izabela Orlowska
d31bc123a0 AAPT2: normalize Manifest java identifiers.
Currently AAPT2 does not allow permissions which last piece contains the
"-" symbol (since it is an illegal character for a java identifier).

AAPT1 would normalize the last piece, therefore creating a valid java
identifier.

This CL makes AAPT2 behave in a similar way to AAPT1, but instead of
modifying the original value of the permission string, modifies only the
java identifier part, leaving the permission string unchanged.

Fixes: 72980877
Test: updated
Change-Id: Ie44317e07407341ba3e91a84d9b06980547b3448
2018-02-13 14:09:00 +00:00
Colin Cross
7d07ad1ef2 Merge "Don't put android.os.Parcelable in framework.aidl" am: 0872f6d5e3 am: 6864210fe2
am: 37ba3de333

Change-Id: Ib8d8277171ede82ea4626b6d2de2fcb9c1a1d307
2018-02-13 08:41:41 +00:00
Colin Cross
37ba3de333 Merge "Don't put android.os.Parcelable in framework.aidl" am: 0872f6d5e3
am: 6864210fe2

Change-Id: I17a5277ece615569670f5f8ea9c2ed42fb473a52
2018-02-13 07:51:59 +00:00
Nick Butcher
0ac5791e9e Merge "Prevent AAPT from versioning <animated-selector> tags." into oc-mr1-dev
am: 35e1410551

Change-Id: If9f28bfe12d75fca6b8f07c15b77f78267ef6292
2018-02-09 22:42:26 +00:00
Colin Cross
fdbe7d1ca9 Don't put android.os.Parcelable in framework.aidl
Parcelable shouldn't be in the list of parcelables in framework.aidl.
Remove it to fix warning when running aidl:
framework.aidl:287 attempt to redefine built in class android.os.Parcelable

Also make the dependency on sdk_parcelables not be order-only so
framework.aidl gets rebuilt when sdk_parcelables changes.

Bug: 73135791
Test: ParcelableDetectorTest
Test: out/target/common/obj/framework.aidl does not contain android.os.Parcelable
Change-Id: If5222879be9ec1e5fa08810adc624ec526ddc0ec
2018-02-09 11:29:15 -08:00
Nick Butcher
e78a816966 Prevent AAPT from versioning <animated-selector> tags.
Bug: 69359529
Test: Manually tested with ag/3178054
Change-Id: I10ae4d96c2a31a0a7c363d7a9292ecdfd3bb526a
2018-02-09 11:36:27 +00:00
Mohamed Heikal
1084432e1e AAPT2: Fix silent failure when ContainerReader fails during Link
Currently in the link step ContainerReader is used to read files but the
reader is not checked for errors prior to the read. This can lead to
silent failure when reading invalid resource files.

Change-Id: I6420699ad30b5b84b0b2c696af8eb5a6cbd4111e
2018-02-08 14:50:14 -05:00
Colin Cross
83b3cb4830 Merge "Add missing copyright messages" am: 872f386f6b am: 32a1dc5075
am: cf4d62fdd3

Change-Id: I75f2c81a9e7c7ec0175e50b3bb58cedc8c36a2be
2018-02-07 02:13:05 +00:00
Colin Cross
cf4d62fdd3 Merge "Add missing copyright messages" am: 872f386f6b
am: 32a1dc5075

Change-Id: I9602e1c9dda5e842fd71c9f48cf354aea4650d74
2018-02-06 23:06:08 +00:00
Colin Cross
1b27440abc Add missing copyright messages
Bug: 72993971
Test: m sdkparcelables
Change-Id: I9fa422160c29ce3054748b2b8d1e26541a697a90
2018-02-06 11:10:25 -08:00
Shane Farmer
11cdc1cf7a AAPT2: Add order attribute to groups
Require explicit ordering of groups in the configuration file to ensure
that the correct version code is set. Ordering based on a single ABI is
straight forward to ensure Play Store delivers the correct APK, but when
an APK needs more than one ABI things get messy quickly. This also goes
for screen density etc. The only thing that is easily sorted without
this attribute is android-sdk since an artifact can only reference a
single SDK.

Test: unit tests
Test: manually split an APK with update config.xml
Change-Id: I37a2b8b8a8409d6d6ff27c7142d4c8c8065a7a51
2018-02-02 12:11:18 -08:00
Dave Ingram
22ed4122e7 AAPT2: Fix typo in BinaryPrimitives oneofs
Follow-up to ag/3449569

Bug: 69587794
Test: aapt2_tests
Change-Id: I95d2ba600c00bda2a8420794e43501f9bfca01df
2018-01-30 21:15:36 -08:00
Yi Jin
b8344dc72f Fix command line tool to set the right privacy enum.
Test: manual
Change-Id: I3f0845ea32b46f1a028f8b6d3d4180a90a47beb5
2018-01-24 18:25:33 -08:00
TreeHugger Robot
adb4fc73b0 Merge "Avoid processing log event when there is no uid field." 2018-01-24 18:18:24 +00:00
Benoit Lamarche
ae992b6392 Merge "Fail when there is an ASM error" am: 4152497b4b am: 05bb83c87d
am: 5fb872e787

Change-Id: I63222e0f376184649f8634932edc6ee296418b91
2018-01-24 12:45:48 +00:00
Benoit Lamarche
5fb872e787 Merge "Fail when there is an ASM error" am: 4152497b4b
am: 05bb83c87d

Change-Id: I27be59afd9f021c2933d10b6becb0f7542162a37
2018-01-24 12:36:26 +00:00
Yangster-mac
68985805f2 Avoid processing log event when there is no uid field.
Test: all statsd unit test passed

Change-Id: Id434d86586950a485b30a244f3c030e8202c1c6d
2018-01-23 16:43:07 +00:00
Benoit Lamarche
9f17dfcba6 Fail when there is an ASM error
Otherwise during a build, Locked Region Code Injection may encounter an
ASM Analyzer exception, and the build will not fail, even though
injection won't have succeeded.

Test: make
Change-Id: Iee69f1a78fde735db62c7f73405b8cec4e410793
2018-01-22 17:42:21 +01:00
TreeHugger Robot
e5b3296316 Merge "Allow <adopt-permissions> tag in manifest" 2018-01-19 17:10:29 +00:00
David Chaloupka
cfd1b4b263 Merge "Handle multiple packages of same name in 'aapt2 convert'" 2018-01-19 10:57:53 +00:00
TreeHugger Robot
e528516731 Merge "Ignore missing font in fontchain_linter.py" 2018-01-19 03:37:25 +00:00
Seigo Nonaka
1403ff2b0b Ignore missing font in fontchain_linter.py
It is totally valid if the font is missing even if the font is listed in
fonts.xml. Android Watch has less fonts and OEM vendor may reduce the
font files.

Bug: 72159040
Test: m fontchain_lint
Change-Id: I22bdf7bfeb6d80a2a338ebf7536c8eaf193b03c5
2018-01-18 17:24:31 -08:00
TreeHugger Robot
8f2fffd809 Merge "AAPT2: Store BinaryPrimatives in protos as oneofs" 2018-01-19 01:00:00 +00:00
David Chaloupka
e3c1a4a9d2 Handle multiple packages of same name in 'aapt2 convert'
aapt2 currently looks-up packages only by package name and then verifies
whether the package ID has the expected value. For pre-L we need to be able
to handle resource tables having packages of same package name but
different IDs.

Note that this CL fixes only proto->binary conversion but many other aapt2
commands are still affected. This is because many transformations still
consider package name as sufficient identifier of a package.

Bug: 72143207
Test: Manual
Change-Id: Id8a920d6cd15bec747d3124270f5bcb7f48924cf
2018-01-18 19:20:01 +00:00
David Chaloupka
415689bb1c Merge "Adjust file reference type in 'aapt2 convert'" 2018-01-18 10:06:01 +00:00
Michael Wachenschwanz
d06f1f38a9 AAPT2: Store BinaryPrimatives in protos as oneofs
Fixes: 69587794
Test: aapt2_tests

Change-Id: Idf5526f6b1b720b6e476bcdf8c2155e13a6ecc0f
2018-01-17 16:58:43 -08:00
TreeHugger Robot
bd56951c5b Merge "aapt2: Fix issue with Manifest duplicate handling" 2018-01-17 20:20:29 +00:00
David Chaloupka
b66db4ec4c Adjust file reference type in 'aapt2 convert'
When converting between binary and proto APKs in either direction, the
'aapt2 convert' command did not adjust FileReference type for entries
inside the resource table. This fix makes in-place changes of the resource
table passed to ConvertApk, which is safe since the resource table is
thrown away after the conversion.

Bug: 71854843
Test: Manual
Change-Id: Ide6e141269392db15b399db3566f18175f5133d5
2018-01-17 11:07:44 +00:00