diff options
41 files changed, 198 insertions, 105 deletions
@@ -26,6 +26,7 @@ #include <stdio.h> namespace android { +namespace hidl { // --------------------------------------------------------------------------- @@ -301,4 +302,5 @@ bool BpRefBase::onIncStrongAttempted(uint32_t /*flags*/, const void* /*id*/) // --------------------------------------------------------------------------- +}; // namespace hidl }; // namespace android diff --git a/BpBinder.cpp b/BpBinder.cpp index f3771bf..ff8a498 100644 --- a/BpBinder.cpp +++ b/BpBinder.cpp @@ -29,6 +29,7 @@ //#define ALOGV(...) fprintf(stderr, __VA_ARGS__) namespace android { +namespace hidl { // --------------------------------------------------------------------------- @@ -362,4 +363,5 @@ bool BpBinder::onIncStrongAttempted(uint32_t /*flags*/, const void* /*id*/) // --------------------------------------------------------------------------- +}; // namespace hidl }; // namespace android diff --git a/BufferedTextOutput.cpp b/BufferedTextOutput.cpp index 7390349..5cd62a3 100644 --- a/BufferedTextOutput.cpp +++ b/BufferedTextOutput.cpp @@ -23,7 +23,7 @@ #include <utils/Vector.h> #include <cutils/threads.h> -#include <private/binder/Static.h> +#include <hwbinder/Static.h> #include <stdio.h> #include <stdlib.h> @@ -31,6 +31,7 @@ // --------------------------------------------------------------------------- namespace android { +namespace hidl { struct BufferedTextOutput::BufferState : public RefBase { @@ -279,4 +280,5 @@ BufferedTextOutput::BufferState* BufferedTextOutput::getBuffer() const return mGlobalState; } +}; // namespace hidl }; // namespace android @@ -23,6 +23,7 @@ #include <ctype.h> namespace android { +namespace hidl { // --------------------------------------------------------------------- @@ -294,5 +295,6 @@ void printHexData(int32_t indent, const void *buf, size_t length, } } +}; // namespace hidl }; // namespace android diff --git a/IInterface.cpp b/IInterface.cpp index 5b71d73..c52e8e0 100644 --- a/IInterface.cpp +++ b/IInterface.cpp @@ -19,6 +19,7 @@ #include <hwbinder/IInterface.h> namespace android { +namespace hidl { // --------------------------------------------------------------------------- @@ -46,22 +47,5 @@ sp<IBinder> IInterface::asBinder(const sp<IInterface>& iface) // --------------------------------------------------------------------------- +}; // namespace hidl }; // namespace android - -extern "C" { - -void _ZN7android10IInterface8asBinderEv(void *retval, void* self) { - ALOGW("deprecated asBinder call, please update your code"); - //ALOGI("self: %p, retval: %p", self, retval); - android::sp<android::IBinder> *ret = new(retval) android::sp<android::IBinder>; - *ret = android::IInterface::asBinder((android::IInterface*)self); -} - -void _ZNK7android10IInterface8asBinderEv(void *retval, void *self) { - ALOGW("deprecated asBinder call, please update your code"); - //ALOGI("self: %p, retval: %p", self, retval); - android::sp<android::IBinder> *ret = new(retval) android::sp<android::IBinder>; - *ret = android::IInterface::asBinder((android::IInterface*)self); -} - -} // extern "C" diff --git a/IMemory.cpp b/IMemory.cpp index 81d7c02..7252443 100644 --- a/IMemory.cpp +++ b/IMemory.cpp @@ -36,6 +36,7 @@ #define VERBOSE 0 namespace android { +namespace hidl { // --------------------------------------------------------------------------- class HeapCache : public IBinder::DeathRecipient @@ -488,4 +489,5 @@ void HeapCache::dump_heaps() // --------------------------------------------------------------------------- +}; // namespace hidl }; // namespace android diff --git a/IPCThreadState.cpp b/IPCThreadState.cpp index 6c0b7a0..9a7eef3 100644 --- a/IPCThreadState.cpp +++ b/IPCThreadState.cpp @@ -28,7 +28,7 @@ #include <utils/threads.h> #include <private/binder/binder_module.h> -#include <private/binder/Static.h> +#include <hwbinder/Static.h> #include <errno.h> #include <inttypes.h> @@ -63,6 +63,7 @@ // --------------------------------------------------------------------------- namespace android { +namespace hidl { static const char* getReturnString(size_t idx); static const void* printReturnCommand(TextOutput& out, const void* _cmd); @@ -1214,4 +1215,5 @@ void IPCThreadState::freeBuffer(Parcel* parcel, const uint8_t* data, state->mOut.writePointer((uintptr_t)data); } +}; // namespace hidl }; // namespace android diff --git a/IPermissionController.cpp b/IPermissionController.cpp index 403174f..6b78334 100644 --- a/IPermissionController.cpp +++ b/IPermissionController.cpp @@ -22,9 +22,10 @@ #include <hwbinder/Parcel.h> #include <utils/String8.h> -#include <private/binder/Static.h> +#include <hwbinder/Static.h> namespace android { +namespace hidl { // ---------------------------------------------------------------------- @@ -127,4 +128,5 @@ status_t BnPermissionController::onTransact( } } +}; // namespace hidl }; // namespace android diff --git a/IResultReceiver.cpp b/IResultReceiver.cpp index 559077f..dc4f6c7 100644 --- a/IResultReceiver.cpp +++ b/IResultReceiver.cpp @@ -22,9 +22,10 @@ #include <hwbinder/Parcel.h> #include <utils/String8.h> -#include <private/binder/Static.h> +#include <hwbinder/Static.h> namespace android { +namespace hidl { // ---------------------------------------------------------------------- @@ -66,4 +67,5 @@ status_t BnResultReceiver::onTransact( } } +}; // namespace hidl }; // namespace android diff --git a/IServiceManager.cpp b/IServiceManager.cpp index 0d5a0bf..47ebb59 100644 --- a/IServiceManager.cpp +++ b/IServiceManager.cpp @@ -21,14 +21,14 @@ #include <utils/Log.h> #include <hwbinder/IPCThreadState.h> #include <hwbinder/Parcel.h> +#include <hwbinder/Static.h> #include <utils/String8.h> #include <utils/SystemClock.h> -#include <private/binder/Static.h> - #include <unistd.h> namespace android { +namespace hidl { sp<IServiceManager> defaultServiceManager() { @@ -184,4 +184,5 @@ public: IMPLEMENT_META_INTERFACE(ServiceManager, "android.os.IServiceManager"); +}; // namespace hidl }; // namespace android diff --git a/MemoryBase.cpp b/MemoryBase.cpp index c3a66b4..aaeb6d9 100644 --- a/MemoryBase.cpp +++ b/MemoryBase.cpp @@ -22,6 +22,7 @@ namespace android { +namespace hidl { // --------------------------------------------------------------------------- @@ -43,4 +44,5 @@ MemoryBase::~MemoryBase() } // --------------------------------------------------------------------------- +}; // namespace hidl }; // namespace android diff --git a/MemoryDealer.cpp b/MemoryDealer.cpp index e0a0c0b..4f3a8a6 100644 --- a/MemoryDealer.cpp +++ b/MemoryDealer.cpp @@ -39,6 +39,7 @@ #include <sys/file.h> namespace android { +namespace hidl { // ---------------------------------------------------------------------------- /* @@ -473,4 +474,5 @@ void SimpleBestFitAllocator::dump_l(String8& result, } +}; // namespace hidl }; // namespace android diff --git a/MemoryHeapBase.cpp b/MemoryHeapBase.cpp index aaa2c90..8730bd8 100644 --- a/MemoryHeapBase.cpp +++ b/MemoryHeapBase.cpp @@ -32,6 +32,7 @@ #include <hwbinder/MemoryHeapBase.h> namespace android { +namespace hidl { // --------------------------------------------------------------------------- @@ -175,4 +176,5 @@ uint32_t MemoryHeapBase::getOffset() const { } // --------------------------------------------------------------------------- +}; // namespace hidl }; // namespace android @@ -47,7 +47,7 @@ #include <utils/String16.h> #include <private/binder/binder_module.h> -#include <private/binder/Static.h> +#include <hwbinder/Static.h> #ifndef INT32_MAX #define INT32_MAX ((int32_t)(2147483647)) @@ -84,6 +84,7 @@ struct small_flat_data }; namespace android { +namespace hidl { static pthread_mutex_t gParcelGlobalAllocSizeLock = PTHREAD_MUTEX_INITIALIZER; static size_t gParcelGlobalAllocSize = 0; @@ -2626,4 +2627,5 @@ void Parcel::Blob::clear() { mMutable = false; } +}; // namespace hidl }; // namespace android diff --git a/PersistableBundle.cpp b/PersistableBundle.cpp index 33670b4..507679e 100644 --- a/PersistableBundle.cpp +++ b/PersistableBundle.cpp @@ -28,7 +28,7 @@ using android::BAD_TYPE; using android::BAD_VALUE; using android::NO_ERROR; -using android::Parcel; +using android::hidl::Parcel; using android::sp; using android::status_t; using android::UNEXPECTED_NULL; @@ -77,7 +77,7 @@ set<android::String16> getKeys(const map<android::String16, T>& map) { } // namespace namespace android { - +namespace hidl { namespace os { #define RETURN_IF_FAILED(calledOnce) \ @@ -487,5 +487,5 @@ status_t PersistableBundle::readFromParcelInner(const Parcel* parcel, size_t len } } // namespace os - +} // namespace hidl } // namespace android diff --git a/ProcessState.cpp b/ProcessState.cpp index c452c32..874fa06 100644 --- a/ProcessState.cpp +++ b/ProcessState.cpp @@ -30,7 +30,7 @@ #include <utils/threads.h> #include <private/binder/binder_module.h> -#include <private/binder/Static.h> +#include <hwbinder/Static.h> #include <errno.h> #include <fcntl.h> @@ -48,6 +48,7 @@ // ------------------------------------------------------------------------- namespace android { +namespace hidl { class PoolThread : public Thread { @@ -375,4 +376,5 @@ ProcessState::~ProcessState() mDriverFD = -1; } +}; // namespace hidl }; // namespace android @@ -17,13 +17,14 @@ // All static variables go here, to control initialization and // destruction order in the library. -#include <private/binder/Static.h> +#include <hwbinder/Static.h> #include <hwbinder/BufferedTextOutput.h> #include <hwbinder/IPCThreadState.h> #include <utils/Log.h> namespace android { +namespace hidl { // ------------ Text output streams @@ -96,4 +97,5 @@ Mutex gDefaultServiceManagerLock; sp<IServiceManager> gDefaultServiceManager; sp<IPermissionController> gPermissionController; +} // namespace hidl } // namespace android @@ -17,6 +17,7 @@ #include <hwbinder/Status.h> namespace android { +namespace hidl { namespace binder { Status Status::ok() { @@ -164,4 +165,5 @@ std::stringstream& operator<< (std::stringstream& stream, const Status& s) { } } // namespace binder +} // namespace hidl } // namespace android diff --git a/TextOutput.cpp b/TextOutput.cpp index 6fc369d..6a38b60 100644 --- a/TextOutput.cpp +++ b/TextOutput.cpp @@ -26,6 +26,7 @@ #include <string.h> namespace android { +namespace hidl { // --------------------------------------------------------------------------- @@ -166,4 +167,5 @@ TextOutput& operator<<(TextOutput& to, const HexDump& val) return to; } +}; // namespace hidl }; // namespace android diff --git a/include/hwbinder/Binder.h b/include/hwbinder/Binder.h index f203901..3749e4f 100644 --- a/include/hwbinder/Binder.h +++ b/include/hwbinder/Binder.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_BINDER_H -#define ANDROID_BINDER_H +#ifndef ANDROID_HIDL_BINDER_H +#define ANDROID_HIDL_BINDER_H #include <atomic> #include <stdint.h> @@ -23,6 +23,7 @@ // --------------------------------------------------------------------------- namespace android { +namespace hidl { class BBinder : public IBinder { @@ -98,8 +99,9 @@ private: std::atomic<int32_t> mState; }; +}; // namespace hidl }; // namespace android // --------------------------------------------------------------------------- -#endif // ANDROID_BINDER_H +#endif // ANDROID_HIDL_BINDER_H diff --git a/include/hwbinder/BinderService.h b/include/hwbinder/BinderService.h index 3392d24..11de982 100644 --- a/include/hwbinder/BinderService.h +++ b/include/hwbinder/BinderService.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_BINDER_SERVICE_H -#define ANDROID_BINDER_SERVICE_H +#ifndef ANDROID_HIDL_BINDER_SERVICE_H +#define ANDROID_HIDL_BINDER_SERVICE_H #include <stdint.h> @@ -29,6 +29,7 @@ // --------------------------------------------------------------------------- namespace android { +namespace hidl { template<typename SERVICE> class BinderService @@ -59,7 +60,7 @@ private: } }; - +}; // namespace hidl }; // namespace android // --------------------------------------------------------------------------- -#endif // ANDROID_BINDER_SERVICE_H +#endif // ANDROID_HIDL_BINDER_SERVICE_H diff --git a/include/hwbinder/BpBinder.h b/include/hwbinder/BpBinder.h index cb67693..3c5e467 100644 --- a/include/hwbinder/BpBinder.h +++ b/include/hwbinder/BpBinder.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_BPBINDER_H -#define ANDROID_BPBINDER_H +#ifndef ANDROID_HIDL_BPBINDER_H +#define ANDROID_HIDL_BPBINDER_H #include <hwbinder/IBinder.h> #include <utils/KeyedVector.h> @@ -23,6 +23,7 @@ // --------------------------------------------------------------------------- namespace android { +namespace hidl { class BpBinder : public IBinder { @@ -117,8 +118,9 @@ private: mutable String16 mDescriptorCache; }; +}; // namespace hidl }; // namespace android // --------------------------------------------------------------------------- -#endif // ANDROID_BPBINDER_H +#endif // ANDROID_HIDL_BPBINDER_H diff --git a/include/hwbinder/BufferedTextOutput.h b/include/hwbinder/BufferedTextOutput.h index 81cce31..2ae5c29 100644 --- a/include/hwbinder/BufferedTextOutput.h +++ b/include/hwbinder/BufferedTextOutput.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_BUFFEREDTEXTOUTPUT_H -#define ANDROID_BUFFEREDTEXTOUTPUT_H +#ifndef ANDROID_HIDL_BUFFEREDTEXTOUTPUT_H +#define ANDROID_HIDL_BUFFEREDTEXTOUTPUT_H #include <hwbinder/TextOutput.h> #include <utils/threads.h> @@ -23,6 +23,7 @@ // --------------------------------------------------------------------------- namespace android { +namespace hidl { class BufferedTextOutput : public TextOutput { @@ -62,6 +63,7 @@ private: }; // --------------------------------------------------------------------------- +}; // namespace hidl }; // namespace android -#endif // ANDROID_BUFFEREDTEXTOUTPUT_H +#endif // ANDROID_HIDL_BUFFEREDTEXTOUTPUT_H diff --git a/include/hwbinder/Debug.h b/include/hwbinder/Debug.h index f6a3355..1704daa 100644 --- a/include/hwbinder/Debug.h +++ b/include/hwbinder/Debug.h @@ -14,13 +14,14 @@ * limitations under the License. */ -#ifndef ANDROID_BINDER_DEBUG_H -#define ANDROID_BINDER_DEBUG_H +#ifndef ANDROID_HIDL_BINDER_DEBUG_H +#define ANDROID_HIDL_BINDER_DEBUG_H #include <stdint.h> #include <sys/types.h> namespace android { +namespace hidl { // --------------------------------------------------------------------------- #ifdef __cplusplus @@ -44,6 +45,7 @@ void printHexData(int32_t indent, const void *buf, size_t length, #endif // --------------------------------------------------------------------------- +}; // namespace hidl }; // namespace android -#endif // ANDROID_BINDER_DEBUG_H +#endif // ANDROID_HIDL_BINDER_DEBUG_H diff --git a/include/hwbinder/IBinder.h b/include/hwbinder/IBinder.h index 5f1e87c..0a3103d 100644 --- a/include/hwbinder/IBinder.h +++ b/include/hwbinder/IBinder.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_IBINDER_H -#define ANDROID_IBINDER_H +#ifndef ANDROID_HIDL_IBINDER_H +#define ANDROID_HIDL_IBINDER_H #include <utils/Errors.h> #include <utils/RefBase.h> @@ -32,6 +32,7 @@ // --------------------------------------------------------------------------- namespace android { +namespace hidl { class BBinder; class BpBinder; @@ -154,8 +155,9 @@ protected: private: }; +}; // namespace hidl }; // namespace android // --------------------------------------------------------------------------- -#endif // ANDROID_IBINDER_H +#endif // ANDROID_HIDL_IBINDER_H diff --git a/include/hwbinder/IInterface.h b/include/hwbinder/IInterface.h index fb10cba..700c9de 100644 --- a/include/hwbinder/IInterface.h +++ b/include/hwbinder/IInterface.h @@ -15,13 +15,13 @@ */ // -#ifndef ANDROID_IINTERFACE_H -#define ANDROID_IINTERFACE_H +#ifndef ANDROID_HIDL_IINTERFACE_H +#define ANDROID_HIDL_IINTERFACE_H #include <hwbinder/Binder.h> namespace android { - +namespace hidl { // ---------------------------------------------------------------------- class IInterface : public virtual RefBase @@ -74,7 +74,7 @@ protected: #define DECLARE_META_INTERFACE(INTERFACE) \ static const android::String16 descriptor; \ static android::sp<I##INTERFACE> asInterface( \ - const android::sp<android::IBinder>& obj); \ + const android::sp<android::hidl::IBinder>& obj); \ virtual const android::String16& getInterfaceDescriptor() const; \ I##INTERFACE(); \ virtual ~I##INTERFACE(); \ @@ -87,7 +87,7 @@ protected: return I##INTERFACE::descriptor; \ } \ android::sp<I##INTERFACE> I##INTERFACE::asInterface( \ - const android::sp<android::IBinder>& obj) \ + const android::sp<android::hidl::IBinder>& obj) \ { \ android::sp<I##INTERFACE> intr; \ if (obj != NULL) { \ @@ -145,6 +145,7 @@ inline IBinder* BpInterface<INTERFACE>::onAsBinder() // ---------------------------------------------------------------------- +}; // namespace hidl }; // namespace android -#endif // ANDROID_IINTERFACE_H +#endif // ANDROID_HIDL_IINTERFACE_H diff --git a/include/hwbinder/IMemory.h b/include/hwbinder/IMemory.h index 6a8d666..d342b8b 100644 --- a/include/hwbinder/IMemory.h +++ b/include/hwbinder/IMemory.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_IMEMORY_H -#define ANDROID_IMEMORY_H +#ifndef ANDROID_HIDL_IMEMORY_H +#define ANDROID_HIDL_IMEMORY_H #include <stdint.h> #include <sys/types.h> @@ -26,7 +26,7 @@ #include <hwbinder/IInterface.h> namespace android { - +namespace hidl { // ---------------------------------------------------------------------------- class IMemoryHeap : public IInterface @@ -97,6 +97,7 @@ protected: // ---------------------------------------------------------------------------- +}; // namespace hidl }; // namespace android -#endif // ANDROID_IMEMORY_H +#endif // ANDROID_HIDL_IMEMORY_H diff --git a/include/hwbinder/IPCThreadState.h b/include/hwbinder/IPCThreadState.h index 2127fd7..c47b619 100644 --- a/include/hwbinder/IPCThreadState.h +++ b/include/hwbinder/IPCThreadState.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_IPC_THREAD_STATE_H -#define ANDROID_IPC_THREAD_STATE_H +#ifndef ANDROID_HIDL_IPC_THREAD_STATE_H +#define ANDROID_HIDL_IPC_THREAD_STATE_H #include <utils/Errors.h> #include <hwbinder/Parcel.h> @@ -28,6 +28,7 @@ typedef int uid_t; // --------------------------------------------------------------------------- namespace android { +namespace hidl { class IPCThreadState { @@ -128,8 +129,9 @@ private: int32_t mLastTransactionBinderFlags; }; +}; // namespace hidl }; // namespace android // --------------------------------------------------------------------------- -#endif // ANDROID_IPC_THREAD_STATE_H +#endif // ANDROID_HIDL_IPC_THREAD_STATE_H diff --git a/include/hwbinder/IPermissionController.h b/include/hwbinder/IPermissionController.h index 2eb8573..a0f0f61 100644 --- a/include/hwbinder/IPermissionController.h +++ b/include/hwbinder/IPermissionController.h @@ -15,14 +15,14 @@ */ // -#ifndef ANDROID_IPERMISSION_CONTROLLER_H -#define ANDROID_IPERMISSION_CONTROLLER_H +#ifndef ANDROID_HIDL_IPERMISSION_CONTROLLER_H +#define ANDROID_HIDL_IPERMISSION_CONTROLLER_H #include <hwbinder/IInterface.h> #include <stdlib.h> namespace android { - +namespace hidl { // ---------------------------------------------------------------------- class IPermissionController : public IInterface @@ -56,7 +56,8 @@ public: // ---------------------------------------------------------------------- +}; // namespace hidl }; // namespace android -#endif // ANDROID_IPERMISSION_CONTROLLER_H +#endif // ANDROID_HIDL_IPERMISSION_CONTROLLER_H diff --git a/include/hwbinder/IResultReceiver.h b/include/hwbinder/IResultReceiver.h index bdb0375..57906c7 100644 --- a/include/hwbinder/IResultReceiver.h +++ b/include/hwbinder/IResultReceiver.h @@ -15,13 +15,13 @@ */ // -#ifndef ANDROID_IRESULT_RECEIVER_H -#define ANDROID_IRESULT_RECEIVER_H +#ifndef ANDROID_HIDL_IRESULT_RECEIVER_H +#define ANDROID_HIDL_IRESULT_RECEIVER_H #include <hwbinder/IInterface.h> namespace android { - +namespace hidl { // ---------------------------------------------------------------------- class IResultReceiver : public IInterface @@ -49,7 +49,8 @@ public: // ---------------------------------------------------------------------- +}; // namespace hidl }; // namespace android -#endif // ANDROID_IRESULT_RECEIVER_H +#endif // ANDROID_HIDL_IRESULT_RECEIVER_H diff --git a/include/hwbinder/IServiceManager.h b/include/hwbinder/IServiceManager.h index caacb7c..f045505 100644 --- a/include/hwbinder/IServiceManager.h +++ b/include/hwbinder/IServiceManager.h @@ -15,8 +15,8 @@ */ // -#ifndef ANDROID_ISERVICE_MANAGER_H -#define ANDROID_ISERVICE_MANAGER_H +#ifndef ANDROID_HIDL_ISERVICE_MANAGER_H +#define ANDROID_HIDL_ISERVICE_MANAGER_H #include <hwbinder/IInterface.h> #include <hwbinder/IPermissionController.h> @@ -24,7 +24,7 @@ #include <utils/String16.h> namespace android { - +namespace hidl { // ---------------------------------------------------------------------- class IServiceManager : public IInterface @@ -81,7 +81,8 @@ bool checkCallingPermission(const String16& permission, int32_t* outPid, int32_t* outUid); bool checkPermission(const String16& permission, pid_t pid, uid_t uid); +}; // namespace hidl }; // namespace android -#endif // ANDROID_ISERVICE_MANAGER_H +#endif // ANDROID_HIDL_ISERVICE_MANAGER_H diff --git a/include/hwbinder/MemoryBase.h b/include/hwbinder/MemoryBase.h index 48ebbaa..8e4091d 100644 --- a/include/hwbinder/MemoryBase.h +++ b/include/hwbinder/MemoryBase.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_MEMORY_BASE_H -#define ANDROID_MEMORY_BASE_H +#ifndef ANDROID_HIDL_MEMORY_BASE_H +#define ANDROID_HIDL_MEMORY_BASE_H #include <stdlib.h> #include <stdint.h> @@ -24,7 +24,7 @@ namespace android { - +namespace hidl { // --------------------------------------------------------------------------- class MemoryBase : public BnMemory @@ -46,6 +46,7 @@ private: }; // --------------------------------------------------------------------------- +}; // namespace hidl }; // namespace android -#endif // ANDROID_MEMORY_BASE_H +#endif // ANDROID_HIDL_MEMORY_BASE_H diff --git a/include/hwbinder/MemoryDealer.h b/include/hwbinder/MemoryDealer.h index 063cdd3..b120922 100644 --- a/include/hwbinder/MemoryDealer.h +++ b/include/hwbinder/MemoryDealer.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_MEMORY_DEALER_H -#define ANDROID_MEMORY_DEALER_H +#ifndef ANDROID_HIDL_MEMORY_DEALER_H +#define ANDROID_HIDL_MEMORY_DEALER_H #include <stdint.h> @@ -25,6 +25,7 @@ #include <hwbinder/MemoryHeapBase.h> namespace android { +namespace hidl { // ---------------------------------------------------------------------------- class SimpleBestFitAllocator; @@ -59,6 +60,7 @@ private: // ---------------------------------------------------------------------------- +}; // namespace hidl }; // namespace android -#endif // ANDROID_MEMORY_DEALER_H +#endif // ANDROID_HIDL_MEMORY_DEALER_H diff --git a/include/hwbinder/MemoryHeapBase.h b/include/hwbinder/MemoryHeapBase.h index 24200c5..5e1affd 100644 --- a/include/hwbinder/MemoryHeapBase.h +++ b/include/hwbinder/MemoryHeapBase.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_MEMORY_HEAP_BASE_H -#define ANDROID_MEMORY_HEAP_BASE_H +#ifndef ANDROID_HIDL_MEMORY_HEAP_BASE_H +#define ANDROID_HIDL_MEMORY_HEAP_BASE_H #include <stdlib.h> #include <stdint.h> @@ -24,6 +24,7 @@ namespace android { +namespace hidl { // --------------------------------------------------------------------------- @@ -98,6 +99,7 @@ private: }; // --------------------------------------------------------------------------- +}; // namespace hidl }; // namespace android -#endif // ANDROID_MEMORY_HEAP_BASE_H +#endif // ANDROID_HIDL_MEMORY_HEAP_BASE_H diff --git a/include/hwbinder/Parcel.h b/include/hwbinder/Parcel.h index 14bd3ef..1d5c224 100644 --- a/include/hwbinder/Parcel.h +++ b/include/hwbinder/Parcel.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_PARCEL_H -#define ANDROID_PARCEL_H +#ifndef ANDROID_HIDL_PARCEL_H +#define ANDROID_HIDL_PARCEL_H #include <string> #include <vector> @@ -34,13 +34,14 @@ // --------------------------------------------------------------------------- namespace android { +class String8; +namespace hidl { template <typename T> class Flattenable; template <typename T> class LightFlattenable; class IBinder; class IPCThreadState; class ProcessState; -class String8; class TextOutput; class Parcel { @@ -801,8 +802,9 @@ status_t unflatten_binder(const sp<ProcessState>& proc, status_t unflatten_binder(const sp<ProcessState>& proc, const flat_binder_object& flat, wp<IBinder>* out); +}; // namespace hidl }; // namespace android // --------------------------------------------------------------------------- -#endif // ANDROID_PARCEL_H +#endif // ANDROID_HIDL_PARCEL_H diff --git a/include/hwbinder/Parcelable.h b/include/hwbinder/Parcelable.h index faf0d34..b75a2b0 100644 --- a/include/hwbinder/Parcelable.h +++ b/include/hwbinder/Parcelable.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_PARCELABLE_H -#define ANDROID_PARCELABLE_H +#ifndef ANDROID_HIDL_PARCELABLE_H +#define ANDROID_HIDL_PARCELABLE_H #include <vector> @@ -23,6 +23,7 @@ #include <utils/String16.h> namespace android { +namespace hidl { class Parcel; @@ -46,6 +47,7 @@ public: virtual status_t readFromParcel(const Parcel* parcel) = 0; }; // class Parcelable +} // namespace hidl } // namespace android -#endif // ANDROID_PARCELABLE_H +#endif // ANDROID_HIDL_PARCELABLE_H diff --git a/include/hwbinder/PersistableBundle.h b/include/hwbinder/PersistableBundle.h index 10a457e..2428568 100644 --- a/include/hwbinder/PersistableBundle.h +++ b/include/hwbinder/PersistableBundle.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_PERSISTABLE_BUNDLE_H -#define ANDROID_PERSISTABLE_BUNDLE_H +#ifndef ANDROID_HIDL_PERSISTABLE_BUNDLE_H +#define ANDROID_HIDL_PERSISTABLE_BUNDLE_H #include <map> #include <set> @@ -26,7 +26,7 @@ #include <utils/StrongPointer.h> namespace android { - +namespace hidl { namespace os { /* @@ -126,7 +126,7 @@ private: }; } // namespace os - +} // namespace hidl } // namespace android #endif // ANDROID_PERSISTABLE_BUNDLE_H diff --git a/include/hwbinder/ProcessState.h b/include/hwbinder/ProcessState.h index 709137c..86af7b0 100644 --- a/include/hwbinder/ProcessState.h +++ b/include/hwbinder/ProcessState.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_PROCESS_STATE_H -#define ANDROID_PROCESS_STATE_H +#ifndef ANDROID_HIDL_PROCESS_STATE_H +#define ANDROID_HIDL_PROCESS_STATE_H #include <hwbinder/IBinder.h> #include <utils/KeyedVector.h> @@ -28,6 +28,7 @@ // --------------------------------------------------------------------------- namespace android { +namespace hidl { class IPCThreadState; @@ -111,8 +112,9 @@ private: volatile int32_t mThreadPoolSeq; }; +}; // namespace hidl }; // namespace android // --------------------------------------------------------------------------- -#endif // ANDROID_PROCESS_STATE_H +#endif // ANDROID_HIDL_PROCESS_STATE_H diff --git a/include/hwbinder/Static.h b/include/hwbinder/Static.h new file mode 100644 index 0000000..02d86f4 --- /dev/null +++ b/include/hwbinder/Static.h @@ -0,0 +1,44 @@ +/* + * Copyright (C) 2008 The Android Open Source Project + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +// All static variables go here, to control initialization and +// destruction order in the library. + +#include <utils/threads.h> + +#include <hwbinder/IBinder.h> +#include <hwbinder/IMemory.h> +#include <hwbinder/ProcessState.h> +#include <hwbinder/IPermissionController.h> +#include <hwbinder/IServiceManager.h> + +namespace android { +namespace hidl { + +// For TextStream.cpp +extern Vector<int32_t> gTextBuffers; + +// For ProcessState.cpp +extern Mutex gProcessMutex; +extern sp<ProcessState> gProcess; + +// For IServiceManager.cpp +extern Mutex gDefaultServiceManagerLock; +extern sp<IServiceManager> gDefaultServiceManager; +extern sp<IPermissionController> gPermissionController; + +} // namespace hidl +} // namespace android diff --git a/include/hwbinder/Status.h b/include/hwbinder/Status.h index 50dd821..2f98bbc 100644 --- a/include/hwbinder/Status.h +++ b/include/hwbinder/Status.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_BINDER_STATUS_H -#define ANDROID_BINDER_STATUS_H +#ifndef ANDROID_HIDL_BINDER_STATUS_H +#define ANDROID_HIDL_BINDER_STATUS_H #include <cstdint> #include <sstream> @@ -24,6 +24,7 @@ #include <utils/String8.h> namespace android { +namespace hidl { namespace binder { // An object similar in function to a status_t except that it understands @@ -146,6 +147,7 @@ private: std::stringstream& operator<< (std::stringstream& stream, const Status& s); } // namespace binder +} // namespace hidl } // namespace android -#endif // ANDROID_BINDER_STATUS_H +#endif // ANDROID_HIDL_BINDER_STATUS_H diff --git a/include/hwbinder/TextOutput.h b/include/hwbinder/TextOutput.h index 974a194..7273a32 100644 --- a/include/hwbinder/TextOutput.h +++ b/include/hwbinder/TextOutput.h @@ -14,8 +14,8 @@ * limitations under the License. */ -#ifndef ANDROID_TEXTOUTPUT_H -#define ANDROID_TEXTOUTPUT_H +#ifndef ANDROID_HIDL_TEXTOUTPUT_H +#define ANDROID_HIDL_TEXTOUTPUT_H #include <utils/Errors.h> @@ -24,9 +24,9 @@ // --------------------------------------------------------------------------- namespace android { - class String8; class String16; +namespace hidl { class TextOutput { @@ -190,6 +190,7 @@ inline size_t HexDump::alignment() const { return mAlignment; } inline bool HexDump::carrayStyle() const { return mCArrayStyle; } // --------------------------------------------------------------------------- +}; // namespace hidl }; // namespace android -#endif // ANDROID_TEXTOUTPUT_H +#endif // ANDROID_HIDL_TEXTOUTPUT_H |