包裹 Android Binder 類最重要方法。 更多...
| 頭: | #include <QAndroidBinder> |
| qmake: | QT += androidextras |
| Since: | Qt 5.10 |
該類在 Qt 5.10 引入。
| 枚舉類 | CallType { Normal, OneWay } |
| QAndroidBinder (const QAndroidJniObject & binder ) | |
| QAndroidBinder () | |
| QAndroidJniObject | handle () const |
| virtual bool | onTransact (int code , const QAndroidParcel & data , const QAndroidParcel & reply , QAndroidBinder::CallType flags ) |
| bool | transact (int code , const QAndroidParcel & data , QAndroidParcel * reply = nullptr, QAndroidBinder::CallType flags = CallType::Normal) const |
QAndroidBinder 方便類包裹最重要的 Android Binder 方法。
此枚舉用於 QAndroidBinder::transact () to describe the mode in which the IPC call is performed.
| 常量 | 值 | 描述 |
|---|---|---|
QAndroidBinder::CallType::Normal
|
0
|
normal IPC, meaning that the caller waits the result from the callee |
QAndroidBinder::CallType::OneWay
|
1
|
one-way IPC, meaning that the caller returns immediately, without waiting for a result from the callee |
創建新的對象從 binder Java 對象。
另請參閱 transact .
創建可用於履行 IPC 的新對象。
另請參閱 onTransact and transact .
The return value is useful to call other Java API which are not covered by this wrapper
[虛擬]
bool
QAndroidBinder::
onTransact
(
int
code
, const
QAndroidParcel
&
data
, const
QAndroidParcel
&
reply
,
QAndroidBinder::CallType
flags
)
Default implementation is a stub that returns false. The user should override this method to get the transact data from the caller.
The
code
是要履行的動作。
data
是由調用者發送的編組數據。
The
reply
是要發送給調用者的編組數據。
The
flags
是額外操作標誌。
警告: 從 Binder 綫程 (不同於創建此對象的綫程) 調用此方法。
另請參閱 transact .
履行 IPC 調用
The
code
是要履行的動作。應該介於
FIRST_CALL_TRANSACTION
and
LAST_CALL_TRANSACTION
.
The
data
是要發送給目標的編組數據。
The
reply
(if specified) is the marshaled data to be received from the target. May be
nullptr
if you are not interested in the return value.
The
flags
是額外操作標誌。
返迴 true 當成功時