• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2017 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 package com.android.server.pm;
17 
18 public final class DumpState {
19     public static final int DUMP_LIBS = 1 << 0;
20     public static final int DUMP_FEATURES = 1 << 1;
21     public static final int DUMP_ACTIVITY_RESOLVERS = 1 << 2;
22     public static final int DUMP_SERVICE_RESOLVERS = 1 << 3;
23     public static final int DUMP_RECEIVER_RESOLVERS = 1 << 4;
24     public static final int DUMP_CONTENT_RESOLVERS = 1 << 5;
25     public static final int DUMP_PERMISSIONS = 1 << 6;
26     public static final int DUMP_PACKAGES = 1 << 7;
27     public static final int DUMP_SHARED_USERS = 1 << 8;
28     public static final int DUMP_MESSAGES = 1 << 9;
29     public static final int DUMP_PROVIDERS = 1 << 10;
30     public static final int DUMP_VERIFIERS = 1 << 11;
31     public static final int DUMP_PREFERRED = 1 << 12;
32     public static final int DUMP_PREFERRED_XML = 1 << 13;
33     public static final int DUMP_KEYSETS = 1 << 14;
34     public static final int DUMP_VERSION = 1 << 15;
35     public static final int DUMP_INSTALLS = 1 << 16;
36     public static final int DUMP_DOMAIN_VERIFIER = 1 << 17;
37     public static final int DUMP_DOMAIN_PREFERRED = 1 << 18;
38     public static final int DUMP_FROZEN = 1 << 19;
39     public static final int DUMP_DEXOPT = 1 << 20;
40     public static final int DUMP_COMPILER_STATS = 1 << 21;
41     public static final int DUMP_CHANGES = 1 << 22;
42     public static final int DUMP_VOLUMES = 1 << 23;
43     public static final int DUMP_SERVICE_PERMISSIONS = 1 << 24;
44     public static final int DUMP_APEX = 1 << 25;
45     public static final int DUMP_QUERIES = 1 << 26;
46     public static final int DUMP_KNOWN_PACKAGES = 1 << 27;
47     public static final int DUMP_PER_UID_READ_TIMEOUTS = 1 << 28;
48     public static final int DUMP_SNAPSHOT_STATISTICS = 1 << 29;
49 
50     public static final int OPTION_SHOW_FILTERS = 1 << 0;
51     public static final int OPTION_DUMP_ALL_COMPONENTS = 1 << 1;
52     public static final int OPTION_SKIP_PERMISSIONS = 1 << 2;
53 
54     private int mTypes;
55 
56     private int mOptions;
57 
58     private boolean mTitlePrinted;
59     private boolean mFullPreferred;
60     private boolean mCheckIn;
61     private boolean mBrief;
62 
63     private String mTargetPackageName;
64 
65     private SharedUserSetting mSharedUser;
66 
isDumping(int type)67     public boolean isDumping(int type) {
68         if (mTypes == 0 && type != DUMP_PREFERRED_XML) {
69             return true;
70         }
71 
72         return (mTypes & type) != 0;
73     }
74 
setDump(int type)75     public void setDump(int type) {
76         mTypes |= type;
77     }
78 
isOptionEnabled(int option)79     public boolean isOptionEnabled(int option) {
80         return (mOptions & option) != 0;
81     }
82 
setOptionEnabled(int option)83     public void setOptionEnabled(int option) {
84         mOptions |= option;
85     }
86 
onTitlePrinted()87     public boolean onTitlePrinted() {
88         final boolean printed = mTitlePrinted;
89         mTitlePrinted = true;
90         return printed;
91     }
92 
getTitlePrinted()93     public boolean getTitlePrinted() {
94         return mTitlePrinted;
95     }
96 
setTitlePrinted(boolean enabled)97     public void setTitlePrinted(boolean enabled) {
98         mTitlePrinted = enabled;
99     }
100 
getSharedUser()101     public SharedUserSetting getSharedUser() {
102         return mSharedUser;
103     }
104 
setSharedUser(SharedUserSetting user)105     public void setSharedUser(SharedUserSetting user) {
106         mSharedUser = user;
107     }
108 
getTargetPackageName()109     public String getTargetPackageName() {
110         return mTargetPackageName;
111     }
112 
setTargetPackageName(String packageName)113     public void setTargetPackageName(String packageName) {
114         mTargetPackageName = packageName;
115     }
116 
isFullPreferred()117     public boolean isFullPreferred() {
118         return mFullPreferred;
119     }
120 
setFullPreferred(boolean fullPreferred)121     public void setFullPreferred(boolean fullPreferred) {
122         mFullPreferred = fullPreferred;
123     }
124 
isCheckIn()125     public boolean isCheckIn() {
126         return mCheckIn;
127     }
128 
setCheckIn(boolean checkIn)129     public void setCheckIn(boolean checkIn) {
130         mCheckIn = checkIn;
131     }
132 
isBrief()133     public boolean isBrief() {
134         return mBrief;
135     }
136 
setBrief(boolean brief)137     public void setBrief(boolean brief) {
138         mBrief = brief;
139     }
140 }
141