Merge "Fix the search result "Google Account" doesn't work." into rvc-dev am: 12e3efcb04
am: a17be1f732
am: ae8cdee154
am: f6398a09fa
Change-Id: I0b3774f7cb8ab6d242446a7d757549c7c84d7751
This commit is contained in:
@@ -125,5 +125,9 @@ public class DashboardFragmentRegistry {
|
|||||||
for (Map.Entry<String, String> parentToKey : PARENT_TO_CATEGORY_KEY_MAP.entrySet()) {
|
for (Map.Entry<String, String> parentToKey : PARENT_TO_CATEGORY_KEY_MAP.entrySet()) {
|
||||||
CATEGORY_KEY_TO_PARENT_MAP.put(parentToKey.getValue(), parentToKey.getKey());
|
CATEGORY_KEY_TO_PARENT_MAP.put(parentToKey.getValue(), parentToKey.getKey());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// For injection index, redirect CATEGORY_ACCOUNT_DETAIL to AccountDashboardFragment.
|
||||||
|
CATEGORY_KEY_TO_PARENT_MAP.put(CategoryKey.CATEGORY_ACCOUNT_DETAIL,
|
||||||
|
AccountDashboardFragment.class.getName());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,6 +18,9 @@ package com.android.settings.dashboard;
|
|||||||
|
|
||||||
import static com.google.common.truth.Truth.assertThat;
|
import static com.google.common.truth.Truth.assertThat;
|
||||||
|
|
||||||
|
import com.android.settings.accounts.AccountDashboardFragment;
|
||||||
|
import com.android.settingslib.drawer.CategoryKey;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
import org.junit.runner.RunWith;
|
import org.junit.runner.RunWith;
|
||||||
import org.robolectric.RobolectricTestRunner;
|
import org.robolectric.RobolectricTestRunner;
|
||||||
@@ -29,4 +32,12 @@ public class DashboardFragmentRegistryTest {
|
|||||||
assertThat(DashboardFragmentRegistry.CATEGORY_KEY_TO_PARENT_MAP.size())
|
assertThat(DashboardFragmentRegistry.CATEGORY_KEY_TO_PARENT_MAP.size())
|
||||||
.isEqualTo(DashboardFragmentRegistry.PARENT_TO_CATEGORY_KEY_MAP.size());
|
.isEqualTo(DashboardFragmentRegistry.PARENT_TO_CATEGORY_KEY_MAP.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void accountDetailCategoryShouldRedirectToAccountDashboardFragment() {
|
||||||
|
final String fragment = DashboardFragmentRegistry.CATEGORY_KEY_TO_PARENT_MAP.get(
|
||||||
|
CategoryKey.CATEGORY_ACCOUNT_DETAIL);
|
||||||
|
|
||||||
|
assertThat(fragment).isEqualTo(AccountDashboardFragment.class.getName());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user