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
tree: a0b81b2abd2da7a60aa706d845975224eb194c19
  1. adservices/
  2. apex/
  3. sdksandbox/
  4. groups
  5. OWNERS
  6. PREUPLOAD.cfg
  7. project.config