Add a null check to UserAvatarView.setBitmap

Adds a null check for the bitmap to set. Resets the paint's shader
in case of a null bitmap to release any previous image.

Change-Id: I1adf3c8ef44522a593fe3f25726b6c83120d7556
diff --git a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UserAvatarView.java b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UserAvatarView.java
index 6c9dc85..6f2642a 100644
--- a/packages/SystemUI/src/com/android/systemui/statusbar/phone/UserAvatarView.java
+++ b/packages/SystemUI/src/com/android/systemui/statusbar/phone/UserAvatarView.java
@@ -90,8 +90,12 @@
     public void setBitmap(Bitmap bitmap) {
         setDrawable(null);
         mBitmap = bitmap;
-        mBitmapPaint.setShader(new BitmapShader(
-                bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));
+        if (mBitmap != null) {
+            mBitmapPaint.setShader(new BitmapShader(
+                    bitmap, Shader.TileMode.CLAMP, Shader.TileMode.CLAMP));
+        } else {
+            mBitmapPaint.setShader(null);
+        }
         configureBounds();
         invalidate();
     }