Switch to using system-wide default user icons

User icons were either User Settings specific, or missing. This makes it
consistent with the ones in the new helper class.

Bug: 17311038
Change-Id: I20cc1deba989cf7a397c5a8dba41bd91bd62472b
This commit is contained in:
Alexandra Gherghina
2014-09-03 10:22:09 +01:00
parent f8310c1850
commit bc6e78f9da
20 changed files with 39 additions and 323 deletions

View File

@@ -31,6 +31,7 @@ import android.widget.ImageView;
import android.widget.SpinnerAdapter;
import android.widget.TextView;
import com.android.internal.util.UserIcons;
import com.android.settings.drawable.CircleFramedDrawable;
import com.android.settings.R;
@@ -57,7 +58,11 @@ public class UserSpinnerAdapter implements SpinnerAdapter {
} else {
name = userInfo.name;
Bitmap bitmap = um.getUserIcon(userHandle.getIdentifier());
icon = (bitmap == null) ? null : CircleFramedDrawable.getInstance(context, bitmap);
if (bitmap != null) {
icon = CircleFramedDrawable.getInstance(context, bitmap);
} else {
icon = UserIcons.getDefaultUserIcon(userInfo.id, /* light= */ false);
}
}
}
}