blob: ecd450d07d464b1ba9e1a3f239c7d6114e5ea7ad [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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
17package android.ddm;
18
19import org.apache.harmony.dalvik.ddmc.DdmServer;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080020import android.util.Log;
21
22/**
23 * Just a place to stick handler registrations, instead of scattering
24 * them around.
25 */
26public 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 Onorato43a17652011-04-06 19:22:23 -070046 if (false)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080047 Log.v("ddm", "Registering DDM message handlers");
48 DdmHandleHello.register();
49 DdmHandleThread.register();
50 DdmHandleHeap.register();
51 DdmHandleNativeHeap.register();
The Android Open Source Project7b0b1ed2009-03-18 22:20:26 -070052 DdmHandleProfiling.register();
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080053 DdmHandleExit.register();
54
55 DdmServer.registrationComplete();
56 }
57}
58