blob: 550c1f1eb2b924080cb3705f02b22f1148e712d4 [file] [log] [blame]
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001/*
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
17package android.content.pm;
18
Tor Norbyed9273d62013-05-30 15:59:53 -070019import android.annotation.IntDef;
Jeff Brownd5a5b5a2014-06-05 17:14:39 -070020import android.annotation.SystemApi;
Xavier Ducrohet3274b9b2009-12-14 17:52:20 -080021import android.annotation.SdkConstant;
22import android.annotation.SdkConstant.SdkConstantType;
Christopher Tatef1977b42014-03-24 16:25:51 -070023import android.app.PackageInstallObserver;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080024import android.content.ComponentName;
25import android.content.Context;
26import android.content.Intent;
27import android.content.IntentFilter;
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -070028import android.content.IntentSender;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080029import android.content.res.Resources;
30import android.content.res.XmlResourceParser;
31import android.graphics.drawable.Drawable;
32import android.net.Uri;
Amith Yamasani742a6712011-05-04 14:49:28 -070033import android.os.Environment;
Dianne Hackborn0c380492012-08-20 17:23:30 -070034import android.os.UserHandle;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080035import android.util.AndroidException;
36import android.util.DisplayMetrics;
37
38import java.io.File;
Tor Norbyed9273d62013-05-30 15:59:53 -070039import java.lang.annotation.Retention;
40import java.lang.annotation.RetentionPolicy;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080041import java.util.List;
42
43/**
44 * Class for retrieving various kinds of information related to the application
45 * packages that are currently installed on the device.
46 *
47 * You can find this class through {@link Context#getPackageManager}.
48 */
49public abstract class PackageManager {
50
51 /**
52 * This exception is thrown when a given package, application, or component
kmccormick30498b42013-03-27 17:39:17 -070053 * name cannot be found.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -080054 */
55 public static class NameNotFoundException extends AndroidException {
56 public NameNotFoundException() {
57 }
58
59 public NameNotFoundException(String name) {
60 super(name);
61 }
62 }
63
64 /**
65 * {@link PackageInfo} flag: return information about
66 * activities in the package in {@link PackageInfo#activities}.
67 */
68 public static final int GET_ACTIVITIES = 0x00000001;
69
70 /**
71 * {@link PackageInfo} flag: return information about
72 * intent receivers in the package in
73 * {@link PackageInfo#receivers}.
74 */
75 public static final int GET_RECEIVERS = 0x00000002;
76
77 /**
78 * {@link PackageInfo} flag: return information about
79 * services in the package in {@link PackageInfo#services}.
80 */
81 public static final int GET_SERVICES = 0x00000004;
82
83 /**
84 * {@link PackageInfo} flag: return information about
85 * content providers in the package in
86 * {@link PackageInfo#providers}.
87 */
88 public static final int GET_PROVIDERS = 0x00000008;
89
90 /**
91 * {@link PackageInfo} flag: return information about
92 * instrumentation in the package in
93 * {@link PackageInfo#instrumentation}.
94 */
95 public static final int GET_INSTRUMENTATION = 0x00000010;
96
97 /**
98 * {@link PackageInfo} flag: return information about the
99 * intent filters supported by the activity.
100 */
101 public static final int GET_INTENT_FILTERS = 0x00000020;
102
103 /**
104 * {@link PackageInfo} flag: return information about the
105 * signatures included in the package.
106 */
107 public static final int GET_SIGNATURES = 0x00000040;
108
109 /**
110 * {@link ResolveInfo} flag: return the IntentFilter that
111 * was matched for a particular ResolveInfo in
112 * {@link ResolveInfo#filter}.
113 */
114 public static final int GET_RESOLVED_FILTER = 0x00000040;
115
116 /**
117 * {@link ComponentInfo} flag: return the {@link ComponentInfo#metaData}
118 * data {@link android.os.Bundle}s that are associated with a component.
119 * This applies for any API returning a ComponentInfo subclass.
120 */
121 public static final int GET_META_DATA = 0x00000080;
122
123 /**
124 * {@link PackageInfo} flag: return the
125 * {@link PackageInfo#gids group ids} that are associated with an
126 * application.
Ken Wakasaf76a50c2012-03-09 19:56:35 +0900127 * This applies for any API returning a PackageInfo class, either
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800128 * directly or nested inside of another.
129 */
130 public static final int GET_GIDS = 0x00000100;
131
132 /**
133 * {@link PackageInfo} flag: include disabled components in the returned info.
134 */
135 public static final int GET_DISABLED_COMPONENTS = 0x00000200;
136
137 /**
138 * {@link ApplicationInfo} flag: return the
139 * {@link ApplicationInfo#sharedLibraryFiles paths to the shared libraries}
140 * that are associated with an application.
141 * This applies for any API returning an ApplicationInfo class, either
142 * directly or nested inside of another.
143 */
144 public static final int GET_SHARED_LIBRARY_FILES = 0x00000400;
145
146 /**
147 * {@link ProviderInfo} flag: return the
148 * {@link ProviderInfo#uriPermissionPatterns URI permission patterns}
149 * that are associated with a content provider.
Ken Wakasaf76a50c2012-03-09 19:56:35 +0900150 * This applies for any API returning a ProviderInfo class, either
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800151 * directly or nested inside of another.
152 */
153 public static final int GET_URI_PERMISSION_PATTERNS = 0x00000800;
154 /**
155 * {@link PackageInfo} flag: return information about
156 * permissions in the package in
157 * {@link PackageInfo#permissions}.
158 */
159 public static final int GET_PERMISSIONS = 0x00001000;
Amith Yamasani4b2e9342011-03-31 12:38:53 -0700160
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800161 /**
Kenny Root685f4902011-11-03 10:13:29 -0700162 * Flag parameter to retrieve some information about all applications (even
163 * uninstalled ones) which have data directories. This state could have
164 * resulted if applications have been deleted with flag
165 * {@code DONT_DELETE_DATA} with a possibility of being replaced or
166 * reinstalled in future.
167 * <p>
168 * Note: this flag may cause less information about currently installed
169 * applications to be returned.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800170 */
171 public static final int GET_UNINSTALLED_PACKAGES = 0x00002000;
Amith Yamasani4b2e9342011-03-31 12:38:53 -0700172
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800173 /**
174 * {@link PackageInfo} flag: return information about
Dianne Hackborn49237342009-08-27 20:08:01 -0700175 * hardware preferences in
176 * {@link PackageInfo#configPreferences PackageInfo.configPreferences} and
177 * requested features in {@link PackageInfo#reqFeatures
Amith Yamasani4b2e9342011-03-31 12:38:53 -0700178 * PackageInfo.reqFeatures}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800179 */
180 public static final int GET_CONFIGURATIONS = 0x00004000;
181
182 /**
Dianne Hackbornfd7aded2013-01-22 17:10:23 -0800183 * {@link PackageInfo} flag: include disabled components which are in
184 * that state only because of {@link #COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED}
185 * in the returned info. Note that if you set this flag, applications
186 * that are in this disabled state will be reported as enabled.
187 */
188 public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 0x00008000;
189
190 /**
Dianne Hackborn1655be42009-05-08 14:29:01 -0700191 * Resolution and querying flag: if set, only filters that support the
192 * {@link android.content.Intent#CATEGORY_DEFAULT} will be considered for
193 * matching. This is a synonym for including the CATEGORY_DEFAULT in your
194 * supplied Intent.
195 */
196 public static final int MATCH_DEFAULT_ONLY = 0x00010000;
197
Tor Norbyed9273d62013-05-30 15:59:53 -0700198 /** @hide */
199 @IntDef({PERMISSION_GRANTED, PERMISSION_DENIED})
200 @Retention(RetentionPolicy.SOURCE)
201 public @interface PermissionResult {}
202
Dianne Hackborn1655be42009-05-08 14:29:01 -0700203 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800204 * Permission check result: this is returned by {@link #checkPermission}
205 * if the permission has been granted to the given package.
206 */
207 public static final int PERMISSION_GRANTED = 0;
208
209 /**
210 * Permission check result: this is returned by {@link #checkPermission}
211 * if the permission has not been granted to the given package.
212 */
213 public static final int PERMISSION_DENIED = -1;
214
215 /**
216 * Signature check result: this is returned by {@link #checkSignatures}
Chris Palmer09f33602010-09-13 14:27:18 -0700217 * if all signatures on the two packages match.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800218 */
219 public static final int SIGNATURE_MATCH = 0;
220
221 /**
222 * Signature check result: this is returned by {@link #checkSignatures}
223 * if neither of the two packages is signed.
224 */
225 public static final int SIGNATURE_NEITHER_SIGNED = 1;
226
227 /**
228 * Signature check result: this is returned by {@link #checkSignatures}
Chris Palmer09f33602010-09-13 14:27:18 -0700229 * if the first package is not signed but the second is.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800230 */
231 public static final int SIGNATURE_FIRST_NOT_SIGNED = -1;
232
233 /**
234 * Signature check result: this is returned by {@link #checkSignatures}
Chris Palmer09f33602010-09-13 14:27:18 -0700235 * if the second package is not signed but the first is.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800236 */
237 public static final int SIGNATURE_SECOND_NOT_SIGNED = -2;
238
239 /**
240 * Signature check result: this is returned by {@link #checkSignatures}
Chris Palmer09f33602010-09-13 14:27:18 -0700241 * if not all signatures on both packages match.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800242 */
243 public static final int SIGNATURE_NO_MATCH = -3;
244
245 /**
246 * Signature check result: this is returned by {@link #checkSignatures}
Chris Palmer09f33602010-09-13 14:27:18 -0700247 * if either of the packages are not valid.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800248 */
249 public static final int SIGNATURE_UNKNOWN_PACKAGE = -4;
250
Dianne Hackborn0ac30312011-06-17 14:49:23 -0700251 /**
252 * Flag for {@link #setApplicationEnabledSetting(String, int, int)}
253 * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This
254 * component or application is in its default enabled state (as specified
255 * in its manifest).
256 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800257 public static final int COMPONENT_ENABLED_STATE_DEFAULT = 0;
Dianne Hackborn0ac30312011-06-17 14:49:23 -0700258
259 /**
260 * Flag for {@link #setApplicationEnabledSetting(String, int, int)}
261 * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This
262 * component or application has been explictily enabled, regardless of
263 * what it has specified in its manifest.
264 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800265 public static final int COMPONENT_ENABLED_STATE_ENABLED = 1;
Dianne Hackborn0ac30312011-06-17 14:49:23 -0700266
267 /**
268 * Flag for {@link #setApplicationEnabledSetting(String, int, int)}
269 * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This
270 * component or application has been explicitly disabled, regardless of
271 * what it has specified in its manifest.
272 */
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800273 public static final int COMPONENT_ENABLED_STATE_DISABLED = 2;
274
275 /**
Dianne Hackborn0ac30312011-06-17 14:49:23 -0700276 * Flag for {@link #setApplicationEnabledSetting(String, int, int)} only: The
277 * user has explicitly disabled the application, regardless of what it has
278 * specified in its manifest. Because this is due to the user's request,
279 * they may re-enable it if desired through the appropriate system UI. This
kmccormick30498b42013-03-27 17:39:17 -0700280 * option currently <strong>cannot</strong> be used with
Dianne Hackborn0ac30312011-06-17 14:49:23 -0700281 * {@link #setComponentEnabledSetting(ComponentName, int, int)}.
282 */
283 public static final int COMPONENT_ENABLED_STATE_DISABLED_USER = 3;
284
285 /**
Dianne Hackbornfd7aded2013-01-22 17:10:23 -0800286 * Flag for {@link #setApplicationEnabledSetting(String, int, int)} only: This
287 * application should be considered, until the point where the user actually
288 * wants to use it. This means that it will not normally show up to the user
289 * (such as in the launcher), but various parts of the user interface can
290 * use {@link #GET_DISABLED_UNTIL_USED_COMPONENTS} to still see it and allow
291 * the user to select it (as for example an IME, device admin, etc). Such code,
292 * once the user has selected the app, should at that point also make it enabled.
293 * This option currently <strong>can not</strong> be used with
294 * {@link #setComponentEnabledSetting(ComponentName, int, int)}.
295 */
296 public static final int COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED = 4;
297
298 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800299 * Flag parameter for {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} to
300 * indicate that this package should be installed as forward locked, i.e. only the app itself
Brad Fitzpatrick2e805b12010-03-22 10:10:51 -0700301 * should have access to its code and non-resource assets.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700302 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800303 */
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700304 public static final int INSTALL_FORWARD_LOCK = 0x00000001;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800305
306 /**
307 * Flag parameter for {@link #installPackage} to indicate that you want to replace an already
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700308 * installed package, if one exists.
309 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800310 */
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700311 public static final int INSTALL_REPLACE_EXISTING = 0x00000002;
312
313 /**
Amith Yamasani4b2e9342011-03-31 12:38:53 -0700314 * Flag parameter for {@link #installPackage} to indicate that you want to
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700315 * allow test packages (those that have set android:testOnly in their
316 * manifest) to be installed.
317 * @hide
318 */
319 public static final int INSTALL_ALLOW_TEST = 0x00000004;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800320
321 /**
Suchi Amalapurapuaf8e9f42010-01-12 10:17:28 -0800322 * Flag parameter for {@link #installPackage} to indicate that this
323 * package has to be installed on the sdcard.
324 * @hide
325 */
Suchi Amalapurapu5b993ce2010-02-12 09:43:29 -0800326 public static final int INSTALL_EXTERNAL = 0x00000008;
Oscar Montemayor539d3c42010-01-29 15:27:00 -0800327
328 /**
Kenny Root5ab21572011-07-27 11:11:19 -0700329 * Flag parameter for {@link #installPackage} to indicate that this package
330 * has to be installed on the sdcard.
331 * @hide
332 */
333 public static final int INSTALL_INTERNAL = 0x00000010;
334
335 /**
336 * Flag parameter for {@link #installPackage} to indicate that this install
337 * was initiated via ADB.
338 *
339 * @hide
340 */
341 public static final int INSTALL_FROM_ADB = 0x00000020;
Suchi Amalapurapu14b6abd2010-03-17 08:37:04 -0700342
343 /**
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700344 * Flag parameter for {@link #installPackage} to indicate that this install
345 * should immediately be visible to all users.
346 *
347 * @hide
348 */
349 public static final int INSTALL_ALL_USERS = 0x00000040;
350
351 /**
352 * Flag parameter for {@link #installPackage} to indicate that it is okay
353 * to install an update to an app where the newly installed app has a lower
354 * version code than the currently installed app.
355 *
356 * @hide
357 */
358 public static final int INSTALL_ALLOW_DOWNGRADE = 0x00000080;
359
360 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800361 * Flag parameter for
362 * {@link #setComponentEnabledSetting(android.content.ComponentName, int, int)} to indicate
363 * that you don't want to kill the app containing the component. Be careful when you set this
364 * since changing component states can make the containing application's behavior unpredictable.
365 */
366 public static final int DONT_KILL_APP = 0x00000001;
367
368 /**
369 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
370 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} on success.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700371 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800372 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700373 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800374 public static final int INSTALL_SUCCEEDED = 1;
375
376 /**
377 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
378 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if the package is
379 * already installed.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700380 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800381 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700382 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800383 public static final int INSTALL_FAILED_ALREADY_EXISTS = -1;
384
385 /**
386 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
387 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if the package archive
388 * file is invalid.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700389 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800390 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700391 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800392 public static final int INSTALL_FAILED_INVALID_APK = -2;
393
394 /**
395 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
396 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if the URI passed in
397 * is invalid.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700398 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800399 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700400 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800401 public static final int INSTALL_FAILED_INVALID_URI = -3;
402
403 /**
404 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
405 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if the package manager
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700406 * service found that the device didn't have enough storage space to install the app.
407 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800408 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700409 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800410 public static final int INSTALL_FAILED_INSUFFICIENT_STORAGE = -4;
411
412 /**
413 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
414 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if a
415 * package is already installed with the same name.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700416 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800417 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700418 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800419 public static final int INSTALL_FAILED_DUPLICATE_PACKAGE = -5;
420
421 /**
422 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
423 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
424 * the requested shared user does not exist.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700425 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800426 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700427 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800428 public static final int INSTALL_FAILED_NO_SHARED_USER = -6;
429
430 /**
431 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
432 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
433 * a previously installed package of the same name has a different signature
434 * than the new package (and the old package's data was not removed).
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700435 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800436 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700437 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800438 public static final int INSTALL_FAILED_UPDATE_INCOMPATIBLE = -7;
439
440 /**
441 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
442 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
443 * the new package is requested a shared user which is already installed on the
444 * device and does not have matching signature.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700445 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800446 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700447 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800448 public static final int INSTALL_FAILED_SHARED_USER_INCOMPATIBLE = -8;
449
450 /**
451 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
452 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
453 * the new package uses a shared library that is not available.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700454 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800455 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700456 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800457 public static final int INSTALL_FAILED_MISSING_SHARED_LIBRARY = -9;
458
459 /**
460 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
461 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
462 * the new package uses a shared library that is not available.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700463 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800464 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700465 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800466 public static final int INSTALL_FAILED_REPLACE_COULDNT_DELETE = -10;
467
468 /**
469 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
470 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
471 * the new package failed while optimizing and validating its dex files,
472 * either because there was not enough storage or the validation failed.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700473 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800474 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700475 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800476 public static final int INSTALL_FAILED_DEXOPT = -11;
477
478 /**
479 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
480 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
481 * the new package failed because the current SDK version is older than
482 * that required by the package.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700483 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800484 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700485 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800486 public static final int INSTALL_FAILED_OLDER_SDK = -12;
487
488 /**
The Android Open Source Project10592532009-03-18 17:39:46 -0700489 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
490 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
491 * the new package failed because it contains a content provider with the
492 * same authority as a provider already installed in the system.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700493 * @hide
The Android Open Source Project10592532009-03-18 17:39:46 -0700494 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700495 @SystemApi
The Android Open Source Project10592532009-03-18 17:39:46 -0700496 public static final int INSTALL_FAILED_CONFLICTING_PROVIDER = -13;
497
498 /**
Dianne Hackborn851a5412009-05-08 12:06:44 -0700499 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
500 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
501 * the new package failed because the current SDK version is newer than
502 * that required by the package.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700503 * @hide
Dianne Hackborn851a5412009-05-08 12:06:44 -0700504 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700505 @SystemApi
Dianne Hackborn851a5412009-05-08 12:06:44 -0700506 public static final int INSTALL_FAILED_NEWER_SDK = -14;
507
508 /**
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700509 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
510 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
511 * the new package failed because it has specified that it is a test-only
512 * package and the caller has not supplied the {@link #INSTALL_ALLOW_TEST}
513 * flag.
514 * @hide
515 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700516 @SystemApi
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700517 public static final int INSTALL_FAILED_TEST_ONLY = -15;
518
519 /**
Dianne Hackbornb1811182009-05-21 15:45:42 -0700520 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
521 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
522 * the package being installed contains native code, but none that is
Amaury Medeirosdde24262014-06-03 20:06:41 -0300523 * compatible with the device's CPU_ABI.
Dianne Hackbornb1811182009-05-21 15:45:42 -0700524 * @hide
525 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700526 @SystemApi
Dianne Hackbornb1811182009-05-21 15:45:42 -0700527 public static final int INSTALL_FAILED_CPU_ABI_INCOMPATIBLE = -16;
528
529 /**
Dianne Hackborn49237342009-08-27 20:08:01 -0700530 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
531 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
532 * the new package uses a feature that is not available.
533 * @hide
534 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700535 @SystemApi
Dianne Hackborn49237342009-08-27 20:08:01 -0700536 public static final int INSTALL_FAILED_MISSING_FEATURE = -17;
537
Suchi Amalapurapuaf8e9f42010-01-12 10:17:28 -0800538 // ------ Errors related to sdcard
539 /**
540 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
541 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
542 * a secure container mount point couldn't be accessed on external media.
543 * @hide
544 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700545 @SystemApi
Suchi Amalapurapuaf8e9f42010-01-12 10:17:28 -0800546 public static final int INSTALL_FAILED_CONTAINER_ERROR = -18;
547
Dianne Hackborn49237342009-08-27 20:08:01 -0700548 /**
Suchi Amalapurapub56ae202010-02-04 22:51:07 -0800549 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
550 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
551 * the new package couldn't be installed in the specified install
552 * location.
553 * @hide
554 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700555 @SystemApi
Suchi Amalapurapub56ae202010-02-04 22:51:07 -0800556 public static final int INSTALL_FAILED_INVALID_INSTALL_LOCATION = -19;
557
558 /**
Suchi Amalapurapu8a9ab242010-03-11 16:49:16 -0800559 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
560 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
561 * the new package couldn't be installed in the specified install
562 * location because the media is not available.
563 * @hide
564 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700565 @SystemApi
Suchi Amalapurapu8a9ab242010-03-11 16:49:16 -0800566 public static final int INSTALL_FAILED_MEDIA_UNAVAILABLE = -20;
567
568 /**
Kenny Root5ab21572011-07-27 11:11:19 -0700569 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
570 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
571 * the new package couldn't be installed because the verification timed out.
572 * @hide
573 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700574 @SystemApi
Kenny Root5ab21572011-07-27 11:11:19 -0700575 public static final int INSTALL_FAILED_VERIFICATION_TIMEOUT = -21;
576
577 /**
578 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
579 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
580 * the new package couldn't be installed because the verification did not succeed.
581 * @hide
582 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700583 @SystemApi
Kenny Root5ab21572011-07-27 11:11:19 -0700584 public static final int INSTALL_FAILED_VERIFICATION_FAILURE = -22;
585
586 /**
587 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
588 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
589 * the package changed from what the calling program expected.
590 * @hide
591 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700592 @SystemApi
Kenny Root5ab21572011-07-27 11:11:19 -0700593 public static final int INSTALL_FAILED_PACKAGE_CHANGED = -23;
594
595 /**
Dianne Hackbornd0c5f512012-06-07 16:53:59 -0700596 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
597 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
598 * the new package is assigned a different UID than it previously held.
599 * @hide
600 */
601 public static final int INSTALL_FAILED_UID_CHANGED = -24;
602
603 /**
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700604 * Installation return code: this is passed to the {@link IPackageInstallObserver} by
605 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)} if
606 * the new package has an older version code than the currently installed package.
607 * @hide
608 */
609 public static final int INSTALL_FAILED_VERSION_DOWNGRADE = -25;
610
611 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800612 * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by
613 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
614 * if the parser was given a path that is not a file, or does not end with the expected
615 * '.apk' extension.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700616 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800617 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700618 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800619 public static final int INSTALL_PARSE_FAILED_NOT_APK = -100;
620
621 /**
622 * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by
623 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
624 * if the parser was unable to retrieve the AndroidManifest.xml file.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700625 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800626 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700627 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800628 public static final int INSTALL_PARSE_FAILED_BAD_MANIFEST = -101;
629
630 /**
631 * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by
632 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
633 * if the parser encountered an unexpected exception.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700634 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800635 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700636 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800637 public static final int INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION = -102;
638
639 /**
640 * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by
641 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
642 * if the parser did not find any certificates in the .apk.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700643 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800644 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700645 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800646 public static final int INSTALL_PARSE_FAILED_NO_CERTIFICATES = -103;
647
648 /**
649 * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by
650 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
651 * if the parser found inconsistent certificates on the files in the .apk.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700652 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800653 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700654 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800655 public static final int INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES = -104;
656
657 /**
658 * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by
659 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
660 * if the parser encountered a CertificateEncodingException in one of the
661 * files in the .apk.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700662 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800663 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700664 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800665 public static final int INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING = -105;
666
667 /**
668 * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by
669 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
670 * if the parser encountered a bad or missing package name in the manifest.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700671 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800672 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700673 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800674 public static final int INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME = -106;
675
676 /**
677 * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by
678 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
679 * if the parser encountered a bad shared user id name in the manifest.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700680 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800681 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700682 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800683 public static final int INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID = -107;
684
685 /**
686 * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by
687 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
688 * if the parser encountered some structural problem in the manifest.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700689 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800690 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700691 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800692 public static final int INSTALL_PARSE_FAILED_MANIFEST_MALFORMED = -108;
693
694 /**
695 * Installation parse return code: this is passed to the {@link IPackageInstallObserver} by
696 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
697 * if the parser did not find any actionable tags (instrumentation or application)
698 * in the manifest.
Dianne Hackbornade3eca2009-05-11 18:54:45 -0700699 * @hide
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800700 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700701 @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800702 public static final int INSTALL_PARSE_FAILED_MANIFEST_EMPTY = -109;
703
704 /**
Suchi Amalapurapu5b993ce2010-02-12 09:43:29 -0800705 * Installation failed return code: this is passed to the {@link IPackageInstallObserver} by
706 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
707 * if the system failed to install the package because of system issues.
708 * @hide
709 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -0700710 @SystemApi
Suchi Amalapurapu5b993ce2010-02-12 09:43:29 -0800711 public static final int INSTALL_FAILED_INTERNAL_ERROR = -110;
712
713 /**
Amith Yamasanie4cf7342012-12-17 11:12:09 -0800714 * Installation failed return code: this is passed to the {@link IPackageInstallObserver} by
715 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
716 * if the system failed to install the package because the user is restricted from installing
717 * apps.
718 * @hide
719 */
720 public static final int INSTALL_FAILED_USER_RESTRICTED = -111;
721
722 /**
Christopher Tatef1977b42014-03-24 16:25:51 -0700723 * Installation failed return code: this is passed to the {@link IPackageInstallObserver} by
724 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
725 * if the system failed to install the package because it is attempting to define a
726 * permission that is already defined by some existing package.
727 *
728 * <p>The package name of the app which has already defined the permission is passed to
729 * a {@link IPackageInstallObserver2}, if any, as the {@link #EXTRA_EXISTING_PACKAGE}
730 * string extra; and the name of the permission being redefined is passed in the
731 * {@link #EXTRA_EXISTING_PERMISSION} string extra.
732 * @hide
733 */
734 public static final int INSTALL_FAILED_DUPLICATE_PERMISSION = -112;
735
736 /**
Narayan Kamathd11f2232014-04-10 10:37:17 +0100737 * Installation failed return code: this is passed to the {@link IPackageInstallObserver} by
738 * {@link #installPackage(android.net.Uri, IPackageInstallObserver, int)}
Ramin Zaghi1378aba2014-02-28 15:03:19 +0000739 * if the system failed to install the package because its packaged native code did not
740 * match any of the ABIs supported by the system.
741 *
742 * @hide
743 */
Narayan Kamathd11f2232014-04-10 10:37:17 +0100744 public static final int INSTALL_FAILED_NO_MATCHING_ABIS = -113;
Ramin Zaghi1378aba2014-02-28 15:03:19 +0000745
746 /**
747 * Internal return code for NativeLibraryHelper methods to indicate that the package
748 * being processed did not contain any native code. This is placed here only so that
749 * it can belong to the same value space as the other install failure codes.
750 *
751 * @hide
752 */
Narayan Kamathd11f2232014-04-10 10:37:17 +0100753 public static final int NO_NATIVE_LIBRARIES = -114;
Ramin Zaghi1378aba2014-02-28 15:03:19 +0000754
755 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800756 * Flag parameter for {@link #deletePackage} to indicate that you don't want to delete the
757 * package's data directory.
758 *
759 * @hide
760 */
Dianne Hackborn7767eac2012-08-23 18:25:40 -0700761 public static final int DELETE_KEEP_DATA = 0x00000001;
762
763 /**
764 * Flag parameter for {@link #deletePackage} to indicate that you want the
765 * package deleted for all users.
766 *
767 * @hide
768 */
769 public static final int DELETE_ALL_USERS = 0x00000002;
The Android Open Source Project9066cfe2009-03-03 19:31:44 -0800770
771 /**
Dianne Hackbornc895be72013-03-11 17:48:43 -0700772 * Flag parameter for {@link #deletePackage} to indicate that, if you are calling
773 * uninstall on a system that has been updated, then don't do the normal process
774 * of uninstalling the update and rolling back to the older system version (which
775 * needs to happen for all users); instead, just mark the app as uninstalled for
776 * the current user.
777 *
778 * @hide
779 */
780 public static final int DELETE_SYSTEM_APP = 0x00000004;
781
782 /**
Kenny Rootc39bb4a2011-02-28 13:27:19 -0800783 * Return code for when package deletion succeeds. This is passed to the
784 * {@link IPackageDeleteObserver} by {@link #deletePackage()} if the system
785 * succeeded in deleting the package.
Amith Yamasani4b2e9342011-03-31 12:38:53 -0700786 *
Kenny Rootc39bb4a2011-02-28 13:27:19 -0800787 * @hide
788 */
789 public static final int DELETE_SUCCEEDED = 1;
790
791 /**
792 * Deletion failed return code: this is passed to the
793 * {@link IPackageDeleteObserver} by {@link #deletePackage()} if the system
794 * failed to delete the package for an unspecified reason.
Amith Yamasani4b2e9342011-03-31 12:38:53 -0700795 *
Kenny Rootc39bb4a2011-02-28 13:27:19 -0800796 * @hide
797 */
798 public static final int DELETE_FAILED_INTERNAL_ERROR = -1;
799
800 /**
801 * Deletion failed return code: this is passed to the
802 * {@link IPackageDeleteObserver} by {@link #deletePackage()} if the system
803 * failed to delete the package because it is the active DevicePolicy
804 * manager.
Amith Yamasani4b2e9342011-03-31 12:38:53 -0700805 *
Kenny Rootc39bb4a2011-02-28 13:27:19 -0800806 * @hide
807 */
808 public static final int DELETE_FAILED_DEVICE_POLICY_MANAGER = -2;
809
810 /**
Amith Yamasanie4cf7342012-12-17 11:12:09 -0800811 * Deletion failed return code: this is passed to the
812 * {@link IPackageDeleteObserver} by {@link #deletePackage()} if the system
813 * failed to delete the package since the user is restricted.
814 *
815 * @hide
816 */
817 public static final int DELETE_FAILED_USER_RESTRICTED = -3;
818
819 /**
Suchi Amalapurapu8946dd32010-02-19 09:19:34 -0800820 * Return code that is passed to the {@link IPackageMoveObserver} by
Kenny Rootc39bb4a2011-02-28 13:27:19 -0800821 * {@link #movePackage(android.net.Uri, IPackageMoveObserver)} when the
822 * package has been successfully moved by the system.
Amith Yamasani4b2e9342011-03-31 12:38:53 -0700823 *
Suchi Amalapurapu8946dd32010-02-19 09:19:34 -0800824 * @hide
825 */
826 public static final int MOVE_SUCCEEDED = 1;
827 /**
828 * Error code that is passed to the {@link IPackageMoveObserver} by
829 * {@link #movePackage(android.net.Uri, IPackageMoveObserver)}
830 * when the package hasn't been successfully moved by the system
831 * because of insufficient memory on specified media.
832 * @hide
833 */
834 public static final int MOVE_FAILED_INSUFFICIENT_STORAGE = -1;
835
836 /**
837 * Error code that is passed to the {@link IPackageMoveObserver} by
838 * {@link #movePackage(android.net.Uri, IPackageMoveObserver)}
839 * if the specified package doesn't exist.
840 * @hide
841 */
842 public static final int MOVE_FAILED_DOESNT_EXIST = -2;
843
844 /**
845 * Error code that is passed to the {@link IPackageMoveObserver} by
846 * {@link #movePackage(android.net.Uri, IPackageMoveObserver)}
847 * if the specified package cannot be moved since its a system package.
848 * @hide
849 */
850 public static final int MOVE_FAILED_SYSTEM_PACKAGE = -3;
851
852 /**
853 * Error code that is passed to the {@link IPackageMoveObserver} by
854 * {@link #movePackage(android.net.Uri, IPackageMoveObserver)}
855 * if the specified package cannot be moved since its forward locked.
856 * @hide
857 */
858 public static final int MOVE_FAILED_FORWARD_LOCKED = -4;
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 cannot be moved to the specified location.
864 * @hide
865 */
866 public static final int MOVE_FAILED_INVALID_LOCATION = -5;
867
868 /**
Suchi Amalapurapu8a9ab242010-03-11 16:49:16 -0800869 * 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 to the specified location.
872 * @hide
873 */
874 public static final int MOVE_FAILED_INTERNAL_ERROR = -6;
875
876 /**
Kenny Rootdeb11262010-08-02 11:36:21 -0700877 * Error code that is passed to the {@link IPackageMoveObserver} by
878 * {@link #movePackage(android.net.Uri, IPackageMoveObserver)} if the
879 * specified package already has an operation pending in the
880 * {@link PackageHandler} queue.
Amith Yamasani4b2e9342011-03-31 12:38:53 -0700881 *
Kenny Rootdeb11262010-08-02 11:36:21 -0700882 * @hide
883 */
884 public static final int MOVE_FAILED_OPERATION_PENDING = -7;
885
886 /**
Suchi Amalapurapu8946dd32010-02-19 09:19:34 -0800887 * Flag parameter for {@link #movePackage} to indicate that
888 * the package should be moved to internal storage if its
889 * been installed on external media.
890 * @hide
891 */
892 public static final int MOVE_INTERNAL = 0x00000001;
893
894 /**
895 * Flag parameter for {@link #movePackage} to indicate that
896 * the package should be moved to external media.
897 * @hide
898 */
899 public static final int MOVE_EXTERNAL_MEDIA = 0x00000002;
900
901 /**
Kenny Root05ca4c92011-09-15 10:36:25 -0700902 * Usable by the required verifier as the {@code verificationCode} argument
903 * for {@link PackageManager#verifyPendingInstall} to indicate that it will
904 * allow the installation to proceed without any of the optional verifiers
905 * needing to vote.
906 *
907 * @hide
908 */
909 public static final int VERIFICATION_ALLOW_WITHOUT_SUFFICIENT = 2;
910
911 /**
Kenny Root3a9b5fb2011-09-20 14:15:38 -0700912 * Used as the {@code verificationCode} argument for
913 * {@link PackageManager#verifyPendingInstall} to indicate that the calling
914 * package verifier allows the installation to proceed.
915 */
916 public static final int VERIFICATION_ALLOW = 1;
917
918 /**
919 * Used as the {@code verificationCode} argument for
920 * {@link PackageManager#verifyPendingInstall} to indicate the calling
921 * package verifier does not vote to allow the installation to proceed.
922 */
923 public static final int VERIFICATION_REJECT = -1;
924
925 /**
rich canningsd9ef3e52012-08-22 14:28:05 -0700926 * Can be used as the {@code millisecondsToDelay} argument for
927 * {@link PackageManager#extendVerificationTimeout}. This is the
928 * maximum time {@code PackageManager} waits for the verification
929 * agent to return (in milliseconds).
930 */
931 public static final long MAXIMUM_VERIFICATION_TIMEOUT = 60*60*1000;
932
933 /**
Amith Yamasani0b285492011-04-14 17:35:23 -0700934 * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: The device's
935 * audio pipeline is low-latency, more suitable for audio applications sensitive to delays or
936 * lag in sound input or output.
Dan Morrill898e1e82010-09-26 17:28:30 -0700937 */
938 @SdkConstant(SdkConstantType.FEATURE)
939 public static final String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency";
940
941 /**
942 * Feature for {@link #getSystemAvailableFeatures} and
Dan Morrill50ab63f2010-03-05 16:16:19 -0800943 * {@link #hasSystemFeature}: The device is capable of communicating with
944 * other devices via Bluetooth.
945 */
946 @SdkConstant(SdkConstantType.FEATURE)
947 public static final String FEATURE_BLUETOOTH = "android.hardware.bluetooth";
948
949 /**
950 * Feature for {@link #getSystemAvailableFeatures} and
Matthew Xiea7227722013-04-18 15:25:59 -0700951 * {@link #hasSystemFeature}: The device is capable of communicating with
952 * other devices via Bluetooth Low Energy radio.
953 */
954 @SdkConstant(SdkConstantType.FEATURE)
955 public static final String FEATURE_BLUETOOTH_LE = "android.hardware.bluetooth_le";
956
957 /**
958 * Feature for {@link #getSystemAvailableFeatures} and
Dianne Hackborn08ee42c2009-11-19 17:08:01 -0800959 * {@link #hasSystemFeature}: The device has a camera facing away
960 * from the screen.
961 */
Xavier Ducrohet3274b9b2009-12-14 17:52:20 -0800962 @SdkConstant(SdkConstantType.FEATURE)
Dianne Hackborn08ee42c2009-11-19 17:08:01 -0800963 public static final String FEATURE_CAMERA = "android.hardware.camera";
Dan Morrill50ab63f2010-03-05 16:16:19 -0800964
Dianne Hackborn08ee42c2009-11-19 17:08:01 -0800965 /**
966 * Feature for {@link #getSystemAvailableFeatures} and
967 * {@link #hasSystemFeature}: The device's camera supports auto-focus.
968 */
Xavier Ducrohet3274b9b2009-12-14 17:52:20 -0800969 @SdkConstant(SdkConstantType.FEATURE)
Dianne Hackborn08ee42c2009-11-19 17:08:01 -0800970 public static final String FEATURE_CAMERA_AUTOFOCUS = "android.hardware.camera.autofocus";
Dan Morrill50ab63f2010-03-05 16:16:19 -0800971
Dianne Hackborn08ee42c2009-11-19 17:08:01 -0800972 /**
973 * Feature for {@link #getSystemAvailableFeatures} and
Eino-Ville Talvala752af832012-09-18 14:45:37 -0700974 * {@link #hasSystemFeature}: The device has at least one camera pointing in
Eino-Ville Talvala9131da22014-05-08 11:39:53 -0700975 * some direction, or can support an external camera being connected to it.
Eino-Ville Talvala752af832012-09-18 14:45:37 -0700976 */
977 @SdkConstant(SdkConstantType.FEATURE)
978 public static final String FEATURE_CAMERA_ANY = "android.hardware.camera.any";
979
980 /**
981 * Feature for {@link #getSystemAvailableFeatures} and
Eino-Ville Talvala9131da22014-05-08 11:39:53 -0700982 * {@link #hasSystemFeature}: The device can support having an external camera connected to it.
983 * The external camera may not always be connected or available to applications to use.
984 */
985 @SdkConstant(SdkConstantType.FEATURE)
986 public static final String FEATURE_CAMERA_EXTERNAL = "android.hardware.camera.external";
987
988 /**
989 * Feature for {@link #getSystemAvailableFeatures} and
Dianne Hackborn08ee42c2009-11-19 17:08:01 -0800990 * {@link #hasSystemFeature}: The device's camera supports flash.
991 */
Xavier Ducrohet3274b9b2009-12-14 17:52:20 -0800992 @SdkConstant(SdkConstantType.FEATURE)
Dianne Hackborn08ee42c2009-11-19 17:08:01 -0800993 public static final String FEATURE_CAMERA_FLASH = "android.hardware.camera.flash";
Dan Morrill50ab63f2010-03-05 16:16:19 -0800994
995 /**
996 * Feature for {@link #getSystemAvailableFeatures} and
Chih-Chung Changde1057c2010-06-14 19:15:00 +0800997 * {@link #hasSystemFeature}: The device has a front facing camera.
998 */
999 @SdkConstant(SdkConstantType.FEATURE)
1000 public static final String FEATURE_CAMERA_FRONT = "android.hardware.camera.front";
1001
1002 /**
1003 * Feature for {@link #getSystemAvailableFeatures} and
Alex Ray0c9d61f2013-10-03 12:17:54 -07001004 * {@link #hasSystemFeature}: The device is capable of communicating with
1005 * consumer IR devices.
1006 */
1007 @SdkConstant(SdkConstantType.FEATURE)
1008 public static final String FEATURE_CONSUMER_IR = "android.hardware.consumerir";
1009
1010 /**
1011 * Feature for {@link #getSystemAvailableFeatures} and
Dan Morrill50ab63f2010-03-05 16:16:19 -08001012 * {@link #hasSystemFeature}: The device supports one or more methods of
1013 * reporting current location.
1014 */
1015 @SdkConstant(SdkConstantType.FEATURE)
1016 public static final String FEATURE_LOCATION = "android.hardware.location";
1017
1018 /**
1019 * Feature for {@link #getSystemAvailableFeatures} and
1020 * {@link #hasSystemFeature}: The device has a Global Positioning System
1021 * receiver and can report precise location.
1022 */
1023 @SdkConstant(SdkConstantType.FEATURE)
1024 public static final String FEATURE_LOCATION_GPS = "android.hardware.location.gps";
1025
1026 /**
1027 * Feature for {@link #getSystemAvailableFeatures} and
1028 * {@link #hasSystemFeature}: The device can report location with coarse
1029 * accuracy using a network-based geolocation system.
1030 */
1031 @SdkConstant(SdkConstantType.FEATURE)
1032 public static final String FEATURE_LOCATION_NETWORK = "android.hardware.location.network";
1033
1034 /**
1035 * Feature for {@link #getSystemAvailableFeatures} and
1036 * {@link #hasSystemFeature}: The device can record audio via a
1037 * microphone.
1038 */
1039 @SdkConstant(SdkConstantType.FEATURE)
1040 public static final String FEATURE_MICROPHONE = "android.hardware.microphone";
1041
1042 /**
1043 * Feature for {@link #getSystemAvailableFeatures} and
Dan Morrill76437d32010-09-01 11:17:20 -07001044 * {@link #hasSystemFeature}: The device can communicate using Near-Field
1045 * Communications (NFC).
1046 */
1047 @SdkConstant(SdkConstantType.FEATURE)
1048 public static final String FEATURE_NFC = "android.hardware.nfc";
1049
1050 /**
1051 * Feature for {@link #getSystemAvailableFeatures} and
Martijn Coenenf4bf1582013-07-22 12:01:19 -07001052 * {@link #hasSystemFeature}: The device supports host-
1053 * based NFC card emulation.
Martijn Coenendf4d1d62013-08-28 11:18:58 -07001054 *
1055 * TODO remove when depending apps have moved to new constant.
1056 * @hide
1057 * @deprecated
Martijn Coenenf4bf1582013-07-22 12:01:19 -07001058 */
Jose Lima970417c2014-04-10 10:42:19 -07001059 @Deprecated
Martijn Coenenf4bf1582013-07-22 12:01:19 -07001060 @SdkConstant(SdkConstantType.FEATURE)
1061 public static final String FEATURE_NFC_HCE = "android.hardware.nfc.hce";
1062
1063 /**
1064 * Feature for {@link #getSystemAvailableFeatures} and
Martijn Coenendf4d1d62013-08-28 11:18:58 -07001065 * {@link #hasSystemFeature}: The device supports host-
1066 * based NFC card emulation.
1067 */
1068 @SdkConstant(SdkConstantType.FEATURE)
1069 public static final String FEATURE_NFC_HOST_CARD_EMULATION = "android.hardware.nfc.hce";
1070
1071 /**
1072 * Feature for {@link #getSystemAvailableFeatures} and
Dan Morrill5744bb42010-09-01 19:18:57 -07001073 * {@link #hasSystemFeature}: The device includes an accelerometer.
1074 */
1075 @SdkConstant(SdkConstantType.FEATURE)
1076 public static final String FEATURE_SENSOR_ACCELEROMETER = "android.hardware.sensor.accelerometer";
1077
1078 /**
1079 * Feature for {@link #getSystemAvailableFeatures} and
1080 * {@link #hasSystemFeature}: The device includes a barometer (air
1081 * pressure sensor.)
1082 */
1083 @SdkConstant(SdkConstantType.FEATURE)
1084 public static final String FEATURE_SENSOR_BAROMETER = "android.hardware.sensor.barometer";
1085
1086 /**
1087 * Feature for {@link #getSystemAvailableFeatures} and
Dan Morrill50ab63f2010-03-05 16:16:19 -08001088 * {@link #hasSystemFeature}: The device includes a magnetometer (compass).
1089 */
1090 @SdkConstant(SdkConstantType.FEATURE)
1091 public static final String FEATURE_SENSOR_COMPASS = "android.hardware.sensor.compass";
1092
1093 /**
1094 * Feature for {@link #getSystemAvailableFeatures} and
Dan Morrill5744bb42010-09-01 19:18:57 -07001095 * {@link #hasSystemFeature}: The device includes a gyroscope.
Dan Morrill50ab63f2010-03-05 16:16:19 -08001096 */
1097 @SdkConstant(SdkConstantType.FEATURE)
Dan Morrill5744bb42010-09-01 19:18:57 -07001098 public static final String FEATURE_SENSOR_GYROSCOPE = "android.hardware.sensor.gyroscope";
Dan Morrill50ab63f2010-03-05 16:16:19 -08001099
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001100 /**
1101 * Feature for {@link #getSystemAvailableFeatures} and
1102 * {@link #hasSystemFeature}: The device includes a light sensor.
1103 */
Xavier Ducrohet3274b9b2009-12-14 17:52:20 -08001104 @SdkConstant(SdkConstantType.FEATURE)
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001105 public static final String FEATURE_SENSOR_LIGHT = "android.hardware.sensor.light";
Dan Morrill50ab63f2010-03-05 16:16:19 -08001106
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001107 /**
1108 * Feature for {@link #getSystemAvailableFeatures} and
1109 * {@link #hasSystemFeature}: The device includes a proximity sensor.
1110 */
Xavier Ducrohet3274b9b2009-12-14 17:52:20 -08001111 @SdkConstant(SdkConstantType.FEATURE)
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001112 public static final String FEATURE_SENSOR_PROXIMITY = "android.hardware.sensor.proximity";
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001113
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001114 /**
1115 * Feature for {@link #getSystemAvailableFeatures} and
Aravind Akella068b0c02013-10-12 17:39:15 -07001116 * {@link #hasSystemFeature}: The device includes a hardware step counter.
1117 */
1118 @SdkConstant(SdkConstantType.FEATURE)
1119 public static final String FEATURE_SENSOR_STEP_COUNTER = "android.hardware.sensor.stepcounter";
1120
1121 /**
1122 * Feature for {@link #getSystemAvailableFeatures} and
1123 * {@link #hasSystemFeature}: The device includes a hardware step detector.
1124 */
1125 @SdkConstant(SdkConstantType.FEATURE)
1126 public static final String FEATURE_SENSOR_STEP_DETECTOR = "android.hardware.sensor.stepdetector";
1127
1128 /**
1129 * Feature for {@link #getSystemAvailableFeatures} and
Vinod Krishnan8afb23c2014-04-30 11:11:39 -07001130 * {@link #hasSystemFeature}: The device includes a heart rate monitor.
1131 */
1132 @SdkConstant(SdkConstantType.FEATURE)
1133 public static final String FEATURE_SENSOR_HEART_RATE = "android.hardware.sensor.heartrate";
1134
1135 /**
1136 * Feature for {@link #getSystemAvailableFeatures} and
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001137 * {@link #hasSystemFeature}: The device has a telephony radio with data
1138 * communication support.
1139 */
Xavier Ducrohet3274b9b2009-12-14 17:52:20 -08001140 @SdkConstant(SdkConstantType.FEATURE)
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001141 public static final String FEATURE_TELEPHONY = "android.hardware.telephony";
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001142
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001143 /**
1144 * Feature for {@link #getSystemAvailableFeatures} and
1145 * {@link #hasSystemFeature}: The device has a CDMA telephony stack.
1146 */
Xavier Ducrohet3274b9b2009-12-14 17:52:20 -08001147 @SdkConstant(SdkConstantType.FEATURE)
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001148 public static final String FEATURE_TELEPHONY_CDMA = "android.hardware.telephony.cdma";
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001149
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001150 /**
1151 * Feature for {@link #getSystemAvailableFeatures} and
1152 * {@link #hasSystemFeature}: The device has a GSM telephony stack.
1153 */
Xavier Ducrohet3274b9b2009-12-14 17:52:20 -08001154 @SdkConstant(SdkConstantType.FEATURE)
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001155 public static final String FEATURE_TELEPHONY_GSM = "android.hardware.telephony.gsm";
Hung-ying Tyan3424c022010-08-27 18:08:19 +08001156
1157 /**
1158 * Feature for {@link #getSystemAvailableFeatures} and
Mike Lockwoodf4ca2472011-02-27 11:23:25 -08001159 * {@link #hasSystemFeature}: The device supports connecting to USB devices
1160 * as the USB host.
1161 */
1162 @SdkConstant(SdkConstantType.FEATURE)
1163 public static final String FEATURE_USB_HOST = "android.hardware.usb.host";
1164
1165 /**
1166 * Feature for {@link #getSystemAvailableFeatures} and
1167 * {@link #hasSystemFeature}: The device supports connecting to USB accessories.
1168 */
1169 @SdkConstant(SdkConstantType.FEATURE)
1170 public static final String FEATURE_USB_ACCESSORY = "android.hardware.usb.accessory";
1171
1172 /**
1173 * Feature for {@link #getSystemAvailableFeatures} and
Hung-ying Tyan3424c022010-08-27 18:08:19 +08001174 * {@link #hasSystemFeature}: The SIP API is enabled on the device.
1175 */
1176 @SdkConstant(SdkConstantType.FEATURE)
1177 public static final String FEATURE_SIP = "android.software.sip";
1178
1179 /**
1180 * Feature for {@link #getSystemAvailableFeatures} and
1181 * {@link #hasSystemFeature}: The device supports SIP-based VOIP.
1182 */
1183 @SdkConstant(SdkConstantType.FEATURE)
1184 public static final String FEATURE_SIP_VOIP = "android.software.sip.voip";
1185
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001186 /**
1187 * Feature for {@link #getSystemAvailableFeatures} and
Dan Morrillb0fe0332010-04-05 14:43:58 -07001188 * {@link #hasSystemFeature}: The device's display has a touch screen.
1189 */
1190 @SdkConstant(SdkConstantType.FEATURE)
1191 public static final String FEATURE_TOUCHSCREEN = "android.hardware.touchscreen";
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001192
1193
Dan Morrillb0fe0332010-04-05 14:43:58 -07001194 /**
1195 * Feature for {@link #getSystemAvailableFeatures} and
Dan Morrill50ab63f2010-03-05 16:16:19 -08001196 * {@link #hasSystemFeature}: The device's touch screen supports
1197 * multitouch sufficient for basic two-finger gesture detection.
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001198 */
Xavier Ducrohet3274b9b2009-12-14 17:52:20 -08001199 @SdkConstant(SdkConstantType.FEATURE)
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001200 public static final String FEATURE_TOUCHSCREEN_MULTITOUCH = "android.hardware.touchscreen.multitouch";
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001201
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001202 /**
1203 * Feature for {@link #getSystemAvailableFeatures} and
Dan Morrill50ab63f2010-03-05 16:16:19 -08001204 * {@link #hasSystemFeature}: The device's touch screen is capable of
1205 * tracking two or more fingers fully independently.
1206 */
1207 @SdkConstant(SdkConstantType.FEATURE)
1208 public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT = "android.hardware.touchscreen.multitouch.distinct";
1209
1210 /**
1211 * Feature for {@link #getSystemAvailableFeatures} and
Dan Morrill6993d3d2010-09-03 14:30:14 -07001212 * {@link #hasSystemFeature}: The device's touch screen is capable of
1213 * tracking a full hand of fingers fully independently -- that is, 5 or
1214 * more simultaneous independent pointers.
1215 */
1216 @SdkConstant(SdkConstantType.FEATURE)
1217 public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND = "android.hardware.touchscreen.multitouch.jazzhand";
1218
1219 /**
1220 * Feature for {@link #getSystemAvailableFeatures} and
Dan Morrilla5376872011-01-23 13:15:53 -08001221 * {@link #hasSystemFeature}: The device does not have a touch screen, but
1222 * does support touch emulation for basic events. For instance, the
1223 * device might use a mouse or remote control to drive a cursor, and
1224 * emulate basic touch pointer events like down, up, drag, etc. All
1225 * devices that support android.hardware.touchscreen or a sub-feature are
1226 * presumed to also support faketouch.
1227 */
1228 @SdkConstant(SdkConstantType.FEATURE)
1229 public static final String FEATURE_FAKETOUCH = "android.hardware.faketouch";
1230
1231 /**
1232 * Feature for {@link #getSystemAvailableFeatures} and
Dianne Hackborne22fe932011-06-08 20:24:29 -07001233 * {@link #hasSystemFeature}: The device does not have a touch screen, but
1234 * does support touch emulation for basic events that supports distinct
1235 * tracking of two or more fingers. This is an extension of
1236 * {@link #FEATURE_FAKETOUCH} for input devices with this capability. Note
1237 * that unlike a distinct multitouch screen as defined by
1238 * {@link #FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT}, these kinds of input
1239 * devices will not actually provide full two-finger gestures since the
1240 * input is being transformed to cursor movement on the screen. That is,
1241 * single finger gestures will move a cursor; two-finger swipes will
1242 * result in single-finger touch events; other two-finger gestures will
1243 * result in the corresponding two-finger touch event.
1244 */
1245 @SdkConstant(SdkConstantType.FEATURE)
1246 public static final String FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT = "android.hardware.faketouch.multitouch.distinct";
1247
1248 /**
1249 * Feature for {@link #getSystemAvailableFeatures} and
1250 * {@link #hasSystemFeature}: The device does not have a touch screen, but
1251 * does support touch emulation for basic events that supports tracking
1252 * a hand of fingers (5 or more fingers) fully independently.
1253 * This is an extension of
1254 * {@link #FEATURE_FAKETOUCH} for input devices with this capability. Note
1255 * that unlike a multitouch screen as defined by
1256 * {@link #FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND}, not all two finger
1257 * gestures can be detected due to the limitations described for
1258 * {@link #FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT}.
1259 */
1260 @SdkConstant(SdkConstantType.FEATURE)
1261 public static final String FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND = "android.hardware.faketouch.multitouch.jazzhand";
1262
1263 /**
1264 * Feature for {@link #getSystemAvailableFeatures} and
Dianne Hackborne289bff2011-06-13 19:33:22 -07001265 * {@link #hasSystemFeature}: The device supports portrait orientation
1266 * screens. For backwards compatibility, you can assume that if neither
1267 * this nor {@link #FEATURE_SCREEN_LANDSCAPE} is set then the device supports
1268 * both portrait and landscape.
1269 */
1270 @SdkConstant(SdkConstantType.FEATURE)
1271 public static final String FEATURE_SCREEN_PORTRAIT = "android.hardware.screen.portrait";
1272
1273 /**
1274 * Feature for {@link #getSystemAvailableFeatures} and
1275 * {@link #hasSystemFeature}: The device supports landscape orientation
1276 * screens. For backwards compatibility, you can assume that if neither
1277 * this nor {@link #FEATURE_SCREEN_PORTRAIT} is set then the device supports
1278 * both portrait and landscape.
1279 */
1280 @SdkConstant(SdkConstantType.FEATURE)
1281 public static final String FEATURE_SCREEN_LANDSCAPE = "android.hardware.screen.landscape";
1282
1283 /**
1284 * Feature for {@link #getSystemAvailableFeatures} and
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001285 * {@link #hasSystemFeature}: The device supports live wallpapers.
1286 */
Xavier Ducrohet3274b9b2009-12-14 17:52:20 -08001287 @SdkConstant(SdkConstantType.FEATURE)
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001288 public static final String FEATURE_LIVE_WALLPAPER = "android.software.live_wallpaper";
Oscar Montemayor1228d0a2010-01-28 12:01:44 -08001289 /**
Dan Morrill50ab63f2010-03-05 16:16:19 -08001290 * Feature for {@link #getSystemAvailableFeatures} and
Dianne Hackborn119bbc32013-03-22 17:27:25 -07001291 * {@link #hasSystemFeature}: The device supports app widgets.
1292 */
1293 @SdkConstant(SdkConstantType.FEATURE)
1294 public static final String FEATURE_APP_WIDGETS = "android.software.app_widgets";
1295
1296 /**
Dianne Hackborn91097de2014-04-04 18:02:06 -07001297 * @hide
1298 * Feature for {@link #getSystemAvailableFeatures} and
1299 * {@link #hasSystemFeature}: The device supports
1300 * {@link android.service.voice.VoiceInteractionService} and
1301 * {@link android.app.VoiceInteractor}.
1302 */
1303 @SdkConstant(SdkConstantType.FEATURE)
1304 public static final String FEATURE_VOICE_RECOGNIZERS = "android.software.voice_recognizers";
1305
1306
1307 /**
Dianne Hackborn119bbc32013-03-22 17:27:25 -07001308 * Feature for {@link #getSystemAvailableFeatures} and
1309 * {@link #hasSystemFeature}: The device supports a home screen that is replaceable
1310 * by third party applications.
1311 */
1312 @SdkConstant(SdkConstantType.FEATURE)
1313 public static final String FEATURE_HOME_SCREEN = "android.software.home_screen";
1314
1315 /**
1316 * Feature for {@link #getSystemAvailableFeatures} and
1317 * {@link #hasSystemFeature}: The device supports adding new input methods implemented
1318 * with the {@link android.inputmethodservice.InputMethodService} API.
1319 */
1320 @SdkConstant(SdkConstantType.FEATURE)
1321 public static final String FEATURE_INPUT_METHODS = "android.software.input_methods";
1322
1323 /**
1324 * Feature for {@link #getSystemAvailableFeatures} and
Amith Yamasani44a01b72013-09-16 10:44:57 -07001325 * {@link #hasSystemFeature}: The device supports device policy enforcement via device admins.
1326 */
1327 @SdkConstant(SdkConstantType.FEATURE)
1328 public static final String FEATURE_DEVICE_ADMIN = "android.software.device_admin";
1329
1330 /**
1331 * Feature for {@link #getSystemAvailableFeatures} and
Tim Kilbournf94b6a92014-03-07 15:13:48 -08001332 * {@link #hasSystemFeature}: The device supports leanback UI. This is
1333 * typically used in a living room television experience, but is a software
1334 * feature unlike {@link #FEATURE_TELEVISION}. Devices running with this
1335 * feature will use resources associated with the "television" UI mode.
1336 */
1337 @SdkConstant(SdkConstantType.FEATURE)
1338 public static final String FEATURE_LEANBACK = "android.software.leanback";
1339
1340 /**
1341 * Feature for {@link #getSystemAvailableFeatures} and
1342 * {@link #hasSystemFeature}: The device supports only leanback UI. Only
1343 * applications designed for this experience should be run, though this is
1344 * not enforced by the system.
1345 * @hide
1346 */
1347 @SdkConstant(SdkConstantType.FEATURE)
1348 public static final String FEATURE_LEANBACK_ONLY = "android.software.leanback_only";
1349
1350 /**
1351 * Feature for {@link #getSystemAvailableFeatures} and
Dan Morrill50ab63f2010-03-05 16:16:19 -08001352 * {@link #hasSystemFeature}: The device supports WiFi (802.11) networking.
1353 */
1354 @SdkConstant(SdkConstantType.FEATURE)
1355 public static final String FEATURE_WIFI = "android.hardware.wifi";
1356
1357 /**
Irfan Sheriff45b8b462011-09-07 11:24:16 -07001358 * Feature for {@link #getSystemAvailableFeatures} and
1359 * {@link #hasSystemFeature}: The device supports Wi-Fi Direct networking.
1360 */
1361 @SdkConstant(SdkConstantType.FEATURE)
1362 public static final String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct";
1363
1364 /**
Dianne Hackborn0cf2c8a2012-05-17 17:29:49 -07001365 * Feature for {@link #getSystemAvailableFeatures} and
1366 * {@link #hasSystemFeature}: This is a device dedicated to showing UI
1367 * on a television. Television here is defined to be a typical living
1368 * room television experience: displayed on a big screen, where the user
1369 * is sitting far away from it, and the dominant form of input will be
1370 * something like a DPAD, not through touch or mouse.
Tim Kilbournf94b6a92014-03-07 15:13:48 -08001371 * @deprecated use {@link #FEATURE_LEANBACK} instead.
Dianne Hackborn0cf2c8a2012-05-17 17:29:49 -07001372 */
Jose Lima970417c2014-04-10 10:42:19 -07001373 @Deprecated
Dianne Hackborn0cf2c8a2012-05-17 17:29:49 -07001374 @SdkConstant(SdkConstantType.FEATURE)
1375 public static final String FEATURE_TELEVISION = "android.hardware.type.television";
1376
1377 /**
Justin Kohb5731f091c2014-02-13 16:06:59 -08001378 * Feature for {@link #getSystemAvailableFeatures} and
1379 * {@link #hasSystemFeature}: This is a device dedicated to showing UI
1380 * on a watch. A watch here is defined to be a device worn on the body, perhaps on
1381 * the wrist. The user is very close when interacting with the device.
1382 */
1383 @SdkConstant(SdkConstantType.FEATURE)
1384 public static final String FEATURE_WATCH = "android.hardware.type.watch";
1385
1386 /**
Adam Lesinski3d9bcb92014-02-18 14:05:14 -08001387 * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}:
1388 * The device supports printing.
1389 */
1390 @SdkConstant(SdkConstantType.FEATURE)
1391 public static final String FEATURE_PRINTING = "android.software.print";
1392
1393 /**
1394 * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}:
1395 * The device can perform backup and restore operations on installed applications.
1396 */
1397 @SdkConstant(SdkConstantType.FEATURE)
1398 public static final String FEATURE_BACKUP = "android.software.backup";
1399
1400 /**
Adam Connors23cc04e2014-04-01 12:12:20 +01001401 * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}:
1402 * The device supports managed profiles for enterprise users.
1403 */
1404 @SdkConstant(SdkConstantType.FEATURE)
Adam Connors551c0782014-06-05 12:13:03 +01001405 public static final String FEATURE_MANAGED_PROFILES = "android.software.managed_profiles";
Adam Connors23cc04e2014-04-01 12:12:20 +01001406
1407 /**
Ben Murdochf564c7f2014-05-20 18:58:06 +01001408 * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}:
Ben Murdoch422c7a52014-05-16 13:45:47 +01001409 * The device has a full implementation of the android.webkit.* APIs. Devices
1410 * lacking this feature will not have a functioning WebView implementation.
1411 */
1412 @SdkConstant(SdkConstantType.FEATURE)
1413 public static final String FEATURE_WEBVIEW = "android.software.webview";
1414
1415 /**
Dianne Hackborne83cefce2010-02-04 17:38:14 -08001416 * Action to external storage service to clean out removed apps.
1417 * @hide
1418 */
1419 public static final String ACTION_CLEAN_EXTERNAL_STORAGE
1420 = "android.content.pm.CLEAN_EXTERNAL_STORAGE";
Oscar Montemayor1228d0a2010-01-28 12:01:44 -08001421
Dianne Hackborn08ee42c2009-11-19 17:08:01 -08001422 /**
Kenny Root5ab21572011-07-27 11:11:19 -07001423 * Extra field name for the URI to a verification file. Passed to a package
1424 * verifier.
1425 *
1426 * @hide
1427 */
1428 public static final String EXTRA_VERIFICATION_URI = "android.content.pm.extra.VERIFICATION_URI";
1429
1430 /**
1431 * Extra field name for the ID of a package pending verification. Passed to
1432 * a package verifier and is used to call back to
Kenny Root3a9b5fb2011-09-20 14:15:38 -07001433 * {@link PackageManager#verifyPendingInstall(int, int)}
Kenny Root5ab21572011-07-27 11:11:19 -07001434 */
1435 public static final String EXTRA_VERIFICATION_ID = "android.content.pm.extra.VERIFICATION_ID";
1436
1437 /**
1438 * Extra field name for the package identifier which is trying to install
1439 * the package.
1440 *
1441 * @hide
1442 */
1443 public static final String EXTRA_VERIFICATION_INSTALLER_PACKAGE
1444 = "android.content.pm.extra.VERIFICATION_INSTALLER_PACKAGE";
1445
1446 /**
1447 * Extra field name for the requested install flags for a package pending
1448 * verification. Passed to a package verifier.
1449 *
1450 * @hide
1451 */
1452 public static final String EXTRA_VERIFICATION_INSTALL_FLAGS
1453 = "android.content.pm.extra.VERIFICATION_INSTALL_FLAGS";
1454
1455 /**
rich cannings13d428e2012-09-13 13:43:07 -07001456 * Extra field name for the uid of who is requesting to install
1457 * the package.
1458 *
1459 * @hide
1460 */
1461 public static final String EXTRA_VERIFICATION_INSTALLER_UID
1462 = "android.content.pm.extra.VERIFICATION_INSTALLER_UID";
1463
1464 /**
1465 * Extra field name for the package name of a package pending verification.
1466 *
1467 * @hide
1468 */
1469 public static final String EXTRA_VERIFICATION_PACKAGE_NAME
1470 = "android.content.pm.extra.VERIFICATION_PACKAGE_NAME";
1471 /**
rich canningsd1b5cfc2012-08-29 14:49:51 -07001472 * Extra field name for the result of a verification, either
1473 * {@link #VERIFICATION_ALLOW}, or {@link #VERIFICATION_REJECT}.
1474 * Passed to package verifiers after a package is verified.
1475 */
1476 public static final String EXTRA_VERIFICATION_RESULT
1477 = "android.content.pm.extra.VERIFICATION_RESULT";
1478
1479 /**
rich cannings13d428e2012-09-13 13:43:07 -07001480 * Extra field name for the version code of a package pending verification.
1481 *
1482 * @hide
1483 */
1484 public static final String EXTRA_VERIFICATION_VERSION_CODE
1485 = "android.content.pm.extra.VERIFICATION_VERSION_CODE";
1486
1487 /**
Nick Kralevich035f80d2013-03-27 15:20:08 -07001488 * The action used to request that the user approve a permission request
1489 * from the application.
1490 *
1491 * @hide
1492 */
1493 public static final String ACTION_REQUEST_PERMISSION
1494 = "android.content.pm.action.REQUEST_PERMISSION";
1495
1496 /**
1497 * Extra field name for the list of permissions, which the user must approve.
1498 *
1499 * @hide
1500 */
1501 public static final String EXTRA_REQUEST_PERMISSION_PERMISSION_LIST
1502 = "android.content.pm.extra.PERMISSION_LIST";
1503
1504 /**
Christopher Tatef1977b42014-03-24 16:25:51 -07001505 * String extra for {@link IPackageInstallObserver2} in the 'extras' Bundle in case of
1506 * {@link #INSTALL_FAILED_DUPLICATE_PERMISSION}. This extra names the package which provides
1507 * the existing definition for the permission.
1508 * @hide
1509 */
1510 public static final String EXTRA_FAILURE_EXISTING_PACKAGE
1511 = "android.content.pm.extra.FAILURE_EXISTING_PACKAGE";
1512
1513 /**
1514 * String extra for {@link IPackageInstallObserver2} in the 'extras' Bundle in case of
1515 * {@link #INSTALL_FAILED_DUPLICATE_PERMISSION}. This extra names the permission that is
1516 * being redundantly defined by the package being installed.
1517 * @hide
1518 */
1519 public static final String EXTRA_FAILURE_EXISTING_PERMISSION
1520 = "android.content.pm.extra.FAILURE_EXISTING_PERMISSION";
1521
1522 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001523 * Retrieve overall information about an application package that is
1524 * installed on the system.
Kenny Root5ab21572011-07-27 11:11:19 -07001525 * <p>
1526 * Throws {@link NameNotFoundException} if a package with the given name can
1527 * not be found on the system.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001528 *
1529 * @param packageName The full name (i.e. com.google.apps.contacts) of the
Kenny Root5ab21572011-07-27 11:11:19 -07001530 * desired package.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001531 * @param flags Additional option flags. Use any combination of
Kenny Root5ab21572011-07-27 11:11:19 -07001532 * {@link #GET_ACTIVITIES}, {@link #GET_GIDS},
1533 * {@link #GET_CONFIGURATIONS}, {@link #GET_INSTRUMENTATION},
1534 * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS},
1535 * {@link #GET_RECEIVERS}, {@link #GET_SERVICES},
1536 * {@link #GET_SIGNATURES}, {@link #GET_UNINSTALLED_PACKAGES} to
1537 * modify the data returned.
1538 * @return Returns a PackageInfo object containing information about the
1539 * package. If flag GET_UNINSTALLED_PACKAGES is set and if the
1540 * package is not found in the list of installed applications, the
1541 * package information is retrieved from the list of uninstalled
kmccormick30498b42013-03-27 17:39:17 -07001542 * applications (which includes installed applications as well as
1543 * applications with data directory i.e. applications which had been
1544 * deleted with {@code DONT_DELETE_DATA} flag set).
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001545 * @see #GET_ACTIVITIES
1546 * @see #GET_GIDS
1547 * @see #GET_CONFIGURATIONS
1548 * @see #GET_INSTRUMENTATION
1549 * @see #GET_PERMISSIONS
1550 * @see #GET_PROVIDERS
1551 * @see #GET_RECEIVERS
1552 * @see #GET_SERVICES
1553 * @see #GET_SIGNATURES
1554 * @see #GET_UNINSTALLED_PACKAGES
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001555 */
1556 public abstract PackageInfo getPackageInfo(String packageName, int flags)
1557 throws NameNotFoundException;
1558
1559 /**
Dianne Hackborn47096932010-02-11 15:57:09 -08001560 * Map from the current package names in use on the device to whatever
1561 * the current canonical name of that package is.
1562 * @param names Array of current names to be mapped.
1563 * @return Returns an array of the same size as the original, containing
1564 * the canonical name for each package.
1565 */
1566 public abstract String[] currentToCanonicalPackageNames(String[] names);
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001567
Dianne Hackborn47096932010-02-11 15:57:09 -08001568 /**
1569 * Map from a packages canonical name to the current name in use on the device.
1570 * @param names Array of new names to be mapped.
1571 * @return Returns an array of the same size as the original, containing
1572 * the current name for each package.
1573 */
1574 public abstract String[] canonicalToCurrentPackageNames(String[] names);
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001575
Dianne Hackborn47096932010-02-11 15:57:09 -08001576 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001577 * Return a "good" intent to launch a front-door activity in a package,
1578 * for use for example to implement an "open" button when browsing through
1579 * packages. The current implementation will look first for a main
1580 * activity in the category {@link Intent#CATEGORY_INFO}, next for a
1581 * main activity in the category {@link Intent#CATEGORY_LAUNCHER}, or return
1582 * null if neither are found.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001583 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001584 * <p>Throws {@link NameNotFoundException} if a package with the given
kmccormick30498b42013-03-27 17:39:17 -07001585 * name cannot be found on the system.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001586 *
1587 * @param packageName The name of the package to inspect.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001588 *
Dianne Hackborn19415762010-12-15 00:20:27 -08001589 * @return Returns either a fully-qualified Intent that can be used to
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001590 * launch the main activity in the package, or null if the package does
1591 * not contain such an activity.
1592 */
Mihai Predaeae850c2009-05-13 10:13:48 +02001593 public abstract Intent getLaunchIntentForPackage(String packageName);
1594
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001595 /**
Jose Lima970417c2014-04-10 10:42:19 -07001596 * Return a "good" intent to launch a front-door Leanback activity in a
1597 * package, for use for example to implement an "open" button when browsing
1598 * through packages. The current implementation will look for a main
1599 * activity in the category {@link Intent#CATEGORY_LEANBACK_LAUNCHER}, or
1600 * return null if no main leanback activities are found.
1601 * <p>
1602 * Throws {@link NameNotFoundException} if a package with the given name
1603 * cannot be found on the system.
Adam Connors551c0782014-06-05 12:13:03 +01001604 *
Jose Lima970417c2014-04-10 10:42:19 -07001605 * @param packageName The name of the package to inspect.
1606 * @return Returns either a fully-qualified Intent that can be used to launch
1607 * the main Leanback activity in the package, or null if the package
1608 * does not contain such an activity.
1609 */
1610 public abstract Intent getLeanbackLaunchIntentForPackage(String packageName);
1611
1612 /**
1613 * Return an array of all of the secondary group-ids that have been assigned
1614 * to a package.
1615 * <p>
1616 * Throws {@link NameNotFoundException} if a package with the given name
1617 * cannot be found on the system.
Adam Connors551c0782014-06-05 12:13:03 +01001618 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001619 * @param packageName The full name (i.e. com.google.apps.contacts) of the
Jose Lima970417c2014-04-10 10:42:19 -07001620 * desired package.
1621 * @return Returns an int array of the assigned gids, or null if there are
1622 * none.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001623 */
1624 public abstract int[] getPackageGids(String packageName)
1625 throws NameNotFoundException;
1626
1627 /**
Dianne Hackborna06de0f2012-12-11 16:34:47 -08001628 * @hide Return the uid associated with the given package name for the
1629 * given user.
1630 *
1631 * <p>Throws {@link NameNotFoundException} if a package with the given
1632 * name can not be found on the system.
1633 *
1634 * @param packageName The full name (i.e. com.google.apps.contacts) of the
1635 * desired package.
1636 * @param userHandle The user handle identifier to look up the package under.
1637 *
1638 * @return Returns an integer uid who owns the given package name.
1639 */
1640 public abstract int getPackageUid(String packageName, int userHandle)
1641 throws NameNotFoundException;
1642
1643 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001644 * Retrieve all of the information we know about a particular permission.
1645 *
1646 * <p>Throws {@link NameNotFoundException} if a permission with the given
kmccormick30498b42013-03-27 17:39:17 -07001647 * name cannot be found on the system.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001648 *
1649 * @param name The fully qualified name (i.e. com.google.permission.LOGIN)
1650 * of the permission you are interested in.
1651 * @param flags Additional option flags. Use {@link #GET_META_DATA} to
1652 * retrieve any meta-data associated with the permission.
1653 *
1654 * @return Returns a {@link PermissionInfo} containing information about the
1655 * permission.
1656 */
1657 public abstract PermissionInfo getPermissionInfo(String name, int flags)
1658 throws NameNotFoundException;
1659
1660 /**
1661 * Query for all of the permissions associated with a particular group.
1662 *
1663 * <p>Throws {@link NameNotFoundException} if the given group does not
1664 * exist.
1665 *
1666 * @param group The fully qualified name (i.e. com.google.permission.LOGIN)
1667 * of the permission group you are interested in. Use null to
1668 * find all of the permissions not associated with a group.
1669 * @param flags Additional option flags. Use {@link #GET_META_DATA} to
1670 * retrieve any meta-data associated with the permissions.
1671 *
1672 * @return Returns a list of {@link PermissionInfo} containing information
1673 * about all of the permissions in the given group.
1674 */
1675 public abstract List<PermissionInfo> queryPermissionsByGroup(String group,
1676 int flags) throws NameNotFoundException;
1677
1678 /**
1679 * Retrieve all of the information we know about a particular group of
1680 * permissions.
1681 *
1682 * <p>Throws {@link NameNotFoundException} if a permission group with the given
kmccormick30498b42013-03-27 17:39:17 -07001683 * name cannot be found on the system.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001684 *
1685 * @param name The fully qualified name (i.e. com.google.permission_group.APPS)
1686 * of the permission you are interested in.
1687 * @param flags Additional option flags. Use {@link #GET_META_DATA} to
1688 * retrieve any meta-data associated with the permission group.
1689 *
1690 * @return Returns a {@link PermissionGroupInfo} containing information
1691 * about the permission.
1692 */
1693 public abstract PermissionGroupInfo getPermissionGroupInfo(String name,
1694 int flags) throws NameNotFoundException;
1695
1696 /**
1697 * Retrieve all of the known permission groups in the system.
1698 *
1699 * @param flags Additional option flags. Use {@link #GET_META_DATA} to
1700 * retrieve any meta-data associated with the permission group.
1701 *
1702 * @return Returns a list of {@link PermissionGroupInfo} containing
1703 * information about all of the known permission groups.
1704 */
1705 public abstract List<PermissionGroupInfo> getAllPermissionGroups(int flags);
1706
1707 /**
1708 * Retrieve all of the information we know about a particular
1709 * package/application.
1710 *
1711 * <p>Throws {@link NameNotFoundException} if an application with the given
kmccormick30498b42013-03-27 17:39:17 -07001712 * package name cannot be found on the system.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001713 *
1714 * @param packageName The full name (i.e. com.google.apps.contacts) of an
1715 * application.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001716 * @param flags Additional option flags. Use any combination of
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001717 * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES},
1718 * {@link #GET_UNINSTALLED_PACKAGES} to modify the data returned.
1719 *
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001720 * @return {@link ApplicationInfo} Returns ApplicationInfo object containing
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001721 * information about the package.
1722 * If flag GET_UNINSTALLED_PACKAGES is set and if the package is not
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001723 * found in the list of installed applications,
1724 * the application information is retrieved from the
1725 * list of uninstalled applications(which includes
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001726 * installed applications as well as applications
1727 * with data directory ie applications which had been
kmccormick30498b42013-03-27 17:39:17 -07001728 * deleted with {@code DONT_DELETE_DATA} flag set).
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001729 *
1730 * @see #GET_META_DATA
1731 * @see #GET_SHARED_LIBRARY_FILES
1732 * @see #GET_UNINSTALLED_PACKAGES
1733 */
1734 public abstract ApplicationInfo getApplicationInfo(String packageName,
1735 int flags) throws NameNotFoundException;
1736
1737 /**
1738 * Retrieve all of the information we know about a particular activity
1739 * class.
1740 *
1741 * <p>Throws {@link NameNotFoundException} if an activity with the given
kmccormick30498b42013-03-27 17:39:17 -07001742 * class name cannot be found on the system.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001743 *
Dianne Hackborn361199b2010-08-30 17:42:07 -07001744 * @param component The full component name (i.e.
1745 * com.google.apps.contacts/com.google.apps.contacts.ContactsList) of an Activity
1746 * class.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001747 * @param flags Additional option flags. Use any combination of
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001748 * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES},
1749 * to modify the data (in ApplicationInfo) returned.
1750 *
1751 * @return {@link ActivityInfo} containing information about the activity.
1752 *
1753 * @see #GET_INTENT_FILTERS
1754 * @see #GET_META_DATA
1755 * @see #GET_SHARED_LIBRARY_FILES
1756 */
Dianne Hackborn361199b2010-08-30 17:42:07 -07001757 public abstract ActivityInfo getActivityInfo(ComponentName component,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001758 int flags) throws NameNotFoundException;
1759
1760 /**
1761 * Retrieve all of the information we know about a particular receiver
1762 * class.
1763 *
1764 * <p>Throws {@link NameNotFoundException} if a receiver with the given
kmccormick30498b42013-03-27 17:39:17 -07001765 * class name cannot be found on the system.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001766 *
Dianne Hackborn361199b2010-08-30 17:42:07 -07001767 * @param component The full component name (i.e.
1768 * com.google.apps.calendar/com.google.apps.calendar.CalendarAlarm) of a Receiver
1769 * class.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001770 * @param flags Additional option flags. Use any combination of
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001771 * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES},
1772 * to modify the data returned.
1773 *
1774 * @return {@link ActivityInfo} containing information about the receiver.
1775 *
1776 * @see #GET_INTENT_FILTERS
1777 * @see #GET_META_DATA
1778 * @see #GET_SHARED_LIBRARY_FILES
1779 */
Dianne Hackborn361199b2010-08-30 17:42:07 -07001780 public abstract ActivityInfo getReceiverInfo(ComponentName component,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001781 int flags) throws NameNotFoundException;
1782
1783 /**
1784 * Retrieve all of the information we know about a particular service
1785 * class.
1786 *
1787 * <p>Throws {@link NameNotFoundException} if a service with the given
kmccormick30498b42013-03-27 17:39:17 -07001788 * class name cannot be found on the system.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001789 *
Dianne Hackborn361199b2010-08-30 17:42:07 -07001790 * @param component The full component name (i.e.
1791 * com.google.apps.media/com.google.apps.media.BackgroundPlayback) of a Service
1792 * class.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001793 * @param flags Additional option flags. Use any combination of
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001794 * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES},
1795 * to modify the data returned.
1796 *
1797 * @return ServiceInfo containing information about the service.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001798 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001799 * @see #GET_META_DATA
1800 * @see #GET_SHARED_LIBRARY_FILES
1801 */
Dianne Hackborn361199b2010-08-30 17:42:07 -07001802 public abstract ServiceInfo getServiceInfo(ComponentName component,
1803 int flags) throws NameNotFoundException;
1804
1805 /**
1806 * Retrieve all of the information we know about a particular content
1807 * provider class.
1808 *
1809 * <p>Throws {@link NameNotFoundException} if a provider with the given
kmccormick30498b42013-03-27 17:39:17 -07001810 * class name cannot be found on the system.
Dianne Hackborn361199b2010-08-30 17:42:07 -07001811 *
1812 * @param component The full component name (i.e.
1813 * com.google.providers.media/com.google.providers.media.MediaProvider) of a
1814 * ContentProvider class.
1815 * @param flags Additional option flags. Use any combination of
1816 * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES},
1817 * to modify the data returned.
1818 *
1819 * @return ProviderInfo containing information about the service.
1820 *
1821 * @see #GET_META_DATA
1822 * @see #GET_SHARED_LIBRARY_FILES
1823 */
1824 public abstract ProviderInfo getProviderInfo(ComponentName component,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001825 int flags) throws NameNotFoundException;
1826
1827 /**
1828 * Return a List of all packages that are installed
1829 * on the device.
1830 *
1831 * @param flags Additional option flags. Use any combination of
1832 * {@link #GET_ACTIVITIES},
1833 * {@link #GET_GIDS},
1834 * {@link #GET_CONFIGURATIONS},
1835 * {@link #GET_INSTRUMENTATION},
1836 * {@link #GET_PERMISSIONS},
1837 * {@link #GET_PROVIDERS},
1838 * {@link #GET_RECEIVERS},
1839 * {@link #GET_SERVICES},
1840 * {@link #GET_SIGNATURES},
1841 * {@link #GET_UNINSTALLED_PACKAGES} to modify the data returned.
1842 *
1843 * @return A List of PackageInfo objects, one for each package that is
1844 * installed on the device. In the unlikely case of there being no
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001845 * installed packages, an empty list is returned.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001846 * If flag GET_UNINSTALLED_PACKAGES is set, a list of all
kmccormick30498b42013-03-27 17:39:17 -07001847 * applications including those deleted with {@code DONT_DELETE_DATA}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001848 * (partially installed apps with data directory) will be returned.
1849 *
1850 * @see #GET_ACTIVITIES
1851 * @see #GET_GIDS
1852 * @see #GET_CONFIGURATIONS
1853 * @see #GET_INSTRUMENTATION
1854 * @see #GET_PERMISSIONS
1855 * @see #GET_PROVIDERS
1856 * @see #GET_RECEIVERS
1857 * @see #GET_SERVICES
1858 * @see #GET_SIGNATURES
1859 * @see #GET_UNINSTALLED_PACKAGES
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001860 */
1861 public abstract List<PackageInfo> getInstalledPackages(int flags);
1862
1863 /**
Dianne Hackborne7991752013-01-16 17:56:46 -08001864 * Return a List of all installed packages that are currently
1865 * holding any of the given permissions.
1866 *
1867 * @param flags Additional option flags. Use any combination of
1868 * {@link #GET_ACTIVITIES},
1869 * {@link #GET_GIDS},
1870 * {@link #GET_CONFIGURATIONS},
1871 * {@link #GET_INSTRUMENTATION},
1872 * {@link #GET_PERMISSIONS},
1873 * {@link #GET_PROVIDERS},
1874 * {@link #GET_RECEIVERS},
1875 * {@link #GET_SERVICES},
1876 * {@link #GET_SIGNATURES},
1877 * {@link #GET_UNINSTALLED_PACKAGES} to modify the data returned.
1878 *
1879 * @return Returns a List of PackageInfo objects, one for each installed
1880 * application that is holding any of the permissions that were provided.
1881 *
1882 * @see #GET_ACTIVITIES
1883 * @see #GET_GIDS
1884 * @see #GET_CONFIGURATIONS
1885 * @see #GET_INSTRUMENTATION
1886 * @see #GET_PERMISSIONS
1887 * @see #GET_PROVIDERS
1888 * @see #GET_RECEIVERS
1889 * @see #GET_SERVICES
1890 * @see #GET_SIGNATURES
1891 * @see #GET_UNINSTALLED_PACKAGES
1892 */
1893 public abstract List<PackageInfo> getPackagesHoldingPermissions(
1894 String[] permissions, int flags);
1895
1896 /**
Amith Yamasani151ec4c2012-09-07 19:25:16 -07001897 * Return a List of all packages that are installed on the device, for a specific user.
1898 * Requesting a list of installed packages for another user
1899 * will require the permission INTERACT_ACROSS_USERS_FULL.
1900 * @param flags Additional option flags. Use any combination of
1901 * {@link #GET_ACTIVITIES},
1902 * {@link #GET_GIDS},
1903 * {@link #GET_CONFIGURATIONS},
1904 * {@link #GET_INSTRUMENTATION},
1905 * {@link #GET_PERMISSIONS},
1906 * {@link #GET_PROVIDERS},
1907 * {@link #GET_RECEIVERS},
1908 * {@link #GET_SERVICES},
1909 * {@link #GET_SIGNATURES},
1910 * {@link #GET_UNINSTALLED_PACKAGES} to modify the data returned.
1911 * @param userId The user for whom the installed packages are to be listed
1912 *
1913 * @return A List of PackageInfo objects, one for each package that is
1914 * installed on the device. In the unlikely case of there being no
1915 * installed packages, an empty list is returned.
1916 * If flag GET_UNINSTALLED_PACKAGES is set, a list of all
kmccormick30498b42013-03-27 17:39:17 -07001917 * applications including those deleted with {@code DONT_DELETE_DATA}
Amith Yamasani151ec4c2012-09-07 19:25:16 -07001918 * (partially installed apps with data directory) will be returned.
1919 *
1920 * @see #GET_ACTIVITIES
1921 * @see #GET_GIDS
1922 * @see #GET_CONFIGURATIONS
1923 * @see #GET_INSTRUMENTATION
1924 * @see #GET_PERMISSIONS
1925 * @see #GET_PROVIDERS
1926 * @see #GET_RECEIVERS
1927 * @see #GET_SERVICES
1928 * @see #GET_SIGNATURES
1929 * @see #GET_UNINSTALLED_PACKAGES
1930 *
1931 * @hide
1932 */
1933 public abstract List<PackageInfo> getInstalledPackages(int flags, int userId);
1934
1935 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001936 * Check whether a particular package has been granted a particular
1937 * permission.
1938 *
1939 * @param permName The name of the permission you are checking for,
1940 * @param pkgName The name of the package you are checking against.
1941 *
1942 * @return If the package has the permission, PERMISSION_GRANTED is
1943 * returned. If it does not have the permission, PERMISSION_DENIED
1944 * is returned.
1945 *
1946 * @see #PERMISSION_GRANTED
1947 * @see #PERMISSION_DENIED
1948 */
1949 public abstract int checkPermission(String permName, String pkgName);
1950
1951 /**
1952 * Add a new dynamic permission to the system. For this to work, your
1953 * package must have defined a permission tree through the
1954 * {@link android.R.styleable#AndroidManifestPermissionTree
1955 * &lt;permission-tree&gt;} tag in its manifest. A package can only add
1956 * permissions to trees that were defined by either its own package or
1957 * another with the same user id; a permission is in a tree if it
1958 * matches the name of the permission tree + ".": for example,
1959 * "com.foo.bar" is a member of the permission tree "com.foo".
1960 *
1961 * <p>It is good to make your permission tree name descriptive, because you
1962 * are taking possession of that entire set of permission names. Thus, it
1963 * must be under a domain you control, with a suffix that will not match
1964 * any normal permissions that may be declared in any applications that
1965 * are part of that domain.
1966 *
1967 * <p>New permissions must be added before
1968 * any .apks are installed that use those permissions. Permissions you
1969 * add through this method are remembered across reboots of the device.
1970 * If the given permission already exists, the info you supply here
1971 * will be used to update it.
1972 *
1973 * @param info Description of the permission to be added.
1974 *
1975 * @return Returns true if a new permission was created, false if an
1976 * existing one was updated.
1977 *
1978 * @throws SecurityException if you are not allowed to add the
1979 * given permission name.
1980 *
1981 * @see #removePermission(String)
1982 */
1983 public abstract boolean addPermission(PermissionInfo info);
1984
1985 /**
Dianne Hackbornd7c09682010-03-30 10:42:20 -07001986 * Like {@link #addPermission(PermissionInfo)} but asynchronously
1987 * persists the package manager state after returning from the call,
1988 * allowing it to return quicker and batch a series of adds at the
1989 * expense of no guarantee the added permission will be retained if
1990 * the device is rebooted before it is written.
1991 */
1992 public abstract boolean addPermissionAsync(PermissionInfo info);
Amith Yamasani4b2e9342011-03-31 12:38:53 -07001993
Dianne Hackbornd7c09682010-03-30 10:42:20 -07001994 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08001995 * Removes a permission that was previously added with
1996 * {@link #addPermission(PermissionInfo)}. The same ownership rules apply
1997 * -- you are only allowed to remove permissions that you are allowed
1998 * to add.
1999 *
2000 * @param name The name of the permission to remove.
2001 *
2002 * @throws SecurityException if you are not allowed to remove the
2003 * given permission name.
2004 *
2005 * @see #addPermission(PermissionInfo)
2006 */
2007 public abstract void removePermission(String name);
2008
2009 /**
Nick Kralevich035f80d2013-03-27 15:20:08 -07002010 * Returns an {@link Intent} suitable for passing to {@code startActivityForResult}
2011 * which prompts the user to grant {@code permissions} to this application.
Nick Kralevich32eb5b182013-04-11 10:20:09 -07002012 * @hide
Nick Kralevich035f80d2013-03-27 15:20:08 -07002013 *
2014 * @throws NullPointerException if {@code permissions} is {@code null}.
2015 * @throws IllegalArgumentException if {@code permissions} contains {@code null}.
2016 */
2017 public Intent buildPermissionRequestIntent(String... permissions) {
2018 if (permissions == null) {
2019 throw new NullPointerException("permissions cannot be null");
2020 }
2021 for (String permission : permissions) {
2022 if (permission == null) {
2023 throw new IllegalArgumentException("permissions cannot contain null");
2024 }
2025 }
2026
2027 Intent i = new Intent(ACTION_REQUEST_PERMISSION);
2028 i.putExtra(EXTRA_REQUEST_PERMISSION_PERMISSION_LIST, permissions);
2029 i.setPackage("com.android.packageinstaller");
2030 return i;
2031 }
2032
2033 /**
Dianne Hackborne639da72012-02-21 15:11:13 -08002034 * Grant a permission to an application which the application does not
2035 * already have. The permission must have been requested by the application,
2036 * but as an optional permission. If the application is not allowed to
2037 * hold the permission, a SecurityException is thrown.
2038 * @hide
2039 *
2040 * @param packageName The name of the package that the permission will be
2041 * granted to.
2042 * @param permissionName The name of the permission.
2043 */
2044 public abstract void grantPermission(String packageName, String permissionName);
2045
2046 /**
2047 * Revoke a permission that was previously granted by {@link #grantPermission}.
2048 * @hide
2049 *
2050 * @param packageName The name of the package that the permission will be
2051 * granted to.
2052 * @param permissionName The name of the permission.
2053 */
2054 public abstract void revokePermission(String packageName, String permissionName);
2055
2056 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002057 * Compare the signatures of two packages to determine if the same
2058 * signature appears in both of them. If they do contain the same
2059 * signature, then they are allowed special privileges when working
2060 * with each other: they can share the same user-id, run instrumentation
2061 * against each other, etc.
2062 *
2063 * @param pkg1 First package name whose signature will be compared.
2064 * @param pkg2 Second package name whose signature will be compared.
Chris Palmer09f33602010-09-13 14:27:18 -07002065 *
2066 * @return Returns an integer indicating whether all signatures on the
2067 * two packages match. The value is >= 0 ({@link #SIGNATURE_MATCH}) if
2068 * all signatures match or < 0 if there is not a match ({@link
2069 * #SIGNATURE_NO_MATCH} or {@link #SIGNATURE_UNKNOWN_PACKAGE}).
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002070 *
Dianne Hackborn766cbfe2009-08-12 18:33:39 -07002071 * @see #checkSignatures(int, int)
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002072 * @see #SIGNATURE_MATCH
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002073 * @see #SIGNATURE_NO_MATCH
2074 * @see #SIGNATURE_UNKNOWN_PACKAGE
2075 */
2076 public abstract int checkSignatures(String pkg1, String pkg2);
2077
2078 /**
Dianne Hackborn766cbfe2009-08-12 18:33:39 -07002079 * Like {@link #checkSignatures(String, String)}, but takes UIDs of
2080 * the two packages to be checked. This can be useful, for example,
2081 * when doing the check in an IPC, where the UID is the only identity
2082 * available. It is functionally identical to determining the package
2083 * associated with the UIDs and checking their signatures.
2084 *
Joe Onorato25660ec2009-08-12 22:40:37 -07002085 * @param uid1 First UID whose signature will be compared.
2086 * @param uid2 Second UID whose signature will be compared.
Dianne Hackborn766cbfe2009-08-12 18:33:39 -07002087 *
Chris Palmer09f33602010-09-13 14:27:18 -07002088 * @return Returns an integer indicating whether all signatures on the
2089 * two packages match. The value is >= 0 ({@link #SIGNATURE_MATCH}) if
2090 * all signatures match or < 0 if there is not a match ({@link
2091 * #SIGNATURE_NO_MATCH} or {@link #SIGNATURE_UNKNOWN_PACKAGE}).
2092 *
2093 * @see #checkSignatures(String, String)
Dianne Hackborn766cbfe2009-08-12 18:33:39 -07002094 * @see #SIGNATURE_MATCH
Dianne Hackborn766cbfe2009-08-12 18:33:39 -07002095 * @see #SIGNATURE_NO_MATCH
2096 * @see #SIGNATURE_UNKNOWN_PACKAGE
2097 */
2098 public abstract int checkSignatures(int uid1, int uid2);
2099
2100 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002101 * Retrieve the names of all packages that are associated with a particular
2102 * user id. In most cases, this will be a single package name, the package
2103 * that has been assigned that user id. Where there are multiple packages
2104 * sharing the same user id through the "sharedUserId" mechanism, all
2105 * packages with that id will be returned.
2106 *
2107 * @param uid The user id for which you would like to retrieve the
2108 * associated packages.
2109 *
2110 * @return Returns an array of one or more packages assigned to the user
2111 * id, or null if there are no known packages with the given id.
2112 */
2113 public abstract String[] getPackagesForUid(int uid);
2114
2115 /**
2116 * Retrieve the official name associated with a user id. This name is
2117 * guaranteed to never change, though it is possibly for the underlying
2118 * user id to be changed. That is, if you are storing information about
2119 * user ids in persistent storage, you should use the string returned
2120 * by this function instead of the raw user-id.
2121 *
2122 * @param uid The user id for which you would like to retrieve a name.
2123 * @return Returns a unique name for the given user id, or null if the
2124 * user id is not currently assigned.
2125 */
2126 public abstract String getNameForUid(int uid);
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002127
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002128 /**
2129 * Return the user id associated with a shared user name. Multiple
2130 * applications can specify a shared user name in their manifest and thus
2131 * end up using a common uid. This might be used for new applications
2132 * that use an existing shared user name and need to know the uid of the
2133 * shared user.
2134 *
2135 * @param sharedUserName The shared user name whose uid is to be retrieved.
2136 * @return Returns the uid associated with the shared user, or NameNotFoundException
2137 * if the shared user name is not being used by any installed packages
2138 * @hide
2139 */
2140 public abstract int getUidForSharedUser(String sharedUserName)
2141 throws NameNotFoundException;
2142
2143 /**
2144 * Return a List of all application packages that are installed on the
2145 * device. If flag GET_UNINSTALLED_PACKAGES has been set, a list of all
kmccormick30498b42013-03-27 17:39:17 -07002146 * applications including those deleted with {@code DONT_DELETE_DATA} (partially
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002147 * installed apps with data directory) will be returned.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002148 *
2149 * @param flags Additional option flags. Use any combination of
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002150 * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES},
Jeff Smitha45746e2012-07-19 14:19:24 -05002151 * {@link #GET_UNINSTALLED_PACKAGES} to modify the data returned.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002152 *
Dianne Hackborne7991752013-01-16 17:56:46 -08002153 * @return Returns a List of ApplicationInfo objects, one for each application that
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002154 * is installed on the device. In the unlikely case of there being
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002155 * no installed applications, an empty list is returned.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002156 * If flag GET_UNINSTALLED_PACKAGES is set, a list of all
kmccormick30498b42013-03-27 17:39:17 -07002157 * applications including those deleted with {@code DONT_DELETE_DATA}
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002158 * (partially installed apps with data directory) will be returned.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002159 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002160 * @see #GET_META_DATA
2161 * @see #GET_SHARED_LIBRARY_FILES
2162 * @see #GET_UNINSTALLED_PACKAGES
2163 */
2164 public abstract List<ApplicationInfo> getInstalledApplications(int flags);
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002165
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002166 /**
2167 * Get a list of shared libraries that are available on the
2168 * system.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002169 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002170 * @return An array of shared library names that are
2171 * available on the system, or null if none are installed.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002172 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002173 */
2174 public abstract String[] getSystemSharedLibraryNames();
2175
2176 /**
Dianne Hackborn49237342009-08-27 20:08:01 -07002177 * Get a list of features that are available on the
2178 * system.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002179 *
Dianne Hackborn49237342009-08-27 20:08:01 -07002180 * @return An array of FeatureInfo classes describing the features
2181 * that are available on the system, or null if there are none(!!).
Dianne Hackborn49237342009-08-27 20:08:01 -07002182 */
2183 public abstract FeatureInfo[] getSystemAvailableFeatures();
2184
2185 /**
Dianne Hackborn039c68e2009-09-26 16:39:23 -07002186 * Check whether the given feature name is one of the available
2187 * features as returned by {@link #getSystemAvailableFeatures()}.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002188 *
Dianne Hackborn039c68e2009-09-26 16:39:23 -07002189 * @return Returns true if the devices supports the feature, else
2190 * false.
2191 */
2192 public abstract boolean hasSystemFeature(String name);
2193
2194 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002195 * Determine the best action to perform for a given Intent. This is how
2196 * {@link Intent#resolveActivity} finds an activity if a class has not
2197 * been explicitly specified.
2198 *
Scott Mainef6b3052011-03-23 14:23:02 -07002199 * <p><em>Note:</em> if using an implicit Intent (without an explicit ComponentName
Dianne Hackborn4d023d212010-10-01 13:41:04 -07002200 * specified), be sure to consider whether to set the {@link #MATCH_DEFAULT_ONLY}
2201 * only flag. You need to do so to resolve the activity in the same way
2202 * that {@link android.content.Context#startActivity(Intent)} and
2203 * {@link android.content.Intent#resolveActivity(PackageManager)
2204 * Intent.resolveActivity(PackageManager)} do.</p>
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002205 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002206 * @param intent An intent containing all of the desired specification
2207 * (action, data, type, category, and/or component).
2208 * @param flags Additional option flags. The most important is
Dianne Hackborn4d023d212010-10-01 13:41:04 -07002209 * {@link #MATCH_DEFAULT_ONLY}, to limit the resolution to only
2210 * those activities that support the {@link android.content.Intent#CATEGORY_DEFAULT}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002211 *
2212 * @return Returns a ResolveInfo containing the final activity intent that
2213 * was determined to be the best action. Returns null if no
Mike LeBeaubd3f5272010-02-18 19:27:17 -08002214 * matching activity was found. If multiple matching activities are
2215 * found and there is no default set, returns a ResolveInfo
2216 * containing something else, such as the activity resolver.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002217 *
2218 * @see #MATCH_DEFAULT_ONLY
2219 * @see #GET_INTENT_FILTERS
2220 * @see #GET_RESOLVED_FILTER
2221 */
2222 public abstract ResolveInfo resolveActivity(Intent intent, int flags);
2223
2224 /**
Svetoslav Ganov58d37b52012-09-18 12:04:19 -07002225 * Determine the best action to perform for a given Intent for a given user. This
2226 * is how {@link Intent#resolveActivity} finds an activity if a class has not
2227 * been explicitly specified.
2228 *
2229 * <p><em>Note:</em> if using an implicit Intent (without an explicit ComponentName
2230 * specified), be sure to consider whether to set the {@link #MATCH_DEFAULT_ONLY}
2231 * only flag. You need to do so to resolve the activity in the same way
2232 * that {@link android.content.Context#startActivity(Intent)} and
2233 * {@link android.content.Intent#resolveActivity(PackageManager)
2234 * Intent.resolveActivity(PackageManager)} do.</p>
2235 *
2236 * @param intent An intent containing all of the desired specification
2237 * (action, data, type, category, and/or component).
2238 * @param flags Additional option flags. The most important is
2239 * {@link #MATCH_DEFAULT_ONLY}, to limit the resolution to only
2240 * those activities that support the {@link android.content.Intent#CATEGORY_DEFAULT}.
2241 * @param userId The user id.
2242 *
2243 * @return Returns a ResolveInfo containing the final activity intent that
2244 * was determined to be the best action. Returns null if no
2245 * matching activity was found. If multiple matching activities are
2246 * found and there is no default set, returns a ResolveInfo
2247 * containing something else, such as the activity resolver.
2248 *
2249 * @see #MATCH_DEFAULT_ONLY
2250 * @see #GET_INTENT_FILTERS
2251 * @see #GET_RESOLVED_FILTER
2252 *
2253 * @hide
2254 */
2255 public abstract ResolveInfo resolveActivityAsUser(Intent intent, int flags, int userId);
2256
2257 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002258 * Retrieve all activities that can be performed for the given intent.
2259 *
2260 * @param intent The desired intent as per resolveActivity().
2261 * @param flags Additional option flags. The most important is
Dianne Hackborn4d023d212010-10-01 13:41:04 -07002262 * {@link #MATCH_DEFAULT_ONLY}, to limit the resolution to only
2263 * those activities that support the {@link android.content.Intent#CATEGORY_DEFAULT}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002264 *
Dianne Hackborn4d023d212010-10-01 13:41:04 -07002265 * @return A List&lt;ResolveInfo&gt; containing one entry for each matching
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002266 * Activity. These are ordered from best to worst match -- that
2267 * is, the first item in the list is what is returned by
Dianne Hackborn4d023d212010-10-01 13:41:04 -07002268 * {@link #resolveActivity}. If there are no matching activities, an empty
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002269 * list is returned.
2270 *
2271 * @see #MATCH_DEFAULT_ONLY
2272 * @see #GET_INTENT_FILTERS
2273 * @see #GET_RESOLVED_FILTER
2274 */
2275 public abstract List<ResolveInfo> queryIntentActivities(Intent intent,
2276 int flags);
2277
2278 /**
Amith Yamasani151ec4c2012-09-07 19:25:16 -07002279 * Retrieve all activities that can be performed for the given intent, for a specific user.
2280 *
2281 * @param intent The desired intent as per resolveActivity().
2282 * @param flags Additional option flags. The most important is
2283 * {@link #MATCH_DEFAULT_ONLY}, to limit the resolution to only
2284 * those activities that support the {@link android.content.Intent#CATEGORY_DEFAULT}.
2285 *
2286 * @return A List&lt;ResolveInfo&gt; containing one entry for each matching
2287 * Activity. These are ordered from best to worst match -- that
2288 * is, the first item in the list is what is returned by
2289 * {@link #resolveActivity}. If there are no matching activities, an empty
2290 * list is returned.
2291 *
2292 * @see #MATCH_DEFAULT_ONLY
2293 * @see #GET_INTENT_FILTERS
2294 * @see #GET_RESOLVED_FILTER
2295 * @hide
2296 */
Svetoslav Ganov58d37b52012-09-18 12:04:19 -07002297 public abstract List<ResolveInfo> queryIntentActivitiesAsUser(Intent intent,
Amith Yamasani151ec4c2012-09-07 19:25:16 -07002298 int flags, int userId);
2299
2300
2301 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002302 * Retrieve a set of activities that should be presented to the user as
2303 * similar options. This is like {@link #queryIntentActivities}, except it
2304 * also allows you to supply a list of more explicit Intents that you would
2305 * like to resolve to particular options, and takes care of returning the
2306 * final ResolveInfo list in a reasonable order, with no duplicates, based
2307 * on those inputs.
2308 *
2309 * @param caller The class name of the activity that is making the
2310 * request. This activity will never appear in the output
2311 * list. Can be null.
2312 * @param specifics An array of Intents that should be resolved to the
2313 * first specific results. Can be null.
2314 * @param intent The desired intent as per resolveActivity().
2315 * @param flags Additional option flags. The most important is
Dianne Hackborn4d023d212010-10-01 13:41:04 -07002316 * {@link #MATCH_DEFAULT_ONLY}, to limit the resolution to only
2317 * those activities that support the {@link android.content.Intent#CATEGORY_DEFAULT}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002318 *
Dianne Hackborn4d023d212010-10-01 13:41:04 -07002319 * @return A List&lt;ResolveInfo&gt; containing one entry for each matching
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002320 * Activity. These are ordered first by all of the intents resolved
2321 * in <var>specifics</var> and then any additional activities that
2322 * can handle <var>intent</var> but did not get included by one of
2323 * the <var>specifics</var> intents. If there are no matching
2324 * activities, an empty list is returned.
2325 *
2326 * @see #MATCH_DEFAULT_ONLY
2327 * @see #GET_INTENT_FILTERS
2328 * @see #GET_RESOLVED_FILTER
2329 */
2330 public abstract List<ResolveInfo> queryIntentActivityOptions(
2331 ComponentName caller, Intent[] specifics, Intent intent, int flags);
2332
2333 /**
2334 * Retrieve all receivers that can handle a broadcast of the given intent.
2335 *
2336 * @param intent The desired intent as per resolveActivity().
Dianne Hackborn4d023d212010-10-01 13:41:04 -07002337 * @param flags Additional option flags.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002338 *
Dianne Hackborn4d023d212010-10-01 13:41:04 -07002339 * @return A List&lt;ResolveInfo&gt; containing one entry for each matching
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002340 * Receiver. These are ordered from first to last in priority. If
2341 * there are no matching receivers, an empty list is returned.
2342 *
2343 * @see #MATCH_DEFAULT_ONLY
2344 * @see #GET_INTENT_FILTERS
2345 * @see #GET_RESOLVED_FILTER
2346 */
2347 public abstract List<ResolveInfo> queryBroadcastReceivers(Intent intent,
2348 int flags);
2349
2350 /**
Amith Yamasanif203aee2012-08-29 18:41:53 -07002351 * Retrieve all receivers that can handle a broadcast of the given intent, for a specific
2352 * user.
2353 *
2354 * @param intent The desired intent as per resolveActivity().
2355 * @param flags Additional option flags.
2356 * @param userId The userId of the user being queried.
2357 *
2358 * @return A List&lt;ResolveInfo&gt; containing one entry for each matching
2359 * Receiver. These are ordered from first to last in priority. If
2360 * there are no matching receivers, an empty list is returned.
2361 *
2362 * @see #MATCH_DEFAULT_ONLY
2363 * @see #GET_INTENT_FILTERS
2364 * @see #GET_RESOLVED_FILTER
2365 * @hide
2366 */
2367 public abstract List<ResolveInfo> queryBroadcastReceivers(Intent intent,
2368 int flags, int userId);
2369
2370 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002371 * Determine the best service to handle for a given Intent.
2372 *
2373 * @param intent An intent containing all of the desired specification
2374 * (action, data, type, category, and/or component).
2375 * @param flags Additional option flags.
2376 *
2377 * @return Returns a ResolveInfo containing the final service intent that
2378 * was determined to be the best action. Returns null if no
2379 * matching service was found.
2380 *
2381 * @see #GET_INTENT_FILTERS
2382 * @see #GET_RESOLVED_FILTER
2383 */
2384 public abstract ResolveInfo resolveService(Intent intent, int flags);
2385
2386 /**
2387 * Retrieve all services that can match the given intent.
2388 *
2389 * @param intent The desired intent as per resolveService().
2390 * @param flags Additional option flags.
2391 *
Dianne Hackborn4d023d212010-10-01 13:41:04 -07002392 * @return A List&lt;ResolveInfo&gt; containing one entry for each matching
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002393 * ServiceInfo. These are ordered from best to worst match -- that
2394 * is, the first item in the list is what is returned by
2395 * resolveService(). If there are no matching services, an empty
2396 * list is returned.
2397 *
2398 * @see #GET_INTENT_FILTERS
2399 * @see #GET_RESOLVED_FILTER
2400 */
2401 public abstract List<ResolveInfo> queryIntentServices(Intent intent,
2402 int flags);
2403
2404 /**
Svetoslav Ganov58d37b52012-09-18 12:04:19 -07002405 * Retrieve all services that can match the given intent for a given user.
2406 *
2407 * @param intent The desired intent as per resolveService().
2408 * @param flags Additional option flags.
2409 * @param userId The user id.
2410 *
2411 * @return A List&lt;ResolveInfo&gt; containing one entry for each matching
2412 * ServiceInfo. These are ordered from best to worst match -- that
2413 * is, the first item in the list is what is returned by
2414 * resolveService(). If there are no matching services, an empty
2415 * list is returned.
2416 *
2417 * @see #GET_INTENT_FILTERS
2418 * @see #GET_RESOLVED_FILTER
2419 *
2420 * @hide
2421 */
2422 public abstract List<ResolveInfo> queryIntentServicesAsUser(Intent intent,
2423 int flags, int userId);
2424
Jeff Sharkey85f5f812013-10-07 10:16:12 -07002425 /** {@hide} */
2426 public abstract List<ResolveInfo> queryIntentContentProvidersAsUser(
2427 Intent intent, int flags, int userId);
2428
2429 /**
2430 * Retrieve all providers that can match the given intent.
2431 *
2432 * @param intent An intent containing all of the desired specification
2433 * (action, data, type, category, and/or component).
2434 * @param flags Additional option flags.
2435 * @return A List&lt;ResolveInfo&gt; containing one entry for each matching
2436 * ProviderInfo. These are ordered from best to worst match. If
2437 * there are no matching providers, an empty list is returned.
2438 * @see #GET_INTENT_FILTERS
2439 * @see #GET_RESOLVED_FILTER
2440 */
2441 public abstract List<ResolveInfo> queryIntentContentProviders(Intent intent, int flags);
2442
Svetoslav Ganov58d37b52012-09-18 12:04:19 -07002443 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002444 * Find a single content provider by its base path name.
2445 *
2446 * @param name The name of the provider to find.
2447 * @param flags Additional option flags. Currently should always be 0.
2448 *
2449 * @return ContentProviderInfo Information about the provider, if found,
2450 * else null.
2451 */
2452 public abstract ProviderInfo resolveContentProvider(String name,
2453 int flags);
2454
2455 /**
2456 * Retrieve content provider information.
2457 *
2458 * <p><em>Note: unlike most other methods, an empty result set is indicated
2459 * by a null return instead of an empty list.</em>
2460 *
2461 * @param processName If non-null, limits the returned providers to only
2462 * those that are hosted by the given process. If null,
2463 * all content providers are returned.
2464 * @param uid If <var>processName</var> is non-null, this is the required
2465 * uid owning the requested content providers.
2466 * @param flags Additional option flags. Currently should always be 0.
2467 *
Dianne Hackborn4d023d212010-10-01 13:41:04 -07002468 * @return A List&lt;ContentProviderInfo&gt; containing one entry for each
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002469 * content provider either patching <var>processName</var> or, if
2470 * <var>processName</var> is null, all known content providers.
2471 * <em>If there are no matching providers, null is returned.</em>
2472 */
2473 public abstract List<ProviderInfo> queryContentProviders(
2474 String processName, int uid, int flags);
2475
2476 /**
2477 * Retrieve all of the information we know about a particular
2478 * instrumentation class.
2479 *
2480 * <p>Throws {@link NameNotFoundException} if instrumentation with the
kmccormick30498b42013-03-27 17:39:17 -07002481 * given class name cannot be found on the system.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002482 *
2483 * @param className The full name (i.e.
2484 * com.google.apps.contacts.InstrumentList) of an
2485 * Instrumentation class.
2486 * @param flags Additional option flags. Currently should always be 0.
2487 *
2488 * @return InstrumentationInfo containing information about the
2489 * instrumentation.
2490 */
2491 public abstract InstrumentationInfo getInstrumentationInfo(
2492 ComponentName className, int flags) throws NameNotFoundException;
2493
2494 /**
2495 * Retrieve information about available instrumentation code. May be used
2496 * to retrieve either all instrumentation code, or only the code targeting
2497 * a particular package.
2498 *
2499 * @param targetPackage If null, all instrumentation is returned; only the
2500 * instrumentation targeting this package name is
2501 * returned.
2502 * @param flags Additional option flags. Currently should always be 0.
2503 *
Dianne Hackborn4d023d212010-10-01 13:41:04 -07002504 * @return A List&lt;InstrumentationInfo&gt; containing one entry for each
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002505 * matching available Instrumentation. Returns an empty list if
2506 * there is no instrumentation available for the given package.
2507 */
2508 public abstract List<InstrumentationInfo> queryInstrumentation(
2509 String targetPackage, int flags);
2510
2511 /**
2512 * Retrieve an image from a package. This is a low-level API used by
2513 * the various package manager info structures (such as
2514 * {@link ComponentInfo} to implement retrieval of their associated
2515 * icon.
2516 *
2517 * @param packageName The name of the package that this icon is coming from.
kmccormick30498b42013-03-27 17:39:17 -07002518 * Cannot be null.
2519 * @param resid The resource identifier of the desired image. Cannot be 0.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002520 * @param appInfo Overall information about <var>packageName</var>. This
2521 * may be null, in which case the application information will be retrieved
2522 * for you if needed; if you already have this information around, it can
2523 * be much more efficient to supply it here.
2524 *
2525 * @return Returns a Drawable holding the requested image. Returns null if
2526 * an image could not be found for any reason.
2527 */
2528 public abstract Drawable getDrawable(String packageName, int resid,
2529 ApplicationInfo appInfo);
2530
2531 /**
2532 * Retrieve the icon associated with an activity. Given the full name of
2533 * an activity, retrieves the information about it and calls
2534 * {@link ComponentInfo#loadIcon ComponentInfo.loadIcon()} to return its icon.
kmccormick30498b42013-03-27 17:39:17 -07002535 * If the activity cannot be found, NameNotFoundException is thrown.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002536 *
2537 * @param activityName Name of the activity whose icon is to be retrieved.
2538 *
2539 * @return Returns the image of the icon, or the default activity icon if
2540 * it could not be found. Does not return null.
2541 * @throws NameNotFoundException Thrown if the resources for the given
2542 * activity could not be loaded.
2543 *
2544 * @see #getActivityIcon(Intent)
2545 */
2546 public abstract Drawable getActivityIcon(ComponentName activityName)
2547 throws NameNotFoundException;
2548
2549 /**
2550 * Retrieve the icon associated with an Intent. If intent.getClassName() is
2551 * set, this simply returns the result of
2552 * getActivityIcon(intent.getClassName()). Otherwise it resolves the intent's
2553 * component and returns the icon associated with the resolved component.
kmccormick30498b42013-03-27 17:39:17 -07002554 * If intent.getClassName() cannot be found or the Intent cannot be resolved
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002555 * to a component, NameNotFoundException is thrown.
2556 *
2557 * @param intent The intent for which you would like to retrieve an icon.
2558 *
2559 * @return Returns the image of the icon, or the default activity icon if
2560 * it could not be found. Does not return null.
2561 * @throws NameNotFoundException Thrown if the resources for application
2562 * matching the given intent could not be loaded.
2563 *
2564 * @see #getActivityIcon(ComponentName)
2565 */
2566 public abstract Drawable getActivityIcon(Intent intent)
2567 throws NameNotFoundException;
2568
2569 /**
Jose Limaf78e3122014-03-06 12:13:15 -08002570 * Retrieve the banner 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
2573 * banner. If the activity cannot be found, NameNotFoundException is thrown.
2574 *
2575 * @param activityName Name of the activity whose banner is to be retrieved.
2576 * @return Returns the image of the banner, or null if the activity has no
2577 * banner specified.
2578 * @throws NameNotFoundException Thrown if the resources for the given
2579 * activity could not be loaded.
2580 * @see #getActivityBanner(Intent)
2581 */
2582 public abstract Drawable getActivityBanner(ComponentName activityName)
2583 throws NameNotFoundException;
2584
2585 /**
2586 * Retrieve the banner associated with an Intent. If intent.getClassName()
2587 * is set, this simply returns the result of
2588 * getActivityBanner(intent.getClassName()). Otherwise it resolves the
2589 * intent's component and returns the banner associated with the resolved
2590 * component. If intent.getClassName() cannot be found or the Intent cannot
2591 * be resolved to a component, NameNotFoundException is thrown.
2592 *
2593 * @param intent The intent for which you would like to retrieve a banner.
2594 * @return Returns the image of the banner, or null if the activity has no
2595 * banner specified.
2596 * @throws NameNotFoundException Thrown if the resources for application
2597 * matching the given intent could not be loaded.
2598 * @see #getActivityBanner(ComponentName)
2599 */
2600 public abstract Drawable getActivityBanner(Intent intent)
2601 throws NameNotFoundException;
2602
2603 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002604 * Return the generic icon for an activity that is used when no specific
2605 * icon is defined.
Adam Connors23cc04e2014-04-01 12:12:20 +01002606 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002607 * @return Drawable Image of the icon.
2608 */
2609 public abstract Drawable getDefaultActivityIcon();
2610
2611 /**
2612 * Retrieve the icon associated with an application. If it has not defined
2613 * an icon, the default app icon is returned. Does not return null.
2614 *
2615 * @param info Information about application being queried.
2616 *
2617 * @return Returns the image of the icon, or the default application icon
2618 * if it could not be found.
2619 *
2620 * @see #getApplicationIcon(String)
2621 */
2622 public abstract Drawable getApplicationIcon(ApplicationInfo info);
2623
2624 /**
2625 * Retrieve the icon associated with an application. Given the name of the
2626 * application's package, retrieves the information about it and calls
kmccormick30498b42013-03-27 17:39:17 -07002627 * getApplicationIcon() to return its icon. If the application cannot be
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002628 * found, NameNotFoundException is thrown.
2629 *
2630 * @param packageName Name of the package whose application icon is to be
2631 * retrieved.
2632 *
2633 * @return Returns the image of the icon, or the default application icon
2634 * if it could not be found. Does not return null.
2635 * @throws NameNotFoundException Thrown if the resources for the given
2636 * application could not be loaded.
2637 *
2638 * @see #getApplicationIcon(ApplicationInfo)
2639 */
2640 public abstract Drawable getApplicationIcon(String packageName)
2641 throws NameNotFoundException;
2642
2643 /**
Jose Limaf78e3122014-03-06 12:13:15 -08002644 * Retrieve the banner associated with an application.
2645 *
2646 * @param info Information about application being queried.
2647 * @return Returns the image of the banner or null if the application has no
2648 * banner specified.
2649 * @see #getApplicationBanner(String)
2650 */
2651 public abstract Drawable getApplicationBanner(ApplicationInfo info);
2652
2653 /**
2654 * Retrieve the banner associated with an application. Given the name of the
2655 * application's package, retrieves the information about it and calls
2656 * getApplicationIcon() to return its banner. If the application cannot be
2657 * found, NameNotFoundException is thrown.
2658 *
2659 * @param packageName Name of the package whose application banner is to be
2660 * retrieved.
2661 * @return Returns the image of the banner or null if the application has no
2662 * banner specified.
2663 * @throws NameNotFoundException Thrown if the resources for the given
2664 * application could not be loaded.
2665 * @see #getApplicationBanner(ApplicationInfo)
2666 */
2667 public abstract Drawable getApplicationBanner(String packageName)
2668 throws NameNotFoundException;
2669
2670 /**
2671 * Retrieve the logo associated with an activity. Given the full name of an
2672 * activity, retrieves the information about it and calls
2673 * {@link ComponentInfo#loadLogo ComponentInfo.loadLogo()} to return its
2674 * logo. If the activity cannot be found, NameNotFoundException is thrown.
Adam Powell81cd2e92010-04-21 16:35:18 -07002675 *
2676 * @param activityName Name of the activity whose logo is to be retrieved.
Jose Limaf78e3122014-03-06 12:13:15 -08002677 * @return Returns the image of the logo or null if the activity has no logo
2678 * specified.
Adam Powell81cd2e92010-04-21 16:35:18 -07002679 * @throws NameNotFoundException Thrown if the resources for the given
Jose Limaf78e3122014-03-06 12:13:15 -08002680 * activity could not be loaded.
Adam Powell81cd2e92010-04-21 16:35:18 -07002681 * @see #getActivityLogo(Intent)
2682 */
2683 public abstract Drawable getActivityLogo(ComponentName activityName)
2684 throws NameNotFoundException;
2685
2686 /**
2687 * Retrieve the logo associated with an Intent. If intent.getClassName() is
2688 * set, this simply returns the result of
2689 * getActivityLogo(intent.getClassName()). Otherwise it resolves the intent's
2690 * component and returns the logo associated with the resolved component.
kmccormick30498b42013-03-27 17:39:17 -07002691 * If intent.getClassName() cannot be found or the Intent cannot be resolved
Adam Powell81cd2e92010-04-21 16:35:18 -07002692 * to a component, NameNotFoundException is thrown.
2693 *
2694 * @param intent The intent for which you would like to retrieve a logo.
2695 *
2696 * @return Returns the image of the logo, or null if the activity has no
2697 * logo specified.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002698 *
Adam Powell81cd2e92010-04-21 16:35:18 -07002699 * @throws NameNotFoundException Thrown if the resources for application
2700 * matching the given intent could not be loaded.
2701 *
2702 * @see #getActivityLogo(ComponentName)
2703 */
2704 public abstract Drawable getActivityLogo(Intent intent)
2705 throws NameNotFoundException;
2706
2707 /**
2708 * Retrieve the logo associated with an application. If it has not specified
2709 * a logo, this method returns null.
2710 *
2711 * @param info Information about application being queried.
2712 *
2713 * @return Returns the image of the logo, or null if no logo is specified
2714 * by the application.
2715 *
2716 * @see #getApplicationLogo(String)
2717 */
2718 public abstract Drawable getApplicationLogo(ApplicationInfo info);
2719
2720 /**
2721 * Retrieve the logo associated with an application. Given the name of the
2722 * application's package, retrieves the information about it and calls
kmccormick30498b42013-03-27 17:39:17 -07002723 * getApplicationLogo() to return its logo. If the application cannot be
Adam Powell81cd2e92010-04-21 16:35:18 -07002724 * found, NameNotFoundException is thrown.
2725 *
2726 * @param packageName Name of the package whose application logo is to be
2727 * retrieved.
2728 *
2729 * @return Returns the image of the logo, or null if no application logo
2730 * has been specified.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002731 *
Adam Powell81cd2e92010-04-21 16:35:18 -07002732 * @throws NameNotFoundException Thrown if the resources for the given
2733 * application could not be loaded.
2734 *
2735 * @see #getApplicationLogo(ApplicationInfo)
2736 */
2737 public abstract Drawable getApplicationLogo(String packageName)
2738 throws NameNotFoundException;
2739
2740 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002741 * Retrieve text from a package. This is a low-level API used by
2742 * the various package manager info structures (such as
2743 * {@link ComponentInfo} to implement retrieval of their associated
2744 * labels and other text.
2745 *
2746 * @param packageName The name of the package that this text is coming from.
kmccormick30498b42013-03-27 17:39:17 -07002747 * Cannot be null.
2748 * @param resid The resource identifier of the desired text. Cannot be 0.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002749 * @param appInfo Overall information about <var>packageName</var>. This
2750 * may be null, in which case the application information will be retrieved
2751 * for you if needed; if you already have this information around, it can
2752 * be much more efficient to supply it here.
2753 *
2754 * @return Returns a CharSequence holding the requested text. Returns null
2755 * if the text could not be found for any reason.
2756 */
2757 public abstract CharSequence getText(String packageName, int resid,
2758 ApplicationInfo appInfo);
2759
2760 /**
2761 * Retrieve an XML file from a package. This is a low-level API used to
2762 * retrieve XML meta data.
2763 *
2764 * @param packageName The name of the package that this xml is coming from.
kmccormick30498b42013-03-27 17:39:17 -07002765 * Cannot be null.
2766 * @param resid The resource identifier of the desired xml. Cannot be 0.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002767 * @param appInfo Overall information about <var>packageName</var>. This
2768 * may be null, in which case the application information will be retrieved
2769 * for you if needed; if you already have this information around, it can
2770 * be much more efficient to supply it here.
2771 *
2772 * @return Returns an XmlPullParser allowing you to parse out the XML
2773 * data. Returns null if the xml resource could not be found for any
2774 * reason.
2775 */
2776 public abstract XmlResourceParser getXml(String packageName, int resid,
2777 ApplicationInfo appInfo);
2778
2779 /**
2780 * Return the label to use for this application.
2781 *
2782 * @return Returns the label associated with this application, or null if
2783 * it could not be found for any reason.
kmccormick30498b42013-03-27 17:39:17 -07002784 * @param info The application to get the label of.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002785 */
2786 public abstract CharSequence getApplicationLabel(ApplicationInfo info);
2787
2788 /**
2789 * Retrieve the resources associated with an activity. Given the full
2790 * name of an activity, retrieves the information about it and calls
2791 * getResources() to return its application's resources. If the activity
kmccormick30498b42013-03-27 17:39:17 -07002792 * cannot be found, NameNotFoundException is thrown.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002793 *
2794 * @param activityName Name of the activity whose resources are to be
2795 * retrieved.
2796 *
2797 * @return Returns the application's Resources.
2798 * @throws NameNotFoundException Thrown if the resources for the given
2799 * application could not be loaded.
2800 *
2801 * @see #getResourcesForApplication(ApplicationInfo)
2802 */
2803 public abstract Resources getResourcesForActivity(ComponentName activityName)
2804 throws NameNotFoundException;
2805
2806 /**
2807 * Retrieve the resources for an application. Throws NameNotFoundException
2808 * if the package is no longer installed.
2809 *
2810 * @param app Information about the desired application.
2811 *
2812 * @return Returns the application's Resources.
2813 * @throws NameNotFoundException Thrown if the resources for the given
2814 * application could not be loaded (most likely because it was uninstalled).
2815 */
2816 public abstract Resources getResourcesForApplication(ApplicationInfo app)
2817 throws NameNotFoundException;
2818
2819 /**
2820 * Retrieve the resources associated with an application. Given the full
2821 * package name of an application, retrieves the information about it and
2822 * calls getResources() to return its application's resources. If the
kmccormick30498b42013-03-27 17:39:17 -07002823 * appPackageName cannot be found, NameNotFoundException is thrown.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002824 *
2825 * @param appPackageName Package name of the application whose resources
2826 * are to be retrieved.
2827 *
2828 * @return Returns the application's Resources.
2829 * @throws NameNotFoundException Thrown if the resources for the given
2830 * application could not be loaded.
2831 *
2832 * @see #getResourcesForApplication(ApplicationInfo)
2833 */
2834 public abstract Resources getResourcesForApplication(String appPackageName)
2835 throws NameNotFoundException;
2836
Amith Yamasani98edc952012-09-25 14:09:27 -07002837 /** @hide */
2838 public abstract Resources getResourcesForApplicationAsUser(String appPackageName, int userId)
2839 throws NameNotFoundException;
2840
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002841 /**
2842 * Retrieve overall information about an application package defined
2843 * in a package archive file
2844 *
2845 * @param archiveFilePath The path to the archive file
2846 * @param flags Additional option flags. Use any combination of
2847 * {@link #GET_ACTIVITIES},
2848 * {@link #GET_GIDS},
2849 * {@link #GET_CONFIGURATIONS},
2850 * {@link #GET_INSTRUMENTATION},
2851 * {@link #GET_PERMISSIONS},
2852 * {@link #GET_PROVIDERS},
2853 * {@link #GET_RECEIVERS},
2854 * {@link #GET_SERVICES},
2855 * {@link #GET_SIGNATURES}, to modify the data returned.
2856 *
2857 * @return Returns the information about the package. Returns
2858 * null if the package could not be successfully parsed.
2859 *
2860 * @see #GET_ACTIVITIES
2861 * @see #GET_GIDS
2862 * @see #GET_CONFIGURATIONS
2863 * @see #GET_INSTRUMENTATION
2864 * @see #GET_PERMISSIONS
2865 * @see #GET_PROVIDERS
2866 * @see #GET_RECEIVERS
2867 * @see #GET_SERVICES
2868 * @see #GET_SIGNATURES
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002869 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002870 */
2871 public PackageInfo getPackageArchiveInfo(String archiveFilePath, int flags) {
2872 PackageParser packageParser = new PackageParser(archiveFilePath);
2873 DisplayMetrics metrics = new DisplayMetrics();
2874 metrics.setToDefaults();
2875 final File sourceFile = new File(archiveFilePath);
2876 PackageParser.Package pkg = packageParser.parsePackage(
2877 sourceFile, archiveFilePath, metrics, 0);
2878 if (pkg == null) {
2879 return null;
2880 }
Kenny Root6ccd4122011-10-13 14:56:21 -07002881 if ((flags & GET_SIGNATURES) != 0) {
2882 packageParser.collectCertificates(pkg, 0);
2883 }
Dianne Hackborn7767eac2012-08-23 18:25:40 -07002884 PackageUserState state = new PackageUserState();
2885 return PackageParser.generatePackageInfo(pkg, null, flags, 0, 0, null, state);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002886 }
2887
2888 /**
Dianne Hackbornade3eca2009-05-11 18:54:45 -07002889 * @hide
Amith Yamasani4b2e9342011-03-31 12:38:53 -07002890 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002891 * Install a package. Since this may take a little while, the result will
2892 * be posted back to the given observer. An installation will fail if the calling context
2893 * lacks the {@link android.Manifest.permission#INSTALL_PACKAGES} permission, if the
2894 * package named in the package file's manifest is already installed, or if there's no space
2895 * available on the device.
2896 *
2897 * @param packageURI The location of the package file to install. This can be a 'file:' or a
2898 * 'content:' URI.
2899 * @param observer An observer callback to get notified when the package installation is
2900 * complete. {@link IPackageInstallObserver#packageInstalled(String, int)} will be
Christopher Tatef1977b42014-03-24 16:25:51 -07002901 * called when that happens. This parameter must not be null.
Dianne Hackbornade3eca2009-05-11 18:54:45 -07002902 * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK},
2903 * {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}.
Jacek Surazski65e13172009-04-28 15:26:38 +02002904 * @param installerPackageName Optional package name of the application that is performing the
2905 * installation. This identifies which market the package came from.
Christopher Tatef1977b42014-03-24 16:25:51 -07002906 * @deprecated Use {@link #installPackage(Uri, IPackageInstallObserver2, int, String)}
2907 * instead. This method will continue to be supported but the older observer interface
2908 * will not get additional failure details.
Jacek Surazski65e13172009-04-28 15:26:38 +02002909 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -07002910 // @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002911 public abstract void installPackage(
Jacek Surazski65e13172009-04-28 15:26:38 +02002912 Uri packageURI, IPackageInstallObserver observer, int flags,
2913 String installerPackageName);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08002914
2915 /**
Kenny Root5ab21572011-07-27 11:11:19 -07002916 * Similar to
2917 * {@link #installPackage(Uri, IPackageInstallObserver, int, String)} but
2918 * with an extra verification file provided.
2919 *
2920 * @param packageURI The location of the package file to install. This can
2921 * be a 'file:' or a 'content:' URI.
2922 * @param observer An observer callback to get notified when the package
2923 * installation is complete.
2924 * {@link IPackageInstallObserver#packageInstalled(String, int)}
Christopher Tatef1977b42014-03-24 16:25:51 -07002925 * will be called when that happens. This parameter must not be null.
Christopher Tateab8a5012014-03-24 16:25:51 -07002926 * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK},
Christopher Tatef1977b42014-03-24 16:25:51 -07002927 * {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}.
Christopher Tateab8a5012014-03-24 16:25:51 -07002928 * @param installerPackageName Optional package name of the application that
2929 * is performing the installation. This identifies which market
2930 * the package came from.
2931 * @param verificationURI The location of the supplementary verification
2932 * file. This can be a 'file:' or a 'content:' URI. May be
2933 * {@code null}.
2934 * @param manifestDigest an object that holds the digest of the package
2935 * which can be used to verify ownership. May be {@code null}.
2936 * @param encryptionParams if the package to be installed is encrypted,
2937 * these parameters describing the encryption and authentication
2938 * used. May be {@code null}.
2939 * @hide
Christopher Tatef1977b42014-03-24 16:25:51 -07002940 * @deprecated Use {@link #installPackageWithVerification(Uri, IPackageInstallObserver2,
2941 * int, String, Uri, ManifestDigest, ContainerEncryptionParams)} instead. This method will
2942 * continue to be supported but the older observer interface will not get additional failure
2943 * details.
Christopher Tateab8a5012014-03-24 16:25:51 -07002944 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -07002945 // @SystemApi
Christopher Tateab8a5012014-03-24 16:25:51 -07002946 public abstract void installPackageWithVerification(Uri packageURI,
2947 IPackageInstallObserver observer, int flags, String installerPackageName,
2948 Uri verificationURI, ManifestDigest manifestDigest,
2949 ContainerEncryptionParams encryptionParams);
2950
2951 /**
2952 * Similar to
2953 * {@link #installPackage(Uri, IPackageInstallObserver, int, String)} but
2954 * with an extra verification information provided.
2955 *
2956 * @param packageURI The location of the package file to install. This can
2957 * be a 'file:' or a 'content:' URI.
2958 * @param observer An observer callback to get notified when the package
2959 * installation is complete.
2960 * {@link IPackageInstallObserver#packageInstalled(String, int)}
Christopher Tatef1977b42014-03-24 16:25:51 -07002961 * will be called when that happens. This parameter must not be null.
Christopher Tateab8a5012014-03-24 16:25:51 -07002962 * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK},
Christopher Tatef1977b42014-03-24 16:25:51 -07002963 * {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}.
2964 * @param installerPackageName Optional package name of the application that
2965 * is performing the installation. This identifies which market
2966 * the package came from.
2967 * @param verificationParams an object that holds signal information to
2968 * assist verification. May be {@code null}.
2969 * @param encryptionParams if the package to be installed is encrypted,
2970 * these parameters describing the encryption and authentication
2971 * used. May be {@code null}.
2972 *
2973 * @hide
2974 * @deprecated Use {@link #installPackageWithVerificationAndEncryption(Uri,
2975 * IPackageInstallObserver2, int, String, VerificationParams,
2976 * ContainerEncryptionParams)} instead. This method will continue to be
2977 * supported but the older observer interface will not get additional failure details.
2978 */
2979 @Deprecated
2980 public abstract void installPackageWithVerificationAndEncryption(Uri packageURI,
2981 IPackageInstallObserver observer, int flags, String installerPackageName,
2982 VerificationParams verificationParams,
2983 ContainerEncryptionParams encryptionParams);
2984
2985 // Package-install variants that take the new, expanded form of observer interface.
2986 // Note that these *also* take the original observer type and will redundantly
2987 // report the same information to that observer if supplied; but it is not required.
2988
2989 /**
2990 * @hide
2991 *
2992 * Install a package. Since this may take a little while, the result will
2993 * be posted back to the given observer. An installation will fail if the calling context
2994 * lacks the {@link android.Manifest.permission#INSTALL_PACKAGES} permission, if the
2995 * package named in the package file's manifest is already installed, or if there's no space
2996 * available on the device.
2997 *
2998 * @param packageURI The location of the package file to install. This can be a 'file:' or a
2999 * 'content:' URI.
3000 * @param observer An observer callback to get notified when the package installation is
3001 * complete. {@link PackageInstallObserver#packageInstalled(String, Bundle, int)} will be
3002 * called when that happens. This parameter must not be null.
3003 * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK},
3004 * {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}.
3005 * @param installerPackageName Optional package name of the application that is performing the
3006 * installation. This identifies which market the package came from.
3007 */
3008 public abstract void installPackage(
3009 Uri packageURI, PackageInstallObserver observer,
3010 int flags, String installerPackageName);
3011
3012 /**
3013 * Similar to
3014 * {@link #installPackage(Uri, IPackageInstallObserver, int, String)} but
3015 * with an extra verification file provided.
3016 *
3017 * @param packageURI The location of the package file to install. This can
3018 * be a 'file:' or a 'content:' URI.
3019 * @param observer An observer callback to get notified when the package installation is
3020 * complete. {@link PackageInstallObserver#packageInstalled(String, Bundle, int)} will be
3021 * called when that happens. This parameter must not be null.
3022 * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK},
3023 * {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}.
3024 * @param installerPackageName Optional package name of the application that
3025 * is performing the installation. This identifies which market
3026 * the package came from.
3027 * @param verificationURI The location of the supplementary verification
3028 * file. This can be a 'file:' or a 'content:' URI. May be
3029 * {@code null}.
3030 * @param manifestDigest an object that holds the digest of the package
3031 * which can be used to verify ownership. May be {@code null}.
3032 * @param encryptionParams if the package to be installed is encrypted,
3033 * these parameters describing the encryption and authentication
3034 * used. May be {@code null}.
3035 * @hide
3036 */
3037 public abstract void installPackageWithVerification(Uri packageURI,
3038 PackageInstallObserver observer, int flags, String installerPackageName,
3039 Uri verificationURI, ManifestDigest manifestDigest,
3040 ContainerEncryptionParams encryptionParams);
3041
3042 /**
3043 * Similar to
3044 * {@link #installPackage(Uri, IPackageInstallObserver, int, String)} but
3045 * with an extra verification information provided.
3046 *
3047 * @param packageURI The location of the package file to install. This can
3048 * be a 'file:' or a 'content:' URI.
3049 * @param observer An observer callback to get notified when the package installation is
3050 * complete. {@link PackageInstallObserver#packageInstalled(String, Bundle, int)} will be
3051 * called when that happens. This parameter must not be null.
3052 * @param flags - possible values: {@link #INSTALL_FORWARD_LOCK},
3053 * {@link #INSTALL_REPLACE_EXISTING}, {@link #INSTALL_ALLOW_TEST}.
Christopher Tateab8a5012014-03-24 16:25:51 -07003054 * @param installerPackageName Optional package name of the application that
3055 * is performing the installation. This identifies which market
3056 * the package came from.
3057 * @param verificationParams an object that holds signal information to
3058 * assist verification. May be {@code null}.
3059 * @param encryptionParams if the package to be installed is encrypted,
3060 * these parameters describing the encryption and authentication
3061 * used. May be {@code null}.
3062 *
3063 * @hide
Christopher Tateab8a5012014-03-24 16:25:51 -07003064 */
Christopher Tateab8a5012014-03-24 16:25:51 -07003065 public abstract void installPackageWithVerificationAndEncryption(Uri packageURI,
Christopher Tatef1977b42014-03-24 16:25:51 -07003066 PackageInstallObserver observer, int flags, String installerPackageName,
3067 VerificationParams verificationParams, ContainerEncryptionParams encryptionParams);
Christopher Tateab8a5012014-03-24 16:25:51 -07003068
rich cannings706e8ba2012-08-20 13:20:14 -07003069 /**
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003070 * If there is already an application with the given package name installed
3071 * on the system for other users, also install it for the calling user.
3072 * @hide
3073 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -07003074 // @SystemApi
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003075 public abstract int installExistingPackage(String packageName)
3076 throws NameNotFoundException;
3077
3078 /**
Kenny Root5ab21572011-07-27 11:11:19 -07003079 * Allows a package listening to the
3080 * {@link Intent#ACTION_PACKAGE_NEEDS_VERIFICATION package verification
Kenny Root3a9b5fb2011-09-20 14:15:38 -07003081 * broadcast} to respond to the package manager. The response must include
3082 * the {@code verificationCode} which is one of
3083 * {@link PackageManager#VERIFICATION_ALLOW} or
3084 * {@link PackageManager#VERIFICATION_REJECT}.
Kenny Root5ab21572011-07-27 11:11:19 -07003085 *
3086 * @param id pending package identifier as passed via the
kmccormick30498b42013-03-27 17:39:17 -07003087 * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra.
Kenny Root3a9b5fb2011-09-20 14:15:38 -07003088 * @param verificationCode either {@link PackageManager#VERIFICATION_ALLOW}
3089 * or {@link PackageManager#VERIFICATION_REJECT}.
rich cannings7e671512012-08-27 14:44:16 -07003090 * @throws SecurityException if the caller does not have the
Dianne Hackborn8832c182012-09-17 17:20:24 -07003091 * PACKAGE_VERIFICATION_AGENT permission.
Kenny Root5ab21572011-07-27 11:11:19 -07003092 */
Kenny Root3a9b5fb2011-09-20 14:15:38 -07003093 public abstract void verifyPendingInstall(int id, int verificationCode);
Kenny Root5ab21572011-07-27 11:11:19 -07003094
3095 /**
rich canningsd9ef3e52012-08-22 14:28:05 -07003096 * Allows a package listening to the
3097 * {@link Intent#ACTION_PACKAGE_NEEDS_VERIFICATION package verification
3098 * broadcast} to extend the default timeout for a response and declare what
3099 * action to perform after the timeout occurs. The response must include
3100 * the {@code verificationCodeAtTimeout} which is one of
3101 * {@link PackageManager#VERIFICATION_ALLOW} or
3102 * {@link PackageManager#VERIFICATION_REJECT}.
3103 *
3104 * This method may only be called once per package id. Additional calls
3105 * will have no effect.
3106 *
3107 * @param id pending package identifier as passed via the
kmccormick30498b42013-03-27 17:39:17 -07003108 * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra.
rich canningsd9ef3e52012-08-22 14:28:05 -07003109 * @param verificationCodeAtTimeout either
3110 * {@link PackageManager#VERIFICATION_ALLOW} or
rich canningsd1b5cfc2012-08-29 14:49:51 -07003111 * {@link PackageManager#VERIFICATION_REJECT}. If
3112 * {@code verificationCodeAtTimeout} is neither
3113 * {@link PackageManager#VERIFICATION_ALLOW} or
3114 * {@link PackageManager#VERIFICATION_REJECT}, then
3115 * {@code verificationCodeAtTimeout} will default to
rich canningsd9ef3e52012-08-22 14:28:05 -07003116 * {@link PackageManager#VERIFICATION_REJECT}.
3117 * @param millisecondsToDelay the amount of time requested for the timeout.
3118 * Must be positive and less than
rich canningsd1b5cfc2012-08-29 14:49:51 -07003119 * {@link PackageManager#MAXIMUM_VERIFICATION_TIMEOUT}. If
3120 * {@code millisecondsToDelay} is out of bounds,
3121 * {@code millisecondsToDelay} will be set to the closest in
3122 * bounds value; namely, 0 or
rich canningsd9ef3e52012-08-22 14:28:05 -07003123 * {@link PackageManager#MAXIMUM_VERIFICATION_TIMEOUT}.
rich cannings7e671512012-08-27 14:44:16 -07003124 * @throws SecurityException if the caller does not have the
Dianne Hackborn8832c182012-09-17 17:20:24 -07003125 * PACKAGE_VERIFICATION_AGENT permission.
rich canningsd9ef3e52012-08-22 14:28:05 -07003126 */
3127 public abstract void extendVerificationTimeout(int id,
3128 int verificationCodeAtTimeout, long millisecondsToDelay);
3129
3130 /**
Dianne Hackborn880119b2010-11-18 22:26:40 -08003131 * Change the installer associated with a given package. There are limitations
3132 * on how the installer package can be changed; in particular:
3133 * <ul>
3134 * <li> A SecurityException will be thrown if <var>installerPackageName</var>
3135 * is not signed with the same certificate as the calling application.
3136 * <li> A SecurityException will be thrown if <var>targetPackage</var> already
3137 * has an installer package, and that installer package is not signed with
3138 * the same certificate as the calling application.
3139 * </ul>
3140 *
3141 * @param targetPackage The installed package whose installer will be changed.
3142 * @param installerPackageName The package name of the new installer. May be
3143 * null to clear the association.
3144 */
3145 public abstract void setInstallerPackageName(String targetPackage,
3146 String installerPackageName);
3147
3148 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003149 * Attempts to delete a package. Since this may take a little while, the result will
3150 * be posted back to the given observer. A deletion will fail if the calling context
3151 * lacks the {@link android.Manifest.permission#DELETE_PACKAGES} permission, if the
3152 * named package cannot be found, or if the named package is a "system package".
3153 * (TODO: include pointer to documentation on "system packages")
3154 *
3155 * @param packageName The name of the package to delete
3156 * @param observer An observer callback to get notified when the package deletion is
3157 * complete. {@link android.content.pm.IPackageDeleteObserver#packageDeleted(boolean)} will be
3158 * called when that happens. observer may be null to indicate that no callback is desired.
Dianne Hackborn7767eac2012-08-23 18:25:40 -07003159 * @param flags - possible values: {@link #DELETE_KEEP_DATA},
3160 * {@link #DELETE_ALL_USERS}.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003161 *
3162 * @hide
3163 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -07003164 // @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003165 public abstract void deletePackage(
3166 String packageName, IPackageDeleteObserver observer, int flags);
Jacek Surazski65e13172009-04-28 15:26:38 +02003167
3168 /**
3169 * Retrieve the package name of the application that installed a package. This identifies
3170 * which market the package came from.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07003171 *
Jacek Surazski65e13172009-04-28 15:26:38 +02003172 * @param packageName The name of the package to query
3173 */
3174 public abstract String getInstallerPackageName(String packageName);
Amith Yamasani4b2e9342011-03-31 12:38:53 -07003175
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003176 /**
3177 * Attempts to clear the user data directory of an application.
3178 * Since this may take a little while, the result will
3179 * be posted back to the given observer. A deletion will fail if the
3180 * named package cannot be found, or if the named package is a "system package".
3181 *
3182 * @param packageName The name of the package
3183 * @param observer An observer callback to get notified when the operation is finished
3184 * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)}
3185 * will be called when that happens. observer may be null to indicate that
3186 * no callback is desired.
3187 *
3188 * @hide
3189 */
3190 public abstract void clearApplicationUserData(String packageName,
3191 IPackageDataObserver observer);
3192 /**
3193 * Attempts to delete the cache files associated with an application.
3194 * Since this may take a little while, the result will
3195 * be posted back to the given observer. A deletion will fail if the calling context
3196 * lacks the {@link android.Manifest.permission#DELETE_CACHE_FILES} permission, if the
3197 * named package cannot be found, or if the named package is a "system package".
3198 *
3199 * @param packageName The name of the package to delete
3200 * @param observer An observer callback to get notified when the cache file deletion
3201 * is complete.
3202 * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)}
3203 * will be called when that happens. observer may be null to indicate that
3204 * no callback is desired.
3205 *
3206 * @hide
3207 */
3208 public abstract void deleteApplicationCacheFiles(String packageName,
3209 IPackageDataObserver observer);
3210
3211 /**
3212 * Free storage by deleting LRU sorted list of cache files across
3213 * all applications. If the currently available free storage
3214 * on the device is greater than or equal to the requested
3215 * free storage, no cache files are cleared. If the currently
3216 * available storage on the device is less than the requested
3217 * free storage, some or all of the cache files across
3218 * all applications are deleted (based on last accessed time)
3219 * to increase the free storage space on the device to
3220 * the requested value. There is no guarantee that clearing all
3221 * the cache files from all applications will clear up
3222 * enough storage to achieve the desired value.
3223 * @param freeStorageSize The number of bytes of storage to be
3224 * freed by the system. Say if freeStorageSize is XX,
3225 * and the current free storage is YY,
3226 * if XX is less than YY, just return. if not free XX-YY number
3227 * of bytes if possible.
3228 * @param observer call back used to notify when
3229 * the operation is completed
Amith Yamasani4b2e9342011-03-31 12:38:53 -07003230 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003231 * @hide
3232 */
Jeff Brownd5a5b5a2014-06-05 17:14:39 -07003233 // @SystemApi
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003234 public abstract void freeStorageAndNotify(long freeStorageSize, IPackageDataObserver observer);
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -07003235
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003236 /**
3237 * Free storage by deleting LRU sorted list of cache files across
3238 * all applications. If the currently available free storage
3239 * on the device is greater than or equal to the requested
3240 * free storage, no cache files are cleared. If the currently
3241 * available storage on the device is less than the requested
3242 * free storage, some or all of the cache files across
3243 * all applications are deleted (based on last accessed time)
3244 * to increase the free storage space on the device to
3245 * the requested value. There is no guarantee that clearing all
3246 * the cache files from all applications will clear up
3247 * enough storage to achieve the desired value.
3248 * @param freeStorageSize The number of bytes of storage to be
3249 * freed by the system. Say if freeStorageSize is XX,
3250 * and the current free storage is YY,
3251 * if XX is less than YY, just return. if not free XX-YY number
3252 * of bytes if possible.
Suchi Amalapurapu1ccac752009-06-12 10:09:58 -07003253 * @param pi IntentSender call back used to
3254 * notify when the operation is completed.May be null
3255 * to indicate that no call back is desired.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07003256 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003257 * @hide
3258 */
Suchi Amalapurapubc806f62009-06-17 15:18:19 -07003259 public abstract void freeStorage(long freeStorageSize, IntentSender pi);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003260
3261 /**
3262 * Retrieve the size information for a package.
3263 * Since this may take a little while, the result will
3264 * be posted back to the given observer. The calling context
3265 * should have the {@link android.Manifest.permission#GET_PACKAGE_SIZE} permission.
3266 *
3267 * @param packageName The name of the package whose size information is to be retrieved
Dianne Hackborn0c380492012-08-20 17:23:30 -07003268 * @param userHandle The user whose size information should be retrieved.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003269 * @param observer An observer callback to get notified when the operation
3270 * is complete.
3271 * {@link android.content.pm.IPackageStatsObserver#onGetStatsCompleted(PackageStats, boolean)}
3272 * The observer's callback is invoked with a PackageStats object(containing the
3273 * code, data and cache sizes of the package) and a boolean value representing
3274 * the status of the operation. observer may be null to indicate that
3275 * no callback is desired.
3276 *
3277 * @hide
3278 */
Dianne Hackborn0c380492012-08-20 17:23:30 -07003279 public abstract void getPackageSizeInfo(String packageName, int userHandle,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003280 IPackageStatsObserver observer);
3281
3282 /**
Dianne Hackborn0c380492012-08-20 17:23:30 -07003283 * Like {@link #getPackageSizeInfo(String, int, IPackageStatsObserver)}, but
3284 * returns the size for the calling user.
3285 *
3286 * @hide
3287 */
3288 public void getPackageSizeInfo(String packageName, IPackageStatsObserver observer) {
3289 getPackageSizeInfo(packageName, UserHandle.myUserId(), observer);
3290 }
3291
3292 /**
Dianne Hackborna7ca0e52009-12-01 14:31:55 -08003293 * @deprecated This function no longer does anything; it was an old
kmccormickac66b852013-03-28 15:17:15 -07003294 * approach to managing preferred activities, which has been superseded
3295 * by (and conflicts with) the modern activity-based preferences.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003296 */
Dianne Hackborna7ca0e52009-12-01 14:31:55 -08003297 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003298 public abstract void addPackageToPreferred(String packageName);
3299
3300 /**
Dianne Hackborna7ca0e52009-12-01 14:31:55 -08003301 * @deprecated This function no longer does anything; it was an old
kmccormickac66b852013-03-28 15:17:15 -07003302 * approach to managing preferred activities, which has been superseded
3303 * by (and conflicts with) the modern activity-based preferences.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003304 */
Dianne Hackborna7ca0e52009-12-01 14:31:55 -08003305 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003306 public abstract void removePackageFromPreferred(String packageName);
3307
3308 /**
3309 * Retrieve the list of all currently configured preferred packages. The
3310 * first package on the list is the most preferred, the last is the
3311 * least preferred.
3312 *
3313 * @param flags Additional option flags. Use any combination of
3314 * {@link #GET_ACTIVITIES},
3315 * {@link #GET_GIDS},
3316 * {@link #GET_CONFIGURATIONS},
3317 * {@link #GET_INSTRUMENTATION},
3318 * {@link #GET_PERMISSIONS},
3319 * {@link #GET_PROVIDERS},
3320 * {@link #GET_RECEIVERS},
3321 * {@link #GET_SERVICES},
3322 * {@link #GET_SIGNATURES}, to modify the data returned.
3323 *
3324 * @return Returns a list of PackageInfo objects describing each
3325 * preferred application, in order of preference.
3326 *
3327 * @see #GET_ACTIVITIES
3328 * @see #GET_GIDS
3329 * @see #GET_CONFIGURATIONS
3330 * @see #GET_INSTRUMENTATION
3331 * @see #GET_PERMISSIONS
3332 * @see #GET_PROVIDERS
3333 * @see #GET_RECEIVERS
3334 * @see #GET_SERVICES
3335 * @see #GET_SIGNATURES
3336 */
3337 public abstract List<PackageInfo> getPreferredPackages(int flags);
3338
3339 /**
Dianne Hackborn2ee89ea2010-03-10 18:27:09 -08003340 * @deprecated This is a protected API that should not have been available
3341 * to third party applications. It is the platform's responsibility for
kmccormick30498b42013-03-27 17:39:17 -07003342 * assigning preferred activities and this cannot be directly modified.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07003343 *
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003344 * Add a new preferred activity mapping to the system. This will be used
3345 * to automatically select the given activity component when
3346 * {@link Context#startActivity(Intent) Context.startActivity()} finds
3347 * multiple matching activities and also matches the given filter.
3348 *
3349 * @param filter The set of intents under which this activity will be
3350 * made preferred.
3351 * @param match The IntentFilter match category that this preference
3352 * applies to.
3353 * @param set The set of activities that the user was picking from when
3354 * this preference was made.
3355 * @param activity The component name of the activity that is to be
3356 * preferred.
3357 */
Dianne Hackborn2ee89ea2010-03-10 18:27:09 -08003358 @Deprecated
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003359 public abstract void addPreferredActivity(IntentFilter filter, int match,
3360 ComponentName[] set, ComponentName activity);
3361
3362 /**
Amith Yamasania3f133a2012-08-09 17:11:28 -07003363 * Same as {@link #addPreferredActivity(IntentFilter, int,
3364 ComponentName[], ComponentName)}, but with a specific userId to apply the preference
3365 to.
3366 * @hide
3367 */
3368 public void addPreferredActivity(IntentFilter filter, int match,
3369 ComponentName[] set, ComponentName activity, int userId) {
3370 throw new RuntimeException("Not implemented. Must override in a subclass.");
3371 }
3372
3373 /**
Dianne Hackborn2ee89ea2010-03-10 18:27:09 -08003374 * @deprecated This is a protected API that should not have been available
3375 * to third party applications. It is the platform's responsibility for
kmccormick30498b42013-03-27 17:39:17 -07003376 * assigning preferred activities and this cannot be directly modified.
Amith Yamasani4b2e9342011-03-31 12:38:53 -07003377 *
Satish Sampath8dbe6122009-06-02 23:35:54 +01003378 * Replaces an existing preferred activity mapping to the system, and if that were not present
3379 * adds a new preferred activity. This will be used
3380 * to automatically select the given activity component when
3381 * {@link Context#startActivity(Intent) Context.startActivity()} finds
3382 * multiple matching activities and also matches the given filter.
3383 *
3384 * @param filter The set of intents under which this activity will be
3385 * made preferred.
3386 * @param match The IntentFilter match category that this preference
3387 * applies to.
3388 * @param set The set of activities that the user was picking from when
3389 * this preference was made.
3390 * @param activity The component name of the activity that is to be
3391 * preferred.
3392 * @hide
3393 */
Dianne Hackborn2ee89ea2010-03-10 18:27:09 -08003394 @Deprecated
Satish Sampath8dbe6122009-06-02 23:35:54 +01003395 public abstract void replacePreferredActivity(IntentFilter filter, int match,
3396 ComponentName[] set, ComponentName activity);
3397
3398 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003399 * Remove all preferred activity mappings, previously added with
3400 * {@link #addPreferredActivity}, from the
3401 * system whose activities are implemented in the given package name.
Dianne Hackborn2ee89ea2010-03-10 18:27:09 -08003402 * An application can only clear its own package(s).
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003403 *
3404 * @param packageName The name of the package whose preferred activity
3405 * mappings are to be removed.
3406 */
3407 public abstract void clearPackagePreferredActivities(String packageName);
3408
3409 /**
3410 * Retrieve all preferred activities, previously added with
3411 * {@link #addPreferredActivity}, that are
3412 * currently registered with the system.
3413 *
3414 * @param outFilters A list in which to place the filters of all of the
3415 * preferred activities, or null for none.
3416 * @param outActivities A list in which to place the component names of
3417 * all of the preferred activities, or null for none.
3418 * @param packageName An option package in which you would like to limit
3419 * the list. If null, all activities will be returned; if non-null, only
3420 * those activities in the given package are returned.
3421 *
3422 * @return Returns the total number of registered preferred activities
3423 * (the number of distinct IntentFilter records, not the number of unique
3424 * activity components) that were found.
3425 */
3426 public abstract int getPreferredActivities(List<IntentFilter> outFilters,
3427 List<ComponentName> outActivities, String packageName);
3428
3429 /**
Christopher Tatea2a0850d2013-09-05 16:38:58 -07003430 * Ask for the set of available 'home' activities and the current explicit
3431 * default, if any.
3432 * @hide
3433 */
3434 public abstract ComponentName getHomeActivities(List<ResolveInfo> outActivities);
3435
3436 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003437 * Set the enabled setting for a package component (activity, receiver, service, provider).
3438 * This setting will override any enabled state which may have been set by the component in its
3439 * manifest.
3440 *
3441 * @param componentName The component to enable
3442 * @param newState The new enabled state for the component. The legal values for this state
3443 * are:
3444 * {@link #COMPONENT_ENABLED_STATE_ENABLED},
3445 * {@link #COMPONENT_ENABLED_STATE_DISABLED}
3446 * and
3447 * {@link #COMPONENT_ENABLED_STATE_DEFAULT}
3448 * The last one removes the setting, thereby restoring the component's state to
3449 * whatever was set in it's manifest (or enabled, by default).
3450 * @param flags Optional behavior flags: {@link #DONT_KILL_APP} or 0.
3451 */
3452 public abstract void setComponentEnabledSetting(ComponentName componentName,
3453 int newState, int flags);
3454
3455
3456 /**
Amaury Medeirosdde24262014-06-03 20:06:41 -03003457 * Return the enabled setting for a package component (activity,
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003458 * receiver, service, provider). This returns the last value set by
3459 * {@link #setComponentEnabledSetting(ComponentName, int, int)}; in most
3460 * cases this value will be {@link #COMPONENT_ENABLED_STATE_DEFAULT} since
3461 * the value originally specified in the manifest has not been modified.
3462 *
3463 * @param componentName The component to retrieve.
3464 * @return Returns the current enabled state for the component. May
3465 * be one of {@link #COMPONENT_ENABLED_STATE_ENABLED},
3466 * {@link #COMPONENT_ENABLED_STATE_DISABLED}, or
3467 * {@link #COMPONENT_ENABLED_STATE_DEFAULT}. The last one means the
3468 * component's enabled state is based on the original information in
3469 * the manifest as found in {@link ComponentInfo}.
3470 */
3471 public abstract int getComponentEnabledSetting(ComponentName componentName);
3472
3473 /**
3474 * Set the enabled setting for an application
3475 * This setting will override any enabled state which may have been set by the application in
3476 * its manifest. It also overrides the enabled state set in the manifest for any of the
3477 * application's components. It does not override any enabled state set by
3478 * {@link #setComponentEnabledSetting} for any of the application's components.
3479 *
3480 * @param packageName The package name of the application to enable
3481 * @param newState The new enabled state for the component. The legal values for this state
3482 * are:
3483 * {@link #COMPONENT_ENABLED_STATE_ENABLED},
3484 * {@link #COMPONENT_ENABLED_STATE_DISABLED}
3485 * and
3486 * {@link #COMPONENT_ENABLED_STATE_DEFAULT}
3487 * The last one removes the setting, thereby restoring the applications's state to
3488 * whatever was set in its manifest (or enabled, by default).
3489 * @param flags Optional behavior flags: {@link #DONT_KILL_APP} or 0.
3490 */
3491 public abstract void setApplicationEnabledSetting(String packageName,
3492 int newState, int flags);
Amith Yamasani4b2e9342011-03-31 12:38:53 -07003493
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003494 /**
Amaury Medeirosdde24262014-06-03 20:06:41 -03003495 * Return the enabled setting for an application. This returns
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003496 * the last value set by
3497 * {@link #setApplicationEnabledSetting(String, int, int)}; in most
3498 * cases this value will be {@link #COMPONENT_ENABLED_STATE_DEFAULT} since
3499 * the value originally specified in the manifest has not been modified.
3500 *
Amaury Medeirosdde24262014-06-03 20:06:41 -03003501 * @param packageName The package name of the application to retrieve.
3502 * @return Returns the current enabled state for the application. May
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003503 * be one of {@link #COMPONENT_ENABLED_STATE_ENABLED},
3504 * {@link #COMPONENT_ENABLED_STATE_DISABLED}, or
3505 * {@link #COMPONENT_ENABLED_STATE_DEFAULT}. The last one means the
3506 * application's enabled state is based on the original information in
3507 * the manifest as found in {@link ComponentInfo}.
Mathew Inwood1b9f8d92011-09-26 13:23:56 +01003508 * @throws IllegalArgumentException if the named package does not exist.
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003509 */
3510 public abstract int getApplicationEnabledSetting(String packageName);
3511
3512 /**
Amith Yamasani655d0e22013-06-12 14:19:10 -07003513 * Puts the package in a blocked state, which is almost like an uninstalled state,
3514 * making the package unavailable, but it doesn't remove the data or the actual
3515 * package file.
3516 * @hide
3517 */
3518 public abstract boolean setApplicationBlockedSettingAsUser(String packageName, boolean blocked,
3519 UserHandle userHandle);
3520
3521 /**
3522 * Returns the blocked state of a package.
3523 * @see #setApplicationBlockedSettingAsUser(String, boolean, UserHandle)
3524 * @hide
3525 */
3526 public abstract boolean getApplicationBlockedSettingAsUser(String packageName,
3527 UserHandle userHandle);
3528
3529 /**
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003530 * Return whether the device has been booted into safe mode.
3531 */
3532 public abstract boolean isSafeMode();
Suchi Amalapurapu8946dd32010-02-19 09:19:34 -08003533
3534 /**
3535 * Attempts to move package resources from internal to external media or vice versa.
3536 * Since this may take a little while, the result will
3537 * be posted back to the given observer. This call may fail if the calling context
3538 * lacks the {@link android.Manifest.permission#MOVE_PACKAGE} permission, if the
3539 * named package cannot be found, or if the named package is a "system package".
3540 *
3541 * @param packageName The name of the package to delete
3542 * @param observer An observer callback to get notified when the package move is
3543 * complete. {@link android.content.pm.IPackageMoveObserver#packageMoved(boolean)} will be
3544 * called when that happens. observer may be null to indicate that no callback is desired.
3545 * @param flags To indicate install location {@link #MOVE_INTERNAL} or
3546 * {@link #MOVE_EXTERNAL_MEDIA}
3547 *
3548 * @hide
3549 */
3550 public abstract void movePackage(
3551 String packageName, IPackageMoveObserver observer, int flags);
Amith Yamasani4b2e9342011-03-31 12:38:53 -07003552
3553 /**
Amith Yamasani13593602012-03-22 16:16:17 -07003554 * Returns the device identity that verifiers can use to associate their scheme to a particular
3555 * device. This should not be used by anything other than a package verifier.
Aravind Akella068b0c02013-10-12 17:39:15 -07003556 *
Kenny Root0aaa0d92011-09-12 16:42:55 -07003557 * @return identity that uniquely identifies current device
3558 * @hide
3559 */
3560 public abstract VerifierDeviceIdentity getVerifierDeviceIdentity();
Amith Yamasani742a6712011-05-04 14:49:28 -07003561
Jeff Sharkey3a44f3f2014-04-28 17:36:31 -07003562 /** {@hide} */
3563 public abstract PackageInstaller getPackageInstaller();
3564
Amith Yamasani742a6712011-05-04 14:49:28 -07003565 /**
3566 * Returns the data directory for a particular user and package, given the uid of the package.
3567 * @param uid uid of the package, including the userId and appId
3568 * @param packageName name of the package
3569 * @return the user-specific data directory for the package
3570 * @hide
3571 */
3572 public static String getDataDirForUser(int userId, String packageName) {
3573 // TODO: This should be shared with Installer's knowledge of user directory
3574 return Environment.getDataDirectory().toString() + "/user/" + userId
3575 + "/" + packageName;
3576 }
Nicolas Prevotc79586e2014-05-06 12:47:57 +01003577
3578 /**
Nicolas Prevot81948992014-05-16 18:25:26 +01003579 * Adds a {@link CrossProfileIntentFilter}. After calling this method all intents sent from the
3580 * user with id sourceUserId can also be be resolved by activities in the user with id
3581 * targetUserId if they match the specified intent filter.
3582 * @param filter the {@link IntentFilter} the intent has to match
3583 * @param removable if set to false, {@link clearCrossProfileIntentFilters} will not remove this
3584 * {@link CrossProfileIntentFilter}
Nicolas Prevotc79586e2014-05-06 12:47:57 +01003585 * @hide
3586 */
Nicolas Prevot81948992014-05-16 18:25:26 +01003587 public abstract void addCrossProfileIntentFilter(IntentFilter filter, boolean removable,
3588 int sourceUserId, int targetUserId);
Nicolas Prevotc79586e2014-05-06 12:47:57 +01003589
3590 /**
Nicolas Prevot81948992014-05-16 18:25:26 +01003591 * @hide
3592 * @deprecated
3593 * TODO: remove it as soon as the code of ManagedProvisionning is updated
3594 */
3595 public abstract void addForwardingIntentFilter(IntentFilter filter, boolean removable,
3596 int sourceUserId, int targetUserId);
3597
3598 /**
3599 * Clearing removable {@link CrossProfileIntentFilter}s which have the specified user as their
3600 * source
3601 * @param sourceUserId
3602 * be cleared.
Nicolas Prevotc79586e2014-05-06 12:47:57 +01003603 * @hide
3604 */
Nicolas Prevot81948992014-05-16 18:25:26 +01003605 public abstract void clearCrossProfileIntentFilters(int sourceUserId);
3606
3607 /**
3608 * @hide
3609 * @deprecated
3610 * TODO: remove it as soon as the code of ManagedProvisionning is updated
3611 */
3612 public abstract void clearForwardingIntentFilters(int sourceUserId);
The Android Open Source Project9066cfe2009-03-03 19:31:44 -08003613}