Edit workPolicyUtil constructor

We only need to pass context in the constructor for workPolicyUtil.
The other dependencies can be derviced from the context.

Test: manual
Change-Id: If97ee93e7812d0768489f038d965212332df9e2c
This commit is contained in:
Prabal Singh
2022-04-27 22:28:11 +01:00
parent d38f05b58f
commit c6c6920991

View File

@@ -42,15 +42,13 @@ public class WorkPolicyUtils {
private static final int USER_NULL = -10000;
public WorkPolicyUtils(
Context applicationContext,
PackageManager mPm,
UserManager mUm,
DevicePolicyManager mDpm
Context context
) {
mContext = applicationContext;
mPackageManager = mPm;
mUserManager = mUm;
mDevicePolicyManager = mDpm;
mContext = context;
mPackageManager = context.getPackageManager();
mUserManager = (UserManager) context.getSystemService(Context.USER_SERVICE);
mDevicePolicyManager =
(DevicePolicyManager) context.getSystemService(Context.DEVICE_POLICY_SERVICE);
}
/**