File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed
firebase-messaging/src/test/java/com/google/firebase/messaging/shadows Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change 1313// limitations under the License.
1414package com .google .firebase .messaging .shadows ;
1515
16+ import static org .robolectric .util .reflector .Reflector .reflector ;
17+
1618import android .os .Message ;
1719import android .os .Messenger ;
1820import android .os .RemoteException ;
1921import org .robolectric .annotation .Implementation ;
2022import org .robolectric .annotation .Implements ;
2123import org .robolectric .annotation .RealObject ;
2224import org .robolectric .shadow .api .Shadow ;
25+ import org .robolectric .util .reflector .Direct ;
26+ import org .robolectric .util .reflector .ForType ;
2327
2428@ Implements (Messenger .class )
2529public class ShadowMessenger {
@@ -28,12 +32,18 @@ public class ShadowMessenger {
2832
2933 private static RemoteException sendException = null ;
3034
35+ @ ForType (Messenger .class )
36+ interface MessengerReflector {
37+ @ Direct
38+ void send (Messenger messenger , Message message ) throws RemoteException ;
39+ }
40+
3141 @ Implementation
3242 protected void send (Message message ) throws RemoteException {
3343 if (sendException != null ) {
3444 throw sendException ;
3545 } else {
36- Shadow . directlyOn ( realMessenger , Messenger .class ).send (message );
46+ reflector ( Messenger .class , realMessenger ).send (message );
3747 }
3848 }
3949
You can’t perform that action at this time.
0 commit comments