Make DPM/DPMS unit-testable
- Now all services that DPMS uses are injectable. - Introduce some wrappers to make static methods and final class mockable. (e.g. for Binder.getCallingUid()) - In unit tests we replace those with Mockito mocks, except we use a partial mock for PackageManager, because we use way too many methods of this and most of them are okay to use directly. - To install a partial mock to PackageManager, I needed to make ApplicationPackageManager @hide public non-final. - For a starter, added tests for DPM.setAmin(). Bug 24061108 Change-Id: I2afd51d8bc0038992d5f9be38c686260be775b75
Loading
Please register or sign in to comment