Fixes aggregate reporting cuts off bucket value
Bug: 269267931
Aggregate report bucket can hold a value up to 16 bytes. This value is
cbor encoded that holds a byte array. This byte array is
created/converted using the function BigInteger#toByteArray. BigInteger
sometimes uses 1 bit for the sign, therefore doing a
bigInteger.toByteArray().length can result in 1 more byte than expected
to hold such bit. This fix checks for the sign bit and if such sign is
present, that value won't be copied into the bucket.
Test: atest AdServicesServiceCoreUnitTests
Change-Id: Ia9e48c63258d3a3f617d71156d3ca2e0e0dc5494
4 files changed