【发布时间】:2014-07-09 07:23:58
【问题描述】:
在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,只是一个normal AIDL file,并且在RemoteViews中,位图对象可以正常方式Parcelable(它does drop down to native code,但它似乎写所有位图像素到一个常规 Parcel)。
那么,Android 怎么可能超出 Binder 事务限制呢? oneway 是否允许发送更大的数据?
【问题讨论】:
-
自从我看到人们使用应用小部件进行活页夹交易失败的 SO 问题,我质疑
AppWidgetManager文档在这一点上的准确性。 -
谢谢,文档好像有问题。