在AppWidgetManager的 Android 文档中,它说
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.
但是TransactionTooLargeException的文档说:
The Binder transaction buffer has a limited fixed size, currently 1Mb, which is
shared by all transactions in progress for the process.
市场上几乎每个 Android 设备的屏幕尺寸都足够大,以至于填充它的位图会超过 1Mb(例如 800 x 600 x 4 = 1,920,000 字节)。我查看了Android平台源代码,它似乎没有使用带有管道或任何深奥的ashmem,只是一个普通的AIDL文件,并且在RemoteViews中,位图对象以正常的方式是Parcelable(它确实下降到本机代码,但它似乎将所有位图像素写入常规包裹)。
那么Android怎么可能超过Binder事务限制呢?是否oneway
允许发送更大的数据?