/* * Copyright (C) 2016 The Android Open Source Project * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.android.bugreport.stacks; import java.util.ArrayList; import java.util.HashMap; /** * One thread in a vm traces snapshot. */ public class ThreadSnapshot implements Comparable { public static final int TYPE_UNMANAGED = 0; public static final int TYPE_MANAGED = 1; public int type; public String name; public String daemon; public int priority; public int tid = -1; public int sysTid = -1; public String vmState; public ArrayList attributeText = new ArrayList(); public String heldMutexes; public ArrayList frames = new ArrayList(); public boolean runnable; public boolean blocked; public String outboundBinderPackage; public String outboundBinderClass; public String outboundBinderMethod; public String inboundBinderPackage; public String inboundBinderClass; public String inboundBinderMethod; public boolean interesting; public HashMap locks = new HashMap(); /** * Construct an empty ThreadSnapshot. */ public ThreadSnapshot() { } /** * Construct a deep copy of the ThreadSnapshot. */ public ThreadSnapshot(ThreadSnapshot that) { this.name = that.name; this.daemon = that.daemon; this.priority = that.priority; this.tid = that.tid; this.sysTid = that.sysTid; this.vmState = that.vmState; int N = that.attributeText.size(); for (int i=0; i