Skip to content

Commit d672475

Browse files
committed
Added noop unregisterReceiver to complement existing noop registerReceiver.
Without this addition, code that is being tested using an isolated context can cause an exception if it unregisters a previously registered broadcast receiver. This is because the isolated context never actually registered the receiver in the first place. The fix is to make sure the isolated context is consistent in ignoring both recevier registration and unregistration calls. Change-Id: Ie0ba6f4bb10f5248704327a0ffc8e37ee8b71ae2
1 parent 7d9c73f commit d672475

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

test-runner/src/android/test/IsolatedContext.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,11 @@ public Intent registerReceiver(BroadcastReceiver receiver, IntentFilter filter)
8686
return null;
8787
}
8888

89+
@Override
90+
public void unregisterReceiver(BroadcastReceiver receiver) {
91+
// Ignore
92+
}
93+
8994
@Override
9095
public void sendBroadcast(Intent intent) {
9196
mBroadcastIntents.add(intent);

0 commit comments

Comments
 (0)