File tree Expand file tree Collapse file tree 1 file changed +3
-9
lines changed
transport/transport-runtime/src/main/java/com/google/android/datatransport/runtime Expand file tree Collapse file tree 1 file changed +3
-9
lines changed Original file line number Diff line number Diff line change 14
14
15
15
package com .google .android .datatransport .runtime ;
16
16
17
- import android .annotation .SuppressLint ;
18
17
import androidx .annotation .Discouraged ;
19
18
import androidx .annotation .WorkerThread ;
20
19
import com .google .android .datatransport .Priority ;
26
25
public final class ForcedSender {
27
26
@ WorkerThread
28
27
public static void sendBlocking (Transport <?> transport , Priority priority ) {
29
- @ SuppressLint ("DiscouragedApi" )
30
- TransportContext context = getTransportContextOrThrow (transport ).withPriority (priority );
31
- TransportRuntime .getInstance ().getUploader ().logAndUpdateState (context , 1 );
32
- }
33
-
34
- private static TransportContext getTransportContextOrThrow (Transport <?> transport ) {
35
28
if (transport instanceof TransportImpl ) {
36
- return ((TransportImpl <?>) transport ).getTransportContext ();
29
+ TransportContext context =
30
+ ((TransportImpl <?>) transport ).getTransportContext ().withPriority (priority );
31
+ TransportRuntime .getInstance ().getUploader ().logAndUpdateState (context , 1 );
37
32
}
38
- throw new IllegalArgumentException ("Expected instance of TransportImpl." );
39
33
}
40
34
41
35
private ForcedSender () {}
You can’t perform that action at this time.
0 commit comments