Did Android widgets somehow exceed the binder transaction limit?

The Android documentation for AppWidgetManager says

The total Bitmap memory used by the RemoteViews object cannot exceed that required 
to fill the screen 1.5 times, ie. (screen width x screen height x 4 x 1.5) bytes.

But the documentation for TransactionTooLargeException says:

The Binder transaction buffer has a limited fixed size, currently 1Mb, which is 
shared by all transactions in progress for the process.

Almost every Android device on the market has a screen size large enough for its bitmap to exceed 1 MB (for example, 800 x 600 x 4 = 1,920,000 bytes). I looked at the source of the Android platform and didn’t seem to use ashmem with pipes or anything esoteric, just a regular AIDL file and inside RemoteViews Bitmap objects are Parcelable in the usual way (it really popped up on its own code , but it seems that all the Bitmap pixels write to ordinary parcel).

So, how is it possible that Android exceeds the Binder transaction limit? Does onewayit provide the ability to send big data?

+4
source share
2 answers

CommonsWare answered this question in a comment, the answer is no, the documentation is incorrect.

Also, using onewayyour help may cause your code to hit the transaction too much, because the RPC will return immediately before the data sent through the binder is destroyed, which allows you to send more data to the binder and bring you closer to limit or higher.

-1
source

Bitmaps . , . byte[] , .

0

Source: https://habr.com/ru/post/1541341/


All Articles