blob: 91fdf7f71f102d6a05c5fc9c58c175bc10b8dba8 [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
Jeff Sharkey9f837a92014-10-24 12:07:24 -070021import android.util.ArraySet;
Dianne Hackborn7767eac2012-08-23 18:25:40 -070022
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;
Amith Yamasanie5bcff62014-07-19 15:44:09 -070031 public boolean hidden; // Is the app restricted by owner / admin
Andrei Stingaceanu1e283912015-11-26 15:26:28 +000032 public boolean suspended;
Dianne Hackborn7767eac2012-08-23 18:25:40 -070033 public int enabled;
Kenny Guyc13053b2014-05-29 14:17:17 +010034 public boolean blockUninstall;
Dianne Hackborn7767eac2012-08-23 18:25:40 -070035
Dianne Hackborn3fa3c28a2013-03-26 16:15:41 -070036 public String lastDisableAppCaller;
37
Jeff Sharkey9f837a92014-10-24 12:07:24 -070038 public ArraySet<String> disabledComponents;
39 public ArraySet<String> enabledComponents;
Dianne Hackborn7767eac2012-08-23 18:25:40 -070040
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -080041 public int domainVerificationStatus;
Christopher Tatef0d6cb32015-07-10 17:44:53 -070042 public int appLinkGeneration;
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -080043
Dianne Hackborn7767eac2012-08-23 18:25:40 -070044 public PackageUserState() {
Dianne Hackborn7767eac2012-08-23 18:25:40 -070045 installed = true;
Amith Yamasanie5bcff62014-07-19 15:44:09 -070046 hidden = false;
Andrei Stingaceanu1e283912015-11-26 15:26:28 +000047 suspended = false;
Dianne Hackborn7767eac2012-08-23 18:25:40 -070048 enabled = COMPONENT_ENABLED_STATE_DEFAULT;
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -080049 domainVerificationStatus =
50 PackageManager.INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED;
Dianne Hackborn7767eac2012-08-23 18:25:40 -070051 }
52
53 public PackageUserState(PackageUserState o) {
54 installed = o.installed;
55 stopped = o.stopped;
56 notLaunched = o.notLaunched;
57 enabled = o.enabled;
Amith Yamasanie5bcff62014-07-19 15:44:09 -070058 hidden = o.hidden;
Andrei Stingaceanu1e283912015-11-26 15:26:28 +000059 suspended = o.suspended;
Dianne Hackborn3fa3c28a2013-03-26 16:15:41 -070060 lastDisableAppCaller = o.lastDisableAppCaller;
Dianne Hackborn7767eac2012-08-23 18:25:40 -070061 disabledComponents = o.disabledComponents != null
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -080062 ? new ArraySet<>(o.disabledComponents) : null;
Dianne Hackborn7767eac2012-08-23 18:25:40 -070063 enabledComponents = o.enabledComponents != null
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -080064 ? new ArraySet<>(o.enabledComponents) : null;
Kenny Guyc13053b2014-05-29 14:17:17 +010065 blockUninstall = o.blockUninstall;
Fabrice Di Meglio1c1b4712014-11-19 17:12:32 -080066 domainVerificationStatus = o.domainVerificationStatus;
Christopher Tatef0d6cb32015-07-10 17:44:53 -070067 appLinkGeneration = o.appLinkGeneration;
Dianne Hackborn7767eac2012-08-23 18:25:40 -070068 }
Jeff Sharkey9f837a92014-10-24 12:07:24 -070069}