Fix bug #13440372 More option is displayed with Email/Gmail icon after...
scrolling through settings options

- force the image and background to null when needed in the Adapter

Change-Id: If4c1769dcd1651b683a34001dcd922c6554252c0
diff --git a/src/com/android/settings/SettingsActivity.java b/src/com/android/settings/SettingsActivity.java
index 4c1d698..e49d827 100644
--- a/src/com/android/settings/SettingsActivity.java
+++ b/src/com/android/settings/SettingsActivity.java
@@ -1580,9 +1580,6 @@
                                 view.findViewById(com.android.internal.R.id.summary);
                         break;
                 }
-                if (holder.mIcon != null) {
-                    holder.mIcon.setBackgroundResource(R.color.background_drawer_icon);
-                }
                 view.setTag(holder);
             } else {
                 view = convertView;
@@ -1650,7 +1647,18 @@
                     Drawable icon = mAuthHelper.getDrawableForType(getContext(), accType);
                     setHeaderIcon(holder, icon);
                 } else {
-                    holder.mIcon.setImageResource(header.iconRes);
+                    if (header.iconRes > 0) {
+                        holder.mIcon.setImageResource(header.iconRes);
+                    } else {
+                        holder.mIcon.setImageDrawable(null);
+                    }
+                }
+                if (holder.mIcon != null) {
+                    if (header.iconRes > 0) {
+                        holder.mIcon.setBackgroundResource(R.color.background_drawer_icon);
+                    } else {
+                        holder.mIcon.setBackground(null);
+                    }
                 }
                 holder.mTitle.setText(header.getTitle(getContext().getResources()));
                 CharSequence summary = header.getSummary(getContext().getResources());