Merge "Verify calling thread for intent receiver"
This commit is contained in:
commit
11781f84b6
1 changed files with 10 additions and 0 deletions
|
|
@ -231,4 +231,14 @@ public class VpnManagerServiceTest extends VpnTestBase {
|
|||
private void onPackageRemoved(String packageName, int uid, boolean isReplacing) {
|
||||
onPackageRemoved(packageName, UserHandle.USER_SYSTEM, uid, isReplacing);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void testReceiveIntentFromNonHandlerThread() {
|
||||
assertThrows(IllegalStateException.class, () ->
|
||||
mIntentReceiver.onReceive(mContext, buildIntent(Intent.ACTION_PACKAGE_REMOVED,
|
||||
PKGS[0], UserHandle.USER_SYSTEM, PKG_UIDS[0], true /* isReplacing */)));
|
||||
|
||||
assertThrows(IllegalStateException.class, () ->
|
||||
mUserPresentReceiver.onReceive(mContext, new Intent(Intent.ACTION_USER_PRESENT)));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue