Remove extra argument WorkPolicyUtil constructor
Only constructor is required for WorkPolicyInfo constructor. The other
dependencies can be derives
Test: make ROBOTEST_FILTER=EnterprisePrivacyFeatureProviderImplTest RunSettingsRoboTests -j40
Change-Id: I7f35e5ed344d452190b333aad7fa823a010d17b3
diff --git a/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java b/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java
index f3085bc..b1ffcf1 100644
--- a/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java
+++ b/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImpl.java
@@ -69,7 +69,7 @@
mCm = cm;
mVm = vm;
mResources = resources;
- mWorkPolicyUtils = new WorkPolicyUtils(mContext, mPm, mUm, mDpm);
+ mWorkPolicyUtils = new WorkPolicyUtils(mContext);
}
@Override
diff --git a/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImplTest.java b/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImplTest.java
index 0005e71..87a447d 100644
--- a/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImplTest.java
+++ b/tests/robotests/src/com/android/settings/enterprise/EnterprisePrivacyFeatureProviderImplTest.java
@@ -105,6 +105,10 @@
when(mContext.getApplicationContext()).thenReturn(mContext);
resetAndInitializePackageManager();
when(mUserManager.getProfiles(mUserId)).thenReturn(mProfiles);
+ when(mContext.getSystemService(Context.DEVICE_POLICY_SERVICE))
+ .thenReturn(mDevicePolicyManager);
+ when(mContext.getSystemService(Context.USER_SERVICE)).thenReturn(mUserManager);
+ when(mContext.getPackageManager()).thenReturn(mPackageManager);
mProfiles.add(new UserInfo(mUserId, "", "", 0 /* flags */));
mResources = RuntimeEnvironment.application.getResources();