Refactor bindPreferenceToTile to properly handle multi-user

Change-Id: I751eb645663b3546c212925e2ba4a0a94714013b
Fixes: 32470791
Test: RunSettingsRoboTests
This commit is contained in:
Fan Zhang
2016-11-01 11:56:22 -07:00
parent aa12b4d269
commit 5482637f8b
2 changed files with 11 additions and 8 deletions

View File

@@ -112,7 +112,9 @@ public class DashboardFeatureProviderImplTest {
tile.userHandle.add(mock(UserHandle.class));
tile.userHandle.add(mock(UserHandle.class));
tile.intent = new Intent();
when(mActivity.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
when(mActivity.getApplicationContext().getSystemService(Context.USER_SERVICE))
.thenReturn(mUserManager);
mImpl.bindPreferenceToTile(mActivity, preference, tile, "123");
preference.getOnPreferenceClickListener().onPreferenceClick(null);