Add number of enterprise-installed apps to Privacy Settings page

This CL adds information about the number of apps that were installed
by the admin to the Enterprise Privacy Settings page.

Test: make RunSettingsRoboTests
Bug: 32692748

Change-Id: Ib710a1249db6d285da962122fd3dfb35a43752a1
This commit is contained in:
Bartosz Fabianowski
2017-01-13 17:41:38 +01:00
parent 0d22680807
commit 13f569ebd6
16 changed files with 314 additions and 40 deletions

View File

@@ -40,6 +40,7 @@ import org.robolectric.annotation.Config;
import static com.google.common.truth.Truth.assertThat;
import static org.mockito.Mockito.anyObject;
import static org.mockito.Mockito.doAnswer;
import static org.mockito.Mockito.eq;
import static org.mockito.Mockito.when;
/**
@@ -69,10 +70,11 @@ public final class InstalledPackagesPreferenceControllerTest {
doAnswer(new Answer() {
public Object answer(InvocationOnMock invocation) {
((ApplicationFeatureProvider.NumberOfInstalledAppsCallback)
invocation.getArguments()[0]).onNumberOfInstalledAppsResult(20);
invocation.getArguments()[1]).onNumberOfInstalledAppsResult(20);
return null;
}}).when(mFeatureFactory.applicationFeatureProvider)
.calculateNumberOfInstalledApps(anyObject());
.calculateNumberOfInstalledApps(
eq(ApplicationFeatureProvider.IGNORE_INSTALL_REASON), anyObject());
when(mContext.getResources().getQuantityString(
R.plurals.enterprise_privacy_number_installed_packages, 20, 20))
.thenReturn("20 packages");