The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 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 android.ddm; |
| 18 | |
| 19 | import org.apache.harmony.dalvik.ddmc.DdmServer; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 20 | import android.util.Log; |
| 21 | |
| 22 | /** |
| 23 | * Just a place to stick handler registrations, instead of scattering |
| 24 | * them around. |
| 25 | */ |
| 26 | public class DdmRegister { |
| 27 | |
| 28 | private DdmRegister() {} |
| 29 | |
| 30 | /** |
| 31 | * Register handlers for all known chunk types. |
| 32 | * |
| 33 | * If you write a handler, add a registration call here. |
| 34 | * |
| 35 | * Note that this is invoked by the application (usually through a |
| 36 | * static initializer in the main class), not the VM. It's done this |
| 37 | * way so that the handlers can use Android classes with native calls |
| 38 | * that aren't registered until after the VM is initialized (e.g. |
| 39 | * logging). It also allows debugging of DDM handler initialization. |
| 40 | * |
| 41 | * The chunk dispatcher will pause until we call registrationComplete(), |
| 42 | * so that we don't have a race that causes us to drop packets before |
| 43 | * we finish here. |
| 44 | */ |
| 45 | public static void registerHandlers() { |
Joe Onorato | 43a1765 | 2011-04-06 19:22:23 -0700 | [diff] [blame] | 46 | if (false) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 47 | Log.v("ddm", "Registering DDM message handlers"); |
| 48 | DdmHandleHello.register(); |
| 49 | DdmHandleThread.register(); |
| 50 | DdmHandleHeap.register(); |
| 51 | DdmHandleNativeHeap.register(); |
The Android Open Source Project | 7b0b1ed | 2009-03-18 22:20:26 -0700 | [diff] [blame] | 52 | DdmHandleProfiling.register(); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 53 | DdmHandleExit.register(); |
| 54 | |
| 55 | DdmServer.registrationComplete(); |
| 56 | } |
| 57 | } |
| 58 | |