@Override protected void onResume() { super.onResume(); LeakDirectoryProvider leakDirectoryProvider = leakDirectoryProvider(this); if (leakDirectoryProvider.isLeakStorageWritable()) { File leakDirectory = leakDirectoryProvider.leakDirectory(); LoadLeaks.load(this, leakDirectory); } else { leakDirectoryProvider.requestPermission(this); } }
public static void setLeakDirectoryProvider(LeakDirectoryProvider leakDirectoryProvider) { DisplayLeakActivity.leakDirectoryProvider = leakDirectoryProvider; }
static void load(DisplayLeakActivity activity, LeakDirectoryProvider leakDirectoryProvider) { LoadLeaks loadLeaks = new LoadLeaks(activity, leakDirectoryProvider); inFlight.add(loadLeaks); backgroundExecutor.execute(loadLeaks); }
LoadLeaks(DisplayLeakActivity activity, LeakDirectoryProvider leakDirectoryProvider) { this.activityOrNull = activity; this.leakDirectoryProvider = leakDirectoryProvider; mainHandler = new Handler(Looper.getMainLooper()); }