Merge "Add test case for missing PACKAGE_USAGE_STATS permission"
This commit is contained in:
@@ -507,7 +507,7 @@ public class BackupManagerServiceTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dump_callerDoesNotHavePermission_ignored() {
|
||||
public void dump_callerDoesNotHaveDumpPermission_ignored() {
|
||||
when(mContextMock.checkCallingOrSelfPermission(
|
||||
android.Manifest.permission.DUMP)).thenReturn(
|
||||
PackageManager.PERMISSION_DENIED);
|
||||
@@ -518,6 +518,18 @@ public class BackupManagerServiceTest {
|
||||
verifyNoMoreInteractions(mNonSystemUserBackupManagerService);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void dump_callerDoesNotHavePackageUsageStatsPermission_ignored() {
|
||||
when(mContextMock.checkCallingOrSelfPermission(
|
||||
Manifest.permission.PACKAGE_USAGE_STATS)).thenReturn(
|
||||
PackageManager.PERMISSION_DENIED);
|
||||
|
||||
mService.dump(mFileDescriptorStub, mPrintWriterMock, new String[0]);
|
||||
|
||||
verifyNoMoreInteractions(mUserBackupManagerService);
|
||||
verifyNoMoreInteractions(mNonSystemUserBackupManagerService);
|
||||
}
|
||||
|
||||
/**
|
||||
* Test that {@link BackupManagerService#dump()} dumps system user information before non-system
|
||||
* user information.
|
||||
|
||||
Reference in New Issue
Block a user