nativeGetAllocationByteCount should return a positive int

Make sure Bitmap_Delegate.nativeGetAllocationByteCount always returns a
positive integer by returning Integer.MAX_VALUE if the the size of the
picture overflows the int. That is to prevent an exception coming from
passing a negative value to NativeAllocationRegistry.
The result is only passed to NativeAllocationRegistry that registers at
most Integer.MAX_VALUE, so that has no impact in layoutlib.

Test: layoutlib tests
Change-Id: I1e637a92df161c341a6ba07cbbe98bac6ec96fcd
1 file changed