Loading include/binder/IPCThreadState.h +5 −1 Original line number Diff line number Diff line Loading @@ -41,6 +41,9 @@ public: int getCallingPid(); int getCallingUid(); void setStrictModePolicy(int32_t policy); int32_t getStrictModePolicy() const; int64_t clearCallingIdentity(); void restoreCallingIdentity(int64_t token); Loading Loading @@ -109,6 +112,7 @@ private: status_t mLastError; pid_t mCallingPid; uid_t mCallingUid; int32_t mStrictModePolicy; }; }; // namespace android Loading include/binder/Parcel.h +4 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,10 @@ public: bool hasFileDescriptors() const; // Writes the RPC header. status_t writeInterfaceToken(const String16& interface); // Parses the RPC header, returning true if the interface name // in the header matches the expected interface from the caller. bool enforceInterface(const String16& interface) const; bool checkInterface(IBinder*) const; Loading libs/binder/IPCThreadState.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -367,6 +367,16 @@ int64_t IPCThreadState::clearCallingIdentity() return token; } void IPCThreadState::setStrictModePolicy(int32_t policy) { mStrictModePolicy = policy; } int32_t IPCThreadState::getStrictModePolicy() const { return mStrictModePolicy; } void IPCThreadState::restoreCallingIdentity(int64_t token) { mCallingUid = (int)(token>>32); Loading Loading @@ -588,7 +598,8 @@ status_t IPCThreadState::clearDeathNotification(int32_t handle, BpBinder* proxy) } IPCThreadState::IPCThreadState() : mProcess(ProcessState::self()), mMyThreadId(androidGetTid()) : mProcess(ProcessState::self()), mMyThreadId(androidGetTid()), mStrictModePolicy(0) { pthread_setspecific(gTLS, this); clearCaller(); Loading libs/binder/IServiceManager.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -136,7 +136,7 @@ public: for (n = 0; n < 5; n++){ sp<IBinder> svc = checkService(name); if (svc != NULL) return svc; LOGI("Waiting for sevice %s...\n", String8(name).string()); LOGI("Waiting for service %s...\n", String8(name).string()); sleep(1); } return NULL; Loading Loading @@ -226,4 +226,3 @@ status_t BnServiceManager::onTransact( } }; // namespace android libs/binder/Parcel.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <binder/Parcel.h> #include <binder/IPCThreadState.h> #include <binder/Binder.h> #include <binder/BpBinder.h> #include <utils/Debug.h> Loading Loading @@ -436,8 +437,10 @@ bool Parcel::hasFileDescriptors() const return mHasFds; } // Write RPC headers. (previously just the interface token) status_t Parcel::writeInterfaceToken(const String16& interface) { writeInt32(IPCThreadState::self()->getStrictModePolicy()); // currently the interface identification token is just its name as a string return writeString16(interface); } Loading @@ -449,6 +452,7 @@ bool Parcel::checkInterface(IBinder* binder) const bool Parcel::enforceInterface(const String16& interface) const { int32_t strict_policy = readInt32(); const String16 str(readString16()); if (str == interface) { return true; Loading Loading
include/binder/IPCThreadState.h +5 −1 Original line number Diff line number Diff line Loading @@ -41,6 +41,9 @@ public: int getCallingPid(); int getCallingUid(); void setStrictModePolicy(int32_t policy); int32_t getStrictModePolicy() const; int64_t clearCallingIdentity(); void restoreCallingIdentity(int64_t token); Loading Loading @@ -109,6 +112,7 @@ private: status_t mLastError; pid_t mCallingPid; uid_t mCallingUid; int32_t mStrictModePolicy; }; }; // namespace android Loading
include/binder/Parcel.h +4 −1 Original line number Diff line number Diff line Loading @@ -56,7 +56,10 @@ public: bool hasFileDescriptors() const; // Writes the RPC header. status_t writeInterfaceToken(const String16& interface); // Parses the RPC header, returning true if the interface name // in the header matches the expected interface from the caller. bool enforceInterface(const String16& interface) const; bool checkInterface(IBinder*) const; Loading
libs/binder/IPCThreadState.cpp +12 −1 Original line number Diff line number Diff line Loading @@ -367,6 +367,16 @@ int64_t IPCThreadState::clearCallingIdentity() return token; } void IPCThreadState::setStrictModePolicy(int32_t policy) { mStrictModePolicy = policy; } int32_t IPCThreadState::getStrictModePolicy() const { return mStrictModePolicy; } void IPCThreadState::restoreCallingIdentity(int64_t token) { mCallingUid = (int)(token>>32); Loading Loading @@ -588,7 +598,8 @@ status_t IPCThreadState::clearDeathNotification(int32_t handle, BpBinder* proxy) } IPCThreadState::IPCThreadState() : mProcess(ProcessState::self()), mMyThreadId(androidGetTid()) : mProcess(ProcessState::self()), mMyThreadId(androidGetTid()), mStrictModePolicy(0) { pthread_setspecific(gTLS, this); clearCaller(); Loading
libs/binder/IServiceManager.cpp +3 −4 Original line number Diff line number Diff line Loading @@ -136,7 +136,7 @@ public: for (n = 0; n < 5; n++){ sp<IBinder> svc = checkService(name); if (svc != NULL) return svc; LOGI("Waiting for sevice %s...\n", String8(name).string()); LOGI("Waiting for service %s...\n", String8(name).string()); sleep(1); } return NULL; Loading Loading @@ -226,4 +226,3 @@ status_t BnServiceManager::onTransact( } }; // namespace android
libs/binder/Parcel.cpp +6 −2 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #include <binder/Parcel.h> #include <binder/IPCThreadState.h> #include <binder/Binder.h> #include <binder/BpBinder.h> #include <utils/Debug.h> Loading Loading @@ -436,8 +437,10 @@ bool Parcel::hasFileDescriptors() const return mHasFds; } // Write RPC headers. (previously just the interface token) status_t Parcel::writeInterfaceToken(const String16& interface) { writeInt32(IPCThreadState::self()->getStrictModePolicy()); // currently the interface identification token is just its name as a string return writeString16(interface); } Loading @@ -449,6 +452,7 @@ bool Parcel::checkInterface(IBinder* binder) const bool Parcel::enforceInterface(const String16& interface) const { int32_t strict_policy = readInt32(); const String16 str(readString16()); if (str == interface) { return true; Loading