Reduce libhwbinder API surface (1/?).
Removed in this round:
- All Vector'ed read/write methods
- Reading/writing dup native_handles
- Blob/ashmem support
- Special binder transactions (ping, dump, interface)
- Various unused helpers.
Obvious remaining items that require more work:
- writeString16()/writeCString() and read variants
- writeInterface() / enforceInterface()
Test: hidl_test
Change-Id: Ica2bbbdee469f12c797d9f3feff6046b2337de6a
diff --git a/Binder.cpp b/Binder.cpp
index 5d850e3..94b2074 100644
--- a/Binder.cpp
+++ b/Binder.cpp
@@ -40,11 +40,6 @@
// ---------------------------------------------------------------------------
-sp<IInterface> IBinder::queryLocalInterface(const String16& /*descriptor*/)
-{
- return NULL;
-}
-
BHwBinder* IBinder::localBinder()
{
return NULL;
@@ -75,25 +70,6 @@
{
}
-bool BHwBinder::isBinderAlive() const
-{
- return true;
-}
-
-status_t BHwBinder::pingBinder()
-{
- return NO_ERROR;
-}
-
-const String16& BHwBinder::getInterfaceDescriptor() const
-{
- // This is a local static rather than a global static,
- // to avoid static initializer ordering issues.
- static String16 sEmptyDescriptor;
- ALOGW("reached BHwBinder::getInterfaceDescriptor (this=%p)", this);
- return sEmptyDescriptor;
-}
-
status_t BHwBinder::transact(
uint32_t code, const Parcel& data, Parcel* reply, uint32_t flags, TransactCallback callback)
{
@@ -101,13 +77,6 @@
status_t err = NO_ERROR;
switch (code) {
- case PING_TRANSACTION:
- reply->writeInt32(pingBinder());
- reply->setDataPosition(0);
- if (callback != NULL) {
- callback(*reply);
- }
- break;
default:
err = onTransact(code, data, reply, flags,
[&](auto &replyParcel) {
@@ -136,11 +105,6 @@
return INVALID_OPERATION;
}
-status_t BHwBinder::dump(int /*fd*/, const Vector<String16>& /*args*/)
-{
- return NO_ERROR;
-}
-
void BHwBinder::attachObject(
const void* objectID, void* object, void* cleanupCookie,
object_cleanup_func func)
@@ -194,34 +158,10 @@
status_t BHwBinder::onTransact(
- uint32_t code, const Parcel& data, Parcel* reply, uint32_t /*flags*/, TransactCallback callback)
+ uint32_t /*code*/, const Parcel& /*data*/, Parcel* /*reply*/, uint32_t /*flags*/,
+ TransactCallback /*callback*/)
{
- switch (code) {
- case INTERFACE_TRANSACTION:
- reply->writeString16(getInterfaceDescriptor());
- if (callback != NULL) {
- callback(*reply);
- }
- return NO_ERROR;
-
- case DUMP_TRANSACTION: {
- int fd = data.readFileDescriptor();
- int argc = data.readInt32();
- Vector<String16> args;
- for (int i = 0; i < argc && data.dataAvail() > 0; i++) {
- args.add(data.readString16());
- }
- return dump(fd, args);
- }
-
- case SYSPROPS_TRANSACTION: {
- report_sysprop_change();
- return NO_ERROR;
- }
-
- default:
- return UNKNOWN_TRANSACTION;
- }
+ return UNKNOWN_TRANSACTION;
}
// ---------------------------------------------------------------------------