1 /* 2 * Copyright (C) 2007 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 org.apache.harmony.dalvik.ddmc; 18 19 import static android.annotation.SystemApi.Client.MODULE_LIBRARIES; 20 21 import android.annotation.SystemApi; 22 import android.compat.annotation.UnsupportedAppUsage; 23 24 /** 25 * Declarations for some VM-internal DDM stuff. 26 * 27 * @hide 28 */ 29 @SystemApi(client = MODULE_LIBRARIES) 30 public final class DdmVmInternal { 31 32 /* do not instantiate */ DdmVmInternal()33 private DdmVmInternal() {} 34 35 /** 36 * Enable thread notification. 37 * 38 * This is built into the VM, since that's where threads get managed. 39 * 40 * @param enabled {@code true} to enable thread notification; {@code false} to disable 41 * 42 * @hide 43 */ 44 @SystemApi(client = MODULE_LIBRARIES) setThreadNotifyEnabled(boolean enabled)45 native public static void setThreadNotifyEnabled(boolean enabled); 46 47 /** 48 * Get status info for all threads. This is for the THST chunk. 49 * 50 * Returns a byte array with the THST data, or null if something 51 * went wrong. 52 * 53 * @hide 54 */ 55 @UnsupportedAppUsage getThreadStats()56 native public static byte[] getThreadStats(); 57 58 /** 59 * Get a stack trace for the specified thread ID. The ID can be found 60 * in the data from getThreadStats. 61 * * 62 * @hide 63 */ 64 @UnsupportedAppUsage getStackTraceById(int threadId)65 native public static StackTraceElement[] getStackTraceById(int threadId); 66 67 /** 68 * Enable or disable "recent allocation" tracking. 69 * 70 * @param enabled {@code true} to enable recent allocation tracking; {@code false} to disable 71 * 72 * @hide 73 */ 74 @SystemApi(client = MODULE_LIBRARIES) setRecentAllocationsTrackingEnabled(boolean enabled)75 native public static void setRecentAllocationsTrackingEnabled(boolean enabled); 76 } 77