1 /*
2  * Copyright (C) 2023 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 com.android.tv.feedbackconsent;
18 
19 /**
20  * This interface defines callback functions for the
21  * {@link ITvDiagnosticInformationManager#getDiagnosticInformation} request.
22  *
23  * {@hide}
24  */
25 
26 interface ITvDiagnosticInformationManagerCallback {
27 
28     /**
29     * Called when system logs are generated successfully,
30     * user consents to sharing system logs, and the logs are available in the
31     * respective URI provided by the calling application.
32     */
onSystemLogsFinished()33     oneway void onSystemLogsFinished();
34 
35     /* Options specified are invalid or incompatible */
36     const int SYSTEM_LOGS_ERROR_INVALID_INPUT = 1;
37 
38     /* System Logs generation encountered a runtime error */
39     const int SYSTEM_LOGS_ERROR_RUNTIME = 2;
40 
41     /* User denied consent to share the system logs with the specified app */
42     const int SYSTEM_LOGS_ERROR_USER_CONSENT_DENIED = 3;
43 
44     /* The request to get user consent timed out */
45     const int SYSTEM_LOGS_ERROR_USER_CONSENT_TIMED_OUT = 4;
46 
47     /* There is currently a consent request in progress. The caller should try again later. */
48     const int SYSTEM_LOGS_ERROR_ANOTHER_REQUEST_IN_PROGRESS = 5;
49 
50     /* There is no system logs to retrieve for the given caller. */
51     const int SYSTEM_LOGS_ERROR_NO_SYSTEM_LOGS_TO_RETRIEVE = 6;
52 
53     /* Failed to write system logs to the FD provided by the caller. */
54     const int SYSTEM_LOGS_ERROR_WRITE_FAILED = 7;
55 
56     /**
57     * Called when user denies consent to sharing system logs or system logs
58     * generation results in failure.
59     *
60     * @param systemLogsErrorCode One of the SYSTEM_LOGS error codes listed above.
61     */
62 
onSystemLogsError(int systemLogsErrorCode)63     oneway void onSystemLogsError(int systemLogsErrorCode);
64 
65     /**
66     * Called when user consents to sharing bugreport,
67     * bugreport is generated successfully and is available in the
68     * respective URI provided by the calling application.
69     */
onBugreportFinished()70     oneway void onBugreportFinished();
71 
72     /**
73     * Called when user denies consent to sharing the bugreport or bugreport
74     * generation results in failure.
75     *
76     * @param bugreportErrorCode One of the BUGREPORT error codes listed in IDumpstateListener.aidl.
77     */
onBugreportError(int bugreportErrorCode)78     oneway void onBugreportError(int bugreportErrorCode);
79 
80     /**
81     * Called when user clicks the cancel button on the consent screen.
82     * Cancels retrieval of the requested data.
83     */
onCancelRequest()84     oneway void onCancelRequest();
85 }