Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 1 | /* |
| 2 | ** |
| 3 | ** Copyright 2009, The Android Open Source Project |
| 4 | ** |
| 5 | ** Licensed under the Apache License, Version 2.0 (the "License"); |
| 6 | ** you may not use this file except in compliance with the License. |
| 7 | ** You may obtain a copy of the License at |
| 8 | ** |
| 9 | ** http://www.apache.org/licenses/LICENSE-2.0 |
| 10 | ** |
| 11 | ** Unless required by applicable law or agreed to in writing, software |
| 12 | ** distributed under the License is distributed on an "AS IS" BASIS, |
| 13 | ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 14 | ** See the License for the specific language governing permissions and |
| 15 | ** limitations under the License. |
| 16 | */ |
| 17 | |
| 18 | package android.app; |
| 19 | |
| 20 | import android.content.Intent; |
| 21 | |
| 22 | /** |
| 23 | * Testing interface to monitor what is happening in the activity manager |
| 24 | * while tests are running. Not for normal application development. |
| 25 | * {@hide} |
| 26 | */ |
| 27 | interface IActivityController |
| 28 | { |
| 29 | /** |
| 30 | * The system is trying to start an activity. Return true to allow |
| 31 | * it to be started as normal, or false to cancel/reject this activity. |
| 32 | */ |
| 33 | boolean activityStarting(in Intent intent, String pkg); |
| 34 | |
| 35 | /** |
| 36 | * The system is trying to return to an activity. Return true to allow |
| 37 | * it to be resumed as normal, or false to cancel/reject this activity. |
| 38 | */ |
| 39 | boolean activityResuming(String pkg); |
| 40 | |
| 41 | /** |
| 42 | * An application process has crashed (in Java). Return true for the |
| 43 | * normal error recovery (app crash dialog) to occur, false to kill |
| 44 | * it immediately. |
| 45 | */ |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 46 | boolean appCrashed(String processName, int pid, |
Dan Egnor | 60d8762 | 2009-12-16 16:32:58 -0800 | [diff] [blame] | 47 | String shortMsg, String longMsg, |
Dan Egnor | b7f0367 | 2009-12-09 16:22:32 -0800 | [diff] [blame] | 48 | long timeMillis, String stackTrace); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 49 | |
| 50 | /** |
Dianne Hackborn | 287952c | 2010-09-22 22:34:31 -0700 | [diff] [blame] | 51 | * Early call as soon as an ANR is detected. |
| 52 | */ |
| 53 | int appEarlyNotResponding(String processName, int pid, String annotation); |
| 54 | |
| 55 | /** |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 56 | * An application process is not responding. Return 0 to show the "app |
| 57 | * not responding" dialog, 1 to continue waiting, or -1 to kill it |
| 58 | * immediately. |
| 59 | */ |
| 60 | int appNotResponding(String processName, int pid, String processStats); |
Dianne Hackborn | 5b88a2f | 2013-05-03 16:25:11 -0700 | [diff] [blame] | 61 | |
| 62 | /** |
| 63 | * The system process watchdog has detected that the system seems to be |
| 64 | * hung. Return 1 to continue waiting, or -1 to let it continue with its |
| 65 | * normal kill. |
| 66 | */ |
| 67 | int systemNotResponding(String msg); |
Dianne Hackborn | b06ea70 | 2009-07-13 13:07:51 -0700 | [diff] [blame] | 68 | } |