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 | |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 19 | import android.annotation.IntDef; |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 20 | import android.annotation.SystemApi; |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 21 | import android.annotation.SdkConstant; |
| 22 | import android.annotation.SdkConstant.SdkConstantType; |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 23 | import android.app.PackageInstallObserver; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 24 | import android.content.ComponentName; |
| 25 | import android.content.Context; |
| 26 | import android.content.Intent; |
| 27 | import android.content.IntentFilter; |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 28 | import android.content.IntentSender; |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 29 | import android.content.pm.PackageParser.PackageParserException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 30 | import android.content.res.Resources; |
| 31 | import android.content.res.XmlResourceParser; |
Nicolas Prevot | 88cc346 | 2014-05-14 14:51:48 +0100 | [diff] [blame] | 32 | import android.graphics.Bitmap; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 33 | import android.graphics.drawable.Drawable; |
| 34 | import android.net.Uri; |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 35 | import android.os.Environment; |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 36 | import android.os.UserHandle; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 37 | import android.util.AndroidException; |
| 38 | import android.util.DisplayMetrics; |
| 39 | |
| 40 | import java.io.File; |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 41 | import java.lang.annotation.Retention; |
| 42 | import java.lang.annotation.RetentionPolicy; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 43 | import java.util.List; |
| 44 | |
| 45 | /** |
| 46 | * Class for retrieving various kinds of information related to the application |
| 47 | * packages that are currently installed on the device. |
| 48 | * |
| 49 | * You can find this class through {@link Context#getPackageManager}. |
| 50 | */ |
| 51 | public abstract class PackageManager { |
| 52 | |
| 53 | /** |
| 54 | * This exception is thrown when a given package, application, or component |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 55 | * name cannot be found. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 56 | */ |
| 57 | public static class NameNotFoundException extends AndroidException { |
| 58 | public NameNotFoundException() { |
| 59 | } |
| 60 | |
| 61 | public NameNotFoundException(String name) { |
| 62 | super(name); |
| 63 | } |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * {@link PackageInfo} flag: return information about |
| 68 | * activities in the package in {@link PackageInfo#activities}. |
| 69 | */ |
| 70 | public static final int GET_ACTIVITIES = 0x00000001; |
| 71 | |
| 72 | /** |
| 73 | * {@link PackageInfo} flag: return information about |
| 74 | * intent receivers in the package in |
| 75 | * {@link PackageInfo#receivers}. |
| 76 | */ |
| 77 | public static final int GET_RECEIVERS = 0x00000002; |
| 78 | |
| 79 | /** |
| 80 | * {@link PackageInfo} flag: return information about |
| 81 | * services in the package in {@link PackageInfo#services}. |
| 82 | */ |
| 83 | public static final int GET_SERVICES = 0x00000004; |
| 84 | |
| 85 | /** |
| 86 | * {@link PackageInfo} flag: return information about |
| 87 | * content providers in the package in |
| 88 | * {@link PackageInfo#providers}. |
| 89 | */ |
| 90 | public static final int GET_PROVIDERS = 0x00000008; |
| 91 | |
| 92 | /** |
| 93 | * {@link PackageInfo} flag: return information about |
| 94 | * instrumentation in the package in |
| 95 | * {@link PackageInfo#instrumentation}. |
| 96 | */ |
| 97 | public static final int GET_INSTRUMENTATION = 0x00000010; |
| 98 | |
| 99 | /** |
| 100 | * {@link PackageInfo} flag: return information about the |
| 101 | * intent filters supported by the activity. |
| 102 | */ |
| 103 | public static final int GET_INTENT_FILTERS = 0x00000020; |
| 104 | |
| 105 | /** |
| 106 | * {@link PackageInfo} flag: return information about the |
| 107 | * signatures included in the package. |
| 108 | */ |
| 109 | public static final int GET_SIGNATURES = 0x00000040; |
| 110 | |
| 111 | /** |
| 112 | * {@link ResolveInfo} flag: return the IntentFilter that |
| 113 | * was matched for a particular ResolveInfo in |
| 114 | * {@link ResolveInfo#filter}. |
| 115 | */ |
| 116 | public static final int GET_RESOLVED_FILTER = 0x00000040; |
| 117 | |
| 118 | /** |
| 119 | * {@link ComponentInfo} flag: return the {@link ComponentInfo#metaData} |
| 120 | * data {@link android.os.Bundle}s that are associated with a component. |
| 121 | * This applies for any API returning a ComponentInfo subclass. |
| 122 | */ |
| 123 | public static final int GET_META_DATA = 0x00000080; |
| 124 | |
| 125 | /** |
| 126 | * {@link PackageInfo} flag: return the |
| 127 | * {@link PackageInfo#gids group ids} that are associated with an |
| 128 | * application. |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 129 | * 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] | 130 | * directly or nested inside of another. |
| 131 | */ |
| 132 | public static final int GET_GIDS = 0x00000100; |
| 133 | |
| 134 | /** |
| 135 | * {@link PackageInfo} flag: include disabled components in the returned info. |
| 136 | */ |
| 137 | public static final int GET_DISABLED_COMPONENTS = 0x00000200; |
| 138 | |
| 139 | /** |
| 140 | * {@link ApplicationInfo} flag: return the |
| 141 | * {@link ApplicationInfo#sharedLibraryFiles paths to the shared libraries} |
| 142 | * that are associated with an application. |
| 143 | * This applies for any API returning an ApplicationInfo class, either |
| 144 | * directly or nested inside of another. |
| 145 | */ |
| 146 | public static final int GET_SHARED_LIBRARY_FILES = 0x00000400; |
| 147 | |
| 148 | /** |
| 149 | * {@link ProviderInfo} flag: return the |
| 150 | * {@link ProviderInfo#uriPermissionPatterns URI permission patterns} |
| 151 | * that are associated with a content provider. |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 152 | * 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] | 153 | * directly or nested inside of another. |
| 154 | */ |
| 155 | public static final int GET_URI_PERMISSION_PATTERNS = 0x00000800; |
| 156 | /** |
| 157 | * {@link PackageInfo} flag: return information about |
| 158 | * permissions in the package in |
| 159 | * {@link PackageInfo#permissions}. |
| 160 | */ |
| 161 | public static final int GET_PERMISSIONS = 0x00001000; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 162 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 163 | /** |
Kenny Root | 685f490 | 2011-11-03 10:13:29 -0700 | [diff] [blame] | 164 | * Flag parameter to retrieve some information about all applications (even |
| 165 | * uninstalled ones) which have data directories. This state could have |
| 166 | * resulted if applications have been deleted with flag |
| 167 | * {@code DONT_DELETE_DATA} with a possibility of being replaced or |
| 168 | * reinstalled in future. |
| 169 | * <p> |
| 170 | * Note: this flag may cause less information about currently installed |
| 171 | * applications to be returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 172 | */ |
| 173 | public static final int GET_UNINSTALLED_PACKAGES = 0x00002000; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 174 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 175 | /** |
| 176 | * {@link PackageInfo} flag: return information about |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 177 | * hardware preferences in |
| 178 | * {@link PackageInfo#configPreferences PackageInfo.configPreferences} and |
| 179 | * requested features in {@link PackageInfo#reqFeatures |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 180 | * PackageInfo.reqFeatures}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 181 | */ |
| 182 | public static final int GET_CONFIGURATIONS = 0x00004000; |
| 183 | |
| 184 | /** |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 185 | * {@link PackageInfo} flag: include disabled components which are in |
| 186 | * that state only because of {@link #COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED} |
| 187 | * in the returned info. Note that if you set this flag, applications |
| 188 | * that are in this disabled state will be reported as enabled. |
| 189 | */ |
| 190 | public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 0x00008000; |
| 191 | |
| 192 | /** |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 193 | * Resolution and querying flag: if set, only filters that support the |
| 194 | * {@link android.content.Intent#CATEGORY_DEFAULT} will be considered for |
| 195 | * matching. This is a synonym for including the CATEGORY_DEFAULT in your |
| 196 | * supplied Intent. |
| 197 | */ |
| 198 | public static final int MATCH_DEFAULT_ONLY = 0x00010000; |
| 199 | |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 200 | /** |
Alexandra Gherghina | fa4533f | 2014-06-24 16:02:39 +0100 | [diff] [blame] | 201 | * Resolution and querying flag: do not resolve intents cross-profile. |
| 202 | * @hide |
| 203 | */ |
| 204 | public static final int NO_CROSS_PROFILE = 0x00020000; |
| 205 | |
| 206 | /** |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 207 | * Flag for {@link addCrossProfileIntentFilter}: if the cross-profile intent has been set by the |
| 208 | * profile owner. |
| 209 | * @hide |
| 210 | */ |
| 211 | public static final int SET_BY_PROFILE_OWNER= 0x00000001; |
| 212 | |
| 213 | /** |
| 214 | * Flag for {@link addCrossProfileIntentFilter}: if this flag is set: |
| 215 | * when resolving an intent that matches the {@link CrossProfileIntentFilter}, the current |
| 216 | * profile will be skipped. |
| 217 | * Only activities in the target user can respond to the intent. |
| 218 | * @hide |
| 219 | */ |
| 220 | public static final int SKIP_CURRENT_PROFILE = 0x00000002; |
| 221 | |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 222 | /** @hide */ |
| 223 | @IntDef({PERMISSION_GRANTED, PERMISSION_DENIED}) |
| 224 | @Retention(RetentionPolicy.SOURCE) |
| 225 | public @interface PermissionResult {} |
| 226 | |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 227 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 228 | * Permission check result: this is returned by {@link #checkPermission} |
| 229 | * if the permission has been granted to the given package. |
| 230 | */ |
| 231 | public static final int PERMISSION_GRANTED = 0; |
| 232 | |
| 233 | /** |
| 234 | * Permission check result: this is returned by {@link #checkPermission} |
| 235 | * if the permission has not been granted to the given package. |
| 236 | */ |
| 237 | public static final int PERMISSION_DENIED = -1; |
| 238 | |
| 239 | /** |
| 240 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 241 | * if all signatures on the two packages match. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 242 | */ |
| 243 | public static final int SIGNATURE_MATCH = 0; |
| 244 | |
| 245 | /** |
| 246 | * Signature check result: this is returned by {@link #checkSignatures} |
| 247 | * if neither of the two packages is signed. |
| 248 | */ |
| 249 | public static final int SIGNATURE_NEITHER_SIGNED = 1; |
| 250 | |
| 251 | /** |
| 252 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 253 | * 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] | 254 | */ |
| 255 | public static final int SIGNATURE_FIRST_NOT_SIGNED = -1; |
| 256 | |
| 257 | /** |
| 258 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 259 | * 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] | 260 | */ |
| 261 | public static final int SIGNATURE_SECOND_NOT_SIGNED = -2; |
| 262 | |
| 263 | /** |
| 264 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 265 | * if not all signatures on both packages match. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 266 | */ |
| 267 | public static final int SIGNATURE_NO_MATCH = -3; |
| 268 | |
| 269 | /** |
| 270 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 271 | * if either of the packages are not valid. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 272 | */ |
| 273 | public static final int SIGNATURE_UNKNOWN_PACKAGE = -4; |
| 274 | |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 275 | /** |
| 276 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} |
| 277 | * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 278 | * component or application is in its default enabled state (as specified |
| 279 | * in its manifest). |
| 280 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 281 | public static final int COMPONENT_ENABLED_STATE_DEFAULT = 0; |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 282 | |
| 283 | /** |
| 284 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} |
| 285 | * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 286 | * component or application has been explictily enabled, regardless of |
| 287 | * what it has specified in its manifest. |
| 288 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 289 | public static final int COMPONENT_ENABLED_STATE_ENABLED = 1; |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 290 | |
| 291 | /** |
| 292 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} |
| 293 | * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 294 | * component or application has been explicitly disabled, regardless of |
| 295 | * what it has specified in its manifest. |
| 296 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 297 | public static final int COMPONENT_ENABLED_STATE_DISABLED = 2; |
| 298 | |
| 299 | /** |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 300 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} only: The |
| 301 | * user has explicitly disabled the application, regardless of what it has |
| 302 | * specified in its manifest. Because this is due to the user's request, |
| 303 | * they may re-enable it if desired through the appropriate system UI. This |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 304 | * option currently <strong>cannot</strong> be used with |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 305 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}. |
| 306 | */ |
| 307 | public static final int COMPONENT_ENABLED_STATE_DISABLED_USER = 3; |
| 308 | |
| 309 | /** |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 310 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} only: This |
| 311 | * application should be considered, until the point where the user actually |
| 312 | * wants to use it. This means that it will not normally show up to the user |
| 313 | * (such as in the launcher), but various parts of the user interface can |
| 314 | * use {@link #GET_DISABLED_UNTIL_USED_COMPONENTS} to still see it and allow |
| 315 | * the user to select it (as for example an IME, device admin, etc). Such code, |
| 316 | * once the user has selected the app, should at that point also make it enabled. |
| 317 | * This option currently <strong>can not</strong> be used with |
| 318 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}. |
| 319 | */ |
| 320 | public static final int COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED = 4; |
| 321 | |
| 322 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 323 | * Flag parameter for {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} to |
| 324 | * indicate that this package should be installed as forward locked, i.e. only the app itself |
Brad Fitzpatrick | 2e805b1 | 2010-03-22 10:10:51 -0700 | [diff] [blame] | 325 | * should have access to its code and non-resource assets. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 326 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 327 | */ |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 328 | public static final int INSTALL_FORWARD_LOCK = 0x00000001; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 329 | |
| 330 | /** |
| 331 | * Flag parameter for {@link #installPackage} to indicate that you want to replace an already |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 332 | * installed package, if one exists. |
| 333 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 334 | */ |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 335 | public static final int INSTALL_REPLACE_EXISTING = 0x00000002; |
| 336 | |
| 337 | /** |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 338 | * Flag parameter for {@link #installPackage} to indicate that you want to |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 339 | * allow test packages (those that have set android:testOnly in their |
| 340 | * manifest) to be installed. |
| 341 | * @hide |
| 342 | */ |
| 343 | public static final int INSTALL_ALLOW_TEST = 0x00000004; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 344 | |
| 345 | /** |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 346 | * Flag parameter for {@link #installPackage} to indicate that this |
| 347 | * package has to be installed on the sdcard. |
| 348 | * @hide |
| 349 | */ |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 350 | public static final int INSTALL_EXTERNAL = 0x00000008; |
Oscar Montemayor | 539d3c4 | 2010-01-29 15:27:00 -0800 | [diff] [blame] | 351 | |
| 352 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 353 | * Flag parameter for {@link #installPackage} to indicate that this package |
| 354 | * has to be installed on the sdcard. |
| 355 | * @hide |
| 356 | */ |
| 357 | public static final int INSTALL_INTERNAL = 0x00000010; |
| 358 | |
| 359 | /** |
| 360 | * Flag parameter for {@link #installPackage} to indicate that this install |
| 361 | * was initiated via ADB. |
| 362 | * |
| 363 | * @hide |
| 364 | */ |
| 365 | public static final int INSTALL_FROM_ADB = 0x00000020; |
Suchi Amalapurapu | 14b6abd | 2010-03-17 08:37:04 -0700 | [diff] [blame] | 366 | |
| 367 | /** |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 368 | * Flag parameter for {@link #installPackage} to indicate that this install |
| 369 | * should immediately be visible to all users. |
| 370 | * |
| 371 | * @hide |
| 372 | */ |
| 373 | public static final int INSTALL_ALL_USERS = 0x00000040; |
| 374 | |
| 375 | /** |
| 376 | * Flag parameter for {@link #installPackage} to indicate that it is okay |
| 377 | * to install an update to an app where the newly installed app has a lower |
| 378 | * version code than the currently installed app. |
| 379 | * |
| 380 | * @hide |
| 381 | */ |
| 382 | public static final int INSTALL_ALLOW_DOWNGRADE = 0x00000080; |
| 383 | |
| 384 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 385 | * Flag parameter for |
| 386 | * {@link #setComponentEnabledSetting(android.content.ComponentName, int, int)} to indicate |
| 387 | * that you don't want to kill the app containing the component. Be careful when you set this |
| 388 | * since changing component states can make the containing application's behavior unpredictable. |
| 389 | */ |
| 390 | public static final int DONT_KILL_APP = 0x00000001; |
| 391 | |
| 392 | /** |
| 393 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 394 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} on success. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 395 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 396 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 397 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 398 | public static final int INSTALL_SUCCEEDED = 1; |
| 399 | |
| 400 | /** |
| 401 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 402 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if the package is |
| 403 | * already installed. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 404 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 405 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 406 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 407 | public static final int INSTALL_FAILED_ALREADY_EXISTS = -1; |
| 408 | |
| 409 | /** |
| 410 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 411 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if the package archive |
| 412 | * file is invalid. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 413 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 414 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 415 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 416 | public static final int INSTALL_FAILED_INVALID_APK = -2; |
| 417 | |
| 418 | /** |
| 419 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 420 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if the URI passed in |
| 421 | * is invalid. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 422 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 423 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 424 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 425 | public static final int INSTALL_FAILED_INVALID_URI = -3; |
| 426 | |
| 427 | /** |
| 428 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 429 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if the package manager |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 430 | * service found that the device didn't have enough storage space to install the app. |
| 431 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 432 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 433 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 434 | public static final int INSTALL_FAILED_INSUFFICIENT_STORAGE = -4; |
| 435 | |
| 436 | /** |
| 437 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 438 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if a |
| 439 | * package is already installed with the same name. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 440 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 441 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 442 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 443 | public static final int INSTALL_FAILED_DUPLICATE_PACKAGE = -5; |
| 444 | |
| 445 | /** |
| 446 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 447 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 448 | * the requested shared user does not exist. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 449 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 450 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 451 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 452 | public static final int INSTALL_FAILED_NO_SHARED_USER = -6; |
| 453 | |
| 454 | /** |
| 455 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 456 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 457 | * a previously installed package of the same name has a different signature |
| 458 | * than the new package (and the old package's data was not removed). |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 459 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 460 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 461 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 462 | public static final int INSTALL_FAILED_UPDATE_INCOMPATIBLE = -7; |
| 463 | |
| 464 | /** |
| 465 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 466 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 467 | * the new package is requested a shared user which is already installed on the |
| 468 | * device and does not have matching signature. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 469 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 470 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 471 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 472 | public static final int INSTALL_FAILED_SHARED_USER_INCOMPATIBLE = -8; |
| 473 | |
| 474 | /** |
| 475 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 476 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 477 | * the new package uses a shared library that is not available. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 478 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 479 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 480 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 481 | public static final int INSTALL_FAILED_MISSING_SHARED_LIBRARY = -9; |
| 482 | |
| 483 | /** |
| 484 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 485 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 486 | * the new package uses a shared library that is not available. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 487 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 488 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 489 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 490 | public static final int INSTALL_FAILED_REPLACE_COULDNT_DELETE = -10; |
| 491 | |
| 492 | /** |
| 493 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 494 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 495 | * the new package failed while optimizing and validating its dex files, |
| 496 | * either because there was not enough storage or the validation failed. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 497 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 498 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 499 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 500 | public static final int INSTALL_FAILED_DEXOPT = -11; |
| 501 | |
| 502 | /** |
| 503 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 504 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 505 | * the new package failed because the current SDK version is older than |
| 506 | * that required by the package. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 507 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 508 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 509 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 510 | public static final int INSTALL_FAILED_OLDER_SDK = -12; |
| 511 | |
| 512 | /** |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 513 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 514 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 515 | * the new package failed because it contains a content provider with the |
| 516 | * same authority as a provider already installed in the system. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 517 | * @hide |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 518 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 519 | @SystemApi |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 520 | public static final int INSTALL_FAILED_CONFLICTING_PROVIDER = -13; |
| 521 | |
| 522 | /** |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 523 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 524 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 525 | * the new package failed because the current SDK version is newer than |
| 526 | * that required by the package. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 527 | * @hide |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 528 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 529 | @SystemApi |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 530 | public static final int INSTALL_FAILED_NEWER_SDK = -14; |
| 531 | |
| 532 | /** |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 533 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 534 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 535 | * the new package failed because it has specified that it is a test-only |
| 536 | * package and the caller has not supplied the {@link #INSTALL_ALLOW_TEST} |
| 537 | * flag. |
| 538 | * @hide |
| 539 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 540 | @SystemApi |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 541 | public static final int INSTALL_FAILED_TEST_ONLY = -15; |
| 542 | |
| 543 | /** |
Dianne Hackborn | b181118 | 2009-05-21 15:45:42 -0700 | [diff] [blame] | 544 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 545 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 546 | * the package being installed contains native code, but none that is |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 547 | * compatible with the device's CPU_ABI. |
Dianne Hackborn | b181118 | 2009-05-21 15:45:42 -0700 | [diff] [blame] | 548 | * @hide |
| 549 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 550 | @SystemApi |
Dianne Hackborn | b181118 | 2009-05-21 15:45:42 -0700 | [diff] [blame] | 551 | public static final int INSTALL_FAILED_CPU_ABI_INCOMPATIBLE = -16; |
| 552 | |
| 553 | /** |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 554 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 555 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 556 | * the new package uses a feature that is not available. |
| 557 | * @hide |
| 558 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 559 | @SystemApi |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 560 | public static final int INSTALL_FAILED_MISSING_FEATURE = -17; |
| 561 | |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 562 | // ------ Errors related to sdcard |
| 563 | /** |
| 564 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 565 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 566 | * a secure container mount point couldn't be accessed on external media. |
| 567 | * @hide |
| 568 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 569 | @SystemApi |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 570 | public static final int INSTALL_FAILED_CONTAINER_ERROR = -18; |
| 571 | |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 572 | /** |
Suchi Amalapurapu | b56ae20 | 2010-02-04 22:51:07 -0800 | [diff] [blame] | 573 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 574 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 575 | * the new package couldn't be installed in the specified install |
| 576 | * location. |
| 577 | * @hide |
| 578 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 579 | @SystemApi |
Suchi Amalapurapu | b56ae20 | 2010-02-04 22:51:07 -0800 | [diff] [blame] | 580 | public static final int INSTALL_FAILED_INVALID_INSTALL_LOCATION = -19; |
| 581 | |
| 582 | /** |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 583 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 584 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 585 | * the new package couldn't be installed in the specified install |
| 586 | * location because the media is not available. |
| 587 | * @hide |
| 588 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 589 | @SystemApi |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 590 | public static final int INSTALL_FAILED_MEDIA_UNAVAILABLE = -20; |
| 591 | |
| 592 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 593 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 594 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 595 | * the new package couldn't be installed because the verification timed out. |
| 596 | * @hide |
| 597 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 598 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 599 | public static final int INSTALL_FAILED_VERIFICATION_TIMEOUT = -21; |
| 600 | |
| 601 | /** |
| 602 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 603 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 604 | * the new package couldn't be installed because the verification did not succeed. |
| 605 | * @hide |
| 606 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 607 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 608 | public static final int INSTALL_FAILED_VERIFICATION_FAILURE = -22; |
| 609 | |
| 610 | /** |
| 611 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 612 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 613 | * the package changed from what the calling program expected. |
| 614 | * @hide |
| 615 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 616 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 617 | public static final int INSTALL_FAILED_PACKAGE_CHANGED = -23; |
| 618 | |
| 619 | /** |
Dianne Hackborn | d0c5f51 | 2012-06-07 16:53:59 -0700 | [diff] [blame] | 620 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 621 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 622 | * the new package is assigned a different UID than it previously held. |
| 623 | * @hide |
| 624 | */ |
| 625 | public static final int INSTALL_FAILED_UID_CHANGED = -24; |
| 626 | |
| 627 | /** |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 628 | * Installation return code: this is passed to the {@link IPackageInstallObserver} by |
| 629 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if |
| 630 | * the new package has an older version code than the currently installed package. |
| 631 | * @hide |
| 632 | */ |
| 633 | public static final int INSTALL_FAILED_VERSION_DOWNGRADE = -25; |
| 634 | |
| 635 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 636 | * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by |
| 637 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} |
| 638 | * if the parser was given a path that is not a file, or does not end with the expected |
| 639 | * '.apk' extension. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 640 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 641 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 642 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 643 | public static final int INSTALL_PARSE_FAILED_NOT_APK = -100; |
| 644 | |
| 645 | /** |
| 646 | * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by |
| 647 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} |
| 648 | * if the parser was unable to retrieve the AndroidManifest.xml file. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 649 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 650 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 651 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 652 | public static final int INSTALL_PARSE_FAILED_BAD_MANIFEST = -101; |
| 653 | |
| 654 | /** |
| 655 | * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by |
| 656 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} |
| 657 | * if the parser encountered an unexpected exception. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 658 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 659 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 660 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 661 | public static final int INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION = -102; |
| 662 | |
| 663 | /** |
| 664 | * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by |
| 665 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} |
| 666 | * if the parser did not find any certificates in the .apk. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 667 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 668 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 669 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 670 | public static final int INSTALL_PARSE_FAILED_NO_CERTIFICATES = -103; |
| 671 | |
| 672 | /** |
| 673 | * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by |
| 674 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} |
| 675 | * if the parser found inconsistent certificates on the files in the .apk. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 676 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 677 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 678 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 679 | public static final int INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES = -104; |
| 680 | |
| 681 | /** |
| 682 | * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by |
| 683 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} |
| 684 | * if the parser encountered a CertificateEncodingException in one of the |
| 685 | * files in the .apk. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 686 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 687 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 688 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 689 | public static final int INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING = -105; |
| 690 | |
| 691 | /** |
| 692 | * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by |
| 693 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} |
| 694 | * if the parser encountered a bad or missing package name in the manifest. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 695 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 696 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 697 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 698 | public static final int INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME = -106; |
| 699 | |
| 700 | /** |
| 701 | * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by |
| 702 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} |
| 703 | * if the parser encountered a bad shared user id name in the manifest. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 704 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 705 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 706 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 707 | public static final int INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID = -107; |
| 708 | |
| 709 | /** |
| 710 | * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by |
| 711 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} |
| 712 | * if the parser encountered some structural problem in the manifest. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 713 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 714 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 715 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 716 | public static final int INSTALL_PARSE_FAILED_MANIFEST_MALFORMED = -108; |
| 717 | |
| 718 | /** |
| 719 | * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by |
| 720 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} |
| 721 | * if the parser did not find any actionable tags (instrumentation or application) |
| 722 | * in the manifest. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 723 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 724 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 725 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 726 | public static final int INSTALL_PARSE_FAILED_MANIFEST_EMPTY = -109; |
| 727 | |
| 728 | /** |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 729 | * Installation failed return code: this is passed to the {@link IPackageInstallObserver} by |
| 730 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} |
| 731 | * if the system failed to install the package because of system issues. |
| 732 | * @hide |
| 733 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 734 | @SystemApi |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 735 | public static final int INSTALL_FAILED_INTERNAL_ERROR = -110; |
| 736 | |
| 737 | /** |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 738 | * Installation failed return code: this is passed to the {@link IPackageInstallObserver} by |
| 739 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} |
| 740 | * if the system failed to install the package because the user is restricted from installing |
| 741 | * apps. |
| 742 | * @hide |
| 743 | */ |
| 744 | public static final int INSTALL_FAILED_USER_RESTRICTED = -111; |
| 745 | |
| 746 | /** |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 747 | * Installation failed return code: this is passed to the {@link IPackageInstallObserver} by |
| 748 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} |
| 749 | * if the system failed to install the package because it is attempting to define a |
| 750 | * permission that is already defined by some existing package. |
| 751 | * |
| 752 | * <p>The package name of the app which has already defined the permission is passed to |
| 753 | * a {@link IPackageInstallObserver2}, if any, as the {@link #EXTRA_EXISTING_PACKAGE} |
| 754 | * string extra; and the name of the permission being redefined is passed in the |
| 755 | * {@link #EXTRA_EXISTING_PERMISSION} string extra. |
| 756 | * @hide |
| 757 | */ |
| 758 | public static final int INSTALL_FAILED_DUPLICATE_PERMISSION = -112; |
| 759 | |
| 760 | /** |
Narayan Kamath | d11f223 | 2014-04-10 10:37:17 +0100 | [diff] [blame] | 761 | * Installation failed return code: this is passed to the {@link IPackageInstallObserver} by |
| 762 | * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 763 | * if the system failed to install the package because its packaged native code did not |
| 764 | * match any of the ABIs supported by the system. |
| 765 | * |
| 766 | * @hide |
| 767 | */ |
Narayan Kamath | d11f223 | 2014-04-10 10:37:17 +0100 | [diff] [blame] | 768 | public static final int INSTALL_FAILED_NO_MATCHING_ABIS = -113; |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 769 | |
| 770 | /** |
| 771 | * Internal return code for NativeLibraryHelper methods to indicate that the package |
| 772 | * being processed did not contain any native code. This is placed here only so that |
| 773 | * it can belong to the same value space as the other install failure codes. |
| 774 | * |
| 775 | * @hide |
| 776 | */ |
Narayan Kamath | d11f223 | 2014-04-10 10:37:17 +0100 | [diff] [blame] | 777 | public static final int NO_NATIVE_LIBRARIES = -114; |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 778 | |
| 779 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 780 | * Flag parameter for {@link #deletePackage} to indicate that you don't want to delete the |
| 781 | * package's data directory. |
| 782 | * |
| 783 | * @hide |
| 784 | */ |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 785 | public static final int DELETE_KEEP_DATA = 0x00000001; |
| 786 | |
| 787 | /** |
| 788 | * Flag parameter for {@link #deletePackage} to indicate that you want the |
| 789 | * package deleted for all users. |
| 790 | * |
| 791 | * @hide |
| 792 | */ |
| 793 | public static final int DELETE_ALL_USERS = 0x00000002; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 794 | |
| 795 | /** |
Dianne Hackborn | c895be7 | 2013-03-11 17:48:43 -0700 | [diff] [blame] | 796 | * Flag parameter for {@link #deletePackage} to indicate that, if you are calling |
| 797 | * uninstall on a system that has been updated, then don't do the normal process |
| 798 | * of uninstalling the update and rolling back to the older system version (which |
| 799 | * needs to happen for all users); instead, just mark the app as uninstalled for |
| 800 | * the current user. |
| 801 | * |
| 802 | * @hide |
| 803 | */ |
| 804 | public static final int DELETE_SYSTEM_APP = 0x00000004; |
| 805 | |
| 806 | /** |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 807 | * Return code for when package deletion succeeds. This is passed to the |
| 808 | * {@link IPackageDeleteObserver} by {@link #deletePackage()} if the system |
| 809 | * succeeded in deleting the package. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 810 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 811 | * @hide |
| 812 | */ |
| 813 | public static final int DELETE_SUCCEEDED = 1; |
| 814 | |
| 815 | /** |
| 816 | * Deletion failed return code: this is passed to the |
| 817 | * {@link IPackageDeleteObserver} by {@link #deletePackage()} if the system |
| 818 | * failed to delete the package for an unspecified reason. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 819 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 820 | * @hide |
| 821 | */ |
| 822 | public static final int DELETE_FAILED_INTERNAL_ERROR = -1; |
| 823 | |
| 824 | /** |
| 825 | * Deletion failed return code: this is passed to the |
| 826 | * {@link IPackageDeleteObserver} by {@link #deletePackage()} if the system |
| 827 | * failed to delete the package because it is the active DevicePolicy |
| 828 | * manager. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 829 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 830 | * @hide |
| 831 | */ |
| 832 | public static final int DELETE_FAILED_DEVICE_POLICY_MANAGER = -2; |
| 833 | |
| 834 | /** |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 835 | * Deletion failed return code: this is passed to the |
| 836 | * {@link IPackageDeleteObserver} by {@link #deletePackage()} if the system |
| 837 | * failed to delete the package since the user is restricted. |
| 838 | * |
| 839 | * @hide |
| 840 | */ |
| 841 | public static final int DELETE_FAILED_USER_RESTRICTED = -3; |
| 842 | |
| 843 | /** |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 844 | * Return code that is passed to the {@link IPackageMoveObserver} by |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 845 | * {@link #movePackage(android.net.Uri, IPackageMoveObserver)} when the |
| 846 | * package has been successfully moved by the system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 847 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 848 | * @hide |
| 849 | */ |
| 850 | public static final int MOVE_SUCCEEDED = 1; |
| 851 | /** |
| 852 | * Error code that is passed to the {@link IPackageMoveObserver} by |
| 853 | * {@link #movePackage(android.net.Uri, IPackageMoveObserver)} |
| 854 | * when the package hasn't been successfully moved by the system |
| 855 | * because of insufficient memory on specified media. |
| 856 | * @hide |
| 857 | */ |
| 858 | public static final int MOVE_FAILED_INSUFFICIENT_STORAGE = -1; |
| 859 | |
| 860 | /** |
| 861 | * Error code that is passed to the {@link IPackageMoveObserver} by |
| 862 | * {@link #movePackage(android.net.Uri, IPackageMoveObserver)} |
| 863 | * if the specified package doesn't exist. |
| 864 | * @hide |
| 865 | */ |
| 866 | public static final int MOVE_FAILED_DOESNT_EXIST = -2; |
| 867 | |
| 868 | /** |
| 869 | * Error code that is passed to the {@link IPackageMoveObserver} by |
| 870 | * {@link #movePackage(android.net.Uri, IPackageMoveObserver)} |
| 871 | * if the specified package cannot be moved since its a system package. |
| 872 | * @hide |
| 873 | */ |
| 874 | public static final int MOVE_FAILED_SYSTEM_PACKAGE = -3; |
| 875 | |
| 876 | /** |
| 877 | * Error code that is passed to the {@link IPackageMoveObserver} by |
| 878 | * {@link #movePackage(android.net.Uri, IPackageMoveObserver)} |
| 879 | * if the specified package cannot be moved since its forward locked. |
| 880 | * @hide |
| 881 | */ |
| 882 | public static final int MOVE_FAILED_FORWARD_LOCKED = -4; |
| 883 | |
| 884 | /** |
| 885 | * Error code that is passed to the {@link IPackageMoveObserver} by |
| 886 | * {@link #movePackage(android.net.Uri, IPackageMoveObserver)} |
| 887 | * if the specified package cannot be moved to the specified location. |
| 888 | * @hide |
| 889 | */ |
| 890 | public static final int MOVE_FAILED_INVALID_LOCATION = -5; |
| 891 | |
| 892 | /** |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 893 | * Error code that is passed to the {@link IPackageMoveObserver} by |
| 894 | * {@link #movePackage(android.net.Uri, IPackageMoveObserver)} |
| 895 | * if the specified package cannot be moved to the specified location. |
| 896 | * @hide |
| 897 | */ |
| 898 | public static final int MOVE_FAILED_INTERNAL_ERROR = -6; |
| 899 | |
| 900 | /** |
Kenny Root | deb1126 | 2010-08-02 11:36:21 -0700 | [diff] [blame] | 901 | * Error code that is passed to the {@link IPackageMoveObserver} by |
| 902 | * {@link #movePackage(android.net.Uri, IPackageMoveObserver)} if the |
| 903 | * specified package already has an operation pending in the |
| 904 | * {@link PackageHandler} queue. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 905 | * |
Kenny Root | deb1126 | 2010-08-02 11:36:21 -0700 | [diff] [blame] | 906 | * @hide |
| 907 | */ |
| 908 | public static final int MOVE_FAILED_OPERATION_PENDING = -7; |
| 909 | |
| 910 | /** |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 911 | * Flag parameter for {@link #movePackage} to indicate that |
| 912 | * the package should be moved to internal storage if its |
| 913 | * been installed on external media. |
| 914 | * @hide |
| 915 | */ |
| 916 | public static final int MOVE_INTERNAL = 0x00000001; |
| 917 | |
| 918 | /** |
| 919 | * Flag parameter for {@link #movePackage} to indicate that |
| 920 | * the package should be moved to external media. |
| 921 | * @hide |
| 922 | */ |
| 923 | public static final int MOVE_EXTERNAL_MEDIA = 0x00000002; |
| 924 | |
| 925 | /** |
Kenny Root | 05ca4c9 | 2011-09-15 10:36:25 -0700 | [diff] [blame] | 926 | * Usable by the required verifier as the {@code verificationCode} argument |
| 927 | * for {@link PackageManager#verifyPendingInstall} to indicate that it will |
| 928 | * allow the installation to proceed without any of the optional verifiers |
| 929 | * needing to vote. |
| 930 | * |
| 931 | * @hide |
| 932 | */ |
| 933 | public static final int VERIFICATION_ALLOW_WITHOUT_SUFFICIENT = 2; |
| 934 | |
| 935 | /** |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 936 | * Used as the {@code verificationCode} argument for |
| 937 | * {@link PackageManager#verifyPendingInstall} to indicate that the calling |
| 938 | * package verifier allows the installation to proceed. |
| 939 | */ |
| 940 | public static final int VERIFICATION_ALLOW = 1; |
| 941 | |
| 942 | /** |
| 943 | * Used as the {@code verificationCode} argument for |
| 944 | * {@link PackageManager#verifyPendingInstall} to indicate the calling |
| 945 | * package verifier does not vote to allow the installation to proceed. |
| 946 | */ |
| 947 | public static final int VERIFICATION_REJECT = -1; |
| 948 | |
| 949 | /** |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 950 | * Can be used as the {@code millisecondsToDelay} argument for |
| 951 | * {@link PackageManager#extendVerificationTimeout}. This is the |
| 952 | * maximum time {@code PackageManager} waits for the verification |
| 953 | * agent to return (in milliseconds). |
| 954 | */ |
| 955 | public static final long MAXIMUM_VERIFICATION_TIMEOUT = 60*60*1000; |
| 956 | |
| 957 | /** |
Amith Yamasani | 0b28549 | 2011-04-14 17:35:23 -0700 | [diff] [blame] | 958 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: The device's |
| 959 | * audio pipeline is low-latency, more suitable for audio applications sensitive to delays or |
| 960 | * lag in sound input or output. |
Dan Morrill | 898e1e8 | 2010-09-26 17:28:30 -0700 | [diff] [blame] | 961 | */ |
| 962 | @SdkConstant(SdkConstantType.FEATURE) |
| 963 | public static final String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency"; |
| 964 | |
| 965 | /** |
| 966 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 967 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 968 | * other devices via Bluetooth. |
| 969 | */ |
| 970 | @SdkConstant(SdkConstantType.FEATURE) |
| 971 | public static final String FEATURE_BLUETOOTH = "android.hardware.bluetooth"; |
| 972 | |
| 973 | /** |
| 974 | * Feature for {@link #getSystemAvailableFeatures} and |
Matthew Xie | a722772 | 2013-04-18 15:25:59 -0700 | [diff] [blame] | 975 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 976 | * other devices via Bluetooth Low Energy radio. |
| 977 | */ |
| 978 | @SdkConstant(SdkConstantType.FEATURE) |
| 979 | public static final String FEATURE_BLUETOOTH_LE = "android.hardware.bluetooth_le"; |
| 980 | |
| 981 | /** |
| 982 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 983 | * {@link #hasSystemFeature}: The device has a camera facing away |
| 984 | * from the screen. |
| 985 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 986 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 987 | public static final String FEATURE_CAMERA = "android.hardware.camera"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 988 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 989 | /** |
| 990 | * Feature for {@link #getSystemAvailableFeatures} and |
| 991 | * {@link #hasSystemFeature}: The device's camera supports auto-focus. |
| 992 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 993 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 994 | public static final String FEATURE_CAMERA_AUTOFOCUS = "android.hardware.camera.autofocus"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 995 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 996 | /** |
| 997 | * Feature for {@link #getSystemAvailableFeatures} and |
Eino-Ville Talvala | 752af83 | 2012-09-18 14:45:37 -0700 | [diff] [blame] | 998 | * {@link #hasSystemFeature}: The device has at least one camera pointing in |
Eino-Ville Talvala | 9131da2 | 2014-05-08 11:39:53 -0700 | [diff] [blame] | 999 | * 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] | 1000 | */ |
| 1001 | @SdkConstant(SdkConstantType.FEATURE) |
| 1002 | public static final String FEATURE_CAMERA_ANY = "android.hardware.camera.any"; |
| 1003 | |
| 1004 | /** |
| 1005 | * Feature for {@link #getSystemAvailableFeatures} and |
Eino-Ville Talvala | 9131da2 | 2014-05-08 11:39:53 -0700 | [diff] [blame] | 1006 | * {@link #hasSystemFeature}: The device can support having an external camera connected to it. |
| 1007 | * The external camera may not always be connected or available to applications to use. |
| 1008 | */ |
| 1009 | @SdkConstant(SdkConstantType.FEATURE) |
| 1010 | public static final String FEATURE_CAMERA_EXTERNAL = "android.hardware.camera.external"; |
| 1011 | |
| 1012 | /** |
| 1013 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1014 | * {@link #hasSystemFeature}: The device's camera supports flash. |
| 1015 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1016 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1017 | public static final String FEATURE_CAMERA_FLASH = "android.hardware.camera.flash"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1018 | |
| 1019 | /** |
| 1020 | * Feature for {@link #getSystemAvailableFeatures} and |
Chih-Chung Chang | de1057c | 2010-06-14 19:15:00 +0800 | [diff] [blame] | 1021 | * {@link #hasSystemFeature}: The device has a front facing camera. |
| 1022 | */ |
| 1023 | @SdkConstant(SdkConstantType.FEATURE) |
| 1024 | public static final String FEATURE_CAMERA_FRONT = "android.hardware.camera.front"; |
| 1025 | |
| 1026 | /** |
| 1027 | * Feature for {@link #getSystemAvailableFeatures} and |
Alex Ray | 0c9d61f | 2013-10-03 12:17:54 -0700 | [diff] [blame] | 1028 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 1029 | * consumer IR devices. |
| 1030 | */ |
| 1031 | @SdkConstant(SdkConstantType.FEATURE) |
| 1032 | public static final String FEATURE_CONSUMER_IR = "android.hardware.consumerir"; |
| 1033 | |
| 1034 | /** |
| 1035 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1036 | * {@link #hasSystemFeature}: The device supports one or more methods of |
| 1037 | * reporting current location. |
| 1038 | */ |
| 1039 | @SdkConstant(SdkConstantType.FEATURE) |
| 1040 | public static final String FEATURE_LOCATION = "android.hardware.location"; |
| 1041 | |
| 1042 | /** |
| 1043 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1044 | * {@link #hasSystemFeature}: The device has a Global Positioning System |
| 1045 | * receiver and can report precise location. |
| 1046 | */ |
| 1047 | @SdkConstant(SdkConstantType.FEATURE) |
| 1048 | public static final String FEATURE_LOCATION_GPS = "android.hardware.location.gps"; |
| 1049 | |
| 1050 | /** |
| 1051 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1052 | * {@link #hasSystemFeature}: The device can report location with coarse |
| 1053 | * accuracy using a network-based geolocation system. |
| 1054 | */ |
| 1055 | @SdkConstant(SdkConstantType.FEATURE) |
| 1056 | public static final String FEATURE_LOCATION_NETWORK = "android.hardware.location.network"; |
| 1057 | |
| 1058 | /** |
| 1059 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1060 | * {@link #hasSystemFeature}: The device can record audio via a |
| 1061 | * microphone. |
| 1062 | */ |
| 1063 | @SdkConstant(SdkConstantType.FEATURE) |
| 1064 | public static final String FEATURE_MICROPHONE = "android.hardware.microphone"; |
| 1065 | |
| 1066 | /** |
| 1067 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 76437d3 | 2010-09-01 11:17:20 -0700 | [diff] [blame] | 1068 | * {@link #hasSystemFeature}: The device can communicate using Near-Field |
| 1069 | * Communications (NFC). |
| 1070 | */ |
| 1071 | @SdkConstant(SdkConstantType.FEATURE) |
| 1072 | public static final String FEATURE_NFC = "android.hardware.nfc"; |
| 1073 | |
| 1074 | /** |
| 1075 | * Feature for {@link #getSystemAvailableFeatures} and |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1076 | * {@link #hasSystemFeature}: The device supports host- |
| 1077 | * based NFC card emulation. |
Martijn Coenen | df4d1d6 | 2013-08-28 11:18:58 -0700 | [diff] [blame] | 1078 | * |
| 1079 | * TODO remove when depending apps have moved to new constant. |
| 1080 | * @hide |
| 1081 | * @deprecated |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1082 | */ |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 1083 | @Deprecated |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1084 | @SdkConstant(SdkConstantType.FEATURE) |
| 1085 | public static final String FEATURE_NFC_HCE = "android.hardware.nfc.hce"; |
| 1086 | |
| 1087 | /** |
| 1088 | * Feature for {@link #getSystemAvailableFeatures} and |
Martijn Coenen | df4d1d6 | 2013-08-28 11:18:58 -0700 | [diff] [blame] | 1089 | * {@link #hasSystemFeature}: The device supports host- |
| 1090 | * based NFC card emulation. |
| 1091 | */ |
| 1092 | @SdkConstant(SdkConstantType.FEATURE) |
| 1093 | public static final String FEATURE_NFC_HOST_CARD_EMULATION = "android.hardware.nfc.hce"; |
| 1094 | |
| 1095 | /** |
| 1096 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1097 | * {@link #hasSystemFeature}: The device includes an accelerometer. |
| 1098 | */ |
| 1099 | @SdkConstant(SdkConstantType.FEATURE) |
| 1100 | public static final String FEATURE_SENSOR_ACCELEROMETER = "android.hardware.sensor.accelerometer"; |
| 1101 | |
| 1102 | /** |
| 1103 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1104 | * {@link #hasSystemFeature}: The device includes a barometer (air |
| 1105 | * pressure sensor.) |
| 1106 | */ |
| 1107 | @SdkConstant(SdkConstantType.FEATURE) |
| 1108 | public static final String FEATURE_SENSOR_BAROMETER = "android.hardware.sensor.barometer"; |
| 1109 | |
| 1110 | /** |
| 1111 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1112 | * {@link #hasSystemFeature}: The device includes a magnetometer (compass). |
| 1113 | */ |
| 1114 | @SdkConstant(SdkConstantType.FEATURE) |
| 1115 | public static final String FEATURE_SENSOR_COMPASS = "android.hardware.sensor.compass"; |
| 1116 | |
| 1117 | /** |
| 1118 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1119 | * {@link #hasSystemFeature}: The device includes a gyroscope. |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1120 | */ |
| 1121 | @SdkConstant(SdkConstantType.FEATURE) |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1122 | public static final String FEATURE_SENSOR_GYROSCOPE = "android.hardware.sensor.gyroscope"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1123 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1124 | /** |
| 1125 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1126 | * {@link #hasSystemFeature}: The device includes a light sensor. |
| 1127 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1128 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1129 | public static final String FEATURE_SENSOR_LIGHT = "android.hardware.sensor.light"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1130 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1131 | /** |
| 1132 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1133 | * {@link #hasSystemFeature}: The device includes a proximity sensor. |
| 1134 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1135 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1136 | public static final String FEATURE_SENSOR_PROXIMITY = "android.hardware.sensor.proximity"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1137 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1138 | /** |
| 1139 | * Feature for {@link #getSystemAvailableFeatures} and |
Aravind Akella | 068b0c0 | 2013-10-12 17:39:15 -0700 | [diff] [blame] | 1140 | * {@link #hasSystemFeature}: The device includes a hardware step counter. |
| 1141 | */ |
| 1142 | @SdkConstant(SdkConstantType.FEATURE) |
| 1143 | public static final String FEATURE_SENSOR_STEP_COUNTER = "android.hardware.sensor.stepcounter"; |
| 1144 | |
| 1145 | /** |
| 1146 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1147 | * {@link #hasSystemFeature}: The device includes a hardware step detector. |
| 1148 | */ |
| 1149 | @SdkConstant(SdkConstantType.FEATURE) |
| 1150 | public static final String FEATURE_SENSOR_STEP_DETECTOR = "android.hardware.sensor.stepdetector"; |
| 1151 | |
| 1152 | /** |
| 1153 | * Feature for {@link #getSystemAvailableFeatures} and |
Vinod Krishnan | 8afb23c | 2014-04-30 11:11:39 -0700 | [diff] [blame] | 1154 | * {@link #hasSystemFeature}: The device includes a heart rate monitor. |
| 1155 | */ |
| 1156 | @SdkConstant(SdkConstantType.FEATURE) |
| 1157 | public static final String FEATURE_SENSOR_HEART_RATE = "android.hardware.sensor.heartrate"; |
| 1158 | |
| 1159 | /** |
| 1160 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1161 | * {@link #hasSystemFeature}: The device has a telephony radio with data |
| 1162 | * communication support. |
| 1163 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1164 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1165 | public static final String FEATURE_TELEPHONY = "android.hardware.telephony"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1166 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1167 | /** |
| 1168 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1169 | * {@link #hasSystemFeature}: The device has a CDMA telephony stack. |
| 1170 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1171 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1172 | public static final String FEATURE_TELEPHONY_CDMA = "android.hardware.telephony.cdma"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1173 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1174 | /** |
| 1175 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1176 | * {@link #hasSystemFeature}: The device has a GSM telephony stack. |
| 1177 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1178 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1179 | public static final String FEATURE_TELEPHONY_GSM = "android.hardware.telephony.gsm"; |
Hung-ying Tyan | 3424c02 | 2010-08-27 18:08:19 +0800 | [diff] [blame] | 1180 | |
| 1181 | /** |
| 1182 | * Feature for {@link #getSystemAvailableFeatures} and |
Mike Lockwood | f4ca247 | 2011-02-27 11:23:25 -0800 | [diff] [blame] | 1183 | * {@link #hasSystemFeature}: The device supports connecting to USB devices |
| 1184 | * as the USB host. |
| 1185 | */ |
| 1186 | @SdkConstant(SdkConstantType.FEATURE) |
| 1187 | public static final String FEATURE_USB_HOST = "android.hardware.usb.host"; |
| 1188 | |
| 1189 | /** |
| 1190 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1191 | * {@link #hasSystemFeature}: The device supports connecting to USB accessories. |
| 1192 | */ |
| 1193 | @SdkConstant(SdkConstantType.FEATURE) |
| 1194 | public static final String FEATURE_USB_ACCESSORY = "android.hardware.usb.accessory"; |
| 1195 | |
| 1196 | /** |
| 1197 | * Feature for {@link #getSystemAvailableFeatures} and |
Hung-ying Tyan | 3424c02 | 2010-08-27 18:08:19 +0800 | [diff] [blame] | 1198 | * {@link #hasSystemFeature}: The SIP API is enabled on the device. |
| 1199 | */ |
| 1200 | @SdkConstant(SdkConstantType.FEATURE) |
| 1201 | public static final String FEATURE_SIP = "android.software.sip"; |
| 1202 | |
| 1203 | /** |
| 1204 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1205 | * {@link #hasSystemFeature}: The device supports SIP-based VOIP. |
| 1206 | */ |
| 1207 | @SdkConstant(SdkConstantType.FEATURE) |
| 1208 | public static final String FEATURE_SIP_VOIP = "android.software.sip.voip"; |
| 1209 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1210 | /** |
| 1211 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | b0fe033 | 2010-04-05 14:43:58 -0700 | [diff] [blame] | 1212 | * {@link #hasSystemFeature}: The device's display has a touch screen. |
| 1213 | */ |
| 1214 | @SdkConstant(SdkConstantType.FEATURE) |
| 1215 | public static final String FEATURE_TOUCHSCREEN = "android.hardware.touchscreen"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1216 | |
| 1217 | |
Dan Morrill | b0fe033 | 2010-04-05 14:43:58 -0700 | [diff] [blame] | 1218 | /** |
| 1219 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1220 | * {@link #hasSystemFeature}: The device's touch screen supports |
| 1221 | * multitouch sufficient for basic two-finger gesture detection. |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1222 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1223 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1224 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH = "android.hardware.touchscreen.multitouch"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1225 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1226 | /** |
| 1227 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1228 | * {@link #hasSystemFeature}: The device's touch screen is capable of |
| 1229 | * tracking two or more fingers fully independently. |
| 1230 | */ |
| 1231 | @SdkConstant(SdkConstantType.FEATURE) |
| 1232 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT = "android.hardware.touchscreen.multitouch.distinct"; |
| 1233 | |
| 1234 | /** |
| 1235 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 6993d3d | 2010-09-03 14:30:14 -0700 | [diff] [blame] | 1236 | * {@link #hasSystemFeature}: The device's touch screen is capable of |
| 1237 | * tracking a full hand of fingers fully independently -- that is, 5 or |
| 1238 | * more simultaneous independent pointers. |
| 1239 | */ |
| 1240 | @SdkConstant(SdkConstantType.FEATURE) |
| 1241 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND = "android.hardware.touchscreen.multitouch.jazzhand"; |
| 1242 | |
| 1243 | /** |
| 1244 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | a537687 | 2011-01-23 13:15:53 -0800 | [diff] [blame] | 1245 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 1246 | * does support touch emulation for basic events. For instance, the |
| 1247 | * device might use a mouse or remote control to drive a cursor, and |
| 1248 | * emulate basic touch pointer events like down, up, drag, etc. All |
| 1249 | * devices that support android.hardware.touchscreen or a sub-feature are |
| 1250 | * presumed to also support faketouch. |
| 1251 | */ |
| 1252 | @SdkConstant(SdkConstantType.FEATURE) |
| 1253 | public static final String FEATURE_FAKETOUCH = "android.hardware.faketouch"; |
| 1254 | |
| 1255 | /** |
| 1256 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | e22fe93 | 2011-06-08 20:24:29 -0700 | [diff] [blame] | 1257 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 1258 | * does support touch emulation for basic events that supports distinct |
| 1259 | * tracking of two or more fingers. This is an extension of |
| 1260 | * {@link #FEATURE_FAKETOUCH} for input devices with this capability. Note |
| 1261 | * that unlike a distinct multitouch screen as defined by |
| 1262 | * {@link #FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT}, these kinds of input |
| 1263 | * devices will not actually provide full two-finger gestures since the |
| 1264 | * input is being transformed to cursor movement on the screen. That is, |
| 1265 | * single finger gestures will move a cursor; two-finger swipes will |
| 1266 | * result in single-finger touch events; other two-finger gestures will |
| 1267 | * result in the corresponding two-finger touch event. |
| 1268 | */ |
| 1269 | @SdkConstant(SdkConstantType.FEATURE) |
| 1270 | public static final String FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT = "android.hardware.faketouch.multitouch.distinct"; |
| 1271 | |
| 1272 | /** |
| 1273 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1274 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 1275 | * does support touch emulation for basic events that supports tracking |
| 1276 | * a hand of fingers (5 or more fingers) fully independently. |
| 1277 | * This is an extension of |
| 1278 | * {@link #FEATURE_FAKETOUCH} for input devices with this capability. Note |
| 1279 | * that unlike a multitouch screen as defined by |
| 1280 | * {@link #FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND}, not all two finger |
| 1281 | * gestures can be detected due to the limitations described for |
| 1282 | * {@link #FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT}. |
| 1283 | */ |
| 1284 | @SdkConstant(SdkConstantType.FEATURE) |
| 1285 | public static final String FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND = "android.hardware.faketouch.multitouch.jazzhand"; |
| 1286 | |
| 1287 | /** |
| 1288 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | e289bff | 2011-06-13 19:33:22 -0700 | [diff] [blame] | 1289 | * {@link #hasSystemFeature}: The device supports portrait orientation |
| 1290 | * screens. For backwards compatibility, you can assume that if neither |
| 1291 | * this nor {@link #FEATURE_SCREEN_LANDSCAPE} is set then the device supports |
| 1292 | * both portrait and landscape. |
| 1293 | */ |
| 1294 | @SdkConstant(SdkConstantType.FEATURE) |
| 1295 | public static final String FEATURE_SCREEN_PORTRAIT = "android.hardware.screen.portrait"; |
| 1296 | |
| 1297 | /** |
| 1298 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1299 | * {@link #hasSystemFeature}: The device supports landscape orientation |
| 1300 | * screens. For backwards compatibility, you can assume that if neither |
| 1301 | * this nor {@link #FEATURE_SCREEN_PORTRAIT} is set then the device supports |
| 1302 | * both portrait and landscape. |
| 1303 | */ |
| 1304 | @SdkConstant(SdkConstantType.FEATURE) |
| 1305 | public static final String FEATURE_SCREEN_LANDSCAPE = "android.hardware.screen.landscape"; |
| 1306 | |
| 1307 | /** |
| 1308 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1309 | * {@link #hasSystemFeature}: The device supports live wallpapers. |
| 1310 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1311 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1312 | public static final String FEATURE_LIVE_WALLPAPER = "android.software.live_wallpaper"; |
Oscar Montemayor | 1228d0a | 2010-01-28 12:01:44 -0800 | [diff] [blame] | 1313 | /** |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1314 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 119bbc3 | 2013-03-22 17:27:25 -0700 | [diff] [blame] | 1315 | * {@link #hasSystemFeature}: The device supports app widgets. |
| 1316 | */ |
| 1317 | @SdkConstant(SdkConstantType.FEATURE) |
| 1318 | public static final String FEATURE_APP_WIDGETS = "android.software.app_widgets"; |
| 1319 | |
| 1320 | /** |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 1321 | * @hide |
| 1322 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1323 | * {@link #hasSystemFeature}: The device supports |
| 1324 | * {@link android.service.voice.VoiceInteractionService} and |
| 1325 | * {@link android.app.VoiceInteractor}. |
| 1326 | */ |
| 1327 | @SdkConstant(SdkConstantType.FEATURE) |
| 1328 | public static final String FEATURE_VOICE_RECOGNIZERS = "android.software.voice_recognizers"; |
| 1329 | |
| 1330 | |
| 1331 | /** |
Dianne Hackborn | 119bbc3 | 2013-03-22 17:27:25 -0700 | [diff] [blame] | 1332 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1333 | * {@link #hasSystemFeature}: The device supports a home screen that is replaceable |
| 1334 | * by third party applications. |
| 1335 | */ |
| 1336 | @SdkConstant(SdkConstantType.FEATURE) |
| 1337 | public static final String FEATURE_HOME_SCREEN = "android.software.home_screen"; |
| 1338 | |
| 1339 | /** |
| 1340 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1341 | * {@link #hasSystemFeature}: The device supports adding new input methods implemented |
| 1342 | * with the {@link android.inputmethodservice.InputMethodService} API. |
| 1343 | */ |
| 1344 | @SdkConstant(SdkConstantType.FEATURE) |
| 1345 | public static final String FEATURE_INPUT_METHODS = "android.software.input_methods"; |
| 1346 | |
| 1347 | /** |
| 1348 | * Feature for {@link #getSystemAvailableFeatures} and |
Amith Yamasani | 44a01b7 | 2013-09-16 10:44:57 -0700 | [diff] [blame] | 1349 | * {@link #hasSystemFeature}: The device supports device policy enforcement via device admins. |
| 1350 | */ |
| 1351 | @SdkConstant(SdkConstantType.FEATURE) |
| 1352 | public static final String FEATURE_DEVICE_ADMIN = "android.software.device_admin"; |
| 1353 | |
| 1354 | /** |
| 1355 | * Feature for {@link #getSystemAvailableFeatures} and |
Tim Kilbourn | f94b6a9 | 2014-03-07 15:13:48 -0800 | [diff] [blame] | 1356 | * {@link #hasSystemFeature}: The device supports leanback UI. This is |
| 1357 | * typically used in a living room television experience, but is a software |
| 1358 | * feature unlike {@link #FEATURE_TELEVISION}. Devices running with this |
| 1359 | * feature will use resources associated with the "television" UI mode. |
| 1360 | */ |
| 1361 | @SdkConstant(SdkConstantType.FEATURE) |
| 1362 | public static final String FEATURE_LEANBACK = "android.software.leanback"; |
| 1363 | |
| 1364 | /** |
| 1365 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1366 | * {@link #hasSystemFeature}: The device supports only leanback UI. Only |
| 1367 | * applications designed for this experience should be run, though this is |
| 1368 | * not enforced by the system. |
| 1369 | * @hide |
| 1370 | */ |
| 1371 | @SdkConstant(SdkConstantType.FEATURE) |
| 1372 | public static final String FEATURE_LEANBACK_ONLY = "android.software.leanback_only"; |
| 1373 | |
| 1374 | /** |
| 1375 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1376 | * {@link #hasSystemFeature}: The device supports WiFi (802.11) networking. |
| 1377 | */ |
| 1378 | @SdkConstant(SdkConstantType.FEATURE) |
| 1379 | public static final String FEATURE_WIFI = "android.hardware.wifi"; |
| 1380 | |
| 1381 | /** |
Irfan Sheriff | 45b8b46 | 2011-09-07 11:24:16 -0700 | [diff] [blame] | 1382 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1383 | * {@link #hasSystemFeature}: The device supports Wi-Fi Direct networking. |
| 1384 | */ |
| 1385 | @SdkConstant(SdkConstantType.FEATURE) |
| 1386 | public static final String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct"; |
| 1387 | |
| 1388 | /** |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 1389 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1390 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
| 1391 | * on a television. Television here is defined to be a typical living |
| 1392 | * room television experience: displayed on a big screen, where the user |
| 1393 | * is sitting far away from it, and the dominant form of input will be |
| 1394 | * something like a DPAD, not through touch or mouse. |
Tim Kilbourn | f94b6a9 | 2014-03-07 15:13:48 -0800 | [diff] [blame] | 1395 | * @deprecated use {@link #FEATURE_LEANBACK} instead. |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 1396 | */ |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 1397 | @Deprecated |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 1398 | @SdkConstant(SdkConstantType.FEATURE) |
| 1399 | public static final String FEATURE_TELEVISION = "android.hardware.type.television"; |
| 1400 | |
| 1401 | /** |
Justin Koh | b5731f0 | 2014-02-13 16:06:59 -0800 | [diff] [blame] | 1402 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1403 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
| 1404 | * on a watch. A watch here is defined to be a device worn on the body, perhaps on |
| 1405 | * the wrist. The user is very close when interacting with the device. |
| 1406 | */ |
| 1407 | @SdkConstant(SdkConstantType.FEATURE) |
| 1408 | public static final String FEATURE_WATCH = "android.hardware.type.watch"; |
| 1409 | |
| 1410 | /** |
Adam Lesinski | 3d9bcb9 | 2014-02-18 14:05:14 -0800 | [diff] [blame] | 1411 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 1412 | * The device supports printing. |
| 1413 | */ |
| 1414 | @SdkConstant(SdkConstantType.FEATURE) |
| 1415 | public static final String FEATURE_PRINTING = "android.software.print"; |
| 1416 | |
| 1417 | /** |
| 1418 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 1419 | * The device can perform backup and restore operations on installed applications. |
| 1420 | */ |
| 1421 | @SdkConstant(SdkConstantType.FEATURE) |
| 1422 | public static final String FEATURE_BACKUP = "android.software.backup"; |
| 1423 | |
| 1424 | /** |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 1425 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 1426 | * The device supports managed profiles for enterprise users. |
| 1427 | */ |
| 1428 | @SdkConstant(SdkConstantType.FEATURE) |
Adam Connors | 551c078 | 2014-06-05 12:13:03 +0100 | [diff] [blame] | 1429 | public static final String FEATURE_MANAGED_PROFILES = "android.software.managed_profiles"; |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 1430 | |
| 1431 | /** |
Ben Murdoch | f564c7f | 2014-05-20 18:58:06 +0100 | [diff] [blame] | 1432 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Ben Murdoch | 422c7a5 | 2014-05-16 13:45:47 +0100 | [diff] [blame] | 1433 | * The device has a full implementation of the android.webkit.* APIs. Devices |
| 1434 | * lacking this feature will not have a functioning WebView implementation. |
| 1435 | */ |
| 1436 | @SdkConstant(SdkConstantType.FEATURE) |
| 1437 | public static final String FEATURE_WEBVIEW = "android.software.webview"; |
| 1438 | |
| 1439 | /** |
Dianne Hackborn | e83cefc | 2010-02-04 17:38:14 -0800 | [diff] [blame] | 1440 | * Action to external storage service to clean out removed apps. |
| 1441 | * @hide |
| 1442 | */ |
| 1443 | public static final String ACTION_CLEAN_EXTERNAL_STORAGE |
| 1444 | = "android.content.pm.CLEAN_EXTERNAL_STORAGE"; |
Oscar Montemayor | 1228d0a | 2010-01-28 12:01:44 -0800 | [diff] [blame] | 1445 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1446 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1447 | * Extra field name for the URI to a verification file. Passed to a package |
| 1448 | * verifier. |
| 1449 | * |
| 1450 | * @hide |
| 1451 | */ |
| 1452 | public static final String EXTRA_VERIFICATION_URI = "android.content.pm.extra.VERIFICATION_URI"; |
| 1453 | |
| 1454 | /** |
| 1455 | * Extra field name for the ID of a package pending verification. Passed to |
| 1456 | * a package verifier and is used to call back to |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 1457 | * {@link PackageManager#verifyPendingInstall(int, int)} |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1458 | */ |
| 1459 | public static final String EXTRA_VERIFICATION_ID = "android.content.pm.extra.VERIFICATION_ID"; |
| 1460 | |
| 1461 | /** |
| 1462 | * Extra field name for the package identifier which is trying to install |
| 1463 | * the package. |
| 1464 | * |
| 1465 | * @hide |
| 1466 | */ |
| 1467 | public static final String EXTRA_VERIFICATION_INSTALLER_PACKAGE |
| 1468 | = "android.content.pm.extra.VERIFICATION_INSTALLER_PACKAGE"; |
| 1469 | |
| 1470 | /** |
| 1471 | * Extra field name for the requested install flags for a package pending |
| 1472 | * verification. Passed to a package verifier. |
| 1473 | * |
| 1474 | * @hide |
| 1475 | */ |
| 1476 | public static final String EXTRA_VERIFICATION_INSTALL_FLAGS |
| 1477 | = "android.content.pm.extra.VERIFICATION_INSTALL_FLAGS"; |
| 1478 | |
| 1479 | /** |
rich cannings | 13d428e | 2012-09-13 13:43:07 -0700 | [diff] [blame] | 1480 | * Extra field name for the uid of who is requesting to install |
| 1481 | * the package. |
| 1482 | * |
| 1483 | * @hide |
| 1484 | */ |
| 1485 | public static final String EXTRA_VERIFICATION_INSTALLER_UID |
| 1486 | = "android.content.pm.extra.VERIFICATION_INSTALLER_UID"; |
| 1487 | |
| 1488 | /** |
| 1489 | * Extra field name for the package name of a package pending verification. |
| 1490 | * |
| 1491 | * @hide |
| 1492 | */ |
| 1493 | public static final String EXTRA_VERIFICATION_PACKAGE_NAME |
| 1494 | = "android.content.pm.extra.VERIFICATION_PACKAGE_NAME"; |
| 1495 | /** |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 1496 | * Extra field name for the result of a verification, either |
| 1497 | * {@link #VERIFICATION_ALLOW}, or {@link #VERIFICATION_REJECT}. |
| 1498 | * Passed to package verifiers after a package is verified. |
| 1499 | */ |
| 1500 | public static final String EXTRA_VERIFICATION_RESULT |
| 1501 | = "android.content.pm.extra.VERIFICATION_RESULT"; |
| 1502 | |
| 1503 | /** |
rich cannings | 13d428e | 2012-09-13 13:43:07 -0700 | [diff] [blame] | 1504 | * Extra field name for the version code of a package pending verification. |
| 1505 | * |
| 1506 | * @hide |
| 1507 | */ |
| 1508 | public static final String EXTRA_VERIFICATION_VERSION_CODE |
| 1509 | = "android.content.pm.extra.VERIFICATION_VERSION_CODE"; |
| 1510 | |
| 1511 | /** |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 1512 | * The action used to request that the user approve a permission request |
| 1513 | * from the application. |
| 1514 | * |
| 1515 | * @hide |
| 1516 | */ |
| 1517 | public static final String ACTION_REQUEST_PERMISSION |
| 1518 | = "android.content.pm.action.REQUEST_PERMISSION"; |
| 1519 | |
| 1520 | /** |
| 1521 | * Extra field name for the list of permissions, which the user must approve. |
| 1522 | * |
| 1523 | * @hide |
| 1524 | */ |
| 1525 | public static final String EXTRA_REQUEST_PERMISSION_PERMISSION_LIST |
| 1526 | = "android.content.pm.extra.PERMISSION_LIST"; |
| 1527 | |
| 1528 | /** |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 1529 | * String extra for {@link IPackageInstallObserver2} in the 'extras' Bundle in case of |
| 1530 | * {@link #INSTALL_FAILED_DUPLICATE_PERMISSION}. This extra names the package which provides |
| 1531 | * the existing definition for the permission. |
| 1532 | * @hide |
| 1533 | */ |
| 1534 | public static final String EXTRA_FAILURE_EXISTING_PACKAGE |
| 1535 | = "android.content.pm.extra.FAILURE_EXISTING_PACKAGE"; |
| 1536 | |
| 1537 | /** |
| 1538 | * String extra for {@link IPackageInstallObserver2} in the 'extras' Bundle in case of |
| 1539 | * {@link #INSTALL_FAILED_DUPLICATE_PERMISSION}. This extra names the permission that is |
| 1540 | * being redundantly defined by the package being installed. |
| 1541 | * @hide |
| 1542 | */ |
| 1543 | public static final String EXTRA_FAILURE_EXISTING_PERMISSION |
| 1544 | = "android.content.pm.extra.FAILURE_EXISTING_PERMISSION"; |
| 1545 | |
| 1546 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1547 | * Retrieve overall information about an application package that is |
| 1548 | * installed on the system. |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1549 | * <p> |
| 1550 | * Throws {@link NameNotFoundException} if a package with the given name can |
| 1551 | * not be found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1552 | * |
| 1553 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1554 | * desired package. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1555 | * @param flags Additional option flags. Use any combination of |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 1556 | * {@link #GET_ACTIVITIES}, {@link #GET_GIDS}, |
| 1557 | * {@link #GET_CONFIGURATIONS}, {@link #GET_INSTRUMENTATION}, |
| 1558 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 1559 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 1560 | * {@link #GET_SIGNATURES}, {@link #GET_UNINSTALLED_PACKAGES} to |
| 1561 | * modify the data returned. |
| 1562 | * @return Returns a PackageInfo object containing information about the |
| 1563 | * package. If flag GET_UNINSTALLED_PACKAGES is set and if the |
| 1564 | * package is not found in the list of installed applications, the |
| 1565 | * package information is retrieved from the list of uninstalled |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 1566 | * applications (which includes installed applications as well as |
| 1567 | * applications with data directory i.e. applications which had been |
| 1568 | * deleted with {@code DONT_DELETE_DATA} flag set). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1569 | * @see #GET_ACTIVITIES |
| 1570 | * @see #GET_GIDS |
| 1571 | * @see #GET_CONFIGURATIONS |
| 1572 | * @see #GET_INSTRUMENTATION |
| 1573 | * @see #GET_PERMISSIONS |
| 1574 | * @see #GET_PROVIDERS |
| 1575 | * @see #GET_RECEIVERS |
| 1576 | * @see #GET_SERVICES |
| 1577 | * @see #GET_SIGNATURES |
| 1578 | * @see #GET_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1579 | */ |
| 1580 | public abstract PackageInfo getPackageInfo(String packageName, int flags) |
| 1581 | throws NameNotFoundException; |
| 1582 | |
| 1583 | /** |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 1584 | * Map from the current package names in use on the device to whatever |
| 1585 | * the current canonical name of that package is. |
| 1586 | * @param names Array of current names to be mapped. |
| 1587 | * @return Returns an array of the same size as the original, containing |
| 1588 | * the canonical name for each package. |
| 1589 | */ |
| 1590 | public abstract String[] currentToCanonicalPackageNames(String[] names); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1591 | |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 1592 | /** |
| 1593 | * Map from a packages canonical name to the current name in use on the device. |
| 1594 | * @param names Array of new names to be mapped. |
| 1595 | * @return Returns an array of the same size as the original, containing |
| 1596 | * the current name for each package. |
| 1597 | */ |
| 1598 | public abstract String[] canonicalToCurrentPackageNames(String[] names); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1599 | |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 1600 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1601 | * Return a "good" intent to launch a front-door activity in a package, |
| 1602 | * for use for example to implement an "open" button when browsing through |
| 1603 | * packages. The current implementation will look first for a main |
| 1604 | * activity in the category {@link Intent#CATEGORY_INFO}, next for a |
| 1605 | * main activity in the category {@link Intent#CATEGORY_LAUNCHER}, or return |
| 1606 | * null if neither are found. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1607 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1608 | * <p>Throws {@link NameNotFoundException} if a package with the given |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 1609 | * name cannot be found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1610 | * |
| 1611 | * @param packageName The name of the package to inspect. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1612 | * |
Dianne Hackborn | 1941576 | 2010-12-15 00:20:27 -0800 | [diff] [blame] | 1613 | * @return Returns either a fully-qualified Intent that can be used to |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1614 | * launch the main activity in the package, or null if the package does |
| 1615 | * not contain such an activity. |
| 1616 | */ |
Mihai Preda | eae850c | 2009-05-13 10:13:48 +0200 | [diff] [blame] | 1617 | public abstract Intent getLaunchIntentForPackage(String packageName); |
| 1618 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1619 | /** |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 1620 | * Return a "good" intent to launch a front-door Leanback activity in a |
| 1621 | * package, for use for example to implement an "open" button when browsing |
| 1622 | * through packages. The current implementation will look for a main |
| 1623 | * activity in the category {@link Intent#CATEGORY_LEANBACK_LAUNCHER}, or |
| 1624 | * return null if no main leanback activities are found. |
| 1625 | * <p> |
| 1626 | * Throws {@link NameNotFoundException} if a package with the given name |
| 1627 | * cannot be found on the system. |
Adam Connors | 551c078 | 2014-06-05 12:13:03 +0100 | [diff] [blame] | 1628 | * |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 1629 | * @param packageName The name of the package to inspect. |
| 1630 | * @return Returns either a fully-qualified Intent that can be used to launch |
| 1631 | * the main Leanback activity in the package, or null if the package |
| 1632 | * does not contain such an activity. |
| 1633 | */ |
| 1634 | public abstract Intent getLeanbackLaunchIntentForPackage(String packageName); |
| 1635 | |
| 1636 | /** |
| 1637 | * Return an array of all of the secondary group-ids that have been assigned |
| 1638 | * to a package. |
| 1639 | * <p> |
| 1640 | * Throws {@link NameNotFoundException} if a package with the given name |
| 1641 | * cannot be found on the system. |
Adam Connors | 551c078 | 2014-06-05 12:13:03 +0100 | [diff] [blame] | 1642 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1643 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 1644 | * desired package. |
| 1645 | * @return Returns an int array of the assigned gids, or null if there are |
| 1646 | * none. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1647 | */ |
| 1648 | public abstract int[] getPackageGids(String packageName) |
| 1649 | throws NameNotFoundException; |
| 1650 | |
| 1651 | /** |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 1652 | * @hide Return the uid associated with the given package name for the |
| 1653 | * given user. |
| 1654 | * |
| 1655 | * <p>Throws {@link NameNotFoundException} if a package with the given |
| 1656 | * name can not be found on the system. |
| 1657 | * |
| 1658 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
| 1659 | * desired package. |
| 1660 | * @param userHandle The user handle identifier to look up the package under. |
| 1661 | * |
| 1662 | * @return Returns an integer uid who owns the given package name. |
| 1663 | */ |
| 1664 | public abstract int getPackageUid(String packageName, int userHandle) |
| 1665 | throws NameNotFoundException; |
| 1666 | |
| 1667 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1668 | * Retrieve all of the information we know about a particular permission. |
| 1669 | * |
| 1670 | * <p>Throws {@link NameNotFoundException} if a permission with the given |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 1671 | * name cannot be found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1672 | * |
| 1673 | * @param name The fully qualified name (i.e. com.google.permission.LOGIN) |
| 1674 | * of the permission you are interested in. |
| 1675 | * @param flags Additional option flags. Use {@link #GET_META_DATA} to |
| 1676 | * retrieve any meta-data associated with the permission. |
| 1677 | * |
| 1678 | * @return Returns a {@link PermissionInfo} containing information about the |
| 1679 | * permission. |
| 1680 | */ |
| 1681 | public abstract PermissionInfo getPermissionInfo(String name, int flags) |
| 1682 | throws NameNotFoundException; |
| 1683 | |
| 1684 | /** |
| 1685 | * Query for all of the permissions associated with a particular group. |
| 1686 | * |
| 1687 | * <p>Throws {@link NameNotFoundException} if the given group does not |
| 1688 | * exist. |
| 1689 | * |
| 1690 | * @param group The fully qualified name (i.e. com.google.permission.LOGIN) |
| 1691 | * of the permission group you are interested in. Use null to |
| 1692 | * find all of the permissions not associated with a group. |
| 1693 | * @param flags Additional option flags. Use {@link #GET_META_DATA} to |
| 1694 | * retrieve any meta-data associated with the permissions. |
| 1695 | * |
| 1696 | * @return Returns a list of {@link PermissionInfo} containing information |
| 1697 | * about all of the permissions in the given group. |
| 1698 | */ |
| 1699 | public abstract List<PermissionInfo> queryPermissionsByGroup(String group, |
| 1700 | int flags) throws NameNotFoundException; |
| 1701 | |
| 1702 | /** |
| 1703 | * Retrieve all of the information we know about a particular group of |
| 1704 | * permissions. |
| 1705 | * |
| 1706 | * <p>Throws {@link NameNotFoundException} if a permission group with the given |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 1707 | * name cannot be found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1708 | * |
| 1709 | * @param name The fully qualified name (i.e. com.google.permission_group.APPS) |
| 1710 | * of the permission you are interested in. |
| 1711 | * @param flags Additional option flags. Use {@link #GET_META_DATA} to |
| 1712 | * retrieve any meta-data associated with the permission group. |
| 1713 | * |
| 1714 | * @return Returns a {@link PermissionGroupInfo} containing information |
| 1715 | * about the permission. |
| 1716 | */ |
| 1717 | public abstract PermissionGroupInfo getPermissionGroupInfo(String name, |
| 1718 | int flags) throws NameNotFoundException; |
| 1719 | |
| 1720 | /** |
| 1721 | * Retrieve all of the known permission groups in the system. |
| 1722 | * |
| 1723 | * @param flags Additional option flags. Use {@link #GET_META_DATA} to |
| 1724 | * retrieve any meta-data associated with the permission group. |
| 1725 | * |
| 1726 | * @return Returns a list of {@link PermissionGroupInfo} containing |
| 1727 | * information about all of the known permission groups. |
| 1728 | */ |
| 1729 | public abstract List<PermissionGroupInfo> getAllPermissionGroups(int flags); |
| 1730 | |
| 1731 | /** |
| 1732 | * Retrieve all of the information we know about a particular |
| 1733 | * package/application. |
| 1734 | * |
| 1735 | * <p>Throws {@link NameNotFoundException} if an application with the given |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 1736 | * package name cannot be found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1737 | * |
| 1738 | * @param packageName The full name (i.e. com.google.apps.contacts) of an |
| 1739 | * application. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1740 | * @param flags Additional option flags. Use any combination of |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1741 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 1742 | * {@link #GET_UNINSTALLED_PACKAGES} to modify the data returned. |
| 1743 | * |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1744 | * @return {@link ApplicationInfo} Returns ApplicationInfo object containing |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1745 | * information about the package. |
| 1746 | * If flag GET_UNINSTALLED_PACKAGES is set and if the package is not |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1747 | * found in the list of installed applications, |
| 1748 | * the application information is retrieved from the |
| 1749 | * list of uninstalled applications(which includes |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1750 | * installed applications as well as applications |
| 1751 | * with data directory ie applications which had been |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 1752 | * deleted with {@code DONT_DELETE_DATA} flag set). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1753 | * |
| 1754 | * @see #GET_META_DATA |
| 1755 | * @see #GET_SHARED_LIBRARY_FILES |
| 1756 | * @see #GET_UNINSTALLED_PACKAGES |
| 1757 | */ |
| 1758 | public abstract ApplicationInfo getApplicationInfo(String packageName, |
| 1759 | int flags) throws NameNotFoundException; |
| 1760 | |
| 1761 | /** |
| 1762 | * Retrieve all of the information we know about a particular activity |
| 1763 | * class. |
| 1764 | * |
| 1765 | * <p>Throws {@link NameNotFoundException} if an activity with the given |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 1766 | * class name cannot be found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1767 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 1768 | * @param component The full component name (i.e. |
| 1769 | * com.google.apps.contacts/com.google.apps.contacts.ContactsList) of an Activity |
| 1770 | * class. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1771 | * @param flags Additional option flags. Use any combination of |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1772 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 1773 | * to modify the data (in ApplicationInfo) returned. |
| 1774 | * |
| 1775 | * @return {@link ActivityInfo} containing information about the activity. |
| 1776 | * |
| 1777 | * @see #GET_INTENT_FILTERS |
| 1778 | * @see #GET_META_DATA |
| 1779 | * @see #GET_SHARED_LIBRARY_FILES |
| 1780 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 1781 | public abstract ActivityInfo getActivityInfo(ComponentName component, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1782 | int flags) throws NameNotFoundException; |
| 1783 | |
| 1784 | /** |
| 1785 | * Retrieve all of the information we know about a particular receiver |
| 1786 | * class. |
| 1787 | * |
| 1788 | * <p>Throws {@link NameNotFoundException} if a receiver with the given |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 1789 | * class name cannot be found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1790 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 1791 | * @param component The full component name (i.e. |
| 1792 | * com.google.apps.calendar/com.google.apps.calendar.CalendarAlarm) of a Receiver |
| 1793 | * class. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1794 | * @param flags Additional option flags. Use any combination of |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1795 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 1796 | * to modify the data returned. |
| 1797 | * |
| 1798 | * @return {@link ActivityInfo} containing information about the receiver. |
| 1799 | * |
| 1800 | * @see #GET_INTENT_FILTERS |
| 1801 | * @see #GET_META_DATA |
| 1802 | * @see #GET_SHARED_LIBRARY_FILES |
| 1803 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 1804 | public abstract ActivityInfo getReceiverInfo(ComponentName component, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1805 | int flags) throws NameNotFoundException; |
| 1806 | |
| 1807 | /** |
| 1808 | * Retrieve all of the information we know about a particular service |
| 1809 | * class. |
| 1810 | * |
| 1811 | * <p>Throws {@link NameNotFoundException} if a service with the given |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 1812 | * class name cannot be found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1813 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 1814 | * @param component The full component name (i.e. |
| 1815 | * com.google.apps.media/com.google.apps.media.BackgroundPlayback) of a Service |
| 1816 | * class. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1817 | * @param flags Additional option flags. Use any combination of |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1818 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 1819 | * to modify the data returned. |
| 1820 | * |
| 1821 | * @return ServiceInfo containing information about the service. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1822 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1823 | * @see #GET_META_DATA |
| 1824 | * @see #GET_SHARED_LIBRARY_FILES |
| 1825 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 1826 | public abstract ServiceInfo getServiceInfo(ComponentName component, |
| 1827 | int flags) throws NameNotFoundException; |
| 1828 | |
| 1829 | /** |
| 1830 | * Retrieve all of the information we know about a particular content |
| 1831 | * provider class. |
| 1832 | * |
| 1833 | * <p>Throws {@link NameNotFoundException} if a provider with the given |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 1834 | * class name cannot be found on the system. |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 1835 | * |
| 1836 | * @param component The full component name (i.e. |
| 1837 | * com.google.providers.media/com.google.providers.media.MediaProvider) of a |
| 1838 | * ContentProvider class. |
| 1839 | * @param flags Additional option flags. Use any combination of |
| 1840 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 1841 | * to modify the data returned. |
| 1842 | * |
| 1843 | * @return ProviderInfo containing information about the service. |
| 1844 | * |
| 1845 | * @see #GET_META_DATA |
| 1846 | * @see #GET_SHARED_LIBRARY_FILES |
| 1847 | */ |
| 1848 | public abstract ProviderInfo getProviderInfo(ComponentName component, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1849 | int flags) throws NameNotFoundException; |
| 1850 | |
| 1851 | /** |
| 1852 | * Return a List of all packages that are installed |
| 1853 | * on the device. |
| 1854 | * |
| 1855 | * @param flags Additional option flags. Use any combination of |
| 1856 | * {@link #GET_ACTIVITIES}, |
| 1857 | * {@link #GET_GIDS}, |
| 1858 | * {@link #GET_CONFIGURATIONS}, |
| 1859 | * {@link #GET_INSTRUMENTATION}, |
| 1860 | * {@link #GET_PERMISSIONS}, |
| 1861 | * {@link #GET_PROVIDERS}, |
| 1862 | * {@link #GET_RECEIVERS}, |
| 1863 | * {@link #GET_SERVICES}, |
| 1864 | * {@link #GET_SIGNATURES}, |
| 1865 | * {@link #GET_UNINSTALLED_PACKAGES} to modify the data returned. |
| 1866 | * |
| 1867 | * @return A List of PackageInfo objects, one for each package that is |
| 1868 | * installed on the device. In the unlikely case of there being no |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1869 | * installed packages, an empty list is returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1870 | * If flag GET_UNINSTALLED_PACKAGES is set, a list of all |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 1871 | * applications including those deleted with {@code DONT_DELETE_DATA} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1872 | * (partially installed apps with data directory) will be returned. |
| 1873 | * |
| 1874 | * @see #GET_ACTIVITIES |
| 1875 | * @see #GET_GIDS |
| 1876 | * @see #GET_CONFIGURATIONS |
| 1877 | * @see #GET_INSTRUMENTATION |
| 1878 | * @see #GET_PERMISSIONS |
| 1879 | * @see #GET_PROVIDERS |
| 1880 | * @see #GET_RECEIVERS |
| 1881 | * @see #GET_SERVICES |
| 1882 | * @see #GET_SIGNATURES |
| 1883 | * @see #GET_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1884 | */ |
| 1885 | public abstract List<PackageInfo> getInstalledPackages(int flags); |
| 1886 | |
| 1887 | /** |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 1888 | * Return a List of all installed packages that are currently |
| 1889 | * holding any of the given permissions. |
| 1890 | * |
| 1891 | * @param flags Additional option flags. Use any combination of |
| 1892 | * {@link #GET_ACTIVITIES}, |
| 1893 | * {@link #GET_GIDS}, |
| 1894 | * {@link #GET_CONFIGURATIONS}, |
| 1895 | * {@link #GET_INSTRUMENTATION}, |
| 1896 | * {@link #GET_PERMISSIONS}, |
| 1897 | * {@link #GET_PROVIDERS}, |
| 1898 | * {@link #GET_RECEIVERS}, |
| 1899 | * {@link #GET_SERVICES}, |
| 1900 | * {@link #GET_SIGNATURES}, |
| 1901 | * {@link #GET_UNINSTALLED_PACKAGES} to modify the data returned. |
| 1902 | * |
| 1903 | * @return Returns a List of PackageInfo objects, one for each installed |
| 1904 | * application that is holding any of the permissions that were provided. |
| 1905 | * |
| 1906 | * @see #GET_ACTIVITIES |
| 1907 | * @see #GET_GIDS |
| 1908 | * @see #GET_CONFIGURATIONS |
| 1909 | * @see #GET_INSTRUMENTATION |
| 1910 | * @see #GET_PERMISSIONS |
| 1911 | * @see #GET_PROVIDERS |
| 1912 | * @see #GET_RECEIVERS |
| 1913 | * @see #GET_SERVICES |
| 1914 | * @see #GET_SIGNATURES |
| 1915 | * @see #GET_UNINSTALLED_PACKAGES |
| 1916 | */ |
| 1917 | public abstract List<PackageInfo> getPackagesHoldingPermissions( |
| 1918 | String[] permissions, int flags); |
| 1919 | |
| 1920 | /** |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 1921 | * Return a List of all packages that are installed on the device, for a specific user. |
| 1922 | * Requesting a list of installed packages for another user |
| 1923 | * will require the permission INTERACT_ACROSS_USERS_FULL. |
| 1924 | * @param flags Additional option flags. Use any combination of |
| 1925 | * {@link #GET_ACTIVITIES}, |
| 1926 | * {@link #GET_GIDS}, |
| 1927 | * {@link #GET_CONFIGURATIONS}, |
| 1928 | * {@link #GET_INSTRUMENTATION}, |
| 1929 | * {@link #GET_PERMISSIONS}, |
| 1930 | * {@link #GET_PROVIDERS}, |
| 1931 | * {@link #GET_RECEIVERS}, |
| 1932 | * {@link #GET_SERVICES}, |
| 1933 | * {@link #GET_SIGNATURES}, |
| 1934 | * {@link #GET_UNINSTALLED_PACKAGES} to modify the data returned. |
| 1935 | * @param userId The user for whom the installed packages are to be listed |
| 1936 | * |
| 1937 | * @return A List of PackageInfo objects, one for each package that is |
| 1938 | * installed on the device. In the unlikely case of there being no |
| 1939 | * installed packages, an empty list is returned. |
| 1940 | * If flag GET_UNINSTALLED_PACKAGES is set, a list of all |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 1941 | * applications including those deleted with {@code DONT_DELETE_DATA} |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 1942 | * (partially installed apps with data directory) will be returned. |
| 1943 | * |
| 1944 | * @see #GET_ACTIVITIES |
| 1945 | * @see #GET_GIDS |
| 1946 | * @see #GET_CONFIGURATIONS |
| 1947 | * @see #GET_INSTRUMENTATION |
| 1948 | * @see #GET_PERMISSIONS |
| 1949 | * @see #GET_PROVIDERS |
| 1950 | * @see #GET_RECEIVERS |
| 1951 | * @see #GET_SERVICES |
| 1952 | * @see #GET_SIGNATURES |
| 1953 | * @see #GET_UNINSTALLED_PACKAGES |
| 1954 | * |
| 1955 | * @hide |
| 1956 | */ |
| 1957 | public abstract List<PackageInfo> getInstalledPackages(int flags, int userId); |
| 1958 | |
| 1959 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1960 | * Check whether a particular package has been granted a particular |
| 1961 | * permission. |
| 1962 | * |
| 1963 | * @param permName The name of the permission you are checking for, |
| 1964 | * @param pkgName The name of the package you are checking against. |
| 1965 | * |
| 1966 | * @return If the package has the permission, PERMISSION_GRANTED is |
| 1967 | * returned. If it does not have the permission, PERMISSION_DENIED |
| 1968 | * is returned. |
| 1969 | * |
| 1970 | * @see #PERMISSION_GRANTED |
| 1971 | * @see #PERMISSION_DENIED |
| 1972 | */ |
| 1973 | public abstract int checkPermission(String permName, String pkgName); |
| 1974 | |
| 1975 | /** |
| 1976 | * Add a new dynamic permission to the system. For this to work, your |
| 1977 | * package must have defined a permission tree through the |
| 1978 | * {@link android.R.styleable#AndroidManifestPermissionTree |
| 1979 | * <permission-tree>} tag in its manifest. A package can only add |
| 1980 | * permissions to trees that were defined by either its own package or |
| 1981 | * another with the same user id; a permission is in a tree if it |
| 1982 | * matches the name of the permission tree + ".": for example, |
| 1983 | * "com.foo.bar" is a member of the permission tree "com.foo". |
| 1984 | * |
| 1985 | * <p>It is good to make your permission tree name descriptive, because you |
| 1986 | * are taking possession of that entire set of permission names. Thus, it |
| 1987 | * must be under a domain you control, with a suffix that will not match |
| 1988 | * any normal permissions that may be declared in any applications that |
| 1989 | * are part of that domain. |
| 1990 | * |
| 1991 | * <p>New permissions must be added before |
| 1992 | * any .apks are installed that use those permissions. Permissions you |
| 1993 | * add through this method are remembered across reboots of the device. |
| 1994 | * If the given permission already exists, the info you supply here |
| 1995 | * will be used to update it. |
| 1996 | * |
| 1997 | * @param info Description of the permission to be added. |
| 1998 | * |
| 1999 | * @return Returns true if a new permission was created, false if an |
| 2000 | * existing one was updated. |
| 2001 | * |
| 2002 | * @throws SecurityException if you are not allowed to add the |
| 2003 | * given permission name. |
| 2004 | * |
| 2005 | * @see #removePermission(String) |
| 2006 | */ |
| 2007 | public abstract boolean addPermission(PermissionInfo info); |
| 2008 | |
| 2009 | /** |
Dianne Hackborn | d7c0968 | 2010-03-30 10:42:20 -0700 | [diff] [blame] | 2010 | * Like {@link #addPermission(PermissionInfo)} but asynchronously |
| 2011 | * persists the package manager state after returning from the call, |
| 2012 | * allowing it to return quicker and batch a series of adds at the |
| 2013 | * expense of no guarantee the added permission will be retained if |
| 2014 | * the device is rebooted before it is written. |
| 2015 | */ |
| 2016 | public abstract boolean addPermissionAsync(PermissionInfo info); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2017 | |
Dianne Hackborn | d7c0968 | 2010-03-30 10:42:20 -0700 | [diff] [blame] | 2018 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2019 | * Removes a permission that was previously added with |
| 2020 | * {@link #addPermission(PermissionInfo)}. The same ownership rules apply |
| 2021 | * -- you are only allowed to remove permissions that you are allowed |
| 2022 | * to add. |
| 2023 | * |
| 2024 | * @param name The name of the permission to remove. |
| 2025 | * |
| 2026 | * @throws SecurityException if you are not allowed to remove the |
| 2027 | * given permission name. |
| 2028 | * |
| 2029 | * @see #addPermission(PermissionInfo) |
| 2030 | */ |
| 2031 | public abstract void removePermission(String name); |
| 2032 | |
| 2033 | /** |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2034 | * Returns an {@link Intent} suitable for passing to {@code startActivityForResult} |
| 2035 | * which prompts the user to grant {@code permissions} to this application. |
Nick Kralevich | 32eb5b1 | 2013-04-11 10:20:09 -0700 | [diff] [blame] | 2036 | * @hide |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2037 | * |
| 2038 | * @throws NullPointerException if {@code permissions} is {@code null}. |
| 2039 | * @throws IllegalArgumentException if {@code permissions} contains {@code null}. |
| 2040 | */ |
| 2041 | public Intent buildPermissionRequestIntent(String... permissions) { |
| 2042 | if (permissions == null) { |
| 2043 | throw new NullPointerException("permissions cannot be null"); |
| 2044 | } |
| 2045 | for (String permission : permissions) { |
| 2046 | if (permission == null) { |
| 2047 | throw new IllegalArgumentException("permissions cannot contain null"); |
| 2048 | } |
| 2049 | } |
| 2050 | |
| 2051 | Intent i = new Intent(ACTION_REQUEST_PERMISSION); |
| 2052 | i.putExtra(EXTRA_REQUEST_PERMISSION_PERMISSION_LIST, permissions); |
| 2053 | i.setPackage("com.android.packageinstaller"); |
| 2054 | return i; |
| 2055 | } |
| 2056 | |
| 2057 | /** |
Dianne Hackborn | e639da7 | 2012-02-21 15:11:13 -0800 | [diff] [blame] | 2058 | * Grant a permission to an application which the application does not |
| 2059 | * already have. The permission must have been requested by the application, |
| 2060 | * but as an optional permission. If the application is not allowed to |
| 2061 | * hold the permission, a SecurityException is thrown. |
| 2062 | * @hide |
| 2063 | * |
| 2064 | * @param packageName The name of the package that the permission will be |
| 2065 | * granted to. |
| 2066 | * @param permissionName The name of the permission. |
| 2067 | */ |
| 2068 | public abstract void grantPermission(String packageName, String permissionName); |
| 2069 | |
| 2070 | /** |
| 2071 | * Revoke a permission that was previously granted by {@link #grantPermission}. |
| 2072 | * @hide |
| 2073 | * |
| 2074 | * @param packageName The name of the package that the permission will be |
| 2075 | * granted to. |
| 2076 | * @param permissionName The name of the permission. |
| 2077 | */ |
| 2078 | public abstract void revokePermission(String packageName, String permissionName); |
| 2079 | |
| 2080 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2081 | * Compare the signatures of two packages to determine if the same |
| 2082 | * signature appears in both of them. If they do contain the same |
| 2083 | * signature, then they are allowed special privileges when working |
| 2084 | * with each other: they can share the same user-id, run instrumentation |
| 2085 | * against each other, etc. |
| 2086 | * |
| 2087 | * @param pkg1 First package name whose signature will be compared. |
| 2088 | * @param pkg2 Second package name whose signature will be compared. |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 2089 | * |
| 2090 | * @return Returns an integer indicating whether all signatures on the |
| 2091 | * two packages match. The value is >= 0 ({@link #SIGNATURE_MATCH}) if |
| 2092 | * all signatures match or < 0 if there is not a match ({@link |
| 2093 | * #SIGNATURE_NO_MATCH} or {@link #SIGNATURE_UNKNOWN_PACKAGE}). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2094 | * |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 2095 | * @see #checkSignatures(int, int) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2096 | * @see #SIGNATURE_MATCH |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2097 | * @see #SIGNATURE_NO_MATCH |
| 2098 | * @see #SIGNATURE_UNKNOWN_PACKAGE |
| 2099 | */ |
| 2100 | public abstract int checkSignatures(String pkg1, String pkg2); |
| 2101 | |
| 2102 | /** |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 2103 | * Like {@link #checkSignatures(String, String)}, but takes UIDs of |
| 2104 | * the two packages to be checked. This can be useful, for example, |
| 2105 | * when doing the check in an IPC, where the UID is the only identity |
| 2106 | * available. It is functionally identical to determining the package |
| 2107 | * associated with the UIDs and checking their signatures. |
| 2108 | * |
Joe Onorato | 25660ec | 2009-08-12 22:40:37 -0700 | [diff] [blame] | 2109 | * @param uid1 First UID whose signature will be compared. |
| 2110 | * @param uid2 Second UID whose signature will be compared. |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 2111 | * |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 2112 | * @return Returns an integer indicating whether all signatures on the |
| 2113 | * two packages match. The value is >= 0 ({@link #SIGNATURE_MATCH}) if |
| 2114 | * all signatures match or < 0 if there is not a match ({@link |
| 2115 | * #SIGNATURE_NO_MATCH} or {@link #SIGNATURE_UNKNOWN_PACKAGE}). |
| 2116 | * |
| 2117 | * @see #checkSignatures(String, String) |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 2118 | * @see #SIGNATURE_MATCH |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 2119 | * @see #SIGNATURE_NO_MATCH |
| 2120 | * @see #SIGNATURE_UNKNOWN_PACKAGE |
| 2121 | */ |
| 2122 | public abstract int checkSignatures(int uid1, int uid2); |
| 2123 | |
| 2124 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2125 | * Retrieve the names of all packages that are associated with a particular |
| 2126 | * user id. In most cases, this will be a single package name, the package |
| 2127 | * that has been assigned that user id. Where there are multiple packages |
| 2128 | * sharing the same user id through the "sharedUserId" mechanism, all |
| 2129 | * packages with that id will be returned. |
| 2130 | * |
| 2131 | * @param uid The user id for which you would like to retrieve the |
| 2132 | * associated packages. |
| 2133 | * |
| 2134 | * @return Returns an array of one or more packages assigned to the user |
| 2135 | * id, or null if there are no known packages with the given id. |
| 2136 | */ |
| 2137 | public abstract String[] getPackagesForUid(int uid); |
| 2138 | |
| 2139 | /** |
| 2140 | * Retrieve the official name associated with a user id. This name is |
| 2141 | * guaranteed to never change, though it is possibly for the underlying |
| 2142 | * user id to be changed. That is, if you are storing information about |
| 2143 | * user ids in persistent storage, you should use the string returned |
| 2144 | * by this function instead of the raw user-id. |
| 2145 | * |
| 2146 | * @param uid The user id for which you would like to retrieve a name. |
| 2147 | * @return Returns a unique name for the given user id, or null if the |
| 2148 | * user id is not currently assigned. |
| 2149 | */ |
| 2150 | public abstract String getNameForUid(int uid); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2151 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2152 | /** |
| 2153 | * Return the user id associated with a shared user name. Multiple |
| 2154 | * applications can specify a shared user name in their manifest and thus |
| 2155 | * end up using a common uid. This might be used for new applications |
| 2156 | * that use an existing shared user name and need to know the uid of the |
| 2157 | * shared user. |
| 2158 | * |
| 2159 | * @param sharedUserName The shared user name whose uid is to be retrieved. |
| 2160 | * @return Returns the uid associated with the shared user, or NameNotFoundException |
| 2161 | * if the shared user name is not being used by any installed packages |
| 2162 | * @hide |
| 2163 | */ |
| 2164 | public abstract int getUidForSharedUser(String sharedUserName) |
| 2165 | throws NameNotFoundException; |
| 2166 | |
| 2167 | /** |
| 2168 | * Return a List of all application packages that are installed on the |
| 2169 | * device. If flag GET_UNINSTALLED_PACKAGES has been set, a list of all |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2170 | * applications including those deleted with {@code DONT_DELETE_DATA} (partially |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2171 | * installed apps with data directory) will be returned. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2172 | * |
| 2173 | * @param flags Additional option flags. Use any combination of |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2174 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
Jeff Smith | a45746e | 2012-07-19 14:19:24 -0500 | [diff] [blame] | 2175 | * {@link #GET_UNINSTALLED_PACKAGES} to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2176 | * |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 2177 | * @return Returns a List of ApplicationInfo objects, one for each application that |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2178 | * is installed on the device. In the unlikely case of there being |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2179 | * no installed applications, an empty list is returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2180 | * If flag GET_UNINSTALLED_PACKAGES is set, a list of all |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2181 | * applications including those deleted with {@code DONT_DELETE_DATA} |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2182 | * (partially installed apps with data directory) will be returned. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2183 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2184 | * @see #GET_META_DATA |
| 2185 | * @see #GET_SHARED_LIBRARY_FILES |
| 2186 | * @see #GET_UNINSTALLED_PACKAGES |
| 2187 | */ |
| 2188 | public abstract List<ApplicationInfo> getInstalledApplications(int flags); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2189 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2190 | /** |
| 2191 | * Get a list of shared libraries that are available on the |
| 2192 | * system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2193 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2194 | * @return An array of shared library names that are |
| 2195 | * available on the system, or null if none are installed. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2196 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2197 | */ |
| 2198 | public abstract String[] getSystemSharedLibraryNames(); |
| 2199 | |
| 2200 | /** |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 2201 | * Get a list of features that are available on the |
| 2202 | * system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2203 | * |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 2204 | * @return An array of FeatureInfo classes describing the features |
| 2205 | * that are available on the system, or null if there are none(!!). |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 2206 | */ |
| 2207 | public abstract FeatureInfo[] getSystemAvailableFeatures(); |
| 2208 | |
| 2209 | /** |
Dianne Hackborn | 039c68e | 2009-09-26 16:39:23 -0700 | [diff] [blame] | 2210 | * Check whether the given feature name is one of the available |
| 2211 | * features as returned by {@link #getSystemAvailableFeatures()}. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2212 | * |
Dianne Hackborn | 039c68e | 2009-09-26 16:39:23 -0700 | [diff] [blame] | 2213 | * @return Returns true if the devices supports the feature, else |
| 2214 | * false. |
| 2215 | */ |
| 2216 | public abstract boolean hasSystemFeature(String name); |
| 2217 | |
| 2218 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2219 | * Determine the best action to perform for a given Intent. This is how |
| 2220 | * {@link Intent#resolveActivity} finds an activity if a class has not |
| 2221 | * been explicitly specified. |
| 2222 | * |
Scott Main | ef6b305 | 2011-03-23 14:23:02 -0700 | [diff] [blame] | 2223 | * <p><em>Note:</em> if using an implicit Intent (without an explicit ComponentName |
Dianne Hackborn | 4d023d2 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 2224 | * specified), be sure to consider whether to set the {@link #MATCH_DEFAULT_ONLY} |
| 2225 | * only flag. You need to do so to resolve the activity in the same way |
| 2226 | * that {@link android.content.Context#startActivity(Intent)} and |
| 2227 | * {@link android.content.Intent#resolveActivity(PackageManager) |
| 2228 | * Intent.resolveActivity(PackageManager)} do.</p> |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2229 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2230 | * @param intent An intent containing all of the desired specification |
| 2231 | * (action, data, type, category, and/or component). |
| 2232 | * @param flags Additional option flags. The most important is |
Dianne Hackborn | 4d023d2 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 2233 | * {@link #MATCH_DEFAULT_ONLY}, to limit the resolution to only |
| 2234 | * those activities that support the {@link android.content.Intent#CATEGORY_DEFAULT}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2235 | * |
| 2236 | * @return Returns a ResolveInfo containing the final activity intent that |
| 2237 | * was determined to be the best action. Returns null if no |
Mike LeBeau | bd3f527 | 2010-02-18 19:27:17 -0800 | [diff] [blame] | 2238 | * matching activity was found. If multiple matching activities are |
| 2239 | * found and there is no default set, returns a ResolveInfo |
| 2240 | * containing something else, such as the activity resolver. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2241 | * |
| 2242 | * @see #MATCH_DEFAULT_ONLY |
| 2243 | * @see #GET_INTENT_FILTERS |
| 2244 | * @see #GET_RESOLVED_FILTER |
| 2245 | */ |
| 2246 | public abstract ResolveInfo resolveActivity(Intent intent, int flags); |
| 2247 | |
| 2248 | /** |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 2249 | * Determine the best action to perform for a given Intent for a given user. This |
| 2250 | * is how {@link Intent#resolveActivity} finds an activity if a class has not |
| 2251 | * been explicitly specified. |
| 2252 | * |
| 2253 | * <p><em>Note:</em> if using an implicit Intent (without an explicit ComponentName |
| 2254 | * specified), be sure to consider whether to set the {@link #MATCH_DEFAULT_ONLY} |
| 2255 | * only flag. You need to do so to resolve the activity in the same way |
| 2256 | * that {@link android.content.Context#startActivity(Intent)} and |
| 2257 | * {@link android.content.Intent#resolveActivity(PackageManager) |
| 2258 | * Intent.resolveActivity(PackageManager)} do.</p> |
| 2259 | * |
| 2260 | * @param intent An intent containing all of the desired specification |
| 2261 | * (action, data, type, category, and/or component). |
| 2262 | * @param flags Additional option flags. The most important is |
| 2263 | * {@link #MATCH_DEFAULT_ONLY}, to limit the resolution to only |
| 2264 | * those activities that support the {@link android.content.Intent#CATEGORY_DEFAULT}. |
| 2265 | * @param userId The user id. |
| 2266 | * |
| 2267 | * @return Returns a ResolveInfo containing the final activity intent that |
| 2268 | * was determined to be the best action. Returns null if no |
| 2269 | * matching activity was found. If multiple matching activities are |
| 2270 | * found and there is no default set, returns a ResolveInfo |
| 2271 | * containing something else, such as the activity resolver. |
| 2272 | * |
| 2273 | * @see #MATCH_DEFAULT_ONLY |
| 2274 | * @see #GET_INTENT_FILTERS |
| 2275 | * @see #GET_RESOLVED_FILTER |
| 2276 | * |
| 2277 | * @hide |
| 2278 | */ |
| 2279 | public abstract ResolveInfo resolveActivityAsUser(Intent intent, int flags, int userId); |
| 2280 | |
| 2281 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2282 | * Retrieve all activities that can be performed for the given intent. |
| 2283 | * |
| 2284 | * @param intent The desired intent as per resolveActivity(). |
| 2285 | * @param flags Additional option flags. The most important is |
Dianne Hackborn | 4d023d2 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 2286 | * {@link #MATCH_DEFAULT_ONLY}, to limit the resolution to only |
| 2287 | * those activities that support the {@link android.content.Intent#CATEGORY_DEFAULT}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2288 | * |
Dianne Hackborn | 4d023d2 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 2289 | * @return A List<ResolveInfo> containing one entry for each matching |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2290 | * Activity. These are ordered from best to worst match -- that |
| 2291 | * is, the first item in the list is what is returned by |
Dianne Hackborn | 4d023d2 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 2292 | * {@link #resolveActivity}. If there are no matching activities, an empty |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2293 | * list is returned. |
| 2294 | * |
| 2295 | * @see #MATCH_DEFAULT_ONLY |
| 2296 | * @see #GET_INTENT_FILTERS |
| 2297 | * @see #GET_RESOLVED_FILTER |
| 2298 | */ |
| 2299 | public abstract List<ResolveInfo> queryIntentActivities(Intent intent, |
| 2300 | int flags); |
| 2301 | |
| 2302 | /** |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 2303 | * Retrieve all activities that can be performed for the given intent, for a specific user. |
| 2304 | * |
| 2305 | * @param intent The desired intent as per resolveActivity(). |
| 2306 | * @param flags Additional option flags. The most important is |
| 2307 | * {@link #MATCH_DEFAULT_ONLY}, to limit the resolution to only |
| 2308 | * those activities that support the {@link android.content.Intent#CATEGORY_DEFAULT}. |
| 2309 | * |
| 2310 | * @return A List<ResolveInfo> containing one entry for each matching |
| 2311 | * Activity. These are ordered from best to worst match -- that |
| 2312 | * is, the first item in the list is what is returned by |
| 2313 | * {@link #resolveActivity}. If there are no matching activities, an empty |
| 2314 | * list is returned. |
| 2315 | * |
| 2316 | * @see #MATCH_DEFAULT_ONLY |
| 2317 | * @see #GET_INTENT_FILTERS |
| 2318 | * @see #GET_RESOLVED_FILTER |
Alexandra Gherghina | fa4533f | 2014-06-24 16:02:39 +0100 | [diff] [blame] | 2319 | * @see #NO_CROSS_PROFILE |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 2320 | * @hide |
| 2321 | */ |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 2322 | public abstract List<ResolveInfo> queryIntentActivitiesAsUser(Intent intent, |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 2323 | int flags, int userId); |
| 2324 | |
| 2325 | |
| 2326 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2327 | * Retrieve a set of activities that should be presented to the user as |
| 2328 | * similar options. This is like {@link #queryIntentActivities}, except it |
| 2329 | * also allows you to supply a list of more explicit Intents that you would |
| 2330 | * like to resolve to particular options, and takes care of returning the |
| 2331 | * final ResolveInfo list in a reasonable order, with no duplicates, based |
| 2332 | * on those inputs. |
| 2333 | * |
| 2334 | * @param caller The class name of the activity that is making the |
| 2335 | * request. This activity will never appear in the output |
| 2336 | * list. Can be null. |
| 2337 | * @param specifics An array of Intents that should be resolved to the |
| 2338 | * first specific results. Can be null. |
| 2339 | * @param intent The desired intent as per resolveActivity(). |
| 2340 | * @param flags Additional option flags. The most important is |
Dianne Hackborn | 4d023d2 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 2341 | * {@link #MATCH_DEFAULT_ONLY}, to limit the resolution to only |
| 2342 | * those activities that support the {@link android.content.Intent#CATEGORY_DEFAULT}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2343 | * |
Dianne Hackborn | 4d023d2 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 2344 | * @return A List<ResolveInfo> containing one entry for each matching |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2345 | * Activity. These are ordered first by all of the intents resolved |
| 2346 | * in <var>specifics</var> and then any additional activities that |
| 2347 | * can handle <var>intent</var> but did not get included by one of |
| 2348 | * the <var>specifics</var> intents. If there are no matching |
| 2349 | * activities, an empty list is returned. |
| 2350 | * |
| 2351 | * @see #MATCH_DEFAULT_ONLY |
| 2352 | * @see #GET_INTENT_FILTERS |
| 2353 | * @see #GET_RESOLVED_FILTER |
| 2354 | */ |
| 2355 | public abstract List<ResolveInfo> queryIntentActivityOptions( |
| 2356 | ComponentName caller, Intent[] specifics, Intent intent, int flags); |
| 2357 | |
| 2358 | /** |
| 2359 | * Retrieve all receivers that can handle a broadcast of the given intent. |
| 2360 | * |
| 2361 | * @param intent The desired intent as per resolveActivity(). |
Dianne Hackborn | 4d023d2 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 2362 | * @param flags Additional option flags. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2363 | * |
Dianne Hackborn | 4d023d2 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 2364 | * @return A List<ResolveInfo> containing one entry for each matching |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2365 | * Receiver. These are ordered from first to last in priority. If |
| 2366 | * there are no matching receivers, an empty list is returned. |
| 2367 | * |
| 2368 | * @see #MATCH_DEFAULT_ONLY |
| 2369 | * @see #GET_INTENT_FILTERS |
| 2370 | * @see #GET_RESOLVED_FILTER |
| 2371 | */ |
| 2372 | public abstract List<ResolveInfo> queryBroadcastReceivers(Intent intent, |
| 2373 | int flags); |
| 2374 | |
| 2375 | /** |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 2376 | * Retrieve all receivers that can handle a broadcast of the given intent, for a specific |
| 2377 | * user. |
| 2378 | * |
| 2379 | * @param intent The desired intent as per resolveActivity(). |
| 2380 | * @param flags Additional option flags. |
| 2381 | * @param userId The userId of the user being queried. |
| 2382 | * |
| 2383 | * @return A List<ResolveInfo> containing one entry for each matching |
| 2384 | * Receiver. These are ordered from first to last in priority. If |
| 2385 | * there are no matching receivers, an empty list is returned. |
| 2386 | * |
| 2387 | * @see #MATCH_DEFAULT_ONLY |
| 2388 | * @see #GET_INTENT_FILTERS |
| 2389 | * @see #GET_RESOLVED_FILTER |
| 2390 | * @hide |
| 2391 | */ |
| 2392 | public abstract List<ResolveInfo> queryBroadcastReceivers(Intent intent, |
| 2393 | int flags, int userId); |
| 2394 | |
| 2395 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2396 | * Determine the best service to handle for a given Intent. |
| 2397 | * |
| 2398 | * @param intent An intent containing all of the desired specification |
| 2399 | * (action, data, type, category, and/or component). |
| 2400 | * @param flags Additional option flags. |
| 2401 | * |
| 2402 | * @return Returns a ResolveInfo containing the final service intent that |
| 2403 | * was determined to be the best action. Returns null if no |
| 2404 | * matching service was found. |
| 2405 | * |
| 2406 | * @see #GET_INTENT_FILTERS |
| 2407 | * @see #GET_RESOLVED_FILTER |
| 2408 | */ |
| 2409 | public abstract ResolveInfo resolveService(Intent intent, int flags); |
| 2410 | |
| 2411 | /** |
| 2412 | * Retrieve all services that can match the given intent. |
| 2413 | * |
| 2414 | * @param intent The desired intent as per resolveService(). |
| 2415 | * @param flags Additional option flags. |
| 2416 | * |
Dianne Hackborn | 4d023d2 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 2417 | * @return A List<ResolveInfo> containing one entry for each matching |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2418 | * ServiceInfo. These are ordered from best to worst match -- that |
| 2419 | * is, the first item in the list is what is returned by |
| 2420 | * resolveService(). If there are no matching services, an empty |
| 2421 | * list is returned. |
| 2422 | * |
| 2423 | * @see #GET_INTENT_FILTERS |
| 2424 | * @see #GET_RESOLVED_FILTER |
| 2425 | */ |
| 2426 | public abstract List<ResolveInfo> queryIntentServices(Intent intent, |
| 2427 | int flags); |
| 2428 | |
| 2429 | /** |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 2430 | * Retrieve all services that can match the given intent for a given user. |
| 2431 | * |
| 2432 | * @param intent The desired intent as per resolveService(). |
| 2433 | * @param flags Additional option flags. |
| 2434 | * @param userId The user id. |
| 2435 | * |
| 2436 | * @return A List<ResolveInfo> containing one entry for each matching |
| 2437 | * ServiceInfo. These are ordered from best to worst match -- that |
| 2438 | * is, the first item in the list is what is returned by |
| 2439 | * resolveService(). If there are no matching services, an empty |
| 2440 | * list is returned. |
| 2441 | * |
| 2442 | * @see #GET_INTENT_FILTERS |
| 2443 | * @see #GET_RESOLVED_FILTER |
| 2444 | * |
| 2445 | * @hide |
| 2446 | */ |
| 2447 | public abstract List<ResolveInfo> queryIntentServicesAsUser(Intent intent, |
| 2448 | int flags, int userId); |
| 2449 | |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 2450 | /** {@hide} */ |
| 2451 | public abstract List<ResolveInfo> queryIntentContentProvidersAsUser( |
| 2452 | Intent intent, int flags, int userId); |
| 2453 | |
| 2454 | /** |
| 2455 | * Retrieve all providers that can match the given intent. |
| 2456 | * |
| 2457 | * @param intent An intent containing all of the desired specification |
| 2458 | * (action, data, type, category, and/or component). |
| 2459 | * @param flags Additional option flags. |
| 2460 | * @return A List<ResolveInfo> containing one entry for each matching |
| 2461 | * ProviderInfo. These are ordered from best to worst match. If |
| 2462 | * there are no matching providers, an empty list is returned. |
| 2463 | * @see #GET_INTENT_FILTERS |
| 2464 | * @see #GET_RESOLVED_FILTER |
| 2465 | */ |
| 2466 | public abstract List<ResolveInfo> queryIntentContentProviders(Intent intent, int flags); |
| 2467 | |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 2468 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2469 | * Find a single content provider by its base path name. |
| 2470 | * |
| 2471 | * @param name The name of the provider to find. |
| 2472 | * @param flags Additional option flags. Currently should always be 0. |
| 2473 | * |
| 2474 | * @return ContentProviderInfo Information about the provider, if found, |
| 2475 | * else null. |
| 2476 | */ |
| 2477 | public abstract ProviderInfo resolveContentProvider(String name, |
| 2478 | int flags); |
| 2479 | |
| 2480 | /** |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame^] | 2481 | * Find a single content provider by its base path name. |
| 2482 | * |
| 2483 | * @param name The name of the provider to find. |
| 2484 | * @param flags Additional option flags. Currently should always be 0. |
| 2485 | * @param userId The user id. |
| 2486 | * |
| 2487 | * @return ContentProviderInfo Information about the provider, if found, |
| 2488 | * else null. |
| 2489 | * @hide |
| 2490 | */ |
| 2491 | public abstract ProviderInfo resolveContentProviderAsUser(String name, int flags, int userId); |
| 2492 | |
| 2493 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2494 | * Retrieve content provider information. |
| 2495 | * |
| 2496 | * <p><em>Note: unlike most other methods, an empty result set is indicated |
| 2497 | * by a null return instead of an empty list.</em> |
| 2498 | * |
| 2499 | * @param processName If non-null, limits the returned providers to only |
| 2500 | * those that are hosted by the given process. If null, |
| 2501 | * all content providers are returned. |
| 2502 | * @param uid If <var>processName</var> is non-null, this is the required |
| 2503 | * uid owning the requested content providers. |
| 2504 | * @param flags Additional option flags. Currently should always be 0. |
| 2505 | * |
Dianne Hackborn | 4d023d2 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 2506 | * @return A List<ContentProviderInfo> containing one entry for each |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2507 | * content provider either patching <var>processName</var> or, if |
| 2508 | * <var>processName</var> is null, all known content providers. |
| 2509 | * <em>If there are no matching providers, null is returned.</em> |
| 2510 | */ |
| 2511 | public abstract List<ProviderInfo> queryContentProviders( |
| 2512 | String processName, int uid, int flags); |
| 2513 | |
| 2514 | /** |
| 2515 | * Retrieve all of the information we know about a particular |
| 2516 | * instrumentation class. |
| 2517 | * |
| 2518 | * <p>Throws {@link NameNotFoundException} if instrumentation with the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2519 | * given class name cannot be found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2520 | * |
| 2521 | * @param className The full name (i.e. |
| 2522 | * com.google.apps.contacts.InstrumentList) of an |
| 2523 | * Instrumentation class. |
| 2524 | * @param flags Additional option flags. Currently should always be 0. |
| 2525 | * |
| 2526 | * @return InstrumentationInfo containing information about the |
| 2527 | * instrumentation. |
| 2528 | */ |
| 2529 | public abstract InstrumentationInfo getInstrumentationInfo( |
| 2530 | ComponentName className, int flags) throws NameNotFoundException; |
| 2531 | |
| 2532 | /** |
| 2533 | * Retrieve information about available instrumentation code. May be used |
| 2534 | * to retrieve either all instrumentation code, or only the code targeting |
| 2535 | * a particular package. |
| 2536 | * |
| 2537 | * @param targetPackage If null, all instrumentation is returned; only the |
| 2538 | * instrumentation targeting this package name is |
| 2539 | * returned. |
| 2540 | * @param flags Additional option flags. Currently should always be 0. |
| 2541 | * |
Dianne Hackborn | 4d023d2 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 2542 | * @return A List<InstrumentationInfo> containing one entry for each |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2543 | * matching available Instrumentation. Returns an empty list if |
| 2544 | * there is no instrumentation available for the given package. |
| 2545 | */ |
| 2546 | public abstract List<InstrumentationInfo> queryInstrumentation( |
| 2547 | String targetPackage, int flags); |
| 2548 | |
| 2549 | /** |
| 2550 | * Retrieve an image from a package. This is a low-level API used by |
| 2551 | * the various package manager info structures (such as |
| 2552 | * {@link ComponentInfo} to implement retrieval of their associated |
| 2553 | * icon. |
| 2554 | * |
| 2555 | * @param packageName The name of the package that this icon is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2556 | * Cannot be null. |
| 2557 | * @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] | 2558 | * @param appInfo Overall information about <var>packageName</var>. This |
| 2559 | * may be null, in which case the application information will be retrieved |
| 2560 | * for you if needed; if you already have this information around, it can |
| 2561 | * be much more efficient to supply it here. |
| 2562 | * |
| 2563 | * @return Returns a Drawable holding the requested image. Returns null if |
| 2564 | * an image could not be found for any reason. |
| 2565 | */ |
| 2566 | public abstract Drawable getDrawable(String packageName, int resid, |
| 2567 | ApplicationInfo appInfo); |
| 2568 | |
| 2569 | /** |
| 2570 | * Retrieve the icon associated with an activity. Given the full name of |
| 2571 | * an activity, retrieves the information about it and calls |
| 2572 | * {@link ComponentInfo#loadIcon ComponentInfo.loadIcon()} to return its icon. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2573 | * If the activity cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2574 | * |
| 2575 | * @param activityName Name of the activity whose icon is to be retrieved. |
| 2576 | * |
| 2577 | * @return Returns the image of the icon, or the default activity icon if |
| 2578 | * it could not be found. Does not return null. |
| 2579 | * @throws NameNotFoundException Thrown if the resources for the given |
| 2580 | * activity could not be loaded. |
| 2581 | * |
| 2582 | * @see #getActivityIcon(Intent) |
| 2583 | */ |
| 2584 | public abstract Drawable getActivityIcon(ComponentName activityName) |
| 2585 | throws NameNotFoundException; |
| 2586 | |
| 2587 | /** |
| 2588 | * Retrieve the icon associated with an Intent. If intent.getClassName() is |
| 2589 | * set, this simply returns the result of |
| 2590 | * getActivityIcon(intent.getClassName()). Otherwise it resolves the intent's |
| 2591 | * component and returns the icon associated with the resolved component. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2592 | * 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] | 2593 | * to a component, NameNotFoundException is thrown. |
| 2594 | * |
| 2595 | * @param intent The intent for which you would like to retrieve an icon. |
| 2596 | * |
| 2597 | * @return Returns the image of the icon, or the default activity icon if |
| 2598 | * it could not be found. Does not return null. |
| 2599 | * @throws NameNotFoundException Thrown if the resources for application |
| 2600 | * matching the given intent could not be loaded. |
| 2601 | * |
| 2602 | * @see #getActivityIcon(ComponentName) |
| 2603 | */ |
| 2604 | public abstract Drawable getActivityIcon(Intent intent) |
| 2605 | throws NameNotFoundException; |
| 2606 | |
| 2607 | /** |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 2608 | * Retrieve the banner associated with an activity. Given the full name of |
| 2609 | * an activity, retrieves the information about it and calls |
| 2610 | * {@link ComponentInfo#loadIcon ComponentInfo.loadIcon()} to return its |
| 2611 | * banner. If the activity cannot be found, NameNotFoundException is thrown. |
| 2612 | * |
| 2613 | * @param activityName Name of the activity whose banner is to be retrieved. |
| 2614 | * @return Returns the image of the banner, or null if the activity has no |
| 2615 | * banner specified. |
| 2616 | * @throws NameNotFoundException Thrown if the resources for the given |
| 2617 | * activity could not be loaded. |
| 2618 | * @see #getActivityBanner(Intent) |
| 2619 | */ |
| 2620 | public abstract Drawable getActivityBanner(ComponentName activityName) |
| 2621 | throws NameNotFoundException; |
| 2622 | |
| 2623 | /** |
| 2624 | * Retrieve the banner associated with an Intent. If intent.getClassName() |
| 2625 | * is set, this simply returns the result of |
| 2626 | * getActivityBanner(intent.getClassName()). Otherwise it resolves the |
| 2627 | * intent's component and returns the banner associated with the resolved |
| 2628 | * component. If intent.getClassName() cannot be found or the Intent cannot |
| 2629 | * be resolved to a component, NameNotFoundException is thrown. |
| 2630 | * |
| 2631 | * @param intent The intent for which you would like to retrieve a banner. |
| 2632 | * @return Returns the image of the banner, or null if the activity has no |
| 2633 | * banner specified. |
| 2634 | * @throws NameNotFoundException Thrown if the resources for application |
| 2635 | * matching the given intent could not be loaded. |
| 2636 | * @see #getActivityBanner(ComponentName) |
| 2637 | */ |
| 2638 | public abstract Drawable getActivityBanner(Intent intent) |
| 2639 | throws NameNotFoundException; |
| 2640 | |
| 2641 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2642 | * Return the generic icon for an activity that is used when no specific |
| 2643 | * icon is defined. |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 2644 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2645 | * @return Drawable Image of the icon. |
| 2646 | */ |
| 2647 | public abstract Drawable getDefaultActivityIcon(); |
| 2648 | |
| 2649 | /** |
| 2650 | * Retrieve the icon associated with an application. If it has not defined |
| 2651 | * an icon, the default app icon is returned. Does not return null. |
| 2652 | * |
| 2653 | * @param info Information about application being queried. |
| 2654 | * |
| 2655 | * @return Returns the image of the icon, or the default application icon |
| 2656 | * if it could not be found. |
| 2657 | * |
| 2658 | * @see #getApplicationIcon(String) |
| 2659 | */ |
| 2660 | public abstract Drawable getApplicationIcon(ApplicationInfo info); |
| 2661 | |
| 2662 | /** |
| 2663 | * Retrieve the icon associated with an application. Given the name of the |
| 2664 | * application's package, retrieves the information about it and calls |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2665 | * 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] | 2666 | * found, NameNotFoundException is thrown. |
| 2667 | * |
| 2668 | * @param packageName Name of the package whose application icon is to be |
| 2669 | * retrieved. |
| 2670 | * |
| 2671 | * @return Returns the image of the icon, or the default application icon |
| 2672 | * if it could not be found. Does not return null. |
| 2673 | * @throws NameNotFoundException Thrown if the resources for the given |
| 2674 | * application could not be loaded. |
| 2675 | * |
| 2676 | * @see #getApplicationIcon(ApplicationInfo) |
| 2677 | */ |
| 2678 | public abstract Drawable getApplicationIcon(String packageName) |
| 2679 | throws NameNotFoundException; |
| 2680 | |
| 2681 | /** |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 2682 | * Retrieve the banner associated with an application. |
| 2683 | * |
| 2684 | * @param info Information about application being queried. |
| 2685 | * @return Returns the image of the banner or null if the application has no |
| 2686 | * banner specified. |
| 2687 | * @see #getApplicationBanner(String) |
| 2688 | */ |
| 2689 | public abstract Drawable getApplicationBanner(ApplicationInfo info); |
| 2690 | |
| 2691 | /** |
| 2692 | * Retrieve the banner associated with an application. Given the name of the |
| 2693 | * application's package, retrieves the information about it and calls |
| 2694 | * getApplicationIcon() to return its banner. If the application cannot be |
| 2695 | * found, NameNotFoundException is thrown. |
| 2696 | * |
| 2697 | * @param packageName Name of the package whose application banner is to be |
| 2698 | * retrieved. |
| 2699 | * @return Returns the image of the banner or null if the application has no |
| 2700 | * banner specified. |
| 2701 | * @throws NameNotFoundException Thrown if the resources for the given |
| 2702 | * application could not be loaded. |
| 2703 | * @see #getApplicationBanner(ApplicationInfo) |
| 2704 | */ |
| 2705 | public abstract Drawable getApplicationBanner(String packageName) |
| 2706 | throws NameNotFoundException; |
| 2707 | |
| 2708 | /** |
| 2709 | * Retrieve the logo associated with an activity. Given the full name of an |
| 2710 | * activity, retrieves the information about it and calls |
| 2711 | * {@link ComponentInfo#loadLogo ComponentInfo.loadLogo()} to return its |
| 2712 | * logo. If the activity cannot be found, NameNotFoundException is thrown. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 2713 | * |
| 2714 | * @param activityName Name of the activity whose logo is to be retrieved. |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 2715 | * @return Returns the image of the logo or null if the activity has no logo |
| 2716 | * specified. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 2717 | * @throws NameNotFoundException Thrown if the resources for the given |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 2718 | * activity could not be loaded. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 2719 | * @see #getActivityLogo(Intent) |
| 2720 | */ |
| 2721 | public abstract Drawable getActivityLogo(ComponentName activityName) |
| 2722 | throws NameNotFoundException; |
| 2723 | |
| 2724 | /** |
| 2725 | * Retrieve the logo associated with an Intent. If intent.getClassName() is |
| 2726 | * set, this simply returns the result of |
| 2727 | * getActivityLogo(intent.getClassName()). Otherwise it resolves the intent's |
| 2728 | * component and returns the logo associated with the resolved component. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2729 | * If intent.getClassName() cannot be found or the Intent cannot be resolved |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 2730 | * to a component, NameNotFoundException is thrown. |
| 2731 | * |
| 2732 | * @param intent The intent for which you would like to retrieve a logo. |
| 2733 | * |
| 2734 | * @return Returns the image of the logo, or null if the activity has no |
| 2735 | * logo specified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2736 | * |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 2737 | * @throws NameNotFoundException Thrown if the resources for application |
| 2738 | * matching the given intent could not be loaded. |
| 2739 | * |
| 2740 | * @see #getActivityLogo(ComponentName) |
| 2741 | */ |
| 2742 | public abstract Drawable getActivityLogo(Intent intent) |
| 2743 | throws NameNotFoundException; |
| 2744 | |
| 2745 | /** |
| 2746 | * Retrieve the logo associated with an application. If it has not specified |
| 2747 | * a logo, this method returns null. |
| 2748 | * |
| 2749 | * @param info Information about application being queried. |
| 2750 | * |
| 2751 | * @return Returns the image of the logo, or null if no logo is specified |
| 2752 | * by the application. |
| 2753 | * |
| 2754 | * @see #getApplicationLogo(String) |
| 2755 | */ |
| 2756 | public abstract Drawable getApplicationLogo(ApplicationInfo info); |
| 2757 | |
| 2758 | /** |
| 2759 | * Retrieve the logo associated with an application. Given the name of the |
| 2760 | * application's package, retrieves the information about it and calls |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2761 | * getApplicationLogo() to return its logo. If the application cannot be |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 2762 | * found, NameNotFoundException is thrown. |
| 2763 | * |
| 2764 | * @param packageName Name of the package whose application logo is to be |
| 2765 | * retrieved. |
| 2766 | * |
| 2767 | * @return Returns the image of the logo, or null if no application logo |
| 2768 | * has been specified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2769 | * |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 2770 | * @throws NameNotFoundException Thrown if the resources for the given |
| 2771 | * application could not be loaded. |
| 2772 | * |
| 2773 | * @see #getApplicationLogo(ApplicationInfo) |
| 2774 | */ |
| 2775 | public abstract Drawable getApplicationLogo(String packageName) |
| 2776 | throws NameNotFoundException; |
| 2777 | |
| 2778 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2779 | * Retrieve text from a package. This is a low-level API used by |
| 2780 | * the various package manager info structures (such as |
| 2781 | * {@link ComponentInfo} to implement retrieval of their associated |
| 2782 | * labels and other text. |
| 2783 | * |
| 2784 | * @param packageName The name of the package that this text is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2785 | * Cannot be null. |
| 2786 | * @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] | 2787 | * @param appInfo Overall information about <var>packageName</var>. This |
| 2788 | * may be null, in which case the application information will be retrieved |
| 2789 | * for you if needed; if you already have this information around, it can |
| 2790 | * be much more efficient to supply it here. |
| 2791 | * |
| 2792 | * @return Returns a CharSequence holding the requested text. Returns null |
| 2793 | * if the text could not be found for any reason. |
| 2794 | */ |
| 2795 | public abstract CharSequence getText(String packageName, int resid, |
| 2796 | ApplicationInfo appInfo); |
| 2797 | |
| 2798 | /** |
| 2799 | * Retrieve an XML file from a package. This is a low-level API used to |
| 2800 | * retrieve XML meta data. |
| 2801 | * |
| 2802 | * @param packageName The name of the package that this xml is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2803 | * Cannot be null. |
| 2804 | * @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] | 2805 | * @param appInfo Overall information about <var>packageName</var>. This |
| 2806 | * may be null, in which case the application information will be retrieved |
| 2807 | * for you if needed; if you already have this information around, it can |
| 2808 | * be much more efficient to supply it here. |
| 2809 | * |
| 2810 | * @return Returns an XmlPullParser allowing you to parse out the XML |
| 2811 | * data. Returns null if the xml resource could not be found for any |
| 2812 | * reason. |
| 2813 | */ |
| 2814 | public abstract XmlResourceParser getXml(String packageName, int resid, |
| 2815 | ApplicationInfo appInfo); |
| 2816 | |
| 2817 | /** |
| 2818 | * Return the label to use for this application. |
| 2819 | * |
| 2820 | * @return Returns the label associated with this application, or null if |
| 2821 | * it could not be found for any reason. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2822 | * @param info The application to get the label of. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2823 | */ |
| 2824 | public abstract CharSequence getApplicationLabel(ApplicationInfo info); |
| 2825 | |
| 2826 | /** |
| 2827 | * Retrieve the resources associated with an activity. Given the full |
| 2828 | * name of an activity, retrieves the information about it and calls |
| 2829 | * getResources() to return its application's resources. If the activity |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2830 | * cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2831 | * |
| 2832 | * @param activityName Name of the activity whose resources are to be |
| 2833 | * retrieved. |
| 2834 | * |
| 2835 | * @return Returns the application's Resources. |
| 2836 | * @throws NameNotFoundException Thrown if the resources for the given |
| 2837 | * application could not be loaded. |
| 2838 | * |
| 2839 | * @see #getResourcesForApplication(ApplicationInfo) |
| 2840 | */ |
| 2841 | public abstract Resources getResourcesForActivity(ComponentName activityName) |
| 2842 | throws NameNotFoundException; |
| 2843 | |
| 2844 | /** |
| 2845 | * Retrieve the resources for an application. Throws NameNotFoundException |
| 2846 | * if the package is no longer installed. |
| 2847 | * |
| 2848 | * @param app Information about the desired application. |
| 2849 | * |
| 2850 | * @return Returns the application's Resources. |
| 2851 | * @throws NameNotFoundException Thrown if the resources for the given |
| 2852 | * application could not be loaded (most likely because it was uninstalled). |
| 2853 | */ |
| 2854 | public abstract Resources getResourcesForApplication(ApplicationInfo app) |
| 2855 | throws NameNotFoundException; |
| 2856 | |
| 2857 | /** |
| 2858 | * Retrieve the resources associated with an application. Given the full |
| 2859 | * package name of an application, retrieves the information about it and |
| 2860 | * calls getResources() to return its application's resources. If the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2861 | * appPackageName cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2862 | * |
| 2863 | * @param appPackageName Package name of the application whose resources |
| 2864 | * are to be retrieved. |
| 2865 | * |
| 2866 | * @return Returns the application's Resources. |
| 2867 | * @throws NameNotFoundException Thrown if the resources for the given |
| 2868 | * application could not be loaded. |
| 2869 | * |
| 2870 | * @see #getResourcesForApplication(ApplicationInfo) |
| 2871 | */ |
| 2872 | public abstract Resources getResourcesForApplication(String appPackageName) |
| 2873 | throws NameNotFoundException; |
| 2874 | |
Amith Yamasani | 98edc95 | 2012-09-25 14:09:27 -0700 | [diff] [blame] | 2875 | /** @hide */ |
| 2876 | public abstract Resources getResourcesForApplicationAsUser(String appPackageName, int userId) |
| 2877 | throws NameNotFoundException; |
| 2878 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2879 | /** |
| 2880 | * Retrieve overall information about an application package defined |
| 2881 | * in a package archive file |
| 2882 | * |
| 2883 | * @param archiveFilePath The path to the archive file |
| 2884 | * @param flags Additional option flags. Use any combination of |
| 2885 | * {@link #GET_ACTIVITIES}, |
| 2886 | * {@link #GET_GIDS}, |
| 2887 | * {@link #GET_CONFIGURATIONS}, |
| 2888 | * {@link #GET_INSTRUMENTATION}, |
| 2889 | * {@link #GET_PERMISSIONS}, |
| 2890 | * {@link #GET_PROVIDERS}, |
| 2891 | * {@link #GET_RECEIVERS}, |
| 2892 | * {@link #GET_SERVICES}, |
| 2893 | * {@link #GET_SIGNATURES}, to modify the data returned. |
| 2894 | * |
| 2895 | * @return Returns the information about the package. Returns |
| 2896 | * null if the package could not be successfully parsed. |
| 2897 | * |
| 2898 | * @see #GET_ACTIVITIES |
| 2899 | * @see #GET_GIDS |
| 2900 | * @see #GET_CONFIGURATIONS |
| 2901 | * @see #GET_INSTRUMENTATION |
| 2902 | * @see #GET_PERMISSIONS |
| 2903 | * @see #GET_PROVIDERS |
| 2904 | * @see #GET_RECEIVERS |
| 2905 | * @see #GET_SERVICES |
| 2906 | * @see #GET_SIGNATURES |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2907 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2908 | */ |
| 2909 | public PackageInfo getPackageArchiveInfo(String archiveFilePath, int flags) { |
Jeff Sharkey | 275e085 | 2014-06-17 18:18:49 -0700 | [diff] [blame] | 2910 | final PackageParser parser = new PackageParser(); |
| 2911 | final File apkFile = new File(archiveFilePath); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 2912 | try { |
Jeff Sharkey | 275e085 | 2014-06-17 18:18:49 -0700 | [diff] [blame] | 2913 | PackageParser.Package pkg = parser.parseMonolithicPackage(apkFile, 0); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 2914 | if ((flags & GET_SIGNATURES) != 0) { |
Jeff Sharkey | 275e085 | 2014-06-17 18:18:49 -0700 | [diff] [blame] | 2915 | parser.collectCertificates(pkg, 0); |
Jeff Sharkey | 032f2b2 | 2014-06-19 15:48:47 -0700 | [diff] [blame] | 2916 | parser.collectManifestDigest(pkg); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 2917 | } |
| 2918 | PackageUserState state = new PackageUserState(); |
| 2919 | return PackageParser.generatePackageInfo(pkg, null, flags, 0, 0, null, state); |
| 2920 | } catch (PackageParserException e) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2921 | return null; |
| 2922 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2923 | } |
| 2924 | |
| 2925 | /** |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 2926 | * @hide |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2927 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2928 | * Install a package. Since this may take a little while, the result will |
| 2929 | * be posted back to the given observer. An installation will fail if the calling context |
| 2930 | * lacks the {@link android.Manifest.permission#INSTALL_PACKAGES} permission, if the |
| 2931 | * package named in the package file's manifest is already installed, or if there's no space |
| 2932 | * available on the device. |
| 2933 | * |
| 2934 | * @param packageURI The location of the package file to install. This can be a 'file:' or a |
| 2935 | * 'content:' URI. |
| 2936 | * @param observer An observer callback to get notified when the package installation is |
| 2937 | * complete. {@link IPackageInstallObserver#packageInstalled(String, int)} will be |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2938 | * called when that happens. This parameter must not be null. |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 2939 | * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK}, |
| 2940 | * {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}. |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 2941 | * @param installerPackageName Optional package name of the application that is performing the |
| 2942 | * installation. This identifies which market the package came from. |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2943 | * @deprecated Use {@link #installPackage(Uri, IPackageInstallObserver2, int, String)} |
| 2944 | * instead. This method will continue to be supported but the older observer interface |
| 2945 | * will not get additional failure details. |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 2946 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 2947 | // @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2948 | public abstract void installPackage( |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 2949 | Uri packageURI, IPackageInstallObserver observer, int flags, |
| 2950 | String installerPackageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2951 | |
| 2952 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 2953 | * Similar to |
| 2954 | * {@link #installPackage(Uri, IPackageInstallObserver, int, String)} but |
| 2955 | * with an extra verification file provided. |
| 2956 | * |
| 2957 | * @param packageURI The location of the package file to install. This can |
| 2958 | * be a 'file:' or a 'content:' URI. |
| 2959 | * @param observer An observer callback to get notified when the package |
| 2960 | * installation is complete. |
| 2961 | * {@link IPackageInstallObserver#packageInstalled(String, int)} |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2962 | * will be called when that happens. This parameter must not be null. |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2963 | * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK}, |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2964 | * {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}. |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2965 | * @param installerPackageName Optional package name of the application that |
| 2966 | * is performing the installation. This identifies which market |
| 2967 | * the package came from. |
| 2968 | * @param verificationURI The location of the supplementary verification |
| 2969 | * file. This can be a 'file:' or a 'content:' URI. May be |
| 2970 | * {@code null}. |
| 2971 | * @param manifestDigest an object that holds the digest of the package |
| 2972 | * which can be used to verify ownership. May be {@code null}. |
| 2973 | * @param encryptionParams if the package to be installed is encrypted, |
| 2974 | * these parameters describing the encryption and authentication |
| 2975 | * used. May be {@code null}. |
| 2976 | * @hide |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2977 | * @deprecated Use {@link #installPackageWithVerification(Uri, IPackageInstallObserver2, |
| 2978 | * int, String, Uri, ManifestDigest, ContainerEncryptionParams)} instead. This method will |
| 2979 | * continue to be supported but the older observer interface will not get additional failure |
| 2980 | * details. |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2981 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 2982 | // @SystemApi |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2983 | public abstract void installPackageWithVerification(Uri packageURI, |
| 2984 | IPackageInstallObserver observer, int flags, String installerPackageName, |
| 2985 | Uri verificationURI, ManifestDigest manifestDigest, |
| 2986 | ContainerEncryptionParams encryptionParams); |
| 2987 | |
| 2988 | /** |
| 2989 | * Similar to |
| 2990 | * {@link #installPackage(Uri, IPackageInstallObserver, int, String)} but |
| 2991 | * with an extra verification information provided. |
| 2992 | * |
| 2993 | * @param packageURI The location of the package file to install. This can |
| 2994 | * be a 'file:' or a 'content:' URI. |
| 2995 | * @param observer An observer callback to get notified when the package |
| 2996 | * installation is complete. |
| 2997 | * {@link IPackageInstallObserver#packageInstalled(String, int)} |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2998 | * will be called when that happens. This parameter must not be null. |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2999 | * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK}, |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 3000 | * {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}. |
| 3001 | * @param installerPackageName Optional package name of the application that |
| 3002 | * is performing the installation. This identifies which market |
| 3003 | * the package came from. |
| 3004 | * @param verificationParams an object that holds signal information to |
| 3005 | * assist verification. May be {@code null}. |
| 3006 | * @param encryptionParams if the package to be installed is encrypted, |
| 3007 | * these parameters describing the encryption and authentication |
| 3008 | * used. May be {@code null}. |
| 3009 | * |
| 3010 | * @hide |
| 3011 | * @deprecated Use {@link #installPackageWithVerificationAndEncryption(Uri, |
| 3012 | * IPackageInstallObserver2, int, String, VerificationParams, |
| 3013 | * ContainerEncryptionParams)} instead. This method will continue to be |
| 3014 | * supported but the older observer interface will not get additional failure details. |
| 3015 | */ |
| 3016 | @Deprecated |
| 3017 | public abstract void installPackageWithVerificationAndEncryption(Uri packageURI, |
| 3018 | IPackageInstallObserver observer, int flags, String installerPackageName, |
| 3019 | VerificationParams verificationParams, |
| 3020 | ContainerEncryptionParams encryptionParams); |
| 3021 | |
| 3022 | // Package-install variants that take the new, expanded form of observer interface. |
| 3023 | // Note that these *also* take the original observer type and will redundantly |
| 3024 | // report the same information to that observer if supplied; but it is not required. |
| 3025 | |
| 3026 | /** |
| 3027 | * @hide |
| 3028 | * |
| 3029 | * Install a package. Since this may take a little while, the result will |
| 3030 | * be posted back to the given observer. An installation will fail if the calling context |
| 3031 | * lacks the {@link android.Manifest.permission#INSTALL_PACKAGES} permission, if the |
| 3032 | * package named in the package file's manifest is already installed, or if there's no space |
| 3033 | * available on the device. |
| 3034 | * |
| 3035 | * @param packageURI The location of the package file to install. This can be a 'file:' or a |
| 3036 | * 'content:' URI. |
| 3037 | * @param observer An observer callback to get notified when the package installation is |
| 3038 | * complete. {@link PackageInstallObserver#packageInstalled(String, Bundle, int)} will be |
| 3039 | * called when that happens. This parameter must not be null. |
| 3040 | * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK}, |
| 3041 | * {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}. |
| 3042 | * @param installerPackageName Optional package name of the application that is performing the |
| 3043 | * installation. This identifies which market the package came from. |
| 3044 | */ |
| 3045 | public abstract void installPackage( |
| 3046 | Uri packageURI, PackageInstallObserver observer, |
| 3047 | int flags, String installerPackageName); |
| 3048 | |
| 3049 | /** |
| 3050 | * Similar to |
| 3051 | * {@link #installPackage(Uri, IPackageInstallObserver, int, String)} but |
| 3052 | * with an extra verification file provided. |
| 3053 | * |
| 3054 | * @param packageURI The location of the package file to install. This can |
| 3055 | * be a 'file:' or a 'content:' URI. |
| 3056 | * @param observer An observer callback to get notified when the package installation is |
| 3057 | * complete. {@link PackageInstallObserver#packageInstalled(String, Bundle, int)} will be |
| 3058 | * called when that happens. This parameter must not be null. |
| 3059 | * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK}, |
| 3060 | * {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}. |
| 3061 | * @param installerPackageName Optional package name of the application that |
| 3062 | * is performing the installation. This identifies which market |
| 3063 | * the package came from. |
| 3064 | * @param verificationURI The location of the supplementary verification |
| 3065 | * file. This can be a 'file:' or a 'content:' URI. May be |
| 3066 | * {@code null}. |
| 3067 | * @param manifestDigest an object that holds the digest of the package |
| 3068 | * which can be used to verify ownership. May be {@code null}. |
| 3069 | * @param encryptionParams if the package to be installed is encrypted, |
| 3070 | * these parameters describing the encryption and authentication |
| 3071 | * used. May be {@code null}. |
| 3072 | * @hide |
| 3073 | */ |
| 3074 | public abstract void installPackageWithVerification(Uri packageURI, |
| 3075 | PackageInstallObserver observer, int flags, String installerPackageName, |
| 3076 | Uri verificationURI, ManifestDigest manifestDigest, |
| 3077 | ContainerEncryptionParams encryptionParams); |
| 3078 | |
| 3079 | /** |
| 3080 | * Similar to |
| 3081 | * {@link #installPackage(Uri, IPackageInstallObserver, int, String)} but |
| 3082 | * with an extra verification information provided. |
| 3083 | * |
| 3084 | * @param packageURI The location of the package file to install. This can |
| 3085 | * be a 'file:' or a 'content:' URI. |
| 3086 | * @param observer An observer callback to get notified when the package installation is |
| 3087 | * complete. {@link PackageInstallObserver#packageInstalled(String, Bundle, int)} will be |
| 3088 | * called when that happens. This parameter must not be null. |
| 3089 | * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK}, |
| 3090 | * {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}. |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 3091 | * @param installerPackageName Optional package name of the application that |
| 3092 | * is performing the installation. This identifies which market |
| 3093 | * the package came from. |
| 3094 | * @param verificationParams an object that holds signal information to |
| 3095 | * assist verification. May be {@code null}. |
| 3096 | * @param encryptionParams if the package to be installed is encrypted, |
| 3097 | * these parameters describing the encryption and authentication |
| 3098 | * used. May be {@code null}. |
| 3099 | * |
| 3100 | * @hide |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 3101 | */ |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 3102 | public abstract void installPackageWithVerificationAndEncryption(Uri packageURI, |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 3103 | PackageInstallObserver observer, int flags, String installerPackageName, |
| 3104 | VerificationParams verificationParams, ContainerEncryptionParams encryptionParams); |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 3105 | |
rich cannings | 706e8ba | 2012-08-20 13:20:14 -0700 | [diff] [blame] | 3106 | /** |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3107 | * If there is already an application with the given package name installed |
| 3108 | * on the system for other users, also install it for the calling user. |
| 3109 | * @hide |
| 3110 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 3111 | // @SystemApi |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3112 | public abstract int installExistingPackage(String packageName) |
| 3113 | throws NameNotFoundException; |
| 3114 | |
| 3115 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 3116 | * Allows a package listening to the |
| 3117 | * {@link Intent#ACTION_PACKAGE_NEEDS_VERIFICATION package verification |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 3118 | * broadcast} to respond to the package manager. The response must include |
| 3119 | * the {@code verificationCode} which is one of |
| 3120 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 3121 | * {@link PackageManager#VERIFICATION_REJECT}. |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 3122 | * |
| 3123 | * @param id pending package identifier as passed via the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 3124 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 3125 | * @param verificationCode either {@link PackageManager#VERIFICATION_ALLOW} |
| 3126 | * or {@link PackageManager#VERIFICATION_REJECT}. |
rich cannings | 7e67151 | 2012-08-27 14:44:16 -0700 | [diff] [blame] | 3127 | * @throws SecurityException if the caller does not have the |
Dianne Hackborn | 8832c18 | 2012-09-17 17:20:24 -0700 | [diff] [blame] | 3128 | * PACKAGE_VERIFICATION_AGENT permission. |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 3129 | */ |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 3130 | public abstract void verifyPendingInstall(int id, int verificationCode); |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 3131 | |
| 3132 | /** |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 3133 | * Allows a package listening to the |
| 3134 | * {@link Intent#ACTION_PACKAGE_NEEDS_VERIFICATION package verification |
| 3135 | * broadcast} to extend the default timeout for a response and declare what |
| 3136 | * action to perform after the timeout occurs. The response must include |
| 3137 | * the {@code verificationCodeAtTimeout} which is one of |
| 3138 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 3139 | * {@link PackageManager#VERIFICATION_REJECT}. |
| 3140 | * |
| 3141 | * This method may only be called once per package id. Additional calls |
| 3142 | * will have no effect. |
| 3143 | * |
| 3144 | * @param id pending package identifier as passed via the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 3145 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 3146 | * @param verificationCodeAtTimeout either |
| 3147 | * {@link PackageManager#VERIFICATION_ALLOW} or |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 3148 | * {@link PackageManager#VERIFICATION_REJECT}. If |
| 3149 | * {@code verificationCodeAtTimeout} is neither |
| 3150 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 3151 | * {@link PackageManager#VERIFICATION_REJECT}, then |
| 3152 | * {@code verificationCodeAtTimeout} will default to |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 3153 | * {@link PackageManager#VERIFICATION_REJECT}. |
| 3154 | * @param millisecondsToDelay the amount of time requested for the timeout. |
| 3155 | * Must be positive and less than |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 3156 | * {@link PackageManager#MAXIMUM_VERIFICATION_TIMEOUT}. If |
| 3157 | * {@code millisecondsToDelay} is out of bounds, |
| 3158 | * {@code millisecondsToDelay} will be set to the closest in |
| 3159 | * bounds value; namely, 0 or |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 3160 | * {@link PackageManager#MAXIMUM_VERIFICATION_TIMEOUT}. |
rich cannings | 7e67151 | 2012-08-27 14:44:16 -0700 | [diff] [blame] | 3161 | * @throws SecurityException if the caller does not have the |
Dianne Hackborn | 8832c18 | 2012-09-17 17:20:24 -0700 | [diff] [blame] | 3162 | * PACKAGE_VERIFICATION_AGENT permission. |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 3163 | */ |
| 3164 | public abstract void extendVerificationTimeout(int id, |
| 3165 | int verificationCodeAtTimeout, long millisecondsToDelay); |
| 3166 | |
| 3167 | /** |
Dianne Hackborn | 880119b | 2010-11-18 22:26:40 -0800 | [diff] [blame] | 3168 | * Change the installer associated with a given package. There are limitations |
| 3169 | * on how the installer package can be changed; in particular: |
| 3170 | * <ul> |
| 3171 | * <li> A SecurityException will be thrown if <var>installerPackageName</var> |
| 3172 | * is not signed with the same certificate as the calling application. |
| 3173 | * <li> A SecurityException will be thrown if <var>targetPackage</var> already |
| 3174 | * has an installer package, and that installer package is not signed with |
| 3175 | * the same certificate as the calling application. |
| 3176 | * </ul> |
| 3177 | * |
| 3178 | * @param targetPackage The installed package whose installer will be changed. |
| 3179 | * @param installerPackageName The package name of the new installer. May be |
| 3180 | * null to clear the association. |
| 3181 | */ |
| 3182 | public abstract void setInstallerPackageName(String targetPackage, |
| 3183 | String installerPackageName); |
| 3184 | |
| 3185 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3186 | * Attempts to delete a package. Since this may take a little while, the result will |
| 3187 | * be posted back to the given observer. A deletion will fail if the calling context |
| 3188 | * lacks the {@link android.Manifest.permission#DELETE_PACKAGES} permission, if the |
| 3189 | * named package cannot be found, or if the named package is a "system package". |
| 3190 | * (TODO: include pointer to documentation on "system packages") |
| 3191 | * |
| 3192 | * @param packageName The name of the package to delete |
| 3193 | * @param observer An observer callback to get notified when the package deletion is |
| 3194 | * complete. {@link android.content.pm.IPackageDeleteObserver#packageDeleted(boolean)} will be |
| 3195 | * called when that happens. observer may be null to indicate that no callback is desired. |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 3196 | * @param flags - possible values: {@link #DELETE_KEEP_DATA}, |
| 3197 | * {@link #DELETE_ALL_USERS}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3198 | * |
| 3199 | * @hide |
| 3200 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 3201 | // @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3202 | public abstract void deletePackage( |
| 3203 | String packageName, IPackageDeleteObserver observer, int flags); |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 3204 | |
| 3205 | /** |
| 3206 | * Retrieve the package name of the application that installed a package. This identifies |
| 3207 | * which market the package came from. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3208 | * |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 3209 | * @param packageName The name of the package to query |
| 3210 | */ |
| 3211 | public abstract String getInstallerPackageName(String packageName); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3212 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3213 | /** |
| 3214 | * Attempts to clear the user data directory of an application. |
| 3215 | * Since this may take a little while, the result will |
| 3216 | * be posted back to the given observer. A deletion will fail if the |
| 3217 | * named package cannot be found, or if the named package is a "system package". |
| 3218 | * |
| 3219 | * @param packageName The name of the package |
| 3220 | * @param observer An observer callback to get notified when the operation is finished |
| 3221 | * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)} |
| 3222 | * will be called when that happens. observer may be null to indicate that |
| 3223 | * no callback is desired. |
| 3224 | * |
| 3225 | * @hide |
| 3226 | */ |
| 3227 | public abstract void clearApplicationUserData(String packageName, |
| 3228 | IPackageDataObserver observer); |
| 3229 | /** |
| 3230 | * Attempts to delete the cache files associated with an application. |
| 3231 | * Since this may take a little while, the result will |
| 3232 | * be posted back to the given observer. A deletion will fail if the calling context |
| 3233 | * lacks the {@link android.Manifest.permission#DELETE_CACHE_FILES} permission, if the |
| 3234 | * named package cannot be found, or if the named package is a "system package". |
| 3235 | * |
| 3236 | * @param packageName The name of the package to delete |
| 3237 | * @param observer An observer callback to get notified when the cache file deletion |
| 3238 | * is complete. |
| 3239 | * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)} |
| 3240 | * will be called when that happens. observer may be null to indicate that |
| 3241 | * no callback is desired. |
| 3242 | * |
| 3243 | * @hide |
| 3244 | */ |
| 3245 | public abstract void deleteApplicationCacheFiles(String packageName, |
| 3246 | IPackageDataObserver observer); |
| 3247 | |
| 3248 | /** |
| 3249 | * Free storage by deleting LRU sorted list of cache files across |
| 3250 | * all applications. If the currently available free storage |
| 3251 | * on the device is greater than or equal to the requested |
| 3252 | * free storage, no cache files are cleared. If the currently |
| 3253 | * available storage on the device is less than the requested |
| 3254 | * free storage, some or all of the cache files across |
| 3255 | * all applications are deleted (based on last accessed time) |
| 3256 | * to increase the free storage space on the device to |
| 3257 | * the requested value. There is no guarantee that clearing all |
| 3258 | * the cache files from all applications will clear up |
| 3259 | * enough storage to achieve the desired value. |
| 3260 | * @param freeStorageSize The number of bytes of storage to be |
| 3261 | * freed by the system. Say if freeStorageSize is XX, |
| 3262 | * and the current free storage is YY, |
| 3263 | * if XX is less than YY, just return. if not free XX-YY number |
| 3264 | * of bytes if possible. |
| 3265 | * @param observer call back used to notify when |
| 3266 | * the operation is completed |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3267 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3268 | * @hide |
| 3269 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 3270 | // @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3271 | public abstract void freeStorageAndNotify(long freeStorageSize, IPackageDataObserver observer); |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 3272 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3273 | /** |
| 3274 | * Free storage by deleting LRU sorted list of cache files across |
| 3275 | * all applications. If the currently available free storage |
| 3276 | * on the device is greater than or equal to the requested |
| 3277 | * free storage, no cache files are cleared. If the currently |
| 3278 | * available storage on the device is less than the requested |
| 3279 | * free storage, some or all of the cache files across |
| 3280 | * all applications are deleted (based on last accessed time) |
| 3281 | * to increase the free storage space on the device to |
| 3282 | * the requested value. There is no guarantee that clearing all |
| 3283 | * the cache files from all applications will clear up |
| 3284 | * enough storage to achieve the desired value. |
| 3285 | * @param freeStorageSize The number of bytes of storage to be |
| 3286 | * freed by the system. Say if freeStorageSize is XX, |
| 3287 | * and the current free storage is YY, |
| 3288 | * if XX is less than YY, just return. if not free XX-YY number |
| 3289 | * of bytes if possible. |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 3290 | * @param pi IntentSender call back used to |
| 3291 | * notify when the operation is completed.May be null |
| 3292 | * to indicate that no call back is desired. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3293 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3294 | * @hide |
| 3295 | */ |
Suchi Amalapurapu | bc806f6 | 2009-06-17 15:18:19 -0700 | [diff] [blame] | 3296 | public abstract void freeStorage(long freeStorageSize, IntentSender pi); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3297 | |
| 3298 | /** |
| 3299 | * Retrieve the size information for a package. |
| 3300 | * Since this may take a little while, the result will |
| 3301 | * be posted back to the given observer. The calling context |
| 3302 | * should have the {@link android.Manifest.permission#GET_PACKAGE_SIZE} permission. |
| 3303 | * |
| 3304 | * @param packageName The name of the package whose size information is to be retrieved |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 3305 | * @param userHandle The user whose size information should be retrieved. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3306 | * @param observer An observer callback to get notified when the operation |
| 3307 | * is complete. |
| 3308 | * {@link android.content.pm.IPackageStatsObserver#onGetStatsCompleted(PackageStats, boolean)} |
| 3309 | * The observer's callback is invoked with a PackageStats object(containing the |
| 3310 | * code, data and cache sizes of the package) and a boolean value representing |
| 3311 | * the status of the operation. observer may be null to indicate that |
| 3312 | * no callback is desired. |
| 3313 | * |
| 3314 | * @hide |
| 3315 | */ |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 3316 | public abstract void getPackageSizeInfo(String packageName, int userHandle, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3317 | IPackageStatsObserver observer); |
| 3318 | |
| 3319 | /** |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 3320 | * Like {@link #getPackageSizeInfo(String, int, IPackageStatsObserver)}, but |
| 3321 | * returns the size for the calling user. |
| 3322 | * |
| 3323 | * @hide |
| 3324 | */ |
| 3325 | public void getPackageSizeInfo(String packageName, IPackageStatsObserver observer) { |
| 3326 | getPackageSizeInfo(packageName, UserHandle.myUserId(), observer); |
| 3327 | } |
| 3328 | |
| 3329 | /** |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 3330 | * @deprecated This function no longer does anything; it was an old |
kmccormick | ac66b85 | 2013-03-28 15:17:15 -0700 | [diff] [blame] | 3331 | * approach to managing preferred activities, which has been superseded |
| 3332 | * by (and conflicts with) the modern activity-based preferences. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3333 | */ |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 3334 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3335 | public abstract void addPackageToPreferred(String packageName); |
| 3336 | |
| 3337 | /** |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 3338 | * @deprecated This function no longer does anything; it was an old |
kmccormick | ac66b85 | 2013-03-28 15:17:15 -0700 | [diff] [blame] | 3339 | * approach to managing preferred activities, which has been superseded |
| 3340 | * by (and conflicts with) the modern activity-based preferences. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3341 | */ |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 3342 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3343 | public abstract void removePackageFromPreferred(String packageName); |
| 3344 | |
| 3345 | /** |
| 3346 | * Retrieve the list of all currently configured preferred packages. The |
| 3347 | * first package on the list is the most preferred, the last is the |
| 3348 | * least preferred. |
| 3349 | * |
| 3350 | * @param flags Additional option flags. Use any combination of |
| 3351 | * {@link #GET_ACTIVITIES}, |
| 3352 | * {@link #GET_GIDS}, |
| 3353 | * {@link #GET_CONFIGURATIONS}, |
| 3354 | * {@link #GET_INSTRUMENTATION}, |
| 3355 | * {@link #GET_PERMISSIONS}, |
| 3356 | * {@link #GET_PROVIDERS}, |
| 3357 | * {@link #GET_RECEIVERS}, |
| 3358 | * {@link #GET_SERVICES}, |
| 3359 | * {@link #GET_SIGNATURES}, to modify the data returned. |
| 3360 | * |
| 3361 | * @return Returns a list of PackageInfo objects describing each |
| 3362 | * preferred application, in order of preference. |
| 3363 | * |
| 3364 | * @see #GET_ACTIVITIES |
| 3365 | * @see #GET_GIDS |
| 3366 | * @see #GET_CONFIGURATIONS |
| 3367 | * @see #GET_INSTRUMENTATION |
| 3368 | * @see #GET_PERMISSIONS |
| 3369 | * @see #GET_PROVIDERS |
| 3370 | * @see #GET_RECEIVERS |
| 3371 | * @see #GET_SERVICES |
| 3372 | * @see #GET_SIGNATURES |
| 3373 | */ |
| 3374 | public abstract List<PackageInfo> getPreferredPackages(int flags); |
| 3375 | |
| 3376 | /** |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 3377 | * @deprecated This is a protected API that should not have been available |
| 3378 | * to third party applications. It is the platform's responsibility for |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 3379 | * assigning preferred activities and this cannot be directly modified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3380 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3381 | * Add a new preferred activity mapping to the system. This will be used |
| 3382 | * to automatically select the given activity component when |
| 3383 | * {@link Context#startActivity(Intent) Context.startActivity()} finds |
| 3384 | * multiple matching activities and also matches the given filter. |
| 3385 | * |
| 3386 | * @param filter The set of intents under which this activity will be |
| 3387 | * made preferred. |
| 3388 | * @param match The IntentFilter match category that this preference |
| 3389 | * applies to. |
| 3390 | * @param set The set of activities that the user was picking from when |
| 3391 | * this preference was made. |
| 3392 | * @param activity The component name of the activity that is to be |
| 3393 | * preferred. |
| 3394 | */ |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 3395 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3396 | public abstract void addPreferredActivity(IntentFilter filter, int match, |
| 3397 | ComponentName[] set, ComponentName activity); |
| 3398 | |
| 3399 | /** |
Amith Yamasani | a3f133a | 2012-08-09 17:11:28 -0700 | [diff] [blame] | 3400 | * Same as {@link #addPreferredActivity(IntentFilter, int, |
| 3401 | ComponentName[], ComponentName)}, but with a specific userId to apply the preference |
| 3402 | to. |
| 3403 | * @hide |
| 3404 | */ |
| 3405 | public void addPreferredActivity(IntentFilter filter, int match, |
| 3406 | ComponentName[] set, ComponentName activity, int userId) { |
| 3407 | throw new RuntimeException("Not implemented. Must override in a subclass."); |
| 3408 | } |
| 3409 | |
| 3410 | /** |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 3411 | * @deprecated This is a protected API that should not have been available |
| 3412 | * to third party applications. It is the platform's responsibility for |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 3413 | * assigning preferred activities and this cannot be directly modified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3414 | * |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 3415 | * Replaces an existing preferred activity mapping to the system, and if that were not present |
| 3416 | * adds a new preferred activity. This will be used |
| 3417 | * to automatically select the given activity component when |
| 3418 | * {@link Context#startActivity(Intent) Context.startActivity()} finds |
| 3419 | * multiple matching activities and also matches the given filter. |
| 3420 | * |
| 3421 | * @param filter The set of intents under which this activity will be |
| 3422 | * made preferred. |
| 3423 | * @param match The IntentFilter match category that this preference |
| 3424 | * applies to. |
| 3425 | * @param set The set of activities that the user was picking from when |
| 3426 | * this preference was made. |
| 3427 | * @param activity The component name of the activity that is to be |
| 3428 | * preferred. |
| 3429 | * @hide |
| 3430 | */ |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 3431 | @Deprecated |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 3432 | public abstract void replacePreferredActivity(IntentFilter filter, int match, |
| 3433 | ComponentName[] set, ComponentName activity); |
| 3434 | |
| 3435 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3436 | * Remove all preferred activity mappings, previously added with |
| 3437 | * {@link #addPreferredActivity}, from the |
| 3438 | * system whose activities are implemented in the given package name. |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 3439 | * An application can only clear its own package(s). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3440 | * |
| 3441 | * @param packageName The name of the package whose preferred activity |
| 3442 | * mappings are to be removed. |
| 3443 | */ |
| 3444 | public abstract void clearPackagePreferredActivities(String packageName); |
| 3445 | |
| 3446 | /** |
| 3447 | * Retrieve all preferred activities, previously added with |
| 3448 | * {@link #addPreferredActivity}, that are |
| 3449 | * currently registered with the system. |
| 3450 | * |
| 3451 | * @param outFilters A list in which to place the filters of all of the |
| 3452 | * preferred activities, or null for none. |
| 3453 | * @param outActivities A list in which to place the component names of |
| 3454 | * all of the preferred activities, or null for none. |
| 3455 | * @param packageName An option package in which you would like to limit |
| 3456 | * the list. If null, all activities will be returned; if non-null, only |
| 3457 | * those activities in the given package are returned. |
| 3458 | * |
| 3459 | * @return Returns the total number of registered preferred activities |
| 3460 | * (the number of distinct IntentFilter records, not the number of unique |
| 3461 | * activity components) that were found. |
| 3462 | */ |
| 3463 | public abstract int getPreferredActivities(List<IntentFilter> outFilters, |
| 3464 | List<ComponentName> outActivities, String packageName); |
| 3465 | |
| 3466 | /** |
Christopher Tate | a2a0850 | 2013-09-05 16:38:58 -0700 | [diff] [blame] | 3467 | * Ask for the set of available 'home' activities and the current explicit |
| 3468 | * default, if any. |
| 3469 | * @hide |
| 3470 | */ |
| 3471 | public abstract ComponentName getHomeActivities(List<ResolveInfo> outActivities); |
| 3472 | |
| 3473 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3474 | * Set the enabled setting for a package component (activity, receiver, service, provider). |
| 3475 | * This setting will override any enabled state which may have been set by the component in its |
| 3476 | * manifest. |
| 3477 | * |
| 3478 | * @param componentName The component to enable |
| 3479 | * @param newState The new enabled state for the component. The legal values for this state |
| 3480 | * are: |
| 3481 | * {@link #COMPONENT_ENABLED_STATE_ENABLED}, |
| 3482 | * {@link #COMPONENT_ENABLED_STATE_DISABLED} |
| 3483 | * and |
| 3484 | * {@link #COMPONENT_ENABLED_STATE_DEFAULT} |
| 3485 | * The last one removes the setting, thereby restoring the component's state to |
| 3486 | * whatever was set in it's manifest (or enabled, by default). |
| 3487 | * @param flags Optional behavior flags: {@link #DONT_KILL_APP} or 0. |
| 3488 | */ |
| 3489 | public abstract void setComponentEnabledSetting(ComponentName componentName, |
| 3490 | int newState, int flags); |
| 3491 | |
| 3492 | |
| 3493 | /** |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 3494 | * Return the enabled setting for a package component (activity, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3495 | * receiver, service, provider). This returns the last value set by |
| 3496 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}; in most |
| 3497 | * cases this value will be {@link #COMPONENT_ENABLED_STATE_DEFAULT} since |
| 3498 | * the value originally specified in the manifest has not been modified. |
| 3499 | * |
| 3500 | * @param componentName The component to retrieve. |
| 3501 | * @return Returns the current enabled state for the component. May |
| 3502 | * be one of {@link #COMPONENT_ENABLED_STATE_ENABLED}, |
| 3503 | * {@link #COMPONENT_ENABLED_STATE_DISABLED}, or |
| 3504 | * {@link #COMPONENT_ENABLED_STATE_DEFAULT}. The last one means the |
| 3505 | * component's enabled state is based on the original information in |
| 3506 | * the manifest as found in {@link ComponentInfo}. |
| 3507 | */ |
| 3508 | public abstract int getComponentEnabledSetting(ComponentName componentName); |
| 3509 | |
| 3510 | /** |
| 3511 | * Set the enabled setting for an application |
| 3512 | * This setting will override any enabled state which may have been set by the application in |
| 3513 | * its manifest. It also overrides the enabled state set in the manifest for any of the |
| 3514 | * application's components. It does not override any enabled state set by |
| 3515 | * {@link #setComponentEnabledSetting} for any of the application's components. |
| 3516 | * |
| 3517 | * @param packageName The package name of the application to enable |
| 3518 | * @param newState The new enabled state for the component. The legal values for this state |
| 3519 | * are: |
| 3520 | * {@link #COMPONENT_ENABLED_STATE_ENABLED}, |
| 3521 | * {@link #COMPONENT_ENABLED_STATE_DISABLED} |
| 3522 | * and |
| 3523 | * {@link #COMPONENT_ENABLED_STATE_DEFAULT} |
| 3524 | * The last one removes the setting, thereby restoring the applications's state to |
| 3525 | * whatever was set in its manifest (or enabled, by default). |
| 3526 | * @param flags Optional behavior flags: {@link #DONT_KILL_APP} or 0. |
| 3527 | */ |
| 3528 | public abstract void setApplicationEnabledSetting(String packageName, |
| 3529 | int newState, int flags); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3530 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3531 | /** |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 3532 | * Return the enabled setting for an application. This returns |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3533 | * the last value set by |
| 3534 | * {@link #setApplicationEnabledSetting(String, int, int)}; in most |
| 3535 | * cases this value will be {@link #COMPONENT_ENABLED_STATE_DEFAULT} since |
| 3536 | * the value originally specified in the manifest has not been modified. |
| 3537 | * |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 3538 | * @param packageName The package name of the application to retrieve. |
| 3539 | * @return Returns the current enabled state for the application. May |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3540 | * be one of {@link #COMPONENT_ENABLED_STATE_ENABLED}, |
| 3541 | * {@link #COMPONENT_ENABLED_STATE_DISABLED}, or |
| 3542 | * {@link #COMPONENT_ENABLED_STATE_DEFAULT}. The last one means the |
| 3543 | * application's enabled state is based on the original information in |
| 3544 | * the manifest as found in {@link ComponentInfo}. |
Mathew Inwood | 1b9f8d9 | 2011-09-26 13:23:56 +0100 | [diff] [blame] | 3545 | * @throws IllegalArgumentException if the named package does not exist. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3546 | */ |
| 3547 | public abstract int getApplicationEnabledSetting(String packageName); |
| 3548 | |
| 3549 | /** |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 3550 | * Puts the package in a blocked state, which is almost like an uninstalled state, |
| 3551 | * making the package unavailable, but it doesn't remove the data or the actual |
| 3552 | * package file. |
| 3553 | * @hide |
| 3554 | */ |
| 3555 | public abstract boolean setApplicationBlockedSettingAsUser(String packageName, boolean blocked, |
| 3556 | UserHandle userHandle); |
| 3557 | |
| 3558 | /** |
| 3559 | * Returns the blocked state of a package. |
| 3560 | * @see #setApplicationBlockedSettingAsUser(String, boolean, UserHandle) |
| 3561 | * @hide |
| 3562 | */ |
| 3563 | public abstract boolean getApplicationBlockedSettingAsUser(String packageName, |
| 3564 | UserHandle userHandle); |
| 3565 | |
| 3566 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3567 | * Return whether the device has been booted into safe mode. |
| 3568 | */ |
| 3569 | public abstract boolean isSafeMode(); |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 3570 | |
| 3571 | /** |
| 3572 | * Attempts to move package resources from internal to external media or vice versa. |
| 3573 | * Since this may take a little while, the result will |
| 3574 | * be posted back to the given observer. This call may fail if the calling context |
| 3575 | * lacks the {@link android.Manifest.permission#MOVE_PACKAGE} permission, if the |
| 3576 | * named package cannot be found, or if the named package is a "system package". |
| 3577 | * |
| 3578 | * @param packageName The name of the package to delete |
| 3579 | * @param observer An observer callback to get notified when the package move is |
| 3580 | * complete. {@link android.content.pm.IPackageMoveObserver#packageMoved(boolean)} will be |
| 3581 | * called when that happens. observer may be null to indicate that no callback is desired. |
| 3582 | * @param flags To indicate install location {@link #MOVE_INTERNAL} or |
| 3583 | * {@link #MOVE_EXTERNAL_MEDIA} |
| 3584 | * |
| 3585 | * @hide |
| 3586 | */ |
| 3587 | public abstract void movePackage( |
| 3588 | String packageName, IPackageMoveObserver observer, int flags); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3589 | |
| 3590 | /** |
Amith Yamasani | 1359360 | 2012-03-22 16:16:17 -0700 | [diff] [blame] | 3591 | * Returns the device identity that verifiers can use to associate their scheme to a particular |
| 3592 | * 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] | 3593 | * |
Kenny Root | 0aaa0d9 | 2011-09-12 16:42:55 -0700 | [diff] [blame] | 3594 | * @return identity that uniquely identifies current device |
| 3595 | * @hide |
| 3596 | */ |
| 3597 | public abstract VerifierDeviceIdentity getVerifierDeviceIdentity(); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3598 | |
Jeff Sharkey | 3a44f3f | 2014-04-28 17:36:31 -0700 | [diff] [blame] | 3599 | /** {@hide} */ |
| 3600 | public abstract PackageInstaller getPackageInstaller(); |
| 3601 | |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 3602 | /** |
| 3603 | * Returns the data directory for a particular user and package, given the uid of the package. |
| 3604 | * @param uid uid of the package, including the userId and appId |
| 3605 | * @param packageName name of the package |
| 3606 | * @return the user-specific data directory for the package |
| 3607 | * @hide |
| 3608 | */ |
| 3609 | public static String getDataDirForUser(int userId, String packageName) { |
| 3610 | // TODO: This should be shared with Installer's knowledge of user directory |
| 3611 | return Environment.getDataDirectory().toString() + "/user/" + userId |
| 3612 | + "/" + packageName; |
| 3613 | } |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 3614 | |
| 3615 | /** |
Nicolas Prevot | 8194899 | 2014-05-16 18:25:26 +0100 | [diff] [blame] | 3616 | * Adds a {@link CrossProfileIntentFilter}. After calling this method all intents sent from the |
| 3617 | * user with id sourceUserId can also be be resolved by activities in the user with id |
| 3618 | * targetUserId if they match the specified intent filter. |
| 3619 | * @param filter the {@link IntentFilter} the intent has to match |
| 3620 | * @param removable if set to false, {@link clearCrossProfileIntentFilters} will not remove this |
| 3621 | * {@link CrossProfileIntentFilter} |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 3622 | * @hide |
| 3623 | */ |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 3624 | public abstract void addCrossProfileIntentFilter(IntentFilter filter, int sourceUserId, |
| 3625 | int targetUserId, int flags); |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 3626 | |
| 3627 | /** |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 3628 | * Clearing {@link CrossProfileIntentFilter}s which have the specified user as their |
| 3629 | * source, and have been set by the profile owner |
Nicolas Prevot | 8194899 | 2014-05-16 18:25:26 +0100 | [diff] [blame] | 3630 | * @param sourceUserId |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 3631 | * @hide |
| 3632 | */ |
Nicolas Prevot | 8194899 | 2014-05-16 18:25:26 +0100 | [diff] [blame] | 3633 | public abstract void clearCrossProfileIntentFilters(int sourceUserId); |
Alexandra Gherghina | 6e2ae25 | 2014-06-12 16:03:58 +0100 | [diff] [blame] | 3634 | |
| 3635 | /** |
| 3636 | * Forwards all intents for {@link packageName} for user {@link sourceUserId} to user |
| 3637 | * {@link targetUserId}. |
| 3638 | * @hide |
| 3639 | */ |
| 3640 | public abstract void addCrossProfileIntentsForPackage(String packageName, |
| 3641 | int sourceUserId, int targetUserId); |
Nicolas Prevot | 88cc346 | 2014-05-14 14:51:48 +0100 | [diff] [blame] | 3642 | /** |
| 3643 | * @hide |
| 3644 | */ |
| 3645 | public abstract Bitmap getUserIcon(int userId); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3646 | } |