• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /**
2  * Copyright (c) 2016, 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.os;
18 
19 /**
20   * Listener for dumpstate events.
21   *
22   * <p>When bugreport creation is complete one of {@code onError} or {@code onFinished} is called.
23   *
24   *
25   * {@hide}
26   */
27 interface IDumpstateListener {
28     /**
29      * Called when there is a progress update.
30      *
31      * @param progress the progress in [0, 100]
32      */
onProgress(int progress)33     oneway void onProgress(int progress);
34 
35     // NOTE: If you add to or change these error codes, please also change the corresponding enums
36     // in system server, in BugreportManager.java.
37 
38     /* Options specified are invalid or incompatible */
39     const int BUGREPORT_ERROR_INVALID_INPUT = 1;
40 
41     /* Bugreport encountered a runtime error */
42     const int BUGREPORT_ERROR_RUNTIME_ERROR = 2;
43 
44     /* User denied consent to share the bugreport with the specified app */
45     const int BUGREPORT_ERROR_USER_DENIED_CONSENT = 3;
46 
47     /* The request to get user consent timed out */
48     const int BUGREPORT_ERROR_USER_CONSENT_TIMED_OUT = 4;
49 
50     /* There is currently a bugreport running. The caller should try again later. */
51     const int BUGREPORT_ERROR_ANOTHER_REPORT_IN_PROGRESS = 5;
52 
53     /**
54      * Called on an error condition with one of the error codes listed above.
55      */
onError(int errorCode)56     oneway void onError(int errorCode);
57 
58     /**
59      * Called when taking bugreport finishes successfully.
60      */
onFinished()61     oneway void onFinished();
62 
63     /**
64      * Called when screenshot is taken.
65      */
onScreenshotTaken(boolean success)66     oneway void onScreenshotTaken(boolean success);
67 
68     /**
69      * Called when ui intensive bugreport dumps are finished.
70      */
onUiIntensiveBugreportDumpsFinished()71     oneway void onUiIntensiveBugreportDumpsFinished();
72 }
73