Use tile.getTitle(context) to get tile title.

And switch to getId() instead of title when comparing 2 tiles. This is
more accurate and more efficient.

Bug: 77600770
Test: robotests
Change-Id: I587d90702d98956bf7b420529ac3280351ca4a10
This commit is contained in:
Fan Zhang
2018-08-17 11:36:20 -07:00
parent e97c21b58d
commit 54cfb64987
9 changed files with 32 additions and 32 deletions

View File

@@ -15,6 +15,8 @@
*/
package com.android.settings.dashboard;
import static com.android.settingslib.drawer.TileUtils.META_DATA_PREFERENCE_TITLE;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.ArgumentMatchers.any;
@@ -95,6 +97,7 @@ public class DashboardAdapterTest {
mActivityInfo.packageName = "pkg";
mActivityInfo.name = "class";
mActivityInfo.metaData = new Bundle();
mActivityInfo.metaData.putString(META_DATA_PREFERENCE_TITLE, "test-title");
when(mContext.getSystemService(Context.WINDOW_SERVICE)).thenReturn(mWindowManager);
when(mContext.getResources()).thenReturn(mResources);