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:
@@ -130,6 +130,17 @@ public class AvatarViewMixinTest {
|
||||
verify(mockAvatar).hasAccount();
|
||||
}
|
||||
|
||||
@Test
|
||||
@Config(qualifiers = "mcc999")
|
||||
public void onStart_noAccount_mAccountNameShouldBeNull() {
|
||||
final AvatarViewMixin avatarViewMixin = new AvatarViewMixin(mActivity, mImageView);
|
||||
avatarViewMixin.mAccountName = DUMMY_ACCOUNT;
|
||||
|
||||
avatarViewMixin.onStart();
|
||||
|
||||
assertThat(avatarViewMixin.mAccountName).isNull();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryProviderAuthority_useShadowPackagteManager_returnNull() {
|
||||
final AvatarViewMixin avatarViewMixin = new AvatarViewMixin(mActivity, mImageView);
|
||||
|
Reference in New Issue
Block a user