diff options
author | Brad Fitzpatrick <bradfitz@android.com> | 2010-06-18 13:07:53 -0700 |
---|---|---|
committer | Brad Fitzpatrick <bradfitz@android.com> | 2010-06-21 12:56:35 -0700 |
commit | 27b3a7a75960d026655f3acd1de8a672e80a5776 (patch) | |
tree | cc5036a00b976b7757f26212abf49ed11f779cd9 /libs/binder/Parcel.cpp | |
parent | f25c560dcdc0c04e11152fff11f521dae03522cd (diff) | |
download | frameworks_base-27b3a7a75960d026655f3acd1de8a672e80a5776.zip frameworks_base-27b3a7a75960d026655f3acd1de8a672e80a5776.tar.gz frameworks_base-27b3a7a75960d026655f3acd1de8a672e80a5776.tar.bz2 |
Start of work on passing around StrictMode policy over Binder calls.
This is (intendend to be) a no-op change.
At this stage, Binder RPCs just have an additional uint32 passed around
in the header, right before the interface name. But nothing is actually
done with them yet. That value should right now always be 0.
This now boots and seems to work.
Change-Id: I135b7c84f07575e6b9717fef2424d301a450df7b
Diffstat (limited to 'libs/binder/Parcel.cpp')
-rw-r--r-- | libs/binder/Parcel.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/libs/binder/Parcel.cpp b/libs/binder/Parcel.cpp index 00d2210..c2574bd 100644 --- a/libs/binder/Parcel.cpp +++ b/libs/binder/Parcel.cpp @@ -19,6 +19,7 @@ #include <binder/Parcel.h> +#include <binder/IPCThreadState.h> #include <binder/Binder.h> #include <binder/BpBinder.h> #include <utils/Debug.h> @@ -436,19 +437,22 @@ 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); } bool Parcel::checkInterface(IBinder* binder) const { - return enforceInterface(binder->getInterfaceDescriptor()); + return enforceInterface(binder->getInterfaceDescriptor()); } bool Parcel::enforceInterface(const String16& interface) const { + int32_t strict_policy = readInt32(); const String16 str(readString16()); if (str == interface) { return true; @@ -457,7 +461,7 @@ bool Parcel::enforceInterface(const String16& interface) const String8(interface).string(), String8(str).string()); return false; } -} +} const size_t* Parcel::objects() const { |