congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
NetworkEventReporter.isEnabled
Code IndexAdd Tabnine to your IDE (free)

How to use
isEnabled
method
in
com.facebook.stetho.inspector.network.NetworkEventReporter

Best Java code snippets using com.facebook.stetho.inspector.network.NetworkEventReporter.isEnabled (Showing top 8 results out of 315)

origin: facebook/stetho

public boolean isStethoActive() {
 return mStethoHook.isEnabled();
}
origin: facebook/stetho

if (mEventReporter.isEnabled()) {
 requestBodyHelper = new RequestBodyHelper(mEventReporter, requestId);
 OkHttpInspectorRequest inspectorRequest =
 response = chain.proceed(request);
} catch (IOException e) {
 if (mEventReporter.isEnabled()) {
  mEventReporter.httpExchangeFailed(requestId, e.toString());
if (mEventReporter.isEnabled()) {
 if (requestBodyHelper != null && requestBodyHelper.hasBody()) {
  requestBodyHelper.reportDataSent();
origin: facebook/stetho

@Before
public void setUp() {
 PowerMockito.mockStatic(NetworkEventReporterImpl.class);
 mMockEventReporter = mock(NetworkEventReporter.class);
 Mockito.when(mMockEventReporter.isEnabled()).thenReturn(true);
 PowerMockito.when(NetworkEventReporterImpl.get()).thenReturn(mMockEventReporter);
 mInterceptor = new StethoInterceptor();
 mClientWithInterceptor = new OkHttpClient.Builder()
     .addNetworkInterceptor(mInterceptor)
     .build();
}
origin: facebook/stetho

@Before
public void setUp() {
 PowerMockito.mockStatic(NetworkEventReporterImpl.class);
 mMockEventReporter = mock(NetworkEventReporter.class);
 Mockito.when(mMockEventReporter.isEnabled()).thenReturn(true);
 PowerMockito.when(NetworkEventReporterImpl.get()).thenReturn(mMockEventReporter);
 mInterceptor = new StethoInterceptor();
 mClientWithInterceptor = new OkHttpClient();
 mClientWithInterceptor.networkInterceptors().add(mInterceptor);
}
origin: facebook/stetho

    new SimpleTestChain(request, reply, mock(Connection.class)));
inOrder.verify(mMockEventReporter).isEnabled();
inOrder.verify(mMockEventReporter)
  .requestWillBeSent(any(NetworkEventReporter.InspectorRequest.class));
origin: facebook/stetho

if (mEventReporter.isEnabled()) {
 requestBodyHelper = new RequestBodyHelper(mEventReporter, requestId);
 OkHttpInspectorRequest inspectorRequest =
 response = chain.proceed(request);
} catch (IOException e) {
 if (mEventReporter.isEnabled()) {
  mEventReporter.httpExchangeFailed(requestId, e.toString());
if (mEventReporter.isEnabled()) {
 if (requestBodyHelper != null && requestBodyHelper.hasBody()) {
  requestBodyHelper.reportDataSent();
origin: facebook/stetho

    new SimpleTestChain(request, reply, mock(Connection.class)));
inOrder.verify(mMockEventReporter).isEnabled();
inOrder.verify(mMockEventReporter)
  .requestWillBeSent(any(NetworkEventReporter.InspectorRequest.class));
origin: dabutaizha/juzimi

if (mEventReporter.isEnabled()) {
  requestBodyHelper = new RequestBodyHelper(mEventReporter, requestId);
  OkHttpInspectorRequest inspectorRequest =
  response = chain.proceed(request);
} catch (IOException e) {
  if (mEventReporter.isEnabled()) {
    mEventReporter.httpExchangeFailed(requestId, e.toString());
if (mEventReporter.isEnabled()) {
  if (requestBodyHelper != null && requestBodyHelper.hasBody()) {
    requestBodyHelper.reportDataSent();
com.facebook.stetho.inspector.networkNetworkEventReporterisEnabled

Javadoc

Returns true if there is at least one peer listening for network events; false otherwise. This value is provided as an optimization to avoid expensive work when the WebKit Inspector is not being used. It is otherwise safe to invoke methods defined in this interface when the value is false.

Popular methods of NetworkEventReporter

  • interpretResponseStream
  • requestWillBeSent
    Indicates that a request is about to be sent, but has not yet been delivered over the wire.
  • responseHeadersReceived
  • nextRequestId
  • httpExchangeFailed
    Indicates that communication with the server has failed. You are expected to call this for any excep
  • dataReceived
    Indicates that raw data was received from the network.
  • dataSent
    Indicates that raw data was sent over the network. It is permissible to invoke this method just once
  • responseReadFinished
    Indicates that the response stream has been fully exhausted and the request is now complete. If you
  • responseReadFailed
    Indicates that there was a failure while reading from response stream. If you use #interpretResponse
  • webSocketClosed
    Socket has been closed for unknown reasons. Consider first invoking #webSocketFrameError even for st
  • webSocketCreated
    Invoked when a socket is created and implicitly being connected (but not necessarily connected yet).
  • webSocketFrameError
    Indicates a web socket (or standard socket) error has occurred though this doesn't explicitly close
  • webSocketCreated,
  • webSocketFrameError,
  • webSocketFrameReceived,
  • webSocketFrameSent

Popular in Java

  • Finding current android device location
  • getSupportFragmentManager (FragmentActivity)
  • setContentView (Activity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • ObjectMapper (com.fasterxml.jackson.databind)
    ObjectMapper provides functionality for reading and writing JSON, either to and from basic POJOs (Pl
  • Font (java.awt)
    The Font class represents fonts, which are used to render text in a visible way. A font provides the
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • Runnable (java.lang)
    Represents a command that can be executed. Often used to run code in a different Thread.
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • Path (java.nio.file)
  • Best IntelliJ plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now