blob: 279ccae7c94fac20460de6cf137e0aab03f98be5 [file] [log] [blame]
Nandana Duttd11850c2018-12-12 17:26:57 +00001/*
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
17package android.os;
18
19import android.annotation.IntDef;
Nandana Dutt0a188202019-01-23 20:02:29 +000020import android.annotation.SystemApi;
Nandana Duttd11850c2018-12-12 17:26:57 +000021
22import java.lang.annotation.Retention;
23import java.lang.annotation.RetentionPolicy;
24
25/**
26 * Parameters that specify what kind of bugreport should be taken.
27 *
28 * @hide
29 */
Nandana Dutt0a188202019-01-23 20:02:29 +000030@SystemApi
Nandana Duttd11850c2018-12-12 17:26:57 +000031public final class BugreportParams {
32 private final int mMode;
33
34 public BugreportParams(@BugreportMode int mode) {
35 mMode = mode;
36 }
37
38 public int getMode() {
39 return mMode;
40 }
41
42 /**
43 * Defines acceptable types of bugreports.
Abhijeet Kaur552e2572019-03-08 11:00:29 +000044 * @hide
Nandana Duttd11850c2018-12-12 17:26:57 +000045 */
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}