2 * Copyright (C) 2006 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package com.android.server.am;
19 import android.content.Context;
20 import android.os.Handler;
21 import android.os.Message;
23 class AppWaitingForDebuggerDialog extends BaseErrorDialog {
24 final ActivityManagerService mService;
25 final ProcessRecord mProc;
26 private CharSequence mAppName;
28 public AppWaitingForDebuggerDialog(ActivityManagerService service,
29 Context context, ProcessRecord app) {
33 mAppName = context.getPackageManager().getApplicationLabel(app.info);
37 StringBuilder text = new StringBuilder();
38 if (mAppName != null && mAppName.length() > 0) {
39 text.append("Application ");
40 text.append(mAppName);
41 text.append(" (process ");
42 text.append(app.processName);
45 text.append("Process ");
46 text.append(app.processName);
49 text.append(" is waiting for the debugger to attach.");
51 setMessage(text.toString());
52 setButton("Force Close", mHandler.obtainMessage(1, app));
53 setTitle("Waiting For Debugger");
54 getWindow().setTitle("Waiting For Debugger: " + app.info.processName);
57 public void onStop() {
60 private final Handler mHandler = new Handler() {
61 public void handleMessage(Message msg) {
64 // Kill the application.
65 mService.killAppAtUsersRequest(mProc, AppWaitingForDebuggerDialog.this);