Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The members of an interface declaration or class should appear in a pre-defined order #37

Merged
merged 1 commit into from
Mar 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@
*/
public final class BlockCanaryInternals {

private BlockCanaryInternals() {
throw new AssertionError();
}

public static String getPath() {
String state = android.os.Environment.getExternalStorageState();
if (android.os.Environment.MEDIA_MOUNTED.equals(state)) {
Expand Down Expand Up @@ -50,10 +54,6 @@ public static File[] getLogFiles() {
return null;
}

private BlockCanaryInternals() {
throw new AssertionError();
}

static class BlockLogFileFilter implements FilenameFilter {

private String TYPE = ".txt";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ final class BlockDetailAdapter extends BaseAdapter {

private boolean[] mFoldings = new boolean[0];

private String mStackFoldPrefix = null;
private Block mBlock;

private static final int POSITION_BASIC = 1;
Expand Down Expand Up @@ -193,8 +194,6 @@ private static <T extends View> T findById(View view, int id) {
return (T) view.findViewById(id);
}

private String mStackFoldPrefix = null;

private String getStackFoldPrefix() {
if (mStackFoldPrefix == null) {
String prefix = BlockCanaryCore.getContext().getStackFoldPrefix();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,14 @@ public class DisplayBlockActivity extends Activity {
private static final String TAG = "DisplayBlockActivity";
private static final String SHOW_BLOCK_EXTRA = "show_latest";
public static final String SHOW_BLOCK_EXTRA_KEY = "BlockStartTime";
// null until it's been first loaded.
private List<Block> mBlockEntries = new ArrayList<>();
private String mBlockStartTime;

private ListView mListView;
private TextView mFailureView;
private Button mActionButton;
private int mMaxStoredBlockCount;

public static PendingIntent createPendingIntent(Context context) {
return createPendingIntent(context, null);
Expand All @@ -79,15 +87,6 @@ public static PendingIntent createPendingIntent(Context context, String blockSta
return PendingIntent.getActivity(context, 1, intent, FLAG_UPDATE_CURRENT);
}

// null until it's been first loaded.
private List<Block> mBlockEntries = new ArrayList<>();
private String mBlockStartTime;

private ListView mListView;
private TextView mFailureView;
private Button mActionButton;
private int mMaxStoredBlockCount;

@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
Expand Down Expand Up @@ -364,8 +363,14 @@ public View getView(int position, View convertView, ViewGroup parent) {
static class LoadBlocks implements Runnable {

static final List<LoadBlocks> inFlight = new ArrayList<>();

static final Executor backgroundExecutor = Executors.newSingleThreadExecutor();
private DisplayBlockActivity activityOrNull;
private final Handler mainHandler;

LoadBlocks(DisplayBlockActivity activity) {
this.activityOrNull = activity;
mainHandler = new Handler(Looper.getMainLooper());
}

static void load(DisplayBlockActivity activity) {
LoadBlocks loadBlocks = new LoadBlocks(activity);
Expand All @@ -380,14 +385,6 @@ static void forgetActivity() {
inFlight.clear();
}

private DisplayBlockActivity activityOrNull;
private final Handler mainHandler;

LoadBlocks(DisplayBlockActivity activity) {
this.activityOrNull = activity;
mainHandler = new Handler(Looper.getMainLooper());
}

@Override
public void run() {
final List<Block> blocks = new ArrayList<Block>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ final class LeakCanaryUi {

static final PorterDuffXfermode CLEAR_XFER_MODE = new PorterDuffXfermode(CLEAR);

private LeakCanaryUi() {
throw new AssertionError();
}

/**
* Converts from device independent pixels (dp or dip) to
* device dependent pixels. This method returns the input
Expand All @@ -47,8 +51,4 @@ static float dpToPixel(float dp, Resources resources) {
DisplayMetrics metrics = resources.getDisplayMetrics();
return metrics.density * dp;
}

private LeakCanaryUi() {
throw new AssertionError();
}
}