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