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 android.util.ArraySet; 22 23 /** 24 * Per-user state information about a package. 25 * @hide 26 */ 27 public class PackageUserState { 28 public boolean stopped; 29 public boolean notLaunched; 30 public boolean installed; 31 public boolean hidden; // Is the app restricted by owner / admin 32 public int enabled; 33 public boolean blockUninstall; 34 35 public String lastDisableAppCaller; 36 37 public ArraySet<String> disabledComponents; 38 public ArraySet<String> enabledComponents; 39 40 public int domainVerificationStatus; 41 public int appLinkGeneration; 42 43 public PackageUserState() { 44 installed = true; 45 hidden = false; 46 enabled = COMPONENT_ENABLED_STATE_DEFAULT; 47 domainVerificationStatus = 48 PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED; 49 } 50 51 public PackageUserState(PackageUserState o) { 52 installed = o.installed; 53 stopped = o.stopped; 54 notLaunched = o.notLaunched; 55 enabled = o.enabled; 56 hidden = o.hidden; 57 lastDisableAppCaller = o.lastDisableAppCaller; 58 disabledComponents = o.disabledComponents != null 59 ? new ArraySet<>(o.disabledComponents) : null; 60 enabledComponents = o.enabledComponents != null 61 ? new ArraySet<>(o.enabledComponents) : null; 62 blockUninstall = o.blockUninstall; 63 domainVerificationStatus = o.domainVerificationStatus; 64 appLinkGeneration = o.appLinkGeneration; 65 } 66 } 67