Home | History | Annotate | Download | only in stacks
      1 /*
      2  * Copyright (C) 2016 The Android Open Source Project
      3  *
      4  * Licensed under the Apache License, Version 2.0 (the "License");
      5  * you may not use this file except in compliance with the License.
      6  * You may obtain a copy of the License at
      7  *
      8  *      http://www.apache.org/licenses/LICENSE-2.0
      9  *
     10  * Unless required by applicable law or agreed to in writing, software
     11  * distributed under the License is distributed on an "AS IS" BASIS,
     12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
     13  * See the License for the specific language governing permissions and
     14  * limitations under the License.
     15  */
     16 
     17 package com.android.bugreport.stacks;
     18 
     19 /**
     20  * Base class for the different types of stack frames.
     21  *
     22  * The type is indicated by frameType.
     23  */
     24 public class StackFrameSnapshot {
     25     public static final int FRAME_TYPE_UNKNOWN = 0;
     26     public static final int FRAME_TYPE_NATIVE = 1;
     27     public static final int FRAME_TYPE_KERNEL = 2;
     28     public static final int FRAME_TYPE_JAVA = 3;
     29 
     30     public final int frameType;
     31     public String text;
     32 
     33     protected StackFrameSnapshot() {
     34         this.frameType = FRAME_TYPE_UNKNOWN;
     35     }
     36 
     37     protected StackFrameSnapshot(int frameType) {
     38         this.frameType = frameType;
     39     }
     40 
     41     protected StackFrameSnapshot(StackFrameSnapshot that) {
     42         this.frameType = that.frameType;
     43         this.text = that.text;
     44     }
     45 
     46     @Override
     47     public StackFrameSnapshot clone() {
     48         return new StackFrameSnapshot(this);
     49     }
     50 }
     51 
     52