Merge AOSP android-9.0.0_r3

Fix conflicts and make it build in 5.1, 6.0, 7.1, 8.1, and 9.0

Change-Id: Ida0a64c29ff27d339b7f42a18d820930964ac6e4
diff --git a/gui/mousecursor.cpp b/gui/mousecursor.cpp
index b87cac4..93c635a 100644
--- a/gui/mousecursor.cpp
+++ b/gui/mousecursor.cpp
@@ -78,7 +78,7 @@
 	{
 		m_color = LoadAttrColor(child, "color", m_color);
 		m_image = LoadAttrImage(child, "resource");
-		if (m_image)
+		if (m_image && m_image->GetResource())
 		{
 			mRenderW = m_image->GetWidth();
 			mRenderH = m_image->GetHeight();
@@ -99,7 +99,7 @@
 	if (!m_present)
 		return 0;
 
-	if (m_image)
+	if (m_image && m_image->GetResource())
 	{
 		gr_blit(m_image->GetResource(), 0, 0, mRenderW, mRenderH, mRenderX, mRenderY);
 	}