blob: dcd54fcb585281605b61906146b8f7596a2fec49 [file] [log] [blame]
Dianne Hackborn7767eac2012-08-23 18:25:40 -07001/*
2 * Copyright (C) 2012 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.content.pm;
18
19import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DEFAULT;
20
21import java.util.HashSet;
22
23/**
24 * Per-user state information about a package.
Dianne Hackborn8832c182012-09-17 17:20:24 -070025 * @hide
Dianne Hackborn7767eac2012-08-23 18:25:40 -070026 */
27public class PackageUserState {
28 public boolean stopped;
29 public boolean notLaunched;
30 public boolean installed;
31 public int enabled;
32
Dianne Hackborn3fa3c28a2013-03-26 16:15:41 -070033 public String lastDisableAppCaller;
34
Dianne Hackborn7767eac2012-08-23 18:25:40 -070035 public HashSet<String> disabledComponents;
36 public HashSet<String> enabledComponents;
37
38 public PackageUserState() {
Dianne Hackborn7767eac2012-08-23 18:25:40 -070039 installed = true;
40 enabled = COMPONENT_ENABLED_STATE_DEFAULT;
41 }
42
43 public PackageUserState(PackageUserState o) {
44 installed = o.installed;
45 stopped = o.stopped;
46 notLaunched = o.notLaunched;
47 enabled = o.enabled;
Dianne Hackborn3fa3c28a2013-03-26 16:15:41 -070048 lastDisableAppCaller = o.lastDisableAppCaller;
Dianne Hackborn7767eac2012-08-23 18:25:40 -070049 disabledComponents = o.disabledComponents != null
50 ? new HashSet<String>(o.disabledComponents) : null;
51 enabledComponents = o.enabledComponents != null
52 ? new HashSet<String>(o.enabledComponents) : null;
53 }
54}