Fix ActionDisabledByAdminDialogHelperTest

- Revert user handling in setAdminSupportDetails to before my changes.
- Implement getUserProfiles in Settings-shadows as the the
  Settings-shadows do not forwarded to profiles the robolectric-default
  shadows

Test: make RunSettingsRoboTests
Change-Id: Idfd4722fe55a17c57d336db943904eb1aeb6e7ce
This commit is contained in:
Philip P. Moltmann
2018-10-15 14:30:34 -07:00
parent 1d95218e49
commit 098d3a79fd
2 changed files with 22 additions and 12 deletions

View File

@@ -88,6 +88,16 @@ public class ShadowUserManager extends org.robolectric.shadows.ShadowUserManager
return ids;
}
@Implementation
public List<UserHandle> getUserProfiles(){
int[] userIds = getProfileIds(UserHandle.myUserId(), true /* enabledOnly */);
List<UserHandle> result = new ArrayList<>(userIds.length);
for (int userId : userIds) {
result.add(UserHandle.of(userId));
}
return result;
}
@Implementation
public int getCredentialOwnerProfile(@UserIdInt int userHandle) {
return userHandle;