The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 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 | |
Svetoslav | f7c06eb | 2015-06-10 18:43:22 -0700 | [diff] [blame] | 19 | import android.Manifest; |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 20 | import android.annotation.CheckResult; |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 21 | import android.annotation.DrawableRes; |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 22 | import android.annotation.IntDef; |
Todd Kennedy | 9106c64 | 2017-02-08 14:16:53 -0800 | [diff] [blame] | 23 | import android.annotation.IntRange; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 24 | import android.annotation.NonNull; |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 25 | import android.annotation.Nullable; |
Svetoslav | f7c06eb | 2015-06-10 18:43:22 -0700 | [diff] [blame] | 26 | import android.annotation.RequiresPermission; |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 27 | import android.annotation.SdkConstant; |
| 28 | import android.annotation.SdkConstant.SdkConstantType; |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 29 | import android.annotation.StringRes; |
Jeff Sharkey | bb58067 | 2014-07-10 12:10:25 -0700 | [diff] [blame] | 30 | import android.annotation.SystemApi; |
Jeff Sharkey | a73b8fd | 2016-01-06 17:02:08 -0700 | [diff] [blame] | 31 | import android.annotation.TestApi; |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 32 | import android.annotation.UserIdInt; |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 33 | import android.annotation.XmlRes; |
Dianne Hackborn | 2a103f1 | 2017-08-08 15:50:31 -0700 | [diff] [blame] | 34 | import android.app.ActivityManager; |
Jeff Sharkey | 6c0b9da | 2014-08-07 22:07:11 -0700 | [diff] [blame] | 35 | import android.app.PackageDeleteObserver; |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 36 | import android.app.PackageInstallObserver; |
Amith Yamasani | 1d65327 | 2014-09-11 17:56:05 -0700 | [diff] [blame] | 37 | import android.app.admin.DevicePolicyManager; |
Jeff Sharkey | 60f95aa | 2017-03-08 13:57:15 -0700 | [diff] [blame] | 38 | import android.app.usage.StorageStatsManager; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 39 | import android.content.ComponentName; |
| 40 | import android.content.Context; |
| 41 | import android.content.Intent; |
| 42 | import android.content.IntentFilter; |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 43 | import android.content.IntentSender; |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 44 | import android.content.pm.PackageParser.PackageParserException; |
Calin Juravle | 45f8b29 | 2017-11-07 18:49:43 -0800 | [diff] [blame] | 45 | import android.content.pm.dex.ArtManager; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 46 | import android.content.res.Resources; |
| 47 | import android.content.res.XmlResourceParser; |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 48 | import android.graphics.Rect; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 49 | import android.graphics.drawable.Drawable; |
Peter Qiu | 3d615e4 | 2017-08-07 20:13:32 +0000 | [diff] [blame] | 50 | import android.net.wifi.WifiManager; |
Jeff Sharkey | 6f4b2a3 | 2017-03-21 14:13:41 -0600 | [diff] [blame] | 51 | import android.os.Build; |
Jeff Sharkey | bb58067 | 2014-07-10 12:10:25 -0700 | [diff] [blame] | 52 | import android.os.Bundle; |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 53 | import android.os.Handler; |
Jeff Sharkey | 6c0b9da | 2014-08-07 22:07:11 -0700 | [diff] [blame] | 54 | import android.os.RemoteException; |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 55 | import android.os.UserHandle; |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 56 | import android.os.UserManager; |
Jeff Sharkey | 683bcd3 | 2017-03-18 17:54:51 -0600 | [diff] [blame] | 57 | import android.os.storage.StorageManager; |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 58 | import android.os.storage.VolumeInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 59 | import android.util.AndroidException; |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 60 | import android.util.Log; |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 61 | |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 62 | import com.android.internal.util.ArrayUtils; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 63 | |
Jeff Sharkey | 6f4b2a3 | 2017-03-21 14:13:41 -0600 | [diff] [blame] | 64 | import dalvik.system.VMRuntime; |
| 65 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 66 | import java.io.File; |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 67 | import java.lang.annotation.Retention; |
| 68 | import java.lang.annotation.RetentionPolicy; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 69 | import java.util.List; |
| 70 | |
| 71 | /** |
| 72 | * Class for retrieving various kinds of information related to the application |
| 73 | * packages that are currently installed on the device. |
| 74 | * |
| 75 | * You can find this class through {@link Context#getPackageManager}. |
| 76 | */ |
| 77 | public abstract class PackageManager { |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 78 | private static final String TAG = "PackageManager"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 79 | |
Jeff Sharkey | e469713 | 2016-02-06 19:46:15 -0700 | [diff] [blame] | 80 | /** {@hide} */ |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 81 | public static final boolean APPLY_DEFAULT_TO_DEVICE_PROTECTED_STORAGE = true; |
Jeff Sharkey | e469713 | 2016-02-06 19:46:15 -0700 | [diff] [blame] | 82 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 83 | /** |
| 84 | * This exception is thrown when a given package, application, or component |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 85 | * name cannot be found. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 86 | */ |
| 87 | public static class NameNotFoundException extends AndroidException { |
| 88 | public NameNotFoundException() { |
| 89 | } |
| 90 | |
| 91 | public NameNotFoundException(String name) { |
| 92 | super(name); |
| 93 | } |
| 94 | } |
| 95 | |
| 96 | /** |
Svetoslav | f7c06eb | 2015-06-10 18:43:22 -0700 | [diff] [blame] | 97 | * Listener for changes in permissions granted to a UID. |
| 98 | * |
| 99 | * @hide |
| 100 | */ |
| 101 | @SystemApi |
| 102 | public interface OnPermissionsChangedListener { |
| 103 | |
| 104 | /** |
| 105 | * Called when the permissions for a UID change. |
| 106 | * @param uid The UID with a change. |
| 107 | */ |
| 108 | public void onPermissionsChanged(int uid); |
| 109 | } |
| 110 | |
| 111 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 112 | * As a guiding principle: |
| 113 | * <p> |
| 114 | * {@code GET_} flags are used to request additional data that may have been |
| 115 | * elided to save wire space. |
| 116 | * <p> |
| 117 | * {@code MATCH_} flags are used to include components or packages that |
| 118 | * would have otherwise been omitted from a result set by current system |
| 119 | * state. |
| 120 | */ |
| 121 | |
| 122 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 123 | @IntDef(flag = true, prefix = { "GET_", "MATCH_" }, value = { |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 124 | GET_ACTIVITIES, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 125 | GET_CONFIGURATIONS, |
| 126 | GET_GIDS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 127 | GET_INSTRUMENTATION, |
| 128 | GET_INTENT_FILTERS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 129 | GET_META_DATA, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 130 | GET_PERMISSIONS, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 131 | GET_PROVIDERS, |
| 132 | GET_RECEIVERS, |
| 133 | GET_SERVICES, |
| 134 | GET_SHARED_LIBRARY_FILES, |
| 135 | GET_SIGNATURES, |
| 136 | GET_URI_PERMISSION_PATTERNS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 137 | MATCH_UNINSTALLED_PACKAGES, |
| 138 | MATCH_DISABLED_COMPONENTS, |
| 139 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
Jeff Sharkey | c5967e9 | 2016-01-07 18:50:29 -0700 | [diff] [blame] | 140 | MATCH_SYSTEM_ONLY, |
Todd Kennedy | d6ee0ba | 2016-03-31 15:11:11 -0700 | [diff] [blame] | 141 | MATCH_FACTORY_ONLY, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 142 | MATCH_DEBUG_TRIAGED_MISSING, |
Todd Kennedy | 9c9fdf2 | 2017-03-06 10:58:27 -0800 | [diff] [blame] | 143 | MATCH_INSTANT, |
Todd Kennedy | 1f397f4 | 2016-06-28 12:14:11 -0700 | [diff] [blame] | 144 | GET_DISABLED_COMPONENTS, |
| 145 | GET_DISABLED_UNTIL_USED_COMPONENTS, |
| 146 | GET_UNINSTALLED_PACKAGES, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 147 | }) |
| 148 | @Retention(RetentionPolicy.SOURCE) |
| 149 | public @interface PackageInfoFlags {} |
| 150 | |
| 151 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 152 | @IntDef(flag = true, prefix = { "GET_", "MATCH_" }, value = { |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 153 | GET_META_DATA, |
| 154 | GET_SHARED_LIBRARY_FILES, |
| 155 | MATCH_UNINSTALLED_PACKAGES, |
| 156 | MATCH_SYSTEM_ONLY, |
| 157 | MATCH_DEBUG_TRIAGED_MISSING, |
Todd Kennedy | 2452202 | 2017-03-27 16:32:20 -0700 | [diff] [blame] | 158 | MATCH_DISABLED_COMPONENTS, |
Todd Kennedy | 5a32c6c | 2016-07-07 14:29:06 -0700 | [diff] [blame] | 159 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
Todd Kennedy | 9c9fdf2 | 2017-03-06 10:58:27 -0800 | [diff] [blame] | 160 | MATCH_INSTANT, |
Svet Ganov | 9e77977 | 2017-05-11 14:36:50 -0700 | [diff] [blame] | 161 | MATCH_STATIC_SHARED_LIBRARIES, |
Todd Kennedy | 5a32c6c | 2016-07-07 14:29:06 -0700 | [diff] [blame] | 162 | GET_DISABLED_UNTIL_USED_COMPONENTS, |
Todd Kennedy | 1f397f4 | 2016-06-28 12:14:11 -0700 | [diff] [blame] | 163 | GET_UNINSTALLED_PACKAGES, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 164 | }) |
| 165 | @Retention(RetentionPolicy.SOURCE) |
| 166 | public @interface ApplicationInfoFlags {} |
| 167 | |
| 168 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 169 | @IntDef(flag = true, prefix = { "GET_", "MATCH_" }, value = { |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 170 | GET_META_DATA, |
| 171 | GET_SHARED_LIBRARY_FILES, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 172 | MATCH_ALL, |
| 173 | MATCH_DEBUG_TRIAGED_MISSING, |
| 174 | MATCH_DEFAULT_ONLY, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 175 | MATCH_DISABLED_COMPONENTS, |
| 176 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 177 | MATCH_DIRECT_BOOT_AWARE, |
| 178 | MATCH_DIRECT_BOOT_UNAWARE, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 179 | MATCH_SYSTEM_ONLY, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 180 | MATCH_UNINSTALLED_PACKAGES, |
Todd Kennedy | 9c9fdf2 | 2017-03-06 10:58:27 -0800 | [diff] [blame] | 181 | MATCH_INSTANT, |
Svet Ganov | 9e77977 | 2017-05-11 14:36:50 -0700 | [diff] [blame] | 182 | MATCH_STATIC_SHARED_LIBRARIES, |
Todd Kennedy | 1f397f4 | 2016-06-28 12:14:11 -0700 | [diff] [blame] | 183 | GET_DISABLED_COMPONENTS, |
| 184 | GET_DISABLED_UNTIL_USED_COMPONENTS, |
| 185 | GET_UNINSTALLED_PACKAGES, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 186 | }) |
| 187 | @Retention(RetentionPolicy.SOURCE) |
| 188 | public @interface ComponentInfoFlags {} |
| 189 | |
| 190 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 191 | @IntDef(flag = true, prefix = { "GET_", "MATCH_" }, value = { |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 192 | GET_META_DATA, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 193 | GET_RESOLVED_FILTER, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 194 | GET_SHARED_LIBRARY_FILES, |
| 195 | MATCH_ALL, |
| 196 | MATCH_DEBUG_TRIAGED_MISSING, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 197 | MATCH_DISABLED_COMPONENTS, |
| 198 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 199 | MATCH_DEFAULT_ONLY, |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 200 | MATCH_DIRECT_BOOT_AWARE, |
| 201 | MATCH_DIRECT_BOOT_UNAWARE, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 202 | MATCH_SYSTEM_ONLY, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 203 | MATCH_UNINSTALLED_PACKAGES, |
Todd Kennedy | 9c9fdf2 | 2017-03-06 10:58:27 -0800 | [diff] [blame] | 204 | MATCH_INSTANT, |
Todd Kennedy | 1f397f4 | 2016-06-28 12:14:11 -0700 | [diff] [blame] | 205 | GET_DISABLED_COMPONENTS, |
| 206 | GET_DISABLED_UNTIL_USED_COMPONENTS, |
| 207 | GET_UNINSTALLED_PACKAGES, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 208 | }) |
| 209 | @Retention(RetentionPolicy.SOURCE) |
| 210 | public @interface ResolveInfoFlags {} |
| 211 | |
| 212 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 213 | @IntDef(flag = true, prefix = { "GET_", "MATCH_" }, value = { |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 214 | GET_META_DATA, |
| 215 | }) |
| 216 | @Retention(RetentionPolicy.SOURCE) |
| 217 | public @interface PermissionInfoFlags {} |
| 218 | |
| 219 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 220 | @IntDef(flag = true, prefix = { "GET_", "MATCH_" }, value = { |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 221 | GET_META_DATA, |
| 222 | }) |
| 223 | @Retention(RetentionPolicy.SOURCE) |
| 224 | public @interface PermissionGroupInfoFlags {} |
| 225 | |
| 226 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 227 | @IntDef(flag = true, prefix = { "GET_", "MATCH_" }, value = { |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 228 | GET_META_DATA, |
| 229 | }) |
| 230 | @Retention(RetentionPolicy.SOURCE) |
| 231 | public @interface InstrumentationInfoFlags {} |
| 232 | |
| 233 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 234 | * {@link PackageInfo} flag: return information about |
| 235 | * activities in the package in {@link PackageInfo#activities}. |
| 236 | */ |
| 237 | public static final int GET_ACTIVITIES = 0x00000001; |
| 238 | |
| 239 | /** |
| 240 | * {@link PackageInfo} flag: return information about |
| 241 | * intent receivers in the package in |
| 242 | * {@link PackageInfo#receivers}. |
| 243 | */ |
| 244 | public static final int GET_RECEIVERS = 0x00000002; |
| 245 | |
| 246 | /** |
| 247 | * {@link PackageInfo} flag: return information about |
| 248 | * services in the package in {@link PackageInfo#services}. |
| 249 | */ |
| 250 | public static final int GET_SERVICES = 0x00000004; |
| 251 | |
| 252 | /** |
| 253 | * {@link PackageInfo} flag: return information about |
| 254 | * content providers in the package in |
| 255 | * {@link PackageInfo#providers}. |
| 256 | */ |
| 257 | public static final int GET_PROVIDERS = 0x00000008; |
| 258 | |
| 259 | /** |
| 260 | * {@link PackageInfo} flag: return information about |
| 261 | * instrumentation in the package in |
| 262 | * {@link PackageInfo#instrumentation}. |
| 263 | */ |
| 264 | public static final int GET_INSTRUMENTATION = 0x00000010; |
| 265 | |
| 266 | /** |
| 267 | * {@link PackageInfo} flag: return information about the |
| 268 | * intent filters supported by the activity. |
| 269 | */ |
| 270 | public static final int GET_INTENT_FILTERS = 0x00000020; |
| 271 | |
| 272 | /** |
| 273 | * {@link PackageInfo} flag: return information about the |
| 274 | * signatures included in the package. |
| 275 | */ |
| 276 | public static final int GET_SIGNATURES = 0x00000040; |
| 277 | |
| 278 | /** |
| 279 | * {@link ResolveInfo} flag: return the IntentFilter that |
| 280 | * was matched for a particular ResolveInfo in |
| 281 | * {@link ResolveInfo#filter}. |
| 282 | */ |
| 283 | public static final int GET_RESOLVED_FILTER = 0x00000040; |
| 284 | |
| 285 | /** |
| 286 | * {@link ComponentInfo} flag: return the {@link ComponentInfo#metaData} |
| 287 | * data {@link android.os.Bundle}s that are associated with a component. |
| 288 | * This applies for any API returning a ComponentInfo subclass. |
| 289 | */ |
| 290 | public static final int GET_META_DATA = 0x00000080; |
| 291 | |
| 292 | /** |
| 293 | * {@link PackageInfo} flag: return the |
| 294 | * {@link PackageInfo#gids group ids} that are associated with an |
| 295 | * application. |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 296 | * This applies for any API returning a PackageInfo class, either |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 297 | * directly or nested inside of another. |
| 298 | */ |
| 299 | public static final int GET_GIDS = 0x00000100; |
| 300 | |
| 301 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 302 | * @deprecated replaced with {@link #MATCH_DISABLED_COMPONENTS} |
| 303 | */ |
| 304 | @Deprecated |
| 305 | public static final int GET_DISABLED_COMPONENTS = 0x00000200; |
| 306 | |
| 307 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 308 | * {@link PackageInfo} flag: include disabled components in the returned info. |
| 309 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 310 | public static final int MATCH_DISABLED_COMPONENTS = 0x00000200; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 311 | |
| 312 | /** |
| 313 | * {@link ApplicationInfo} flag: return the |
| 314 | * {@link ApplicationInfo#sharedLibraryFiles paths to the shared libraries} |
| 315 | * that are associated with an application. |
| 316 | * This applies for any API returning an ApplicationInfo class, either |
| 317 | * directly or nested inside of another. |
| 318 | */ |
| 319 | public static final int GET_SHARED_LIBRARY_FILES = 0x00000400; |
| 320 | |
| 321 | /** |
| 322 | * {@link ProviderInfo} flag: return the |
| 323 | * {@link ProviderInfo#uriPermissionPatterns URI permission patterns} |
| 324 | * that are associated with a content provider. |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 325 | * This applies for any API returning a ProviderInfo class, either |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 326 | * directly or nested inside of another. |
| 327 | */ |
| 328 | public static final int GET_URI_PERMISSION_PATTERNS = 0x00000800; |
| 329 | /** |
| 330 | * {@link PackageInfo} flag: return information about |
| 331 | * permissions in the package in |
| 332 | * {@link PackageInfo#permissions}. |
| 333 | */ |
| 334 | public static final int GET_PERMISSIONS = 0x00001000; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 335 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 336 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 337 | * @deprecated replaced with {@link #MATCH_UNINSTALLED_PACKAGES} |
| 338 | */ |
| 339 | @Deprecated |
| 340 | public static final int GET_UNINSTALLED_PACKAGES = 0x00002000; |
| 341 | |
| 342 | /** |
Kenny Root | 685f490 | 2011-11-03 10:13:29 -0700 | [diff] [blame] | 343 | * Flag parameter to retrieve some information about all applications (even |
| 344 | * uninstalled ones) which have data directories. This state could have |
| 345 | * resulted if applications have been deleted with flag |
| 346 | * {@code DONT_DELETE_DATA} with a possibility of being replaced or |
| 347 | * reinstalled in future. |
| 348 | * <p> |
| 349 | * Note: this flag may cause less information about currently installed |
| 350 | * applications to be returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 351 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 352 | public static final int MATCH_UNINSTALLED_PACKAGES = 0x00002000; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 353 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 354 | /** |
| 355 | * {@link PackageInfo} flag: return information about |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 356 | * hardware preferences in |
Adam Lesinski | d3edfde | 2014-08-08 17:32:44 -0700 | [diff] [blame] | 357 | * {@link PackageInfo#configPreferences PackageInfo.configPreferences}, |
| 358 | * and requested features in {@link PackageInfo#reqFeatures} and |
| 359 | * {@link PackageInfo#featureGroups}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 360 | */ |
| 361 | public static final int GET_CONFIGURATIONS = 0x00004000; |
| 362 | |
| 363 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 364 | * @deprecated replaced with {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}. |
| 365 | */ |
| 366 | @Deprecated |
| 367 | public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 0x00008000; |
| 368 | |
| 369 | /** |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 370 | * {@link PackageInfo} flag: include disabled components which are in |
| 371 | * that state only because of {@link #COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED} |
| 372 | * in the returned info. Note that if you set this flag, applications |
| 373 | * that are in this disabled state will be reported as enabled. |
| 374 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 375 | public static final int MATCH_DISABLED_UNTIL_USED_COMPONENTS = 0x00008000; |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 376 | |
| 377 | /** |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 378 | * Resolution and querying flag: if set, only filters that support the |
| 379 | * {@link android.content.Intent#CATEGORY_DEFAULT} will be considered for |
| 380 | * matching. This is a synonym for including the CATEGORY_DEFAULT in your |
| 381 | * supplied Intent. |
| 382 | */ |
Fabrice Di Meglio | 9f7e39f | 2015-04-10 20:40:16 -0700 | [diff] [blame] | 383 | public static final int MATCH_DEFAULT_ONLY = 0x00010000; |
| 384 | |
| 385 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 386 | * Querying flag: if set and if the platform is doing any filtering of the |
| 387 | * results, then the filtering will not happen. This is a synonym for saying |
| 388 | * that all results should be returned. |
| 389 | * <p> |
| 390 | * <em>This flag should be used with extreme care.</em> |
Fabrice Di Meglio | 9f7e39f | 2015-04-10 20:40:16 -0700 | [diff] [blame] | 391 | */ |
| 392 | public static final int MATCH_ALL = 0x00020000; |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 393 | |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 394 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 395 | * Querying flag: match components which are direct boot <em>unaware</em> in |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 396 | * the returned info, regardless of the current user state. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 397 | * <p> |
| 398 | * When neither {@link #MATCH_DIRECT_BOOT_AWARE} nor |
| 399 | * {@link #MATCH_DIRECT_BOOT_UNAWARE} are specified, the default behavior is |
| 400 | * to match only runnable components based on the user state. For example, |
| 401 | * when a user is started but credentials have not been presented yet, the |
| 402 | * user is running "locked" and only {@link #MATCH_DIRECT_BOOT_AWARE} |
| 403 | * components are returned. Once the user credentials have been presented, |
| 404 | * the user is running "unlocked" and both {@link #MATCH_DIRECT_BOOT_AWARE} |
| 405 | * and {@link #MATCH_DIRECT_BOOT_UNAWARE} components are returned. |
| 406 | * |
| 407 | * @see UserManager#isUserUnlocked() |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 408 | */ |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 409 | public static final int MATCH_DIRECT_BOOT_UNAWARE = 0x00040000; |
| 410 | |
| 411 | /** |
| 412 | * Querying flag: match components which are direct boot <em>aware</em> in |
| 413 | * the returned info, regardless of the current user state. |
| 414 | * <p> |
| 415 | * When neither {@link #MATCH_DIRECT_BOOT_AWARE} nor |
| 416 | * {@link #MATCH_DIRECT_BOOT_UNAWARE} are specified, the default behavior is |
| 417 | * to match only runnable components based on the user state. For example, |
| 418 | * when a user is started but credentials have not been presented yet, the |
| 419 | * user is running "locked" and only {@link #MATCH_DIRECT_BOOT_AWARE} |
| 420 | * components are returned. Once the user credentials have been presented, |
| 421 | * the user is running "unlocked" and both {@link #MATCH_DIRECT_BOOT_AWARE} |
| 422 | * and {@link #MATCH_DIRECT_BOOT_UNAWARE} components are returned. |
| 423 | * |
| 424 | * @see UserManager#isUserUnlocked() |
| 425 | */ |
| 426 | public static final int MATCH_DIRECT_BOOT_AWARE = 0x00080000; |
| 427 | |
Jeff Sharkey | 2a9e3f8 | 2015-12-18 10:57:58 -0700 | [diff] [blame] | 428 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 429 | * Querying flag: include only components from applications that are marked |
| 430 | * with {@link ApplicationInfo#FLAG_SYSTEM}. |
Jeff Sharkey | 5217cac | 2015-12-20 15:34:01 -0700 | [diff] [blame] | 431 | */ |
| 432 | public static final int MATCH_SYSTEM_ONLY = 0x00100000; |
| 433 | |
| 434 | /** |
Todd Kennedy | d6ee0ba | 2016-03-31 15:11:11 -0700 | [diff] [blame] | 435 | * Internal {@link PackageInfo} flag: include only components on the system image. |
| 436 | * This will not return information on any unbundled update to system components. |
| 437 | * @hide |
| 438 | */ |
Todd Kennedy | 4908496 | 2017-03-27 16:20:37 -0700 | [diff] [blame] | 439 | @SystemApi |
Todd Kennedy | d6ee0ba | 2016-03-31 15:11:11 -0700 | [diff] [blame] | 440 | public static final int MATCH_FACTORY_ONLY = 0x00200000; |
| 441 | |
| 442 | /** |
Amith Yamasani | 0d1fd8d | 2016-10-12 14:21:51 -0700 | [diff] [blame] | 443 | * Allows querying of packages installed for any user, not just the specific one. This flag |
Amith Yamasani | 475f9a3 | 2016-12-08 09:46:15 -0800 | [diff] [blame] | 444 | * is only meant for use by apps that have INTERACT_ACROSS_USERS permission. |
Amith Yamasani | 0d1fd8d | 2016-10-12 14:21:51 -0700 | [diff] [blame] | 445 | * @hide |
| 446 | */ |
Amith Yamasani | 475f9a3 | 2016-12-08 09:46:15 -0800 | [diff] [blame] | 447 | @SystemApi |
Amith Yamasani | 0d1fd8d | 2016-10-12 14:21:51 -0700 | [diff] [blame] | 448 | public static final int MATCH_ANY_USER = 0x00400000; |
| 449 | |
| 450 | /** |
| 451 | * Combination of MATCH_ANY_USER and MATCH_UNINSTALLED_PACKAGES to mean any known |
| 452 | * package. |
| 453 | * @hide |
| 454 | */ |
| 455 | public static final int MATCH_KNOWN_PACKAGES = MATCH_UNINSTALLED_PACKAGES | MATCH_ANY_USER; |
| 456 | |
| 457 | /** |
Todd Kennedy | 7bc3a70 | 2016-12-08 14:54:48 -0800 | [diff] [blame] | 458 | * Internal {@link PackageInfo} flag: include components that are part of an |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 459 | * instant app. By default, instant app components are not matched. |
Todd Kennedy | 7bc3a70 | 2016-12-08 14:54:48 -0800 | [diff] [blame] | 460 | * @hide |
| 461 | */ |
Todd Kennedy | 9c9fdf2 | 2017-03-06 10:58:27 -0800 | [diff] [blame] | 462 | @SystemApi |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 463 | public static final int MATCH_INSTANT = 0x00800000; |
Todd Kennedy | 7bc3a70 | 2016-12-08 14:54:48 -0800 | [diff] [blame] | 464 | |
| 465 | /** |
| 466 | * Internal {@link PackageInfo} flag: include only components that are exposed to |
Todd Kennedy | c05f5d1 | 2017-04-25 11:11:40 -0700 | [diff] [blame] | 467 | * instant apps. Matched components may have been either explicitly or implicitly |
| 468 | * exposed. |
Todd Kennedy | 7bc3a70 | 2016-12-08 14:54:48 -0800 | [diff] [blame] | 469 | * @hide |
| 470 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 471 | public static final int MATCH_VISIBLE_TO_INSTANT_APP_ONLY = 0x01000000; |
Todd Kennedy | 7bc3a70 | 2016-12-08 14:54:48 -0800 | [diff] [blame] | 472 | |
| 473 | /** |
Todd Kennedy | c05f5d1 | 2017-04-25 11:11:40 -0700 | [diff] [blame] | 474 | * Internal {@link PackageInfo} flag: include only components that have been |
| 475 | * explicitly exposed to instant apps. |
| 476 | * @hide |
| 477 | */ |
| 478 | public static final int MATCH_EXPLICITLY_VISIBLE_ONLY = 0x02000000; |
| 479 | |
| 480 | /** |
Svet Ganov | 9e77977 | 2017-05-11 14:36:50 -0700 | [diff] [blame] | 481 | * Internal {@link PackageInfo} flag: include static shared libraries. |
| 482 | * Apps that depend on static shared libs can always access the version |
| 483 | * of the lib they depend on. System/shell/root can access all shared |
| 484 | * libs regardless of dependency but need to explicitly ask for them |
| 485 | * via this flag. |
| 486 | * @hide |
| 487 | */ |
| 488 | public static final int MATCH_STATIC_SHARED_LIBRARIES = 0x04000000; |
| 489 | |
| 490 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 491 | * Internal flag used to indicate that a system component has done their |
| 492 | * homework and verified that they correctly handle packages and components |
| 493 | * that come and go over time. In particular: |
| 494 | * <ul> |
| 495 | * <li>Apps installed on external storage, which will appear to be |
| 496 | * uninstalled while the the device is ejected. |
| 497 | * <li>Apps with encryption unaware components, which will appear to not |
| 498 | * exist while the device is locked. |
| 499 | * </ul> |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 500 | * |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 501 | * @see #MATCH_UNINSTALLED_PACKAGES |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 502 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 503 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 504 | * @hide |
| 505 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 506 | public static final int MATCH_DEBUG_TRIAGED_MISSING = 0x10000000; |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 507 | |
| 508 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 509 | * Flag for {@link #addCrossProfileIntentFilter}: if this flag is set: when |
| 510 | * resolving an intent that matches the {@code CrossProfileIntentFilter}, |
| 511 | * the current profile will be skipped. Only activities in the target user |
| 512 | * can respond to the intent. |
| 513 | * |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 514 | * @hide |
| 515 | */ |
| 516 | public static final int SKIP_CURRENT_PROFILE = 0x00000002; |
| 517 | |
Tony Mak | 807e01c | 2015-12-01 20:19:03 +0000 | [diff] [blame] | 518 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 519 | * Flag for {@link #addCrossProfileIntentFilter}: if this flag is set: |
Tony Mak | 807e01c | 2015-12-01 20:19:03 +0000 | [diff] [blame] | 520 | * activities in the other profiles can respond to the intent only if no activity with |
| 521 | * non-negative priority in current profile can respond to the intent. |
| 522 | * @hide |
| 523 | */ |
| 524 | public static final int ONLY_IF_NO_MATCH_FOUND = 0x00000004; |
| 525 | |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 526 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 527 | @IntDef(prefix = { "PERMISSION_" }, value = { |
| 528 | PERMISSION_GRANTED, |
| 529 | PERMISSION_DENIED |
| 530 | }) |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 531 | @Retention(RetentionPolicy.SOURCE) |
| 532 | public @interface PermissionResult {} |
| 533 | |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 534 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 535 | * Permission check result: this is returned by {@link #checkPermission} |
| 536 | * if the permission has been granted to the given package. |
| 537 | */ |
| 538 | public static final int PERMISSION_GRANTED = 0; |
| 539 | |
| 540 | /** |
| 541 | * Permission check result: this is returned by {@link #checkPermission} |
| 542 | * if the permission has not been granted to the given package. |
| 543 | */ |
| 544 | public static final int PERMISSION_DENIED = -1; |
| 545 | |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 546 | /** @hide */ |
| 547 | @IntDef(prefix = { "SIGNATURE_" }, value = { |
| 548 | SIGNATURE_MATCH, |
| 549 | SIGNATURE_NEITHER_SIGNED, |
| 550 | SIGNATURE_FIRST_NOT_SIGNED, |
| 551 | SIGNATURE_SECOND_NOT_SIGNED, |
| 552 | SIGNATURE_NO_MATCH, |
| 553 | SIGNATURE_UNKNOWN_PACKAGE, |
| 554 | }) |
| 555 | @Retention(RetentionPolicy.SOURCE) |
| 556 | public @interface SignatureResult {} |
| 557 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 558 | /** |
| 559 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 560 | * if all signatures on the two packages match. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 561 | */ |
| 562 | public static final int SIGNATURE_MATCH = 0; |
| 563 | |
| 564 | /** |
| 565 | * Signature check result: this is returned by {@link #checkSignatures} |
| 566 | * if neither of the two packages is signed. |
| 567 | */ |
| 568 | public static final int SIGNATURE_NEITHER_SIGNED = 1; |
| 569 | |
| 570 | /** |
| 571 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 572 | * if the first package is not signed but the second is. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 573 | */ |
| 574 | public static final int SIGNATURE_FIRST_NOT_SIGNED = -1; |
| 575 | |
| 576 | /** |
| 577 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 578 | * if the second package is not signed but the first is. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 579 | */ |
| 580 | public static final int SIGNATURE_SECOND_NOT_SIGNED = -2; |
| 581 | |
| 582 | /** |
| 583 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 584 | * if not all signatures on both packages match. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 585 | */ |
| 586 | public static final int SIGNATURE_NO_MATCH = -3; |
| 587 | |
| 588 | /** |
| 589 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 590 | * if either of the packages are not valid. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 591 | */ |
| 592 | public static final int SIGNATURE_UNKNOWN_PACKAGE = -4; |
| 593 | |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 594 | /** @hide */ |
| 595 | @IntDef(prefix = { "COMPONENT_ENABLED_STATE_" }, value = { |
| 596 | COMPONENT_ENABLED_STATE_DEFAULT, |
| 597 | COMPONENT_ENABLED_STATE_ENABLED, |
| 598 | COMPONENT_ENABLED_STATE_DISABLED, |
| 599 | COMPONENT_ENABLED_STATE_DISABLED_USER, |
| 600 | COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED, |
| 601 | }) |
| 602 | @Retention(RetentionPolicy.SOURCE) |
| 603 | public @interface EnabledState {} |
| 604 | |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 605 | /** |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 606 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} and |
| 607 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 608 | * component or application is in its default enabled state (as specified in |
| 609 | * its manifest). |
| 610 | * <p> |
| 611 | * Explicitly setting the component state to this value restores it's |
| 612 | * enabled state to whatever is set in the manifest. |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 613 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 614 | public static final int COMPONENT_ENABLED_STATE_DEFAULT = 0; |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 615 | |
| 616 | /** |
| 617 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} |
| 618 | * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 619 | * component or application has been explictily enabled, regardless of |
| 620 | * what it has specified in its manifest. |
| 621 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 622 | public static final int COMPONENT_ENABLED_STATE_ENABLED = 1; |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 623 | |
| 624 | /** |
| 625 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} |
| 626 | * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 627 | * component or application has been explicitly disabled, regardless of |
| 628 | * what it has specified in its manifest. |
| 629 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 630 | public static final int COMPONENT_ENABLED_STATE_DISABLED = 2; |
| 631 | |
| 632 | /** |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 633 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} only: The |
| 634 | * user has explicitly disabled the application, regardless of what it has |
| 635 | * specified in its manifest. Because this is due to the user's request, |
| 636 | * they may re-enable it if desired through the appropriate system UI. This |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 637 | * option currently <strong>cannot</strong> be used with |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 638 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}. |
| 639 | */ |
| 640 | public static final int COMPONENT_ENABLED_STATE_DISABLED_USER = 3; |
| 641 | |
| 642 | /** |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 643 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} only: This |
| 644 | * application should be considered, until the point where the user actually |
| 645 | * wants to use it. This means that it will not normally show up to the user |
| 646 | * (such as in the launcher), but various parts of the user interface can |
| 647 | * use {@link #GET_DISABLED_UNTIL_USED_COMPONENTS} to still see it and allow |
| 648 | * the user to select it (as for example an IME, device admin, etc). Such code, |
| 649 | * once the user has selected the app, should at that point also make it enabled. |
| 650 | * This option currently <strong>can not</strong> be used with |
| 651 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}. |
| 652 | */ |
| 653 | public static final int COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED = 4; |
| 654 | |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 655 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 656 | @IntDef(flag = true, prefix = { "INSTALL_" }, value = { |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 657 | INSTALL_FORWARD_LOCK, |
| 658 | INSTALL_REPLACE_EXISTING, |
| 659 | INSTALL_ALLOW_TEST, |
| 660 | INSTALL_EXTERNAL, |
| 661 | INSTALL_INTERNAL, |
| 662 | INSTALL_FROM_ADB, |
| 663 | INSTALL_ALL_USERS, |
| 664 | INSTALL_ALLOW_DOWNGRADE, |
| 665 | INSTALL_GRANT_RUNTIME_PERMISSIONS, |
| 666 | INSTALL_FORCE_VOLUME_UUID, |
| 667 | INSTALL_FORCE_PERMISSION_PROMPT, |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 668 | INSTALL_INSTANT_APP, |
Todd Kennedy | 39bfee5 | 2016-02-24 10:28:21 -0800 | [diff] [blame] | 669 | INSTALL_DONT_KILL_APP, |
Jeff Sharkey | 683bcd3 | 2017-03-18 17:54:51 -0600 | [diff] [blame] | 670 | INSTALL_FORCE_SDK, |
| 671 | INSTALL_FULL_APP, |
| 672 | INSTALL_ALLOCATE_AGGRESSIVE, |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 673 | }) |
| 674 | @Retention(RetentionPolicy.SOURCE) |
| 675 | public @interface InstallFlags {} |
| 676 | |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 677 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 678 | * Flag parameter for {@link #installPackage} to indicate that this package |
| 679 | * should be installed as forward locked, i.e. only the app itself should |
| 680 | * have access to its code and non-resource assets. |
| 681 | * |
Jeff Sharkey | 8c61e39 | 2017-02-24 09:22:48 -0700 | [diff] [blame] | 682 | * @deprecated new installs into ASEC containers are no longer supported. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 683 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 684 | */ |
Jeff Sharkey | 8c61e39 | 2017-02-24 09:22:48 -0700 | [diff] [blame] | 685 | @Deprecated |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 686 | public static final int INSTALL_FORWARD_LOCK = 0x00000001; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 687 | |
| 688 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 689 | * Flag parameter for {@link #installPackage} to indicate that you want to |
| 690 | * replace an already installed package, if one exists. |
| 691 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 692 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 693 | */ |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 694 | public static final int INSTALL_REPLACE_EXISTING = 0x00000002; |
| 695 | |
| 696 | /** |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 697 | * Flag parameter for {@link #installPackage} to indicate that you want to |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 698 | * allow test packages (those that have set android:testOnly in their |
| 699 | * manifest) to be installed. |
| 700 | * @hide |
| 701 | */ |
| 702 | public static final int INSTALL_ALLOW_TEST = 0x00000004; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 703 | |
| 704 | /** |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 705 | * Flag parameter for {@link #installPackage} to indicate that this package |
| 706 | * must be installed to an ASEC on a {@link VolumeInfo#TYPE_PUBLIC}. |
| 707 | * |
Jeff Sharkey | 8c61e39 | 2017-02-24 09:22:48 -0700 | [diff] [blame] | 708 | * @deprecated new installs into ASEC containers are no longer supported; |
| 709 | * use adoptable storage instead. |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 710 | * @hide |
| 711 | */ |
Jeff Sharkey | 8c61e39 | 2017-02-24 09:22:48 -0700 | [diff] [blame] | 712 | @Deprecated |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 713 | public static final int INSTALL_EXTERNAL = 0x00000008; |
Oscar Montemayor | 539d3c4 | 2010-01-29 15:27:00 -0800 | [diff] [blame] | 714 | |
| 715 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 716 | * Flag parameter for {@link #installPackage} to indicate that this package |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 717 | * must be installed to internal storage. |
| 718 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 719 | * @hide |
| 720 | */ |
| 721 | public static final int INSTALL_INTERNAL = 0x00000010; |
| 722 | |
| 723 | /** |
| 724 | * Flag parameter for {@link #installPackage} to indicate that this install |
| 725 | * was initiated via ADB. |
| 726 | * |
| 727 | * @hide |
| 728 | */ |
| 729 | public static final int INSTALL_FROM_ADB = 0x00000020; |
Suchi Amalapurapu | 14b6abd | 2010-03-17 08:37:04 -0700 | [diff] [blame] | 730 | |
| 731 | /** |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 732 | * Flag parameter for {@link #installPackage} to indicate that this install |
| 733 | * should immediately be visible to all users. |
| 734 | * |
| 735 | * @hide |
| 736 | */ |
| 737 | public static final int INSTALL_ALL_USERS = 0x00000040; |
| 738 | |
| 739 | /** |
| 740 | * Flag parameter for {@link #installPackage} to indicate that it is okay |
| 741 | * to install an update to an app where the newly installed app has a lower |
Alex Klyubin | 921dd75 | 2016-02-24 13:21:41 -0800 | [diff] [blame] | 742 | * version code than the currently installed app. This is permitted only if |
| 743 | * the currently installed app is marked debuggable. |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 744 | * |
| 745 | * @hide |
| 746 | */ |
| 747 | public static final int INSTALL_ALLOW_DOWNGRADE = 0x00000080; |
| 748 | |
| 749 | /** |
Svet Ganov | 95c1ade | 2015-03-19 09:38:52 -0700 | [diff] [blame] | 750 | * Flag parameter for {@link #installPackage} to indicate that all runtime |
| 751 | * permissions should be granted to the package. If {@link #INSTALL_ALL_USERS} |
| 752 | * is set the runtime permissions will be granted to all users, otherwise |
| 753 | * only to the owner. |
| 754 | * |
| 755 | * @hide |
| 756 | */ |
| 757 | public static final int INSTALL_GRANT_RUNTIME_PERMISSIONS = 0x00000100; |
| 758 | |
Jeff Sharkey | ab23409 | 2015-06-09 21:42:22 -0700 | [diff] [blame] | 759 | /** {@hide} */ |
| 760 | public static final int INSTALL_FORCE_VOLUME_UUID = 0x00000200; |
| 761 | |
Svet Ganov | 95c1ade | 2015-03-19 09:38:52 -0700 | [diff] [blame] | 762 | /** |
Todd Kennedy | a1d12cf | 2015-09-29 15:43:00 -0700 | [diff] [blame] | 763 | * Flag parameter for {@link #installPackage} to indicate that we always want to force |
| 764 | * the prompt for permission approval. This overrides any special behaviour for internal |
| 765 | * components. |
| 766 | * |
| 767 | * @hide |
| 768 | */ |
| 769 | public static final int INSTALL_FORCE_PERMISSION_PROMPT = 0x00000400; |
| 770 | |
| 771 | /** |
Todd Kennedy | 27c24fb | 2015-09-17 16:49:25 -0700 | [diff] [blame] | 772 | * Flag parameter for {@link #installPackage} to indicate that this package is |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 773 | * to be installed as a lightweight "ephemeral" app. |
| 774 | * |
| 775 | * @hide |
| 776 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 777 | public static final int INSTALL_INSTANT_APP = 0x00000800; |
| 778 | |
| 779 | /** |
Todd Kennedy | 39bfee5 | 2016-02-24 10:28:21 -0800 | [diff] [blame] | 780 | * Flag parameter for {@link #installPackage} to indicate that this package contains |
| 781 | * a feature split to an existing application and the existing application should not |
| 782 | * be killed during the installation process. |
| 783 | * |
| 784 | * @hide |
| 785 | */ |
| 786 | public static final int INSTALL_DONT_KILL_APP = 0x00001000; |
| 787 | |
| 788 | /** |
Todd Kennedy | b107271 | 2016-04-26 15:41:20 -0700 | [diff] [blame] | 789 | * Flag parameter for {@link #installPackage} to indicate that this package is an |
| 790 | * upgrade to a package that refers to the SDK via release letter. |
| 791 | * |
| 792 | * @hide |
| 793 | */ |
| 794 | public static final int INSTALL_FORCE_SDK = 0x00002000; |
| 795 | |
| 796 | /** |
Jeff Sharkey | 683bcd3 | 2017-03-18 17:54:51 -0600 | [diff] [blame] | 797 | * Flag parameter for {@link #installPackage} to indicate that this package is |
| 798 | * to be installed as a heavy weight app. This is fundamentally the opposite of |
| 799 | * {@link #INSTALL_INSTANT_APP}. |
| 800 | * |
| 801 | * @hide |
| 802 | */ |
| 803 | public static final int INSTALL_FULL_APP = 0x00004000; |
| 804 | |
| 805 | /** |
| 806 | * Flag parameter for {@link #installPackage} to indicate that this package |
| 807 | * is critical to system health or security, meaning the system should use |
| 808 | * {@link StorageManager#FLAG_ALLOCATE_AGGRESSIVE} internally. |
| 809 | * |
| 810 | * @hide |
| 811 | */ |
| 812 | public static final int INSTALL_ALLOCATE_AGGRESSIVE = 0x00008000; |
| 813 | |
Todd Kennedy | 78a7250 | 2017-07-19 12:49:30 -0700 | [diff] [blame] | 814 | /** |
| 815 | * Flag parameter for {@link #installPackage} to indicate that this package |
| 816 | * is a virtual preload. |
| 817 | * |
| 818 | * @hide |
| 819 | */ |
| 820 | public static final int INSTALL_VIRTUAL_PRELOAD = 0x00010000; |
| 821 | |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 822 | /** @hide */ |
| 823 | @IntDef(flag = true, prefix = { "DONT_KILL_APP" }, value = { |
| 824 | DONT_KILL_APP |
| 825 | }) |
| 826 | @Retention(RetentionPolicy.SOURCE) |
| 827 | public @interface EnabledFlags {} |
| 828 | |
Jeff Sharkey | 683bcd3 | 2017-03-18 17:54:51 -0600 | [diff] [blame] | 829 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 830 | * Flag parameter for |
| 831 | * {@link #setComponentEnabledSetting(android.content.ComponentName, int, int)} to indicate |
| 832 | * that you don't want to kill the app containing the component. Be careful when you set this |
| 833 | * since changing component states can make the containing application's behavior unpredictable. |
| 834 | */ |
| 835 | public static final int DONT_KILL_APP = 0x00000001; |
| 836 | |
Bartosz Fabianowski | a34f53f | 2017-01-11 18:08:47 +0100 | [diff] [blame] | 837 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 838 | @IntDef(prefix = { "INSTALL_REASON_" }, value = { |
| 839 | INSTALL_REASON_UNKNOWN, |
| 840 | INSTALL_REASON_POLICY, |
| 841 | INSTALL_REASON_DEVICE_RESTORE, |
| 842 | INSTALL_REASON_DEVICE_SETUP, |
| 843 | INSTALL_REASON_USER |
| 844 | }) |
Bartosz Fabianowski | a34f53f | 2017-01-11 18:08:47 +0100 | [diff] [blame] | 845 | @Retention(RetentionPolicy.SOURCE) |
| 846 | public @interface InstallReason {} |
| 847 | |
| 848 | /** |
| 849 | * Code indicating that the reason for installing this package is unknown. |
| 850 | */ |
| 851 | public static final int INSTALL_REASON_UNKNOWN = 0; |
| 852 | |
| 853 | /** |
| 854 | * Code indicating that this package was installed due to enterprise policy. |
| 855 | */ |
| 856 | public static final int INSTALL_REASON_POLICY = 1; |
| 857 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 858 | /** |
Sunny Goyal | 80af6a2 | 2017-03-02 08:32:33 -0800 | [diff] [blame] | 859 | * Code indicating that this package was installed as part of restoring from another device. |
| 860 | */ |
| 861 | public static final int INSTALL_REASON_DEVICE_RESTORE = 2; |
| 862 | |
| 863 | /** |
| 864 | * Code indicating that this package was installed as part of device setup. |
| 865 | */ |
| 866 | public static final int INSTALL_REASON_DEVICE_SETUP = 3; |
| 867 | |
| 868 | /** |
| 869 | * Code indicating that the package installation was initiated by the user. |
| 870 | */ |
| 871 | public static final int INSTALL_REASON_USER = 4; |
| 872 | |
| 873 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 874 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 875 | * on success. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 876 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 877 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 878 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 879 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 880 | public static final int INSTALL_SUCCEEDED = 1; |
| 881 | |
| 882 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 883 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 884 | * if the package is already installed. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 885 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 886 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 887 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 888 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 889 | public static final int INSTALL_FAILED_ALREADY_EXISTS = -1; |
| 890 | |
| 891 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 892 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 893 | * if the package archive file is invalid. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 894 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 895 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 896 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 897 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 898 | public static final int INSTALL_FAILED_INVALID_APK = -2; |
| 899 | |
| 900 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 901 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 902 | * if the URI passed in is invalid. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 903 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 904 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 905 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 906 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 907 | public static final int INSTALL_FAILED_INVALID_URI = -3; |
| 908 | |
| 909 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 910 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 911 | * if the package manager service found that the device didn't have enough storage space to |
| 912 | * install the app. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 913 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 914 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 915 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 916 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 917 | public static final int INSTALL_FAILED_INSUFFICIENT_STORAGE = -4; |
| 918 | |
| 919 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 920 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 921 | * if a package is already installed with the same name. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 922 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 923 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 924 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 925 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 926 | public static final int INSTALL_FAILED_DUPLICATE_PACKAGE = -5; |
| 927 | |
| 928 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 929 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 930 | * if the requested shared user does not exist. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 931 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 932 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 933 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 934 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 935 | public static final int INSTALL_FAILED_NO_SHARED_USER = -6; |
| 936 | |
| 937 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 938 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 939 | * if a previously installed package of the same name has a different signature than the new |
| 940 | * package (and the old package's data was not removed). |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 941 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 942 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 943 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 944 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 945 | public static final int INSTALL_FAILED_UPDATE_INCOMPATIBLE = -7; |
| 946 | |
| 947 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 948 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 949 | * if the new package is requested a shared user which is already installed on the device and |
| 950 | * does not have matching signature. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 951 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 952 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 953 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 954 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 955 | public static final int INSTALL_FAILED_SHARED_USER_INCOMPATIBLE = -8; |
| 956 | |
| 957 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 958 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 959 | * if the new package uses a shared library that is not available. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 960 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 961 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 962 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 963 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 964 | public static final int INSTALL_FAILED_MISSING_SHARED_LIBRARY = -9; |
| 965 | |
| 966 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 967 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 968 | * if the new package uses a shared library that is not available. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 969 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 970 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 971 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 972 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 973 | public static final int INSTALL_FAILED_REPLACE_COULDNT_DELETE = -10; |
| 974 | |
| 975 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 976 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 977 | * if the new package failed while optimizing and validating its dex files, either because there |
| 978 | * was not enough storage or the validation failed. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 979 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 980 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 981 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 982 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 983 | public static final int INSTALL_FAILED_DEXOPT = -11; |
| 984 | |
| 985 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 986 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 987 | * if the new package failed because the current SDK version is older than that required by the |
| 988 | * package. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 989 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 990 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 991 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 992 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 993 | public static final int INSTALL_FAILED_OLDER_SDK = -12; |
| 994 | |
| 995 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 996 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 997 | * if the new package failed because it contains a content provider with the same authority as a |
| 998 | * provider already installed in the system. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 999 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1000 | * @hide |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 1001 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1002 | @SystemApi |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 1003 | public static final int INSTALL_FAILED_CONFLICTING_PROVIDER = -13; |
| 1004 | |
| 1005 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1006 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 1007 | * if the new package failed because the current SDK version is newer than that required by the |
| 1008 | * package. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1009 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1010 | * @hide |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 1011 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1012 | @SystemApi |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 1013 | public static final int INSTALL_FAILED_NEWER_SDK = -14; |
| 1014 | |
| 1015 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1016 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 1017 | * if the new package failed because it has specified that it is a test-only package and the |
| 1018 | * caller has not supplied the {@link #INSTALL_ALLOW_TEST} flag. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1019 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1020 | * @hide |
| 1021 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1022 | @SystemApi |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1023 | public static final int INSTALL_FAILED_TEST_ONLY = -15; |
| 1024 | |
| 1025 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1026 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 1027 | * if the package being installed contains native code, but none that is compatible with the |
| 1028 | * device's CPU_ABI. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1029 | * |
Dianne Hackborn | b181118 | 2009-05-21 15:45:42 -0700 | [diff] [blame] | 1030 | * @hide |
| 1031 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1032 | @SystemApi |
Dianne Hackborn | b181118 | 2009-05-21 15:45:42 -0700 | [diff] [blame] | 1033 | public static final int INSTALL_FAILED_CPU_ABI_INCOMPATIBLE = -16; |
| 1034 | |
| 1035 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1036 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 1037 | * if the new package uses a feature that is not available. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1038 | * |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 1039 | * @hide |
| 1040 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1041 | @SystemApi |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 1042 | public static final int INSTALL_FAILED_MISSING_FEATURE = -17; |
| 1043 | |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 1044 | // ------ Errors related to sdcard |
| 1045 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1046 | * Installation return code: this is passed in the |
| 1047 | * {@link PackageInstaller#EXTRA_LEGACY_STATUS} if a secure container mount point couldn't be |
| 1048 | * accessed on external media. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1049 | * |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 1050 | * @hide |
| 1051 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1052 | @SystemApi |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 1053 | public static final int INSTALL_FAILED_CONTAINER_ERROR = -18; |
| 1054 | |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 1055 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1056 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 1057 | * if the new package couldn't be installed in the specified install location. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1058 | * |
Suchi Amalapurapu | b56ae20 | 2010-02-04 22:51:07 -0800 | [diff] [blame] | 1059 | * @hide |
| 1060 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1061 | @SystemApi |
Suchi Amalapurapu | b56ae20 | 2010-02-04 22:51:07 -0800 | [diff] [blame] | 1062 | public static final int INSTALL_FAILED_INVALID_INSTALL_LOCATION = -19; |
| 1063 | |
| 1064 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1065 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 1066 | * if the new package couldn't be installed in the specified install location because the media |
| 1067 | * is not available. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1068 | * |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 1069 | * @hide |
| 1070 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1071 | @SystemApi |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 1072 | public static final int INSTALL_FAILED_MEDIA_UNAVAILABLE = -20; |
| 1073 | |
| 1074 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1075 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 1076 | * if the new package couldn't be installed because the verification timed out. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1077 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1078 | * @hide |
| 1079 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1080 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1081 | public static final int INSTALL_FAILED_VERIFICATION_TIMEOUT = -21; |
| 1082 | |
| 1083 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1084 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 1085 | * if the new package couldn't be installed because the verification did not succeed. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1086 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1087 | * @hide |
| 1088 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1089 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1090 | public static final int INSTALL_FAILED_VERIFICATION_FAILURE = -22; |
| 1091 | |
| 1092 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1093 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 1094 | * if the package changed from what the calling program expected. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1095 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1096 | * @hide |
| 1097 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1098 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1099 | public static final int INSTALL_FAILED_PACKAGE_CHANGED = -23; |
| 1100 | |
| 1101 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1102 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 1103 | * if the new package is assigned a different UID than it previously held. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1104 | * |
Dianne Hackborn | d0c5f51 | 2012-06-07 16:53:59 -0700 | [diff] [blame] | 1105 | * @hide |
| 1106 | */ |
| 1107 | public static final int INSTALL_FAILED_UID_CHANGED = -24; |
| 1108 | |
| 1109 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1110 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 1111 | * if the new package has an older version code than the currently installed package. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1112 | * |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1113 | * @hide |
| 1114 | */ |
| 1115 | public static final int INSTALL_FAILED_VERSION_DOWNGRADE = -25; |
| 1116 | |
| 1117 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1118 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 1119 | * if the old package has target SDK high enough to support runtime permission and the new |
| 1120 | * package has target SDK low enough to not support runtime permissions. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1121 | * |
Svetoslav | d965370 | 2015-05-13 18:02:46 -0700 | [diff] [blame] | 1122 | * @hide |
| 1123 | */ |
| 1124 | @SystemApi |
| 1125 | public static final int INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE = -26; |
| 1126 | |
| 1127 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1128 | * Installation return code: this is passed in the {@link PackageInstaller#EXTRA_LEGACY_STATUS} |
| 1129 | * if the new package attempts to downgrade the target sandbox version of the app. |
Chad Brubaker | 34573b2 | 2017-03-07 15:27:35 -0800 | [diff] [blame] | 1130 | * |
| 1131 | * @hide |
| 1132 | */ |
| 1133 | @SystemApi |
| 1134 | public static final int INSTALL_FAILED_SANDBOX_VERSION_DOWNGRADE = -27; |
| 1135 | |
| 1136 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1137 | * Installation parse return code: this is passed in the |
| 1138 | * {@link PackageInstaller#EXTRA_LEGACY_STATUS} if the parser was given a path that is not a |
| 1139 | * file, or does not end with the expected '.apk' extension. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1140 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1141 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1142 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1143 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1144 | public static final int INSTALL_PARSE_FAILED_NOT_APK = -100; |
| 1145 | |
| 1146 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1147 | * Installation parse return code: this is passed in the |
| 1148 | * {@link PackageInstaller#EXTRA_LEGACY_STATUS} if the parser was unable to retrieve the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1149 | * AndroidManifest.xml file. |
| 1150 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1151 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1152 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1153 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1154 | public static final int INSTALL_PARSE_FAILED_BAD_MANIFEST = -101; |
| 1155 | |
| 1156 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1157 | * Installation parse return code: this is passed in the |
| 1158 | * {@link PackageInstaller#EXTRA_LEGACY_STATUS} if the parser encountered an unexpected |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1159 | * exception. |
| 1160 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1161 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1162 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1163 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1164 | public static final int INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION = -102; |
| 1165 | |
| 1166 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1167 | * Installation parse return code: this is passed in the |
| 1168 | * {@link PackageInstaller#EXTRA_LEGACY_STATUS} if the parser did not find any certificates in |
| 1169 | * the .apk. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1170 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1171 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1172 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1173 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1174 | public static final int INSTALL_PARSE_FAILED_NO_CERTIFICATES = -103; |
| 1175 | |
| 1176 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1177 | * Installation parse return code: this is passed in the |
| 1178 | * {@link PackageInstaller#EXTRA_LEGACY_STATUS} if the parser found inconsistent certificates on |
| 1179 | * the files in the .apk. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1180 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1181 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1182 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1183 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1184 | public static final int INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES = -104; |
| 1185 | |
| 1186 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1187 | * Installation parse return code: this is passed in the |
| 1188 | * {@link PackageInstaller#EXTRA_LEGACY_STATUS} if the parser encountered a |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1189 | * CertificateEncodingException in one of the files in the .apk. |
| 1190 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1191 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1192 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1193 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1194 | public static final int INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING = -105; |
| 1195 | |
| 1196 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1197 | * Installation parse return code: this is passed in the |
| 1198 | * {@link PackageInstaller#EXTRA_LEGACY_STATUS} if the parser encountered a bad or missing |
| 1199 | * package name in the manifest. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1200 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1201 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1202 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1203 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1204 | public static final int INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME = -106; |
| 1205 | |
| 1206 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1207 | * Installation parse return code: tthis is passed in the |
| 1208 | * {@link PackageInstaller#EXTRA_LEGACY_STATUS} if the parser encountered a bad shared user id |
| 1209 | * name in the manifest. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1210 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1211 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1212 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1213 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1214 | public static final int INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID = -107; |
| 1215 | |
| 1216 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1217 | * Installation parse return code: this is passed in the |
| 1218 | * {@link PackageInstaller#EXTRA_LEGACY_STATUS} if the parser encountered some structural |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1219 | * problem in the manifest. |
| 1220 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1221 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1222 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1223 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1224 | public static final int INSTALL_PARSE_FAILED_MANIFEST_MALFORMED = -108; |
| 1225 | |
| 1226 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1227 | * Installation parse return code: this is passed in the |
| 1228 | * {@link PackageInstaller#EXTRA_LEGACY_STATUS} if the parser did not find any actionable tags |
| 1229 | * (instrumentation or application) in the manifest. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1230 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1231 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1232 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1233 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1234 | public static final int INSTALL_PARSE_FAILED_MANIFEST_EMPTY = -109; |
| 1235 | |
| 1236 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1237 | * Installation failed return code: this is passed in the |
| 1238 | * {@link PackageInstaller#EXTRA_LEGACY_STATUS} if the system failed to install the package |
| 1239 | * because of system issues. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1240 | * |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 1241 | * @hide |
| 1242 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1243 | @SystemApi |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 1244 | public static final int INSTALL_FAILED_INTERNAL_ERROR = -110; |
| 1245 | |
| 1246 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1247 | * Installation failed return code: this is passed in the |
| 1248 | * {@link PackageInstaller#EXTRA_LEGACY_STATUS} if the system failed to install the package |
| 1249 | * because the user is restricted from installing apps. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1250 | * |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 1251 | * @hide |
| 1252 | */ |
| 1253 | public static final int INSTALL_FAILED_USER_RESTRICTED = -111; |
| 1254 | |
| 1255 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1256 | * Installation failed return code: this is passed in the |
| 1257 | * {@link PackageInstaller#EXTRA_LEGACY_STATUS} if the system failed to install the package |
| 1258 | * because it is attempting to define a permission that is already defined by some existing |
| 1259 | * package. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1260 | * <p> |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1261 | * The package name of the app which has already defined the permission is passed to a |
| 1262 | * {@link PackageInstallObserver}, if any, as the {@link #EXTRA_FAILURE_EXISTING_PACKAGE} string |
| 1263 | * extra; and the name of the permission being redefined is passed in the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1264 | * {@link #EXTRA_FAILURE_EXISTING_PERMISSION} string extra. |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 1265 | * |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 1266 | * @hide |
| 1267 | */ |
| 1268 | public static final int INSTALL_FAILED_DUPLICATE_PERMISSION = -112; |
| 1269 | |
| 1270 | /** |
Philip P. Moltmann | b13f153 | 2017-11-14 08:34:06 -0800 | [diff] [blame] | 1271 | * Installation failed return code: this is passed in the |
| 1272 | * {@link PackageInstaller#EXTRA_LEGACY_STATUS} if the system failed to install the package |
| 1273 | * because its packaged native code did not match any of the ABIs supported by the system. |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1274 | * |
| 1275 | * @hide |
| 1276 | */ |
Narayan Kamath | d11f223 | 2014-04-10 10:37:17 +0100 | [diff] [blame] | 1277 | public static final int INSTALL_FAILED_NO_MATCHING_ABIS = -113; |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1278 | |
| 1279 | /** |
| 1280 | * Internal return code for NativeLibraryHelper methods to indicate that the package |
| 1281 | * being processed did not contain any native code. This is placed here only so that |
| 1282 | * it can belong to the same value space as the other install failure codes. |
| 1283 | * |
| 1284 | * @hide |
| 1285 | */ |
Narayan Kamath | d11f223 | 2014-04-10 10:37:17 +0100 | [diff] [blame] | 1286 | public static final int NO_NATIVE_LIBRARIES = -114; |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1287 | |
Jeff Sharkey | 7328a1b | 2014-08-07 14:01:43 -0700 | [diff] [blame] | 1288 | /** {@hide} */ |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 1289 | public static final int INSTALL_FAILED_ABORTED = -115; |
Jeff Sharkey | 7328a1b | 2014-08-07 14:01:43 -0700 | [diff] [blame] | 1290 | |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1291 | /** |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 1292 | * Installation failed return code: instant app installs are incompatible with some |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 1293 | * other installation flags supplied for the operation; or other circumstances such |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 1294 | * as trying to upgrade a system app via an instant app install. |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 1295 | * @hide |
| 1296 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 1297 | public static final int INSTALL_FAILED_INSTANT_APP_INVALID = -116; |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 1298 | |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1299 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 1300 | @IntDef(flag = true, prefix = { "DELETE_" }, value = { |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1301 | DELETE_KEEP_DATA, |
| 1302 | DELETE_ALL_USERS, |
| 1303 | DELETE_SYSTEM_APP, |
Todd Kennedy | 39bfee5 | 2016-02-24 10:28:21 -0800 | [diff] [blame] | 1304 | DELETE_DONT_KILL_APP, |
Todd Kennedy | 232d29e | 2017-11-06 14:45:53 -0800 | [diff] [blame] | 1305 | DELETE_CHATTY, |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1306 | }) |
| 1307 | @Retention(RetentionPolicy.SOURCE) |
| 1308 | public @interface DeleteFlags {} |
| 1309 | |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 1310 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1311 | * Flag parameter for {@link #deletePackage} to indicate that you don't want to delete the |
| 1312 | * package's data directory. |
| 1313 | * |
| 1314 | * @hide |
| 1315 | */ |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1316 | public static final int DELETE_KEEP_DATA = 0x00000001; |
| 1317 | |
| 1318 | /** |
| 1319 | * Flag parameter for {@link #deletePackage} to indicate that you want the |
| 1320 | * package deleted for all users. |
| 1321 | * |
| 1322 | * @hide |
| 1323 | */ |
| 1324 | public static final int DELETE_ALL_USERS = 0x00000002; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1325 | |
| 1326 | /** |
Dianne Hackborn | c895be7 | 2013-03-11 17:48:43 -0700 | [diff] [blame] | 1327 | * Flag parameter for {@link #deletePackage} to indicate that, if you are calling |
| 1328 | * uninstall on a system that has been updated, then don't do the normal process |
| 1329 | * of uninstalling the update and rolling back to the older system version (which |
| 1330 | * needs to happen for all users); instead, just mark the app as uninstalled for |
| 1331 | * the current user. |
| 1332 | * |
| 1333 | * @hide |
| 1334 | */ |
| 1335 | public static final int DELETE_SYSTEM_APP = 0x00000004; |
| 1336 | |
| 1337 | /** |
Todd Kennedy | 39bfee5 | 2016-02-24 10:28:21 -0800 | [diff] [blame] | 1338 | * Flag parameter for {@link #deletePackage} to indicate that, if you are calling |
| 1339 | * uninstall on a package that is replaced to provide new feature splits, the |
| 1340 | * existing application should not be killed during the removal process. |
| 1341 | * |
| 1342 | * @hide |
| 1343 | */ |
| 1344 | public static final int DELETE_DONT_KILL_APP = 0x00000008; |
| 1345 | |
| 1346 | /** |
Todd Kennedy | 232d29e | 2017-11-06 14:45:53 -0800 | [diff] [blame] | 1347 | * Flag parameter for {@link #deletePackage} to indicate that package deletion |
| 1348 | * should be chatty. |
| 1349 | * |
| 1350 | * @hide |
| 1351 | */ |
| 1352 | public static final int DELETE_CHATTY = 0x80000000; |
| 1353 | |
| 1354 | /** |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1355 | * Return code for when package deletion succeeds. This is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1356 | * {@link IPackageDeleteObserver} if the system succeeded in deleting the |
| 1357 | * package. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1358 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1359 | * @hide |
| 1360 | */ |
| 1361 | public static final int DELETE_SUCCEEDED = 1; |
| 1362 | |
| 1363 | /** |
| 1364 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1365 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1366 | * for an unspecified reason. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1367 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1368 | * @hide |
| 1369 | */ |
| 1370 | public static final int DELETE_FAILED_INTERNAL_ERROR = -1; |
| 1371 | |
| 1372 | /** |
| 1373 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1374 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1375 | * because it is the active DevicePolicy manager. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1376 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1377 | * @hide |
| 1378 | */ |
| 1379 | public static final int DELETE_FAILED_DEVICE_POLICY_MANAGER = -2; |
| 1380 | |
| 1381 | /** |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 1382 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1383 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1384 | * since the user is restricted. |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 1385 | * |
| 1386 | * @hide |
| 1387 | */ |
| 1388 | public static final int DELETE_FAILED_USER_RESTRICTED = -3; |
| 1389 | |
| 1390 | /** |
Kenny Guy | 1b88da5 | 2014-07-10 16:33:49 +0100 | [diff] [blame] | 1391 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1392 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1393 | * because a profile or device owner has marked the package as |
| 1394 | * uninstallable. |
Kenny Guy | c13053b | 2014-05-29 14:17:17 +0100 | [diff] [blame] | 1395 | * |
| 1396 | * @hide |
| 1397 | */ |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 1398 | public static final int DELETE_FAILED_OWNER_BLOCKED = -4; |
| 1399 | |
| 1400 | /** {@hide} */ |
| 1401 | public static final int DELETE_FAILED_ABORTED = -5; |
Kenny Guy | c13053b | 2014-05-29 14:17:17 +0100 | [diff] [blame] | 1402 | |
| 1403 | /** |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 1404 | * Deletion failed return code: this is passed to the |
| 1405 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1406 | * because the packge is a shared library used by other installed packages. |
| 1407 | * {@hide} */ |
| 1408 | public static final int DELETE_FAILED_USED_SHARED_LIBRARY = -6; |
| 1409 | |
| 1410 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1411 | * Return code that is passed to the {@link IPackageMoveObserver} when the |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1412 | * package has been successfully moved by the system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1413 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1414 | * @hide |
| 1415 | */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1416 | public static final int MOVE_SUCCEEDED = -100; |
| 1417 | |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1418 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1419 | * Error code that is passed to the {@link IPackageMoveObserver} when the |
| 1420 | * package hasn't been successfully moved by the system because of |
| 1421 | * insufficient memory on specified media. |
| 1422 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1423 | * @hide |
| 1424 | */ |
| 1425 | public static final int MOVE_FAILED_INSUFFICIENT_STORAGE = -1; |
| 1426 | |
| 1427 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1428 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1429 | * specified package doesn't exist. |
| 1430 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1431 | * @hide |
| 1432 | */ |
| 1433 | public static final int MOVE_FAILED_DOESNT_EXIST = -2; |
| 1434 | |
| 1435 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1436 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1437 | * specified package cannot be moved since its a system package. |
| 1438 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1439 | * @hide |
| 1440 | */ |
| 1441 | public static final int MOVE_FAILED_SYSTEM_PACKAGE = -3; |
| 1442 | |
| 1443 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1444 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1445 | * specified package cannot be moved since its forward locked. |
| 1446 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1447 | * @hide |
| 1448 | */ |
| 1449 | public static final int MOVE_FAILED_FORWARD_LOCKED = -4; |
| 1450 | |
| 1451 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1452 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1453 | * specified package cannot be moved to the specified location. |
| 1454 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1455 | * @hide |
| 1456 | */ |
| 1457 | public static final int MOVE_FAILED_INVALID_LOCATION = -5; |
| 1458 | |
| 1459 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1460 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1461 | * specified package cannot be moved to the specified location. |
| 1462 | * |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 1463 | * @hide |
| 1464 | */ |
| 1465 | public static final int MOVE_FAILED_INTERNAL_ERROR = -6; |
| 1466 | |
| 1467 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1468 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1469 | * specified package already has an operation pending in the queue. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1470 | * |
Kenny Root | deb1126 | 2010-08-02 11:36:21 -0700 | [diff] [blame] | 1471 | * @hide |
| 1472 | */ |
| 1473 | public static final int MOVE_FAILED_OPERATION_PENDING = -7; |
| 1474 | |
| 1475 | /** |
Makoto Onuki | f34db0a | 2016-02-17 11:17:15 -0800 | [diff] [blame] | 1476 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1477 | * specified package cannot be moved since it contains a device admin. |
| 1478 | * |
| 1479 | * @hide |
| 1480 | */ |
| 1481 | public static final int MOVE_FAILED_DEVICE_ADMIN = -8; |
| 1482 | |
| 1483 | /** |
Yao Chen | 022b8ea | 2016-12-16 11:03:28 -0800 | [diff] [blame] | 1484 | * Error code that is passed to the {@link IPackageMoveObserver} if system does not allow |
| 1485 | * non-system apps to be moved to internal storage. |
| 1486 | * |
| 1487 | * @hide |
| 1488 | */ |
| 1489 | public static final int MOVE_FAILED_3RD_PARTY_NOT_ALLOWED_ON_INTERNAL = -9; |
| 1490 | |
Jeff Sharkey | a65e649 | 2017-06-21 13:45:11 -0600 | [diff] [blame] | 1491 | /** @hide */ |
| 1492 | public static final int MOVE_FAILED_LOCKED_USER = -10; |
| 1493 | |
Yao Chen | 022b8ea | 2016-12-16 11:03:28 -0800 | [diff] [blame] | 1494 | /** |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1495 | * Flag parameter for {@link #movePackage} to indicate that |
| 1496 | * the package should be moved to internal storage if its |
| 1497 | * been installed on external media. |
| 1498 | * @hide |
| 1499 | */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1500 | @Deprecated |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1501 | public static final int MOVE_INTERNAL = 0x00000001; |
| 1502 | |
| 1503 | /** |
| 1504 | * Flag parameter for {@link #movePackage} to indicate that |
| 1505 | * the package should be moved to external media. |
| 1506 | * @hide |
| 1507 | */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1508 | @Deprecated |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1509 | public static final int MOVE_EXTERNAL_MEDIA = 0x00000002; |
| 1510 | |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1511 | /** {@hide} */ |
| 1512 | public static final String EXTRA_MOVE_ID = "android.content.pm.extra.MOVE_ID"; |
| 1513 | |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1514 | /** |
Kenny Root | 05ca4c9 | 2011-09-15 10:36:25 -0700 | [diff] [blame] | 1515 | * Usable by the required verifier as the {@code verificationCode} argument |
| 1516 | * for {@link PackageManager#verifyPendingInstall} to indicate that it will |
| 1517 | * allow the installation to proceed without any of the optional verifiers |
| 1518 | * needing to vote. |
| 1519 | * |
| 1520 | * @hide |
| 1521 | */ |
| 1522 | public static final int VERIFICATION_ALLOW_WITHOUT_SUFFICIENT = 2; |
| 1523 | |
| 1524 | /** |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 1525 | * Used as the {@code verificationCode} argument for |
| 1526 | * {@link PackageManager#verifyPendingInstall} to indicate that the calling |
| 1527 | * package verifier allows the installation to proceed. |
| 1528 | */ |
| 1529 | public static final int VERIFICATION_ALLOW = 1; |
| 1530 | |
| 1531 | /** |
| 1532 | * Used as the {@code verificationCode} argument for |
| 1533 | * {@link PackageManager#verifyPendingInstall} to indicate the calling |
| 1534 | * package verifier does not vote to allow the installation to proceed. |
| 1535 | */ |
| 1536 | public static final int VERIFICATION_REJECT = -1; |
| 1537 | |
| 1538 | /** |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1539 | * Used as the {@code verificationCode} argument for |
| 1540 | * {@link PackageManager#verifyIntentFilter} to indicate that the calling |
| 1541 | * IntentFilter Verifier confirms that the IntentFilter is verified. |
| 1542 | * |
| 1543 | * @hide |
| 1544 | */ |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 1545 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1546 | public static final int INTENT_FILTER_VERIFICATION_SUCCESS = 1; |
| 1547 | |
| 1548 | /** |
| 1549 | * Used as the {@code verificationCode} argument for |
| 1550 | * {@link PackageManager#verifyIntentFilter} to indicate that the calling |
| 1551 | * IntentFilter Verifier confirms that the IntentFilter is NOT verified. |
| 1552 | * |
| 1553 | * @hide |
| 1554 | */ |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 1555 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1556 | public static final int INTENT_FILTER_VERIFICATION_FAILURE = -1; |
| 1557 | |
| 1558 | /** |
| 1559 | * Internal status code to indicate that an IntentFilter verification result is not specified. |
| 1560 | * |
| 1561 | * @hide |
| 1562 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 1563 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1564 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED = 0; |
| 1565 | |
| 1566 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1567 | * Used as the {@code status} argument for |
| 1568 | * {@link #updateIntentVerificationStatusAsUser} to indicate that the User |
| 1569 | * will always be prompted the Intent Disambiguation Dialog if there are two |
| 1570 | * or more Intent resolved for the IntentFilter's domain(s). |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1571 | * |
| 1572 | * @hide |
| 1573 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 1574 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1575 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK = 1; |
| 1576 | |
| 1577 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1578 | * Used as the {@code status} argument for |
| 1579 | * {@link #updateIntentVerificationStatusAsUser} to indicate that the User |
| 1580 | * will never be prompted the Intent Disambiguation Dialog if there are two |
| 1581 | * or more resolution of the Intent. The default App for the domain(s) |
| 1582 | * specified in the IntentFilter will also ALWAYS be used. |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1583 | * |
| 1584 | * @hide |
| 1585 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 1586 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1587 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS = 2; |
| 1588 | |
| 1589 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1590 | * Used as the {@code status} argument for |
| 1591 | * {@link #updateIntentVerificationStatusAsUser} to indicate that the User |
| 1592 | * may be prompted the Intent Disambiguation Dialog if there are two or more |
| 1593 | * Intent resolved. The default App for the domain(s) specified in the |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1594 | * IntentFilter will also NEVER be presented to the User. |
| 1595 | * |
| 1596 | * @hide |
| 1597 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 1598 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1599 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER = 3; |
| 1600 | |
| 1601 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1602 | * Used as the {@code status} argument for |
| 1603 | * {@link #updateIntentVerificationStatusAsUser} to indicate that this app |
| 1604 | * should always be considered as an ambiguous candidate for handling the |
| 1605 | * matching Intent even if there are other candidate apps in the "always" |
| 1606 | * state. Put another way: if there are any 'always ask' apps in a set of |
| 1607 | * more than one candidate app, then a disambiguation is *always* presented |
| 1608 | * even if there is another candidate app with the 'always' state. |
Christopher Tate | 56f0ff3 | 2015-08-13 16:29:33 -0700 | [diff] [blame] | 1609 | * |
| 1610 | * @hide |
| 1611 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 1612 | @SystemApi |
Christopher Tate | 56f0ff3 | 2015-08-13 16:29:33 -0700 | [diff] [blame] | 1613 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS_ASK = 4; |
| 1614 | |
| 1615 | /** |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 1616 | * Can be used as the {@code millisecondsToDelay} argument for |
| 1617 | * {@link PackageManager#extendVerificationTimeout}. This is the |
| 1618 | * maximum time {@code PackageManager} waits for the verification |
| 1619 | * agent to return (in milliseconds). |
| 1620 | */ |
| 1621 | public static final long MAXIMUM_VERIFICATION_TIMEOUT = 60*60*1000; |
| 1622 | |
| 1623 | /** |
Amith Yamasani | 0b28549 | 2011-04-14 17:35:23 -0700 | [diff] [blame] | 1624 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: The device's |
| 1625 | * audio pipeline is low-latency, more suitable for audio applications sensitive to delays or |
| 1626 | * lag in sound input or output. |
Dan Morrill | 898e1e8 | 2010-09-26 17:28:30 -0700 | [diff] [blame] | 1627 | */ |
| 1628 | @SdkConstant(SdkConstantType.FEATURE) |
| 1629 | public static final String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency"; |
| 1630 | |
| 1631 | /** |
| 1632 | * Feature for {@link #getSystemAvailableFeatures} and |
Unsuk Jung | 50909f6 | 2014-09-02 18:25:49 -0700 | [diff] [blame] | 1633 | * {@link #hasSystemFeature}: The device includes at least one form of audio |
| 1634 | * output, such as speakers, audio jack or streaming over bluetooth |
| 1635 | */ |
| 1636 | @SdkConstant(SdkConstantType.FEATURE) |
| 1637 | public static final String FEATURE_AUDIO_OUTPUT = "android.hardware.audio.output"; |
| 1638 | |
| 1639 | /** |
Glenn Kasten | cdcb577 | 2015-05-06 15:54:49 -0700 | [diff] [blame] | 1640 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Glenn Kasten | 7587edc | 2015-10-30 17:45:52 -0700 | [diff] [blame] | 1641 | * The device has professional audio level of functionality and performance. |
Glenn Kasten | cdcb577 | 2015-05-06 15:54:49 -0700 | [diff] [blame] | 1642 | */ |
| 1643 | @SdkConstant(SdkConstantType.FEATURE) |
| 1644 | public static final String FEATURE_AUDIO_PRO = "android.hardware.audio.pro"; |
| 1645 | |
| 1646 | /** |
Unsuk Jung | 50909f6 | 2014-09-02 18:25:49 -0700 | [diff] [blame] | 1647 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1648 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 1649 | * other devices via Bluetooth. |
| 1650 | */ |
| 1651 | @SdkConstant(SdkConstantType.FEATURE) |
| 1652 | public static final String FEATURE_BLUETOOTH = "android.hardware.bluetooth"; |
| 1653 | |
| 1654 | /** |
| 1655 | * Feature for {@link #getSystemAvailableFeatures} and |
Matthew Xie | a722772 | 2013-04-18 15:25:59 -0700 | [diff] [blame] | 1656 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 1657 | * other devices via Bluetooth Low Energy radio. |
| 1658 | */ |
| 1659 | @SdkConstant(SdkConstantType.FEATURE) |
| 1660 | public static final String FEATURE_BLUETOOTH_LE = "android.hardware.bluetooth_le"; |
| 1661 | |
| 1662 | /** |
| 1663 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1664 | * {@link #hasSystemFeature}: The device has a camera facing away |
| 1665 | * from the screen. |
| 1666 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1667 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1668 | public static final String FEATURE_CAMERA = "android.hardware.camera"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1669 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1670 | /** |
| 1671 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1672 | * {@link #hasSystemFeature}: The device's camera supports auto-focus. |
| 1673 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1674 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1675 | public static final String FEATURE_CAMERA_AUTOFOCUS = "android.hardware.camera.autofocus"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1676 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1677 | /** |
| 1678 | * Feature for {@link #getSystemAvailableFeatures} and |
Eino-Ville Talvala | 752af83 | 2012-09-18 14:45:37 -0700 | [diff] [blame] | 1679 | * {@link #hasSystemFeature}: The device has at least one camera pointing in |
Eino-Ville Talvala | 9131da2 | 2014-05-08 11:39:53 -0700 | [diff] [blame] | 1680 | * some direction, or can support an external camera being connected to it. |
Eino-Ville Talvala | 752af83 | 2012-09-18 14:45:37 -0700 | [diff] [blame] | 1681 | */ |
| 1682 | @SdkConstant(SdkConstantType.FEATURE) |
| 1683 | public static final String FEATURE_CAMERA_ANY = "android.hardware.camera.any"; |
| 1684 | |
| 1685 | /** |
| 1686 | * Feature for {@link #getSystemAvailableFeatures} and |
Eino-Ville Talvala | 9131da2 | 2014-05-08 11:39:53 -0700 | [diff] [blame] | 1687 | * {@link #hasSystemFeature}: The device can support having an external camera connected to it. |
| 1688 | * The external camera may not always be connected or available to applications to use. |
| 1689 | */ |
| 1690 | @SdkConstant(SdkConstantType.FEATURE) |
| 1691 | public static final String FEATURE_CAMERA_EXTERNAL = "android.hardware.camera.external"; |
| 1692 | |
| 1693 | /** |
| 1694 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1695 | * {@link #hasSystemFeature}: The device's camera supports flash. |
| 1696 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1697 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1698 | public static final String FEATURE_CAMERA_FLASH = "android.hardware.camera.flash"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1699 | |
| 1700 | /** |
| 1701 | * Feature for {@link #getSystemAvailableFeatures} and |
Chih-Chung Chang | de1057c | 2010-06-14 19:15:00 +0800 | [diff] [blame] | 1702 | * {@link #hasSystemFeature}: The device has a front facing camera. |
| 1703 | */ |
| 1704 | @SdkConstant(SdkConstantType.FEATURE) |
| 1705 | public static final String FEATURE_CAMERA_FRONT = "android.hardware.camera.front"; |
| 1706 | |
| 1707 | /** |
Eino-Ville Talvala | 611fece | 2014-07-10 17:29:38 -0700 | [diff] [blame] | 1708 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1709 | * of the cameras on the device supports the |
| 1710 | * {@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL full hardware} |
| 1711 | * capability level. |
| 1712 | */ |
| 1713 | @SdkConstant(SdkConstantType.FEATURE) |
| 1714 | public static final String FEATURE_CAMERA_LEVEL_FULL = "android.hardware.camera.level.full"; |
| 1715 | |
| 1716 | /** |
| 1717 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1718 | * of the cameras on the device supports the |
| 1719 | * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR manual sensor} |
| 1720 | * capability level. |
| 1721 | */ |
| 1722 | @SdkConstant(SdkConstantType.FEATURE) |
| 1723 | public static final String FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR = |
| 1724 | "android.hardware.camera.capability.manual_sensor"; |
| 1725 | |
| 1726 | /** |
| 1727 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1728 | * of the cameras on the device supports the |
| 1729 | * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING manual post-processing} |
| 1730 | * capability level. |
| 1731 | */ |
| 1732 | @SdkConstant(SdkConstantType.FEATURE) |
| 1733 | public static final String FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING = |
| 1734 | "android.hardware.camera.capability.manual_post_processing"; |
| 1735 | |
| 1736 | /** |
| 1737 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1738 | * of the cameras on the device supports the |
| 1739 | * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_RAW RAW} |
| 1740 | * capability level. |
| 1741 | */ |
| 1742 | @SdkConstant(SdkConstantType.FEATURE) |
| 1743 | public static final String FEATURE_CAMERA_CAPABILITY_RAW = |
| 1744 | "android.hardware.camera.capability.raw"; |
| 1745 | |
| 1746 | /** |
Chih-Chung Chang | de1057c | 2010-06-14 19:15:00 +0800 | [diff] [blame] | 1747 | * Feature for {@link #getSystemAvailableFeatures} and |
Alex Ray | 0c9d61f | 2013-10-03 12:17:54 -0700 | [diff] [blame] | 1748 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 1749 | * consumer IR devices. |
| 1750 | */ |
| 1751 | @SdkConstant(SdkConstantType.FEATURE) |
| 1752 | public static final String FEATURE_CONSUMER_IR = "android.hardware.consumerir"; |
| 1753 | |
Sam Lin | 90e258b | 2017-04-03 20:57:45 -0700 | [diff] [blame] | 1754 | /** {@hide} */ |
| 1755 | @SdkConstant(SdkConstantType.FEATURE) |
| 1756 | public static final String FEATURE_CTS = "android.software.cts"; |
| 1757 | |
Alex Ray | 0c9d61f | 2013-10-03 12:17:54 -0700 | [diff] [blame] | 1758 | /** |
| 1759 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1760 | * {@link #hasSystemFeature}: The device supports one or more methods of |
| 1761 | * reporting current location. |
| 1762 | */ |
| 1763 | @SdkConstant(SdkConstantType.FEATURE) |
| 1764 | public static final String FEATURE_LOCATION = "android.hardware.location"; |
| 1765 | |
| 1766 | /** |
| 1767 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1768 | * {@link #hasSystemFeature}: The device has a Global Positioning System |
| 1769 | * receiver and can report precise location. |
| 1770 | */ |
| 1771 | @SdkConstant(SdkConstantType.FEATURE) |
| 1772 | public static final String FEATURE_LOCATION_GPS = "android.hardware.location.gps"; |
| 1773 | |
| 1774 | /** |
| 1775 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1776 | * {@link #hasSystemFeature}: The device can report location with coarse |
| 1777 | * accuracy using a network-based geolocation system. |
| 1778 | */ |
| 1779 | @SdkConstant(SdkConstantType.FEATURE) |
| 1780 | public static final String FEATURE_LOCATION_NETWORK = "android.hardware.location.network"; |
| 1781 | |
| 1782 | /** |
| 1783 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 2a103f1 | 2017-08-08 15:50:31 -0700 | [diff] [blame] | 1784 | * {@link #hasSystemFeature}: The device's |
| 1785 | * {@link ActivityManager#isLowRamDevice() ActivityManager.isLowRamDevice()} method returns |
| 1786 | * true. |
| 1787 | */ |
| 1788 | @SdkConstant(SdkConstantType.FEATURE) |
| 1789 | public static final String FEATURE_RAM_LOW = "android.hardware.ram.low"; |
| 1790 | |
| 1791 | /** |
| 1792 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1793 | * {@link #hasSystemFeature}: The device's |
| 1794 | * {@link ActivityManager#isLowRamDevice() ActivityManager.isLowRamDevice()} method returns |
| 1795 | * false. |
| 1796 | */ |
| 1797 | @SdkConstant(SdkConstantType.FEATURE) |
| 1798 | public static final String FEATURE_RAM_NORMAL = "android.hardware.ram.normal"; |
| 1799 | |
| 1800 | /** |
| 1801 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1802 | * {@link #hasSystemFeature}: The device can record audio via a |
| 1803 | * microphone. |
| 1804 | */ |
| 1805 | @SdkConstant(SdkConstantType.FEATURE) |
| 1806 | public static final String FEATURE_MICROPHONE = "android.hardware.microphone"; |
| 1807 | |
| 1808 | /** |
| 1809 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 76437d3 | 2010-09-01 11:17:20 -0700 | [diff] [blame] | 1810 | * {@link #hasSystemFeature}: The device can communicate using Near-Field |
| 1811 | * Communications (NFC). |
| 1812 | */ |
| 1813 | @SdkConstant(SdkConstantType.FEATURE) |
| 1814 | public static final String FEATURE_NFC = "android.hardware.nfc"; |
| 1815 | |
| 1816 | /** |
| 1817 | * Feature for {@link #getSystemAvailableFeatures} and |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1818 | * {@link #hasSystemFeature}: The device supports host- |
| 1819 | * based NFC card emulation. |
Martijn Coenen | df4d1d6 | 2013-08-28 11:18:58 -0700 | [diff] [blame] | 1820 | * |
| 1821 | * TODO remove when depending apps have moved to new constant. |
| 1822 | * @hide |
| 1823 | * @deprecated |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1824 | */ |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 1825 | @Deprecated |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1826 | @SdkConstant(SdkConstantType.FEATURE) |
| 1827 | public static final String FEATURE_NFC_HCE = "android.hardware.nfc.hce"; |
| 1828 | |
| 1829 | /** |
| 1830 | * Feature for {@link #getSystemAvailableFeatures} and |
Martijn Coenen | df4d1d6 | 2013-08-28 11:18:58 -0700 | [diff] [blame] | 1831 | * {@link #hasSystemFeature}: The device supports host- |
| 1832 | * based NFC card emulation. |
| 1833 | */ |
| 1834 | @SdkConstant(SdkConstantType.FEATURE) |
| 1835 | public static final String FEATURE_NFC_HOST_CARD_EMULATION = "android.hardware.nfc.hce"; |
| 1836 | |
| 1837 | /** |
| 1838 | * Feature for {@link #getSystemAvailableFeatures} and |
Yoshinobu Ito | c52adfe | 2016-01-22 18:14:18 +0900 | [diff] [blame] | 1839 | * {@link #hasSystemFeature}: The device supports host- |
| 1840 | * based NFC-F card emulation. |
| 1841 | */ |
| 1842 | @SdkConstant(SdkConstantType.FEATURE) |
| 1843 | public static final String FEATURE_NFC_HOST_CARD_EMULATION_NFCF = "android.hardware.nfc.hcef"; |
| 1844 | |
| 1845 | /** |
| 1846 | * Feature for {@link #getSystemAvailableFeatures} and |
Martijn Coenen | 441d61b | 2017-04-12 13:52:40 -0700 | [diff] [blame] | 1847 | * {@link #hasSystemFeature}: The device supports any |
| 1848 | * one of the {@link #FEATURE_NFC}, {@link #FEATURE_NFC_HOST_CARD_EMULATION}, |
| 1849 | * or {@link #FEATURE_NFC_HOST_CARD_EMULATION_NFCF} features. |
| 1850 | * |
| 1851 | * @hide |
| 1852 | */ |
| 1853 | @SdkConstant(SdkConstantType.FEATURE) |
| 1854 | public static final String FEATURE_NFC_ANY = "android.hardware.nfc.any"; |
| 1855 | |
| 1856 | /** |
| 1857 | * Feature for {@link #getSystemAvailableFeatures} and |
Jesse Hall | 7f51706 | 2014-07-18 11:54:41 -0700 | [diff] [blame] | 1858 | * {@link #hasSystemFeature}: The device supports the OpenGL ES |
| 1859 | * <a href="http://www.khronos.org/registry/gles/extensions/ANDROID/ANDROID_extension_pack_es31a.txt"> |
| 1860 | * Android Extension Pack</a>. |
| 1861 | */ |
| 1862 | @SdkConstant(SdkConstantType.FEATURE) |
| 1863 | public static final String FEATURE_OPENGLES_EXTENSION_PACK = "android.hardware.opengles.aep"; |
| 1864 | |
| 1865 | /** |
| 1866 | * Feature for {@link #getSystemAvailableFeatures} and |
Jesse Hall | 39ceeb5 | 2016-03-10 09:04:26 -0800 | [diff] [blame] | 1867 | * {@link #hasSystemFeature(String, int)}: If this feature is supported, the Vulkan native API |
| 1868 | * will enumerate at least one {@code VkPhysicalDevice}, and the feature version will indicate |
| 1869 | * what level of optional hardware features limits it supports. |
Jesse Hall | f77a34f | 2016-02-04 18:41:33 -0800 | [diff] [blame] | 1870 | * <p> |
| 1871 | * Level 0 includes the base Vulkan requirements as well as: |
| 1872 | * <ul><li>{@code VkPhysicalDeviceFeatures::textureCompressionETC2}</li></ul> |
| 1873 | * <p> |
| 1874 | * Level 1 additionally includes: |
| 1875 | * <ul> |
| 1876 | * <li>{@code VkPhysicalDeviceFeatures::fullDrawIndexUint32}</li> |
| 1877 | * <li>{@code VkPhysicalDeviceFeatures::imageCubeArray}</li> |
| 1878 | * <li>{@code VkPhysicalDeviceFeatures::independentBlend}</li> |
| 1879 | * <li>{@code VkPhysicalDeviceFeatures::geometryShader}</li> |
| 1880 | * <li>{@code VkPhysicalDeviceFeatures::tessellationShader}</li> |
| 1881 | * <li>{@code VkPhysicalDeviceFeatures::sampleRateShading}</li> |
| 1882 | * <li>{@code VkPhysicalDeviceFeatures::textureCompressionASTC_LDR}</li> |
| 1883 | * <li>{@code VkPhysicalDeviceFeatures::fragmentStoresAndAtomics}</li> |
| 1884 | * <li>{@code VkPhysicalDeviceFeatures::shaderImageGatherExtended}</li> |
| 1885 | * <li>{@code VkPhysicalDeviceFeatures::shaderUniformBufferArrayDynamicIndexing}</li> |
| 1886 | * <li>{@code VkPhysicalDeviceFeatures::shaderSampledImageArrayDynamicIndexing}</li> |
| 1887 | * </ul> |
| 1888 | */ |
| 1889 | @SdkConstant(SdkConstantType.FEATURE) |
| 1890 | public static final String FEATURE_VULKAN_HARDWARE_LEVEL = "android.hardware.vulkan.level"; |
| 1891 | |
| 1892 | /** |
| 1893 | * Feature for {@link #getSystemAvailableFeatures} and |
Jesse Hall | 1cd7e93 | 2017-02-05 19:58:15 -0800 | [diff] [blame] | 1894 | * {@link #hasSystemFeature(String, int)}: If this feature is supported, the Vulkan native API |
| 1895 | * will enumerate at least one {@code VkPhysicalDevice}, and the feature version will indicate |
Jesse Hall | 54fc609 | 2017-08-22 07:19:56 -0700 | [diff] [blame] | 1896 | * what level of optional compute features that device supports beyond the Vulkan 1.0 |
| 1897 | * requirements. |
Jesse Hall | 1cd7e93 | 2017-02-05 19:58:15 -0800 | [diff] [blame] | 1898 | * <p> |
Jesse Hall | 54fc609 | 2017-08-22 07:19:56 -0700 | [diff] [blame] | 1899 | * Compute level 0 indicates: |
| 1900 | * <ul> |
| 1901 | * <li>The {@code VK_KHR_variable_pointers} extension and |
| 1902 | * {@code VkPhysicalDeviceVariablePointerFeaturesKHR::variablePointers} feature are |
| 1903 | supported.</li> |
| 1904 | * <li>{@code VkPhysicalDeviceLimits::maxPerStageDescriptorStorageBuffers} is at least 16.</li> |
| 1905 | * </ul> |
Jesse Hall | 1cd7e93 | 2017-02-05 19:58:15 -0800 | [diff] [blame] | 1906 | */ |
| 1907 | @SdkConstant(SdkConstantType.FEATURE) |
| 1908 | public static final String FEATURE_VULKAN_HARDWARE_COMPUTE = "android.hardware.vulkan.compute"; |
| 1909 | |
| 1910 | /** |
| 1911 | * Feature for {@link #getSystemAvailableFeatures} and |
Jesse Hall | 39ceeb5 | 2016-03-10 09:04:26 -0800 | [diff] [blame] | 1912 | * {@link #hasSystemFeature(String, int)}: The version of this feature indicates the highest |
Jesse Hall | f77a34f | 2016-02-04 18:41:33 -0800 | [diff] [blame] | 1913 | * {@code VkPhysicalDeviceProperties::apiVersion} supported by the physical devices that support |
| 1914 | * the hardware level indicated by {@link #FEATURE_VULKAN_HARDWARE_LEVEL}. The feature version |
| 1915 | * uses the same encoding as Vulkan version numbers: |
| 1916 | * <ul> |
| 1917 | * <li>Major version number in bits 31-22</li> |
| 1918 | * <li>Minor version number in bits 21-12</li> |
| 1919 | * <li>Patch version number in bits 11-0</li> |
| 1920 | * </ul> |
| 1921 | */ |
| 1922 | @SdkConstant(SdkConstantType.FEATURE) |
| 1923 | public static final String FEATURE_VULKAN_HARDWARE_VERSION = "android.hardware.vulkan.version"; |
| 1924 | |
| 1925 | /** |
Tomasz Wasilczyk | 05392d6 | 2017-07-10 19:33:22 -0700 | [diff] [blame] | 1926 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1927 | * {@link #hasSystemFeature}: The device includes broadcast radio tuner. |
| 1928 | * @hide |
Tomasz Wasilczyk | 347192e | 2017-04-04 11:13:44 -0700 | [diff] [blame] | 1929 | */ |
Tomasz Wasilczyk | 05392d6 | 2017-07-10 19:33:22 -0700 | [diff] [blame] | 1930 | @SystemApi |
Tomasz Wasilczyk | 347192e | 2017-04-04 11:13:44 -0700 | [diff] [blame] | 1931 | @SdkConstant(SdkConstantType.FEATURE) |
Tomasz Wasilczyk | 05392d6 | 2017-07-10 19:33:22 -0700 | [diff] [blame] | 1932 | public static final String FEATURE_BROADCAST_RADIO = "android.hardware.broadcastradio"; |
Tomasz Wasilczyk | 347192e | 2017-04-04 11:13:44 -0700 | [diff] [blame] | 1933 | |
| 1934 | /** |
Jesse Hall | f77a34f | 2016-02-04 18:41:33 -0800 | [diff] [blame] | 1935 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1936 | * {@link #hasSystemFeature}: The device includes an accelerometer. |
| 1937 | */ |
| 1938 | @SdkConstant(SdkConstantType.FEATURE) |
| 1939 | public static final String FEATURE_SENSOR_ACCELEROMETER = "android.hardware.sensor.accelerometer"; |
| 1940 | |
| 1941 | /** |
| 1942 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1943 | * {@link #hasSystemFeature}: The device includes a barometer (air |
| 1944 | * pressure sensor.) |
| 1945 | */ |
| 1946 | @SdkConstant(SdkConstantType.FEATURE) |
| 1947 | public static final String FEATURE_SENSOR_BAROMETER = "android.hardware.sensor.barometer"; |
| 1948 | |
| 1949 | /** |
| 1950 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1951 | * {@link #hasSystemFeature}: The device includes a magnetometer (compass). |
| 1952 | */ |
| 1953 | @SdkConstant(SdkConstantType.FEATURE) |
| 1954 | public static final String FEATURE_SENSOR_COMPASS = "android.hardware.sensor.compass"; |
| 1955 | |
| 1956 | /** |
| 1957 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1958 | * {@link #hasSystemFeature}: The device includes a gyroscope. |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1959 | */ |
| 1960 | @SdkConstant(SdkConstantType.FEATURE) |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1961 | public static final String FEATURE_SENSOR_GYROSCOPE = "android.hardware.sensor.gyroscope"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1962 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1963 | /** |
| 1964 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1965 | * {@link #hasSystemFeature}: The device includes a light sensor. |
| 1966 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1967 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1968 | public static final String FEATURE_SENSOR_LIGHT = "android.hardware.sensor.light"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1969 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1970 | /** |
| 1971 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1972 | * {@link #hasSystemFeature}: The device includes a proximity sensor. |
| 1973 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1974 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1975 | public static final String FEATURE_SENSOR_PROXIMITY = "android.hardware.sensor.proximity"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1976 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1977 | /** |
| 1978 | * Feature for {@link #getSystemAvailableFeatures} and |
Aravind Akella | 068b0c0 | 2013-10-12 17:39:15 -0700 | [diff] [blame] | 1979 | * {@link #hasSystemFeature}: The device includes a hardware step counter. |
| 1980 | */ |
| 1981 | @SdkConstant(SdkConstantType.FEATURE) |
| 1982 | public static final String FEATURE_SENSOR_STEP_COUNTER = "android.hardware.sensor.stepcounter"; |
| 1983 | |
| 1984 | /** |
| 1985 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1986 | * {@link #hasSystemFeature}: The device includes a hardware step detector. |
| 1987 | */ |
| 1988 | @SdkConstant(SdkConstantType.FEATURE) |
| 1989 | public static final String FEATURE_SENSOR_STEP_DETECTOR = "android.hardware.sensor.stepdetector"; |
| 1990 | |
| 1991 | /** |
| 1992 | * Feature for {@link #getSystemAvailableFeatures} and |
Vinod Krishnan | 8afb23c | 2014-04-30 11:11:39 -0700 | [diff] [blame] | 1993 | * {@link #hasSystemFeature}: The device includes a heart rate monitor. |
| 1994 | */ |
| 1995 | @SdkConstant(SdkConstantType.FEATURE) |
| 1996 | public static final String FEATURE_SENSOR_HEART_RATE = "android.hardware.sensor.heartrate"; |
| 1997 | |
| 1998 | /** |
| 1999 | * Feature for {@link #getSystemAvailableFeatures} and |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 2000 | * {@link #hasSystemFeature}: The heart rate sensor on this device is an Electrocardiogram. |
Vinod Krishnan | 1ab7689 | 2014-08-20 11:11:55 -0700 | [diff] [blame] | 2001 | */ |
| 2002 | @SdkConstant(SdkConstantType.FEATURE) |
| 2003 | public static final String FEATURE_SENSOR_HEART_RATE_ECG = |
| 2004 | "android.hardware.sensor.heartrate.ecg"; |
| 2005 | |
| 2006 | /** |
| 2007 | * Feature for {@link #getSystemAvailableFeatures} and |
Aravind Akella | 8b8e74b | 2014-07-09 11:52:39 -0700 | [diff] [blame] | 2008 | * {@link #hasSystemFeature}: The device includes a relative humidity sensor. |
| 2009 | */ |
| 2010 | @SdkConstant(SdkConstantType.FEATURE) |
| 2011 | public static final String FEATURE_SENSOR_RELATIVE_HUMIDITY = |
| 2012 | "android.hardware.sensor.relative_humidity"; |
| 2013 | |
| 2014 | /** |
| 2015 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2016 | * {@link #hasSystemFeature}: The device includes an ambient temperature sensor. |
| 2017 | */ |
| 2018 | @SdkConstant(SdkConstantType.FEATURE) |
| 2019 | public static final String FEATURE_SENSOR_AMBIENT_TEMPERATURE = |
| 2020 | "android.hardware.sensor.ambient_temperature"; |
| 2021 | |
| 2022 | /** |
| 2023 | * Feature for {@link #getSystemAvailableFeatures} and |
Ashutosh Joshi | eae371b | 2015-04-09 10:30:07 -0700 | [diff] [blame] | 2024 | * {@link #hasSystemFeature}: The device supports high fidelity sensor processing |
| 2025 | * capabilities. |
| 2026 | */ |
| 2027 | @SdkConstant(SdkConstantType.FEATURE) |
| 2028 | public static final String FEATURE_HIFI_SENSORS = |
| 2029 | "android.hardware.sensor.hifi_sensors"; |
| 2030 | |
| 2031 | /** |
| 2032 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2033 | * {@link #hasSystemFeature}: The device has a telephony radio with data |
| 2034 | * communication support. |
| 2035 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 2036 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2037 | public static final String FEATURE_TELEPHONY = "android.hardware.telephony"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2038 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2039 | /** |
| 2040 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2041 | * {@link #hasSystemFeature}: The device has a CDMA telephony stack. |
| 2042 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 2043 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2044 | public static final String FEATURE_TELEPHONY_CDMA = "android.hardware.telephony.cdma"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2045 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2046 | /** |
| 2047 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2048 | * {@link #hasSystemFeature}: The device has a GSM telephony stack. |
| 2049 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 2050 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2051 | public static final String FEATURE_TELEPHONY_GSM = "android.hardware.telephony.gsm"; |
Hung-ying Tyan | 3424c02 | 2010-08-27 18:08:19 +0800 | [diff] [blame] | 2052 | |
| 2053 | /** |
Polina Bondarenko | 80909ce | 2017-01-12 21:10:38 +0100 | [diff] [blame] | 2054 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2055 | * The device supports telephony carrier restriction mechanism. |
| 2056 | * |
| 2057 | * <p>Devices declaring this feature must have an implementation of the |
| 2058 | * {@link android.telephony.TelephonyManager#getAllowedCarriers} and |
| 2059 | * {@link android.telephony.TelephonyManager#setAllowedCarriers}. |
| 2060 | * @hide |
| 2061 | */ |
| 2062 | @SystemApi |
| 2063 | @SdkConstant(SdkConstantType.FEATURE) |
| 2064 | public static final String FEATURE_TELEPHONY_CARRIERLOCK = |
| 2065 | "android.hardware.telephony.carrierlock"; |
| 2066 | |
| 2067 | /** |
Jeff Davidson | 35cda39 | 2017-02-27 09:46:00 -0800 | [diff] [blame] | 2068 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: The device |
| 2069 | * supports embedded subscriptions on eUICCs. |
| 2070 | * TODO(b/35851809): Make this public. |
| 2071 | * @hide |
| 2072 | */ |
| 2073 | @SdkConstant(SdkConstantType.FEATURE) |
| 2074 | public static final String FEATURE_TELEPHONY_EUICC = "android.hardware.telephony.euicc"; |
| 2075 | |
| 2076 | /** |
Hall Liu | c6703d9 | 2017-11-17 11:31:57 -0800 | [diff] [blame] | 2077 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: The device |
| 2078 | * supports cell-broadcast reception using the MBMS APIs. |
| 2079 | */ |
| 2080 | @SdkConstant(SdkConstantType.FEATURE) |
| 2081 | public static final String FEATURE_TELEPHONY_MBMS = "android.hardware.telephony.mbms"; |
| 2082 | |
| 2083 | /** |
Hung-ying Tyan | 3424c02 | 2010-08-27 18:08:19 +0800 | [diff] [blame] | 2084 | * Feature for {@link #getSystemAvailableFeatures} and |
Mike Lockwood | f4ca247 | 2011-02-27 11:23:25 -0800 | [diff] [blame] | 2085 | * {@link #hasSystemFeature}: The device supports connecting to USB devices |
| 2086 | * as the USB host. |
| 2087 | */ |
| 2088 | @SdkConstant(SdkConstantType.FEATURE) |
| 2089 | public static final String FEATURE_USB_HOST = "android.hardware.usb.host"; |
| 2090 | |
| 2091 | /** |
| 2092 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2093 | * {@link #hasSystemFeature}: The device supports connecting to USB accessories. |
| 2094 | */ |
| 2095 | @SdkConstant(SdkConstantType.FEATURE) |
| 2096 | public static final String FEATURE_USB_ACCESSORY = "android.hardware.usb.accessory"; |
| 2097 | |
| 2098 | /** |
| 2099 | * Feature for {@link #getSystemAvailableFeatures} and |
Hung-ying Tyan | 3424c02 | 2010-08-27 18:08:19 +0800 | [diff] [blame] | 2100 | * {@link #hasSystemFeature}: The SIP API is enabled on the device. |
| 2101 | */ |
| 2102 | @SdkConstant(SdkConstantType.FEATURE) |
| 2103 | public static final String FEATURE_SIP = "android.software.sip"; |
| 2104 | |
| 2105 | /** |
| 2106 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2107 | * {@link #hasSystemFeature}: The device supports SIP-based VOIP. |
| 2108 | */ |
| 2109 | @SdkConstant(SdkConstantType.FEATURE) |
| 2110 | public static final String FEATURE_SIP_VOIP = "android.software.sip.voip"; |
| 2111 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2112 | /** |
| 2113 | * Feature for {@link #getSystemAvailableFeatures} and |
Ihab Awad | 1ec6888 | 2014-09-12 11:09:01 -0700 | [diff] [blame] | 2114 | * {@link #hasSystemFeature}: The Connection Service API is enabled on the device. |
| 2115 | */ |
| 2116 | @SdkConstant(SdkConstantType.FEATURE) |
| 2117 | public static final String FEATURE_CONNECTION_SERVICE = "android.software.connectionservice"; |
| 2118 | |
| 2119 | /** |
| 2120 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | b0fe033 | 2010-04-05 14:43:58 -0700 | [diff] [blame] | 2121 | * {@link #hasSystemFeature}: The device's display has a touch screen. |
| 2122 | */ |
| 2123 | @SdkConstant(SdkConstantType.FEATURE) |
| 2124 | public static final String FEATURE_TOUCHSCREEN = "android.hardware.touchscreen"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2125 | |
Dan Morrill | b0fe033 | 2010-04-05 14:43:58 -0700 | [diff] [blame] | 2126 | /** |
| 2127 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 2128 | * {@link #hasSystemFeature}: The device's touch screen supports |
| 2129 | * multitouch sufficient for basic two-finger gesture detection. |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2130 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 2131 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2132 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH = "android.hardware.touchscreen.multitouch"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2133 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2134 | /** |
| 2135 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 2136 | * {@link #hasSystemFeature}: The device's touch screen is capable of |
| 2137 | * tracking two or more fingers fully independently. |
| 2138 | */ |
| 2139 | @SdkConstant(SdkConstantType.FEATURE) |
| 2140 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT = "android.hardware.touchscreen.multitouch.distinct"; |
| 2141 | |
| 2142 | /** |
| 2143 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 6993d3d | 2010-09-03 14:30:14 -0700 | [diff] [blame] | 2144 | * {@link #hasSystemFeature}: The device's touch screen is capable of |
| 2145 | * tracking a full hand of fingers fully independently -- that is, 5 or |
| 2146 | * more simultaneous independent pointers. |
| 2147 | */ |
| 2148 | @SdkConstant(SdkConstantType.FEATURE) |
| 2149 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND = "android.hardware.touchscreen.multitouch.jazzhand"; |
| 2150 | |
| 2151 | /** |
| 2152 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | a537687 | 2011-01-23 13:15:53 -0800 | [diff] [blame] | 2153 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 2154 | * does support touch emulation for basic events. For instance, the |
| 2155 | * device might use a mouse or remote control to drive a cursor, and |
| 2156 | * emulate basic touch pointer events like down, up, drag, etc. All |
| 2157 | * devices that support android.hardware.touchscreen or a sub-feature are |
| 2158 | * presumed to also support faketouch. |
| 2159 | */ |
| 2160 | @SdkConstant(SdkConstantType.FEATURE) |
| 2161 | public static final String FEATURE_FAKETOUCH = "android.hardware.faketouch"; |
| 2162 | |
| 2163 | /** |
| 2164 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | e22fe93 | 2011-06-08 20:24:29 -0700 | [diff] [blame] | 2165 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 2166 | * does support touch emulation for basic events that supports distinct |
| 2167 | * tracking of two or more fingers. This is an extension of |
| 2168 | * {@link #FEATURE_FAKETOUCH} for input devices with this capability. Note |
| 2169 | * that unlike a distinct multitouch screen as defined by |
| 2170 | * {@link #FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT}, these kinds of input |
| 2171 | * devices will not actually provide full two-finger gestures since the |
| 2172 | * input is being transformed to cursor movement on the screen. That is, |
| 2173 | * single finger gestures will move a cursor; two-finger swipes will |
| 2174 | * result in single-finger touch events; other two-finger gestures will |
| 2175 | * result in the corresponding two-finger touch event. |
| 2176 | */ |
| 2177 | @SdkConstant(SdkConstantType.FEATURE) |
| 2178 | public static final String FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT = "android.hardware.faketouch.multitouch.distinct"; |
| 2179 | |
| 2180 | /** |
| 2181 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2182 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 2183 | * does support touch emulation for basic events that supports tracking |
| 2184 | * a hand of fingers (5 or more fingers) fully independently. |
| 2185 | * This is an extension of |
| 2186 | * {@link #FEATURE_FAKETOUCH} for input devices with this capability. Note |
| 2187 | * that unlike a multitouch screen as defined by |
| 2188 | * {@link #FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND}, not all two finger |
| 2189 | * gestures can be detected due to the limitations described for |
| 2190 | * {@link #FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT}. |
| 2191 | */ |
| 2192 | @SdkConstant(SdkConstantType.FEATURE) |
| 2193 | public static final String FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND = "android.hardware.faketouch.multitouch.jazzhand"; |
| 2194 | |
| 2195 | /** |
| 2196 | * Feature for {@link #getSystemAvailableFeatures} and |
Jim Miller | d9b9d41 | 2015-07-22 19:51:40 -0700 | [diff] [blame] | 2197 | * {@link #hasSystemFeature}: The device has biometric hardware to detect a fingerprint. |
| 2198 | */ |
| 2199 | @SdkConstant(SdkConstantType.FEATURE) |
| 2200 | public static final String FEATURE_FINGERPRINT = "android.hardware.fingerprint"; |
| 2201 | |
| 2202 | /** |
| 2203 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | e289bff | 2011-06-13 19:33:22 -0700 | [diff] [blame] | 2204 | * {@link #hasSystemFeature}: The device supports portrait orientation |
| 2205 | * screens. For backwards compatibility, you can assume that if neither |
| 2206 | * this nor {@link #FEATURE_SCREEN_LANDSCAPE} is set then the device supports |
| 2207 | * both portrait and landscape. |
| 2208 | */ |
| 2209 | @SdkConstant(SdkConstantType.FEATURE) |
| 2210 | public static final String FEATURE_SCREEN_PORTRAIT = "android.hardware.screen.portrait"; |
| 2211 | |
| 2212 | /** |
| 2213 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2214 | * {@link #hasSystemFeature}: The device supports landscape orientation |
| 2215 | * screens. For backwards compatibility, you can assume that if neither |
| 2216 | * this nor {@link #FEATURE_SCREEN_PORTRAIT} is set then the device supports |
| 2217 | * both portrait and landscape. |
| 2218 | */ |
| 2219 | @SdkConstant(SdkConstantType.FEATURE) |
| 2220 | public static final String FEATURE_SCREEN_LANDSCAPE = "android.hardware.screen.landscape"; |
| 2221 | |
| 2222 | /** |
| 2223 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2224 | * {@link #hasSystemFeature}: The device supports live wallpapers. |
| 2225 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 2226 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2227 | public static final String FEATURE_LIVE_WALLPAPER = "android.software.live_wallpaper"; |
Oscar Montemayor | 1228d0a | 2010-01-28 12:01:44 -0800 | [diff] [blame] | 2228 | /** |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 2229 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 119bbc3 | 2013-03-22 17:27:25 -0700 | [diff] [blame] | 2230 | * {@link #hasSystemFeature}: The device supports app widgets. |
| 2231 | */ |
| 2232 | @SdkConstant(SdkConstantType.FEATURE) |
| 2233 | public static final String FEATURE_APP_WIDGETS = "android.software.app_widgets"; |
| 2234 | |
| 2235 | /** |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2236 | * @hide |
| 2237 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2238 | * {@link #hasSystemFeature}: The device supports |
| 2239 | * {@link android.service.voice.VoiceInteractionService} and |
| 2240 | * {@link android.app.VoiceInteractor}. |
| 2241 | */ |
| 2242 | @SdkConstant(SdkConstantType.FEATURE) |
| 2243 | public static final String FEATURE_VOICE_RECOGNIZERS = "android.software.voice_recognizers"; |
| 2244 | |
| 2245 | |
| 2246 | /** |
Dianne Hackborn | 119bbc3 | 2013-03-22 17:27:25 -0700 | [diff] [blame] | 2247 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2248 | * {@link #hasSystemFeature}: The device supports a home screen that is replaceable |
| 2249 | * by third party applications. |
| 2250 | */ |
| 2251 | @SdkConstant(SdkConstantType.FEATURE) |
| 2252 | public static final String FEATURE_HOME_SCREEN = "android.software.home_screen"; |
| 2253 | |
| 2254 | /** |
| 2255 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2256 | * {@link #hasSystemFeature}: The device supports adding new input methods implemented |
| 2257 | * with the {@link android.inputmethodservice.InputMethodService} API. |
| 2258 | */ |
| 2259 | @SdkConstant(SdkConstantType.FEATURE) |
| 2260 | public static final String FEATURE_INPUT_METHODS = "android.software.input_methods"; |
| 2261 | |
| 2262 | /** |
| 2263 | * Feature for {@link #getSystemAvailableFeatures} and |
Amith Yamasani | 44a01b7 | 2013-09-16 10:44:57 -0700 | [diff] [blame] | 2264 | * {@link #hasSystemFeature}: The device supports device policy enforcement via device admins. |
| 2265 | */ |
| 2266 | @SdkConstant(SdkConstantType.FEATURE) |
| 2267 | public static final String FEATURE_DEVICE_ADMIN = "android.software.device_admin"; |
| 2268 | |
| 2269 | /** |
| 2270 | * Feature for {@link #getSystemAvailableFeatures} and |
Tim Kilbourn | f94b6a9 | 2014-03-07 15:13:48 -0800 | [diff] [blame] | 2271 | * {@link #hasSystemFeature}: The device supports leanback UI. This is |
| 2272 | * typically used in a living room television experience, but is a software |
| 2273 | * feature unlike {@link #FEATURE_TELEVISION}. Devices running with this |
| 2274 | * feature will use resources associated with the "television" UI mode. |
| 2275 | */ |
| 2276 | @SdkConstant(SdkConstantType.FEATURE) |
| 2277 | public static final String FEATURE_LEANBACK = "android.software.leanback"; |
| 2278 | |
| 2279 | /** |
| 2280 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2281 | * {@link #hasSystemFeature}: The device supports only leanback UI. Only |
| 2282 | * applications designed for this experience should be run, though this is |
| 2283 | * not enforced by the system. |
Tim Kilbourn | f94b6a9 | 2014-03-07 15:13:48 -0800 | [diff] [blame] | 2284 | */ |
| 2285 | @SdkConstant(SdkConstantType.FEATURE) |
| 2286 | public static final String FEATURE_LEANBACK_ONLY = "android.software.leanback_only"; |
| 2287 | |
| 2288 | /** |
| 2289 | * Feature for {@link #getSystemAvailableFeatures} and |
Jae Seo | cfd861e | 2014-08-27 14:02:15 -0700 | [diff] [blame] | 2290 | * {@link #hasSystemFeature}: The device supports live TV and can display |
| 2291 | * contents from TV inputs implemented with the |
| 2292 | * {@link android.media.tv.TvInputService} API. |
| 2293 | */ |
| 2294 | @SdkConstant(SdkConstantType.FEATURE) |
| 2295 | public static final String FEATURE_LIVE_TV = "android.software.live_tv"; |
| 2296 | |
| 2297 | /** |
| 2298 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 2299 | * {@link #hasSystemFeature}: The device supports WiFi (802.11) networking. |
| 2300 | */ |
| 2301 | @SdkConstant(SdkConstantType.FEATURE) |
| 2302 | public static final String FEATURE_WIFI = "android.hardware.wifi"; |
| 2303 | |
| 2304 | /** |
Irfan Sheriff | 45b8b46 | 2011-09-07 11:24:16 -0700 | [diff] [blame] | 2305 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2306 | * {@link #hasSystemFeature}: The device supports Wi-Fi Direct networking. |
| 2307 | */ |
| 2308 | @SdkConstant(SdkConstantType.FEATURE) |
| 2309 | public static final String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct"; |
| 2310 | |
| 2311 | /** |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2312 | * Feature for {@link #getSystemAvailableFeatures} and |
Etan Cohen | 0413327 | 2016-10-26 11:22:06 -0700 | [diff] [blame] | 2313 | * {@link #hasSystemFeature}: The device supports Wi-Fi Aware. |
Etan Cohen | 20d329b | 2015-09-29 13:49:02 -0700 | [diff] [blame] | 2314 | */ |
| 2315 | @SdkConstant(SdkConstantType.FEATURE) |
Etan Cohen | 0413327 | 2016-10-26 11:22:06 -0700 | [diff] [blame] | 2316 | public static final String FEATURE_WIFI_AWARE = "android.hardware.wifi.aware"; |
Etan Cohen | 20d329b | 2015-09-29 13:49:02 -0700 | [diff] [blame] | 2317 | |
| 2318 | /** |
| 2319 | * Feature for {@link #getSystemAvailableFeatures} and |
Peter Qiu | 3d615e4 | 2017-08-07 20:13:32 +0000 | [diff] [blame] | 2320 | * {@link #hasSystemFeature}: The device supports Wi-Fi Passpoint and all |
| 2321 | * Passpoint related APIs in {@link WifiManager} are supported. Refer to |
| 2322 | * {@link WifiManager#addOrUpdatePasspointConfiguration} for more info. |
Peter Qiu | b99fe31 | 2017-05-05 13:48:47 -0700 | [diff] [blame] | 2323 | */ |
| 2324 | @SdkConstant(SdkConstantType.FEATURE) |
| 2325 | public static final String FEATURE_WIFI_PASSPOINT = "android.hardware.wifi.passpoint"; |
| 2326 | |
| 2327 | /** |
| 2328 | * Feature for {@link #getSystemAvailableFeatures} and |
Etan Cohen | 692e68e | 2017-09-14 15:42:01 -0700 | [diff] [blame] | 2329 | * {@link #hasSystemFeature}: The device supports Wi-Fi RTT (IEEE 802.11mc). |
| 2330 | * |
| 2331 | * @hide RTT_API |
| 2332 | */ |
| 2333 | @SdkConstant(SdkConstantType.FEATURE) |
| 2334 | public static final String FEATURE_WIFI_RTT = "android.hardware.wifi.rtt"; |
| 2335 | |
| 2336 | |
| 2337 | /** |
| 2338 | * Feature for {@link #getSystemAvailableFeatures} and |
Robert Quattlebaum | 87a7104 | 2017-05-15 15:45:20 -0700 | [diff] [blame] | 2339 | * {@link #hasSystemFeature}: The device supports LoWPAN networking. |
| 2340 | * @hide |
| 2341 | */ |
| 2342 | @SdkConstant(SdkConstantType.FEATURE) |
| 2343 | public static final String FEATURE_LOWPAN = "android.hardware.lowpan"; |
| 2344 | |
| 2345 | /** |
| 2346 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2347 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
Todd Kennedy | 7f95a00 | 2015-04-22 14:28:25 -0700 | [diff] [blame] | 2348 | * on a vehicle headunit. A headunit here is defined to be inside a |
| 2349 | * vehicle that may or may not be moving. A headunit uses either a |
| 2350 | * primary display in the center console and/or additional displays in |
| 2351 | * the instrument cluster or elsewhere in the vehicle. Headunit display(s) |
| 2352 | * have limited size and resolution. The user will likely be focused on |
| 2353 | * driving so limiting driver distraction is a primary concern. User input |
| 2354 | * can be a variety of hard buttons, touch, rotary controllers and even mouse- |
| 2355 | * like interfaces. |
| 2356 | */ |
| 2357 | @SdkConstant(SdkConstantType.FEATURE) |
| 2358 | public static final String FEATURE_AUTOMOTIVE = "android.hardware.type.automotive"; |
| 2359 | |
| 2360 | /** |
| 2361 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2362 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2363 | * on a television. Television here is defined to be a typical living |
| 2364 | * room television experience: displayed on a big screen, where the user |
| 2365 | * is sitting far away from it, and the dominant form of input will be |
| 2366 | * something like a DPAD, not through touch or mouse. |
Tim Kilbourn | f94b6a9 | 2014-03-07 15:13:48 -0800 | [diff] [blame] | 2367 | * @deprecated use {@link #FEATURE_LEANBACK} instead. |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2368 | */ |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 2369 | @Deprecated |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2370 | @SdkConstant(SdkConstantType.FEATURE) |
| 2371 | public static final String FEATURE_TELEVISION = "android.hardware.type.television"; |
| 2372 | |
| 2373 | /** |
Justin Koh | b5731f091c | 2014-02-13 16:06:59 -0800 | [diff] [blame] | 2374 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2375 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
| 2376 | * on a watch. A watch here is defined to be a device worn on the body, perhaps on |
| 2377 | * the wrist. The user is very close when interacting with the device. |
| 2378 | */ |
| 2379 | @SdkConstant(SdkConstantType.FEATURE) |
| 2380 | public static final String FEATURE_WATCH = "android.hardware.type.watch"; |
| 2381 | |
| 2382 | /** |
Ralph Nathan | b8e0dee | 2017-01-24 15:24:59 -0800 | [diff] [blame] | 2383 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2384 | * {@link #hasSystemFeature}: This is a device for IoT and may not have an UI. An embedded |
| 2385 | * device is defined as a full stack Android device with or without a display and no |
| 2386 | * user-installable apps. |
| 2387 | */ |
| 2388 | @SdkConstant(SdkConstantType.FEATURE) |
| 2389 | public static final String FEATURE_EMBEDDED = "android.hardware.type.embedded"; |
| 2390 | |
| 2391 | /** |
Dennis Kempin | 7345ed5 | 2017-04-14 16:40:56 -0700 | [diff] [blame] | 2392 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2393 | * {@link #hasSystemFeature}: This is a device dedicated to be primarily used |
| 2394 | * with keyboard, mouse or touchpad. This includes traditional desktop |
| 2395 | * computers, laptops and variants such as convertibles or detachables. |
| 2396 | * Due to the larger screen, the device will most likely use the |
| 2397 | * {@link #FEATURE_FREEFORM_WINDOW_MANAGEMENT} feature as well. |
| 2398 | */ |
| 2399 | @SdkConstant(SdkConstantType.FEATURE) |
| 2400 | public static final String FEATURE_PC = "android.hardware.type.pc"; |
| 2401 | |
| 2402 | /** |
Adam Lesinski | 3d9bcb9 | 2014-02-18 14:05:14 -0800 | [diff] [blame] | 2403 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2404 | * The device supports printing. |
| 2405 | */ |
| 2406 | @SdkConstant(SdkConstantType.FEATURE) |
| 2407 | public static final String FEATURE_PRINTING = "android.software.print"; |
| 2408 | |
| 2409 | /** |
| 2410 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Eugene Susla | 7c3eef2 | 2017-03-10 14:25:58 -0800 | [diff] [blame] | 2411 | * The device supports {@link android.companion.CompanionDeviceManager#associate associating} |
| 2412 | * with devices via {@link android.companion.CompanionDeviceManager}. |
| 2413 | */ |
| 2414 | @SdkConstant(SdkConstantType.FEATURE) |
| 2415 | public static final String FEATURE_COMPANION_DEVICE_SETUP |
| 2416 | = "android.software.companion_device_setup"; |
| 2417 | |
| 2418 | /** |
| 2419 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Adam Lesinski | 3d9bcb9 | 2014-02-18 14:05:14 -0800 | [diff] [blame] | 2420 | * The device can perform backup and restore operations on installed applications. |
| 2421 | */ |
| 2422 | @SdkConstant(SdkConstantType.FEATURE) |
| 2423 | public static final String FEATURE_BACKUP = "android.software.backup"; |
| 2424 | |
| 2425 | /** |
Vladislav Kaznacheev | d303b25 | 2015-10-27 17:30:58 -0700 | [diff] [blame] | 2426 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2427 | * {@link #hasSystemFeature}: The device supports freeform window management. |
| 2428 | * Windows have title bars and can be moved and resized. |
| 2429 | */ |
Filip Gruszczynski | 811dc3b | 2015-11-23 12:34:22 -0800 | [diff] [blame] | 2430 | // If this feature is present, you also need to set |
| 2431 | // com.android.internal.R.config_freeformWindowManagement to true in your configuration overlay. |
Vladislav Kaznacheev | d303b25 | 2015-10-27 17:30:58 -0700 | [diff] [blame] | 2432 | @SdkConstant(SdkConstantType.FEATURE) |
| 2433 | public static final String FEATURE_FREEFORM_WINDOW_MANAGEMENT |
| 2434 | = "android.software.freeform_window_management"; |
| 2435 | |
| 2436 | /** |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 2437 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Wale Ogunwale | fbe12c4 | 2015-12-06 16:23:50 -0800 | [diff] [blame] | 2438 | * The device supports picture-in-picture multi-window mode. |
| 2439 | */ |
| 2440 | @SdkConstant(SdkConstantType.FEATURE) |
| 2441 | public static final String FEATURE_PICTURE_IN_PICTURE = "android.software.picture_in_picture"; |
| 2442 | |
| 2443 | /** |
| 2444 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Andrii Kulian | 1981f5f | 2017-04-07 16:23:12 -0700 | [diff] [blame] | 2445 | * The device supports running activities on secondary displays. |
| 2446 | */ |
| 2447 | @SdkConstant(SdkConstantType.FEATURE) |
| 2448 | public static final String FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS |
| 2449 | = "android.software.activities_on_secondary_displays"; |
| 2450 | |
| 2451 | /** |
| 2452 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Amith Yamasani | 1d65327 | 2014-09-11 17:56:05 -0700 | [diff] [blame] | 2453 | * The device supports creating secondary users and managed profiles via |
| 2454 | * {@link DevicePolicyManager}. |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 2455 | */ |
| 2456 | @SdkConstant(SdkConstantType.FEATURE) |
Amith Yamasani | 1d65327 | 2014-09-11 17:56:05 -0700 | [diff] [blame] | 2457 | public static final String FEATURE_MANAGED_USERS = "android.software.managed_users"; |
| 2458 | |
| 2459 | /** |
| 2460 | * @hide |
| 2461 | * TODO: Remove after dependencies updated b/17392243 |
| 2462 | */ |
| 2463 | public static final String FEATURE_MANAGED_PROFILES = "android.software.managed_users"; |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 2464 | |
| 2465 | /** |
Ben Murdoch | f564c7f | 2014-05-20 18:58:06 +0100 | [diff] [blame] | 2466 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Adam Connors | 19ccb5f | 2014-09-08 17:31:50 +0100 | [diff] [blame] | 2467 | * The device supports verified boot. |
| 2468 | */ |
| 2469 | @SdkConstant(SdkConstantType.FEATURE) |
| 2470 | public static final String FEATURE_VERIFIED_BOOT = "android.software.verified_boot"; |
| 2471 | |
| 2472 | /** |
| 2473 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2474 | * The device supports secure removal of users. When a user is deleted the data associated |
| 2475 | * with that user is securely deleted and no longer available. |
| 2476 | */ |
| 2477 | @SdkConstant(SdkConstantType.FEATURE) |
| 2478 | public static final String FEATURE_SECURELY_REMOVES_USERS |
| 2479 | = "android.software.securely_removes_users"; |
| 2480 | |
Jeff Sharkey | b92b05b | 2016-01-28 09:50:00 -0700 | [diff] [blame] | 2481 | /** {@hide} */ |
Jeff Sharkey | 8eb783b | 2018-01-04 16:46:48 -0700 | [diff] [blame] | 2482 | @TestApi |
Jeff Sharkey | b92b05b | 2016-01-28 09:50:00 -0700 | [diff] [blame] | 2483 | @SdkConstant(SdkConstantType.FEATURE) |
| 2484 | public static final String FEATURE_FILE_BASED_ENCRYPTION |
| 2485 | = "android.software.file_based_encryption"; |
| 2486 | |
Jeff Sharkey | 8eb783b | 2018-01-04 16:46:48 -0700 | [diff] [blame] | 2487 | /** {@hide} */ |
| 2488 | @TestApi |
| 2489 | @SdkConstant(SdkConstantType.FEATURE) |
| 2490 | public static final String FEATURE_ADOPTABLE_STORAGE |
| 2491 | = "android.software.adoptable_storage"; |
| 2492 | |
Adam Connors | 19ccb5f | 2014-09-08 17:31:50 +0100 | [diff] [blame] | 2493 | /** |
| 2494 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Ben Murdoch | 422c7a5 | 2014-05-16 13:45:47 +0100 | [diff] [blame] | 2495 | * The device has a full implementation of the android.webkit.* APIs. Devices |
| 2496 | * lacking this feature will not have a functioning WebView implementation. |
| 2497 | */ |
| 2498 | @SdkConstant(SdkConstantType.FEATURE) |
| 2499 | public static final String FEATURE_WEBVIEW = "android.software.webview"; |
| 2500 | |
| 2501 | /** |
Joe LaPenna | 4bb015d | 2014-07-04 17:15:54 -0700 | [diff] [blame] | 2502 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2503 | * {@link #hasSystemFeature}: This device supports ethernet. |
Joe LaPenna | 4bb015d | 2014-07-04 17:15:54 -0700 | [diff] [blame] | 2504 | */ |
| 2505 | @SdkConstant(SdkConstantType.FEATURE) |
| 2506 | public static final String FEATURE_ETHERNET = "android.hardware.ethernet"; |
| 2507 | |
| 2508 | /** |
Yuncheol Heo | a0c4a06 | 2014-07-10 20:49:27 +0900 | [diff] [blame] | 2509 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2510 | * {@link #hasSystemFeature}: This device supports HDMI-CEC. |
| 2511 | * @hide |
| 2512 | */ |
| 2513 | @SdkConstant(SdkConstantType.FEATURE) |
| 2514 | public static final String FEATURE_HDMI_CEC = "android.hardware.hdmi.cec"; |
| 2515 | |
| 2516 | /** |
Michael Wright | 6faa675 | 2014-09-05 17:57:44 -0700 | [diff] [blame] | 2517 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2518 | * The device has all of the inputs necessary to be considered a compatible game controller, or |
| 2519 | * includes a compatible game controller in the box. |
| 2520 | */ |
| 2521 | @SdkConstant(SdkConstantType.FEATURE) |
| 2522 | public static final String FEATURE_GAMEPAD = "android.hardware.gamepad"; |
| 2523 | |
Mike Lockwood | 5781cd5 | 2015-03-27 13:23:41 -0700 | [diff] [blame] | 2524 | /** |
| 2525 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2526 | * The device has a full implementation of the android.media.midi.* APIs. |
| 2527 | */ |
| 2528 | @SdkConstant(SdkConstantType.FEATURE) |
| 2529 | public static final String FEATURE_MIDI = "android.software.midi"; |
Michael Wright | 6faa675 | 2014-09-05 17:57:44 -0700 | [diff] [blame] | 2530 | |
| 2531 | /** |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2532 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Ruben Brunk | 927d345 | 2016-05-02 19:30:51 -0700 | [diff] [blame] | 2533 | * The device implements an optimized mode for virtual reality (VR) applications that handles |
| 2534 | * stereoscopic rendering of notifications, and disables most monocular system UI components |
| 2535 | * while a VR application has user focus. |
| 2536 | * Devices declaring this feature must include an application implementing a |
| 2537 | * {@link android.service.vr.VrListenerService} that can be targeted by VR applications via |
| 2538 | * {@link android.app.Activity#setVrModeEnabled}. |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2539 | */ |
| 2540 | @SdkConstant(SdkConstantType.FEATURE) |
| 2541 | public static final String FEATURE_VR_MODE = "android.software.vr.mode"; |
| 2542 | |
| 2543 | /** |
Ruben Brunk | 31d80ea | 2016-01-25 20:14:08 -0800 | [diff] [blame] | 2544 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Ruben Brunk | 927d345 | 2016-05-02 19:30:51 -0700 | [diff] [blame] | 2545 | * The device implements {@link #FEATURE_VR_MODE} but additionally meets extra CDD requirements |
| 2546 | * to provide a high-quality VR experience. In general, devices declaring this feature will |
| 2547 | * additionally: |
| 2548 | * <ul> |
| 2549 | * <li>Deliver consistent performance at a high framerate over an extended period of time |
| 2550 | * for typical VR application CPU/GPU workloads with a minimal number of frame drops for VR |
| 2551 | * applications that have called |
| 2552 | * {@link android.view.Window#setSustainedPerformanceMode}.</li> |
| 2553 | * <li>Implement {@link #FEATURE_HIFI_SENSORS} and have a low sensor latency.</li> |
| 2554 | * <li>Include optimizations to lower display persistence while running VR applications.</li> |
| 2555 | * <li>Implement an optimized render path to minimize latency to draw to the device's main |
| 2556 | * display.</li> |
| 2557 | * <li>Include the following EGL extensions: EGL_ANDROID_create_native_client_buffer, |
| 2558 | * EGL_ANDROID_front_buffer_auto_refresh, EGL_EXT_protected_content, |
| 2559 | * EGL_KHR_mutable_render_buffer, EGL_KHR_reusable_sync, and EGL_KHR_wait_sync.</li> |
| 2560 | * <li>Provide at least one CPU core that is reserved for use solely by the top, foreground |
| 2561 | * VR application process for critical render threads while such an application is |
| 2562 | * running.</li> |
| 2563 | * </ul> |
Ruben Brunk | 31d80ea | 2016-01-25 20:14:08 -0800 | [diff] [blame] | 2564 | */ |
| 2565 | @SdkConstant(SdkConstantType.FEATURE) |
| 2566 | public static final String FEATURE_VR_MODE_HIGH_PERFORMANCE |
| 2567 | = "android.hardware.vr.high_performance"; |
| 2568 | |
| 2569 | /** |
Craig Donner | 279dd66 | 2017-03-15 17:10:50 -0700 | [diff] [blame] | 2570 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Svet Ganov | 43574b0 | 2017-04-12 09:25:20 -0700 | [diff] [blame] | 2571 | * The device supports autofill of user credentials, addresses, credit cards, etc |
| 2572 | * via integration with {@link android.service.autofill.AutofillService autofill |
| 2573 | * providers}. |
| 2574 | */ |
| 2575 | @SdkConstant(SdkConstantType.FEATURE) |
| 2576 | public static final String FEATURE_AUTOFILL = "android.software.autofill"; |
| 2577 | |
| 2578 | /** |
| 2579 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Craig Donner | 279dd66 | 2017-03-15 17:10:50 -0700 | [diff] [blame] | 2580 | * The device implements headtracking suitable for a VR device. |
| 2581 | */ |
| 2582 | @SdkConstant(SdkConstantType.FEATURE) |
| 2583 | public static final String FEATURE_VR_HEADTRACKING = "android.hardware.vr.headtracking"; |
| 2584 | |
| 2585 | /** |
Dianne Hackborn | e83cefce | 2010-02-04 17:38:14 -0800 | [diff] [blame] | 2586 | * Action to external storage service to clean out removed apps. |
| 2587 | * @hide |
| 2588 | */ |
| 2589 | public static final String ACTION_CLEAN_EXTERNAL_STORAGE |
| 2590 | = "android.content.pm.CLEAN_EXTERNAL_STORAGE"; |
Oscar Montemayor | 1228d0a | 2010-01-28 12:01:44 -0800 | [diff] [blame] | 2591 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2592 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 2593 | * Extra field name for the URI to a verification file. Passed to a package |
| 2594 | * verifier. |
| 2595 | * |
| 2596 | * @hide |
| 2597 | */ |
| 2598 | public static final String EXTRA_VERIFICATION_URI = "android.content.pm.extra.VERIFICATION_URI"; |
| 2599 | |
| 2600 | /** |
| 2601 | * Extra field name for the ID of a package pending verification. Passed to |
| 2602 | * a package verifier and is used to call back to |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 2603 | * {@link PackageManager#verifyPendingInstall(int, int)} |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 2604 | */ |
| 2605 | public static final String EXTRA_VERIFICATION_ID = "android.content.pm.extra.VERIFICATION_ID"; |
| 2606 | |
| 2607 | /** |
| 2608 | * Extra field name for the package identifier which is trying to install |
| 2609 | * the package. |
| 2610 | * |
| 2611 | * @hide |
| 2612 | */ |
| 2613 | public static final String EXTRA_VERIFICATION_INSTALLER_PACKAGE |
| 2614 | = "android.content.pm.extra.VERIFICATION_INSTALLER_PACKAGE"; |
| 2615 | |
| 2616 | /** |
| 2617 | * Extra field name for the requested install flags for a package pending |
| 2618 | * verification. Passed to a package verifier. |
| 2619 | * |
| 2620 | * @hide |
| 2621 | */ |
| 2622 | public static final String EXTRA_VERIFICATION_INSTALL_FLAGS |
| 2623 | = "android.content.pm.extra.VERIFICATION_INSTALL_FLAGS"; |
| 2624 | |
| 2625 | /** |
rich cannings | 13d428e | 2012-09-13 13:43:07 -0700 | [diff] [blame] | 2626 | * Extra field name for the uid of who is requesting to install |
| 2627 | * the package. |
| 2628 | * |
| 2629 | * @hide |
| 2630 | */ |
| 2631 | public static final String EXTRA_VERIFICATION_INSTALLER_UID |
| 2632 | = "android.content.pm.extra.VERIFICATION_INSTALLER_UID"; |
| 2633 | |
| 2634 | /** |
| 2635 | * Extra field name for the package name of a package pending verification. |
| 2636 | * |
| 2637 | * @hide |
| 2638 | */ |
| 2639 | public static final String EXTRA_VERIFICATION_PACKAGE_NAME |
| 2640 | = "android.content.pm.extra.VERIFICATION_PACKAGE_NAME"; |
| 2641 | /** |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 2642 | * Extra field name for the result of a verification, either |
| 2643 | * {@link #VERIFICATION_ALLOW}, or {@link #VERIFICATION_REJECT}. |
| 2644 | * Passed to package verifiers after a package is verified. |
| 2645 | */ |
| 2646 | public static final String EXTRA_VERIFICATION_RESULT |
| 2647 | = "android.content.pm.extra.VERIFICATION_RESULT"; |
| 2648 | |
| 2649 | /** |
rich cannings | 13d428e | 2012-09-13 13:43:07 -0700 | [diff] [blame] | 2650 | * Extra field name for the version code of a package pending verification. |
Dianne Hackborn | 3accca0 | 2013-09-20 09:32:11 -0700 | [diff] [blame] | 2651 | * @deprecated Use {@link #EXTRA_VERIFICATION_LONG_VERSION_CODE} instead. |
| 2652 | * @hide |
| 2653 | */ |
| 2654 | @Deprecated |
| 2655 | public static final String EXTRA_VERIFICATION_VERSION_CODE |
| 2656 | = "android.content.pm.extra.VERIFICATION_VERSION_CODE"; |
| 2657 | |
| 2658 | /** |
| 2659 | * Extra field name for the long version code of a package pending verification. |
rich cannings | 13d428e | 2012-09-13 13:43:07 -0700 | [diff] [blame] | 2660 | * |
| 2661 | * @hide |
| 2662 | */ |
Dianne Hackborn | 3accca0 | 2013-09-20 09:32:11 -0700 | [diff] [blame] | 2663 | public static final String EXTRA_VERIFICATION_LONG_VERSION_CODE = |
| 2664 | "android.content.pm.extra.VERIFICATION_LONG_VERSION_CODE"; |
rich cannings | 13d428e | 2012-09-13 13:43:07 -0700 | [diff] [blame] | 2665 | |
| 2666 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 2667 | * Extra field name for the ID of a intent filter pending verification. |
| 2668 | * Passed to an intent filter verifier and is used to call back to |
| 2669 | * {@link #verifyIntentFilter} |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 2670 | * |
| 2671 | * @hide |
| 2672 | */ |
| 2673 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_ID |
| 2674 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_ID"; |
| 2675 | |
| 2676 | /** |
| 2677 | * Extra field name for the scheme used for an intent filter pending verification. Passed to |
| 2678 | * an intent filter verifier and is used to construct the URI to verify against. |
| 2679 | * |
| 2680 | * Usually this is "https" |
| 2681 | * |
| 2682 | * @hide |
| 2683 | */ |
| 2684 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_URI_SCHEME |
| 2685 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_URI_SCHEME"; |
| 2686 | |
| 2687 | /** |
| 2688 | * Extra field name for the host names to be used for an intent filter pending verification. |
| 2689 | * Passed to an intent filter verifier and is used to construct the URI to verify the |
| 2690 | * intent filter. |
| 2691 | * |
| 2692 | * This is a space delimited list of hosts. |
| 2693 | * |
| 2694 | * @hide |
| 2695 | */ |
| 2696 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_HOSTS |
| 2697 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_HOSTS"; |
| 2698 | |
| 2699 | /** |
| 2700 | * Extra field name for the package name to be used for an intent filter pending verification. |
| 2701 | * Passed to an intent filter verifier and is used to check the verification responses coming |
| 2702 | * from the hosts. Each host response will need to include the package name of APK containing |
| 2703 | * the intent filter. |
| 2704 | * |
| 2705 | * @hide |
| 2706 | */ |
| 2707 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_PACKAGE_NAME |
| 2708 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_PACKAGE_NAME"; |
| 2709 | |
| 2710 | /** |
| 2711 | * The action used to request that the user approve a permission request |
| 2712 | * from the application. |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2713 | * |
| 2714 | * @hide |
| 2715 | */ |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 2716 | @SystemApi |
| 2717 | public static final String ACTION_REQUEST_PERMISSIONS = |
| 2718 | "android.content.pm.action.REQUEST_PERMISSIONS"; |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2719 | |
| 2720 | /** |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 2721 | * The names of the requested permissions. |
| 2722 | * <p> |
| 2723 | * <strong>Type:</strong> String[] |
| 2724 | * </p> |
| 2725 | * |
| 2726 | * @hide |
| 2727 | */ |
| 2728 | @SystemApi |
| 2729 | public static final String EXTRA_REQUEST_PERMISSIONS_NAMES = |
| 2730 | "android.content.pm.extra.REQUEST_PERMISSIONS_NAMES"; |
| 2731 | |
| 2732 | /** |
| 2733 | * The results from the permissions request. |
| 2734 | * <p> |
| 2735 | * <strong>Type:</strong> int[] of #PermissionResult |
| 2736 | * </p> |
| 2737 | * |
| 2738 | * @hide |
| 2739 | */ |
| 2740 | @SystemApi |
| 2741 | public static final String EXTRA_REQUEST_PERMISSIONS_RESULTS |
| 2742 | = "android.content.pm.extra.REQUEST_PERMISSIONS_RESULTS"; |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2743 | |
| 2744 | /** |
Jeff Sharkey | bb58067 | 2014-07-10 12:10:25 -0700 | [diff] [blame] | 2745 | * String extra for {@link PackageInstallObserver} in the 'extras' Bundle in case of |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2746 | * {@link #INSTALL_FAILED_DUPLICATE_PERMISSION}. This extra names the package which provides |
| 2747 | * the existing definition for the permission. |
| 2748 | * @hide |
| 2749 | */ |
| 2750 | public static final String EXTRA_FAILURE_EXISTING_PACKAGE |
| 2751 | = "android.content.pm.extra.FAILURE_EXISTING_PACKAGE"; |
| 2752 | |
| 2753 | /** |
Jeff Sharkey | bb58067 | 2014-07-10 12:10:25 -0700 | [diff] [blame] | 2754 | * String extra for {@link PackageInstallObserver} in the 'extras' Bundle in case of |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2755 | * {@link #INSTALL_FAILED_DUPLICATE_PERMISSION}. This extra names the permission that is |
| 2756 | * being redundantly defined by the package being installed. |
| 2757 | * @hide |
| 2758 | */ |
| 2759 | public static final String EXTRA_FAILURE_EXISTING_PERMISSION |
| 2760 | = "android.content.pm.extra.FAILURE_EXISTING_PERMISSION"; |
| 2761 | |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2762 | /** |
| 2763 | * Permission flag: The permission is set in its current state |
| 2764 | * by the user and apps can still request it at runtime. |
| 2765 | * |
| 2766 | * @hide |
| 2767 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2768 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2769 | public static final int FLAG_PERMISSION_USER_SET = 1 << 0; |
| 2770 | |
| 2771 | /** |
| 2772 | * Permission flag: The permission is set in its current state |
| 2773 | * by the user and it is fixed, i.e. apps can no longer request |
| 2774 | * this permission. |
| 2775 | * |
| 2776 | * @hide |
| 2777 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2778 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2779 | public static final int FLAG_PERMISSION_USER_FIXED = 1 << 1; |
| 2780 | |
| 2781 | /** |
| 2782 | * Permission flag: The permission is set in its current state |
| 2783 | * by device policy and neither apps nor the user can change |
| 2784 | * its state. |
| 2785 | * |
| 2786 | * @hide |
| 2787 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2788 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2789 | public static final int FLAG_PERMISSION_POLICY_FIXED = 1 << 2; |
| 2790 | |
| 2791 | /** |
| 2792 | * Permission flag: The permission is set in a granted state but |
| 2793 | * access to resources it guards is restricted by other means to |
| 2794 | * enable revoking a permission on legacy apps that do not support |
| 2795 | * runtime permissions. If this permission is upgraded to runtime |
| 2796 | * because the app was updated to support runtime permissions, the |
| 2797 | * the permission will be revoked in the upgrade process. |
| 2798 | * |
| 2799 | * @hide |
| 2800 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2801 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2802 | public static final int FLAG_PERMISSION_REVOKE_ON_UPGRADE = 1 << 3; |
| 2803 | |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 2804 | /** |
| 2805 | * Permission flag: The permission is set in its current state |
| 2806 | * because the app is a component that is a part of the system. |
| 2807 | * |
| 2808 | * @hide |
| 2809 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2810 | @SystemApi |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 2811 | public static final int FLAG_PERMISSION_SYSTEM_FIXED = 1 << 4; |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2812 | |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 2813 | /** |
| 2814 | * Permission flag: The permission is granted by default because it |
| 2815 | * enables app functionality that is expected to work out-of-the-box |
| 2816 | * for providing a smooth user experience. For example, the phone app |
| 2817 | * is expected to have the phone permission. |
| 2818 | * |
| 2819 | * @hide |
| 2820 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2821 | @SystemApi |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 2822 | public static final int FLAG_PERMISSION_GRANTED_BY_DEFAULT = 1 << 5; |
| 2823 | |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2824 | /** |
Svet Ganov | 9c165d7 | 2015-12-01 19:52:26 -0800 | [diff] [blame] | 2825 | * Permission flag: The permission has to be reviewed before any of |
| 2826 | * the app components can run. |
| 2827 | * |
| 2828 | * @hide |
| 2829 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2830 | @SystemApi |
Svet Ganov | 9c165d7 | 2015-12-01 19:52:26 -0800 | [diff] [blame] | 2831 | public static final int FLAG_PERMISSION_REVIEW_REQUIRED = 1 << 6; |
| 2832 | |
| 2833 | /** |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2834 | * Mask for all permission flags. |
| 2835 | * |
| 2836 | * @hide |
| 2837 | */ |
| 2838 | @SystemApi |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 2839 | public static final int MASK_PERMISSION_FLAGS = 0xFF; |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2840 | |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2841 | /** |
Svet Ganov | d7b1f411 | 2016-02-09 18:49:23 -0800 | [diff] [blame] | 2842 | * This is a library that contains components apps can invoke. For |
| 2843 | * example, a services for apps to bind to, or standard chooser UI, |
| 2844 | * etc. This library is versioned and backwards compatible. Clients |
| 2845 | * should check its version via {@link android.ext.services.Version |
| 2846 | * #getVersionCode()} and avoid calling APIs added in later versions. |
| 2847 | * |
| 2848 | * @hide |
| 2849 | */ |
| 2850 | public static final String SYSTEM_SHARED_LIBRARY_SERVICES = "android.ext.services"; |
| 2851 | |
| 2852 | /** |
| 2853 | * This is a library that contains components apps can dynamically |
| 2854 | * load. For example, new widgets, helper classes, etc. This library |
| 2855 | * is versioned and backwards compatible. Clients should check its |
| 2856 | * version via {@link android.ext.shared.Version#getVersionCode()} |
| 2857 | * and avoid calling APIs added in later versions. |
| 2858 | * |
| 2859 | * @hide |
| 2860 | */ |
| 2861 | public static final String SYSTEM_SHARED_LIBRARY_SHARED = "android.ext.shared"; |
| 2862 | |
| 2863 | /** |
Brian Carlstrom | ca82e61 | 2016-04-19 23:16:08 -0700 | [diff] [blame] | 2864 | * Used when starting a process for an Activity. |
| 2865 | * |
| 2866 | * @hide |
| 2867 | */ |
| 2868 | public static final int NOTIFY_PACKAGE_USE_ACTIVITY = 0; |
| 2869 | |
| 2870 | /** |
| 2871 | * Used when starting a process for a Service. |
| 2872 | * |
| 2873 | * @hide |
| 2874 | */ |
| 2875 | public static final int NOTIFY_PACKAGE_USE_SERVICE = 1; |
| 2876 | |
| 2877 | /** |
| 2878 | * Used when moving a Service to the foreground. |
| 2879 | * |
| 2880 | * @hide |
| 2881 | */ |
| 2882 | public static final int NOTIFY_PACKAGE_USE_FOREGROUND_SERVICE = 2; |
| 2883 | |
| 2884 | /** |
| 2885 | * Used when starting a process for a BroadcastReceiver. |
| 2886 | * |
| 2887 | * @hide |
| 2888 | */ |
| 2889 | public static final int NOTIFY_PACKAGE_USE_BROADCAST_RECEIVER = 3; |
| 2890 | |
| 2891 | /** |
| 2892 | * Used when starting a process for a ContentProvider. |
| 2893 | * |
| 2894 | * @hide |
| 2895 | */ |
| 2896 | public static final int NOTIFY_PACKAGE_USE_CONTENT_PROVIDER = 4; |
| 2897 | |
| 2898 | /** |
| 2899 | * Used when starting a process for a BroadcastReceiver. |
| 2900 | * |
| 2901 | * @hide |
| 2902 | */ |
| 2903 | public static final int NOTIFY_PACKAGE_USE_BACKUP = 5; |
| 2904 | |
| 2905 | /** |
| 2906 | * Used with Context.getClassLoader() across Android packages. |
| 2907 | * |
| 2908 | * @hide |
| 2909 | */ |
| 2910 | public static final int NOTIFY_PACKAGE_USE_CROSS_PACKAGE = 6; |
| 2911 | |
| 2912 | /** |
| 2913 | * Used when starting a package within a process for Instrumentation. |
| 2914 | * |
| 2915 | * @hide |
| 2916 | */ |
| 2917 | public static final int NOTIFY_PACKAGE_USE_INSTRUMENTATION = 7; |
| 2918 | |
| 2919 | /** |
| 2920 | * Total number of usage reasons. |
| 2921 | * |
| 2922 | * @hide |
| 2923 | */ |
| 2924 | public static final int NOTIFY_PACKAGE_USE_REASONS_COUNT = 8; |
| 2925 | |
| 2926 | /** |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 2927 | * Constant for specifying the highest installed package version code. |
| 2928 | */ |
| 2929 | public static final int VERSION_CODE_HIGHEST = -1; |
| 2930 | |
| 2931 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2932 | * Retrieve overall information about an application package that is |
| 2933 | * installed on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2934 | * |
| 2935 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 2936 | * desired package. |
| 2937 | * @param flags Additional option flags to modify the data returned. |
| 2938 | * @return A PackageInfo object containing information about the package. If |
| 2939 | * flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if the package |
| 2940 | * is not found in the list of installed applications, the package |
| 2941 | * information is retrieved from the list of uninstalled |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2942 | * applications (which includes installed applications as well as |
| 2943 | * applications with data directory i.e. applications which had been |
| 2944 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2945 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2946 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2947 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2948 | public abstract PackageInfo getPackageInfo(String packageName, @PackageInfoFlags int flags) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2949 | throws NameNotFoundException; |
| 2950 | |
| 2951 | /** |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 2952 | * Retrieve overall information about an application package that is |
| 2953 | * installed on the system. This method can be used for retrieving |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 2954 | * information about packages for which multiple versions can be installed |
| 2955 | * at the time. Currently only packages hosting static shared libraries can |
| 2956 | * have multiple installed versions. The method can also be used to get info |
| 2957 | * for a package that has a single version installed by passing |
| 2958 | * {@link #VERSION_CODE_HIGHEST} in the {@link VersionedPackage} |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 2959 | * constructor. |
| 2960 | * |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 2961 | * @param versionedPackage The versioned package for which to query. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 2962 | * @param flags Additional option flags to modify the data returned. |
| 2963 | * @return A PackageInfo object containing information about the package. If |
| 2964 | * flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if the package |
| 2965 | * is not found in the list of installed applications, the package |
| 2966 | * information is retrieved from the list of uninstalled |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 2967 | * applications (which includes installed applications as well as |
| 2968 | * applications with data directory i.e. applications which had been |
| 2969 | * deleted with {@code DONT_DELETE_DATA} flag set). |
| 2970 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2971 | * found on the system. |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 2972 | */ |
| 2973 | public abstract PackageInfo getPackageInfo(VersionedPackage versionedPackage, |
| 2974 | @PackageInfoFlags int flags) throws NameNotFoundException; |
| 2975 | |
| 2976 | /** |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2977 | * Retrieve overall information about an application package that is |
| 2978 | * installed on the system. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2979 | * |
| 2980 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 2981 | * desired package. |
| 2982 | * @param flags Additional option flags to modify the data returned. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2983 | * @param userId The user id. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 2984 | * @return A PackageInfo object containing information about the package. If |
| 2985 | * flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if the package |
| 2986 | * is not found in the list of installed applications, the package |
| 2987 | * information is retrieved from the list of uninstalled |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2988 | * applications (which includes installed applications as well as |
| 2989 | * applications with data directory i.e. applications which had been |
| 2990 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2991 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2992 | * found on the system. |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 2993 | * @hide |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2994 | */ |
| 2995 | @RequiresPermission(Manifest.permission.INTERACT_ACROSS_USERS) |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2996 | public abstract PackageInfo getPackageInfoAsUser(String packageName, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2997 | @PackageInfoFlags int flags, @UserIdInt int userId) throws NameNotFoundException; |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2998 | |
| 2999 | /** |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 3000 | * Map from the current package names in use on the device to whatever |
| 3001 | * the current canonical name of that package is. |
| 3002 | * @param names Array of current names to be mapped. |
| 3003 | * @return Returns an array of the same size as the original, containing |
| 3004 | * the canonical name for each package. |
| 3005 | */ |
| 3006 | public abstract String[] currentToCanonicalPackageNames(String[] names); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3007 | |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 3008 | /** |
| 3009 | * Map from a packages canonical name to the current name in use on the device. |
| 3010 | * @param names Array of new names to be mapped. |
| 3011 | * @return Returns an array of the same size as the original, containing |
| 3012 | * the current name for each package. |
| 3013 | */ |
| 3014 | public abstract String[] canonicalToCurrentPackageNames(String[] names); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3015 | |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 3016 | /** |
Andrew Solovay | 5ae1335 | 2014-06-06 12:23:09 -0700 | [diff] [blame] | 3017 | * Returns a "good" intent to launch a front-door activity in a package. |
| 3018 | * This is used, for example, to implement an "open" button when browsing |
| 3019 | * through packages. The current implementation looks first for a main |
| 3020 | * activity in the category {@link Intent#CATEGORY_INFO}, and next for a |
| 3021 | * main activity in the category {@link Intent#CATEGORY_LAUNCHER}. Returns |
| 3022 | * <code>null</code> if neither are found. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3023 | * |
| 3024 | * @param packageName The name of the package to inspect. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3025 | * |
Andrew Solovay | 5ae1335 | 2014-06-06 12:23:09 -0700 | [diff] [blame] | 3026 | * @return A fully-qualified {@link Intent} that can be used to launch the |
| 3027 | * main activity in the package. Returns <code>null</code> if the package |
| 3028 | * does not contain such an activity, or if <em>packageName</em> is not |
Ihab Awad | 1ec6888 | 2014-09-12 11:09:01 -0700 | [diff] [blame] | 3029 | * recognized. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3030 | */ |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 3031 | public abstract @Nullable Intent getLaunchIntentForPackage(@NonNull String packageName); |
Mihai Preda | eae850c | 2009-05-13 10:13:48 +0200 | [diff] [blame] | 3032 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3033 | /** |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 3034 | * Return a "good" intent to launch a front-door Leanback activity in a |
| 3035 | * package, for use for example to implement an "open" button when browsing |
| 3036 | * through packages. The current implementation will look for a main |
| 3037 | * activity in the category {@link Intent#CATEGORY_LEANBACK_LAUNCHER}, or |
| 3038 | * return null if no main leanback activities are found. |
Adam Connors | 551c078 | 2014-06-05 12:13:03 +0100 | [diff] [blame] | 3039 | * |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 3040 | * @param packageName The name of the package to inspect. |
| 3041 | * @return Returns either a fully-qualified Intent that can be used to launch |
| 3042 | * the main Leanback activity in the package, or null if the package |
| 3043 | * does not contain such an activity. |
| 3044 | */ |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 3045 | public abstract @Nullable Intent getLeanbackLaunchIntentForPackage(@NonNull String packageName); |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 3046 | |
| 3047 | /** |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 3048 | * Return an array of all of the POSIX secondary group IDs that have been |
| 3049 | * assigned to the given package. |
| 3050 | * <p> |
| 3051 | * Note that the same package may have different GIDs under different |
| 3052 | * {@link UserHandle} on the same device. |
Adam Connors | 551c078 | 2014-06-05 12:13:03 +0100 | [diff] [blame] | 3053 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3054 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 3055 | * desired package. |
| 3056 | * @return Returns an int array of the assigned GIDs, or null if there are |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 3057 | * none. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3058 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3059 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3060 | */ |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 3061 | public abstract int[] getPackageGids(@NonNull String packageName) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3062 | throws NameNotFoundException; |
| 3063 | |
| 3064 | /** |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 3065 | * Return an array of all of the POSIX secondary group IDs that have been |
| 3066 | * assigned to the given package. |
| 3067 | * <p> |
| 3068 | * Note that the same package may have different GIDs under different |
| 3069 | * {@link UserHandle} on the same device. |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 3070 | * |
| 3071 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3072 | * desired package. |
| 3073 | * @return Returns an int array of the assigned gids, or null if there are |
| 3074 | * none. |
| 3075 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3076 | * found on the system. |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 3077 | */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3078 | public abstract int[] getPackageGids(String packageName, @PackageInfoFlags int flags) |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 3079 | throws NameNotFoundException; |
| 3080 | |
| 3081 | /** |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3082 | * Return the UID associated with the given package name. |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 3083 | * <p> |
| 3084 | * Note that the same package will have different UIDs under different |
| 3085 | * {@link UserHandle} on the same device. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3086 | * |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3087 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
| 3088 | * desired package. |
| 3089 | * @return Returns an integer UID who owns the given package name. |
| 3090 | * @throws NameNotFoundException if a package with the given name can not be |
| 3091 | * found on the system. |
| 3092 | */ |
| 3093 | public abstract int getPackageUid(String packageName, @PackageInfoFlags int flags) |
| 3094 | throws NameNotFoundException; |
| 3095 | |
| 3096 | /** |
| 3097 | * Return the UID associated with the given package name. |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 3098 | * <p> |
| 3099 | * Note that the same package will have different UIDs under different |
| 3100 | * {@link UserHandle} on the same device. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3101 | * |
| 3102 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
| 3103 | * desired package. |
| 3104 | * @param userId The user handle identifier to look up the package under. |
| 3105 | * @return Returns an integer UID who owns the given package name. |
| 3106 | * @throws NameNotFoundException if a package with the given name can not be |
| 3107 | * found on the system. |
| 3108 | * @hide |
| 3109 | */ |
| 3110 | public abstract int getPackageUidAsUser(String packageName, @UserIdInt int userId) |
| 3111 | throws NameNotFoundException; |
| 3112 | |
| 3113 | /** |
| 3114 | * Return the UID associated with the given package name. |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 3115 | * <p> |
| 3116 | * Note that the same package will have different UIDs under different |
| 3117 | * {@link UserHandle} on the same device. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3118 | * |
| 3119 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
| 3120 | * desired package. |
| 3121 | * @param userId The user handle identifier to look up the package under. |
| 3122 | * @return Returns an integer UID who owns the given package name. |
| 3123 | * @throws NameNotFoundException if a package with the given name can not be |
| 3124 | * found on the system. |
| 3125 | * @hide |
| 3126 | */ |
| 3127 | public abstract int getPackageUidAsUser(String packageName, @PackageInfoFlags int flags, |
| 3128 | @UserIdInt int userId) throws NameNotFoundException; |
| 3129 | |
| 3130 | /** |
| 3131 | * Retrieve all of the information we know about a particular permission. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3132 | * |
| 3133 | * @param name The fully qualified name (i.e. com.google.permission.LOGIN) |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3134 | * of the permission you are interested in. |
| 3135 | * @param flags Additional option flags to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3136 | * @return Returns a {@link PermissionInfo} containing information about the |
| 3137 | * permission. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3138 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3139 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3140 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3141 | public abstract PermissionInfo getPermissionInfo(String name, @PermissionInfoFlags int flags) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3142 | throws NameNotFoundException; |
| 3143 | |
| 3144 | /** |
| 3145 | * Query for all of the permissions associated with a particular group. |
| 3146 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3147 | * @param group The fully qualified name (i.e. com.google.permission.LOGIN) |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3148 | * of the permission group you are interested in. Use null to |
| 3149 | * find all of the permissions not associated with a group. |
| 3150 | * @param flags Additional option flags to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3151 | * @return Returns a list of {@link PermissionInfo} containing information |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3152 | * about all of the permissions in the given group. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3153 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3154 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3155 | */ |
| 3156 | public abstract List<PermissionInfo> queryPermissionsByGroup(String group, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3157 | @PermissionInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3158 | |
| 3159 | /** |
Paul Navin | 7b89a7b | 2017-01-26 23:56:08 +0000 | [diff] [blame] | 3160 | * Returns true if Permission Review Mode is enabled, false otherwise. |
| 3161 | * |
| 3162 | * @hide |
| 3163 | */ |
| 3164 | @TestApi |
| 3165 | public abstract boolean isPermissionReviewModeEnabled(); |
| 3166 | |
| 3167 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3168 | * Retrieve all of the information we know about a particular group of |
| 3169 | * permissions. |
| 3170 | * |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3171 | * @param name The fully qualified name (i.e. |
| 3172 | * com.google.permission_group.APPS) of the permission you are |
| 3173 | * interested in. |
| 3174 | * @param flags Additional option flags to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3175 | * @return Returns a {@link PermissionGroupInfo} containing information |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3176 | * about the permission. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3177 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3178 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3179 | */ |
| 3180 | public abstract PermissionGroupInfo getPermissionGroupInfo(String name, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3181 | @PermissionGroupInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3182 | |
| 3183 | /** |
| 3184 | * Retrieve all of the known permission groups in the system. |
| 3185 | * |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3186 | * @param flags Additional option flags to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3187 | * @return Returns a list of {@link PermissionGroupInfo} containing |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3188 | * information about all of the known permission groups. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3189 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3190 | public abstract List<PermissionGroupInfo> getAllPermissionGroups( |
| 3191 | @PermissionGroupInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3192 | |
| 3193 | /** |
| 3194 | * Retrieve all of the information we know about a particular |
| 3195 | * package/application. |
| 3196 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3197 | * @param packageName The full name (i.e. com.google.apps.contacts) of an |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3198 | * application. |
| 3199 | * @param flags Additional option flags to modify the data returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3200 | * @return An {@link ApplicationInfo} containing information about the |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3201 | * package. If flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if |
| 3202 | * the package is not found in the list of installed applications, |
| 3203 | * the application information is retrieved from the list of |
| 3204 | * uninstalled applications (which includes installed applications |
| 3205 | * as well as applications with data directory i.e. applications |
| 3206 | * which had been deleted with {@code DONT_DELETE_DATA} flag set). |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3207 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3208 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3209 | */ |
| 3210 | public abstract ApplicationInfo getApplicationInfo(String packageName, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3211 | @ApplicationInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3212 | |
Jeff Sharkey | cd65448 | 2016-01-08 17:42:11 -0700 | [diff] [blame] | 3213 | /** {@hide} */ |
| 3214 | public abstract ApplicationInfo getApplicationInfoAsUser(String packageName, |
| 3215 | @ApplicationInfoFlags int flags, @UserIdInt int userId) throws NameNotFoundException; |
| 3216 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3217 | /** |
| 3218 | * Retrieve all of the information we know about a particular activity |
| 3219 | * class. |
| 3220 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3221 | * @param component The full component name (i.e. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3222 | * com.google.apps.contacts/com.google.apps.contacts. |
| 3223 | * ContactsList) of an Activity class. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3224 | * @param flags Additional option flags to modify the data returned. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3225 | * @return An {@link ActivityInfo} containing information about the |
| 3226 | * activity. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3227 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3228 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3229 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3230 | public abstract ActivityInfo getActivityInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3231 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3232 | |
| 3233 | /** |
| 3234 | * Retrieve all of the information we know about a particular receiver |
| 3235 | * class. |
| 3236 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3237 | * @param component The full component name (i.e. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3238 | * com.google.apps.calendar/com.google.apps.calendar. |
| 3239 | * CalendarAlarm) of a Receiver class. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3240 | * @param flags Additional option flags to modify the data returned. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3241 | * @return An {@link ActivityInfo} containing information about the |
| 3242 | * receiver. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3243 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3244 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3245 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3246 | public abstract ActivityInfo getReceiverInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3247 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3248 | |
| 3249 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3250 | * Retrieve all of the information we know about a particular service class. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3251 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3252 | * @param component The full component name (i.e. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3253 | * com.google.apps.media/com.google.apps.media. |
| 3254 | * BackgroundPlayback) of a Service class. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3255 | * @param flags Additional option flags to modify the data returned. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3256 | * @return A {@link ServiceInfo} object containing information about the |
| 3257 | * service. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3258 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3259 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3260 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3261 | public abstract ServiceInfo getServiceInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3262 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3263 | |
| 3264 | /** |
| 3265 | * Retrieve all of the information we know about a particular content |
| 3266 | * provider class. |
| 3267 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3268 | * @param component The full component name (i.e. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3269 | * com.google.providers.media/com.google.providers.media. |
| 3270 | * MediaProvider) of a ContentProvider class. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3271 | * @param flags Additional option flags to modify the data returned. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3272 | * @return A {@link ProviderInfo} object containing information about the |
| 3273 | * provider. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3274 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3275 | * found on the system. |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3276 | */ |
| 3277 | public abstract ProviderInfo getProviderInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3278 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3279 | |
| 3280 | /** |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3281 | * Return a List of all packages that are installed on the device. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3282 | * |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3283 | * @param flags Additional option flags to modify the data returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3284 | * @return A List of PackageInfo objects, one for each installed package, |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3285 | * containing information about the package. In the unlikely case |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3286 | * there are no installed packages, an empty list is returned. If |
| 3287 | * flag {@code MATCH_UNINSTALLED_PACKAGES} is set, the package |
| 3288 | * information is retrieved from the list of uninstalled |
| 3289 | * applications (which includes installed applications as well as |
| 3290 | * applications with data directory i.e. applications which had been |
| 3291 | * deleted with {@code DONT_DELETE_DATA} flag set). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3292 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3293 | public abstract List<PackageInfo> getInstalledPackages(@PackageInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3294 | |
| 3295 | /** |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3296 | * Return a List of all installed packages that are currently holding any of |
| 3297 | * the given permissions. |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3298 | * |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3299 | * @param flags Additional option flags to modify the data returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3300 | * @return A List of PackageInfo objects, one for each installed package |
| 3301 | * that holds any of the permissions that were provided, containing |
| 3302 | * information about the package. If no installed packages hold any |
| 3303 | * of the permissions, an empty list is returned. If flag |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3304 | * {@code MATCH_UNINSTALLED_PACKAGES} is set, the package |
| 3305 | * information is retrieved from the list of uninstalled |
| 3306 | * applications (which includes installed applications as well as |
| 3307 | * applications with data directory i.e. applications which had been |
| 3308 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3309 | */ |
| 3310 | public abstract List<PackageInfo> getPackagesHoldingPermissions( |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3311 | String[] permissions, @PackageInfoFlags int flags); |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3312 | |
| 3313 | /** |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3314 | * Return a List of all packages that are installed on the device, for a |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 3315 | * specific user. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3316 | * |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3317 | * @param flags Additional option flags to modify the data returned. |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3318 | * @param userId The user for whom the installed packages are to be listed |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3319 | * @return A List of PackageInfo objects, one for each installed package, |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3320 | * containing information about the package. In the unlikely case |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3321 | * there are no installed packages, an empty list is returned. If |
| 3322 | * flag {@code MATCH_UNINSTALLED_PACKAGES} is set, the package |
| 3323 | * information is retrieved from the list of uninstalled |
| 3324 | * applications (which includes installed applications as well as |
| 3325 | * applications with data directory i.e. applications which had been |
| 3326 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3327 | * @hide |
| 3328 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 3329 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 3330 | @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 3331 | public abstract List<PackageInfo> getInstalledPackagesAsUser(@PackageInfoFlags int flags, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3332 | @UserIdInt int userId); |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3333 | |
| 3334 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3335 | * Check whether a particular package has been granted a particular |
| 3336 | * permission. |
| 3337 | * |
Svet Ganov | ad3b297 | 2015-07-07 22:49:17 -0700 | [diff] [blame] | 3338 | * @param permName The name of the permission you are checking for. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3339 | * @param pkgName The name of the package you are checking against. |
| 3340 | * |
| 3341 | * @return If the package has the permission, PERMISSION_GRANTED is |
| 3342 | * returned. If it does not have the permission, PERMISSION_DENIED |
| 3343 | * is returned. |
| 3344 | * |
| 3345 | * @see #PERMISSION_GRANTED |
| 3346 | * @see #PERMISSION_DENIED |
| 3347 | */ |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 3348 | @CheckResult |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 3349 | public abstract @PermissionResult int checkPermission(String permName, String pkgName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3350 | |
| 3351 | /** |
Svet Ganov | ad3b297 | 2015-07-07 22:49:17 -0700 | [diff] [blame] | 3352 | * Checks whether a particular permissions has been revoked for a |
| 3353 | * package by policy. Typically the device owner or the profile owner |
| 3354 | * may apply such a policy. The user cannot grant policy revoked |
| 3355 | * permissions, hence the only way for an app to get such a permission |
| 3356 | * is by a policy change. |
| 3357 | * |
| 3358 | * @param permName The name of the permission you are checking for. |
| 3359 | * @param pkgName The name of the package you are checking against. |
| 3360 | * |
| 3361 | * @return Whether the permission is restricted by policy. |
| 3362 | */ |
| 3363 | @CheckResult |
Svet Ganov | f1b7f20 | 2015-07-29 08:33:42 -0700 | [diff] [blame] | 3364 | public abstract boolean isPermissionRevokedByPolicy(@NonNull String permName, |
| 3365 | @NonNull String pkgName); |
| 3366 | |
| 3367 | /** |
| 3368 | * Gets the package name of the component controlling runtime permissions. |
| 3369 | * |
| 3370 | * @return The package name. |
| 3371 | * |
| 3372 | * @hide |
| 3373 | */ |
Philip P. Moltmann | eb0a0ae | 2017-06-30 10:55:51 -0700 | [diff] [blame] | 3374 | @TestApi |
Svet Ganov | f1b7f20 | 2015-07-29 08:33:42 -0700 | [diff] [blame] | 3375 | public abstract String getPermissionControllerPackageName(); |
Svet Ganov | ad3b297 | 2015-07-07 22:49:17 -0700 | [diff] [blame] | 3376 | |
| 3377 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3378 | * Add a new dynamic permission to the system. For this to work, your |
| 3379 | * package must have defined a permission tree through the |
| 3380 | * {@link android.R.styleable#AndroidManifestPermissionTree |
| 3381 | * <permission-tree>} tag in its manifest. A package can only add |
| 3382 | * permissions to trees that were defined by either its own package or |
| 3383 | * another with the same user id; a permission is in a tree if it |
| 3384 | * matches the name of the permission tree + ".": for example, |
| 3385 | * "com.foo.bar" is a member of the permission tree "com.foo". |
| 3386 | * |
| 3387 | * <p>It is good to make your permission tree name descriptive, because you |
| 3388 | * are taking possession of that entire set of permission names. Thus, it |
| 3389 | * must be under a domain you control, with a suffix that will not match |
| 3390 | * any normal permissions that may be declared in any applications that |
| 3391 | * are part of that domain. |
| 3392 | * |
| 3393 | * <p>New permissions must be added before |
| 3394 | * any .apks are installed that use those permissions. Permissions you |
| 3395 | * add through this method are remembered across reboots of the device. |
| 3396 | * If the given permission already exists, the info you supply here |
| 3397 | * will be used to update it. |
| 3398 | * |
| 3399 | * @param info Description of the permission to be added. |
| 3400 | * |
| 3401 | * @return Returns true if a new permission was created, false if an |
| 3402 | * existing one was updated. |
| 3403 | * |
| 3404 | * @throws SecurityException if you are not allowed to add the |
| 3405 | * given permission name. |
| 3406 | * |
| 3407 | * @see #removePermission(String) |
| 3408 | */ |
| 3409 | public abstract boolean addPermission(PermissionInfo info); |
| 3410 | |
| 3411 | /** |
Dianne Hackborn | d7c0968 | 2010-03-30 10:42:20 -0700 | [diff] [blame] | 3412 | * Like {@link #addPermission(PermissionInfo)} but asynchronously |
| 3413 | * persists the package manager state after returning from the call, |
| 3414 | * allowing it to return quicker and batch a series of adds at the |
| 3415 | * expense of no guarantee the added permission will be retained if |
| 3416 | * the device is rebooted before it is written. |
| 3417 | */ |
| 3418 | public abstract boolean addPermissionAsync(PermissionInfo info); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3419 | |
Dianne Hackborn | d7c0968 | 2010-03-30 10:42:20 -0700 | [diff] [blame] | 3420 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3421 | * Removes a permission that was previously added with |
| 3422 | * {@link #addPermission(PermissionInfo)}. The same ownership rules apply |
| 3423 | * -- you are only allowed to remove permissions that you are allowed |
| 3424 | * to add. |
| 3425 | * |
| 3426 | * @param name The name of the permission to remove. |
| 3427 | * |
| 3428 | * @throws SecurityException if you are not allowed to remove the |
| 3429 | * given permission name. |
| 3430 | * |
| 3431 | * @see #addPermission(PermissionInfo) |
| 3432 | */ |
| 3433 | public abstract void removePermission(String name); |
| 3434 | |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3435 | /** |
| 3436 | * Permission flags set when granting or revoking a permission. |
| 3437 | * |
| 3438 | * @hide |
| 3439 | */ |
| 3440 | @SystemApi |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3441 | @IntDef(prefix = { "FLAG_PERMISSION_" }, value = { |
| 3442 | FLAG_PERMISSION_USER_SET, |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3443 | FLAG_PERMISSION_USER_FIXED, |
| 3444 | FLAG_PERMISSION_POLICY_FIXED, |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 3445 | FLAG_PERMISSION_REVOKE_ON_UPGRADE, |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 3446 | FLAG_PERMISSION_SYSTEM_FIXED, |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3447 | FLAG_PERMISSION_GRANTED_BY_DEFAULT |
| 3448 | }) |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3449 | @Retention(RetentionPolicy.SOURCE) |
| 3450 | public @interface PermissionFlags {} |
| 3451 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3452 | /** |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3453 | * Grant a runtime permission to an application which the application does not |
| 3454 | * already have. The permission must have been requested by the application. |
| 3455 | * If the application is not allowed to hold the permission, a {@link |
Ruben Brunk | 12ab5e1 | 2016-11-10 15:27:30 -0800 | [diff] [blame] | 3456 | * java.lang.SecurityException} is thrown. If the package or permission is |
| 3457 | * invalid, a {@link java.lang.IllegalArgumentException} is thrown. |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3458 | * <p> |
| 3459 | * <strong>Note: </strong>Using this API requires holding |
Todd Kennedy | a8eb6a8 | 2016-07-28 16:35:42 -0700 | [diff] [blame] | 3460 | * android.permission.GRANT_RUNTIME_PERMISSIONS and if the user id is |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3461 | * not the current user android.permission.INTERACT_ACROSS_USERS_FULL. |
| 3462 | * </p> |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3463 | * |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3464 | * @param packageName The package to which to grant the permission. |
| 3465 | * @param permissionName The permission name to grant. |
| 3466 | * @param user The user for which to grant the permission. |
| 3467 | * |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3468 | * @see #revokeRuntimePermission(String, String, android.os.UserHandle) |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3469 | * |
| 3470 | * @hide |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3471 | */ |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3472 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 3473 | @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS) |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3474 | public abstract void grantRuntimePermission(@NonNull String packageName, |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3475 | @NonNull String permissionName, @NonNull UserHandle user); |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3476 | |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3477 | /** |
| 3478 | * Revoke a runtime permission that was previously granted by {@link |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3479 | * #grantRuntimePermission(String, String, android.os.UserHandle)}. The |
| 3480 | * permission must have been requested by and granted to the application. |
| 3481 | * If the application is not allowed to hold the permission, a {@link |
Ruben Brunk | 12ab5e1 | 2016-11-10 15:27:30 -0800 | [diff] [blame] | 3482 | * java.lang.SecurityException} is thrown. If the package or permission is |
| 3483 | * invalid, a {@link java.lang.IllegalArgumentException} is thrown. |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3484 | * <p> |
| 3485 | * <strong>Note: </strong>Using this API requires holding |
Todd Kennedy | a8eb6a8 | 2016-07-28 16:35:42 -0700 | [diff] [blame] | 3486 | * android.permission.REVOKE_RUNTIME_PERMISSIONS and if the user id is |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3487 | * not the current user android.permission.INTERACT_ACROSS_USERS_FULL. |
| 3488 | * </p> |
| 3489 | * |
| 3490 | * @param packageName The package from which to revoke the permission. |
| 3491 | * @param permissionName The permission name to revoke. |
| 3492 | * @param user The user for which to revoke the permission. |
| 3493 | * |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3494 | * @see #grantRuntimePermission(String, String, android.os.UserHandle) |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3495 | * |
| 3496 | * @hide |
| 3497 | */ |
| 3498 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 3499 | @RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS) |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3500 | public abstract void revokeRuntimePermission(@NonNull String packageName, |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3501 | @NonNull String permissionName, @NonNull UserHandle user); |
| 3502 | |
| 3503 | /** |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3504 | * Gets the state flags associated with a permission. |
| 3505 | * |
| 3506 | * @param permissionName The permission for which to get the flags. |
| 3507 | * @param packageName The package name for which to get the flags. |
| 3508 | * @param user The user for which to get permission flags. |
| 3509 | * @return The permission flags. |
| 3510 | * |
| 3511 | * @hide |
| 3512 | */ |
| 3513 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 3514 | @RequiresPermission(anyOf = { |
| 3515 | android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS, |
| 3516 | android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS |
| 3517 | }) |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3518 | public abstract @PermissionFlags int getPermissionFlags(String permissionName, |
| 3519 | String packageName, @NonNull UserHandle user); |
| 3520 | |
| 3521 | /** |
| 3522 | * Updates the flags associated with a permission by replacing the flags in |
| 3523 | * the specified mask with the provided flag values. |
| 3524 | * |
| 3525 | * @param permissionName The permission for which to update the flags. |
| 3526 | * @param packageName The package name for which to update the flags. |
| 3527 | * @param flagMask The flags which to replace. |
| 3528 | * @param flagValues The flags with which to replace. |
| 3529 | * @param user The user for which to update the permission flags. |
| 3530 | * |
| 3531 | * @hide |
| 3532 | */ |
| 3533 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 3534 | @RequiresPermission(anyOf = { |
| 3535 | android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS, |
| 3536 | android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS |
| 3537 | }) |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3538 | public abstract void updatePermissionFlags(String permissionName, |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3539 | String packageName, @PermissionFlags int flagMask, @PermissionFlags int flagValues, |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3540 | @NonNull UserHandle user); |
| 3541 | |
| 3542 | /** |
Svetoslav | 20770dd | 2015-05-29 15:43:04 -0700 | [diff] [blame] | 3543 | * Gets whether you should show UI with rationale for requesting a permission. |
| 3544 | * You should do this only if you do not have the permission and the context in |
| 3545 | * which the permission is requested does not clearly communicate to the user |
| 3546 | * what would be the benefit from grating this permission. |
| 3547 | * |
| 3548 | * @param permission A permission your app wants to request. |
| 3549 | * @return Whether you can show permission rationale UI. |
| 3550 | * |
| 3551 | * @hide |
| 3552 | */ |
| 3553 | public abstract boolean shouldShowRequestPermissionRationale(String permission); |
| 3554 | |
| 3555 | /** |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3556 | * Returns an {@link android.content.Intent} suitable for passing to |
| 3557 | * {@link android.app.Activity#startActivityForResult(android.content.Intent, int)} |
| 3558 | * which prompts the user to grant permissions to this application. |
| 3559 | * |
| 3560 | * @throws NullPointerException if {@code permissions} is {@code null} or empty. |
| 3561 | * |
| 3562 | * @hide |
| 3563 | */ |
| 3564 | public Intent buildRequestPermissionsIntent(@NonNull String[] permissions) { |
| 3565 | if (ArrayUtils.isEmpty(permissions)) { |
Svet Ganov | f66381c | 2016-02-18 20:02:36 -0800 | [diff] [blame] | 3566 | throw new IllegalArgumentException("permission cannot be null or empty"); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3567 | } |
| 3568 | Intent intent = new Intent(ACTION_REQUEST_PERMISSIONS); |
| 3569 | intent.putExtra(EXTRA_REQUEST_PERMISSIONS_NAMES, permissions); |
Svet Ganov | f1b7f20 | 2015-07-29 08:33:42 -0700 | [diff] [blame] | 3570 | intent.setPackage(getPermissionControllerPackageName()); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3571 | return intent; |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3572 | } |
| 3573 | |
| 3574 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3575 | * Compare the signatures of two packages to determine if the same |
| 3576 | * signature appears in both of them. If they do contain the same |
| 3577 | * signature, then they are allowed special privileges when working |
| 3578 | * with each other: they can share the same user-id, run instrumentation |
| 3579 | * against each other, etc. |
| 3580 | * |
| 3581 | * @param pkg1 First package name whose signature will be compared. |
| 3582 | * @param pkg2 Second package name whose signature will be compared. |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 3583 | * |
| 3584 | * @return Returns an integer indicating whether all signatures on the |
| 3585 | * two packages match. The value is >= 0 ({@link #SIGNATURE_MATCH}) if |
| 3586 | * all signatures match or < 0 if there is not a match ({@link |
| 3587 | * #SIGNATURE_NO_MATCH} or {@link #SIGNATURE_UNKNOWN_PACKAGE}). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3588 | * |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3589 | * @see #checkSignatures(int, int) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3590 | */ |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 3591 | @CheckResult |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 3592 | public abstract @SignatureResult int checkSignatures(String pkg1, String pkg2); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3593 | |
| 3594 | /** |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3595 | * Like {@link #checkSignatures(String, String)}, but takes UIDs of |
| 3596 | * the two packages to be checked. This can be useful, for example, |
| 3597 | * when doing the check in an IPC, where the UID is the only identity |
| 3598 | * available. It is functionally identical to determining the package |
| 3599 | * associated with the UIDs and checking their signatures. |
| 3600 | * |
Joe Onorato | 25660ec | 2009-08-12 22:40:37 -0700 | [diff] [blame] | 3601 | * @param uid1 First UID whose signature will be compared. |
| 3602 | * @param uid2 Second UID whose signature will be compared. |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3603 | * |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 3604 | * @return Returns an integer indicating whether all signatures on the |
| 3605 | * two packages match. The value is >= 0 ({@link #SIGNATURE_MATCH}) if |
| 3606 | * all signatures match or < 0 if there is not a match ({@link |
| 3607 | * #SIGNATURE_NO_MATCH} or {@link #SIGNATURE_UNKNOWN_PACKAGE}). |
| 3608 | * |
| 3609 | * @see #checkSignatures(String, String) |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3610 | */ |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 3611 | @CheckResult |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 3612 | public abstract @SignatureResult int checkSignatures(int uid1, int uid2); |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3613 | |
| 3614 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3615 | * Retrieve the names of all packages that are associated with a particular |
| 3616 | * user id. In most cases, this will be a single package name, the package |
| 3617 | * that has been assigned that user id. Where there are multiple packages |
| 3618 | * sharing the same user id through the "sharedUserId" mechanism, all |
| 3619 | * packages with that id will be returned. |
| 3620 | * |
| 3621 | * @param uid The user id for which you would like to retrieve the |
| 3622 | * associated packages. |
| 3623 | * |
| 3624 | * @return Returns an array of one or more packages assigned to the user |
| 3625 | * id, or null if there are no known packages with the given id. |
| 3626 | */ |
Jeff Sharkey | 377ded0f | 2016-01-10 13:15:41 -0700 | [diff] [blame] | 3627 | public abstract @Nullable String[] getPackagesForUid(int uid); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3628 | |
| 3629 | /** |
Michal Karpinski | cb67dc9 | 2016-12-13 18:20:23 +0000 | [diff] [blame] | 3630 | * Retrieve the official name associated with a uid. This name is |
Jonathan Basseri | 7ea3a33 | 2015-05-12 19:39:22 -0700 | [diff] [blame] | 3631 | * guaranteed to never change, though it is possible for the underlying |
Michal Karpinski | cb67dc9 | 2016-12-13 18:20:23 +0000 | [diff] [blame] | 3632 | * uid to be changed. That is, if you are storing information about |
| 3633 | * uids in persistent storage, you should use the string returned |
| 3634 | * by this function instead of the raw uid. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3635 | * |
Michal Karpinski | cb67dc9 | 2016-12-13 18:20:23 +0000 | [diff] [blame] | 3636 | * @param uid The uid for which you would like to retrieve a name. |
| 3637 | * @return Returns a unique name for the given uid, or null if the |
| 3638 | * uid is not currently assigned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3639 | */ |
Jeff Sharkey | 377ded0f | 2016-01-10 13:15:41 -0700 | [diff] [blame] | 3640 | public abstract @Nullable String getNameForUid(int uid); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3641 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3642 | /** |
Todd Kennedy | 9da8b8a7 | 2017-07-25 15:38:39 -0700 | [diff] [blame] | 3643 | * Retrieves the official names associated with each given uid. |
| 3644 | * @see #getNameForUid(int) |
| 3645 | * |
| 3646 | * @hide |
| 3647 | */ |
| 3648 | public abstract @Nullable String[] getNamesForUids(int[] uids); |
| 3649 | |
| 3650 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3651 | * Return the user id associated with a shared user name. Multiple |
| 3652 | * applications can specify a shared user name in their manifest and thus |
| 3653 | * end up using a common uid. This might be used for new applications |
| 3654 | * that use an existing shared user name and need to know the uid of the |
| 3655 | * shared user. |
| 3656 | * |
| 3657 | * @param sharedUserName The shared user name whose uid is to be retrieved. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3658 | * @return Returns the UID associated with the shared user. |
| 3659 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3660 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3661 | * @hide |
| 3662 | */ |
| 3663 | public abstract int getUidForSharedUser(String sharedUserName) |
| 3664 | throws NameNotFoundException; |
| 3665 | |
| 3666 | /** |
| 3667 | * Return a List of all application packages that are installed on the |
| 3668 | * device. If flag GET_UNINSTALLED_PACKAGES has been set, a list of all |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3669 | * applications including those deleted with {@code DONT_DELETE_DATA} |
| 3670 | * (partially installed apps with data directory) will be returned. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3671 | * |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3672 | * @param flags Additional option flags to modify the data returned. |
| 3673 | * @return A List of ApplicationInfo objects, one for each installed |
| 3674 | * application. In the unlikely case there are no installed |
| 3675 | * packages, an empty list is returned. If flag |
| 3676 | * {@code MATCH_UNINSTALLED_PACKAGES} is set, the application |
| 3677 | * information is retrieved from the list of uninstalled |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3678 | * applications (which includes installed applications as well as |
| 3679 | * applications with data directory i.e. applications which had been |
| 3680 | * deleted with {@code DONT_DELETE_DATA} flag set). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3681 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3682 | public abstract List<ApplicationInfo> getInstalledApplications(@ApplicationInfoFlags int flags); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3683 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3684 | /** |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3685 | * Return a List of all application packages that are installed on the |
| 3686 | * device, for a specific user. If flag GET_UNINSTALLED_PACKAGES has been |
| 3687 | * set, a list of all applications including those deleted with |
| 3688 | * {@code DONT_DELETE_DATA} (partially installed apps with data directory) |
Bartosz Fabianowski | 1133424 | 2016-11-17 20:49:16 +0100 | [diff] [blame] | 3689 | * will be returned. |
| 3690 | * |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3691 | * @param flags Additional option flags to modify the data returned. |
| 3692 | * @param userId The user for whom the installed applications are to be |
| 3693 | * listed |
| 3694 | * @return A List of ApplicationInfo objects, one for each installed |
| 3695 | * application. In the unlikely case there are no installed |
| 3696 | * packages, an empty list is returned. If flag |
| 3697 | * {@code MATCH_UNINSTALLED_PACKAGES} is set, the application |
| 3698 | * information is retrieved from the list of uninstalled |
Bartosz Fabianowski | 1133424 | 2016-11-17 20:49:16 +0100 | [diff] [blame] | 3699 | * applications (which includes installed applications as well as |
| 3700 | * applications with data directory i.e. applications which had been |
| 3701 | * deleted with {@code DONT_DELETE_DATA} flag set). |
| 3702 | * @hide |
Bartosz Fabianowski | 1133424 | 2016-11-17 20:49:16 +0100 | [diff] [blame] | 3703 | */ |
| 3704 | public abstract List<ApplicationInfo> getInstalledApplicationsAsUser( |
| 3705 | @ApplicationInfoFlags int flags, @UserIdInt int userId); |
| 3706 | |
| 3707 | /** |
Jeff Sharkey | 910e081 | 2017-04-21 16:29:27 -0600 | [diff] [blame] | 3708 | * Gets the instant applications the user recently used. |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3709 | * |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3710 | * @return The instant app list. |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3711 | * |
| 3712 | * @hide |
| 3713 | */ |
Todd Kennedy | 9c9fdf2 | 2017-03-06 10:58:27 -0800 | [diff] [blame] | 3714 | @SystemApi |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3715 | @RequiresPermission(Manifest.permission.ACCESS_INSTANT_APPS) |
| 3716 | public abstract @NonNull List<InstantAppInfo> getInstantApps(); |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3717 | |
| 3718 | /** |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3719 | * Gets the icon for an instant application. |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3720 | * |
| 3721 | * @param packageName The app package name. |
| 3722 | * |
| 3723 | * @hide |
| 3724 | */ |
Todd Kennedy | 9c9fdf2 | 2017-03-06 10:58:27 -0800 | [diff] [blame] | 3725 | @SystemApi |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3726 | @RequiresPermission(Manifest.permission.ACCESS_INSTANT_APPS) |
| 3727 | public abstract @Nullable Drawable getInstantAppIcon(String packageName); |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3728 | |
| 3729 | /** |
David Christie | 31a1655 | 2017-03-01 15:08:45 -0800 | [diff] [blame] | 3730 | * Gets whether this application is an instant app. |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3731 | * |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3732 | * @return Whether caller is an instant app. |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3733 | * |
David Christie | 31a1655 | 2017-03-01 15:08:45 -0800 | [diff] [blame] | 3734 | * @see #isInstantApp(String) |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3735 | * @see #updateInstantAppCookie(byte[]) |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3736 | * @see #getInstantAppCookie() |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3737 | * @see #getInstantAppCookieMaxBytes() |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3738 | */ |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3739 | public abstract boolean isInstantApp(); |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3740 | |
| 3741 | /** |
David Christie | 31a1655 | 2017-03-01 15:08:45 -0800 | [diff] [blame] | 3742 | * Gets whether the given package is an instant app. |
| 3743 | * |
| 3744 | * @param packageName The package to check |
| 3745 | * @return Whether the given package is an instant app. |
| 3746 | * |
| 3747 | * @see #isInstantApp() |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3748 | * @see #updateInstantAppCookie(byte[]) |
David Christie | 31a1655 | 2017-03-01 15:08:45 -0800 | [diff] [blame] | 3749 | * @see #getInstantAppCookie() |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3750 | * @see #getInstantAppCookieMaxBytes() |
| 3751 | * @see #clearInstantAppCookie() |
David Christie | 31a1655 | 2017-03-01 15:08:45 -0800 | [diff] [blame] | 3752 | */ |
| 3753 | public abstract boolean isInstantApp(String packageName); |
| 3754 | |
| 3755 | /** |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3756 | * Gets the maximum size in bytes of the cookie data an instant app |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3757 | * can store on the device. |
| 3758 | * |
| 3759 | * @return The max cookie size in bytes. |
| 3760 | * |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3761 | * @see #isInstantApp() |
David Christie | 31a1655 | 2017-03-01 15:08:45 -0800 | [diff] [blame] | 3762 | * @see #isInstantApp(String) |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3763 | * @see #updateInstantAppCookie(byte[]) |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3764 | * @see #getInstantAppCookie() |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3765 | * @see #clearInstantAppCookie() |
| 3766 | */ |
| 3767 | public abstract int getInstantAppCookieMaxBytes(); |
| 3768 | |
| 3769 | /** |
| 3770 | * @deprecated |
| 3771 | * @hide |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3772 | */ |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3773 | public abstract int getInstantAppCookieMaxSize(); |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3774 | |
| 3775 | /** |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3776 | * Gets the instant application cookie for this app. Non |
| 3777 | * instant apps and apps that were instant but were upgraded |
| 3778 | * to normal apps can still access this API. For instant apps |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3779 | * this cookie is cached for some time after uninstall while for |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3780 | * normal apps the cookie is deleted after the app is uninstalled. |
| 3781 | * The cookie is always present while the app is installed. |
| 3782 | * |
| 3783 | * @return The cookie. |
| 3784 | * |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3785 | * @see #isInstantApp() |
David Christie | 31a1655 | 2017-03-01 15:08:45 -0800 | [diff] [blame] | 3786 | * @see #isInstantApp(String) |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3787 | * @see #updateInstantAppCookie(byte[]) |
| 3788 | * @see #getInstantAppCookieMaxBytes() |
| 3789 | * @see #clearInstantAppCookie() |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3790 | */ |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3791 | public abstract @NonNull byte[] getInstantAppCookie(); |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3792 | |
| 3793 | /** |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3794 | * Clears the instant application cookie for the calling app. |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3795 | * |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3796 | * @see #isInstantApp() |
David Christie | 31a1655 | 2017-03-01 15:08:45 -0800 | [diff] [blame] | 3797 | * @see #isInstantApp(String) |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3798 | * @see #getInstantAppCookieMaxBytes() |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3799 | * @see #getInstantAppCookie() |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3800 | * @see #clearInstantAppCookie() |
| 3801 | */ |
| 3802 | public abstract void clearInstantAppCookie(); |
| 3803 | |
| 3804 | /** |
| 3805 | * Updates the instant application cookie for the calling app. Non |
| 3806 | * instant apps and apps that were instant but were upgraded |
| 3807 | * to normal apps can still access this API. For instant apps |
| 3808 | * this cookie is cached for some time after uninstall while for |
| 3809 | * normal apps the cookie is deleted after the app is uninstalled. |
| 3810 | * The cookie is always present while the app is installed. The |
| 3811 | * cookie size is limited by {@link #getInstantAppCookieMaxBytes()}. |
| 3812 | * Passing <code>null</code> or an empty array clears the cookie. |
| 3813 | * </p> |
| 3814 | * |
| 3815 | * @param cookie The cookie data. |
| 3816 | * |
| 3817 | * @see #isInstantApp() |
| 3818 | * @see #isInstantApp(String) |
| 3819 | * @see #getInstantAppCookieMaxBytes() |
| 3820 | * @see #getInstantAppCookie() |
| 3821 | * @see #clearInstantAppCookie() |
| 3822 | * |
| 3823 | * @throws IllegalArgumentException if the array exceeds max cookie size. |
| 3824 | */ |
| 3825 | public abstract void updateInstantAppCookie(@Nullable byte[] cookie); |
| 3826 | |
| 3827 | /** |
| 3828 | * @removed |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3829 | */ |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3830 | public abstract boolean setInstantAppCookie(@Nullable byte[] cookie); |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3831 | |
| 3832 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3833 | * Get a list of shared libraries that are available on the |
| 3834 | * system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3835 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3836 | * @return An array of shared library names that are |
| 3837 | * available on the system, or null if none are installed. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3838 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3839 | */ |
| 3840 | public abstract String[] getSystemSharedLibraryNames(); |
| 3841 | |
| 3842 | /** |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 3843 | * Get a list of shared libraries on the device. |
| 3844 | * |
| 3845 | * @param flags To filter the libraries to return. |
| 3846 | * @return The shared library list. |
| 3847 | * |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 3848 | * @see #MATCH_UNINSTALLED_PACKAGES |
| 3849 | */ |
| 3850 | public abstract @NonNull List<SharedLibraryInfo> getSharedLibraries( |
| 3851 | @InstallFlags int flags); |
| 3852 | |
| 3853 | /** |
| 3854 | * Get a list of shared libraries on the device. |
| 3855 | * |
| 3856 | * @param flags To filter the libraries to return. |
| 3857 | * @param userId The user to query for. |
| 3858 | * @return The shared library list. |
| 3859 | * |
| 3860 | * @see #MATCH_FACTORY_ONLY |
| 3861 | * @see #MATCH_KNOWN_PACKAGES |
| 3862 | * @see #MATCH_ANY_USER |
| 3863 | * @see #MATCH_UNINSTALLED_PACKAGES |
| 3864 | * |
| 3865 | * @hide |
| 3866 | */ |
| 3867 | public abstract @NonNull List<SharedLibraryInfo> getSharedLibrariesAsUser( |
| 3868 | @InstallFlags int flags, @UserIdInt int userId); |
| 3869 | |
| 3870 | /** |
Svet Ganov | d7b1f411 | 2016-02-09 18:49:23 -0800 | [diff] [blame] | 3871 | * Get the name of the package hosting the services shared library. |
| 3872 | * |
| 3873 | * @return The library host package. |
| 3874 | * |
| 3875 | * @hide |
| 3876 | */ |
Svetoslav Ganov | a9c2500 | 2016-04-13 19:25:56 -0700 | [diff] [blame] | 3877 | public abstract @NonNull String getServicesSystemSharedLibraryPackageName(); |
| 3878 | |
| 3879 | /** |
| 3880 | * Get the name of the package hosting the shared components shared library. |
| 3881 | * |
| 3882 | * @return The library host package. |
| 3883 | * |
| 3884 | * @hide |
| 3885 | */ |
| 3886 | public abstract @NonNull String getSharedSystemSharedLibraryPackageName(); |
Svet Ganov | d7b1f411 | 2016-02-09 18:49:23 -0800 | [diff] [blame] | 3887 | |
| 3888 | /** |
Todd Kennedy | 9106c64 | 2017-02-08 14:16:53 -0800 | [diff] [blame] | 3889 | * Returns the names of the packages that have been changed |
| 3890 | * [eg. added, removed or updated] since the given sequence |
| 3891 | * number. |
| 3892 | * <p>If no packages have been changed, returns <code>null</code>. |
| 3893 | * <p>The sequence number starts at <code>0</code> and is |
| 3894 | * reset every boot. |
Todd Kennedy | 8fddf9d | 2017-04-17 15:16:12 -0700 | [diff] [blame] | 3895 | * @param sequenceNumber The first sequence number for which to retrieve package changes. |
| 3896 | * @see Settings.Global#BOOT_COUNT |
Todd Kennedy | 9106c64 | 2017-02-08 14:16:53 -0800 | [diff] [blame] | 3897 | */ |
| 3898 | public abstract @Nullable ChangedPackages getChangedPackages( |
| 3899 | @IntRange(from=0) int sequenceNumber); |
| 3900 | |
| 3901 | /** |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 3902 | * Get a list of features that are available on the |
| 3903 | * system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3904 | * |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 3905 | * @return An array of FeatureInfo classes describing the features |
| 3906 | * that are available on the system, or null if there are none(!!). |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 3907 | */ |
| 3908 | public abstract FeatureInfo[] getSystemAvailableFeatures(); |
| 3909 | |
| 3910 | /** |
Jeff Sharkey | 115d2c1 | 2016-02-15 17:25:57 -0700 | [diff] [blame] | 3911 | * Check whether the given feature name is one of the available features as |
| 3912 | * returned by {@link #getSystemAvailableFeatures()}. This tests for the |
| 3913 | * presence of <em>any</em> version of the given feature name; use |
| 3914 | * {@link #hasSystemFeature(String, int)} to check for a minimum version. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3915 | * |
Jeff Sharkey | 115d2c1 | 2016-02-15 17:25:57 -0700 | [diff] [blame] | 3916 | * @return Returns true if the devices supports the feature, else false. |
Dianne Hackborn | 039c68e | 2009-09-26 16:39:23 -0700 | [diff] [blame] | 3917 | */ |
| 3918 | public abstract boolean hasSystemFeature(String name); |
| 3919 | |
| 3920 | /** |
Jeff Sharkey | 115d2c1 | 2016-02-15 17:25:57 -0700 | [diff] [blame] | 3921 | * Check whether the given feature name and version is one of the available |
| 3922 | * features as returned by {@link #getSystemAvailableFeatures()}. Since |
| 3923 | * features are defined to always be backwards compatible, this returns true |
| 3924 | * if the available feature version is greater than or equal to the |
| 3925 | * requested version. |
| 3926 | * |
| 3927 | * @return Returns true if the devices supports the feature, else false. |
| 3928 | */ |
| 3929 | public abstract boolean hasSystemFeature(String name, int version); |
| 3930 | |
| 3931 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3932 | * Determine the best action to perform for a given Intent. This is how |
| 3933 | * {@link Intent#resolveActivity} finds an activity if a class has not been |
| 3934 | * explicitly specified. |
| 3935 | * <p> |
| 3936 | * <em>Note:</em> if using an implicit Intent (without an explicit |
| 3937 | * ComponentName specified), be sure to consider whether to set the |
| 3938 | * {@link #MATCH_DEFAULT_ONLY} only flag. You need to do so to resolve the |
| 3939 | * activity in the same way that |
| 3940 | * {@link android.content.Context#startActivity(Intent)} and |
Dianne Hackborn | 4d023d21 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 3941 | * {@link android.content.Intent#resolveActivity(PackageManager) |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3942 | * Intent.resolveActivity(PackageManager)} do. |
| 3943 | * </p> |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3944 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3945 | * @param intent An intent containing all of the desired specification |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3946 | * (action, data, type, category, and/or component). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3947 | * @param flags Additional option flags to modify the data returned. The |
| 3948 | * most important is {@link #MATCH_DEFAULT_ONLY}, to limit the |
| 3949 | * resolution to only those activities that support the |
| 3950 | * {@link android.content.Intent#CATEGORY_DEFAULT}. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3951 | * @return Returns a ResolveInfo object containing the final activity intent |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3952 | * that was determined to be the best action. Returns null if no |
Mike LeBeau | bd3f527 | 2010-02-18 19:27:17 -0800 | [diff] [blame] | 3953 | * matching activity was found. If multiple matching activities are |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3954 | * found and there is no default set, returns a ResolveInfo object |
Mike LeBeau | bd3f527 | 2010-02-18 19:27:17 -0800 | [diff] [blame] | 3955 | * containing something else, such as the activity resolver. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3956 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3957 | public abstract ResolveInfo resolveActivity(Intent intent, @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3958 | |
| 3959 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3960 | * Determine the best action to perform for a given Intent for a given user. |
| 3961 | * This is how {@link Intent#resolveActivity} finds an activity if a class |
| 3962 | * has not been explicitly specified. |
| 3963 | * <p> |
| 3964 | * <em>Note:</em> if using an implicit Intent (without an explicit |
| 3965 | * ComponentName specified), be sure to consider whether to set the |
| 3966 | * {@link #MATCH_DEFAULT_ONLY} only flag. You need to do so to resolve the |
| 3967 | * activity in the same way that |
| 3968 | * {@link android.content.Context#startActivity(Intent)} and |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3969 | * {@link android.content.Intent#resolveActivity(PackageManager) |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3970 | * Intent.resolveActivity(PackageManager)} do. |
| 3971 | * </p> |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3972 | * |
| 3973 | * @param intent An intent containing all of the desired specification |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3974 | * (action, data, type, category, and/or component). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3975 | * @param flags Additional option flags to modify the data returned. The |
| 3976 | * most important is {@link #MATCH_DEFAULT_ONLY}, to limit the |
| 3977 | * resolution to only those activities that support the |
| 3978 | * {@link android.content.Intent#CATEGORY_DEFAULT}. |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3979 | * @param userId The user id. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3980 | * @return Returns a ResolveInfo object containing the final activity intent |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3981 | * that was determined to be the best action. Returns null if no |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3982 | * matching activity was found. If multiple matching activities are |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3983 | * found and there is no default set, returns a ResolveInfo object |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3984 | * containing something else, such as the activity resolver. |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3985 | * @hide |
| 3986 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3987 | public abstract ResolveInfo resolveActivityAsUser(Intent intent, @ResolveInfoFlags int flags, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3988 | @UserIdInt int userId); |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3989 | |
| 3990 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3991 | * Retrieve all activities that can be performed for the given intent. |
| 3992 | * |
| 3993 | * @param intent The desired intent as per resolveActivity(). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3994 | * @param flags Additional option flags to modify the data returned. The |
| 3995 | * most important is {@link #MATCH_DEFAULT_ONLY}, to limit the |
| 3996 | * resolution to only those activities that support the |
| 3997 | * {@link android.content.Intent#CATEGORY_DEFAULT}. Or, set |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3998 | * {@link #MATCH_ALL} to prevent any filtering of the results. |
| 3999 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4000 | * each matching activity, ordered from best to worst. In other |
| 4001 | * words, the first item is what would be returned by |
| 4002 | * {@link #resolveActivity}. If there are no matching activities, an |
| 4003 | * empty list is returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4004 | */ |
| 4005 | public abstract List<ResolveInfo> queryIntentActivities(Intent intent, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4006 | @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4007 | |
| 4008 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4009 | * Retrieve all activities that can be performed for the given intent, for a |
| 4010 | * specific user. |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 4011 | * |
| 4012 | * @param intent The desired intent as per resolveActivity(). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4013 | * @param flags Additional option flags to modify the data returned. The |
| 4014 | * most important is {@link #MATCH_DEFAULT_ONLY}, to limit the |
| 4015 | * resolution to only those activities that support the |
| 4016 | * {@link android.content.Intent#CATEGORY_DEFAULT}. Or, set |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4017 | * {@link #MATCH_ALL} to prevent any filtering of the results. |
| 4018 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4019 | * each matching activity, ordered from best to worst. In other |
| 4020 | * words, the first item is what would be returned by |
| 4021 | * {@link #resolveActivity}. If there are no matching activities, an |
| 4022 | * empty list is returned. |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 4023 | * @hide |
| 4024 | */ |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4025 | public abstract List<ResolveInfo> queryIntentActivitiesAsUser(Intent intent, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4026 | @ResolveInfoFlags int flags, @UserIdInt int userId); |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 4027 | |
| 4028 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4029 | * Retrieve a set of activities that should be presented to the user as |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4030 | * similar options. This is like {@link #queryIntentActivities}, except it |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4031 | * also allows you to supply a list of more explicit Intents that you would |
| 4032 | * like to resolve to particular options, and takes care of returning the |
| 4033 | * final ResolveInfo list in a reasonable order, with no duplicates, based |
| 4034 | * on those inputs. |
| 4035 | * |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4036 | * @param caller The class name of the activity that is making the request. |
| 4037 | * This activity will never appear in the output list. Can be |
| 4038 | * null. |
| 4039 | * @param specifics An array of Intents that should be resolved to the first |
| 4040 | * specific results. Can be null. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4041 | * @param intent The desired intent as per resolveActivity(). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4042 | * @param flags Additional option flags to modify the data returned. The |
| 4043 | * most important is {@link #MATCH_DEFAULT_ONLY}, to limit the |
| 4044 | * resolution to only those activities that support the |
| 4045 | * {@link android.content.Intent#CATEGORY_DEFAULT}. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4046 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4047 | * each matching activity. The list is ordered first by all of the |
| 4048 | * intents resolved in <var>specifics</var> and then any additional |
| 4049 | * activities that can handle <var>intent</var> but did not get |
| 4050 | * included by one of the <var>specifics</var> intents. If there are |
| 4051 | * no matching activities, an empty list is returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4052 | */ |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 4053 | public abstract List<ResolveInfo> queryIntentActivityOptions(@Nullable ComponentName caller, |
| 4054 | @Nullable Intent[] specifics, Intent intent, @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4055 | |
| 4056 | /** |
| 4057 | * Retrieve all receivers that can handle a broadcast of the given intent. |
| 4058 | * |
| 4059 | * @param intent The desired intent as per resolveActivity(). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4060 | * @param flags Additional option flags to modify the data returned. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4061 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4062 | * each matching receiver, ordered from best to worst. If there are |
| 4063 | * no matching receivers, an empty list or null is returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4064 | */ |
| 4065 | public abstract List<ResolveInfo> queryBroadcastReceivers(Intent intent, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4066 | @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4067 | |
| 4068 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4069 | * Retrieve all receivers that can handle a broadcast of the given intent, |
| 4070 | * for a specific user. |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 4071 | * |
| 4072 | * @param intent The desired intent as per resolveActivity(). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4073 | * @param flags Additional option flags to modify the data returned. |
Fyodor Kupolov | 940e857 | 2016-01-26 12:03:51 -0800 | [diff] [blame] | 4074 | * @param userHandle UserHandle of the user being queried. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4075 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4076 | * each matching receiver, ordered from best to worst. If there are |
| 4077 | * no matching receivers, an empty list or null is returned. |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 4078 | * @hide |
| 4079 | */ |
Fyodor Kupolov | 940e857 | 2016-01-26 12:03:51 -0800 | [diff] [blame] | 4080 | @SystemApi |
Todd Kennedy | dbaef6d | 2017-07-24 11:28:00 -0700 | [diff] [blame] | 4081 | @RequiresPermission(Manifest.permission.INTERACT_ACROSS_USERS) |
Fyodor Kupolov | 940e857 | 2016-01-26 12:03:51 -0800 | [diff] [blame] | 4082 | public List<ResolveInfo> queryBroadcastReceiversAsUser(Intent intent, |
| 4083 | @ResolveInfoFlags int flags, UserHandle userHandle) { |
| 4084 | return queryBroadcastReceiversAsUser(intent, flags, userHandle.getIdentifier()); |
| 4085 | } |
| 4086 | |
| 4087 | /** |
| 4088 | * @hide |
| 4089 | */ |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 4090 | public abstract List<ResolveInfo> queryBroadcastReceiversAsUser(Intent intent, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4091 | @ResolveInfoFlags int flags, @UserIdInt int userId); |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 4092 | |
Fyodor Kupolov | 940e857 | 2016-01-26 12:03:51 -0800 | [diff] [blame] | 4093 | |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 4094 | /** {@hide} */ |
| 4095 | @Deprecated |
| 4096 | public List<ResolveInfo> queryBroadcastReceivers(Intent intent, |
| 4097 | @ResolveInfoFlags int flags, @UserIdInt int userId) { |
Jeff Sharkey | 6f4b2a3 | 2017-03-21 14:13:41 -0600 | [diff] [blame] | 4098 | final String msg = "Shame on you for calling the hidden API " |
| 4099 | + "queryBroadcastReceivers(). Shame!"; |
| 4100 | if (VMRuntime.getRuntime().getTargetSdkVersion() >= Build.VERSION_CODES.O) { |
| 4101 | throw new UnsupportedOperationException(msg); |
| 4102 | } else { |
| 4103 | Log.d(TAG, msg); |
| 4104 | return queryBroadcastReceiversAsUser(intent, flags, userId); |
| 4105 | } |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 4106 | } |
| 4107 | |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 4108 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4109 | * Determine the best service to handle for a given Intent. |
| 4110 | * |
| 4111 | * @param intent An intent containing all of the desired specification |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4112 | * (action, data, type, category, and/or component). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4113 | * @param flags Additional option flags to modify the data returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4114 | * @return Returns a ResolveInfo object containing the final service intent |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4115 | * that was determined to be the best action. Returns null if no |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4116 | * matching service was found. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4117 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4118 | public abstract ResolveInfo resolveService(Intent intent, @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4119 | |
| 4120 | /** |
| 4121 | * Retrieve all services that can match the given intent. |
| 4122 | * |
| 4123 | * @param intent The desired intent as per resolveService(). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4124 | * @param flags Additional option flags to modify the data returned. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4125 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4126 | * each matching service, ordered from best to worst. In other |
| 4127 | * words, the first item is what would be returned by |
| 4128 | * {@link #resolveService}. If there are no matching services, an |
| 4129 | * empty list or null is returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4130 | */ |
| 4131 | public abstract List<ResolveInfo> queryIntentServices(Intent intent, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4132 | @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4133 | |
| 4134 | /** |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4135 | * Retrieve all services that can match the given intent for a given user. |
| 4136 | * |
| 4137 | * @param intent The desired intent as per resolveService(). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4138 | * @param flags Additional option flags to modify the data returned. |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4139 | * @param userId The user id. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4140 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4141 | * each matching service, ordered from best to worst. In other |
| 4142 | * words, the first item is what would be returned by |
| 4143 | * {@link #resolveService}. If there are no matching services, an |
| 4144 | * empty list or null is returned. |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4145 | * @hide |
| 4146 | */ |
| 4147 | public abstract List<ResolveInfo> queryIntentServicesAsUser(Intent intent, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4148 | @ResolveInfoFlags int flags, @UserIdInt int userId); |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4149 | |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4150 | /** |
| 4151 | * Retrieve all providers that can match the given intent. |
| 4152 | * |
| 4153 | * @param intent An intent containing all of the desired specification |
| 4154 | * (action, data, type, category, and/or component). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4155 | * @param flags Additional option flags to modify the data returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4156 | * @param userId The user id. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4157 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4158 | * each matching provider, ordered from best to worst. If there are |
| 4159 | * no matching services, an empty list or null is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4160 | * @hide |
| 4161 | */ |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 4162 | public abstract List<ResolveInfo> queryIntentContentProvidersAsUser( |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4163 | Intent intent, @ResolveInfoFlags int flags, @UserIdInt int userId); |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 4164 | |
| 4165 | /** |
| 4166 | * Retrieve all providers that can match the given intent. |
| 4167 | * |
| 4168 | * @param intent An intent containing all of the desired specification |
| 4169 | * (action, data, type, category, and/or component). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4170 | * @param flags Additional option flags to modify the data returned. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4171 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4172 | * each matching provider, ordered from best to worst. If there are |
| 4173 | * no matching services, an empty list or null is returned. |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 4174 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4175 | public abstract List<ResolveInfo> queryIntentContentProviders(Intent intent, |
| 4176 | @ResolveInfoFlags int flags); |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 4177 | |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4178 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4179 | * Find a single content provider by its base path name. |
| 4180 | * |
| 4181 | * @param name The name of the provider to find. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4182 | * @param flags Additional option flags to modify the data returned. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4183 | * @return A {@link ProviderInfo} object containing information about the |
| 4184 | * provider. If a provider was not found, returns null. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4185 | */ |
| 4186 | public abstract ProviderInfo resolveContentProvider(String name, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4187 | @ComponentInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4188 | |
| 4189 | /** |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4190 | * Find a single content provider by its base path name. |
| 4191 | * |
| 4192 | * @param name The name of the provider to find. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4193 | * @param flags Additional option flags to modify the data returned. |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4194 | * @param userId The user id. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4195 | * @return A {@link ProviderInfo} object containing information about the |
| 4196 | * provider. If a provider was not found, returns null. |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4197 | * @hide |
| 4198 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4199 | public abstract ProviderInfo resolveContentProviderAsUser(String name, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4200 | @ComponentInfoFlags int flags, @UserIdInt int userId); |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4201 | |
| 4202 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4203 | * Retrieve content provider information. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4204 | * <p> |
| 4205 | * <em>Note: unlike most other methods, an empty result set is indicated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4206 | * by a null return instead of an empty list.</em> |
| 4207 | * |
| 4208 | * @param processName If non-null, limits the returned providers to only |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4209 | * those that are hosted by the given process. If null, all |
| 4210 | * content providers are returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4211 | * @param uid If <var>processName</var> is non-null, this is the required |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4212 | * uid owning the requested content providers. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4213 | * @param flags Additional option flags to modify the data returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4214 | * @return A list of {@link ProviderInfo} objects containing one entry for |
| 4215 | * each provider either matching <var>processName</var> or, if |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4216 | * <var>processName</var> is null, all known content providers. |
| 4217 | * <em>If there are no matching providers, null is returned.</em> |
| 4218 | */ |
| 4219 | public abstract List<ProviderInfo> queryContentProviders( |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4220 | String processName, int uid, @ComponentInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4221 | |
| 4222 | /** |
Makoto Onuki | 3275729 | 2017-02-22 14:36:59 -0800 | [diff] [blame] | 4223 | * Same as {@link #queryContentProviders}, except when {@code metaDataKey} is not null, |
| 4224 | * it only returns providers which have metadata with the {@code metaDataKey} key. |
| 4225 | * |
| 4226 | * <p>DO NOT USE the {@code metaDataKey} parameter, unless you're the contacts provider. |
| 4227 | * You really shouldn't need it. Other apps should use {@link #queryIntentContentProviders} |
| 4228 | * instead. |
| 4229 | * |
| 4230 | * <p>The {@code metaDataKey} parameter was added to allow the contacts provider to quickly |
| 4231 | * scan the GAL providers on the device. Unfortunately the discovery protocol used metadata |
| 4232 | * to mark GAL providers, rather than intent filters, so we can't use |
| 4233 | * {@link #queryIntentContentProviders} for that. |
| 4234 | * |
| 4235 | * @hide |
| 4236 | */ |
| 4237 | public List<ProviderInfo> queryContentProviders( |
| 4238 | String processName, int uid, @ComponentInfoFlags int flags, String metaDataKey) { |
| 4239 | // Provide the default implementation for mocks. |
| 4240 | return queryContentProviders(processName, uid, flags); |
| 4241 | } |
| 4242 | |
| 4243 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4244 | * Retrieve all of the information we know about a particular |
| 4245 | * instrumentation class. |
| 4246 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4247 | * @param className The full name (i.e. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4248 | * com.google.apps.contacts.InstrumentList) of an Instrumentation |
| 4249 | * class. |
| 4250 | * @param flags Additional option flags to modify the data returned. |
| 4251 | * @return An {@link InstrumentationInfo} object containing information |
| 4252 | * about the instrumentation. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4253 | * @throws NameNotFoundException if a package with the given name cannot be |
| 4254 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4255 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4256 | public abstract InstrumentationInfo getInstrumentationInfo(ComponentName className, |
| 4257 | @InstrumentationInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4258 | |
| 4259 | /** |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4260 | * Retrieve information about available instrumentation code. May be used to |
| 4261 | * retrieve either all instrumentation code, or only the code targeting a |
| 4262 | * particular package. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4263 | * |
| 4264 | * @param targetPackage If null, all instrumentation is returned; only the |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4265 | * instrumentation targeting this package name is returned. |
| 4266 | * @param flags Additional option flags to modify the data returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4267 | * @return A list of {@link InstrumentationInfo} objects containing one |
| 4268 | * entry for each matching instrumentation. If there are no |
Jesse Hall | f77a34f | 2016-02-04 18:41:33 -0800 | [diff] [blame] | 4269 | * instrumentation available, returns an empty list. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4270 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4271 | public abstract List<InstrumentationInfo> queryInstrumentation(String targetPackage, |
| 4272 | @InstrumentationInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4273 | |
| 4274 | /** |
| 4275 | * Retrieve an image from a package. This is a low-level API used by |
| 4276 | * the various package manager info structures (such as |
| 4277 | * {@link ComponentInfo} to implement retrieval of their associated |
| 4278 | * icon. |
| 4279 | * |
| 4280 | * @param packageName The name of the package that this icon is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4281 | * Cannot be null. |
| 4282 | * @param resid The resource identifier of the desired image. Cannot be 0. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4283 | * @param appInfo Overall information about <var>packageName</var>. This |
| 4284 | * may be null, in which case the application information will be retrieved |
| 4285 | * for you if needed; if you already have this information around, it can |
| 4286 | * be much more efficient to supply it here. |
| 4287 | * |
| 4288 | * @return Returns a Drawable holding the requested image. Returns null if |
| 4289 | * an image could not be found for any reason. |
| 4290 | */ |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 4291 | public abstract Drawable getDrawable(String packageName, @DrawableRes int resid, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4292 | ApplicationInfo appInfo); |
| 4293 | |
| 4294 | /** |
| 4295 | * Retrieve the icon associated with an activity. Given the full name of |
| 4296 | * an activity, retrieves the information about it and calls |
| 4297 | * {@link ComponentInfo#loadIcon ComponentInfo.loadIcon()} to return its icon. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4298 | * If the activity cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4299 | * |
| 4300 | * @param activityName Name of the activity whose icon is to be retrieved. |
| 4301 | * |
| 4302 | * @return Returns the image of the icon, or the default activity icon if |
| 4303 | * it could not be found. Does not return null. |
| 4304 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4305 | * activity could not be loaded. |
| 4306 | * |
| 4307 | * @see #getActivityIcon(Intent) |
| 4308 | */ |
| 4309 | public abstract Drawable getActivityIcon(ComponentName activityName) |
| 4310 | throws NameNotFoundException; |
| 4311 | |
| 4312 | /** |
| 4313 | * Retrieve the icon associated with an Intent. If intent.getClassName() is |
| 4314 | * set, this simply returns the result of |
| 4315 | * getActivityIcon(intent.getClassName()). Otherwise it resolves the intent's |
| 4316 | * component and returns the icon associated with the resolved component. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4317 | * If intent.getClassName() cannot be found or the Intent cannot be resolved |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4318 | * to a component, NameNotFoundException is thrown. |
| 4319 | * |
| 4320 | * @param intent The intent for which you would like to retrieve an icon. |
| 4321 | * |
| 4322 | * @return Returns the image of the icon, or the default activity icon if |
| 4323 | * it could not be found. Does not return null. |
| 4324 | * @throws NameNotFoundException Thrown if the resources for application |
| 4325 | * matching the given intent could not be loaded. |
| 4326 | * |
| 4327 | * @see #getActivityIcon(ComponentName) |
| 4328 | */ |
| 4329 | public abstract Drawable getActivityIcon(Intent intent) |
| 4330 | throws NameNotFoundException; |
| 4331 | |
| 4332 | /** |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4333 | * Retrieve the banner associated with an activity. Given the full name of |
| 4334 | * an activity, retrieves the information about it and calls |
| 4335 | * {@link ComponentInfo#loadIcon ComponentInfo.loadIcon()} to return its |
| 4336 | * banner. If the activity cannot be found, NameNotFoundException is thrown. |
| 4337 | * |
| 4338 | * @param activityName Name of the activity whose banner is to be retrieved. |
| 4339 | * @return Returns the image of the banner, or null if the activity has no |
| 4340 | * banner specified. |
| 4341 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4342 | * activity could not be loaded. |
| 4343 | * @see #getActivityBanner(Intent) |
| 4344 | */ |
| 4345 | public abstract Drawable getActivityBanner(ComponentName activityName) |
| 4346 | throws NameNotFoundException; |
| 4347 | |
| 4348 | /** |
| 4349 | * Retrieve the banner associated with an Intent. If intent.getClassName() |
| 4350 | * is set, this simply returns the result of |
| 4351 | * getActivityBanner(intent.getClassName()). Otherwise it resolves the |
| 4352 | * intent's component and returns the banner associated with the resolved |
| 4353 | * component. If intent.getClassName() cannot be found or the Intent cannot |
| 4354 | * be resolved to a component, NameNotFoundException is thrown. |
| 4355 | * |
| 4356 | * @param intent The intent for which you would like to retrieve a banner. |
| 4357 | * @return Returns the image of the banner, or null if the activity has no |
| 4358 | * banner specified. |
| 4359 | * @throws NameNotFoundException Thrown if the resources for application |
| 4360 | * matching the given intent could not be loaded. |
| 4361 | * @see #getActivityBanner(ComponentName) |
| 4362 | */ |
| 4363 | public abstract Drawable getActivityBanner(Intent intent) |
| 4364 | throws NameNotFoundException; |
| 4365 | |
| 4366 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4367 | * Return the generic icon for an activity that is used when no specific |
| 4368 | * icon is defined. |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 4369 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4370 | * @return Drawable Image of the icon. |
| 4371 | */ |
| 4372 | public abstract Drawable getDefaultActivityIcon(); |
| 4373 | |
| 4374 | /** |
| 4375 | * Retrieve the icon associated with an application. If it has not defined |
| 4376 | * an icon, the default app icon is returned. Does not return null. |
| 4377 | * |
| 4378 | * @param info Information about application being queried. |
| 4379 | * |
| 4380 | * @return Returns the image of the icon, or the default application icon |
| 4381 | * if it could not be found. |
| 4382 | * |
| 4383 | * @see #getApplicationIcon(String) |
| 4384 | */ |
| 4385 | public abstract Drawable getApplicationIcon(ApplicationInfo info); |
| 4386 | |
| 4387 | /** |
| 4388 | * Retrieve the icon associated with an application. Given the name of the |
| 4389 | * application's package, retrieves the information about it and calls |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4390 | * getApplicationIcon() to return its icon. If the application cannot be |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4391 | * found, NameNotFoundException is thrown. |
| 4392 | * |
| 4393 | * @param packageName Name of the package whose application icon is to be |
| 4394 | * retrieved. |
| 4395 | * |
| 4396 | * @return Returns the image of the icon, or the default application icon |
| 4397 | * if it could not be found. Does not return null. |
| 4398 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4399 | * application could not be loaded. |
| 4400 | * |
| 4401 | * @see #getApplicationIcon(ApplicationInfo) |
| 4402 | */ |
| 4403 | public abstract Drawable getApplicationIcon(String packageName) |
| 4404 | throws NameNotFoundException; |
| 4405 | |
| 4406 | /** |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4407 | * Retrieve the banner associated with an application. |
| 4408 | * |
| 4409 | * @param info Information about application being queried. |
| 4410 | * @return Returns the image of the banner or null if the application has no |
| 4411 | * banner specified. |
| 4412 | * @see #getApplicationBanner(String) |
| 4413 | */ |
| 4414 | public abstract Drawable getApplicationBanner(ApplicationInfo info); |
| 4415 | |
| 4416 | /** |
| 4417 | * Retrieve the banner associated with an application. Given the name of the |
| 4418 | * application's package, retrieves the information about it and calls |
| 4419 | * getApplicationIcon() to return its banner. If the application cannot be |
| 4420 | * found, NameNotFoundException is thrown. |
| 4421 | * |
| 4422 | * @param packageName Name of the package whose application banner is to be |
| 4423 | * retrieved. |
| 4424 | * @return Returns the image of the banner or null if the application has no |
| 4425 | * banner specified. |
| 4426 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4427 | * application could not be loaded. |
| 4428 | * @see #getApplicationBanner(ApplicationInfo) |
| 4429 | */ |
| 4430 | public abstract Drawable getApplicationBanner(String packageName) |
| 4431 | throws NameNotFoundException; |
| 4432 | |
| 4433 | /** |
| 4434 | * Retrieve the logo associated with an activity. Given the full name of an |
| 4435 | * activity, retrieves the information about it and calls |
| 4436 | * {@link ComponentInfo#loadLogo ComponentInfo.loadLogo()} to return its |
| 4437 | * logo. If the activity cannot be found, NameNotFoundException is thrown. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4438 | * |
| 4439 | * @param activityName Name of the activity whose logo is to be retrieved. |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4440 | * @return Returns the image of the logo or null if the activity has no logo |
| 4441 | * specified. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4442 | * @throws NameNotFoundException Thrown if the resources for the given |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4443 | * activity could not be loaded. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4444 | * @see #getActivityLogo(Intent) |
| 4445 | */ |
| 4446 | public abstract Drawable getActivityLogo(ComponentName activityName) |
| 4447 | throws NameNotFoundException; |
| 4448 | |
| 4449 | /** |
| 4450 | * Retrieve the logo associated with an Intent. If intent.getClassName() is |
| 4451 | * set, this simply returns the result of |
| 4452 | * getActivityLogo(intent.getClassName()). Otherwise it resolves the intent's |
| 4453 | * component and returns the logo associated with the resolved component. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4454 | * If intent.getClassName() cannot be found or the Intent cannot be resolved |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4455 | * to a component, NameNotFoundException is thrown. |
| 4456 | * |
| 4457 | * @param intent The intent for which you would like to retrieve a logo. |
| 4458 | * |
| 4459 | * @return Returns the image of the logo, or null if the activity has no |
| 4460 | * logo specified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4461 | * |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4462 | * @throws NameNotFoundException Thrown if the resources for application |
| 4463 | * matching the given intent could not be loaded. |
| 4464 | * |
| 4465 | * @see #getActivityLogo(ComponentName) |
| 4466 | */ |
| 4467 | public abstract Drawable getActivityLogo(Intent intent) |
| 4468 | throws NameNotFoundException; |
| 4469 | |
| 4470 | /** |
| 4471 | * Retrieve the logo associated with an application. If it has not specified |
| 4472 | * a logo, this method returns null. |
| 4473 | * |
| 4474 | * @param info Information about application being queried. |
| 4475 | * |
| 4476 | * @return Returns the image of the logo, or null if no logo is specified |
| 4477 | * by the application. |
| 4478 | * |
| 4479 | * @see #getApplicationLogo(String) |
| 4480 | */ |
| 4481 | public abstract Drawable getApplicationLogo(ApplicationInfo info); |
| 4482 | |
| 4483 | /** |
| 4484 | * Retrieve the logo associated with an application. Given the name of the |
| 4485 | * application's package, retrieves the information about it and calls |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4486 | * getApplicationLogo() to return its logo. If the application cannot be |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4487 | * found, NameNotFoundException is thrown. |
| 4488 | * |
| 4489 | * @param packageName Name of the package whose application logo is to be |
| 4490 | * retrieved. |
| 4491 | * |
| 4492 | * @return Returns the image of the logo, or null if no application logo |
| 4493 | * has been specified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4494 | * |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4495 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4496 | * application could not be loaded. |
| 4497 | * |
| 4498 | * @see #getApplicationLogo(ApplicationInfo) |
| 4499 | */ |
| 4500 | public abstract Drawable getApplicationLogo(String packageName) |
| 4501 | throws NameNotFoundException; |
| 4502 | |
| 4503 | /** |
Tony Mak | 4dc008c | 2016-03-16 10:46:49 +0000 | [diff] [blame] | 4504 | * If the target user is a managed profile, then this returns a badged copy of the given icon |
| 4505 | * to be able to distinguish it from the original icon. For badging an arbitrary drawable use |
Kenny Guy | df77d71 | 2015-05-29 17:02:22 +0100 | [diff] [blame] | 4506 | * {@link #getUserBadgedDrawableForDensity( |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4507 | * android.graphics.drawable.Drawable, UserHandle, android.graphics.Rect, int)}. |
| 4508 | * <p> |
| 4509 | * If the original drawable is a BitmapDrawable and the backing bitmap is |
| 4510 | * mutable as per {@link android.graphics.Bitmap#isMutable()}, the badging |
| 4511 | * is performed in place and the original drawable is returned. |
| 4512 | * </p> |
| 4513 | * |
| 4514 | * @param icon The icon to badge. |
| 4515 | * @param user The target user. |
| 4516 | * @return A drawable that combines the original icon and a badge as |
| 4517 | * determined by the system. |
| 4518 | */ |
| 4519 | public abstract Drawable getUserBadgedIcon(Drawable icon, UserHandle user); |
| 4520 | |
| 4521 | /** |
| 4522 | * If the target user is a managed profile of the calling user or the caller |
| 4523 | * is itself a managed profile, then this returns a badged copy of the given |
| 4524 | * drawable allowing the user to distinguish it from the original drawable. |
| 4525 | * The caller can specify the location in the bounds of the drawable to be |
| 4526 | * badged where the badge should be applied as well as the density of the |
| 4527 | * badge to be used. |
| 4528 | * <p> |
| 4529 | * If the original drawable is a BitmapDrawable and the backing bitmap is |
Vadim Tryshev | 66ae66a | 2016-02-18 15:41:21 -0800 | [diff] [blame] | 4530 | * mutable as per {@link android.graphics.Bitmap#isMutable()}, the badging |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4531 | * is performed in place and the original drawable is returned. |
| 4532 | * </p> |
| 4533 | * |
| 4534 | * @param drawable The drawable to badge. |
| 4535 | * @param user The target user. |
| 4536 | * @param badgeLocation Where in the bounds of the badged drawable to place |
Vadim Tryshev | 66ae66a | 2016-02-18 15:41:21 -0800 | [diff] [blame] | 4537 | * the badge. If it's {@code null}, the badge is applied on top of the entire |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4538 | * drawable being badged. |
| 4539 | * @param badgeDensity The optional desired density for the badge as per |
Vadim Tryshev | 66ae66a | 2016-02-18 15:41:21 -0800 | [diff] [blame] | 4540 | * {@link android.util.DisplayMetrics#densityDpi}. If it's not positive, |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4541 | * the density of the display is used. |
| 4542 | * @return A drawable that combines the original drawable and a badge as |
| 4543 | * determined by the system. |
| 4544 | */ |
| 4545 | public abstract Drawable getUserBadgedDrawableForDensity(Drawable drawable, |
| 4546 | UserHandle user, Rect badgeLocation, int badgeDensity); |
| 4547 | |
| 4548 | /** |
| 4549 | * If the target user is a managed profile of the calling user or the caller |
| 4550 | * is itself a managed profile, then this returns a drawable to use as a small |
| 4551 | * icon to include in a view to distinguish it from the original icon. |
| 4552 | * |
| 4553 | * @param user The target user. |
| 4554 | * @param density The optional desired density for the badge as per |
| 4555 | * {@link android.util.DisplayMetrics#densityDpi}. If not provided |
| 4556 | * the density of the current display is used. |
| 4557 | * @return the drawable or null if no drawable is required. |
| 4558 | * @hide |
| 4559 | */ |
| 4560 | public abstract Drawable getUserBadgeForDensity(UserHandle user, int density); |
| 4561 | |
| 4562 | /** |
| 4563 | * If the target user is a managed profile of the calling user or the caller |
Selim Cinek | e6ff946 | 2016-01-15 15:07:06 -0800 | [diff] [blame] | 4564 | * is itself a managed profile, then this returns a drawable to use as a small |
| 4565 | * icon to include in a view to distinguish it from the original icon. This version |
| 4566 | * doesn't have background protection and should be used over a light background instead of |
| 4567 | * a badge. |
| 4568 | * |
| 4569 | * @param user The target user. |
| 4570 | * @param density The optional desired density for the badge as per |
| 4571 | * {@link android.util.DisplayMetrics#densityDpi}. If not provided |
| 4572 | * the density of the current display is used. |
| 4573 | * @return the drawable or null if no drawable is required. |
| 4574 | * @hide |
| 4575 | */ |
| 4576 | public abstract Drawable getUserBadgeForDensityNoBackground(UserHandle user, int density); |
| 4577 | |
| 4578 | /** |
| 4579 | * If the target user is a managed profile of the calling user or the caller |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4580 | * is itself a managed profile, then this returns a copy of the label with |
| 4581 | * badging for accessibility services like talkback. E.g. passing in "Email" |
| 4582 | * and it might return "Work Email" for Email in the work profile. |
| 4583 | * |
| 4584 | * @param label The label to change. |
| 4585 | * @param user The target user. |
| 4586 | * @return A label that combines the original label and a badge as |
| 4587 | * determined by the system. |
| 4588 | */ |
| 4589 | public abstract CharSequence getUserBadgedLabel(CharSequence label, UserHandle user); |
| 4590 | |
| 4591 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4592 | * Retrieve text from a package. This is a low-level API used by |
| 4593 | * the various package manager info structures (such as |
| 4594 | * {@link ComponentInfo} to implement retrieval of their associated |
| 4595 | * labels and other text. |
| 4596 | * |
| 4597 | * @param packageName The name of the package that this text is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4598 | * Cannot be null. |
| 4599 | * @param resid The resource identifier of the desired text. Cannot be 0. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4600 | * @param appInfo Overall information about <var>packageName</var>. This |
| 4601 | * may be null, in which case the application information will be retrieved |
| 4602 | * for you if needed; if you already have this information around, it can |
| 4603 | * be much more efficient to supply it here. |
| 4604 | * |
| 4605 | * @return Returns a CharSequence holding the requested text. Returns null |
| 4606 | * if the text could not be found for any reason. |
| 4607 | */ |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 4608 | public abstract CharSequence getText(String packageName, @StringRes int resid, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4609 | ApplicationInfo appInfo); |
| 4610 | |
| 4611 | /** |
| 4612 | * Retrieve an XML file from a package. This is a low-level API used to |
| 4613 | * retrieve XML meta data. |
| 4614 | * |
| 4615 | * @param packageName The name of the package that this xml is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4616 | * Cannot be null. |
| 4617 | * @param resid The resource identifier of the desired xml. Cannot be 0. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4618 | * @param appInfo Overall information about <var>packageName</var>. This |
| 4619 | * may be null, in which case the application information will be retrieved |
| 4620 | * for you if needed; if you already have this information around, it can |
| 4621 | * be much more efficient to supply it here. |
| 4622 | * |
| 4623 | * @return Returns an XmlPullParser allowing you to parse out the XML |
| 4624 | * data. Returns null if the xml resource could not be found for any |
| 4625 | * reason. |
| 4626 | */ |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 4627 | public abstract XmlResourceParser getXml(String packageName, @XmlRes int resid, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4628 | ApplicationInfo appInfo); |
| 4629 | |
| 4630 | /** |
| 4631 | * Return the label to use for this application. |
| 4632 | * |
| 4633 | * @return Returns the label associated with this application, or null if |
| 4634 | * it could not be found for any reason. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4635 | * @param info The application to get the label of. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4636 | */ |
| 4637 | public abstract CharSequence getApplicationLabel(ApplicationInfo info); |
| 4638 | |
| 4639 | /** |
| 4640 | * Retrieve the resources associated with an activity. Given the full |
| 4641 | * name of an activity, retrieves the information about it and calls |
| 4642 | * getResources() to return its application's resources. If the activity |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4643 | * cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4644 | * |
| 4645 | * @param activityName Name of the activity whose resources are to be |
| 4646 | * retrieved. |
| 4647 | * |
| 4648 | * @return Returns the application's Resources. |
| 4649 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4650 | * application could not be loaded. |
| 4651 | * |
| 4652 | * @see #getResourcesForApplication(ApplicationInfo) |
| 4653 | */ |
| 4654 | public abstract Resources getResourcesForActivity(ComponentName activityName) |
| 4655 | throws NameNotFoundException; |
| 4656 | |
| 4657 | /** |
| 4658 | * Retrieve the resources for an application. Throws NameNotFoundException |
| 4659 | * if the package is no longer installed. |
| 4660 | * |
| 4661 | * @param app Information about the desired application. |
| 4662 | * |
| 4663 | * @return Returns the application's Resources. |
| 4664 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4665 | * application could not be loaded (most likely because it was uninstalled). |
| 4666 | */ |
| 4667 | public abstract Resources getResourcesForApplication(ApplicationInfo app) |
| 4668 | throws NameNotFoundException; |
| 4669 | |
| 4670 | /** |
| 4671 | * Retrieve the resources associated with an application. Given the full |
| 4672 | * package name of an application, retrieves the information about it and |
| 4673 | * calls getResources() to return its application's resources. If the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4674 | * appPackageName cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4675 | * |
| 4676 | * @param appPackageName Package name of the application whose resources |
| 4677 | * are to be retrieved. |
| 4678 | * |
| 4679 | * @return Returns the application's Resources. |
| 4680 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4681 | * application could not be loaded. |
| 4682 | * |
| 4683 | * @see #getResourcesForApplication(ApplicationInfo) |
| 4684 | */ |
| 4685 | public abstract Resources getResourcesForApplication(String appPackageName) |
| 4686 | throws NameNotFoundException; |
| 4687 | |
Amith Yamasani | 98edc95 | 2012-09-25 14:09:27 -0700 | [diff] [blame] | 4688 | /** @hide */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4689 | public abstract Resources getResourcesForApplicationAsUser(String appPackageName, |
| 4690 | @UserIdInt int userId) throws NameNotFoundException; |
Amith Yamasani | 98edc95 | 2012-09-25 14:09:27 -0700 | [diff] [blame] | 4691 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4692 | /** |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4693 | * Retrieve overall information about an application package defined in a |
| 4694 | * package archive file |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4695 | * |
| 4696 | * @param archiveFilePath The path to the archive file |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4697 | * @param flags Additional option flags to modify the data returned. |
| 4698 | * @return A PackageInfo object containing information about the package |
| 4699 | * archive. If the package could not be parsed, returns null. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4700 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4701 | public PackageInfo getPackageArchiveInfo(String archiveFilePath, @PackageInfoFlags int flags) { |
Jeff Sharkey | 275e085 | 2014-06-17 18:18:49 -0700 | [diff] [blame] | 4702 | final PackageParser parser = new PackageParser(); |
Dianne Hackborn | cd154e9 | 2017-02-28 17:37:35 -0800 | [diff] [blame] | 4703 | parser.setCallback(new PackageParser.CallbackImpl(this)); |
Jeff Sharkey | 275e085 | 2014-06-17 18:18:49 -0700 | [diff] [blame] | 4704 | final File apkFile = new File(archiveFilePath); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 4705 | try { |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4706 | if ((flags & (MATCH_DIRECT_BOOT_UNAWARE | MATCH_DIRECT_BOOT_AWARE)) != 0) { |
Jeff Sharkey | c313251 | 2016-01-12 14:06:58 -0700 | [diff] [blame] | 4707 | // Caller expressed an explicit opinion about what encryption |
| 4708 | // aware/unaware components they want to see, so fall through and |
| 4709 | // give them what they want |
| 4710 | } else { |
| 4711 | // Caller expressed no opinion, so match everything |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4712 | flags |= MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE; |
Jeff Sharkey | c313251 | 2016-01-12 14:06:58 -0700 | [diff] [blame] | 4713 | } |
| 4714 | |
Jeff Sharkey | 275e085 | 2014-06-17 18:18:49 -0700 | [diff] [blame] | 4715 | PackageParser.Package pkg = parser.parseMonolithicPackage(apkFile, 0); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 4716 | if ((flags & GET_SIGNATURES) != 0) { |
Svet Ganov | 354cd3c | 2015-12-17 11:35:04 -0800 | [diff] [blame] | 4717 | PackageParser.collectCertificates(pkg, 0); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 4718 | } |
| 4719 | PackageUserState state = new PackageUserState(); |
| 4720 | return PackageParser.generatePackageInfo(pkg, null, flags, 0, 0, null, state); |
| 4721 | } catch (PackageParserException e) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4722 | return null; |
| 4723 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4724 | } |
| 4725 | |
| 4726 | /** |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4727 | * If there is already an application with the given package name installed |
| 4728 | * on the system for other users, also install it for the calling user. |
| 4729 | * @hide |
| 4730 | */ |
Sunny Goyal | 07f41fb | 2017-08-09 02:56:34 -0700 | [diff] [blame] | 4731 | @SystemApi |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4732 | public abstract int installExistingPackage(String packageName) throws NameNotFoundException; |
| 4733 | |
| 4734 | /** |
| 4735 | * If there is already an application with the given package name installed |
Sunny Goyal | a31a74b | 2017-05-11 15:59:19 -0700 | [diff] [blame] | 4736 | * on the system for other users, also install it for the calling user. |
| 4737 | * @hide |
| 4738 | */ |
Sunny Goyal | 07f41fb | 2017-08-09 02:56:34 -0700 | [diff] [blame] | 4739 | @SystemApi |
Sunny Goyal | a31a74b | 2017-05-11 15:59:19 -0700 | [diff] [blame] | 4740 | public abstract int installExistingPackage(String packageName, @InstallReason int installReason) |
| 4741 | throws NameNotFoundException; |
| 4742 | |
| 4743 | /** |
| 4744 | * If there is already an application with the given package name installed |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4745 | * on the system for other users, also install it for the specified user. |
| 4746 | * @hide |
| 4747 | */ |
| 4748 | @RequiresPermission(anyOf = { |
| 4749 | Manifest.permission.INSTALL_PACKAGES, |
| 4750 | Manifest.permission.INTERACT_ACROSS_USERS_FULL}) |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4751 | public abstract int installExistingPackageAsUser(String packageName, @UserIdInt int userId) |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4752 | throws NameNotFoundException; |
| 4753 | |
| 4754 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4755 | * Allows a package listening to the |
| 4756 | * {@link Intent#ACTION_PACKAGE_NEEDS_VERIFICATION package verification |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 4757 | * broadcast} to respond to the package manager. The response must include |
| 4758 | * the {@code verificationCode} which is one of |
| 4759 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 4760 | * {@link PackageManager#VERIFICATION_REJECT}. |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4761 | * |
| 4762 | * @param id pending package identifier as passed via the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4763 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 4764 | * @param verificationCode either {@link PackageManager#VERIFICATION_ALLOW} |
| 4765 | * or {@link PackageManager#VERIFICATION_REJECT}. |
rich cannings | 7e67151 | 2012-08-27 14:44:16 -0700 | [diff] [blame] | 4766 | * @throws SecurityException if the caller does not have the |
Dianne Hackborn | 8832c18 | 2012-09-17 17:20:24 -0700 | [diff] [blame] | 4767 | * PACKAGE_VERIFICATION_AGENT permission. |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4768 | */ |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 4769 | public abstract void verifyPendingInstall(int id, int verificationCode); |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4770 | |
| 4771 | /** |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4772 | * Allows a package listening to the |
| 4773 | * {@link Intent#ACTION_PACKAGE_NEEDS_VERIFICATION package verification |
| 4774 | * broadcast} to extend the default timeout for a response and declare what |
| 4775 | * action to perform after the timeout occurs. The response must include |
| 4776 | * the {@code verificationCodeAtTimeout} which is one of |
| 4777 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 4778 | * {@link PackageManager#VERIFICATION_REJECT}. |
| 4779 | * |
| 4780 | * This method may only be called once per package id. Additional calls |
| 4781 | * will have no effect. |
| 4782 | * |
| 4783 | * @param id pending package identifier as passed via the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4784 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4785 | * @param verificationCodeAtTimeout either |
| 4786 | * {@link PackageManager#VERIFICATION_ALLOW} or |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 4787 | * {@link PackageManager#VERIFICATION_REJECT}. If |
| 4788 | * {@code verificationCodeAtTimeout} is neither |
| 4789 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 4790 | * {@link PackageManager#VERIFICATION_REJECT}, then |
| 4791 | * {@code verificationCodeAtTimeout} will default to |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4792 | * {@link PackageManager#VERIFICATION_REJECT}. |
| 4793 | * @param millisecondsToDelay the amount of time requested for the timeout. |
| 4794 | * Must be positive and less than |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 4795 | * {@link PackageManager#MAXIMUM_VERIFICATION_TIMEOUT}. If |
| 4796 | * {@code millisecondsToDelay} is out of bounds, |
| 4797 | * {@code millisecondsToDelay} will be set to the closest in |
| 4798 | * bounds value; namely, 0 or |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4799 | * {@link PackageManager#MAXIMUM_VERIFICATION_TIMEOUT}. |
rich cannings | 7e67151 | 2012-08-27 14:44:16 -0700 | [diff] [blame] | 4800 | * @throws SecurityException if the caller does not have the |
Dianne Hackborn | 8832c18 | 2012-09-17 17:20:24 -0700 | [diff] [blame] | 4801 | * PACKAGE_VERIFICATION_AGENT permission. |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4802 | */ |
| 4803 | public abstract void extendVerificationTimeout(int id, |
| 4804 | int verificationCodeAtTimeout, long millisecondsToDelay); |
| 4805 | |
| 4806 | /** |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4807 | * Allows a package listening to the |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 4808 | * {@link Intent#ACTION_INTENT_FILTER_NEEDS_VERIFICATION} intent filter verification |
| 4809 | * broadcast to respond to the package manager. The response must include |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4810 | * the {@code verificationCode} which is one of |
| 4811 | * {@link PackageManager#INTENT_FILTER_VERIFICATION_SUCCESS} or |
| 4812 | * {@link PackageManager#INTENT_FILTER_VERIFICATION_FAILURE}. |
| 4813 | * |
| 4814 | * @param verificationId pending package identifier as passed via the |
| 4815 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
| 4816 | * @param verificationCode either {@link PackageManager#INTENT_FILTER_VERIFICATION_SUCCESS} |
| 4817 | * or {@link PackageManager#INTENT_FILTER_VERIFICATION_FAILURE}. |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 4818 | * @param failedDomains a list of failed domains if the verificationCode is |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4819 | * {@link PackageManager#INTENT_FILTER_VERIFICATION_FAILURE}, otherwise null; |
| 4820 | * @throws SecurityException if the caller does not have the |
| 4821 | * INTENT_FILTER_VERIFICATION_AGENT permission. |
| 4822 | * |
| 4823 | * @hide |
| 4824 | */ |
Fabrice Di Meglio | ef741da | 2015-05-12 16:31:38 -0700 | [diff] [blame] | 4825 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 4826 | @RequiresPermission(android.Manifest.permission.INTENT_FILTER_VERIFICATION_AGENT) |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4827 | public abstract void verifyIntentFilter(int verificationId, int verificationCode, |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 4828 | List<String> failedDomains); |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4829 | |
| 4830 | /** |
| 4831 | * Get the status of a Domain Verification Result for an IntentFilter. This is |
| 4832 | * related to the {@link android.content.IntentFilter#setAutoVerify(boolean)} and |
| 4833 | * {@link android.content.IntentFilter#getAutoVerify()} |
| 4834 | * |
| 4835 | * This is used by the ResolverActivity to change the status depending on what the User select |
| 4836 | * in the Disambiguation Dialog and also used by the Settings App for changing the default App |
| 4837 | * for a domain. |
| 4838 | * |
| 4839 | * @param packageName The package name of the Activity associated with the IntentFilter. |
| 4840 | * @param userId The user id. |
| 4841 | * |
| 4842 | * @return The status to set to. This can be |
| 4843 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK} or |
| 4844 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS} or |
| 4845 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER} or |
| 4846 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED} |
| 4847 | * |
| 4848 | * @hide |
| 4849 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 4850 | @SystemApi |
Todd Kennedy | dbaef6d | 2017-07-24 11:28:00 -0700 | [diff] [blame] | 4851 | @RequiresPermission(Manifest.permission.INTERACT_ACROSS_USERS_FULL) |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4852 | public abstract int getIntentVerificationStatusAsUser(String packageName, @UserIdInt int userId); |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4853 | |
| 4854 | /** |
| 4855 | * Allow to change the status of a Intent Verification status for all IntentFilter of an App. |
| 4856 | * This is related to the {@link android.content.IntentFilter#setAutoVerify(boolean)} and |
| 4857 | * {@link android.content.IntentFilter#getAutoVerify()} |
| 4858 | * |
| 4859 | * This is used by the ResolverActivity to change the status depending on what the User select |
| 4860 | * in the Disambiguation Dialog and also used by the Settings App for changing the default App |
| 4861 | * for a domain. |
| 4862 | * |
| 4863 | * @param packageName The package name of the Activity associated with the IntentFilter. |
| 4864 | * @param status The status to set to. This can be |
| 4865 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK} or |
| 4866 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS} or |
| 4867 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER} |
| 4868 | * @param userId The user id. |
| 4869 | * |
| 4870 | * @return true if the status has been set. False otherwise. |
| 4871 | * |
| 4872 | * @hide |
| 4873 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 4874 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 4875 | @RequiresPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS) |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 4876 | public abstract boolean updateIntentVerificationStatusAsUser(String packageName, int status, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4877 | @UserIdInt int userId); |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4878 | |
| 4879 | /** |
| 4880 | * Get the list of IntentFilterVerificationInfo for a specific package and User. |
| 4881 | * |
| 4882 | * @param packageName the package name. When this parameter is set to a non null value, |
| 4883 | * the results will be filtered by the package name provided. |
| 4884 | * Otherwise, there will be no filtering and it will return a list |
Fabrice Di Meglio | 0788595 | 2015-04-06 19:41:28 -0700 | [diff] [blame] | 4885 | * corresponding for all packages |
| 4886 | * |
| 4887 | * @return a list of IntentFilterVerificationInfo for a specific package. |
| 4888 | * |
| 4889 | * @hide |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4890 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 4891 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4892 | public abstract List<IntentFilterVerificationInfo> getIntentFilterVerifications( |
| 4893 | String packageName); |
| 4894 | |
| 4895 | /** |
Fabrice Di Meglio | 0788595 | 2015-04-06 19:41:28 -0700 | [diff] [blame] | 4896 | * Get the list of IntentFilter for a specific package. |
| 4897 | * |
| 4898 | * @param packageName the package name. This parameter is set to a non null value, |
| 4899 | * the list will contain all the IntentFilter for that package. |
| 4900 | * Otherwise, the list will be empty. |
| 4901 | * |
| 4902 | * @return a list of IntentFilter for a specific package. |
| 4903 | * |
| 4904 | * @hide |
| 4905 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 4906 | @SystemApi |
Fabrice Di Meglio | 0788595 | 2015-04-06 19:41:28 -0700 | [diff] [blame] | 4907 | public abstract List<IntentFilter> getAllIntentFilters(String packageName); |
| 4908 | |
| 4909 | /** |
Fabrice Di Meglio | 6227172 | 2015-04-10 17:24:02 -0700 | [diff] [blame] | 4910 | * Get the default Browser package name for a specific user. |
| 4911 | * |
| 4912 | * @param userId The user id. |
| 4913 | * |
| 4914 | * @return the package name of the default Browser for the specified user. If the user id passed |
| 4915 | * is -1 (all users) it will return a null value. |
| 4916 | * |
| 4917 | * @hide |
| 4918 | */ |
Jeff Sharkey | a73b8fd | 2016-01-06 17:02:08 -0700 | [diff] [blame] | 4919 | @TestApi |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 4920 | @SystemApi |
Todd Kennedy | dbaef6d | 2017-07-24 11:28:00 -0700 | [diff] [blame] | 4921 | @RequiresPermission(Manifest.permission.INTERACT_ACROSS_USERS_FULL) |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4922 | public abstract String getDefaultBrowserPackageNameAsUser(@UserIdInt int userId); |
Fabrice Di Meglio | 6227172 | 2015-04-10 17:24:02 -0700 | [diff] [blame] | 4923 | |
| 4924 | /** |
| 4925 | * Set the default Browser package name for a specific user. |
| 4926 | * |
| 4927 | * @param packageName The package name of the default Browser. |
| 4928 | * @param userId The user id. |
| 4929 | * |
| 4930 | * @return true if the default Browser for the specified user has been set, |
| 4931 | * otherwise return false. If the user id passed is -1 (all users) this call will not |
| 4932 | * do anything and just return false. |
| 4933 | * |
| 4934 | * @hide |
| 4935 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 4936 | @SystemApi |
Todd Kennedy | dbaef6d | 2017-07-24 11:28:00 -0700 | [diff] [blame] | 4937 | @RequiresPermission(allOf = { |
| 4938 | Manifest.permission.SET_PREFERRED_APPLICATIONS, |
| 4939 | Manifest.permission.INTERACT_ACROSS_USERS_FULL}) |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4940 | public abstract boolean setDefaultBrowserPackageNameAsUser(String packageName, |
| 4941 | @UserIdInt int userId); |
Fabrice Di Meglio | 6227172 | 2015-04-10 17:24:02 -0700 | [diff] [blame] | 4942 | |
| 4943 | /** |
Dianne Hackborn | 880119b | 2010-11-18 22:26:40 -0800 | [diff] [blame] | 4944 | * Change the installer associated with a given package. There are limitations |
| 4945 | * on how the installer package can be changed; in particular: |
| 4946 | * <ul> |
| 4947 | * <li> A SecurityException will be thrown if <var>installerPackageName</var> |
| 4948 | * is not signed with the same certificate as the calling application. |
| 4949 | * <li> A SecurityException will be thrown if <var>targetPackage</var> already |
| 4950 | * has an installer package, and that installer package is not signed with |
| 4951 | * the same certificate as the calling application. |
| 4952 | * </ul> |
| 4953 | * |
| 4954 | * @param targetPackage The installed package whose installer will be changed. |
| 4955 | * @param installerPackageName The package name of the new installer. May be |
| 4956 | * null to clear the association. |
| 4957 | */ |
| 4958 | public abstract void setInstallerPackageName(String targetPackage, |
| 4959 | String installerPackageName); |
| 4960 | |
Todd Kennedy | ab53289 | 2017-03-08 14:19:49 -0800 | [diff] [blame] | 4961 | /** @hide */ |
| 4962 | @SystemApi |
| 4963 | @RequiresPermission(Manifest.permission.INSTALL_PACKAGES) |
| 4964 | public abstract void setUpdateAvailable(String packageName, boolean updateAvaialble); |
| 4965 | |
Dianne Hackborn | 880119b | 2010-11-18 22:26:40 -0800 | [diff] [blame] | 4966 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4967 | * Attempts to delete a package. Since this may take a little while, the |
| 4968 | * result will be posted back to the given observer. A deletion will fail if |
| 4969 | * the calling context lacks the |
| 4970 | * {@link android.Manifest.permission#DELETE_PACKAGES} permission, if the |
| 4971 | * named package cannot be found, or if the named package is a system |
| 4972 | * package. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4973 | * |
| 4974 | * @param packageName The name of the package to delete |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4975 | * @param observer An observer callback to get notified when the package |
| 4976 | * deletion is complete. |
| 4977 | * {@link android.content.pm.IPackageDeleteObserver#packageDeleted} |
| 4978 | * will be called when that happens. observer may be null to |
| 4979 | * indicate that no callback is desired. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4980 | * @hide |
| 4981 | */ |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 4982 | @RequiresPermission(Manifest.permission.DELETE_PACKAGES) |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4983 | public abstract void deletePackage(String packageName, IPackageDeleteObserver observer, |
| 4984 | @DeleteFlags int flags); |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4985 | |
| 4986 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4987 | * Attempts to delete a package. Since this may take a little while, the |
| 4988 | * result will be posted back to the given observer. A deletion will fail if |
| 4989 | * the named package cannot be found, or if the named package is a system |
| 4990 | * package. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4991 | * |
| 4992 | * @param packageName The name of the package to delete |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4993 | * @param observer An observer callback to get notified when the package |
| 4994 | * deletion is complete. |
| 4995 | * {@link android.content.pm.IPackageDeleteObserver#packageDeleted} |
| 4996 | * will be called when that happens. observer may be null to |
| 4997 | * indicate that no callback is desired. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4998 | * @param userId The user Id |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4999 | * @hide |
| 5000 | */ |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 5001 | @RequiresPermission(anyOf = { |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 5002 | Manifest.permission.DELETE_PACKAGES, |
| 5003 | Manifest.permission.INTERACT_ACROSS_USERS_FULL}) |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 5004 | public abstract void deletePackageAsUser(@NonNull String packageName, |
| 5005 | IPackageDeleteObserver observer, @DeleteFlags int flags, @UserIdInt int userId); |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 5006 | |
| 5007 | /** |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 5008 | * Retrieve the package name of the application that installed a package. This identifies |
| 5009 | * which market the package came from. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5010 | * |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 5011 | * @param packageName The name of the package to query |
| 5012 | */ |
| 5013 | public abstract String getInstallerPackageName(String packageName); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5014 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5015 | /** |
| 5016 | * Attempts to clear the user data directory of an application. |
| 5017 | * Since this may take a little while, the result will |
| 5018 | * be posted back to the given observer. A deletion will fail if the |
| 5019 | * named package cannot be found, or if the named package is a "system package". |
| 5020 | * |
| 5021 | * @param packageName The name of the package |
| 5022 | * @param observer An observer callback to get notified when the operation is finished |
| 5023 | * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)} |
| 5024 | * will be called when that happens. observer may be null to indicate that |
| 5025 | * no callback is desired. |
| 5026 | * |
| 5027 | * @hide |
| 5028 | */ |
| 5029 | public abstract void clearApplicationUserData(String packageName, |
| 5030 | IPackageDataObserver observer); |
| 5031 | /** |
| 5032 | * Attempts to delete the cache files associated with an application. |
| 5033 | * Since this may take a little while, the result will |
| 5034 | * be posted back to the given observer. A deletion will fail if the calling context |
| 5035 | * lacks the {@link android.Manifest.permission#DELETE_CACHE_FILES} permission, if the |
| 5036 | * named package cannot be found, or if the named package is a "system package". |
| 5037 | * |
| 5038 | * @param packageName The name of the package to delete |
| 5039 | * @param observer An observer callback to get notified when the cache file deletion |
| 5040 | * is complete. |
| 5041 | * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)} |
| 5042 | * will be called when that happens. observer may be null to indicate that |
| 5043 | * no callback is desired. |
| 5044 | * |
| 5045 | * @hide |
| 5046 | */ |
| 5047 | public abstract void deleteApplicationCacheFiles(String packageName, |
| 5048 | IPackageDataObserver observer); |
| 5049 | |
| 5050 | /** |
Suprabh Shukla | 78c9eb8 | 2016-04-12 15:51:35 -0700 | [diff] [blame] | 5051 | * Attempts to delete the cache files associated with an application for a given user. Since |
| 5052 | * this may take a little while, the result will be posted back to the given observer. A |
| 5053 | * deletion will fail if the calling context lacks the |
| 5054 | * {@link android.Manifest.permission#DELETE_CACHE_FILES} permission, if the named package |
| 5055 | * cannot be found, or if the named package is a "system package". If {@code userId} does not |
| 5056 | * belong to the calling user, the caller must have |
| 5057 | * {@link android.Manifest.permission#INTERACT_ACROSS_USERS} permission. |
| 5058 | * |
| 5059 | * @param packageName The name of the package to delete |
| 5060 | * @param userId the user for which the cache files needs to be deleted |
| 5061 | * @param observer An observer callback to get notified when the cache file deletion is |
| 5062 | * complete. |
| 5063 | * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)} |
| 5064 | * will be called when that happens. observer may be null to indicate that no |
| 5065 | * callback is desired. |
| 5066 | * @hide |
| 5067 | */ |
| 5068 | public abstract void deleteApplicationCacheFilesAsUser(String packageName, int userId, |
| 5069 | IPackageDataObserver observer); |
| 5070 | |
| 5071 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5072 | * Free storage by deleting LRU sorted list of cache files across |
| 5073 | * all applications. If the currently available free storage |
| 5074 | * on the device is greater than or equal to the requested |
| 5075 | * free storage, no cache files are cleared. If the currently |
| 5076 | * available storage on the device is less than the requested |
| 5077 | * free storage, some or all of the cache files across |
| 5078 | * all applications are deleted (based on last accessed time) |
| 5079 | * to increase the free storage space on the device to |
| 5080 | * the requested value. There is no guarantee that clearing all |
| 5081 | * the cache files from all applications will clear up |
| 5082 | * enough storage to achieve the desired value. |
| 5083 | * @param freeStorageSize The number of bytes of storage to be |
| 5084 | * freed by the system. Say if freeStorageSize is XX, |
| 5085 | * and the current free storage is YY, |
| 5086 | * if XX is less than YY, just return. if not free XX-YY number |
| 5087 | * of bytes if possible. |
| 5088 | * @param observer call back used to notify when |
| 5089 | * the operation is completed |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5090 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5091 | * @hide |
| 5092 | */ |
Jeff Sharkey | 529f91f | 2015-04-18 20:23:13 -0700 | [diff] [blame] | 5093 | public void freeStorageAndNotify(long freeStorageSize, IPackageDataObserver observer) { |
| 5094 | freeStorageAndNotify(null, freeStorageSize, observer); |
| 5095 | } |
| 5096 | |
| 5097 | /** {@hide} */ |
| 5098 | public abstract void freeStorageAndNotify(String volumeUuid, long freeStorageSize, |
| 5099 | IPackageDataObserver observer); |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 5100 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5101 | /** |
| 5102 | * Free storage by deleting LRU sorted list of cache files across |
| 5103 | * all applications. If the currently available free storage |
| 5104 | * on the device is greater than or equal to the requested |
| 5105 | * free storage, no cache files are cleared. If the currently |
| 5106 | * available storage on the device is less than the requested |
| 5107 | * free storage, some or all of the cache files across |
| 5108 | * all applications are deleted (based on last accessed time) |
| 5109 | * to increase the free storage space on the device to |
| 5110 | * the requested value. There is no guarantee that clearing all |
| 5111 | * the cache files from all applications will clear up |
| 5112 | * enough storage to achieve the desired value. |
| 5113 | * @param freeStorageSize The number of bytes of storage to be |
| 5114 | * freed by the system. Say if freeStorageSize is XX, |
| 5115 | * and the current free storage is YY, |
| 5116 | * if XX is less than YY, just return. if not free XX-YY number |
| 5117 | * of bytes if possible. |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 5118 | * @param pi IntentSender call back used to |
| 5119 | * notify when the operation is completed.May be null |
| 5120 | * to indicate that no call back is desired. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5121 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5122 | * @hide |
| 5123 | */ |
Jeff Sharkey | 529f91f | 2015-04-18 20:23:13 -0700 | [diff] [blame] | 5124 | public void freeStorage(long freeStorageSize, IntentSender pi) { |
| 5125 | freeStorage(null, freeStorageSize, pi); |
| 5126 | } |
| 5127 | |
| 5128 | /** {@hide} */ |
| 5129 | public abstract void freeStorage(String volumeUuid, long freeStorageSize, IntentSender pi); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5130 | |
| 5131 | /** |
| 5132 | * Retrieve the size information for a package. |
| 5133 | * Since this may take a little while, the result will |
| 5134 | * be posted back to the given observer. The calling context |
| 5135 | * should have the {@link android.Manifest.permission#GET_PACKAGE_SIZE} permission. |
| 5136 | * |
| 5137 | * @param packageName The name of the package whose size information is to be retrieved |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5138 | * @param userId The user whose size information should be retrieved. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5139 | * @param observer An observer callback to get notified when the operation |
| 5140 | * is complete. |
| 5141 | * {@link android.content.pm.IPackageStatsObserver#onGetStatsCompleted(PackageStats, boolean)} |
| 5142 | * The observer's callback is invoked with a PackageStats object(containing the |
| 5143 | * code, data and cache sizes of the package) and a boolean value representing |
| 5144 | * the status of the operation. observer may be null to indicate that |
| 5145 | * no callback is desired. |
| 5146 | * |
Jeff Sharkey | 60f95aa | 2017-03-08 13:57:15 -0700 | [diff] [blame] | 5147 | * @deprecated use {@link StorageStatsManager} instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5148 | * @hide |
| 5149 | */ |
Jeff Sharkey | 60f95aa | 2017-03-08 13:57:15 -0700 | [diff] [blame] | 5150 | @Deprecated |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 5151 | public abstract void getPackageSizeInfoAsUser(String packageName, @UserIdInt int userId, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5152 | IPackageStatsObserver observer); |
| 5153 | |
| 5154 | /** |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5155 | * Like {@link #getPackageSizeInfoAsUser(String, int, IPackageStatsObserver)}, but |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 5156 | * returns the size for the calling user. |
| 5157 | * |
Jeff Sharkey | 60f95aa | 2017-03-08 13:57:15 -0700 | [diff] [blame] | 5158 | * @deprecated use {@link StorageStatsManager} instead. |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 5159 | * @hide |
| 5160 | */ |
Jeff Sharkey | 60f95aa | 2017-03-08 13:57:15 -0700 | [diff] [blame] | 5161 | @Deprecated |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 5162 | public void getPackageSizeInfo(String packageName, IPackageStatsObserver observer) { |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5163 | getPackageSizeInfoAsUser(packageName, UserHandle.myUserId(), observer); |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 5164 | } |
| 5165 | |
| 5166 | /** |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5167 | * @deprecated This function no longer does anything; it was an old |
kmccormick | ac66b85 | 2013-03-28 15:17:15 -0700 | [diff] [blame] | 5168 | * approach to managing preferred activities, which has been superseded |
| 5169 | * by (and conflicts with) the modern activity-based preferences. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5170 | */ |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5171 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5172 | public abstract void addPackageToPreferred(String packageName); |
| 5173 | |
| 5174 | /** |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5175 | * @deprecated This function no longer does anything; it was an old |
kmccormick | ac66b85 | 2013-03-28 15:17:15 -0700 | [diff] [blame] | 5176 | * approach to managing preferred activities, which has been superseded |
| 5177 | * by (and conflicts with) the modern activity-based preferences. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5178 | */ |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5179 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5180 | public abstract void removePackageFromPreferred(String packageName); |
| 5181 | |
| 5182 | /** |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 5183 | * Retrieve the list of all currently configured preferred packages. The |
| 5184 | * first package on the list is the most preferred, the last is the least |
| 5185 | * preferred. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5186 | * |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 5187 | * @param flags Additional option flags to modify the data returned. |
| 5188 | * @return A List of PackageInfo objects, one for each preferred |
| 5189 | * application, in order of preference. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5190 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 5191 | public abstract List<PackageInfo> getPreferredPackages(@PackageInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5192 | |
| 5193 | /** |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5194 | * @deprecated This is a protected API that should not have been available |
| 5195 | * to third party applications. It is the platform's responsibility for |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 5196 | * assigning preferred activities and this cannot be directly modified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5197 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5198 | * Add a new preferred activity mapping to the system. This will be used |
| 5199 | * to automatically select the given activity component when |
| 5200 | * {@link Context#startActivity(Intent) Context.startActivity()} finds |
| 5201 | * multiple matching activities and also matches the given filter. |
| 5202 | * |
| 5203 | * @param filter The set of intents under which this activity will be |
| 5204 | * made preferred. |
| 5205 | * @param match The IntentFilter match category that this preference |
| 5206 | * applies to. |
| 5207 | * @param set The set of activities that the user was picking from when |
| 5208 | * this preference was made. |
| 5209 | * @param activity The component name of the activity that is to be |
| 5210 | * preferred. |
| 5211 | */ |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5212 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5213 | public abstract void addPreferredActivity(IntentFilter filter, int match, |
| 5214 | ComponentName[] set, ComponentName activity); |
| 5215 | |
| 5216 | /** |
Amith Yamasani | a3f133a | 2012-08-09 17:11:28 -0700 | [diff] [blame] | 5217 | * Same as {@link #addPreferredActivity(IntentFilter, int, |
| 5218 | ComponentName[], ComponentName)}, but with a specific userId to apply the preference |
| 5219 | to. |
| 5220 | * @hide |
| 5221 | */ |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5222 | public void addPreferredActivityAsUser(IntentFilter filter, int match, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 5223 | ComponentName[] set, ComponentName activity, @UserIdInt int userId) { |
Amith Yamasani | a3f133a | 2012-08-09 17:11:28 -0700 | [diff] [blame] | 5224 | throw new RuntimeException("Not implemented. Must override in a subclass."); |
| 5225 | } |
| 5226 | |
| 5227 | /** |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5228 | * @deprecated This is a protected API that should not have been available |
| 5229 | * to third party applications. It is the platform's responsibility for |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 5230 | * assigning preferred activities and this cannot be directly modified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5231 | * |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 5232 | * Replaces an existing preferred activity mapping to the system, and if that were not present |
| 5233 | * adds a new preferred activity. This will be used |
| 5234 | * to automatically select the given activity component when |
| 5235 | * {@link Context#startActivity(Intent) Context.startActivity()} finds |
| 5236 | * multiple matching activities and also matches the given filter. |
| 5237 | * |
| 5238 | * @param filter The set of intents under which this activity will be |
| 5239 | * made preferred. |
| 5240 | * @param match The IntentFilter match category that this preference |
| 5241 | * applies to. |
| 5242 | * @param set The set of activities that the user was picking from when |
| 5243 | * this preference was made. |
| 5244 | * @param activity The component name of the activity that is to be |
| 5245 | * preferred. |
| 5246 | * @hide |
| 5247 | */ |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5248 | @Deprecated |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 5249 | public abstract void replacePreferredActivity(IntentFilter filter, int match, |
| 5250 | ComponentName[] set, ComponentName activity); |
| 5251 | |
| 5252 | /** |
Amith Yamasani | 41c1ded | 2014-08-05 11:15:05 -0700 | [diff] [blame] | 5253 | * @hide |
| 5254 | */ |
| 5255 | @Deprecated |
| 5256 | public void replacePreferredActivityAsUser(IntentFilter filter, int match, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 5257 | ComponentName[] set, ComponentName activity, @UserIdInt int userId) { |
Amith Yamasani | 41c1ded | 2014-08-05 11:15:05 -0700 | [diff] [blame] | 5258 | throw new RuntimeException("Not implemented. Must override in a subclass."); |
| 5259 | } |
| 5260 | |
| 5261 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5262 | * Remove all preferred activity mappings, previously added with |
| 5263 | * {@link #addPreferredActivity}, from the |
| 5264 | * system whose activities are implemented in the given package name. |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5265 | * An application can only clear its own package(s). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5266 | * |
| 5267 | * @param packageName The name of the package whose preferred activity |
| 5268 | * mappings are to be removed. |
| 5269 | */ |
| 5270 | public abstract void clearPackagePreferredActivities(String packageName); |
| 5271 | |
| 5272 | /** |
| 5273 | * Retrieve all preferred activities, previously added with |
| 5274 | * {@link #addPreferredActivity}, that are |
| 5275 | * currently registered with the system. |
| 5276 | * |
John Spurlock | 38e6425 | 2015-03-18 12:09:32 -0400 | [diff] [blame] | 5277 | * @param outFilters A required list in which to place the filters of all of the |
| 5278 | * preferred activities. |
| 5279 | * @param outActivities A required list in which to place the component names of |
| 5280 | * all of the preferred activities. |
| 5281 | * @param packageName An optional package in which you would like to limit |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5282 | * the list. If null, all activities will be returned; if non-null, only |
| 5283 | * those activities in the given package are returned. |
| 5284 | * |
| 5285 | * @return Returns the total number of registered preferred activities |
| 5286 | * (the number of distinct IntentFilter records, not the number of unique |
| 5287 | * activity components) that were found. |
| 5288 | */ |
John Spurlock | 38e6425 | 2015-03-18 12:09:32 -0400 | [diff] [blame] | 5289 | public abstract int getPreferredActivities(@NonNull List<IntentFilter> outFilters, |
| 5290 | @NonNull List<ComponentName> outActivities, String packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5291 | |
| 5292 | /** |
Christopher Tate | a2a0850d | 2013-09-05 16:38:58 -0700 | [diff] [blame] | 5293 | * Ask for the set of available 'home' activities and the current explicit |
| 5294 | * default, if any. |
| 5295 | * @hide |
| 5296 | */ |
| 5297 | public abstract ComponentName getHomeActivities(List<ResolveInfo> outActivities); |
| 5298 | |
| 5299 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5300 | * Set the enabled setting for a package component (activity, receiver, service, provider). |
| 5301 | * This setting will override any enabled state which may have been set by the component in its |
| 5302 | * manifest. |
| 5303 | * |
| 5304 | * @param componentName The component to enable |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 5305 | * @param newState The new enabled state for the component. |
| 5306 | * @param flags Optional behavior flags. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5307 | */ |
| 5308 | public abstract void setComponentEnabledSetting(ComponentName componentName, |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 5309 | @EnabledState int newState, @EnabledFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5310 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5311 | /** |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 5312 | * Return the enabled setting for a package component (activity, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5313 | * receiver, service, provider). This returns the last value set by |
| 5314 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}; in most |
| 5315 | * cases this value will be {@link #COMPONENT_ENABLED_STATE_DEFAULT} since |
| 5316 | * the value originally specified in the manifest has not been modified. |
| 5317 | * |
| 5318 | * @param componentName The component to retrieve. |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 5319 | * @return Returns the current enabled state for the component. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5320 | */ |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 5321 | public abstract @EnabledState int getComponentEnabledSetting( |
| 5322 | ComponentName componentName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5323 | |
| 5324 | /** |
| 5325 | * Set the enabled setting for an application |
| 5326 | * This setting will override any enabled state which may have been set by the application in |
| 5327 | * its manifest. It also overrides the enabled state set in the manifest for any of the |
| 5328 | * application's components. It does not override any enabled state set by |
| 5329 | * {@link #setComponentEnabledSetting} for any of the application's components. |
| 5330 | * |
| 5331 | * @param packageName The package name of the application to enable |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 5332 | * @param newState The new enabled state for the application. |
| 5333 | * @param flags Optional behavior flags. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5334 | */ |
| 5335 | public abstract void setApplicationEnabledSetting(String packageName, |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 5336 | @EnabledState int newState, @EnabledFlags int flags); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5337 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5338 | /** |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 5339 | * Return the enabled setting for an application. This returns |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5340 | * the last value set by |
| 5341 | * {@link #setApplicationEnabledSetting(String, int, int)}; in most |
| 5342 | * cases this value will be {@link #COMPONENT_ENABLED_STATE_DEFAULT} since |
| 5343 | * the value originally specified in the manifest has not been modified. |
| 5344 | * |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 5345 | * @param packageName The package name of the application to retrieve. |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 5346 | * @return Returns the current enabled state for the application. |
Mathew Inwood | 1b9f8d9 | 2011-09-26 13:23:56 +0100 | [diff] [blame] | 5347 | * @throws IllegalArgumentException if the named package does not exist. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5348 | */ |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 5349 | public abstract @EnabledState int getApplicationEnabledSetting(String packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5350 | |
| 5351 | /** |
Sudheer Shanka | bbb3ff2 | 2015-07-09 15:39:23 +0100 | [diff] [blame] | 5352 | * Flush the package restrictions for a given user to disk. This forces the package restrictions |
| 5353 | * like component and package enabled settings to be written to disk and avoids the delay that |
| 5354 | * is otherwise present when changing those settings. |
| 5355 | * |
| 5356 | * @param userId Ther userId of the user whose restrictions are to be flushed. |
| 5357 | * @hide |
| 5358 | */ |
| 5359 | public abstract void flushPackageRestrictionsAsUser(int userId); |
| 5360 | |
| 5361 | /** |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5362 | * Puts the package in a hidden state, which is almost like an uninstalled state, |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5363 | * making the package unavailable, but it doesn't remove the data or the actual |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5364 | * package file. Application can be unhidden by either resetting the hidden state |
| 5365 | * or by installing it, such as with {@link #installExistingPackage(String)} |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5366 | * @hide |
| 5367 | */ |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5368 | public abstract boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden, |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5369 | UserHandle userHandle); |
| 5370 | |
| 5371 | /** |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5372 | * Returns the hidden state of a package. |
| 5373 | * @see #setApplicationHiddenSettingAsUser(String, boolean, UserHandle) |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5374 | * @hide |
| 5375 | */ |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5376 | public abstract boolean getApplicationHiddenSettingAsUser(String packageName, |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5377 | UserHandle userHandle); |
| 5378 | |
| 5379 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5380 | * Return whether the device has been booted into safe mode. |
| 5381 | */ |
| 5382 | public abstract boolean isSafeMode(); |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 5383 | |
| 5384 | /** |
Svetoslav | f7c06eb | 2015-06-10 18:43:22 -0700 | [diff] [blame] | 5385 | * Adds a listener for permission changes for installed packages. |
| 5386 | * |
| 5387 | * @param listener The listener to add. |
| 5388 | * |
| 5389 | * @hide |
| 5390 | */ |
| 5391 | @SystemApi |
| 5392 | @RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS) |
| 5393 | public abstract void addOnPermissionsChangeListener(OnPermissionsChangedListener listener); |
| 5394 | |
| 5395 | /** |
| 5396 | * Remvoes a listener for permission changes for installed packages. |
| 5397 | * |
| 5398 | * @param listener The listener to remove. |
| 5399 | * |
| 5400 | * @hide |
| 5401 | */ |
| 5402 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 5403 | @RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS) |
Svetoslav | f7c06eb | 2015-06-10 18:43:22 -0700 | [diff] [blame] | 5404 | public abstract void removeOnPermissionsChangeListener(OnPermissionsChangedListener listener); |
| 5405 | |
| 5406 | /** |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5407 | * Return the {@link KeySet} associated with the String alias for this |
| 5408 | * application. |
| 5409 | * |
| 5410 | * @param alias The alias for a given {@link KeySet} as defined in the |
| 5411 | * application's AndroidManifest.xml. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5412 | * @hide |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5413 | */ |
| 5414 | public abstract KeySet getKeySetByAlias(String packageName, String alias); |
| 5415 | |
Ihab Awad | 1ec6888 | 2014-09-12 11:09:01 -0700 | [diff] [blame] | 5416 | /** Return the signing {@link KeySet} for this application. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5417 | * @hide |
| 5418 | */ |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5419 | public abstract KeySet getSigningKeySet(String packageName); |
| 5420 | |
| 5421 | /** |
| 5422 | * Return whether the package denoted by packageName has been signed by all |
| 5423 | * of the keys specified by the {@link KeySet} ks. This will return true if |
| 5424 | * the package has been signed by additional keys (a superset) as well. |
| 5425 | * Compare to {@link #isSignedByExactly(String packageName, KeySet ks)}. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5426 | * @hide |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5427 | */ |
| 5428 | public abstract boolean isSignedBy(String packageName, KeySet ks); |
| 5429 | |
| 5430 | /** |
| 5431 | * Return whether the package denoted by packageName has been signed by all |
| 5432 | * of, and only, the keys specified by the {@link KeySet} ks. Compare to |
| 5433 | * {@link #isSignedBy(String packageName, KeySet ks)}. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5434 | * @hide |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5435 | */ |
| 5436 | public abstract boolean isSignedByExactly(String packageName, KeySet ks); |
| 5437 | |
| 5438 | /** |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5439 | * Puts the package in a suspended state, where attempts at starting activities are denied. |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5440 | * |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5441 | * <p>It doesn't remove the data or the actual package file. The application notifications |
| 5442 | * will be hidden, the application will not show up in recents, will not be able to show |
| 5443 | * toasts or dialogs or ring the device. |
| 5444 | * |
Kenny Guy | 871f3eb | 2016-03-09 20:06:16 +0000 | [diff] [blame] | 5445 | * <p>The package must already be installed. If the package is uninstalled while suspended |
| 5446 | * the package will no longer be suspended. |
| 5447 | * |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5448 | * @param packageNames The names of the packages to set the suspended status. |
| 5449 | * @param suspended If set to {@code true} than the packages will be suspended, if set to |
| 5450 | * {@code false} the packages will be unsuspended. |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5451 | * @param userId The user id. |
| 5452 | * |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5453 | * @return an array of package names for which the suspended status is not set as requested in |
| 5454 | * this method. |
| 5455 | * |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5456 | * @hide |
| 5457 | */ |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5458 | public abstract String[] setPackagesSuspendedAsUser( |
| 5459 | String[] packageNames, boolean suspended, @UserIdInt int userId); |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5460 | |
Andrei Stingaceanu | 355b232 | 2016-02-12 16:43:51 +0000 | [diff] [blame] | 5461 | /** |
| 5462 | * @see #setPackageSuspendedAsUser(String, boolean, int) |
| 5463 | * @param packageName The name of the package to get the suspended status of. |
| 5464 | * @param userId The user id. |
| 5465 | * @return {@code true} if the package is suspended or {@code false} if the package is not |
| 5466 | * suspended or could not be found. |
| 5467 | * @hide |
| 5468 | */ |
| 5469 | public abstract boolean isPackageSuspendedForUser(String packageName, int userId); |
| 5470 | |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 5471 | /** |
| 5472 | * Provide a hint of what the {@link ApplicationInfo#category} value should |
| 5473 | * be for the given package. |
| 5474 | * <p> |
| 5475 | * This hint can only be set by the app which installed this package, as |
| 5476 | * determined by {@link #getInstallerPackageName(String)}. |
Jeff Sharkey | 60a82cd | 2017-04-18 18:19:16 -0600 | [diff] [blame] | 5477 | * |
| 5478 | * @param packageName the package to change the category hint for. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 5479 | * @param categoryHint the category hint to set. |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 5480 | */ |
Jeff Sharkey | 60a82cd | 2017-04-18 18:19:16 -0600 | [diff] [blame] | 5481 | public abstract void setApplicationCategoryHint(@NonNull String packageName, |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 5482 | @ApplicationInfo.Category int categoryHint); |
| 5483 | |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 5484 | /** {@hide} */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5485 | public static boolean isMoveStatusFinished(int status) { |
| 5486 | return (status < 0 || status > 100); |
| 5487 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5488 | |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 5489 | /** {@hide} */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5490 | public static abstract class MoveCallback { |
Jeff Sharkey | 50a0545 | 2015-04-29 11:24:52 -0700 | [diff] [blame] | 5491 | public void onCreated(int moveId, Bundle extras) {} |
| 5492 | public abstract void onStatusChanged(int moveId, int status, long estMillis); |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5493 | } |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 5494 | |
| 5495 | /** {@hide} */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5496 | public abstract int getMoveStatus(int moveId); |
| 5497 | |
| 5498 | /** {@hide} */ |
| 5499 | public abstract void registerMoveCallback(MoveCallback callback, Handler handler); |
| 5500 | /** {@hide} */ |
| 5501 | public abstract void unregisterMoveCallback(MoveCallback callback); |
| 5502 | |
| 5503 | /** {@hide} */ |
| 5504 | public abstract int movePackage(String packageName, VolumeInfo vol); |
| 5505 | /** {@hide} */ |
| 5506 | public abstract @Nullable VolumeInfo getPackageCurrentVolume(ApplicationInfo app); |
| 5507 | /** {@hide} */ |
| 5508 | public abstract @NonNull List<VolumeInfo> getPackageCandidateVolumes(ApplicationInfo app); |
| 5509 | |
| 5510 | /** {@hide} */ |
| 5511 | public abstract int movePrimaryStorage(VolumeInfo vol); |
| 5512 | /** {@hide} */ |
| 5513 | public abstract @Nullable VolumeInfo getPrimaryStorageCurrentVolume(); |
| 5514 | /** {@hide} */ |
| 5515 | public abstract @NonNull List<VolumeInfo> getPrimaryStorageCandidateVolumes(); |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 5516 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5517 | /** |
Amith Yamasani | 1359360 | 2012-03-22 16:16:17 -0700 | [diff] [blame] | 5518 | * Returns the device identity that verifiers can use to associate their scheme to a particular |
| 5519 | * device. This should not be used by anything other than a package verifier. |
Aravind Akella | 068b0c0 | 2013-10-12 17:39:15 -0700 | [diff] [blame] | 5520 | * |
Kenny Root | 0aaa0d9 | 2011-09-12 16:42:55 -0700 | [diff] [blame] | 5521 | * @return identity that uniquely identifies current device |
| 5522 | * @hide |
| 5523 | */ |
| 5524 | public abstract VerifierDeviceIdentity getVerifierDeviceIdentity(); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 5525 | |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5526 | /** |
Jeff Hao | 9f60c08 | 2014-10-28 18:51:07 -0700 | [diff] [blame] | 5527 | * Returns true if the device is upgrading, such as first boot after OTA. |
| 5528 | * |
| 5529 | * @hide |
| 5530 | */ |
| 5531 | public abstract boolean isUpgrade(); |
| 5532 | |
| 5533 | /** |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5534 | * Return interface that offers the ability to install, upgrade, and remove |
| 5535 | * applications on the device. |
| 5536 | */ |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5537 | public abstract @NonNull PackageInstaller getPackageInstaller(); |
Jeff Sharkey | 3a44f3f | 2014-04-28 17:36:31 -0700 | [diff] [blame] | 5538 | |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 5539 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5540 | * Adds a {@code CrossProfileIntentFilter}. After calling this method all |
| 5541 | * intents sent from the user with id sourceUserId can also be be resolved |
| 5542 | * by activities in the user with id targetUserId if they match the |
| 5543 | * specified intent filter. |
| 5544 | * |
Nicolas Prevot | 3f7777f | 2014-07-24 15:58:39 +0100 | [diff] [blame] | 5545 | * @param filter The {@link IntentFilter} the intent has to match |
| 5546 | * @param sourceUserId The source user id. |
| 5547 | * @param targetUserId The target user id. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5548 | * @param flags The possible values are {@link #SKIP_CURRENT_PROFILE} and |
| 5549 | * {@link #ONLY_IF_NO_MATCH_FOUND}. |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 5550 | * @hide |
| 5551 | */ |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 5552 | public abstract void addCrossProfileIntentFilter(IntentFilter filter, int sourceUserId, |
| 5553 | int targetUserId, int flags); |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 5554 | |
| 5555 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5556 | * Clearing {@code CrossProfileIntentFilter}s which have the specified user |
| 5557 | * as their source, and have been set by the app calling this method. |
| 5558 | * |
Nicolas Prevot | 3f7777f | 2014-07-24 15:58:39 +0100 | [diff] [blame] | 5559 | * @param sourceUserId The source user id. |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 5560 | * @hide |
| 5561 | */ |
Nicolas Prevot | 8194899 | 2014-05-16 18:25:26 +0100 | [diff] [blame] | 5562 | public abstract void clearCrossProfileIntentFilters(int sourceUserId); |
Alexandra Gherghina | 6e2ae25 | 2014-06-12 16:03:58 +0100 | [diff] [blame] | 5563 | |
| 5564 | /** |
Nicolas Prevot | 88cc346 | 2014-05-14 14:51:48 +0100 | [diff] [blame] | 5565 | * @hide |
| 5566 | */ |
Nicolas Prevot | 7f7b0c7 | 2014-06-23 15:59:38 +0100 | [diff] [blame] | 5567 | public abstract Drawable loadItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo); |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5568 | |
Benjamin Franz | ec2d48b | 2014-10-01 15:38:43 +0100 | [diff] [blame] | 5569 | /** |
| 5570 | * @hide |
| 5571 | */ |
| 5572 | public abstract Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo); |
| 5573 | |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5574 | /** {@hide} */ |
| 5575 | public abstract boolean isPackageAvailable(String packageName); |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5576 | |
| 5577 | /** {@hide} */ |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5578 | public static String installStatusToString(int status, String msg) { |
| 5579 | final String str = installStatusToString(status); |
| 5580 | if (msg != null) { |
| 5581 | return str + ": " + msg; |
| 5582 | } else { |
| 5583 | return str; |
| 5584 | } |
| 5585 | } |
| 5586 | |
| 5587 | /** {@hide} */ |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5588 | public static String installStatusToString(int status) { |
| 5589 | switch (status) { |
| 5590 | case INSTALL_SUCCEEDED: return "INSTALL_SUCCEEDED"; |
| 5591 | case INSTALL_FAILED_ALREADY_EXISTS: return "INSTALL_FAILED_ALREADY_EXISTS"; |
| 5592 | case INSTALL_FAILED_INVALID_APK: return "INSTALL_FAILED_INVALID_APK"; |
| 5593 | case INSTALL_FAILED_INVALID_URI: return "INSTALL_FAILED_INVALID_URI"; |
| 5594 | case INSTALL_FAILED_INSUFFICIENT_STORAGE: return "INSTALL_FAILED_INSUFFICIENT_STORAGE"; |
| 5595 | case INSTALL_FAILED_DUPLICATE_PACKAGE: return "INSTALL_FAILED_DUPLICATE_PACKAGE"; |
| 5596 | case INSTALL_FAILED_NO_SHARED_USER: return "INSTALL_FAILED_NO_SHARED_USER"; |
| 5597 | case INSTALL_FAILED_UPDATE_INCOMPATIBLE: return "INSTALL_FAILED_UPDATE_INCOMPATIBLE"; |
| 5598 | case INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: return "INSTALL_FAILED_SHARED_USER_INCOMPATIBLE"; |
| 5599 | case INSTALL_FAILED_MISSING_SHARED_LIBRARY: return "INSTALL_FAILED_MISSING_SHARED_LIBRARY"; |
| 5600 | case INSTALL_FAILED_REPLACE_COULDNT_DELETE: return "INSTALL_FAILED_REPLACE_COULDNT_DELETE"; |
| 5601 | case INSTALL_FAILED_DEXOPT: return "INSTALL_FAILED_DEXOPT"; |
| 5602 | case INSTALL_FAILED_OLDER_SDK: return "INSTALL_FAILED_OLDER_SDK"; |
| 5603 | case INSTALL_FAILED_CONFLICTING_PROVIDER: return "INSTALL_FAILED_CONFLICTING_PROVIDER"; |
| 5604 | case INSTALL_FAILED_NEWER_SDK: return "INSTALL_FAILED_NEWER_SDK"; |
| 5605 | case INSTALL_FAILED_TEST_ONLY: return "INSTALL_FAILED_TEST_ONLY"; |
| 5606 | case INSTALL_FAILED_CPU_ABI_INCOMPATIBLE: return "INSTALL_FAILED_CPU_ABI_INCOMPATIBLE"; |
| 5607 | case INSTALL_FAILED_MISSING_FEATURE: return "INSTALL_FAILED_MISSING_FEATURE"; |
| 5608 | case INSTALL_FAILED_CONTAINER_ERROR: return "INSTALL_FAILED_CONTAINER_ERROR"; |
| 5609 | case INSTALL_FAILED_INVALID_INSTALL_LOCATION: return "INSTALL_FAILED_INVALID_INSTALL_LOCATION"; |
| 5610 | case INSTALL_FAILED_MEDIA_UNAVAILABLE: return "INSTALL_FAILED_MEDIA_UNAVAILABLE"; |
| 5611 | case INSTALL_FAILED_VERIFICATION_TIMEOUT: return "INSTALL_FAILED_VERIFICATION_TIMEOUT"; |
| 5612 | case INSTALL_FAILED_VERIFICATION_FAILURE: return "INSTALL_FAILED_VERIFICATION_FAILURE"; |
| 5613 | case INSTALL_FAILED_PACKAGE_CHANGED: return "INSTALL_FAILED_PACKAGE_CHANGED"; |
| 5614 | case INSTALL_FAILED_UID_CHANGED: return "INSTALL_FAILED_UID_CHANGED"; |
| 5615 | case INSTALL_FAILED_VERSION_DOWNGRADE: return "INSTALL_FAILED_VERSION_DOWNGRADE"; |
| 5616 | case INSTALL_PARSE_FAILED_NOT_APK: return "INSTALL_PARSE_FAILED_NOT_APK"; |
| 5617 | case INSTALL_PARSE_FAILED_BAD_MANIFEST: return "INSTALL_PARSE_FAILED_BAD_MANIFEST"; |
| 5618 | case INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: return "INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION"; |
| 5619 | case INSTALL_PARSE_FAILED_NO_CERTIFICATES: return "INSTALL_PARSE_FAILED_NO_CERTIFICATES"; |
| 5620 | case INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES: return "INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES"; |
| 5621 | case INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING: return "INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING"; |
| 5622 | case INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME: return "INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME"; |
| 5623 | case INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID: return "INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID"; |
| 5624 | case INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: return "INSTALL_PARSE_FAILED_MANIFEST_MALFORMED"; |
| 5625 | case INSTALL_PARSE_FAILED_MANIFEST_EMPTY: return "INSTALL_PARSE_FAILED_MANIFEST_EMPTY"; |
| 5626 | case INSTALL_FAILED_INTERNAL_ERROR: return "INSTALL_FAILED_INTERNAL_ERROR"; |
| 5627 | case INSTALL_FAILED_USER_RESTRICTED: return "INSTALL_FAILED_USER_RESTRICTED"; |
| 5628 | case INSTALL_FAILED_DUPLICATE_PERMISSION: return "INSTALL_FAILED_DUPLICATE_PERMISSION"; |
| 5629 | case INSTALL_FAILED_NO_MATCHING_ABIS: return "INSTALL_FAILED_NO_MATCHING_ABIS"; |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5630 | case INSTALL_FAILED_ABORTED: return "INSTALL_FAILED_ABORTED"; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5631 | default: return Integer.toString(status); |
| 5632 | } |
| 5633 | } |
| 5634 | |
| 5635 | /** {@hide} */ |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5636 | public static int installStatusToPublicStatus(int status) { |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5637 | switch (status) { |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5638 | case INSTALL_SUCCEEDED: return PackageInstaller.STATUS_SUCCESS; |
| 5639 | case INSTALL_FAILED_ALREADY_EXISTS: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5640 | case INSTALL_FAILED_INVALID_APK: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5641 | case INSTALL_FAILED_INVALID_URI: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5642 | case INSTALL_FAILED_INSUFFICIENT_STORAGE: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5643 | case INSTALL_FAILED_DUPLICATE_PACKAGE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5644 | case INSTALL_FAILED_NO_SHARED_USER: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5645 | case INSTALL_FAILED_UPDATE_INCOMPATIBLE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5646 | case INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5647 | case INSTALL_FAILED_MISSING_SHARED_LIBRARY: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5648 | case INSTALL_FAILED_REPLACE_COULDNT_DELETE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5649 | case INSTALL_FAILED_DEXOPT: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5650 | case INSTALL_FAILED_OLDER_SDK: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5651 | case INSTALL_FAILED_CONFLICTING_PROVIDER: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5652 | case INSTALL_FAILED_NEWER_SDK: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5653 | case INSTALL_FAILED_TEST_ONLY: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5654 | case INSTALL_FAILED_CPU_ABI_INCOMPATIBLE: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5655 | case INSTALL_FAILED_MISSING_FEATURE: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5656 | case INSTALL_FAILED_CONTAINER_ERROR: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5657 | case INSTALL_FAILED_INVALID_INSTALL_LOCATION: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5658 | case INSTALL_FAILED_MEDIA_UNAVAILABLE: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5659 | case INSTALL_FAILED_VERIFICATION_TIMEOUT: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5660 | case INSTALL_FAILED_VERIFICATION_FAILURE: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5661 | case INSTALL_FAILED_PACKAGE_CHANGED: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5662 | case INSTALL_FAILED_UID_CHANGED: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5663 | case INSTALL_FAILED_VERSION_DOWNGRADE: return PackageInstaller.STATUS_FAILURE_INVALID; |
Svetoslav | d965370 | 2015-05-13 18:02:46 -0700 | [diff] [blame] | 5664 | case INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE: return PackageInstaller.STATUS_FAILURE_INVALID; |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5665 | case INSTALL_PARSE_FAILED_NOT_APK: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5666 | case INSTALL_PARSE_FAILED_BAD_MANIFEST: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5667 | case INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5668 | case INSTALL_PARSE_FAILED_NO_CERTIFICATES: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5669 | case INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5670 | case INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5671 | case INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5672 | case INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5673 | case INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5674 | case INSTALL_PARSE_FAILED_MANIFEST_EMPTY: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5675 | case INSTALL_FAILED_INTERNAL_ERROR: return PackageInstaller.STATUS_FAILURE; |
| 5676 | case INSTALL_FAILED_USER_RESTRICTED: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5677 | case INSTALL_FAILED_DUPLICATE_PERMISSION: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5678 | case INSTALL_FAILED_NO_MATCHING_ABIS: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5679 | case INSTALL_FAILED_ABORTED: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5680 | default: return PackageInstaller.STATUS_FAILURE; |
| 5681 | } |
| 5682 | } |
| 5683 | |
| 5684 | /** {@hide} */ |
| 5685 | public static String deleteStatusToString(int status, String msg) { |
| 5686 | final String str = deleteStatusToString(status); |
| 5687 | if (msg != null) { |
| 5688 | return str + ": " + msg; |
| 5689 | } else { |
| 5690 | return str; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5691 | } |
| 5692 | } |
| 5693 | |
| 5694 | /** {@hide} */ |
| 5695 | public static String deleteStatusToString(int status) { |
| 5696 | switch (status) { |
| 5697 | case DELETE_SUCCEEDED: return "DELETE_SUCCEEDED"; |
| 5698 | case DELETE_FAILED_INTERNAL_ERROR: return "DELETE_FAILED_INTERNAL_ERROR"; |
| 5699 | case DELETE_FAILED_DEVICE_POLICY_MANAGER: return "DELETE_FAILED_DEVICE_POLICY_MANAGER"; |
| 5700 | case DELETE_FAILED_USER_RESTRICTED: return "DELETE_FAILED_USER_RESTRICTED"; |
| 5701 | case DELETE_FAILED_OWNER_BLOCKED: return "DELETE_FAILED_OWNER_BLOCKED"; |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5702 | case DELETE_FAILED_ABORTED: return "DELETE_FAILED_ABORTED"; |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 5703 | case DELETE_FAILED_USED_SHARED_LIBRARY: return "DELETE_FAILED_USED_SHARED_LIBRARY"; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5704 | default: return Integer.toString(status); |
| 5705 | } |
| 5706 | } |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5707 | |
| 5708 | /** {@hide} */ |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5709 | public static int deleteStatusToPublicStatus(int status) { |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5710 | switch (status) { |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5711 | case DELETE_SUCCEEDED: return PackageInstaller.STATUS_SUCCESS; |
| 5712 | case DELETE_FAILED_INTERNAL_ERROR: return PackageInstaller.STATUS_FAILURE; |
| 5713 | case DELETE_FAILED_DEVICE_POLICY_MANAGER: return PackageInstaller.STATUS_FAILURE_BLOCKED; |
| 5714 | case DELETE_FAILED_USER_RESTRICTED: return PackageInstaller.STATUS_FAILURE_BLOCKED; |
| 5715 | case DELETE_FAILED_OWNER_BLOCKED: return PackageInstaller.STATUS_FAILURE_BLOCKED; |
| 5716 | case DELETE_FAILED_ABORTED: return PackageInstaller.STATUS_FAILURE_ABORTED; |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 5717 | case DELETE_FAILED_USED_SHARED_LIBRARY: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5718 | default: return PackageInstaller.STATUS_FAILURE; |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5719 | } |
| 5720 | } |
Jeff Sharkey | 6c0b9da | 2014-08-07 22:07:11 -0700 | [diff] [blame] | 5721 | |
| 5722 | /** {@hide} */ |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 5723 | public static String permissionFlagToString(int flag) { |
| 5724 | switch (flag) { |
Svetoslav | 4a5f4a2 | 2015-07-07 18:18:15 -0700 | [diff] [blame] | 5725 | case FLAG_PERMISSION_GRANTED_BY_DEFAULT: return "GRANTED_BY_DEFAULT"; |
| 5726 | case FLAG_PERMISSION_POLICY_FIXED: return "POLICY_FIXED"; |
| 5727 | case FLAG_PERMISSION_SYSTEM_FIXED: return "SYSTEM_FIXED"; |
| 5728 | case FLAG_PERMISSION_USER_SET: return "USER_SET"; |
| 5729 | case FLAG_PERMISSION_REVOKE_ON_UPGRADE: return "REVOKE_ON_UPGRADE"; |
| 5730 | case FLAG_PERMISSION_USER_FIXED: return "USER_FIXED"; |
Svet Ganov | 9c165d7 | 2015-12-01 19:52:26 -0800 | [diff] [blame] | 5731 | case FLAG_PERMISSION_REVIEW_REQUIRED: return "REVIEW_REQUIRED"; |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 5732 | default: return Integer.toString(flag); |
| 5733 | } |
| 5734 | } |
| 5735 | |
| 5736 | /** {@hide} */ |
Jeff Sharkey | 6c0b9da | 2014-08-07 22:07:11 -0700 | [diff] [blame] | 5737 | public static class LegacyPackageDeleteObserver extends PackageDeleteObserver { |
| 5738 | private final IPackageDeleteObserver mLegacy; |
| 5739 | |
| 5740 | public LegacyPackageDeleteObserver(IPackageDeleteObserver legacy) { |
| 5741 | mLegacy = legacy; |
| 5742 | } |
| 5743 | |
| 5744 | @Override |
| 5745 | public void onPackageDeleted(String basePackageName, int returnCode, String msg) { |
| 5746 | if (mLegacy == null) return; |
| 5747 | try { |
| 5748 | mLegacy.packageDeleted(basePackageName, returnCode); |
| 5749 | } catch (RemoteException ignored) { |
| 5750 | } |
| 5751 | } |
| 5752 | } |
Bartosz Fabianowski | a34f53f | 2017-01-11 18:08:47 +0100 | [diff] [blame] | 5753 | |
| 5754 | /** |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 5755 | * Return the install reason that was recorded when a package was first |
| 5756 | * installed for a specific user. Requesting the install reason for another |
| 5757 | * user will require the permission INTERACT_ACROSS_USERS_FULL. |
Bartosz Fabianowski | a34f53f | 2017-01-11 18:08:47 +0100 | [diff] [blame] | 5758 | * |
| 5759 | * @param packageName The package for which to retrieve the install reason |
| 5760 | * @param user The user for whom to retrieve the install reason |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 5761 | * @return The install reason. If the package is not installed for the given |
| 5762 | * user, {@code INSTALL_REASON_UNKNOWN} is returned. |
Bartosz Fabianowski | a34f53f | 2017-01-11 18:08:47 +0100 | [diff] [blame] | 5763 | * @hide |
| 5764 | */ |
| 5765 | @TestApi |
| 5766 | public abstract @InstallReason int getInstallReason(String packageName, |
| 5767 | @NonNull UserHandle user); |
Suprabh Shukla | aef2513 | 2017-01-23 18:09:03 -0800 | [diff] [blame] | 5768 | |
| 5769 | /** |
| 5770 | * Checks whether the calling package is allowed to request package installs through package |
Suprabh Shukla | 5752847 | 2017-04-14 19:22:45 -0700 | [diff] [blame] | 5771 | * installer. Apps are encouraged to call this API before launching the package installer via |
Suprabh Shukla | aef2513 | 2017-01-23 18:09:03 -0800 | [diff] [blame] | 5772 | * intent {@link android.content.Intent#ACTION_INSTALL_PACKAGE}. Starting from Android O, the |
| 5773 | * user can explicitly choose what external sources they trust to install apps on the device. |
Suprabh Shukla | 5752847 | 2017-04-14 19:22:45 -0700 | [diff] [blame] | 5774 | * If this API returns false, the install request will be blocked by the package installer and |
Suprabh Shukla | aef2513 | 2017-01-23 18:09:03 -0800 | [diff] [blame] | 5775 | * a dialog will be shown to the user with an option to launch settings to change their |
| 5776 | * preference. An application must target Android O or higher and declare permission |
Suprabh Shukla | 5752847 | 2017-04-14 19:22:45 -0700 | [diff] [blame] | 5777 | * {@link android.Manifest.permission#REQUEST_INSTALL_PACKAGES} in order to use this API. |
Suprabh Shukla | aef2513 | 2017-01-23 18:09:03 -0800 | [diff] [blame] | 5778 | * |
| 5779 | * @return true if the calling package is trusted by the user to request install packages on |
| 5780 | * the device, false otherwise. |
Suprabh Shukla | 5752847 | 2017-04-14 19:22:45 -0700 | [diff] [blame] | 5781 | * @see android.content.Intent#ACTION_INSTALL_PACKAGE |
| 5782 | * @see android.provider.Settings#ACTION_MANAGE_UNKNOWN_APP_SOURCES |
Suprabh Shukla | aef2513 | 2017-01-23 18:09:03 -0800 | [diff] [blame] | 5783 | */ |
| 5784 | public abstract boolean canRequestPackageInstalls(); |
Chad Brubaker | aa49cb8 | 2017-03-24 15:53:09 -0700 | [diff] [blame] | 5785 | |
| 5786 | /** |
| 5787 | * Return the {@link ComponentName} of the activity providing Settings for the Instant App |
| 5788 | * resolver. |
| 5789 | * |
Todd Kennedy | 801e659 | 2017-04-12 14:10:12 -0700 | [diff] [blame] | 5790 | * @see {@link android.content.Intent#ACTION_INSTANT_APP_RESOLVER_SETTINGS} |
Chad Brubaker | aa49cb8 | 2017-03-24 15:53:09 -0700 | [diff] [blame] | 5791 | * @hide |
| 5792 | */ |
| 5793 | @SystemApi |
| 5794 | public abstract ComponentName getInstantAppResolverSettingsComponent(); |
Todd Kennedy | 801e659 | 2017-04-12 14:10:12 -0700 | [diff] [blame] | 5795 | |
| 5796 | /** |
| 5797 | * Return the {@link ComponentName} of the activity responsible for installing instant |
| 5798 | * applications. |
| 5799 | * |
| 5800 | * @see {@link android.content.Intent#ACTION_INSTALL_INSTANT_APP_PACKAGE} |
| 5801 | * @hide |
| 5802 | */ |
| 5803 | @SystemApi |
| 5804 | public abstract ComponentName getInstantAppInstallerComponent(); |
Chad Brubaker | 0d277a7 | 2017-04-12 16:56:53 -0700 | [diff] [blame] | 5805 | |
| 5806 | /** |
| 5807 | * Return the Android Id for a given Instant App. |
| 5808 | * |
| 5809 | * @see {@link android.provider.Settings.Secure#ANDROID_ID} |
| 5810 | * @hide |
| 5811 | */ |
| 5812 | public abstract String getInstantAppAndroidId(String packageName, @NonNull UserHandle user); |
Calin Juravle | 3d2af7f | 2017-04-19 19:56:21 -0700 | [diff] [blame] | 5813 | |
| 5814 | /** |
| 5815 | * Callback use to notify the callers of module registration that the operation |
| 5816 | * has finished. |
| 5817 | * |
| 5818 | * @hide |
| 5819 | */ |
Jeff Sharkey | 9039636 | 2017-06-12 16:26:53 -0600 | [diff] [blame] | 5820 | @SystemApi |
Calin Juravle | 3d2af7f | 2017-04-19 19:56:21 -0700 | [diff] [blame] | 5821 | public static abstract class DexModuleRegisterCallback { |
| 5822 | public abstract void onDexModuleRegistered(String dexModulePath, boolean success, |
| 5823 | String message); |
| 5824 | } |
| 5825 | |
| 5826 | /** |
| 5827 | * Register an application dex module with the package manager. |
| 5828 | * The package manager will keep track of the given module for future optimizations. |
| 5829 | * |
| 5830 | * Dex module optimizations will disable the classpath checking at runtime. The client bares |
| 5831 | * the responsibility to ensure that the static assumptions on classes in the optimized code |
| 5832 | * hold at runtime (e.g. there's no duplicate classes in the classpath). |
| 5833 | * |
| 5834 | * Note that the package manager already keeps track of dex modules loaded with |
| 5835 | * {@link dalvik.system.DexClassLoader} and {@link dalvik.system.PathClassLoader}. |
| 5836 | * This can be called for an eager registration. |
| 5837 | * |
| 5838 | * The call might take a while and the results will be posted on the main thread, using |
| 5839 | * the given callback. |
| 5840 | * |
| 5841 | * If the module is intended to be shared with other apps, make sure that the file |
| 5842 | * permissions allow for it. |
| 5843 | * If at registration time the permissions allow for others to read it, the module would |
| 5844 | * be marked as a shared module which might undergo a different optimization strategy. |
| 5845 | * (usually shared modules will generated larger optimizations artifacts, |
| 5846 | * taking more disk space). |
| 5847 | * |
| 5848 | * @param dexModulePath the absolute path of the dex module. |
| 5849 | * @param callback if not null, {@link DexModuleRegisterCallback#onDexModuleRegistered} will |
| 5850 | * be called once the registration finishes. |
| 5851 | * |
| 5852 | * @hide |
| 5853 | */ |
Jeff Sharkey | 9039636 | 2017-06-12 16:26:53 -0600 | [diff] [blame] | 5854 | @SystemApi |
Calin Juravle | 3d2af7f | 2017-04-19 19:56:21 -0700 | [diff] [blame] | 5855 | public abstract void registerDexModule(String dexModulePath, |
| 5856 | @Nullable DexModuleRegisterCallback callback); |
Calin Juravle | 45f8b29 | 2017-11-07 18:49:43 -0800 | [diff] [blame] | 5857 | |
| 5858 | /** |
| 5859 | * Returns the {@link ArtManager} associated with this package manager. |
| 5860 | * |
| 5861 | * @hide |
| 5862 | */ |
| 5863 | @SystemApi |
| 5864 | public @NonNull ArtManager getArtManager() { |
| 5865 | throw new UnsupportedOperationException("getArtManager not implemented in subclass"); |
| 5866 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5867 | } |