Launch view account page when it's available.

- Add to launch the new Contextual Landing Page when user clicks the avatar
  icon and check the matching intent activity exist.
- Use the serialized intent and keeps in config.xml.
- Remove the getAccountSettingsDeeplinkIntent in the AccountFeatureProvider
  which never use again.

Change-Id: I50396af67eb04034572f8c885b4d9aef48a67e9d
Fixes: 122486552
Test: robotest
This commit is contained in:
Sunny Shao
2018-12-19 17:39:09 +08:00
parent a9f902b9c2
commit 7aa9fdd75c
5 changed files with 32 additions and 16 deletions

View File

@@ -30,6 +30,7 @@ import android.accounts.Account;
import android.content.ContentProvider;
import android.content.ContentResolver;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ApplicationInfo;
import android.content.pm.PackageInfo;
import android.content.pm.ProviderInfo;
@@ -167,12 +168,22 @@ public class AvatarViewMixinTest {
assertThat(bundle.getString("account_name")).isEqualTo(DUMMY_ACCOUNT);
}
@Test
public void onClickAvatar_withEmptyUri_startActivityShouldNotBeExecuted() {
final SettingsHomepageActivity activity = spy((SettingsHomepageActivity) mController.get());
final AvatarViewMixin avatarViewMixin = new AvatarViewMixin(activity, mImageView);
mImageView.performClick();
verify(activity, never()).startActivity(any(Intent.class));
}
@Implements(value = AccountFeatureProviderImpl.class)
public static class ShadowAccountFeatureProviderImpl {
@Implementation
protected Account[] getAccounts(Context context) {
return new Account[] {new Account(DUMMY_ACCOUNT, DUMMY_DOMAIN)};
return new Account[]{new Account(DUMMY_ACCOUNT, DUMMY_DOMAIN)};
}
}
}