t.java 2.58 KB
package com.instabug.library;

import android.content.Context;
import android.content.Intent;
import android.support.v4.content.LocalBroadcastManager;
import com.instabug.library.a.c.b;
import com.instabug.library.internal.d.a.b;
import com.instabug.library.internal.d.a.f;
import com.instabug.library.internal.d.a.g;
import com.instabug.library.internal.d.a.h;
import com.instabug.library.internal.d.a.k;
import com.instabug.library.util.InstabugSDKLogger;

public class t
{
  private static t b;
  long a;
  
  public static t a()
  {
    if (b == null) {
      b = new t();
    }
    return b;
  }
  
  static void a(c.b paramb, Context paramContext)
  {
    if (paramb.equals(c.b.c)) {
      u.a().e(false);
    }
    for (;;)
    {
      Intent localIntent = new Intent();
      localIntent.setAction("Session state changed");
      localIntent.putExtra("Session state", paramb);
      LocalBroadcastManager.getInstance(paramContext).sendBroadcast(localIntent);
      paramContext.startService(new Intent(paramContext, InstabugSessionUploaderService.class));
      paramContext.startService(new Intent(paramContext, InstabugIssueUploaderService.class));
      paramContext.startService(new Intent(paramContext, InstabugMessageUploaderService.class));
      paramContext.startService(new Intent(paramContext, InstabugFeaturesFetcherService.class));
      return;
      u.a().e(true);
    }
  }
  
  final void a(Context paramContext)
  {
    InstabugSDKLogger.d(this, "Session finished");
    InstabugSDKLogger.d(this, "Dumping caches");
    com.instabug.library.internal.d.a.j.c();
    f.b();
    h.b();
    b.b(paramContext);
    if (InstabugFeaturesManager.getInstance().isFeatureAvailable(Feature.INSTABUG))
    {
      if (this.a != 0L)
      {
        InstabugSDKLogger.d(this, "Handling session finished");
        int i = -1;
        if (u.a().v())
        {
          i = 1;
          u.a().f(false);
        }
        com.instabug.library.model.j localj = new com.instabug.library.model.j(i, String.valueOf(this.a), System.currentTimeMillis() / 1000L - this.a);
        InstabugSDKLogger.v(this, "Adding session " + localj + " to cache " + k.a().b());
        k.a(localj);
        k.b();
        a(c.b.c, paramContext);
      }
    }
    else {
      return;
    }
    InstabugSDKLogger.d(this, "Instabug SDK is enabled after session started, Session ignored");
  }
  
  public long b()
  {
    return System.currentTimeMillis() / 1000L - this.a;
  }
}


/* Location:              /home/merong/decompile/hackery-dex2jar.jar!/com/instabug/library/t.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */