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 /* There is no bugreport to retrieve for the given caller. */ 54 const int BUGREPORT_ERROR_NO_BUGREPORT_TO_RETRIEVE = 6; 55 56 /** 57 * Called on an error condition with one of the error codes listed above. 58 */ onError(int errorCode)59 oneway void onError(int errorCode); 60 61 /** 62 * Called when taking bugreport finishes successfully. 63 * 64 * @param bugreportFile The location of the bugreport file 65 */ onFinished(@tf8InCpp String bugreportFile)66 oneway void onFinished(@utf8InCpp String bugreportFile); 67 68 /** 69 * Called when screenshot is taken. 70 */ onScreenshotTaken(boolean success)71 oneway void onScreenshotTaken(boolean success); 72 73 /** 74 * Called when ui intensive bugreport dumps are finished. 75 */ onUiIntensiveBugreportDumpsFinished()76 oneway void onUiIntensiveBugreportDumpsFinished(); 77 } 78