diff options
author | Mathias Agopian <mathias@google.com> | 2010-04-19 19:26:31 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2010-04-19 19:26:31 -0700 |
commit | 65d884063727629ac9b859e3ff155e623e9d4ebd (patch) | |
tree | e12493e7eef9950f16847e02d1f4e680da84d5b7 | |
parent | 3956b41a044caeeeb66c44810e7764bb08ca475d (diff) | |
parent | 8288f66f0af45c82ffa2394a419e1f7c9393c048 (diff) | |
download | frameworks_native-65d884063727629ac9b859e3ff155e623e9d4ebd.zip frameworks_native-65d884063727629ac9b859e3ff155e623e9d4ebd.tar.gz frameworks_native-65d884063727629ac9b859e3ff155e623e9d4ebd.tar.bz2 |
am 0a4ab1b9: Merge "fix [2599939] "cannot play video" after open/close a video player a dozen of times" into froyo
Merge commit '0a4ab1b9b4c7b891c1ecb67eed99e9c9b30c93aa' into froyo-plus-aosp
* commit '0a4ab1b9b4c7b891c1ecb67eed99e9c9b30c93aa':
fix [2599939] "cannot play video" after open/close a video player a dozen of times
-rw-r--r-- | include/binder/IMemory.h | 3 | ||||
-rw-r--r-- | include/binder/MemoryHeapBase.h | 1 | ||||
-rw-r--r-- | include/binder/MemoryHeapPmem.h | 3 | ||||
-rw-r--r-- | libs/binder/IMemory.cpp | 23 |
4 files changed, 2 insertions, 28 deletions
diff --git a/include/binder/IMemory.h b/include/binder/IMemory.h index ae042cb..74d2cc7 100644 --- a/include/binder/IMemory.h +++ b/include/binder/IMemory.h @@ -36,8 +36,7 @@ public: // flags returned by getFlags() enum { - READ_ONLY = 0x00000001, - MAP_ONCE = 0x00000002 + READ_ONLY = 0x00000001 }; virtual int getHeapID() const = 0; diff --git a/include/binder/MemoryHeapBase.h b/include/binder/MemoryHeapBase.h index d793c24..2f2e31b 100644 --- a/include/binder/MemoryHeapBase.h +++ b/include/binder/MemoryHeapBase.h @@ -32,7 +32,6 @@ class MemoryHeapBase : public virtual BnMemoryHeap public: enum { READ_ONLY = IMemoryHeap::READ_ONLY, - MAP_ONCE = IMemoryHeap::MAP_ONCE, // memory won't be mapped locally, but will be mapped in the remote // process. DONT_MAP_LOCALLY = 0x00000100, diff --git a/include/binder/MemoryHeapPmem.h b/include/binder/MemoryHeapPmem.h index aac164f..e1660c4 100644 --- a/include/binder/MemoryHeapPmem.h +++ b/include/binder/MemoryHeapPmem.h @@ -46,8 +46,7 @@ public: sp<MemoryHeapPmem> mClientHeap; }; - MemoryHeapPmem(const sp<MemoryHeapBase>& pmemHeap, - uint32_t flags = IMemoryHeap::MAP_ONCE); + MemoryHeapPmem(const sp<MemoryHeapBase>& pmemHeap, uint32_t flags = 0); ~MemoryHeapPmem(); /* HeapInterface additions */ diff --git a/libs/binder/IMemory.cpp b/libs/binder/IMemory.cpp index 6c1d225..bc8c412 100644 --- a/libs/binder/IMemory.cpp +++ b/libs/binder/IMemory.cpp @@ -46,7 +46,6 @@ public: virtual void binderDied(const wp<IBinder>& who); sp<IMemoryHeap> find_heap(const sp<IBinder>& binder); - void pin_heap(const sp<IBinder>& binder); void free_heap(const sp<IBinder>& binder); sp<IMemoryHeap> get_heap(const sp<IBinder>& binder); void dump_heaps(); @@ -100,13 +99,9 @@ private: static inline void dump_heaps() { gHeapCache->dump_heaps(); } - void inline pin_heap() const { - gHeapCache->pin_heap(const_cast<BpMemoryHeap*>(this)->asBinder()); - } void assertMapped() const; void assertReallyMapped() const; - void pinHeap() const; mutable volatile int32_t mHeapId; mutable void* mBase; @@ -320,11 +315,6 @@ void BpMemoryHeap::assertReallyMapped() const asBinder().get(), size, fd, strerror(errno)); close(fd); } else { - if (flags & MAP_ONCE) { - //LOGD("pinning heap (binder=%p, size=%d, fd=%d", - // asBinder().get(), size, fd); - pin_heap(); - } mSize = size; mFlags = flags; android_atomic_write(fd, &mHeapId); @@ -421,19 +411,6 @@ sp<IMemoryHeap> HeapCache::find_heap(const sp<IBinder>& binder) } } -void HeapCache::pin_heap(const sp<IBinder>& binder) -{ - Mutex::Autolock _l(mHeapCacheLock); - ssize_t i = mHeapCache.indexOfKey(binder); - if (i>=0) { - heap_info_t& info(mHeapCache.editValueAt(i)); - android_atomic_inc(&info.count); - binder->linkToDeath(this); - } else { - LOGE("pin_heap binder=%p not found!!!", binder.get()); - } -} - void HeapCache::free_heap(const sp<IBinder>& binder) { free_heap( wp<IBinder>(binder) ); } |