00a754499e125c56ed6fae7b9d4eedb6ac7922a8 |
|
30-Mar-2018 |
Yi Jin <jinyithu@google.com> |
Correctly use int types and fix uint64_t print. Bug: 74118023 Test: atest incidentd_test and atest incident_helper Change-Id: I951021c12e3d0dc5c83a1bbb03fa0d64d99c0920
/frameworks/base/libs/protoutil/include/android/util/ProtoOutputStream.h
|
5ee0787024cc446a21008ff5710dec19c6afc834 |
|
06-Mar-2018 |
Yi Jin <jinyithu@google.com> |
Use uint64_t instead of long long as API type for consistent reason. Bug: 74118023 Test: manual Change-Id: Icd5f506c76d3a008a79cb6c9d2061962ca7fdd40
/frameworks/base/libs/protoutil/include/android/util/ProtoOutputStream.h
|
7f9e63b63269baa41a36fc31acd6fc071309c26c |
|
03-Feb-2018 |
Yi Jin <jinyithu@google.com> |
Add clear method to ProtoOutputStream so it is reusable by just rewinding its internal pointer. Bug: 72319159 Test: atest incidentd_test and atest statsd_test Change-Id: Id046b987a7460d68300e5d4d46ae56aec1eba2d0
/frameworks/base/libs/protoutil/include/android/util/ProtoOutputStream.h
|
0abdfb0889a4957faaba8a95903e529fced7316c |
|
17-Nov-2017 |
Yi Jin <jinyithu@google.com> |
Expose how many bytes are written in ProtoOutputStream Bug: 69428467 Test: N/A Change-Id: If1405885949635cebd1c6d89e220c210ef9fa210
/frameworks/base/libs/protoutil/include/android/util/ProtoOutputStream.h
|
f9ed04b3d938b06329fcd14d4f2b461000d028da |
|
21-Oct-2017 |
Yi Jin <jinyithu@google.com> |
Remove the extra mapping of field types in ProtoOutputStream It is very unlikely the protobuf changes the value in descriptor.h, and if defines an extra mapping, there are several places to maintain: 1. java-stream, 2. cpp-stream, 3. ProtoOutputStream.java 4. ProtoOutputStream.cpp 5. Privacy.h (GetFieldId) 6. StatsLog to generate field id (type << 32 + field number) Therefore use the current value in descriptor.h seems reasonable unless they change that, very very unlikely, they probably will just add new types, and deprect the existing ones like Group. Test: test output of dumpsys proto Change-Id: I6e150ab427851dd3b5dd55d3b273deeed7a0963c
/frameworks/base/libs/protoutil/include/android/util/ProtoOutputStream.h
|
04625ad4886a478bf74bbfc13937c10fa63eb272 |
|
18-Oct-2017 |
Yi Jin <jinyithu@google.com> |
Refactor incident_helper to use protoutil and cppstream plugin. 1. Split the parsers to its own file to prevent all the parsers in one gaint file. 2. Completely get rid of protobuf-cpp-full in incident_helper, use ProtoOutputStream and cppstream instead, the incident_helper binary is reduced from ~500K to ~113K. 3. Write data to protobuf even its values are zero/default, the reason is for example we have a repeated int32 orders = 1; and people explicitly append 0 so the total repeated field has 10 values, if zero is not written to serialized data, this repeated field will only have 9 values which is not what we want at first place. This also aligns with the default protobuf serialization behavior in incident_helper_test. 4. Use Android.bp for protoutil lib since it is not able to depend on libs compiled by .mk file, it works the other way. 5. Add a new custom message option for streaming_proto, if specified, the cppstream will create extra metadata to get field ids by field name. A Table class is created in incident_helper to use it. Bug: 67860303 Test: unit tested as well as on device test Change-Id: I8e136fd15f343a4a623d20910ec64b622b478a3e
/frameworks/base/libs/protoutil/include/android/util/ProtoOutputStream.h
|
8ad193870b2f8d6f8478d591ced2100e22b23229 |
|
31-Oct-2017 |
Yi Jin <jinyithu@google.com> |
Create a new API allowing callers to concat a serialized message field. Test: N/A Change-Id: I90570ea62e6c406d40c399cee6cbb8dcb5172e21
/frameworks/base/libs/protoutil/include/android/util/ProtoOutputStream.h
|
e08333067a9f4ce9176dff490c4b163f71f56e1e |
|
24-Oct-2017 |
Yi Jin <jinyithu@google.com> |
Fix several nits 1. Change the APIs of ProtoOutputStream to be able to write bytes 2. Fix the tests in incidentd, stdout is closed so can't capture the value, use temporaryFile instead. Test: N/A Change-Id: Ibc31f2efd068afc6c06188d92f57ca5a754c3683
/frameworks/base/libs/protoutil/include/android/util/ProtoOutputStream.h
|
42711a0b4fffd0dc670ec7bc38cc7f954c60e530 |
|
12-Oct-2017 |
Yi Jin <jinyithu@google.com> |
Use ProtoOutputStream to strip Pii sensetive fields in incidentd The in-place algorithm in ProtoOutputStream will have at most 2 copies of possible nested message values incidentd is getting which makes it more ram-efficient, and minimize allocations. Bug: 65641021 Test: the units pass Change-Id: Ic3fe99b7e27895bd613a129ba0f12ccfca4af317
/frameworks/base/libs/protoutil/include/android/util/ProtoOutputStream.h
|
974a9c28853d24ff94f000ae9f5c816d9538897b |
|
03-Oct-2017 |
Yi Jin <jinyithu@google.com> |
Implement go/streaming-proto native libs, part 2 Implement ProtoOutputStream.h to write protobuf format data. Usage of dumping proto: ProtoOutputStream proto(fd); proto.write(fieldId, value1); // dump a single value // start to dump a message: long long token = proto.start(messageFieldId); proto.write(nestedField1, nestedValue1); ... proto.end(token); fieldId will be generated by protoc-cpp plugin(TBD). It is an encoded uint64_t value, with 0 - 32 bits as its proto number, 33 - 40 bits reserved for field type, int32, bool, string, message, etc. and 41 - 43 bits for single, repeated or packed type. Currently packed field is not supported. Bug: 65641021 Test: N/A, need to wait for protoc-cpp plugin and will test in incident_helper Change-Id: Ic188615b950235aae0edeee4876b78d31feb5619
/frameworks/base/libs/protoutil/include/android/util/ProtoOutputStream.h
|