The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1 | /* |
| 2 | * Copyright (C) 2006 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | package android.content.pm; |
| 18 | |
Svetoslav | f7c06eb | 2015-06-10 18:43:22 -0700 | [diff] [blame] | 19 | import android.Manifest; |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 20 | import android.annotation.CheckResult; |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 21 | import android.annotation.DrawableRes; |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 22 | import android.annotation.IntDef; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 23 | import android.annotation.NonNull; |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 24 | import android.annotation.Nullable; |
Svetoslav | f7c06eb | 2015-06-10 18:43:22 -0700 | [diff] [blame] | 25 | import android.annotation.RequiresPermission; |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 26 | import android.annotation.SdkConstant; |
| 27 | import android.annotation.SdkConstant.SdkConstantType; |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 28 | import android.annotation.StringRes; |
Jeff Sharkey | bb58067 | 2014-07-10 12:10:25 -0700 | [diff] [blame] | 29 | import android.annotation.SystemApi; |
Jeff Sharkey | a73b8fd | 2016-01-06 17:02:08 -0700 | [diff] [blame] | 30 | import android.annotation.TestApi; |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 31 | import android.annotation.UserIdInt; |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 32 | import android.annotation.XmlRes; |
Jeff Sharkey | 6c0b9da | 2014-08-07 22:07:11 -0700 | [diff] [blame] | 33 | import android.app.PackageDeleteObserver; |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 34 | import android.app.PackageInstallObserver; |
Amith Yamasani | 1d65327 | 2014-09-11 17:56:05 -0700 | [diff] [blame] | 35 | import android.app.admin.DevicePolicyManager; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 36 | import android.content.ComponentName; |
| 37 | import android.content.Context; |
| 38 | import android.content.Intent; |
| 39 | import android.content.IntentFilter; |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 40 | import android.content.IntentSender; |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 41 | import android.content.pm.PackageParser.PackageParserException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 42 | import android.content.res.Resources; |
| 43 | import android.content.res.XmlResourceParser; |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 44 | import android.graphics.Rect; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 45 | import android.graphics.drawable.Drawable; |
| 46 | import android.net.Uri; |
Jeff Sharkey | bb58067 | 2014-07-10 12:10:25 -0700 | [diff] [blame] | 47 | import android.os.Bundle; |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 48 | import android.os.Handler; |
Jeff Sharkey | 6c0b9da | 2014-08-07 22:07:11 -0700 | [diff] [blame] | 49 | import android.os.RemoteException; |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 50 | import android.os.UserHandle; |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 51 | import android.os.UserManager; |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 52 | import android.os.storage.VolumeInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 53 | import android.util.AndroidException; |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 54 | import android.util.Log; |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 55 | |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 56 | import com.android.internal.util.ArrayUtils; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 57 | |
| 58 | import java.io.File; |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 59 | import java.lang.annotation.Retention; |
| 60 | import java.lang.annotation.RetentionPolicy; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 61 | import java.util.List; |
| 62 | |
| 63 | /** |
| 64 | * Class for retrieving various kinds of information related to the application |
| 65 | * packages that are currently installed on the device. |
| 66 | * |
| 67 | * You can find this class through {@link Context#getPackageManager}. |
| 68 | */ |
| 69 | public abstract class PackageManager { |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 70 | private static final String TAG = "PackageManager"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 71 | |
Jeff Sharkey | e469713 | 2016-02-06 19:46:15 -0700 | [diff] [blame] | 72 | /** {@hide} */ |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 73 | public static final boolean APPLY_DEFAULT_TO_DEVICE_PROTECTED_STORAGE = true; |
Jeff Sharkey | e469713 | 2016-02-06 19:46:15 -0700 | [diff] [blame] | 74 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 75 | /** |
| 76 | * This exception is thrown when a given package, application, or component |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 77 | * name cannot be found. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 78 | */ |
| 79 | public static class NameNotFoundException extends AndroidException { |
| 80 | public NameNotFoundException() { |
| 81 | } |
| 82 | |
| 83 | public NameNotFoundException(String name) { |
| 84 | super(name); |
| 85 | } |
| 86 | } |
| 87 | |
| 88 | /** |
Svetoslav | f7c06eb | 2015-06-10 18:43:22 -0700 | [diff] [blame] | 89 | * Listener for changes in permissions granted to a UID. |
| 90 | * |
| 91 | * @hide |
| 92 | */ |
| 93 | @SystemApi |
| 94 | public interface OnPermissionsChangedListener { |
| 95 | |
| 96 | /** |
| 97 | * Called when the permissions for a UID change. |
| 98 | * @param uid The UID with a change. |
| 99 | */ |
| 100 | public void onPermissionsChanged(int uid); |
| 101 | } |
| 102 | |
| 103 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 104 | * As a guiding principle: |
| 105 | * <p> |
| 106 | * {@code GET_} flags are used to request additional data that may have been |
| 107 | * elided to save wire space. |
| 108 | * <p> |
| 109 | * {@code MATCH_} flags are used to include components or packages that |
| 110 | * would have otherwise been omitted from a result set by current system |
| 111 | * state. |
| 112 | */ |
| 113 | |
| 114 | /** @hide */ |
| 115 | @IntDef(flag = true, value = { |
| 116 | GET_ACTIVITIES, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 117 | GET_CONFIGURATIONS, |
| 118 | GET_GIDS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 119 | GET_INSTRUMENTATION, |
| 120 | GET_INTENT_FILTERS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 121 | GET_META_DATA, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 122 | GET_PERMISSIONS, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 123 | GET_PROVIDERS, |
| 124 | GET_RECEIVERS, |
| 125 | GET_SERVICES, |
| 126 | GET_SHARED_LIBRARY_FILES, |
| 127 | GET_SIGNATURES, |
| 128 | GET_URI_PERMISSION_PATTERNS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 129 | MATCH_UNINSTALLED_PACKAGES, |
| 130 | MATCH_DISABLED_COMPONENTS, |
| 131 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
Jeff Sharkey | c5967e9 | 2016-01-07 18:50:29 -0700 | [diff] [blame] | 132 | MATCH_SYSTEM_ONLY, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 133 | MATCH_DEBUG_TRIAGED_MISSING, |
| 134 | }) |
| 135 | @Retention(RetentionPolicy.SOURCE) |
| 136 | public @interface PackageInfoFlags {} |
| 137 | |
| 138 | /** @hide */ |
| 139 | @IntDef(flag = true, value = { |
| 140 | GET_META_DATA, |
| 141 | GET_SHARED_LIBRARY_FILES, |
| 142 | MATCH_UNINSTALLED_PACKAGES, |
| 143 | MATCH_SYSTEM_ONLY, |
| 144 | MATCH_DEBUG_TRIAGED_MISSING, |
| 145 | }) |
| 146 | @Retention(RetentionPolicy.SOURCE) |
| 147 | public @interface ApplicationInfoFlags {} |
| 148 | |
| 149 | /** @hide */ |
| 150 | @IntDef(flag = true, value = { |
| 151 | GET_META_DATA, |
| 152 | GET_SHARED_LIBRARY_FILES, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 153 | MATCH_ALL, |
| 154 | MATCH_DEBUG_TRIAGED_MISSING, |
| 155 | MATCH_DEFAULT_ONLY, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 156 | MATCH_DISABLED_COMPONENTS, |
| 157 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 158 | MATCH_DIRECT_BOOT_AWARE, |
| 159 | MATCH_DIRECT_BOOT_UNAWARE, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 160 | MATCH_SYSTEM_ONLY, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 161 | MATCH_UNINSTALLED_PACKAGES, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 162 | }) |
| 163 | @Retention(RetentionPolicy.SOURCE) |
| 164 | public @interface ComponentInfoFlags {} |
| 165 | |
| 166 | /** @hide */ |
| 167 | @IntDef(flag = true, value = { |
| 168 | GET_META_DATA, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 169 | GET_RESOLVED_FILTER, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 170 | GET_SHARED_LIBRARY_FILES, |
| 171 | MATCH_ALL, |
| 172 | MATCH_DEBUG_TRIAGED_MISSING, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 173 | MATCH_DISABLED_COMPONENTS, |
| 174 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 175 | MATCH_DEFAULT_ONLY, |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 176 | MATCH_DIRECT_BOOT_AWARE, |
| 177 | MATCH_DIRECT_BOOT_UNAWARE, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 178 | MATCH_SYSTEM_ONLY, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 179 | MATCH_UNINSTALLED_PACKAGES, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 180 | }) |
| 181 | @Retention(RetentionPolicy.SOURCE) |
| 182 | public @interface ResolveInfoFlags {} |
| 183 | |
| 184 | /** @hide */ |
| 185 | @IntDef(flag = true, value = { |
| 186 | GET_META_DATA, |
| 187 | }) |
| 188 | @Retention(RetentionPolicy.SOURCE) |
| 189 | public @interface PermissionInfoFlags {} |
| 190 | |
| 191 | /** @hide */ |
| 192 | @IntDef(flag = true, value = { |
| 193 | GET_META_DATA, |
| 194 | }) |
| 195 | @Retention(RetentionPolicy.SOURCE) |
| 196 | public @interface PermissionGroupInfoFlags {} |
| 197 | |
| 198 | /** @hide */ |
| 199 | @IntDef(flag = true, value = { |
| 200 | GET_META_DATA, |
| 201 | }) |
| 202 | @Retention(RetentionPolicy.SOURCE) |
| 203 | public @interface InstrumentationInfoFlags {} |
| 204 | |
| 205 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 206 | * {@link PackageInfo} flag: return information about |
| 207 | * activities in the package in {@link PackageInfo#activities}. |
| 208 | */ |
| 209 | public static final int GET_ACTIVITIES = 0x00000001; |
| 210 | |
| 211 | /** |
| 212 | * {@link PackageInfo} flag: return information about |
| 213 | * intent receivers in the package in |
| 214 | * {@link PackageInfo#receivers}. |
| 215 | */ |
| 216 | public static final int GET_RECEIVERS = 0x00000002; |
| 217 | |
| 218 | /** |
| 219 | * {@link PackageInfo} flag: return information about |
| 220 | * services in the package in {@link PackageInfo#services}. |
| 221 | */ |
| 222 | public static final int GET_SERVICES = 0x00000004; |
| 223 | |
| 224 | /** |
| 225 | * {@link PackageInfo} flag: return information about |
| 226 | * content providers in the package in |
| 227 | * {@link PackageInfo#providers}. |
| 228 | */ |
| 229 | public static final int GET_PROVIDERS = 0x00000008; |
| 230 | |
| 231 | /** |
| 232 | * {@link PackageInfo} flag: return information about |
| 233 | * instrumentation in the package in |
| 234 | * {@link PackageInfo#instrumentation}. |
| 235 | */ |
| 236 | public static final int GET_INSTRUMENTATION = 0x00000010; |
| 237 | |
| 238 | /** |
| 239 | * {@link PackageInfo} flag: return information about the |
| 240 | * intent filters supported by the activity. |
| 241 | */ |
| 242 | public static final int GET_INTENT_FILTERS = 0x00000020; |
| 243 | |
| 244 | /** |
| 245 | * {@link PackageInfo} flag: return information about the |
| 246 | * signatures included in the package. |
| 247 | */ |
| 248 | public static final int GET_SIGNATURES = 0x00000040; |
| 249 | |
| 250 | /** |
| 251 | * {@link ResolveInfo} flag: return the IntentFilter that |
| 252 | * was matched for a particular ResolveInfo in |
| 253 | * {@link ResolveInfo#filter}. |
| 254 | */ |
| 255 | public static final int GET_RESOLVED_FILTER = 0x00000040; |
| 256 | |
| 257 | /** |
| 258 | * {@link ComponentInfo} flag: return the {@link ComponentInfo#metaData} |
| 259 | * data {@link android.os.Bundle}s that are associated with a component. |
| 260 | * This applies for any API returning a ComponentInfo subclass. |
| 261 | */ |
| 262 | public static final int GET_META_DATA = 0x00000080; |
| 263 | |
| 264 | /** |
| 265 | * {@link PackageInfo} flag: return the |
| 266 | * {@link PackageInfo#gids group ids} that are associated with an |
| 267 | * application. |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 268 | * This applies for any API returning a PackageInfo class, either |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 269 | * directly or nested inside of another. |
| 270 | */ |
| 271 | public static final int GET_GIDS = 0x00000100; |
| 272 | |
| 273 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 274 | * @deprecated replaced with {@link #MATCH_DISABLED_COMPONENTS} |
| 275 | */ |
| 276 | @Deprecated |
| 277 | public static final int GET_DISABLED_COMPONENTS = 0x00000200; |
| 278 | |
| 279 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 280 | * {@link PackageInfo} flag: include disabled components in the returned info. |
| 281 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 282 | public static final int MATCH_DISABLED_COMPONENTS = 0x00000200; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 283 | |
| 284 | /** |
| 285 | * {@link ApplicationInfo} flag: return the |
| 286 | * {@link ApplicationInfo#sharedLibraryFiles paths to the shared libraries} |
| 287 | * that are associated with an application. |
| 288 | * This applies for any API returning an ApplicationInfo class, either |
| 289 | * directly or nested inside of another. |
| 290 | */ |
| 291 | public static final int GET_SHARED_LIBRARY_FILES = 0x00000400; |
| 292 | |
| 293 | /** |
| 294 | * {@link ProviderInfo} flag: return the |
| 295 | * {@link ProviderInfo#uriPermissionPatterns URI permission patterns} |
| 296 | * that are associated with a content provider. |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 297 | * This applies for any API returning a ProviderInfo class, either |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 298 | * directly or nested inside of another. |
| 299 | */ |
| 300 | public static final int GET_URI_PERMISSION_PATTERNS = 0x00000800; |
| 301 | /** |
| 302 | * {@link PackageInfo} flag: return information about |
| 303 | * permissions in the package in |
| 304 | * {@link PackageInfo#permissions}. |
| 305 | */ |
| 306 | public static final int GET_PERMISSIONS = 0x00001000; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 307 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 308 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 309 | * @deprecated replaced with {@link #MATCH_UNINSTALLED_PACKAGES} |
| 310 | */ |
| 311 | @Deprecated |
| 312 | public static final int GET_UNINSTALLED_PACKAGES = 0x00002000; |
| 313 | |
| 314 | /** |
Kenny Root | 685f490 | 2011-11-03 10:13:29 -0700 | [diff] [blame] | 315 | * Flag parameter to retrieve some information about all applications (even |
| 316 | * uninstalled ones) which have data directories. This state could have |
| 317 | * resulted if applications have been deleted with flag |
| 318 | * {@code DONT_DELETE_DATA} with a possibility of being replaced or |
| 319 | * reinstalled in future. |
| 320 | * <p> |
| 321 | * Note: this flag may cause less information about currently installed |
| 322 | * applications to be returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 323 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 324 | public static final int MATCH_UNINSTALLED_PACKAGES = 0x00002000; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 325 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 326 | /** |
| 327 | * {@link PackageInfo} flag: return information about |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 328 | * hardware preferences in |
Adam Lesinski | d3edfde | 2014-08-08 17:32:44 -0700 | [diff] [blame] | 329 | * {@link PackageInfo#configPreferences PackageInfo.configPreferences}, |
| 330 | * and requested features in {@link PackageInfo#reqFeatures} and |
| 331 | * {@link PackageInfo#featureGroups}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 332 | */ |
| 333 | public static final int GET_CONFIGURATIONS = 0x00004000; |
| 334 | |
| 335 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 336 | * @deprecated replaced with {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}. |
| 337 | */ |
| 338 | @Deprecated |
| 339 | public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 0x00008000; |
| 340 | |
| 341 | /** |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 342 | * {@link PackageInfo} flag: include disabled components which are in |
| 343 | * that state only because of {@link #COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED} |
| 344 | * in the returned info. Note that if you set this flag, applications |
| 345 | * that are in this disabled state will be reported as enabled. |
| 346 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 347 | public static final int MATCH_DISABLED_UNTIL_USED_COMPONENTS = 0x00008000; |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 348 | |
| 349 | /** |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 350 | * Resolution and querying flag: if set, only filters that support the |
| 351 | * {@link android.content.Intent#CATEGORY_DEFAULT} will be considered for |
| 352 | * matching. This is a synonym for including the CATEGORY_DEFAULT in your |
| 353 | * supplied Intent. |
| 354 | */ |
Fabrice Di Meglio | 9f7e39f | 2015-04-10 20:40:16 -0700 | [diff] [blame] | 355 | public static final int MATCH_DEFAULT_ONLY = 0x00010000; |
| 356 | |
| 357 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 358 | * Querying flag: if set and if the platform is doing any filtering of the |
| 359 | * results, then the filtering will not happen. This is a synonym for saying |
| 360 | * that all results should be returned. |
| 361 | * <p> |
| 362 | * <em>This flag should be used with extreme care.</em> |
Fabrice Di Meglio | 9f7e39f | 2015-04-10 20:40:16 -0700 | [diff] [blame] | 363 | */ |
| 364 | public static final int MATCH_ALL = 0x00020000; |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 365 | |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 366 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 367 | * Querying flag: match components which are direct boot <em>unaware</em> in |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 368 | * the returned info, regardless of the current user state. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 369 | * <p> |
| 370 | * When neither {@link #MATCH_DIRECT_BOOT_AWARE} nor |
| 371 | * {@link #MATCH_DIRECT_BOOT_UNAWARE} are specified, the default behavior is |
| 372 | * to match only runnable components based on the user state. For example, |
| 373 | * when a user is started but credentials have not been presented yet, the |
| 374 | * user is running "locked" and only {@link #MATCH_DIRECT_BOOT_AWARE} |
| 375 | * components are returned. Once the user credentials have been presented, |
| 376 | * the user is running "unlocked" and both {@link #MATCH_DIRECT_BOOT_AWARE} |
| 377 | * and {@link #MATCH_DIRECT_BOOT_UNAWARE} components are returned. |
| 378 | * |
| 379 | * @see UserManager#isUserUnlocked() |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 380 | */ |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 381 | public static final int MATCH_DIRECT_BOOT_UNAWARE = 0x00040000; |
| 382 | |
| 383 | /** |
| 384 | * Querying flag: match components which are direct boot <em>aware</em> in |
| 385 | * the returned info, regardless of the current user state. |
| 386 | * <p> |
| 387 | * When neither {@link #MATCH_DIRECT_BOOT_AWARE} nor |
| 388 | * {@link #MATCH_DIRECT_BOOT_UNAWARE} are specified, the default behavior is |
| 389 | * to match only runnable components based on the user state. For example, |
| 390 | * when a user is started but credentials have not been presented yet, the |
| 391 | * user is running "locked" and only {@link #MATCH_DIRECT_BOOT_AWARE} |
| 392 | * components are returned. Once the user credentials have been presented, |
| 393 | * the user is running "unlocked" and both {@link #MATCH_DIRECT_BOOT_AWARE} |
| 394 | * and {@link #MATCH_DIRECT_BOOT_UNAWARE} components are returned. |
| 395 | * |
| 396 | * @see UserManager#isUserUnlocked() |
| 397 | */ |
| 398 | public static final int MATCH_DIRECT_BOOT_AWARE = 0x00080000; |
| 399 | |
| 400 | /** @removed */ |
| 401 | @Deprecated |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 402 | public static final int MATCH_ENCRYPTION_UNAWARE = 0x00040000; |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 403 | /** @removed */ |
| 404 | @Deprecated |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 405 | public static final int MATCH_ENCRYPTION_AWARE = 0x00080000; |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 406 | /** @removed */ |
| 407 | @Deprecated |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 408 | public static final int MATCH_ENCRYPTION_AWARE_AND_UNAWARE = MATCH_ENCRYPTION_AWARE |
| 409 | | MATCH_ENCRYPTION_UNAWARE; |
Jeff Sharkey | 2a9e3f8 | 2015-12-18 10:57:58 -0700 | [diff] [blame] | 410 | |
| 411 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 412 | * Querying flag: include only components from applications that are marked |
| 413 | * with {@link ApplicationInfo#FLAG_SYSTEM}. |
Jeff Sharkey | 5217cac | 2015-12-20 15:34:01 -0700 | [diff] [blame] | 414 | */ |
| 415 | public static final int MATCH_SYSTEM_ONLY = 0x00100000; |
| 416 | |
| 417 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 418 | * Internal flag used to indicate that a system component has done their |
| 419 | * homework and verified that they correctly handle packages and components |
| 420 | * that come and go over time. In particular: |
| 421 | * <ul> |
| 422 | * <li>Apps installed on external storage, which will appear to be |
| 423 | * uninstalled while the the device is ejected. |
| 424 | * <li>Apps with encryption unaware components, which will appear to not |
| 425 | * exist while the device is locked. |
| 426 | * </ul> |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 427 | * |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 428 | * @see #MATCH_UNINSTALLED_PACKAGES |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 429 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 430 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 431 | * @hide |
| 432 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 433 | public static final int MATCH_DEBUG_TRIAGED_MISSING = 0x10000000; |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 434 | |
| 435 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 436 | * Flag for {@link #addCrossProfileIntentFilter}: if this flag is set: when |
| 437 | * resolving an intent that matches the {@code CrossProfileIntentFilter}, |
| 438 | * the current profile will be skipped. Only activities in the target user |
| 439 | * can respond to the intent. |
| 440 | * |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 441 | * @hide |
| 442 | */ |
| 443 | public static final int SKIP_CURRENT_PROFILE = 0x00000002; |
| 444 | |
Tony Mak | 807e01c | 2015-12-01 20:19:03 +0000 | [diff] [blame] | 445 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 446 | * Flag for {@link #addCrossProfileIntentFilter}: if this flag is set: |
Tony Mak | 807e01c | 2015-12-01 20:19:03 +0000 | [diff] [blame] | 447 | * activities in the other profiles can respond to the intent only if no activity with |
| 448 | * non-negative priority in current profile can respond to the intent. |
| 449 | * @hide |
| 450 | */ |
| 451 | public static final int ONLY_IF_NO_MATCH_FOUND = 0x00000004; |
| 452 | |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 453 | /** @hide */ |
| 454 | @IntDef({PERMISSION_GRANTED, PERMISSION_DENIED}) |
| 455 | @Retention(RetentionPolicy.SOURCE) |
| 456 | public @interface PermissionResult {} |
| 457 | |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 458 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 459 | * Permission check result: this is returned by {@link #checkPermission} |
| 460 | * if the permission has been granted to the given package. |
| 461 | */ |
| 462 | public static final int PERMISSION_GRANTED = 0; |
| 463 | |
| 464 | /** |
| 465 | * Permission check result: this is returned by {@link #checkPermission} |
| 466 | * if the permission has not been granted to the given package. |
| 467 | */ |
| 468 | public static final int PERMISSION_DENIED = -1; |
| 469 | |
| 470 | /** |
| 471 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 472 | * if all signatures on the two packages match. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 473 | */ |
| 474 | public static final int SIGNATURE_MATCH = 0; |
| 475 | |
| 476 | /** |
| 477 | * Signature check result: this is returned by {@link #checkSignatures} |
| 478 | * if neither of the two packages is signed. |
| 479 | */ |
| 480 | public static final int SIGNATURE_NEITHER_SIGNED = 1; |
| 481 | |
| 482 | /** |
| 483 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 484 | * if the first package is not signed but the second is. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 485 | */ |
| 486 | public static final int SIGNATURE_FIRST_NOT_SIGNED = -1; |
| 487 | |
| 488 | /** |
| 489 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 490 | * if the second package is not signed but the first is. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 491 | */ |
| 492 | public static final int SIGNATURE_SECOND_NOT_SIGNED = -2; |
| 493 | |
| 494 | /** |
| 495 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 496 | * if not all signatures on both packages match. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 497 | */ |
| 498 | public static final int SIGNATURE_NO_MATCH = -3; |
| 499 | |
| 500 | /** |
| 501 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 502 | * if either of the packages are not valid. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 503 | */ |
| 504 | public static final int SIGNATURE_UNKNOWN_PACKAGE = -4; |
| 505 | |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 506 | /** |
| 507 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} |
| 508 | * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 509 | * component or application is in its default enabled state (as specified |
| 510 | * in its manifest). |
| 511 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 512 | public static final int COMPONENT_ENABLED_STATE_DEFAULT = 0; |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 513 | |
| 514 | /** |
| 515 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} |
| 516 | * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 517 | * component or application has been explictily enabled, regardless of |
| 518 | * what it has specified in its manifest. |
| 519 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 520 | public static final int COMPONENT_ENABLED_STATE_ENABLED = 1; |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 521 | |
| 522 | /** |
| 523 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} |
| 524 | * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 525 | * component or application has been explicitly disabled, regardless of |
| 526 | * what it has specified in its manifest. |
| 527 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 528 | public static final int COMPONENT_ENABLED_STATE_DISABLED = 2; |
| 529 | |
| 530 | /** |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 531 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} only: The |
| 532 | * user has explicitly disabled the application, regardless of what it has |
| 533 | * specified in its manifest. Because this is due to the user's request, |
| 534 | * they may re-enable it if desired through the appropriate system UI. This |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 535 | * option currently <strong>cannot</strong> be used with |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 536 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}. |
| 537 | */ |
| 538 | public static final int COMPONENT_ENABLED_STATE_DISABLED_USER = 3; |
| 539 | |
| 540 | /** |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 541 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} only: This |
| 542 | * application should be considered, until the point where the user actually |
| 543 | * wants to use it. This means that it will not normally show up to the user |
| 544 | * (such as in the launcher), but various parts of the user interface can |
| 545 | * use {@link #GET_DISABLED_UNTIL_USED_COMPONENTS} to still see it and allow |
| 546 | * the user to select it (as for example an IME, device admin, etc). Such code, |
| 547 | * once the user has selected the app, should at that point also make it enabled. |
| 548 | * This option currently <strong>can not</strong> be used with |
| 549 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}. |
| 550 | */ |
| 551 | public static final int COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED = 4; |
| 552 | |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 553 | /** @hide */ |
| 554 | @IntDef(flag = true, value = { |
| 555 | INSTALL_FORWARD_LOCK, |
| 556 | INSTALL_REPLACE_EXISTING, |
| 557 | INSTALL_ALLOW_TEST, |
| 558 | INSTALL_EXTERNAL, |
| 559 | INSTALL_INTERNAL, |
| 560 | INSTALL_FROM_ADB, |
| 561 | INSTALL_ALL_USERS, |
| 562 | INSTALL_ALLOW_DOWNGRADE, |
| 563 | INSTALL_GRANT_RUNTIME_PERMISSIONS, |
| 564 | INSTALL_FORCE_VOLUME_UUID, |
| 565 | INSTALL_FORCE_PERMISSION_PROMPT, |
| 566 | INSTALL_EPHEMERAL, |
Todd Kennedy | 39bfee5 | 2016-02-24 10:28:21 -0800 | [diff] [blame] | 567 | INSTALL_DONT_KILL_APP, |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 568 | }) |
| 569 | @Retention(RetentionPolicy.SOURCE) |
| 570 | public @interface InstallFlags {} |
| 571 | |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 572 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 573 | * Flag parameter for {@link #installPackage} to indicate that this package |
| 574 | * should be installed as forward locked, i.e. only the app itself should |
| 575 | * have access to its code and non-resource assets. |
| 576 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 577 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 578 | */ |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 579 | public static final int INSTALL_FORWARD_LOCK = 0x00000001; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 580 | |
| 581 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 582 | * Flag parameter for {@link #installPackage} to indicate that you want to |
| 583 | * replace an already installed package, if one exists. |
| 584 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 585 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 586 | */ |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 587 | public static final int INSTALL_REPLACE_EXISTING = 0x00000002; |
| 588 | |
| 589 | /** |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 590 | * Flag parameter for {@link #installPackage} to indicate that you want to |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 591 | * allow test packages (those that have set android:testOnly in their |
| 592 | * manifest) to be installed. |
| 593 | * @hide |
| 594 | */ |
| 595 | public static final int INSTALL_ALLOW_TEST = 0x00000004; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 596 | |
| 597 | /** |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 598 | * Flag parameter for {@link #installPackage} to indicate that this package |
| 599 | * must be installed to an ASEC on a {@link VolumeInfo#TYPE_PUBLIC}. |
| 600 | * |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 601 | * @hide |
| 602 | */ |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 603 | public static final int INSTALL_EXTERNAL = 0x00000008; |
Oscar Montemayor | 539d3c4 | 2010-01-29 15:27:00 -0800 | [diff] [blame] | 604 | |
| 605 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 606 | * Flag parameter for {@link #installPackage} to indicate that this package |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 607 | * must be installed to internal storage. |
| 608 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 609 | * @hide |
| 610 | */ |
| 611 | public static final int INSTALL_INTERNAL = 0x00000010; |
| 612 | |
| 613 | /** |
| 614 | * Flag parameter for {@link #installPackage} to indicate that this install |
| 615 | * was initiated via ADB. |
| 616 | * |
| 617 | * @hide |
| 618 | */ |
| 619 | public static final int INSTALL_FROM_ADB = 0x00000020; |
Suchi Amalapurapu | 14b6abd | 2010-03-17 08:37:04 -0700 | [diff] [blame] | 620 | |
| 621 | /** |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 622 | * Flag parameter for {@link #installPackage} to indicate that this install |
| 623 | * should immediately be visible to all users. |
| 624 | * |
| 625 | * @hide |
| 626 | */ |
| 627 | public static final int INSTALL_ALL_USERS = 0x00000040; |
| 628 | |
| 629 | /** |
| 630 | * Flag parameter for {@link #installPackage} to indicate that it is okay |
| 631 | * to install an update to an app where the newly installed app has a lower |
Alex Klyubin | 921dd75 | 2016-02-24 13:21:41 -0800 | [diff] [blame] | 632 | * version code than the currently installed app. This is permitted only if |
| 633 | * the currently installed app is marked debuggable. |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 634 | * |
| 635 | * @hide |
| 636 | */ |
| 637 | public static final int INSTALL_ALLOW_DOWNGRADE = 0x00000080; |
| 638 | |
| 639 | /** |
Svet Ganov | 95c1ade | 2015-03-19 09:38:52 -0700 | [diff] [blame] | 640 | * Flag parameter for {@link #installPackage} to indicate that all runtime |
| 641 | * permissions should be granted to the package. If {@link #INSTALL_ALL_USERS} |
| 642 | * is set the runtime permissions will be granted to all users, otherwise |
| 643 | * only to the owner. |
| 644 | * |
| 645 | * @hide |
| 646 | */ |
| 647 | public static final int INSTALL_GRANT_RUNTIME_PERMISSIONS = 0x00000100; |
| 648 | |
Jeff Sharkey | ab23409 | 2015-06-09 21:42:22 -0700 | [diff] [blame] | 649 | /** {@hide} */ |
| 650 | public static final int INSTALL_FORCE_VOLUME_UUID = 0x00000200; |
| 651 | |
Svet Ganov | 95c1ade | 2015-03-19 09:38:52 -0700 | [diff] [blame] | 652 | /** |
Todd Kennedy | a1d12cf | 2015-09-29 15:43:00 -0700 | [diff] [blame] | 653 | * Flag parameter for {@link #installPackage} to indicate that we always want to force |
| 654 | * the prompt for permission approval. This overrides any special behaviour for internal |
| 655 | * components. |
| 656 | * |
| 657 | * @hide |
| 658 | */ |
| 659 | public static final int INSTALL_FORCE_PERMISSION_PROMPT = 0x00000400; |
| 660 | |
| 661 | /** |
Todd Kennedy | 27c24fb | 2015-09-17 16:49:25 -0700 | [diff] [blame] | 662 | * Flag parameter for {@link #installPackage} to indicate that this package is |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 663 | * to be installed as a lightweight "ephemeral" app. |
| 664 | * |
| 665 | * @hide |
| 666 | */ |
Todd Kennedy | 373f0b4 | 2015-12-16 14:45:14 -0800 | [diff] [blame] | 667 | public static final int INSTALL_EPHEMERAL = 0x00000800; |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 668 | |
| 669 | /** |
Todd Kennedy | 39bfee5 | 2016-02-24 10:28:21 -0800 | [diff] [blame] | 670 | * Flag parameter for {@link #installPackage} to indicate that this package contains |
| 671 | * a feature split to an existing application and the existing application should not |
| 672 | * be killed during the installation process. |
| 673 | * |
| 674 | * @hide |
| 675 | */ |
| 676 | public static final int INSTALL_DONT_KILL_APP = 0x00001000; |
| 677 | |
| 678 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 679 | * Flag parameter for |
| 680 | * {@link #setComponentEnabledSetting(android.content.ComponentName, int, int)} to indicate |
| 681 | * that you don't want to kill the app containing the component. Be careful when you set this |
| 682 | * since changing component states can make the containing application's behavior unpredictable. |
| 683 | */ |
| 684 | public static final int DONT_KILL_APP = 0x00000001; |
| 685 | |
| 686 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 687 | * Installation return code: this is passed to the |
| 688 | * {@link IPackageInstallObserver} on success. |
| 689 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 690 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 691 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 692 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 693 | public static final int INSTALL_SUCCEEDED = 1; |
| 694 | |
| 695 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 696 | * Installation return code: this is passed to the |
| 697 | * {@link IPackageInstallObserver} if the package is already installed. |
| 698 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 699 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 700 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 701 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 702 | public static final int INSTALL_FAILED_ALREADY_EXISTS = -1; |
| 703 | |
| 704 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 705 | * Installation return code: this is passed to the |
| 706 | * {@link IPackageInstallObserver} if the package archive file is invalid. |
| 707 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 708 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 709 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 710 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 711 | public static final int INSTALL_FAILED_INVALID_APK = -2; |
| 712 | |
| 713 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 714 | * Installation return code: this is passed to the |
| 715 | * {@link IPackageInstallObserver} if the URI passed in is invalid. |
| 716 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 717 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 718 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 719 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 720 | public static final int INSTALL_FAILED_INVALID_URI = -3; |
| 721 | |
| 722 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 723 | * Installation return code: this is passed to the |
| 724 | * {@link IPackageInstallObserver} if the package manager service found that |
| 725 | * the device didn't have enough storage space to install the app. |
| 726 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 727 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 728 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 729 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 730 | public static final int INSTALL_FAILED_INSUFFICIENT_STORAGE = -4; |
| 731 | |
| 732 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 733 | * Installation return code: this is passed to the |
| 734 | * {@link IPackageInstallObserver} if a package is already installed with |
| 735 | * the same name. |
| 736 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 737 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 738 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 739 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 740 | public static final int INSTALL_FAILED_DUPLICATE_PACKAGE = -5; |
| 741 | |
| 742 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 743 | * Installation return code: this is passed to the |
| 744 | * {@link IPackageInstallObserver} if the requested shared user does not |
| 745 | * exist. |
| 746 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 747 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 748 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 749 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 750 | public static final int INSTALL_FAILED_NO_SHARED_USER = -6; |
| 751 | |
| 752 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 753 | * Installation return code: this is passed to the |
| 754 | * {@link IPackageInstallObserver} if a previously installed package of the |
| 755 | * same name has a different signature than the new package (and the old |
| 756 | * package's data was not removed). |
| 757 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 758 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 759 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 760 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 761 | public static final int INSTALL_FAILED_UPDATE_INCOMPATIBLE = -7; |
| 762 | |
| 763 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 764 | * Installation return code: this is passed to the |
| 765 | * {@link IPackageInstallObserver} if the new package is requested a shared |
| 766 | * user which is already installed on the device and does not have matching |
| 767 | * signature. |
| 768 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 769 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 770 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 771 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 772 | public static final int INSTALL_FAILED_SHARED_USER_INCOMPATIBLE = -8; |
| 773 | |
| 774 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 775 | * Installation return code: this is passed to the |
| 776 | * {@link IPackageInstallObserver} if the new package uses a shared library |
| 777 | * that is not available. |
| 778 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 779 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 780 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 781 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 782 | public static final int INSTALL_FAILED_MISSING_SHARED_LIBRARY = -9; |
| 783 | |
| 784 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 785 | * Installation return code: this is passed to the |
| 786 | * {@link IPackageInstallObserver} if the new package uses a shared library |
| 787 | * that is not available. |
| 788 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 789 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 790 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 791 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 792 | public static final int INSTALL_FAILED_REPLACE_COULDNT_DELETE = -10; |
| 793 | |
| 794 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 795 | * Installation return code: this is passed to the |
| 796 | * {@link IPackageInstallObserver} if the new package failed while |
| 797 | * optimizing and validating its dex files, either because there was not |
| 798 | * enough storage or the validation failed. |
| 799 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 800 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 801 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 802 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 803 | public static final int INSTALL_FAILED_DEXOPT = -11; |
| 804 | |
| 805 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 806 | * Installation return code: this is passed to the |
| 807 | * {@link IPackageInstallObserver} if the new package failed because the |
| 808 | * current SDK version is older than that required by the package. |
| 809 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 810 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 811 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 812 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 813 | public static final int INSTALL_FAILED_OLDER_SDK = -12; |
| 814 | |
| 815 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 816 | * Installation return code: this is passed to the |
| 817 | * {@link IPackageInstallObserver} if the new package failed because it |
| 818 | * contains a content provider with the same authority as a provider already |
| 819 | * installed in the system. |
| 820 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 821 | * @hide |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 822 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 823 | @SystemApi |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 824 | public static final int INSTALL_FAILED_CONFLICTING_PROVIDER = -13; |
| 825 | |
| 826 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 827 | * Installation return code: this is passed to the |
| 828 | * {@link IPackageInstallObserver} if the new package failed because the |
| 829 | * current SDK version is newer than that required by the package. |
| 830 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 831 | * @hide |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 832 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 833 | @SystemApi |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 834 | public static final int INSTALL_FAILED_NEWER_SDK = -14; |
| 835 | |
| 836 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 837 | * Installation return code: this is passed to the |
| 838 | * {@link IPackageInstallObserver} if the new package failed because it has |
| 839 | * specified that it is a test-only package and the caller has not supplied |
| 840 | * the {@link #INSTALL_ALLOW_TEST} flag. |
| 841 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 842 | * @hide |
| 843 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 844 | @SystemApi |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 845 | public static final int INSTALL_FAILED_TEST_ONLY = -15; |
| 846 | |
| 847 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 848 | * Installation return code: this is passed to the |
| 849 | * {@link IPackageInstallObserver} if the package being installed contains |
| 850 | * native code, but none that is compatible with the device's CPU_ABI. |
| 851 | * |
Dianne Hackborn | b181118 | 2009-05-21 15:45:42 -0700 | [diff] [blame] | 852 | * @hide |
| 853 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 854 | @SystemApi |
Dianne Hackborn | b181118 | 2009-05-21 15:45:42 -0700 | [diff] [blame] | 855 | public static final int INSTALL_FAILED_CPU_ABI_INCOMPATIBLE = -16; |
| 856 | |
| 857 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 858 | * Installation return code: this is passed to the |
| 859 | * {@link IPackageInstallObserver} if the new package uses a feature that is |
| 860 | * not available. |
| 861 | * |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 862 | * @hide |
| 863 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 864 | @SystemApi |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 865 | public static final int INSTALL_FAILED_MISSING_FEATURE = -17; |
| 866 | |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 867 | // ------ Errors related to sdcard |
| 868 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 869 | * Installation return code: this is passed to the |
| 870 | * {@link IPackageInstallObserver} if a secure container mount point |
| 871 | * couldn't be accessed on external media. |
| 872 | * |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 873 | * @hide |
| 874 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 875 | @SystemApi |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 876 | public static final int INSTALL_FAILED_CONTAINER_ERROR = -18; |
| 877 | |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 878 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 879 | * Installation return code: this is passed to the |
| 880 | * {@link IPackageInstallObserver} if the new package couldn't be installed |
| 881 | * in the specified install location. |
| 882 | * |
Suchi Amalapurapu | b56ae20 | 2010-02-04 22:51:07 -0800 | [diff] [blame] | 883 | * @hide |
| 884 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 885 | @SystemApi |
Suchi Amalapurapu | b56ae20 | 2010-02-04 22:51:07 -0800 | [diff] [blame] | 886 | public static final int INSTALL_FAILED_INVALID_INSTALL_LOCATION = -19; |
| 887 | |
| 888 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 889 | * Installation return code: this is passed to the |
| 890 | * {@link IPackageInstallObserver} if the new package couldn't be installed |
| 891 | * in the specified install location because the media is not available. |
| 892 | * |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 893 | * @hide |
| 894 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 895 | @SystemApi |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 896 | public static final int INSTALL_FAILED_MEDIA_UNAVAILABLE = -20; |
| 897 | |
| 898 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 899 | * Installation return code: this is passed to the |
| 900 | * {@link IPackageInstallObserver} if the new package couldn't be installed |
| 901 | * because the verification timed out. |
| 902 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 903 | * @hide |
| 904 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 905 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 906 | public static final int INSTALL_FAILED_VERIFICATION_TIMEOUT = -21; |
| 907 | |
| 908 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 909 | * Installation return code: this is passed to the |
| 910 | * {@link IPackageInstallObserver} if the new package couldn't be installed |
| 911 | * because the verification did not succeed. |
| 912 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 913 | * @hide |
| 914 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 915 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 916 | public static final int INSTALL_FAILED_VERIFICATION_FAILURE = -22; |
| 917 | |
| 918 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 919 | * Installation return code: this is passed to the |
| 920 | * {@link IPackageInstallObserver} if the package changed from what the |
| 921 | * calling program expected. |
| 922 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 923 | * @hide |
| 924 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 925 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 926 | public static final int INSTALL_FAILED_PACKAGE_CHANGED = -23; |
| 927 | |
| 928 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 929 | * Installation return code: this is passed to the |
| 930 | * {@link IPackageInstallObserver} if the new package is assigned a |
| 931 | * different UID than it previously held. |
| 932 | * |
Dianne Hackborn | d0c5f51 | 2012-06-07 16:53:59 -0700 | [diff] [blame] | 933 | * @hide |
| 934 | */ |
| 935 | public static final int INSTALL_FAILED_UID_CHANGED = -24; |
| 936 | |
| 937 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 938 | * Installation return code: this is passed to the |
| 939 | * {@link IPackageInstallObserver} if the new package has an older version |
| 940 | * code than the currently installed package. |
| 941 | * |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 942 | * @hide |
| 943 | */ |
| 944 | public static final int INSTALL_FAILED_VERSION_DOWNGRADE = -25; |
| 945 | |
| 946 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 947 | * Installation return code: this is passed to the |
| 948 | * {@link IPackageInstallObserver} if the old package has target SDK high |
| 949 | * enough to support runtime permission and the new package has target SDK |
| 950 | * low enough to not support runtime permissions. |
| 951 | * |
Svetoslav | d965370 | 2015-05-13 18:02:46 -0700 | [diff] [blame] | 952 | * @hide |
| 953 | */ |
| 954 | @SystemApi |
| 955 | public static final int INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE = -26; |
| 956 | |
| 957 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 958 | * Installation parse return code: this is passed to the |
| 959 | * {@link IPackageInstallObserver} if the parser was given a path that is |
| 960 | * not a file, or does not end with the expected '.apk' extension. |
| 961 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 962 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 963 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 964 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 965 | public static final int INSTALL_PARSE_FAILED_NOT_APK = -100; |
| 966 | |
| 967 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 968 | * Installation parse return code: this is passed to the |
| 969 | * {@link IPackageInstallObserver} if the parser was unable to retrieve the |
| 970 | * AndroidManifest.xml file. |
| 971 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 972 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 973 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 974 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 975 | public static final int INSTALL_PARSE_FAILED_BAD_MANIFEST = -101; |
| 976 | |
| 977 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 978 | * Installation parse return code: this is passed to the |
| 979 | * {@link IPackageInstallObserver} if the parser encountered an unexpected |
| 980 | * exception. |
| 981 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 982 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 983 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 984 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 985 | public static final int INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION = -102; |
| 986 | |
| 987 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 988 | * Installation parse return code: this is passed to the |
| 989 | * {@link IPackageInstallObserver} if the parser did not find any |
| 990 | * certificates in the .apk. |
| 991 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 992 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 993 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 994 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 995 | public static final int INSTALL_PARSE_FAILED_NO_CERTIFICATES = -103; |
| 996 | |
| 997 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 998 | * Installation parse return code: this is passed to the |
| 999 | * {@link IPackageInstallObserver} if the parser found inconsistent |
| 1000 | * certificates on the files in the .apk. |
| 1001 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1002 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1003 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1004 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1005 | public static final int INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES = -104; |
| 1006 | |
| 1007 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1008 | * Installation parse return code: this is passed to the |
| 1009 | * {@link IPackageInstallObserver} if the parser encountered a |
| 1010 | * CertificateEncodingException in one of the files in the .apk. |
| 1011 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1012 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1013 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1014 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1015 | public static final int INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING = -105; |
| 1016 | |
| 1017 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1018 | * Installation parse return code: this is passed to the |
| 1019 | * {@link IPackageInstallObserver} if the parser encountered a bad or |
| 1020 | * missing package name in the manifest. |
| 1021 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1022 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1023 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1024 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1025 | public static final int INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME = -106; |
| 1026 | |
| 1027 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1028 | * Installation parse return code: this is passed to the |
| 1029 | * {@link IPackageInstallObserver} if the parser encountered a bad shared |
| 1030 | * user id name in the manifest. |
| 1031 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1032 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1033 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1034 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1035 | public static final int INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID = -107; |
| 1036 | |
| 1037 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1038 | * Installation parse return code: this is passed to the |
| 1039 | * {@link IPackageInstallObserver} if the parser encountered some structural |
| 1040 | * problem in the manifest. |
| 1041 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1042 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1043 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1044 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1045 | public static final int INSTALL_PARSE_FAILED_MANIFEST_MALFORMED = -108; |
| 1046 | |
| 1047 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1048 | * Installation parse return code: this is passed to the |
| 1049 | * {@link IPackageInstallObserver} if the parser did not find any actionable |
| 1050 | * tags (instrumentation or application) in the manifest. |
| 1051 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1052 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1053 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1054 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1055 | public static final int INSTALL_PARSE_FAILED_MANIFEST_EMPTY = -109; |
| 1056 | |
| 1057 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1058 | * Installation failed return code: this is passed to the |
| 1059 | * {@link IPackageInstallObserver} if the system failed to install the |
| 1060 | * package because of system issues. |
| 1061 | * |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 1062 | * @hide |
| 1063 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1064 | @SystemApi |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 1065 | public static final int INSTALL_FAILED_INTERNAL_ERROR = -110; |
| 1066 | |
| 1067 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1068 | * Installation failed return code: this is passed to the |
| 1069 | * {@link IPackageInstallObserver} if the system failed to install the |
| 1070 | * package because the user is restricted from installing apps. |
| 1071 | * |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 1072 | * @hide |
| 1073 | */ |
| 1074 | public static final int INSTALL_FAILED_USER_RESTRICTED = -111; |
| 1075 | |
| 1076 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1077 | * Installation failed return code: this is passed to the |
| 1078 | * {@link IPackageInstallObserver} if the system failed to install the |
| 1079 | * package because it is attempting to define a permission that is already |
| 1080 | * defined by some existing package. |
| 1081 | * <p> |
| 1082 | * The package name of the app which has already defined the permission is |
| 1083 | * passed to a {@link PackageInstallObserver}, if any, as the |
| 1084 | * {@link #EXTRA_FAILURE_EXISTING_PACKAGE} string extra; and the name of the |
| 1085 | * permission being redefined is passed in the |
| 1086 | * {@link #EXTRA_FAILURE_EXISTING_PERMISSION} string extra. |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 1087 | * |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 1088 | * @hide |
| 1089 | */ |
| 1090 | public static final int INSTALL_FAILED_DUPLICATE_PERMISSION = -112; |
| 1091 | |
| 1092 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1093 | * Installation failed return code: this is passed to the |
| 1094 | * {@link IPackageInstallObserver} if the system failed to install the |
| 1095 | * package because its packaged native code did not match any of the ABIs |
| 1096 | * supported by the system. |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1097 | * |
| 1098 | * @hide |
| 1099 | */ |
Narayan Kamath | d11f223 | 2014-04-10 10:37:17 +0100 | [diff] [blame] | 1100 | public static final int INSTALL_FAILED_NO_MATCHING_ABIS = -113; |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1101 | |
| 1102 | /** |
| 1103 | * Internal return code for NativeLibraryHelper methods to indicate that the package |
| 1104 | * being processed did not contain any native code. This is placed here only so that |
| 1105 | * it can belong to the same value space as the other install failure codes. |
| 1106 | * |
| 1107 | * @hide |
| 1108 | */ |
Narayan Kamath | d11f223 | 2014-04-10 10:37:17 +0100 | [diff] [blame] | 1109 | public static final int NO_NATIVE_LIBRARIES = -114; |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1110 | |
Jeff Sharkey | 7328a1b | 2014-08-07 14:01:43 -0700 | [diff] [blame] | 1111 | /** {@hide} */ |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 1112 | public static final int INSTALL_FAILED_ABORTED = -115; |
Jeff Sharkey | 7328a1b | 2014-08-07 14:01:43 -0700 | [diff] [blame] | 1113 | |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1114 | /** |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 1115 | * Installation failed return code: ephemeral app installs are incompatible with some |
| 1116 | * other installation flags supplied for the operation; or other circumstances such |
| 1117 | * as trying to upgrade a system app via an ephemeral install. |
| 1118 | * @hide |
| 1119 | */ |
| 1120 | public static final int INSTALL_FAILED_EPHEMERAL_INVALID = -116; |
| 1121 | |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1122 | /** @hide */ |
| 1123 | @IntDef(flag = true, value = { |
| 1124 | DELETE_KEEP_DATA, |
| 1125 | DELETE_ALL_USERS, |
| 1126 | DELETE_SYSTEM_APP, |
Todd Kennedy | 39bfee5 | 2016-02-24 10:28:21 -0800 | [diff] [blame] | 1127 | DELETE_DONT_KILL_APP, |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1128 | }) |
| 1129 | @Retention(RetentionPolicy.SOURCE) |
| 1130 | public @interface DeleteFlags {} |
| 1131 | |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 1132 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1133 | * Flag parameter for {@link #deletePackage} to indicate that you don't want to delete the |
| 1134 | * package's data directory. |
| 1135 | * |
| 1136 | * @hide |
| 1137 | */ |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1138 | public static final int DELETE_KEEP_DATA = 0x00000001; |
| 1139 | |
| 1140 | /** |
| 1141 | * Flag parameter for {@link #deletePackage} to indicate that you want the |
| 1142 | * package deleted for all users. |
| 1143 | * |
| 1144 | * @hide |
| 1145 | */ |
| 1146 | public static final int DELETE_ALL_USERS = 0x00000002; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1147 | |
| 1148 | /** |
Dianne Hackborn | c895be7 | 2013-03-11 17:48:43 -0700 | [diff] [blame] | 1149 | * Flag parameter for {@link #deletePackage} to indicate that, if you are calling |
| 1150 | * uninstall on a system that has been updated, then don't do the normal process |
| 1151 | * of uninstalling the update and rolling back to the older system version (which |
| 1152 | * needs to happen for all users); instead, just mark the app as uninstalled for |
| 1153 | * the current user. |
| 1154 | * |
| 1155 | * @hide |
| 1156 | */ |
| 1157 | public static final int DELETE_SYSTEM_APP = 0x00000004; |
| 1158 | |
| 1159 | /** |
Todd Kennedy | 39bfee5 | 2016-02-24 10:28:21 -0800 | [diff] [blame] | 1160 | * Flag parameter for {@link #deletePackage} to indicate that, if you are calling |
| 1161 | * uninstall on a package that is replaced to provide new feature splits, the |
| 1162 | * existing application should not be killed during the removal process. |
| 1163 | * |
| 1164 | * @hide |
| 1165 | */ |
| 1166 | public static final int DELETE_DONT_KILL_APP = 0x00000008; |
| 1167 | |
| 1168 | /** |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1169 | * Return code for when package deletion succeeds. This is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1170 | * {@link IPackageDeleteObserver} if the system succeeded in deleting the |
| 1171 | * package. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1172 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1173 | * @hide |
| 1174 | */ |
| 1175 | public static final int DELETE_SUCCEEDED = 1; |
| 1176 | |
| 1177 | /** |
| 1178 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1179 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1180 | * for an unspecified reason. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1181 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1182 | * @hide |
| 1183 | */ |
| 1184 | public static final int DELETE_FAILED_INTERNAL_ERROR = -1; |
| 1185 | |
| 1186 | /** |
| 1187 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1188 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1189 | * because it is the active DevicePolicy manager. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1190 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1191 | * @hide |
| 1192 | */ |
| 1193 | public static final int DELETE_FAILED_DEVICE_POLICY_MANAGER = -2; |
| 1194 | |
| 1195 | /** |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 1196 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1197 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1198 | * since the user is restricted. |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 1199 | * |
| 1200 | * @hide |
| 1201 | */ |
| 1202 | public static final int DELETE_FAILED_USER_RESTRICTED = -3; |
| 1203 | |
| 1204 | /** |
Kenny Guy | 1b88da5 | 2014-07-10 16:33:49 +0100 | [diff] [blame] | 1205 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1206 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1207 | * because a profile or device owner has marked the package as |
| 1208 | * uninstallable. |
Kenny Guy | c13053b | 2014-05-29 14:17:17 +0100 | [diff] [blame] | 1209 | * |
| 1210 | * @hide |
| 1211 | */ |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 1212 | public static final int DELETE_FAILED_OWNER_BLOCKED = -4; |
| 1213 | |
| 1214 | /** {@hide} */ |
| 1215 | public static final int DELETE_FAILED_ABORTED = -5; |
Kenny Guy | c13053b | 2014-05-29 14:17:17 +0100 | [diff] [blame] | 1216 | |
| 1217 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1218 | * Return code that is passed to the {@link IPackageMoveObserver} when the |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1219 | * package has been successfully moved by the system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1220 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1221 | * @hide |
| 1222 | */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1223 | public static final int MOVE_SUCCEEDED = -100; |
| 1224 | |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1225 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1226 | * Error code that is passed to the {@link IPackageMoveObserver} when the |
| 1227 | * package hasn't been successfully moved by the system because of |
| 1228 | * insufficient memory on specified media. |
| 1229 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1230 | * @hide |
| 1231 | */ |
| 1232 | public static final int MOVE_FAILED_INSUFFICIENT_STORAGE = -1; |
| 1233 | |
| 1234 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1235 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1236 | * specified package doesn't exist. |
| 1237 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1238 | * @hide |
| 1239 | */ |
| 1240 | public static final int MOVE_FAILED_DOESNT_EXIST = -2; |
| 1241 | |
| 1242 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1243 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1244 | * specified package cannot be moved since its a system package. |
| 1245 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1246 | * @hide |
| 1247 | */ |
| 1248 | public static final int MOVE_FAILED_SYSTEM_PACKAGE = -3; |
| 1249 | |
| 1250 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1251 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1252 | * specified package cannot be moved since its forward locked. |
| 1253 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1254 | * @hide |
| 1255 | */ |
| 1256 | public static final int MOVE_FAILED_FORWARD_LOCKED = -4; |
| 1257 | |
| 1258 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1259 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1260 | * specified package cannot be moved to the specified location. |
| 1261 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1262 | * @hide |
| 1263 | */ |
| 1264 | public static final int MOVE_FAILED_INVALID_LOCATION = -5; |
| 1265 | |
| 1266 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1267 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1268 | * specified package cannot be moved to the specified location. |
| 1269 | * |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 1270 | * @hide |
| 1271 | */ |
| 1272 | public static final int MOVE_FAILED_INTERNAL_ERROR = -6; |
| 1273 | |
| 1274 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1275 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1276 | * specified package already has an operation pending in the queue. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1277 | * |
Kenny Root | deb1126 | 2010-08-02 11:36:21 -0700 | [diff] [blame] | 1278 | * @hide |
| 1279 | */ |
| 1280 | public static final int MOVE_FAILED_OPERATION_PENDING = -7; |
| 1281 | |
| 1282 | /** |
Makoto Onuki | f34db0a | 2016-02-17 11:17:15 -0800 | [diff] [blame] | 1283 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1284 | * specified package cannot be moved since it contains a device admin. |
| 1285 | * |
| 1286 | * @hide |
| 1287 | */ |
| 1288 | public static final int MOVE_FAILED_DEVICE_ADMIN = -8; |
| 1289 | |
| 1290 | /** |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1291 | * Flag parameter for {@link #movePackage} to indicate that |
| 1292 | * the package should be moved to internal storage if its |
| 1293 | * been installed on external media. |
| 1294 | * @hide |
| 1295 | */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1296 | @Deprecated |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1297 | public static final int MOVE_INTERNAL = 0x00000001; |
| 1298 | |
| 1299 | /** |
| 1300 | * Flag parameter for {@link #movePackage} to indicate that |
| 1301 | * the package should be moved to external media. |
| 1302 | * @hide |
| 1303 | */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1304 | @Deprecated |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1305 | public static final int MOVE_EXTERNAL_MEDIA = 0x00000002; |
| 1306 | |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1307 | /** {@hide} */ |
| 1308 | public static final String EXTRA_MOVE_ID = "android.content.pm.extra.MOVE_ID"; |
| 1309 | |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1310 | /** |
Kenny Root | 05ca4c9 | 2011-09-15 10:36:25 -0700 | [diff] [blame] | 1311 | * Usable by the required verifier as the {@code verificationCode} argument |
| 1312 | * for {@link PackageManager#verifyPendingInstall} to indicate that it will |
| 1313 | * allow the installation to proceed without any of the optional verifiers |
| 1314 | * needing to vote. |
| 1315 | * |
| 1316 | * @hide |
| 1317 | */ |
| 1318 | public static final int VERIFICATION_ALLOW_WITHOUT_SUFFICIENT = 2; |
| 1319 | |
| 1320 | /** |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 1321 | * Used as the {@code verificationCode} argument for |
| 1322 | * {@link PackageManager#verifyPendingInstall} to indicate that the calling |
| 1323 | * package verifier allows the installation to proceed. |
| 1324 | */ |
| 1325 | public static final int VERIFICATION_ALLOW = 1; |
| 1326 | |
| 1327 | /** |
| 1328 | * Used as the {@code verificationCode} argument for |
| 1329 | * {@link PackageManager#verifyPendingInstall} to indicate the calling |
| 1330 | * package verifier does not vote to allow the installation to proceed. |
| 1331 | */ |
| 1332 | public static final int VERIFICATION_REJECT = -1; |
| 1333 | |
| 1334 | /** |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1335 | * Used as the {@code verificationCode} argument for |
| 1336 | * {@link PackageManager#verifyIntentFilter} to indicate that the calling |
| 1337 | * IntentFilter Verifier confirms that the IntentFilter is verified. |
| 1338 | * |
| 1339 | * @hide |
| 1340 | */ |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 1341 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1342 | public static final int INTENT_FILTER_VERIFICATION_SUCCESS = 1; |
| 1343 | |
| 1344 | /** |
| 1345 | * Used as the {@code verificationCode} argument for |
| 1346 | * {@link PackageManager#verifyIntentFilter} to indicate that the calling |
| 1347 | * IntentFilter Verifier confirms that the IntentFilter is NOT verified. |
| 1348 | * |
| 1349 | * @hide |
| 1350 | */ |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 1351 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1352 | public static final int INTENT_FILTER_VERIFICATION_FAILURE = -1; |
| 1353 | |
| 1354 | /** |
| 1355 | * Internal status code to indicate that an IntentFilter verification result is not specified. |
| 1356 | * |
| 1357 | * @hide |
| 1358 | */ |
| 1359 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED = 0; |
| 1360 | |
| 1361 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1362 | * Used as the {@code status} argument for |
| 1363 | * {@link #updateIntentVerificationStatusAsUser} to indicate that the User |
| 1364 | * will always be prompted the Intent Disambiguation Dialog if there are two |
| 1365 | * or more Intent resolved for the IntentFilter's domain(s). |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1366 | * |
| 1367 | * @hide |
| 1368 | */ |
| 1369 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK = 1; |
| 1370 | |
| 1371 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1372 | * Used as the {@code status} argument for |
| 1373 | * {@link #updateIntentVerificationStatusAsUser} to indicate that the User |
| 1374 | * will never be prompted the Intent Disambiguation Dialog if there are two |
| 1375 | * or more resolution of the Intent. The default App for the domain(s) |
| 1376 | * specified in the IntentFilter will also ALWAYS be used. |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1377 | * |
| 1378 | * @hide |
| 1379 | */ |
| 1380 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS = 2; |
| 1381 | |
| 1382 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1383 | * Used as the {@code status} argument for |
| 1384 | * {@link #updateIntentVerificationStatusAsUser} to indicate that the User |
| 1385 | * may be prompted the Intent Disambiguation Dialog if there are two or more |
| 1386 | * Intent resolved. The default App for the domain(s) specified in the |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1387 | * IntentFilter will also NEVER be presented to the User. |
| 1388 | * |
| 1389 | * @hide |
| 1390 | */ |
| 1391 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER = 3; |
| 1392 | |
| 1393 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1394 | * Used as the {@code status} argument for |
| 1395 | * {@link #updateIntentVerificationStatusAsUser} to indicate that this app |
| 1396 | * should always be considered as an ambiguous candidate for handling the |
| 1397 | * matching Intent even if there are other candidate apps in the "always" |
| 1398 | * state. Put another way: if there are any 'always ask' apps in a set of |
| 1399 | * more than one candidate app, then a disambiguation is *always* presented |
| 1400 | * even if there is another candidate app with the 'always' state. |
Christopher Tate | 56f0ff3 | 2015-08-13 16:29:33 -0700 | [diff] [blame] | 1401 | * |
| 1402 | * @hide |
| 1403 | */ |
| 1404 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS_ASK = 4; |
| 1405 | |
| 1406 | /** |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 1407 | * Can be used as the {@code millisecondsToDelay} argument for |
| 1408 | * {@link PackageManager#extendVerificationTimeout}. This is the |
| 1409 | * maximum time {@code PackageManager} waits for the verification |
| 1410 | * agent to return (in milliseconds). |
| 1411 | */ |
| 1412 | public static final long MAXIMUM_VERIFICATION_TIMEOUT = 60*60*1000; |
| 1413 | |
| 1414 | /** |
Amith Yamasani | 0b28549 | 2011-04-14 17:35:23 -0700 | [diff] [blame] | 1415 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: The device's |
| 1416 | * audio pipeline is low-latency, more suitable for audio applications sensitive to delays or |
| 1417 | * lag in sound input or output. |
Dan Morrill | 898e1e8 | 2010-09-26 17:28:30 -0700 | [diff] [blame] | 1418 | */ |
| 1419 | @SdkConstant(SdkConstantType.FEATURE) |
| 1420 | public static final String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency"; |
| 1421 | |
| 1422 | /** |
| 1423 | * Feature for {@link #getSystemAvailableFeatures} and |
Unsuk Jung | 50909f6 | 2014-09-02 18:25:49 -0700 | [diff] [blame] | 1424 | * {@link #hasSystemFeature}: The device includes at least one form of audio |
| 1425 | * output, such as speakers, audio jack or streaming over bluetooth |
| 1426 | */ |
| 1427 | @SdkConstant(SdkConstantType.FEATURE) |
| 1428 | public static final String FEATURE_AUDIO_OUTPUT = "android.hardware.audio.output"; |
| 1429 | |
| 1430 | /** |
Glenn Kasten | cdcb577 | 2015-05-06 15:54:49 -0700 | [diff] [blame] | 1431 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Glenn Kasten | 7587edc | 2015-10-30 17:45:52 -0700 | [diff] [blame] | 1432 | * The device has professional audio level of functionality and performance. |
Glenn Kasten | cdcb577 | 2015-05-06 15:54:49 -0700 | [diff] [blame] | 1433 | */ |
| 1434 | @SdkConstant(SdkConstantType.FEATURE) |
| 1435 | public static final String FEATURE_AUDIO_PRO = "android.hardware.audio.pro"; |
| 1436 | |
| 1437 | /** |
Unsuk Jung | 50909f6 | 2014-09-02 18:25:49 -0700 | [diff] [blame] | 1438 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1439 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 1440 | * other devices via Bluetooth. |
| 1441 | */ |
| 1442 | @SdkConstant(SdkConstantType.FEATURE) |
| 1443 | public static final String FEATURE_BLUETOOTH = "android.hardware.bluetooth"; |
| 1444 | |
| 1445 | /** |
| 1446 | * Feature for {@link #getSystemAvailableFeatures} and |
Matthew Xie | a722772 | 2013-04-18 15:25:59 -0700 | [diff] [blame] | 1447 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 1448 | * other devices via Bluetooth Low Energy radio. |
| 1449 | */ |
| 1450 | @SdkConstant(SdkConstantType.FEATURE) |
| 1451 | public static final String FEATURE_BLUETOOTH_LE = "android.hardware.bluetooth_le"; |
| 1452 | |
| 1453 | /** |
| 1454 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1455 | * {@link #hasSystemFeature}: The device has a camera facing away |
| 1456 | * from the screen. |
| 1457 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1458 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1459 | public static final String FEATURE_CAMERA = "android.hardware.camera"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1460 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1461 | /** |
| 1462 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1463 | * {@link #hasSystemFeature}: The device's camera supports auto-focus. |
| 1464 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1465 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1466 | public static final String FEATURE_CAMERA_AUTOFOCUS = "android.hardware.camera.autofocus"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1467 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1468 | /** |
| 1469 | * Feature for {@link #getSystemAvailableFeatures} and |
Eino-Ville Talvala | 752af83 | 2012-09-18 14:45:37 -0700 | [diff] [blame] | 1470 | * {@link #hasSystemFeature}: The device has at least one camera pointing in |
Eino-Ville Talvala | 9131da2 | 2014-05-08 11:39:53 -0700 | [diff] [blame] | 1471 | * some direction, or can support an external camera being connected to it. |
Eino-Ville Talvala | 752af83 | 2012-09-18 14:45:37 -0700 | [diff] [blame] | 1472 | */ |
| 1473 | @SdkConstant(SdkConstantType.FEATURE) |
| 1474 | public static final String FEATURE_CAMERA_ANY = "android.hardware.camera.any"; |
| 1475 | |
| 1476 | /** |
| 1477 | * Feature for {@link #getSystemAvailableFeatures} and |
Eino-Ville Talvala | 9131da2 | 2014-05-08 11:39:53 -0700 | [diff] [blame] | 1478 | * {@link #hasSystemFeature}: The device can support having an external camera connected to it. |
| 1479 | * The external camera may not always be connected or available to applications to use. |
| 1480 | */ |
| 1481 | @SdkConstant(SdkConstantType.FEATURE) |
| 1482 | public static final String FEATURE_CAMERA_EXTERNAL = "android.hardware.camera.external"; |
| 1483 | |
| 1484 | /** |
| 1485 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1486 | * {@link #hasSystemFeature}: The device's camera supports flash. |
| 1487 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1488 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1489 | public static final String FEATURE_CAMERA_FLASH = "android.hardware.camera.flash"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1490 | |
| 1491 | /** |
| 1492 | * Feature for {@link #getSystemAvailableFeatures} and |
Chih-Chung Chang | de1057c | 2010-06-14 19:15:00 +0800 | [diff] [blame] | 1493 | * {@link #hasSystemFeature}: The device has a front facing camera. |
| 1494 | */ |
| 1495 | @SdkConstant(SdkConstantType.FEATURE) |
| 1496 | public static final String FEATURE_CAMERA_FRONT = "android.hardware.camera.front"; |
| 1497 | |
| 1498 | /** |
Eino-Ville Talvala | 611fece | 2014-07-10 17:29:38 -0700 | [diff] [blame] | 1499 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1500 | * of the cameras on the device supports the |
| 1501 | * {@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL full hardware} |
| 1502 | * capability level. |
| 1503 | */ |
| 1504 | @SdkConstant(SdkConstantType.FEATURE) |
| 1505 | public static final String FEATURE_CAMERA_LEVEL_FULL = "android.hardware.camera.level.full"; |
| 1506 | |
| 1507 | /** |
| 1508 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1509 | * of the cameras on the device supports the |
| 1510 | * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR manual sensor} |
| 1511 | * capability level. |
| 1512 | */ |
| 1513 | @SdkConstant(SdkConstantType.FEATURE) |
| 1514 | public static final String FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR = |
| 1515 | "android.hardware.camera.capability.manual_sensor"; |
| 1516 | |
| 1517 | /** |
| 1518 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1519 | * of the cameras on the device supports the |
| 1520 | * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING manual post-processing} |
| 1521 | * capability level. |
| 1522 | */ |
| 1523 | @SdkConstant(SdkConstantType.FEATURE) |
| 1524 | public static final String FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING = |
| 1525 | "android.hardware.camera.capability.manual_post_processing"; |
| 1526 | |
| 1527 | /** |
| 1528 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1529 | * of the cameras on the device supports the |
| 1530 | * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_RAW RAW} |
| 1531 | * capability level. |
| 1532 | */ |
| 1533 | @SdkConstant(SdkConstantType.FEATURE) |
| 1534 | public static final String FEATURE_CAMERA_CAPABILITY_RAW = |
| 1535 | "android.hardware.camera.capability.raw"; |
| 1536 | |
| 1537 | /** |
Chih-Chung Chang | de1057c | 2010-06-14 19:15:00 +0800 | [diff] [blame] | 1538 | * Feature for {@link #getSystemAvailableFeatures} and |
Alex Ray | 0c9d61f | 2013-10-03 12:17:54 -0700 | [diff] [blame] | 1539 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 1540 | * consumer IR devices. |
| 1541 | */ |
| 1542 | @SdkConstant(SdkConstantType.FEATURE) |
| 1543 | public static final String FEATURE_CONSUMER_IR = "android.hardware.consumerir"; |
| 1544 | |
| 1545 | /** |
| 1546 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1547 | * {@link #hasSystemFeature}: The device supports one or more methods of |
| 1548 | * reporting current location. |
| 1549 | */ |
| 1550 | @SdkConstant(SdkConstantType.FEATURE) |
| 1551 | public static final String FEATURE_LOCATION = "android.hardware.location"; |
| 1552 | |
| 1553 | /** |
| 1554 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1555 | * {@link #hasSystemFeature}: The device has a Global Positioning System |
| 1556 | * receiver and can report precise location. |
| 1557 | */ |
| 1558 | @SdkConstant(SdkConstantType.FEATURE) |
| 1559 | public static final String FEATURE_LOCATION_GPS = "android.hardware.location.gps"; |
| 1560 | |
| 1561 | /** |
| 1562 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1563 | * {@link #hasSystemFeature}: The device can report location with coarse |
| 1564 | * accuracy using a network-based geolocation system. |
| 1565 | */ |
| 1566 | @SdkConstant(SdkConstantType.FEATURE) |
| 1567 | public static final String FEATURE_LOCATION_NETWORK = "android.hardware.location.network"; |
| 1568 | |
| 1569 | /** |
| 1570 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1571 | * {@link #hasSystemFeature}: The device can record audio via a |
| 1572 | * microphone. |
| 1573 | */ |
| 1574 | @SdkConstant(SdkConstantType.FEATURE) |
| 1575 | public static final String FEATURE_MICROPHONE = "android.hardware.microphone"; |
| 1576 | |
| 1577 | /** |
| 1578 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 76437d3 | 2010-09-01 11:17:20 -0700 | [diff] [blame] | 1579 | * {@link #hasSystemFeature}: The device can communicate using Near-Field |
| 1580 | * Communications (NFC). |
| 1581 | */ |
| 1582 | @SdkConstant(SdkConstantType.FEATURE) |
| 1583 | public static final String FEATURE_NFC = "android.hardware.nfc"; |
| 1584 | |
| 1585 | /** |
| 1586 | * Feature for {@link #getSystemAvailableFeatures} and |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1587 | * {@link #hasSystemFeature}: The device supports host- |
| 1588 | * based NFC card emulation. |
Martijn Coenen | df4d1d6 | 2013-08-28 11:18:58 -0700 | [diff] [blame] | 1589 | * |
| 1590 | * TODO remove when depending apps have moved to new constant. |
| 1591 | * @hide |
| 1592 | * @deprecated |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1593 | */ |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 1594 | @Deprecated |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1595 | @SdkConstant(SdkConstantType.FEATURE) |
| 1596 | public static final String FEATURE_NFC_HCE = "android.hardware.nfc.hce"; |
| 1597 | |
| 1598 | /** |
| 1599 | * Feature for {@link #getSystemAvailableFeatures} and |
Martijn Coenen | df4d1d6 | 2013-08-28 11:18:58 -0700 | [diff] [blame] | 1600 | * {@link #hasSystemFeature}: The device supports host- |
| 1601 | * based NFC card emulation. |
| 1602 | */ |
| 1603 | @SdkConstant(SdkConstantType.FEATURE) |
| 1604 | public static final String FEATURE_NFC_HOST_CARD_EMULATION = "android.hardware.nfc.hce"; |
| 1605 | |
| 1606 | /** |
| 1607 | * Feature for {@link #getSystemAvailableFeatures} and |
Yoshinobu Ito | c52adfe | 2016-01-22 18:14:18 +0900 | [diff] [blame] | 1608 | * {@link #hasSystemFeature}: The device supports host- |
| 1609 | * based NFC-F card emulation. |
| 1610 | */ |
| 1611 | @SdkConstant(SdkConstantType.FEATURE) |
| 1612 | public static final String FEATURE_NFC_HOST_CARD_EMULATION_NFCF = "android.hardware.nfc.hcef"; |
| 1613 | |
| 1614 | /** |
| 1615 | * Feature for {@link #getSystemAvailableFeatures} and |
Jesse Hall | 7f51706 | 2014-07-18 11:54:41 -0700 | [diff] [blame] | 1616 | * {@link #hasSystemFeature}: The device supports the OpenGL ES |
| 1617 | * <a href="http://www.khronos.org/registry/gles/extensions/ANDROID/ANDROID_extension_pack_es31a.txt"> |
| 1618 | * Android Extension Pack</a>. |
| 1619 | */ |
| 1620 | @SdkConstant(SdkConstantType.FEATURE) |
| 1621 | public static final String FEATURE_OPENGLES_EXTENSION_PACK = "android.hardware.opengles.aep"; |
| 1622 | |
| 1623 | /** |
| 1624 | * Feature for {@link #getSystemAvailableFeatures} and |
Jesse Hall | 39ceeb5 | 2016-03-10 09:04:26 -0800 | [diff] [blame] | 1625 | * {@link #hasSystemFeature(String, int)}: If this feature is supported, the Vulkan native API |
| 1626 | * will enumerate at least one {@code VkPhysicalDevice}, and the feature version will indicate |
| 1627 | * what level of optional hardware features limits it supports. |
Jesse Hall | f77a34f | 2016-02-04 18:41:33 -0800 | [diff] [blame] | 1628 | * <p> |
| 1629 | * Level 0 includes the base Vulkan requirements as well as: |
| 1630 | * <ul><li>{@code VkPhysicalDeviceFeatures::textureCompressionETC2}</li></ul> |
| 1631 | * <p> |
| 1632 | * Level 1 additionally includes: |
| 1633 | * <ul> |
| 1634 | * <li>{@code VkPhysicalDeviceFeatures::fullDrawIndexUint32}</li> |
| 1635 | * <li>{@code VkPhysicalDeviceFeatures::imageCubeArray}</li> |
| 1636 | * <li>{@code VkPhysicalDeviceFeatures::independentBlend}</li> |
| 1637 | * <li>{@code VkPhysicalDeviceFeatures::geometryShader}</li> |
| 1638 | * <li>{@code VkPhysicalDeviceFeatures::tessellationShader}</li> |
| 1639 | * <li>{@code VkPhysicalDeviceFeatures::sampleRateShading}</li> |
| 1640 | * <li>{@code VkPhysicalDeviceFeatures::textureCompressionASTC_LDR}</li> |
| 1641 | * <li>{@code VkPhysicalDeviceFeatures::fragmentStoresAndAtomics}</li> |
| 1642 | * <li>{@code VkPhysicalDeviceFeatures::shaderImageGatherExtended}</li> |
| 1643 | * <li>{@code VkPhysicalDeviceFeatures::shaderUniformBufferArrayDynamicIndexing}</li> |
| 1644 | * <li>{@code VkPhysicalDeviceFeatures::shaderSampledImageArrayDynamicIndexing}</li> |
| 1645 | * </ul> |
| 1646 | */ |
| 1647 | @SdkConstant(SdkConstantType.FEATURE) |
| 1648 | public static final String FEATURE_VULKAN_HARDWARE_LEVEL = "android.hardware.vulkan.level"; |
| 1649 | |
| 1650 | /** |
| 1651 | * Feature for {@link #getSystemAvailableFeatures} and |
Jesse Hall | 39ceeb5 | 2016-03-10 09:04:26 -0800 | [diff] [blame] | 1652 | * {@link #hasSystemFeature(String, int)}: The version of this feature indicates the highest |
Jesse Hall | f77a34f | 2016-02-04 18:41:33 -0800 | [diff] [blame] | 1653 | * {@code VkPhysicalDeviceProperties::apiVersion} supported by the physical devices that support |
| 1654 | * the hardware level indicated by {@link #FEATURE_VULKAN_HARDWARE_LEVEL}. The feature version |
| 1655 | * uses the same encoding as Vulkan version numbers: |
| 1656 | * <ul> |
| 1657 | * <li>Major version number in bits 31-22</li> |
| 1658 | * <li>Minor version number in bits 21-12</li> |
| 1659 | * <li>Patch version number in bits 11-0</li> |
| 1660 | * </ul> |
| 1661 | */ |
| 1662 | @SdkConstant(SdkConstantType.FEATURE) |
| 1663 | public static final String FEATURE_VULKAN_HARDWARE_VERSION = "android.hardware.vulkan.version"; |
| 1664 | |
| 1665 | /** |
| 1666 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1667 | * {@link #hasSystemFeature}: The device includes an accelerometer. |
| 1668 | */ |
| 1669 | @SdkConstant(SdkConstantType.FEATURE) |
| 1670 | public static final String FEATURE_SENSOR_ACCELEROMETER = "android.hardware.sensor.accelerometer"; |
| 1671 | |
| 1672 | /** |
| 1673 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1674 | * {@link #hasSystemFeature}: The device includes a barometer (air |
| 1675 | * pressure sensor.) |
| 1676 | */ |
| 1677 | @SdkConstant(SdkConstantType.FEATURE) |
| 1678 | public static final String FEATURE_SENSOR_BAROMETER = "android.hardware.sensor.barometer"; |
| 1679 | |
| 1680 | /** |
| 1681 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1682 | * {@link #hasSystemFeature}: The device includes a magnetometer (compass). |
| 1683 | */ |
| 1684 | @SdkConstant(SdkConstantType.FEATURE) |
| 1685 | public static final String FEATURE_SENSOR_COMPASS = "android.hardware.sensor.compass"; |
| 1686 | |
| 1687 | /** |
| 1688 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1689 | * {@link #hasSystemFeature}: The device includes a gyroscope. |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1690 | */ |
| 1691 | @SdkConstant(SdkConstantType.FEATURE) |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1692 | public static final String FEATURE_SENSOR_GYROSCOPE = "android.hardware.sensor.gyroscope"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1693 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1694 | /** |
| 1695 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1696 | * {@link #hasSystemFeature}: The device includes a light sensor. |
| 1697 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1698 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1699 | public static final String FEATURE_SENSOR_LIGHT = "android.hardware.sensor.light"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1700 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1701 | /** |
| 1702 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1703 | * {@link #hasSystemFeature}: The device includes a proximity sensor. |
| 1704 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1705 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1706 | public static final String FEATURE_SENSOR_PROXIMITY = "android.hardware.sensor.proximity"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1707 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1708 | /** |
| 1709 | * Feature for {@link #getSystemAvailableFeatures} and |
Aravind Akella | 068b0c0 | 2013-10-12 17:39:15 -0700 | [diff] [blame] | 1710 | * {@link #hasSystemFeature}: The device includes a hardware step counter. |
| 1711 | */ |
| 1712 | @SdkConstant(SdkConstantType.FEATURE) |
| 1713 | public static final String FEATURE_SENSOR_STEP_COUNTER = "android.hardware.sensor.stepcounter"; |
| 1714 | |
| 1715 | /** |
| 1716 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1717 | * {@link #hasSystemFeature}: The device includes a hardware step detector. |
| 1718 | */ |
| 1719 | @SdkConstant(SdkConstantType.FEATURE) |
| 1720 | public static final String FEATURE_SENSOR_STEP_DETECTOR = "android.hardware.sensor.stepdetector"; |
| 1721 | |
| 1722 | /** |
| 1723 | * Feature for {@link #getSystemAvailableFeatures} and |
Vinod Krishnan | 8afb23c | 2014-04-30 11:11:39 -0700 | [diff] [blame] | 1724 | * {@link #hasSystemFeature}: The device includes a heart rate monitor. |
| 1725 | */ |
| 1726 | @SdkConstant(SdkConstantType.FEATURE) |
| 1727 | public static final String FEATURE_SENSOR_HEART_RATE = "android.hardware.sensor.heartrate"; |
| 1728 | |
| 1729 | /** |
| 1730 | * Feature for {@link #getSystemAvailableFeatures} and |
Vinod Krishnan | 1ab7689 | 2014-08-20 11:11:55 -0700 | [diff] [blame] | 1731 | * {@link #hasSystemFeature}: The heart rate sensor on this device is an Electrocargiogram. |
| 1732 | */ |
| 1733 | @SdkConstant(SdkConstantType.FEATURE) |
| 1734 | public static final String FEATURE_SENSOR_HEART_RATE_ECG = |
| 1735 | "android.hardware.sensor.heartrate.ecg"; |
| 1736 | |
| 1737 | /** |
| 1738 | * Feature for {@link #getSystemAvailableFeatures} and |
Aravind Akella | 8b8e74b | 2014-07-09 11:52:39 -0700 | [diff] [blame] | 1739 | * {@link #hasSystemFeature}: The device includes a relative humidity sensor. |
| 1740 | */ |
| 1741 | @SdkConstant(SdkConstantType.FEATURE) |
| 1742 | public static final String FEATURE_SENSOR_RELATIVE_HUMIDITY = |
| 1743 | "android.hardware.sensor.relative_humidity"; |
| 1744 | |
| 1745 | /** |
| 1746 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1747 | * {@link #hasSystemFeature}: The device includes an ambient temperature sensor. |
| 1748 | */ |
| 1749 | @SdkConstant(SdkConstantType.FEATURE) |
| 1750 | public static final String FEATURE_SENSOR_AMBIENT_TEMPERATURE = |
| 1751 | "android.hardware.sensor.ambient_temperature"; |
| 1752 | |
| 1753 | /** |
| 1754 | * Feature for {@link #getSystemAvailableFeatures} and |
Ashutosh Joshi | eae371b | 2015-04-09 10:30:07 -0700 | [diff] [blame] | 1755 | * {@link #hasSystemFeature}: The device supports high fidelity sensor processing |
| 1756 | * capabilities. |
| 1757 | */ |
| 1758 | @SdkConstant(SdkConstantType.FEATURE) |
| 1759 | public static final String FEATURE_HIFI_SENSORS = |
| 1760 | "android.hardware.sensor.hifi_sensors"; |
| 1761 | |
| 1762 | /** |
| 1763 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1764 | * {@link #hasSystemFeature}: The device has a telephony radio with data |
| 1765 | * communication support. |
| 1766 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1767 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1768 | public static final String FEATURE_TELEPHONY = "android.hardware.telephony"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1769 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1770 | /** |
| 1771 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1772 | * {@link #hasSystemFeature}: The device has a CDMA telephony stack. |
| 1773 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1774 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1775 | public static final String FEATURE_TELEPHONY_CDMA = "android.hardware.telephony.cdma"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1776 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1777 | /** |
| 1778 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1779 | * {@link #hasSystemFeature}: The device has a GSM telephony stack. |
| 1780 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1781 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1782 | public static final String FEATURE_TELEPHONY_GSM = "android.hardware.telephony.gsm"; |
Hung-ying Tyan | 3424c02 | 2010-08-27 18:08:19 +0800 | [diff] [blame] | 1783 | |
| 1784 | /** |
| 1785 | * Feature for {@link #getSystemAvailableFeatures} and |
Mike Lockwood | f4ca247 | 2011-02-27 11:23:25 -0800 | [diff] [blame] | 1786 | * {@link #hasSystemFeature}: The device supports connecting to USB devices |
| 1787 | * as the USB host. |
| 1788 | */ |
| 1789 | @SdkConstant(SdkConstantType.FEATURE) |
| 1790 | public static final String FEATURE_USB_HOST = "android.hardware.usb.host"; |
| 1791 | |
| 1792 | /** |
| 1793 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1794 | * {@link #hasSystemFeature}: The device supports connecting to USB accessories. |
| 1795 | */ |
| 1796 | @SdkConstant(SdkConstantType.FEATURE) |
| 1797 | public static final String FEATURE_USB_ACCESSORY = "android.hardware.usb.accessory"; |
| 1798 | |
| 1799 | /** |
| 1800 | * Feature for {@link #getSystemAvailableFeatures} and |
Hung-ying Tyan | 3424c02 | 2010-08-27 18:08:19 +0800 | [diff] [blame] | 1801 | * {@link #hasSystemFeature}: The SIP API is enabled on the device. |
| 1802 | */ |
| 1803 | @SdkConstant(SdkConstantType.FEATURE) |
| 1804 | public static final String FEATURE_SIP = "android.software.sip"; |
| 1805 | |
| 1806 | /** |
| 1807 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1808 | * {@link #hasSystemFeature}: The device supports SIP-based VOIP. |
| 1809 | */ |
| 1810 | @SdkConstant(SdkConstantType.FEATURE) |
| 1811 | public static final String FEATURE_SIP_VOIP = "android.software.sip.voip"; |
| 1812 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1813 | /** |
| 1814 | * Feature for {@link #getSystemAvailableFeatures} and |
Ihab Awad | 1ec6888 | 2014-09-12 11:09:01 -0700 | [diff] [blame] | 1815 | * {@link #hasSystemFeature}: The Connection Service API is enabled on the device. |
| 1816 | */ |
| 1817 | @SdkConstant(SdkConstantType.FEATURE) |
| 1818 | public static final String FEATURE_CONNECTION_SERVICE = "android.software.connectionservice"; |
| 1819 | |
| 1820 | /** |
| 1821 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | b0fe033 | 2010-04-05 14:43:58 -0700 | [diff] [blame] | 1822 | * {@link #hasSystemFeature}: The device's display has a touch screen. |
| 1823 | */ |
| 1824 | @SdkConstant(SdkConstantType.FEATURE) |
| 1825 | public static final String FEATURE_TOUCHSCREEN = "android.hardware.touchscreen"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1826 | |
Dan Morrill | b0fe033 | 2010-04-05 14:43:58 -0700 | [diff] [blame] | 1827 | /** |
| 1828 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1829 | * {@link #hasSystemFeature}: The device's touch screen supports |
| 1830 | * multitouch sufficient for basic two-finger gesture detection. |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1831 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1832 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1833 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH = "android.hardware.touchscreen.multitouch"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1834 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1835 | /** |
| 1836 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1837 | * {@link #hasSystemFeature}: The device's touch screen is capable of |
| 1838 | * tracking two or more fingers fully independently. |
| 1839 | */ |
| 1840 | @SdkConstant(SdkConstantType.FEATURE) |
| 1841 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT = "android.hardware.touchscreen.multitouch.distinct"; |
| 1842 | |
| 1843 | /** |
| 1844 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 6993d3d | 2010-09-03 14:30:14 -0700 | [diff] [blame] | 1845 | * {@link #hasSystemFeature}: The device's touch screen is capable of |
| 1846 | * tracking a full hand of fingers fully independently -- that is, 5 or |
| 1847 | * more simultaneous independent pointers. |
| 1848 | */ |
| 1849 | @SdkConstant(SdkConstantType.FEATURE) |
| 1850 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND = "android.hardware.touchscreen.multitouch.jazzhand"; |
| 1851 | |
| 1852 | /** |
| 1853 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | a537687 | 2011-01-23 13:15:53 -0800 | [diff] [blame] | 1854 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 1855 | * does support touch emulation for basic events. For instance, the |
| 1856 | * device might use a mouse or remote control to drive a cursor, and |
| 1857 | * emulate basic touch pointer events like down, up, drag, etc. All |
| 1858 | * devices that support android.hardware.touchscreen or a sub-feature are |
| 1859 | * presumed to also support faketouch. |
| 1860 | */ |
| 1861 | @SdkConstant(SdkConstantType.FEATURE) |
| 1862 | public static final String FEATURE_FAKETOUCH = "android.hardware.faketouch"; |
| 1863 | |
| 1864 | /** |
| 1865 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | e22fe93 | 2011-06-08 20:24:29 -0700 | [diff] [blame] | 1866 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 1867 | * does support touch emulation for basic events that supports distinct |
| 1868 | * tracking of two or more fingers. This is an extension of |
| 1869 | * {@link #FEATURE_FAKETOUCH} for input devices with this capability. Note |
| 1870 | * that unlike a distinct multitouch screen as defined by |
| 1871 | * {@link #FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT}, these kinds of input |
| 1872 | * devices will not actually provide full two-finger gestures since the |
| 1873 | * input is being transformed to cursor movement on the screen. That is, |
| 1874 | * single finger gestures will move a cursor; two-finger swipes will |
| 1875 | * result in single-finger touch events; other two-finger gestures will |
| 1876 | * result in the corresponding two-finger touch event. |
| 1877 | */ |
| 1878 | @SdkConstant(SdkConstantType.FEATURE) |
| 1879 | public static final String FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT = "android.hardware.faketouch.multitouch.distinct"; |
| 1880 | |
| 1881 | /** |
| 1882 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1883 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 1884 | * does support touch emulation for basic events that supports tracking |
| 1885 | * a hand of fingers (5 or more fingers) fully independently. |
| 1886 | * This is an extension of |
| 1887 | * {@link #FEATURE_FAKETOUCH} for input devices with this capability. Note |
| 1888 | * that unlike a multitouch screen as defined by |
| 1889 | * {@link #FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND}, not all two finger |
| 1890 | * gestures can be detected due to the limitations described for |
| 1891 | * {@link #FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT}. |
| 1892 | */ |
| 1893 | @SdkConstant(SdkConstantType.FEATURE) |
| 1894 | public static final String FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND = "android.hardware.faketouch.multitouch.jazzhand"; |
| 1895 | |
| 1896 | /** |
| 1897 | * Feature for {@link #getSystemAvailableFeatures} and |
Jim Miller | d9b9d41 | 2015-07-22 19:51:40 -0700 | [diff] [blame] | 1898 | * {@link #hasSystemFeature}: The device has biometric hardware to detect a fingerprint. |
| 1899 | */ |
| 1900 | @SdkConstant(SdkConstantType.FEATURE) |
| 1901 | public static final String FEATURE_FINGERPRINT = "android.hardware.fingerprint"; |
| 1902 | |
| 1903 | /** |
| 1904 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | e289bff | 2011-06-13 19:33:22 -0700 | [diff] [blame] | 1905 | * {@link #hasSystemFeature}: The device supports portrait orientation |
| 1906 | * screens. For backwards compatibility, you can assume that if neither |
| 1907 | * this nor {@link #FEATURE_SCREEN_LANDSCAPE} is set then the device supports |
| 1908 | * both portrait and landscape. |
| 1909 | */ |
| 1910 | @SdkConstant(SdkConstantType.FEATURE) |
| 1911 | public static final String FEATURE_SCREEN_PORTRAIT = "android.hardware.screen.portrait"; |
| 1912 | |
| 1913 | /** |
| 1914 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1915 | * {@link #hasSystemFeature}: The device supports landscape orientation |
| 1916 | * screens. For backwards compatibility, you can assume that if neither |
| 1917 | * this nor {@link #FEATURE_SCREEN_PORTRAIT} is set then the device supports |
| 1918 | * both portrait and landscape. |
| 1919 | */ |
| 1920 | @SdkConstant(SdkConstantType.FEATURE) |
| 1921 | public static final String FEATURE_SCREEN_LANDSCAPE = "android.hardware.screen.landscape"; |
| 1922 | |
| 1923 | /** |
| 1924 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1925 | * {@link #hasSystemFeature}: The device supports live wallpapers. |
| 1926 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1927 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1928 | public static final String FEATURE_LIVE_WALLPAPER = "android.software.live_wallpaper"; |
Oscar Montemayor | 1228d0a | 2010-01-28 12:01:44 -0800 | [diff] [blame] | 1929 | /** |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1930 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 119bbc3 | 2013-03-22 17:27:25 -0700 | [diff] [blame] | 1931 | * {@link #hasSystemFeature}: The device supports app widgets. |
| 1932 | */ |
| 1933 | @SdkConstant(SdkConstantType.FEATURE) |
| 1934 | public static final String FEATURE_APP_WIDGETS = "android.software.app_widgets"; |
| 1935 | |
| 1936 | /** |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 1937 | * @hide |
| 1938 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1939 | * {@link #hasSystemFeature}: The device supports |
| 1940 | * {@link android.service.voice.VoiceInteractionService} and |
| 1941 | * {@link android.app.VoiceInteractor}. |
| 1942 | */ |
| 1943 | @SdkConstant(SdkConstantType.FEATURE) |
| 1944 | public static final String FEATURE_VOICE_RECOGNIZERS = "android.software.voice_recognizers"; |
| 1945 | |
| 1946 | |
| 1947 | /** |
Dianne Hackborn | 119bbc3 | 2013-03-22 17:27:25 -0700 | [diff] [blame] | 1948 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1949 | * {@link #hasSystemFeature}: The device supports a home screen that is replaceable |
| 1950 | * by third party applications. |
| 1951 | */ |
| 1952 | @SdkConstant(SdkConstantType.FEATURE) |
| 1953 | public static final String FEATURE_HOME_SCREEN = "android.software.home_screen"; |
| 1954 | |
| 1955 | /** |
| 1956 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1957 | * {@link #hasSystemFeature}: The device supports adding new input methods implemented |
| 1958 | * with the {@link android.inputmethodservice.InputMethodService} API. |
| 1959 | */ |
| 1960 | @SdkConstant(SdkConstantType.FEATURE) |
| 1961 | public static final String FEATURE_INPUT_METHODS = "android.software.input_methods"; |
| 1962 | |
| 1963 | /** |
| 1964 | * Feature for {@link #getSystemAvailableFeatures} and |
Amith Yamasani | 44a01b7 | 2013-09-16 10:44:57 -0700 | [diff] [blame] | 1965 | * {@link #hasSystemFeature}: The device supports device policy enforcement via device admins. |
| 1966 | */ |
| 1967 | @SdkConstant(SdkConstantType.FEATURE) |
| 1968 | public static final String FEATURE_DEVICE_ADMIN = "android.software.device_admin"; |
| 1969 | |
| 1970 | /** |
| 1971 | * Feature for {@link #getSystemAvailableFeatures} and |
Tim Kilbourn | f94b6a9 | 2014-03-07 15:13:48 -0800 | [diff] [blame] | 1972 | * {@link #hasSystemFeature}: The device supports leanback UI. This is |
| 1973 | * typically used in a living room television experience, but is a software |
| 1974 | * feature unlike {@link #FEATURE_TELEVISION}. Devices running with this |
| 1975 | * feature will use resources associated with the "television" UI mode. |
| 1976 | */ |
| 1977 | @SdkConstant(SdkConstantType.FEATURE) |
| 1978 | public static final String FEATURE_LEANBACK = "android.software.leanback"; |
| 1979 | |
| 1980 | /** |
| 1981 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1982 | * {@link #hasSystemFeature}: The device supports only leanback UI. Only |
| 1983 | * applications designed for this experience should be run, though this is |
| 1984 | * not enforced by the system. |
| 1985 | * @hide |
| 1986 | */ |
| 1987 | @SdkConstant(SdkConstantType.FEATURE) |
| 1988 | public static final String FEATURE_LEANBACK_ONLY = "android.software.leanback_only"; |
| 1989 | |
| 1990 | /** |
| 1991 | * Feature for {@link #getSystemAvailableFeatures} and |
Jae Seo | cfd861e | 2014-08-27 14:02:15 -0700 | [diff] [blame] | 1992 | * {@link #hasSystemFeature}: The device supports live TV and can display |
| 1993 | * contents from TV inputs implemented with the |
| 1994 | * {@link android.media.tv.TvInputService} API. |
| 1995 | */ |
| 1996 | @SdkConstant(SdkConstantType.FEATURE) |
| 1997 | public static final String FEATURE_LIVE_TV = "android.software.live_tv"; |
| 1998 | |
| 1999 | /** |
| 2000 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 2001 | * {@link #hasSystemFeature}: The device supports WiFi (802.11) networking. |
| 2002 | */ |
| 2003 | @SdkConstant(SdkConstantType.FEATURE) |
| 2004 | public static final String FEATURE_WIFI = "android.hardware.wifi"; |
| 2005 | |
| 2006 | /** |
Irfan Sheriff | 45b8b46 | 2011-09-07 11:24:16 -0700 | [diff] [blame] | 2007 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2008 | * {@link #hasSystemFeature}: The device supports Wi-Fi Direct networking. |
| 2009 | */ |
| 2010 | @SdkConstant(SdkConstantType.FEATURE) |
| 2011 | public static final String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct"; |
| 2012 | |
| 2013 | /** |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2014 | * Feature for {@link #getSystemAvailableFeatures} and |
Etan Cohen | 20d329b | 2015-09-29 13:49:02 -0700 | [diff] [blame] | 2015 | * {@link #hasSystemFeature}: The device supports Wi-Fi Aware (NAN) |
| 2016 | * networking. |
| 2017 | * |
| 2018 | * @hide PROPOSED_NAN_API |
| 2019 | */ |
| 2020 | @SdkConstant(SdkConstantType.FEATURE) |
| 2021 | public static final String FEATURE_WIFI_NAN = "android.hardware.wifi.nan"; |
| 2022 | |
| 2023 | /** |
| 2024 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2025 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
Todd Kennedy | 7f95a00 | 2015-04-22 14:28:25 -0700 | [diff] [blame] | 2026 | * on a vehicle headunit. A headunit here is defined to be inside a |
| 2027 | * vehicle that may or may not be moving. A headunit uses either a |
| 2028 | * primary display in the center console and/or additional displays in |
| 2029 | * the instrument cluster or elsewhere in the vehicle. Headunit display(s) |
| 2030 | * have limited size and resolution. The user will likely be focused on |
| 2031 | * driving so limiting driver distraction is a primary concern. User input |
| 2032 | * can be a variety of hard buttons, touch, rotary controllers and even mouse- |
| 2033 | * like interfaces. |
| 2034 | */ |
| 2035 | @SdkConstant(SdkConstantType.FEATURE) |
| 2036 | public static final String FEATURE_AUTOMOTIVE = "android.hardware.type.automotive"; |
| 2037 | |
| 2038 | /** |
| 2039 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2040 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2041 | * on a television. Television here is defined to be a typical living |
| 2042 | * room television experience: displayed on a big screen, where the user |
| 2043 | * is sitting far away from it, and the dominant form of input will be |
| 2044 | * something like a DPAD, not through touch or mouse. |
Tim Kilbourn | f94b6a9 | 2014-03-07 15:13:48 -0800 | [diff] [blame] | 2045 | * @deprecated use {@link #FEATURE_LEANBACK} instead. |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2046 | */ |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 2047 | @Deprecated |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2048 | @SdkConstant(SdkConstantType.FEATURE) |
| 2049 | public static final String FEATURE_TELEVISION = "android.hardware.type.television"; |
| 2050 | |
| 2051 | /** |
Justin Koh | b5731f091c | 2014-02-13 16:06:59 -0800 | [diff] [blame] | 2052 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2053 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
| 2054 | * on a watch. A watch here is defined to be a device worn on the body, perhaps on |
| 2055 | * the wrist. The user is very close when interacting with the device. |
| 2056 | */ |
| 2057 | @SdkConstant(SdkConstantType.FEATURE) |
| 2058 | public static final String FEATURE_WATCH = "android.hardware.type.watch"; |
| 2059 | |
| 2060 | /** |
Adam Lesinski | 3d9bcb9 | 2014-02-18 14:05:14 -0800 | [diff] [blame] | 2061 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2062 | * The device supports printing. |
| 2063 | */ |
| 2064 | @SdkConstant(SdkConstantType.FEATURE) |
| 2065 | public static final String FEATURE_PRINTING = "android.software.print"; |
| 2066 | |
| 2067 | /** |
| 2068 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2069 | * The device can perform backup and restore operations on installed applications. |
| 2070 | */ |
| 2071 | @SdkConstant(SdkConstantType.FEATURE) |
| 2072 | public static final String FEATURE_BACKUP = "android.software.backup"; |
| 2073 | |
| 2074 | /** |
Vladislav Kaznacheev | d303b25 | 2015-10-27 17:30:58 -0700 | [diff] [blame] | 2075 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2076 | * {@link #hasSystemFeature}: The device supports freeform window management. |
| 2077 | * Windows have title bars and can be moved and resized. |
| 2078 | */ |
Filip Gruszczynski | 811dc3b | 2015-11-23 12:34:22 -0800 | [diff] [blame] | 2079 | // If this feature is present, you also need to set |
| 2080 | // com.android.internal.R.config_freeformWindowManagement to true in your configuration overlay. |
Vladislav Kaznacheev | d303b25 | 2015-10-27 17:30:58 -0700 | [diff] [blame] | 2081 | @SdkConstant(SdkConstantType.FEATURE) |
| 2082 | public static final String FEATURE_FREEFORM_WINDOW_MANAGEMENT |
| 2083 | = "android.software.freeform_window_management"; |
| 2084 | |
| 2085 | /** |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 2086 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Wale Ogunwale | fbe12c4 | 2015-12-06 16:23:50 -0800 | [diff] [blame] | 2087 | * The device supports picture-in-picture multi-window mode. |
| 2088 | */ |
| 2089 | @SdkConstant(SdkConstantType.FEATURE) |
| 2090 | public static final String FEATURE_PICTURE_IN_PICTURE = "android.software.picture_in_picture"; |
| 2091 | |
| 2092 | /** |
| 2093 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Amith Yamasani | 1d65327 | 2014-09-11 17:56:05 -0700 | [diff] [blame] | 2094 | * The device supports creating secondary users and managed profiles via |
| 2095 | * {@link DevicePolicyManager}. |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 2096 | */ |
| 2097 | @SdkConstant(SdkConstantType.FEATURE) |
Amith Yamasani | 1d65327 | 2014-09-11 17:56:05 -0700 | [diff] [blame] | 2098 | public static final String FEATURE_MANAGED_USERS = "android.software.managed_users"; |
| 2099 | |
| 2100 | /** |
| 2101 | * @hide |
| 2102 | * TODO: Remove after dependencies updated b/17392243 |
| 2103 | */ |
| 2104 | public static final String FEATURE_MANAGED_PROFILES = "android.software.managed_users"; |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 2105 | |
| 2106 | /** |
Ben Murdoch | f564c7f | 2014-05-20 18:58:06 +0100 | [diff] [blame] | 2107 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Adam Connors | 19ccb5f | 2014-09-08 17:31:50 +0100 | [diff] [blame] | 2108 | * The device supports verified boot. |
| 2109 | */ |
| 2110 | @SdkConstant(SdkConstantType.FEATURE) |
| 2111 | public static final String FEATURE_VERIFIED_BOOT = "android.software.verified_boot"; |
| 2112 | |
| 2113 | /** |
| 2114 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2115 | * The device supports secure removal of users. When a user is deleted the data associated |
| 2116 | * with that user is securely deleted and no longer available. |
| 2117 | */ |
| 2118 | @SdkConstant(SdkConstantType.FEATURE) |
| 2119 | public static final String FEATURE_SECURELY_REMOVES_USERS |
| 2120 | = "android.software.securely_removes_users"; |
| 2121 | |
Jeff Sharkey | b92b05b | 2016-01-28 09:50:00 -0700 | [diff] [blame] | 2122 | /** {@hide} */ |
| 2123 | @SdkConstant(SdkConstantType.FEATURE) |
| 2124 | public static final String FEATURE_FILE_BASED_ENCRYPTION |
| 2125 | = "android.software.file_based_encryption"; |
| 2126 | |
Adam Connors | 19ccb5f | 2014-09-08 17:31:50 +0100 | [diff] [blame] | 2127 | /** |
| 2128 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Ben Murdoch | 422c7a5 | 2014-05-16 13:45:47 +0100 | [diff] [blame] | 2129 | * The device has a full implementation of the android.webkit.* APIs. Devices |
| 2130 | * lacking this feature will not have a functioning WebView implementation. |
| 2131 | */ |
| 2132 | @SdkConstant(SdkConstantType.FEATURE) |
| 2133 | public static final String FEATURE_WEBVIEW = "android.software.webview"; |
| 2134 | |
| 2135 | /** |
Joe LaPenna | 4bb015d | 2014-07-04 17:15:54 -0700 | [diff] [blame] | 2136 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2137 | * {@link #hasSystemFeature}: This device supports ethernet. |
Joe LaPenna | 4bb015d | 2014-07-04 17:15:54 -0700 | [diff] [blame] | 2138 | */ |
| 2139 | @SdkConstant(SdkConstantType.FEATURE) |
| 2140 | public static final String FEATURE_ETHERNET = "android.hardware.ethernet"; |
| 2141 | |
| 2142 | /** |
Yuncheol Heo | a0c4a06 | 2014-07-10 20:49:27 +0900 | [diff] [blame] | 2143 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2144 | * {@link #hasSystemFeature}: This device supports HDMI-CEC. |
| 2145 | * @hide |
| 2146 | */ |
| 2147 | @SdkConstant(SdkConstantType.FEATURE) |
| 2148 | public static final String FEATURE_HDMI_CEC = "android.hardware.hdmi.cec"; |
| 2149 | |
| 2150 | /** |
Michael Wright | 6faa675 | 2014-09-05 17:57:44 -0700 | [diff] [blame] | 2151 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2152 | * The device has all of the inputs necessary to be considered a compatible game controller, or |
| 2153 | * includes a compatible game controller in the box. |
| 2154 | */ |
| 2155 | @SdkConstant(SdkConstantType.FEATURE) |
| 2156 | public static final String FEATURE_GAMEPAD = "android.hardware.gamepad"; |
| 2157 | |
Mike Lockwood | 5781cd5 | 2015-03-27 13:23:41 -0700 | [diff] [blame] | 2158 | /** |
| 2159 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2160 | * The device has a full implementation of the android.media.midi.* APIs. |
| 2161 | */ |
| 2162 | @SdkConstant(SdkConstantType.FEATURE) |
| 2163 | public static final String FEATURE_MIDI = "android.software.midi"; |
Michael Wright | 6faa675 | 2014-09-05 17:57:44 -0700 | [diff] [blame] | 2164 | |
| 2165 | /** |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2166 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2167 | * The device implements a an optimized mode for virtual reality (VR) applications that handles |
| 2168 | * stereoscopic rendering of notifications, and may potentially also include optimizations to |
Ruben Brunk | 31d80ea | 2016-01-25 20:14:08 -0800 | [diff] [blame] | 2169 | * reduce latency in the graphics, display, and sensor stacks. |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2170 | */ |
| 2171 | @SdkConstant(SdkConstantType.FEATURE) |
| 2172 | public static final String FEATURE_VR_MODE = "android.software.vr.mode"; |
| 2173 | |
| 2174 | /** |
Ruben Brunk | 31d80ea | 2016-01-25 20:14:08 -0800 | [diff] [blame] | 2175 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2176 | * The device implements {@link #FEATURE_VR_MODE} but additionally meets all CTS requirements |
| 2177 | * to be certified as a "VR Ready" device, which guarantees that the device is capable of |
| 2178 | * delivering consistent performance at a high framerate over an extended period of time for |
| 2179 | * typical VR application CPU/GPU workloads with a minimal number of frame drops, implements |
| 2180 | * {@link #FEATURE_HIFI_SENSORS} with a low sensor latency, implements an optimized render path |
| 2181 | * to minimize latency to draw to the device's main display, and includes optimizations to |
| 2182 | * lower display persistence to an acceptable level. |
| 2183 | */ |
| 2184 | @SdkConstant(SdkConstantType.FEATURE) |
| 2185 | public static final String FEATURE_VR_MODE_HIGH_PERFORMANCE |
| 2186 | = "android.hardware.vr.high_performance"; |
| 2187 | |
| 2188 | /** |
Dianne Hackborn | e83cefce | 2010-02-04 17:38:14 -0800 | [diff] [blame] | 2189 | * Action to external storage service to clean out removed apps. |
| 2190 | * @hide |
| 2191 | */ |
| 2192 | public static final String ACTION_CLEAN_EXTERNAL_STORAGE |
| 2193 | = "android.content.pm.CLEAN_EXTERNAL_STORAGE"; |
Oscar Montemayor | 1228d0a | 2010-01-28 12:01:44 -0800 | [diff] [blame] | 2194 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2195 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 2196 | * Extra field name for the URI to a verification file. Passed to a package |
| 2197 | * verifier. |
| 2198 | * |
| 2199 | * @hide |
| 2200 | */ |
| 2201 | public static final String EXTRA_VERIFICATION_URI = "android.content.pm.extra.VERIFICATION_URI"; |
| 2202 | |
| 2203 | /** |
| 2204 | * Extra field name for the ID of a package pending verification. Passed to |
| 2205 | * a package verifier and is used to call back to |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 2206 | * {@link PackageManager#verifyPendingInstall(int, int)} |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 2207 | */ |
| 2208 | public static final String EXTRA_VERIFICATION_ID = "android.content.pm.extra.VERIFICATION_ID"; |
| 2209 | |
| 2210 | /** |
| 2211 | * Extra field name for the package identifier which is trying to install |
| 2212 | * the package. |
| 2213 | * |
| 2214 | * @hide |
| 2215 | */ |
| 2216 | public static final String EXTRA_VERIFICATION_INSTALLER_PACKAGE |
| 2217 | = "android.content.pm.extra.VERIFICATION_INSTALLER_PACKAGE"; |
| 2218 | |
| 2219 | /** |
| 2220 | * Extra field name for the requested install flags for a package pending |
| 2221 | * verification. Passed to a package verifier. |
| 2222 | * |
| 2223 | * @hide |
| 2224 | */ |
| 2225 | public static final String EXTRA_VERIFICATION_INSTALL_FLAGS |
| 2226 | = "android.content.pm.extra.VERIFICATION_INSTALL_FLAGS"; |
| 2227 | |
| 2228 | /** |
rich cannings | 13d428e | 2012-09-13 13:43:07 -0700 | [diff] [blame] | 2229 | * Extra field name for the uid of who is requesting to install |
| 2230 | * the package. |
| 2231 | * |
| 2232 | * @hide |
| 2233 | */ |
| 2234 | public static final String EXTRA_VERIFICATION_INSTALLER_UID |
| 2235 | = "android.content.pm.extra.VERIFICATION_INSTALLER_UID"; |
| 2236 | |
| 2237 | /** |
| 2238 | * Extra field name for the package name of a package pending verification. |
| 2239 | * |
| 2240 | * @hide |
| 2241 | */ |
| 2242 | public static final String EXTRA_VERIFICATION_PACKAGE_NAME |
| 2243 | = "android.content.pm.extra.VERIFICATION_PACKAGE_NAME"; |
| 2244 | /** |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 2245 | * Extra field name for the result of a verification, either |
| 2246 | * {@link #VERIFICATION_ALLOW}, or {@link #VERIFICATION_REJECT}. |
| 2247 | * Passed to package verifiers after a package is verified. |
| 2248 | */ |
| 2249 | public static final String EXTRA_VERIFICATION_RESULT |
| 2250 | = "android.content.pm.extra.VERIFICATION_RESULT"; |
| 2251 | |
| 2252 | /** |
rich cannings | 13d428e | 2012-09-13 13:43:07 -0700 | [diff] [blame] | 2253 | * Extra field name for the version code of a package pending verification. |
| 2254 | * |
| 2255 | * @hide |
| 2256 | */ |
| 2257 | public static final String EXTRA_VERIFICATION_VERSION_CODE |
| 2258 | = "android.content.pm.extra.VERIFICATION_VERSION_CODE"; |
| 2259 | |
| 2260 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 2261 | * Extra field name for the ID of a intent filter pending verification. |
| 2262 | * Passed to an intent filter verifier and is used to call back to |
| 2263 | * {@link #verifyIntentFilter} |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 2264 | * |
| 2265 | * @hide |
| 2266 | */ |
| 2267 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_ID |
| 2268 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_ID"; |
| 2269 | |
| 2270 | /** |
| 2271 | * Extra field name for the scheme used for an intent filter pending verification. Passed to |
| 2272 | * an intent filter verifier and is used to construct the URI to verify against. |
| 2273 | * |
| 2274 | * Usually this is "https" |
| 2275 | * |
| 2276 | * @hide |
| 2277 | */ |
| 2278 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_URI_SCHEME |
| 2279 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_URI_SCHEME"; |
| 2280 | |
| 2281 | /** |
| 2282 | * Extra field name for the host names to be used for an intent filter pending verification. |
| 2283 | * Passed to an intent filter verifier and is used to construct the URI to verify the |
| 2284 | * intent filter. |
| 2285 | * |
| 2286 | * This is a space delimited list of hosts. |
| 2287 | * |
| 2288 | * @hide |
| 2289 | */ |
| 2290 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_HOSTS |
| 2291 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_HOSTS"; |
| 2292 | |
| 2293 | /** |
| 2294 | * Extra field name for the package name to be used for an intent filter pending verification. |
| 2295 | * Passed to an intent filter verifier and is used to check the verification responses coming |
| 2296 | * from the hosts. Each host response will need to include the package name of APK containing |
| 2297 | * the intent filter. |
| 2298 | * |
| 2299 | * @hide |
| 2300 | */ |
| 2301 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_PACKAGE_NAME |
| 2302 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_PACKAGE_NAME"; |
| 2303 | |
| 2304 | /** |
| 2305 | * The action used to request that the user approve a permission request |
| 2306 | * from the application. |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2307 | * |
| 2308 | * @hide |
| 2309 | */ |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 2310 | @SystemApi |
| 2311 | public static final String ACTION_REQUEST_PERMISSIONS = |
| 2312 | "android.content.pm.action.REQUEST_PERMISSIONS"; |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2313 | |
| 2314 | /** |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 2315 | * The names of the requested permissions. |
| 2316 | * <p> |
| 2317 | * <strong>Type:</strong> String[] |
| 2318 | * </p> |
| 2319 | * |
| 2320 | * @hide |
| 2321 | */ |
| 2322 | @SystemApi |
| 2323 | public static final String EXTRA_REQUEST_PERMISSIONS_NAMES = |
| 2324 | "android.content.pm.extra.REQUEST_PERMISSIONS_NAMES"; |
| 2325 | |
| 2326 | /** |
| 2327 | * The results from the permissions request. |
| 2328 | * <p> |
| 2329 | * <strong>Type:</strong> int[] of #PermissionResult |
| 2330 | * </p> |
| 2331 | * |
| 2332 | * @hide |
| 2333 | */ |
| 2334 | @SystemApi |
| 2335 | public static final String EXTRA_REQUEST_PERMISSIONS_RESULTS |
| 2336 | = "android.content.pm.extra.REQUEST_PERMISSIONS_RESULTS"; |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2337 | |
| 2338 | /** |
Jeff Sharkey | bb58067 | 2014-07-10 12:10:25 -0700 | [diff] [blame] | 2339 | * String extra for {@link PackageInstallObserver} in the 'extras' Bundle in case of |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2340 | * {@link #INSTALL_FAILED_DUPLICATE_PERMISSION}. This extra names the package which provides |
| 2341 | * the existing definition for the permission. |
| 2342 | * @hide |
| 2343 | */ |
| 2344 | public static final String EXTRA_FAILURE_EXISTING_PACKAGE |
| 2345 | = "android.content.pm.extra.FAILURE_EXISTING_PACKAGE"; |
| 2346 | |
| 2347 | /** |
Jeff Sharkey | bb58067 | 2014-07-10 12:10:25 -0700 | [diff] [blame] | 2348 | * String extra for {@link PackageInstallObserver} in the 'extras' Bundle in case of |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2349 | * {@link #INSTALL_FAILED_DUPLICATE_PERMISSION}. This extra names the permission that is |
| 2350 | * being redundantly defined by the package being installed. |
| 2351 | * @hide |
| 2352 | */ |
| 2353 | public static final String EXTRA_FAILURE_EXISTING_PERMISSION |
| 2354 | = "android.content.pm.extra.FAILURE_EXISTING_PERMISSION"; |
| 2355 | |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2356 | /** |
| 2357 | * Permission flag: The permission is set in its current state |
| 2358 | * by the user and apps can still request it at runtime. |
| 2359 | * |
| 2360 | * @hide |
| 2361 | */ |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2362 | public static final int FLAG_PERMISSION_USER_SET = 1 << 0; |
| 2363 | |
| 2364 | /** |
| 2365 | * Permission flag: The permission is set in its current state |
| 2366 | * by the user and it is fixed, i.e. apps can no longer request |
| 2367 | * this permission. |
| 2368 | * |
| 2369 | * @hide |
| 2370 | */ |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2371 | public static final int FLAG_PERMISSION_USER_FIXED = 1 << 1; |
| 2372 | |
| 2373 | /** |
| 2374 | * Permission flag: The permission is set in its current state |
| 2375 | * by device policy and neither apps nor the user can change |
| 2376 | * its state. |
| 2377 | * |
| 2378 | * @hide |
| 2379 | */ |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2380 | public static final int FLAG_PERMISSION_POLICY_FIXED = 1 << 2; |
| 2381 | |
| 2382 | /** |
| 2383 | * Permission flag: The permission is set in a granted state but |
| 2384 | * access to resources it guards is restricted by other means to |
| 2385 | * enable revoking a permission on legacy apps that do not support |
| 2386 | * runtime permissions. If this permission is upgraded to runtime |
| 2387 | * because the app was updated to support runtime permissions, the |
| 2388 | * the permission will be revoked in the upgrade process. |
| 2389 | * |
| 2390 | * @hide |
| 2391 | */ |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2392 | public static final int FLAG_PERMISSION_REVOKE_ON_UPGRADE = 1 << 3; |
| 2393 | |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 2394 | /** |
| 2395 | * Permission flag: The permission is set in its current state |
| 2396 | * because the app is a component that is a part of the system. |
| 2397 | * |
| 2398 | * @hide |
| 2399 | */ |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 2400 | public static final int FLAG_PERMISSION_SYSTEM_FIXED = 1 << 4; |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2401 | |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 2402 | /** |
| 2403 | * Permission flag: The permission is granted by default because it |
| 2404 | * enables app functionality that is expected to work out-of-the-box |
| 2405 | * for providing a smooth user experience. For example, the phone app |
| 2406 | * is expected to have the phone permission. |
| 2407 | * |
| 2408 | * @hide |
| 2409 | */ |
| 2410 | public static final int FLAG_PERMISSION_GRANTED_BY_DEFAULT = 1 << 5; |
| 2411 | |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2412 | /** |
Svet Ganov | 9c165d7 | 2015-12-01 19:52:26 -0800 | [diff] [blame] | 2413 | * Permission flag: The permission has to be reviewed before any of |
| 2414 | * the app components can run. |
| 2415 | * |
| 2416 | * @hide |
| 2417 | */ |
| 2418 | public static final int FLAG_PERMISSION_REVIEW_REQUIRED = 1 << 6; |
| 2419 | |
| 2420 | /** |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2421 | * Mask for all permission flags. |
| 2422 | * |
| 2423 | * @hide |
| 2424 | */ |
| 2425 | @SystemApi |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 2426 | public static final int MASK_PERMISSION_FLAGS = 0xFF; |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2427 | |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2428 | /** |
Svet Ganov | d7b1f411 | 2016-02-09 18:49:23 -0800 | [diff] [blame] | 2429 | * This is a library that contains components apps can invoke. For |
| 2430 | * example, a services for apps to bind to, or standard chooser UI, |
| 2431 | * etc. This library is versioned and backwards compatible. Clients |
| 2432 | * should check its version via {@link android.ext.services.Version |
| 2433 | * #getVersionCode()} and avoid calling APIs added in later versions. |
| 2434 | * |
| 2435 | * @hide |
| 2436 | */ |
| 2437 | public static final String SYSTEM_SHARED_LIBRARY_SERVICES = "android.ext.services"; |
| 2438 | |
| 2439 | /** |
| 2440 | * This is a library that contains components apps can dynamically |
| 2441 | * load. For example, new widgets, helper classes, etc. This library |
| 2442 | * is versioned and backwards compatible. Clients should check its |
| 2443 | * version via {@link android.ext.shared.Version#getVersionCode()} |
| 2444 | * and avoid calling APIs added in later versions. |
| 2445 | * |
| 2446 | * @hide |
| 2447 | */ |
| 2448 | public static final String SYSTEM_SHARED_LIBRARY_SHARED = "android.ext.shared"; |
| 2449 | |
| 2450 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2451 | * Retrieve overall information about an application package that is |
| 2452 | * installed on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2453 | * |
| 2454 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2455 | * desired package. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2456 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2457 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 2458 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 2459 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 2460 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 2461 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 2462 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 2463 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 2464 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2465 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2466 | * to modify the data returned. |
| 2467 | * |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2468 | * @return A PackageInfo object containing information about the |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2469 | * package. If flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if the |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 2470 | * package is not found in the list of installed applications, the |
| 2471 | * package information is retrieved from the list of uninstalled |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2472 | * applications (which includes installed applications as well as |
| 2473 | * applications with data directory i.e. applications which had been |
| 2474 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2475 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2476 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2477 | * @see #GET_ACTIVITIES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2478 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2479 | * @see #GET_GIDS |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2480 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2481 | * @see #GET_INTENT_FILTERS |
| 2482 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2483 | * @see #GET_PERMISSIONS |
| 2484 | * @see #GET_PROVIDERS |
| 2485 | * @see #GET_RECEIVERS |
| 2486 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2487 | * @see #GET_SHARED_LIBRARY_FILES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2488 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2489 | * @see #GET_URI_PERMISSION_PATTERNS |
| 2490 | * @see #MATCH_DISABLED_COMPONENTS |
| 2491 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 2492 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2493 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2494 | public abstract PackageInfo getPackageInfo(String packageName, @PackageInfoFlags int flags) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2495 | throws NameNotFoundException; |
| 2496 | |
| 2497 | /** |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2498 | * @hide |
| 2499 | * Retrieve overall information about an application package that is |
| 2500 | * installed on the system. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2501 | * |
| 2502 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2503 | * desired package. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2504 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2505 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 2506 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 2507 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 2508 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 2509 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 2510 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 2511 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 2512 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2513 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2514 | * to modify the data returned. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2515 | * @param userId The user id. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2516 | * |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2517 | * @return A PackageInfo object containing information about the |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2518 | * package. If flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if the |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2519 | * package is not found in the list of installed applications, the |
| 2520 | * package information is retrieved from the list of uninstalled |
| 2521 | * applications (which includes installed applications as well as |
| 2522 | * applications with data directory i.e. applications which had been |
| 2523 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2524 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2525 | * found on the system. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2526 | * @see #GET_ACTIVITIES |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2527 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2528 | * @see #GET_GIDS |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2529 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2530 | * @see #GET_INTENT_FILTERS |
| 2531 | * @see #GET_META_DATA |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2532 | * @see #GET_PERMISSIONS |
| 2533 | * @see #GET_PROVIDERS |
| 2534 | * @see #GET_RECEIVERS |
| 2535 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2536 | * @see #GET_SHARED_LIBRARY_FILES |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2537 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2538 | * @see #GET_URI_PERMISSION_PATTERNS |
| 2539 | * @see #MATCH_DISABLED_COMPONENTS |
| 2540 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 2541 | * @see #MATCH_UNINSTALLED_PACKAGES |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2542 | */ |
| 2543 | @RequiresPermission(Manifest.permission.INTERACT_ACROSS_USERS) |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2544 | public abstract PackageInfo getPackageInfoAsUser(String packageName, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2545 | @PackageInfoFlags int flags, @UserIdInt int userId) throws NameNotFoundException; |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2546 | |
| 2547 | /** |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 2548 | * Map from the current package names in use on the device to whatever |
| 2549 | * the current canonical name of that package is. |
| 2550 | * @param names Array of current names to be mapped. |
| 2551 | * @return Returns an array of the same size as the original, containing |
| 2552 | * the canonical name for each package. |
| 2553 | */ |
| 2554 | public abstract String[] currentToCanonicalPackageNames(String[] names); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2555 | |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 2556 | /** |
| 2557 | * Map from a packages canonical name to the current name in use on the device. |
| 2558 | * @param names Array of new names to be mapped. |
| 2559 | * @return Returns an array of the same size as the original, containing |
| 2560 | * the current name for each package. |
| 2561 | */ |
| 2562 | public abstract String[] canonicalToCurrentPackageNames(String[] names); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2563 | |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 2564 | /** |
Andrew Solovay | 5ae1335 | 2014-06-06 12:23:09 -0700 | [diff] [blame] | 2565 | * Returns a "good" intent to launch a front-door activity in a package. |
| 2566 | * This is used, for example, to implement an "open" button when browsing |
| 2567 | * through packages. The current implementation looks first for a main |
| 2568 | * activity in the category {@link Intent#CATEGORY_INFO}, and next for a |
| 2569 | * main activity in the category {@link Intent#CATEGORY_LAUNCHER}. Returns |
| 2570 | * <code>null</code> if neither are found. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2571 | * |
| 2572 | * @param packageName The name of the package to inspect. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2573 | * |
Andrew Solovay | 5ae1335 | 2014-06-06 12:23:09 -0700 | [diff] [blame] | 2574 | * @return A fully-qualified {@link Intent} that can be used to launch the |
| 2575 | * main activity in the package. Returns <code>null</code> if the package |
| 2576 | * does not contain such an activity, or if <em>packageName</em> is not |
Ihab Awad | 1ec6888 | 2014-09-12 11:09:01 -0700 | [diff] [blame] | 2577 | * recognized. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2578 | */ |
Mihai Preda | eae850c | 2009-05-13 10:13:48 +0200 | [diff] [blame] | 2579 | public abstract Intent getLaunchIntentForPackage(String packageName); |
| 2580 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2581 | /** |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 2582 | * Return a "good" intent to launch a front-door Leanback activity in a |
| 2583 | * package, for use for example to implement an "open" button when browsing |
| 2584 | * through packages. The current implementation will look for a main |
| 2585 | * activity in the category {@link Intent#CATEGORY_LEANBACK_LAUNCHER}, or |
| 2586 | * return null if no main leanback activities are found. |
Adam Connors | 551c078 | 2014-06-05 12:13:03 +0100 | [diff] [blame] | 2587 | * |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 2588 | * @param packageName The name of the package to inspect. |
| 2589 | * @return Returns either a fully-qualified Intent that can be used to launch |
| 2590 | * the main Leanback activity in the package, or null if the package |
| 2591 | * does not contain such an activity. |
| 2592 | */ |
| 2593 | public abstract Intent getLeanbackLaunchIntentForPackage(String packageName); |
| 2594 | |
| 2595 | /** |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 2596 | * Return an array of all of the POSIX secondary group IDs that have been |
| 2597 | * assigned to the given package. |
| 2598 | * <p> |
| 2599 | * Note that the same package may have different GIDs under different |
| 2600 | * {@link UserHandle} on the same device. |
Adam Connors | 551c078 | 2014-06-05 12:13:03 +0100 | [diff] [blame] | 2601 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2602 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 2603 | * desired package. |
| 2604 | * @return Returns an int array of the assigned GIDs, or null if there are |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 2605 | * none. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2606 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2607 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2608 | */ |
| 2609 | public abstract int[] getPackageGids(String packageName) |
| 2610 | throws NameNotFoundException; |
| 2611 | |
| 2612 | /** |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 2613 | * Return an array of all of the POSIX secondary group IDs that have been |
| 2614 | * assigned to the given package. |
| 2615 | * <p> |
| 2616 | * Note that the same package may have different GIDs under different |
| 2617 | * {@link UserHandle} on the same device. |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 2618 | * |
| 2619 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2620 | * desired package. |
| 2621 | * @return Returns an int array of the assigned gids, or null if there are |
| 2622 | * none. |
| 2623 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2624 | * found on the system. |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 2625 | */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2626 | public abstract int[] getPackageGids(String packageName, @PackageInfoFlags int flags) |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 2627 | throws NameNotFoundException; |
| 2628 | |
| 2629 | /** |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2630 | * Return the UID associated with the given package name. |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 2631 | * <p> |
| 2632 | * Note that the same package will have different UIDs under different |
| 2633 | * {@link UserHandle} on the same device. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2634 | * |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2635 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
| 2636 | * desired package. |
| 2637 | * @return Returns an integer UID who owns the given package name. |
| 2638 | * @throws NameNotFoundException if a package with the given name can not be |
| 2639 | * found on the system. |
| 2640 | */ |
| 2641 | public abstract int getPackageUid(String packageName, @PackageInfoFlags int flags) |
| 2642 | throws NameNotFoundException; |
| 2643 | |
| 2644 | /** |
| 2645 | * Return the UID associated with the given package name. |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 2646 | * <p> |
| 2647 | * Note that the same package will have different UIDs under different |
| 2648 | * {@link UserHandle} on the same device. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2649 | * |
| 2650 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
| 2651 | * desired package. |
| 2652 | * @param userId The user handle identifier to look up the package under. |
| 2653 | * @return Returns an integer UID who owns the given package name. |
| 2654 | * @throws NameNotFoundException if a package with the given name can not be |
| 2655 | * found on the system. |
| 2656 | * @hide |
| 2657 | */ |
| 2658 | public abstract int getPackageUidAsUser(String packageName, @UserIdInt int userId) |
| 2659 | throws NameNotFoundException; |
| 2660 | |
| 2661 | /** |
| 2662 | * Return the UID associated with the given package name. |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 2663 | * <p> |
| 2664 | * Note that the same package will have different UIDs under different |
| 2665 | * {@link UserHandle} on the same device. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2666 | * |
| 2667 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
| 2668 | * desired package. |
| 2669 | * @param userId The user handle identifier to look up the package under. |
| 2670 | * @return Returns an integer UID who owns the given package name. |
| 2671 | * @throws NameNotFoundException if a package with the given name can not be |
| 2672 | * found on the system. |
| 2673 | * @hide |
| 2674 | */ |
| 2675 | public abstract int getPackageUidAsUser(String packageName, @PackageInfoFlags int flags, |
| 2676 | @UserIdInt int userId) throws NameNotFoundException; |
| 2677 | |
| 2678 | /** |
| 2679 | * Retrieve all of the information we know about a particular permission. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2680 | * |
| 2681 | * @param name The fully qualified name (i.e. com.google.permission.LOGIN) |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2682 | * of the permission you are interested in. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2683 | * @param flags Additional option flags. Use {@link #GET_META_DATA} to |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2684 | * retrieve any meta-data associated with the permission. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2685 | * |
| 2686 | * @return Returns a {@link PermissionInfo} containing information about the |
| 2687 | * permission. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2688 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2689 | * found on the system. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2690 | * |
| 2691 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2692 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2693 | public abstract PermissionInfo getPermissionInfo(String name, @PermissionInfoFlags int flags) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2694 | throws NameNotFoundException; |
| 2695 | |
| 2696 | /** |
| 2697 | * Query for all of the permissions associated with a particular group. |
| 2698 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2699 | * @param group The fully qualified name (i.e. com.google.permission.LOGIN) |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2700 | * of the permission group you are interested in. Use null to |
| 2701 | * find all of the permissions not associated with a group. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2702 | * @param flags Additional option flags. Use {@link #GET_META_DATA} to |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2703 | * retrieve any meta-data associated with the permissions. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2704 | * |
| 2705 | * @return Returns a list of {@link PermissionInfo} containing information |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2706 | * about all of the permissions in the given group. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2707 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2708 | * found on the system. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2709 | * |
| 2710 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2711 | */ |
| 2712 | public abstract List<PermissionInfo> queryPermissionsByGroup(String group, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2713 | @PermissionInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2714 | |
| 2715 | /** |
| 2716 | * Retrieve all of the information we know about a particular group of |
| 2717 | * permissions. |
| 2718 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2719 | * @param name The fully qualified name (i.e. com.google.permission_group.APPS) |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2720 | * of the permission you are interested in. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2721 | * @param flags Additional option flags. Use {@link #GET_META_DATA} to |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2722 | * retrieve any meta-data associated with the permission group. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2723 | * |
| 2724 | * @return Returns a {@link PermissionGroupInfo} containing information |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2725 | * about the permission. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2726 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2727 | * found on the system. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2728 | * |
| 2729 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2730 | */ |
| 2731 | public abstract PermissionGroupInfo getPermissionGroupInfo(String name, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2732 | @PermissionGroupInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2733 | |
| 2734 | /** |
| 2735 | * Retrieve all of the known permission groups in the system. |
| 2736 | * |
| 2737 | * @param flags Additional option flags. Use {@link #GET_META_DATA} to |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2738 | * retrieve any meta-data associated with the permission group. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2739 | * |
| 2740 | * @return Returns a list of {@link PermissionGroupInfo} containing |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2741 | * information about all of the known permission groups. |
| 2742 | * |
| 2743 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2744 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2745 | public abstract List<PermissionGroupInfo> getAllPermissionGroups( |
| 2746 | @PermissionGroupInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2747 | |
| 2748 | /** |
| 2749 | * Retrieve all of the information we know about a particular |
| 2750 | * package/application. |
| 2751 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2752 | * @param packageName The full name (i.e. com.google.apps.contacts) of an |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2753 | * application. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2754 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2755 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 2756 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2757 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2758 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2759 | * @return An {@link ApplicationInfo} containing information about the |
| 2760 | * package. If flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if the |
| 2761 | * package is not found in the list of installed applications, the |
| 2762 | * application information is retrieved from the list of uninstalled |
| 2763 | * applications (which includes installed applications as well as |
| 2764 | * applications with data directory i.e. applications which had been |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2765 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2766 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2767 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2768 | * |
| 2769 | * @see #GET_META_DATA |
| 2770 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2771 | * @see #MATCH_SYSTEM_ONLY |
| 2772 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2773 | */ |
| 2774 | public abstract ApplicationInfo getApplicationInfo(String packageName, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2775 | @ApplicationInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2776 | |
Jeff Sharkey | cd65448 | 2016-01-08 17:42:11 -0700 | [diff] [blame] | 2777 | /** {@hide} */ |
| 2778 | public abstract ApplicationInfo getApplicationInfoAsUser(String packageName, |
| 2779 | @ApplicationInfoFlags int flags, @UserIdInt int userId) throws NameNotFoundException; |
| 2780 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2781 | /** |
| 2782 | * Retrieve all of the information we know about a particular activity |
| 2783 | * class. |
| 2784 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2785 | * @param component The full component name (i.e. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2786 | * com.google.apps.contacts/com.google.apps.contacts. |
| 2787 | * ContactsList) of an Activity class. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2788 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2789 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 2790 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 2791 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 2792 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2793 | * {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 2794 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 2795 | * {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 2796 | * returned. |
| 2797 | * @return An {@link ActivityInfo} containing information about the |
| 2798 | * activity. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2799 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2800 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2801 | * @see #GET_META_DATA |
| 2802 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2803 | * @see #MATCH_ALL |
| 2804 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 2805 | * @see #MATCH_DEFAULT_ONLY |
| 2806 | * @see #MATCH_DISABLED_COMPONENTS |
| 2807 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2808 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 2809 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2810 | * @see #MATCH_SYSTEM_ONLY |
| 2811 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2812 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2813 | public abstract ActivityInfo getActivityInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2814 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2815 | |
| 2816 | /** |
| 2817 | * Retrieve all of the information we know about a particular receiver |
| 2818 | * class. |
| 2819 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2820 | * @param component The full component name (i.e. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2821 | * com.google.apps.calendar/com.google.apps.calendar. |
| 2822 | * CalendarAlarm) of a Receiver class. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2823 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2824 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 2825 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 2826 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 2827 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2828 | * {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 2829 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 2830 | * {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 2831 | * returned. |
| 2832 | * @return An {@link ActivityInfo} containing information about the |
| 2833 | * receiver. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2834 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2835 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2836 | * @see #GET_META_DATA |
| 2837 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2838 | * @see #MATCH_ALL |
| 2839 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 2840 | * @see #MATCH_DEFAULT_ONLY |
| 2841 | * @see #MATCH_DISABLED_COMPONENTS |
| 2842 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2843 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 2844 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2845 | * @see #MATCH_SYSTEM_ONLY |
| 2846 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2847 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2848 | public abstract ActivityInfo getReceiverInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2849 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2850 | |
| 2851 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2852 | * Retrieve all of the information we know about a particular service class. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2853 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2854 | * @param component The full component name (i.e. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2855 | * com.google.apps.media/com.google.apps.media. |
| 2856 | * BackgroundPlayback) of a Service class. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2857 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2858 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 2859 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 2860 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 2861 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2862 | * {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 2863 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 2864 | * {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 2865 | * returned. |
| 2866 | * @return A {@link ServiceInfo} object containing information about the |
| 2867 | * service. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2868 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2869 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2870 | * @see #GET_META_DATA |
| 2871 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2872 | * @see #MATCH_ALL |
| 2873 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 2874 | * @see #MATCH_DEFAULT_ONLY |
| 2875 | * @see #MATCH_DISABLED_COMPONENTS |
| 2876 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2877 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 2878 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2879 | * @see #MATCH_SYSTEM_ONLY |
| 2880 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2881 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2882 | public abstract ServiceInfo getServiceInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2883 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2884 | |
| 2885 | /** |
| 2886 | * Retrieve all of the information we know about a particular content |
| 2887 | * provider class. |
| 2888 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2889 | * @param component The full component name (i.e. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2890 | * com.google.providers.media/com.google.providers.media. |
| 2891 | * MediaProvider) of a ContentProvider class. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2892 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2893 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 2894 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 2895 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 2896 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2897 | * {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 2898 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 2899 | * {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 2900 | * returned. |
| 2901 | * @return A {@link ProviderInfo} object containing information about the |
| 2902 | * provider. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2903 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2904 | * found on the system. |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2905 | * @see #GET_META_DATA |
| 2906 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2907 | * @see #MATCH_ALL |
| 2908 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 2909 | * @see #MATCH_DEFAULT_ONLY |
| 2910 | * @see #MATCH_DISABLED_COMPONENTS |
| 2911 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2912 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 2913 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2914 | * @see #MATCH_SYSTEM_ONLY |
| 2915 | * @see #MATCH_UNINSTALLED_PACKAGES |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2916 | */ |
| 2917 | public abstract ProviderInfo getProviderInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2918 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2919 | |
| 2920 | /** |
| 2921 | * Return a List of all packages that are installed |
| 2922 | * on the device. |
| 2923 | * |
| 2924 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2925 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 2926 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 2927 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 2928 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 2929 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 2930 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 2931 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 2932 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2933 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2934 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2935 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2936 | * @return A List of PackageInfo objects, one for each installed package, |
| 2937 | * containing information about the package. In the unlikely case |
| 2938 | * there are no installed packages, an empty list is returned. If |
| 2939 | * flag {@code MATCH_UNINSTALLED_PACKAGES} is set, the package |
| 2940 | * information is retrieved from the list of uninstalled |
| 2941 | * applications (which includes installed applications as well as |
| 2942 | * applications with data directory i.e. applications which had been |
| 2943 | * deleted with {@code DONT_DELETE_DATA} flag set). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2944 | * |
| 2945 | * @see #GET_ACTIVITIES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2946 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2947 | * @see #GET_GIDS |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2948 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2949 | * @see #GET_INTENT_FILTERS |
| 2950 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2951 | * @see #GET_PERMISSIONS |
| 2952 | * @see #GET_PROVIDERS |
| 2953 | * @see #GET_RECEIVERS |
| 2954 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2955 | * @see #GET_SHARED_LIBRARY_FILES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2956 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2957 | * @see #GET_URI_PERMISSION_PATTERNS |
| 2958 | * @see #MATCH_DISABLED_COMPONENTS |
| 2959 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 2960 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2961 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2962 | public abstract List<PackageInfo> getInstalledPackages(@PackageInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2963 | |
| 2964 | /** |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 2965 | * Return a List of all installed packages that are currently |
| 2966 | * holding any of the given permissions. |
| 2967 | * |
| 2968 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2969 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 2970 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 2971 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 2972 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 2973 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 2974 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 2975 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 2976 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2977 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2978 | * to modify the data returned. |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 2979 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2980 | * @return A List of PackageInfo objects, one for each installed package |
| 2981 | * that holds any of the permissions that were provided, containing |
| 2982 | * information about the package. If no installed packages hold any |
| 2983 | * of the permissions, an empty list is returned. If flag |
| 2984 | * {@code MATCH_UNINSTALLED_PACKAGES} is set, the package information |
| 2985 | * is retrieved from the list of uninstalled applications (which |
| 2986 | * includes installed applications as well as applications with data |
| 2987 | * directory i.e. applications which had been deleted with |
| 2988 | * {@code DONT_DELETE_DATA} flag set). |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 2989 | * |
| 2990 | * @see #GET_ACTIVITIES |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 2991 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2992 | * @see #GET_GIDS |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 2993 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2994 | * @see #GET_INTENT_FILTERS |
| 2995 | * @see #GET_META_DATA |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 2996 | * @see #GET_PERMISSIONS |
| 2997 | * @see #GET_PROVIDERS |
| 2998 | * @see #GET_RECEIVERS |
| 2999 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3000 | * @see #GET_SHARED_LIBRARY_FILES |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3001 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3002 | * @see #GET_URI_PERMISSION_PATTERNS |
| 3003 | * @see #MATCH_DISABLED_COMPONENTS |
| 3004 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3005 | * @see #MATCH_UNINSTALLED_PACKAGES |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3006 | */ |
| 3007 | public abstract List<PackageInfo> getPackagesHoldingPermissions( |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3008 | String[] permissions, @PackageInfoFlags int flags); |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3009 | |
| 3010 | /** |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3011 | * Return a List of all packages that are installed on the device, for a specific user. |
| 3012 | * Requesting a list of installed packages for another user |
| 3013 | * will require the permission INTERACT_ACROSS_USERS_FULL. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3014 | * |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3015 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3016 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 3017 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 3018 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 3019 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 3020 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 3021 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 3022 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 3023 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3024 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3025 | * to modify the data returned. |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3026 | * @param userId The user for whom the installed packages are to be listed |
| 3027 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3028 | * @return A List of PackageInfo objects, one for each installed package, |
| 3029 | * containing information about the package. In the unlikely case |
| 3030 | * there are no installed packages, an empty list is returned. If |
| 3031 | * flag {@code MATCH_UNINSTALLED_PACKAGES} is set, the package |
| 3032 | * information is retrieved from the list of uninstalled |
| 3033 | * applications (which includes installed applications as well as |
| 3034 | * applications with data directory i.e. applications which had been |
| 3035 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3036 | * |
| 3037 | * @see #GET_ACTIVITIES |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3038 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3039 | * @see #GET_GIDS |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3040 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3041 | * @see #GET_INTENT_FILTERS |
| 3042 | * @see #GET_META_DATA |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3043 | * @see #GET_PERMISSIONS |
| 3044 | * @see #GET_PROVIDERS |
| 3045 | * @see #GET_RECEIVERS |
| 3046 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3047 | * @see #GET_SHARED_LIBRARY_FILES |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3048 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3049 | * @see #GET_URI_PERMISSION_PATTERNS |
| 3050 | * @see #MATCH_DISABLED_COMPONENTS |
| 3051 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3052 | * @see #MATCH_UNINSTALLED_PACKAGES |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3053 | * |
| 3054 | * @hide |
| 3055 | */ |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 3056 | public abstract List<PackageInfo> getInstalledPackagesAsUser(@PackageInfoFlags int flags, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3057 | @UserIdInt int userId); |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3058 | |
| 3059 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3060 | * Check whether a particular package has been granted a particular |
| 3061 | * permission. |
| 3062 | * |
Svet Ganov | ad3b297 | 2015-07-07 22:49:17 -0700 | [diff] [blame] | 3063 | * @param permName The name of the permission you are checking for. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3064 | * @param pkgName The name of the package you are checking against. |
| 3065 | * |
| 3066 | * @return If the package has the permission, PERMISSION_GRANTED is |
| 3067 | * returned. If it does not have the permission, PERMISSION_DENIED |
| 3068 | * is returned. |
| 3069 | * |
| 3070 | * @see #PERMISSION_GRANTED |
| 3071 | * @see #PERMISSION_DENIED |
| 3072 | */ |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 3073 | @CheckResult |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3074 | public abstract int checkPermission(String permName, String pkgName); |
| 3075 | |
| 3076 | /** |
Svet Ganov | ad3b297 | 2015-07-07 22:49:17 -0700 | [diff] [blame] | 3077 | * Checks whether a particular permissions has been revoked for a |
| 3078 | * package by policy. Typically the device owner or the profile owner |
| 3079 | * may apply such a policy. The user cannot grant policy revoked |
| 3080 | * permissions, hence the only way for an app to get such a permission |
| 3081 | * is by a policy change. |
| 3082 | * |
| 3083 | * @param permName The name of the permission you are checking for. |
| 3084 | * @param pkgName The name of the package you are checking against. |
| 3085 | * |
| 3086 | * @return Whether the permission is restricted by policy. |
| 3087 | */ |
| 3088 | @CheckResult |
Svet Ganov | f1b7f20 | 2015-07-29 08:33:42 -0700 | [diff] [blame] | 3089 | public abstract boolean isPermissionRevokedByPolicy(@NonNull String permName, |
| 3090 | @NonNull String pkgName); |
| 3091 | |
| 3092 | /** |
| 3093 | * Gets the package name of the component controlling runtime permissions. |
| 3094 | * |
| 3095 | * @return The package name. |
| 3096 | * |
| 3097 | * @hide |
| 3098 | */ |
| 3099 | public abstract String getPermissionControllerPackageName(); |
Svet Ganov | ad3b297 | 2015-07-07 22:49:17 -0700 | [diff] [blame] | 3100 | |
| 3101 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3102 | * Add a new dynamic permission to the system. For this to work, your |
| 3103 | * package must have defined a permission tree through the |
| 3104 | * {@link android.R.styleable#AndroidManifestPermissionTree |
| 3105 | * <permission-tree>} tag in its manifest. A package can only add |
| 3106 | * permissions to trees that were defined by either its own package or |
| 3107 | * another with the same user id; a permission is in a tree if it |
| 3108 | * matches the name of the permission tree + ".": for example, |
| 3109 | * "com.foo.bar" is a member of the permission tree "com.foo". |
| 3110 | * |
| 3111 | * <p>It is good to make your permission tree name descriptive, because you |
| 3112 | * are taking possession of that entire set of permission names. Thus, it |
| 3113 | * must be under a domain you control, with a suffix that will not match |
| 3114 | * any normal permissions that may be declared in any applications that |
| 3115 | * are part of that domain. |
| 3116 | * |
| 3117 | * <p>New permissions must be added before |
| 3118 | * any .apks are installed that use those permissions. Permissions you |
| 3119 | * add through this method are remembered across reboots of the device. |
| 3120 | * If the given permission already exists, the info you supply here |
| 3121 | * will be used to update it. |
| 3122 | * |
| 3123 | * @param info Description of the permission to be added. |
| 3124 | * |
| 3125 | * @return Returns true if a new permission was created, false if an |
| 3126 | * existing one was updated. |
| 3127 | * |
| 3128 | * @throws SecurityException if you are not allowed to add the |
| 3129 | * given permission name. |
| 3130 | * |
| 3131 | * @see #removePermission(String) |
| 3132 | */ |
| 3133 | public abstract boolean addPermission(PermissionInfo info); |
| 3134 | |
| 3135 | /** |
Dianne Hackborn | d7c0968 | 2010-03-30 10:42:20 -0700 | [diff] [blame] | 3136 | * Like {@link #addPermission(PermissionInfo)} but asynchronously |
| 3137 | * persists the package manager state after returning from the call, |
| 3138 | * allowing it to return quicker and batch a series of adds at the |
| 3139 | * expense of no guarantee the added permission will be retained if |
| 3140 | * the device is rebooted before it is written. |
| 3141 | */ |
| 3142 | public abstract boolean addPermissionAsync(PermissionInfo info); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3143 | |
Dianne Hackborn | d7c0968 | 2010-03-30 10:42:20 -0700 | [diff] [blame] | 3144 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3145 | * Removes a permission that was previously added with |
| 3146 | * {@link #addPermission(PermissionInfo)}. The same ownership rules apply |
| 3147 | * -- you are only allowed to remove permissions that you are allowed |
| 3148 | * to add. |
| 3149 | * |
| 3150 | * @param name The name of the permission to remove. |
| 3151 | * |
| 3152 | * @throws SecurityException if you are not allowed to remove the |
| 3153 | * given permission name. |
| 3154 | * |
| 3155 | * @see #addPermission(PermissionInfo) |
| 3156 | */ |
| 3157 | public abstract void removePermission(String name); |
| 3158 | |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3159 | |
| 3160 | /** |
| 3161 | * Permission flags set when granting or revoking a permission. |
| 3162 | * |
| 3163 | * @hide |
| 3164 | */ |
| 3165 | @SystemApi |
| 3166 | @IntDef({FLAG_PERMISSION_USER_SET, |
| 3167 | FLAG_PERMISSION_USER_FIXED, |
| 3168 | FLAG_PERMISSION_POLICY_FIXED, |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 3169 | FLAG_PERMISSION_REVOKE_ON_UPGRADE, |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 3170 | FLAG_PERMISSION_SYSTEM_FIXED, |
| 3171 | FLAG_PERMISSION_GRANTED_BY_DEFAULT}) |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3172 | @Retention(RetentionPolicy.SOURCE) |
| 3173 | public @interface PermissionFlags {} |
| 3174 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3175 | /** |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3176 | * Grant a runtime permission to an application which the application does not |
| 3177 | * already have. The permission must have been requested by the application. |
| 3178 | * If the application is not allowed to hold the permission, a {@link |
| 3179 | * java.lang.SecurityException} is thrown. |
| 3180 | * <p> |
| 3181 | * <strong>Note: </strong>Using this API requires holding |
| 3182 | * android.permission.GRANT_REVOKE_PERMISSIONS and if the user id is |
| 3183 | * not the current user android.permission.INTERACT_ACROSS_USERS_FULL. |
| 3184 | * </p> |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3185 | * |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3186 | * @param packageName The package to which to grant the permission. |
| 3187 | * @param permissionName The permission name to grant. |
| 3188 | * @param user The user for which to grant the permission. |
| 3189 | * |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3190 | * @see #revokeRuntimePermission(String, String, android.os.UserHandle) |
| 3191 | * @see android.content.pm.PackageManager.PermissionFlags |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3192 | * |
| 3193 | * @hide |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3194 | */ |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3195 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3196 | public abstract void grantRuntimePermission(@NonNull String packageName, |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3197 | @NonNull String permissionName, @NonNull UserHandle user); |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3198 | |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3199 | /** |
| 3200 | * Revoke a runtime permission that was previously granted by {@link |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3201 | * #grantRuntimePermission(String, String, android.os.UserHandle)}. The |
| 3202 | * permission must have been requested by and granted to the application. |
| 3203 | * If the application is not allowed to hold the permission, a {@link |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3204 | * java.lang.SecurityException} is thrown. |
| 3205 | * <p> |
| 3206 | * <strong>Note: </strong>Using this API requires holding |
| 3207 | * android.permission.GRANT_REVOKE_PERMISSIONS and if the user id is |
| 3208 | * not the current user android.permission.INTERACT_ACROSS_USERS_FULL. |
| 3209 | * </p> |
| 3210 | * |
| 3211 | * @param packageName The package from which to revoke the permission. |
| 3212 | * @param permissionName The permission name to revoke. |
| 3213 | * @param user The user for which to revoke the permission. |
| 3214 | * |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3215 | * @see #grantRuntimePermission(String, String, android.os.UserHandle) |
| 3216 | * @see android.content.pm.PackageManager.PermissionFlags |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3217 | * |
| 3218 | * @hide |
| 3219 | */ |
| 3220 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3221 | public abstract void revokeRuntimePermission(@NonNull String packageName, |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3222 | @NonNull String permissionName, @NonNull UserHandle user); |
| 3223 | |
| 3224 | /** |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3225 | * Gets the state flags associated with a permission. |
| 3226 | * |
| 3227 | * @param permissionName The permission for which to get the flags. |
| 3228 | * @param packageName The package name for which to get the flags. |
| 3229 | * @param user The user for which to get permission flags. |
| 3230 | * @return The permission flags. |
| 3231 | * |
| 3232 | * @hide |
| 3233 | */ |
| 3234 | @SystemApi |
| 3235 | public abstract @PermissionFlags int getPermissionFlags(String permissionName, |
| 3236 | String packageName, @NonNull UserHandle user); |
| 3237 | |
| 3238 | /** |
| 3239 | * Updates the flags associated with a permission by replacing the flags in |
| 3240 | * the specified mask with the provided flag values. |
| 3241 | * |
| 3242 | * @param permissionName The permission for which to update the flags. |
| 3243 | * @param packageName The package name for which to update the flags. |
| 3244 | * @param flagMask The flags which to replace. |
| 3245 | * @param flagValues The flags with which to replace. |
| 3246 | * @param user The user for which to update the permission flags. |
| 3247 | * |
| 3248 | * @hide |
| 3249 | */ |
| 3250 | @SystemApi |
| 3251 | public abstract void updatePermissionFlags(String permissionName, |
| 3252 | String packageName, @PermissionFlags int flagMask, int flagValues, |
| 3253 | @NonNull UserHandle user); |
| 3254 | |
| 3255 | /** |
Svetoslav | 20770dd | 2015-05-29 15:43:04 -0700 | [diff] [blame] | 3256 | * Gets whether you should show UI with rationale for requesting a permission. |
| 3257 | * You should do this only if you do not have the permission and the context in |
| 3258 | * which the permission is requested does not clearly communicate to the user |
| 3259 | * what would be the benefit from grating this permission. |
| 3260 | * |
| 3261 | * @param permission A permission your app wants to request. |
| 3262 | * @return Whether you can show permission rationale UI. |
| 3263 | * |
| 3264 | * @hide |
| 3265 | */ |
| 3266 | public abstract boolean shouldShowRequestPermissionRationale(String permission); |
| 3267 | |
| 3268 | /** |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3269 | * Returns an {@link android.content.Intent} suitable for passing to |
| 3270 | * {@link android.app.Activity#startActivityForResult(android.content.Intent, int)} |
| 3271 | * which prompts the user to grant permissions to this application. |
| 3272 | * |
| 3273 | * @throws NullPointerException if {@code permissions} is {@code null} or empty. |
| 3274 | * |
| 3275 | * @hide |
| 3276 | */ |
| 3277 | public Intent buildRequestPermissionsIntent(@NonNull String[] permissions) { |
| 3278 | if (ArrayUtils.isEmpty(permissions)) { |
Svet Ganov | f66381c | 2016-02-18 20:02:36 -0800 | [diff] [blame] | 3279 | throw new IllegalArgumentException("permission cannot be null or empty"); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3280 | } |
| 3281 | Intent intent = new Intent(ACTION_REQUEST_PERMISSIONS); |
| 3282 | intent.putExtra(EXTRA_REQUEST_PERMISSIONS_NAMES, permissions); |
Svet Ganov | f1b7f20 | 2015-07-29 08:33:42 -0700 | [diff] [blame] | 3283 | intent.setPackage(getPermissionControllerPackageName()); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3284 | return intent; |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3285 | } |
| 3286 | |
| 3287 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3288 | * Compare the signatures of two packages to determine if the same |
| 3289 | * signature appears in both of them. If they do contain the same |
| 3290 | * signature, then they are allowed special privileges when working |
| 3291 | * with each other: they can share the same user-id, run instrumentation |
| 3292 | * against each other, etc. |
| 3293 | * |
| 3294 | * @param pkg1 First package name whose signature will be compared. |
| 3295 | * @param pkg2 Second package name whose signature will be compared. |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 3296 | * |
| 3297 | * @return Returns an integer indicating whether all signatures on the |
| 3298 | * two packages match. The value is >= 0 ({@link #SIGNATURE_MATCH}) if |
| 3299 | * all signatures match or < 0 if there is not a match ({@link |
| 3300 | * #SIGNATURE_NO_MATCH} or {@link #SIGNATURE_UNKNOWN_PACKAGE}). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3301 | * |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3302 | * @see #checkSignatures(int, int) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3303 | * @see #SIGNATURE_MATCH |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3304 | * @see #SIGNATURE_NO_MATCH |
| 3305 | * @see #SIGNATURE_UNKNOWN_PACKAGE |
| 3306 | */ |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 3307 | @CheckResult |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3308 | public abstract int checkSignatures(String pkg1, String pkg2); |
| 3309 | |
| 3310 | /** |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3311 | * Like {@link #checkSignatures(String, String)}, but takes UIDs of |
| 3312 | * the two packages to be checked. This can be useful, for example, |
| 3313 | * when doing the check in an IPC, where the UID is the only identity |
| 3314 | * available. It is functionally identical to determining the package |
| 3315 | * associated with the UIDs and checking their signatures. |
| 3316 | * |
Joe Onorato | 25660ec | 2009-08-12 22:40:37 -0700 | [diff] [blame] | 3317 | * @param uid1 First UID whose signature will be compared. |
| 3318 | * @param uid2 Second UID whose signature will be compared. |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3319 | * |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 3320 | * @return Returns an integer indicating whether all signatures on the |
| 3321 | * two packages match. The value is >= 0 ({@link #SIGNATURE_MATCH}) if |
| 3322 | * all signatures match or < 0 if there is not a match ({@link |
| 3323 | * #SIGNATURE_NO_MATCH} or {@link #SIGNATURE_UNKNOWN_PACKAGE}). |
| 3324 | * |
| 3325 | * @see #checkSignatures(String, String) |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3326 | * @see #SIGNATURE_MATCH |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3327 | * @see #SIGNATURE_NO_MATCH |
| 3328 | * @see #SIGNATURE_UNKNOWN_PACKAGE |
| 3329 | */ |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 3330 | @CheckResult |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3331 | public abstract int checkSignatures(int uid1, int uid2); |
| 3332 | |
| 3333 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3334 | * Retrieve the names of all packages that are associated with a particular |
| 3335 | * user id. In most cases, this will be a single package name, the package |
| 3336 | * that has been assigned that user id. Where there are multiple packages |
| 3337 | * sharing the same user id through the "sharedUserId" mechanism, all |
| 3338 | * packages with that id will be returned. |
| 3339 | * |
| 3340 | * @param uid The user id for which you would like to retrieve the |
| 3341 | * associated packages. |
| 3342 | * |
| 3343 | * @return Returns an array of one or more packages assigned to the user |
| 3344 | * id, or null if there are no known packages with the given id. |
| 3345 | */ |
Jeff Sharkey | 377ded0f | 2016-01-10 13:15:41 -0700 | [diff] [blame] | 3346 | public abstract @Nullable String[] getPackagesForUid(int uid); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3347 | |
| 3348 | /** |
| 3349 | * Retrieve the official name associated with a user id. This name is |
Jonathan Basseri | 7ea3a33 | 2015-05-12 19:39:22 -0700 | [diff] [blame] | 3350 | * guaranteed to never change, though it is possible for the underlying |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3351 | * user id to be changed. That is, if you are storing information about |
| 3352 | * user ids in persistent storage, you should use the string returned |
| 3353 | * by this function instead of the raw user-id. |
| 3354 | * |
| 3355 | * @param uid The user id for which you would like to retrieve a name. |
| 3356 | * @return Returns a unique name for the given user id, or null if the |
| 3357 | * user id is not currently assigned. |
| 3358 | */ |
Jeff Sharkey | 377ded0f | 2016-01-10 13:15:41 -0700 | [diff] [blame] | 3359 | public abstract @Nullable String getNameForUid(int uid); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3360 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3361 | /** |
| 3362 | * Return the user id associated with a shared user name. Multiple |
| 3363 | * applications can specify a shared user name in their manifest and thus |
| 3364 | * end up using a common uid. This might be used for new applications |
| 3365 | * that use an existing shared user name and need to know the uid of the |
| 3366 | * shared user. |
| 3367 | * |
| 3368 | * @param sharedUserName The shared user name whose uid is to be retrieved. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3369 | * @return Returns the UID associated with the shared user. |
| 3370 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3371 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3372 | * @hide |
| 3373 | */ |
| 3374 | public abstract int getUidForSharedUser(String sharedUserName) |
| 3375 | throws NameNotFoundException; |
| 3376 | |
| 3377 | /** |
| 3378 | * Return a List of all application packages that are installed on the |
| 3379 | * device. If flag GET_UNINSTALLED_PACKAGES has been set, a list of all |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 3380 | * applications including those deleted with {@code DONT_DELETE_DATA} (partially |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3381 | * installed apps with data directory) will be returned. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3382 | * |
| 3383 | * @param flags Additional option flags. Use any combination of |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3384 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3385 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3386 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3387 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3388 | * @return A List of ApplicationInfo objects, one for each installed application. |
| 3389 | * In the unlikely case there are no installed packages, an empty list |
| 3390 | * is returned. If flag {@code MATCH_UNINSTALLED_PACKAGES} is set, the |
| 3391 | * application information is retrieved from the list of uninstalled |
| 3392 | * applications (which includes installed applications as well as |
| 3393 | * applications with data directory i.e. applications which had been |
| 3394 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3395 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3396 | * @see #GET_META_DATA |
| 3397 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3398 | * @see #MATCH_SYSTEM_ONLY |
| 3399 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3400 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3401 | public abstract List<ApplicationInfo> getInstalledApplications(@ApplicationInfoFlags int flags); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3402 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3403 | /** |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3404 | * Gets the ephemeral applications the user recently used. Requires |
| 3405 | * holding "android.permission.ACCESS_EPHEMERAL_APPS". |
| 3406 | * |
| 3407 | * @return The ephemeral app list. |
| 3408 | * |
| 3409 | * @hide |
| 3410 | */ |
| 3411 | @RequiresPermission(Manifest.permission.ACCESS_EPHEMERAL_APPS) |
| 3412 | public abstract List<EphemeralApplicationInfo> getEphemeralApplications(); |
| 3413 | |
| 3414 | /** |
| 3415 | * Gets the icon for an ephemeral application. |
| 3416 | * |
| 3417 | * @param packageName The app package name. |
| 3418 | * |
| 3419 | * @hide |
| 3420 | */ |
| 3421 | public abstract Drawable getEphemeralApplicationIcon(String packageName); |
| 3422 | |
| 3423 | /** |
| 3424 | * Gets whether the caller is an ephemeral app. |
| 3425 | * |
| 3426 | * @return Whether caller is an ephemeral app. |
| 3427 | * |
| 3428 | * @see #setEphemeralCookie(byte[]) |
| 3429 | * @see #getEphemeralCookie() |
| 3430 | * @see #getEphemeralCookieMaxSizeBytes() |
Todd Kennedy | 1270513 | 2016-01-05 15:17:57 -0800 | [diff] [blame] | 3431 | * |
| 3432 | * @hide |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3433 | */ |
| 3434 | public abstract boolean isEphemeralApplication(); |
| 3435 | |
| 3436 | /** |
| 3437 | * Gets the maximum size in bytes of the cookie data an ephemeral app |
| 3438 | * can store on the device. |
| 3439 | * |
| 3440 | * @return The max cookie size in bytes. |
| 3441 | * |
| 3442 | * @see #isEphemeralApplication() |
| 3443 | * @see #setEphemeralCookie(byte[]) |
| 3444 | * @see #getEphemeralCookie() |
Todd Kennedy | 1270513 | 2016-01-05 15:17:57 -0800 | [diff] [blame] | 3445 | * |
| 3446 | * @hide |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3447 | */ |
| 3448 | public abstract int getEphemeralCookieMaxSizeBytes(); |
| 3449 | |
| 3450 | /** |
| 3451 | * Gets the ephemeral application cookie for this app. Non |
| 3452 | * ephemeral apps and apps that were ephemeral but were upgraded |
| 3453 | * to non-ephemeral can still access this API. For ephemeral apps |
| 3454 | * this cooke is cached for some time after uninstall while for |
| 3455 | * normal apps the cookie is deleted after the app is uninstalled. |
| 3456 | * The cookie is always present while the app is installed. |
| 3457 | * |
| 3458 | * @return The cookie. |
| 3459 | * |
| 3460 | * @see #isEphemeralApplication() |
| 3461 | * @see #setEphemeralCookie(byte[]) |
| 3462 | * @see #getEphemeralCookieMaxSizeBytes() |
Todd Kennedy | 1270513 | 2016-01-05 15:17:57 -0800 | [diff] [blame] | 3463 | * |
| 3464 | * @hide |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3465 | */ |
| 3466 | public abstract @NonNull byte[] getEphemeralCookie(); |
| 3467 | |
| 3468 | /** |
| 3469 | * Sets the ephemeral application cookie for the calling app. Non |
| 3470 | * ephemeral apps and apps that were ephemeral but were upgraded |
| 3471 | * to non-ephemeral can still access this API. For ephemeral apps |
| 3472 | * this cooke is cached for some time after uninstall while for |
| 3473 | * normal apps the cookie is deleted after the app is uninstalled. |
| 3474 | * The cookie is always present while the app is installed. The |
| 3475 | * cookie size is limited by {@link #getEphemeralCookieMaxSizeBytes()}. |
| 3476 | * |
| 3477 | * @param cookie The cookie data. |
| 3478 | * @return True if the cookie was set. |
| 3479 | * |
| 3480 | * @see #isEphemeralApplication() |
| 3481 | * @see #getEphemeralCookieMaxSizeBytes() |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 3482 | * @see #getEphemeralCookie() |
Todd Kennedy | 1270513 | 2016-01-05 15:17:57 -0800 | [diff] [blame] | 3483 | * |
| 3484 | * @hide |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3485 | */ |
| 3486 | public abstract boolean setEphemeralCookie(@NonNull byte[] cookie); |
| 3487 | |
| 3488 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3489 | * Get a list of shared libraries that are available on the |
| 3490 | * system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3491 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3492 | * @return An array of shared library names that are |
| 3493 | * available on the system, or null if none are installed. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3494 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3495 | */ |
| 3496 | public abstract String[] getSystemSharedLibraryNames(); |
| 3497 | |
| 3498 | /** |
Svet Ganov | d7b1f411 | 2016-02-09 18:49:23 -0800 | [diff] [blame] | 3499 | * Get the name of the package hosting the services shared library. |
| 3500 | * |
| 3501 | * @return The library host package. |
| 3502 | * |
| 3503 | * @hide |
| 3504 | */ |
| 3505 | public abstract @Nullable String getServicesSystemSharedLibraryPackageName(); |
| 3506 | |
| 3507 | /** |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 3508 | * Get a list of features that are available on the |
| 3509 | * system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3510 | * |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 3511 | * @return An array of FeatureInfo classes describing the features |
| 3512 | * that are available on the system, or null if there are none(!!). |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 3513 | */ |
| 3514 | public abstract FeatureInfo[] getSystemAvailableFeatures(); |
| 3515 | |
| 3516 | /** |
Jeff Sharkey | 115d2c1 | 2016-02-15 17:25:57 -0700 | [diff] [blame] | 3517 | * Check whether the given feature name is one of the available features as |
| 3518 | * returned by {@link #getSystemAvailableFeatures()}. This tests for the |
| 3519 | * presence of <em>any</em> version of the given feature name; use |
| 3520 | * {@link #hasSystemFeature(String, int)} to check for a minimum version. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3521 | * |
Jeff Sharkey | 115d2c1 | 2016-02-15 17:25:57 -0700 | [diff] [blame] | 3522 | * @return Returns true if the devices supports the feature, else false. |
Dianne Hackborn | 039c68e | 2009-09-26 16:39:23 -0700 | [diff] [blame] | 3523 | */ |
| 3524 | public abstract boolean hasSystemFeature(String name); |
| 3525 | |
| 3526 | /** |
Jeff Sharkey | 115d2c1 | 2016-02-15 17:25:57 -0700 | [diff] [blame] | 3527 | * Check whether the given feature name and version is one of the available |
| 3528 | * features as returned by {@link #getSystemAvailableFeatures()}. Since |
| 3529 | * features are defined to always be backwards compatible, this returns true |
| 3530 | * if the available feature version is greater than or equal to the |
| 3531 | * requested version. |
| 3532 | * |
| 3533 | * @return Returns true if the devices supports the feature, else false. |
| 3534 | */ |
| 3535 | public abstract boolean hasSystemFeature(String name, int version); |
| 3536 | |
| 3537 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3538 | * Determine the best action to perform for a given Intent. This is how |
| 3539 | * {@link Intent#resolveActivity} finds an activity if a class has not been |
| 3540 | * explicitly specified. |
| 3541 | * <p> |
| 3542 | * <em>Note:</em> if using an implicit Intent (without an explicit |
| 3543 | * ComponentName specified), be sure to consider whether to set the |
| 3544 | * {@link #MATCH_DEFAULT_ONLY} only flag. You need to do so to resolve the |
| 3545 | * activity in the same way that |
| 3546 | * {@link android.content.Context#startActivity(Intent)} and |
Dianne Hackborn | 4d023d21 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 3547 | * {@link android.content.Intent#resolveActivity(PackageManager) |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3548 | * Intent.resolveActivity(PackageManager)} do. |
| 3549 | * </p> |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3550 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3551 | * @param intent An intent containing all of the desired specification |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3552 | * (action, data, type, category, and/or component). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3553 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3554 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3555 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3556 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3557 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3558 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3559 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3560 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3561 | * returned. The most important is {@link #MATCH_DEFAULT_ONLY}, |
| 3562 | * to limit the resolution to only those activities that support |
| 3563 | * the {@link android.content.Intent#CATEGORY_DEFAULT}. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3564 | * @return Returns a ResolveInfo object containing the final activity intent |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3565 | * that was determined to be the best action. Returns null if no |
Mike LeBeau | bd3f527 | 2010-02-18 19:27:17 -0800 | [diff] [blame] | 3566 | * matching activity was found. If multiple matching activities are |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3567 | * found and there is no default set, returns a ResolveInfo object |
Mike LeBeau | bd3f527 | 2010-02-18 19:27:17 -0800 | [diff] [blame] | 3568 | * containing something else, such as the activity resolver. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3569 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3570 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3571 | * @see #GET_SHARED_LIBRARY_FILES |
| 3572 | * @see #MATCH_ALL |
| 3573 | * @see #MATCH_DISABLED_COMPONENTS |
| 3574 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3575 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3576 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3577 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3578 | * @see #MATCH_SYSTEM_ONLY |
| 3579 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3580 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3581 | public abstract ResolveInfo resolveActivity(Intent intent, @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3582 | |
| 3583 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3584 | * Determine the best action to perform for a given Intent for a given user. |
| 3585 | * This is how {@link Intent#resolveActivity} finds an activity if a class |
| 3586 | * has not been explicitly specified. |
| 3587 | * <p> |
| 3588 | * <em>Note:</em> if using an implicit Intent (without an explicit |
| 3589 | * ComponentName specified), be sure to consider whether to set the |
| 3590 | * {@link #MATCH_DEFAULT_ONLY} only flag. You need to do so to resolve the |
| 3591 | * activity in the same way that |
| 3592 | * {@link android.content.Context#startActivity(Intent)} and |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3593 | * {@link android.content.Intent#resolveActivity(PackageManager) |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3594 | * Intent.resolveActivity(PackageManager)} do. |
| 3595 | * </p> |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3596 | * |
| 3597 | * @param intent An intent containing all of the desired specification |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3598 | * (action, data, type, category, and/or component). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3599 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3600 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3601 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3602 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3603 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3604 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3605 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3606 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3607 | * returned. The most important is {@link #MATCH_DEFAULT_ONLY}, |
| 3608 | * to limit the resolution to only those activities that support |
| 3609 | * the {@link android.content.Intent#CATEGORY_DEFAULT}. |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3610 | * @param userId The user id. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3611 | * @return Returns a ResolveInfo object containing the final activity intent |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3612 | * that was determined to be the best action. Returns null if no |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3613 | * matching activity was found. If multiple matching activities are |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3614 | * found and there is no default set, returns a ResolveInfo object |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3615 | * containing something else, such as the activity resolver. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3616 | * @see #GET_META_DATA |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3617 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3618 | * @see #GET_SHARED_LIBRARY_FILES |
| 3619 | * @see #MATCH_ALL |
| 3620 | * @see #MATCH_DISABLED_COMPONENTS |
| 3621 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3622 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3623 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3624 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3625 | * @see #MATCH_SYSTEM_ONLY |
| 3626 | * @see #MATCH_UNINSTALLED_PACKAGES |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3627 | * @hide |
| 3628 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3629 | public abstract ResolveInfo resolveActivityAsUser(Intent intent, @ResolveInfoFlags int flags, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3630 | @UserIdInt int userId); |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3631 | |
| 3632 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3633 | * Retrieve all activities that can be performed for the given intent. |
| 3634 | * |
| 3635 | * @param intent The desired intent as per resolveActivity(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3636 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3637 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3638 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3639 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3640 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3641 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3642 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3643 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3644 | * returned. The most important is {@link #MATCH_DEFAULT_ONLY}, |
| 3645 | * to limit the resolution to only those activities that support |
| 3646 | * the {@link android.content.Intent#CATEGORY_DEFAULT}. Or, set |
| 3647 | * {@link #MATCH_ALL} to prevent any filtering of the results. |
| 3648 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3649 | * each matching activity, ordered from best to worst. In other |
| 3650 | * words, the first item is what would be returned by |
| 3651 | * {@link #resolveActivity}. If there are no matching activities, an |
| 3652 | * empty list is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3653 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3654 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3655 | * @see #GET_SHARED_LIBRARY_FILES |
| 3656 | * @see #MATCH_ALL |
| 3657 | * @see #MATCH_DISABLED_COMPONENTS |
| 3658 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3659 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3660 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3661 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3662 | * @see #MATCH_SYSTEM_ONLY |
| 3663 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3664 | */ |
| 3665 | public abstract List<ResolveInfo> queryIntentActivities(Intent intent, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3666 | @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3667 | |
| 3668 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3669 | * Retrieve all activities that can be performed for the given intent, for a |
| 3670 | * specific user. |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3671 | * |
| 3672 | * @param intent The desired intent as per resolveActivity(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3673 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3674 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3675 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3676 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3677 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3678 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3679 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3680 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3681 | * returned. The most important is {@link #MATCH_DEFAULT_ONLY}, |
| 3682 | * to limit the resolution to only those activities that support |
| 3683 | * the {@link android.content.Intent#CATEGORY_DEFAULT}. Or, set |
| 3684 | * {@link #MATCH_ALL} to prevent any filtering of the results. |
| 3685 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3686 | * each matching activity, ordered from best to worst. In other |
| 3687 | * words, the first item is what would be returned by |
| 3688 | * {@link #resolveActivity}. If there are no matching activities, an |
| 3689 | * empty list is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3690 | * @see #GET_META_DATA |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3691 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3692 | * @see #GET_SHARED_LIBRARY_FILES |
| 3693 | * @see #MATCH_ALL |
| 3694 | * @see #MATCH_DISABLED_COMPONENTS |
| 3695 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3696 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3697 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3698 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3699 | * @see #MATCH_SYSTEM_ONLY |
| 3700 | * @see #MATCH_UNINSTALLED_PACKAGES |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3701 | * @hide |
| 3702 | */ |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3703 | public abstract List<ResolveInfo> queryIntentActivitiesAsUser(Intent intent, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3704 | @ResolveInfoFlags int flags, @UserIdInt int userId); |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3705 | |
| 3706 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3707 | * Retrieve a set of activities that should be presented to the user as |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3708 | * similar options. This is like {@link #queryIntentActivities}, except it |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3709 | * also allows you to supply a list of more explicit Intents that you would |
| 3710 | * like to resolve to particular options, and takes care of returning the |
| 3711 | * final ResolveInfo list in a reasonable order, with no duplicates, based |
| 3712 | * on those inputs. |
| 3713 | * |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3714 | * @param caller The class name of the activity that is making the request. |
| 3715 | * This activity will never appear in the output list. Can be |
| 3716 | * null. |
| 3717 | * @param specifics An array of Intents that should be resolved to the first |
| 3718 | * specific results. Can be null. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3719 | * @param intent The desired intent as per resolveActivity(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3720 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3721 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3722 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3723 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3724 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3725 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3726 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3727 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3728 | * returned. The most important is {@link #MATCH_DEFAULT_ONLY}, |
| 3729 | * to limit the resolution to only those activities that support |
| 3730 | * the {@link android.content.Intent#CATEGORY_DEFAULT}. |
| 3731 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3732 | * each matching activity. The list is ordered first by all of the |
| 3733 | * intents resolved in <var>specifics</var> and then any additional |
| 3734 | * activities that can handle <var>intent</var> but did not get |
| 3735 | * included by one of the <var>specifics</var> intents. If there are |
| 3736 | * no matching activities, an empty list is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3737 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3738 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3739 | * @see #GET_SHARED_LIBRARY_FILES |
| 3740 | * @see #MATCH_ALL |
| 3741 | * @see #MATCH_DISABLED_COMPONENTS |
| 3742 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3743 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3744 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3745 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3746 | * @see #MATCH_SYSTEM_ONLY |
| 3747 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3748 | */ |
| 3749 | public abstract List<ResolveInfo> queryIntentActivityOptions( |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3750 | ComponentName caller, Intent[] specifics, Intent intent, @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3751 | |
| 3752 | /** |
| 3753 | * Retrieve all receivers that can handle a broadcast of the given intent. |
| 3754 | * |
| 3755 | * @param intent The desired intent as per resolveActivity(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3756 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3757 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3758 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3759 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3760 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3761 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3762 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3763 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3764 | * returned. |
| 3765 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3766 | * each matching receiver, ordered from best to worst. If there are |
| 3767 | * no matching receivers, an empty list or null is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3768 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3769 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3770 | * @see #GET_SHARED_LIBRARY_FILES |
| 3771 | * @see #MATCH_ALL |
| 3772 | * @see #MATCH_DISABLED_COMPONENTS |
| 3773 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3774 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3775 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3776 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3777 | * @see #MATCH_SYSTEM_ONLY |
| 3778 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3779 | */ |
| 3780 | public abstract List<ResolveInfo> queryBroadcastReceivers(Intent intent, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3781 | @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3782 | |
| 3783 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3784 | * Retrieve all receivers that can handle a broadcast of the given intent, |
| 3785 | * for a specific user. |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3786 | * |
| 3787 | * @param intent The desired intent as per resolveActivity(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3788 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3789 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3790 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3791 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3792 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3793 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3794 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3795 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3796 | * returned. |
Fyodor Kupolov | 940e857 | 2016-01-26 12:03:51 -0800 | [diff] [blame] | 3797 | * @param userHandle UserHandle of the user being queried. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3798 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3799 | * each matching receiver, ordered from best to worst. If there are |
| 3800 | * no matching receivers, an empty list or null is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3801 | * @see #GET_META_DATA |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3802 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3803 | * @see #GET_SHARED_LIBRARY_FILES |
| 3804 | * @see #MATCH_ALL |
| 3805 | * @see #MATCH_DISABLED_COMPONENTS |
| 3806 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3807 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3808 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3809 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3810 | * @see #MATCH_SYSTEM_ONLY |
| 3811 | * @see #MATCH_UNINSTALLED_PACKAGES |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3812 | * @hide |
| 3813 | */ |
Fyodor Kupolov | 940e857 | 2016-01-26 12:03:51 -0800 | [diff] [blame] | 3814 | @SystemApi |
| 3815 | public List<ResolveInfo> queryBroadcastReceiversAsUser(Intent intent, |
| 3816 | @ResolveInfoFlags int flags, UserHandle userHandle) { |
| 3817 | return queryBroadcastReceiversAsUser(intent, flags, userHandle.getIdentifier()); |
| 3818 | } |
| 3819 | |
| 3820 | /** |
| 3821 | * @hide |
| 3822 | */ |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 3823 | public abstract List<ResolveInfo> queryBroadcastReceiversAsUser(Intent intent, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3824 | @ResolveInfoFlags int flags, @UserIdInt int userId); |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3825 | |
Fyodor Kupolov | 940e857 | 2016-01-26 12:03:51 -0800 | [diff] [blame] | 3826 | |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 3827 | /** {@hide} */ |
| 3828 | @Deprecated |
| 3829 | public List<ResolveInfo> queryBroadcastReceivers(Intent intent, |
| 3830 | @ResolveInfoFlags int flags, @UserIdInt int userId) { |
| 3831 | Log.w(TAG, "STAHP USING HIDDEN APIS KTHX"); |
| 3832 | return queryBroadcastReceiversAsUser(intent, flags, userId); |
| 3833 | } |
| 3834 | |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3835 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3836 | * Determine the best service to handle for a given Intent. |
| 3837 | * |
| 3838 | * @param intent An intent containing all of the desired specification |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3839 | * (action, data, type, category, and/or component). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3840 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3841 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3842 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3843 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3844 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3845 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3846 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3847 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3848 | * returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3849 | * @return Returns a ResolveInfo object containing the final service intent |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3850 | * that was determined to be the best action. Returns null if no |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3851 | * matching service was found. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3852 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3853 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3854 | * @see #GET_SHARED_LIBRARY_FILES |
| 3855 | * @see #MATCH_ALL |
| 3856 | * @see #MATCH_DISABLED_COMPONENTS |
| 3857 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3858 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3859 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3860 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3861 | * @see #MATCH_SYSTEM_ONLY |
| 3862 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3863 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3864 | public abstract ResolveInfo resolveService(Intent intent, @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3865 | |
| 3866 | /** |
| 3867 | * Retrieve all services that can match the given intent. |
| 3868 | * |
| 3869 | * @param intent The desired intent as per resolveService(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3870 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3871 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3872 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3873 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3874 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3875 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3876 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3877 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3878 | * returned. |
| 3879 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3880 | * each matching service, ordered from best to worst. In other |
| 3881 | * words, the first item is what would be returned by |
| 3882 | * {@link #resolveService}. If there are no matching services, an |
| 3883 | * empty list or null is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3884 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3885 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3886 | * @see #GET_SHARED_LIBRARY_FILES |
| 3887 | * @see #MATCH_ALL |
| 3888 | * @see #MATCH_DISABLED_COMPONENTS |
| 3889 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3890 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3891 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3892 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3893 | * @see #MATCH_SYSTEM_ONLY |
| 3894 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3895 | */ |
| 3896 | public abstract List<ResolveInfo> queryIntentServices(Intent intent, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3897 | @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3898 | |
| 3899 | /** |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3900 | * Retrieve all services that can match the given intent for a given user. |
| 3901 | * |
| 3902 | * @param intent The desired intent as per resolveService(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3903 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3904 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3905 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3906 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3907 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3908 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3909 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3910 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3911 | * returned. |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3912 | * @param userId The user id. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3913 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3914 | * each matching service, ordered from best to worst. In other |
| 3915 | * words, the first item is what would be returned by |
| 3916 | * {@link #resolveService}. If there are no matching services, an |
| 3917 | * empty list or null is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3918 | * @see #GET_META_DATA |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3919 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3920 | * @see #GET_SHARED_LIBRARY_FILES |
| 3921 | * @see #MATCH_ALL |
| 3922 | * @see #MATCH_DISABLED_COMPONENTS |
| 3923 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3924 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3925 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3926 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3927 | * @see #MATCH_SYSTEM_ONLY |
| 3928 | * @see #MATCH_UNINSTALLED_PACKAGES |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3929 | * @hide |
| 3930 | */ |
| 3931 | public abstract List<ResolveInfo> queryIntentServicesAsUser(Intent intent, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3932 | @ResolveInfoFlags int flags, @UserIdInt int userId); |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3933 | |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3934 | /** |
| 3935 | * Retrieve all providers that can match the given intent. |
| 3936 | * |
| 3937 | * @param intent An intent containing all of the desired specification |
| 3938 | * (action, data, type, category, and/or component). |
| 3939 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3940 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3941 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3942 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3943 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3944 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3945 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3946 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3947 | * returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3948 | * @param userId The user id. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3949 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3950 | * each matching provider, ordered from best to worst. If there are |
| 3951 | * no matching services, an empty list or null is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3952 | * @see #GET_META_DATA |
| 3953 | * @see #GET_RESOLVED_FILTER |
| 3954 | * @see #GET_SHARED_LIBRARY_FILES |
| 3955 | * @see #MATCH_ALL |
| 3956 | * @see #MATCH_DISABLED_COMPONENTS |
| 3957 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3958 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3959 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3960 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3961 | * @see #MATCH_SYSTEM_ONLY |
| 3962 | * @see #MATCH_UNINSTALLED_PACKAGES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3963 | * @hide |
| 3964 | */ |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 3965 | public abstract List<ResolveInfo> queryIntentContentProvidersAsUser( |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3966 | Intent intent, @ResolveInfoFlags int flags, @UserIdInt int userId); |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 3967 | |
| 3968 | /** |
| 3969 | * Retrieve all providers that can match the given intent. |
| 3970 | * |
| 3971 | * @param intent An intent containing all of the desired specification |
| 3972 | * (action, data, type, category, and/or component). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3973 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3974 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3975 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3976 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3977 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3978 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3979 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3980 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3981 | * returned. |
| 3982 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3983 | * each matching provider, ordered from best to worst. If there are |
| 3984 | * no matching services, an empty list or null is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3985 | * @see #GET_META_DATA |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 3986 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3987 | * @see #GET_SHARED_LIBRARY_FILES |
| 3988 | * @see #MATCH_ALL |
| 3989 | * @see #MATCH_DISABLED_COMPONENTS |
| 3990 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3991 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3992 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3993 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3994 | * @see #MATCH_SYSTEM_ONLY |
| 3995 | * @see #MATCH_UNINSTALLED_PACKAGES |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 3996 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3997 | public abstract List<ResolveInfo> queryIntentContentProviders(Intent intent, |
| 3998 | @ResolveInfoFlags int flags); |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 3999 | |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4000 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4001 | * Find a single content provider by its base path name. |
| 4002 | * |
| 4003 | * @param name The name of the provider to find. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4004 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4005 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 4006 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 4007 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 4008 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 4009 | * {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 4010 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 4011 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 4012 | * returned. |
| 4013 | * @return A {@link ProviderInfo} object containing information about the |
| 4014 | * provider. If a provider was not found, returns null. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4015 | * @see #GET_META_DATA |
| 4016 | * @see #GET_SHARED_LIBRARY_FILES |
| 4017 | * @see #MATCH_ALL |
| 4018 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 4019 | * @see #MATCH_DEFAULT_ONLY |
| 4020 | * @see #MATCH_DISABLED_COMPONENTS |
| 4021 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4022 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 4023 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4024 | * @see #MATCH_SYSTEM_ONLY |
| 4025 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4026 | */ |
| 4027 | public abstract ProviderInfo resolveContentProvider(String name, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4028 | @ComponentInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4029 | |
| 4030 | /** |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4031 | * Find a single content provider by its base path name. |
| 4032 | * |
| 4033 | * @param name The name of the provider to find. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4034 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4035 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 4036 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 4037 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 4038 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 4039 | * {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 4040 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 4041 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 4042 | * returned. |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4043 | * @param userId The user id. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4044 | * @return A {@link ProviderInfo} object containing information about the |
| 4045 | * provider. If a provider was not found, returns null. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4046 | * @see #GET_META_DATA |
| 4047 | * @see #GET_SHARED_LIBRARY_FILES |
| 4048 | * @see #MATCH_ALL |
| 4049 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 4050 | * @see #MATCH_DEFAULT_ONLY |
| 4051 | * @see #MATCH_DISABLED_COMPONENTS |
| 4052 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4053 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 4054 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4055 | * @see #MATCH_SYSTEM_ONLY |
| 4056 | * @see #MATCH_UNINSTALLED_PACKAGES |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4057 | * @hide |
| 4058 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4059 | public abstract ProviderInfo resolveContentProviderAsUser(String name, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4060 | @ComponentInfoFlags int flags, @UserIdInt int userId); |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4061 | |
| 4062 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4063 | * Retrieve content provider information. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4064 | * <p> |
| 4065 | * <em>Note: unlike most other methods, an empty result set is indicated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4066 | * by a null return instead of an empty list.</em> |
| 4067 | * |
| 4068 | * @param processName If non-null, limits the returned providers to only |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4069 | * those that are hosted by the given process. If null, all |
| 4070 | * content providers are returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4071 | * @param uid If <var>processName</var> is non-null, this is the required |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4072 | * uid owning the requested content providers. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4073 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4074 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 4075 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 4076 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 4077 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 4078 | * {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 4079 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 4080 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 4081 | * returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4082 | * @return A list of {@link ProviderInfo} objects containing one entry for |
| 4083 | * each provider either matching <var>processName</var> or, if |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4084 | * <var>processName</var> is null, all known content providers. |
| 4085 | * <em>If there are no matching providers, null is returned.</em> |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4086 | * @see #GET_META_DATA |
| 4087 | * @see #GET_SHARED_LIBRARY_FILES |
| 4088 | * @see #MATCH_ALL |
| 4089 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 4090 | * @see #MATCH_DEFAULT_ONLY |
| 4091 | * @see #MATCH_DISABLED_COMPONENTS |
| 4092 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4093 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 4094 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4095 | * @see #MATCH_SYSTEM_ONLY |
| 4096 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4097 | */ |
| 4098 | public abstract List<ProviderInfo> queryContentProviders( |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4099 | String processName, int uid, @ComponentInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4100 | |
| 4101 | /** |
| 4102 | * Retrieve all of the information we know about a particular |
| 4103 | * instrumentation class. |
| 4104 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4105 | * @param className The full name (i.e. |
| 4106 | * com.google.apps.contacts.InstrumentList) of an |
| 4107 | * Instrumentation class. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4108 | * @param flags Additional option flags. Use any combination of |
| 4109 | * {@link #GET_META_DATA} |
| 4110 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4111 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4112 | * @return An {@link InstrumentationInfo} object containing information about the |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4113 | * instrumentation. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4114 | * @throws NameNotFoundException if a package with the given name cannot be |
| 4115 | * found on the system. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4116 | * |
| 4117 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4118 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4119 | public abstract InstrumentationInfo getInstrumentationInfo(ComponentName className, |
| 4120 | @InstrumentationInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4121 | |
| 4122 | /** |
| 4123 | * Retrieve information about available instrumentation code. May be used |
| 4124 | * to retrieve either all instrumentation code, or only the code targeting |
| 4125 | * a particular package. |
| 4126 | * |
| 4127 | * @param targetPackage If null, all instrumentation is returned; only the |
| 4128 | * instrumentation targeting this package name is |
| 4129 | * returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4130 | * @param flags Additional option flags. Use any combination of |
| 4131 | * {@link #GET_META_DATA} |
| 4132 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4133 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4134 | * @return A list of {@link InstrumentationInfo} objects containing one |
| 4135 | * entry for each matching instrumentation. If there are no |
Jesse Hall | f77a34f | 2016-02-04 18:41:33 -0800 | [diff] [blame] | 4136 | * instrumentation available, returns an empty list. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4137 | * |
| 4138 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4139 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4140 | public abstract List<InstrumentationInfo> queryInstrumentation(String targetPackage, |
| 4141 | @InstrumentationInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4142 | |
| 4143 | /** |
| 4144 | * Retrieve an image from a package. This is a low-level API used by |
| 4145 | * the various package manager info structures (such as |
| 4146 | * {@link ComponentInfo} to implement retrieval of their associated |
| 4147 | * icon. |
| 4148 | * |
| 4149 | * @param packageName The name of the package that this icon is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4150 | * Cannot be null. |
| 4151 | * @param resid The resource identifier of the desired image. Cannot be 0. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4152 | * @param appInfo Overall information about <var>packageName</var>. This |
| 4153 | * may be null, in which case the application information will be retrieved |
| 4154 | * for you if needed; if you already have this information around, it can |
| 4155 | * be much more efficient to supply it here. |
| 4156 | * |
| 4157 | * @return Returns a Drawable holding the requested image. Returns null if |
| 4158 | * an image could not be found for any reason. |
| 4159 | */ |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 4160 | public abstract Drawable getDrawable(String packageName, @DrawableRes int resid, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4161 | ApplicationInfo appInfo); |
| 4162 | |
| 4163 | /** |
| 4164 | * Retrieve the icon associated with an activity. Given the full name of |
| 4165 | * an activity, retrieves the information about it and calls |
| 4166 | * {@link ComponentInfo#loadIcon ComponentInfo.loadIcon()} to return its icon. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4167 | * If the activity cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4168 | * |
| 4169 | * @param activityName Name of the activity whose icon is to be retrieved. |
| 4170 | * |
| 4171 | * @return Returns the image of the icon, or the default activity icon if |
| 4172 | * it could not be found. Does not return null. |
| 4173 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4174 | * activity could not be loaded. |
| 4175 | * |
| 4176 | * @see #getActivityIcon(Intent) |
| 4177 | */ |
| 4178 | public abstract Drawable getActivityIcon(ComponentName activityName) |
| 4179 | throws NameNotFoundException; |
| 4180 | |
| 4181 | /** |
| 4182 | * Retrieve the icon associated with an Intent. If intent.getClassName() is |
| 4183 | * set, this simply returns the result of |
| 4184 | * getActivityIcon(intent.getClassName()). Otherwise it resolves the intent's |
| 4185 | * component and returns the icon associated with the resolved component. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4186 | * If intent.getClassName() cannot be found or the Intent cannot be resolved |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4187 | * to a component, NameNotFoundException is thrown. |
| 4188 | * |
| 4189 | * @param intent The intent for which you would like to retrieve an icon. |
| 4190 | * |
| 4191 | * @return Returns the image of the icon, or the default activity icon if |
| 4192 | * it could not be found. Does not return null. |
| 4193 | * @throws NameNotFoundException Thrown if the resources for application |
| 4194 | * matching the given intent could not be loaded. |
| 4195 | * |
| 4196 | * @see #getActivityIcon(ComponentName) |
| 4197 | */ |
| 4198 | public abstract Drawable getActivityIcon(Intent intent) |
| 4199 | throws NameNotFoundException; |
| 4200 | |
| 4201 | /** |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4202 | * Retrieve the banner associated with an activity. Given the full name of |
| 4203 | * an activity, retrieves the information about it and calls |
| 4204 | * {@link ComponentInfo#loadIcon ComponentInfo.loadIcon()} to return its |
| 4205 | * banner. If the activity cannot be found, NameNotFoundException is thrown. |
| 4206 | * |
| 4207 | * @param activityName Name of the activity whose banner is to be retrieved. |
| 4208 | * @return Returns the image of the banner, or null if the activity has no |
| 4209 | * banner specified. |
| 4210 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4211 | * activity could not be loaded. |
| 4212 | * @see #getActivityBanner(Intent) |
| 4213 | */ |
| 4214 | public abstract Drawable getActivityBanner(ComponentName activityName) |
| 4215 | throws NameNotFoundException; |
| 4216 | |
| 4217 | /** |
| 4218 | * Retrieve the banner associated with an Intent. If intent.getClassName() |
| 4219 | * is set, this simply returns the result of |
| 4220 | * getActivityBanner(intent.getClassName()). Otherwise it resolves the |
| 4221 | * intent's component and returns the banner associated with the resolved |
| 4222 | * component. If intent.getClassName() cannot be found or the Intent cannot |
| 4223 | * be resolved to a component, NameNotFoundException is thrown. |
| 4224 | * |
| 4225 | * @param intent The intent for which you would like to retrieve a banner. |
| 4226 | * @return Returns the image of the banner, or null if the activity has no |
| 4227 | * banner specified. |
| 4228 | * @throws NameNotFoundException Thrown if the resources for application |
| 4229 | * matching the given intent could not be loaded. |
| 4230 | * @see #getActivityBanner(ComponentName) |
| 4231 | */ |
| 4232 | public abstract Drawable getActivityBanner(Intent intent) |
| 4233 | throws NameNotFoundException; |
| 4234 | |
| 4235 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4236 | * Return the generic icon for an activity that is used when no specific |
| 4237 | * icon is defined. |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 4238 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4239 | * @return Drawable Image of the icon. |
| 4240 | */ |
| 4241 | public abstract Drawable getDefaultActivityIcon(); |
| 4242 | |
| 4243 | /** |
| 4244 | * Retrieve the icon associated with an application. If it has not defined |
| 4245 | * an icon, the default app icon is returned. Does not return null. |
| 4246 | * |
| 4247 | * @param info Information about application being queried. |
| 4248 | * |
| 4249 | * @return Returns the image of the icon, or the default application icon |
| 4250 | * if it could not be found. |
| 4251 | * |
| 4252 | * @see #getApplicationIcon(String) |
| 4253 | */ |
| 4254 | public abstract Drawable getApplicationIcon(ApplicationInfo info); |
| 4255 | |
| 4256 | /** |
| 4257 | * Retrieve the icon associated with an application. Given the name of the |
| 4258 | * application's package, retrieves the information about it and calls |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4259 | * getApplicationIcon() to return its icon. If the application cannot be |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4260 | * found, NameNotFoundException is thrown. |
| 4261 | * |
| 4262 | * @param packageName Name of the package whose application icon is to be |
| 4263 | * retrieved. |
| 4264 | * |
| 4265 | * @return Returns the image of the icon, or the default application icon |
| 4266 | * if it could not be found. Does not return null. |
| 4267 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4268 | * application could not be loaded. |
| 4269 | * |
| 4270 | * @see #getApplicationIcon(ApplicationInfo) |
| 4271 | */ |
| 4272 | public abstract Drawable getApplicationIcon(String packageName) |
| 4273 | throws NameNotFoundException; |
| 4274 | |
| 4275 | /** |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4276 | * Retrieve the banner associated with an application. |
| 4277 | * |
| 4278 | * @param info Information about application being queried. |
| 4279 | * @return Returns the image of the banner or null if the application has no |
| 4280 | * banner specified. |
| 4281 | * @see #getApplicationBanner(String) |
| 4282 | */ |
| 4283 | public abstract Drawable getApplicationBanner(ApplicationInfo info); |
| 4284 | |
| 4285 | /** |
| 4286 | * Retrieve the banner associated with an application. Given the name of the |
| 4287 | * application's package, retrieves the information about it and calls |
| 4288 | * getApplicationIcon() to return its banner. If the application cannot be |
| 4289 | * found, NameNotFoundException is thrown. |
| 4290 | * |
| 4291 | * @param packageName Name of the package whose application banner is to be |
| 4292 | * retrieved. |
| 4293 | * @return Returns the image of the banner or null if the application has no |
| 4294 | * banner specified. |
| 4295 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4296 | * application could not be loaded. |
| 4297 | * @see #getApplicationBanner(ApplicationInfo) |
| 4298 | */ |
| 4299 | public abstract Drawable getApplicationBanner(String packageName) |
| 4300 | throws NameNotFoundException; |
| 4301 | |
| 4302 | /** |
| 4303 | * Retrieve the logo associated with an activity. Given the full name of an |
| 4304 | * activity, retrieves the information about it and calls |
| 4305 | * {@link ComponentInfo#loadLogo ComponentInfo.loadLogo()} to return its |
| 4306 | * logo. If the activity cannot be found, NameNotFoundException is thrown. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4307 | * |
| 4308 | * @param activityName Name of the activity whose logo is to be retrieved. |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4309 | * @return Returns the image of the logo or null if the activity has no logo |
| 4310 | * specified. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4311 | * @throws NameNotFoundException Thrown if the resources for the given |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4312 | * activity could not be loaded. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4313 | * @see #getActivityLogo(Intent) |
| 4314 | */ |
| 4315 | public abstract Drawable getActivityLogo(ComponentName activityName) |
| 4316 | throws NameNotFoundException; |
| 4317 | |
| 4318 | /** |
| 4319 | * Retrieve the logo associated with an Intent. If intent.getClassName() is |
| 4320 | * set, this simply returns the result of |
| 4321 | * getActivityLogo(intent.getClassName()). Otherwise it resolves the intent's |
| 4322 | * component and returns the logo associated with the resolved component. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4323 | * If intent.getClassName() cannot be found or the Intent cannot be resolved |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4324 | * to a component, NameNotFoundException is thrown. |
| 4325 | * |
| 4326 | * @param intent The intent for which you would like to retrieve a logo. |
| 4327 | * |
| 4328 | * @return Returns the image of the logo, or null if the activity has no |
| 4329 | * logo specified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4330 | * |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4331 | * @throws NameNotFoundException Thrown if the resources for application |
| 4332 | * matching the given intent could not be loaded. |
| 4333 | * |
| 4334 | * @see #getActivityLogo(ComponentName) |
| 4335 | */ |
| 4336 | public abstract Drawable getActivityLogo(Intent intent) |
| 4337 | throws NameNotFoundException; |
| 4338 | |
| 4339 | /** |
| 4340 | * Retrieve the logo associated with an application. If it has not specified |
| 4341 | * a logo, this method returns null. |
| 4342 | * |
| 4343 | * @param info Information about application being queried. |
| 4344 | * |
| 4345 | * @return Returns the image of the logo, or null if no logo is specified |
| 4346 | * by the application. |
| 4347 | * |
| 4348 | * @see #getApplicationLogo(String) |
| 4349 | */ |
| 4350 | public abstract Drawable getApplicationLogo(ApplicationInfo info); |
| 4351 | |
| 4352 | /** |
| 4353 | * Retrieve the logo associated with an application. Given the name of the |
| 4354 | * application's package, retrieves the information about it and calls |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4355 | * getApplicationLogo() to return its logo. If the application cannot be |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4356 | * found, NameNotFoundException is thrown. |
| 4357 | * |
| 4358 | * @param packageName Name of the package whose application logo is to be |
| 4359 | * retrieved. |
| 4360 | * |
| 4361 | * @return Returns the image of the logo, or null if no application logo |
| 4362 | * has been specified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4363 | * |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4364 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4365 | * application could not be loaded. |
| 4366 | * |
| 4367 | * @see #getApplicationLogo(ApplicationInfo) |
| 4368 | */ |
| 4369 | public abstract Drawable getApplicationLogo(String packageName) |
| 4370 | throws NameNotFoundException; |
| 4371 | |
| 4372 | /** |
Vadim Tryshev | 66ae66a | 2016-02-18 15:41:21 -0800 | [diff] [blame] | 4373 | * Returns a managed-user-style badged copy of the given drawable allowing the user to |
| 4374 | * distinguish it from the original drawable. |
| 4375 | * The caller can specify the location in the bounds of the drawable to be |
| 4376 | * badged where the badge should be applied as well as the density of the |
| 4377 | * badge to be used. |
| 4378 | * <p> |
| 4379 | * If the original drawable is a BitmapDrawable and the backing bitmap is |
| 4380 | * mutable as per {@link android.graphics.Bitmap#isMutable()}, the badging |
| 4381 | * is performed in place and the original drawable is returned. |
| 4382 | * </p> |
| 4383 | * |
| 4384 | * @param drawable The drawable to badge. |
| 4385 | * @param badgeLocation Where in the bounds of the badged drawable to place |
| 4386 | * the badge. If it's {@code null}, the badge is applied on top of the entire |
| 4387 | * drawable being badged. |
| 4388 | * @param badgeDensity The optional desired density for the badge as per |
| 4389 | * {@link android.util.DisplayMetrics#densityDpi}. If it's not positive, |
| 4390 | * the density of the display is used. |
| 4391 | * @return A drawable that combines the original drawable and a badge as |
| 4392 | * determined by the system. |
| 4393 | * @hide |
| 4394 | */ |
| 4395 | public abstract Drawable getManagedUserBadgedDrawable(Drawable drawable, Rect badgeLocation, |
| 4396 | int badgeDensity); |
| 4397 | |
| 4398 | /** |
Tony Mak | 4dc008c | 2016-03-16 10:46:49 +0000 | [diff] [blame] | 4399 | * If the target user is a managed profile, then this returns a badged copy of the given icon |
| 4400 | * to be able to distinguish it from the original icon. For badging an arbitrary drawable use |
Kenny Guy | df77d71 | 2015-05-29 17:02:22 +0100 | [diff] [blame] | 4401 | * {@link #getUserBadgedDrawableForDensity( |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4402 | * android.graphics.drawable.Drawable, UserHandle, android.graphics.Rect, int)}. |
| 4403 | * <p> |
| 4404 | * If the original drawable is a BitmapDrawable and the backing bitmap is |
| 4405 | * mutable as per {@link android.graphics.Bitmap#isMutable()}, the badging |
| 4406 | * is performed in place and the original drawable is returned. |
| 4407 | * </p> |
| 4408 | * |
| 4409 | * @param icon The icon to badge. |
| 4410 | * @param user The target user. |
| 4411 | * @return A drawable that combines the original icon and a badge as |
| 4412 | * determined by the system. |
| 4413 | */ |
| 4414 | public abstract Drawable getUserBadgedIcon(Drawable icon, UserHandle user); |
| 4415 | |
| 4416 | /** |
| 4417 | * If the target user is a managed profile of the calling user or the caller |
| 4418 | * is itself a managed profile, then this returns a badged copy of the given |
| 4419 | * drawable allowing the user to distinguish it from the original drawable. |
| 4420 | * The caller can specify the location in the bounds of the drawable to be |
| 4421 | * badged where the badge should be applied as well as the density of the |
| 4422 | * badge to be used. |
| 4423 | * <p> |
| 4424 | * If the original drawable is a BitmapDrawable and the backing bitmap is |
Vadim Tryshev | 66ae66a | 2016-02-18 15:41:21 -0800 | [diff] [blame] | 4425 | * mutable as per {@link android.graphics.Bitmap#isMutable()}, the badging |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4426 | * is performed in place and the original drawable is returned. |
| 4427 | * </p> |
| 4428 | * |
| 4429 | * @param drawable The drawable to badge. |
| 4430 | * @param user The target user. |
| 4431 | * @param badgeLocation Where in the bounds of the badged drawable to place |
Vadim Tryshev | 66ae66a | 2016-02-18 15:41:21 -0800 | [diff] [blame] | 4432 | * the badge. If it's {@code null}, the badge is applied on top of the entire |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4433 | * drawable being badged. |
| 4434 | * @param badgeDensity The optional desired density for the badge as per |
Vadim Tryshev | 66ae66a | 2016-02-18 15:41:21 -0800 | [diff] [blame] | 4435 | * {@link android.util.DisplayMetrics#densityDpi}. If it's not positive, |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4436 | * the density of the display is used. |
| 4437 | * @return A drawable that combines the original drawable and a badge as |
| 4438 | * determined by the system. |
| 4439 | */ |
| 4440 | public abstract Drawable getUserBadgedDrawableForDensity(Drawable drawable, |
| 4441 | UserHandle user, Rect badgeLocation, int badgeDensity); |
| 4442 | |
| 4443 | /** |
| 4444 | * If the target user is a managed profile of the calling user or the caller |
| 4445 | * is itself a managed profile, then this returns a drawable to use as a small |
| 4446 | * icon to include in a view to distinguish it from the original icon. |
| 4447 | * |
| 4448 | * @param user The target user. |
| 4449 | * @param density The optional desired density for the badge as per |
| 4450 | * {@link android.util.DisplayMetrics#densityDpi}. If not provided |
| 4451 | * the density of the current display is used. |
| 4452 | * @return the drawable or null if no drawable is required. |
| 4453 | * @hide |
| 4454 | */ |
| 4455 | public abstract Drawable getUserBadgeForDensity(UserHandle user, int density); |
| 4456 | |
| 4457 | /** |
| 4458 | * If the target user is a managed profile of the calling user or the caller |
Selim Cinek | e6ff946 | 2016-01-15 15:07:06 -0800 | [diff] [blame] | 4459 | * is itself a managed profile, then this returns a drawable to use as a small |
| 4460 | * icon to include in a view to distinguish it from the original icon. This version |
| 4461 | * doesn't have background protection and should be used over a light background instead of |
| 4462 | * a badge. |
| 4463 | * |
| 4464 | * @param user The target user. |
| 4465 | * @param density The optional desired density for the badge as per |
| 4466 | * {@link android.util.DisplayMetrics#densityDpi}. If not provided |
| 4467 | * the density of the current display is used. |
| 4468 | * @return the drawable or null if no drawable is required. |
| 4469 | * @hide |
| 4470 | */ |
| 4471 | public abstract Drawable getUserBadgeForDensityNoBackground(UserHandle user, int density); |
| 4472 | |
| 4473 | /** |
| 4474 | * If the target user is a managed profile of the calling user or the caller |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4475 | * is itself a managed profile, then this returns a copy of the label with |
| 4476 | * badging for accessibility services like talkback. E.g. passing in "Email" |
| 4477 | * and it might return "Work Email" for Email in the work profile. |
| 4478 | * |
| 4479 | * @param label The label to change. |
| 4480 | * @param user The target user. |
| 4481 | * @return A label that combines the original label and a badge as |
| 4482 | * determined by the system. |
| 4483 | */ |
| 4484 | public abstract CharSequence getUserBadgedLabel(CharSequence label, UserHandle user); |
| 4485 | |
| 4486 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4487 | * Retrieve text from a package. This is a low-level API used by |
| 4488 | * the various package manager info structures (such as |
| 4489 | * {@link ComponentInfo} to implement retrieval of their associated |
| 4490 | * labels and other text. |
| 4491 | * |
| 4492 | * @param packageName The name of the package that this text is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4493 | * Cannot be null. |
| 4494 | * @param resid The resource identifier of the desired text. Cannot be 0. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4495 | * @param appInfo Overall information about <var>packageName</var>. This |
| 4496 | * may be null, in which case the application information will be retrieved |
| 4497 | * for you if needed; if you already have this information around, it can |
| 4498 | * be much more efficient to supply it here. |
| 4499 | * |
| 4500 | * @return Returns a CharSequence holding the requested text. Returns null |
| 4501 | * if the text could not be found for any reason. |
| 4502 | */ |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 4503 | public abstract CharSequence getText(String packageName, @StringRes int resid, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4504 | ApplicationInfo appInfo); |
| 4505 | |
| 4506 | /** |
| 4507 | * Retrieve an XML file from a package. This is a low-level API used to |
| 4508 | * retrieve XML meta data. |
| 4509 | * |
| 4510 | * @param packageName The name of the package that this xml is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4511 | * Cannot be null. |
| 4512 | * @param resid The resource identifier of the desired xml. Cannot be 0. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4513 | * @param appInfo Overall information about <var>packageName</var>. This |
| 4514 | * may be null, in which case the application information will be retrieved |
| 4515 | * for you if needed; if you already have this information around, it can |
| 4516 | * be much more efficient to supply it here. |
| 4517 | * |
| 4518 | * @return Returns an XmlPullParser allowing you to parse out the XML |
| 4519 | * data. Returns null if the xml resource could not be found for any |
| 4520 | * reason. |
| 4521 | */ |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 4522 | public abstract XmlResourceParser getXml(String packageName, @XmlRes int resid, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4523 | ApplicationInfo appInfo); |
| 4524 | |
| 4525 | /** |
| 4526 | * Return the label to use for this application. |
| 4527 | * |
| 4528 | * @return Returns the label associated with this application, or null if |
| 4529 | * it could not be found for any reason. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4530 | * @param info The application to get the label of. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4531 | */ |
| 4532 | public abstract CharSequence getApplicationLabel(ApplicationInfo info); |
| 4533 | |
| 4534 | /** |
| 4535 | * Retrieve the resources associated with an activity. Given the full |
| 4536 | * name of an activity, retrieves the information about it and calls |
| 4537 | * getResources() to return its application's resources. If the activity |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4538 | * cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4539 | * |
| 4540 | * @param activityName Name of the activity whose resources are to be |
| 4541 | * retrieved. |
| 4542 | * |
| 4543 | * @return Returns the application's Resources. |
| 4544 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4545 | * application could not be loaded. |
| 4546 | * |
| 4547 | * @see #getResourcesForApplication(ApplicationInfo) |
| 4548 | */ |
| 4549 | public abstract Resources getResourcesForActivity(ComponentName activityName) |
| 4550 | throws NameNotFoundException; |
| 4551 | |
| 4552 | /** |
| 4553 | * Retrieve the resources for an application. Throws NameNotFoundException |
| 4554 | * if the package is no longer installed. |
| 4555 | * |
| 4556 | * @param app Information about the desired application. |
| 4557 | * |
| 4558 | * @return Returns the application's Resources. |
| 4559 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4560 | * application could not be loaded (most likely because it was uninstalled). |
| 4561 | */ |
| 4562 | public abstract Resources getResourcesForApplication(ApplicationInfo app) |
| 4563 | throws NameNotFoundException; |
| 4564 | |
| 4565 | /** |
| 4566 | * Retrieve the resources associated with an application. Given the full |
| 4567 | * package name of an application, retrieves the information about it and |
| 4568 | * calls getResources() to return its application's resources. If the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4569 | * appPackageName cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4570 | * |
| 4571 | * @param appPackageName Package name of the application whose resources |
| 4572 | * are to be retrieved. |
| 4573 | * |
| 4574 | * @return Returns the application's Resources. |
| 4575 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4576 | * application could not be loaded. |
| 4577 | * |
| 4578 | * @see #getResourcesForApplication(ApplicationInfo) |
| 4579 | */ |
| 4580 | public abstract Resources getResourcesForApplication(String appPackageName) |
| 4581 | throws NameNotFoundException; |
| 4582 | |
Amith Yamasani | 98edc95 | 2012-09-25 14:09:27 -0700 | [diff] [blame] | 4583 | /** @hide */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4584 | public abstract Resources getResourcesForApplicationAsUser(String appPackageName, |
| 4585 | @UserIdInt int userId) throws NameNotFoundException; |
Amith Yamasani | 98edc95 | 2012-09-25 14:09:27 -0700 | [diff] [blame] | 4586 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4587 | /** |
| 4588 | * Retrieve overall information about an application package defined |
| 4589 | * in a package archive file |
| 4590 | * |
| 4591 | * @param archiveFilePath The path to the archive file |
| 4592 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4593 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 4594 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 4595 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 4596 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 4597 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 4598 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 4599 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 4600 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 4601 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 4602 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4603 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4604 | * @return A PackageInfo object containing information about the |
| 4605 | * package archive. If the package could not be parsed, |
| 4606 | * returns null. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4607 | * |
| 4608 | * @see #GET_ACTIVITIES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4609 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4610 | * @see #GET_GIDS |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4611 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4612 | * @see #GET_INTENT_FILTERS |
| 4613 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4614 | * @see #GET_PERMISSIONS |
| 4615 | * @see #GET_PROVIDERS |
| 4616 | * @see #GET_RECEIVERS |
| 4617 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4618 | * @see #GET_SHARED_LIBRARY_FILES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4619 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4620 | * @see #GET_URI_PERMISSION_PATTERNS |
| 4621 | * @see #MATCH_DISABLED_COMPONENTS |
| 4622 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 4623 | * @see #MATCH_UNINSTALLED_PACKAGES |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4624 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4625 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4626 | public PackageInfo getPackageArchiveInfo(String archiveFilePath, @PackageInfoFlags int flags) { |
Jeff Sharkey | 275e085 | 2014-06-17 18:18:49 -0700 | [diff] [blame] | 4627 | final PackageParser parser = new PackageParser(); |
| 4628 | final File apkFile = new File(archiveFilePath); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 4629 | try { |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4630 | if ((flags & (MATCH_DIRECT_BOOT_UNAWARE | MATCH_DIRECT_BOOT_AWARE)) != 0) { |
Jeff Sharkey | c313251 | 2016-01-12 14:06:58 -0700 | [diff] [blame] | 4631 | // Caller expressed an explicit opinion about what encryption |
| 4632 | // aware/unaware components they want to see, so fall through and |
| 4633 | // give them what they want |
| 4634 | } else { |
| 4635 | // Caller expressed no opinion, so match everything |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4636 | flags |= MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE; |
Jeff Sharkey | c313251 | 2016-01-12 14:06:58 -0700 | [diff] [blame] | 4637 | } |
| 4638 | |
Jeff Sharkey | 275e085 | 2014-06-17 18:18:49 -0700 | [diff] [blame] | 4639 | PackageParser.Package pkg = parser.parseMonolithicPackage(apkFile, 0); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 4640 | if ((flags & GET_SIGNATURES) != 0) { |
Svet Ganov | 354cd3c | 2015-12-17 11:35:04 -0800 | [diff] [blame] | 4641 | PackageParser.collectCertificates(pkg, 0); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 4642 | } |
| 4643 | PackageUserState state = new PackageUserState(); |
| 4644 | return PackageParser.generatePackageInfo(pkg, null, flags, 0, 0, null, state); |
| 4645 | } catch (PackageParserException e) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4646 | return null; |
| 4647 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4648 | } |
| 4649 | |
| 4650 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4651 | * @deprecated replaced by {@link PackageInstaller} |
| 4652 | * @hide |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4653 | */ |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4654 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4655 | public abstract void installPackage( |
Todd Kennedy | a679323 | 2016-02-24 22:46:00 +0000 | [diff] [blame] | 4656 | Uri packageURI, |
| 4657 | IPackageInstallObserver observer, |
| 4658 | @InstallFlags int flags, |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4659 | String installerPackageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4660 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4661 | * @deprecated replaced by {@link PackageInstaller} |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4662 | * @hide |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4663 | */ |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4664 | @Deprecated |
Todd Kennedy | a679323 | 2016-02-24 22:46:00 +0000 | [diff] [blame] | 4665 | public abstract void installPackage( |
| 4666 | Uri packageURI, |
| 4667 | PackageInstallObserver observer, |
| 4668 | @InstallFlags int flags, |
| 4669 | String installerPackageName); |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4670 | |
rich cannings | 706e8ba | 2012-08-20 13:20:14 -0700 | [diff] [blame] | 4671 | /** |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4672 | * If there is already an application with the given package name installed |
| 4673 | * on the system for other users, also install it for the calling user. |
| 4674 | * @hide |
| 4675 | */ |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4676 | public abstract int installExistingPackage(String packageName) throws NameNotFoundException; |
| 4677 | |
| 4678 | /** |
| 4679 | * If there is already an application with the given package name installed |
| 4680 | * on the system for other users, also install it for the specified user. |
| 4681 | * @hide |
| 4682 | */ |
| 4683 | @RequiresPermission(anyOf = { |
| 4684 | Manifest.permission.INSTALL_PACKAGES, |
| 4685 | Manifest.permission.INTERACT_ACROSS_USERS_FULL}) |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4686 | public abstract int installExistingPackageAsUser(String packageName, @UserIdInt int userId) |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4687 | throws NameNotFoundException; |
| 4688 | |
| 4689 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4690 | * Allows a package listening to the |
| 4691 | * {@link Intent#ACTION_PACKAGE_NEEDS_VERIFICATION package verification |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 4692 | * broadcast} to respond to the package manager. The response must include |
| 4693 | * the {@code verificationCode} which is one of |
| 4694 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 4695 | * {@link PackageManager#VERIFICATION_REJECT}. |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4696 | * |
| 4697 | * @param id pending package identifier as passed via the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4698 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 4699 | * @param verificationCode either {@link PackageManager#VERIFICATION_ALLOW} |
| 4700 | * or {@link PackageManager#VERIFICATION_REJECT}. |
rich cannings | 7e67151 | 2012-08-27 14:44:16 -0700 | [diff] [blame] | 4701 | * @throws SecurityException if the caller does not have the |
Dianne Hackborn | 8832c18 | 2012-09-17 17:20:24 -0700 | [diff] [blame] | 4702 | * PACKAGE_VERIFICATION_AGENT permission. |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4703 | */ |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 4704 | public abstract void verifyPendingInstall(int id, int verificationCode); |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4705 | |
| 4706 | /** |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4707 | * Allows a package listening to the |
| 4708 | * {@link Intent#ACTION_PACKAGE_NEEDS_VERIFICATION package verification |
| 4709 | * broadcast} to extend the default timeout for a response and declare what |
| 4710 | * action to perform after the timeout occurs. The response must include |
| 4711 | * the {@code verificationCodeAtTimeout} which is one of |
| 4712 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 4713 | * {@link PackageManager#VERIFICATION_REJECT}. |
| 4714 | * |
| 4715 | * This method may only be called once per package id. Additional calls |
| 4716 | * will have no effect. |
| 4717 | * |
| 4718 | * @param id pending package identifier as passed via the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4719 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4720 | * @param verificationCodeAtTimeout either |
| 4721 | * {@link PackageManager#VERIFICATION_ALLOW} or |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 4722 | * {@link PackageManager#VERIFICATION_REJECT}. If |
| 4723 | * {@code verificationCodeAtTimeout} is neither |
| 4724 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 4725 | * {@link PackageManager#VERIFICATION_REJECT}, then |
| 4726 | * {@code verificationCodeAtTimeout} will default to |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4727 | * {@link PackageManager#VERIFICATION_REJECT}. |
| 4728 | * @param millisecondsToDelay the amount of time requested for the timeout. |
| 4729 | * Must be positive and less than |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 4730 | * {@link PackageManager#MAXIMUM_VERIFICATION_TIMEOUT}. If |
| 4731 | * {@code millisecondsToDelay} is out of bounds, |
| 4732 | * {@code millisecondsToDelay} will be set to the closest in |
| 4733 | * bounds value; namely, 0 or |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4734 | * {@link PackageManager#MAXIMUM_VERIFICATION_TIMEOUT}. |
rich cannings | 7e67151 | 2012-08-27 14:44:16 -0700 | [diff] [blame] | 4735 | * @throws SecurityException if the caller does not have the |
Dianne Hackborn | 8832c18 | 2012-09-17 17:20:24 -0700 | [diff] [blame] | 4736 | * PACKAGE_VERIFICATION_AGENT permission. |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4737 | */ |
| 4738 | public abstract void extendVerificationTimeout(int id, |
| 4739 | int verificationCodeAtTimeout, long millisecondsToDelay); |
| 4740 | |
| 4741 | /** |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4742 | * Allows a package listening to the |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 4743 | * {@link Intent#ACTION_INTENT_FILTER_NEEDS_VERIFICATION} intent filter verification |
| 4744 | * broadcast to respond to the package manager. The response must include |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4745 | * the {@code verificationCode} which is one of |
| 4746 | * {@link PackageManager#INTENT_FILTER_VERIFICATION_SUCCESS} or |
| 4747 | * {@link PackageManager#INTENT_FILTER_VERIFICATION_FAILURE}. |
| 4748 | * |
| 4749 | * @param verificationId pending package identifier as passed via the |
| 4750 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
| 4751 | * @param verificationCode either {@link PackageManager#INTENT_FILTER_VERIFICATION_SUCCESS} |
| 4752 | * or {@link PackageManager#INTENT_FILTER_VERIFICATION_FAILURE}. |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 4753 | * @param failedDomains a list of failed domains if the verificationCode is |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4754 | * {@link PackageManager#INTENT_FILTER_VERIFICATION_FAILURE}, otherwise null; |
| 4755 | * @throws SecurityException if the caller does not have the |
| 4756 | * INTENT_FILTER_VERIFICATION_AGENT permission. |
| 4757 | * |
| 4758 | * @hide |
| 4759 | */ |
Fabrice Di Meglio | ef741da | 2015-05-12 16:31:38 -0700 | [diff] [blame] | 4760 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4761 | public abstract void verifyIntentFilter(int verificationId, int verificationCode, |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 4762 | List<String> failedDomains); |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4763 | |
| 4764 | /** |
| 4765 | * Get the status of a Domain Verification Result for an IntentFilter. This is |
| 4766 | * related to the {@link android.content.IntentFilter#setAutoVerify(boolean)} and |
| 4767 | * {@link android.content.IntentFilter#getAutoVerify()} |
| 4768 | * |
| 4769 | * This is used by the ResolverActivity to change the status depending on what the User select |
| 4770 | * in the Disambiguation Dialog and also used by the Settings App for changing the default App |
| 4771 | * for a domain. |
| 4772 | * |
| 4773 | * @param packageName The package name of the Activity associated with the IntentFilter. |
| 4774 | * @param userId The user id. |
| 4775 | * |
| 4776 | * @return The status to set to. This can be |
| 4777 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK} or |
| 4778 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS} or |
| 4779 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER} or |
| 4780 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED} |
| 4781 | * |
| 4782 | * @hide |
| 4783 | */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4784 | public abstract int getIntentVerificationStatusAsUser(String packageName, @UserIdInt int userId); |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4785 | |
| 4786 | /** |
| 4787 | * Allow to change the status of a Intent Verification status for all IntentFilter of an App. |
| 4788 | * This is related to the {@link android.content.IntentFilter#setAutoVerify(boolean)} and |
| 4789 | * {@link android.content.IntentFilter#getAutoVerify()} |
| 4790 | * |
| 4791 | * This is used by the ResolverActivity to change the status depending on what the User select |
| 4792 | * in the Disambiguation Dialog and also used by the Settings App for changing the default App |
| 4793 | * for a domain. |
| 4794 | * |
| 4795 | * @param packageName The package name of the Activity associated with the IntentFilter. |
| 4796 | * @param status The status to set to. This can be |
| 4797 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK} or |
| 4798 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS} or |
| 4799 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER} |
| 4800 | * @param userId The user id. |
| 4801 | * |
| 4802 | * @return true if the status has been set. False otherwise. |
| 4803 | * |
| 4804 | * @hide |
| 4805 | */ |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 4806 | public abstract boolean updateIntentVerificationStatusAsUser(String packageName, int status, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4807 | @UserIdInt int userId); |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4808 | |
| 4809 | /** |
| 4810 | * Get the list of IntentFilterVerificationInfo for a specific package and User. |
| 4811 | * |
| 4812 | * @param packageName the package name. When this parameter is set to a non null value, |
| 4813 | * the results will be filtered by the package name provided. |
| 4814 | * Otherwise, there will be no filtering and it will return a list |
Fabrice Di Meglio | 0788595 | 2015-04-06 19:41:28 -0700 | [diff] [blame] | 4815 | * corresponding for all packages |
| 4816 | * |
| 4817 | * @return a list of IntentFilterVerificationInfo for a specific package. |
| 4818 | * |
| 4819 | * @hide |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4820 | */ |
| 4821 | public abstract List<IntentFilterVerificationInfo> getIntentFilterVerifications( |
| 4822 | String packageName); |
| 4823 | |
| 4824 | /** |
Fabrice Di Meglio | 0788595 | 2015-04-06 19:41:28 -0700 | [diff] [blame] | 4825 | * Get the list of IntentFilter for a specific package. |
| 4826 | * |
| 4827 | * @param packageName the package name. This parameter is set to a non null value, |
| 4828 | * the list will contain all the IntentFilter for that package. |
| 4829 | * Otherwise, the list will be empty. |
| 4830 | * |
| 4831 | * @return a list of IntentFilter for a specific package. |
| 4832 | * |
| 4833 | * @hide |
| 4834 | */ |
| 4835 | public abstract List<IntentFilter> getAllIntentFilters(String packageName); |
| 4836 | |
| 4837 | /** |
Fabrice Di Meglio | 6227172 | 2015-04-10 17:24:02 -0700 | [diff] [blame] | 4838 | * Get the default Browser package name for a specific user. |
| 4839 | * |
| 4840 | * @param userId The user id. |
| 4841 | * |
| 4842 | * @return the package name of the default Browser for the specified user. If the user id passed |
| 4843 | * is -1 (all users) it will return a null value. |
| 4844 | * |
| 4845 | * @hide |
| 4846 | */ |
Jeff Sharkey | a73b8fd | 2016-01-06 17:02:08 -0700 | [diff] [blame] | 4847 | @TestApi |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4848 | public abstract String getDefaultBrowserPackageNameAsUser(@UserIdInt int userId); |
Fabrice Di Meglio | 6227172 | 2015-04-10 17:24:02 -0700 | [diff] [blame] | 4849 | |
| 4850 | /** |
| 4851 | * Set the default Browser package name for a specific user. |
| 4852 | * |
| 4853 | * @param packageName The package name of the default Browser. |
| 4854 | * @param userId The user id. |
| 4855 | * |
| 4856 | * @return true if the default Browser for the specified user has been set, |
| 4857 | * otherwise return false. If the user id passed is -1 (all users) this call will not |
| 4858 | * do anything and just return false. |
| 4859 | * |
| 4860 | * @hide |
| 4861 | */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4862 | public abstract boolean setDefaultBrowserPackageNameAsUser(String packageName, |
| 4863 | @UserIdInt int userId); |
Fabrice Di Meglio | 6227172 | 2015-04-10 17:24:02 -0700 | [diff] [blame] | 4864 | |
| 4865 | /** |
Dianne Hackborn | 880119b | 2010-11-18 22:26:40 -0800 | [diff] [blame] | 4866 | * Change the installer associated with a given package. There are limitations |
| 4867 | * on how the installer package can be changed; in particular: |
| 4868 | * <ul> |
| 4869 | * <li> A SecurityException will be thrown if <var>installerPackageName</var> |
| 4870 | * is not signed with the same certificate as the calling application. |
| 4871 | * <li> A SecurityException will be thrown if <var>targetPackage</var> already |
| 4872 | * has an installer package, and that installer package is not signed with |
| 4873 | * the same certificate as the calling application. |
| 4874 | * </ul> |
| 4875 | * |
| 4876 | * @param targetPackage The installed package whose installer will be changed. |
| 4877 | * @param installerPackageName The package name of the new installer. May be |
| 4878 | * null to clear the association. |
| 4879 | */ |
| 4880 | public abstract void setInstallerPackageName(String targetPackage, |
| 4881 | String installerPackageName); |
| 4882 | |
| 4883 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4884 | * Attempts to delete a package. Since this may take a little while, the |
| 4885 | * result will be posted back to the given observer. A deletion will fail if |
| 4886 | * the calling context lacks the |
| 4887 | * {@link android.Manifest.permission#DELETE_PACKAGES} permission, if the |
| 4888 | * named package cannot be found, or if the named package is a system |
| 4889 | * package. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4890 | * |
| 4891 | * @param packageName The name of the package to delete |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4892 | * @param observer An observer callback to get notified when the package |
| 4893 | * deletion is complete. |
| 4894 | * {@link android.content.pm.IPackageDeleteObserver#packageDeleted} |
| 4895 | * will be called when that happens. observer may be null to |
| 4896 | * indicate that no callback is desired. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4897 | * @hide |
| 4898 | */ |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4899 | public abstract void deletePackage(String packageName, IPackageDeleteObserver observer, |
| 4900 | @DeleteFlags int flags); |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4901 | |
| 4902 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4903 | * Attempts to delete a package. Since this may take a little while, the |
| 4904 | * result will be posted back to the given observer. A deletion will fail if |
| 4905 | * the named package cannot be found, or if the named package is a system |
| 4906 | * package. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4907 | * |
| 4908 | * @param packageName The name of the package to delete |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4909 | * @param observer An observer callback to get notified when the package |
| 4910 | * deletion is complete. |
| 4911 | * {@link android.content.pm.IPackageDeleteObserver#packageDeleted} |
| 4912 | * will be called when that happens. observer may be null to |
| 4913 | * indicate that no callback is desired. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4914 | * @param userId The user Id |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4915 | * @hide |
| 4916 | */ |
| 4917 | @RequiresPermission(anyOf = { |
| 4918 | Manifest.permission.DELETE_PACKAGES, |
| 4919 | Manifest.permission.INTERACT_ACROSS_USERS_FULL}) |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4920 | public abstract void deletePackageAsUser(String packageName, IPackageDeleteObserver observer, |
| 4921 | @DeleteFlags int flags, @UserIdInt int userId); |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4922 | |
| 4923 | /** |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4924 | * Retrieve the package name of the application that installed a package. This identifies |
| 4925 | * which market the package came from. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4926 | * |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4927 | * @param packageName The name of the package to query |
| 4928 | */ |
| 4929 | public abstract String getInstallerPackageName(String packageName); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4930 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4931 | /** |
| 4932 | * Attempts to clear the user data directory of an application. |
| 4933 | * Since this may take a little while, the result will |
| 4934 | * be posted back to the given observer. A deletion will fail if the |
| 4935 | * named package cannot be found, or if the named package is a "system package". |
| 4936 | * |
| 4937 | * @param packageName The name of the package |
| 4938 | * @param observer An observer callback to get notified when the operation is finished |
| 4939 | * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)} |
| 4940 | * will be called when that happens. observer may be null to indicate that |
| 4941 | * no callback is desired. |
| 4942 | * |
| 4943 | * @hide |
| 4944 | */ |
| 4945 | public abstract void clearApplicationUserData(String packageName, |
| 4946 | IPackageDataObserver observer); |
| 4947 | /** |
| 4948 | * Attempts to delete the cache files associated with an application. |
| 4949 | * Since this may take a little while, the result will |
| 4950 | * be posted back to the given observer. A deletion will fail if the calling context |
| 4951 | * lacks the {@link android.Manifest.permission#DELETE_CACHE_FILES} permission, if the |
| 4952 | * named package cannot be found, or if the named package is a "system package". |
| 4953 | * |
| 4954 | * @param packageName The name of the package to delete |
| 4955 | * @param observer An observer callback to get notified when the cache file deletion |
| 4956 | * is complete. |
| 4957 | * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)} |
| 4958 | * will be called when that happens. observer may be null to indicate that |
| 4959 | * no callback is desired. |
| 4960 | * |
| 4961 | * @hide |
| 4962 | */ |
| 4963 | public abstract void deleteApplicationCacheFiles(String packageName, |
| 4964 | IPackageDataObserver observer); |
| 4965 | |
| 4966 | /** |
| 4967 | * Free storage by deleting LRU sorted list of cache files across |
| 4968 | * all applications. If the currently available free storage |
| 4969 | * on the device is greater than or equal to the requested |
| 4970 | * free storage, no cache files are cleared. If the currently |
| 4971 | * available storage on the device is less than the requested |
| 4972 | * free storage, some or all of the cache files across |
| 4973 | * all applications are deleted (based on last accessed time) |
| 4974 | * to increase the free storage space on the device to |
| 4975 | * the requested value. There is no guarantee that clearing all |
| 4976 | * the cache files from all applications will clear up |
| 4977 | * enough storage to achieve the desired value. |
| 4978 | * @param freeStorageSize The number of bytes of storage to be |
| 4979 | * freed by the system. Say if freeStorageSize is XX, |
| 4980 | * and the current free storage is YY, |
| 4981 | * if XX is less than YY, just return. if not free XX-YY number |
| 4982 | * of bytes if possible. |
| 4983 | * @param observer call back used to notify when |
| 4984 | * the operation is completed |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4985 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4986 | * @hide |
| 4987 | */ |
Jeff Sharkey | 529f91f | 2015-04-18 20:23:13 -0700 | [diff] [blame] | 4988 | public void freeStorageAndNotify(long freeStorageSize, IPackageDataObserver observer) { |
| 4989 | freeStorageAndNotify(null, freeStorageSize, observer); |
| 4990 | } |
| 4991 | |
| 4992 | /** {@hide} */ |
| 4993 | public abstract void freeStorageAndNotify(String volumeUuid, long freeStorageSize, |
| 4994 | IPackageDataObserver observer); |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 4995 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4996 | /** |
| 4997 | * Free storage by deleting LRU sorted list of cache files across |
| 4998 | * all applications. If the currently available free storage |
| 4999 | * on the device is greater than or equal to the requested |
| 5000 | * free storage, no cache files are cleared. If the currently |
| 5001 | * available storage on the device is less than the requested |
| 5002 | * free storage, some or all of the cache files across |
| 5003 | * all applications are deleted (based on last accessed time) |
| 5004 | * to increase the free storage space on the device to |
| 5005 | * the requested value. There is no guarantee that clearing all |
| 5006 | * the cache files from all applications will clear up |
| 5007 | * enough storage to achieve the desired value. |
| 5008 | * @param freeStorageSize The number of bytes of storage to be |
| 5009 | * freed by the system. Say if freeStorageSize is XX, |
| 5010 | * and the current free storage is YY, |
| 5011 | * if XX is less than YY, just return. if not free XX-YY number |
| 5012 | * of bytes if possible. |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 5013 | * @param pi IntentSender call back used to |
| 5014 | * notify when the operation is completed.May be null |
| 5015 | * to indicate that no call back is desired. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5016 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5017 | * @hide |
| 5018 | */ |
Jeff Sharkey | 529f91f | 2015-04-18 20:23:13 -0700 | [diff] [blame] | 5019 | public void freeStorage(long freeStorageSize, IntentSender pi) { |
| 5020 | freeStorage(null, freeStorageSize, pi); |
| 5021 | } |
| 5022 | |
| 5023 | /** {@hide} */ |
| 5024 | public abstract void freeStorage(String volumeUuid, long freeStorageSize, IntentSender pi); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5025 | |
| 5026 | /** |
| 5027 | * Retrieve the size information for a package. |
| 5028 | * Since this may take a little while, the result will |
| 5029 | * be posted back to the given observer. The calling context |
| 5030 | * should have the {@link android.Manifest.permission#GET_PACKAGE_SIZE} permission. |
| 5031 | * |
| 5032 | * @param packageName The name of the package whose size information is to be retrieved |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5033 | * @param userId The user whose size information should be retrieved. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5034 | * @param observer An observer callback to get notified when the operation |
| 5035 | * is complete. |
| 5036 | * {@link android.content.pm.IPackageStatsObserver#onGetStatsCompleted(PackageStats, boolean)} |
| 5037 | * The observer's callback is invoked with a PackageStats object(containing the |
| 5038 | * code, data and cache sizes of the package) and a boolean value representing |
| 5039 | * the status of the operation. observer may be null to indicate that |
| 5040 | * no callback is desired. |
| 5041 | * |
| 5042 | * @hide |
| 5043 | */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 5044 | public abstract void getPackageSizeInfoAsUser(String packageName, @UserIdInt int userId, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5045 | IPackageStatsObserver observer); |
| 5046 | |
| 5047 | /** |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5048 | * Like {@link #getPackageSizeInfoAsUser(String, int, IPackageStatsObserver)}, but |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 5049 | * returns the size for the calling user. |
| 5050 | * |
| 5051 | * @hide |
| 5052 | */ |
| 5053 | public void getPackageSizeInfo(String packageName, IPackageStatsObserver observer) { |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5054 | getPackageSizeInfoAsUser(packageName, UserHandle.myUserId(), observer); |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 5055 | } |
| 5056 | |
| 5057 | /** |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5058 | * @deprecated This function no longer does anything; it was an old |
kmccormick | ac66b85 | 2013-03-28 15:17:15 -0700 | [diff] [blame] | 5059 | * approach to managing preferred activities, which has been superseded |
| 5060 | * by (and conflicts with) the modern activity-based preferences. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5061 | */ |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5062 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5063 | public abstract void addPackageToPreferred(String packageName); |
| 5064 | |
| 5065 | /** |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5066 | * @deprecated This function no longer does anything; it was an old |
kmccormick | ac66b85 | 2013-03-28 15:17:15 -0700 | [diff] [blame] | 5067 | * approach to managing preferred activities, which has been superseded |
| 5068 | * by (and conflicts with) the modern activity-based preferences. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5069 | */ |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5070 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5071 | public abstract void removePackageFromPreferred(String packageName); |
| 5072 | |
| 5073 | /** |
Jeff Sharkey | 629f984 | 2016-01-08 16:36:54 -0700 | [diff] [blame] | 5074 | * Retrieve the list of all currently configured preferred packages. The |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5075 | * first package on the list is the most preferred, the last is the |
| 5076 | * least preferred. |
| 5077 | * |
| 5078 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5079 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 5080 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 5081 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 5082 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 5083 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 5084 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 5085 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 5086 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 5087 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 5088 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5089 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5090 | * @return A List of PackageInfo objects, one for each preferred application, |
| 5091 | * in order of preference. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5092 | * |
| 5093 | * @see #GET_ACTIVITIES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5094 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5095 | * @see #GET_GIDS |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5096 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5097 | * @see #GET_INTENT_FILTERS |
| 5098 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5099 | * @see #GET_PERMISSIONS |
| 5100 | * @see #GET_PROVIDERS |
| 5101 | * @see #GET_RECEIVERS |
| 5102 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5103 | * @see #GET_SHARED_LIBRARY_FILES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5104 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5105 | * @see #GET_URI_PERMISSION_PATTERNS |
| 5106 | * @see #MATCH_DISABLED_COMPONENTS |
| 5107 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 5108 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5109 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 5110 | public abstract List<PackageInfo> getPreferredPackages(@PackageInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5111 | |
| 5112 | /** |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5113 | * @deprecated This is a protected API that should not have been available |
| 5114 | * to third party applications. It is the platform's responsibility for |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 5115 | * assigning preferred activities and this cannot be directly modified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5116 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5117 | * Add a new preferred activity mapping to the system. This will be used |
| 5118 | * to automatically select the given activity component when |
| 5119 | * {@link Context#startActivity(Intent) Context.startActivity()} finds |
| 5120 | * multiple matching activities and also matches the given filter. |
| 5121 | * |
| 5122 | * @param filter The set of intents under which this activity will be |
| 5123 | * made preferred. |
| 5124 | * @param match The IntentFilter match category that this preference |
| 5125 | * applies to. |
| 5126 | * @param set The set of activities that the user was picking from when |
| 5127 | * this preference was made. |
| 5128 | * @param activity The component name of the activity that is to be |
| 5129 | * preferred. |
| 5130 | */ |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5131 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5132 | public abstract void addPreferredActivity(IntentFilter filter, int match, |
| 5133 | ComponentName[] set, ComponentName activity); |
| 5134 | |
| 5135 | /** |
Amith Yamasani | a3f133a | 2012-08-09 17:11:28 -0700 | [diff] [blame] | 5136 | * Same as {@link #addPreferredActivity(IntentFilter, int, |
| 5137 | ComponentName[], ComponentName)}, but with a specific userId to apply the preference |
| 5138 | to. |
| 5139 | * @hide |
| 5140 | */ |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5141 | public void addPreferredActivityAsUser(IntentFilter filter, int match, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 5142 | ComponentName[] set, ComponentName activity, @UserIdInt int userId) { |
Amith Yamasani | a3f133a | 2012-08-09 17:11:28 -0700 | [diff] [blame] | 5143 | throw new RuntimeException("Not implemented. Must override in a subclass."); |
| 5144 | } |
| 5145 | |
| 5146 | /** |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5147 | * @deprecated This is a protected API that should not have been available |
| 5148 | * to third party applications. It is the platform's responsibility for |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 5149 | * assigning preferred activities and this cannot be directly modified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5150 | * |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 5151 | * Replaces an existing preferred activity mapping to the system, and if that were not present |
| 5152 | * adds a new preferred activity. This will be used |
| 5153 | * to automatically select the given activity component when |
| 5154 | * {@link Context#startActivity(Intent) Context.startActivity()} finds |
| 5155 | * multiple matching activities and also matches the given filter. |
| 5156 | * |
| 5157 | * @param filter The set of intents under which this activity will be |
| 5158 | * made preferred. |
| 5159 | * @param match The IntentFilter match category that this preference |
| 5160 | * applies to. |
| 5161 | * @param set The set of activities that the user was picking from when |
| 5162 | * this preference was made. |
| 5163 | * @param activity The component name of the activity that is to be |
| 5164 | * preferred. |
| 5165 | * @hide |
| 5166 | */ |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5167 | @Deprecated |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 5168 | public abstract void replacePreferredActivity(IntentFilter filter, int match, |
| 5169 | ComponentName[] set, ComponentName activity); |
| 5170 | |
| 5171 | /** |
Amith Yamasani | 41c1ded | 2014-08-05 11:15:05 -0700 | [diff] [blame] | 5172 | * @hide |
| 5173 | */ |
| 5174 | @Deprecated |
| 5175 | public void replacePreferredActivityAsUser(IntentFilter filter, int match, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 5176 | ComponentName[] set, ComponentName activity, @UserIdInt int userId) { |
Amith Yamasani | 41c1ded | 2014-08-05 11:15:05 -0700 | [diff] [blame] | 5177 | throw new RuntimeException("Not implemented. Must override in a subclass."); |
| 5178 | } |
| 5179 | |
| 5180 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5181 | * Remove all preferred activity mappings, previously added with |
| 5182 | * {@link #addPreferredActivity}, from the |
| 5183 | * system whose activities are implemented in the given package name. |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5184 | * An application can only clear its own package(s). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5185 | * |
| 5186 | * @param packageName The name of the package whose preferred activity |
| 5187 | * mappings are to be removed. |
| 5188 | */ |
| 5189 | public abstract void clearPackagePreferredActivities(String packageName); |
| 5190 | |
| 5191 | /** |
| 5192 | * Retrieve all preferred activities, previously added with |
| 5193 | * {@link #addPreferredActivity}, that are |
| 5194 | * currently registered with the system. |
| 5195 | * |
John Spurlock | 38e6425 | 2015-03-18 12:09:32 -0400 | [diff] [blame] | 5196 | * @param outFilters A required list in which to place the filters of all of the |
| 5197 | * preferred activities. |
| 5198 | * @param outActivities A required list in which to place the component names of |
| 5199 | * all of the preferred activities. |
| 5200 | * @param packageName An optional package in which you would like to limit |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5201 | * the list. If null, all activities will be returned; if non-null, only |
| 5202 | * those activities in the given package are returned. |
| 5203 | * |
| 5204 | * @return Returns the total number of registered preferred activities |
| 5205 | * (the number of distinct IntentFilter records, not the number of unique |
| 5206 | * activity components) that were found. |
| 5207 | */ |
John Spurlock | 38e6425 | 2015-03-18 12:09:32 -0400 | [diff] [blame] | 5208 | public abstract int getPreferredActivities(@NonNull List<IntentFilter> outFilters, |
| 5209 | @NonNull List<ComponentName> outActivities, String packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5210 | |
| 5211 | /** |
Christopher Tate | a2a0850d | 2013-09-05 16:38:58 -0700 | [diff] [blame] | 5212 | * Ask for the set of available 'home' activities and the current explicit |
| 5213 | * default, if any. |
| 5214 | * @hide |
| 5215 | */ |
| 5216 | public abstract ComponentName getHomeActivities(List<ResolveInfo> outActivities); |
| 5217 | |
| 5218 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5219 | * Set the enabled setting for a package component (activity, receiver, service, provider). |
| 5220 | * This setting will override any enabled state which may have been set by the component in its |
| 5221 | * manifest. |
| 5222 | * |
| 5223 | * @param componentName The component to enable |
| 5224 | * @param newState The new enabled state for the component. The legal values for this state |
| 5225 | * are: |
| 5226 | * {@link #COMPONENT_ENABLED_STATE_ENABLED}, |
| 5227 | * {@link #COMPONENT_ENABLED_STATE_DISABLED} |
| 5228 | * and |
| 5229 | * {@link #COMPONENT_ENABLED_STATE_DEFAULT} |
| 5230 | * The last one removes the setting, thereby restoring the component's state to |
| 5231 | * whatever was set in it's manifest (or enabled, by default). |
| 5232 | * @param flags Optional behavior flags: {@link #DONT_KILL_APP} or 0. |
| 5233 | */ |
| 5234 | public abstract void setComponentEnabledSetting(ComponentName componentName, |
| 5235 | int newState, int flags); |
| 5236 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5237 | /** |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 5238 | * Return the enabled setting for a package component (activity, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5239 | * receiver, service, provider). This returns the last value set by |
| 5240 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}; in most |
| 5241 | * cases this value will be {@link #COMPONENT_ENABLED_STATE_DEFAULT} since |
| 5242 | * the value originally specified in the manifest has not been modified. |
| 5243 | * |
| 5244 | * @param componentName The component to retrieve. |
| 5245 | * @return Returns the current enabled state for the component. May |
| 5246 | * be one of {@link #COMPONENT_ENABLED_STATE_ENABLED}, |
| 5247 | * {@link #COMPONENT_ENABLED_STATE_DISABLED}, or |
| 5248 | * {@link #COMPONENT_ENABLED_STATE_DEFAULT}. The last one means the |
| 5249 | * component's enabled state is based on the original information in |
| 5250 | * the manifest as found in {@link ComponentInfo}. |
| 5251 | */ |
| 5252 | public abstract int getComponentEnabledSetting(ComponentName componentName); |
| 5253 | |
| 5254 | /** |
| 5255 | * Set the enabled setting for an application |
| 5256 | * This setting will override any enabled state which may have been set by the application in |
| 5257 | * its manifest. It also overrides the enabled state set in the manifest for any of the |
| 5258 | * application's components. It does not override any enabled state set by |
| 5259 | * {@link #setComponentEnabledSetting} for any of the application's components. |
| 5260 | * |
| 5261 | * @param packageName The package name of the application to enable |
| 5262 | * @param newState The new enabled state for the component. The legal values for this state |
| 5263 | * are: |
| 5264 | * {@link #COMPONENT_ENABLED_STATE_ENABLED}, |
| 5265 | * {@link #COMPONENT_ENABLED_STATE_DISABLED} |
| 5266 | * and |
| 5267 | * {@link #COMPONENT_ENABLED_STATE_DEFAULT} |
| 5268 | * The last one removes the setting, thereby restoring the applications's state to |
| 5269 | * whatever was set in its manifest (or enabled, by default). |
| 5270 | * @param flags Optional behavior flags: {@link #DONT_KILL_APP} or 0. |
| 5271 | */ |
| 5272 | public abstract void setApplicationEnabledSetting(String packageName, |
| 5273 | int newState, int flags); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5274 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5275 | /** |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 5276 | * Return the enabled setting for an application. This returns |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5277 | * the last value set by |
| 5278 | * {@link #setApplicationEnabledSetting(String, int, int)}; in most |
| 5279 | * cases this value will be {@link #COMPONENT_ENABLED_STATE_DEFAULT} since |
| 5280 | * the value originally specified in the manifest has not been modified. |
| 5281 | * |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 5282 | * @param packageName The package name of the application to retrieve. |
| 5283 | * @return Returns the current enabled state for the application. May |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5284 | * be one of {@link #COMPONENT_ENABLED_STATE_ENABLED}, |
| 5285 | * {@link #COMPONENT_ENABLED_STATE_DISABLED}, or |
| 5286 | * {@link #COMPONENT_ENABLED_STATE_DEFAULT}. The last one means the |
| 5287 | * application's enabled state is based on the original information in |
| 5288 | * the manifest as found in {@link ComponentInfo}. |
Mathew Inwood | 1b9f8d9 | 2011-09-26 13:23:56 +0100 | [diff] [blame] | 5289 | * @throws IllegalArgumentException if the named package does not exist. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5290 | */ |
| 5291 | public abstract int getApplicationEnabledSetting(String packageName); |
| 5292 | |
| 5293 | /** |
Sudheer Shanka | bbb3ff2 | 2015-07-09 15:39:23 +0100 | [diff] [blame] | 5294 | * Flush the package restrictions for a given user to disk. This forces the package restrictions |
| 5295 | * like component and package enabled settings to be written to disk and avoids the delay that |
| 5296 | * is otherwise present when changing those settings. |
| 5297 | * |
| 5298 | * @param userId Ther userId of the user whose restrictions are to be flushed. |
| 5299 | * @hide |
| 5300 | */ |
| 5301 | public abstract void flushPackageRestrictionsAsUser(int userId); |
| 5302 | |
| 5303 | /** |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5304 | * Puts the package in a hidden state, which is almost like an uninstalled state, |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5305 | * making the package unavailable, but it doesn't remove the data or the actual |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5306 | * package file. Application can be unhidden by either resetting the hidden state |
| 5307 | * or by installing it, such as with {@link #installExistingPackage(String)} |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5308 | * @hide |
| 5309 | */ |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5310 | public abstract boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden, |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5311 | UserHandle userHandle); |
| 5312 | |
| 5313 | /** |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5314 | * Returns the hidden state of a package. |
| 5315 | * @see #setApplicationHiddenSettingAsUser(String, boolean, UserHandle) |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5316 | * @hide |
| 5317 | */ |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5318 | public abstract boolean getApplicationHiddenSettingAsUser(String packageName, |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5319 | UserHandle userHandle); |
| 5320 | |
| 5321 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5322 | * Return whether the device has been booted into safe mode. |
| 5323 | */ |
| 5324 | public abstract boolean isSafeMode(); |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 5325 | |
| 5326 | /** |
Svetoslav | f7c06eb | 2015-06-10 18:43:22 -0700 | [diff] [blame] | 5327 | * Adds a listener for permission changes for installed packages. |
| 5328 | * |
| 5329 | * @param listener The listener to add. |
| 5330 | * |
| 5331 | * @hide |
| 5332 | */ |
| 5333 | @SystemApi |
| 5334 | @RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS) |
| 5335 | public abstract void addOnPermissionsChangeListener(OnPermissionsChangedListener listener); |
| 5336 | |
| 5337 | /** |
| 5338 | * Remvoes a listener for permission changes for installed packages. |
| 5339 | * |
| 5340 | * @param listener The listener to remove. |
| 5341 | * |
| 5342 | * @hide |
| 5343 | */ |
| 5344 | @SystemApi |
| 5345 | public abstract void removeOnPermissionsChangeListener(OnPermissionsChangedListener listener); |
| 5346 | |
| 5347 | /** |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5348 | * Return the {@link KeySet} associated with the String alias for this |
| 5349 | * application. |
| 5350 | * |
| 5351 | * @param alias The alias for a given {@link KeySet} as defined in the |
| 5352 | * application's AndroidManifest.xml. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5353 | * @hide |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5354 | */ |
| 5355 | public abstract KeySet getKeySetByAlias(String packageName, String alias); |
| 5356 | |
Ihab Awad | 1ec6888 | 2014-09-12 11:09:01 -0700 | [diff] [blame] | 5357 | /** Return the signing {@link KeySet} for this application. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5358 | * @hide |
| 5359 | */ |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5360 | public abstract KeySet getSigningKeySet(String packageName); |
| 5361 | |
| 5362 | /** |
| 5363 | * Return whether the package denoted by packageName has been signed by all |
| 5364 | * of the keys specified by the {@link KeySet} ks. This will return true if |
| 5365 | * the package has been signed by additional keys (a superset) as well. |
| 5366 | * Compare to {@link #isSignedByExactly(String packageName, KeySet ks)}. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5367 | * @hide |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5368 | */ |
| 5369 | public abstract boolean isSignedBy(String packageName, KeySet ks); |
| 5370 | |
| 5371 | /** |
| 5372 | * Return whether the package denoted by packageName has been signed by all |
| 5373 | * of, and only, the keys specified by the {@link KeySet} ks. Compare to |
| 5374 | * {@link #isSignedBy(String packageName, KeySet ks)}. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5375 | * @hide |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5376 | */ |
| 5377 | public abstract boolean isSignedByExactly(String packageName, KeySet ks); |
| 5378 | |
| 5379 | /** |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5380 | * Puts the package in a suspended state, where attempts at starting activities are denied. |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5381 | * |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5382 | * <p>It doesn't remove the data or the actual package file. The application notifications |
| 5383 | * will be hidden, the application will not show up in recents, will not be able to show |
| 5384 | * toasts or dialogs or ring the device. |
| 5385 | * |
Kenny Guy | 871f3eb | 2016-03-09 20:06:16 +0000 | [diff] [blame] | 5386 | * <p>The package must already be installed. If the package is uninstalled while suspended |
| 5387 | * the package will no longer be suspended. |
| 5388 | * |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5389 | * @param packageNames The names of the packages to set the suspended status. |
| 5390 | * @param suspended If set to {@code true} than the packages will be suspended, if set to |
| 5391 | * {@code false} the packages will be unsuspended. |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5392 | * @param userId The user id. |
| 5393 | * |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5394 | * @return an array of package names for which the suspended status is not set as requested in |
| 5395 | * this method. |
| 5396 | * |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5397 | * @hide |
| 5398 | */ |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5399 | public abstract String[] setPackagesSuspendedAsUser( |
| 5400 | String[] packageNames, boolean suspended, @UserIdInt int userId); |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5401 | |
Andrei Stingaceanu | 355b232 | 2016-02-12 16:43:51 +0000 | [diff] [blame] | 5402 | /** |
| 5403 | * @see #setPackageSuspendedAsUser(String, boolean, int) |
| 5404 | * @param packageName The name of the package to get the suspended status of. |
| 5405 | * @param userId The user id. |
| 5406 | * @return {@code true} if the package is suspended or {@code false} if the package is not |
| 5407 | * suspended or could not be found. |
| 5408 | * @hide |
| 5409 | */ |
| 5410 | public abstract boolean isPackageSuspendedForUser(String packageName, int userId); |
| 5411 | |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 5412 | /** {@hide} */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5413 | public static boolean isMoveStatusFinished(int status) { |
| 5414 | return (status < 0 || status > 100); |
| 5415 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5416 | |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 5417 | /** {@hide} */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5418 | public static abstract class MoveCallback { |
Jeff Sharkey | 50a0545 | 2015-04-29 11:24:52 -0700 | [diff] [blame] | 5419 | public void onCreated(int moveId, Bundle extras) {} |
| 5420 | public abstract void onStatusChanged(int moveId, int status, long estMillis); |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5421 | } |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 5422 | |
| 5423 | /** {@hide} */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5424 | public abstract int getMoveStatus(int moveId); |
| 5425 | |
| 5426 | /** {@hide} */ |
| 5427 | public abstract void registerMoveCallback(MoveCallback callback, Handler handler); |
| 5428 | /** {@hide} */ |
| 5429 | public abstract void unregisterMoveCallback(MoveCallback callback); |
| 5430 | |
| 5431 | /** {@hide} */ |
| 5432 | public abstract int movePackage(String packageName, VolumeInfo vol); |
| 5433 | /** {@hide} */ |
| 5434 | public abstract @Nullable VolumeInfo getPackageCurrentVolume(ApplicationInfo app); |
| 5435 | /** {@hide} */ |
| 5436 | public abstract @NonNull List<VolumeInfo> getPackageCandidateVolumes(ApplicationInfo app); |
| 5437 | |
| 5438 | /** {@hide} */ |
| 5439 | public abstract int movePrimaryStorage(VolumeInfo vol); |
| 5440 | /** {@hide} */ |
| 5441 | public abstract @Nullable VolumeInfo getPrimaryStorageCurrentVolume(); |
| 5442 | /** {@hide} */ |
| 5443 | public abstract @NonNull List<VolumeInfo> getPrimaryStorageCandidateVolumes(); |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 5444 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5445 | /** |
Amith Yamasani | 1359360 | 2012-03-22 16:16:17 -0700 | [diff] [blame] | 5446 | * Returns the device identity that verifiers can use to associate their scheme to a particular |
| 5447 | * device. This should not be used by anything other than a package verifier. |
Aravind Akella | 068b0c0 | 2013-10-12 17:39:15 -0700 | [diff] [blame] | 5448 | * |
Kenny Root | 0aaa0d9 | 2011-09-12 16:42:55 -0700 | [diff] [blame] | 5449 | * @return identity that uniquely identifies current device |
| 5450 | * @hide |
| 5451 | */ |
| 5452 | public abstract VerifierDeviceIdentity getVerifierDeviceIdentity(); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 5453 | |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5454 | /** |
Jeff Hao | 9f60c08 | 2014-10-28 18:51:07 -0700 | [diff] [blame] | 5455 | * Returns true if the device is upgrading, such as first boot after OTA. |
| 5456 | * |
| 5457 | * @hide |
| 5458 | */ |
| 5459 | public abstract boolean isUpgrade(); |
| 5460 | |
| 5461 | /** |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5462 | * Return interface that offers the ability to install, upgrade, and remove |
| 5463 | * applications on the device. |
| 5464 | */ |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5465 | public abstract @NonNull PackageInstaller getPackageInstaller(); |
Jeff Sharkey | 3a44f3f | 2014-04-28 17:36:31 -0700 | [diff] [blame] | 5466 | |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 5467 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5468 | * Adds a {@code CrossProfileIntentFilter}. After calling this method all |
| 5469 | * intents sent from the user with id sourceUserId can also be be resolved |
| 5470 | * by activities in the user with id targetUserId if they match the |
| 5471 | * specified intent filter. |
| 5472 | * |
Nicolas Prevot | 3f7777f | 2014-07-24 15:58:39 +0100 | [diff] [blame] | 5473 | * @param filter The {@link IntentFilter} the intent has to match |
| 5474 | * @param sourceUserId The source user id. |
| 5475 | * @param targetUserId The target user id. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5476 | * @param flags The possible values are {@link #SKIP_CURRENT_PROFILE} and |
| 5477 | * {@link #ONLY_IF_NO_MATCH_FOUND}. |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 5478 | * @hide |
| 5479 | */ |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 5480 | public abstract void addCrossProfileIntentFilter(IntentFilter filter, int sourceUserId, |
| 5481 | int targetUserId, int flags); |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 5482 | |
| 5483 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5484 | * Clearing {@code CrossProfileIntentFilter}s which have the specified user |
| 5485 | * as their source, and have been set by the app calling this method. |
| 5486 | * |
Nicolas Prevot | 3f7777f | 2014-07-24 15:58:39 +0100 | [diff] [blame] | 5487 | * @param sourceUserId The source user id. |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 5488 | * @hide |
| 5489 | */ |
Nicolas Prevot | 8194899 | 2014-05-16 18:25:26 +0100 | [diff] [blame] | 5490 | public abstract void clearCrossProfileIntentFilters(int sourceUserId); |
Alexandra Gherghina | 6e2ae25 | 2014-06-12 16:03:58 +0100 | [diff] [blame] | 5491 | |
| 5492 | /** |
Nicolas Prevot | 88cc346 | 2014-05-14 14:51:48 +0100 | [diff] [blame] | 5493 | * @hide |
| 5494 | */ |
Nicolas Prevot | 7f7b0c7 | 2014-06-23 15:59:38 +0100 | [diff] [blame] | 5495 | public abstract Drawable loadItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo); |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5496 | |
Benjamin Franz | ec2d48b | 2014-10-01 15:38:43 +0100 | [diff] [blame] | 5497 | /** |
| 5498 | * @hide |
| 5499 | */ |
| 5500 | public abstract Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo); |
| 5501 | |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5502 | /** {@hide} */ |
| 5503 | public abstract boolean isPackageAvailable(String packageName); |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5504 | |
| 5505 | /** {@hide} */ |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5506 | public static String installStatusToString(int status, String msg) { |
| 5507 | final String str = installStatusToString(status); |
| 5508 | if (msg != null) { |
| 5509 | return str + ": " + msg; |
| 5510 | } else { |
| 5511 | return str; |
| 5512 | } |
| 5513 | } |
| 5514 | |
| 5515 | /** {@hide} */ |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5516 | public static String installStatusToString(int status) { |
| 5517 | switch (status) { |
| 5518 | case INSTALL_SUCCEEDED: return "INSTALL_SUCCEEDED"; |
| 5519 | case INSTALL_FAILED_ALREADY_EXISTS: return "INSTALL_FAILED_ALREADY_EXISTS"; |
| 5520 | case INSTALL_FAILED_INVALID_APK: return "INSTALL_FAILED_INVALID_APK"; |
| 5521 | case INSTALL_FAILED_INVALID_URI: return "INSTALL_FAILED_INVALID_URI"; |
| 5522 | case INSTALL_FAILED_INSUFFICIENT_STORAGE: return "INSTALL_FAILED_INSUFFICIENT_STORAGE"; |
| 5523 | case INSTALL_FAILED_DUPLICATE_PACKAGE: return "INSTALL_FAILED_DUPLICATE_PACKAGE"; |
| 5524 | case INSTALL_FAILED_NO_SHARED_USER: return "INSTALL_FAILED_NO_SHARED_USER"; |
| 5525 | case INSTALL_FAILED_UPDATE_INCOMPATIBLE: return "INSTALL_FAILED_UPDATE_INCOMPATIBLE"; |
| 5526 | case INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: return "INSTALL_FAILED_SHARED_USER_INCOMPATIBLE"; |
| 5527 | case INSTALL_FAILED_MISSING_SHARED_LIBRARY: return "INSTALL_FAILED_MISSING_SHARED_LIBRARY"; |
| 5528 | case INSTALL_FAILED_REPLACE_COULDNT_DELETE: return "INSTALL_FAILED_REPLACE_COULDNT_DELETE"; |
| 5529 | case INSTALL_FAILED_DEXOPT: return "INSTALL_FAILED_DEXOPT"; |
| 5530 | case INSTALL_FAILED_OLDER_SDK: return "INSTALL_FAILED_OLDER_SDK"; |
| 5531 | case INSTALL_FAILED_CONFLICTING_PROVIDER: return "INSTALL_FAILED_CONFLICTING_PROVIDER"; |
| 5532 | case INSTALL_FAILED_NEWER_SDK: return "INSTALL_FAILED_NEWER_SDK"; |
| 5533 | case INSTALL_FAILED_TEST_ONLY: return "INSTALL_FAILED_TEST_ONLY"; |
| 5534 | case INSTALL_FAILED_CPU_ABI_INCOMPATIBLE: return "INSTALL_FAILED_CPU_ABI_INCOMPATIBLE"; |
| 5535 | case INSTALL_FAILED_MISSING_FEATURE: return "INSTALL_FAILED_MISSING_FEATURE"; |
| 5536 | case INSTALL_FAILED_CONTAINER_ERROR: return "INSTALL_FAILED_CONTAINER_ERROR"; |
| 5537 | case INSTALL_FAILED_INVALID_INSTALL_LOCATION: return "INSTALL_FAILED_INVALID_INSTALL_LOCATION"; |
| 5538 | case INSTALL_FAILED_MEDIA_UNAVAILABLE: return "INSTALL_FAILED_MEDIA_UNAVAILABLE"; |
| 5539 | case INSTALL_FAILED_VERIFICATION_TIMEOUT: return "INSTALL_FAILED_VERIFICATION_TIMEOUT"; |
| 5540 | case INSTALL_FAILED_VERIFICATION_FAILURE: return "INSTALL_FAILED_VERIFICATION_FAILURE"; |
| 5541 | case INSTALL_FAILED_PACKAGE_CHANGED: return "INSTALL_FAILED_PACKAGE_CHANGED"; |
| 5542 | case INSTALL_FAILED_UID_CHANGED: return "INSTALL_FAILED_UID_CHANGED"; |
| 5543 | case INSTALL_FAILED_VERSION_DOWNGRADE: return "INSTALL_FAILED_VERSION_DOWNGRADE"; |
| 5544 | case INSTALL_PARSE_FAILED_NOT_APK: return "INSTALL_PARSE_FAILED_NOT_APK"; |
| 5545 | case INSTALL_PARSE_FAILED_BAD_MANIFEST: return "INSTALL_PARSE_FAILED_BAD_MANIFEST"; |
| 5546 | case INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: return "INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION"; |
| 5547 | case INSTALL_PARSE_FAILED_NO_CERTIFICATES: return "INSTALL_PARSE_FAILED_NO_CERTIFICATES"; |
| 5548 | case INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES: return "INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES"; |
| 5549 | case INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING: return "INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING"; |
| 5550 | case INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME: return "INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME"; |
| 5551 | case INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID: return "INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID"; |
| 5552 | case INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: return "INSTALL_PARSE_FAILED_MANIFEST_MALFORMED"; |
| 5553 | case INSTALL_PARSE_FAILED_MANIFEST_EMPTY: return "INSTALL_PARSE_FAILED_MANIFEST_EMPTY"; |
| 5554 | case INSTALL_FAILED_INTERNAL_ERROR: return "INSTALL_FAILED_INTERNAL_ERROR"; |
| 5555 | case INSTALL_FAILED_USER_RESTRICTED: return "INSTALL_FAILED_USER_RESTRICTED"; |
| 5556 | case INSTALL_FAILED_DUPLICATE_PERMISSION: return "INSTALL_FAILED_DUPLICATE_PERMISSION"; |
| 5557 | case INSTALL_FAILED_NO_MATCHING_ABIS: return "INSTALL_FAILED_NO_MATCHING_ABIS"; |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5558 | case INSTALL_FAILED_ABORTED: return "INSTALL_FAILED_ABORTED"; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5559 | default: return Integer.toString(status); |
| 5560 | } |
| 5561 | } |
| 5562 | |
| 5563 | /** {@hide} */ |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5564 | public static int installStatusToPublicStatus(int status) { |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5565 | switch (status) { |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5566 | case INSTALL_SUCCEEDED: return PackageInstaller.STATUS_SUCCESS; |
| 5567 | case INSTALL_FAILED_ALREADY_EXISTS: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5568 | case INSTALL_FAILED_INVALID_APK: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5569 | case INSTALL_FAILED_INVALID_URI: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5570 | case INSTALL_FAILED_INSUFFICIENT_STORAGE: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5571 | case INSTALL_FAILED_DUPLICATE_PACKAGE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5572 | case INSTALL_FAILED_NO_SHARED_USER: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5573 | case INSTALL_FAILED_UPDATE_INCOMPATIBLE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5574 | case INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5575 | case INSTALL_FAILED_MISSING_SHARED_LIBRARY: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5576 | case INSTALL_FAILED_REPLACE_COULDNT_DELETE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5577 | case INSTALL_FAILED_DEXOPT: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5578 | case INSTALL_FAILED_OLDER_SDK: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5579 | case INSTALL_FAILED_CONFLICTING_PROVIDER: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5580 | case INSTALL_FAILED_NEWER_SDK: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5581 | case INSTALL_FAILED_TEST_ONLY: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5582 | case INSTALL_FAILED_CPU_ABI_INCOMPATIBLE: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5583 | case INSTALL_FAILED_MISSING_FEATURE: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5584 | case INSTALL_FAILED_CONTAINER_ERROR: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5585 | case INSTALL_FAILED_INVALID_INSTALL_LOCATION: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5586 | case INSTALL_FAILED_MEDIA_UNAVAILABLE: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5587 | case INSTALL_FAILED_VERIFICATION_TIMEOUT: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5588 | case INSTALL_FAILED_VERIFICATION_FAILURE: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5589 | case INSTALL_FAILED_PACKAGE_CHANGED: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5590 | case INSTALL_FAILED_UID_CHANGED: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5591 | case INSTALL_FAILED_VERSION_DOWNGRADE: return PackageInstaller.STATUS_FAILURE_INVALID; |
Svetoslav | d965370 | 2015-05-13 18:02:46 -0700 | [diff] [blame] | 5592 | case INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE: return PackageInstaller.STATUS_FAILURE_INVALID; |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5593 | case INSTALL_PARSE_FAILED_NOT_APK: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5594 | case INSTALL_PARSE_FAILED_BAD_MANIFEST: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5595 | case INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5596 | case INSTALL_PARSE_FAILED_NO_CERTIFICATES: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5597 | case INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5598 | case INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5599 | case INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5600 | case INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5601 | case INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5602 | case INSTALL_PARSE_FAILED_MANIFEST_EMPTY: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5603 | case INSTALL_FAILED_INTERNAL_ERROR: return PackageInstaller.STATUS_FAILURE; |
| 5604 | case INSTALL_FAILED_USER_RESTRICTED: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5605 | case INSTALL_FAILED_DUPLICATE_PERMISSION: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5606 | case INSTALL_FAILED_NO_MATCHING_ABIS: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5607 | case INSTALL_FAILED_ABORTED: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5608 | default: return PackageInstaller.STATUS_FAILURE; |
| 5609 | } |
| 5610 | } |
| 5611 | |
| 5612 | /** {@hide} */ |
| 5613 | public static String deleteStatusToString(int status, String msg) { |
| 5614 | final String str = deleteStatusToString(status); |
| 5615 | if (msg != null) { |
| 5616 | return str + ": " + msg; |
| 5617 | } else { |
| 5618 | return str; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5619 | } |
| 5620 | } |
| 5621 | |
| 5622 | /** {@hide} */ |
| 5623 | public static String deleteStatusToString(int status) { |
| 5624 | switch (status) { |
| 5625 | case DELETE_SUCCEEDED: return "DELETE_SUCCEEDED"; |
| 5626 | case DELETE_FAILED_INTERNAL_ERROR: return "DELETE_FAILED_INTERNAL_ERROR"; |
| 5627 | case DELETE_FAILED_DEVICE_POLICY_MANAGER: return "DELETE_FAILED_DEVICE_POLICY_MANAGER"; |
| 5628 | case DELETE_FAILED_USER_RESTRICTED: return "DELETE_FAILED_USER_RESTRICTED"; |
| 5629 | case DELETE_FAILED_OWNER_BLOCKED: return "DELETE_FAILED_OWNER_BLOCKED"; |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5630 | case DELETE_FAILED_ABORTED: return "DELETE_FAILED_ABORTED"; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5631 | default: return Integer.toString(status); |
| 5632 | } |
| 5633 | } |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5634 | |
| 5635 | /** {@hide} */ |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5636 | public static int deleteStatusToPublicStatus(int status) { |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5637 | switch (status) { |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5638 | case DELETE_SUCCEEDED: return PackageInstaller.STATUS_SUCCESS; |
| 5639 | case DELETE_FAILED_INTERNAL_ERROR: return PackageInstaller.STATUS_FAILURE; |
| 5640 | case DELETE_FAILED_DEVICE_POLICY_MANAGER: return PackageInstaller.STATUS_FAILURE_BLOCKED; |
| 5641 | case DELETE_FAILED_USER_RESTRICTED: return PackageInstaller.STATUS_FAILURE_BLOCKED; |
| 5642 | case DELETE_FAILED_OWNER_BLOCKED: return PackageInstaller.STATUS_FAILURE_BLOCKED; |
| 5643 | case DELETE_FAILED_ABORTED: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5644 | default: return PackageInstaller.STATUS_FAILURE; |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5645 | } |
| 5646 | } |
Jeff Sharkey | 6c0b9da | 2014-08-07 22:07:11 -0700 | [diff] [blame] | 5647 | |
| 5648 | /** {@hide} */ |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 5649 | public static String permissionFlagToString(int flag) { |
| 5650 | switch (flag) { |
Svetoslav | 4a5f4a2 | 2015-07-07 18:18:15 -0700 | [diff] [blame] | 5651 | case FLAG_PERMISSION_GRANTED_BY_DEFAULT: return "GRANTED_BY_DEFAULT"; |
| 5652 | case FLAG_PERMISSION_POLICY_FIXED: return "POLICY_FIXED"; |
| 5653 | case FLAG_PERMISSION_SYSTEM_FIXED: return "SYSTEM_FIXED"; |
| 5654 | case FLAG_PERMISSION_USER_SET: return "USER_SET"; |
| 5655 | case FLAG_PERMISSION_REVOKE_ON_UPGRADE: return "REVOKE_ON_UPGRADE"; |
| 5656 | case FLAG_PERMISSION_USER_FIXED: return "USER_FIXED"; |
Svet Ganov | 9c165d7 | 2015-12-01 19:52:26 -0800 | [diff] [blame] | 5657 | case FLAG_PERMISSION_REVIEW_REQUIRED: return "REVIEW_REQUIRED"; |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 5658 | default: return Integer.toString(flag); |
| 5659 | } |
| 5660 | } |
| 5661 | |
| 5662 | /** {@hide} */ |
Jeff Sharkey | 6c0b9da | 2014-08-07 22:07:11 -0700 | [diff] [blame] | 5663 | public static class LegacyPackageInstallObserver extends PackageInstallObserver { |
| 5664 | private final IPackageInstallObserver mLegacy; |
| 5665 | |
| 5666 | public LegacyPackageInstallObserver(IPackageInstallObserver legacy) { |
| 5667 | mLegacy = legacy; |
| 5668 | } |
| 5669 | |
| 5670 | @Override |
| 5671 | public void onPackageInstalled(String basePackageName, int returnCode, String msg, |
| 5672 | Bundle extras) { |
| 5673 | if (mLegacy == null) return; |
| 5674 | try { |
| 5675 | mLegacy.packageInstalled(basePackageName, returnCode); |
| 5676 | } catch (RemoteException ignored) { |
| 5677 | } |
| 5678 | } |
| 5679 | } |
| 5680 | |
| 5681 | /** {@hide} */ |
| 5682 | public static class LegacyPackageDeleteObserver extends PackageDeleteObserver { |
| 5683 | private final IPackageDeleteObserver mLegacy; |
| 5684 | |
| 5685 | public LegacyPackageDeleteObserver(IPackageDeleteObserver legacy) { |
| 5686 | mLegacy = legacy; |
| 5687 | } |
| 5688 | |
| 5689 | @Override |
| 5690 | public void onPackageDeleted(String basePackageName, int returnCode, String msg) { |
| 5691 | if (mLegacy == null) return; |
| 5692 | try { |
| 5693 | mLegacy.packageDeleted(basePackageName, returnCode); |
| 5694 | } catch (RemoteException ignored) { |
| 5695 | } |
| 5696 | } |
| 5697 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5698 | } |