Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.content.pm; |
| 18 | |
| 19 | import static android.content.pm.PackageManager.COMPONENT_ENABLED_STATE_DEFAULT; |
| 20 | |
| 21 | import java.util.HashSet; |
| 22 | |
| 23 | /** |
| 24 | * Per-user state information about a package. |
Dianne Hackborn | 8832c18 | 2012-09-17 17:20:24 -0700 | [diff] [blame] | 25 | * @hide |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 26 | */ |
| 27 | public class PackageUserState { |
| 28 | public boolean stopped; |
| 29 | public boolean notLaunched; |
| 30 | public boolean installed; |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 31 | public boolean blocked; // Is the app restricted by owner / admin |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 32 | public int enabled; |
| 33 | |
Dianne Hackborn | 3fa3c28a | 2013-03-26 16:15:41 -0700 | [diff] [blame] | 34 | public String lastDisableAppCaller; |
| 35 | |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 36 | public HashSet<String> disabledComponents; |
| 37 | public HashSet<String> enabledComponents; |
| 38 | |
| 39 | public PackageUserState() { |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 40 | installed = true; |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 41 | blocked = false; |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 42 | enabled = COMPONENT_ENABLED_STATE_DEFAULT; |
| 43 | } |
| 44 | |
| 45 | public PackageUserState(PackageUserState o) { |
| 46 | installed = o.installed; |
| 47 | stopped = o.stopped; |
| 48 | notLaunched = o.notLaunched; |
| 49 | enabled = o.enabled; |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 50 | blocked = o.blocked; |
Dianne Hackborn | 3fa3c28a | 2013-03-26 16:15:41 -0700 | [diff] [blame] | 51 | lastDisableAppCaller = o.lastDisableAppCaller; |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 52 | disabledComponents = o.disabledComponents != null |
| 53 | ? new HashSet<String>(o.disabledComponents) : null; |
| 54 | enabledComponents = o.enabledComponents != null |
| 55 | ? new HashSet<String>(o.enabledComponents) : null; |
| 56 | } |
| 57 | } |