Java 类com.squareup.leakcanary.internal.DisplayLeakActivity 实例源码

项目:superglue    文件:DebugView.java   
@OnClick(R.id.debug_leaks_show) void showLeaks() {
  Intent intent = new Intent(getContext(), DisplayLeakActivity.class);
  getContext().startActivity(intent);
}
项目:superglue    文件:DebugView.java   
@OnClick(R.id.debug_leaks_show) void showLeaks() {
  Intent intent = new Intent(getContext(), DisplayLeakActivity.class);
  getContext().startActivity(intent);
}
项目:boohee_v5.6    文件:LeakCanary.java   
public static void enableDisplayLeakActivity(Context context) {
    LeakCanaryInternals.setEnabled(context, DisplayLeakActivity.class, true);
}
项目:leakcannary    文件:LeakCanary.java   
public static void enableDisplayLeakActivity(Context context) {
  setEnabled(context, DisplayLeakActivity.class, true);
}
项目:leakcannary    文件:LeakCanary.java   
public static void setDisplayLeakActivityDirectoryProvider(
    LeakDirectoryProvider leakDirectoryProvider) {
  DisplayLeakActivity.setLeakDirectoryProvider(leakDirectoryProvider);
}
项目:leakcannary    文件:DisplayLeakService.java   
@Override protected final void onHeapAnalyzed(HeapDump heapDump, AnalysisResult result) {
  String leakInfo = leakInfo(this, heapDump, result, true);
  CanaryLog.d(leakInfo);

  boolean resultSaved = false;
  boolean shouldSaveResult = result.leakFound || result.failure != null;
  if (shouldSaveResult) {
    heapDump = renameHeapdump(heapDump);
    resultSaved = saveResult(heapDump, result);
  }

  PendingIntent pendingIntent;
  String contentTitle;
  String contentText;

  if (!shouldSaveResult) {
    contentTitle = getString(R.string.leak_canary_no_leak_title);
    contentText = getString(R.string.leak_canary_no_leak_text);
    pendingIntent = null;
  } else if (resultSaved) {
    pendingIntent = DisplayLeakActivity.createPendingIntent(this, heapDump.referenceKey);

    if (result.failure == null) {
      String size = formatShortFileSize(this, result.retainedHeapSize);
      String className = classSimpleName(result.className);
      if (result.excludedLeak) {
        contentTitle = getString(R.string.leak_canary_leak_excluded, className, size);
      } else {
        contentTitle = getString(R.string.leak_canary_class_has_leaked, className, size);
      }
    } else {
      contentTitle = getString(R.string.leak_canary_analysis_failed);
    }
    contentText = getString(R.string.leak_canary_notification_message);
  } else {
    contentTitle = getString(R.string.leak_canary_could_not_save_title);
    contentText = getString(R.string.leak_canary_could_not_save_text);
    pendingIntent = null;
  }
  showNotification(this, contentTitle, contentText, pendingIntent);
  afterDefaultHandling(heapDump, result, leakInfo);
}
项目:LeakCanary4Eclipse    文件:LeakCanary.java   
public static void enableDisplayLeakActivity(Context context) {
  setEnabled(context, DisplayLeakActivity.class, true);
}
项目:LeakCanary4Eclipse    文件:LeakCanary.java   
public static void setDisplayLeakActivityDirectoryProvider(
    LeakDirectoryProvider leakDirectoryProvider) {
  DisplayLeakActivity.setLeakDirectoryProvider(leakDirectoryProvider);
}
项目:LeakCanary4Eclipse    文件:DisplayLeakService.java   
@Override protected final void onHeapAnalyzed(HeapDump heapDump, AnalysisResult result) {
  String leakInfo = leakInfo(this, heapDump, result, true);
  CanaryLog.d(leakInfo);

  boolean resultSaved = false;
  boolean shouldSaveResult = result.leakFound || result.failure != null;
  if (shouldSaveResult) {
    heapDump = renameHeapdump(heapDump);
    resultSaved = saveResult(heapDump, result);
  }

  PendingIntent pendingIntent;
  String contentTitle;
  String contentText;

  if (!shouldSaveResult) {
    contentTitle = getString(R.string.leak_canary_no_leak_title);
    contentText = getString(R.string.leak_canary_no_leak_text);
    pendingIntent = null;
  } else if (resultSaved) {
    pendingIntent = DisplayLeakActivity.createPendingIntent(this, heapDump.referenceKey);

    if (result.failure == null) {
      String size = formatShortFileSize(this, result.retainedHeapSize);
      String className = classSimpleName(result.className);
      if (result.excludedLeak) {
        contentTitle = getString(R.string.leak_canary_leak_excluded, className, size);
      } else {
        contentTitle = getString(R.string.leak_canary_class_has_leaked, className, size);
      }
    } else {
      contentTitle = getString(R.string.leak_canary_analysis_failed);
    }
    contentText = getString(R.string.leak_canary_notification_message);
  } else {
    contentTitle = getString(R.string.leak_canary_could_not_save_title);
    contentText = getString(R.string.leak_canary_could_not_save_text);
    pendingIntent = null;
  }
  showNotification(this, contentTitle, contentText, pendingIntent);
  afterDefaultHandling(heapDump, result, leakInfo);
}
项目:leakcanary-for-eclipse    文件:LeakCanary.java   
public static void enableDisplayLeakActivity(Context context) {
  setEnabled(context, DisplayLeakActivity.class, true);
}
项目:leakcanary    文件:LeakCanary.java   
public static void enableDisplayLeakActivity(Context context) {
  setEnabled(context, DisplayLeakActivity.class, true);
}
项目:leakcanary    文件:DisplayLeakService.java   
@Override protected final void onHeapAnalyzed(HeapDump heapDump, AnalysisResult result) {
  String leakInfo = leakInfo(this, heapDump, result, true);
  CanaryLog.d("%s", leakInfo);

  boolean resultSaved = false;
  boolean shouldSaveResult = result.leakFound || result.failure != null;
  if (shouldSaveResult) {
    heapDump = renameHeapdump(heapDump);
    resultSaved = saveResult(heapDump, result);
  }

  PendingIntent pendingIntent;
  String contentTitle;
  String contentText;

  if (!shouldSaveResult) {
    contentTitle = getString(R.string.leak_canary_no_leak_title);
    contentText = getString(R.string.leak_canary_no_leak_text);
    pendingIntent = null;
  } else if (resultSaved) {
    pendingIntent = DisplayLeakActivity.createPendingIntent(this, heapDump.referenceKey);

    if (result.failure == null) {
      String size = formatShortFileSize(this, result.retainedHeapSize);
      String className = classSimpleName(result.className);
      if (result.excludedLeak) {
        contentTitle = getString(R.string.leak_canary_leak_excluded, className, size);
      } else {
        contentTitle = getString(R.string.leak_canary_class_has_leaked, className, size);
      }
    } else {
      contentTitle = getString(R.string.leak_canary_analysis_failed);
    }
    contentText = getString(R.string.leak_canary_notification_message);
  } else {
    contentTitle = getString(R.string.leak_canary_could_not_save_title);
    contentText = getString(R.string.leak_canary_could_not_save_text);
    pendingIntent = null;
  }
  // New notification id every second.
  int notificationId = (int) (SystemClock.uptimeMillis() / 1000);
  showNotification(this, contentTitle, contentText, pendingIntent, notificationId);
  afterDefaultHandling(heapDump, result, leakInfo);
}
项目:u2020-mvp    文件:DebugView.java   
@OnClick(R.id.debug_leaks_show)
void showLeaks() {
    Intent intent = new Intent(getContext(), DisplayLeakActivity.class);
    getContext().startActivity(intent);
}
项目:u2020    文件:DebugView.java   
@OnClick(R.id.debug_leaks_show) void showLeaks() {
  Intent intent = new Intent(getContext(), DisplayLeakActivity.class);
  getContext().startActivity(intent);
}
项目:leakcanary    文件:LeakCanary.java   
/**
 * If you build a {@link RefWatcher} with a {@link AndroidHeapDumper} that has a custom {@link
 * LeakDirectoryProvider}, then you should also call this method to make sure the activity in
 * charge of displaying leaks can find those on the file system.
 */
public static void setDisplayLeakActivityDirectoryProvider(
    LeakDirectoryProvider leakDirectoryProvider) {
  DisplayLeakActivity.setLeakDirectoryProvider(leakDirectoryProvider);
}