Nandana Dutt | d11850c | 2018-12-12 17:26:57 +0000 | [diff] [blame] | 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; |
Nandana Dutt | 0a18820 | 2019-01-23 20:02:29 +0000 | [diff] [blame] | 20 | import android.annotation.SystemApi; |
Nandana Dutt | d11850c | 2018-12-12 17:26:57 +0000 | [diff] [blame] | 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 | */ |
Nandana Dutt | 0a18820 | 2019-01-23 20:02:29 +0000 | [diff] [blame] | 30 | @SystemApi |
Nandana Dutt | d11850c | 2018-12-12 17:26:57 +0000 | [diff] [blame] | 31 | public 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. |
| 44 | */ |
| 45 | @Retention(RetentionPolicy.SOURCE) |
| 46 | @IntDef(prefix = { "BUGREPORT_MODE_" }, value = { |
| 47 | BUGREPORT_MODE_FULL, |
| 48 | BUGREPORT_MODE_INTERACTIVE, |
| 49 | BUGREPORT_MODE_REMOTE, |
| 50 | BUGREPORT_MODE_WEAR, |
| 51 | BUGREPORT_MODE_TELEPHONY, |
| 52 | BUGREPORT_MODE_WIFI |
| 53 | }) |
| 54 | public @interface BugreportMode {} |
| 55 | |
| 56 | /** |
| 57 | * Options for a bugreport without user interference (and hence causing less |
| 58 | * interference to the system), but includes all sections. |
| 59 | */ |
| 60 | public static final int BUGREPORT_MODE_FULL = IDumpstate.BUGREPORT_MODE_FULL; |
| 61 | |
| 62 | /** |
| 63 | * Options that allow user to monitor progress and enter additional data; might not |
| 64 | * include all sections. |
| 65 | */ |
| 66 | public static final int BUGREPORT_MODE_INTERACTIVE = IDumpstate.BUGREPORT_MODE_INTERACTIVE; |
| 67 | |
| 68 | /** |
| 69 | * Options for a bugreport requested remotely by administrator of the Device Owner app, |
| 70 | * not the device's user. |
| 71 | */ |
| 72 | public static final int BUGREPORT_MODE_REMOTE = IDumpstate.BUGREPORT_MODE_REMOTE; |
| 73 | |
| 74 | /** |
| 75 | * Options for a bugreport on a wearable device. |
| 76 | */ |
| 77 | public static final int BUGREPORT_MODE_WEAR = IDumpstate.BUGREPORT_MODE_WEAR; |
| 78 | |
| 79 | /** |
| 80 | * Options for a lightweight version of bugreport that only includes a few, urgent |
| 81 | * sections used to report telephony bugs. |
| 82 | */ |
| 83 | public static final int BUGREPORT_MODE_TELEPHONY = IDumpstate.BUGREPORT_MODE_TELEPHONY; |
| 84 | |
| 85 | /** |
| 86 | * Options for a lightweight bugreport that only includes a few sections related to |
| 87 | * Wifi. |
| 88 | */ |
| 89 | public static final int BUGREPORT_MODE_WIFI = IDumpstate.BUGREPORT_MODE_WIFI; |
| 90 | } |