Add Account.name to the tile's intent.

For dynamic tiles that are displayed in specific account type, add the
account name to the tile's intent so that when we launch the preference,
it can associate with the correct account.

Change-Id: I25f76c1b5710f525634983d00832c9a68cdeeebb
Fix: 62365341
Test: make RunSettingsRoboTests
This commit is contained in:
Doris Ling
2017-06-13 16:50:46 -07:00
parent b806580e87
commit cae6639b96
2 changed files with 60 additions and 2 deletions

View File

@@ -39,6 +39,7 @@ public class AccountDetailDashboardFragment extends DashboardFragment {
private static final String TAG = "AccountDetailDashboard";
private static final String METADATA_IA_ACCOUNT = "com.android.settings.ia.account";
private static final String EXTRA_ACCOUNT_NAME = "extra.accountName";
public static final String KEY_ACCOUNT = "account";
public static final String KEY_ACCOUNT_TYPE = "account_type";
@@ -127,7 +128,11 @@ public class AccountDetailDashboardFragment extends DashboardFragment {
if (metadata == null) {
return false;
}
return mAccountType.equals(metadata.getString(METADATA_IA_ACCOUNT));
final boolean display = mAccountType.equals(metadata.getString(METADATA_IA_ACCOUNT));
if (display && tile.intent != null) {
tile.intent.putExtra(EXTRA_ACCOUNT_NAME, mAccount.name);
}
return display;
}
@VisibleForTesting