Merge "Expand on the SurfaceTexture API docs."
diff --git a/include/binder/IBinder.h b/include/binder/IBinder.h
index 81b56c2..749a977 100644
--- a/include/binder/IBinder.h
+++ b/include/binder/IBinder.h
@@ -98,7 +98,7 @@
* Register the @a recipient for a notification if this binder
* goes away. If this binder object unexpectedly goes away
* (typically because its hosting process has been killed),
- * then DeathRecipient::binderDied() will be called with a reference
+ * then DeathRecipient::binderDied() will be called with a referene
* to this.
*
* The @a cookie is optional -- if non-NULL, it should be a
diff --git a/include/utils/RefBase.h b/include/utils/RefBase.h
index 9b0e7d8..f355087 100644
--- a/include/utils/RefBase.h
+++ b/include/utils/RefBase.h
@@ -425,8 +425,11 @@
template<typename T>
sp<T> wp<T>::promote() const
{
- T* p = (m_ptr && m_refs->attemptIncStrong(this)) ? m_ptr : 0;
- return sp<T>(p, true);
+ sp<T> result;
+ if (m_ptr && m_refs->attemptIncStrong(&result)) {
+ result.set_pointer(m_ptr);
+ }
+ return result;
}
template<typename T>
diff --git a/include/utils/StrongPointer.h b/include/utils/StrongPointer.h
index 5daccf4..a8c9897 100644
--- a/include/utils/StrongPointer.h
+++ b/include/utils/StrongPointer.h
@@ -104,11 +104,8 @@
private:
template<typename Y> friend class sp;
template<typename Y> friend class wp;
-
- // Optimization for wp::promote().
- sp(T* p, bool);
-
- T* m_ptr;
+ void set_pointer(T* ptr);
+ T* m_ptr;
};
#undef COMPARE
@@ -206,10 +203,9 @@
}
template<typename T>
-sp<T>::sp(T* p, bool)
-: m_ptr(p)
- {
- }
+void sp<T>::set_pointer(T* ptr) {
+ m_ptr = ptr;
+}
template <typename T>
inline TextOutput& operator<<(TextOutput& to, const sp<T>& val)