Commit Graph

5 Commits

Author SHA1 Message Date
Alexander Smundak
44dc35f254 Merge "Convert tests/ProtoInputStreamTests/Android.mk file to Android.bp" am: 4497c97891 am: 3036f3d732
Change-Id: Icc2f93cf7751223f3010231edf932e5c036ffd65
2020-05-20 21:03:55 +00:00
Sasha Smundak
de2826edb4 Convert tests/ProtoInputStreamTests/Android.mk file to Android.bp
See build/soong/README.md for more information.

Bug: 122332340
Test: treehugger + atest ProtoInputStreamTests
Change-Id: I558ded58b725310a544f0c79a090f38dcc1bc413
2020-05-19 18:04:09 -07:00
Michael Wachenschwanz
240896281b Throw ProtoParseException for incomplete values
Reading a corrupted stream/file could cause an infinite loop while
reading values. Throw an exception if unexpectedly reached the end of
the stream.

Bug: 150192344
Test: atest ProtoInputStreamTests
Change-Id: Ie660545152ba821be0c371dd1e3bf7235372bc6d
2020-02-27 17:44:14 -08:00
Kweku Adams
6acbca3a9a Rename ProtoInputStream.isNextField to nextField.
ProtoInputStream.isNextField() skips over the current field to read the
next tag. This side effect means that calling isNextField prevents the
caller from reading the field it was just on. The "is" prefix makes it
easy to assume that the method has no side effects. Renaming to
nextField(long) with a parameter should help make it clear that the call
is as dangerous as calling nextField().

Fixes: 137294060
Test: atest android.app.usage.UsageStatsTest
Test: atest android.app.usage.cts.UsageStatsTest
Test: atest com.android.server.usage.UsageStatsDatabaseTest
Test: atest ProtoInputStreamTests
Change-Id: Ibfb8ef741f27a211f076dc0b715b64acbfc0696a
2019-07-12 17:10:39 -07:00
Michael Wachenschwanz
d3538564e5 Remove Test Api annotation from ProtoInputStream
Also move cts tests to unit tests

Test: atest ProtoInputStreamTests
Fixes: 115635242
Change-Id: I9aff1227328aad6ec2bec3471f73ae90293a028d
2019-04-04 20:23:29 +00:00