1 /*
2  * Copyright (C) 2019 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 import android.annotation.IntDef;
20 import android.annotation.SystemApi;
21 
22 import java.lang.annotation.Retention;
23 import java.lang.annotation.RetentionPolicy;
24 
25 /**
26  * Parameters that specify what kind of bugreport should be taken.
27  *
28  * @hide
29  */
30 @SystemApi
31 public final class BugreportParams {
32     private final int mMode;
33 
BugreportParams(@ugreportMode int mode)34     public BugreportParams(@BugreportMode int mode) {
35         mMode = mode;
36     }
37 
getMode()38     public int getMode() {
39         return mMode;
40     }
41 
42     /**
43      * Defines acceptable types of bugreports.
44      * @hide
45      */
46     @Retention(RetentionPolicy.SOURCE)
47     @IntDef(prefix = { "BUGREPORT_MODE_" }, value = {
48             BUGREPORT_MODE_FULL,
49             BUGREPORT_MODE_INTERACTIVE,
50             BUGREPORT_MODE_REMOTE,
51             BUGREPORT_MODE_WEAR,
52             BUGREPORT_MODE_TELEPHONY,
53             BUGREPORT_MODE_WIFI
54     })
55     public @interface BugreportMode {}
56 
57     /**
58      * Options for a bugreport without user interference (and hence causing less
59      * interference to the system), but includes all sections.
60      */
61     public static final int BUGREPORT_MODE_FULL = IDumpstate.BUGREPORT_MODE_FULL;
62 
63     /**
64      * Options that allow user to monitor progress and enter additional data; might not
65      * include all sections.
66      */
67     public static final int BUGREPORT_MODE_INTERACTIVE = IDumpstate.BUGREPORT_MODE_INTERACTIVE;
68 
69     /**
70      * Options for a bugreport requested remotely by administrator of the Device Owner app,
71      * not the device's user.
72      */
73     public static final int BUGREPORT_MODE_REMOTE = IDumpstate.BUGREPORT_MODE_REMOTE;
74 
75     /**
76      * Options for a bugreport on a wearable device.
77      */
78     public static final int BUGREPORT_MODE_WEAR = IDumpstate.BUGREPORT_MODE_WEAR;
79 
80     /**
81      * Options for a lightweight version of bugreport that only includes a few, urgent
82      * sections used to report telephony bugs.
83      */
84     public static final int BUGREPORT_MODE_TELEPHONY = IDumpstate.BUGREPORT_MODE_TELEPHONY;
85 
86     /**
87      * Options for a lightweight bugreport that only includes a few sections related to
88      * Wifi.
89      */
90     public static final int BUGREPORT_MODE_WIFI = IDumpstate.BUGREPORT_MODE_WIFI;
91 }
92