diff options
author | Martijn Coenen <maco@google.com> | 2017-01-18 15:33:31 +0100 |
---|---|---|
committer | Martijn Coenen <maco@google.com> | 2017-01-19 16:05:26 +0100 |
commit | 5c6fe25870c611f1b0c36f034414037f91201b6d (patch) | |
tree | 93b1eaaf98fb086179276cb50980a59e10997ba0 /Binder.cpp | |
parent | 865da06f1c9933b533f21f8fd86896faea4520e8 (diff) | |
download | libhwbinder-5c6fe25870c611f1b0c36f034414037f91201b6d.tar.gz |
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
Diffstat (limited to 'Binder.cpp')
-rw-r--r-- | Binder.cpp | 66 |
1 files changed, 3 insertions, 63 deletions
@@ -40,11 +40,6 @@ IBinder::~IBinder() // --------------------------------------------------------------------------- -sp<IInterface> IBinder::queryLocalInterface(const String16& /*descriptor*/) -{ - return NULL; -} - BHwBinder* IBinder::localBinder() { return NULL; @@ -75,25 +70,6 @@ BHwBinder::BHwBinder() : mExtras(nullptr) { } -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 BHwBinder::transact( 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 @@ status_t BHwBinder::unlinkToDeath( 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 @@ BHwBinder::~BHwBinder() 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; } // --------------------------------------------------------------------------- |