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; |
Jeff Sharkey | 6c0b9da | 2014-08-07 22:07:11 -0700 | [diff] [blame] | 34 | import android.app.PackageDeleteObserver; |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 35 | import android.app.PackageInstallObserver; |
Amith Yamasani | 1d65327 | 2014-09-11 17:56:05 -0700 | [diff] [blame] | 36 | import android.app.admin.DevicePolicyManager; |
Jeff Sharkey | 60f95aa | 2017-03-08 13:57:15 -0700 | [diff] [blame] | 37 | import android.app.usage.StorageStatsManager; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 38 | import android.content.ComponentName; |
| 39 | import android.content.Context; |
| 40 | import android.content.Intent; |
| 41 | import android.content.IntentFilter; |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 42 | import android.content.IntentSender; |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 43 | import android.content.pm.PackageParser.PackageParserException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 44 | import android.content.res.Resources; |
| 45 | import android.content.res.XmlResourceParser; |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 46 | import android.graphics.Rect; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 47 | import android.graphics.drawable.Drawable; |
| 48 | import android.net.Uri; |
Jeff Sharkey | 6f4b2a3 | 2017-03-21 14:13:41 -0600 | [diff] [blame] | 49 | import android.os.Build; |
Jeff Sharkey | bb58067 | 2014-07-10 12:10:25 -0700 | [diff] [blame] | 50 | import android.os.Bundle; |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 51 | import android.os.Handler; |
Jeff Sharkey | 6c0b9da | 2014-08-07 22:07:11 -0700 | [diff] [blame] | 52 | import android.os.RemoteException; |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 53 | import android.os.UserHandle; |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 54 | import android.os.UserManager; |
Jeff Sharkey | 683bcd3 | 2017-03-18 17:54:51 -0600 | [diff] [blame] | 55 | import android.os.storage.StorageManager; |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 56 | import android.os.storage.VolumeInfo; |
Todd Kennedy | 8fddf9d | 2017-04-17 15:16:12 -0700 | [diff] [blame] | 57 | import android.provider.Settings; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 58 | import android.util.AndroidException; |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 59 | import android.util.Log; |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 60 | |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 61 | import com.android.internal.util.ArrayUtils; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 62 | |
Jeff Sharkey | 6f4b2a3 | 2017-03-21 14:13:41 -0600 | [diff] [blame] | 63 | import dalvik.system.VMRuntime; |
| 64 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 65 | import java.io.File; |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 66 | import java.lang.annotation.Retention; |
| 67 | import java.lang.annotation.RetentionPolicy; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 68 | import java.util.List; |
| 69 | |
| 70 | /** |
| 71 | * Class for retrieving various kinds of information related to the application |
| 72 | * packages that are currently installed on the device. |
| 73 | * |
| 74 | * You can find this class through {@link Context#getPackageManager}. |
| 75 | */ |
| 76 | public abstract class PackageManager { |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 77 | private static final String TAG = "PackageManager"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 78 | |
Jeff Sharkey | e469713 | 2016-02-06 19:46:15 -0700 | [diff] [blame] | 79 | /** {@hide} */ |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 80 | public static final boolean APPLY_DEFAULT_TO_DEVICE_PROTECTED_STORAGE = true; |
Jeff Sharkey | e469713 | 2016-02-06 19:46:15 -0700 | [diff] [blame] | 81 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 82 | /** |
| 83 | * This exception is thrown when a given package, application, or component |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 84 | * name cannot be found. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 85 | */ |
| 86 | public static class NameNotFoundException extends AndroidException { |
| 87 | public NameNotFoundException() { |
| 88 | } |
| 89 | |
| 90 | public NameNotFoundException(String name) { |
| 91 | super(name); |
| 92 | } |
| 93 | } |
| 94 | |
| 95 | /** |
Svetoslav | f7c06eb | 2015-06-10 18:43:22 -0700 | [diff] [blame] | 96 | * Listener for changes in permissions granted to a UID. |
| 97 | * |
| 98 | * @hide |
| 99 | */ |
| 100 | @SystemApi |
| 101 | public interface OnPermissionsChangedListener { |
| 102 | |
| 103 | /** |
| 104 | * Called when the permissions for a UID change. |
| 105 | * @param uid The UID with a change. |
| 106 | */ |
| 107 | public void onPermissionsChanged(int uid); |
| 108 | } |
| 109 | |
| 110 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 111 | * As a guiding principle: |
| 112 | * <p> |
| 113 | * {@code GET_} flags are used to request additional data that may have been |
| 114 | * elided to save wire space. |
| 115 | * <p> |
| 116 | * {@code MATCH_} flags are used to include components or packages that |
| 117 | * would have otherwise been omitted from a result set by current system |
| 118 | * state. |
| 119 | */ |
| 120 | |
| 121 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 122 | @IntDef(flag = true, prefix = { "GET_", "MATCH_" }, value = { |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 123 | GET_ACTIVITIES, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 124 | GET_CONFIGURATIONS, |
| 125 | GET_GIDS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 126 | GET_INSTRUMENTATION, |
| 127 | GET_INTENT_FILTERS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 128 | GET_META_DATA, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 129 | GET_PERMISSIONS, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 130 | GET_PROVIDERS, |
| 131 | GET_RECEIVERS, |
| 132 | GET_SERVICES, |
| 133 | GET_SHARED_LIBRARY_FILES, |
| 134 | GET_SIGNATURES, |
| 135 | GET_URI_PERMISSION_PATTERNS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 136 | MATCH_UNINSTALLED_PACKAGES, |
| 137 | MATCH_DISABLED_COMPONENTS, |
| 138 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
Jeff Sharkey | c5967e9 | 2016-01-07 18:50:29 -0700 | [diff] [blame] | 139 | MATCH_SYSTEM_ONLY, |
Todd Kennedy | d6ee0ba | 2016-03-31 15:11:11 -0700 | [diff] [blame] | 140 | MATCH_FACTORY_ONLY, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 141 | MATCH_DEBUG_TRIAGED_MISSING, |
Todd Kennedy | 9c9fdf2 | 2017-03-06 10:58:27 -0800 | [diff] [blame] | 142 | MATCH_INSTANT, |
Todd Kennedy | 1f397f4 | 2016-06-28 12:14:11 -0700 | [diff] [blame] | 143 | GET_DISABLED_COMPONENTS, |
| 144 | GET_DISABLED_UNTIL_USED_COMPONENTS, |
| 145 | GET_UNINSTALLED_PACKAGES, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 146 | }) |
| 147 | @Retention(RetentionPolicy.SOURCE) |
| 148 | public @interface PackageInfoFlags {} |
| 149 | |
| 150 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 151 | @IntDef(flag = true, prefix = { "GET_", "MATCH_" }, value = { |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 152 | GET_META_DATA, |
| 153 | GET_SHARED_LIBRARY_FILES, |
| 154 | MATCH_UNINSTALLED_PACKAGES, |
| 155 | MATCH_SYSTEM_ONLY, |
| 156 | MATCH_DEBUG_TRIAGED_MISSING, |
Todd Kennedy | 2452202 | 2017-03-27 16:32:20 -0700 | [diff] [blame] | 157 | MATCH_DISABLED_COMPONENTS, |
Todd Kennedy | 5a32c6c | 2016-07-07 14:29:06 -0700 | [diff] [blame] | 158 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
Todd Kennedy | 9c9fdf2 | 2017-03-06 10:58:27 -0800 | [diff] [blame] | 159 | MATCH_INSTANT, |
Svet Ganov | 9e77977 | 2017-05-11 14:36:50 -0700 | [diff] [blame] | 160 | MATCH_STATIC_SHARED_LIBRARIES, |
Todd Kennedy | 5a32c6c | 2016-07-07 14:29:06 -0700 | [diff] [blame] | 161 | GET_DISABLED_UNTIL_USED_COMPONENTS, |
Todd Kennedy | 1f397f4 | 2016-06-28 12:14:11 -0700 | [diff] [blame] | 162 | GET_UNINSTALLED_PACKAGES, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 163 | }) |
| 164 | @Retention(RetentionPolicy.SOURCE) |
| 165 | public @interface ApplicationInfoFlags {} |
| 166 | |
| 167 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 168 | @IntDef(flag = true, prefix = { "GET_", "MATCH_" }, value = { |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 169 | GET_META_DATA, |
| 170 | GET_SHARED_LIBRARY_FILES, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 171 | MATCH_ALL, |
| 172 | MATCH_DEBUG_TRIAGED_MISSING, |
| 173 | MATCH_DEFAULT_ONLY, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 174 | MATCH_DISABLED_COMPONENTS, |
| 175 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 176 | MATCH_DIRECT_BOOT_AWARE, |
| 177 | MATCH_DIRECT_BOOT_UNAWARE, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 178 | MATCH_SYSTEM_ONLY, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 179 | MATCH_UNINSTALLED_PACKAGES, |
Todd Kennedy | 9c9fdf2 | 2017-03-06 10:58:27 -0800 | [diff] [blame] | 180 | MATCH_INSTANT, |
Svet Ganov | 9e77977 | 2017-05-11 14:36:50 -0700 | [diff] [blame] | 181 | MATCH_STATIC_SHARED_LIBRARIES, |
Todd Kennedy | 1f397f4 | 2016-06-28 12:14:11 -0700 | [diff] [blame] | 182 | GET_DISABLED_COMPONENTS, |
| 183 | GET_DISABLED_UNTIL_USED_COMPONENTS, |
| 184 | GET_UNINSTALLED_PACKAGES, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 185 | }) |
| 186 | @Retention(RetentionPolicy.SOURCE) |
| 187 | public @interface ComponentInfoFlags {} |
| 188 | |
| 189 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 190 | @IntDef(flag = true, prefix = { "GET_", "MATCH_" }, value = { |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 191 | GET_META_DATA, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 192 | GET_RESOLVED_FILTER, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 193 | GET_SHARED_LIBRARY_FILES, |
| 194 | MATCH_ALL, |
| 195 | MATCH_DEBUG_TRIAGED_MISSING, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 196 | MATCH_DISABLED_COMPONENTS, |
| 197 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 198 | MATCH_DEFAULT_ONLY, |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 199 | MATCH_DIRECT_BOOT_AWARE, |
| 200 | MATCH_DIRECT_BOOT_UNAWARE, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 201 | MATCH_SYSTEM_ONLY, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 202 | MATCH_UNINSTALLED_PACKAGES, |
Todd Kennedy | 9c9fdf2 | 2017-03-06 10:58:27 -0800 | [diff] [blame] | 203 | MATCH_INSTANT, |
Todd Kennedy | 1f397f4 | 2016-06-28 12:14:11 -0700 | [diff] [blame] | 204 | GET_DISABLED_COMPONENTS, |
| 205 | GET_DISABLED_UNTIL_USED_COMPONENTS, |
| 206 | GET_UNINSTALLED_PACKAGES, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 207 | }) |
| 208 | @Retention(RetentionPolicy.SOURCE) |
| 209 | public @interface ResolveInfoFlags {} |
| 210 | |
| 211 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 212 | @IntDef(flag = true, prefix = { "GET_", "MATCH_" }, value = { |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 213 | GET_META_DATA, |
| 214 | }) |
| 215 | @Retention(RetentionPolicy.SOURCE) |
| 216 | public @interface PermissionInfoFlags {} |
| 217 | |
| 218 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 219 | @IntDef(flag = true, prefix = { "GET_", "MATCH_" }, value = { |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 220 | GET_META_DATA, |
| 221 | }) |
| 222 | @Retention(RetentionPolicy.SOURCE) |
| 223 | public @interface PermissionGroupInfoFlags {} |
| 224 | |
| 225 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 226 | @IntDef(flag = true, prefix = { "GET_", "MATCH_" }, value = { |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 227 | GET_META_DATA, |
| 228 | }) |
| 229 | @Retention(RetentionPolicy.SOURCE) |
| 230 | public @interface InstrumentationInfoFlags {} |
| 231 | |
| 232 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 233 | * {@link PackageInfo} flag: return information about |
| 234 | * activities in the package in {@link PackageInfo#activities}. |
| 235 | */ |
| 236 | public static final int GET_ACTIVITIES = 0x00000001; |
| 237 | |
| 238 | /** |
| 239 | * {@link PackageInfo} flag: return information about |
| 240 | * intent receivers in the package in |
| 241 | * {@link PackageInfo#receivers}. |
| 242 | */ |
| 243 | public static final int GET_RECEIVERS = 0x00000002; |
| 244 | |
| 245 | /** |
| 246 | * {@link PackageInfo} flag: return information about |
| 247 | * services in the package in {@link PackageInfo#services}. |
| 248 | */ |
| 249 | public static final int GET_SERVICES = 0x00000004; |
| 250 | |
| 251 | /** |
| 252 | * {@link PackageInfo} flag: return information about |
| 253 | * content providers in the package in |
| 254 | * {@link PackageInfo#providers}. |
| 255 | */ |
| 256 | public static final int GET_PROVIDERS = 0x00000008; |
| 257 | |
| 258 | /** |
| 259 | * {@link PackageInfo} flag: return information about |
| 260 | * instrumentation in the package in |
| 261 | * {@link PackageInfo#instrumentation}. |
| 262 | */ |
| 263 | public static final int GET_INSTRUMENTATION = 0x00000010; |
| 264 | |
| 265 | /** |
| 266 | * {@link PackageInfo} flag: return information about the |
| 267 | * intent filters supported by the activity. |
| 268 | */ |
| 269 | public static final int GET_INTENT_FILTERS = 0x00000020; |
| 270 | |
| 271 | /** |
| 272 | * {@link PackageInfo} flag: return information about the |
| 273 | * signatures included in the package. |
| 274 | */ |
| 275 | public static final int GET_SIGNATURES = 0x00000040; |
| 276 | |
| 277 | /** |
| 278 | * {@link ResolveInfo} flag: return the IntentFilter that |
| 279 | * was matched for a particular ResolveInfo in |
| 280 | * {@link ResolveInfo#filter}. |
| 281 | */ |
| 282 | public static final int GET_RESOLVED_FILTER = 0x00000040; |
| 283 | |
| 284 | /** |
| 285 | * {@link ComponentInfo} flag: return the {@link ComponentInfo#metaData} |
| 286 | * data {@link android.os.Bundle}s that are associated with a component. |
| 287 | * This applies for any API returning a ComponentInfo subclass. |
| 288 | */ |
| 289 | public static final int GET_META_DATA = 0x00000080; |
| 290 | |
| 291 | /** |
| 292 | * {@link PackageInfo} flag: return the |
| 293 | * {@link PackageInfo#gids group ids} that are associated with an |
| 294 | * application. |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 295 | * 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] | 296 | * directly or nested inside of another. |
| 297 | */ |
| 298 | public static final int GET_GIDS = 0x00000100; |
| 299 | |
| 300 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 301 | * @deprecated replaced with {@link #MATCH_DISABLED_COMPONENTS} |
| 302 | */ |
| 303 | @Deprecated |
| 304 | public static final int GET_DISABLED_COMPONENTS = 0x00000200; |
| 305 | |
| 306 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 307 | * {@link PackageInfo} flag: include disabled components in the returned info. |
| 308 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 309 | public static final int MATCH_DISABLED_COMPONENTS = 0x00000200; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 310 | |
| 311 | /** |
| 312 | * {@link ApplicationInfo} flag: return the |
| 313 | * {@link ApplicationInfo#sharedLibraryFiles paths to the shared libraries} |
| 314 | * that are associated with an application. |
| 315 | * This applies for any API returning an ApplicationInfo class, either |
| 316 | * directly or nested inside of another. |
| 317 | */ |
| 318 | public static final int GET_SHARED_LIBRARY_FILES = 0x00000400; |
| 319 | |
| 320 | /** |
| 321 | * {@link ProviderInfo} flag: return the |
| 322 | * {@link ProviderInfo#uriPermissionPatterns URI permission patterns} |
| 323 | * that are associated with a content provider. |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 324 | * 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] | 325 | * directly or nested inside of another. |
| 326 | */ |
| 327 | public static final int GET_URI_PERMISSION_PATTERNS = 0x00000800; |
| 328 | /** |
| 329 | * {@link PackageInfo} flag: return information about |
| 330 | * permissions in the package in |
| 331 | * {@link PackageInfo#permissions}. |
| 332 | */ |
| 333 | public static final int GET_PERMISSIONS = 0x00001000; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 334 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 335 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 336 | * @deprecated replaced with {@link #MATCH_UNINSTALLED_PACKAGES} |
| 337 | */ |
| 338 | @Deprecated |
| 339 | public static final int GET_UNINSTALLED_PACKAGES = 0x00002000; |
| 340 | |
| 341 | /** |
Kenny Root | 685f490 | 2011-11-03 10:13:29 -0700 | [diff] [blame] | 342 | * Flag parameter to retrieve some information about all applications (even |
| 343 | * uninstalled ones) which have data directories. This state could have |
| 344 | * resulted if applications have been deleted with flag |
| 345 | * {@code DONT_DELETE_DATA} with a possibility of being replaced or |
| 346 | * reinstalled in future. |
| 347 | * <p> |
| 348 | * Note: this flag may cause less information about currently installed |
| 349 | * applications to be returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 350 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 351 | public static final int MATCH_UNINSTALLED_PACKAGES = 0x00002000; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 352 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 353 | /** |
| 354 | * {@link PackageInfo} flag: return information about |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 355 | * hardware preferences in |
Adam Lesinski | d3edfde | 2014-08-08 17:32:44 -0700 | [diff] [blame] | 356 | * {@link PackageInfo#configPreferences PackageInfo.configPreferences}, |
| 357 | * and requested features in {@link PackageInfo#reqFeatures} and |
| 358 | * {@link PackageInfo#featureGroups}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 359 | */ |
| 360 | public static final int GET_CONFIGURATIONS = 0x00004000; |
| 361 | |
| 362 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 363 | * @deprecated replaced with {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}. |
| 364 | */ |
| 365 | @Deprecated |
| 366 | public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 0x00008000; |
| 367 | |
| 368 | /** |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 369 | * {@link PackageInfo} flag: include disabled components which are in |
| 370 | * that state only because of {@link #COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED} |
| 371 | * in the returned info. Note that if you set this flag, applications |
| 372 | * that are in this disabled state will be reported as enabled. |
| 373 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 374 | public static final int MATCH_DISABLED_UNTIL_USED_COMPONENTS = 0x00008000; |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 375 | |
| 376 | /** |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 377 | * Resolution and querying flag: if set, only filters that support the |
| 378 | * {@link android.content.Intent#CATEGORY_DEFAULT} will be considered for |
| 379 | * matching. This is a synonym for including the CATEGORY_DEFAULT in your |
| 380 | * supplied Intent. |
| 381 | */ |
Fabrice Di Meglio | 9f7e39f | 2015-04-10 20:40:16 -0700 | [diff] [blame] | 382 | public static final int MATCH_DEFAULT_ONLY = 0x00010000; |
| 383 | |
| 384 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 385 | * Querying flag: if set and if the platform is doing any filtering of the |
| 386 | * results, then the filtering will not happen. This is a synonym for saying |
| 387 | * that all results should be returned. |
| 388 | * <p> |
| 389 | * <em>This flag should be used with extreme care.</em> |
Fabrice Di Meglio | 9f7e39f | 2015-04-10 20:40:16 -0700 | [diff] [blame] | 390 | */ |
| 391 | public static final int MATCH_ALL = 0x00020000; |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 392 | |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 393 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 394 | * Querying flag: match components which are direct boot <em>unaware</em> in |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 395 | * the returned info, regardless of the current user state. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 396 | * <p> |
| 397 | * When neither {@link #MATCH_DIRECT_BOOT_AWARE} nor |
| 398 | * {@link #MATCH_DIRECT_BOOT_UNAWARE} are specified, the default behavior is |
| 399 | * to match only runnable components based on the user state. For example, |
| 400 | * when a user is started but credentials have not been presented yet, the |
| 401 | * user is running "locked" and only {@link #MATCH_DIRECT_BOOT_AWARE} |
| 402 | * components are returned. Once the user credentials have been presented, |
| 403 | * the user is running "unlocked" and both {@link #MATCH_DIRECT_BOOT_AWARE} |
| 404 | * and {@link #MATCH_DIRECT_BOOT_UNAWARE} components are returned. |
| 405 | * |
| 406 | * @see UserManager#isUserUnlocked() |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 407 | */ |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 408 | public static final int MATCH_DIRECT_BOOT_UNAWARE = 0x00040000; |
| 409 | |
| 410 | /** |
| 411 | * Querying flag: match components which are direct boot <em>aware</em> in |
| 412 | * the returned info, regardless of the current user state. |
| 413 | * <p> |
| 414 | * When neither {@link #MATCH_DIRECT_BOOT_AWARE} nor |
| 415 | * {@link #MATCH_DIRECT_BOOT_UNAWARE} are specified, the default behavior is |
| 416 | * to match only runnable components based on the user state. For example, |
| 417 | * when a user is started but credentials have not been presented yet, the |
| 418 | * user is running "locked" and only {@link #MATCH_DIRECT_BOOT_AWARE} |
| 419 | * components are returned. Once the user credentials have been presented, |
| 420 | * the user is running "unlocked" and both {@link #MATCH_DIRECT_BOOT_AWARE} |
| 421 | * and {@link #MATCH_DIRECT_BOOT_UNAWARE} components are returned. |
| 422 | * |
| 423 | * @see UserManager#isUserUnlocked() |
| 424 | */ |
| 425 | public static final int MATCH_DIRECT_BOOT_AWARE = 0x00080000; |
| 426 | |
Jeff Sharkey | 2a9e3f8 | 2015-12-18 10:57:58 -0700 | [diff] [blame] | 427 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 428 | * Querying flag: include only components from applications that are marked |
| 429 | * with {@link ApplicationInfo#FLAG_SYSTEM}. |
Jeff Sharkey | 5217cac | 2015-12-20 15:34:01 -0700 | [diff] [blame] | 430 | */ |
| 431 | public static final int MATCH_SYSTEM_ONLY = 0x00100000; |
| 432 | |
| 433 | /** |
Todd Kennedy | d6ee0ba | 2016-03-31 15:11:11 -0700 | [diff] [blame] | 434 | * Internal {@link PackageInfo} flag: include only components on the system image. |
| 435 | * This will not return information on any unbundled update to system components. |
| 436 | * @hide |
| 437 | */ |
Todd Kennedy | 4908496 | 2017-03-27 16:20:37 -0700 | [diff] [blame] | 438 | @SystemApi |
Todd Kennedy | d6ee0ba | 2016-03-31 15:11:11 -0700 | [diff] [blame] | 439 | public static final int MATCH_FACTORY_ONLY = 0x00200000; |
| 440 | |
| 441 | /** |
Amith Yamasani | 0d1fd8d | 2016-10-12 14:21:51 -0700 | [diff] [blame] | 442 | * 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] | 443 | * 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] | 444 | * @hide |
| 445 | */ |
Amith Yamasani | 475f9a3 | 2016-12-08 09:46:15 -0800 | [diff] [blame] | 446 | @SystemApi |
Amith Yamasani | 0d1fd8d | 2016-10-12 14:21:51 -0700 | [diff] [blame] | 447 | public static final int MATCH_ANY_USER = 0x00400000; |
| 448 | |
| 449 | /** |
| 450 | * Combination of MATCH_ANY_USER and MATCH_UNINSTALLED_PACKAGES to mean any known |
| 451 | * package. |
| 452 | * @hide |
| 453 | */ |
| 454 | public static final int MATCH_KNOWN_PACKAGES = MATCH_UNINSTALLED_PACKAGES | MATCH_ANY_USER; |
| 455 | |
| 456 | /** |
Todd Kennedy | 7bc3a70 | 2016-12-08 14:54:48 -0800 | [diff] [blame] | 457 | * Internal {@link PackageInfo} flag: include components that are part of an |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 458 | * instant app. By default, instant app components are not matched. |
Todd Kennedy | 7bc3a70 | 2016-12-08 14:54:48 -0800 | [diff] [blame] | 459 | * @hide |
| 460 | */ |
Todd Kennedy | 9c9fdf2 | 2017-03-06 10:58:27 -0800 | [diff] [blame] | 461 | @SystemApi |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 462 | public static final int MATCH_INSTANT = 0x00800000; |
Todd Kennedy | 7bc3a70 | 2016-12-08 14:54:48 -0800 | [diff] [blame] | 463 | |
| 464 | /** |
| 465 | * Internal {@link PackageInfo} flag: include only components that are exposed to |
Todd Kennedy | c05f5d1 | 2017-04-25 11:11:40 -0700 | [diff] [blame] | 466 | * instant apps. Matched components may have been either explicitly or implicitly |
| 467 | * exposed. |
Todd Kennedy | 7bc3a70 | 2016-12-08 14:54:48 -0800 | [diff] [blame] | 468 | * @hide |
| 469 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 470 | public static final int MATCH_VISIBLE_TO_INSTANT_APP_ONLY = 0x01000000; |
Todd Kennedy | 7bc3a70 | 2016-12-08 14:54:48 -0800 | [diff] [blame] | 471 | |
| 472 | /** |
Todd Kennedy | c05f5d1 | 2017-04-25 11:11:40 -0700 | [diff] [blame] | 473 | * Internal {@link PackageInfo} flag: include only components that have been |
| 474 | * explicitly exposed to instant apps. |
| 475 | * @hide |
| 476 | */ |
| 477 | public static final int MATCH_EXPLICITLY_VISIBLE_ONLY = 0x02000000; |
| 478 | |
| 479 | /** |
Svet Ganov | 9e77977 | 2017-05-11 14:36:50 -0700 | [diff] [blame] | 480 | * Internal {@link PackageInfo} flag: include static shared libraries. |
| 481 | * Apps that depend on static shared libs can always access the version |
| 482 | * of the lib they depend on. System/shell/root can access all shared |
| 483 | * libs regardless of dependency but need to explicitly ask for them |
| 484 | * via this flag. |
| 485 | * @hide |
| 486 | */ |
| 487 | public static final int MATCH_STATIC_SHARED_LIBRARIES = 0x04000000; |
| 488 | |
| 489 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 490 | * Internal flag used to indicate that a system component has done their |
| 491 | * homework and verified that they correctly handle packages and components |
| 492 | * that come and go over time. In particular: |
| 493 | * <ul> |
| 494 | * <li>Apps installed on external storage, which will appear to be |
| 495 | * uninstalled while the the device is ejected. |
| 496 | * <li>Apps with encryption unaware components, which will appear to not |
| 497 | * exist while the device is locked. |
| 498 | * </ul> |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 499 | * |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 500 | * @see #MATCH_UNINSTALLED_PACKAGES |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 501 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 502 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 503 | * @hide |
| 504 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 505 | public static final int MATCH_DEBUG_TRIAGED_MISSING = 0x10000000; |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 506 | |
| 507 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 508 | * Flag for {@link #addCrossProfileIntentFilter}: if this flag is set: when |
| 509 | * resolving an intent that matches the {@code CrossProfileIntentFilter}, |
| 510 | * the current profile will be skipped. Only activities in the target user |
| 511 | * can respond to the intent. |
| 512 | * |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 513 | * @hide |
| 514 | */ |
| 515 | public static final int SKIP_CURRENT_PROFILE = 0x00000002; |
| 516 | |
Tony Mak | 807e01c | 2015-12-01 20:19:03 +0000 | [diff] [blame] | 517 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 518 | * Flag for {@link #addCrossProfileIntentFilter}: if this flag is set: |
Tony Mak | 807e01c | 2015-12-01 20:19:03 +0000 | [diff] [blame] | 519 | * activities in the other profiles can respond to the intent only if no activity with |
| 520 | * non-negative priority in current profile can respond to the intent. |
| 521 | * @hide |
| 522 | */ |
| 523 | public static final int ONLY_IF_NO_MATCH_FOUND = 0x00000004; |
| 524 | |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 525 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 526 | @IntDef(prefix = { "PERMISSION_" }, value = { |
| 527 | PERMISSION_GRANTED, |
| 528 | PERMISSION_DENIED |
| 529 | }) |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 530 | @Retention(RetentionPolicy.SOURCE) |
| 531 | public @interface PermissionResult {} |
| 532 | |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 533 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 534 | * Permission check result: this is returned by {@link #checkPermission} |
| 535 | * if the permission has been granted to the given package. |
| 536 | */ |
| 537 | public static final int PERMISSION_GRANTED = 0; |
| 538 | |
| 539 | /** |
| 540 | * Permission check result: this is returned by {@link #checkPermission} |
| 541 | * if the permission has not been granted to the given package. |
| 542 | */ |
| 543 | public static final int PERMISSION_DENIED = -1; |
| 544 | |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 545 | /** @hide */ |
| 546 | @IntDef(prefix = { "SIGNATURE_" }, value = { |
| 547 | SIGNATURE_MATCH, |
| 548 | SIGNATURE_NEITHER_SIGNED, |
| 549 | SIGNATURE_FIRST_NOT_SIGNED, |
| 550 | SIGNATURE_SECOND_NOT_SIGNED, |
| 551 | SIGNATURE_NO_MATCH, |
| 552 | SIGNATURE_UNKNOWN_PACKAGE, |
| 553 | }) |
| 554 | @Retention(RetentionPolicy.SOURCE) |
| 555 | public @interface SignatureResult {} |
| 556 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 557 | /** |
| 558 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 559 | * if all signatures on the two packages match. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 560 | */ |
| 561 | public static final int SIGNATURE_MATCH = 0; |
| 562 | |
| 563 | /** |
| 564 | * Signature check result: this is returned by {@link #checkSignatures} |
| 565 | * if neither of the two packages is signed. |
| 566 | */ |
| 567 | public static final int SIGNATURE_NEITHER_SIGNED = 1; |
| 568 | |
| 569 | /** |
| 570 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 571 | * 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] | 572 | */ |
| 573 | public static final int SIGNATURE_FIRST_NOT_SIGNED = -1; |
| 574 | |
| 575 | /** |
| 576 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 577 | * 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] | 578 | */ |
| 579 | public static final int SIGNATURE_SECOND_NOT_SIGNED = -2; |
| 580 | |
| 581 | /** |
| 582 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 583 | * if not all signatures on both packages match. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 584 | */ |
| 585 | public static final int SIGNATURE_NO_MATCH = -3; |
| 586 | |
| 587 | /** |
| 588 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 589 | * if either of the packages are not valid. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 590 | */ |
| 591 | public static final int SIGNATURE_UNKNOWN_PACKAGE = -4; |
| 592 | |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 593 | /** @hide */ |
| 594 | @IntDef(prefix = { "COMPONENT_ENABLED_STATE_" }, value = { |
| 595 | COMPONENT_ENABLED_STATE_DEFAULT, |
| 596 | COMPONENT_ENABLED_STATE_ENABLED, |
| 597 | COMPONENT_ENABLED_STATE_DISABLED, |
| 598 | COMPONENT_ENABLED_STATE_DISABLED_USER, |
| 599 | COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED, |
| 600 | }) |
| 601 | @Retention(RetentionPolicy.SOURCE) |
| 602 | public @interface EnabledState {} |
| 603 | |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 604 | /** |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 605 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} and |
| 606 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 607 | * component or application is in its default enabled state (as specified in |
| 608 | * its manifest). |
| 609 | * <p> |
| 610 | * Explicitly setting the component state to this value restores it's |
| 611 | * enabled state to whatever is set in the manifest. |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 612 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 613 | public static final int COMPONENT_ENABLED_STATE_DEFAULT = 0; |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 614 | |
| 615 | /** |
| 616 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} |
| 617 | * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 618 | * component or application has been explictily enabled, regardless of |
| 619 | * what it has specified in its manifest. |
| 620 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 621 | public static final int COMPONENT_ENABLED_STATE_ENABLED = 1; |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 622 | |
| 623 | /** |
| 624 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} |
| 625 | * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 626 | * component or application has been explicitly disabled, regardless of |
| 627 | * what it has specified in its manifest. |
| 628 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 629 | public static final int COMPONENT_ENABLED_STATE_DISABLED = 2; |
| 630 | |
| 631 | /** |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 632 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} only: The |
| 633 | * user has explicitly disabled the application, regardless of what it has |
| 634 | * specified in its manifest. Because this is due to the user's request, |
| 635 | * they may re-enable it if desired through the appropriate system UI. This |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 636 | * option currently <strong>cannot</strong> be used with |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 637 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}. |
| 638 | */ |
| 639 | public static final int COMPONENT_ENABLED_STATE_DISABLED_USER = 3; |
| 640 | |
| 641 | /** |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 642 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} only: This |
| 643 | * application should be considered, until the point where the user actually |
| 644 | * wants to use it. This means that it will not normally show up to the user |
| 645 | * (such as in the launcher), but various parts of the user interface can |
| 646 | * use {@link #GET_DISABLED_UNTIL_USED_COMPONENTS} to still see it and allow |
| 647 | * the user to select it (as for example an IME, device admin, etc). Such code, |
| 648 | * once the user has selected the app, should at that point also make it enabled. |
| 649 | * This option currently <strong>can not</strong> be used with |
| 650 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}. |
| 651 | */ |
| 652 | public static final int COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED = 4; |
| 653 | |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 654 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 655 | @IntDef(flag = true, prefix = { "INSTALL_" }, value = { |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 656 | INSTALL_FORWARD_LOCK, |
| 657 | INSTALL_REPLACE_EXISTING, |
| 658 | INSTALL_ALLOW_TEST, |
| 659 | INSTALL_EXTERNAL, |
| 660 | INSTALL_INTERNAL, |
| 661 | INSTALL_FROM_ADB, |
| 662 | INSTALL_ALL_USERS, |
| 663 | INSTALL_ALLOW_DOWNGRADE, |
| 664 | INSTALL_GRANT_RUNTIME_PERMISSIONS, |
| 665 | INSTALL_FORCE_VOLUME_UUID, |
| 666 | INSTALL_FORCE_PERMISSION_PROMPT, |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 667 | INSTALL_INSTANT_APP, |
Todd Kennedy | 39bfee5 | 2016-02-24 10:28:21 -0800 | [diff] [blame] | 668 | INSTALL_DONT_KILL_APP, |
Jeff Sharkey | 683bcd3 | 2017-03-18 17:54:51 -0600 | [diff] [blame] | 669 | INSTALL_FORCE_SDK, |
| 670 | INSTALL_FULL_APP, |
| 671 | INSTALL_ALLOCATE_AGGRESSIVE, |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 672 | }) |
| 673 | @Retention(RetentionPolicy.SOURCE) |
| 674 | public @interface InstallFlags {} |
| 675 | |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 676 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 677 | * Flag parameter for {@link #installPackage} to indicate that this package |
| 678 | * should be installed as forward locked, i.e. only the app itself should |
| 679 | * have access to its code and non-resource assets. |
| 680 | * |
Jeff Sharkey | 8c61e39 | 2017-02-24 09:22:48 -0700 | [diff] [blame] | 681 | * @deprecated new installs into ASEC containers are no longer supported. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 682 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 683 | */ |
Jeff Sharkey | 8c61e39 | 2017-02-24 09:22:48 -0700 | [diff] [blame] | 684 | @Deprecated |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 685 | public static final int INSTALL_FORWARD_LOCK = 0x00000001; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 686 | |
| 687 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 688 | * Flag parameter for {@link #installPackage} to indicate that you want to |
| 689 | * replace an already installed package, if one exists. |
| 690 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 691 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 692 | */ |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 693 | public static final int INSTALL_REPLACE_EXISTING = 0x00000002; |
| 694 | |
| 695 | /** |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 696 | * Flag parameter for {@link #installPackage} to indicate that you want to |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 697 | * allow test packages (those that have set android:testOnly in their |
| 698 | * manifest) to be installed. |
| 699 | * @hide |
| 700 | */ |
| 701 | public static final int INSTALL_ALLOW_TEST = 0x00000004; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 702 | |
| 703 | /** |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 704 | * Flag parameter for {@link #installPackage} to indicate that this package |
| 705 | * must be installed to an ASEC on a {@link VolumeInfo#TYPE_PUBLIC}. |
| 706 | * |
Jeff Sharkey | 8c61e39 | 2017-02-24 09:22:48 -0700 | [diff] [blame] | 707 | * @deprecated new installs into ASEC containers are no longer supported; |
| 708 | * use adoptable storage instead. |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 709 | * @hide |
| 710 | */ |
Jeff Sharkey | 8c61e39 | 2017-02-24 09:22:48 -0700 | [diff] [blame] | 711 | @Deprecated |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 712 | public static final int INSTALL_EXTERNAL = 0x00000008; |
Oscar Montemayor | 539d3c4 | 2010-01-29 15:27:00 -0800 | [diff] [blame] | 713 | |
| 714 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 715 | * Flag parameter for {@link #installPackage} to indicate that this package |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 716 | * must be installed to internal storage. |
| 717 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 718 | * @hide |
| 719 | */ |
| 720 | public static final int INSTALL_INTERNAL = 0x00000010; |
| 721 | |
| 722 | /** |
| 723 | * Flag parameter for {@link #installPackage} to indicate that this install |
| 724 | * was initiated via ADB. |
| 725 | * |
| 726 | * @hide |
| 727 | */ |
| 728 | public static final int INSTALL_FROM_ADB = 0x00000020; |
Suchi Amalapurapu | 14b6abd | 2010-03-17 08:37:04 -0700 | [diff] [blame] | 729 | |
| 730 | /** |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 731 | * Flag parameter for {@link #installPackage} to indicate that this install |
| 732 | * should immediately be visible to all users. |
| 733 | * |
| 734 | * @hide |
| 735 | */ |
| 736 | public static final int INSTALL_ALL_USERS = 0x00000040; |
| 737 | |
| 738 | /** |
| 739 | * Flag parameter for {@link #installPackage} to indicate that it is okay |
| 740 | * 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] | 741 | * version code than the currently installed app. This is permitted only if |
| 742 | * the currently installed app is marked debuggable. |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 743 | * |
| 744 | * @hide |
| 745 | */ |
| 746 | public static final int INSTALL_ALLOW_DOWNGRADE = 0x00000080; |
| 747 | |
| 748 | /** |
Svet Ganov | 95c1ade | 2015-03-19 09:38:52 -0700 | [diff] [blame] | 749 | * Flag parameter for {@link #installPackage} to indicate that all runtime |
| 750 | * permissions should be granted to the package. If {@link #INSTALL_ALL_USERS} |
| 751 | * is set the runtime permissions will be granted to all users, otherwise |
| 752 | * only to the owner. |
| 753 | * |
| 754 | * @hide |
| 755 | */ |
| 756 | public static final int INSTALL_GRANT_RUNTIME_PERMISSIONS = 0x00000100; |
| 757 | |
Jeff Sharkey | ab23409 | 2015-06-09 21:42:22 -0700 | [diff] [blame] | 758 | /** {@hide} */ |
| 759 | public static final int INSTALL_FORCE_VOLUME_UUID = 0x00000200; |
| 760 | |
Svet Ganov | 95c1ade | 2015-03-19 09:38:52 -0700 | [diff] [blame] | 761 | /** |
Todd Kennedy | a1d12cf | 2015-09-29 15:43:00 -0700 | [diff] [blame] | 762 | * Flag parameter for {@link #installPackage} to indicate that we always want to force |
| 763 | * the prompt for permission approval. This overrides any special behaviour for internal |
| 764 | * components. |
| 765 | * |
| 766 | * @hide |
| 767 | */ |
| 768 | public static final int INSTALL_FORCE_PERMISSION_PROMPT = 0x00000400; |
| 769 | |
| 770 | /** |
Todd Kennedy | 27c24fb | 2015-09-17 16:49:25 -0700 | [diff] [blame] | 771 | * Flag parameter for {@link #installPackage} to indicate that this package is |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 772 | * to be installed as a lightweight "ephemeral" app. |
| 773 | * |
| 774 | * @hide |
| 775 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 776 | public static final int INSTALL_INSTANT_APP = 0x00000800; |
| 777 | |
| 778 | /** |
Todd Kennedy | 39bfee5 | 2016-02-24 10:28:21 -0800 | [diff] [blame] | 779 | * Flag parameter for {@link #installPackage} to indicate that this package contains |
| 780 | * a feature split to an existing application and the existing application should not |
| 781 | * be killed during the installation process. |
| 782 | * |
| 783 | * @hide |
| 784 | */ |
| 785 | public static final int INSTALL_DONT_KILL_APP = 0x00001000; |
| 786 | |
| 787 | /** |
Todd Kennedy | b107271 | 2016-04-26 15:41:20 -0700 | [diff] [blame] | 788 | * Flag parameter for {@link #installPackage} to indicate that this package is an |
| 789 | * upgrade to a package that refers to the SDK via release letter. |
| 790 | * |
| 791 | * @hide |
| 792 | */ |
| 793 | public static final int INSTALL_FORCE_SDK = 0x00002000; |
| 794 | |
| 795 | /** |
Jeff Sharkey | 683bcd3 | 2017-03-18 17:54:51 -0600 | [diff] [blame] | 796 | * Flag parameter for {@link #installPackage} to indicate that this package is |
| 797 | * to be installed as a heavy weight app. This is fundamentally the opposite of |
| 798 | * {@link #INSTALL_INSTANT_APP}. |
| 799 | * |
| 800 | * @hide |
| 801 | */ |
| 802 | public static final int INSTALL_FULL_APP = 0x00004000; |
| 803 | |
| 804 | /** |
| 805 | * Flag parameter for {@link #installPackage} to indicate that this package |
| 806 | * is critical to system health or security, meaning the system should use |
| 807 | * {@link StorageManager#FLAG_ALLOCATE_AGGRESSIVE} internally. |
| 808 | * |
| 809 | * @hide |
| 810 | */ |
| 811 | public static final int INSTALL_ALLOCATE_AGGRESSIVE = 0x00008000; |
| 812 | |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 813 | /** @hide */ |
| 814 | @IntDef(flag = true, prefix = { "DONT_KILL_APP" }, value = { |
| 815 | DONT_KILL_APP |
| 816 | }) |
| 817 | @Retention(RetentionPolicy.SOURCE) |
| 818 | public @interface EnabledFlags {} |
| 819 | |
Jeff Sharkey | 683bcd3 | 2017-03-18 17:54:51 -0600 | [diff] [blame] | 820 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 821 | * Flag parameter for |
| 822 | * {@link #setComponentEnabledSetting(android.content.ComponentName, int, int)} to indicate |
| 823 | * that you don't want to kill the app containing the component. Be careful when you set this |
| 824 | * since changing component states can make the containing application's behavior unpredictable. |
| 825 | */ |
| 826 | public static final int DONT_KILL_APP = 0x00000001; |
| 827 | |
Bartosz Fabianowski | a34f53f | 2017-01-11 18:08:47 +0100 | [diff] [blame] | 828 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 829 | @IntDef(prefix = { "INSTALL_REASON_" }, value = { |
| 830 | INSTALL_REASON_UNKNOWN, |
| 831 | INSTALL_REASON_POLICY, |
| 832 | INSTALL_REASON_DEVICE_RESTORE, |
| 833 | INSTALL_REASON_DEVICE_SETUP, |
| 834 | INSTALL_REASON_USER |
| 835 | }) |
Bartosz Fabianowski | a34f53f | 2017-01-11 18:08:47 +0100 | [diff] [blame] | 836 | @Retention(RetentionPolicy.SOURCE) |
| 837 | public @interface InstallReason {} |
| 838 | |
| 839 | /** |
| 840 | * Code indicating that the reason for installing this package is unknown. |
| 841 | */ |
| 842 | public static final int INSTALL_REASON_UNKNOWN = 0; |
| 843 | |
| 844 | /** |
| 845 | * Code indicating that this package was installed due to enterprise policy. |
| 846 | */ |
| 847 | public static final int INSTALL_REASON_POLICY = 1; |
| 848 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 849 | /** |
Sunny Goyal | 80af6a2 | 2017-03-02 08:32:33 -0800 | [diff] [blame] | 850 | * Code indicating that this package was installed as part of restoring from another device. |
| 851 | */ |
| 852 | public static final int INSTALL_REASON_DEVICE_RESTORE = 2; |
| 853 | |
| 854 | /** |
| 855 | * Code indicating that this package was installed as part of device setup. |
| 856 | */ |
| 857 | public static final int INSTALL_REASON_DEVICE_SETUP = 3; |
| 858 | |
| 859 | /** |
| 860 | * Code indicating that the package installation was initiated by the user. |
| 861 | */ |
| 862 | public static final int INSTALL_REASON_USER = 4; |
| 863 | |
| 864 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 865 | * Installation return code: this is passed to the |
| 866 | * {@link IPackageInstallObserver} on success. |
| 867 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 868 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 869 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 870 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 871 | public static final int INSTALL_SUCCEEDED = 1; |
| 872 | |
| 873 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 874 | * Installation return code: this is passed to the |
| 875 | * {@link IPackageInstallObserver} if the package is already installed. |
| 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_FAILED_ALREADY_EXISTS = -1; |
| 881 | |
| 882 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 883 | * Installation return code: this is passed to the |
| 884 | * {@link IPackageInstallObserver} if the package archive file is invalid. |
| 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_INVALID_APK = -2; |
| 890 | |
| 891 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 892 | * Installation return code: this is passed to the |
| 893 | * {@link IPackageInstallObserver} if the URI passed in is invalid. |
| 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_URI = -3; |
| 899 | |
| 900 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 901 | * Installation return code: this is passed to the |
| 902 | * {@link IPackageInstallObserver} if the package manager service found that |
| 903 | * the device didn't have enough storage space to install the app. |
| 904 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 905 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 906 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 907 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 908 | public static final int INSTALL_FAILED_INSUFFICIENT_STORAGE = -4; |
| 909 | |
| 910 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 911 | * Installation return code: this is passed to the |
| 912 | * {@link IPackageInstallObserver} if a package is already installed with |
| 913 | * the same name. |
| 914 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 915 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 916 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 917 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 918 | public static final int INSTALL_FAILED_DUPLICATE_PACKAGE = -5; |
| 919 | |
| 920 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 921 | * Installation return code: this is passed to the |
| 922 | * {@link IPackageInstallObserver} if the requested shared user does not |
| 923 | * exist. |
| 924 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 925 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 926 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 927 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 928 | public static final int INSTALL_FAILED_NO_SHARED_USER = -6; |
| 929 | |
| 930 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 931 | * Installation return code: this is passed to the |
| 932 | * {@link IPackageInstallObserver} if a previously installed package of the |
| 933 | * same name has a different signature than the new package (and the old |
| 934 | * package's data was not removed). |
| 935 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 936 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 937 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 938 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 939 | public static final int INSTALL_FAILED_UPDATE_INCOMPATIBLE = -7; |
| 940 | |
| 941 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 942 | * Installation return code: this is passed to the |
| 943 | * {@link IPackageInstallObserver} if the new package is requested a shared |
| 944 | * user which is already installed on the device and does not have matching |
| 945 | * signature. |
| 946 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 947 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 948 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 949 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 950 | public static final int INSTALL_FAILED_SHARED_USER_INCOMPATIBLE = -8; |
| 951 | |
| 952 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 953 | * Installation return code: this is passed to the |
| 954 | * {@link IPackageInstallObserver} if the new package uses a shared library |
| 955 | * that is not available. |
| 956 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 957 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 958 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 959 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 960 | public static final int INSTALL_FAILED_MISSING_SHARED_LIBRARY = -9; |
| 961 | |
| 962 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 963 | * Installation return code: this is passed to the |
| 964 | * {@link IPackageInstallObserver} if the new package uses a shared library |
| 965 | * that is not available. |
| 966 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 967 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 968 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 969 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 970 | public static final int INSTALL_FAILED_REPLACE_COULDNT_DELETE = -10; |
| 971 | |
| 972 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 973 | * Installation return code: this is passed to the |
| 974 | * {@link IPackageInstallObserver} if the new package failed while |
| 975 | * optimizing and validating its dex files, either because there was not |
| 976 | * enough storage or the validation failed. |
| 977 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 978 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 979 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 980 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 981 | public static final int INSTALL_FAILED_DEXOPT = -11; |
| 982 | |
| 983 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 984 | * Installation return code: this is passed to the |
| 985 | * {@link IPackageInstallObserver} if the new package failed because the |
| 986 | * current SDK version is older than that required by the package. |
| 987 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 988 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 989 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 990 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 991 | public static final int INSTALL_FAILED_OLDER_SDK = -12; |
| 992 | |
| 993 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 994 | * Installation return code: this is passed to the |
| 995 | * {@link IPackageInstallObserver} if the new package failed because it |
| 996 | * contains a content provider with the same authority as a provider already |
| 997 | * installed in the system. |
| 998 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 999 | * @hide |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 1000 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1001 | @SystemApi |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 1002 | public static final int INSTALL_FAILED_CONFLICTING_PROVIDER = -13; |
| 1003 | |
| 1004 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1005 | * Installation return code: this is passed to the |
| 1006 | * {@link IPackageInstallObserver} if the new package failed because the |
| 1007 | * current SDK version is newer than that required by the package. |
| 1008 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1009 | * @hide |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 1010 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1011 | @SystemApi |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 1012 | public static final int INSTALL_FAILED_NEWER_SDK = -14; |
| 1013 | |
| 1014 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1015 | * Installation return code: this is passed to the |
| 1016 | * {@link IPackageInstallObserver} if the new package failed because it has |
| 1017 | * specified that it is a test-only package and the caller has not supplied |
| 1018 | * the {@link #INSTALL_ALLOW_TEST} flag. |
| 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 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1026 | * Installation return code: this is passed to the |
| 1027 | * {@link IPackageInstallObserver} if the package being installed contains |
| 1028 | * native code, but none that is compatible with the device's CPU_ABI. |
| 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 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1036 | * Installation return code: this is passed to the |
| 1037 | * {@link IPackageInstallObserver} if the new package uses a feature that is |
| 1038 | * not available. |
| 1039 | * |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 1040 | * @hide |
| 1041 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1042 | @SystemApi |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 1043 | public static final int INSTALL_FAILED_MISSING_FEATURE = -17; |
| 1044 | |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 1045 | // ------ Errors related to sdcard |
| 1046 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1047 | * Installation return code: this is passed to the |
| 1048 | * {@link IPackageInstallObserver} if a secure container mount point |
| 1049 | * couldn't be accessed on external media. |
| 1050 | * |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 1051 | * @hide |
| 1052 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1053 | @SystemApi |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 1054 | public static final int INSTALL_FAILED_CONTAINER_ERROR = -18; |
| 1055 | |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 1056 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1057 | * Installation return code: this is passed to the |
| 1058 | * {@link IPackageInstallObserver} if the new package couldn't be installed |
| 1059 | * in the specified install location. |
| 1060 | * |
Suchi Amalapurapu | b56ae20 | 2010-02-04 22:51:07 -0800 | [diff] [blame] | 1061 | * @hide |
| 1062 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1063 | @SystemApi |
Suchi Amalapurapu | b56ae20 | 2010-02-04 22:51:07 -0800 | [diff] [blame] | 1064 | public static final int INSTALL_FAILED_INVALID_INSTALL_LOCATION = -19; |
| 1065 | |
| 1066 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1067 | * Installation return code: this is passed to the |
| 1068 | * {@link IPackageInstallObserver} if the new package couldn't be installed |
| 1069 | * in the specified install location because the media is not available. |
| 1070 | * |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 1071 | * @hide |
| 1072 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1073 | @SystemApi |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 1074 | public static final int INSTALL_FAILED_MEDIA_UNAVAILABLE = -20; |
| 1075 | |
| 1076 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1077 | * Installation return code: this is passed to the |
| 1078 | * {@link IPackageInstallObserver} if the new package couldn't be installed |
| 1079 | * because the verification timed out. |
| 1080 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1081 | * @hide |
| 1082 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1083 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1084 | public static final int INSTALL_FAILED_VERIFICATION_TIMEOUT = -21; |
| 1085 | |
| 1086 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1087 | * Installation return code: this is passed to the |
| 1088 | * {@link IPackageInstallObserver} if the new package couldn't be installed |
| 1089 | * because the verification did not succeed. |
| 1090 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1091 | * @hide |
| 1092 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1093 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1094 | public static final int INSTALL_FAILED_VERIFICATION_FAILURE = -22; |
| 1095 | |
| 1096 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1097 | * Installation return code: this is passed to the |
| 1098 | * {@link IPackageInstallObserver} if the package changed from what the |
| 1099 | * calling program expected. |
| 1100 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1101 | * @hide |
| 1102 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1103 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1104 | public static final int INSTALL_FAILED_PACKAGE_CHANGED = -23; |
| 1105 | |
| 1106 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1107 | * Installation return code: this is passed to the |
| 1108 | * {@link IPackageInstallObserver} if the new package is assigned a |
| 1109 | * different UID than it previously held. |
| 1110 | * |
Dianne Hackborn | d0c5f51 | 2012-06-07 16:53:59 -0700 | [diff] [blame] | 1111 | * @hide |
| 1112 | */ |
| 1113 | public static final int INSTALL_FAILED_UID_CHANGED = -24; |
| 1114 | |
| 1115 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1116 | * Installation return code: this is passed to the |
| 1117 | * {@link IPackageInstallObserver} if the new package has an older version |
| 1118 | * code than the currently installed package. |
| 1119 | * |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1120 | * @hide |
| 1121 | */ |
| 1122 | public static final int INSTALL_FAILED_VERSION_DOWNGRADE = -25; |
| 1123 | |
| 1124 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1125 | * Installation return code: this is passed to the |
| 1126 | * {@link IPackageInstallObserver} if the old package has target SDK high |
| 1127 | * enough to support runtime permission and the new package has target SDK |
| 1128 | * low enough to not support runtime permissions. |
| 1129 | * |
Svetoslav | d965370 | 2015-05-13 18:02:46 -0700 | [diff] [blame] | 1130 | * @hide |
| 1131 | */ |
| 1132 | @SystemApi |
| 1133 | public static final int INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE = -26; |
| 1134 | |
| 1135 | /** |
Chad Brubaker | 34573b2 | 2017-03-07 15:27:35 -0800 | [diff] [blame] | 1136 | * Installation return code: this is passed to the |
| 1137 | * {@link IPackageInstallObserver} if the new package attempts to downgrade the |
| 1138 | * target sandbox version of the app. |
| 1139 | * |
| 1140 | * @hide |
| 1141 | */ |
| 1142 | @SystemApi |
| 1143 | public static final int INSTALL_FAILED_SANDBOX_VERSION_DOWNGRADE = -27; |
| 1144 | |
| 1145 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1146 | * Installation parse return code: this is passed to the |
| 1147 | * {@link IPackageInstallObserver} if the parser was given a path that is |
| 1148 | * not a file, or does not end with the expected '.apk' extension. |
| 1149 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1150 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1151 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1152 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1153 | public static final int INSTALL_PARSE_FAILED_NOT_APK = -100; |
| 1154 | |
| 1155 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1156 | * Installation parse return code: this is passed to the |
| 1157 | * {@link IPackageInstallObserver} if the parser was unable to retrieve the |
| 1158 | * AndroidManifest.xml file. |
| 1159 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1160 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1161 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1162 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1163 | public static final int INSTALL_PARSE_FAILED_BAD_MANIFEST = -101; |
| 1164 | |
| 1165 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1166 | * Installation parse return code: this is passed to the |
| 1167 | * {@link IPackageInstallObserver} if the parser encountered an unexpected |
| 1168 | * exception. |
| 1169 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1170 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1171 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1172 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1173 | public static final int INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION = -102; |
| 1174 | |
| 1175 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1176 | * Installation parse return code: this is passed to the |
| 1177 | * {@link IPackageInstallObserver} if the parser did not find any |
| 1178 | * certificates in the .apk. |
| 1179 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1180 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1181 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1182 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1183 | public static final int INSTALL_PARSE_FAILED_NO_CERTIFICATES = -103; |
| 1184 | |
| 1185 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1186 | * Installation parse return code: this is passed to the |
| 1187 | * {@link IPackageInstallObserver} if the parser found inconsistent |
| 1188 | * certificates on the files in the .apk. |
| 1189 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1190 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1191 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1192 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1193 | public static final int INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES = -104; |
| 1194 | |
| 1195 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1196 | * Installation parse return code: this is passed to the |
| 1197 | * {@link IPackageInstallObserver} if the parser encountered a |
| 1198 | * CertificateEncodingException in one of the files in the .apk. |
| 1199 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1200 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1201 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1202 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1203 | public static final int INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING = -105; |
| 1204 | |
| 1205 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1206 | * Installation parse return code: this is passed to the |
| 1207 | * {@link IPackageInstallObserver} if the parser encountered a bad or |
| 1208 | * missing package name in the manifest. |
| 1209 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1210 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1211 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1212 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1213 | public static final int INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME = -106; |
| 1214 | |
| 1215 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1216 | * Installation parse return code: this is passed to the |
| 1217 | * {@link IPackageInstallObserver} if the parser encountered a bad shared |
| 1218 | * user id name in the manifest. |
| 1219 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1220 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1221 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1222 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1223 | public static final int INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID = -107; |
| 1224 | |
| 1225 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1226 | * Installation parse return code: this is passed to the |
| 1227 | * {@link IPackageInstallObserver} if the parser encountered some structural |
| 1228 | * problem in the manifest. |
| 1229 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1230 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1231 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1232 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1233 | public static final int INSTALL_PARSE_FAILED_MANIFEST_MALFORMED = -108; |
| 1234 | |
| 1235 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1236 | * Installation parse return code: this is passed to the |
| 1237 | * {@link IPackageInstallObserver} if the parser did not find any actionable |
| 1238 | * tags (instrumentation or application) in the manifest. |
| 1239 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1240 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1241 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1242 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1243 | public static final int INSTALL_PARSE_FAILED_MANIFEST_EMPTY = -109; |
| 1244 | |
| 1245 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1246 | * Installation failed return code: this is passed to the |
| 1247 | * {@link IPackageInstallObserver} if the system failed to install the |
| 1248 | * package because of system issues. |
| 1249 | * |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 1250 | * @hide |
| 1251 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1252 | @SystemApi |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 1253 | public static final int INSTALL_FAILED_INTERNAL_ERROR = -110; |
| 1254 | |
| 1255 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1256 | * Installation failed return code: this is passed to the |
| 1257 | * {@link IPackageInstallObserver} if the system failed to install the |
| 1258 | * package because the user is restricted from installing apps. |
| 1259 | * |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 1260 | * @hide |
| 1261 | */ |
| 1262 | public static final int INSTALL_FAILED_USER_RESTRICTED = -111; |
| 1263 | |
| 1264 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1265 | * Installation failed return code: this is passed to the |
| 1266 | * {@link IPackageInstallObserver} if the system failed to install the |
| 1267 | * package because it is attempting to define a permission that is already |
| 1268 | * defined by some existing package. |
| 1269 | * <p> |
| 1270 | * The package name of the app which has already defined the permission is |
| 1271 | * passed to a {@link PackageInstallObserver}, if any, as the |
| 1272 | * {@link #EXTRA_FAILURE_EXISTING_PACKAGE} string extra; and the name of the |
| 1273 | * permission being redefined is passed in the |
| 1274 | * {@link #EXTRA_FAILURE_EXISTING_PERMISSION} string extra. |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 1275 | * |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 1276 | * @hide |
| 1277 | */ |
| 1278 | public static final int INSTALL_FAILED_DUPLICATE_PERMISSION = -112; |
| 1279 | |
| 1280 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1281 | * Installation failed return code: this is passed to the |
| 1282 | * {@link IPackageInstallObserver} if the system failed to install the |
| 1283 | * package because its packaged native code did not match any of the ABIs |
| 1284 | * supported by the system. |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1285 | * |
| 1286 | * @hide |
| 1287 | */ |
Narayan Kamath | d11f223 | 2014-04-10 10:37:17 +0100 | [diff] [blame] | 1288 | public static final int INSTALL_FAILED_NO_MATCHING_ABIS = -113; |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1289 | |
| 1290 | /** |
| 1291 | * Internal return code for NativeLibraryHelper methods to indicate that the package |
| 1292 | * being processed did not contain any native code. This is placed here only so that |
| 1293 | * it can belong to the same value space as the other install failure codes. |
| 1294 | * |
| 1295 | * @hide |
| 1296 | */ |
Narayan Kamath | d11f223 | 2014-04-10 10:37:17 +0100 | [diff] [blame] | 1297 | public static final int NO_NATIVE_LIBRARIES = -114; |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1298 | |
Jeff Sharkey | 7328a1b | 2014-08-07 14:01:43 -0700 | [diff] [blame] | 1299 | /** {@hide} */ |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 1300 | public static final int INSTALL_FAILED_ABORTED = -115; |
Jeff Sharkey | 7328a1b | 2014-08-07 14:01:43 -0700 | [diff] [blame] | 1301 | |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1302 | /** |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 1303 | * Installation failed return code: instant app installs are incompatible with some |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 1304 | * other installation flags supplied for the operation; or other circumstances such |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 1305 | * as trying to upgrade a system app via an instant app install. |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 1306 | * @hide |
| 1307 | */ |
Todd Kennedy | be0b889 | 2017-02-15 14:13:52 -0800 | [diff] [blame] | 1308 | public static final int INSTALL_FAILED_INSTANT_APP_INVALID = -116; |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 1309 | |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1310 | /** @hide */ |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 1311 | @IntDef(flag = true, prefix = { "DELETE_" }, value = { |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1312 | DELETE_KEEP_DATA, |
| 1313 | DELETE_ALL_USERS, |
| 1314 | DELETE_SYSTEM_APP, |
Todd Kennedy | 39bfee5 | 2016-02-24 10:28:21 -0800 | [diff] [blame] | 1315 | DELETE_DONT_KILL_APP, |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1316 | }) |
| 1317 | @Retention(RetentionPolicy.SOURCE) |
| 1318 | public @interface DeleteFlags {} |
| 1319 | |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 1320 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1321 | * Flag parameter for {@link #deletePackage} to indicate that you don't want to delete the |
| 1322 | * package's data directory. |
| 1323 | * |
| 1324 | * @hide |
| 1325 | */ |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1326 | public static final int DELETE_KEEP_DATA = 0x00000001; |
| 1327 | |
| 1328 | /** |
| 1329 | * Flag parameter for {@link #deletePackage} to indicate that you want the |
| 1330 | * package deleted for all users. |
| 1331 | * |
| 1332 | * @hide |
| 1333 | */ |
| 1334 | public static final int DELETE_ALL_USERS = 0x00000002; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1335 | |
| 1336 | /** |
Dianne Hackborn | c895be7 | 2013-03-11 17:48:43 -0700 | [diff] [blame] | 1337 | * Flag parameter for {@link #deletePackage} to indicate that, if you are calling |
| 1338 | * uninstall on a system that has been updated, then don't do the normal process |
| 1339 | * of uninstalling the update and rolling back to the older system version (which |
| 1340 | * needs to happen for all users); instead, just mark the app as uninstalled for |
| 1341 | * the current user. |
| 1342 | * |
| 1343 | * @hide |
| 1344 | */ |
| 1345 | public static final int DELETE_SYSTEM_APP = 0x00000004; |
| 1346 | |
| 1347 | /** |
Todd Kennedy | 39bfee5 | 2016-02-24 10:28:21 -0800 | [diff] [blame] | 1348 | * Flag parameter for {@link #deletePackage} to indicate that, if you are calling |
| 1349 | * uninstall on a package that is replaced to provide new feature splits, the |
| 1350 | * existing application should not be killed during the removal process. |
| 1351 | * |
| 1352 | * @hide |
| 1353 | */ |
| 1354 | public static final int DELETE_DONT_KILL_APP = 0x00000008; |
| 1355 | |
| 1356 | /** |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1357 | * Return code for when package deletion succeeds. This is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1358 | * {@link IPackageDeleteObserver} if the system succeeded in deleting the |
| 1359 | * package. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1360 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1361 | * @hide |
| 1362 | */ |
| 1363 | public static final int DELETE_SUCCEEDED = 1; |
| 1364 | |
| 1365 | /** |
| 1366 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1367 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1368 | * for an unspecified reason. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1369 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1370 | * @hide |
| 1371 | */ |
| 1372 | public static final int DELETE_FAILED_INTERNAL_ERROR = -1; |
| 1373 | |
| 1374 | /** |
| 1375 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1376 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1377 | * because it is the active DevicePolicy manager. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1378 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1379 | * @hide |
| 1380 | */ |
| 1381 | public static final int DELETE_FAILED_DEVICE_POLICY_MANAGER = -2; |
| 1382 | |
| 1383 | /** |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 1384 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1385 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1386 | * since the user is restricted. |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 1387 | * |
| 1388 | * @hide |
| 1389 | */ |
| 1390 | public static final int DELETE_FAILED_USER_RESTRICTED = -3; |
| 1391 | |
| 1392 | /** |
Kenny Guy | 1b88da5 | 2014-07-10 16:33:49 +0100 | [diff] [blame] | 1393 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1394 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1395 | * because a profile or device owner has marked the package as |
| 1396 | * uninstallable. |
Kenny Guy | c13053b | 2014-05-29 14:17:17 +0100 | [diff] [blame] | 1397 | * |
| 1398 | * @hide |
| 1399 | */ |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 1400 | public static final int DELETE_FAILED_OWNER_BLOCKED = -4; |
| 1401 | |
| 1402 | /** {@hide} */ |
| 1403 | public static final int DELETE_FAILED_ABORTED = -5; |
Kenny Guy | c13053b | 2014-05-29 14:17:17 +0100 | [diff] [blame] | 1404 | |
| 1405 | /** |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 1406 | * Deletion failed return code: this is passed to the |
| 1407 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1408 | * because the packge is a shared library used by other installed packages. |
| 1409 | * {@hide} */ |
| 1410 | public static final int DELETE_FAILED_USED_SHARED_LIBRARY = -6; |
| 1411 | |
| 1412 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1413 | * Return code that is passed to the {@link IPackageMoveObserver} when the |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1414 | * package has been successfully moved by the system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1415 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1416 | * @hide |
| 1417 | */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1418 | public static final int MOVE_SUCCEEDED = -100; |
| 1419 | |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1420 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1421 | * Error code that is passed to the {@link IPackageMoveObserver} when the |
| 1422 | * package hasn't been successfully moved by the system because of |
| 1423 | * insufficient memory on specified media. |
| 1424 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1425 | * @hide |
| 1426 | */ |
| 1427 | public static final int MOVE_FAILED_INSUFFICIENT_STORAGE = -1; |
| 1428 | |
| 1429 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1430 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1431 | * specified package doesn't exist. |
| 1432 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1433 | * @hide |
| 1434 | */ |
| 1435 | public static final int MOVE_FAILED_DOESNT_EXIST = -2; |
| 1436 | |
| 1437 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1438 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1439 | * specified package cannot be moved since its a system package. |
| 1440 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1441 | * @hide |
| 1442 | */ |
| 1443 | public static final int MOVE_FAILED_SYSTEM_PACKAGE = -3; |
| 1444 | |
| 1445 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1446 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1447 | * specified package cannot be moved since its forward locked. |
| 1448 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1449 | * @hide |
| 1450 | */ |
| 1451 | public static final int MOVE_FAILED_FORWARD_LOCKED = -4; |
| 1452 | |
| 1453 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1454 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1455 | * specified package cannot be moved to the specified location. |
| 1456 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1457 | * @hide |
| 1458 | */ |
| 1459 | public static final int MOVE_FAILED_INVALID_LOCATION = -5; |
| 1460 | |
| 1461 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1462 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1463 | * specified package cannot be moved to the specified location. |
| 1464 | * |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 1465 | * @hide |
| 1466 | */ |
| 1467 | public static final int MOVE_FAILED_INTERNAL_ERROR = -6; |
| 1468 | |
| 1469 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1470 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1471 | * specified package already has an operation pending in the queue. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1472 | * |
Kenny Root | deb1126 | 2010-08-02 11:36:21 -0700 | [diff] [blame] | 1473 | * @hide |
| 1474 | */ |
| 1475 | public static final int MOVE_FAILED_OPERATION_PENDING = -7; |
| 1476 | |
| 1477 | /** |
Makoto Onuki | f34db0a | 2016-02-17 11:17:15 -0800 | [diff] [blame] | 1478 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1479 | * specified package cannot be moved since it contains a device admin. |
| 1480 | * |
| 1481 | * @hide |
| 1482 | */ |
| 1483 | public static final int MOVE_FAILED_DEVICE_ADMIN = -8; |
| 1484 | |
| 1485 | /** |
Yao Chen | 022b8ea | 2016-12-16 11:03:28 -0800 | [diff] [blame] | 1486 | * Error code that is passed to the {@link IPackageMoveObserver} if system does not allow |
| 1487 | * non-system apps to be moved to internal storage. |
| 1488 | * |
| 1489 | * @hide |
| 1490 | */ |
| 1491 | public static final int MOVE_FAILED_3RD_PARTY_NOT_ALLOWED_ON_INTERNAL = -9; |
| 1492 | |
| 1493 | /** |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1494 | * Flag parameter for {@link #movePackage} to indicate that |
| 1495 | * the package should be moved to internal storage if its |
| 1496 | * been installed on external media. |
| 1497 | * @hide |
| 1498 | */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1499 | @Deprecated |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1500 | public static final int MOVE_INTERNAL = 0x00000001; |
| 1501 | |
| 1502 | /** |
| 1503 | * Flag parameter for {@link #movePackage} to indicate that |
| 1504 | * the package should be moved to external media. |
| 1505 | * @hide |
| 1506 | */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1507 | @Deprecated |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1508 | public static final int MOVE_EXTERNAL_MEDIA = 0x00000002; |
| 1509 | |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1510 | /** {@hide} */ |
| 1511 | public static final String EXTRA_MOVE_ID = "android.content.pm.extra.MOVE_ID"; |
| 1512 | |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1513 | /** |
Kenny Root | 05ca4c9 | 2011-09-15 10:36:25 -0700 | [diff] [blame] | 1514 | * Usable by the required verifier as the {@code verificationCode} argument |
| 1515 | * for {@link PackageManager#verifyPendingInstall} to indicate that it will |
| 1516 | * allow the installation to proceed without any of the optional verifiers |
| 1517 | * needing to vote. |
| 1518 | * |
| 1519 | * @hide |
| 1520 | */ |
| 1521 | public static final int VERIFICATION_ALLOW_WITHOUT_SUFFICIENT = 2; |
| 1522 | |
| 1523 | /** |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 1524 | * Used as the {@code verificationCode} argument for |
| 1525 | * {@link PackageManager#verifyPendingInstall} to indicate that the calling |
| 1526 | * package verifier allows the installation to proceed. |
| 1527 | */ |
| 1528 | public static final int VERIFICATION_ALLOW = 1; |
| 1529 | |
| 1530 | /** |
| 1531 | * Used as the {@code verificationCode} argument for |
| 1532 | * {@link PackageManager#verifyPendingInstall} to indicate the calling |
| 1533 | * package verifier does not vote to allow the installation to proceed. |
| 1534 | */ |
| 1535 | public static final int VERIFICATION_REJECT = -1; |
| 1536 | |
| 1537 | /** |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1538 | * Used as the {@code verificationCode} argument for |
| 1539 | * {@link PackageManager#verifyIntentFilter} to indicate that the calling |
| 1540 | * IntentFilter Verifier confirms that the IntentFilter is verified. |
| 1541 | * |
| 1542 | * @hide |
| 1543 | */ |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 1544 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1545 | public static final int INTENT_FILTER_VERIFICATION_SUCCESS = 1; |
| 1546 | |
| 1547 | /** |
| 1548 | * Used as the {@code verificationCode} argument for |
| 1549 | * {@link PackageManager#verifyIntentFilter} to indicate that the calling |
| 1550 | * IntentFilter Verifier confirms that the IntentFilter is NOT verified. |
| 1551 | * |
| 1552 | * @hide |
| 1553 | */ |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 1554 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1555 | public static final int INTENT_FILTER_VERIFICATION_FAILURE = -1; |
| 1556 | |
| 1557 | /** |
| 1558 | * Internal status code to indicate that an IntentFilter verification result is not specified. |
| 1559 | * |
| 1560 | * @hide |
| 1561 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 1562 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1563 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED = 0; |
| 1564 | |
| 1565 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1566 | * Used as the {@code status} argument for |
| 1567 | * {@link #updateIntentVerificationStatusAsUser} to indicate that the User |
| 1568 | * will always be prompted the Intent Disambiguation Dialog if there are two |
| 1569 | * or more Intent resolved for the IntentFilter's domain(s). |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1570 | * |
| 1571 | * @hide |
| 1572 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 1573 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1574 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK = 1; |
| 1575 | |
| 1576 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1577 | * Used as the {@code status} argument for |
| 1578 | * {@link #updateIntentVerificationStatusAsUser} to indicate that the User |
| 1579 | * will never be prompted the Intent Disambiguation Dialog if there are two |
| 1580 | * or more resolution of the Intent. The default App for the domain(s) |
| 1581 | * specified in the IntentFilter will also ALWAYS be used. |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1582 | * |
| 1583 | * @hide |
| 1584 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 1585 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1586 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS = 2; |
| 1587 | |
| 1588 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1589 | * Used as the {@code status} argument for |
| 1590 | * {@link #updateIntentVerificationStatusAsUser} to indicate that the User |
| 1591 | * may be prompted the Intent Disambiguation Dialog if there are two or more |
| 1592 | * 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] | 1593 | * IntentFilter will also NEVER be presented to the User. |
| 1594 | * |
| 1595 | * @hide |
| 1596 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 1597 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1598 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER = 3; |
| 1599 | |
| 1600 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1601 | * Used as the {@code status} argument for |
| 1602 | * {@link #updateIntentVerificationStatusAsUser} to indicate that this app |
| 1603 | * should always be considered as an ambiguous candidate for handling the |
| 1604 | * matching Intent even if there are other candidate apps in the "always" |
| 1605 | * state. Put another way: if there are any 'always ask' apps in a set of |
| 1606 | * more than one candidate app, then a disambiguation is *always* presented |
| 1607 | * even if there is another candidate app with the 'always' state. |
Christopher Tate | 56f0ff3 | 2015-08-13 16:29:33 -0700 | [diff] [blame] | 1608 | * |
| 1609 | * @hide |
| 1610 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 1611 | @SystemApi |
Christopher Tate | 56f0ff3 | 2015-08-13 16:29:33 -0700 | [diff] [blame] | 1612 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS_ASK = 4; |
| 1613 | |
| 1614 | /** |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 1615 | * Can be used as the {@code millisecondsToDelay} argument for |
| 1616 | * {@link PackageManager#extendVerificationTimeout}. This is the |
| 1617 | * maximum time {@code PackageManager} waits for the verification |
| 1618 | * agent to return (in milliseconds). |
| 1619 | */ |
| 1620 | public static final long MAXIMUM_VERIFICATION_TIMEOUT = 60*60*1000; |
| 1621 | |
| 1622 | /** |
Amith Yamasani | 0b28549 | 2011-04-14 17:35:23 -0700 | [diff] [blame] | 1623 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: The device's |
| 1624 | * audio pipeline is low-latency, more suitable for audio applications sensitive to delays or |
| 1625 | * lag in sound input or output. |
Dan Morrill | 898e1e8 | 2010-09-26 17:28:30 -0700 | [diff] [blame] | 1626 | */ |
| 1627 | @SdkConstant(SdkConstantType.FEATURE) |
| 1628 | public static final String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency"; |
| 1629 | |
| 1630 | /** |
| 1631 | * Feature for {@link #getSystemAvailableFeatures} and |
Unsuk Jung | 50909f6 | 2014-09-02 18:25:49 -0700 | [diff] [blame] | 1632 | * {@link #hasSystemFeature}: The device includes at least one form of audio |
| 1633 | * output, such as speakers, audio jack or streaming over bluetooth |
| 1634 | */ |
| 1635 | @SdkConstant(SdkConstantType.FEATURE) |
| 1636 | public static final String FEATURE_AUDIO_OUTPUT = "android.hardware.audio.output"; |
| 1637 | |
| 1638 | /** |
Glenn Kasten | cdcb577 | 2015-05-06 15:54:49 -0700 | [diff] [blame] | 1639 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Glenn Kasten | 7587edc | 2015-10-30 17:45:52 -0700 | [diff] [blame] | 1640 | * The device has professional audio level of functionality and performance. |
Glenn Kasten | cdcb577 | 2015-05-06 15:54:49 -0700 | [diff] [blame] | 1641 | */ |
| 1642 | @SdkConstant(SdkConstantType.FEATURE) |
| 1643 | public static final String FEATURE_AUDIO_PRO = "android.hardware.audio.pro"; |
| 1644 | |
| 1645 | /** |
Unsuk Jung | 50909f6 | 2014-09-02 18:25:49 -0700 | [diff] [blame] | 1646 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1647 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 1648 | * other devices via Bluetooth. |
| 1649 | */ |
| 1650 | @SdkConstant(SdkConstantType.FEATURE) |
| 1651 | public static final String FEATURE_BLUETOOTH = "android.hardware.bluetooth"; |
| 1652 | |
| 1653 | /** |
| 1654 | * Feature for {@link #getSystemAvailableFeatures} and |
Matthew Xie | a722772 | 2013-04-18 15:25:59 -0700 | [diff] [blame] | 1655 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 1656 | * other devices via Bluetooth Low Energy radio. |
| 1657 | */ |
| 1658 | @SdkConstant(SdkConstantType.FEATURE) |
| 1659 | public static final String FEATURE_BLUETOOTH_LE = "android.hardware.bluetooth_le"; |
| 1660 | |
| 1661 | /** |
| 1662 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1663 | * {@link #hasSystemFeature}: The device has a camera facing away |
| 1664 | * from the screen. |
| 1665 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1666 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1667 | public static final String FEATURE_CAMERA = "android.hardware.camera"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1668 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1669 | /** |
| 1670 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1671 | * {@link #hasSystemFeature}: The device's camera supports auto-focus. |
| 1672 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1673 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1674 | public static final String FEATURE_CAMERA_AUTOFOCUS = "android.hardware.camera.autofocus"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1675 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1676 | /** |
| 1677 | * Feature for {@link #getSystemAvailableFeatures} and |
Eino-Ville Talvala | 752af83 | 2012-09-18 14:45:37 -0700 | [diff] [blame] | 1678 | * {@link #hasSystemFeature}: The device has at least one camera pointing in |
Eino-Ville Talvala | 9131da2 | 2014-05-08 11:39:53 -0700 | [diff] [blame] | 1679 | * 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] | 1680 | */ |
| 1681 | @SdkConstant(SdkConstantType.FEATURE) |
| 1682 | public static final String FEATURE_CAMERA_ANY = "android.hardware.camera.any"; |
| 1683 | |
| 1684 | /** |
| 1685 | * Feature for {@link #getSystemAvailableFeatures} and |
Eino-Ville Talvala | 9131da2 | 2014-05-08 11:39:53 -0700 | [diff] [blame] | 1686 | * {@link #hasSystemFeature}: The device can support having an external camera connected to it. |
| 1687 | * The external camera may not always be connected or available to applications to use. |
| 1688 | */ |
| 1689 | @SdkConstant(SdkConstantType.FEATURE) |
| 1690 | public static final String FEATURE_CAMERA_EXTERNAL = "android.hardware.camera.external"; |
| 1691 | |
| 1692 | /** |
| 1693 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1694 | * {@link #hasSystemFeature}: The device's camera supports flash. |
| 1695 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1696 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1697 | public static final String FEATURE_CAMERA_FLASH = "android.hardware.camera.flash"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1698 | |
| 1699 | /** |
| 1700 | * Feature for {@link #getSystemAvailableFeatures} and |
Chih-Chung Chang | de1057c | 2010-06-14 19:15:00 +0800 | [diff] [blame] | 1701 | * {@link #hasSystemFeature}: The device has a front facing camera. |
| 1702 | */ |
| 1703 | @SdkConstant(SdkConstantType.FEATURE) |
| 1704 | public static final String FEATURE_CAMERA_FRONT = "android.hardware.camera.front"; |
| 1705 | |
| 1706 | /** |
Eino-Ville Talvala | 611fece | 2014-07-10 17:29:38 -0700 | [diff] [blame] | 1707 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1708 | * of the cameras on the device supports the |
| 1709 | * {@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL full hardware} |
| 1710 | * capability level. |
| 1711 | */ |
| 1712 | @SdkConstant(SdkConstantType.FEATURE) |
| 1713 | public static final String FEATURE_CAMERA_LEVEL_FULL = "android.hardware.camera.level.full"; |
| 1714 | |
| 1715 | /** |
| 1716 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1717 | * of the cameras on the device supports the |
| 1718 | * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR manual sensor} |
| 1719 | * capability level. |
| 1720 | */ |
| 1721 | @SdkConstant(SdkConstantType.FEATURE) |
| 1722 | public static final String FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR = |
| 1723 | "android.hardware.camera.capability.manual_sensor"; |
| 1724 | |
| 1725 | /** |
| 1726 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1727 | * of the cameras on the device supports the |
| 1728 | * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING manual post-processing} |
| 1729 | * capability level. |
| 1730 | */ |
| 1731 | @SdkConstant(SdkConstantType.FEATURE) |
| 1732 | public static final String FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING = |
| 1733 | "android.hardware.camera.capability.manual_post_processing"; |
| 1734 | |
| 1735 | /** |
| 1736 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1737 | * of the cameras on the device supports the |
| 1738 | * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_RAW RAW} |
| 1739 | * capability level. |
| 1740 | */ |
| 1741 | @SdkConstant(SdkConstantType.FEATURE) |
| 1742 | public static final String FEATURE_CAMERA_CAPABILITY_RAW = |
| 1743 | "android.hardware.camera.capability.raw"; |
| 1744 | |
| 1745 | /** |
Chih-Chung Chang | de1057c | 2010-06-14 19:15:00 +0800 | [diff] [blame] | 1746 | * Feature for {@link #getSystemAvailableFeatures} and |
Alex Ray | 0c9d61f | 2013-10-03 12:17:54 -0700 | [diff] [blame] | 1747 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 1748 | * consumer IR devices. |
| 1749 | */ |
| 1750 | @SdkConstant(SdkConstantType.FEATURE) |
| 1751 | public static final String FEATURE_CONSUMER_IR = "android.hardware.consumerir"; |
| 1752 | |
Sam Lin | 90e258b | 2017-04-03 20:57:45 -0700 | [diff] [blame] | 1753 | /** {@hide} */ |
| 1754 | @SdkConstant(SdkConstantType.FEATURE) |
| 1755 | public static final String FEATURE_CTS = "android.software.cts"; |
| 1756 | |
Alex Ray | 0c9d61f | 2013-10-03 12:17:54 -0700 | [diff] [blame] | 1757 | /** |
| 1758 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1759 | * {@link #hasSystemFeature}: The device supports one or more methods of |
| 1760 | * reporting current location. |
| 1761 | */ |
| 1762 | @SdkConstant(SdkConstantType.FEATURE) |
| 1763 | public static final String FEATURE_LOCATION = "android.hardware.location"; |
| 1764 | |
| 1765 | /** |
| 1766 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1767 | * {@link #hasSystemFeature}: The device has a Global Positioning System |
| 1768 | * receiver and can report precise location. |
| 1769 | */ |
| 1770 | @SdkConstant(SdkConstantType.FEATURE) |
| 1771 | public static final String FEATURE_LOCATION_GPS = "android.hardware.location.gps"; |
| 1772 | |
| 1773 | /** |
| 1774 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1775 | * {@link #hasSystemFeature}: The device can report location with coarse |
| 1776 | * accuracy using a network-based geolocation system. |
| 1777 | */ |
| 1778 | @SdkConstant(SdkConstantType.FEATURE) |
| 1779 | public static final String FEATURE_LOCATION_NETWORK = "android.hardware.location.network"; |
| 1780 | |
| 1781 | /** |
| 1782 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1783 | * {@link #hasSystemFeature}: The device can record audio via a |
| 1784 | * microphone. |
| 1785 | */ |
| 1786 | @SdkConstant(SdkConstantType.FEATURE) |
| 1787 | public static final String FEATURE_MICROPHONE = "android.hardware.microphone"; |
| 1788 | |
| 1789 | /** |
| 1790 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 76437d3 | 2010-09-01 11:17:20 -0700 | [diff] [blame] | 1791 | * {@link #hasSystemFeature}: The device can communicate using Near-Field |
| 1792 | * Communications (NFC). |
| 1793 | */ |
| 1794 | @SdkConstant(SdkConstantType.FEATURE) |
| 1795 | public static final String FEATURE_NFC = "android.hardware.nfc"; |
| 1796 | |
| 1797 | /** |
| 1798 | * Feature for {@link #getSystemAvailableFeatures} and |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1799 | * {@link #hasSystemFeature}: The device supports host- |
| 1800 | * based NFC card emulation. |
Martijn Coenen | df4d1d6 | 2013-08-28 11:18:58 -0700 | [diff] [blame] | 1801 | * |
| 1802 | * TODO remove when depending apps have moved to new constant. |
| 1803 | * @hide |
| 1804 | * @deprecated |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1805 | */ |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 1806 | @Deprecated |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1807 | @SdkConstant(SdkConstantType.FEATURE) |
| 1808 | public static final String FEATURE_NFC_HCE = "android.hardware.nfc.hce"; |
| 1809 | |
| 1810 | /** |
| 1811 | * Feature for {@link #getSystemAvailableFeatures} and |
Martijn Coenen | df4d1d6 | 2013-08-28 11:18:58 -0700 | [diff] [blame] | 1812 | * {@link #hasSystemFeature}: The device supports host- |
| 1813 | * based NFC card emulation. |
| 1814 | */ |
| 1815 | @SdkConstant(SdkConstantType.FEATURE) |
| 1816 | public static final String FEATURE_NFC_HOST_CARD_EMULATION = "android.hardware.nfc.hce"; |
| 1817 | |
| 1818 | /** |
| 1819 | * Feature for {@link #getSystemAvailableFeatures} and |
Yoshinobu Ito | c52adfe | 2016-01-22 18:14:18 +0900 | [diff] [blame] | 1820 | * {@link #hasSystemFeature}: The device supports host- |
| 1821 | * based NFC-F card emulation. |
| 1822 | */ |
| 1823 | @SdkConstant(SdkConstantType.FEATURE) |
| 1824 | public static final String FEATURE_NFC_HOST_CARD_EMULATION_NFCF = "android.hardware.nfc.hcef"; |
| 1825 | |
| 1826 | /** |
| 1827 | * Feature for {@link #getSystemAvailableFeatures} and |
Martijn Coenen | 441d61b | 2017-04-12 13:52:40 -0700 | [diff] [blame] | 1828 | * {@link #hasSystemFeature}: The device supports any |
| 1829 | * one of the {@link #FEATURE_NFC}, {@link #FEATURE_NFC_HOST_CARD_EMULATION}, |
| 1830 | * or {@link #FEATURE_NFC_HOST_CARD_EMULATION_NFCF} features. |
| 1831 | * |
| 1832 | * @hide |
| 1833 | */ |
| 1834 | @SdkConstant(SdkConstantType.FEATURE) |
| 1835 | public static final String FEATURE_NFC_ANY = "android.hardware.nfc.any"; |
| 1836 | |
| 1837 | /** |
| 1838 | * Feature for {@link #getSystemAvailableFeatures} and |
Jesse Hall | 7f51706 | 2014-07-18 11:54:41 -0700 | [diff] [blame] | 1839 | * {@link #hasSystemFeature}: The device supports the OpenGL ES |
| 1840 | * <a href="http://www.khronos.org/registry/gles/extensions/ANDROID/ANDROID_extension_pack_es31a.txt"> |
| 1841 | * Android Extension Pack</a>. |
| 1842 | */ |
| 1843 | @SdkConstant(SdkConstantType.FEATURE) |
| 1844 | public static final String FEATURE_OPENGLES_EXTENSION_PACK = "android.hardware.opengles.aep"; |
| 1845 | |
| 1846 | /** |
| 1847 | * Feature for {@link #getSystemAvailableFeatures} and |
Jesse Hall | 39ceeb5 | 2016-03-10 09:04:26 -0800 | [diff] [blame] | 1848 | * {@link #hasSystemFeature(String, int)}: If this feature is supported, the Vulkan native API |
| 1849 | * will enumerate at least one {@code VkPhysicalDevice}, and the feature version will indicate |
| 1850 | * what level of optional hardware features limits it supports. |
Jesse Hall | f77a34f | 2016-02-04 18:41:33 -0800 | [diff] [blame] | 1851 | * <p> |
| 1852 | * Level 0 includes the base Vulkan requirements as well as: |
| 1853 | * <ul><li>{@code VkPhysicalDeviceFeatures::textureCompressionETC2}</li></ul> |
| 1854 | * <p> |
| 1855 | * Level 1 additionally includes: |
| 1856 | * <ul> |
| 1857 | * <li>{@code VkPhysicalDeviceFeatures::fullDrawIndexUint32}</li> |
| 1858 | * <li>{@code VkPhysicalDeviceFeatures::imageCubeArray}</li> |
| 1859 | * <li>{@code VkPhysicalDeviceFeatures::independentBlend}</li> |
| 1860 | * <li>{@code VkPhysicalDeviceFeatures::geometryShader}</li> |
| 1861 | * <li>{@code VkPhysicalDeviceFeatures::tessellationShader}</li> |
| 1862 | * <li>{@code VkPhysicalDeviceFeatures::sampleRateShading}</li> |
| 1863 | * <li>{@code VkPhysicalDeviceFeatures::textureCompressionASTC_LDR}</li> |
| 1864 | * <li>{@code VkPhysicalDeviceFeatures::fragmentStoresAndAtomics}</li> |
| 1865 | * <li>{@code VkPhysicalDeviceFeatures::shaderImageGatherExtended}</li> |
| 1866 | * <li>{@code VkPhysicalDeviceFeatures::shaderUniformBufferArrayDynamicIndexing}</li> |
| 1867 | * <li>{@code VkPhysicalDeviceFeatures::shaderSampledImageArrayDynamicIndexing}</li> |
| 1868 | * </ul> |
| 1869 | */ |
| 1870 | @SdkConstant(SdkConstantType.FEATURE) |
| 1871 | public static final String FEATURE_VULKAN_HARDWARE_LEVEL = "android.hardware.vulkan.level"; |
| 1872 | |
| 1873 | /** |
| 1874 | * Feature for {@link #getSystemAvailableFeatures} and |
Jesse Hall | 1cd7e93 | 2017-02-05 19:58:15 -0800 | [diff] [blame] | 1875 | * {@link #hasSystemFeature(String, int)}: If this feature is supported, the Vulkan native API |
| 1876 | * will enumerate at least one {@code VkPhysicalDevice}, and the feature version will indicate |
| 1877 | * what level of optional compute features are supported beyond the Vulkan 1.0 requirements. |
| 1878 | * <p> |
Jesse Hall | 7a1b8af | 2017-04-14 11:22:24 -0700 | [diff] [blame] | 1879 | * Compute level 0 indicates support for the {@code VariablePointers} SPIR-V capability defined |
| 1880 | * by the SPV_KHR_variable_pointers extension. |
Jesse Hall | 1cd7e93 | 2017-02-05 19:58:15 -0800 | [diff] [blame] | 1881 | */ |
| 1882 | @SdkConstant(SdkConstantType.FEATURE) |
| 1883 | public static final String FEATURE_VULKAN_HARDWARE_COMPUTE = "android.hardware.vulkan.compute"; |
| 1884 | |
| 1885 | /** |
| 1886 | * Feature for {@link #getSystemAvailableFeatures} and |
Jesse Hall | 39ceeb5 | 2016-03-10 09:04:26 -0800 | [diff] [blame] | 1887 | * {@link #hasSystemFeature(String, int)}: The version of this feature indicates the highest |
Jesse Hall | f77a34f | 2016-02-04 18:41:33 -0800 | [diff] [blame] | 1888 | * {@code VkPhysicalDeviceProperties::apiVersion} supported by the physical devices that support |
| 1889 | * the hardware level indicated by {@link #FEATURE_VULKAN_HARDWARE_LEVEL}. The feature version |
| 1890 | * uses the same encoding as Vulkan version numbers: |
| 1891 | * <ul> |
| 1892 | * <li>Major version number in bits 31-22</li> |
| 1893 | * <li>Minor version number in bits 21-12</li> |
| 1894 | * <li>Patch version number in bits 11-0</li> |
| 1895 | * </ul> |
| 1896 | */ |
| 1897 | @SdkConstant(SdkConstantType.FEATURE) |
| 1898 | public static final String FEATURE_VULKAN_HARDWARE_VERSION = "android.hardware.vulkan.version"; |
| 1899 | |
| 1900 | /** |
Tomasz Wasilczyk | 347192e | 2017-04-04 11:13:44 -0700 | [diff] [blame] | 1901 | * The device includes broadcast radio tuner. |
| 1902 | * |
| 1903 | * @hide FutureFeature |
| 1904 | */ |
| 1905 | @SdkConstant(SdkConstantType.FEATURE) |
| 1906 | public static final String FEATURE_RADIO = "android.hardware.radio"; |
| 1907 | |
| 1908 | /** |
Jesse Hall | f77a34f | 2016-02-04 18:41:33 -0800 | [diff] [blame] | 1909 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1910 | * {@link #hasSystemFeature}: The device includes an accelerometer. |
| 1911 | */ |
| 1912 | @SdkConstant(SdkConstantType.FEATURE) |
| 1913 | public static final String FEATURE_SENSOR_ACCELEROMETER = "android.hardware.sensor.accelerometer"; |
| 1914 | |
| 1915 | /** |
| 1916 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1917 | * {@link #hasSystemFeature}: The device includes a barometer (air |
| 1918 | * pressure sensor.) |
| 1919 | */ |
| 1920 | @SdkConstant(SdkConstantType.FEATURE) |
| 1921 | public static final String FEATURE_SENSOR_BAROMETER = "android.hardware.sensor.barometer"; |
| 1922 | |
| 1923 | /** |
| 1924 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1925 | * {@link #hasSystemFeature}: The device includes a magnetometer (compass). |
| 1926 | */ |
| 1927 | @SdkConstant(SdkConstantType.FEATURE) |
| 1928 | public static final String FEATURE_SENSOR_COMPASS = "android.hardware.sensor.compass"; |
| 1929 | |
| 1930 | /** |
| 1931 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1932 | * {@link #hasSystemFeature}: The device includes a gyroscope. |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1933 | */ |
| 1934 | @SdkConstant(SdkConstantType.FEATURE) |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1935 | public static final String FEATURE_SENSOR_GYROSCOPE = "android.hardware.sensor.gyroscope"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1936 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1937 | /** |
| 1938 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1939 | * {@link #hasSystemFeature}: The device includes a light sensor. |
| 1940 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1941 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1942 | public static final String FEATURE_SENSOR_LIGHT = "android.hardware.sensor.light"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1943 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1944 | /** |
| 1945 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1946 | * {@link #hasSystemFeature}: The device includes a proximity sensor. |
| 1947 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1948 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1949 | public static final String FEATURE_SENSOR_PROXIMITY = "android.hardware.sensor.proximity"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1950 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1951 | /** |
| 1952 | * Feature for {@link #getSystemAvailableFeatures} and |
Aravind Akella | 068b0c0 | 2013-10-12 17:39:15 -0700 | [diff] [blame] | 1953 | * {@link #hasSystemFeature}: The device includes a hardware step counter. |
| 1954 | */ |
| 1955 | @SdkConstant(SdkConstantType.FEATURE) |
| 1956 | public static final String FEATURE_SENSOR_STEP_COUNTER = "android.hardware.sensor.stepcounter"; |
| 1957 | |
| 1958 | /** |
| 1959 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1960 | * {@link #hasSystemFeature}: The device includes a hardware step detector. |
| 1961 | */ |
| 1962 | @SdkConstant(SdkConstantType.FEATURE) |
| 1963 | public static final String FEATURE_SENSOR_STEP_DETECTOR = "android.hardware.sensor.stepdetector"; |
| 1964 | |
| 1965 | /** |
| 1966 | * Feature for {@link #getSystemAvailableFeatures} and |
Vinod Krishnan | 8afb23c | 2014-04-30 11:11:39 -0700 | [diff] [blame] | 1967 | * {@link #hasSystemFeature}: The device includes a heart rate monitor. |
| 1968 | */ |
| 1969 | @SdkConstant(SdkConstantType.FEATURE) |
| 1970 | public static final String FEATURE_SENSOR_HEART_RATE = "android.hardware.sensor.heartrate"; |
| 1971 | |
| 1972 | /** |
| 1973 | * Feature for {@link #getSystemAvailableFeatures} and |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 1974 | * {@link #hasSystemFeature}: The heart rate sensor on this device is an Electrocardiogram. |
Vinod Krishnan | 1ab7689 | 2014-08-20 11:11:55 -0700 | [diff] [blame] | 1975 | */ |
| 1976 | @SdkConstant(SdkConstantType.FEATURE) |
| 1977 | public static final String FEATURE_SENSOR_HEART_RATE_ECG = |
| 1978 | "android.hardware.sensor.heartrate.ecg"; |
| 1979 | |
| 1980 | /** |
| 1981 | * Feature for {@link #getSystemAvailableFeatures} and |
Aravind Akella | 8b8e74b | 2014-07-09 11:52:39 -0700 | [diff] [blame] | 1982 | * {@link #hasSystemFeature}: The device includes a relative humidity sensor. |
| 1983 | */ |
| 1984 | @SdkConstant(SdkConstantType.FEATURE) |
| 1985 | public static final String FEATURE_SENSOR_RELATIVE_HUMIDITY = |
| 1986 | "android.hardware.sensor.relative_humidity"; |
| 1987 | |
| 1988 | /** |
| 1989 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1990 | * {@link #hasSystemFeature}: The device includes an ambient temperature sensor. |
| 1991 | */ |
| 1992 | @SdkConstant(SdkConstantType.FEATURE) |
| 1993 | public static final String FEATURE_SENSOR_AMBIENT_TEMPERATURE = |
| 1994 | "android.hardware.sensor.ambient_temperature"; |
| 1995 | |
| 1996 | /** |
| 1997 | * Feature for {@link #getSystemAvailableFeatures} and |
Ashutosh Joshi | eae371b | 2015-04-09 10:30:07 -0700 | [diff] [blame] | 1998 | * {@link #hasSystemFeature}: The device supports high fidelity sensor processing |
| 1999 | * capabilities. |
| 2000 | */ |
| 2001 | @SdkConstant(SdkConstantType.FEATURE) |
| 2002 | public static final String FEATURE_HIFI_SENSORS = |
| 2003 | "android.hardware.sensor.hifi_sensors"; |
| 2004 | |
| 2005 | /** |
| 2006 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2007 | * {@link #hasSystemFeature}: The device has a telephony radio with data |
| 2008 | * communication support. |
| 2009 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 2010 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2011 | public static final String FEATURE_TELEPHONY = "android.hardware.telephony"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2012 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2013 | /** |
| 2014 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2015 | * {@link #hasSystemFeature}: The device has a CDMA telephony stack. |
| 2016 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 2017 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2018 | public static final String FEATURE_TELEPHONY_CDMA = "android.hardware.telephony.cdma"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2019 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2020 | /** |
| 2021 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2022 | * {@link #hasSystemFeature}: The device has a GSM telephony stack. |
| 2023 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 2024 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2025 | public static final String FEATURE_TELEPHONY_GSM = "android.hardware.telephony.gsm"; |
Hung-ying Tyan | 3424c02 | 2010-08-27 18:08:19 +0800 | [diff] [blame] | 2026 | |
| 2027 | /** |
Polina Bondarenko | 80909ce | 2017-01-12 21:10:38 +0100 | [diff] [blame] | 2028 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2029 | * The device supports telephony carrier restriction mechanism. |
| 2030 | * |
| 2031 | * <p>Devices declaring this feature must have an implementation of the |
| 2032 | * {@link android.telephony.TelephonyManager#getAllowedCarriers} and |
| 2033 | * {@link android.telephony.TelephonyManager#setAllowedCarriers}. |
| 2034 | * @hide |
| 2035 | */ |
| 2036 | @SystemApi |
| 2037 | @SdkConstant(SdkConstantType.FEATURE) |
| 2038 | public static final String FEATURE_TELEPHONY_CARRIERLOCK = |
| 2039 | "android.hardware.telephony.carrierlock"; |
| 2040 | |
| 2041 | /** |
Jeff Davidson | 35cda39 | 2017-02-27 09:46:00 -0800 | [diff] [blame] | 2042 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: The device |
| 2043 | * supports embedded subscriptions on eUICCs. |
| 2044 | * TODO(b/35851809): Make this public. |
| 2045 | * @hide |
| 2046 | */ |
| 2047 | @SdkConstant(SdkConstantType.FEATURE) |
| 2048 | public static final String FEATURE_TELEPHONY_EUICC = "android.hardware.telephony.euicc"; |
| 2049 | |
| 2050 | /** |
Hung-ying Tyan | 3424c02 | 2010-08-27 18:08:19 +0800 | [diff] [blame] | 2051 | * Feature for {@link #getSystemAvailableFeatures} and |
Mike Lockwood | f4ca247 | 2011-02-27 11:23:25 -0800 | [diff] [blame] | 2052 | * {@link #hasSystemFeature}: The device supports connecting to USB devices |
| 2053 | * as the USB host. |
| 2054 | */ |
| 2055 | @SdkConstant(SdkConstantType.FEATURE) |
| 2056 | public static final String FEATURE_USB_HOST = "android.hardware.usb.host"; |
| 2057 | |
| 2058 | /** |
| 2059 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2060 | * {@link #hasSystemFeature}: The device supports connecting to USB accessories. |
| 2061 | */ |
| 2062 | @SdkConstant(SdkConstantType.FEATURE) |
| 2063 | public static final String FEATURE_USB_ACCESSORY = "android.hardware.usb.accessory"; |
| 2064 | |
| 2065 | /** |
| 2066 | * Feature for {@link #getSystemAvailableFeatures} and |
Hung-ying Tyan | 3424c02 | 2010-08-27 18:08:19 +0800 | [diff] [blame] | 2067 | * {@link #hasSystemFeature}: The SIP API is enabled on the device. |
| 2068 | */ |
| 2069 | @SdkConstant(SdkConstantType.FEATURE) |
| 2070 | public static final String FEATURE_SIP = "android.software.sip"; |
| 2071 | |
| 2072 | /** |
| 2073 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2074 | * {@link #hasSystemFeature}: The device supports SIP-based VOIP. |
| 2075 | */ |
| 2076 | @SdkConstant(SdkConstantType.FEATURE) |
| 2077 | public static final String FEATURE_SIP_VOIP = "android.software.sip.voip"; |
| 2078 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2079 | /** |
| 2080 | * Feature for {@link #getSystemAvailableFeatures} and |
Ihab Awad | 1ec6888 | 2014-09-12 11:09:01 -0700 | [diff] [blame] | 2081 | * {@link #hasSystemFeature}: The Connection Service API is enabled on the device. |
| 2082 | */ |
| 2083 | @SdkConstant(SdkConstantType.FEATURE) |
| 2084 | public static final String FEATURE_CONNECTION_SERVICE = "android.software.connectionservice"; |
| 2085 | |
| 2086 | /** |
| 2087 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | b0fe033 | 2010-04-05 14:43:58 -0700 | [diff] [blame] | 2088 | * {@link #hasSystemFeature}: The device's display has a touch screen. |
| 2089 | */ |
| 2090 | @SdkConstant(SdkConstantType.FEATURE) |
| 2091 | public static final String FEATURE_TOUCHSCREEN = "android.hardware.touchscreen"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2092 | |
Dan Morrill | b0fe033 | 2010-04-05 14:43:58 -0700 | [diff] [blame] | 2093 | /** |
| 2094 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 2095 | * {@link #hasSystemFeature}: The device's touch screen supports |
| 2096 | * multitouch sufficient for basic two-finger gesture detection. |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2097 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 2098 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2099 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH = "android.hardware.touchscreen.multitouch"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2100 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2101 | /** |
| 2102 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 2103 | * {@link #hasSystemFeature}: The device's touch screen is capable of |
| 2104 | * tracking two or more fingers fully independently. |
| 2105 | */ |
| 2106 | @SdkConstant(SdkConstantType.FEATURE) |
| 2107 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT = "android.hardware.touchscreen.multitouch.distinct"; |
| 2108 | |
| 2109 | /** |
| 2110 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 6993d3d | 2010-09-03 14:30:14 -0700 | [diff] [blame] | 2111 | * {@link #hasSystemFeature}: The device's touch screen is capable of |
| 2112 | * tracking a full hand of fingers fully independently -- that is, 5 or |
| 2113 | * more simultaneous independent pointers. |
| 2114 | */ |
| 2115 | @SdkConstant(SdkConstantType.FEATURE) |
| 2116 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND = "android.hardware.touchscreen.multitouch.jazzhand"; |
| 2117 | |
| 2118 | /** |
| 2119 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | a537687 | 2011-01-23 13:15:53 -0800 | [diff] [blame] | 2120 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 2121 | * does support touch emulation for basic events. For instance, the |
| 2122 | * device might use a mouse or remote control to drive a cursor, and |
| 2123 | * emulate basic touch pointer events like down, up, drag, etc. All |
| 2124 | * devices that support android.hardware.touchscreen or a sub-feature are |
| 2125 | * presumed to also support faketouch. |
| 2126 | */ |
| 2127 | @SdkConstant(SdkConstantType.FEATURE) |
| 2128 | public static final String FEATURE_FAKETOUCH = "android.hardware.faketouch"; |
| 2129 | |
| 2130 | /** |
| 2131 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | e22fe93 | 2011-06-08 20:24:29 -0700 | [diff] [blame] | 2132 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 2133 | * does support touch emulation for basic events that supports distinct |
| 2134 | * tracking of two or more fingers. This is an extension of |
| 2135 | * {@link #FEATURE_FAKETOUCH} for input devices with this capability. Note |
| 2136 | * that unlike a distinct multitouch screen as defined by |
| 2137 | * {@link #FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT}, these kinds of input |
| 2138 | * devices will not actually provide full two-finger gestures since the |
| 2139 | * input is being transformed to cursor movement on the screen. That is, |
| 2140 | * single finger gestures will move a cursor; two-finger swipes will |
| 2141 | * result in single-finger touch events; other two-finger gestures will |
| 2142 | * result in the corresponding two-finger touch event. |
| 2143 | */ |
| 2144 | @SdkConstant(SdkConstantType.FEATURE) |
| 2145 | public static final String FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT = "android.hardware.faketouch.multitouch.distinct"; |
| 2146 | |
| 2147 | /** |
| 2148 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2149 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 2150 | * does support touch emulation for basic events that supports tracking |
| 2151 | * a hand of fingers (5 or more fingers) fully independently. |
| 2152 | * This is an extension of |
| 2153 | * {@link #FEATURE_FAKETOUCH} for input devices with this capability. Note |
| 2154 | * that unlike a multitouch screen as defined by |
| 2155 | * {@link #FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND}, not all two finger |
| 2156 | * gestures can be detected due to the limitations described for |
| 2157 | * {@link #FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT}. |
| 2158 | */ |
| 2159 | @SdkConstant(SdkConstantType.FEATURE) |
| 2160 | public static final String FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND = "android.hardware.faketouch.multitouch.jazzhand"; |
| 2161 | |
| 2162 | /** |
| 2163 | * Feature for {@link #getSystemAvailableFeatures} and |
Jim Miller | d9b9d41 | 2015-07-22 19:51:40 -0700 | [diff] [blame] | 2164 | * {@link #hasSystemFeature}: The device has biometric hardware to detect a fingerprint. |
| 2165 | */ |
| 2166 | @SdkConstant(SdkConstantType.FEATURE) |
| 2167 | public static final String FEATURE_FINGERPRINT = "android.hardware.fingerprint"; |
| 2168 | |
| 2169 | /** |
| 2170 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | e289bff | 2011-06-13 19:33:22 -0700 | [diff] [blame] | 2171 | * {@link #hasSystemFeature}: The device supports portrait orientation |
| 2172 | * screens. For backwards compatibility, you can assume that if neither |
| 2173 | * this nor {@link #FEATURE_SCREEN_LANDSCAPE} is set then the device supports |
| 2174 | * both portrait and landscape. |
| 2175 | */ |
| 2176 | @SdkConstant(SdkConstantType.FEATURE) |
| 2177 | public static final String FEATURE_SCREEN_PORTRAIT = "android.hardware.screen.portrait"; |
| 2178 | |
| 2179 | /** |
| 2180 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2181 | * {@link #hasSystemFeature}: The device supports landscape orientation |
| 2182 | * screens. For backwards compatibility, you can assume that if neither |
| 2183 | * this nor {@link #FEATURE_SCREEN_PORTRAIT} is set then the device supports |
| 2184 | * both portrait and landscape. |
| 2185 | */ |
| 2186 | @SdkConstant(SdkConstantType.FEATURE) |
| 2187 | public static final String FEATURE_SCREEN_LANDSCAPE = "android.hardware.screen.landscape"; |
| 2188 | |
| 2189 | /** |
| 2190 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2191 | * {@link #hasSystemFeature}: The device supports live wallpapers. |
| 2192 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 2193 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2194 | public static final String FEATURE_LIVE_WALLPAPER = "android.software.live_wallpaper"; |
Oscar Montemayor | 1228d0a | 2010-01-28 12:01:44 -0800 | [diff] [blame] | 2195 | /** |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 2196 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 119bbc3 | 2013-03-22 17:27:25 -0700 | [diff] [blame] | 2197 | * {@link #hasSystemFeature}: The device supports app widgets. |
| 2198 | */ |
| 2199 | @SdkConstant(SdkConstantType.FEATURE) |
| 2200 | public static final String FEATURE_APP_WIDGETS = "android.software.app_widgets"; |
| 2201 | |
| 2202 | /** |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 2203 | * @hide |
| 2204 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2205 | * {@link #hasSystemFeature}: The device supports |
| 2206 | * {@link android.service.voice.VoiceInteractionService} and |
| 2207 | * {@link android.app.VoiceInteractor}. |
| 2208 | */ |
| 2209 | @SdkConstant(SdkConstantType.FEATURE) |
| 2210 | public static final String FEATURE_VOICE_RECOGNIZERS = "android.software.voice_recognizers"; |
| 2211 | |
| 2212 | |
| 2213 | /** |
Dianne Hackborn | 119bbc3 | 2013-03-22 17:27:25 -0700 | [diff] [blame] | 2214 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2215 | * {@link #hasSystemFeature}: The device supports a home screen that is replaceable |
| 2216 | * by third party applications. |
| 2217 | */ |
| 2218 | @SdkConstant(SdkConstantType.FEATURE) |
| 2219 | public static final String FEATURE_HOME_SCREEN = "android.software.home_screen"; |
| 2220 | |
| 2221 | /** |
| 2222 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2223 | * {@link #hasSystemFeature}: The device supports adding new input methods implemented |
| 2224 | * with the {@link android.inputmethodservice.InputMethodService} API. |
| 2225 | */ |
| 2226 | @SdkConstant(SdkConstantType.FEATURE) |
| 2227 | public static final String FEATURE_INPUT_METHODS = "android.software.input_methods"; |
| 2228 | |
| 2229 | /** |
| 2230 | * Feature for {@link #getSystemAvailableFeatures} and |
Amith Yamasani | 44a01b7 | 2013-09-16 10:44:57 -0700 | [diff] [blame] | 2231 | * {@link #hasSystemFeature}: The device supports device policy enforcement via device admins. |
| 2232 | */ |
| 2233 | @SdkConstant(SdkConstantType.FEATURE) |
| 2234 | public static final String FEATURE_DEVICE_ADMIN = "android.software.device_admin"; |
| 2235 | |
| 2236 | /** |
| 2237 | * Feature for {@link #getSystemAvailableFeatures} and |
Tim Kilbourn | f94b6a9 | 2014-03-07 15:13:48 -0800 | [diff] [blame] | 2238 | * {@link #hasSystemFeature}: The device supports leanback UI. This is |
| 2239 | * typically used in a living room television experience, but is a software |
| 2240 | * feature unlike {@link #FEATURE_TELEVISION}. Devices running with this |
| 2241 | * feature will use resources associated with the "television" UI mode. |
| 2242 | */ |
| 2243 | @SdkConstant(SdkConstantType.FEATURE) |
| 2244 | public static final String FEATURE_LEANBACK = "android.software.leanback"; |
| 2245 | |
| 2246 | /** |
| 2247 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2248 | * {@link #hasSystemFeature}: The device supports only leanback UI. Only |
| 2249 | * applications designed for this experience should be run, though this is |
| 2250 | * not enforced by the system. |
Tim Kilbourn | f94b6a9 | 2014-03-07 15:13:48 -0800 | [diff] [blame] | 2251 | */ |
| 2252 | @SdkConstant(SdkConstantType.FEATURE) |
| 2253 | public static final String FEATURE_LEANBACK_ONLY = "android.software.leanback_only"; |
| 2254 | |
| 2255 | /** |
| 2256 | * Feature for {@link #getSystemAvailableFeatures} and |
Jae Seo | cfd861e | 2014-08-27 14:02:15 -0700 | [diff] [blame] | 2257 | * {@link #hasSystemFeature}: The device supports live TV and can display |
| 2258 | * contents from TV inputs implemented with the |
| 2259 | * {@link android.media.tv.TvInputService} API. |
| 2260 | */ |
| 2261 | @SdkConstant(SdkConstantType.FEATURE) |
| 2262 | public static final String FEATURE_LIVE_TV = "android.software.live_tv"; |
| 2263 | |
| 2264 | /** |
| 2265 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 2266 | * {@link #hasSystemFeature}: The device supports WiFi (802.11) networking. |
| 2267 | */ |
| 2268 | @SdkConstant(SdkConstantType.FEATURE) |
| 2269 | public static final String FEATURE_WIFI = "android.hardware.wifi"; |
| 2270 | |
| 2271 | /** |
Irfan Sheriff | 45b8b46 | 2011-09-07 11:24:16 -0700 | [diff] [blame] | 2272 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2273 | * {@link #hasSystemFeature}: The device supports Wi-Fi Direct networking. |
| 2274 | */ |
| 2275 | @SdkConstant(SdkConstantType.FEATURE) |
| 2276 | public static final String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct"; |
| 2277 | |
| 2278 | /** |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2279 | * Feature for {@link #getSystemAvailableFeatures} and |
Etan Cohen | 0413327 | 2016-10-26 11:22:06 -0700 | [diff] [blame] | 2280 | * {@link #hasSystemFeature}: The device supports Wi-Fi Aware. |
Etan Cohen | 20d329b | 2015-09-29 13:49:02 -0700 | [diff] [blame] | 2281 | */ |
| 2282 | @SdkConstant(SdkConstantType.FEATURE) |
Etan Cohen | 0413327 | 2016-10-26 11:22:06 -0700 | [diff] [blame] | 2283 | public static final String FEATURE_WIFI_AWARE = "android.hardware.wifi.aware"; |
Etan Cohen | 20d329b | 2015-09-29 13:49:02 -0700 | [diff] [blame] | 2284 | |
| 2285 | /** |
| 2286 | * Feature for {@link #getSystemAvailableFeatures} and |
Peter Qiu | b99fe31 | 2017-05-05 13:48:47 -0700 | [diff] [blame] | 2287 | * {@link #hasSystemFeature}: The device supports Wi-Fi Passpoint. |
Jeff Sharkey | 0c28d43 | 2017-06-09 11:37:02 -0600 | [diff] [blame] | 2288 | * @hide |
Peter Qiu | b99fe31 | 2017-05-05 13:48:47 -0700 | [diff] [blame] | 2289 | */ |
| 2290 | @SdkConstant(SdkConstantType.FEATURE) |
| 2291 | public static final String FEATURE_WIFI_PASSPOINT = "android.hardware.wifi.passpoint"; |
| 2292 | |
| 2293 | /** |
| 2294 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2295 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
Todd Kennedy | 7f95a00 | 2015-04-22 14:28:25 -0700 | [diff] [blame] | 2296 | * on a vehicle headunit. A headunit here is defined to be inside a |
| 2297 | * vehicle that may or may not be moving. A headunit uses either a |
| 2298 | * primary display in the center console and/or additional displays in |
| 2299 | * the instrument cluster or elsewhere in the vehicle. Headunit display(s) |
| 2300 | * have limited size and resolution. The user will likely be focused on |
| 2301 | * driving so limiting driver distraction is a primary concern. User input |
| 2302 | * can be a variety of hard buttons, touch, rotary controllers and even mouse- |
| 2303 | * like interfaces. |
| 2304 | */ |
| 2305 | @SdkConstant(SdkConstantType.FEATURE) |
| 2306 | public static final String FEATURE_AUTOMOTIVE = "android.hardware.type.automotive"; |
| 2307 | |
| 2308 | /** |
| 2309 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2310 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2311 | * on a television. Television here is defined to be a typical living |
| 2312 | * room television experience: displayed on a big screen, where the user |
| 2313 | * is sitting far away from it, and the dominant form of input will be |
| 2314 | * something like a DPAD, not through touch or mouse. |
Tim Kilbourn | f94b6a9 | 2014-03-07 15:13:48 -0800 | [diff] [blame] | 2315 | * @deprecated use {@link #FEATURE_LEANBACK} instead. |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2316 | */ |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 2317 | @Deprecated |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2318 | @SdkConstant(SdkConstantType.FEATURE) |
| 2319 | public static final String FEATURE_TELEVISION = "android.hardware.type.television"; |
| 2320 | |
| 2321 | /** |
Justin Koh | b5731f091c | 2014-02-13 16:06:59 -0800 | [diff] [blame] | 2322 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2323 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
| 2324 | * on a watch. A watch here is defined to be a device worn on the body, perhaps on |
| 2325 | * the wrist. The user is very close when interacting with the device. |
| 2326 | */ |
| 2327 | @SdkConstant(SdkConstantType.FEATURE) |
| 2328 | public static final String FEATURE_WATCH = "android.hardware.type.watch"; |
| 2329 | |
| 2330 | /** |
Ralph Nathan | b8e0dee | 2017-01-24 15:24:59 -0800 | [diff] [blame] | 2331 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2332 | * {@link #hasSystemFeature}: This is a device for IoT and may not have an UI. An embedded |
| 2333 | * device is defined as a full stack Android device with or without a display and no |
| 2334 | * user-installable apps. |
| 2335 | */ |
| 2336 | @SdkConstant(SdkConstantType.FEATURE) |
| 2337 | public static final String FEATURE_EMBEDDED = "android.hardware.type.embedded"; |
| 2338 | |
| 2339 | /** |
Dennis Kempin | 7345ed5 | 2017-04-14 16:40:56 -0700 | [diff] [blame] | 2340 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2341 | * {@link #hasSystemFeature}: This is a device dedicated to be primarily used |
| 2342 | * with keyboard, mouse or touchpad. This includes traditional desktop |
| 2343 | * computers, laptops and variants such as convertibles or detachables. |
| 2344 | * Due to the larger screen, the device will most likely use the |
| 2345 | * {@link #FEATURE_FREEFORM_WINDOW_MANAGEMENT} feature as well. |
Jeff Sharkey | 0c28d43 | 2017-06-09 11:37:02 -0600 | [diff] [blame] | 2346 | * @hide |
Dennis Kempin | 7345ed5 | 2017-04-14 16:40:56 -0700 | [diff] [blame] | 2347 | */ |
| 2348 | @SdkConstant(SdkConstantType.FEATURE) |
| 2349 | public static final String FEATURE_PC = "android.hardware.type.pc"; |
| 2350 | |
| 2351 | /** |
Adam Lesinski | 3d9bcb9 | 2014-02-18 14:05:14 -0800 | [diff] [blame] | 2352 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2353 | * The device supports printing. |
| 2354 | */ |
| 2355 | @SdkConstant(SdkConstantType.FEATURE) |
| 2356 | public static final String FEATURE_PRINTING = "android.software.print"; |
| 2357 | |
| 2358 | /** |
| 2359 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Eugene Susla | 7c3eef2 | 2017-03-10 14:25:58 -0800 | [diff] [blame] | 2360 | * The device supports {@link android.companion.CompanionDeviceManager#associate associating} |
| 2361 | * with devices via {@link android.companion.CompanionDeviceManager}. |
| 2362 | */ |
| 2363 | @SdkConstant(SdkConstantType.FEATURE) |
| 2364 | public static final String FEATURE_COMPANION_DEVICE_SETUP |
| 2365 | = "android.software.companion_device_setup"; |
| 2366 | |
| 2367 | /** |
| 2368 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Adam Lesinski | 3d9bcb9 | 2014-02-18 14:05:14 -0800 | [diff] [blame] | 2369 | * The device can perform backup and restore operations on installed applications. |
| 2370 | */ |
| 2371 | @SdkConstant(SdkConstantType.FEATURE) |
| 2372 | public static final String FEATURE_BACKUP = "android.software.backup"; |
| 2373 | |
| 2374 | /** |
Vladislav Kaznacheev | d303b25 | 2015-10-27 17:30:58 -0700 | [diff] [blame] | 2375 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2376 | * {@link #hasSystemFeature}: The device supports freeform window management. |
| 2377 | * Windows have title bars and can be moved and resized. |
| 2378 | */ |
Filip Gruszczynski | 811dc3b | 2015-11-23 12:34:22 -0800 | [diff] [blame] | 2379 | // If this feature is present, you also need to set |
| 2380 | // com.android.internal.R.config_freeformWindowManagement to true in your configuration overlay. |
Vladislav Kaznacheev | d303b25 | 2015-10-27 17:30:58 -0700 | [diff] [blame] | 2381 | @SdkConstant(SdkConstantType.FEATURE) |
| 2382 | public static final String FEATURE_FREEFORM_WINDOW_MANAGEMENT |
| 2383 | = "android.software.freeform_window_management"; |
| 2384 | |
| 2385 | /** |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 2386 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Wale Ogunwale | fbe12c4 | 2015-12-06 16:23:50 -0800 | [diff] [blame] | 2387 | * The device supports picture-in-picture multi-window mode. |
| 2388 | */ |
| 2389 | @SdkConstant(SdkConstantType.FEATURE) |
| 2390 | public static final String FEATURE_PICTURE_IN_PICTURE = "android.software.picture_in_picture"; |
| 2391 | |
| 2392 | /** |
| 2393 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Andrii Kulian | 1981f5f | 2017-04-07 16:23:12 -0700 | [diff] [blame] | 2394 | * The device supports running activities on secondary displays. |
| 2395 | */ |
| 2396 | @SdkConstant(SdkConstantType.FEATURE) |
| 2397 | public static final String FEATURE_ACTIVITIES_ON_SECONDARY_DISPLAYS |
| 2398 | = "android.software.activities_on_secondary_displays"; |
| 2399 | |
| 2400 | /** |
| 2401 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Amith Yamasani | 1d65327 | 2014-09-11 17:56:05 -0700 | [diff] [blame] | 2402 | * The device supports creating secondary users and managed profiles via |
| 2403 | * {@link DevicePolicyManager}. |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 2404 | */ |
| 2405 | @SdkConstant(SdkConstantType.FEATURE) |
Amith Yamasani | 1d65327 | 2014-09-11 17:56:05 -0700 | [diff] [blame] | 2406 | public static final String FEATURE_MANAGED_USERS = "android.software.managed_users"; |
| 2407 | |
| 2408 | /** |
| 2409 | * @hide |
| 2410 | * TODO: Remove after dependencies updated b/17392243 |
| 2411 | */ |
| 2412 | public static final String FEATURE_MANAGED_PROFILES = "android.software.managed_users"; |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 2413 | |
| 2414 | /** |
Ben Murdoch | f564c7f | 2014-05-20 18:58:06 +0100 | [diff] [blame] | 2415 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Adam Connors | 19ccb5f | 2014-09-08 17:31:50 +0100 | [diff] [blame] | 2416 | * The device supports verified boot. |
| 2417 | */ |
| 2418 | @SdkConstant(SdkConstantType.FEATURE) |
| 2419 | public static final String FEATURE_VERIFIED_BOOT = "android.software.verified_boot"; |
| 2420 | |
| 2421 | /** |
| 2422 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2423 | * The device supports secure removal of users. When a user is deleted the data associated |
| 2424 | * with that user is securely deleted and no longer available. |
| 2425 | */ |
| 2426 | @SdkConstant(SdkConstantType.FEATURE) |
| 2427 | public static final String FEATURE_SECURELY_REMOVES_USERS |
| 2428 | = "android.software.securely_removes_users"; |
| 2429 | |
Jeff Sharkey | b92b05b | 2016-01-28 09:50:00 -0700 | [diff] [blame] | 2430 | /** {@hide} */ |
| 2431 | @SdkConstant(SdkConstantType.FEATURE) |
| 2432 | public static final String FEATURE_FILE_BASED_ENCRYPTION |
| 2433 | = "android.software.file_based_encryption"; |
| 2434 | |
Adam Connors | 19ccb5f | 2014-09-08 17:31:50 +0100 | [diff] [blame] | 2435 | /** |
| 2436 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Ben Murdoch | 422c7a5 | 2014-05-16 13:45:47 +0100 | [diff] [blame] | 2437 | * The device has a full implementation of the android.webkit.* APIs. Devices |
| 2438 | * lacking this feature will not have a functioning WebView implementation. |
| 2439 | */ |
| 2440 | @SdkConstant(SdkConstantType.FEATURE) |
| 2441 | public static final String FEATURE_WEBVIEW = "android.software.webview"; |
| 2442 | |
| 2443 | /** |
Joe LaPenna | 4bb015d | 2014-07-04 17:15:54 -0700 | [diff] [blame] | 2444 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2445 | * {@link #hasSystemFeature}: This device supports ethernet. |
Joe LaPenna | 4bb015d | 2014-07-04 17:15:54 -0700 | [diff] [blame] | 2446 | */ |
| 2447 | @SdkConstant(SdkConstantType.FEATURE) |
| 2448 | public static final String FEATURE_ETHERNET = "android.hardware.ethernet"; |
| 2449 | |
| 2450 | /** |
Yuncheol Heo | a0c4a06 | 2014-07-10 20:49:27 +0900 | [diff] [blame] | 2451 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2452 | * {@link #hasSystemFeature}: This device supports HDMI-CEC. |
| 2453 | * @hide |
| 2454 | */ |
| 2455 | @SdkConstant(SdkConstantType.FEATURE) |
| 2456 | public static final String FEATURE_HDMI_CEC = "android.hardware.hdmi.cec"; |
| 2457 | |
| 2458 | /** |
Michael Wright | 6faa675 | 2014-09-05 17:57:44 -0700 | [diff] [blame] | 2459 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2460 | * The device has all of the inputs necessary to be considered a compatible game controller, or |
| 2461 | * includes a compatible game controller in the box. |
| 2462 | */ |
| 2463 | @SdkConstant(SdkConstantType.FEATURE) |
| 2464 | public static final String FEATURE_GAMEPAD = "android.hardware.gamepad"; |
| 2465 | |
Mike Lockwood | 5781cd5 | 2015-03-27 13:23:41 -0700 | [diff] [blame] | 2466 | /** |
| 2467 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2468 | * The device has a full implementation of the android.media.midi.* APIs. |
| 2469 | */ |
| 2470 | @SdkConstant(SdkConstantType.FEATURE) |
| 2471 | public static final String FEATURE_MIDI = "android.software.midi"; |
Michael Wright | 6faa675 | 2014-09-05 17:57:44 -0700 | [diff] [blame] | 2472 | |
| 2473 | /** |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2474 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Ruben Brunk | 927d345 | 2016-05-02 19:30:51 -0700 | [diff] [blame] | 2475 | * The device implements an optimized mode for virtual reality (VR) applications that handles |
| 2476 | * stereoscopic rendering of notifications, and disables most monocular system UI components |
| 2477 | * while a VR application has user focus. |
| 2478 | * Devices declaring this feature must include an application implementing a |
| 2479 | * {@link android.service.vr.VrListenerService} that can be targeted by VR applications via |
| 2480 | * {@link android.app.Activity#setVrModeEnabled}. |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2481 | */ |
| 2482 | @SdkConstant(SdkConstantType.FEATURE) |
| 2483 | public static final String FEATURE_VR_MODE = "android.software.vr.mode"; |
| 2484 | |
| 2485 | /** |
Ruben Brunk | 31d80ea | 2016-01-25 20:14:08 -0800 | [diff] [blame] | 2486 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Ruben Brunk | 927d345 | 2016-05-02 19:30:51 -0700 | [diff] [blame] | 2487 | * The device implements {@link #FEATURE_VR_MODE} but additionally meets extra CDD requirements |
| 2488 | * to provide a high-quality VR experience. In general, devices declaring this feature will |
| 2489 | * additionally: |
| 2490 | * <ul> |
| 2491 | * <li>Deliver consistent performance at a high framerate over an extended period of time |
| 2492 | * for typical VR application CPU/GPU workloads with a minimal number of frame drops for VR |
| 2493 | * applications that have called |
| 2494 | * {@link android.view.Window#setSustainedPerformanceMode}.</li> |
| 2495 | * <li>Implement {@link #FEATURE_HIFI_SENSORS} and have a low sensor latency.</li> |
| 2496 | * <li>Include optimizations to lower display persistence while running VR applications.</li> |
| 2497 | * <li>Implement an optimized render path to minimize latency to draw to the device's main |
| 2498 | * display.</li> |
| 2499 | * <li>Include the following EGL extensions: EGL_ANDROID_create_native_client_buffer, |
| 2500 | * EGL_ANDROID_front_buffer_auto_refresh, EGL_EXT_protected_content, |
| 2501 | * EGL_KHR_mutable_render_buffer, EGL_KHR_reusable_sync, and EGL_KHR_wait_sync.</li> |
| 2502 | * <li>Provide at least one CPU core that is reserved for use solely by the top, foreground |
| 2503 | * VR application process for critical render threads while such an application is |
| 2504 | * running.</li> |
| 2505 | * </ul> |
Ruben Brunk | 31d80ea | 2016-01-25 20:14:08 -0800 | [diff] [blame] | 2506 | */ |
| 2507 | @SdkConstant(SdkConstantType.FEATURE) |
| 2508 | public static final String FEATURE_VR_MODE_HIGH_PERFORMANCE |
| 2509 | = "android.hardware.vr.high_performance"; |
| 2510 | |
| 2511 | /** |
Craig Donner | 279dd66 | 2017-03-15 17:10:50 -0700 | [diff] [blame] | 2512 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Svet Ganov | 43574b0 | 2017-04-12 09:25:20 -0700 | [diff] [blame] | 2513 | * The device supports autofill of user credentials, addresses, credit cards, etc |
| 2514 | * via integration with {@link android.service.autofill.AutofillService autofill |
| 2515 | * providers}. |
| 2516 | */ |
| 2517 | @SdkConstant(SdkConstantType.FEATURE) |
| 2518 | public static final String FEATURE_AUTOFILL = "android.software.autofill"; |
| 2519 | |
| 2520 | /** |
| 2521 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Craig Donner | 279dd66 | 2017-03-15 17:10:50 -0700 | [diff] [blame] | 2522 | * The device implements headtracking suitable for a VR device. |
| 2523 | */ |
| 2524 | @SdkConstant(SdkConstantType.FEATURE) |
| 2525 | public static final String FEATURE_VR_HEADTRACKING = "android.hardware.vr.headtracking"; |
| 2526 | |
| 2527 | /** |
Dianne Hackborn | e83cefce | 2010-02-04 17:38:14 -0800 | [diff] [blame] | 2528 | * Action to external storage service to clean out removed apps. |
| 2529 | * @hide |
| 2530 | */ |
| 2531 | public static final String ACTION_CLEAN_EXTERNAL_STORAGE |
| 2532 | = "android.content.pm.CLEAN_EXTERNAL_STORAGE"; |
Oscar Montemayor | 1228d0a | 2010-01-28 12:01:44 -0800 | [diff] [blame] | 2533 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2534 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 2535 | * Extra field name for the URI to a verification file. Passed to a package |
| 2536 | * verifier. |
| 2537 | * |
| 2538 | * @hide |
| 2539 | */ |
| 2540 | public static final String EXTRA_VERIFICATION_URI = "android.content.pm.extra.VERIFICATION_URI"; |
| 2541 | |
| 2542 | /** |
| 2543 | * Extra field name for the ID of a package pending verification. Passed to |
| 2544 | * a package verifier and is used to call back to |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 2545 | * {@link PackageManager#verifyPendingInstall(int, int)} |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 2546 | */ |
| 2547 | public static final String EXTRA_VERIFICATION_ID = "android.content.pm.extra.VERIFICATION_ID"; |
| 2548 | |
| 2549 | /** |
| 2550 | * Extra field name for the package identifier which is trying to install |
| 2551 | * the package. |
| 2552 | * |
| 2553 | * @hide |
| 2554 | */ |
| 2555 | public static final String EXTRA_VERIFICATION_INSTALLER_PACKAGE |
| 2556 | = "android.content.pm.extra.VERIFICATION_INSTALLER_PACKAGE"; |
| 2557 | |
| 2558 | /** |
| 2559 | * Extra field name for the requested install flags for a package pending |
| 2560 | * verification. Passed to a package verifier. |
| 2561 | * |
| 2562 | * @hide |
| 2563 | */ |
| 2564 | public static final String EXTRA_VERIFICATION_INSTALL_FLAGS |
| 2565 | = "android.content.pm.extra.VERIFICATION_INSTALL_FLAGS"; |
| 2566 | |
| 2567 | /** |
rich cannings | 13d428e | 2012-09-13 13:43:07 -0700 | [diff] [blame] | 2568 | * Extra field name for the uid of who is requesting to install |
| 2569 | * the package. |
| 2570 | * |
| 2571 | * @hide |
| 2572 | */ |
| 2573 | public static final String EXTRA_VERIFICATION_INSTALLER_UID |
| 2574 | = "android.content.pm.extra.VERIFICATION_INSTALLER_UID"; |
| 2575 | |
| 2576 | /** |
| 2577 | * Extra field name for the package name of a package pending verification. |
| 2578 | * |
| 2579 | * @hide |
| 2580 | */ |
| 2581 | public static final String EXTRA_VERIFICATION_PACKAGE_NAME |
| 2582 | = "android.content.pm.extra.VERIFICATION_PACKAGE_NAME"; |
| 2583 | /** |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 2584 | * Extra field name for the result of a verification, either |
| 2585 | * {@link #VERIFICATION_ALLOW}, or {@link #VERIFICATION_REJECT}. |
| 2586 | * Passed to package verifiers after a package is verified. |
| 2587 | */ |
| 2588 | public static final String EXTRA_VERIFICATION_RESULT |
| 2589 | = "android.content.pm.extra.VERIFICATION_RESULT"; |
| 2590 | |
| 2591 | /** |
rich cannings | 13d428e | 2012-09-13 13:43:07 -0700 | [diff] [blame] | 2592 | * Extra field name for the version code of a package pending verification. |
| 2593 | * |
| 2594 | * @hide |
| 2595 | */ |
| 2596 | public static final String EXTRA_VERIFICATION_VERSION_CODE |
| 2597 | = "android.content.pm.extra.VERIFICATION_VERSION_CODE"; |
| 2598 | |
| 2599 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 2600 | * Extra field name for the ID of a intent filter pending verification. |
| 2601 | * Passed to an intent filter verifier and is used to call back to |
| 2602 | * {@link #verifyIntentFilter} |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 2603 | * |
| 2604 | * @hide |
| 2605 | */ |
| 2606 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_ID |
| 2607 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_ID"; |
| 2608 | |
| 2609 | /** |
| 2610 | * Extra field name for the scheme used for an intent filter pending verification. Passed to |
| 2611 | * an intent filter verifier and is used to construct the URI to verify against. |
| 2612 | * |
| 2613 | * Usually this is "https" |
| 2614 | * |
| 2615 | * @hide |
| 2616 | */ |
| 2617 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_URI_SCHEME |
| 2618 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_URI_SCHEME"; |
| 2619 | |
| 2620 | /** |
| 2621 | * Extra field name for the host names to be used for an intent filter pending verification. |
| 2622 | * Passed to an intent filter verifier and is used to construct the URI to verify the |
| 2623 | * intent filter. |
| 2624 | * |
| 2625 | * This is a space delimited list of hosts. |
| 2626 | * |
| 2627 | * @hide |
| 2628 | */ |
| 2629 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_HOSTS |
| 2630 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_HOSTS"; |
| 2631 | |
| 2632 | /** |
| 2633 | * Extra field name for the package name to be used for an intent filter pending verification. |
| 2634 | * Passed to an intent filter verifier and is used to check the verification responses coming |
| 2635 | * from the hosts. Each host response will need to include the package name of APK containing |
| 2636 | * the intent filter. |
| 2637 | * |
| 2638 | * @hide |
| 2639 | */ |
| 2640 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_PACKAGE_NAME |
| 2641 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_PACKAGE_NAME"; |
| 2642 | |
| 2643 | /** |
| 2644 | * The action used to request that the user approve a permission request |
| 2645 | * from the application. |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2646 | * |
| 2647 | * @hide |
| 2648 | */ |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 2649 | @SystemApi |
| 2650 | public static final String ACTION_REQUEST_PERMISSIONS = |
| 2651 | "android.content.pm.action.REQUEST_PERMISSIONS"; |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2652 | |
| 2653 | /** |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 2654 | * The names of the requested permissions. |
| 2655 | * <p> |
| 2656 | * <strong>Type:</strong> String[] |
| 2657 | * </p> |
| 2658 | * |
| 2659 | * @hide |
| 2660 | */ |
| 2661 | @SystemApi |
| 2662 | public static final String EXTRA_REQUEST_PERMISSIONS_NAMES = |
| 2663 | "android.content.pm.extra.REQUEST_PERMISSIONS_NAMES"; |
| 2664 | |
| 2665 | /** |
| 2666 | * The results from the permissions request. |
| 2667 | * <p> |
| 2668 | * <strong>Type:</strong> int[] of #PermissionResult |
| 2669 | * </p> |
| 2670 | * |
| 2671 | * @hide |
| 2672 | */ |
| 2673 | @SystemApi |
| 2674 | public static final String EXTRA_REQUEST_PERMISSIONS_RESULTS |
| 2675 | = "android.content.pm.extra.REQUEST_PERMISSIONS_RESULTS"; |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2676 | |
| 2677 | /** |
Jeff Sharkey | bb58067 | 2014-07-10 12:10:25 -0700 | [diff] [blame] | 2678 | * String extra for {@link PackageInstallObserver} in the 'extras' Bundle in case of |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2679 | * {@link #INSTALL_FAILED_DUPLICATE_PERMISSION}. This extra names the package which provides |
| 2680 | * the existing definition for the permission. |
| 2681 | * @hide |
| 2682 | */ |
| 2683 | public static final String EXTRA_FAILURE_EXISTING_PACKAGE |
| 2684 | = "android.content.pm.extra.FAILURE_EXISTING_PACKAGE"; |
| 2685 | |
| 2686 | /** |
Jeff Sharkey | bb58067 | 2014-07-10 12:10:25 -0700 | [diff] [blame] | 2687 | * String extra for {@link PackageInstallObserver} in the 'extras' Bundle in case of |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2688 | * {@link #INSTALL_FAILED_DUPLICATE_PERMISSION}. This extra names the permission that is |
| 2689 | * being redundantly defined by the package being installed. |
| 2690 | * @hide |
| 2691 | */ |
| 2692 | public static final String EXTRA_FAILURE_EXISTING_PERMISSION |
| 2693 | = "android.content.pm.extra.FAILURE_EXISTING_PERMISSION"; |
| 2694 | |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2695 | /** |
| 2696 | * Permission flag: The permission is set in its current state |
| 2697 | * by the user and apps can still request it at runtime. |
| 2698 | * |
| 2699 | * @hide |
| 2700 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2701 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2702 | public static final int FLAG_PERMISSION_USER_SET = 1 << 0; |
| 2703 | |
| 2704 | /** |
| 2705 | * Permission flag: The permission is set in its current state |
| 2706 | * by the user and it is fixed, i.e. apps can no longer request |
| 2707 | * this permission. |
| 2708 | * |
| 2709 | * @hide |
| 2710 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2711 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2712 | public static final int FLAG_PERMISSION_USER_FIXED = 1 << 1; |
| 2713 | |
| 2714 | /** |
| 2715 | * Permission flag: The permission is set in its current state |
| 2716 | * by device policy and neither apps nor the user can change |
| 2717 | * its state. |
| 2718 | * |
| 2719 | * @hide |
| 2720 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2721 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2722 | public static final int FLAG_PERMISSION_POLICY_FIXED = 1 << 2; |
| 2723 | |
| 2724 | /** |
| 2725 | * Permission flag: The permission is set in a granted state but |
| 2726 | * access to resources it guards is restricted by other means to |
| 2727 | * enable revoking a permission on legacy apps that do not support |
| 2728 | * runtime permissions. If this permission is upgraded to runtime |
| 2729 | * because the app was updated to support runtime permissions, the |
| 2730 | * the permission will be revoked in the upgrade process. |
| 2731 | * |
| 2732 | * @hide |
| 2733 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2734 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2735 | public static final int FLAG_PERMISSION_REVOKE_ON_UPGRADE = 1 << 3; |
| 2736 | |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 2737 | /** |
| 2738 | * Permission flag: The permission is set in its current state |
| 2739 | * because the app is a component that is a part of the system. |
| 2740 | * |
| 2741 | * @hide |
| 2742 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2743 | @SystemApi |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 2744 | public static final int FLAG_PERMISSION_SYSTEM_FIXED = 1 << 4; |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2745 | |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 2746 | /** |
| 2747 | * Permission flag: The permission is granted by default because it |
| 2748 | * enables app functionality that is expected to work out-of-the-box |
| 2749 | * for providing a smooth user experience. For example, the phone app |
| 2750 | * is expected to have the phone permission. |
| 2751 | * |
| 2752 | * @hide |
| 2753 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2754 | @SystemApi |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 2755 | public static final int FLAG_PERMISSION_GRANTED_BY_DEFAULT = 1 << 5; |
| 2756 | |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2757 | /** |
Svet Ganov | 9c165d7 | 2015-12-01 19:52:26 -0800 | [diff] [blame] | 2758 | * Permission flag: The permission has to be reviewed before any of |
| 2759 | * the app components can run. |
| 2760 | * |
| 2761 | * @hide |
| 2762 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2763 | @SystemApi |
Svet Ganov | 9c165d7 | 2015-12-01 19:52:26 -0800 | [diff] [blame] | 2764 | public static final int FLAG_PERMISSION_REVIEW_REQUIRED = 1 << 6; |
| 2765 | |
| 2766 | /** |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2767 | * Mask for all permission flags. |
| 2768 | * |
| 2769 | * @hide |
| 2770 | */ |
| 2771 | @SystemApi |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 2772 | public static final int MASK_PERMISSION_FLAGS = 0xFF; |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2773 | |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2774 | /** |
Svet Ganov | d7b1f411 | 2016-02-09 18:49:23 -0800 | [diff] [blame] | 2775 | * This is a library that contains components apps can invoke. For |
| 2776 | * example, a services for apps to bind to, or standard chooser UI, |
| 2777 | * etc. This library is versioned and backwards compatible. Clients |
| 2778 | * should check its version via {@link android.ext.services.Version |
| 2779 | * #getVersionCode()} and avoid calling APIs added in later versions. |
| 2780 | * |
| 2781 | * @hide |
| 2782 | */ |
| 2783 | public static final String SYSTEM_SHARED_LIBRARY_SERVICES = "android.ext.services"; |
| 2784 | |
| 2785 | /** |
| 2786 | * This is a library that contains components apps can dynamically |
| 2787 | * load. For example, new widgets, helper classes, etc. This library |
| 2788 | * is versioned and backwards compatible. Clients should check its |
| 2789 | * version via {@link android.ext.shared.Version#getVersionCode()} |
| 2790 | * and avoid calling APIs added in later versions. |
| 2791 | * |
| 2792 | * @hide |
| 2793 | */ |
| 2794 | public static final String SYSTEM_SHARED_LIBRARY_SHARED = "android.ext.shared"; |
| 2795 | |
| 2796 | /** |
Brian Carlstrom | ca82e61 | 2016-04-19 23:16:08 -0700 | [diff] [blame] | 2797 | * Used when starting a process for an Activity. |
| 2798 | * |
| 2799 | * @hide |
| 2800 | */ |
| 2801 | public static final int NOTIFY_PACKAGE_USE_ACTIVITY = 0; |
| 2802 | |
| 2803 | /** |
| 2804 | * Used when starting a process for a Service. |
| 2805 | * |
| 2806 | * @hide |
| 2807 | */ |
| 2808 | public static final int NOTIFY_PACKAGE_USE_SERVICE = 1; |
| 2809 | |
| 2810 | /** |
| 2811 | * Used when moving a Service to the foreground. |
| 2812 | * |
| 2813 | * @hide |
| 2814 | */ |
| 2815 | public static final int NOTIFY_PACKAGE_USE_FOREGROUND_SERVICE = 2; |
| 2816 | |
| 2817 | /** |
| 2818 | * Used when starting a process for a BroadcastReceiver. |
| 2819 | * |
| 2820 | * @hide |
| 2821 | */ |
| 2822 | public static final int NOTIFY_PACKAGE_USE_BROADCAST_RECEIVER = 3; |
| 2823 | |
| 2824 | /** |
| 2825 | * Used when starting a process for a ContentProvider. |
| 2826 | * |
| 2827 | * @hide |
| 2828 | */ |
| 2829 | public static final int NOTIFY_PACKAGE_USE_CONTENT_PROVIDER = 4; |
| 2830 | |
| 2831 | /** |
| 2832 | * Used when starting a process for a BroadcastReceiver. |
| 2833 | * |
| 2834 | * @hide |
| 2835 | */ |
| 2836 | public static final int NOTIFY_PACKAGE_USE_BACKUP = 5; |
| 2837 | |
| 2838 | /** |
| 2839 | * Used with Context.getClassLoader() across Android packages. |
| 2840 | * |
| 2841 | * @hide |
| 2842 | */ |
| 2843 | public static final int NOTIFY_PACKAGE_USE_CROSS_PACKAGE = 6; |
| 2844 | |
| 2845 | /** |
| 2846 | * Used when starting a package within a process for Instrumentation. |
| 2847 | * |
| 2848 | * @hide |
| 2849 | */ |
| 2850 | public static final int NOTIFY_PACKAGE_USE_INSTRUMENTATION = 7; |
| 2851 | |
| 2852 | /** |
| 2853 | * Total number of usage reasons. |
| 2854 | * |
| 2855 | * @hide |
| 2856 | */ |
| 2857 | public static final int NOTIFY_PACKAGE_USE_REASONS_COUNT = 8; |
| 2858 | |
| 2859 | /** |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 2860 | * Constant for specifying the highest installed package version code. |
| 2861 | */ |
| 2862 | public static final int VERSION_CODE_HIGHEST = -1; |
| 2863 | |
| 2864 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2865 | * Retrieve overall information about an application package that is |
| 2866 | * installed on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2867 | * |
| 2868 | * @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] | 2869 | * desired package. |
| 2870 | * @param flags Additional option flags to modify the data returned. |
| 2871 | * @return A PackageInfo object containing information about the package. If |
| 2872 | * flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if the package |
| 2873 | * is not found in the list of installed applications, the package |
| 2874 | * information is retrieved from the list of uninstalled |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2875 | * applications (which includes installed applications as well as |
| 2876 | * applications with data directory i.e. applications which had been |
| 2877 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2878 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2879 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2880 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2881 | public abstract PackageInfo getPackageInfo(String packageName, @PackageInfoFlags int flags) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2882 | throws NameNotFoundException; |
| 2883 | |
| 2884 | /** |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 2885 | * Retrieve overall information about an application package that is |
| 2886 | * installed on the system. This method can be used for retrieving |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 2887 | * information about packages for which multiple versions can be installed |
| 2888 | * at the time. Currently only packages hosting static shared libraries can |
| 2889 | * have multiple installed versions. The method can also be used to get info |
| 2890 | * for a package that has a single version installed by passing |
| 2891 | * {@link #VERSION_CODE_HIGHEST} in the {@link VersionedPackage} |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 2892 | * constructor. |
| 2893 | * |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 2894 | * @param versionedPackage The versioned package for which to query. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 2895 | * @param flags Additional option flags to modify the data returned. |
| 2896 | * @return A PackageInfo object containing information about the package. If |
| 2897 | * flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if the package |
| 2898 | * is not found in the list of installed applications, the package |
| 2899 | * information is retrieved from the list of uninstalled |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 2900 | * applications (which includes installed applications as well as |
| 2901 | * applications with data directory i.e. applications which had been |
| 2902 | * deleted with {@code DONT_DELETE_DATA} flag set). |
| 2903 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2904 | * found on the system. |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 2905 | */ |
| 2906 | public abstract PackageInfo getPackageInfo(VersionedPackage versionedPackage, |
| 2907 | @PackageInfoFlags int flags) throws NameNotFoundException; |
| 2908 | |
| 2909 | /** |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2910 | * Retrieve overall information about an application package that is |
| 2911 | * installed on the system. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2912 | * |
| 2913 | * @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] | 2914 | * desired package. |
| 2915 | * @param flags Additional option flags to modify the data returned. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2916 | * @param userId The user id. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 2917 | * @return A PackageInfo object containing information about the package. If |
| 2918 | * flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if the package |
| 2919 | * is not found in the list of installed applications, the package |
| 2920 | * information is retrieved from the list of uninstalled |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2921 | * applications (which includes installed applications as well as |
| 2922 | * applications with data directory i.e. applications which had been |
| 2923 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2924 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2925 | * found on the system. |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 2926 | * @hide |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2927 | */ |
| 2928 | @RequiresPermission(Manifest.permission.INTERACT_ACROSS_USERS) |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2929 | public abstract PackageInfo getPackageInfoAsUser(String packageName, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2930 | @PackageInfoFlags int flags, @UserIdInt int userId) throws NameNotFoundException; |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2931 | |
| 2932 | /** |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 2933 | * Map from the current package names in use on the device to whatever |
| 2934 | * the current canonical name of that package is. |
| 2935 | * @param names Array of current names to be mapped. |
| 2936 | * @return Returns an array of the same size as the original, containing |
| 2937 | * the canonical name for each package. |
| 2938 | */ |
| 2939 | public abstract String[] currentToCanonicalPackageNames(String[] names); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2940 | |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 2941 | /** |
| 2942 | * Map from a packages canonical name to the current name in use on the device. |
| 2943 | * @param names Array of new names to be mapped. |
| 2944 | * @return Returns an array of the same size as the original, containing |
| 2945 | * the current name for each package. |
| 2946 | */ |
| 2947 | public abstract String[] canonicalToCurrentPackageNames(String[] names); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2948 | |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 2949 | /** |
Andrew Solovay | 5ae1335 | 2014-06-06 12:23:09 -0700 | [diff] [blame] | 2950 | * Returns a "good" intent to launch a front-door activity in a package. |
| 2951 | * This is used, for example, to implement an "open" button when browsing |
| 2952 | * through packages. The current implementation looks first for a main |
| 2953 | * activity in the category {@link Intent#CATEGORY_INFO}, and next for a |
| 2954 | * main activity in the category {@link Intent#CATEGORY_LAUNCHER}. Returns |
| 2955 | * <code>null</code> if neither are found. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2956 | * |
| 2957 | * @param packageName The name of the package to inspect. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2958 | * |
Andrew Solovay | 5ae1335 | 2014-06-06 12:23:09 -0700 | [diff] [blame] | 2959 | * @return A fully-qualified {@link Intent} that can be used to launch the |
| 2960 | * main activity in the package. Returns <code>null</code> if the package |
| 2961 | * 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] | 2962 | * recognized. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2963 | */ |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 2964 | public abstract @Nullable Intent getLaunchIntentForPackage(@NonNull String packageName); |
Mihai Preda | eae850c | 2009-05-13 10:13:48 +0200 | [diff] [blame] | 2965 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2966 | /** |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 2967 | * Return a "good" intent to launch a front-door Leanback activity in a |
| 2968 | * package, for use for example to implement an "open" button when browsing |
| 2969 | * through packages. The current implementation will look for a main |
| 2970 | * activity in the category {@link Intent#CATEGORY_LEANBACK_LAUNCHER}, or |
| 2971 | * return null if no main leanback activities are found. |
Adam Connors | 551c078 | 2014-06-05 12:13:03 +0100 | [diff] [blame] | 2972 | * |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 2973 | * @param packageName The name of the package to inspect. |
| 2974 | * @return Returns either a fully-qualified Intent that can be used to launch |
| 2975 | * the main Leanback activity in the package, or null if the package |
| 2976 | * does not contain such an activity. |
| 2977 | */ |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 2978 | public abstract @Nullable Intent getLeanbackLaunchIntentForPackage(@NonNull String packageName); |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 2979 | |
| 2980 | /** |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 2981 | * Return an array of all of the POSIX secondary group IDs that have been |
| 2982 | * assigned to the given package. |
| 2983 | * <p> |
| 2984 | * Note that the same package may have different GIDs under different |
| 2985 | * {@link UserHandle} on the same device. |
Adam Connors | 551c078 | 2014-06-05 12:13:03 +0100 | [diff] [blame] | 2986 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2987 | * @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] | 2988 | * desired package. |
| 2989 | * @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] | 2990 | * none. |
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. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2993 | */ |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 2994 | public abstract int[] getPackageGids(@NonNull String packageName) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2995 | throws NameNotFoundException; |
| 2996 | |
| 2997 | /** |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 2998 | * Return an array of all of the POSIX secondary group IDs that have been |
| 2999 | * assigned to the given package. |
| 3000 | * <p> |
| 3001 | * Note that the same package may have different GIDs under different |
| 3002 | * {@link UserHandle} on the same device. |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 3003 | * |
| 3004 | * @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] | 3005 | * desired package. |
| 3006 | * @return Returns an int array of the assigned gids, or null if there are |
| 3007 | * none. |
| 3008 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3009 | * found on the system. |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 3010 | */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3011 | public abstract int[] getPackageGids(String packageName, @PackageInfoFlags int flags) |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 3012 | throws NameNotFoundException; |
| 3013 | |
| 3014 | /** |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3015 | * Return the UID associated with the given package name. |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 3016 | * <p> |
| 3017 | * Note that the same package will have different UIDs under different |
| 3018 | * {@link UserHandle} on the same device. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3019 | * |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3020 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
| 3021 | * desired package. |
| 3022 | * @return Returns an integer UID who owns the given package name. |
| 3023 | * @throws NameNotFoundException if a package with the given name can not be |
| 3024 | * found on the system. |
| 3025 | */ |
| 3026 | public abstract int getPackageUid(String packageName, @PackageInfoFlags int flags) |
| 3027 | throws NameNotFoundException; |
| 3028 | |
| 3029 | /** |
| 3030 | * Return the UID associated with the given package name. |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 3031 | * <p> |
| 3032 | * Note that the same package will have different UIDs under different |
| 3033 | * {@link UserHandle} on the same device. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3034 | * |
| 3035 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
| 3036 | * desired package. |
| 3037 | * @param userId The user handle identifier to look up the package under. |
| 3038 | * @return Returns an integer UID who owns the given package name. |
| 3039 | * @throws NameNotFoundException if a package with the given name can not be |
| 3040 | * found on the system. |
| 3041 | * @hide |
| 3042 | */ |
| 3043 | public abstract int getPackageUidAsUser(String packageName, @UserIdInt int userId) |
| 3044 | throws NameNotFoundException; |
| 3045 | |
| 3046 | /** |
| 3047 | * Return the UID associated with the given package name. |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 3048 | * <p> |
| 3049 | * Note that the same package will have different UIDs under different |
| 3050 | * {@link UserHandle} on the same device. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3051 | * |
| 3052 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
| 3053 | * desired package. |
| 3054 | * @param userId The user handle identifier to look up the package under. |
| 3055 | * @return Returns an integer UID who owns the given package name. |
| 3056 | * @throws NameNotFoundException if a package with the given name can not be |
| 3057 | * found on the system. |
| 3058 | * @hide |
| 3059 | */ |
| 3060 | public abstract int getPackageUidAsUser(String packageName, @PackageInfoFlags int flags, |
| 3061 | @UserIdInt int userId) throws NameNotFoundException; |
| 3062 | |
| 3063 | /** |
| 3064 | * 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] | 3065 | * |
| 3066 | * @param name The fully qualified name (i.e. com.google.permission.LOGIN) |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3067 | * of the permission you are interested in. |
| 3068 | * @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] | 3069 | * @return Returns a {@link PermissionInfo} containing information about the |
| 3070 | * permission. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3071 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3072 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3073 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3074 | public abstract PermissionInfo getPermissionInfo(String name, @PermissionInfoFlags int flags) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3075 | throws NameNotFoundException; |
| 3076 | |
| 3077 | /** |
| 3078 | * Query for all of the permissions associated with a particular group. |
| 3079 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3080 | * @param group The fully qualified name (i.e. com.google.permission.LOGIN) |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3081 | * of the permission group you are interested in. Use null to |
| 3082 | * find all of the permissions not associated with a group. |
| 3083 | * @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] | 3084 | * @return Returns a list of {@link PermissionInfo} containing information |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3085 | * about all of the permissions in the given group. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3086 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3087 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3088 | */ |
| 3089 | public abstract List<PermissionInfo> queryPermissionsByGroup(String group, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3090 | @PermissionInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3091 | |
| 3092 | /** |
Paul Navin | 7b89a7b | 2017-01-26 23:56:08 +0000 | [diff] [blame] | 3093 | * Returns true if Permission Review Mode is enabled, false otherwise. |
| 3094 | * |
| 3095 | * @hide |
| 3096 | */ |
| 3097 | @TestApi |
| 3098 | public abstract boolean isPermissionReviewModeEnabled(); |
| 3099 | |
| 3100 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3101 | * Retrieve all of the information we know about a particular group of |
| 3102 | * permissions. |
| 3103 | * |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3104 | * @param name The fully qualified name (i.e. |
| 3105 | * com.google.permission_group.APPS) of the permission you are |
| 3106 | * interested in. |
| 3107 | * @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] | 3108 | * @return Returns a {@link PermissionGroupInfo} containing information |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3109 | * about the permission. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3110 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3111 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3112 | */ |
| 3113 | public abstract PermissionGroupInfo getPermissionGroupInfo(String name, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3114 | @PermissionGroupInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3115 | |
| 3116 | /** |
| 3117 | * Retrieve all of the known permission groups in the system. |
| 3118 | * |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3119 | * @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] | 3120 | * @return Returns a list of {@link PermissionGroupInfo} containing |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3121 | * information about all of the known permission groups. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3122 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3123 | public abstract List<PermissionGroupInfo> getAllPermissionGroups( |
| 3124 | @PermissionGroupInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3125 | |
| 3126 | /** |
| 3127 | * Retrieve all of the information we know about a particular |
| 3128 | * package/application. |
| 3129 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3130 | * @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] | 3131 | * application. |
| 3132 | * @param flags Additional option flags to modify the data returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3133 | * @return An {@link ApplicationInfo} containing information about the |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3134 | * package. If flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if |
| 3135 | * the package is not found in the list of installed applications, |
| 3136 | * the application information is retrieved from the list of |
| 3137 | * uninstalled applications (which includes installed applications |
| 3138 | * as well as applications with data directory i.e. applications |
| 3139 | * which had been deleted with {@code DONT_DELETE_DATA} flag set). |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3140 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3141 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3142 | */ |
| 3143 | public abstract ApplicationInfo getApplicationInfo(String packageName, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3144 | @ApplicationInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3145 | |
Jeff Sharkey | cd65448 | 2016-01-08 17:42:11 -0700 | [diff] [blame] | 3146 | /** {@hide} */ |
| 3147 | public abstract ApplicationInfo getApplicationInfoAsUser(String packageName, |
| 3148 | @ApplicationInfoFlags int flags, @UserIdInt int userId) throws NameNotFoundException; |
| 3149 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3150 | /** |
| 3151 | * Retrieve all of the information we know about a particular activity |
| 3152 | * class. |
| 3153 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3154 | * @param component The full component name (i.e. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3155 | * com.google.apps.contacts/com.google.apps.contacts. |
| 3156 | * ContactsList) of an Activity class. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3157 | * @param flags Additional option flags to modify the data returned. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3158 | * @return An {@link ActivityInfo} containing information about the |
| 3159 | * activity. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3160 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3161 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3162 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3163 | public abstract ActivityInfo getActivityInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3164 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3165 | |
| 3166 | /** |
| 3167 | * Retrieve all of the information we know about a particular receiver |
| 3168 | * class. |
| 3169 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3170 | * @param component The full component name (i.e. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3171 | * com.google.apps.calendar/com.google.apps.calendar. |
| 3172 | * CalendarAlarm) of a Receiver class. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3173 | * @param flags Additional option flags to modify the data returned. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3174 | * @return An {@link ActivityInfo} containing information about the |
| 3175 | * receiver. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3176 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3177 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3178 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3179 | public abstract ActivityInfo getReceiverInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3180 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3181 | |
| 3182 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3183 | * 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] | 3184 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3185 | * @param component The full component name (i.e. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3186 | * com.google.apps.media/com.google.apps.media. |
| 3187 | * BackgroundPlayback) of a Service class. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3188 | * @param flags Additional option flags to modify the data returned. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3189 | * @return A {@link ServiceInfo} object containing information about the |
| 3190 | * service. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3191 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3192 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3193 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3194 | public abstract ServiceInfo getServiceInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3195 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3196 | |
| 3197 | /** |
| 3198 | * Retrieve all of the information we know about a particular content |
| 3199 | * provider class. |
| 3200 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3201 | * @param component The full component name (i.e. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3202 | * com.google.providers.media/com.google.providers.media. |
| 3203 | * MediaProvider) of a ContentProvider class. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3204 | * @param flags Additional option flags to modify the data returned. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3205 | * @return A {@link ProviderInfo} object containing information about the |
| 3206 | * provider. |
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. |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3209 | */ |
| 3210 | public abstract ProviderInfo getProviderInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3211 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3212 | |
| 3213 | /** |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3214 | * 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] | 3215 | * |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3216 | * @param flags Additional option flags to modify the data returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3217 | * @return A List of PackageInfo objects, one for each installed package, |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3218 | * containing information about the package. In the unlikely case |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3219 | * there are no installed packages, an empty list is returned. If |
| 3220 | * flag {@code MATCH_UNINSTALLED_PACKAGES} is set, the package |
| 3221 | * information is retrieved from the list of uninstalled |
| 3222 | * applications (which includes installed applications as well as |
| 3223 | * applications with data directory i.e. applications which had been |
| 3224 | * deleted with {@code DONT_DELETE_DATA} flag set). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3225 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3226 | public abstract List<PackageInfo> getInstalledPackages(@PackageInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3227 | |
| 3228 | /** |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3229 | * Return a List of all installed packages that are currently holding any of |
| 3230 | * the given permissions. |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3231 | * |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3232 | * @param flags Additional option flags to modify the data returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3233 | * @return A List of PackageInfo objects, one for each installed package |
| 3234 | * that holds any of the permissions that were provided, containing |
| 3235 | * information about the package. If no installed packages hold any |
| 3236 | * of the permissions, an empty list is returned. If flag |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3237 | * {@code MATCH_UNINSTALLED_PACKAGES} is set, the package |
| 3238 | * information is retrieved from the list of uninstalled |
| 3239 | * applications (which includes installed applications as well as |
| 3240 | * applications with data directory i.e. applications which had been |
| 3241 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3242 | */ |
| 3243 | public abstract List<PackageInfo> getPackagesHoldingPermissions( |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3244 | String[] permissions, @PackageInfoFlags int flags); |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3245 | |
| 3246 | /** |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3247 | * 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] | 3248 | * specific user. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3249 | * |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3250 | * @param flags Additional option flags to modify the data returned. |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3251 | * @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] | 3252 | * @return A List of PackageInfo objects, one for each installed package, |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3253 | * containing information about the package. In the unlikely case |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3254 | * there are no installed packages, an empty list is returned. If |
| 3255 | * flag {@code MATCH_UNINSTALLED_PACKAGES} is set, the package |
| 3256 | * information is retrieved from the list of uninstalled |
| 3257 | * applications (which includes installed applications as well as |
| 3258 | * applications with data directory i.e. applications which had been |
| 3259 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3260 | * @hide |
| 3261 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 3262 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 3263 | @RequiresPermission(android.Manifest.permission.INTERACT_ACROSS_USERS_FULL) |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 3264 | public abstract List<PackageInfo> getInstalledPackagesAsUser(@PackageInfoFlags int flags, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3265 | @UserIdInt int userId); |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3266 | |
| 3267 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3268 | * Check whether a particular package has been granted a particular |
| 3269 | * permission. |
| 3270 | * |
Svet Ganov | ad3b297 | 2015-07-07 22:49:17 -0700 | [diff] [blame] | 3271 | * @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] | 3272 | * @param pkgName The name of the package you are checking against. |
| 3273 | * |
| 3274 | * @return If the package has the permission, PERMISSION_GRANTED is |
| 3275 | * returned. If it does not have the permission, PERMISSION_DENIED |
| 3276 | * is returned. |
| 3277 | * |
| 3278 | * @see #PERMISSION_GRANTED |
| 3279 | * @see #PERMISSION_DENIED |
| 3280 | */ |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 3281 | @CheckResult |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 3282 | public abstract @PermissionResult int checkPermission(String permName, String pkgName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3283 | |
| 3284 | /** |
Svet Ganov | ad3b297 | 2015-07-07 22:49:17 -0700 | [diff] [blame] | 3285 | * Checks whether a particular permissions has been revoked for a |
| 3286 | * package by policy. Typically the device owner or the profile owner |
| 3287 | * may apply such a policy. The user cannot grant policy revoked |
| 3288 | * permissions, hence the only way for an app to get such a permission |
| 3289 | * is by a policy change. |
| 3290 | * |
| 3291 | * @param permName The name of the permission you are checking for. |
| 3292 | * @param pkgName The name of the package you are checking against. |
| 3293 | * |
| 3294 | * @return Whether the permission is restricted by policy. |
| 3295 | */ |
| 3296 | @CheckResult |
Svet Ganov | f1b7f20 | 2015-07-29 08:33:42 -0700 | [diff] [blame] | 3297 | public abstract boolean isPermissionRevokedByPolicy(@NonNull String permName, |
| 3298 | @NonNull String pkgName); |
| 3299 | |
| 3300 | /** |
| 3301 | * Gets the package name of the component controlling runtime permissions. |
| 3302 | * |
| 3303 | * @return The package name. |
| 3304 | * |
| 3305 | * @hide |
| 3306 | */ |
| 3307 | public abstract String getPermissionControllerPackageName(); |
Svet Ganov | ad3b297 | 2015-07-07 22:49:17 -0700 | [diff] [blame] | 3308 | |
| 3309 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3310 | * Add a new dynamic permission to the system. For this to work, your |
| 3311 | * package must have defined a permission tree through the |
| 3312 | * {@link android.R.styleable#AndroidManifestPermissionTree |
| 3313 | * <permission-tree>} tag in its manifest. A package can only add |
| 3314 | * permissions to trees that were defined by either its own package or |
| 3315 | * another with the same user id; a permission is in a tree if it |
| 3316 | * matches the name of the permission tree + ".": for example, |
| 3317 | * "com.foo.bar" is a member of the permission tree "com.foo". |
| 3318 | * |
| 3319 | * <p>It is good to make your permission tree name descriptive, because you |
| 3320 | * are taking possession of that entire set of permission names. Thus, it |
| 3321 | * must be under a domain you control, with a suffix that will not match |
| 3322 | * any normal permissions that may be declared in any applications that |
| 3323 | * are part of that domain. |
| 3324 | * |
| 3325 | * <p>New permissions must be added before |
| 3326 | * any .apks are installed that use those permissions. Permissions you |
| 3327 | * add through this method are remembered across reboots of the device. |
| 3328 | * If the given permission already exists, the info you supply here |
| 3329 | * will be used to update it. |
| 3330 | * |
| 3331 | * @param info Description of the permission to be added. |
| 3332 | * |
| 3333 | * @return Returns true if a new permission was created, false if an |
| 3334 | * existing one was updated. |
| 3335 | * |
| 3336 | * @throws SecurityException if you are not allowed to add the |
| 3337 | * given permission name. |
| 3338 | * |
| 3339 | * @see #removePermission(String) |
| 3340 | */ |
| 3341 | public abstract boolean addPermission(PermissionInfo info); |
| 3342 | |
| 3343 | /** |
Dianne Hackborn | d7c0968 | 2010-03-30 10:42:20 -0700 | [diff] [blame] | 3344 | * Like {@link #addPermission(PermissionInfo)} but asynchronously |
| 3345 | * persists the package manager state after returning from the call, |
| 3346 | * allowing it to return quicker and batch a series of adds at the |
| 3347 | * expense of no guarantee the added permission will be retained if |
| 3348 | * the device is rebooted before it is written. |
| 3349 | */ |
| 3350 | public abstract boolean addPermissionAsync(PermissionInfo info); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3351 | |
Dianne Hackborn | d7c0968 | 2010-03-30 10:42:20 -0700 | [diff] [blame] | 3352 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3353 | * Removes a permission that was previously added with |
| 3354 | * {@link #addPermission(PermissionInfo)}. The same ownership rules apply |
| 3355 | * -- you are only allowed to remove permissions that you are allowed |
| 3356 | * to add. |
| 3357 | * |
| 3358 | * @param name The name of the permission to remove. |
| 3359 | * |
| 3360 | * @throws SecurityException if you are not allowed to remove the |
| 3361 | * given permission name. |
| 3362 | * |
| 3363 | * @see #addPermission(PermissionInfo) |
| 3364 | */ |
| 3365 | public abstract void removePermission(String name); |
| 3366 | |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3367 | /** |
| 3368 | * Permission flags set when granting or revoking a permission. |
| 3369 | * |
| 3370 | * @hide |
| 3371 | */ |
| 3372 | @SystemApi |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3373 | @IntDef(prefix = { "FLAG_PERMISSION_" }, value = { |
| 3374 | FLAG_PERMISSION_USER_SET, |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3375 | FLAG_PERMISSION_USER_FIXED, |
| 3376 | FLAG_PERMISSION_POLICY_FIXED, |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 3377 | FLAG_PERMISSION_REVOKE_ON_UPGRADE, |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 3378 | FLAG_PERMISSION_SYSTEM_FIXED, |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3379 | FLAG_PERMISSION_GRANTED_BY_DEFAULT |
| 3380 | }) |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3381 | @Retention(RetentionPolicy.SOURCE) |
| 3382 | public @interface PermissionFlags {} |
| 3383 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3384 | /** |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3385 | * Grant a runtime permission to an application which the application does not |
| 3386 | * already have. The permission must have been requested by the application. |
| 3387 | * If the application is not allowed to hold the permission, a {@link |
Ruben Brunk | 12ab5e1 | 2016-11-10 15:27:30 -0800 | [diff] [blame] | 3388 | * java.lang.SecurityException} is thrown. If the package or permission is |
| 3389 | * invalid, a {@link java.lang.IllegalArgumentException} is thrown. |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3390 | * <p> |
| 3391 | * <strong>Note: </strong>Using this API requires holding |
Todd Kennedy | a8eb6a8 | 2016-07-28 16:35:42 -0700 | [diff] [blame] | 3392 | * android.permission.GRANT_RUNTIME_PERMISSIONS and if the user id is |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3393 | * not the current user android.permission.INTERACT_ACROSS_USERS_FULL. |
| 3394 | * </p> |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3395 | * |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3396 | * @param packageName The package to which to grant the permission. |
| 3397 | * @param permissionName The permission name to grant. |
| 3398 | * @param user The user for which to grant the permission. |
| 3399 | * |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3400 | * @see #revokeRuntimePermission(String, String, android.os.UserHandle) |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3401 | * |
| 3402 | * @hide |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3403 | */ |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3404 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 3405 | @RequiresPermission(android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS) |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3406 | public abstract void grantRuntimePermission(@NonNull String packageName, |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3407 | @NonNull String permissionName, @NonNull UserHandle user); |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3408 | |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3409 | /** |
| 3410 | * Revoke a runtime permission that was previously granted by {@link |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3411 | * #grantRuntimePermission(String, String, android.os.UserHandle)}. The |
| 3412 | * permission must have been requested by and granted to the application. |
| 3413 | * If the application is not allowed to hold the permission, a {@link |
Ruben Brunk | 12ab5e1 | 2016-11-10 15:27:30 -0800 | [diff] [blame] | 3414 | * java.lang.SecurityException} is thrown. If the package or permission is |
| 3415 | * invalid, a {@link java.lang.IllegalArgumentException} is thrown. |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3416 | * <p> |
| 3417 | * <strong>Note: </strong>Using this API requires holding |
Todd Kennedy | a8eb6a8 | 2016-07-28 16:35:42 -0700 | [diff] [blame] | 3418 | * android.permission.REVOKE_RUNTIME_PERMISSIONS and if the user id is |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3419 | * not the current user android.permission.INTERACT_ACROSS_USERS_FULL. |
| 3420 | * </p> |
| 3421 | * |
| 3422 | * @param packageName The package from which to revoke the permission. |
| 3423 | * @param permissionName The permission name to revoke. |
| 3424 | * @param user The user for which to revoke the permission. |
| 3425 | * |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3426 | * @see #grantRuntimePermission(String, String, android.os.UserHandle) |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3427 | * |
| 3428 | * @hide |
| 3429 | */ |
| 3430 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 3431 | @RequiresPermission(android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS) |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3432 | public abstract void revokeRuntimePermission(@NonNull String packageName, |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3433 | @NonNull String permissionName, @NonNull UserHandle user); |
| 3434 | |
| 3435 | /** |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3436 | * Gets the state flags associated with a permission. |
| 3437 | * |
| 3438 | * @param permissionName The permission for which to get the flags. |
| 3439 | * @param packageName The package name for which to get the flags. |
| 3440 | * @param user The user for which to get permission flags. |
| 3441 | * @return The permission flags. |
| 3442 | * |
| 3443 | * @hide |
| 3444 | */ |
| 3445 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 3446 | @RequiresPermission(anyOf = { |
| 3447 | android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS, |
| 3448 | android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS |
| 3449 | }) |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3450 | public abstract @PermissionFlags int getPermissionFlags(String permissionName, |
| 3451 | String packageName, @NonNull UserHandle user); |
| 3452 | |
| 3453 | /** |
| 3454 | * Updates the flags associated with a permission by replacing the flags in |
| 3455 | * the specified mask with the provided flag values. |
| 3456 | * |
| 3457 | * @param permissionName The permission for which to update the flags. |
| 3458 | * @param packageName The package name for which to update the flags. |
| 3459 | * @param flagMask The flags which to replace. |
| 3460 | * @param flagValues The flags with which to replace. |
| 3461 | * @param user The user for which to update the permission flags. |
| 3462 | * |
| 3463 | * @hide |
| 3464 | */ |
| 3465 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 3466 | @RequiresPermission(anyOf = { |
| 3467 | android.Manifest.permission.GRANT_RUNTIME_PERMISSIONS, |
| 3468 | android.Manifest.permission.REVOKE_RUNTIME_PERMISSIONS |
| 3469 | }) |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3470 | public abstract void updatePermissionFlags(String permissionName, |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3471 | String packageName, @PermissionFlags int flagMask, @PermissionFlags int flagValues, |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3472 | @NonNull UserHandle user); |
| 3473 | |
| 3474 | /** |
Svetoslav | 20770dd | 2015-05-29 15:43:04 -0700 | [diff] [blame] | 3475 | * Gets whether you should show UI with rationale for requesting a permission. |
| 3476 | * You should do this only if you do not have the permission and the context in |
| 3477 | * which the permission is requested does not clearly communicate to the user |
| 3478 | * what would be the benefit from grating this permission. |
| 3479 | * |
| 3480 | * @param permission A permission your app wants to request. |
| 3481 | * @return Whether you can show permission rationale UI. |
| 3482 | * |
| 3483 | * @hide |
| 3484 | */ |
| 3485 | public abstract boolean shouldShowRequestPermissionRationale(String permission); |
| 3486 | |
| 3487 | /** |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3488 | * Returns an {@link android.content.Intent} suitable for passing to |
| 3489 | * {@link android.app.Activity#startActivityForResult(android.content.Intent, int)} |
| 3490 | * which prompts the user to grant permissions to this application. |
| 3491 | * |
| 3492 | * @throws NullPointerException if {@code permissions} is {@code null} or empty. |
| 3493 | * |
| 3494 | * @hide |
| 3495 | */ |
| 3496 | public Intent buildRequestPermissionsIntent(@NonNull String[] permissions) { |
| 3497 | if (ArrayUtils.isEmpty(permissions)) { |
Svet Ganov | f66381c | 2016-02-18 20:02:36 -0800 | [diff] [blame] | 3498 | throw new IllegalArgumentException("permission cannot be null or empty"); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3499 | } |
| 3500 | Intent intent = new Intent(ACTION_REQUEST_PERMISSIONS); |
| 3501 | intent.putExtra(EXTRA_REQUEST_PERMISSIONS_NAMES, permissions); |
Svet Ganov | f1b7f20 | 2015-07-29 08:33:42 -0700 | [diff] [blame] | 3502 | intent.setPackage(getPermissionControllerPackageName()); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3503 | return intent; |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3504 | } |
| 3505 | |
| 3506 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3507 | * Compare the signatures of two packages to determine if the same |
| 3508 | * signature appears in both of them. If they do contain the same |
| 3509 | * signature, then they are allowed special privileges when working |
| 3510 | * with each other: they can share the same user-id, run instrumentation |
| 3511 | * against each other, etc. |
| 3512 | * |
| 3513 | * @param pkg1 First package name whose signature will be compared. |
| 3514 | * @param pkg2 Second package name whose signature will be compared. |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 3515 | * |
| 3516 | * @return Returns an integer indicating whether all signatures on the |
| 3517 | * two packages match. The value is >= 0 ({@link #SIGNATURE_MATCH}) if |
| 3518 | * all signatures match or < 0 if there is not a match ({@link |
| 3519 | * #SIGNATURE_NO_MATCH} or {@link #SIGNATURE_UNKNOWN_PACKAGE}). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3520 | * |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3521 | * @see #checkSignatures(int, int) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3522 | */ |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 3523 | @CheckResult |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 3524 | public abstract @SignatureResult int checkSignatures(String pkg1, String pkg2); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3525 | |
| 3526 | /** |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3527 | * Like {@link #checkSignatures(String, String)}, but takes UIDs of |
| 3528 | * the two packages to be checked. This can be useful, for example, |
| 3529 | * when doing the check in an IPC, where the UID is the only identity |
| 3530 | * available. It is functionally identical to determining the package |
| 3531 | * associated with the UIDs and checking their signatures. |
| 3532 | * |
Joe Onorato | 25660ec | 2009-08-12 22:40:37 -0700 | [diff] [blame] | 3533 | * @param uid1 First UID whose signature will be compared. |
| 3534 | * @param uid2 Second UID whose signature will be compared. |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3535 | * |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 3536 | * @return Returns an integer indicating whether all signatures on the |
| 3537 | * two packages match. The value is >= 0 ({@link #SIGNATURE_MATCH}) if |
| 3538 | * all signatures match or < 0 if there is not a match ({@link |
| 3539 | * #SIGNATURE_NO_MATCH} or {@link #SIGNATURE_UNKNOWN_PACKAGE}). |
| 3540 | * |
| 3541 | * @see #checkSignatures(String, String) |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3542 | */ |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 3543 | @CheckResult |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 3544 | public abstract @SignatureResult int checkSignatures(int uid1, int uid2); |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3545 | |
| 3546 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3547 | * Retrieve the names of all packages that are associated with a particular |
| 3548 | * user id. In most cases, this will be a single package name, the package |
| 3549 | * that has been assigned that user id. Where there are multiple packages |
| 3550 | * sharing the same user id through the "sharedUserId" mechanism, all |
| 3551 | * packages with that id will be returned. |
| 3552 | * |
| 3553 | * @param uid The user id for which you would like to retrieve the |
| 3554 | * associated packages. |
| 3555 | * |
| 3556 | * @return Returns an array of one or more packages assigned to the user |
| 3557 | * id, or null if there are no known packages with the given id. |
| 3558 | */ |
Jeff Sharkey | 377ded0f | 2016-01-10 13:15:41 -0700 | [diff] [blame] | 3559 | public abstract @Nullable String[] getPackagesForUid(int uid); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3560 | |
| 3561 | /** |
Michal Karpinski | cb67dc9 | 2016-12-13 18:20:23 +0000 | [diff] [blame] | 3562 | * Retrieve the official name associated with a uid. This name is |
Jonathan Basseri | 7ea3a33 | 2015-05-12 19:39:22 -0700 | [diff] [blame] | 3563 | * guaranteed to never change, though it is possible for the underlying |
Michal Karpinski | cb67dc9 | 2016-12-13 18:20:23 +0000 | [diff] [blame] | 3564 | * uid to be changed. That is, if you are storing information about |
| 3565 | * uids in persistent storage, you should use the string returned |
| 3566 | * by this function instead of the raw uid. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3567 | * |
Michal Karpinski | cb67dc9 | 2016-12-13 18:20:23 +0000 | [diff] [blame] | 3568 | * @param uid The uid for which you would like to retrieve a name. |
| 3569 | * @return Returns a unique name for the given uid, or null if the |
| 3570 | * uid is not currently assigned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3571 | */ |
Jeff Sharkey | 377ded0f | 2016-01-10 13:15:41 -0700 | [diff] [blame] | 3572 | public abstract @Nullable String getNameForUid(int uid); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3573 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3574 | /** |
| 3575 | * Return the user id associated with a shared user name. Multiple |
| 3576 | * applications can specify a shared user name in their manifest and thus |
| 3577 | * end up using a common uid. This might be used for new applications |
| 3578 | * that use an existing shared user name and need to know the uid of the |
| 3579 | * shared user. |
| 3580 | * |
| 3581 | * @param sharedUserName The shared user name whose uid is to be retrieved. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3582 | * @return Returns the UID associated with the shared user. |
| 3583 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3584 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3585 | * @hide |
| 3586 | */ |
| 3587 | public abstract int getUidForSharedUser(String sharedUserName) |
| 3588 | throws NameNotFoundException; |
| 3589 | |
| 3590 | /** |
| 3591 | * Return a List of all application packages that are installed on the |
| 3592 | * 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] | 3593 | * applications including those deleted with {@code DONT_DELETE_DATA} |
| 3594 | * (partially installed apps with data directory) will be returned. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3595 | * |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3596 | * @param flags Additional option flags to modify the data returned. |
| 3597 | * @return A List of ApplicationInfo objects, one for each installed |
| 3598 | * application. In the unlikely case there are no installed |
| 3599 | * packages, an empty list is returned. If flag |
| 3600 | * {@code MATCH_UNINSTALLED_PACKAGES} is set, the application |
| 3601 | * information is retrieved from the list of uninstalled |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3602 | * applications (which includes installed applications as well as |
| 3603 | * applications with data directory i.e. applications which had been |
| 3604 | * deleted with {@code DONT_DELETE_DATA} flag set). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3605 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3606 | public abstract List<ApplicationInfo> getInstalledApplications(@ApplicationInfoFlags int flags); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3607 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3608 | /** |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3609 | * Return a List of all application packages that are installed on the |
| 3610 | * device, for a specific user. If flag GET_UNINSTALLED_PACKAGES has been |
| 3611 | * set, a list of all applications including those deleted with |
| 3612 | * {@code DONT_DELETE_DATA} (partially installed apps with data directory) |
Bartosz Fabianowski | 1133424 | 2016-11-17 20:49:16 +0100 | [diff] [blame] | 3613 | * will be returned. |
| 3614 | * |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3615 | * @param flags Additional option flags to modify the data returned. |
| 3616 | * @param userId The user for whom the installed applications are to be |
| 3617 | * listed |
| 3618 | * @return A List of ApplicationInfo objects, one for each installed |
| 3619 | * application. In the unlikely case there are no installed |
| 3620 | * packages, an empty list is returned. If flag |
| 3621 | * {@code MATCH_UNINSTALLED_PACKAGES} is set, the application |
| 3622 | * information is retrieved from the list of uninstalled |
Bartosz Fabianowski | 1133424 | 2016-11-17 20:49:16 +0100 | [diff] [blame] | 3623 | * applications (which includes installed applications as well as |
| 3624 | * applications with data directory i.e. applications which had been |
| 3625 | * deleted with {@code DONT_DELETE_DATA} flag set). |
| 3626 | * @hide |
Bartosz Fabianowski | 1133424 | 2016-11-17 20:49:16 +0100 | [diff] [blame] | 3627 | */ |
| 3628 | public abstract List<ApplicationInfo> getInstalledApplicationsAsUser( |
| 3629 | @ApplicationInfoFlags int flags, @UserIdInt int userId); |
| 3630 | |
| 3631 | /** |
Jeff Sharkey | 910e081 | 2017-04-21 16:29:27 -0600 | [diff] [blame] | 3632 | * Gets the instant applications the user recently used. |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3633 | * |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3634 | * @return The instant app list. |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3635 | * |
| 3636 | * @hide |
| 3637 | */ |
Todd Kennedy | 9c9fdf2 | 2017-03-06 10:58:27 -0800 | [diff] [blame] | 3638 | @SystemApi |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3639 | @RequiresPermission(Manifest.permission.ACCESS_INSTANT_APPS) |
| 3640 | public abstract @NonNull List<InstantAppInfo> getInstantApps(); |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3641 | |
| 3642 | /** |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3643 | * Gets the icon for an instant application. |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3644 | * |
| 3645 | * @param packageName The app package name. |
| 3646 | * |
| 3647 | * @hide |
| 3648 | */ |
Todd Kennedy | 9c9fdf2 | 2017-03-06 10:58:27 -0800 | [diff] [blame] | 3649 | @SystemApi |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3650 | @RequiresPermission(Manifest.permission.ACCESS_INSTANT_APPS) |
| 3651 | public abstract @Nullable Drawable getInstantAppIcon(String packageName); |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3652 | |
| 3653 | /** |
David Christie | 31a1655 | 2017-03-01 15:08:45 -0800 | [diff] [blame] | 3654 | * Gets whether this application is an instant app. |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3655 | * |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3656 | * @return Whether caller is an instant app. |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3657 | * |
David Christie | 31a1655 | 2017-03-01 15:08:45 -0800 | [diff] [blame] | 3658 | * @see #isInstantApp(String) |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3659 | * @see #updateInstantAppCookie(byte[]) |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3660 | * @see #getInstantAppCookie() |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3661 | * @see #getInstantAppCookieMaxBytes() |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3662 | */ |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3663 | public abstract boolean isInstantApp(); |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3664 | |
| 3665 | /** |
David Christie | 31a1655 | 2017-03-01 15:08:45 -0800 | [diff] [blame] | 3666 | * Gets whether the given package is an instant app. |
| 3667 | * |
| 3668 | * @param packageName The package to check |
| 3669 | * @return Whether the given package is an instant app. |
| 3670 | * |
| 3671 | * @see #isInstantApp() |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3672 | * @see #updateInstantAppCookie(byte[]) |
David Christie | 31a1655 | 2017-03-01 15:08:45 -0800 | [diff] [blame] | 3673 | * @see #getInstantAppCookie() |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3674 | * @see #getInstantAppCookieMaxBytes() |
| 3675 | * @see #clearInstantAppCookie() |
David Christie | 31a1655 | 2017-03-01 15:08:45 -0800 | [diff] [blame] | 3676 | */ |
| 3677 | public abstract boolean isInstantApp(String packageName); |
| 3678 | |
| 3679 | /** |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3680 | * 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] | 3681 | * can store on the device. |
| 3682 | * |
| 3683 | * @return The max cookie size in bytes. |
| 3684 | * |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3685 | * @see #isInstantApp() |
David Christie | 31a1655 | 2017-03-01 15:08:45 -0800 | [diff] [blame] | 3686 | * @see #isInstantApp(String) |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3687 | * @see #updateInstantAppCookie(byte[]) |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3688 | * @see #getInstantAppCookie() |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3689 | * @see #clearInstantAppCookie() |
| 3690 | */ |
| 3691 | public abstract int getInstantAppCookieMaxBytes(); |
| 3692 | |
| 3693 | /** |
| 3694 | * @deprecated |
| 3695 | * @hide |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3696 | */ |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3697 | public abstract int getInstantAppCookieMaxSize(); |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3698 | |
| 3699 | /** |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3700 | * Gets the instant application cookie for this app. Non |
| 3701 | * instant apps and apps that were instant but were upgraded |
| 3702 | * to normal apps can still access this API. For instant apps |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3703 | * this cookie is cached for some time after uninstall while for |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3704 | * normal apps the cookie is deleted after the app is uninstalled. |
| 3705 | * The cookie is always present while the app is installed. |
| 3706 | * |
| 3707 | * @return The cookie. |
| 3708 | * |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3709 | * @see #isInstantApp() |
David Christie | 31a1655 | 2017-03-01 15:08:45 -0800 | [diff] [blame] | 3710 | * @see #isInstantApp(String) |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3711 | * @see #updateInstantAppCookie(byte[]) |
| 3712 | * @see #getInstantAppCookieMaxBytes() |
| 3713 | * @see #clearInstantAppCookie() |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3714 | */ |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3715 | public abstract @NonNull byte[] getInstantAppCookie(); |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3716 | |
| 3717 | /** |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3718 | * Clears the instant application cookie for the calling app. |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3719 | * |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3720 | * @see #isInstantApp() |
David Christie | 31a1655 | 2017-03-01 15:08:45 -0800 | [diff] [blame] | 3721 | * @see #isInstantApp(String) |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3722 | * @see #getInstantAppCookieMaxBytes() |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3723 | * @see #getInstantAppCookie() |
Svetoslav Ganov | 345ffa5 | 2017-04-18 16:08:41 -0700 | [diff] [blame] | 3724 | * @see #clearInstantAppCookie() |
| 3725 | */ |
| 3726 | public abstract void clearInstantAppCookie(); |
| 3727 | |
| 3728 | /** |
| 3729 | * Updates the instant application cookie for the calling app. Non |
| 3730 | * instant apps and apps that were instant but were upgraded |
| 3731 | * to normal apps can still access this API. For instant apps |
| 3732 | * this cookie is cached for some time after uninstall while for |
| 3733 | * normal apps the cookie is deleted after the app is uninstalled. |
| 3734 | * The cookie is always present while the app is installed. The |
| 3735 | * cookie size is limited by {@link #getInstantAppCookieMaxBytes()}. |
| 3736 | * Passing <code>null</code> or an empty array clears the cookie. |
| 3737 | * </p> |
| 3738 | * |
| 3739 | * @param cookie The cookie data. |
| 3740 | * |
| 3741 | * @see #isInstantApp() |
| 3742 | * @see #isInstantApp(String) |
| 3743 | * @see #getInstantAppCookieMaxBytes() |
| 3744 | * @see #getInstantAppCookie() |
| 3745 | * @see #clearInstantAppCookie() |
| 3746 | * |
| 3747 | * @throws IllegalArgumentException if the array exceeds max cookie size. |
| 3748 | */ |
| 3749 | public abstract void updateInstantAppCookie(@Nullable byte[] cookie); |
| 3750 | |
| 3751 | /** |
| 3752 | * @removed |
| 3753 | * @hide |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3754 | */ |
Svetoslav Ganov | 096d304 | 2017-01-30 16:34:13 -0800 | [diff] [blame] | 3755 | public abstract boolean setInstantAppCookie(@Nullable byte[] cookie); |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3756 | |
| 3757 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3758 | * Get a list of shared libraries that are available on the |
| 3759 | * system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3760 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3761 | * @return An array of shared library names that are |
| 3762 | * available on the system, or null if none are installed. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3763 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3764 | */ |
| 3765 | public abstract String[] getSystemSharedLibraryNames(); |
| 3766 | |
| 3767 | /** |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 3768 | * Get a list of shared libraries on the device. |
| 3769 | * |
| 3770 | * @param flags To filter the libraries to return. |
| 3771 | * @return The shared library list. |
| 3772 | * |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 3773 | * @see #MATCH_UNINSTALLED_PACKAGES |
| 3774 | */ |
| 3775 | public abstract @NonNull List<SharedLibraryInfo> getSharedLibraries( |
| 3776 | @InstallFlags int flags); |
| 3777 | |
| 3778 | /** |
| 3779 | * Get a list of shared libraries on the device. |
| 3780 | * |
| 3781 | * @param flags To filter the libraries to return. |
| 3782 | * @param userId The user to query for. |
| 3783 | * @return The shared library list. |
| 3784 | * |
| 3785 | * @see #MATCH_FACTORY_ONLY |
| 3786 | * @see #MATCH_KNOWN_PACKAGES |
| 3787 | * @see #MATCH_ANY_USER |
| 3788 | * @see #MATCH_UNINSTALLED_PACKAGES |
| 3789 | * |
| 3790 | * @hide |
| 3791 | */ |
| 3792 | public abstract @NonNull List<SharedLibraryInfo> getSharedLibrariesAsUser( |
| 3793 | @InstallFlags int flags, @UserIdInt int userId); |
| 3794 | |
| 3795 | /** |
Svet Ganov | d7b1f411 | 2016-02-09 18:49:23 -0800 | [diff] [blame] | 3796 | * Get the name of the package hosting the services shared library. |
| 3797 | * |
| 3798 | * @return The library host package. |
| 3799 | * |
| 3800 | * @hide |
| 3801 | */ |
Svetoslav Ganov | a9c2500 | 2016-04-13 19:25:56 -0700 | [diff] [blame] | 3802 | public abstract @NonNull String getServicesSystemSharedLibraryPackageName(); |
| 3803 | |
| 3804 | /** |
| 3805 | * Get the name of the package hosting the shared components shared library. |
| 3806 | * |
| 3807 | * @return The library host package. |
| 3808 | * |
| 3809 | * @hide |
| 3810 | */ |
| 3811 | public abstract @NonNull String getSharedSystemSharedLibraryPackageName(); |
Svet Ganov | d7b1f411 | 2016-02-09 18:49:23 -0800 | [diff] [blame] | 3812 | |
| 3813 | /** |
Todd Kennedy | 9106c64 | 2017-02-08 14:16:53 -0800 | [diff] [blame] | 3814 | * Returns the names of the packages that have been changed |
| 3815 | * [eg. added, removed or updated] since the given sequence |
| 3816 | * number. |
| 3817 | * <p>If no packages have been changed, returns <code>null</code>. |
| 3818 | * <p>The sequence number starts at <code>0</code> and is |
| 3819 | * reset every boot. |
Todd Kennedy | 8fddf9d | 2017-04-17 15:16:12 -0700 | [diff] [blame] | 3820 | * @param sequenceNumber The first sequence number for which to retrieve package changes. |
| 3821 | * @see Settings.Global#BOOT_COUNT |
Todd Kennedy | 9106c64 | 2017-02-08 14:16:53 -0800 | [diff] [blame] | 3822 | */ |
| 3823 | public abstract @Nullable ChangedPackages getChangedPackages( |
| 3824 | @IntRange(from=0) int sequenceNumber); |
| 3825 | |
| 3826 | /** |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 3827 | * Get a list of features that are available on the |
| 3828 | * system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3829 | * |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 3830 | * @return An array of FeatureInfo classes describing the features |
| 3831 | * that are available on the system, or null if there are none(!!). |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 3832 | */ |
| 3833 | public abstract FeatureInfo[] getSystemAvailableFeatures(); |
| 3834 | |
| 3835 | /** |
Jeff Sharkey | 115d2c1 | 2016-02-15 17:25:57 -0700 | [diff] [blame] | 3836 | * Check whether the given feature name is one of the available features as |
| 3837 | * returned by {@link #getSystemAvailableFeatures()}. This tests for the |
| 3838 | * presence of <em>any</em> version of the given feature name; use |
| 3839 | * {@link #hasSystemFeature(String, int)} to check for a minimum version. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3840 | * |
Jeff Sharkey | 115d2c1 | 2016-02-15 17:25:57 -0700 | [diff] [blame] | 3841 | * @return Returns true if the devices supports the feature, else false. |
Dianne Hackborn | 039c68e | 2009-09-26 16:39:23 -0700 | [diff] [blame] | 3842 | */ |
| 3843 | public abstract boolean hasSystemFeature(String name); |
| 3844 | |
| 3845 | /** |
Jeff Sharkey | 115d2c1 | 2016-02-15 17:25:57 -0700 | [diff] [blame] | 3846 | * Check whether the given feature name and version is one of the available |
| 3847 | * features as returned by {@link #getSystemAvailableFeatures()}. Since |
| 3848 | * features are defined to always be backwards compatible, this returns true |
| 3849 | * if the available feature version is greater than or equal to the |
| 3850 | * requested version. |
| 3851 | * |
| 3852 | * @return Returns true if the devices supports the feature, else false. |
| 3853 | */ |
| 3854 | public abstract boolean hasSystemFeature(String name, int version); |
| 3855 | |
| 3856 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3857 | * Determine the best action to perform for a given Intent. This is how |
| 3858 | * {@link Intent#resolveActivity} finds an activity if a class has not been |
| 3859 | * explicitly specified. |
| 3860 | * <p> |
| 3861 | * <em>Note:</em> if using an implicit Intent (without an explicit |
| 3862 | * ComponentName specified), be sure to consider whether to set the |
| 3863 | * {@link #MATCH_DEFAULT_ONLY} only flag. You need to do so to resolve the |
| 3864 | * activity in the same way that |
| 3865 | * {@link android.content.Context#startActivity(Intent)} and |
Dianne Hackborn | 4d023d21 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 3866 | * {@link android.content.Intent#resolveActivity(PackageManager) |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3867 | * Intent.resolveActivity(PackageManager)} do. |
| 3868 | * </p> |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3869 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3870 | * @param intent An intent containing all of the desired specification |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3871 | * (action, data, type, category, and/or component). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3872 | * @param flags Additional option flags to modify the data returned. The |
| 3873 | * most important is {@link #MATCH_DEFAULT_ONLY}, to limit the |
| 3874 | * resolution to only those activities that support the |
| 3875 | * {@link android.content.Intent#CATEGORY_DEFAULT}. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3876 | * @return Returns a ResolveInfo object containing the final activity intent |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3877 | * that was determined to be the best action. Returns null if no |
Mike LeBeau | bd3f527 | 2010-02-18 19:27:17 -0800 | [diff] [blame] | 3878 | * matching activity was found. If multiple matching activities are |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3879 | * found and there is no default set, returns a ResolveInfo object |
Mike LeBeau | bd3f527 | 2010-02-18 19:27:17 -0800 | [diff] [blame] | 3880 | * containing something else, such as the activity resolver. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3881 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3882 | public abstract ResolveInfo resolveActivity(Intent intent, @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3883 | |
| 3884 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3885 | * Determine the best action to perform for a given Intent for a given user. |
| 3886 | * This is how {@link Intent#resolveActivity} finds an activity if a class |
| 3887 | * has not been explicitly specified. |
| 3888 | * <p> |
| 3889 | * <em>Note:</em> if using an implicit Intent (without an explicit |
| 3890 | * ComponentName specified), be sure to consider whether to set the |
| 3891 | * {@link #MATCH_DEFAULT_ONLY} only flag. You need to do so to resolve the |
| 3892 | * activity in the same way that |
| 3893 | * {@link android.content.Context#startActivity(Intent)} and |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3894 | * {@link android.content.Intent#resolveActivity(PackageManager) |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3895 | * Intent.resolveActivity(PackageManager)} do. |
| 3896 | * </p> |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3897 | * |
| 3898 | * @param intent An intent containing all of the desired specification |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3899 | * (action, data, type, category, and/or component). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3900 | * @param flags Additional option flags to modify the data returned. The |
| 3901 | * most important is {@link #MATCH_DEFAULT_ONLY}, to limit the |
| 3902 | * resolution to only those activities that support the |
| 3903 | * {@link android.content.Intent#CATEGORY_DEFAULT}. |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3904 | * @param userId The user id. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3905 | * @return Returns a ResolveInfo object containing the final activity intent |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3906 | * that was determined to be the best action. Returns null if no |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3907 | * matching activity was found. If multiple matching activities are |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3908 | * found and there is no default set, returns a ResolveInfo object |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3909 | * containing something else, such as the activity resolver. |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3910 | * @hide |
| 3911 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3912 | public abstract ResolveInfo resolveActivityAsUser(Intent intent, @ResolveInfoFlags int flags, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3913 | @UserIdInt int userId); |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3914 | |
| 3915 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3916 | * Retrieve all activities that can be performed for the given intent. |
| 3917 | * |
| 3918 | * @param intent The desired intent as per resolveActivity(). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3919 | * @param flags Additional option flags to modify the data returned. The |
| 3920 | * most important is {@link #MATCH_DEFAULT_ONLY}, to limit the |
| 3921 | * resolution to only those activities that support the |
| 3922 | * {@link android.content.Intent#CATEGORY_DEFAULT}. Or, set |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3923 | * {@link #MATCH_ALL} to prevent any filtering of the results. |
| 3924 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3925 | * each matching activity, ordered from best to worst. In other |
| 3926 | * words, the first item is what would be returned by |
| 3927 | * {@link #resolveActivity}. If there are no matching activities, an |
| 3928 | * empty list is returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3929 | */ |
| 3930 | public abstract List<ResolveInfo> queryIntentActivities(Intent intent, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3931 | @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3932 | |
| 3933 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3934 | * Retrieve all activities that can be performed for the given intent, for a |
| 3935 | * specific user. |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3936 | * |
| 3937 | * @param intent The desired intent as per resolveActivity(). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3938 | * @param flags Additional option flags to modify the data returned. The |
| 3939 | * most important is {@link #MATCH_DEFAULT_ONLY}, to limit the |
| 3940 | * resolution to only those activities that support the |
| 3941 | * {@link android.content.Intent#CATEGORY_DEFAULT}. Or, set |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3942 | * {@link #MATCH_ALL} to prevent any filtering of the results. |
| 3943 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3944 | * each matching activity, ordered from best to worst. In other |
| 3945 | * words, the first item is what would be returned by |
| 3946 | * {@link #resolveActivity}. If there are no matching activities, an |
| 3947 | * empty list is returned. |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3948 | * @hide |
| 3949 | */ |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3950 | public abstract List<ResolveInfo> queryIntentActivitiesAsUser(Intent intent, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3951 | @ResolveInfoFlags int flags, @UserIdInt int userId); |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3952 | |
| 3953 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3954 | * 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] | 3955 | * similar options. This is like {@link #queryIntentActivities}, except it |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3956 | * also allows you to supply a list of more explicit Intents that you would |
| 3957 | * like to resolve to particular options, and takes care of returning the |
| 3958 | * final ResolveInfo list in a reasonable order, with no duplicates, based |
| 3959 | * on those inputs. |
| 3960 | * |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3961 | * @param caller The class name of the activity that is making the request. |
| 3962 | * This activity will never appear in the output list. Can be |
| 3963 | * null. |
| 3964 | * @param specifics An array of Intents that should be resolved to the first |
| 3965 | * specific results. Can be null. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3966 | * @param intent The desired intent as per resolveActivity(). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3967 | * @param flags Additional option flags to modify the data returned. The |
| 3968 | * most important is {@link #MATCH_DEFAULT_ONLY}, to limit the |
| 3969 | * resolution to only those activities that support the |
| 3970 | * {@link android.content.Intent#CATEGORY_DEFAULT}. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3971 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3972 | * each matching activity. The list is ordered first by all of the |
| 3973 | * intents resolved in <var>specifics</var> and then any additional |
| 3974 | * activities that can handle <var>intent</var> but did not get |
| 3975 | * included by one of the <var>specifics</var> intents. If there are |
| 3976 | * no matching activities, an empty list is returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3977 | */ |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 3978 | public abstract List<ResolveInfo> queryIntentActivityOptions(@Nullable ComponentName caller, |
| 3979 | @Nullable Intent[] specifics, Intent intent, @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3980 | |
| 3981 | /** |
| 3982 | * Retrieve all receivers that can handle a broadcast of the given intent. |
| 3983 | * |
| 3984 | * @param intent The desired intent as per resolveActivity(). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3985 | * @param flags Additional option flags to modify the data returned. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3986 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3987 | * each matching receiver, ordered from best to worst. If there are |
| 3988 | * 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] | 3989 | */ |
| 3990 | public abstract List<ResolveInfo> queryBroadcastReceivers(Intent intent, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3991 | @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3992 | |
| 3993 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3994 | * Retrieve all receivers that can handle a broadcast of the given intent, |
| 3995 | * for a specific user. |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3996 | * |
| 3997 | * @param intent The desired intent as per resolveActivity(). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 3998 | * @param flags Additional option flags to modify the data returned. |
Fyodor Kupolov | 940e857 | 2016-01-26 12:03:51 -0800 | [diff] [blame] | 3999 | * @param userHandle UserHandle of the user being queried. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4000 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4001 | * each matching receiver, ordered from best to worst. If there are |
| 4002 | * no matching receivers, an empty list or null is returned. |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 4003 | * @hide |
| 4004 | */ |
Fyodor Kupolov | 940e857 | 2016-01-26 12:03:51 -0800 | [diff] [blame] | 4005 | @SystemApi |
| 4006 | public List<ResolveInfo> queryBroadcastReceiversAsUser(Intent intent, |
| 4007 | @ResolveInfoFlags int flags, UserHandle userHandle) { |
| 4008 | return queryBroadcastReceiversAsUser(intent, flags, userHandle.getIdentifier()); |
| 4009 | } |
| 4010 | |
| 4011 | /** |
| 4012 | * @hide |
| 4013 | */ |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 4014 | public abstract List<ResolveInfo> queryBroadcastReceiversAsUser(Intent intent, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4015 | @ResolveInfoFlags int flags, @UserIdInt int userId); |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 4016 | |
Fyodor Kupolov | 940e857 | 2016-01-26 12:03:51 -0800 | [diff] [blame] | 4017 | |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 4018 | /** {@hide} */ |
| 4019 | @Deprecated |
| 4020 | public List<ResolveInfo> queryBroadcastReceivers(Intent intent, |
| 4021 | @ResolveInfoFlags int flags, @UserIdInt int userId) { |
Jeff Sharkey | 6f4b2a3 | 2017-03-21 14:13:41 -0600 | [diff] [blame] | 4022 | final String msg = "Shame on you for calling the hidden API " |
| 4023 | + "queryBroadcastReceivers(). Shame!"; |
| 4024 | if (VMRuntime.getRuntime().getTargetSdkVersion() >= Build.VERSION_CODES.O) { |
| 4025 | throw new UnsupportedOperationException(msg); |
| 4026 | } else { |
| 4027 | Log.d(TAG, msg); |
| 4028 | return queryBroadcastReceiversAsUser(intent, flags, userId); |
| 4029 | } |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 4030 | } |
| 4031 | |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 4032 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4033 | * Determine the best service to handle for a given Intent. |
| 4034 | * |
| 4035 | * @param intent An intent containing all of the desired specification |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4036 | * (action, data, type, category, and/or component). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4037 | * @param flags Additional option flags to modify the data returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4038 | * @return Returns a ResolveInfo object containing the final service intent |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4039 | * 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] | 4040 | * matching service was found. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4041 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4042 | public abstract ResolveInfo resolveService(Intent intent, @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4043 | |
| 4044 | /** |
| 4045 | * Retrieve all services that can match the given intent. |
| 4046 | * |
| 4047 | * @param intent The desired intent as per resolveService(). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4048 | * @param flags Additional option flags to modify the data returned. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4049 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4050 | * each matching service, ordered from best to worst. In other |
| 4051 | * words, the first item is what would be returned by |
| 4052 | * {@link #resolveService}. If there are no matching services, an |
| 4053 | * empty list or null is returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4054 | */ |
| 4055 | public abstract List<ResolveInfo> queryIntentServices(Intent intent, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4056 | @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4057 | |
| 4058 | /** |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4059 | * Retrieve all services that can match the given intent for a given user. |
| 4060 | * |
| 4061 | * @param intent The desired intent as per resolveService(). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4062 | * @param flags Additional option flags to modify the data returned. |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4063 | * @param userId The user id. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4064 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4065 | * each matching service, ordered from best to worst. In other |
| 4066 | * words, the first item is what would be returned by |
| 4067 | * {@link #resolveService}. If there are no matching services, an |
| 4068 | * empty list or null is returned. |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4069 | * @hide |
| 4070 | */ |
| 4071 | public abstract List<ResolveInfo> queryIntentServicesAsUser(Intent intent, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4072 | @ResolveInfoFlags int flags, @UserIdInt int userId); |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4073 | |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4074 | /** |
| 4075 | * Retrieve all providers that can match the given intent. |
| 4076 | * |
| 4077 | * @param intent An intent containing all of the desired specification |
| 4078 | * (action, data, type, category, and/or component). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4079 | * @param flags Additional option flags to modify the data returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4080 | * @param userId The user id. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4081 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4082 | * each matching provider, ordered from best to worst. If there are |
| 4083 | * no matching services, an empty list or null is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4084 | * @hide |
| 4085 | */ |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 4086 | public abstract List<ResolveInfo> queryIntentContentProvidersAsUser( |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4087 | Intent intent, @ResolveInfoFlags int flags, @UserIdInt int userId); |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 4088 | |
| 4089 | /** |
| 4090 | * Retrieve all providers that can match the given intent. |
| 4091 | * |
| 4092 | * @param intent An intent containing all of the desired specification |
| 4093 | * (action, data, type, category, and/or component). |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4094 | * @param flags Additional option flags to modify the data returned. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4095 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4096 | * each matching provider, ordered from best to worst. If there are |
| 4097 | * no matching services, an empty list or null is returned. |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 4098 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4099 | public abstract List<ResolveInfo> queryIntentContentProviders(Intent intent, |
| 4100 | @ResolveInfoFlags int flags); |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 4101 | |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4102 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4103 | * Find a single content provider by its base path name. |
| 4104 | * |
| 4105 | * @param name The name of the provider to find. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4106 | * @param flags Additional option flags to modify the data returned. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4107 | * @return A {@link ProviderInfo} object containing information about the |
| 4108 | * provider. If a provider was not found, returns null. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4109 | */ |
| 4110 | public abstract ProviderInfo resolveContentProvider(String name, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4111 | @ComponentInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4112 | |
| 4113 | /** |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4114 | * Find a single content provider by its base path name. |
| 4115 | * |
| 4116 | * @param name The name of the provider to find. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4117 | * @param flags Additional option flags to modify the data returned. |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4118 | * @param userId The user id. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4119 | * @return A {@link ProviderInfo} object containing information about the |
| 4120 | * provider. If a provider was not found, returns null. |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4121 | * @hide |
| 4122 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4123 | public abstract ProviderInfo resolveContentProviderAsUser(String name, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4124 | @ComponentInfoFlags int flags, @UserIdInt int userId); |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4125 | |
| 4126 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4127 | * Retrieve content provider information. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4128 | * <p> |
| 4129 | * <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] | 4130 | * by a null return instead of an empty list.</em> |
| 4131 | * |
| 4132 | * @param processName If non-null, limits the returned providers to only |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4133 | * those that are hosted by the given process. If null, all |
| 4134 | * content providers are returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4135 | * @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] | 4136 | * uid owning the requested content providers. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4137 | * @param flags Additional option flags to modify the data returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4138 | * @return A list of {@link ProviderInfo} objects containing one entry for |
| 4139 | * each provider either matching <var>processName</var> or, if |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4140 | * <var>processName</var> is null, all known content providers. |
| 4141 | * <em>If there are no matching providers, null is returned.</em> |
| 4142 | */ |
| 4143 | public abstract List<ProviderInfo> queryContentProviders( |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4144 | String processName, int uid, @ComponentInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4145 | |
| 4146 | /** |
Makoto Onuki | 3275729 | 2017-02-22 14:36:59 -0800 | [diff] [blame] | 4147 | * Same as {@link #queryContentProviders}, except when {@code metaDataKey} is not null, |
| 4148 | * it only returns providers which have metadata with the {@code metaDataKey} key. |
| 4149 | * |
| 4150 | * <p>DO NOT USE the {@code metaDataKey} parameter, unless you're the contacts provider. |
| 4151 | * You really shouldn't need it. Other apps should use {@link #queryIntentContentProviders} |
| 4152 | * instead. |
| 4153 | * |
| 4154 | * <p>The {@code metaDataKey} parameter was added to allow the contacts provider to quickly |
| 4155 | * scan the GAL providers on the device. Unfortunately the discovery protocol used metadata |
| 4156 | * to mark GAL providers, rather than intent filters, so we can't use |
| 4157 | * {@link #queryIntentContentProviders} for that. |
| 4158 | * |
| 4159 | * @hide |
| 4160 | */ |
| 4161 | public List<ProviderInfo> queryContentProviders( |
| 4162 | String processName, int uid, @ComponentInfoFlags int flags, String metaDataKey) { |
| 4163 | // Provide the default implementation for mocks. |
| 4164 | return queryContentProviders(processName, uid, flags); |
| 4165 | } |
| 4166 | |
| 4167 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4168 | * Retrieve all of the information we know about a particular |
| 4169 | * instrumentation class. |
| 4170 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4171 | * @param className The full name (i.e. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4172 | * com.google.apps.contacts.InstrumentList) of an Instrumentation |
| 4173 | * class. |
| 4174 | * @param flags Additional option flags to modify the data returned. |
| 4175 | * @return An {@link InstrumentationInfo} object containing information |
| 4176 | * about the instrumentation. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4177 | * @throws NameNotFoundException if a package with the given name cannot be |
| 4178 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4179 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4180 | public abstract InstrumentationInfo getInstrumentationInfo(ComponentName className, |
| 4181 | @InstrumentationInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4182 | |
| 4183 | /** |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4184 | * Retrieve information about available instrumentation code. May be used to |
| 4185 | * retrieve either all instrumentation code, or only the code targeting a |
| 4186 | * particular package. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4187 | * |
| 4188 | * @param targetPackage If null, all instrumentation is returned; only the |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4189 | * instrumentation targeting this package name is returned. |
| 4190 | * @param flags Additional option flags to modify the data returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4191 | * @return A list of {@link InstrumentationInfo} objects containing one |
| 4192 | * entry for each matching instrumentation. If there are no |
Jesse Hall | f77a34f | 2016-02-04 18:41:33 -0800 | [diff] [blame] | 4193 | * instrumentation available, returns an empty list. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4194 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4195 | public abstract List<InstrumentationInfo> queryInstrumentation(String targetPackage, |
| 4196 | @InstrumentationInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4197 | |
| 4198 | /** |
| 4199 | * Retrieve an image from a package. This is a low-level API used by |
| 4200 | * the various package manager info structures (such as |
| 4201 | * {@link ComponentInfo} to implement retrieval of their associated |
| 4202 | * icon. |
| 4203 | * |
| 4204 | * @param packageName The name of the package that this icon is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4205 | * Cannot be null. |
| 4206 | * @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] | 4207 | * @param appInfo Overall information about <var>packageName</var>. This |
| 4208 | * may be null, in which case the application information will be retrieved |
| 4209 | * for you if needed; if you already have this information around, it can |
| 4210 | * be much more efficient to supply it here. |
| 4211 | * |
| 4212 | * @return Returns a Drawable holding the requested image. Returns null if |
| 4213 | * an image could not be found for any reason. |
| 4214 | */ |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 4215 | public abstract Drawable getDrawable(String packageName, @DrawableRes int resid, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4216 | ApplicationInfo appInfo); |
| 4217 | |
| 4218 | /** |
| 4219 | * Retrieve the icon associated with an activity. Given the full name of |
| 4220 | * an activity, retrieves the information about it and calls |
| 4221 | * {@link ComponentInfo#loadIcon ComponentInfo.loadIcon()} to return its icon. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4222 | * If the activity cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4223 | * |
| 4224 | * @param activityName Name of the activity whose icon is to be retrieved. |
| 4225 | * |
| 4226 | * @return Returns the image of the icon, or the default activity icon if |
| 4227 | * it could not be found. Does not return null. |
| 4228 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4229 | * activity could not be loaded. |
| 4230 | * |
| 4231 | * @see #getActivityIcon(Intent) |
| 4232 | */ |
| 4233 | public abstract Drawable getActivityIcon(ComponentName activityName) |
| 4234 | throws NameNotFoundException; |
| 4235 | |
| 4236 | /** |
| 4237 | * Retrieve the icon associated with an Intent. If intent.getClassName() is |
| 4238 | * set, this simply returns the result of |
| 4239 | * getActivityIcon(intent.getClassName()). Otherwise it resolves the intent's |
| 4240 | * component and returns the icon associated with the resolved component. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4241 | * 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] | 4242 | * to a component, NameNotFoundException is thrown. |
| 4243 | * |
| 4244 | * @param intent The intent for which you would like to retrieve an icon. |
| 4245 | * |
| 4246 | * @return Returns the image of the icon, or the default activity icon if |
| 4247 | * it could not be found. Does not return null. |
| 4248 | * @throws NameNotFoundException Thrown if the resources for application |
| 4249 | * matching the given intent could not be loaded. |
| 4250 | * |
| 4251 | * @see #getActivityIcon(ComponentName) |
| 4252 | */ |
| 4253 | public abstract Drawable getActivityIcon(Intent intent) |
| 4254 | throws NameNotFoundException; |
| 4255 | |
| 4256 | /** |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4257 | * Retrieve the banner associated with an activity. Given the full name of |
| 4258 | * an activity, retrieves the information about it and calls |
| 4259 | * {@link ComponentInfo#loadIcon ComponentInfo.loadIcon()} to return its |
| 4260 | * banner. If the activity cannot be found, NameNotFoundException is thrown. |
| 4261 | * |
| 4262 | * @param activityName Name of the activity whose banner is to be retrieved. |
| 4263 | * @return Returns the image of the banner, or null if the activity has no |
| 4264 | * banner specified. |
| 4265 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4266 | * activity could not be loaded. |
| 4267 | * @see #getActivityBanner(Intent) |
| 4268 | */ |
| 4269 | public abstract Drawable getActivityBanner(ComponentName activityName) |
| 4270 | throws NameNotFoundException; |
| 4271 | |
| 4272 | /** |
| 4273 | * Retrieve the banner associated with an Intent. If intent.getClassName() |
| 4274 | * is set, this simply returns the result of |
| 4275 | * getActivityBanner(intent.getClassName()). Otherwise it resolves the |
| 4276 | * intent's component and returns the banner associated with the resolved |
| 4277 | * component. If intent.getClassName() cannot be found or the Intent cannot |
| 4278 | * be resolved to a component, NameNotFoundException is thrown. |
| 4279 | * |
| 4280 | * @param intent The intent for which you would like to retrieve a banner. |
| 4281 | * @return Returns the image of the banner, or null if the activity has no |
| 4282 | * banner specified. |
| 4283 | * @throws NameNotFoundException Thrown if the resources for application |
| 4284 | * matching the given intent could not be loaded. |
| 4285 | * @see #getActivityBanner(ComponentName) |
| 4286 | */ |
| 4287 | public abstract Drawable getActivityBanner(Intent intent) |
| 4288 | throws NameNotFoundException; |
| 4289 | |
| 4290 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4291 | * Return the generic icon for an activity that is used when no specific |
| 4292 | * icon is defined. |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 4293 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4294 | * @return Drawable Image of the icon. |
| 4295 | */ |
| 4296 | public abstract Drawable getDefaultActivityIcon(); |
| 4297 | |
| 4298 | /** |
| 4299 | * Retrieve the icon associated with an application. If it has not defined |
| 4300 | * an icon, the default app icon is returned. Does not return null. |
| 4301 | * |
| 4302 | * @param info Information about application being queried. |
| 4303 | * |
| 4304 | * @return Returns the image of the icon, or the default application icon |
| 4305 | * if it could not be found. |
| 4306 | * |
| 4307 | * @see #getApplicationIcon(String) |
| 4308 | */ |
| 4309 | public abstract Drawable getApplicationIcon(ApplicationInfo info); |
| 4310 | |
| 4311 | /** |
| 4312 | * Retrieve the icon associated with an application. Given the name of the |
| 4313 | * application's package, retrieves the information about it and calls |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4314 | * 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] | 4315 | * found, NameNotFoundException is thrown. |
| 4316 | * |
| 4317 | * @param packageName Name of the package whose application icon is to be |
| 4318 | * retrieved. |
| 4319 | * |
| 4320 | * @return Returns the image of the icon, or the default application icon |
| 4321 | * if it could not be found. Does not return null. |
| 4322 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4323 | * application could not be loaded. |
| 4324 | * |
| 4325 | * @see #getApplicationIcon(ApplicationInfo) |
| 4326 | */ |
| 4327 | public abstract Drawable getApplicationIcon(String packageName) |
| 4328 | throws NameNotFoundException; |
| 4329 | |
| 4330 | /** |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4331 | * Retrieve the banner associated with an application. |
| 4332 | * |
| 4333 | * @param info Information about application being queried. |
| 4334 | * @return Returns the image of the banner or null if the application has no |
| 4335 | * banner specified. |
| 4336 | * @see #getApplicationBanner(String) |
| 4337 | */ |
| 4338 | public abstract Drawable getApplicationBanner(ApplicationInfo info); |
| 4339 | |
| 4340 | /** |
| 4341 | * Retrieve the banner associated with an application. Given the name of the |
| 4342 | * application's package, retrieves the information about it and calls |
| 4343 | * getApplicationIcon() to return its banner. If the application cannot be |
| 4344 | * found, NameNotFoundException is thrown. |
| 4345 | * |
| 4346 | * @param packageName Name of the package whose application banner is to be |
| 4347 | * retrieved. |
| 4348 | * @return Returns the image of the banner or null if the application has no |
| 4349 | * banner specified. |
| 4350 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4351 | * application could not be loaded. |
| 4352 | * @see #getApplicationBanner(ApplicationInfo) |
| 4353 | */ |
| 4354 | public abstract Drawable getApplicationBanner(String packageName) |
| 4355 | throws NameNotFoundException; |
| 4356 | |
| 4357 | /** |
| 4358 | * Retrieve the logo associated with an activity. Given the full name of an |
| 4359 | * activity, retrieves the information about it and calls |
| 4360 | * {@link ComponentInfo#loadLogo ComponentInfo.loadLogo()} to return its |
| 4361 | * logo. If the activity cannot be found, NameNotFoundException is thrown. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4362 | * |
| 4363 | * @param activityName Name of the activity whose logo is to be retrieved. |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4364 | * @return Returns the image of the logo or null if the activity has no logo |
| 4365 | * specified. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4366 | * @throws NameNotFoundException Thrown if the resources for the given |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4367 | * activity could not be loaded. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4368 | * @see #getActivityLogo(Intent) |
| 4369 | */ |
| 4370 | public abstract Drawable getActivityLogo(ComponentName activityName) |
| 4371 | throws NameNotFoundException; |
| 4372 | |
| 4373 | /** |
| 4374 | * Retrieve the logo associated with an Intent. If intent.getClassName() is |
| 4375 | * set, this simply returns the result of |
| 4376 | * getActivityLogo(intent.getClassName()). Otherwise it resolves the intent's |
| 4377 | * component and returns the logo associated with the resolved component. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4378 | * If intent.getClassName() cannot be found or the Intent cannot be resolved |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4379 | * to a component, NameNotFoundException is thrown. |
| 4380 | * |
| 4381 | * @param intent The intent for which you would like to retrieve a logo. |
| 4382 | * |
| 4383 | * @return Returns the image of the logo, or null if the activity has no |
| 4384 | * logo specified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4385 | * |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4386 | * @throws NameNotFoundException Thrown if the resources for application |
| 4387 | * matching the given intent could not be loaded. |
| 4388 | * |
| 4389 | * @see #getActivityLogo(ComponentName) |
| 4390 | */ |
| 4391 | public abstract Drawable getActivityLogo(Intent intent) |
| 4392 | throws NameNotFoundException; |
| 4393 | |
| 4394 | /** |
| 4395 | * Retrieve the logo associated with an application. If it has not specified |
| 4396 | * a logo, this method returns null. |
| 4397 | * |
| 4398 | * @param info Information about application being queried. |
| 4399 | * |
| 4400 | * @return Returns the image of the logo, or null if no logo is specified |
| 4401 | * by the application. |
| 4402 | * |
| 4403 | * @see #getApplicationLogo(String) |
| 4404 | */ |
| 4405 | public abstract Drawable getApplicationLogo(ApplicationInfo info); |
| 4406 | |
| 4407 | /** |
| 4408 | * Retrieve the logo associated with an application. Given the name of the |
| 4409 | * application's package, retrieves the information about it and calls |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4410 | * getApplicationLogo() to return its logo. If the application cannot be |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4411 | * found, NameNotFoundException is thrown. |
| 4412 | * |
| 4413 | * @param packageName Name of the package whose application logo is to be |
| 4414 | * retrieved. |
| 4415 | * |
| 4416 | * @return Returns the image of the logo, or null if no application logo |
| 4417 | * has been specified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4418 | * |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4419 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4420 | * application could not be loaded. |
| 4421 | * |
| 4422 | * @see #getApplicationLogo(ApplicationInfo) |
| 4423 | */ |
| 4424 | public abstract Drawable getApplicationLogo(String packageName) |
| 4425 | throws NameNotFoundException; |
| 4426 | |
| 4427 | /** |
Tony Mak | 4dc008c | 2016-03-16 10:46:49 +0000 | [diff] [blame] | 4428 | * If the target user is a managed profile, then this returns a badged copy of the given icon |
| 4429 | * 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] | 4430 | * {@link #getUserBadgedDrawableForDensity( |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4431 | * android.graphics.drawable.Drawable, UserHandle, android.graphics.Rect, int)}. |
| 4432 | * <p> |
| 4433 | * If the original drawable is a BitmapDrawable and the backing bitmap is |
| 4434 | * mutable as per {@link android.graphics.Bitmap#isMutable()}, the badging |
| 4435 | * is performed in place and the original drawable is returned. |
| 4436 | * </p> |
| 4437 | * |
| 4438 | * @param icon The icon to badge. |
| 4439 | * @param user The target user. |
| 4440 | * @return A drawable that combines the original icon and a badge as |
| 4441 | * determined by the system. |
| 4442 | */ |
| 4443 | public abstract Drawable getUserBadgedIcon(Drawable icon, UserHandle user); |
| 4444 | |
| 4445 | /** |
| 4446 | * If the target user is a managed profile of the calling user or the caller |
| 4447 | * is itself a managed profile, then this returns a badged copy of the given |
| 4448 | * drawable allowing the user to distinguish it from the original drawable. |
| 4449 | * The caller can specify the location in the bounds of the drawable to be |
| 4450 | * badged where the badge should be applied as well as the density of the |
| 4451 | * badge to be used. |
| 4452 | * <p> |
| 4453 | * If the original drawable is a BitmapDrawable and the backing bitmap is |
Vadim Tryshev | 66ae66a | 2016-02-18 15:41:21 -0800 | [diff] [blame] | 4454 | * mutable as per {@link android.graphics.Bitmap#isMutable()}, the badging |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4455 | * is performed in place and the original drawable is returned. |
| 4456 | * </p> |
| 4457 | * |
| 4458 | * @param drawable The drawable to badge. |
| 4459 | * @param user The target user. |
| 4460 | * @param badgeLocation Where in the bounds of the badged drawable to place |
Vadim Tryshev | 66ae66a | 2016-02-18 15:41:21 -0800 | [diff] [blame] | 4461 | * 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] | 4462 | * drawable being badged. |
| 4463 | * @param badgeDensity The optional desired density for the badge as per |
Vadim Tryshev | 66ae66a | 2016-02-18 15:41:21 -0800 | [diff] [blame] | 4464 | * {@link android.util.DisplayMetrics#densityDpi}. If it's not positive, |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4465 | * the density of the display is used. |
| 4466 | * @return A drawable that combines the original drawable and a badge as |
| 4467 | * determined by the system. |
| 4468 | */ |
| 4469 | public abstract Drawable getUserBadgedDrawableForDensity(Drawable drawable, |
| 4470 | UserHandle user, Rect badgeLocation, int badgeDensity); |
| 4471 | |
| 4472 | /** |
| 4473 | * If the target user is a managed profile of the calling user or the caller |
| 4474 | * is itself a managed profile, then this returns a drawable to use as a small |
| 4475 | * icon to include in a view to distinguish it from the original icon. |
| 4476 | * |
| 4477 | * @param user The target user. |
| 4478 | * @param density The optional desired density for the badge as per |
| 4479 | * {@link android.util.DisplayMetrics#densityDpi}. If not provided |
| 4480 | * the density of the current display is used. |
| 4481 | * @return the drawable or null if no drawable is required. |
| 4482 | * @hide |
| 4483 | */ |
| 4484 | public abstract Drawable getUserBadgeForDensity(UserHandle user, int density); |
| 4485 | |
| 4486 | /** |
| 4487 | * 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] | 4488 | * is itself a managed profile, then this returns a drawable to use as a small |
| 4489 | * icon to include in a view to distinguish it from the original icon. This version |
| 4490 | * doesn't have background protection and should be used over a light background instead of |
| 4491 | * a badge. |
| 4492 | * |
| 4493 | * @param user The target user. |
| 4494 | * @param density The optional desired density for the badge as per |
| 4495 | * {@link android.util.DisplayMetrics#densityDpi}. If not provided |
| 4496 | * the density of the current display is used. |
| 4497 | * @return the drawable or null if no drawable is required. |
| 4498 | * @hide |
| 4499 | */ |
| 4500 | public abstract Drawable getUserBadgeForDensityNoBackground(UserHandle user, int density); |
| 4501 | |
| 4502 | /** |
| 4503 | * 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] | 4504 | * is itself a managed profile, then this returns a copy of the label with |
| 4505 | * badging for accessibility services like talkback. E.g. passing in "Email" |
| 4506 | * and it might return "Work Email" for Email in the work profile. |
| 4507 | * |
| 4508 | * @param label The label to change. |
| 4509 | * @param user The target user. |
| 4510 | * @return A label that combines the original label and a badge as |
| 4511 | * determined by the system. |
| 4512 | */ |
| 4513 | public abstract CharSequence getUserBadgedLabel(CharSequence label, UserHandle user); |
| 4514 | |
| 4515 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4516 | * Retrieve text from a package. This is a low-level API used by |
| 4517 | * the various package manager info structures (such as |
| 4518 | * {@link ComponentInfo} to implement retrieval of their associated |
| 4519 | * labels and other text. |
| 4520 | * |
| 4521 | * @param packageName The name of the package that this text is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4522 | * Cannot be null. |
| 4523 | * @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] | 4524 | * @param appInfo Overall information about <var>packageName</var>. This |
| 4525 | * may be null, in which case the application information will be retrieved |
| 4526 | * for you if needed; if you already have this information around, it can |
| 4527 | * be much more efficient to supply it here. |
| 4528 | * |
| 4529 | * @return Returns a CharSequence holding the requested text. Returns null |
| 4530 | * if the text could not be found for any reason. |
| 4531 | */ |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 4532 | public abstract CharSequence getText(String packageName, @StringRes int resid, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4533 | ApplicationInfo appInfo); |
| 4534 | |
| 4535 | /** |
| 4536 | * Retrieve an XML file from a package. This is a low-level API used to |
| 4537 | * retrieve XML meta data. |
| 4538 | * |
| 4539 | * @param packageName The name of the package that this xml is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4540 | * Cannot be null. |
| 4541 | * @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] | 4542 | * @param appInfo Overall information about <var>packageName</var>. This |
| 4543 | * may be null, in which case the application information will be retrieved |
| 4544 | * for you if needed; if you already have this information around, it can |
| 4545 | * be much more efficient to supply it here. |
| 4546 | * |
| 4547 | * @return Returns an XmlPullParser allowing you to parse out the XML |
| 4548 | * data. Returns null if the xml resource could not be found for any |
| 4549 | * reason. |
| 4550 | */ |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 4551 | public abstract XmlResourceParser getXml(String packageName, @XmlRes int resid, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4552 | ApplicationInfo appInfo); |
| 4553 | |
| 4554 | /** |
| 4555 | * Return the label to use for this application. |
| 4556 | * |
| 4557 | * @return Returns the label associated with this application, or null if |
| 4558 | * it could not be found for any reason. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4559 | * @param info The application to get the label of. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4560 | */ |
| 4561 | public abstract CharSequence getApplicationLabel(ApplicationInfo info); |
| 4562 | |
| 4563 | /** |
| 4564 | * Retrieve the resources associated with an activity. Given the full |
| 4565 | * name of an activity, retrieves the information about it and calls |
| 4566 | * getResources() to return its application's resources. If the activity |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4567 | * cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4568 | * |
| 4569 | * @param activityName Name of the activity whose resources are to be |
| 4570 | * retrieved. |
| 4571 | * |
| 4572 | * @return Returns the application's Resources. |
| 4573 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4574 | * application could not be loaded. |
| 4575 | * |
| 4576 | * @see #getResourcesForApplication(ApplicationInfo) |
| 4577 | */ |
| 4578 | public abstract Resources getResourcesForActivity(ComponentName activityName) |
| 4579 | throws NameNotFoundException; |
| 4580 | |
| 4581 | /** |
| 4582 | * Retrieve the resources for an application. Throws NameNotFoundException |
| 4583 | * if the package is no longer installed. |
| 4584 | * |
| 4585 | * @param app Information about the desired application. |
| 4586 | * |
| 4587 | * @return Returns the application's Resources. |
| 4588 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4589 | * application could not be loaded (most likely because it was uninstalled). |
| 4590 | */ |
| 4591 | public abstract Resources getResourcesForApplication(ApplicationInfo app) |
| 4592 | throws NameNotFoundException; |
| 4593 | |
| 4594 | /** |
| 4595 | * Retrieve the resources associated with an application. Given the full |
| 4596 | * package name of an application, retrieves the information about it and |
| 4597 | * calls getResources() to return its application's resources. If the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4598 | * appPackageName cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4599 | * |
| 4600 | * @param appPackageName Package name of the application whose resources |
| 4601 | * are to be retrieved. |
| 4602 | * |
| 4603 | * @return Returns the application's Resources. |
| 4604 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4605 | * application could not be loaded. |
| 4606 | * |
| 4607 | * @see #getResourcesForApplication(ApplicationInfo) |
| 4608 | */ |
| 4609 | public abstract Resources getResourcesForApplication(String appPackageName) |
| 4610 | throws NameNotFoundException; |
| 4611 | |
Amith Yamasani | 98edc95 | 2012-09-25 14:09:27 -0700 | [diff] [blame] | 4612 | /** @hide */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4613 | public abstract Resources getResourcesForApplicationAsUser(String appPackageName, |
| 4614 | @UserIdInt int userId) throws NameNotFoundException; |
Amith Yamasani | 98edc95 | 2012-09-25 14:09:27 -0700 | [diff] [blame] | 4615 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4616 | /** |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4617 | * Retrieve overall information about an application package defined in a |
| 4618 | * package archive file |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4619 | * |
| 4620 | * @param archiveFilePath The path to the archive file |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 4621 | * @param flags Additional option flags to modify the data returned. |
| 4622 | * @return A PackageInfo object containing information about the package |
| 4623 | * 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] | 4624 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4625 | public PackageInfo getPackageArchiveInfo(String archiveFilePath, @PackageInfoFlags int flags) { |
Jeff Sharkey | 275e085 | 2014-06-17 18:18:49 -0700 | [diff] [blame] | 4626 | final PackageParser parser = new PackageParser(); |
Dianne Hackborn | cd154e9 | 2017-02-28 17:37:35 -0800 | [diff] [blame] | 4627 | parser.setCallback(new PackageParser.CallbackImpl(this)); |
Jeff Sharkey | 275e085 | 2014-06-17 18:18:49 -0700 | [diff] [blame] | 4628 | final File apkFile = new File(archiveFilePath); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 4629 | try { |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4630 | if ((flags & (MATCH_DIRECT_BOOT_UNAWARE | MATCH_DIRECT_BOOT_AWARE)) != 0) { |
Jeff Sharkey | c313251 | 2016-01-12 14:06:58 -0700 | [diff] [blame] | 4631 | // Caller expressed an explicit opinion about what encryption |
| 4632 | // aware/unaware components they want to see, so fall through and |
| 4633 | // give them what they want |
| 4634 | } else { |
| 4635 | // Caller expressed no opinion, so match everything |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4636 | flags |= MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE; |
Jeff Sharkey | c313251 | 2016-01-12 14:06:58 -0700 | [diff] [blame] | 4637 | } |
| 4638 | |
Jeff Sharkey | 275e085 | 2014-06-17 18:18:49 -0700 | [diff] [blame] | 4639 | PackageParser.Package pkg = parser.parseMonolithicPackage(apkFile, 0); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 4640 | if ((flags & GET_SIGNATURES) != 0) { |
Svet Ganov | 354cd3c | 2015-12-17 11:35:04 -0800 | [diff] [blame] | 4641 | PackageParser.collectCertificates(pkg, 0); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 4642 | } |
| 4643 | PackageUserState state = new PackageUserState(); |
| 4644 | return PackageParser.generatePackageInfo(pkg, null, flags, 0, 0, null, state); |
| 4645 | } catch (PackageParserException e) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4646 | return null; |
| 4647 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4648 | } |
| 4649 | |
| 4650 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4651 | * @deprecated replaced by {@link PackageInstaller} |
| 4652 | * @hide |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4653 | */ |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4654 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4655 | public abstract void installPackage( |
Todd Kennedy | a679323 | 2016-02-24 22:46:00 +0000 | [diff] [blame] | 4656 | Uri packageURI, |
| 4657 | IPackageInstallObserver observer, |
| 4658 | @InstallFlags int flags, |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4659 | String installerPackageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4660 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4661 | * @deprecated replaced by {@link PackageInstaller} |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4662 | * @hide |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4663 | */ |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4664 | @Deprecated |
Todd Kennedy | a679323 | 2016-02-24 22:46:00 +0000 | [diff] [blame] | 4665 | public abstract void installPackage( |
| 4666 | Uri packageURI, |
| 4667 | PackageInstallObserver observer, |
| 4668 | @InstallFlags int flags, |
| 4669 | String installerPackageName); |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4670 | |
rich cannings | 706e8ba | 2012-08-20 13:20:14 -0700 | [diff] [blame] | 4671 | /** |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4672 | * If there is already an application with the given package name installed |
| 4673 | * on the system for other users, also install it for the calling user. |
| 4674 | * @hide |
| 4675 | */ |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4676 | public abstract int installExistingPackage(String packageName) throws NameNotFoundException; |
| 4677 | |
| 4678 | /** |
| 4679 | * If there is already an application with the given package name installed |
Sunny Goyal | a31a74b | 2017-05-11 15:59:19 -0700 | [diff] [blame] | 4680 | * on the system for other users, also install it for the calling user. |
| 4681 | * @hide |
| 4682 | */ |
| 4683 | public abstract int installExistingPackage(String packageName, @InstallReason int installReason) |
| 4684 | throws NameNotFoundException; |
| 4685 | |
| 4686 | /** |
| 4687 | * If there is already an application with the given package name installed |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4688 | * on the system for other users, also install it for the specified user. |
| 4689 | * @hide |
| 4690 | */ |
| 4691 | @RequiresPermission(anyOf = { |
| 4692 | Manifest.permission.INSTALL_PACKAGES, |
| 4693 | Manifest.permission.INTERACT_ACROSS_USERS_FULL}) |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4694 | public abstract int installExistingPackageAsUser(String packageName, @UserIdInt int userId) |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4695 | throws NameNotFoundException; |
| 4696 | |
| 4697 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4698 | * Allows a package listening to the |
| 4699 | * {@link Intent#ACTION_PACKAGE_NEEDS_VERIFICATION package verification |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 4700 | * broadcast} to respond to the package manager. The response must include |
| 4701 | * the {@code verificationCode} which is one of |
| 4702 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 4703 | * {@link PackageManager#VERIFICATION_REJECT}. |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4704 | * |
| 4705 | * @param id pending package identifier as passed via the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4706 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 4707 | * @param verificationCode either {@link PackageManager#VERIFICATION_ALLOW} |
| 4708 | * or {@link PackageManager#VERIFICATION_REJECT}. |
rich cannings | 7e67151 | 2012-08-27 14:44:16 -0700 | [diff] [blame] | 4709 | * @throws SecurityException if the caller does not have the |
Dianne Hackborn | 8832c18 | 2012-09-17 17:20:24 -0700 | [diff] [blame] | 4710 | * PACKAGE_VERIFICATION_AGENT permission. |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4711 | */ |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 4712 | public abstract void verifyPendingInstall(int id, int verificationCode); |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4713 | |
| 4714 | /** |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4715 | * Allows a package listening to the |
| 4716 | * {@link Intent#ACTION_PACKAGE_NEEDS_VERIFICATION package verification |
| 4717 | * broadcast} to extend the default timeout for a response and declare what |
| 4718 | * action to perform after the timeout occurs. The response must include |
| 4719 | * the {@code verificationCodeAtTimeout} which is one of |
| 4720 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 4721 | * {@link PackageManager#VERIFICATION_REJECT}. |
| 4722 | * |
| 4723 | * This method may only be called once per package id. Additional calls |
| 4724 | * will have no effect. |
| 4725 | * |
| 4726 | * @param id pending package identifier as passed via the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4727 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4728 | * @param verificationCodeAtTimeout either |
| 4729 | * {@link PackageManager#VERIFICATION_ALLOW} or |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 4730 | * {@link PackageManager#VERIFICATION_REJECT}. If |
| 4731 | * {@code verificationCodeAtTimeout} is neither |
| 4732 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 4733 | * {@link PackageManager#VERIFICATION_REJECT}, then |
| 4734 | * {@code verificationCodeAtTimeout} will default to |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4735 | * {@link PackageManager#VERIFICATION_REJECT}. |
| 4736 | * @param millisecondsToDelay the amount of time requested for the timeout. |
| 4737 | * Must be positive and less than |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 4738 | * {@link PackageManager#MAXIMUM_VERIFICATION_TIMEOUT}. If |
| 4739 | * {@code millisecondsToDelay} is out of bounds, |
| 4740 | * {@code millisecondsToDelay} will be set to the closest in |
| 4741 | * bounds value; namely, 0 or |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4742 | * {@link PackageManager#MAXIMUM_VERIFICATION_TIMEOUT}. |
rich cannings | 7e67151 | 2012-08-27 14:44:16 -0700 | [diff] [blame] | 4743 | * @throws SecurityException if the caller does not have the |
Dianne Hackborn | 8832c18 | 2012-09-17 17:20:24 -0700 | [diff] [blame] | 4744 | * PACKAGE_VERIFICATION_AGENT permission. |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4745 | */ |
| 4746 | public abstract void extendVerificationTimeout(int id, |
| 4747 | int verificationCodeAtTimeout, long millisecondsToDelay); |
| 4748 | |
| 4749 | /** |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4750 | * Allows a package listening to the |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 4751 | * {@link Intent#ACTION_INTENT_FILTER_NEEDS_VERIFICATION} intent filter verification |
| 4752 | * broadcast to respond to the package manager. The response must include |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4753 | * the {@code verificationCode} which is one of |
| 4754 | * {@link PackageManager#INTENT_FILTER_VERIFICATION_SUCCESS} or |
| 4755 | * {@link PackageManager#INTENT_FILTER_VERIFICATION_FAILURE}. |
| 4756 | * |
| 4757 | * @param verificationId pending package identifier as passed via the |
| 4758 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
| 4759 | * @param verificationCode either {@link PackageManager#INTENT_FILTER_VERIFICATION_SUCCESS} |
| 4760 | * or {@link PackageManager#INTENT_FILTER_VERIFICATION_FAILURE}. |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 4761 | * @param failedDomains a list of failed domains if the verificationCode is |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4762 | * {@link PackageManager#INTENT_FILTER_VERIFICATION_FAILURE}, otherwise null; |
| 4763 | * @throws SecurityException if the caller does not have the |
| 4764 | * INTENT_FILTER_VERIFICATION_AGENT permission. |
| 4765 | * |
| 4766 | * @hide |
| 4767 | */ |
Fabrice Di Meglio | ef741da | 2015-05-12 16:31:38 -0700 | [diff] [blame] | 4768 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 4769 | @RequiresPermission(android.Manifest.permission.INTENT_FILTER_VERIFICATION_AGENT) |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4770 | public abstract void verifyIntentFilter(int verificationId, int verificationCode, |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 4771 | List<String> failedDomains); |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4772 | |
| 4773 | /** |
| 4774 | * Get the status of a Domain Verification Result for an IntentFilter. This is |
| 4775 | * related to the {@link android.content.IntentFilter#setAutoVerify(boolean)} and |
| 4776 | * {@link android.content.IntentFilter#getAutoVerify()} |
| 4777 | * |
| 4778 | * This is used by the ResolverActivity to change the status depending on what the User select |
| 4779 | * in the Disambiguation Dialog and also used by the Settings App for changing the default App |
| 4780 | * for a domain. |
| 4781 | * |
| 4782 | * @param packageName The package name of the Activity associated with the IntentFilter. |
| 4783 | * @param userId The user id. |
| 4784 | * |
| 4785 | * @return The status to set to. This can be |
| 4786 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK} or |
| 4787 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS} or |
| 4788 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER} or |
| 4789 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED} |
| 4790 | * |
| 4791 | * @hide |
| 4792 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 4793 | @SystemApi |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4794 | public abstract int getIntentVerificationStatusAsUser(String packageName, @UserIdInt int userId); |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4795 | |
| 4796 | /** |
| 4797 | * Allow to change the status of a Intent Verification status for all IntentFilter of an App. |
| 4798 | * This is related to the {@link android.content.IntentFilter#setAutoVerify(boolean)} and |
| 4799 | * {@link android.content.IntentFilter#getAutoVerify()} |
| 4800 | * |
| 4801 | * This is used by the ResolverActivity to change the status depending on what the User select |
| 4802 | * in the Disambiguation Dialog and also used by the Settings App for changing the default App |
| 4803 | * for a domain. |
| 4804 | * |
| 4805 | * @param packageName The package name of the Activity associated with the IntentFilter. |
| 4806 | * @param status The status to set to. This can be |
| 4807 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK} or |
| 4808 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS} or |
| 4809 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER} |
| 4810 | * @param userId The user id. |
| 4811 | * |
| 4812 | * @return true if the status has been set. False otherwise. |
| 4813 | * |
| 4814 | * @hide |
| 4815 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 4816 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 4817 | @RequiresPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS) |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 4818 | public abstract boolean updateIntentVerificationStatusAsUser(String packageName, int status, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4819 | @UserIdInt int userId); |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4820 | |
| 4821 | /** |
| 4822 | * Get the list of IntentFilterVerificationInfo for a specific package and User. |
| 4823 | * |
| 4824 | * @param packageName the package name. When this parameter is set to a non null value, |
| 4825 | * the results will be filtered by the package name provided. |
| 4826 | * 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] | 4827 | * corresponding for all packages |
| 4828 | * |
| 4829 | * @return a list of IntentFilterVerificationInfo for a specific package. |
| 4830 | * |
| 4831 | * @hide |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4832 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 4833 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4834 | public abstract List<IntentFilterVerificationInfo> getIntentFilterVerifications( |
| 4835 | String packageName); |
| 4836 | |
| 4837 | /** |
Fabrice Di Meglio | 0788595 | 2015-04-06 19:41:28 -0700 | [diff] [blame] | 4838 | * Get the list of IntentFilter for a specific package. |
| 4839 | * |
| 4840 | * @param packageName the package name. This parameter is set to a non null value, |
| 4841 | * the list will contain all the IntentFilter for that package. |
| 4842 | * Otherwise, the list will be empty. |
| 4843 | * |
| 4844 | * @return a list of IntentFilter for a specific package. |
| 4845 | * |
| 4846 | * @hide |
| 4847 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 4848 | @SystemApi |
Fabrice Di Meglio | 0788595 | 2015-04-06 19:41:28 -0700 | [diff] [blame] | 4849 | public abstract List<IntentFilter> getAllIntentFilters(String packageName); |
| 4850 | |
| 4851 | /** |
Fabrice Di Meglio | 6227172 | 2015-04-10 17:24:02 -0700 | [diff] [blame] | 4852 | * Get the default Browser package name for a specific user. |
| 4853 | * |
| 4854 | * @param userId The user id. |
| 4855 | * |
| 4856 | * @return the package name of the default Browser for the specified user. If the user id passed |
| 4857 | * is -1 (all users) it will return a null value. |
| 4858 | * |
| 4859 | * @hide |
| 4860 | */ |
Jeff Sharkey | a73b8fd | 2016-01-06 17:02:08 -0700 | [diff] [blame] | 4861 | @TestApi |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 4862 | @SystemApi |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4863 | public abstract String getDefaultBrowserPackageNameAsUser(@UserIdInt int userId); |
Fabrice Di Meglio | 6227172 | 2015-04-10 17:24:02 -0700 | [diff] [blame] | 4864 | |
| 4865 | /** |
| 4866 | * Set the default Browser package name for a specific user. |
| 4867 | * |
| 4868 | * @param packageName The package name of the default Browser. |
| 4869 | * @param userId The user id. |
| 4870 | * |
| 4871 | * @return true if the default Browser for the specified user has been set, |
| 4872 | * otherwise return false. If the user id passed is -1 (all users) this call will not |
| 4873 | * do anything and just return false. |
| 4874 | * |
| 4875 | * @hide |
| 4876 | */ |
Jeff Schumacher | 6fd90ed | 2017-01-20 13:58:34 -0800 | [diff] [blame] | 4877 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 4878 | @RequiresPermission(android.Manifest.permission.SET_PREFERRED_APPLICATIONS) |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4879 | public abstract boolean setDefaultBrowserPackageNameAsUser(String packageName, |
| 4880 | @UserIdInt int userId); |
Fabrice Di Meglio | 6227172 | 2015-04-10 17:24:02 -0700 | [diff] [blame] | 4881 | |
| 4882 | /** |
Dianne Hackborn | 880119b | 2010-11-18 22:26:40 -0800 | [diff] [blame] | 4883 | * Change the installer associated with a given package. There are limitations |
| 4884 | * on how the installer package can be changed; in particular: |
| 4885 | * <ul> |
| 4886 | * <li> A SecurityException will be thrown if <var>installerPackageName</var> |
| 4887 | * is not signed with the same certificate as the calling application. |
| 4888 | * <li> A SecurityException will be thrown if <var>targetPackage</var> already |
| 4889 | * has an installer package, and that installer package is not signed with |
| 4890 | * the same certificate as the calling application. |
| 4891 | * </ul> |
| 4892 | * |
| 4893 | * @param targetPackage The installed package whose installer will be changed. |
| 4894 | * @param installerPackageName The package name of the new installer. May be |
| 4895 | * null to clear the association. |
| 4896 | */ |
| 4897 | public abstract void setInstallerPackageName(String targetPackage, |
| 4898 | String installerPackageName); |
| 4899 | |
Todd Kennedy | ab53289 | 2017-03-08 14:19:49 -0800 | [diff] [blame] | 4900 | /** @hide */ |
| 4901 | @SystemApi |
| 4902 | @RequiresPermission(Manifest.permission.INSTALL_PACKAGES) |
| 4903 | public abstract void setUpdateAvailable(String packageName, boolean updateAvaialble); |
| 4904 | |
Dianne Hackborn | 880119b | 2010-11-18 22:26:40 -0800 | [diff] [blame] | 4905 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4906 | * Attempts to delete a package. Since this may take a little while, the |
| 4907 | * result will be posted back to the given observer. A deletion will fail if |
| 4908 | * the calling context lacks the |
| 4909 | * {@link android.Manifest.permission#DELETE_PACKAGES} permission, if the |
| 4910 | * named package cannot be found, or if the named package is a system |
| 4911 | * package. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4912 | * |
| 4913 | * @param packageName The name of the package to delete |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4914 | * @param observer An observer callback to get notified when the package |
| 4915 | * deletion is complete. |
| 4916 | * {@link android.content.pm.IPackageDeleteObserver#packageDeleted} |
| 4917 | * will be called when that happens. observer may be null to |
| 4918 | * indicate that no callback is desired. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4919 | * @hide |
| 4920 | */ |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 4921 | @RequiresPermission(Manifest.permission.DELETE_PACKAGES) |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4922 | public abstract void deletePackage(String packageName, IPackageDeleteObserver observer, |
| 4923 | @DeleteFlags int flags); |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4924 | |
| 4925 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4926 | * Attempts to delete a package. Since this may take a little while, the |
| 4927 | * result will be posted back to the given observer. A deletion will fail if |
| 4928 | * the named package cannot be found, or if the named package is a system |
| 4929 | * package. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4930 | * |
| 4931 | * @param packageName The name of the package to delete |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4932 | * @param observer An observer callback to get notified when the package |
| 4933 | * deletion is complete. |
| 4934 | * {@link android.content.pm.IPackageDeleteObserver#packageDeleted} |
| 4935 | * will be called when that happens. observer may be null to |
| 4936 | * indicate that no callback is desired. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4937 | * @param userId The user Id |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4938 | * @hide |
| 4939 | */ |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 4940 | @RequiresPermission(anyOf = { |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4941 | Manifest.permission.DELETE_PACKAGES, |
| 4942 | Manifest.permission.INTERACT_ACROSS_USERS_FULL}) |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 4943 | public abstract void deletePackageAsUser(@NonNull String packageName, |
| 4944 | IPackageDeleteObserver observer, @DeleteFlags int flags, @UserIdInt int userId); |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4945 | |
| 4946 | /** |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4947 | * Retrieve the package name of the application that installed a package. This identifies |
| 4948 | * which market the package came from. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4949 | * |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4950 | * @param packageName The name of the package to query |
| 4951 | */ |
| 4952 | public abstract String getInstallerPackageName(String packageName); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4953 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4954 | /** |
| 4955 | * Attempts to clear the user data directory of an application. |
| 4956 | * Since this may take a little while, the result will |
| 4957 | * be posted back to the given observer. A deletion will fail if the |
| 4958 | * named package cannot be found, or if the named package is a "system package". |
| 4959 | * |
| 4960 | * @param packageName The name of the package |
| 4961 | * @param observer An observer callback to get notified when the operation is finished |
| 4962 | * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)} |
| 4963 | * will be called when that happens. observer may be null to indicate that |
| 4964 | * no callback is desired. |
| 4965 | * |
| 4966 | * @hide |
| 4967 | */ |
| 4968 | public abstract void clearApplicationUserData(String packageName, |
| 4969 | IPackageDataObserver observer); |
| 4970 | /** |
| 4971 | * Attempts to delete the cache files associated with an application. |
| 4972 | * Since this may take a little while, the result will |
| 4973 | * be posted back to the given observer. A deletion will fail if the calling context |
| 4974 | * lacks the {@link android.Manifest.permission#DELETE_CACHE_FILES} permission, if the |
| 4975 | * named package cannot be found, or if the named package is a "system package". |
| 4976 | * |
| 4977 | * @param packageName The name of the package to delete |
| 4978 | * @param observer An observer callback to get notified when the cache file deletion |
| 4979 | * is complete. |
| 4980 | * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)} |
| 4981 | * will be called when that happens. observer may be null to indicate that |
| 4982 | * no callback is desired. |
| 4983 | * |
| 4984 | * @hide |
| 4985 | */ |
| 4986 | public abstract void deleteApplicationCacheFiles(String packageName, |
| 4987 | IPackageDataObserver observer); |
| 4988 | |
| 4989 | /** |
Suprabh Shukla | 78c9eb8 | 2016-04-12 15:51:35 -0700 | [diff] [blame] | 4990 | * Attempts to delete the cache files associated with an application for a given user. Since |
| 4991 | * this may take a little while, the result will be posted back to the given observer. A |
| 4992 | * deletion will fail if the calling context lacks the |
| 4993 | * {@link android.Manifest.permission#DELETE_CACHE_FILES} permission, if the named package |
| 4994 | * cannot be found, or if the named package is a "system package". If {@code userId} does not |
| 4995 | * belong to the calling user, the caller must have |
| 4996 | * {@link android.Manifest.permission#INTERACT_ACROSS_USERS} permission. |
| 4997 | * |
| 4998 | * @param packageName The name of the package to delete |
| 4999 | * @param userId the user for which the cache files needs to be deleted |
| 5000 | * @param observer An observer callback to get notified when the cache file deletion is |
| 5001 | * complete. |
| 5002 | * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)} |
| 5003 | * will be called when that happens. observer may be null to indicate that no |
| 5004 | * callback is desired. |
| 5005 | * @hide |
| 5006 | */ |
| 5007 | public abstract void deleteApplicationCacheFilesAsUser(String packageName, int userId, |
| 5008 | IPackageDataObserver observer); |
| 5009 | |
| 5010 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5011 | * Free storage by deleting LRU sorted list of cache files across |
| 5012 | * all applications. If the currently available free storage |
| 5013 | * on the device is greater than or equal to the requested |
| 5014 | * free storage, no cache files are cleared. If the currently |
| 5015 | * available storage on the device is less than the requested |
| 5016 | * free storage, some or all of the cache files across |
| 5017 | * all applications are deleted (based on last accessed time) |
| 5018 | * to increase the free storage space on the device to |
| 5019 | * the requested value. There is no guarantee that clearing all |
| 5020 | * the cache files from all applications will clear up |
| 5021 | * enough storage to achieve the desired value. |
| 5022 | * @param freeStorageSize The number of bytes of storage to be |
| 5023 | * freed by the system. Say if freeStorageSize is XX, |
| 5024 | * and the current free storage is YY, |
| 5025 | * if XX is less than YY, just return. if not free XX-YY number |
| 5026 | * of bytes if possible. |
| 5027 | * @param observer call back used to notify when |
| 5028 | * the operation is completed |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5029 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5030 | * @hide |
| 5031 | */ |
Jeff Sharkey | 529f91f | 2015-04-18 20:23:13 -0700 | [diff] [blame] | 5032 | public void freeStorageAndNotify(long freeStorageSize, IPackageDataObserver observer) { |
| 5033 | freeStorageAndNotify(null, freeStorageSize, observer); |
| 5034 | } |
| 5035 | |
| 5036 | /** {@hide} */ |
| 5037 | public abstract void freeStorageAndNotify(String volumeUuid, long freeStorageSize, |
| 5038 | IPackageDataObserver observer); |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 5039 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5040 | /** |
| 5041 | * Free storage by deleting LRU sorted list of cache files across |
| 5042 | * all applications. If the currently available free storage |
| 5043 | * on the device is greater than or equal to the requested |
| 5044 | * free storage, no cache files are cleared. If the currently |
| 5045 | * available storage on the device is less than the requested |
| 5046 | * free storage, some or all of the cache files across |
| 5047 | * all applications are deleted (based on last accessed time) |
| 5048 | * to increase the free storage space on the device to |
| 5049 | * the requested value. There is no guarantee that clearing all |
| 5050 | * the cache files from all applications will clear up |
| 5051 | * enough storage to achieve the desired value. |
| 5052 | * @param freeStorageSize The number of bytes of storage to be |
| 5053 | * freed by the system. Say if freeStorageSize is XX, |
| 5054 | * and the current free storage is YY, |
| 5055 | * if XX is less than YY, just return. if not free XX-YY number |
| 5056 | * of bytes if possible. |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 5057 | * @param pi IntentSender call back used to |
| 5058 | * notify when the operation is completed.May be null |
| 5059 | * to indicate that no call back is desired. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5060 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5061 | * @hide |
| 5062 | */ |
Jeff Sharkey | 529f91f | 2015-04-18 20:23:13 -0700 | [diff] [blame] | 5063 | public void freeStorage(long freeStorageSize, IntentSender pi) { |
| 5064 | freeStorage(null, freeStorageSize, pi); |
| 5065 | } |
| 5066 | |
| 5067 | /** {@hide} */ |
| 5068 | 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] | 5069 | |
| 5070 | /** |
| 5071 | * Retrieve the size information for a package. |
| 5072 | * Since this may take a little while, the result will |
| 5073 | * be posted back to the given observer. The calling context |
| 5074 | * should have the {@link android.Manifest.permission#GET_PACKAGE_SIZE} permission. |
| 5075 | * |
| 5076 | * @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] | 5077 | * @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] | 5078 | * @param observer An observer callback to get notified when the operation |
| 5079 | * is complete. |
| 5080 | * {@link android.content.pm.IPackageStatsObserver#onGetStatsCompleted(PackageStats, boolean)} |
| 5081 | * The observer's callback is invoked with a PackageStats object(containing the |
| 5082 | * code, data and cache sizes of the package) and a boolean value representing |
| 5083 | * the status of the operation. observer may be null to indicate that |
| 5084 | * no callback is desired. |
| 5085 | * |
Jeff Sharkey | 60f95aa | 2017-03-08 13:57:15 -0700 | [diff] [blame] | 5086 | * @deprecated use {@link StorageStatsManager} instead. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5087 | * @hide |
| 5088 | */ |
Jeff Sharkey | 60f95aa | 2017-03-08 13:57:15 -0700 | [diff] [blame] | 5089 | @Deprecated |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 5090 | public abstract void getPackageSizeInfoAsUser(String packageName, @UserIdInt int userId, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5091 | IPackageStatsObserver observer); |
| 5092 | |
| 5093 | /** |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5094 | * Like {@link #getPackageSizeInfoAsUser(String, int, IPackageStatsObserver)}, but |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 5095 | * returns the size for the calling user. |
| 5096 | * |
Jeff Sharkey | 60f95aa | 2017-03-08 13:57:15 -0700 | [diff] [blame] | 5097 | * @deprecated use {@link StorageStatsManager} instead. |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 5098 | * @hide |
| 5099 | */ |
Jeff Sharkey | 60f95aa | 2017-03-08 13:57:15 -0700 | [diff] [blame] | 5100 | @Deprecated |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 5101 | public void getPackageSizeInfo(String packageName, IPackageStatsObserver observer) { |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5102 | getPackageSizeInfoAsUser(packageName, UserHandle.myUserId(), observer); |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 5103 | } |
| 5104 | |
| 5105 | /** |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5106 | * @deprecated This function no longer does anything; it was an old |
kmccormick | ac66b85 | 2013-03-28 15:17:15 -0700 | [diff] [blame] | 5107 | * approach to managing preferred activities, which has been superseded |
| 5108 | * by (and conflicts with) the modern activity-based preferences. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5109 | */ |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5110 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5111 | public abstract void addPackageToPreferred(String packageName); |
| 5112 | |
| 5113 | /** |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5114 | * @deprecated This function no longer does anything; it was an old |
kmccormick | ac66b85 | 2013-03-28 15:17:15 -0700 | [diff] [blame] | 5115 | * approach to managing preferred activities, which has been superseded |
| 5116 | * by (and conflicts with) the modern activity-based preferences. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5117 | */ |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5118 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5119 | public abstract void removePackageFromPreferred(String packageName); |
| 5120 | |
| 5121 | /** |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 5122 | * Retrieve the list of all currently configured preferred packages. The |
| 5123 | * first package on the list is the most preferred, the last is the least |
| 5124 | * preferred. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5125 | * |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 5126 | * @param flags Additional option flags to modify the data returned. |
| 5127 | * @return A List of PackageInfo objects, one for each preferred |
| 5128 | * application, in order of preference. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5129 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 5130 | public abstract List<PackageInfo> getPreferredPackages(@PackageInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5131 | |
| 5132 | /** |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5133 | * @deprecated This is a protected API that should not have been available |
| 5134 | * to third party applications. It is the platform's responsibility for |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 5135 | * assigning preferred activities and this cannot be directly modified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5136 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5137 | * Add a new preferred activity mapping to the system. This will be used |
| 5138 | * to automatically select the given activity component when |
| 5139 | * {@link Context#startActivity(Intent) Context.startActivity()} finds |
| 5140 | * multiple matching activities and also matches the given filter. |
| 5141 | * |
| 5142 | * @param filter The set of intents under which this activity will be |
| 5143 | * made preferred. |
| 5144 | * @param match The IntentFilter match category that this preference |
| 5145 | * applies to. |
| 5146 | * @param set The set of activities that the user was picking from when |
| 5147 | * this preference was made. |
| 5148 | * @param activity The component name of the activity that is to be |
| 5149 | * preferred. |
| 5150 | */ |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5151 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5152 | public abstract void addPreferredActivity(IntentFilter filter, int match, |
| 5153 | ComponentName[] set, ComponentName activity); |
| 5154 | |
| 5155 | /** |
Amith Yamasani | a3f133a | 2012-08-09 17:11:28 -0700 | [diff] [blame] | 5156 | * Same as {@link #addPreferredActivity(IntentFilter, int, |
| 5157 | ComponentName[], ComponentName)}, but with a specific userId to apply the preference |
| 5158 | to. |
| 5159 | * @hide |
| 5160 | */ |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5161 | public void addPreferredActivityAsUser(IntentFilter filter, int match, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 5162 | ComponentName[] set, ComponentName activity, @UserIdInt int userId) { |
Amith Yamasani | a3f133a | 2012-08-09 17:11:28 -0700 | [diff] [blame] | 5163 | throw new RuntimeException("Not implemented. Must override in a subclass."); |
| 5164 | } |
| 5165 | |
| 5166 | /** |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5167 | * @deprecated This is a protected API that should not have been available |
| 5168 | * to third party applications. It is the platform's responsibility for |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 5169 | * assigning preferred activities and this cannot be directly modified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5170 | * |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 5171 | * Replaces an existing preferred activity mapping to the system, and if that were not present |
| 5172 | * adds a new preferred activity. This will be used |
| 5173 | * to automatically select the given activity component when |
| 5174 | * {@link Context#startActivity(Intent) Context.startActivity()} finds |
| 5175 | * multiple matching activities and also matches the given filter. |
| 5176 | * |
| 5177 | * @param filter The set of intents under which this activity will be |
| 5178 | * made preferred. |
| 5179 | * @param match The IntentFilter match category that this preference |
| 5180 | * applies to. |
| 5181 | * @param set The set of activities that the user was picking from when |
| 5182 | * this preference was made. |
| 5183 | * @param activity The component name of the activity that is to be |
| 5184 | * preferred. |
| 5185 | * @hide |
| 5186 | */ |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5187 | @Deprecated |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 5188 | public abstract void replacePreferredActivity(IntentFilter filter, int match, |
| 5189 | ComponentName[] set, ComponentName activity); |
| 5190 | |
| 5191 | /** |
Amith Yamasani | 41c1ded | 2014-08-05 11:15:05 -0700 | [diff] [blame] | 5192 | * @hide |
| 5193 | */ |
| 5194 | @Deprecated |
| 5195 | public void replacePreferredActivityAsUser(IntentFilter filter, int match, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 5196 | ComponentName[] set, ComponentName activity, @UserIdInt int userId) { |
Amith Yamasani | 41c1ded | 2014-08-05 11:15:05 -0700 | [diff] [blame] | 5197 | throw new RuntimeException("Not implemented. Must override in a subclass."); |
| 5198 | } |
| 5199 | |
| 5200 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5201 | * Remove all preferred activity mappings, previously added with |
| 5202 | * {@link #addPreferredActivity}, from the |
| 5203 | * system whose activities are implemented in the given package name. |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5204 | * An application can only clear its own package(s). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5205 | * |
| 5206 | * @param packageName The name of the package whose preferred activity |
| 5207 | * mappings are to be removed. |
| 5208 | */ |
| 5209 | public abstract void clearPackagePreferredActivities(String packageName); |
| 5210 | |
| 5211 | /** |
| 5212 | * Retrieve all preferred activities, previously added with |
| 5213 | * {@link #addPreferredActivity}, that are |
| 5214 | * currently registered with the system. |
| 5215 | * |
John Spurlock | 38e6425 | 2015-03-18 12:09:32 -0400 | [diff] [blame] | 5216 | * @param outFilters A required list in which to place the filters of all of the |
| 5217 | * preferred activities. |
| 5218 | * @param outActivities A required list in which to place the component names of |
| 5219 | * all of the preferred activities. |
| 5220 | * @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] | 5221 | * the list. If null, all activities will be returned; if non-null, only |
| 5222 | * those activities in the given package are returned. |
| 5223 | * |
| 5224 | * @return Returns the total number of registered preferred activities |
| 5225 | * (the number of distinct IntentFilter records, not the number of unique |
| 5226 | * activity components) that were found. |
| 5227 | */ |
John Spurlock | 38e6425 | 2015-03-18 12:09:32 -0400 | [diff] [blame] | 5228 | public abstract int getPreferredActivities(@NonNull List<IntentFilter> outFilters, |
| 5229 | @NonNull List<ComponentName> outActivities, String packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5230 | |
| 5231 | /** |
Christopher Tate | a2a0850d | 2013-09-05 16:38:58 -0700 | [diff] [blame] | 5232 | * Ask for the set of available 'home' activities and the current explicit |
| 5233 | * default, if any. |
| 5234 | * @hide |
| 5235 | */ |
| 5236 | public abstract ComponentName getHomeActivities(List<ResolveInfo> outActivities); |
| 5237 | |
| 5238 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5239 | * Set the enabled setting for a package component (activity, receiver, service, provider). |
| 5240 | * This setting will override any enabled state which may have been set by the component in its |
| 5241 | * manifest. |
| 5242 | * |
| 5243 | * @param componentName The component to enable |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 5244 | * @param newState The new enabled state for the component. |
| 5245 | * @param flags Optional behavior flags. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5246 | */ |
| 5247 | public abstract void setComponentEnabledSetting(ComponentName componentName, |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 5248 | @EnabledState int newState, @EnabledFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5249 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5250 | /** |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 5251 | * Return the enabled setting for a package component (activity, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5252 | * receiver, service, provider). This returns the last value set by |
| 5253 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}; in most |
| 5254 | * cases this value will be {@link #COMPONENT_ENABLED_STATE_DEFAULT} since |
| 5255 | * the value originally specified in the manifest has not been modified. |
| 5256 | * |
| 5257 | * @param componentName The component to retrieve. |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 5258 | * @return Returns the current enabled state for the component. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5259 | */ |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 5260 | public abstract @EnabledState int getComponentEnabledSetting( |
| 5261 | ComponentName componentName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5262 | |
| 5263 | /** |
| 5264 | * Set the enabled setting for an application |
| 5265 | * This setting will override any enabled state which may have been set by the application in |
| 5266 | * its manifest. It also overrides the enabled state set in the manifest for any of the |
| 5267 | * application's components. It does not override any enabled state set by |
| 5268 | * {@link #setComponentEnabledSetting} for any of the application's components. |
| 5269 | * |
| 5270 | * @param packageName The package name of the application to enable |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 5271 | * @param newState The new enabled state for the application. |
| 5272 | * @param flags Optional behavior flags. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5273 | */ |
| 5274 | public abstract void setApplicationEnabledSetting(String packageName, |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 5275 | @EnabledState int newState, @EnabledFlags int flags); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5276 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5277 | /** |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 5278 | * Return the enabled setting for an application. This returns |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5279 | * the last value set by |
| 5280 | * {@link #setApplicationEnabledSetting(String, int, int)}; in most |
| 5281 | * cases this value will be {@link #COMPONENT_ENABLED_STATE_DEFAULT} since |
| 5282 | * the value originally specified in the manifest has not been modified. |
| 5283 | * |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 5284 | * @param packageName The package name of the application to retrieve. |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 5285 | * @return Returns the current enabled state for the application. |
Mathew Inwood | 1b9f8d9 | 2011-09-26 13:23:56 +0100 | [diff] [blame] | 5286 | * @throws IllegalArgumentException if the named package does not exist. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5287 | */ |
Jeff Sharkey | 30e06bb | 2017-04-24 11:18:03 -0600 | [diff] [blame] | 5288 | public abstract @EnabledState int getApplicationEnabledSetting(String packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5289 | |
| 5290 | /** |
Sudheer Shanka | bbb3ff2 | 2015-07-09 15:39:23 +0100 | [diff] [blame] | 5291 | * Flush the package restrictions for a given user to disk. This forces the package restrictions |
| 5292 | * like component and package enabled settings to be written to disk and avoids the delay that |
| 5293 | * is otherwise present when changing those settings. |
| 5294 | * |
| 5295 | * @param userId Ther userId of the user whose restrictions are to be flushed. |
| 5296 | * @hide |
| 5297 | */ |
| 5298 | public abstract void flushPackageRestrictionsAsUser(int userId); |
| 5299 | |
| 5300 | /** |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5301 | * 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] | 5302 | * 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] | 5303 | * package file. Application can be unhidden by either resetting the hidden state |
| 5304 | * or by installing it, such as with {@link #installExistingPackage(String)} |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5305 | * @hide |
| 5306 | */ |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5307 | public abstract boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden, |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5308 | UserHandle userHandle); |
| 5309 | |
| 5310 | /** |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5311 | * Returns the hidden state of a package. |
| 5312 | * @see #setApplicationHiddenSettingAsUser(String, boolean, UserHandle) |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5313 | * @hide |
| 5314 | */ |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5315 | public abstract boolean getApplicationHiddenSettingAsUser(String packageName, |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5316 | UserHandle userHandle); |
| 5317 | |
| 5318 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5319 | * Return whether the device has been booted into safe mode. |
| 5320 | */ |
| 5321 | public abstract boolean isSafeMode(); |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 5322 | |
| 5323 | /** |
Svetoslav | f7c06eb | 2015-06-10 18:43:22 -0700 | [diff] [blame] | 5324 | * Adds a listener for permission changes for installed packages. |
| 5325 | * |
| 5326 | * @param listener The listener to add. |
| 5327 | * |
| 5328 | * @hide |
| 5329 | */ |
| 5330 | @SystemApi |
| 5331 | @RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS) |
| 5332 | public abstract void addOnPermissionsChangeListener(OnPermissionsChangedListener listener); |
| 5333 | |
| 5334 | /** |
| 5335 | * Remvoes a listener for permission changes for installed packages. |
| 5336 | * |
| 5337 | * @param listener The listener to remove. |
| 5338 | * |
| 5339 | * @hide |
| 5340 | */ |
| 5341 | @SystemApi |
Jeff Sharkey | d86b8fe | 2017-06-02 17:36:26 -0600 | [diff] [blame] | 5342 | @RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS) |
Svetoslav | f7c06eb | 2015-06-10 18:43:22 -0700 | [diff] [blame] | 5343 | public abstract void removeOnPermissionsChangeListener(OnPermissionsChangedListener listener); |
| 5344 | |
| 5345 | /** |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5346 | * Return the {@link KeySet} associated with the String alias for this |
| 5347 | * application. |
| 5348 | * |
| 5349 | * @param alias The alias for a given {@link KeySet} as defined in the |
| 5350 | * application's AndroidManifest.xml. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5351 | * @hide |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5352 | */ |
| 5353 | public abstract KeySet getKeySetByAlias(String packageName, String alias); |
| 5354 | |
Ihab Awad | 1ec6888 | 2014-09-12 11:09:01 -0700 | [diff] [blame] | 5355 | /** Return the signing {@link KeySet} for this application. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5356 | * @hide |
| 5357 | */ |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5358 | public abstract KeySet getSigningKeySet(String packageName); |
| 5359 | |
| 5360 | /** |
| 5361 | * Return whether the package denoted by packageName has been signed by all |
| 5362 | * of the keys specified by the {@link KeySet} ks. This will return true if |
| 5363 | * the package has been signed by additional keys (a superset) as well. |
| 5364 | * Compare to {@link #isSignedByExactly(String packageName, KeySet ks)}. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5365 | * @hide |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5366 | */ |
| 5367 | public abstract boolean isSignedBy(String packageName, KeySet ks); |
| 5368 | |
| 5369 | /** |
| 5370 | * Return whether the package denoted by packageName has been signed by all |
| 5371 | * of, and only, the keys specified by the {@link KeySet} ks. Compare to |
| 5372 | * {@link #isSignedBy(String packageName, KeySet ks)}. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5373 | * @hide |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5374 | */ |
| 5375 | public abstract boolean isSignedByExactly(String packageName, KeySet ks); |
| 5376 | |
| 5377 | /** |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5378 | * 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] | 5379 | * |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5380 | * <p>It doesn't remove the data or the actual package file. The application notifications |
| 5381 | * will be hidden, the application will not show up in recents, will not be able to show |
| 5382 | * toasts or dialogs or ring the device. |
| 5383 | * |
Kenny Guy | 871f3eb | 2016-03-09 20:06:16 +0000 | [diff] [blame] | 5384 | * <p>The package must already be installed. If the package is uninstalled while suspended |
| 5385 | * the package will no longer be suspended. |
| 5386 | * |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5387 | * @param packageNames The names of the packages to set the suspended status. |
| 5388 | * @param suspended If set to {@code true} than the packages will be suspended, if set to |
| 5389 | * {@code false} the packages will be unsuspended. |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5390 | * @param userId The user id. |
| 5391 | * |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5392 | * @return an array of package names for which the suspended status is not set as requested in |
| 5393 | * this method. |
| 5394 | * |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5395 | * @hide |
| 5396 | */ |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5397 | public abstract String[] setPackagesSuspendedAsUser( |
| 5398 | String[] packageNames, boolean suspended, @UserIdInt int userId); |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5399 | |
Andrei Stingaceanu | 355b232 | 2016-02-12 16:43:51 +0000 | [diff] [blame] | 5400 | /** |
| 5401 | * @see #setPackageSuspendedAsUser(String, boolean, int) |
| 5402 | * @param packageName The name of the package to get the suspended status of. |
| 5403 | * @param userId The user id. |
| 5404 | * @return {@code true} if the package is suspended or {@code false} if the package is not |
| 5405 | * suspended or could not be found. |
| 5406 | * @hide |
| 5407 | */ |
| 5408 | public abstract boolean isPackageSuspendedForUser(String packageName, int userId); |
| 5409 | |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 5410 | /** |
| 5411 | * Provide a hint of what the {@link ApplicationInfo#category} value should |
| 5412 | * be for the given package. |
| 5413 | * <p> |
| 5414 | * This hint can only be set by the app which installed this package, as |
| 5415 | * determined by {@link #getInstallerPackageName(String)}. |
Jeff Sharkey | 60a82cd | 2017-04-18 18:19:16 -0600 | [diff] [blame] | 5416 | * |
| 5417 | * @param packageName the package to change the category hint for. |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 5418 | * @param categoryHint the category hint to set. |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 5419 | */ |
Jeff Sharkey | 60a82cd | 2017-04-18 18:19:16 -0600 | [diff] [blame] | 5420 | public abstract void setApplicationCategoryHint(@NonNull String packageName, |
Jeff Sharkey | 9bc89af | 2017-01-11 11:25:50 -0700 | [diff] [blame] | 5421 | @ApplicationInfo.Category int categoryHint); |
| 5422 | |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 5423 | /** {@hide} */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5424 | public static boolean isMoveStatusFinished(int status) { |
| 5425 | return (status < 0 || status > 100); |
| 5426 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5427 | |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 5428 | /** {@hide} */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5429 | public static abstract class MoveCallback { |
Jeff Sharkey | 50a0545 | 2015-04-29 11:24:52 -0700 | [diff] [blame] | 5430 | public void onCreated(int moveId, Bundle extras) {} |
| 5431 | public abstract void onStatusChanged(int moveId, int status, long estMillis); |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5432 | } |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 5433 | |
| 5434 | /** {@hide} */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5435 | public abstract int getMoveStatus(int moveId); |
| 5436 | |
| 5437 | /** {@hide} */ |
| 5438 | public abstract void registerMoveCallback(MoveCallback callback, Handler handler); |
| 5439 | /** {@hide} */ |
| 5440 | public abstract void unregisterMoveCallback(MoveCallback callback); |
| 5441 | |
| 5442 | /** {@hide} */ |
| 5443 | public abstract int movePackage(String packageName, VolumeInfo vol); |
| 5444 | /** {@hide} */ |
| 5445 | public abstract @Nullable VolumeInfo getPackageCurrentVolume(ApplicationInfo app); |
| 5446 | /** {@hide} */ |
| 5447 | public abstract @NonNull List<VolumeInfo> getPackageCandidateVolumes(ApplicationInfo app); |
| 5448 | |
| 5449 | /** {@hide} */ |
| 5450 | public abstract int movePrimaryStorage(VolumeInfo vol); |
| 5451 | /** {@hide} */ |
| 5452 | public abstract @Nullable VolumeInfo getPrimaryStorageCurrentVolume(); |
| 5453 | /** {@hide} */ |
| 5454 | public abstract @NonNull List<VolumeInfo> getPrimaryStorageCandidateVolumes(); |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 5455 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5456 | /** |
Amith Yamasani | 1359360 | 2012-03-22 16:16:17 -0700 | [diff] [blame] | 5457 | * Returns the device identity that verifiers can use to associate their scheme to a particular |
| 5458 | * 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] | 5459 | * |
Kenny Root | 0aaa0d9 | 2011-09-12 16:42:55 -0700 | [diff] [blame] | 5460 | * @return identity that uniquely identifies current device |
| 5461 | * @hide |
| 5462 | */ |
| 5463 | public abstract VerifierDeviceIdentity getVerifierDeviceIdentity(); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 5464 | |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5465 | /** |
Jeff Hao | 9f60c08 | 2014-10-28 18:51:07 -0700 | [diff] [blame] | 5466 | * Returns true if the device is upgrading, such as first boot after OTA. |
| 5467 | * |
| 5468 | * @hide |
| 5469 | */ |
| 5470 | public abstract boolean isUpgrade(); |
| 5471 | |
| 5472 | /** |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5473 | * Return interface that offers the ability to install, upgrade, and remove |
| 5474 | * applications on the device. |
| 5475 | */ |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5476 | public abstract @NonNull PackageInstaller getPackageInstaller(); |
Jeff Sharkey | 3a44f3f | 2014-04-28 17:36:31 -0700 | [diff] [blame] | 5477 | |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 5478 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5479 | * Adds a {@code CrossProfileIntentFilter}. After calling this method all |
| 5480 | * intents sent from the user with id sourceUserId can also be be resolved |
| 5481 | * by activities in the user with id targetUserId if they match the |
| 5482 | * specified intent filter. |
| 5483 | * |
Nicolas Prevot | 3f7777f | 2014-07-24 15:58:39 +0100 | [diff] [blame] | 5484 | * @param filter The {@link IntentFilter} the intent has to match |
| 5485 | * @param sourceUserId The source user id. |
| 5486 | * @param targetUserId The target user id. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5487 | * @param flags The possible values are {@link #SKIP_CURRENT_PROFILE} and |
| 5488 | * {@link #ONLY_IF_NO_MATCH_FOUND}. |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 5489 | * @hide |
| 5490 | */ |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 5491 | public abstract void addCrossProfileIntentFilter(IntentFilter filter, int sourceUserId, |
| 5492 | int targetUserId, int flags); |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 5493 | |
| 5494 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5495 | * Clearing {@code CrossProfileIntentFilter}s which have the specified user |
| 5496 | * as their source, and have been set by the app calling this method. |
| 5497 | * |
Nicolas Prevot | 3f7777f | 2014-07-24 15:58:39 +0100 | [diff] [blame] | 5498 | * @param sourceUserId The source user id. |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 5499 | * @hide |
| 5500 | */ |
Nicolas Prevot | 8194899 | 2014-05-16 18:25:26 +0100 | [diff] [blame] | 5501 | public abstract void clearCrossProfileIntentFilters(int sourceUserId); |
Alexandra Gherghina | 6e2ae25 | 2014-06-12 16:03:58 +0100 | [diff] [blame] | 5502 | |
| 5503 | /** |
Nicolas Prevot | 88cc346 | 2014-05-14 14:51:48 +0100 | [diff] [blame] | 5504 | * @hide |
| 5505 | */ |
Nicolas Prevot | 7f7b0c7 | 2014-06-23 15:59:38 +0100 | [diff] [blame] | 5506 | public abstract Drawable loadItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo); |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5507 | |
Benjamin Franz | ec2d48b | 2014-10-01 15:38:43 +0100 | [diff] [blame] | 5508 | /** |
| 5509 | * @hide |
| 5510 | */ |
| 5511 | public abstract Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo); |
| 5512 | |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5513 | /** {@hide} */ |
| 5514 | public abstract boolean isPackageAvailable(String packageName); |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5515 | |
| 5516 | /** {@hide} */ |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5517 | public static String installStatusToString(int status, String msg) { |
| 5518 | final String str = installStatusToString(status); |
| 5519 | if (msg != null) { |
| 5520 | return str + ": " + msg; |
| 5521 | } else { |
| 5522 | return str; |
| 5523 | } |
| 5524 | } |
| 5525 | |
| 5526 | /** {@hide} */ |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5527 | public static String installStatusToString(int status) { |
| 5528 | switch (status) { |
| 5529 | case INSTALL_SUCCEEDED: return "INSTALL_SUCCEEDED"; |
| 5530 | case INSTALL_FAILED_ALREADY_EXISTS: return "INSTALL_FAILED_ALREADY_EXISTS"; |
| 5531 | case INSTALL_FAILED_INVALID_APK: return "INSTALL_FAILED_INVALID_APK"; |
| 5532 | case INSTALL_FAILED_INVALID_URI: return "INSTALL_FAILED_INVALID_URI"; |
| 5533 | case INSTALL_FAILED_INSUFFICIENT_STORAGE: return "INSTALL_FAILED_INSUFFICIENT_STORAGE"; |
| 5534 | case INSTALL_FAILED_DUPLICATE_PACKAGE: return "INSTALL_FAILED_DUPLICATE_PACKAGE"; |
| 5535 | case INSTALL_FAILED_NO_SHARED_USER: return "INSTALL_FAILED_NO_SHARED_USER"; |
| 5536 | case INSTALL_FAILED_UPDATE_INCOMPATIBLE: return "INSTALL_FAILED_UPDATE_INCOMPATIBLE"; |
| 5537 | case INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: return "INSTALL_FAILED_SHARED_USER_INCOMPATIBLE"; |
| 5538 | case INSTALL_FAILED_MISSING_SHARED_LIBRARY: return "INSTALL_FAILED_MISSING_SHARED_LIBRARY"; |
| 5539 | case INSTALL_FAILED_REPLACE_COULDNT_DELETE: return "INSTALL_FAILED_REPLACE_COULDNT_DELETE"; |
| 5540 | case INSTALL_FAILED_DEXOPT: return "INSTALL_FAILED_DEXOPT"; |
| 5541 | case INSTALL_FAILED_OLDER_SDK: return "INSTALL_FAILED_OLDER_SDK"; |
| 5542 | case INSTALL_FAILED_CONFLICTING_PROVIDER: return "INSTALL_FAILED_CONFLICTING_PROVIDER"; |
| 5543 | case INSTALL_FAILED_NEWER_SDK: return "INSTALL_FAILED_NEWER_SDK"; |
| 5544 | case INSTALL_FAILED_TEST_ONLY: return "INSTALL_FAILED_TEST_ONLY"; |
| 5545 | case INSTALL_FAILED_CPU_ABI_INCOMPATIBLE: return "INSTALL_FAILED_CPU_ABI_INCOMPATIBLE"; |
| 5546 | case INSTALL_FAILED_MISSING_FEATURE: return "INSTALL_FAILED_MISSING_FEATURE"; |
| 5547 | case INSTALL_FAILED_CONTAINER_ERROR: return "INSTALL_FAILED_CONTAINER_ERROR"; |
| 5548 | case INSTALL_FAILED_INVALID_INSTALL_LOCATION: return "INSTALL_FAILED_INVALID_INSTALL_LOCATION"; |
| 5549 | case INSTALL_FAILED_MEDIA_UNAVAILABLE: return "INSTALL_FAILED_MEDIA_UNAVAILABLE"; |
| 5550 | case INSTALL_FAILED_VERIFICATION_TIMEOUT: return "INSTALL_FAILED_VERIFICATION_TIMEOUT"; |
| 5551 | case INSTALL_FAILED_VERIFICATION_FAILURE: return "INSTALL_FAILED_VERIFICATION_FAILURE"; |
| 5552 | case INSTALL_FAILED_PACKAGE_CHANGED: return "INSTALL_FAILED_PACKAGE_CHANGED"; |
| 5553 | case INSTALL_FAILED_UID_CHANGED: return "INSTALL_FAILED_UID_CHANGED"; |
| 5554 | case INSTALL_FAILED_VERSION_DOWNGRADE: return "INSTALL_FAILED_VERSION_DOWNGRADE"; |
| 5555 | case INSTALL_PARSE_FAILED_NOT_APK: return "INSTALL_PARSE_FAILED_NOT_APK"; |
| 5556 | case INSTALL_PARSE_FAILED_BAD_MANIFEST: return "INSTALL_PARSE_FAILED_BAD_MANIFEST"; |
| 5557 | case INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: return "INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION"; |
| 5558 | case INSTALL_PARSE_FAILED_NO_CERTIFICATES: return "INSTALL_PARSE_FAILED_NO_CERTIFICATES"; |
| 5559 | case INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES: return "INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES"; |
| 5560 | case INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING: return "INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING"; |
| 5561 | case INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME: return "INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME"; |
| 5562 | case INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID: return "INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID"; |
| 5563 | case INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: return "INSTALL_PARSE_FAILED_MANIFEST_MALFORMED"; |
| 5564 | case INSTALL_PARSE_FAILED_MANIFEST_EMPTY: return "INSTALL_PARSE_FAILED_MANIFEST_EMPTY"; |
| 5565 | case INSTALL_FAILED_INTERNAL_ERROR: return "INSTALL_FAILED_INTERNAL_ERROR"; |
| 5566 | case INSTALL_FAILED_USER_RESTRICTED: return "INSTALL_FAILED_USER_RESTRICTED"; |
| 5567 | case INSTALL_FAILED_DUPLICATE_PERMISSION: return "INSTALL_FAILED_DUPLICATE_PERMISSION"; |
| 5568 | case INSTALL_FAILED_NO_MATCHING_ABIS: return "INSTALL_FAILED_NO_MATCHING_ABIS"; |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5569 | case INSTALL_FAILED_ABORTED: return "INSTALL_FAILED_ABORTED"; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5570 | default: return Integer.toString(status); |
| 5571 | } |
| 5572 | } |
| 5573 | |
| 5574 | /** {@hide} */ |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5575 | public static int installStatusToPublicStatus(int status) { |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5576 | switch (status) { |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5577 | case INSTALL_SUCCEEDED: return PackageInstaller.STATUS_SUCCESS; |
| 5578 | case INSTALL_FAILED_ALREADY_EXISTS: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5579 | case INSTALL_FAILED_INVALID_APK: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5580 | case INSTALL_FAILED_INVALID_URI: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5581 | case INSTALL_FAILED_INSUFFICIENT_STORAGE: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5582 | case INSTALL_FAILED_DUPLICATE_PACKAGE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5583 | case INSTALL_FAILED_NO_SHARED_USER: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5584 | case INSTALL_FAILED_UPDATE_INCOMPATIBLE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5585 | case INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5586 | case INSTALL_FAILED_MISSING_SHARED_LIBRARY: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5587 | case INSTALL_FAILED_REPLACE_COULDNT_DELETE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5588 | case INSTALL_FAILED_DEXOPT: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5589 | case INSTALL_FAILED_OLDER_SDK: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5590 | case INSTALL_FAILED_CONFLICTING_PROVIDER: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5591 | case INSTALL_FAILED_NEWER_SDK: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5592 | case INSTALL_FAILED_TEST_ONLY: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5593 | case INSTALL_FAILED_CPU_ABI_INCOMPATIBLE: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5594 | case INSTALL_FAILED_MISSING_FEATURE: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5595 | case INSTALL_FAILED_CONTAINER_ERROR: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5596 | case INSTALL_FAILED_INVALID_INSTALL_LOCATION: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5597 | case INSTALL_FAILED_MEDIA_UNAVAILABLE: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5598 | case INSTALL_FAILED_VERIFICATION_TIMEOUT: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5599 | case INSTALL_FAILED_VERIFICATION_FAILURE: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5600 | case INSTALL_FAILED_PACKAGE_CHANGED: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5601 | case INSTALL_FAILED_UID_CHANGED: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5602 | case INSTALL_FAILED_VERSION_DOWNGRADE: return PackageInstaller.STATUS_FAILURE_INVALID; |
Svetoslav | d965370 | 2015-05-13 18:02:46 -0700 | [diff] [blame] | 5603 | case INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE: return PackageInstaller.STATUS_FAILURE_INVALID; |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5604 | case INSTALL_PARSE_FAILED_NOT_APK: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5605 | case INSTALL_PARSE_FAILED_BAD_MANIFEST: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5606 | case INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5607 | case INSTALL_PARSE_FAILED_NO_CERTIFICATES: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5608 | case INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5609 | case INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5610 | case INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5611 | case INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5612 | case INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5613 | case INSTALL_PARSE_FAILED_MANIFEST_EMPTY: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5614 | case INSTALL_FAILED_INTERNAL_ERROR: return PackageInstaller.STATUS_FAILURE; |
| 5615 | case INSTALL_FAILED_USER_RESTRICTED: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5616 | case INSTALL_FAILED_DUPLICATE_PERMISSION: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5617 | case INSTALL_FAILED_NO_MATCHING_ABIS: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5618 | case INSTALL_FAILED_ABORTED: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5619 | default: return PackageInstaller.STATUS_FAILURE; |
| 5620 | } |
| 5621 | } |
| 5622 | |
| 5623 | /** {@hide} */ |
| 5624 | public static String deleteStatusToString(int status, String msg) { |
| 5625 | final String str = deleteStatusToString(status); |
| 5626 | if (msg != null) { |
| 5627 | return str + ": " + msg; |
| 5628 | } else { |
| 5629 | return str; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5630 | } |
| 5631 | } |
| 5632 | |
| 5633 | /** {@hide} */ |
| 5634 | public static String deleteStatusToString(int status) { |
| 5635 | switch (status) { |
| 5636 | case DELETE_SUCCEEDED: return "DELETE_SUCCEEDED"; |
| 5637 | case DELETE_FAILED_INTERNAL_ERROR: return "DELETE_FAILED_INTERNAL_ERROR"; |
| 5638 | case DELETE_FAILED_DEVICE_POLICY_MANAGER: return "DELETE_FAILED_DEVICE_POLICY_MANAGER"; |
| 5639 | case DELETE_FAILED_USER_RESTRICTED: return "DELETE_FAILED_USER_RESTRICTED"; |
| 5640 | case DELETE_FAILED_OWNER_BLOCKED: return "DELETE_FAILED_OWNER_BLOCKED"; |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5641 | case DELETE_FAILED_ABORTED: return "DELETE_FAILED_ABORTED"; |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 5642 | case DELETE_FAILED_USED_SHARED_LIBRARY: return "DELETE_FAILED_USED_SHARED_LIBRARY"; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5643 | default: return Integer.toString(status); |
| 5644 | } |
| 5645 | } |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5646 | |
| 5647 | /** {@hide} */ |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5648 | public static int deleteStatusToPublicStatus(int status) { |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5649 | switch (status) { |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5650 | case DELETE_SUCCEEDED: return PackageInstaller.STATUS_SUCCESS; |
| 5651 | case DELETE_FAILED_INTERNAL_ERROR: return PackageInstaller.STATUS_FAILURE; |
| 5652 | case DELETE_FAILED_DEVICE_POLICY_MANAGER: return PackageInstaller.STATUS_FAILURE_BLOCKED; |
| 5653 | case DELETE_FAILED_USER_RESTRICTED: return PackageInstaller.STATUS_FAILURE_BLOCKED; |
| 5654 | case DELETE_FAILED_OWNER_BLOCKED: return PackageInstaller.STATUS_FAILURE_BLOCKED; |
| 5655 | case DELETE_FAILED_ABORTED: return PackageInstaller.STATUS_FAILURE_ABORTED; |
Svet Ganov | 6788212 | 2016-12-11 16:36:34 -0800 | [diff] [blame] | 5656 | case DELETE_FAILED_USED_SHARED_LIBRARY: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5657 | default: return PackageInstaller.STATUS_FAILURE; |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5658 | } |
| 5659 | } |
Jeff Sharkey | 6c0b9da | 2014-08-07 22:07:11 -0700 | [diff] [blame] | 5660 | |
| 5661 | /** {@hide} */ |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 5662 | public static String permissionFlagToString(int flag) { |
| 5663 | switch (flag) { |
Svetoslav | 4a5f4a2 | 2015-07-07 18:18:15 -0700 | [diff] [blame] | 5664 | case FLAG_PERMISSION_GRANTED_BY_DEFAULT: return "GRANTED_BY_DEFAULT"; |
| 5665 | case FLAG_PERMISSION_POLICY_FIXED: return "POLICY_FIXED"; |
| 5666 | case FLAG_PERMISSION_SYSTEM_FIXED: return "SYSTEM_FIXED"; |
| 5667 | case FLAG_PERMISSION_USER_SET: return "USER_SET"; |
| 5668 | case FLAG_PERMISSION_REVOKE_ON_UPGRADE: return "REVOKE_ON_UPGRADE"; |
| 5669 | case FLAG_PERMISSION_USER_FIXED: return "USER_FIXED"; |
Svet Ganov | 9c165d7 | 2015-12-01 19:52:26 -0800 | [diff] [blame] | 5670 | case FLAG_PERMISSION_REVIEW_REQUIRED: return "REVIEW_REQUIRED"; |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 5671 | default: return Integer.toString(flag); |
| 5672 | } |
| 5673 | } |
| 5674 | |
| 5675 | /** {@hide} */ |
Jeff Sharkey | 6c0b9da | 2014-08-07 22:07:11 -0700 | [diff] [blame] | 5676 | public static class LegacyPackageInstallObserver extends PackageInstallObserver { |
| 5677 | private final IPackageInstallObserver mLegacy; |
| 5678 | |
| 5679 | public LegacyPackageInstallObserver(IPackageInstallObserver legacy) { |
| 5680 | mLegacy = legacy; |
| 5681 | } |
| 5682 | |
| 5683 | @Override |
| 5684 | public void onPackageInstalled(String basePackageName, int returnCode, String msg, |
| 5685 | Bundle extras) { |
| 5686 | if (mLegacy == null) return; |
| 5687 | try { |
| 5688 | mLegacy.packageInstalled(basePackageName, returnCode); |
| 5689 | } catch (RemoteException ignored) { |
| 5690 | } |
| 5691 | } |
| 5692 | } |
| 5693 | |
| 5694 | /** {@hide} */ |
| 5695 | public static class LegacyPackageDeleteObserver extends PackageDeleteObserver { |
| 5696 | private final IPackageDeleteObserver mLegacy; |
| 5697 | |
| 5698 | public LegacyPackageDeleteObserver(IPackageDeleteObserver legacy) { |
| 5699 | mLegacy = legacy; |
| 5700 | } |
| 5701 | |
| 5702 | @Override |
| 5703 | public void onPackageDeleted(String basePackageName, int returnCode, String msg) { |
| 5704 | if (mLegacy == null) return; |
| 5705 | try { |
| 5706 | mLegacy.packageDeleted(basePackageName, returnCode); |
| 5707 | } catch (RemoteException ignored) { |
| 5708 | } |
| 5709 | } |
| 5710 | } |
Bartosz Fabianowski | a34f53f | 2017-01-11 18:08:47 +0100 | [diff] [blame] | 5711 | |
| 5712 | /** |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 5713 | * Return the install reason that was recorded when a package was first |
| 5714 | * installed for a specific user. Requesting the install reason for another |
| 5715 | * user will require the permission INTERACT_ACROSS_USERS_FULL. |
Bartosz Fabianowski | a34f53f | 2017-01-11 18:08:47 +0100 | [diff] [blame] | 5716 | * |
| 5717 | * @param packageName The package for which to retrieve the install reason |
| 5718 | * @param user The user for whom to retrieve the install reason |
Jeff Sharkey | 4347f81 | 2017-04-21 12:08:39 -0600 | [diff] [blame] | 5719 | * @return The install reason. If the package is not installed for the given |
| 5720 | * user, {@code INSTALL_REASON_UNKNOWN} is returned. |
Bartosz Fabianowski | a34f53f | 2017-01-11 18:08:47 +0100 | [diff] [blame] | 5721 | * @hide |
| 5722 | */ |
| 5723 | @TestApi |
| 5724 | public abstract @InstallReason int getInstallReason(String packageName, |
| 5725 | @NonNull UserHandle user); |
Suprabh Shukla | aef2513 | 2017-01-23 18:09:03 -0800 | [diff] [blame] | 5726 | |
| 5727 | /** |
| 5728 | * 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] | 5729 | * 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] | 5730 | * intent {@link android.content.Intent#ACTION_INSTALL_PACKAGE}. Starting from Android O, the |
| 5731 | * 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] | 5732 | * 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] | 5733 | * a dialog will be shown to the user with an option to launch settings to change their |
| 5734 | * preference. An application must target Android O or higher and declare permission |
Suprabh Shukla | 5752847 | 2017-04-14 19:22:45 -0700 | [diff] [blame] | 5735 | * {@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] | 5736 | * |
| 5737 | * @return true if the calling package is trusted by the user to request install packages on |
| 5738 | * the device, false otherwise. |
Suprabh Shukla | 5752847 | 2017-04-14 19:22:45 -0700 | [diff] [blame] | 5739 | * @see android.content.Intent#ACTION_INSTALL_PACKAGE |
| 5740 | * @see android.provider.Settings#ACTION_MANAGE_UNKNOWN_APP_SOURCES |
Suprabh Shukla | aef2513 | 2017-01-23 18:09:03 -0800 | [diff] [blame] | 5741 | */ |
| 5742 | public abstract boolean canRequestPackageInstalls(); |
Chad Brubaker | aa49cb8 | 2017-03-24 15:53:09 -0700 | [diff] [blame] | 5743 | |
| 5744 | /** |
| 5745 | * Return the {@link ComponentName} of the activity providing Settings for the Instant App |
| 5746 | * resolver. |
| 5747 | * |
Todd Kennedy | 801e659 | 2017-04-12 14:10:12 -0700 | [diff] [blame] | 5748 | * @see {@link android.content.Intent#ACTION_INSTANT_APP_RESOLVER_SETTINGS} |
Chad Brubaker | aa49cb8 | 2017-03-24 15:53:09 -0700 | [diff] [blame] | 5749 | * @hide |
| 5750 | */ |
| 5751 | @SystemApi |
| 5752 | public abstract ComponentName getInstantAppResolverSettingsComponent(); |
Todd Kennedy | 801e659 | 2017-04-12 14:10:12 -0700 | [diff] [blame] | 5753 | |
| 5754 | /** |
| 5755 | * Return the {@link ComponentName} of the activity responsible for installing instant |
| 5756 | * applications. |
| 5757 | * |
| 5758 | * @see {@link android.content.Intent#ACTION_INSTALL_INSTANT_APP_PACKAGE} |
| 5759 | * @hide |
| 5760 | */ |
| 5761 | @SystemApi |
| 5762 | public abstract ComponentName getInstantAppInstallerComponent(); |
Chad Brubaker | 0d277a7 | 2017-04-12 16:56:53 -0700 | [diff] [blame] | 5763 | |
| 5764 | /** |
| 5765 | * Return the Android Id for a given Instant App. |
| 5766 | * |
| 5767 | * @see {@link android.provider.Settings.Secure#ANDROID_ID} |
| 5768 | * @hide |
| 5769 | */ |
| 5770 | public abstract String getInstantAppAndroidId(String packageName, @NonNull UserHandle user); |
Calin Juravle | 3d2af7f | 2017-04-19 19:56:21 -0700 | [diff] [blame] | 5771 | |
| 5772 | /** |
| 5773 | * Callback use to notify the callers of module registration that the operation |
| 5774 | * has finished. |
| 5775 | * |
| 5776 | * @hide |
| 5777 | */ |
Calin Juravle | 3d2af7f | 2017-04-19 19:56:21 -0700 | [diff] [blame] | 5778 | public static abstract class DexModuleRegisterCallback { |
| 5779 | public abstract void onDexModuleRegistered(String dexModulePath, boolean success, |
| 5780 | String message); |
| 5781 | } |
| 5782 | |
| 5783 | /** |
| 5784 | * Register an application dex module with the package manager. |
| 5785 | * The package manager will keep track of the given module for future optimizations. |
| 5786 | * |
| 5787 | * Dex module optimizations will disable the classpath checking at runtime. The client bares |
| 5788 | * the responsibility to ensure that the static assumptions on classes in the optimized code |
| 5789 | * hold at runtime (e.g. there's no duplicate classes in the classpath). |
| 5790 | * |
| 5791 | * Note that the package manager already keeps track of dex modules loaded with |
| 5792 | * {@link dalvik.system.DexClassLoader} and {@link dalvik.system.PathClassLoader}. |
| 5793 | * This can be called for an eager registration. |
| 5794 | * |
| 5795 | * The call might take a while and the results will be posted on the main thread, using |
| 5796 | * the given callback. |
| 5797 | * |
| 5798 | * If the module is intended to be shared with other apps, make sure that the file |
| 5799 | * permissions allow for it. |
| 5800 | * If at registration time the permissions allow for others to read it, the module would |
| 5801 | * be marked as a shared module which might undergo a different optimization strategy. |
| 5802 | * (usually shared modules will generated larger optimizations artifacts, |
| 5803 | * taking more disk space). |
| 5804 | * |
| 5805 | * @param dexModulePath the absolute path of the dex module. |
| 5806 | * @param callback if not null, {@link DexModuleRegisterCallback#onDexModuleRegistered} will |
| 5807 | * be called once the registration finishes. |
| 5808 | * |
| 5809 | * @hide |
| 5810 | */ |
Calin Juravle | 3d2af7f | 2017-04-19 19:56:21 -0700 | [diff] [blame] | 5811 | public abstract void registerDexModule(String dexModulePath, |
| 5812 | @Nullable DexModuleRegisterCallback callback); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5813 | } |