Set the mAccountName as null while device has no any account
It doesn't clean the mAccountName buffer while device has no any account. And it will be put into
the Intent and pass to MeCard when user click the ghost boy avatar. It does not make sense and
modify code to fixed it.
Fixes: 129265427
Test: make RunSettingsRoboTests -j56 ROBOTEST_FILTER=com.android.settings.accounts
make RunSettingsRoboTests -j56 ROBOTEST_FILTER=com.android.settings.core
make RunSettingsRoboTests -j56 ROBOTEST_FILTER=com.android.settings.dashboard
Change-Id: Ib8cfab2cb416515018f335b21ef49a95699a1597
This commit is contained in:
@@ -67,7 +67,8 @@ public class AvatarViewMixin implements LifecycleObserver {
|
||||
private final MutableLiveData<Bitmap> mAvatarImage;
|
||||
private final ActivityManager mActivityManager;
|
||||
|
||||
private String mAccountName;
|
||||
@VisibleForTesting
|
||||
String mAccountName;
|
||||
|
||||
public AvatarViewMixin(SettingsHomepageActivity activity, ImageView avatarView) {
|
||||
mContext = activity.getApplicationContext();
|
||||
@@ -127,6 +128,7 @@ public class AvatarViewMixin implements LifecycleObserver {
|
||||
if (hasAccount()) {
|
||||
loadAccount();
|
||||
} else {
|
||||
mAccountName = null;
|
||||
mAvatarView.setImageResource(R.drawable.ic_account_circle_24dp);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user