Fix sp<> conversion operator / constructor

some of the conversion operators were not using the proper
pointer type when calling incStrong/decStrong, usually it
has no bad consequences, but for some implementation
of the ref-counted object it could lead to recording the wrong
owner id.

Change-Id: If574b9069b8a4cf6e0911a992c8f095aba799995
diff --git a/include/utils/StrongPointer.h b/include/utils/StrongPointer.h
index a8c9897..49fa3a8 100644
--- a/include/utils/StrongPointer.h
+++ b/include/utils/StrongPointer.h
@@ -133,7 +133,7 @@
 template<typename T> template<typename U>
 sp<T>::sp(U* other) : m_ptr(other)
 {
-    if (other) other->incStrong(this);
+    if (other) ((T*)other)->incStrong(this);
 }
 
 template<typename T> template<typename U>
@@ -170,7 +170,7 @@
 template<typename T> template<typename U>
 sp<T>& sp<T>::operator = (const sp<U>& other)
 {
-    U* otherPtr(other.m_ptr);
+    T* otherPtr(other.m_ptr);
     if (otherPtr) otherPtr->incStrong(this);
     if (m_ptr) m_ptr->decStrong(this);
     m_ptr = otherPtr;
@@ -180,7 +180,7 @@
 template<typename T> template<typename U>
 sp<T>& sp<T>::operator = (U* other)
 {
-    if (other) other->incStrong(this);
+    if (other) ((T*)other)->incStrong(this);
     if (m_ptr) m_ptr->decStrong(this);
     m_ptr = other;
     return *this;