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, |
Todd Kennedy | d6ee0ba | 2016-03-31 15:11:11 -0700 | [diff] [blame] | 133 | MATCH_FACTORY_ONLY, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 134 | MATCH_DEBUG_TRIAGED_MISSING, |
Todd Kennedy | 1f397f4 | 2016-06-28 12:14:11 -0700 | [diff] [blame] | 135 | GET_DISABLED_COMPONENTS, |
| 136 | GET_DISABLED_UNTIL_USED_COMPONENTS, |
| 137 | GET_UNINSTALLED_PACKAGES, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 138 | }) |
| 139 | @Retention(RetentionPolicy.SOURCE) |
| 140 | public @interface PackageInfoFlags {} |
| 141 | |
| 142 | /** @hide */ |
| 143 | @IntDef(flag = true, value = { |
| 144 | GET_META_DATA, |
| 145 | GET_SHARED_LIBRARY_FILES, |
| 146 | MATCH_UNINSTALLED_PACKAGES, |
| 147 | MATCH_SYSTEM_ONLY, |
| 148 | MATCH_DEBUG_TRIAGED_MISSING, |
Todd Kennedy | 5a32c6c | 2016-07-07 14:29:06 -0700 | [diff] [blame] | 149 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
| 150 | GET_DISABLED_UNTIL_USED_COMPONENTS, |
Todd Kennedy | 1f397f4 | 2016-06-28 12:14:11 -0700 | [diff] [blame] | 151 | GET_UNINSTALLED_PACKAGES, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 152 | }) |
| 153 | @Retention(RetentionPolicy.SOURCE) |
| 154 | public @interface ApplicationInfoFlags {} |
| 155 | |
| 156 | /** @hide */ |
| 157 | @IntDef(flag = true, value = { |
| 158 | GET_META_DATA, |
| 159 | GET_SHARED_LIBRARY_FILES, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 160 | MATCH_ALL, |
| 161 | MATCH_DEBUG_TRIAGED_MISSING, |
| 162 | MATCH_DEFAULT_ONLY, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 163 | MATCH_DISABLED_COMPONENTS, |
| 164 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 165 | MATCH_DIRECT_BOOT_AWARE, |
| 166 | MATCH_DIRECT_BOOT_UNAWARE, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 167 | MATCH_SYSTEM_ONLY, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 168 | MATCH_UNINSTALLED_PACKAGES, |
Todd Kennedy | 1f397f4 | 2016-06-28 12:14:11 -0700 | [diff] [blame] | 169 | GET_DISABLED_COMPONENTS, |
| 170 | GET_DISABLED_UNTIL_USED_COMPONENTS, |
| 171 | GET_UNINSTALLED_PACKAGES, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 172 | }) |
| 173 | @Retention(RetentionPolicy.SOURCE) |
| 174 | public @interface ComponentInfoFlags {} |
| 175 | |
| 176 | /** @hide */ |
| 177 | @IntDef(flag = true, value = { |
| 178 | GET_META_DATA, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 179 | GET_RESOLVED_FILTER, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 180 | GET_SHARED_LIBRARY_FILES, |
| 181 | MATCH_ALL, |
| 182 | MATCH_DEBUG_TRIAGED_MISSING, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 183 | MATCH_DISABLED_COMPONENTS, |
| 184 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 185 | MATCH_DEFAULT_ONLY, |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 186 | MATCH_DIRECT_BOOT_AWARE, |
| 187 | MATCH_DIRECT_BOOT_UNAWARE, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 188 | MATCH_SYSTEM_ONLY, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 189 | MATCH_UNINSTALLED_PACKAGES, |
Todd Kennedy | 1f397f4 | 2016-06-28 12:14:11 -0700 | [diff] [blame] | 190 | GET_DISABLED_COMPONENTS, |
| 191 | GET_DISABLED_UNTIL_USED_COMPONENTS, |
| 192 | GET_UNINSTALLED_PACKAGES, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 193 | }) |
| 194 | @Retention(RetentionPolicy.SOURCE) |
| 195 | public @interface ResolveInfoFlags {} |
| 196 | |
| 197 | /** @hide */ |
| 198 | @IntDef(flag = true, value = { |
| 199 | GET_META_DATA, |
| 200 | }) |
| 201 | @Retention(RetentionPolicy.SOURCE) |
| 202 | public @interface PermissionInfoFlags {} |
| 203 | |
| 204 | /** @hide */ |
| 205 | @IntDef(flag = true, value = { |
| 206 | GET_META_DATA, |
| 207 | }) |
| 208 | @Retention(RetentionPolicy.SOURCE) |
| 209 | public @interface PermissionGroupInfoFlags {} |
| 210 | |
| 211 | /** @hide */ |
| 212 | @IntDef(flag = true, value = { |
| 213 | GET_META_DATA, |
| 214 | }) |
| 215 | @Retention(RetentionPolicy.SOURCE) |
| 216 | public @interface InstrumentationInfoFlags {} |
| 217 | |
| 218 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 219 | * {@link PackageInfo} flag: return information about |
| 220 | * activities in the package in {@link PackageInfo#activities}. |
| 221 | */ |
| 222 | public static final int GET_ACTIVITIES = 0x00000001; |
| 223 | |
| 224 | /** |
| 225 | * {@link PackageInfo} flag: return information about |
| 226 | * intent receivers in the package in |
| 227 | * {@link PackageInfo#receivers}. |
| 228 | */ |
| 229 | public static final int GET_RECEIVERS = 0x00000002; |
| 230 | |
| 231 | /** |
| 232 | * {@link PackageInfo} flag: return information about |
| 233 | * services in the package in {@link PackageInfo#services}. |
| 234 | */ |
| 235 | public static final int GET_SERVICES = 0x00000004; |
| 236 | |
| 237 | /** |
| 238 | * {@link PackageInfo} flag: return information about |
| 239 | * content providers in the package in |
| 240 | * {@link PackageInfo#providers}. |
| 241 | */ |
| 242 | public static final int GET_PROVIDERS = 0x00000008; |
| 243 | |
| 244 | /** |
| 245 | * {@link PackageInfo} flag: return information about |
| 246 | * instrumentation in the package in |
| 247 | * {@link PackageInfo#instrumentation}. |
| 248 | */ |
| 249 | public static final int GET_INSTRUMENTATION = 0x00000010; |
| 250 | |
| 251 | /** |
| 252 | * {@link PackageInfo} flag: return information about the |
| 253 | * intent filters supported by the activity. |
| 254 | */ |
| 255 | public static final int GET_INTENT_FILTERS = 0x00000020; |
| 256 | |
| 257 | /** |
| 258 | * {@link PackageInfo} flag: return information about the |
| 259 | * signatures included in the package. |
| 260 | */ |
| 261 | public static final int GET_SIGNATURES = 0x00000040; |
| 262 | |
| 263 | /** |
| 264 | * {@link ResolveInfo} flag: return the IntentFilter that |
| 265 | * was matched for a particular ResolveInfo in |
| 266 | * {@link ResolveInfo#filter}. |
| 267 | */ |
| 268 | public static final int GET_RESOLVED_FILTER = 0x00000040; |
| 269 | |
| 270 | /** |
| 271 | * {@link ComponentInfo} flag: return the {@link ComponentInfo#metaData} |
| 272 | * data {@link android.os.Bundle}s that are associated with a component. |
| 273 | * This applies for any API returning a ComponentInfo subclass. |
| 274 | */ |
| 275 | public static final int GET_META_DATA = 0x00000080; |
| 276 | |
| 277 | /** |
| 278 | * {@link PackageInfo} flag: return the |
| 279 | * {@link PackageInfo#gids group ids} that are associated with an |
| 280 | * application. |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 281 | * 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] | 282 | * directly or nested inside of another. |
| 283 | */ |
| 284 | public static final int GET_GIDS = 0x00000100; |
| 285 | |
| 286 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 287 | * @deprecated replaced with {@link #MATCH_DISABLED_COMPONENTS} |
| 288 | */ |
| 289 | @Deprecated |
| 290 | public static final int GET_DISABLED_COMPONENTS = 0x00000200; |
| 291 | |
| 292 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 293 | * {@link PackageInfo} flag: include disabled components in the returned info. |
| 294 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 295 | public static final int MATCH_DISABLED_COMPONENTS = 0x00000200; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 296 | |
| 297 | /** |
| 298 | * {@link ApplicationInfo} flag: return the |
| 299 | * {@link ApplicationInfo#sharedLibraryFiles paths to the shared libraries} |
| 300 | * that are associated with an application. |
| 301 | * This applies for any API returning an ApplicationInfo class, either |
| 302 | * directly or nested inside of another. |
| 303 | */ |
| 304 | public static final int GET_SHARED_LIBRARY_FILES = 0x00000400; |
| 305 | |
| 306 | /** |
| 307 | * {@link ProviderInfo} flag: return the |
| 308 | * {@link ProviderInfo#uriPermissionPatterns URI permission patterns} |
| 309 | * that are associated with a content provider. |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 310 | * 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] | 311 | * directly or nested inside of another. |
| 312 | */ |
| 313 | public static final int GET_URI_PERMISSION_PATTERNS = 0x00000800; |
| 314 | /** |
| 315 | * {@link PackageInfo} flag: return information about |
| 316 | * permissions in the package in |
| 317 | * {@link PackageInfo#permissions}. |
| 318 | */ |
| 319 | public static final int GET_PERMISSIONS = 0x00001000; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 320 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 321 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 322 | * @deprecated replaced with {@link #MATCH_UNINSTALLED_PACKAGES} |
| 323 | */ |
| 324 | @Deprecated |
| 325 | public static final int GET_UNINSTALLED_PACKAGES = 0x00002000; |
| 326 | |
| 327 | /** |
Kenny Root | 685f490 | 2011-11-03 10:13:29 -0700 | [diff] [blame] | 328 | * Flag parameter to retrieve some information about all applications (even |
| 329 | * uninstalled ones) which have data directories. This state could have |
| 330 | * resulted if applications have been deleted with flag |
| 331 | * {@code DONT_DELETE_DATA} with a possibility of being replaced or |
| 332 | * reinstalled in future. |
| 333 | * <p> |
| 334 | * Note: this flag may cause less information about currently installed |
| 335 | * applications to be returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 336 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 337 | public static final int MATCH_UNINSTALLED_PACKAGES = 0x00002000; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 338 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 339 | /** |
| 340 | * {@link PackageInfo} flag: return information about |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 341 | * hardware preferences in |
Adam Lesinski | d3edfde | 2014-08-08 17:32:44 -0700 | [diff] [blame] | 342 | * {@link PackageInfo#configPreferences PackageInfo.configPreferences}, |
| 343 | * and requested features in {@link PackageInfo#reqFeatures} and |
| 344 | * {@link PackageInfo#featureGroups}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 345 | */ |
| 346 | public static final int GET_CONFIGURATIONS = 0x00004000; |
| 347 | |
| 348 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 349 | * @deprecated replaced with {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}. |
| 350 | */ |
| 351 | @Deprecated |
| 352 | public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 0x00008000; |
| 353 | |
| 354 | /** |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 355 | * {@link PackageInfo} flag: include disabled components which are in |
| 356 | * that state only because of {@link #COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED} |
| 357 | * in the returned info. Note that if you set this flag, applications |
| 358 | * that are in this disabled state will be reported as enabled. |
| 359 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 360 | public static final int MATCH_DISABLED_UNTIL_USED_COMPONENTS = 0x00008000; |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 361 | |
| 362 | /** |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 363 | * Resolution and querying flag: if set, only filters that support the |
| 364 | * {@link android.content.Intent#CATEGORY_DEFAULT} will be considered for |
| 365 | * matching. This is a synonym for including the CATEGORY_DEFAULT in your |
| 366 | * supplied Intent. |
| 367 | */ |
Fabrice Di Meglio | 9f7e39f | 2015-04-10 20:40:16 -0700 | [diff] [blame] | 368 | public static final int MATCH_DEFAULT_ONLY = 0x00010000; |
| 369 | |
| 370 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 371 | * Querying flag: if set and if the platform is doing any filtering of the |
| 372 | * results, then the filtering will not happen. This is a synonym for saying |
| 373 | * that all results should be returned. |
| 374 | * <p> |
| 375 | * <em>This flag should be used with extreme care.</em> |
Fabrice Di Meglio | 9f7e39f | 2015-04-10 20:40:16 -0700 | [diff] [blame] | 376 | */ |
| 377 | public static final int MATCH_ALL = 0x00020000; |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 378 | |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 379 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 380 | * Querying flag: match components which are direct boot <em>unaware</em> in |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 381 | * the returned info, regardless of the current user state. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 382 | * <p> |
| 383 | * When neither {@link #MATCH_DIRECT_BOOT_AWARE} nor |
| 384 | * {@link #MATCH_DIRECT_BOOT_UNAWARE} are specified, the default behavior is |
| 385 | * to match only runnable components based on the user state. For example, |
| 386 | * when a user is started but credentials have not been presented yet, the |
| 387 | * user is running "locked" and only {@link #MATCH_DIRECT_BOOT_AWARE} |
| 388 | * components are returned. Once the user credentials have been presented, |
| 389 | * the user is running "unlocked" and both {@link #MATCH_DIRECT_BOOT_AWARE} |
| 390 | * and {@link #MATCH_DIRECT_BOOT_UNAWARE} components are returned. |
| 391 | * |
| 392 | * @see UserManager#isUserUnlocked() |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 393 | */ |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 394 | public static final int MATCH_DIRECT_BOOT_UNAWARE = 0x00040000; |
| 395 | |
| 396 | /** |
| 397 | * Querying flag: match components which are direct boot <em>aware</em> in |
| 398 | * the returned info, regardless of the current user state. |
| 399 | * <p> |
| 400 | * When neither {@link #MATCH_DIRECT_BOOT_AWARE} nor |
| 401 | * {@link #MATCH_DIRECT_BOOT_UNAWARE} are specified, the default behavior is |
| 402 | * to match only runnable components based on the user state. For example, |
| 403 | * when a user is started but credentials have not been presented yet, the |
| 404 | * user is running "locked" and only {@link #MATCH_DIRECT_BOOT_AWARE} |
| 405 | * components are returned. Once the user credentials have been presented, |
| 406 | * the user is running "unlocked" and both {@link #MATCH_DIRECT_BOOT_AWARE} |
| 407 | * and {@link #MATCH_DIRECT_BOOT_UNAWARE} components are returned. |
| 408 | * |
| 409 | * @see UserManager#isUserUnlocked() |
| 410 | */ |
| 411 | public static final int MATCH_DIRECT_BOOT_AWARE = 0x00080000; |
| 412 | |
| 413 | /** @removed */ |
| 414 | @Deprecated |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 415 | public static final int MATCH_ENCRYPTION_UNAWARE = 0x00040000; |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 416 | /** @removed */ |
| 417 | @Deprecated |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 418 | public static final int MATCH_ENCRYPTION_AWARE = 0x00080000; |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 419 | /** @removed */ |
| 420 | @Deprecated |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 421 | public static final int MATCH_ENCRYPTION_AWARE_AND_UNAWARE = MATCH_ENCRYPTION_AWARE |
| 422 | | MATCH_ENCRYPTION_UNAWARE; |
Jeff Sharkey | 2a9e3f8 | 2015-12-18 10:57:58 -0700 | [diff] [blame] | 423 | |
| 424 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 425 | * Querying flag: include only components from applications that are marked |
| 426 | * with {@link ApplicationInfo#FLAG_SYSTEM}. |
Jeff Sharkey | 5217cac | 2015-12-20 15:34:01 -0700 | [diff] [blame] | 427 | */ |
| 428 | public static final int MATCH_SYSTEM_ONLY = 0x00100000; |
| 429 | |
| 430 | /** |
Todd Kennedy | d6ee0ba | 2016-03-31 15:11:11 -0700 | [diff] [blame] | 431 | * Internal {@link PackageInfo} flag: include only components on the system image. |
| 432 | * This will not return information on any unbundled update to system components. |
| 433 | * @hide |
| 434 | */ |
| 435 | public static final int MATCH_FACTORY_ONLY = 0x00200000; |
| 436 | |
| 437 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 438 | * Internal flag used to indicate that a system component has done their |
| 439 | * homework and verified that they correctly handle packages and components |
| 440 | * that come and go over time. In particular: |
| 441 | * <ul> |
| 442 | * <li>Apps installed on external storage, which will appear to be |
| 443 | * uninstalled while the the device is ejected. |
| 444 | * <li>Apps with encryption unaware components, which will appear to not |
| 445 | * exist while the device is locked. |
| 446 | * </ul> |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 447 | * |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 448 | * @see #MATCH_UNINSTALLED_PACKAGES |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 449 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 450 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 451 | * @hide |
| 452 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 453 | public static final int MATCH_DEBUG_TRIAGED_MISSING = 0x10000000; |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 454 | |
| 455 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 456 | * Flag for {@link #addCrossProfileIntentFilter}: if this flag is set: when |
| 457 | * resolving an intent that matches the {@code CrossProfileIntentFilter}, |
| 458 | * the current profile will be skipped. Only activities in the target user |
| 459 | * can respond to the intent. |
| 460 | * |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 461 | * @hide |
| 462 | */ |
| 463 | public static final int SKIP_CURRENT_PROFILE = 0x00000002; |
| 464 | |
Tony Mak | 807e01c | 2015-12-01 20:19:03 +0000 | [diff] [blame] | 465 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 466 | * Flag for {@link #addCrossProfileIntentFilter}: if this flag is set: |
Tony Mak | 807e01c | 2015-12-01 20:19:03 +0000 | [diff] [blame] | 467 | * activities in the other profiles can respond to the intent only if no activity with |
| 468 | * non-negative priority in current profile can respond to the intent. |
| 469 | * @hide |
| 470 | */ |
| 471 | public static final int ONLY_IF_NO_MATCH_FOUND = 0x00000004; |
| 472 | |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 473 | /** @hide */ |
| 474 | @IntDef({PERMISSION_GRANTED, PERMISSION_DENIED}) |
| 475 | @Retention(RetentionPolicy.SOURCE) |
| 476 | public @interface PermissionResult {} |
| 477 | |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 478 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 479 | * Permission check result: this is returned by {@link #checkPermission} |
| 480 | * if the permission has been granted to the given package. |
| 481 | */ |
| 482 | public static final int PERMISSION_GRANTED = 0; |
| 483 | |
| 484 | /** |
| 485 | * Permission check result: this is returned by {@link #checkPermission} |
| 486 | * if the permission has not been granted to the given package. |
| 487 | */ |
| 488 | public static final int PERMISSION_DENIED = -1; |
| 489 | |
| 490 | /** |
| 491 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 492 | * if all signatures on the two packages match. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 493 | */ |
| 494 | public static final int SIGNATURE_MATCH = 0; |
| 495 | |
| 496 | /** |
| 497 | * Signature check result: this is returned by {@link #checkSignatures} |
| 498 | * if neither of the two packages is signed. |
| 499 | */ |
| 500 | public static final int SIGNATURE_NEITHER_SIGNED = 1; |
| 501 | |
| 502 | /** |
| 503 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 504 | * 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] | 505 | */ |
| 506 | public static final int SIGNATURE_FIRST_NOT_SIGNED = -1; |
| 507 | |
| 508 | /** |
| 509 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 510 | * 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] | 511 | */ |
| 512 | public static final int SIGNATURE_SECOND_NOT_SIGNED = -2; |
| 513 | |
| 514 | /** |
| 515 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 516 | * if not all signatures on both packages match. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 517 | */ |
| 518 | public static final int SIGNATURE_NO_MATCH = -3; |
| 519 | |
| 520 | /** |
| 521 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 522 | * if either of the packages are not valid. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 523 | */ |
| 524 | public static final int SIGNATURE_UNKNOWN_PACKAGE = -4; |
| 525 | |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 526 | /** |
| 527 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} |
| 528 | * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 529 | * component or application is in its default enabled state (as specified |
| 530 | * in its manifest). |
| 531 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 532 | public static final int COMPONENT_ENABLED_STATE_DEFAULT = 0; |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 533 | |
| 534 | /** |
| 535 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} |
| 536 | * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 537 | * component or application has been explictily enabled, regardless of |
| 538 | * what it has specified in its manifest. |
| 539 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 540 | public static final int COMPONENT_ENABLED_STATE_ENABLED = 1; |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 541 | |
| 542 | /** |
| 543 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} |
| 544 | * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 545 | * component or application has been explicitly disabled, regardless of |
| 546 | * what it has specified in its manifest. |
| 547 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 548 | public static final int COMPONENT_ENABLED_STATE_DISABLED = 2; |
| 549 | |
| 550 | /** |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 551 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} only: The |
| 552 | * user has explicitly disabled the application, regardless of what it has |
| 553 | * specified in its manifest. Because this is due to the user's request, |
| 554 | * they may re-enable it if desired through the appropriate system UI. This |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 555 | * option currently <strong>cannot</strong> be used with |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 556 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}. |
| 557 | */ |
| 558 | public static final int COMPONENT_ENABLED_STATE_DISABLED_USER = 3; |
| 559 | |
| 560 | /** |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 561 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} only: This |
| 562 | * application should be considered, until the point where the user actually |
| 563 | * wants to use it. This means that it will not normally show up to the user |
| 564 | * (such as in the launcher), but various parts of the user interface can |
| 565 | * use {@link #GET_DISABLED_UNTIL_USED_COMPONENTS} to still see it and allow |
| 566 | * the user to select it (as for example an IME, device admin, etc). Such code, |
| 567 | * once the user has selected the app, should at that point also make it enabled. |
| 568 | * This option currently <strong>can not</strong> be used with |
| 569 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}. |
| 570 | */ |
| 571 | public static final int COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED = 4; |
| 572 | |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 573 | /** @hide */ |
| 574 | @IntDef(flag = true, value = { |
| 575 | INSTALL_FORWARD_LOCK, |
| 576 | INSTALL_REPLACE_EXISTING, |
| 577 | INSTALL_ALLOW_TEST, |
| 578 | INSTALL_EXTERNAL, |
| 579 | INSTALL_INTERNAL, |
| 580 | INSTALL_FROM_ADB, |
| 581 | INSTALL_ALL_USERS, |
| 582 | INSTALL_ALLOW_DOWNGRADE, |
| 583 | INSTALL_GRANT_RUNTIME_PERMISSIONS, |
| 584 | INSTALL_FORCE_VOLUME_UUID, |
| 585 | INSTALL_FORCE_PERMISSION_PROMPT, |
| 586 | INSTALL_EPHEMERAL, |
Todd Kennedy | 39bfee5 | 2016-02-24 10:28:21 -0800 | [diff] [blame] | 587 | INSTALL_DONT_KILL_APP, |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 588 | }) |
| 589 | @Retention(RetentionPolicy.SOURCE) |
| 590 | public @interface InstallFlags {} |
| 591 | |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 592 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 593 | * Flag parameter for {@link #installPackage} to indicate that this package |
| 594 | * should be installed as forward locked, i.e. only the app itself should |
| 595 | * have access to its code and non-resource assets. |
| 596 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 597 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 598 | */ |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 599 | public static final int INSTALL_FORWARD_LOCK = 0x00000001; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 600 | |
| 601 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 602 | * Flag parameter for {@link #installPackage} to indicate that you want to |
| 603 | * replace an already installed package, if one exists. |
| 604 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 605 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 606 | */ |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 607 | public static final int INSTALL_REPLACE_EXISTING = 0x00000002; |
| 608 | |
| 609 | /** |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 610 | * Flag parameter for {@link #installPackage} to indicate that you want to |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 611 | * allow test packages (those that have set android:testOnly in their |
| 612 | * manifest) to be installed. |
| 613 | * @hide |
| 614 | */ |
| 615 | public static final int INSTALL_ALLOW_TEST = 0x00000004; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 616 | |
| 617 | /** |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 618 | * Flag parameter for {@link #installPackage} to indicate that this package |
| 619 | * must be installed to an ASEC on a {@link VolumeInfo#TYPE_PUBLIC}. |
| 620 | * |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 621 | * @hide |
| 622 | */ |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 623 | public static final int INSTALL_EXTERNAL = 0x00000008; |
Oscar Montemayor | 539d3c4 | 2010-01-29 15:27:00 -0800 | [diff] [blame] | 624 | |
| 625 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 626 | * Flag parameter for {@link #installPackage} to indicate that this package |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 627 | * must be installed to internal storage. |
| 628 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 629 | * @hide |
| 630 | */ |
| 631 | public static final int INSTALL_INTERNAL = 0x00000010; |
| 632 | |
| 633 | /** |
| 634 | * Flag parameter for {@link #installPackage} to indicate that this install |
| 635 | * was initiated via ADB. |
| 636 | * |
| 637 | * @hide |
| 638 | */ |
| 639 | public static final int INSTALL_FROM_ADB = 0x00000020; |
Suchi Amalapurapu | 14b6abd | 2010-03-17 08:37:04 -0700 | [diff] [blame] | 640 | |
| 641 | /** |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 642 | * Flag parameter for {@link #installPackage} to indicate that this install |
| 643 | * should immediately be visible to all users. |
| 644 | * |
| 645 | * @hide |
| 646 | */ |
| 647 | public static final int INSTALL_ALL_USERS = 0x00000040; |
| 648 | |
| 649 | /** |
| 650 | * Flag parameter for {@link #installPackage} to indicate that it is okay |
| 651 | * 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] | 652 | * version code than the currently installed app. This is permitted only if |
| 653 | * the currently installed app is marked debuggable. |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 654 | * |
| 655 | * @hide |
| 656 | */ |
| 657 | public static final int INSTALL_ALLOW_DOWNGRADE = 0x00000080; |
| 658 | |
| 659 | /** |
Svet Ganov | 95c1ade | 2015-03-19 09:38:52 -0700 | [diff] [blame] | 660 | * Flag parameter for {@link #installPackage} to indicate that all runtime |
| 661 | * permissions should be granted to the package. If {@link #INSTALL_ALL_USERS} |
| 662 | * is set the runtime permissions will be granted to all users, otherwise |
| 663 | * only to the owner. |
| 664 | * |
| 665 | * @hide |
| 666 | */ |
| 667 | public static final int INSTALL_GRANT_RUNTIME_PERMISSIONS = 0x00000100; |
| 668 | |
Jeff Sharkey | ab23409 | 2015-06-09 21:42:22 -0700 | [diff] [blame] | 669 | /** {@hide} */ |
| 670 | public static final int INSTALL_FORCE_VOLUME_UUID = 0x00000200; |
| 671 | |
Svet Ganov | 95c1ade | 2015-03-19 09:38:52 -0700 | [diff] [blame] | 672 | /** |
Todd Kennedy | a1d12cf | 2015-09-29 15:43:00 -0700 | [diff] [blame] | 673 | * Flag parameter for {@link #installPackage} to indicate that we always want to force |
| 674 | * the prompt for permission approval. This overrides any special behaviour for internal |
| 675 | * components. |
| 676 | * |
| 677 | * @hide |
| 678 | */ |
| 679 | public static final int INSTALL_FORCE_PERMISSION_PROMPT = 0x00000400; |
| 680 | |
| 681 | /** |
Todd Kennedy | 27c24fb | 2015-09-17 16:49:25 -0700 | [diff] [blame] | 682 | * Flag parameter for {@link #installPackage} to indicate that this package is |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 683 | * to be installed as a lightweight "ephemeral" app. |
| 684 | * |
| 685 | * @hide |
| 686 | */ |
Todd Kennedy | 373f0b4 | 2015-12-16 14:45:14 -0800 | [diff] [blame] | 687 | public static final int INSTALL_EPHEMERAL = 0x00000800; |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 688 | |
| 689 | /** |
Todd Kennedy | 39bfee5 | 2016-02-24 10:28:21 -0800 | [diff] [blame] | 690 | * Flag parameter for {@link #installPackage} to indicate that this package contains |
| 691 | * a feature split to an existing application and the existing application should not |
| 692 | * be killed during the installation process. |
| 693 | * |
| 694 | * @hide |
| 695 | */ |
| 696 | public static final int INSTALL_DONT_KILL_APP = 0x00001000; |
| 697 | |
| 698 | /** |
Todd Kennedy | b107271 | 2016-04-26 15:41:20 -0700 | [diff] [blame] | 699 | * Flag parameter for {@link #installPackage} to indicate that this package is an |
| 700 | * upgrade to a package that refers to the SDK via release letter. |
| 701 | * |
| 702 | * @hide |
| 703 | */ |
| 704 | public static final int INSTALL_FORCE_SDK = 0x00002000; |
| 705 | |
| 706 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 707 | * Flag parameter for |
| 708 | * {@link #setComponentEnabledSetting(android.content.ComponentName, int, int)} to indicate |
| 709 | * that you don't want to kill the app containing the component. Be careful when you set this |
| 710 | * since changing component states can make the containing application's behavior unpredictable. |
| 711 | */ |
| 712 | public static final int DONT_KILL_APP = 0x00000001; |
| 713 | |
| 714 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 715 | * Installation return code: this is passed to the |
| 716 | * {@link IPackageInstallObserver} on success. |
| 717 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 718 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 719 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 720 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 721 | public static final int INSTALL_SUCCEEDED = 1; |
| 722 | |
| 723 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 724 | * Installation return code: this is passed to the |
| 725 | * {@link IPackageInstallObserver} if the package is already installed. |
| 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_ALREADY_EXISTS = -1; |
| 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 the package archive file is invalid. |
| 735 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 736 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 737 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 738 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 739 | public static final int INSTALL_FAILED_INVALID_APK = -2; |
| 740 | |
| 741 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 742 | * Installation return code: this is passed to the |
| 743 | * {@link IPackageInstallObserver} if the URI passed in is invalid. |
| 744 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 745 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 746 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 747 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 748 | public static final int INSTALL_FAILED_INVALID_URI = -3; |
| 749 | |
| 750 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 751 | * Installation return code: this is passed to the |
| 752 | * {@link IPackageInstallObserver} if the package manager service found that |
| 753 | * the device didn't have enough storage space to install the app. |
| 754 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 755 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 756 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 757 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 758 | public static final int INSTALL_FAILED_INSUFFICIENT_STORAGE = -4; |
| 759 | |
| 760 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 761 | * Installation return code: this is passed to the |
| 762 | * {@link IPackageInstallObserver} if a package is already installed with |
| 763 | * the same name. |
| 764 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 765 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 766 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 767 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 768 | public static final int INSTALL_FAILED_DUPLICATE_PACKAGE = -5; |
| 769 | |
| 770 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 771 | * Installation return code: this is passed to the |
| 772 | * {@link IPackageInstallObserver} if the requested shared user does not |
| 773 | * exist. |
| 774 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 775 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 776 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 777 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 778 | public static final int INSTALL_FAILED_NO_SHARED_USER = -6; |
| 779 | |
| 780 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 781 | * Installation return code: this is passed to the |
| 782 | * {@link IPackageInstallObserver} if a previously installed package of the |
| 783 | * same name has a different signature than the new package (and the old |
| 784 | * package's data was not removed). |
| 785 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 786 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 787 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 788 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 789 | public static final int INSTALL_FAILED_UPDATE_INCOMPATIBLE = -7; |
| 790 | |
| 791 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 792 | * Installation return code: this is passed to the |
| 793 | * {@link IPackageInstallObserver} if the new package is requested a shared |
| 794 | * user which is already installed on the device and does not have matching |
| 795 | * signature. |
| 796 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 797 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 798 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 799 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 800 | public static final int INSTALL_FAILED_SHARED_USER_INCOMPATIBLE = -8; |
| 801 | |
| 802 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 803 | * Installation return code: this is passed to the |
| 804 | * {@link IPackageInstallObserver} if the new package uses a shared library |
| 805 | * that is not available. |
| 806 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 807 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 808 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 809 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 810 | public static final int INSTALL_FAILED_MISSING_SHARED_LIBRARY = -9; |
| 811 | |
| 812 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 813 | * Installation return code: this is passed to the |
| 814 | * {@link IPackageInstallObserver} if the new package uses a shared library |
| 815 | * that is not available. |
| 816 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 817 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 818 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 819 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 820 | public static final int INSTALL_FAILED_REPLACE_COULDNT_DELETE = -10; |
| 821 | |
| 822 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 823 | * Installation return code: this is passed to the |
| 824 | * {@link IPackageInstallObserver} if the new package failed while |
| 825 | * optimizing and validating its dex files, either because there was not |
| 826 | * enough storage or the validation failed. |
| 827 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 828 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 829 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 830 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 831 | public static final int INSTALL_FAILED_DEXOPT = -11; |
| 832 | |
| 833 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 834 | * Installation return code: this is passed to the |
| 835 | * {@link IPackageInstallObserver} if the new package failed because the |
| 836 | * current SDK version is older than that required by the package. |
| 837 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 838 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 839 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 840 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 841 | public static final int INSTALL_FAILED_OLDER_SDK = -12; |
| 842 | |
| 843 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 844 | * Installation return code: this is passed to the |
| 845 | * {@link IPackageInstallObserver} if the new package failed because it |
| 846 | * contains a content provider with the same authority as a provider already |
| 847 | * installed in the system. |
| 848 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 849 | * @hide |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 850 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 851 | @SystemApi |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 852 | public static final int INSTALL_FAILED_CONFLICTING_PROVIDER = -13; |
| 853 | |
| 854 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 855 | * Installation return code: this is passed to the |
| 856 | * {@link IPackageInstallObserver} if the new package failed because the |
| 857 | * current SDK version is newer than that required by the package. |
| 858 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 859 | * @hide |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 860 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 861 | @SystemApi |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 862 | public static final int INSTALL_FAILED_NEWER_SDK = -14; |
| 863 | |
| 864 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 865 | * Installation return code: this is passed to the |
| 866 | * {@link IPackageInstallObserver} if the new package failed because it has |
| 867 | * specified that it is a test-only package and the caller has not supplied |
| 868 | * the {@link #INSTALL_ALLOW_TEST} flag. |
| 869 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 870 | * @hide |
| 871 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 872 | @SystemApi |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 873 | public static final int INSTALL_FAILED_TEST_ONLY = -15; |
| 874 | |
| 875 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 876 | * Installation return code: this is passed to the |
| 877 | * {@link IPackageInstallObserver} if the package being installed contains |
| 878 | * native code, but none that is compatible with the device's CPU_ABI. |
| 879 | * |
Dianne Hackborn | b181118 | 2009-05-21 15:45:42 -0700 | [diff] [blame] | 880 | * @hide |
| 881 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 882 | @SystemApi |
Dianne Hackborn | b181118 | 2009-05-21 15:45:42 -0700 | [diff] [blame] | 883 | public static final int INSTALL_FAILED_CPU_ABI_INCOMPATIBLE = -16; |
| 884 | |
| 885 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 886 | * Installation return code: this is passed to the |
| 887 | * {@link IPackageInstallObserver} if the new package uses a feature that is |
| 888 | * not available. |
| 889 | * |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 890 | * @hide |
| 891 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 892 | @SystemApi |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 893 | public static final int INSTALL_FAILED_MISSING_FEATURE = -17; |
| 894 | |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 895 | // ------ Errors related to sdcard |
| 896 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 897 | * Installation return code: this is passed to the |
| 898 | * {@link IPackageInstallObserver} if a secure container mount point |
| 899 | * couldn't be accessed on external media. |
| 900 | * |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 901 | * @hide |
| 902 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 903 | @SystemApi |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 904 | public static final int INSTALL_FAILED_CONTAINER_ERROR = -18; |
| 905 | |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 906 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 907 | * Installation return code: this is passed to the |
| 908 | * {@link IPackageInstallObserver} if the new package couldn't be installed |
| 909 | * in the specified install location. |
| 910 | * |
Suchi Amalapurapu | b56ae20 | 2010-02-04 22:51:07 -0800 | [diff] [blame] | 911 | * @hide |
| 912 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 913 | @SystemApi |
Suchi Amalapurapu | b56ae20 | 2010-02-04 22:51:07 -0800 | [diff] [blame] | 914 | public static final int INSTALL_FAILED_INVALID_INSTALL_LOCATION = -19; |
| 915 | |
| 916 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 917 | * Installation return code: this is passed to the |
| 918 | * {@link IPackageInstallObserver} if the new package couldn't be installed |
| 919 | * in the specified install location because the media is not available. |
| 920 | * |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 921 | * @hide |
| 922 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 923 | @SystemApi |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 924 | public static final int INSTALL_FAILED_MEDIA_UNAVAILABLE = -20; |
| 925 | |
| 926 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 927 | * Installation return code: this is passed to the |
| 928 | * {@link IPackageInstallObserver} if the new package couldn't be installed |
| 929 | * because the verification timed out. |
| 930 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 931 | * @hide |
| 932 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 933 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 934 | public static final int INSTALL_FAILED_VERIFICATION_TIMEOUT = -21; |
| 935 | |
| 936 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 937 | * Installation return code: this is passed to the |
| 938 | * {@link IPackageInstallObserver} if the new package couldn't be installed |
| 939 | * because the verification did not succeed. |
| 940 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 941 | * @hide |
| 942 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 943 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 944 | public static final int INSTALL_FAILED_VERIFICATION_FAILURE = -22; |
| 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 package changed from what the |
| 949 | * calling program expected. |
| 950 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 951 | * @hide |
| 952 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 953 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 954 | public static final int INSTALL_FAILED_PACKAGE_CHANGED = -23; |
| 955 | |
| 956 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 957 | * Installation return code: this is passed to the |
| 958 | * {@link IPackageInstallObserver} if the new package is assigned a |
| 959 | * different UID than it previously held. |
| 960 | * |
Dianne Hackborn | d0c5f51 | 2012-06-07 16:53:59 -0700 | [diff] [blame] | 961 | * @hide |
| 962 | */ |
| 963 | public static final int INSTALL_FAILED_UID_CHANGED = -24; |
| 964 | |
| 965 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 966 | * Installation return code: this is passed to the |
| 967 | * {@link IPackageInstallObserver} if the new package has an older version |
| 968 | * code than the currently installed package. |
| 969 | * |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 970 | * @hide |
| 971 | */ |
| 972 | public static final int INSTALL_FAILED_VERSION_DOWNGRADE = -25; |
| 973 | |
| 974 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 975 | * Installation return code: this is passed to the |
| 976 | * {@link IPackageInstallObserver} if the old package has target SDK high |
| 977 | * enough to support runtime permission and the new package has target SDK |
| 978 | * low enough to not support runtime permissions. |
| 979 | * |
Svetoslav | d965370 | 2015-05-13 18:02:46 -0700 | [diff] [blame] | 980 | * @hide |
| 981 | */ |
| 982 | @SystemApi |
| 983 | public static final int INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE = -26; |
| 984 | |
| 985 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 986 | * Installation parse return code: this is passed to the |
| 987 | * {@link IPackageInstallObserver} if the parser was given a path that is |
| 988 | * not a file, or does not end with the expected '.apk' extension. |
| 989 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 990 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 991 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 992 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 993 | public static final int INSTALL_PARSE_FAILED_NOT_APK = -100; |
| 994 | |
| 995 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 996 | * Installation parse return code: this is passed to the |
| 997 | * {@link IPackageInstallObserver} if the parser was unable to retrieve the |
| 998 | * AndroidManifest.xml file. |
| 999 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1000 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1001 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1002 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1003 | public static final int INSTALL_PARSE_FAILED_BAD_MANIFEST = -101; |
| 1004 | |
| 1005 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1006 | * Installation parse return code: this is passed to the |
| 1007 | * {@link IPackageInstallObserver} if the parser encountered an unexpected |
| 1008 | * exception. |
| 1009 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1010 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1011 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1012 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1013 | public static final int INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION = -102; |
| 1014 | |
| 1015 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1016 | * Installation parse return code: this is passed to the |
| 1017 | * {@link IPackageInstallObserver} if the parser did not find any |
| 1018 | * certificates in the .apk. |
| 1019 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1020 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1021 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1022 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1023 | public static final int INSTALL_PARSE_FAILED_NO_CERTIFICATES = -103; |
| 1024 | |
| 1025 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1026 | * Installation parse return code: this is passed to the |
| 1027 | * {@link IPackageInstallObserver} if the parser found inconsistent |
| 1028 | * certificates on the files in the .apk. |
| 1029 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1030 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1031 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1032 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1033 | public static final int INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES = -104; |
| 1034 | |
| 1035 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1036 | * Installation parse return code: this is passed to the |
| 1037 | * {@link IPackageInstallObserver} if the parser encountered a |
| 1038 | * CertificateEncodingException in one of the files in the .apk. |
| 1039 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1040 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1041 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1042 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1043 | public static final int INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING = -105; |
| 1044 | |
| 1045 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1046 | * Installation parse return code: this is passed to the |
| 1047 | * {@link IPackageInstallObserver} if the parser encountered a bad or |
| 1048 | * missing package name in the manifest. |
| 1049 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1050 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1051 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1052 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1053 | public static final int INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME = -106; |
| 1054 | |
| 1055 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1056 | * Installation parse return code: this is passed to the |
| 1057 | * {@link IPackageInstallObserver} if the parser encountered a bad shared |
| 1058 | * user id name in the manifest. |
| 1059 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1060 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1061 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1062 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1063 | public static final int INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID = -107; |
| 1064 | |
| 1065 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1066 | * Installation parse return code: this is passed to the |
| 1067 | * {@link IPackageInstallObserver} if the parser encountered some structural |
| 1068 | * problem in the manifest. |
| 1069 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1070 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1071 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1072 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1073 | public static final int INSTALL_PARSE_FAILED_MANIFEST_MALFORMED = -108; |
| 1074 | |
| 1075 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1076 | * Installation parse return code: this is passed to the |
| 1077 | * {@link IPackageInstallObserver} if the parser did not find any actionable |
| 1078 | * tags (instrumentation or application) in the manifest. |
| 1079 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1080 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1081 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1082 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1083 | public static final int INSTALL_PARSE_FAILED_MANIFEST_EMPTY = -109; |
| 1084 | |
| 1085 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1086 | * Installation failed return code: this is passed to the |
| 1087 | * {@link IPackageInstallObserver} if the system failed to install the |
| 1088 | * package because of system issues. |
| 1089 | * |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 1090 | * @hide |
| 1091 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1092 | @SystemApi |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 1093 | public static final int INSTALL_FAILED_INTERNAL_ERROR = -110; |
| 1094 | |
| 1095 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1096 | * Installation failed return code: this is passed to the |
| 1097 | * {@link IPackageInstallObserver} if the system failed to install the |
| 1098 | * package because the user is restricted from installing apps. |
| 1099 | * |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 1100 | * @hide |
| 1101 | */ |
| 1102 | public static final int INSTALL_FAILED_USER_RESTRICTED = -111; |
| 1103 | |
| 1104 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1105 | * Installation failed return code: this is passed to the |
| 1106 | * {@link IPackageInstallObserver} if the system failed to install the |
| 1107 | * package because it is attempting to define a permission that is already |
| 1108 | * defined by some existing package. |
| 1109 | * <p> |
| 1110 | * The package name of the app which has already defined the permission is |
| 1111 | * passed to a {@link PackageInstallObserver}, if any, as the |
| 1112 | * {@link #EXTRA_FAILURE_EXISTING_PACKAGE} string extra; and the name of the |
| 1113 | * permission being redefined is passed in the |
| 1114 | * {@link #EXTRA_FAILURE_EXISTING_PERMISSION} string extra. |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 1115 | * |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 1116 | * @hide |
| 1117 | */ |
| 1118 | public static final int INSTALL_FAILED_DUPLICATE_PERMISSION = -112; |
| 1119 | |
| 1120 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1121 | * Installation failed return code: this is passed to the |
| 1122 | * {@link IPackageInstallObserver} if the system failed to install the |
| 1123 | * package because its packaged native code did not match any of the ABIs |
| 1124 | * supported by the system. |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1125 | * |
| 1126 | * @hide |
| 1127 | */ |
Narayan Kamath | d11f223 | 2014-04-10 10:37:17 +0100 | [diff] [blame] | 1128 | public static final int INSTALL_FAILED_NO_MATCHING_ABIS = -113; |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1129 | |
| 1130 | /** |
| 1131 | * Internal return code for NativeLibraryHelper methods to indicate that the package |
| 1132 | * being processed did not contain any native code. This is placed here only so that |
| 1133 | * it can belong to the same value space as the other install failure codes. |
| 1134 | * |
| 1135 | * @hide |
| 1136 | */ |
Narayan Kamath | d11f223 | 2014-04-10 10:37:17 +0100 | [diff] [blame] | 1137 | public static final int NO_NATIVE_LIBRARIES = -114; |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1138 | |
Jeff Sharkey | 7328a1b | 2014-08-07 14:01:43 -0700 | [diff] [blame] | 1139 | /** {@hide} */ |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 1140 | public static final int INSTALL_FAILED_ABORTED = -115; |
Jeff Sharkey | 7328a1b | 2014-08-07 14:01:43 -0700 | [diff] [blame] | 1141 | |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1142 | /** |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 1143 | * Installation failed return code: ephemeral app installs are incompatible with some |
| 1144 | * other installation flags supplied for the operation; or other circumstances such |
| 1145 | * as trying to upgrade a system app via an ephemeral install. |
| 1146 | * @hide |
| 1147 | */ |
| 1148 | public static final int INSTALL_FAILED_EPHEMERAL_INVALID = -116; |
| 1149 | |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1150 | /** @hide */ |
| 1151 | @IntDef(flag = true, value = { |
| 1152 | DELETE_KEEP_DATA, |
| 1153 | DELETE_ALL_USERS, |
| 1154 | DELETE_SYSTEM_APP, |
Todd Kennedy | 39bfee5 | 2016-02-24 10:28:21 -0800 | [diff] [blame] | 1155 | DELETE_DONT_KILL_APP, |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1156 | }) |
| 1157 | @Retention(RetentionPolicy.SOURCE) |
| 1158 | public @interface DeleteFlags {} |
| 1159 | |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 1160 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1161 | * Flag parameter for {@link #deletePackage} to indicate that you don't want to delete the |
| 1162 | * package's data directory. |
| 1163 | * |
| 1164 | * @hide |
| 1165 | */ |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1166 | public static final int DELETE_KEEP_DATA = 0x00000001; |
| 1167 | |
| 1168 | /** |
| 1169 | * Flag parameter for {@link #deletePackage} to indicate that you want the |
| 1170 | * package deleted for all users. |
| 1171 | * |
| 1172 | * @hide |
| 1173 | */ |
| 1174 | public static final int DELETE_ALL_USERS = 0x00000002; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1175 | |
| 1176 | /** |
Dianne Hackborn | c895be7 | 2013-03-11 17:48:43 -0700 | [diff] [blame] | 1177 | * Flag parameter for {@link #deletePackage} to indicate that, if you are calling |
| 1178 | * uninstall on a system that has been updated, then don't do the normal process |
| 1179 | * of uninstalling the update and rolling back to the older system version (which |
| 1180 | * needs to happen for all users); instead, just mark the app as uninstalled for |
| 1181 | * the current user. |
| 1182 | * |
| 1183 | * @hide |
| 1184 | */ |
| 1185 | public static final int DELETE_SYSTEM_APP = 0x00000004; |
| 1186 | |
| 1187 | /** |
Todd Kennedy | 39bfee5 | 2016-02-24 10:28:21 -0800 | [diff] [blame] | 1188 | * Flag parameter for {@link #deletePackage} to indicate that, if you are calling |
| 1189 | * uninstall on a package that is replaced to provide new feature splits, the |
| 1190 | * existing application should not be killed during the removal process. |
| 1191 | * |
| 1192 | * @hide |
| 1193 | */ |
| 1194 | public static final int DELETE_DONT_KILL_APP = 0x00000008; |
| 1195 | |
| 1196 | /** |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1197 | * Return code for when package deletion succeeds. This is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1198 | * {@link IPackageDeleteObserver} if the system succeeded in deleting the |
| 1199 | * package. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1200 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1201 | * @hide |
| 1202 | */ |
| 1203 | public static final int DELETE_SUCCEEDED = 1; |
| 1204 | |
| 1205 | /** |
| 1206 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1207 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1208 | * for an unspecified reason. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1209 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1210 | * @hide |
| 1211 | */ |
| 1212 | public static final int DELETE_FAILED_INTERNAL_ERROR = -1; |
| 1213 | |
| 1214 | /** |
| 1215 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1216 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1217 | * because it is the active DevicePolicy manager. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1218 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1219 | * @hide |
| 1220 | */ |
| 1221 | public static final int DELETE_FAILED_DEVICE_POLICY_MANAGER = -2; |
| 1222 | |
| 1223 | /** |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 1224 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1225 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1226 | * since the user is restricted. |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 1227 | * |
| 1228 | * @hide |
| 1229 | */ |
| 1230 | public static final int DELETE_FAILED_USER_RESTRICTED = -3; |
| 1231 | |
| 1232 | /** |
Kenny Guy | 1b88da5 | 2014-07-10 16:33:49 +0100 | [diff] [blame] | 1233 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1234 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1235 | * because a profile or device owner has marked the package as |
| 1236 | * uninstallable. |
Kenny Guy | c13053b | 2014-05-29 14:17:17 +0100 | [diff] [blame] | 1237 | * |
| 1238 | * @hide |
| 1239 | */ |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 1240 | public static final int DELETE_FAILED_OWNER_BLOCKED = -4; |
| 1241 | |
| 1242 | /** {@hide} */ |
| 1243 | public static final int DELETE_FAILED_ABORTED = -5; |
Kenny Guy | c13053b | 2014-05-29 14:17:17 +0100 | [diff] [blame] | 1244 | |
| 1245 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1246 | * Return code that is passed to the {@link IPackageMoveObserver} when the |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1247 | * package has been successfully moved by the system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1248 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1249 | * @hide |
| 1250 | */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1251 | public static final int MOVE_SUCCEEDED = -100; |
| 1252 | |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1253 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1254 | * Error code that is passed to the {@link IPackageMoveObserver} when the |
| 1255 | * package hasn't been successfully moved by the system because of |
| 1256 | * insufficient memory on specified media. |
| 1257 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1258 | * @hide |
| 1259 | */ |
| 1260 | public static final int MOVE_FAILED_INSUFFICIENT_STORAGE = -1; |
| 1261 | |
| 1262 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1263 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1264 | * specified package doesn't exist. |
| 1265 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1266 | * @hide |
| 1267 | */ |
| 1268 | public static final int MOVE_FAILED_DOESNT_EXIST = -2; |
| 1269 | |
| 1270 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1271 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1272 | * specified package cannot be moved since its a system package. |
| 1273 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1274 | * @hide |
| 1275 | */ |
| 1276 | public static final int MOVE_FAILED_SYSTEM_PACKAGE = -3; |
| 1277 | |
| 1278 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1279 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1280 | * specified package cannot be moved since its forward locked. |
| 1281 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1282 | * @hide |
| 1283 | */ |
| 1284 | public static final int MOVE_FAILED_FORWARD_LOCKED = -4; |
| 1285 | |
| 1286 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1287 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1288 | * specified package cannot be moved to the specified location. |
| 1289 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1290 | * @hide |
| 1291 | */ |
| 1292 | public static final int MOVE_FAILED_INVALID_LOCATION = -5; |
| 1293 | |
| 1294 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1295 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1296 | * specified package cannot be moved to the specified location. |
| 1297 | * |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 1298 | * @hide |
| 1299 | */ |
| 1300 | public static final int MOVE_FAILED_INTERNAL_ERROR = -6; |
| 1301 | |
| 1302 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1303 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1304 | * specified package already has an operation pending in the queue. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1305 | * |
Kenny Root | deb1126 | 2010-08-02 11:36:21 -0700 | [diff] [blame] | 1306 | * @hide |
| 1307 | */ |
| 1308 | public static final int MOVE_FAILED_OPERATION_PENDING = -7; |
| 1309 | |
| 1310 | /** |
Makoto Onuki | f34db0a | 2016-02-17 11:17:15 -0800 | [diff] [blame] | 1311 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1312 | * specified package cannot be moved since it contains a device admin. |
| 1313 | * |
| 1314 | * @hide |
| 1315 | */ |
| 1316 | public static final int MOVE_FAILED_DEVICE_ADMIN = -8; |
| 1317 | |
| 1318 | /** |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1319 | * Flag parameter for {@link #movePackage} to indicate that |
| 1320 | * the package should be moved to internal storage if its |
| 1321 | * been installed on external media. |
| 1322 | * @hide |
| 1323 | */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1324 | @Deprecated |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1325 | public static final int MOVE_INTERNAL = 0x00000001; |
| 1326 | |
| 1327 | /** |
| 1328 | * Flag parameter for {@link #movePackage} to indicate that |
| 1329 | * the package should be moved to external media. |
| 1330 | * @hide |
| 1331 | */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1332 | @Deprecated |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1333 | public static final int MOVE_EXTERNAL_MEDIA = 0x00000002; |
| 1334 | |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1335 | /** {@hide} */ |
| 1336 | public static final String EXTRA_MOVE_ID = "android.content.pm.extra.MOVE_ID"; |
| 1337 | |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1338 | /** |
Kenny Root | 05ca4c9 | 2011-09-15 10:36:25 -0700 | [diff] [blame] | 1339 | * Usable by the required verifier as the {@code verificationCode} argument |
| 1340 | * for {@link PackageManager#verifyPendingInstall} to indicate that it will |
| 1341 | * allow the installation to proceed without any of the optional verifiers |
| 1342 | * needing to vote. |
| 1343 | * |
| 1344 | * @hide |
| 1345 | */ |
| 1346 | public static final int VERIFICATION_ALLOW_WITHOUT_SUFFICIENT = 2; |
| 1347 | |
| 1348 | /** |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 1349 | * Used as the {@code verificationCode} argument for |
| 1350 | * {@link PackageManager#verifyPendingInstall} to indicate that the calling |
| 1351 | * package verifier allows the installation to proceed. |
| 1352 | */ |
| 1353 | public static final int VERIFICATION_ALLOW = 1; |
| 1354 | |
| 1355 | /** |
| 1356 | * Used as the {@code verificationCode} argument for |
| 1357 | * {@link PackageManager#verifyPendingInstall} to indicate the calling |
| 1358 | * package verifier does not vote to allow the installation to proceed. |
| 1359 | */ |
| 1360 | public static final int VERIFICATION_REJECT = -1; |
| 1361 | |
| 1362 | /** |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1363 | * Used as the {@code verificationCode} argument for |
| 1364 | * {@link PackageManager#verifyIntentFilter} to indicate that the calling |
| 1365 | * IntentFilter Verifier confirms that the IntentFilter is verified. |
| 1366 | * |
| 1367 | * @hide |
| 1368 | */ |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 1369 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1370 | public static final int INTENT_FILTER_VERIFICATION_SUCCESS = 1; |
| 1371 | |
| 1372 | /** |
| 1373 | * Used as the {@code verificationCode} argument for |
| 1374 | * {@link PackageManager#verifyIntentFilter} to indicate that the calling |
| 1375 | * IntentFilter Verifier confirms that the IntentFilter is NOT verified. |
| 1376 | * |
| 1377 | * @hide |
| 1378 | */ |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 1379 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1380 | public static final int INTENT_FILTER_VERIFICATION_FAILURE = -1; |
| 1381 | |
| 1382 | /** |
| 1383 | * Internal status code to indicate that an IntentFilter verification result is not specified. |
| 1384 | * |
| 1385 | * @hide |
| 1386 | */ |
| 1387 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED = 0; |
| 1388 | |
| 1389 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1390 | * Used as the {@code status} argument for |
| 1391 | * {@link #updateIntentVerificationStatusAsUser} to indicate that the User |
| 1392 | * will always be prompted the Intent Disambiguation Dialog if there are two |
| 1393 | * or more Intent resolved for the IntentFilter's domain(s). |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1394 | * |
| 1395 | * @hide |
| 1396 | */ |
| 1397 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK = 1; |
| 1398 | |
| 1399 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1400 | * Used as the {@code status} argument for |
| 1401 | * {@link #updateIntentVerificationStatusAsUser} to indicate that the User |
| 1402 | * will never be prompted the Intent Disambiguation Dialog if there are two |
| 1403 | * or more resolution of the Intent. The default App for the domain(s) |
| 1404 | * specified in the IntentFilter will also ALWAYS be used. |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1405 | * |
| 1406 | * @hide |
| 1407 | */ |
| 1408 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS = 2; |
| 1409 | |
| 1410 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1411 | * Used as the {@code status} argument for |
| 1412 | * {@link #updateIntentVerificationStatusAsUser} to indicate that the User |
| 1413 | * may be prompted the Intent Disambiguation Dialog if there are two or more |
| 1414 | * 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] | 1415 | * IntentFilter will also NEVER be presented to the User. |
| 1416 | * |
| 1417 | * @hide |
| 1418 | */ |
| 1419 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER = 3; |
| 1420 | |
| 1421 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1422 | * Used as the {@code status} argument for |
| 1423 | * {@link #updateIntentVerificationStatusAsUser} to indicate that this app |
| 1424 | * should always be considered as an ambiguous candidate for handling the |
| 1425 | * matching Intent even if there are other candidate apps in the "always" |
| 1426 | * state. Put another way: if there are any 'always ask' apps in a set of |
| 1427 | * more than one candidate app, then a disambiguation is *always* presented |
| 1428 | * even if there is another candidate app with the 'always' state. |
Christopher Tate | 56f0ff3 | 2015-08-13 16:29:33 -0700 | [diff] [blame] | 1429 | * |
| 1430 | * @hide |
| 1431 | */ |
| 1432 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS_ASK = 4; |
| 1433 | |
| 1434 | /** |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 1435 | * Can be used as the {@code millisecondsToDelay} argument for |
| 1436 | * {@link PackageManager#extendVerificationTimeout}. This is the |
| 1437 | * maximum time {@code PackageManager} waits for the verification |
| 1438 | * agent to return (in milliseconds). |
| 1439 | */ |
| 1440 | public static final long MAXIMUM_VERIFICATION_TIMEOUT = 60*60*1000; |
| 1441 | |
| 1442 | /** |
Amith Yamasani | 0b28549 | 2011-04-14 17:35:23 -0700 | [diff] [blame] | 1443 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: The device's |
| 1444 | * audio pipeline is low-latency, more suitable for audio applications sensitive to delays or |
| 1445 | * lag in sound input or output. |
Dan Morrill | 898e1e8 | 2010-09-26 17:28:30 -0700 | [diff] [blame] | 1446 | */ |
| 1447 | @SdkConstant(SdkConstantType.FEATURE) |
| 1448 | public static final String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency"; |
| 1449 | |
| 1450 | /** |
| 1451 | * Feature for {@link #getSystemAvailableFeatures} and |
Unsuk Jung | 50909f6 | 2014-09-02 18:25:49 -0700 | [diff] [blame] | 1452 | * {@link #hasSystemFeature}: The device includes at least one form of audio |
| 1453 | * output, such as speakers, audio jack or streaming over bluetooth |
| 1454 | */ |
| 1455 | @SdkConstant(SdkConstantType.FEATURE) |
| 1456 | public static final String FEATURE_AUDIO_OUTPUT = "android.hardware.audio.output"; |
| 1457 | |
| 1458 | /** |
Glenn Kasten | cdcb577 | 2015-05-06 15:54:49 -0700 | [diff] [blame] | 1459 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Glenn Kasten | 7587edc | 2015-10-30 17:45:52 -0700 | [diff] [blame] | 1460 | * The device has professional audio level of functionality and performance. |
Glenn Kasten | cdcb577 | 2015-05-06 15:54:49 -0700 | [diff] [blame] | 1461 | */ |
| 1462 | @SdkConstant(SdkConstantType.FEATURE) |
| 1463 | public static final String FEATURE_AUDIO_PRO = "android.hardware.audio.pro"; |
| 1464 | |
| 1465 | /** |
Unsuk Jung | 50909f6 | 2014-09-02 18:25:49 -0700 | [diff] [blame] | 1466 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1467 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 1468 | * other devices via Bluetooth. |
| 1469 | */ |
| 1470 | @SdkConstant(SdkConstantType.FEATURE) |
| 1471 | public static final String FEATURE_BLUETOOTH = "android.hardware.bluetooth"; |
| 1472 | |
| 1473 | /** |
| 1474 | * Feature for {@link #getSystemAvailableFeatures} and |
Matthew Xie | a722772 | 2013-04-18 15:25:59 -0700 | [diff] [blame] | 1475 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 1476 | * other devices via Bluetooth Low Energy radio. |
| 1477 | */ |
| 1478 | @SdkConstant(SdkConstantType.FEATURE) |
| 1479 | public static final String FEATURE_BLUETOOTH_LE = "android.hardware.bluetooth_le"; |
| 1480 | |
| 1481 | /** |
| 1482 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1483 | * {@link #hasSystemFeature}: The device has a camera facing away |
| 1484 | * from the screen. |
| 1485 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1486 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1487 | public static final String FEATURE_CAMERA = "android.hardware.camera"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1488 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1489 | /** |
| 1490 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1491 | * {@link #hasSystemFeature}: The device's camera supports auto-focus. |
| 1492 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1493 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1494 | public static final String FEATURE_CAMERA_AUTOFOCUS = "android.hardware.camera.autofocus"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1495 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1496 | /** |
| 1497 | * Feature for {@link #getSystemAvailableFeatures} and |
Eino-Ville Talvala | 752af83 | 2012-09-18 14:45:37 -0700 | [diff] [blame] | 1498 | * {@link #hasSystemFeature}: The device has at least one camera pointing in |
Eino-Ville Talvala | 9131da2 | 2014-05-08 11:39:53 -0700 | [diff] [blame] | 1499 | * 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] | 1500 | */ |
| 1501 | @SdkConstant(SdkConstantType.FEATURE) |
| 1502 | public static final String FEATURE_CAMERA_ANY = "android.hardware.camera.any"; |
| 1503 | |
| 1504 | /** |
| 1505 | * Feature for {@link #getSystemAvailableFeatures} and |
Eino-Ville Talvala | 9131da2 | 2014-05-08 11:39:53 -0700 | [diff] [blame] | 1506 | * {@link #hasSystemFeature}: The device can support having an external camera connected to it. |
| 1507 | * The external camera may not always be connected or available to applications to use. |
| 1508 | */ |
| 1509 | @SdkConstant(SdkConstantType.FEATURE) |
| 1510 | public static final String FEATURE_CAMERA_EXTERNAL = "android.hardware.camera.external"; |
| 1511 | |
| 1512 | /** |
| 1513 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1514 | * {@link #hasSystemFeature}: The device's camera supports flash. |
| 1515 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1516 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1517 | public static final String FEATURE_CAMERA_FLASH = "android.hardware.camera.flash"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1518 | |
| 1519 | /** |
| 1520 | * Feature for {@link #getSystemAvailableFeatures} and |
Chih-Chung Chang | de1057c | 2010-06-14 19:15:00 +0800 | [diff] [blame] | 1521 | * {@link #hasSystemFeature}: The device has a front facing camera. |
| 1522 | */ |
| 1523 | @SdkConstant(SdkConstantType.FEATURE) |
| 1524 | public static final String FEATURE_CAMERA_FRONT = "android.hardware.camera.front"; |
| 1525 | |
| 1526 | /** |
Eino-Ville Talvala | 611fece | 2014-07-10 17:29:38 -0700 | [diff] [blame] | 1527 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1528 | * of the cameras on the device supports the |
| 1529 | * {@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL full hardware} |
| 1530 | * capability level. |
| 1531 | */ |
| 1532 | @SdkConstant(SdkConstantType.FEATURE) |
| 1533 | public static final String FEATURE_CAMERA_LEVEL_FULL = "android.hardware.camera.level.full"; |
| 1534 | |
| 1535 | /** |
| 1536 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1537 | * of the cameras on the device supports the |
| 1538 | * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR manual sensor} |
| 1539 | * capability level. |
| 1540 | */ |
| 1541 | @SdkConstant(SdkConstantType.FEATURE) |
| 1542 | public static final String FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR = |
| 1543 | "android.hardware.camera.capability.manual_sensor"; |
| 1544 | |
| 1545 | /** |
| 1546 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1547 | * of the cameras on the device supports the |
| 1548 | * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING manual post-processing} |
| 1549 | * capability level. |
| 1550 | */ |
| 1551 | @SdkConstant(SdkConstantType.FEATURE) |
| 1552 | public static final String FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING = |
| 1553 | "android.hardware.camera.capability.manual_post_processing"; |
| 1554 | |
| 1555 | /** |
| 1556 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1557 | * of the cameras on the device supports the |
| 1558 | * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_RAW RAW} |
| 1559 | * capability level. |
| 1560 | */ |
| 1561 | @SdkConstant(SdkConstantType.FEATURE) |
| 1562 | public static final String FEATURE_CAMERA_CAPABILITY_RAW = |
| 1563 | "android.hardware.camera.capability.raw"; |
| 1564 | |
| 1565 | /** |
Chih-Chung Chang | de1057c | 2010-06-14 19:15:00 +0800 | [diff] [blame] | 1566 | * Feature for {@link #getSystemAvailableFeatures} and |
Alex Ray | 0c9d61f | 2013-10-03 12:17:54 -0700 | [diff] [blame] | 1567 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 1568 | * consumer IR devices. |
| 1569 | */ |
| 1570 | @SdkConstant(SdkConstantType.FEATURE) |
| 1571 | public static final String FEATURE_CONSUMER_IR = "android.hardware.consumerir"; |
| 1572 | |
| 1573 | /** |
| 1574 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1575 | * {@link #hasSystemFeature}: The device supports one or more methods of |
| 1576 | * reporting current location. |
| 1577 | */ |
| 1578 | @SdkConstant(SdkConstantType.FEATURE) |
| 1579 | public static final String FEATURE_LOCATION = "android.hardware.location"; |
| 1580 | |
| 1581 | /** |
| 1582 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1583 | * {@link #hasSystemFeature}: The device has a Global Positioning System |
| 1584 | * receiver and can report precise location. |
| 1585 | */ |
| 1586 | @SdkConstant(SdkConstantType.FEATURE) |
| 1587 | public static final String FEATURE_LOCATION_GPS = "android.hardware.location.gps"; |
| 1588 | |
| 1589 | /** |
| 1590 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1591 | * {@link #hasSystemFeature}: The device can report location with coarse |
| 1592 | * accuracy using a network-based geolocation system. |
| 1593 | */ |
| 1594 | @SdkConstant(SdkConstantType.FEATURE) |
| 1595 | public static final String FEATURE_LOCATION_NETWORK = "android.hardware.location.network"; |
| 1596 | |
| 1597 | /** |
| 1598 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1599 | * {@link #hasSystemFeature}: The device can record audio via a |
| 1600 | * microphone. |
| 1601 | */ |
| 1602 | @SdkConstant(SdkConstantType.FEATURE) |
| 1603 | public static final String FEATURE_MICROPHONE = "android.hardware.microphone"; |
| 1604 | |
| 1605 | /** |
| 1606 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 76437d3 | 2010-09-01 11:17:20 -0700 | [diff] [blame] | 1607 | * {@link #hasSystemFeature}: The device can communicate using Near-Field |
| 1608 | * Communications (NFC). |
| 1609 | */ |
| 1610 | @SdkConstant(SdkConstantType.FEATURE) |
| 1611 | public static final String FEATURE_NFC = "android.hardware.nfc"; |
| 1612 | |
| 1613 | /** |
| 1614 | * Feature for {@link #getSystemAvailableFeatures} and |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1615 | * {@link #hasSystemFeature}: The device supports host- |
| 1616 | * based NFC card emulation. |
Martijn Coenen | df4d1d6 | 2013-08-28 11:18:58 -0700 | [diff] [blame] | 1617 | * |
| 1618 | * TODO remove when depending apps have moved to new constant. |
| 1619 | * @hide |
| 1620 | * @deprecated |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1621 | */ |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 1622 | @Deprecated |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1623 | @SdkConstant(SdkConstantType.FEATURE) |
| 1624 | public static final String FEATURE_NFC_HCE = "android.hardware.nfc.hce"; |
| 1625 | |
| 1626 | /** |
| 1627 | * Feature for {@link #getSystemAvailableFeatures} and |
Martijn Coenen | df4d1d6 | 2013-08-28 11:18:58 -0700 | [diff] [blame] | 1628 | * {@link #hasSystemFeature}: The device supports host- |
| 1629 | * based NFC card emulation. |
| 1630 | */ |
| 1631 | @SdkConstant(SdkConstantType.FEATURE) |
| 1632 | public static final String FEATURE_NFC_HOST_CARD_EMULATION = "android.hardware.nfc.hce"; |
| 1633 | |
| 1634 | /** |
| 1635 | * Feature for {@link #getSystemAvailableFeatures} and |
Yoshinobu Ito | c52adfe | 2016-01-22 18:14:18 +0900 | [diff] [blame] | 1636 | * {@link #hasSystemFeature}: The device supports host- |
| 1637 | * based NFC-F card emulation. |
| 1638 | */ |
| 1639 | @SdkConstant(SdkConstantType.FEATURE) |
| 1640 | public static final String FEATURE_NFC_HOST_CARD_EMULATION_NFCF = "android.hardware.nfc.hcef"; |
| 1641 | |
| 1642 | /** |
| 1643 | * Feature for {@link #getSystemAvailableFeatures} and |
Jesse Hall | 7f51706 | 2014-07-18 11:54:41 -0700 | [diff] [blame] | 1644 | * {@link #hasSystemFeature}: The device supports the OpenGL ES |
| 1645 | * <a href="http://www.khronos.org/registry/gles/extensions/ANDROID/ANDROID_extension_pack_es31a.txt"> |
| 1646 | * Android Extension Pack</a>. |
| 1647 | */ |
| 1648 | @SdkConstant(SdkConstantType.FEATURE) |
| 1649 | public static final String FEATURE_OPENGLES_EXTENSION_PACK = "android.hardware.opengles.aep"; |
| 1650 | |
| 1651 | /** |
| 1652 | * Feature for {@link #getSystemAvailableFeatures} and |
Jesse Hall | 39ceeb5 | 2016-03-10 09:04:26 -0800 | [diff] [blame] | 1653 | * {@link #hasSystemFeature(String, int)}: If this feature is supported, the Vulkan native API |
| 1654 | * will enumerate at least one {@code VkPhysicalDevice}, and the feature version will indicate |
| 1655 | * what level of optional hardware features limits it supports. |
Jesse Hall | f77a34f | 2016-02-04 18:41:33 -0800 | [diff] [blame] | 1656 | * <p> |
| 1657 | * Level 0 includes the base Vulkan requirements as well as: |
| 1658 | * <ul><li>{@code VkPhysicalDeviceFeatures::textureCompressionETC2}</li></ul> |
| 1659 | * <p> |
| 1660 | * Level 1 additionally includes: |
| 1661 | * <ul> |
| 1662 | * <li>{@code VkPhysicalDeviceFeatures::fullDrawIndexUint32}</li> |
| 1663 | * <li>{@code VkPhysicalDeviceFeatures::imageCubeArray}</li> |
| 1664 | * <li>{@code VkPhysicalDeviceFeatures::independentBlend}</li> |
| 1665 | * <li>{@code VkPhysicalDeviceFeatures::geometryShader}</li> |
| 1666 | * <li>{@code VkPhysicalDeviceFeatures::tessellationShader}</li> |
| 1667 | * <li>{@code VkPhysicalDeviceFeatures::sampleRateShading}</li> |
| 1668 | * <li>{@code VkPhysicalDeviceFeatures::textureCompressionASTC_LDR}</li> |
| 1669 | * <li>{@code VkPhysicalDeviceFeatures::fragmentStoresAndAtomics}</li> |
| 1670 | * <li>{@code VkPhysicalDeviceFeatures::shaderImageGatherExtended}</li> |
| 1671 | * <li>{@code VkPhysicalDeviceFeatures::shaderUniformBufferArrayDynamicIndexing}</li> |
| 1672 | * <li>{@code VkPhysicalDeviceFeatures::shaderSampledImageArrayDynamicIndexing}</li> |
| 1673 | * </ul> |
| 1674 | */ |
| 1675 | @SdkConstant(SdkConstantType.FEATURE) |
| 1676 | public static final String FEATURE_VULKAN_HARDWARE_LEVEL = "android.hardware.vulkan.level"; |
| 1677 | |
| 1678 | /** |
| 1679 | * Feature for {@link #getSystemAvailableFeatures} and |
Jesse Hall | 39ceeb5 | 2016-03-10 09:04:26 -0800 | [diff] [blame] | 1680 | * {@link #hasSystemFeature(String, int)}: The version of this feature indicates the highest |
Jesse Hall | f77a34f | 2016-02-04 18:41:33 -0800 | [diff] [blame] | 1681 | * {@code VkPhysicalDeviceProperties::apiVersion} supported by the physical devices that support |
| 1682 | * the hardware level indicated by {@link #FEATURE_VULKAN_HARDWARE_LEVEL}. The feature version |
| 1683 | * uses the same encoding as Vulkan version numbers: |
| 1684 | * <ul> |
| 1685 | * <li>Major version number in bits 31-22</li> |
| 1686 | * <li>Minor version number in bits 21-12</li> |
| 1687 | * <li>Patch version number in bits 11-0</li> |
| 1688 | * </ul> |
| 1689 | */ |
| 1690 | @SdkConstant(SdkConstantType.FEATURE) |
| 1691 | public static final String FEATURE_VULKAN_HARDWARE_VERSION = "android.hardware.vulkan.version"; |
| 1692 | |
| 1693 | /** |
| 1694 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1695 | * {@link #hasSystemFeature}: The device includes an accelerometer. |
| 1696 | */ |
| 1697 | @SdkConstant(SdkConstantType.FEATURE) |
| 1698 | public static final String FEATURE_SENSOR_ACCELEROMETER = "android.hardware.sensor.accelerometer"; |
| 1699 | |
| 1700 | /** |
| 1701 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1702 | * {@link #hasSystemFeature}: The device includes a barometer (air |
| 1703 | * pressure sensor.) |
| 1704 | */ |
| 1705 | @SdkConstant(SdkConstantType.FEATURE) |
| 1706 | public static final String FEATURE_SENSOR_BAROMETER = "android.hardware.sensor.barometer"; |
| 1707 | |
| 1708 | /** |
| 1709 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1710 | * {@link #hasSystemFeature}: The device includes a magnetometer (compass). |
| 1711 | */ |
| 1712 | @SdkConstant(SdkConstantType.FEATURE) |
| 1713 | public static final String FEATURE_SENSOR_COMPASS = "android.hardware.sensor.compass"; |
| 1714 | |
| 1715 | /** |
| 1716 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1717 | * {@link #hasSystemFeature}: The device includes a gyroscope. |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1718 | */ |
| 1719 | @SdkConstant(SdkConstantType.FEATURE) |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1720 | public static final String FEATURE_SENSOR_GYROSCOPE = "android.hardware.sensor.gyroscope"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1721 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1722 | /** |
| 1723 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1724 | * {@link #hasSystemFeature}: The device includes a light sensor. |
| 1725 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1726 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1727 | public static final String FEATURE_SENSOR_LIGHT = "android.hardware.sensor.light"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1728 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1729 | /** |
| 1730 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1731 | * {@link #hasSystemFeature}: The device includes a proximity sensor. |
| 1732 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1733 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1734 | public static final String FEATURE_SENSOR_PROXIMITY = "android.hardware.sensor.proximity"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1735 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1736 | /** |
| 1737 | * Feature for {@link #getSystemAvailableFeatures} and |
Aravind Akella | 068b0c0 | 2013-10-12 17:39:15 -0700 | [diff] [blame] | 1738 | * {@link #hasSystemFeature}: The device includes a hardware step counter. |
| 1739 | */ |
| 1740 | @SdkConstant(SdkConstantType.FEATURE) |
| 1741 | public static final String FEATURE_SENSOR_STEP_COUNTER = "android.hardware.sensor.stepcounter"; |
| 1742 | |
| 1743 | /** |
| 1744 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1745 | * {@link #hasSystemFeature}: The device includes a hardware step detector. |
| 1746 | */ |
| 1747 | @SdkConstant(SdkConstantType.FEATURE) |
| 1748 | public static final String FEATURE_SENSOR_STEP_DETECTOR = "android.hardware.sensor.stepdetector"; |
| 1749 | |
| 1750 | /** |
| 1751 | * Feature for {@link #getSystemAvailableFeatures} and |
Vinod Krishnan | 8afb23c | 2014-04-30 11:11:39 -0700 | [diff] [blame] | 1752 | * {@link #hasSystemFeature}: The device includes a heart rate monitor. |
| 1753 | */ |
| 1754 | @SdkConstant(SdkConstantType.FEATURE) |
| 1755 | public static final String FEATURE_SENSOR_HEART_RATE = "android.hardware.sensor.heartrate"; |
| 1756 | |
| 1757 | /** |
| 1758 | * Feature for {@link #getSystemAvailableFeatures} and |
Trevor Johns | 682c24e | 2016-04-12 10:13:47 -0700 | [diff] [blame] | 1759 | * {@link #hasSystemFeature}: The heart rate sensor on this device is an Electrocardiogram. |
Vinod Krishnan | 1ab7689 | 2014-08-20 11:11:55 -0700 | [diff] [blame] | 1760 | */ |
| 1761 | @SdkConstant(SdkConstantType.FEATURE) |
| 1762 | public static final String FEATURE_SENSOR_HEART_RATE_ECG = |
| 1763 | "android.hardware.sensor.heartrate.ecg"; |
| 1764 | |
| 1765 | /** |
| 1766 | * Feature for {@link #getSystemAvailableFeatures} and |
Aravind Akella | 8b8e74b | 2014-07-09 11:52:39 -0700 | [diff] [blame] | 1767 | * {@link #hasSystemFeature}: The device includes a relative humidity sensor. |
| 1768 | */ |
| 1769 | @SdkConstant(SdkConstantType.FEATURE) |
| 1770 | public static final String FEATURE_SENSOR_RELATIVE_HUMIDITY = |
| 1771 | "android.hardware.sensor.relative_humidity"; |
| 1772 | |
| 1773 | /** |
| 1774 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1775 | * {@link #hasSystemFeature}: The device includes an ambient temperature sensor. |
| 1776 | */ |
| 1777 | @SdkConstant(SdkConstantType.FEATURE) |
| 1778 | public static final String FEATURE_SENSOR_AMBIENT_TEMPERATURE = |
| 1779 | "android.hardware.sensor.ambient_temperature"; |
| 1780 | |
| 1781 | /** |
| 1782 | * Feature for {@link #getSystemAvailableFeatures} and |
Ashutosh Joshi | eae371b | 2015-04-09 10:30:07 -0700 | [diff] [blame] | 1783 | * {@link #hasSystemFeature}: The device supports high fidelity sensor processing |
| 1784 | * capabilities. |
| 1785 | */ |
| 1786 | @SdkConstant(SdkConstantType.FEATURE) |
| 1787 | public static final String FEATURE_HIFI_SENSORS = |
| 1788 | "android.hardware.sensor.hifi_sensors"; |
| 1789 | |
| 1790 | /** |
| 1791 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1792 | * {@link #hasSystemFeature}: The device has a telephony radio with data |
| 1793 | * communication support. |
| 1794 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1795 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1796 | public static final String FEATURE_TELEPHONY = "android.hardware.telephony"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1797 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1798 | /** |
| 1799 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1800 | * {@link #hasSystemFeature}: The device has a CDMA telephony stack. |
| 1801 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1802 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1803 | public static final String FEATURE_TELEPHONY_CDMA = "android.hardware.telephony.cdma"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1804 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1805 | /** |
| 1806 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1807 | * {@link #hasSystemFeature}: The device has a GSM telephony stack. |
| 1808 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1809 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1810 | public static final String FEATURE_TELEPHONY_GSM = "android.hardware.telephony.gsm"; |
Hung-ying Tyan | 3424c02 | 2010-08-27 18:08:19 +0800 | [diff] [blame] | 1811 | |
| 1812 | /** |
| 1813 | * Feature for {@link #getSystemAvailableFeatures} and |
Mike Lockwood | f4ca247 | 2011-02-27 11:23:25 -0800 | [diff] [blame] | 1814 | * {@link #hasSystemFeature}: The device supports connecting to USB devices |
| 1815 | * as the USB host. |
| 1816 | */ |
| 1817 | @SdkConstant(SdkConstantType.FEATURE) |
| 1818 | public static final String FEATURE_USB_HOST = "android.hardware.usb.host"; |
| 1819 | |
| 1820 | /** |
| 1821 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1822 | * {@link #hasSystemFeature}: The device supports connecting to USB accessories. |
| 1823 | */ |
| 1824 | @SdkConstant(SdkConstantType.FEATURE) |
| 1825 | public static final String FEATURE_USB_ACCESSORY = "android.hardware.usb.accessory"; |
| 1826 | |
| 1827 | /** |
| 1828 | * Feature for {@link #getSystemAvailableFeatures} and |
Hung-ying Tyan | 3424c02 | 2010-08-27 18:08:19 +0800 | [diff] [blame] | 1829 | * {@link #hasSystemFeature}: The SIP API is enabled on the device. |
| 1830 | */ |
| 1831 | @SdkConstant(SdkConstantType.FEATURE) |
| 1832 | public static final String FEATURE_SIP = "android.software.sip"; |
| 1833 | |
| 1834 | /** |
| 1835 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1836 | * {@link #hasSystemFeature}: The device supports SIP-based VOIP. |
| 1837 | */ |
| 1838 | @SdkConstant(SdkConstantType.FEATURE) |
| 1839 | public static final String FEATURE_SIP_VOIP = "android.software.sip.voip"; |
| 1840 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1841 | /** |
| 1842 | * Feature for {@link #getSystemAvailableFeatures} and |
Ihab Awad | 1ec6888 | 2014-09-12 11:09:01 -0700 | [diff] [blame] | 1843 | * {@link #hasSystemFeature}: The Connection Service API is enabled on the device. |
| 1844 | */ |
| 1845 | @SdkConstant(SdkConstantType.FEATURE) |
| 1846 | public static final String FEATURE_CONNECTION_SERVICE = "android.software.connectionservice"; |
| 1847 | |
| 1848 | /** |
| 1849 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | b0fe033 | 2010-04-05 14:43:58 -0700 | [diff] [blame] | 1850 | * {@link #hasSystemFeature}: The device's display has a touch screen. |
| 1851 | */ |
| 1852 | @SdkConstant(SdkConstantType.FEATURE) |
| 1853 | public static final String FEATURE_TOUCHSCREEN = "android.hardware.touchscreen"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1854 | |
Dan Morrill | b0fe033 | 2010-04-05 14:43:58 -0700 | [diff] [blame] | 1855 | /** |
| 1856 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1857 | * {@link #hasSystemFeature}: The device's touch screen supports |
| 1858 | * multitouch sufficient for basic two-finger gesture detection. |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1859 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1860 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1861 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH = "android.hardware.touchscreen.multitouch"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1862 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1863 | /** |
| 1864 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1865 | * {@link #hasSystemFeature}: The device's touch screen is capable of |
| 1866 | * tracking two or more fingers fully independently. |
| 1867 | */ |
| 1868 | @SdkConstant(SdkConstantType.FEATURE) |
| 1869 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT = "android.hardware.touchscreen.multitouch.distinct"; |
| 1870 | |
| 1871 | /** |
| 1872 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 6993d3d | 2010-09-03 14:30:14 -0700 | [diff] [blame] | 1873 | * {@link #hasSystemFeature}: The device's touch screen is capable of |
| 1874 | * tracking a full hand of fingers fully independently -- that is, 5 or |
| 1875 | * more simultaneous independent pointers. |
| 1876 | */ |
| 1877 | @SdkConstant(SdkConstantType.FEATURE) |
| 1878 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND = "android.hardware.touchscreen.multitouch.jazzhand"; |
| 1879 | |
| 1880 | /** |
| 1881 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | a537687 | 2011-01-23 13:15:53 -0800 | [diff] [blame] | 1882 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 1883 | * does support touch emulation for basic events. For instance, the |
| 1884 | * device might use a mouse or remote control to drive a cursor, and |
| 1885 | * emulate basic touch pointer events like down, up, drag, etc. All |
| 1886 | * devices that support android.hardware.touchscreen or a sub-feature are |
| 1887 | * presumed to also support faketouch. |
| 1888 | */ |
| 1889 | @SdkConstant(SdkConstantType.FEATURE) |
| 1890 | public static final String FEATURE_FAKETOUCH = "android.hardware.faketouch"; |
| 1891 | |
| 1892 | /** |
| 1893 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | e22fe93 | 2011-06-08 20:24:29 -0700 | [diff] [blame] | 1894 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 1895 | * does support touch emulation for basic events that supports distinct |
| 1896 | * tracking of two or more fingers. This is an extension of |
| 1897 | * {@link #FEATURE_FAKETOUCH} for input devices with this capability. Note |
| 1898 | * that unlike a distinct multitouch screen as defined by |
| 1899 | * {@link #FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT}, these kinds of input |
| 1900 | * devices will not actually provide full two-finger gestures since the |
| 1901 | * input is being transformed to cursor movement on the screen. That is, |
| 1902 | * single finger gestures will move a cursor; two-finger swipes will |
| 1903 | * result in single-finger touch events; other two-finger gestures will |
| 1904 | * result in the corresponding two-finger touch event. |
| 1905 | */ |
| 1906 | @SdkConstant(SdkConstantType.FEATURE) |
| 1907 | public static final String FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT = "android.hardware.faketouch.multitouch.distinct"; |
| 1908 | |
| 1909 | /** |
| 1910 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1911 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 1912 | * does support touch emulation for basic events that supports tracking |
| 1913 | * a hand of fingers (5 or more fingers) fully independently. |
| 1914 | * This is an extension of |
| 1915 | * {@link #FEATURE_FAKETOUCH} for input devices with this capability. Note |
| 1916 | * that unlike a multitouch screen as defined by |
| 1917 | * {@link #FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND}, not all two finger |
| 1918 | * gestures can be detected due to the limitations described for |
| 1919 | * {@link #FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT}. |
| 1920 | */ |
| 1921 | @SdkConstant(SdkConstantType.FEATURE) |
| 1922 | public static final String FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND = "android.hardware.faketouch.multitouch.jazzhand"; |
| 1923 | |
| 1924 | /** |
| 1925 | * Feature for {@link #getSystemAvailableFeatures} and |
Jim Miller | d9b9d41 | 2015-07-22 19:51:40 -0700 | [diff] [blame] | 1926 | * {@link #hasSystemFeature}: The device has biometric hardware to detect a fingerprint. |
| 1927 | */ |
| 1928 | @SdkConstant(SdkConstantType.FEATURE) |
| 1929 | public static final String FEATURE_FINGERPRINT = "android.hardware.fingerprint"; |
| 1930 | |
| 1931 | /** |
| 1932 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | e289bff | 2011-06-13 19:33:22 -0700 | [diff] [blame] | 1933 | * {@link #hasSystemFeature}: The device supports portrait orientation |
| 1934 | * screens. For backwards compatibility, you can assume that if neither |
| 1935 | * this nor {@link #FEATURE_SCREEN_LANDSCAPE} is set then the device supports |
| 1936 | * both portrait and landscape. |
| 1937 | */ |
| 1938 | @SdkConstant(SdkConstantType.FEATURE) |
| 1939 | public static final String FEATURE_SCREEN_PORTRAIT = "android.hardware.screen.portrait"; |
| 1940 | |
| 1941 | /** |
| 1942 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1943 | * {@link #hasSystemFeature}: The device supports landscape orientation |
| 1944 | * screens. For backwards compatibility, you can assume that if neither |
| 1945 | * this nor {@link #FEATURE_SCREEN_PORTRAIT} is set then the device supports |
| 1946 | * both portrait and landscape. |
| 1947 | */ |
| 1948 | @SdkConstant(SdkConstantType.FEATURE) |
| 1949 | public static final String FEATURE_SCREEN_LANDSCAPE = "android.hardware.screen.landscape"; |
| 1950 | |
| 1951 | /** |
| 1952 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1953 | * {@link #hasSystemFeature}: The device supports live wallpapers. |
| 1954 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1955 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1956 | public static final String FEATURE_LIVE_WALLPAPER = "android.software.live_wallpaper"; |
Oscar Montemayor | 1228d0a | 2010-01-28 12:01:44 -0800 | [diff] [blame] | 1957 | /** |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1958 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 119bbc3 | 2013-03-22 17:27:25 -0700 | [diff] [blame] | 1959 | * {@link #hasSystemFeature}: The device supports app widgets. |
| 1960 | */ |
| 1961 | @SdkConstant(SdkConstantType.FEATURE) |
| 1962 | public static final String FEATURE_APP_WIDGETS = "android.software.app_widgets"; |
| 1963 | |
| 1964 | /** |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 1965 | * @hide |
| 1966 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1967 | * {@link #hasSystemFeature}: The device supports |
| 1968 | * {@link android.service.voice.VoiceInteractionService} and |
| 1969 | * {@link android.app.VoiceInteractor}. |
| 1970 | */ |
| 1971 | @SdkConstant(SdkConstantType.FEATURE) |
| 1972 | public static final String FEATURE_VOICE_RECOGNIZERS = "android.software.voice_recognizers"; |
| 1973 | |
| 1974 | |
| 1975 | /** |
Dianne Hackborn | 119bbc3 | 2013-03-22 17:27:25 -0700 | [diff] [blame] | 1976 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1977 | * {@link #hasSystemFeature}: The device supports a home screen that is replaceable |
| 1978 | * by third party applications. |
| 1979 | */ |
| 1980 | @SdkConstant(SdkConstantType.FEATURE) |
| 1981 | public static final String FEATURE_HOME_SCREEN = "android.software.home_screen"; |
| 1982 | |
| 1983 | /** |
| 1984 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1985 | * {@link #hasSystemFeature}: The device supports adding new input methods implemented |
| 1986 | * with the {@link android.inputmethodservice.InputMethodService} API. |
| 1987 | */ |
| 1988 | @SdkConstant(SdkConstantType.FEATURE) |
| 1989 | public static final String FEATURE_INPUT_METHODS = "android.software.input_methods"; |
| 1990 | |
| 1991 | /** |
| 1992 | * Feature for {@link #getSystemAvailableFeatures} and |
Amith Yamasani | 44a01b7 | 2013-09-16 10:44:57 -0700 | [diff] [blame] | 1993 | * {@link #hasSystemFeature}: The device supports device policy enforcement via device admins. |
| 1994 | */ |
| 1995 | @SdkConstant(SdkConstantType.FEATURE) |
| 1996 | public static final String FEATURE_DEVICE_ADMIN = "android.software.device_admin"; |
| 1997 | |
| 1998 | /** |
| 1999 | * Feature for {@link #getSystemAvailableFeatures} and |
Tim Kilbourn | f94b6a9 | 2014-03-07 15:13:48 -0800 | [diff] [blame] | 2000 | * {@link #hasSystemFeature}: The device supports leanback UI. This is |
| 2001 | * typically used in a living room television experience, but is a software |
| 2002 | * feature unlike {@link #FEATURE_TELEVISION}. Devices running with this |
| 2003 | * feature will use resources associated with the "television" UI mode. |
| 2004 | */ |
| 2005 | @SdkConstant(SdkConstantType.FEATURE) |
| 2006 | public static final String FEATURE_LEANBACK = "android.software.leanback"; |
| 2007 | |
| 2008 | /** |
| 2009 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2010 | * {@link #hasSystemFeature}: The device supports only leanback UI. Only |
| 2011 | * applications designed for this experience should be run, though this is |
| 2012 | * not enforced by the system. |
| 2013 | * @hide |
| 2014 | */ |
| 2015 | @SdkConstant(SdkConstantType.FEATURE) |
| 2016 | public static final String FEATURE_LEANBACK_ONLY = "android.software.leanback_only"; |
| 2017 | |
| 2018 | /** |
| 2019 | * Feature for {@link #getSystemAvailableFeatures} and |
Jae Seo | cfd861e | 2014-08-27 14:02:15 -0700 | [diff] [blame] | 2020 | * {@link #hasSystemFeature}: The device supports live TV and can display |
| 2021 | * contents from TV inputs implemented with the |
| 2022 | * {@link android.media.tv.TvInputService} API. |
| 2023 | */ |
| 2024 | @SdkConstant(SdkConstantType.FEATURE) |
| 2025 | public static final String FEATURE_LIVE_TV = "android.software.live_tv"; |
| 2026 | |
| 2027 | /** |
| 2028 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 2029 | * {@link #hasSystemFeature}: The device supports WiFi (802.11) networking. |
| 2030 | */ |
| 2031 | @SdkConstant(SdkConstantType.FEATURE) |
| 2032 | public static final String FEATURE_WIFI = "android.hardware.wifi"; |
| 2033 | |
| 2034 | /** |
Irfan Sheriff | 45b8b46 | 2011-09-07 11:24:16 -0700 | [diff] [blame] | 2035 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2036 | * {@link #hasSystemFeature}: The device supports Wi-Fi Direct networking. |
| 2037 | */ |
| 2038 | @SdkConstant(SdkConstantType.FEATURE) |
| 2039 | public static final String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct"; |
| 2040 | |
| 2041 | /** |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2042 | * Feature for {@link #getSystemAvailableFeatures} and |
Etan Cohen | 0413327 | 2016-10-26 11:22:06 -0700 | [diff] [blame] | 2043 | * {@link #hasSystemFeature}: The device supports Wi-Fi Aware. |
Etan Cohen | 20d329b | 2015-09-29 13:49:02 -0700 | [diff] [blame] | 2044 | * |
Etan Cohen | 0413327 | 2016-10-26 11:22:06 -0700 | [diff] [blame] | 2045 | * @hide PROPOSED_AWARE_API |
Etan Cohen | 20d329b | 2015-09-29 13:49:02 -0700 | [diff] [blame] | 2046 | */ |
| 2047 | @SdkConstant(SdkConstantType.FEATURE) |
Etan Cohen | 0413327 | 2016-10-26 11:22:06 -0700 | [diff] [blame] | 2048 | public static final String FEATURE_WIFI_AWARE = "android.hardware.wifi.aware"; |
Etan Cohen | 20d329b | 2015-09-29 13:49:02 -0700 | [diff] [blame] | 2049 | |
| 2050 | /** |
| 2051 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2052 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
Todd Kennedy | 7f95a00 | 2015-04-22 14:28:25 -0700 | [diff] [blame] | 2053 | * on a vehicle headunit. A headunit here is defined to be inside a |
| 2054 | * vehicle that may or may not be moving. A headunit uses either a |
| 2055 | * primary display in the center console and/or additional displays in |
| 2056 | * the instrument cluster or elsewhere in the vehicle. Headunit display(s) |
| 2057 | * have limited size and resolution. The user will likely be focused on |
| 2058 | * driving so limiting driver distraction is a primary concern. User input |
| 2059 | * can be a variety of hard buttons, touch, rotary controllers and even mouse- |
| 2060 | * like interfaces. |
| 2061 | */ |
| 2062 | @SdkConstant(SdkConstantType.FEATURE) |
| 2063 | public static final String FEATURE_AUTOMOTIVE = "android.hardware.type.automotive"; |
| 2064 | |
| 2065 | /** |
| 2066 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2067 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2068 | * on a television. Television here is defined to be a typical living |
| 2069 | * room television experience: displayed on a big screen, where the user |
| 2070 | * is sitting far away from it, and the dominant form of input will be |
| 2071 | * something like a DPAD, not through touch or mouse. |
Tim Kilbourn | f94b6a9 | 2014-03-07 15:13:48 -0800 | [diff] [blame] | 2072 | * @deprecated use {@link #FEATURE_LEANBACK} instead. |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2073 | */ |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 2074 | @Deprecated |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2075 | @SdkConstant(SdkConstantType.FEATURE) |
| 2076 | public static final String FEATURE_TELEVISION = "android.hardware.type.television"; |
| 2077 | |
| 2078 | /** |
Justin Koh | b5731f091c | 2014-02-13 16:06:59 -0800 | [diff] [blame] | 2079 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2080 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
| 2081 | * on a watch. A watch here is defined to be a device worn on the body, perhaps on |
| 2082 | * the wrist. The user is very close when interacting with the device. |
| 2083 | */ |
| 2084 | @SdkConstant(SdkConstantType.FEATURE) |
| 2085 | public static final String FEATURE_WATCH = "android.hardware.type.watch"; |
| 2086 | |
| 2087 | /** |
Adam Lesinski | 3d9bcb9 | 2014-02-18 14:05:14 -0800 | [diff] [blame] | 2088 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2089 | * The device supports printing. |
| 2090 | */ |
| 2091 | @SdkConstant(SdkConstantType.FEATURE) |
| 2092 | public static final String FEATURE_PRINTING = "android.software.print"; |
| 2093 | |
| 2094 | /** |
| 2095 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2096 | * The device can perform backup and restore operations on installed applications. |
| 2097 | */ |
| 2098 | @SdkConstant(SdkConstantType.FEATURE) |
| 2099 | public static final String FEATURE_BACKUP = "android.software.backup"; |
| 2100 | |
| 2101 | /** |
Vladislav Kaznacheev | d303b25 | 2015-10-27 17:30:58 -0700 | [diff] [blame] | 2102 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2103 | * {@link #hasSystemFeature}: The device supports freeform window management. |
| 2104 | * Windows have title bars and can be moved and resized. |
| 2105 | */ |
Filip Gruszczynski | 811dc3b | 2015-11-23 12:34:22 -0800 | [diff] [blame] | 2106 | // If this feature is present, you also need to set |
| 2107 | // com.android.internal.R.config_freeformWindowManagement to true in your configuration overlay. |
Vladislav Kaznacheev | d303b25 | 2015-10-27 17:30:58 -0700 | [diff] [blame] | 2108 | @SdkConstant(SdkConstantType.FEATURE) |
| 2109 | public static final String FEATURE_FREEFORM_WINDOW_MANAGEMENT |
| 2110 | = "android.software.freeform_window_management"; |
| 2111 | |
| 2112 | /** |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 2113 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Wale Ogunwale | fbe12c4 | 2015-12-06 16:23:50 -0800 | [diff] [blame] | 2114 | * The device supports picture-in-picture multi-window mode. |
| 2115 | */ |
| 2116 | @SdkConstant(SdkConstantType.FEATURE) |
| 2117 | public static final String FEATURE_PICTURE_IN_PICTURE = "android.software.picture_in_picture"; |
| 2118 | |
| 2119 | /** |
| 2120 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Amith Yamasani | 1d65327 | 2014-09-11 17:56:05 -0700 | [diff] [blame] | 2121 | * The device supports creating secondary users and managed profiles via |
| 2122 | * {@link DevicePolicyManager}. |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 2123 | */ |
| 2124 | @SdkConstant(SdkConstantType.FEATURE) |
Amith Yamasani | 1d65327 | 2014-09-11 17:56:05 -0700 | [diff] [blame] | 2125 | public static final String FEATURE_MANAGED_USERS = "android.software.managed_users"; |
| 2126 | |
| 2127 | /** |
| 2128 | * @hide |
| 2129 | * TODO: Remove after dependencies updated b/17392243 |
| 2130 | */ |
| 2131 | public static final String FEATURE_MANAGED_PROFILES = "android.software.managed_users"; |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 2132 | |
| 2133 | /** |
Ben Murdoch | f564c7f | 2014-05-20 18:58:06 +0100 | [diff] [blame] | 2134 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Adam Connors | 19ccb5f | 2014-09-08 17:31:50 +0100 | [diff] [blame] | 2135 | * The device supports verified boot. |
| 2136 | */ |
| 2137 | @SdkConstant(SdkConstantType.FEATURE) |
| 2138 | public static final String FEATURE_VERIFIED_BOOT = "android.software.verified_boot"; |
| 2139 | |
| 2140 | /** |
| 2141 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2142 | * The device supports secure removal of users. When a user is deleted the data associated |
| 2143 | * with that user is securely deleted and no longer available. |
| 2144 | */ |
| 2145 | @SdkConstant(SdkConstantType.FEATURE) |
| 2146 | public static final String FEATURE_SECURELY_REMOVES_USERS |
| 2147 | = "android.software.securely_removes_users"; |
| 2148 | |
Jeff Sharkey | b92b05b | 2016-01-28 09:50:00 -0700 | [diff] [blame] | 2149 | /** {@hide} */ |
| 2150 | @SdkConstant(SdkConstantType.FEATURE) |
| 2151 | public static final String FEATURE_FILE_BASED_ENCRYPTION |
| 2152 | = "android.software.file_based_encryption"; |
| 2153 | |
Adam Connors | 19ccb5f | 2014-09-08 17:31:50 +0100 | [diff] [blame] | 2154 | /** |
| 2155 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Ben Murdoch | 422c7a5 | 2014-05-16 13:45:47 +0100 | [diff] [blame] | 2156 | * The device has a full implementation of the android.webkit.* APIs. Devices |
| 2157 | * lacking this feature will not have a functioning WebView implementation. |
| 2158 | */ |
| 2159 | @SdkConstant(SdkConstantType.FEATURE) |
| 2160 | public static final String FEATURE_WEBVIEW = "android.software.webview"; |
| 2161 | |
| 2162 | /** |
Joe LaPenna | 4bb015d | 2014-07-04 17:15:54 -0700 | [diff] [blame] | 2163 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2164 | * {@link #hasSystemFeature}: This device supports ethernet. |
Joe LaPenna | 4bb015d | 2014-07-04 17:15:54 -0700 | [diff] [blame] | 2165 | */ |
| 2166 | @SdkConstant(SdkConstantType.FEATURE) |
| 2167 | public static final String FEATURE_ETHERNET = "android.hardware.ethernet"; |
| 2168 | |
| 2169 | /** |
Yuncheol Heo | a0c4a06 | 2014-07-10 20:49:27 +0900 | [diff] [blame] | 2170 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2171 | * {@link #hasSystemFeature}: This device supports HDMI-CEC. |
| 2172 | * @hide |
| 2173 | */ |
| 2174 | @SdkConstant(SdkConstantType.FEATURE) |
| 2175 | public static final String FEATURE_HDMI_CEC = "android.hardware.hdmi.cec"; |
| 2176 | |
| 2177 | /** |
Michael Wright | 6faa675 | 2014-09-05 17:57:44 -0700 | [diff] [blame] | 2178 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2179 | * The device has all of the inputs necessary to be considered a compatible game controller, or |
| 2180 | * includes a compatible game controller in the box. |
| 2181 | */ |
| 2182 | @SdkConstant(SdkConstantType.FEATURE) |
| 2183 | public static final String FEATURE_GAMEPAD = "android.hardware.gamepad"; |
| 2184 | |
Mike Lockwood | 5781cd5 | 2015-03-27 13:23:41 -0700 | [diff] [blame] | 2185 | /** |
| 2186 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2187 | * The device has a full implementation of the android.media.midi.* APIs. |
| 2188 | */ |
| 2189 | @SdkConstant(SdkConstantType.FEATURE) |
| 2190 | public static final String FEATURE_MIDI = "android.software.midi"; |
Michael Wright | 6faa675 | 2014-09-05 17:57:44 -0700 | [diff] [blame] | 2191 | |
| 2192 | /** |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2193 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Ruben Brunk | 927d345 | 2016-05-02 19:30:51 -0700 | [diff] [blame] | 2194 | * The device implements an optimized mode for virtual reality (VR) applications that handles |
| 2195 | * stereoscopic rendering of notifications, and disables most monocular system UI components |
| 2196 | * while a VR application has user focus. |
| 2197 | * Devices declaring this feature must include an application implementing a |
| 2198 | * {@link android.service.vr.VrListenerService} that can be targeted by VR applications via |
| 2199 | * {@link android.app.Activity#setVrModeEnabled}. |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2200 | */ |
| 2201 | @SdkConstant(SdkConstantType.FEATURE) |
| 2202 | public static final String FEATURE_VR_MODE = "android.software.vr.mode"; |
| 2203 | |
| 2204 | /** |
Ruben Brunk | 31d80ea | 2016-01-25 20:14:08 -0800 | [diff] [blame] | 2205 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Ruben Brunk | 927d345 | 2016-05-02 19:30:51 -0700 | [diff] [blame] | 2206 | * The device implements {@link #FEATURE_VR_MODE} but additionally meets extra CDD requirements |
| 2207 | * to provide a high-quality VR experience. In general, devices declaring this feature will |
| 2208 | * additionally: |
| 2209 | * <ul> |
| 2210 | * <li>Deliver consistent performance at a high framerate over an extended period of time |
| 2211 | * for typical VR application CPU/GPU workloads with a minimal number of frame drops for VR |
| 2212 | * applications that have called |
| 2213 | * {@link android.view.Window#setSustainedPerformanceMode}.</li> |
| 2214 | * <li>Implement {@link #FEATURE_HIFI_SENSORS} and have a low sensor latency.</li> |
| 2215 | * <li>Include optimizations to lower display persistence while running VR applications.</li> |
| 2216 | * <li>Implement an optimized render path to minimize latency to draw to the device's main |
| 2217 | * display.</li> |
| 2218 | * <li>Include the following EGL extensions: EGL_ANDROID_create_native_client_buffer, |
| 2219 | * EGL_ANDROID_front_buffer_auto_refresh, EGL_EXT_protected_content, |
| 2220 | * EGL_KHR_mutable_render_buffer, EGL_KHR_reusable_sync, and EGL_KHR_wait_sync.</li> |
| 2221 | * <li>Provide at least one CPU core that is reserved for use solely by the top, foreground |
| 2222 | * VR application process for critical render threads while such an application is |
| 2223 | * running.</li> |
| 2224 | * </ul> |
Ruben Brunk | 31d80ea | 2016-01-25 20:14:08 -0800 | [diff] [blame] | 2225 | */ |
| 2226 | @SdkConstant(SdkConstantType.FEATURE) |
| 2227 | public static final String FEATURE_VR_MODE_HIGH_PERFORMANCE |
| 2228 | = "android.hardware.vr.high_performance"; |
| 2229 | |
| 2230 | /** |
Dianne Hackborn | e83cefce | 2010-02-04 17:38:14 -0800 | [diff] [blame] | 2231 | * Action to external storage service to clean out removed apps. |
| 2232 | * @hide |
| 2233 | */ |
| 2234 | public static final String ACTION_CLEAN_EXTERNAL_STORAGE |
| 2235 | = "android.content.pm.CLEAN_EXTERNAL_STORAGE"; |
Oscar Montemayor | 1228d0a | 2010-01-28 12:01:44 -0800 | [diff] [blame] | 2236 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2237 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 2238 | * Extra field name for the URI to a verification file. Passed to a package |
| 2239 | * verifier. |
| 2240 | * |
| 2241 | * @hide |
| 2242 | */ |
| 2243 | public static final String EXTRA_VERIFICATION_URI = "android.content.pm.extra.VERIFICATION_URI"; |
| 2244 | |
| 2245 | /** |
| 2246 | * Extra field name for the ID of a package pending verification. Passed to |
| 2247 | * a package verifier and is used to call back to |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 2248 | * {@link PackageManager#verifyPendingInstall(int, int)} |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 2249 | */ |
| 2250 | public static final String EXTRA_VERIFICATION_ID = "android.content.pm.extra.VERIFICATION_ID"; |
| 2251 | |
| 2252 | /** |
| 2253 | * Extra field name for the package identifier which is trying to install |
| 2254 | * the package. |
| 2255 | * |
| 2256 | * @hide |
| 2257 | */ |
| 2258 | public static final String EXTRA_VERIFICATION_INSTALLER_PACKAGE |
| 2259 | = "android.content.pm.extra.VERIFICATION_INSTALLER_PACKAGE"; |
| 2260 | |
| 2261 | /** |
| 2262 | * Extra field name for the requested install flags for a package pending |
| 2263 | * verification. Passed to a package verifier. |
| 2264 | * |
| 2265 | * @hide |
| 2266 | */ |
| 2267 | public static final String EXTRA_VERIFICATION_INSTALL_FLAGS |
| 2268 | = "android.content.pm.extra.VERIFICATION_INSTALL_FLAGS"; |
| 2269 | |
| 2270 | /** |
rich cannings | 13d428e | 2012-09-13 13:43:07 -0700 | [diff] [blame] | 2271 | * Extra field name for the uid of who is requesting to install |
| 2272 | * the package. |
| 2273 | * |
| 2274 | * @hide |
| 2275 | */ |
| 2276 | public static final String EXTRA_VERIFICATION_INSTALLER_UID |
| 2277 | = "android.content.pm.extra.VERIFICATION_INSTALLER_UID"; |
| 2278 | |
| 2279 | /** |
| 2280 | * Extra field name for the package name of a package pending verification. |
| 2281 | * |
| 2282 | * @hide |
| 2283 | */ |
| 2284 | public static final String EXTRA_VERIFICATION_PACKAGE_NAME |
| 2285 | = "android.content.pm.extra.VERIFICATION_PACKAGE_NAME"; |
| 2286 | /** |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 2287 | * Extra field name for the result of a verification, either |
| 2288 | * {@link #VERIFICATION_ALLOW}, or {@link #VERIFICATION_REJECT}. |
| 2289 | * Passed to package verifiers after a package is verified. |
| 2290 | */ |
| 2291 | public static final String EXTRA_VERIFICATION_RESULT |
| 2292 | = "android.content.pm.extra.VERIFICATION_RESULT"; |
| 2293 | |
| 2294 | /** |
rich cannings | 13d428e | 2012-09-13 13:43:07 -0700 | [diff] [blame] | 2295 | * Extra field name for the version code of a package pending verification. |
| 2296 | * |
| 2297 | * @hide |
| 2298 | */ |
| 2299 | public static final String EXTRA_VERIFICATION_VERSION_CODE |
| 2300 | = "android.content.pm.extra.VERIFICATION_VERSION_CODE"; |
| 2301 | |
| 2302 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 2303 | * Extra field name for the ID of a intent filter pending verification. |
| 2304 | * Passed to an intent filter verifier and is used to call back to |
| 2305 | * {@link #verifyIntentFilter} |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 2306 | * |
| 2307 | * @hide |
| 2308 | */ |
| 2309 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_ID |
| 2310 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_ID"; |
| 2311 | |
| 2312 | /** |
| 2313 | * Extra field name for the scheme used for an intent filter pending verification. Passed to |
| 2314 | * an intent filter verifier and is used to construct the URI to verify against. |
| 2315 | * |
| 2316 | * Usually this is "https" |
| 2317 | * |
| 2318 | * @hide |
| 2319 | */ |
| 2320 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_URI_SCHEME |
| 2321 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_URI_SCHEME"; |
| 2322 | |
| 2323 | /** |
| 2324 | * Extra field name for the host names to be used for an intent filter pending verification. |
| 2325 | * Passed to an intent filter verifier and is used to construct the URI to verify the |
| 2326 | * intent filter. |
| 2327 | * |
| 2328 | * This is a space delimited list of hosts. |
| 2329 | * |
| 2330 | * @hide |
| 2331 | */ |
| 2332 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_HOSTS |
| 2333 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_HOSTS"; |
| 2334 | |
| 2335 | /** |
| 2336 | * Extra field name for the package name to be used for an intent filter pending verification. |
| 2337 | * Passed to an intent filter verifier and is used to check the verification responses coming |
| 2338 | * from the hosts. Each host response will need to include the package name of APK containing |
| 2339 | * the intent filter. |
| 2340 | * |
| 2341 | * @hide |
| 2342 | */ |
| 2343 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_PACKAGE_NAME |
| 2344 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_PACKAGE_NAME"; |
| 2345 | |
| 2346 | /** |
| 2347 | * The action used to request that the user approve a permission request |
| 2348 | * from the application. |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2349 | * |
| 2350 | * @hide |
| 2351 | */ |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 2352 | @SystemApi |
| 2353 | public static final String ACTION_REQUEST_PERMISSIONS = |
| 2354 | "android.content.pm.action.REQUEST_PERMISSIONS"; |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2355 | |
| 2356 | /** |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 2357 | * The names of the requested permissions. |
| 2358 | * <p> |
| 2359 | * <strong>Type:</strong> String[] |
| 2360 | * </p> |
| 2361 | * |
| 2362 | * @hide |
| 2363 | */ |
| 2364 | @SystemApi |
| 2365 | public static final String EXTRA_REQUEST_PERMISSIONS_NAMES = |
| 2366 | "android.content.pm.extra.REQUEST_PERMISSIONS_NAMES"; |
| 2367 | |
| 2368 | /** |
| 2369 | * The results from the permissions request. |
| 2370 | * <p> |
| 2371 | * <strong>Type:</strong> int[] of #PermissionResult |
| 2372 | * </p> |
| 2373 | * |
| 2374 | * @hide |
| 2375 | */ |
| 2376 | @SystemApi |
| 2377 | public static final String EXTRA_REQUEST_PERMISSIONS_RESULTS |
| 2378 | = "android.content.pm.extra.REQUEST_PERMISSIONS_RESULTS"; |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2379 | |
| 2380 | /** |
Jeff Sharkey | bb58067 | 2014-07-10 12:10:25 -0700 | [diff] [blame] | 2381 | * String extra for {@link PackageInstallObserver} in the 'extras' Bundle in case of |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2382 | * {@link #INSTALL_FAILED_DUPLICATE_PERMISSION}. This extra names the package which provides |
| 2383 | * the existing definition for the permission. |
| 2384 | * @hide |
| 2385 | */ |
| 2386 | public static final String EXTRA_FAILURE_EXISTING_PACKAGE |
| 2387 | = "android.content.pm.extra.FAILURE_EXISTING_PACKAGE"; |
| 2388 | |
| 2389 | /** |
Jeff Sharkey | bb58067 | 2014-07-10 12:10:25 -0700 | [diff] [blame] | 2390 | * String extra for {@link PackageInstallObserver} in the 'extras' Bundle in case of |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2391 | * {@link #INSTALL_FAILED_DUPLICATE_PERMISSION}. This extra names the permission that is |
| 2392 | * being redundantly defined by the package being installed. |
| 2393 | * @hide |
| 2394 | */ |
| 2395 | public static final String EXTRA_FAILURE_EXISTING_PERMISSION |
| 2396 | = "android.content.pm.extra.FAILURE_EXISTING_PERMISSION"; |
| 2397 | |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2398 | /** |
| 2399 | * Permission flag: The permission is set in its current state |
| 2400 | * by the user and apps can still request it at runtime. |
| 2401 | * |
| 2402 | * @hide |
| 2403 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2404 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2405 | public static final int FLAG_PERMISSION_USER_SET = 1 << 0; |
| 2406 | |
| 2407 | /** |
| 2408 | * Permission flag: The permission is set in its current state |
| 2409 | * by the user and it is fixed, i.e. apps can no longer request |
| 2410 | * this permission. |
| 2411 | * |
| 2412 | * @hide |
| 2413 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2414 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2415 | public static final int FLAG_PERMISSION_USER_FIXED = 1 << 1; |
| 2416 | |
| 2417 | /** |
| 2418 | * Permission flag: The permission is set in its current state |
| 2419 | * by device policy and neither apps nor the user can change |
| 2420 | * its state. |
| 2421 | * |
| 2422 | * @hide |
| 2423 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2424 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2425 | public static final int FLAG_PERMISSION_POLICY_FIXED = 1 << 2; |
| 2426 | |
| 2427 | /** |
| 2428 | * Permission flag: The permission is set in a granted state but |
| 2429 | * access to resources it guards is restricted by other means to |
| 2430 | * enable revoking a permission on legacy apps that do not support |
| 2431 | * runtime permissions. If this permission is upgraded to runtime |
| 2432 | * because the app was updated to support runtime permissions, the |
| 2433 | * the permission will be revoked in the upgrade process. |
| 2434 | * |
| 2435 | * @hide |
| 2436 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2437 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2438 | public static final int FLAG_PERMISSION_REVOKE_ON_UPGRADE = 1 << 3; |
| 2439 | |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 2440 | /** |
| 2441 | * Permission flag: The permission is set in its current state |
| 2442 | * because the app is a component that is a part of the system. |
| 2443 | * |
| 2444 | * @hide |
| 2445 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2446 | @SystemApi |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 2447 | public static final int FLAG_PERMISSION_SYSTEM_FIXED = 1 << 4; |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2448 | |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 2449 | /** |
| 2450 | * Permission flag: The permission is granted by default because it |
| 2451 | * enables app functionality that is expected to work out-of-the-box |
| 2452 | * for providing a smooth user experience. For example, the phone app |
| 2453 | * is expected to have the phone permission. |
| 2454 | * |
| 2455 | * @hide |
| 2456 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2457 | @SystemApi |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 2458 | public static final int FLAG_PERMISSION_GRANTED_BY_DEFAULT = 1 << 5; |
| 2459 | |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2460 | /** |
Svet Ganov | 9c165d7 | 2015-12-01 19:52:26 -0800 | [diff] [blame] | 2461 | * Permission flag: The permission has to be reviewed before any of |
| 2462 | * the app components can run. |
| 2463 | * |
| 2464 | * @hide |
| 2465 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 2466 | @SystemApi |
Svet Ganov | 9c165d7 | 2015-12-01 19:52:26 -0800 | [diff] [blame] | 2467 | public static final int FLAG_PERMISSION_REVIEW_REQUIRED = 1 << 6; |
| 2468 | |
| 2469 | /** |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2470 | * Mask for all permission flags. |
| 2471 | * |
| 2472 | * @hide |
| 2473 | */ |
| 2474 | @SystemApi |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 2475 | public static final int MASK_PERMISSION_FLAGS = 0xFF; |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2476 | |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2477 | /** |
Svet Ganov | d7b1f411 | 2016-02-09 18:49:23 -0800 | [diff] [blame] | 2478 | * This is a library that contains components apps can invoke. For |
| 2479 | * example, a services for apps to bind to, or standard chooser UI, |
| 2480 | * etc. This library is versioned and backwards compatible. Clients |
| 2481 | * should check its version via {@link android.ext.services.Version |
| 2482 | * #getVersionCode()} and avoid calling APIs added in later versions. |
| 2483 | * |
| 2484 | * @hide |
| 2485 | */ |
| 2486 | public static final String SYSTEM_SHARED_LIBRARY_SERVICES = "android.ext.services"; |
| 2487 | |
| 2488 | /** |
| 2489 | * This is a library that contains components apps can dynamically |
| 2490 | * load. For example, new widgets, helper classes, etc. This library |
| 2491 | * is versioned and backwards compatible. Clients should check its |
| 2492 | * version via {@link android.ext.shared.Version#getVersionCode()} |
| 2493 | * and avoid calling APIs added in later versions. |
| 2494 | * |
| 2495 | * @hide |
| 2496 | */ |
| 2497 | public static final String SYSTEM_SHARED_LIBRARY_SHARED = "android.ext.shared"; |
| 2498 | |
| 2499 | /** |
Brian Carlstrom | ca82e61 | 2016-04-19 23:16:08 -0700 | [diff] [blame] | 2500 | * Used when starting a process for an Activity. |
| 2501 | * |
| 2502 | * @hide |
| 2503 | */ |
| 2504 | public static final int NOTIFY_PACKAGE_USE_ACTIVITY = 0; |
| 2505 | |
| 2506 | /** |
| 2507 | * Used when starting a process for a Service. |
| 2508 | * |
| 2509 | * @hide |
| 2510 | */ |
| 2511 | public static final int NOTIFY_PACKAGE_USE_SERVICE = 1; |
| 2512 | |
| 2513 | /** |
| 2514 | * Used when moving a Service to the foreground. |
| 2515 | * |
| 2516 | * @hide |
| 2517 | */ |
| 2518 | public static final int NOTIFY_PACKAGE_USE_FOREGROUND_SERVICE = 2; |
| 2519 | |
| 2520 | /** |
| 2521 | * Used when starting a process for a BroadcastReceiver. |
| 2522 | * |
| 2523 | * @hide |
| 2524 | */ |
| 2525 | public static final int NOTIFY_PACKAGE_USE_BROADCAST_RECEIVER = 3; |
| 2526 | |
| 2527 | /** |
| 2528 | * Used when starting a process for a ContentProvider. |
| 2529 | * |
| 2530 | * @hide |
| 2531 | */ |
| 2532 | public static final int NOTIFY_PACKAGE_USE_CONTENT_PROVIDER = 4; |
| 2533 | |
| 2534 | /** |
| 2535 | * Used when starting a process for a BroadcastReceiver. |
| 2536 | * |
| 2537 | * @hide |
| 2538 | */ |
| 2539 | public static final int NOTIFY_PACKAGE_USE_BACKUP = 5; |
| 2540 | |
| 2541 | /** |
| 2542 | * Used with Context.getClassLoader() across Android packages. |
| 2543 | * |
| 2544 | * @hide |
| 2545 | */ |
| 2546 | public static final int NOTIFY_PACKAGE_USE_CROSS_PACKAGE = 6; |
| 2547 | |
| 2548 | /** |
| 2549 | * Used when starting a package within a process for Instrumentation. |
| 2550 | * |
| 2551 | * @hide |
| 2552 | */ |
| 2553 | public static final int NOTIFY_PACKAGE_USE_INSTRUMENTATION = 7; |
| 2554 | |
| 2555 | /** |
| 2556 | * Total number of usage reasons. |
| 2557 | * |
| 2558 | * @hide |
| 2559 | */ |
| 2560 | public static final int NOTIFY_PACKAGE_USE_REASONS_COUNT = 8; |
| 2561 | |
| 2562 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2563 | * Retrieve overall information about an application package that is |
| 2564 | * installed on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2565 | * |
| 2566 | * @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] | 2567 | * desired package. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2568 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2569 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 2570 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 2571 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 2572 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 2573 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 2574 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 2575 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 2576 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2577 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2578 | * to modify the data returned. |
| 2579 | * |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2580 | * @return A PackageInfo object containing information about the |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2581 | * package. If flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if the |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 2582 | * package is not found in the list of installed applications, the |
| 2583 | * package information is retrieved from the list of uninstalled |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2584 | * applications (which includes installed applications as well as |
| 2585 | * applications with data directory i.e. applications which had been |
| 2586 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2587 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2588 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2589 | * @see #GET_ACTIVITIES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2590 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2591 | * @see #GET_GIDS |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2592 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2593 | * @see #GET_INTENT_FILTERS |
| 2594 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2595 | * @see #GET_PERMISSIONS |
| 2596 | * @see #GET_PROVIDERS |
| 2597 | * @see #GET_RECEIVERS |
| 2598 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2599 | * @see #GET_SHARED_LIBRARY_FILES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2600 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2601 | * @see #GET_URI_PERMISSION_PATTERNS |
| 2602 | * @see #MATCH_DISABLED_COMPONENTS |
| 2603 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 2604 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2605 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2606 | public abstract PackageInfo getPackageInfo(String packageName, @PackageInfoFlags int flags) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2607 | throws NameNotFoundException; |
| 2608 | |
| 2609 | /** |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2610 | * @hide |
| 2611 | * Retrieve overall information about an application package that is |
| 2612 | * installed on the system. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2613 | * |
| 2614 | * @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] | 2615 | * desired package. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2616 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2617 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 2618 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 2619 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 2620 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 2621 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 2622 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 2623 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 2624 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2625 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2626 | * to modify the data returned. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2627 | * @param userId The user id. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2628 | * |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2629 | * @return A PackageInfo object containing information about the |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2630 | * package. If flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if the |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2631 | * package is not found in the list of installed applications, the |
| 2632 | * package information is retrieved from the list of uninstalled |
| 2633 | * applications (which includes installed applications as well as |
| 2634 | * applications with data directory i.e. applications which had been |
| 2635 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2636 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2637 | * found on the system. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2638 | * @see #GET_ACTIVITIES |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2639 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2640 | * @see #GET_GIDS |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2641 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2642 | * @see #GET_INTENT_FILTERS |
| 2643 | * @see #GET_META_DATA |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2644 | * @see #GET_PERMISSIONS |
| 2645 | * @see #GET_PROVIDERS |
| 2646 | * @see #GET_RECEIVERS |
| 2647 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2648 | * @see #GET_SHARED_LIBRARY_FILES |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2649 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2650 | * @see #GET_URI_PERMISSION_PATTERNS |
| 2651 | * @see #MATCH_DISABLED_COMPONENTS |
| 2652 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 2653 | * @see #MATCH_UNINSTALLED_PACKAGES |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2654 | */ |
| 2655 | @RequiresPermission(Manifest.permission.INTERACT_ACROSS_USERS) |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2656 | public abstract PackageInfo getPackageInfoAsUser(String packageName, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2657 | @PackageInfoFlags int flags, @UserIdInt int userId) throws NameNotFoundException; |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2658 | |
| 2659 | /** |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 2660 | * Map from the current package names in use on the device to whatever |
| 2661 | * the current canonical name of that package is. |
| 2662 | * @param names Array of current names to be mapped. |
| 2663 | * @return Returns an array of the same size as the original, containing |
| 2664 | * the canonical name for each package. |
| 2665 | */ |
| 2666 | public abstract String[] currentToCanonicalPackageNames(String[] names); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2667 | |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 2668 | /** |
| 2669 | * Map from a packages canonical name to the current name in use on the device. |
| 2670 | * @param names Array of new names to be mapped. |
| 2671 | * @return Returns an array of the same size as the original, containing |
| 2672 | * the current name for each package. |
| 2673 | */ |
| 2674 | public abstract String[] canonicalToCurrentPackageNames(String[] names); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2675 | |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 2676 | /** |
Andrew Solovay | 5ae1335 | 2014-06-06 12:23:09 -0700 | [diff] [blame] | 2677 | * Returns a "good" intent to launch a front-door activity in a package. |
| 2678 | * This is used, for example, to implement an "open" button when browsing |
| 2679 | * through packages. The current implementation looks first for a main |
| 2680 | * activity in the category {@link Intent#CATEGORY_INFO}, and next for a |
| 2681 | * main activity in the category {@link Intent#CATEGORY_LAUNCHER}. Returns |
| 2682 | * <code>null</code> if neither are found. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2683 | * |
| 2684 | * @param packageName The name of the package to inspect. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2685 | * |
Andrew Solovay | 5ae1335 | 2014-06-06 12:23:09 -0700 | [diff] [blame] | 2686 | * @return A fully-qualified {@link Intent} that can be used to launch the |
| 2687 | * main activity in the package. Returns <code>null</code> if the package |
| 2688 | * 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] | 2689 | * recognized. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2690 | */ |
Mihai Preda | eae850c | 2009-05-13 10:13:48 +0200 | [diff] [blame] | 2691 | public abstract Intent getLaunchIntentForPackage(String packageName); |
| 2692 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2693 | /** |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 2694 | * Return a "good" intent to launch a front-door Leanback activity in a |
| 2695 | * package, for use for example to implement an "open" button when browsing |
| 2696 | * through packages. The current implementation will look for a main |
| 2697 | * activity in the category {@link Intent#CATEGORY_LEANBACK_LAUNCHER}, or |
| 2698 | * return null if no main leanback activities are found. |
Adam Connors | 551c078 | 2014-06-05 12:13:03 +0100 | [diff] [blame] | 2699 | * |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 2700 | * @param packageName The name of the package to inspect. |
| 2701 | * @return Returns either a fully-qualified Intent that can be used to launch |
| 2702 | * the main Leanback activity in the package, or null if the package |
| 2703 | * does not contain such an activity. |
| 2704 | */ |
| 2705 | public abstract Intent getLeanbackLaunchIntentForPackage(String packageName); |
| 2706 | |
| 2707 | /** |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 2708 | * Return an array of all of the POSIX secondary group IDs that have been |
| 2709 | * assigned to the given package. |
| 2710 | * <p> |
| 2711 | * Note that the same package may have different GIDs under different |
| 2712 | * {@link UserHandle} on the same device. |
Adam Connors | 551c078 | 2014-06-05 12:13:03 +0100 | [diff] [blame] | 2713 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2714 | * @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] | 2715 | * desired package. |
| 2716 | * @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] | 2717 | * none. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2718 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2719 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2720 | */ |
| 2721 | public abstract int[] getPackageGids(String packageName) |
| 2722 | throws NameNotFoundException; |
| 2723 | |
| 2724 | /** |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 2725 | * Return an array of all of the POSIX secondary group IDs that have been |
| 2726 | * assigned to the given package. |
| 2727 | * <p> |
| 2728 | * Note that the same package may have different GIDs under different |
| 2729 | * {@link UserHandle} on the same device. |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 2730 | * |
| 2731 | * @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] | 2732 | * desired package. |
| 2733 | * @return Returns an int array of the assigned gids, or null if there are |
| 2734 | * none. |
| 2735 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2736 | * found on the system. |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 2737 | */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2738 | public abstract int[] getPackageGids(String packageName, @PackageInfoFlags int flags) |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 2739 | throws NameNotFoundException; |
| 2740 | |
| 2741 | /** |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2742 | * Return the UID associated with the given package name. |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 2743 | * <p> |
| 2744 | * Note that the same package will have different UIDs under different |
| 2745 | * {@link UserHandle} on the same device. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2746 | * |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2747 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
| 2748 | * desired package. |
| 2749 | * @return Returns an integer UID who owns the given package name. |
| 2750 | * @throws NameNotFoundException if a package with the given name can not be |
| 2751 | * found on the system. |
| 2752 | */ |
| 2753 | public abstract int getPackageUid(String packageName, @PackageInfoFlags int flags) |
| 2754 | throws NameNotFoundException; |
| 2755 | |
| 2756 | /** |
| 2757 | * Return the UID associated with the given package name. |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 2758 | * <p> |
| 2759 | * Note that the same package will have different UIDs under different |
| 2760 | * {@link UserHandle} on the same device. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2761 | * |
| 2762 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
| 2763 | * desired package. |
| 2764 | * @param userId The user handle identifier to look up the package under. |
| 2765 | * @return Returns an integer UID who owns the given package name. |
| 2766 | * @throws NameNotFoundException if a package with the given name can not be |
| 2767 | * found on the system. |
| 2768 | * @hide |
| 2769 | */ |
| 2770 | public abstract int getPackageUidAsUser(String packageName, @UserIdInt int userId) |
| 2771 | throws NameNotFoundException; |
| 2772 | |
| 2773 | /** |
| 2774 | * Return the UID associated with the given package name. |
Jeff Sharkey | cf3f0a1 | 2016-03-17 19:57:58 -0600 | [diff] [blame] | 2775 | * <p> |
| 2776 | * Note that the same package will have different UIDs under different |
| 2777 | * {@link UserHandle} on the same device. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2778 | * |
| 2779 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
| 2780 | * desired package. |
| 2781 | * @param userId The user handle identifier to look up the package under. |
| 2782 | * @return Returns an integer UID who owns the given package name. |
| 2783 | * @throws NameNotFoundException if a package with the given name can not be |
| 2784 | * found on the system. |
| 2785 | * @hide |
| 2786 | */ |
| 2787 | public abstract int getPackageUidAsUser(String packageName, @PackageInfoFlags int flags, |
| 2788 | @UserIdInt int userId) throws NameNotFoundException; |
| 2789 | |
| 2790 | /** |
| 2791 | * 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] | 2792 | * |
| 2793 | * @param name The fully qualified name (i.e. com.google.permission.LOGIN) |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2794 | * of the permission you are interested in. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2795 | * @param flags Additional option flags. Use {@link #GET_META_DATA} to |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2796 | * retrieve any meta-data associated with the permission. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2797 | * |
| 2798 | * @return Returns a {@link PermissionInfo} containing information about the |
| 2799 | * permission. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2800 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2801 | * found on the system. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2802 | * |
| 2803 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2804 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2805 | public abstract PermissionInfo getPermissionInfo(String name, @PermissionInfoFlags int flags) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2806 | throws NameNotFoundException; |
| 2807 | |
| 2808 | /** |
| 2809 | * Query for all of the permissions associated with a particular group. |
| 2810 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2811 | * @param group The fully qualified name (i.e. com.google.permission.LOGIN) |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2812 | * of the permission group you are interested in. Use null to |
| 2813 | * 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] | 2814 | * @param flags Additional option flags. Use {@link #GET_META_DATA} to |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2815 | * retrieve any meta-data associated with the permissions. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2816 | * |
| 2817 | * @return Returns a list of {@link PermissionInfo} containing information |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2818 | * about all of the permissions in the given group. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2819 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2820 | * found on the system. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2821 | * |
| 2822 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2823 | */ |
| 2824 | public abstract List<PermissionInfo> queryPermissionsByGroup(String group, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2825 | @PermissionInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2826 | |
| 2827 | /** |
| 2828 | * Retrieve all of the information we know about a particular group of |
| 2829 | * permissions. |
| 2830 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2831 | * @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] | 2832 | * of the permission you are interested in. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2833 | * @param flags Additional option flags. Use {@link #GET_META_DATA} to |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2834 | * retrieve any meta-data associated with the permission group. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2835 | * |
| 2836 | * @return Returns a {@link PermissionGroupInfo} containing information |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2837 | * about the permission. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2838 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2839 | * found on the system. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2840 | * |
| 2841 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2842 | */ |
| 2843 | public abstract PermissionGroupInfo getPermissionGroupInfo(String name, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2844 | @PermissionGroupInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2845 | |
| 2846 | /** |
| 2847 | * Retrieve all of the known permission groups in the system. |
| 2848 | * |
| 2849 | * @param flags Additional option flags. Use {@link #GET_META_DATA} to |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2850 | * retrieve any meta-data associated with the permission group. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2851 | * |
| 2852 | * @return Returns a list of {@link PermissionGroupInfo} containing |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2853 | * information about all of the known permission groups. |
| 2854 | * |
| 2855 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2856 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2857 | public abstract List<PermissionGroupInfo> getAllPermissionGroups( |
| 2858 | @PermissionGroupInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2859 | |
| 2860 | /** |
| 2861 | * Retrieve all of the information we know about a particular |
| 2862 | * package/application. |
| 2863 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2864 | * @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] | 2865 | * application. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2866 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2867 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 2868 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2869 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2870 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2871 | * @return An {@link ApplicationInfo} containing information about the |
| 2872 | * package. If flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if the |
| 2873 | * package is not found in the list of installed applications, the |
| 2874 | * application information is retrieved from the list of uninstalled |
| 2875 | * applications (which includes installed applications as well as |
| 2876 | * applications with data directory i.e. applications which had been |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2877 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2878 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2879 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2880 | * |
| 2881 | * @see #GET_META_DATA |
| 2882 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 5a32c6c | 2016-07-07 14:29:06 -0700 | [diff] [blame] | 2883 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2884 | * @see #MATCH_SYSTEM_ONLY |
| 2885 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2886 | */ |
| 2887 | public abstract ApplicationInfo getApplicationInfo(String packageName, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2888 | @ApplicationInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2889 | |
Jeff Sharkey | cd65448 | 2016-01-08 17:42:11 -0700 | [diff] [blame] | 2890 | /** {@hide} */ |
| 2891 | public abstract ApplicationInfo getApplicationInfoAsUser(String packageName, |
| 2892 | @ApplicationInfoFlags int flags, @UserIdInt int userId) throws NameNotFoundException; |
| 2893 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2894 | /** |
| 2895 | * Retrieve all of the information we know about a particular activity |
| 2896 | * class. |
| 2897 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2898 | * @param component The full component name (i.e. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2899 | * com.google.apps.contacts/com.google.apps.contacts. |
| 2900 | * ContactsList) of an Activity class. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2901 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2902 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 2903 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 2904 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 2905 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2906 | * {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 2907 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 2908 | * {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 2909 | * returned. |
| 2910 | * @return An {@link ActivityInfo} containing information about the |
| 2911 | * activity. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2912 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2913 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2914 | * @see #GET_META_DATA |
| 2915 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2916 | * @see #MATCH_ALL |
| 2917 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 2918 | * @see #MATCH_DEFAULT_ONLY |
| 2919 | * @see #MATCH_DISABLED_COMPONENTS |
| 2920 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2921 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 2922 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2923 | * @see #MATCH_SYSTEM_ONLY |
| 2924 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2925 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2926 | public abstract ActivityInfo getActivityInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2927 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2928 | |
| 2929 | /** |
| 2930 | * Retrieve all of the information we know about a particular receiver |
| 2931 | * class. |
| 2932 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2933 | * @param component The full component name (i.e. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2934 | * com.google.apps.calendar/com.google.apps.calendar. |
| 2935 | * CalendarAlarm) of a Receiver class. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2936 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2937 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 2938 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 2939 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 2940 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2941 | * {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 2942 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 2943 | * {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 2944 | * returned. |
| 2945 | * @return An {@link ActivityInfo} containing information about the |
| 2946 | * receiver. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2947 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2948 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2949 | * @see #GET_META_DATA |
| 2950 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2951 | * @see #MATCH_ALL |
| 2952 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 2953 | * @see #MATCH_DEFAULT_ONLY |
| 2954 | * @see #MATCH_DISABLED_COMPONENTS |
| 2955 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2956 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 2957 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2958 | * @see #MATCH_SYSTEM_ONLY |
| 2959 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2960 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2961 | public abstract ActivityInfo getReceiverInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2962 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2963 | |
| 2964 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2965 | * 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] | 2966 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2967 | * @param component The full component name (i.e. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2968 | * com.google.apps.media/com.google.apps.media. |
| 2969 | * BackgroundPlayback) of a Service class. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2970 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2971 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 2972 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 2973 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 2974 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2975 | * {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 2976 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 2977 | * {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 2978 | * returned. |
| 2979 | * @return A {@link ServiceInfo} object containing information about the |
| 2980 | * service. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2981 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2982 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2983 | * @see #GET_META_DATA |
| 2984 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2985 | * @see #MATCH_ALL |
| 2986 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 2987 | * @see #MATCH_DEFAULT_ONLY |
| 2988 | * @see #MATCH_DISABLED_COMPONENTS |
| 2989 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 2990 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 2991 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2992 | * @see #MATCH_SYSTEM_ONLY |
| 2993 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2994 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2995 | public abstract ServiceInfo getServiceInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2996 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2997 | |
| 2998 | /** |
| 2999 | * Retrieve all of the information we know about a particular content |
| 3000 | * provider class. |
| 3001 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3002 | * @param component The full component name (i.e. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3003 | * com.google.providers.media/com.google.providers.media. |
| 3004 | * MediaProvider) of a ContentProvider class. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3005 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3006 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 3007 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 3008 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3009 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3010 | * {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3011 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3012 | * {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3013 | * returned. |
| 3014 | * @return A {@link ProviderInfo} object containing information about the |
| 3015 | * provider. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3016 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3017 | * found on the system. |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3018 | * @see #GET_META_DATA |
| 3019 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3020 | * @see #MATCH_ALL |
| 3021 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 3022 | * @see #MATCH_DEFAULT_ONLY |
| 3023 | * @see #MATCH_DISABLED_COMPONENTS |
| 3024 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3025 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3026 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3027 | * @see #MATCH_SYSTEM_ONLY |
| 3028 | * @see #MATCH_UNINSTALLED_PACKAGES |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 3029 | */ |
| 3030 | public abstract ProviderInfo getProviderInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3031 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3032 | |
| 3033 | /** |
| 3034 | * Return a List of all packages that are installed |
| 3035 | * on the device. |
| 3036 | * |
| 3037 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3038 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 3039 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 3040 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 3041 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 3042 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 3043 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 3044 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 3045 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3046 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3047 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3048 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3049 | * @return A List of PackageInfo objects, one for each installed package, |
| 3050 | * containing information about the package. In the unlikely case |
| 3051 | * there are no installed packages, an empty list is returned. If |
| 3052 | * flag {@code MATCH_UNINSTALLED_PACKAGES} is set, the package |
| 3053 | * information is retrieved from the list of uninstalled |
| 3054 | * applications (which includes installed applications as well as |
| 3055 | * applications with data directory i.e. applications which had been |
| 3056 | * deleted with {@code DONT_DELETE_DATA} flag set). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3057 | * |
| 3058 | * @see #GET_ACTIVITIES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3059 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3060 | * @see #GET_GIDS |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3061 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3062 | * @see #GET_INTENT_FILTERS |
| 3063 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3064 | * @see #GET_PERMISSIONS |
| 3065 | * @see #GET_PROVIDERS |
| 3066 | * @see #GET_RECEIVERS |
| 3067 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3068 | * @see #GET_SHARED_LIBRARY_FILES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3069 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3070 | * @see #GET_URI_PERMISSION_PATTERNS |
| 3071 | * @see #MATCH_DISABLED_COMPONENTS |
| 3072 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3073 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3074 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3075 | public abstract List<PackageInfo> getInstalledPackages(@PackageInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3076 | |
| 3077 | /** |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3078 | * Return a List of all installed packages that are currently |
| 3079 | * holding any of the given permissions. |
| 3080 | * |
| 3081 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3082 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 3083 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 3084 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 3085 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 3086 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 3087 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 3088 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 3089 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3090 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3091 | * to modify the data returned. |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3092 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3093 | * @return A List of PackageInfo objects, one for each installed package |
| 3094 | * that holds any of the permissions that were provided, containing |
| 3095 | * information about the package. If no installed packages hold any |
| 3096 | * of the permissions, an empty list is returned. If flag |
| 3097 | * {@code MATCH_UNINSTALLED_PACKAGES} is set, the package information |
| 3098 | * is retrieved from the list of uninstalled applications (which |
| 3099 | * includes installed applications as well as applications with data |
| 3100 | * directory i.e. applications which had been deleted with |
| 3101 | * {@code DONT_DELETE_DATA} flag set). |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3102 | * |
| 3103 | * @see #GET_ACTIVITIES |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3104 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3105 | * @see #GET_GIDS |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3106 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3107 | * @see #GET_INTENT_FILTERS |
| 3108 | * @see #GET_META_DATA |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3109 | * @see #GET_PERMISSIONS |
| 3110 | * @see #GET_PROVIDERS |
| 3111 | * @see #GET_RECEIVERS |
| 3112 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3113 | * @see #GET_SHARED_LIBRARY_FILES |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3114 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3115 | * @see #GET_URI_PERMISSION_PATTERNS |
| 3116 | * @see #MATCH_DISABLED_COMPONENTS |
| 3117 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3118 | * @see #MATCH_UNINSTALLED_PACKAGES |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3119 | */ |
| 3120 | public abstract List<PackageInfo> getPackagesHoldingPermissions( |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3121 | String[] permissions, @PackageInfoFlags int flags); |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 3122 | |
| 3123 | /** |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3124 | * Return a List of all packages that are installed on the device, for a specific user. |
| 3125 | * Requesting a list of installed packages for another user |
| 3126 | * will require the permission INTERACT_ACROSS_USERS_FULL. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3127 | * |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3128 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3129 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 3130 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 3131 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 3132 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 3133 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 3134 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 3135 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 3136 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3137 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3138 | * to modify the data returned. |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3139 | * @param userId The user for whom the installed packages are to be listed |
| 3140 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3141 | * @return A List of PackageInfo objects, one for each installed package, |
| 3142 | * containing information about the package. In the unlikely case |
| 3143 | * there are no installed packages, an empty list is returned. If |
| 3144 | * flag {@code MATCH_UNINSTALLED_PACKAGES} is set, the package |
| 3145 | * information is retrieved from the list of uninstalled |
| 3146 | * applications (which includes installed applications as well as |
| 3147 | * applications with data directory i.e. applications which had been |
| 3148 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3149 | * |
| 3150 | * @see #GET_ACTIVITIES |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3151 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3152 | * @see #GET_GIDS |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3153 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3154 | * @see #GET_INTENT_FILTERS |
| 3155 | * @see #GET_META_DATA |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3156 | * @see #GET_PERMISSIONS |
| 3157 | * @see #GET_PROVIDERS |
| 3158 | * @see #GET_RECEIVERS |
| 3159 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3160 | * @see #GET_SHARED_LIBRARY_FILES |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3161 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3162 | * @see #GET_URI_PERMISSION_PATTERNS |
| 3163 | * @see #MATCH_DISABLED_COMPONENTS |
| 3164 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3165 | * @see #MATCH_UNINSTALLED_PACKAGES |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3166 | * |
| 3167 | * @hide |
| 3168 | */ |
Svet Ganov | ae0e03a | 2016-02-25 18:22:10 -0800 | [diff] [blame] | 3169 | @SystemApi |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 3170 | public abstract List<PackageInfo> getInstalledPackagesAsUser(@PackageInfoFlags int flags, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3171 | @UserIdInt int userId); |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3172 | |
| 3173 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3174 | * Check whether a particular package has been granted a particular |
| 3175 | * permission. |
| 3176 | * |
Svet Ganov | ad3b297 | 2015-07-07 22:49:17 -0700 | [diff] [blame] | 3177 | * @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] | 3178 | * @param pkgName The name of the package you are checking against. |
| 3179 | * |
| 3180 | * @return If the package has the permission, PERMISSION_GRANTED is |
| 3181 | * returned. If it does not have the permission, PERMISSION_DENIED |
| 3182 | * is returned. |
| 3183 | * |
| 3184 | * @see #PERMISSION_GRANTED |
| 3185 | * @see #PERMISSION_DENIED |
| 3186 | */ |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 3187 | @CheckResult |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3188 | public abstract int checkPermission(String permName, String pkgName); |
| 3189 | |
| 3190 | /** |
Svet Ganov | ad3b297 | 2015-07-07 22:49:17 -0700 | [diff] [blame] | 3191 | * Checks whether a particular permissions has been revoked for a |
| 3192 | * package by policy. Typically the device owner or the profile owner |
| 3193 | * may apply such a policy. The user cannot grant policy revoked |
| 3194 | * permissions, hence the only way for an app to get such a permission |
| 3195 | * is by a policy change. |
| 3196 | * |
| 3197 | * @param permName The name of the permission you are checking for. |
| 3198 | * @param pkgName The name of the package you are checking against. |
| 3199 | * |
| 3200 | * @return Whether the permission is restricted by policy. |
| 3201 | */ |
| 3202 | @CheckResult |
Svet Ganov | f1b7f20 | 2015-07-29 08:33:42 -0700 | [diff] [blame] | 3203 | public abstract boolean isPermissionRevokedByPolicy(@NonNull String permName, |
| 3204 | @NonNull String pkgName); |
| 3205 | |
| 3206 | /** |
| 3207 | * Gets the package name of the component controlling runtime permissions. |
| 3208 | * |
| 3209 | * @return The package name. |
| 3210 | * |
| 3211 | * @hide |
| 3212 | */ |
| 3213 | public abstract String getPermissionControllerPackageName(); |
Svet Ganov | ad3b297 | 2015-07-07 22:49:17 -0700 | [diff] [blame] | 3214 | |
| 3215 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3216 | * Add a new dynamic permission to the system. For this to work, your |
| 3217 | * package must have defined a permission tree through the |
| 3218 | * {@link android.R.styleable#AndroidManifestPermissionTree |
| 3219 | * <permission-tree>} tag in its manifest. A package can only add |
| 3220 | * permissions to trees that were defined by either its own package or |
| 3221 | * another with the same user id; a permission is in a tree if it |
| 3222 | * matches the name of the permission tree + ".": for example, |
| 3223 | * "com.foo.bar" is a member of the permission tree "com.foo". |
| 3224 | * |
| 3225 | * <p>It is good to make your permission tree name descriptive, because you |
| 3226 | * are taking possession of that entire set of permission names. Thus, it |
| 3227 | * must be under a domain you control, with a suffix that will not match |
| 3228 | * any normal permissions that may be declared in any applications that |
| 3229 | * are part of that domain. |
| 3230 | * |
| 3231 | * <p>New permissions must be added before |
| 3232 | * any .apks are installed that use those permissions. Permissions you |
| 3233 | * add through this method are remembered across reboots of the device. |
| 3234 | * If the given permission already exists, the info you supply here |
| 3235 | * will be used to update it. |
| 3236 | * |
| 3237 | * @param info Description of the permission to be added. |
| 3238 | * |
| 3239 | * @return Returns true if a new permission was created, false if an |
| 3240 | * existing one was updated. |
| 3241 | * |
| 3242 | * @throws SecurityException if you are not allowed to add the |
| 3243 | * given permission name. |
| 3244 | * |
| 3245 | * @see #removePermission(String) |
| 3246 | */ |
| 3247 | public abstract boolean addPermission(PermissionInfo info); |
| 3248 | |
| 3249 | /** |
Dianne Hackborn | d7c0968 | 2010-03-30 10:42:20 -0700 | [diff] [blame] | 3250 | * Like {@link #addPermission(PermissionInfo)} but asynchronously |
| 3251 | * persists the package manager state after returning from the call, |
| 3252 | * allowing it to return quicker and batch a series of adds at the |
| 3253 | * expense of no guarantee the added permission will be retained if |
| 3254 | * the device is rebooted before it is written. |
| 3255 | */ |
| 3256 | public abstract boolean addPermissionAsync(PermissionInfo info); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3257 | |
Dianne Hackborn | d7c0968 | 2010-03-30 10:42:20 -0700 | [diff] [blame] | 3258 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3259 | * Removes a permission that was previously added with |
| 3260 | * {@link #addPermission(PermissionInfo)}. The same ownership rules apply |
| 3261 | * -- you are only allowed to remove permissions that you are allowed |
| 3262 | * to add. |
| 3263 | * |
| 3264 | * @param name The name of the permission to remove. |
| 3265 | * |
| 3266 | * @throws SecurityException if you are not allowed to remove the |
| 3267 | * given permission name. |
| 3268 | * |
| 3269 | * @see #addPermission(PermissionInfo) |
| 3270 | */ |
| 3271 | public abstract void removePermission(String name); |
| 3272 | |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3273 | |
| 3274 | /** |
| 3275 | * Permission flags set when granting or revoking a permission. |
| 3276 | * |
| 3277 | * @hide |
| 3278 | */ |
| 3279 | @SystemApi |
| 3280 | @IntDef({FLAG_PERMISSION_USER_SET, |
| 3281 | FLAG_PERMISSION_USER_FIXED, |
| 3282 | FLAG_PERMISSION_POLICY_FIXED, |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 3283 | FLAG_PERMISSION_REVOKE_ON_UPGRADE, |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 3284 | FLAG_PERMISSION_SYSTEM_FIXED, |
| 3285 | FLAG_PERMISSION_GRANTED_BY_DEFAULT}) |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3286 | @Retention(RetentionPolicy.SOURCE) |
| 3287 | public @interface PermissionFlags {} |
| 3288 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3289 | /** |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3290 | * Grant a runtime permission to an application which the application does not |
| 3291 | * already have. The permission must have been requested by the application. |
| 3292 | * If the application is not allowed to hold the permission, a {@link |
| 3293 | * java.lang.SecurityException} is thrown. |
| 3294 | * <p> |
| 3295 | * <strong>Note: </strong>Using this API requires holding |
Todd Kennedy | a8eb6a8 | 2016-07-28 16:35:42 -0700 | [diff] [blame] | 3296 | * android.permission.GRANT_RUNTIME_PERMISSIONS and if the user id is |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3297 | * not the current user android.permission.INTERACT_ACROSS_USERS_FULL. |
| 3298 | * </p> |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3299 | * |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3300 | * @param packageName The package to which to grant the permission. |
| 3301 | * @param permissionName The permission name to grant. |
| 3302 | * @param user The user for which to grant the permission. |
| 3303 | * |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3304 | * @see #revokeRuntimePermission(String, String, android.os.UserHandle) |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3305 | * |
| 3306 | * @hide |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3307 | */ |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3308 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3309 | public abstract void grantRuntimePermission(@NonNull String packageName, |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3310 | @NonNull String permissionName, @NonNull UserHandle user); |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3311 | |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3312 | /** |
| 3313 | * Revoke a runtime permission that was previously granted by {@link |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3314 | * #grantRuntimePermission(String, String, android.os.UserHandle)}. The |
| 3315 | * permission must have been requested by and granted to the application. |
| 3316 | * If the application is not allowed to hold the permission, a {@link |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3317 | * java.lang.SecurityException} is thrown. |
| 3318 | * <p> |
| 3319 | * <strong>Note: </strong>Using this API requires holding |
Todd Kennedy | a8eb6a8 | 2016-07-28 16:35:42 -0700 | [diff] [blame] | 3320 | * android.permission.REVOKE_RUNTIME_PERMISSIONS and if the user id is |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3321 | * not the current user android.permission.INTERACT_ACROSS_USERS_FULL. |
| 3322 | * </p> |
| 3323 | * |
| 3324 | * @param packageName The package from which to revoke the permission. |
| 3325 | * @param permissionName The permission name to revoke. |
| 3326 | * @param user The user for which to revoke the permission. |
| 3327 | * |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3328 | * @see #grantRuntimePermission(String, String, android.os.UserHandle) |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3329 | * |
| 3330 | * @hide |
| 3331 | */ |
| 3332 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3333 | public abstract void revokeRuntimePermission(@NonNull String packageName, |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3334 | @NonNull String permissionName, @NonNull UserHandle user); |
| 3335 | |
| 3336 | /** |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3337 | * Gets the state flags associated with a permission. |
| 3338 | * |
| 3339 | * @param permissionName The permission for which to get the flags. |
| 3340 | * @param packageName The package name for which to get the flags. |
| 3341 | * @param user The user for which to get permission flags. |
| 3342 | * @return The permission flags. |
| 3343 | * |
| 3344 | * @hide |
| 3345 | */ |
| 3346 | @SystemApi |
| 3347 | public abstract @PermissionFlags int getPermissionFlags(String permissionName, |
| 3348 | String packageName, @NonNull UserHandle user); |
| 3349 | |
| 3350 | /** |
| 3351 | * Updates the flags associated with a permission by replacing the flags in |
| 3352 | * the specified mask with the provided flag values. |
| 3353 | * |
| 3354 | * @param permissionName The permission for which to update the flags. |
| 3355 | * @param packageName The package name for which to update the flags. |
| 3356 | * @param flagMask The flags which to replace. |
| 3357 | * @param flagValues The flags with which to replace. |
| 3358 | * @param user The user for which to update the permission flags. |
| 3359 | * |
| 3360 | * @hide |
| 3361 | */ |
| 3362 | @SystemApi |
| 3363 | public abstract void updatePermissionFlags(String permissionName, |
| 3364 | String packageName, @PermissionFlags int flagMask, int flagValues, |
| 3365 | @NonNull UserHandle user); |
| 3366 | |
| 3367 | /** |
Svetoslav | 20770dd | 2015-05-29 15:43:04 -0700 | [diff] [blame] | 3368 | * Gets whether you should show UI with rationale for requesting a permission. |
| 3369 | * You should do this only if you do not have the permission and the context in |
| 3370 | * which the permission is requested does not clearly communicate to the user |
| 3371 | * what would be the benefit from grating this permission. |
| 3372 | * |
| 3373 | * @param permission A permission your app wants to request. |
| 3374 | * @return Whether you can show permission rationale UI. |
| 3375 | * |
| 3376 | * @hide |
| 3377 | */ |
| 3378 | public abstract boolean shouldShowRequestPermissionRationale(String permission); |
| 3379 | |
| 3380 | /** |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3381 | * Returns an {@link android.content.Intent} suitable for passing to |
| 3382 | * {@link android.app.Activity#startActivityForResult(android.content.Intent, int)} |
| 3383 | * which prompts the user to grant permissions to this application. |
| 3384 | * |
| 3385 | * @throws NullPointerException if {@code permissions} is {@code null} or empty. |
| 3386 | * |
| 3387 | * @hide |
| 3388 | */ |
| 3389 | public Intent buildRequestPermissionsIntent(@NonNull String[] permissions) { |
| 3390 | if (ArrayUtils.isEmpty(permissions)) { |
Svet Ganov | f66381c | 2016-02-18 20:02:36 -0800 | [diff] [blame] | 3391 | throw new IllegalArgumentException("permission cannot be null or empty"); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3392 | } |
| 3393 | Intent intent = new Intent(ACTION_REQUEST_PERMISSIONS); |
| 3394 | intent.putExtra(EXTRA_REQUEST_PERMISSIONS_NAMES, permissions); |
Svet Ganov | f1b7f20 | 2015-07-29 08:33:42 -0700 | [diff] [blame] | 3395 | intent.setPackage(getPermissionControllerPackageName()); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3396 | return intent; |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3397 | } |
| 3398 | |
| 3399 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3400 | * Compare the signatures of two packages to determine if the same |
| 3401 | * signature appears in both of them. If they do contain the same |
| 3402 | * signature, then they are allowed special privileges when working |
| 3403 | * with each other: they can share the same user-id, run instrumentation |
| 3404 | * against each other, etc. |
| 3405 | * |
| 3406 | * @param pkg1 First package name whose signature will be compared. |
| 3407 | * @param pkg2 Second package name whose signature will be compared. |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 3408 | * |
| 3409 | * @return Returns an integer indicating whether all signatures on the |
| 3410 | * two packages match. The value is >= 0 ({@link #SIGNATURE_MATCH}) if |
| 3411 | * all signatures match or < 0 if there is not a match ({@link |
| 3412 | * #SIGNATURE_NO_MATCH} or {@link #SIGNATURE_UNKNOWN_PACKAGE}). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3413 | * |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3414 | * @see #checkSignatures(int, int) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3415 | * @see #SIGNATURE_MATCH |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3416 | * @see #SIGNATURE_NO_MATCH |
| 3417 | * @see #SIGNATURE_UNKNOWN_PACKAGE |
| 3418 | */ |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 3419 | @CheckResult |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3420 | public abstract int checkSignatures(String pkg1, String pkg2); |
| 3421 | |
| 3422 | /** |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3423 | * Like {@link #checkSignatures(String, String)}, but takes UIDs of |
| 3424 | * the two packages to be checked. This can be useful, for example, |
| 3425 | * when doing the check in an IPC, where the UID is the only identity |
| 3426 | * available. It is functionally identical to determining the package |
| 3427 | * associated with the UIDs and checking their signatures. |
| 3428 | * |
Joe Onorato | 25660ec | 2009-08-12 22:40:37 -0700 | [diff] [blame] | 3429 | * @param uid1 First UID whose signature will be compared. |
| 3430 | * @param uid2 Second UID whose signature will be compared. |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3431 | * |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 3432 | * @return Returns an integer indicating whether all signatures on the |
| 3433 | * two packages match. The value is >= 0 ({@link #SIGNATURE_MATCH}) if |
| 3434 | * all signatures match or < 0 if there is not a match ({@link |
| 3435 | * #SIGNATURE_NO_MATCH} or {@link #SIGNATURE_UNKNOWN_PACKAGE}). |
| 3436 | * |
| 3437 | * @see #checkSignatures(String, String) |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3438 | * @see #SIGNATURE_MATCH |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3439 | * @see #SIGNATURE_NO_MATCH |
| 3440 | * @see #SIGNATURE_UNKNOWN_PACKAGE |
| 3441 | */ |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 3442 | @CheckResult |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3443 | public abstract int checkSignatures(int uid1, int uid2); |
| 3444 | |
| 3445 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3446 | * Retrieve the names of all packages that are associated with a particular |
| 3447 | * user id. In most cases, this will be a single package name, the package |
| 3448 | * that has been assigned that user id. Where there are multiple packages |
| 3449 | * sharing the same user id through the "sharedUserId" mechanism, all |
| 3450 | * packages with that id will be returned. |
| 3451 | * |
| 3452 | * @param uid The user id for which you would like to retrieve the |
| 3453 | * associated packages. |
| 3454 | * |
| 3455 | * @return Returns an array of one or more packages assigned to the user |
| 3456 | * id, or null if there are no known packages with the given id. |
| 3457 | */ |
Jeff Sharkey | 377ded0f | 2016-01-10 13:15:41 -0700 | [diff] [blame] | 3458 | public abstract @Nullable String[] getPackagesForUid(int uid); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3459 | |
| 3460 | /** |
| 3461 | * Retrieve the official name associated with a user id. This name is |
Jonathan Basseri | 7ea3a33 | 2015-05-12 19:39:22 -0700 | [diff] [blame] | 3462 | * 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] | 3463 | * user id to be changed. That is, if you are storing information about |
| 3464 | * user ids in persistent storage, you should use the string returned |
| 3465 | * by this function instead of the raw user-id. |
| 3466 | * |
| 3467 | * @param uid The user id for which you would like to retrieve a name. |
| 3468 | * @return Returns a unique name for the given user id, or null if the |
| 3469 | * user id is not currently assigned. |
| 3470 | */ |
Jeff Sharkey | 377ded0f | 2016-01-10 13:15:41 -0700 | [diff] [blame] | 3471 | public abstract @Nullable String getNameForUid(int uid); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3472 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3473 | /** |
| 3474 | * Return the user id associated with a shared user name. Multiple |
| 3475 | * applications can specify a shared user name in their manifest and thus |
| 3476 | * end up using a common uid. This might be used for new applications |
| 3477 | * that use an existing shared user name and need to know the uid of the |
| 3478 | * shared user. |
| 3479 | * |
| 3480 | * @param sharedUserName The shared user name whose uid is to be retrieved. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3481 | * @return Returns the UID associated with the shared user. |
| 3482 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3483 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3484 | * @hide |
| 3485 | */ |
| 3486 | public abstract int getUidForSharedUser(String sharedUserName) |
| 3487 | throws NameNotFoundException; |
| 3488 | |
| 3489 | /** |
| 3490 | * Return a List of all application packages that are installed on the |
| 3491 | * device. If flag GET_UNINSTALLED_PACKAGES has been set, a list of all |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 3492 | * 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] | 3493 | * installed apps with data directory) will be returned. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3494 | * |
| 3495 | * @param flags Additional option flags. Use any combination of |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3496 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3497 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3498 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3499 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3500 | * @return A List of ApplicationInfo objects, one for each installed application. |
| 3501 | * In the unlikely case there are no installed packages, an empty list |
| 3502 | * is returned. If flag {@code MATCH_UNINSTALLED_PACKAGES} is set, the |
| 3503 | * application information is retrieved from the list of uninstalled |
| 3504 | * applications (which includes installed applications as well as |
| 3505 | * applications with data directory i.e. applications which had been |
| 3506 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3507 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3508 | * @see #GET_META_DATA |
| 3509 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 5a32c6c | 2016-07-07 14:29:06 -0700 | [diff] [blame] | 3510 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3511 | * @see #MATCH_SYSTEM_ONLY |
| 3512 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3513 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3514 | public abstract List<ApplicationInfo> getInstalledApplications(@ApplicationInfoFlags int flags); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3515 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3516 | /** |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3517 | * Gets the ephemeral applications the user recently used. Requires |
| 3518 | * holding "android.permission.ACCESS_EPHEMERAL_APPS". |
| 3519 | * |
| 3520 | * @return The ephemeral app list. |
| 3521 | * |
| 3522 | * @hide |
| 3523 | */ |
| 3524 | @RequiresPermission(Manifest.permission.ACCESS_EPHEMERAL_APPS) |
| 3525 | public abstract List<EphemeralApplicationInfo> getEphemeralApplications(); |
| 3526 | |
| 3527 | /** |
| 3528 | * Gets the icon for an ephemeral application. |
| 3529 | * |
| 3530 | * @param packageName The app package name. |
| 3531 | * |
| 3532 | * @hide |
| 3533 | */ |
| 3534 | public abstract Drawable getEphemeralApplicationIcon(String packageName); |
| 3535 | |
| 3536 | /** |
| 3537 | * Gets whether the caller is an ephemeral app. |
| 3538 | * |
| 3539 | * @return Whether caller is an ephemeral app. |
| 3540 | * |
| 3541 | * @see #setEphemeralCookie(byte[]) |
| 3542 | * @see #getEphemeralCookie() |
| 3543 | * @see #getEphemeralCookieMaxSizeBytes() |
Todd Kennedy | 1270513 | 2016-01-05 15:17:57 -0800 | [diff] [blame] | 3544 | * |
| 3545 | * @hide |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3546 | */ |
| 3547 | public abstract boolean isEphemeralApplication(); |
| 3548 | |
| 3549 | /** |
| 3550 | * Gets the maximum size in bytes of the cookie data an ephemeral app |
| 3551 | * can store on the device. |
| 3552 | * |
| 3553 | * @return The max cookie size in bytes. |
| 3554 | * |
| 3555 | * @see #isEphemeralApplication() |
| 3556 | * @see #setEphemeralCookie(byte[]) |
| 3557 | * @see #getEphemeralCookie() |
Todd Kennedy | 1270513 | 2016-01-05 15:17:57 -0800 | [diff] [blame] | 3558 | * |
| 3559 | * @hide |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3560 | */ |
| 3561 | public abstract int getEphemeralCookieMaxSizeBytes(); |
| 3562 | |
| 3563 | /** |
| 3564 | * Gets the ephemeral application cookie for this app. Non |
| 3565 | * ephemeral apps and apps that were ephemeral but were upgraded |
| 3566 | * to non-ephemeral can still access this API. For ephemeral apps |
| 3567 | * this cooke is cached for some time after uninstall while for |
| 3568 | * normal apps the cookie is deleted after the app is uninstalled. |
| 3569 | * The cookie is always present while the app is installed. |
| 3570 | * |
| 3571 | * @return The cookie. |
| 3572 | * |
| 3573 | * @see #isEphemeralApplication() |
| 3574 | * @see #setEphemeralCookie(byte[]) |
| 3575 | * @see #getEphemeralCookieMaxSizeBytes() |
Todd Kennedy | 1270513 | 2016-01-05 15:17:57 -0800 | [diff] [blame] | 3576 | * |
| 3577 | * @hide |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3578 | */ |
| 3579 | public abstract @NonNull byte[] getEphemeralCookie(); |
| 3580 | |
| 3581 | /** |
| 3582 | * Sets the ephemeral application cookie for the calling app. Non |
| 3583 | * ephemeral apps and apps that were ephemeral but were upgraded |
| 3584 | * to non-ephemeral can still access this API. For ephemeral apps |
| 3585 | * this cooke is cached for some time after uninstall while for |
| 3586 | * normal apps the cookie is deleted after the app is uninstalled. |
| 3587 | * The cookie is always present while the app is installed. The |
| 3588 | * cookie size is limited by {@link #getEphemeralCookieMaxSizeBytes()}. |
| 3589 | * |
| 3590 | * @param cookie The cookie data. |
| 3591 | * @return True if the cookie was set. |
| 3592 | * |
| 3593 | * @see #isEphemeralApplication() |
| 3594 | * @see #getEphemeralCookieMaxSizeBytes() |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 3595 | * @see #getEphemeralCookie() |
Todd Kennedy | 1270513 | 2016-01-05 15:17:57 -0800 | [diff] [blame] | 3596 | * |
| 3597 | * @hide |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3598 | */ |
| 3599 | public abstract boolean setEphemeralCookie(@NonNull byte[] cookie); |
| 3600 | |
| 3601 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3602 | * Get a list of shared libraries that are available on the |
| 3603 | * system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3604 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3605 | * @return An array of shared library names that are |
| 3606 | * available on the system, or null if none are installed. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3607 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3608 | */ |
| 3609 | public abstract String[] getSystemSharedLibraryNames(); |
| 3610 | |
| 3611 | /** |
Svet Ganov | d7b1f411 | 2016-02-09 18:49:23 -0800 | [diff] [blame] | 3612 | * Get the name of the package hosting the services shared library. |
| 3613 | * |
| 3614 | * @return The library host package. |
| 3615 | * |
| 3616 | * @hide |
| 3617 | */ |
Svetoslav Ganov | a9c2500 | 2016-04-13 19:25:56 -0700 | [diff] [blame] | 3618 | public abstract @NonNull String getServicesSystemSharedLibraryPackageName(); |
| 3619 | |
| 3620 | /** |
| 3621 | * Get the name of the package hosting the shared components shared library. |
| 3622 | * |
| 3623 | * @return The library host package. |
| 3624 | * |
| 3625 | * @hide |
| 3626 | */ |
| 3627 | public abstract @NonNull String getSharedSystemSharedLibraryPackageName(); |
Svet Ganov | d7b1f411 | 2016-02-09 18:49:23 -0800 | [diff] [blame] | 3628 | |
| 3629 | /** |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 3630 | * Get a list of features that are available on the |
| 3631 | * system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3632 | * |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 3633 | * @return An array of FeatureInfo classes describing the features |
| 3634 | * that are available on the system, or null if there are none(!!). |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 3635 | */ |
| 3636 | public abstract FeatureInfo[] getSystemAvailableFeatures(); |
| 3637 | |
| 3638 | /** |
Jeff Sharkey | 115d2c1 | 2016-02-15 17:25:57 -0700 | [diff] [blame] | 3639 | * Check whether the given feature name is one of the available features as |
| 3640 | * returned by {@link #getSystemAvailableFeatures()}. This tests for the |
| 3641 | * presence of <em>any</em> version of the given feature name; use |
| 3642 | * {@link #hasSystemFeature(String, int)} to check for a minimum version. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3643 | * |
Jeff Sharkey | 115d2c1 | 2016-02-15 17:25:57 -0700 | [diff] [blame] | 3644 | * @return Returns true if the devices supports the feature, else false. |
Dianne Hackborn | 039c68e | 2009-09-26 16:39:23 -0700 | [diff] [blame] | 3645 | */ |
| 3646 | public abstract boolean hasSystemFeature(String name); |
| 3647 | |
| 3648 | /** |
Jeff Sharkey | 115d2c1 | 2016-02-15 17:25:57 -0700 | [diff] [blame] | 3649 | * Check whether the given feature name and version is one of the available |
| 3650 | * features as returned by {@link #getSystemAvailableFeatures()}. Since |
| 3651 | * features are defined to always be backwards compatible, this returns true |
| 3652 | * if the available feature version is greater than or equal to the |
| 3653 | * requested version. |
| 3654 | * |
| 3655 | * @return Returns true if the devices supports the feature, else false. |
| 3656 | */ |
| 3657 | public abstract boolean hasSystemFeature(String name, int version); |
| 3658 | |
| 3659 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3660 | * Determine the best action to perform for a given Intent. This is how |
| 3661 | * {@link Intent#resolveActivity} finds an activity if a class has not been |
| 3662 | * explicitly specified. |
| 3663 | * <p> |
| 3664 | * <em>Note:</em> if using an implicit Intent (without an explicit |
| 3665 | * ComponentName specified), be sure to consider whether to set the |
| 3666 | * {@link #MATCH_DEFAULT_ONLY} only flag. You need to do so to resolve the |
| 3667 | * activity in the same way that |
| 3668 | * {@link android.content.Context#startActivity(Intent)} and |
Dianne Hackborn | 4d023d21 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 3669 | * {@link android.content.Intent#resolveActivity(PackageManager) |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3670 | * Intent.resolveActivity(PackageManager)} do. |
| 3671 | * </p> |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3672 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3673 | * @param intent An intent containing all of the desired specification |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3674 | * (action, data, type, category, and/or component). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3675 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3676 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3677 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3678 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3679 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3680 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3681 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3682 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3683 | * returned. The most important is {@link #MATCH_DEFAULT_ONLY}, |
| 3684 | * to limit the resolution to only those activities that support |
| 3685 | * the {@link android.content.Intent#CATEGORY_DEFAULT}. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3686 | * @return Returns a ResolveInfo object containing the final activity intent |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3687 | * that was determined to be the best action. Returns null if no |
Mike LeBeau | bd3f527 | 2010-02-18 19:27:17 -0800 | [diff] [blame] | 3688 | * matching activity was found. If multiple matching activities are |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3689 | * found and there is no default set, returns a ResolveInfo object |
Mike LeBeau | bd3f527 | 2010-02-18 19:27:17 -0800 | [diff] [blame] | 3690 | * containing something else, such as the activity resolver. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3691 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3692 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3693 | * @see #GET_SHARED_LIBRARY_FILES |
| 3694 | * @see #MATCH_ALL |
| 3695 | * @see #MATCH_DISABLED_COMPONENTS |
| 3696 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3697 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3698 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3699 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3700 | * @see #MATCH_SYSTEM_ONLY |
| 3701 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3702 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3703 | public abstract ResolveInfo resolveActivity(Intent intent, @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3704 | |
| 3705 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3706 | * Determine the best action to perform for a given Intent for a given user. |
| 3707 | * This is how {@link Intent#resolveActivity} finds an activity if a class |
| 3708 | * has not been explicitly specified. |
| 3709 | * <p> |
| 3710 | * <em>Note:</em> if using an implicit Intent (without an explicit |
| 3711 | * ComponentName specified), be sure to consider whether to set the |
| 3712 | * {@link #MATCH_DEFAULT_ONLY} only flag. You need to do so to resolve the |
| 3713 | * activity in the same way that |
| 3714 | * {@link android.content.Context#startActivity(Intent)} and |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3715 | * {@link android.content.Intent#resolveActivity(PackageManager) |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3716 | * Intent.resolveActivity(PackageManager)} do. |
| 3717 | * </p> |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3718 | * |
| 3719 | * @param intent An intent containing all of the desired specification |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3720 | * (action, data, type, category, and/or component). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3721 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3722 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3723 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3724 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3725 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3726 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3727 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3728 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3729 | * returned. The most important is {@link #MATCH_DEFAULT_ONLY}, |
| 3730 | * to limit the resolution to only those activities that support |
| 3731 | * the {@link android.content.Intent#CATEGORY_DEFAULT}. |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3732 | * @param userId The user id. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3733 | * @return Returns a ResolveInfo object containing the final activity intent |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3734 | * that was determined to be the best action. Returns null if no |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3735 | * matching activity was found. If multiple matching activities are |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3736 | * found and there is no default set, returns a ResolveInfo object |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3737 | * containing something else, such as the activity resolver. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3738 | * @see #GET_META_DATA |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3739 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3740 | * @see #GET_SHARED_LIBRARY_FILES |
| 3741 | * @see #MATCH_ALL |
| 3742 | * @see #MATCH_DISABLED_COMPONENTS |
| 3743 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3744 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3745 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3746 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3747 | * @see #MATCH_SYSTEM_ONLY |
| 3748 | * @see #MATCH_UNINSTALLED_PACKAGES |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3749 | * @hide |
| 3750 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3751 | public abstract ResolveInfo resolveActivityAsUser(Intent intent, @ResolveInfoFlags int flags, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3752 | @UserIdInt int userId); |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3753 | |
| 3754 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3755 | * Retrieve all activities that can be performed for the given intent. |
| 3756 | * |
| 3757 | * @param intent The desired intent as per resolveActivity(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3758 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3759 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3760 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3761 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3762 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3763 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3764 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3765 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3766 | * returned. The most important is {@link #MATCH_DEFAULT_ONLY}, |
| 3767 | * to limit the resolution to only those activities that support |
| 3768 | * the {@link android.content.Intent#CATEGORY_DEFAULT}. Or, set |
| 3769 | * {@link #MATCH_ALL} to prevent any filtering of the results. |
| 3770 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3771 | * each matching activity, ordered from best to worst. In other |
| 3772 | * words, the first item is what would be returned by |
| 3773 | * {@link #resolveActivity}. If there are no matching activities, an |
| 3774 | * empty list is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3775 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3776 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3777 | * @see #GET_SHARED_LIBRARY_FILES |
| 3778 | * @see #MATCH_ALL |
| 3779 | * @see #MATCH_DISABLED_COMPONENTS |
| 3780 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3781 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3782 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3783 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3784 | * @see #MATCH_SYSTEM_ONLY |
| 3785 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3786 | */ |
| 3787 | public abstract List<ResolveInfo> queryIntentActivities(Intent intent, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3788 | @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3789 | |
| 3790 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3791 | * Retrieve all activities that can be performed for the given intent, for a |
| 3792 | * specific user. |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3793 | * |
| 3794 | * @param intent The desired intent as per resolveActivity(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3795 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3796 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3797 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3798 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3799 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3800 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3801 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3802 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3803 | * returned. The most important is {@link #MATCH_DEFAULT_ONLY}, |
| 3804 | * to limit the resolution to only those activities that support |
| 3805 | * the {@link android.content.Intent#CATEGORY_DEFAULT}. Or, set |
| 3806 | * {@link #MATCH_ALL} to prevent any filtering of the results. |
| 3807 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3808 | * each matching activity, ordered from best to worst. In other |
| 3809 | * words, the first item is what would be returned by |
| 3810 | * {@link #resolveActivity}. If there are no matching activities, an |
| 3811 | * empty list is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3812 | * @see #GET_META_DATA |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3813 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3814 | * @see #GET_SHARED_LIBRARY_FILES |
| 3815 | * @see #MATCH_ALL |
| 3816 | * @see #MATCH_DISABLED_COMPONENTS |
| 3817 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3818 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3819 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3820 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3821 | * @see #MATCH_SYSTEM_ONLY |
| 3822 | * @see #MATCH_UNINSTALLED_PACKAGES |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3823 | * @hide |
| 3824 | */ |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3825 | public abstract List<ResolveInfo> queryIntentActivitiesAsUser(Intent intent, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3826 | @ResolveInfoFlags int flags, @UserIdInt int userId); |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3827 | |
| 3828 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3829 | * 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] | 3830 | * similar options. This is like {@link #queryIntentActivities}, except it |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3831 | * also allows you to supply a list of more explicit Intents that you would |
| 3832 | * like to resolve to particular options, and takes care of returning the |
| 3833 | * final ResolveInfo list in a reasonable order, with no duplicates, based |
| 3834 | * on those inputs. |
| 3835 | * |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3836 | * @param caller The class name of the activity that is making the request. |
| 3837 | * This activity will never appear in the output list. Can be |
| 3838 | * null. |
| 3839 | * @param specifics An array of Intents that should be resolved to the first |
| 3840 | * specific results. Can be null. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3841 | * @param intent The desired intent as per resolveActivity(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3842 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3843 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3844 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3845 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3846 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3847 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3848 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3849 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3850 | * returned. The most important is {@link #MATCH_DEFAULT_ONLY}, |
| 3851 | * to limit the resolution to only those activities that support |
| 3852 | * the {@link android.content.Intent#CATEGORY_DEFAULT}. |
| 3853 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3854 | * each matching activity. The list is ordered first by all of the |
| 3855 | * intents resolved in <var>specifics</var> and then any additional |
| 3856 | * activities that can handle <var>intent</var> but did not get |
| 3857 | * included by one of the <var>specifics</var> intents. If there are |
| 3858 | * no matching activities, an empty list is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3859 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3860 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3861 | * @see #GET_SHARED_LIBRARY_FILES |
| 3862 | * @see #MATCH_ALL |
| 3863 | * @see #MATCH_DISABLED_COMPONENTS |
| 3864 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3865 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3866 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3867 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3868 | * @see #MATCH_SYSTEM_ONLY |
| 3869 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3870 | */ |
| 3871 | public abstract List<ResolveInfo> queryIntentActivityOptions( |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3872 | ComponentName caller, Intent[] specifics, Intent intent, @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3873 | |
| 3874 | /** |
| 3875 | * Retrieve all receivers that can handle a broadcast of the given intent. |
| 3876 | * |
| 3877 | * @param intent The desired intent as per resolveActivity(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3878 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3879 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3880 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3881 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3882 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3883 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3884 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3885 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3886 | * returned. |
| 3887 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3888 | * each matching receiver, ordered from best to worst. If there are |
| 3889 | * no matching receivers, an empty list or null is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3890 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3891 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3892 | * @see #GET_SHARED_LIBRARY_FILES |
| 3893 | * @see #MATCH_ALL |
| 3894 | * @see #MATCH_DISABLED_COMPONENTS |
| 3895 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3896 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3897 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3898 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3899 | * @see #MATCH_SYSTEM_ONLY |
| 3900 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3901 | */ |
| 3902 | public abstract List<ResolveInfo> queryBroadcastReceivers(Intent intent, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3903 | @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3904 | |
| 3905 | /** |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3906 | * Retrieve all receivers that can handle a broadcast of the given intent, |
| 3907 | * for a specific user. |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3908 | * |
| 3909 | * @param intent The desired intent as per resolveActivity(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3910 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3911 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3912 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3913 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3914 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3915 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3916 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3917 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3918 | * returned. |
Fyodor Kupolov | 940e857 | 2016-01-26 12:03:51 -0800 | [diff] [blame] | 3919 | * @param userHandle UserHandle of the user being queried. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3920 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 3921 | * each matching receiver, ordered from best to worst. If there are |
| 3922 | * no matching receivers, an empty list or null is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3923 | * @see #GET_META_DATA |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3924 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3925 | * @see #GET_SHARED_LIBRARY_FILES |
| 3926 | * @see #MATCH_ALL |
| 3927 | * @see #MATCH_DISABLED_COMPONENTS |
| 3928 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3929 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3930 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3931 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3932 | * @see #MATCH_SYSTEM_ONLY |
| 3933 | * @see #MATCH_UNINSTALLED_PACKAGES |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3934 | * @hide |
| 3935 | */ |
Fyodor Kupolov | 940e857 | 2016-01-26 12:03:51 -0800 | [diff] [blame] | 3936 | @SystemApi |
| 3937 | public List<ResolveInfo> queryBroadcastReceiversAsUser(Intent intent, |
| 3938 | @ResolveInfoFlags int flags, UserHandle userHandle) { |
| 3939 | return queryBroadcastReceiversAsUser(intent, flags, userHandle.getIdentifier()); |
| 3940 | } |
| 3941 | |
| 3942 | /** |
| 3943 | * @hide |
| 3944 | */ |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 3945 | public abstract List<ResolveInfo> queryBroadcastReceiversAsUser(Intent intent, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3946 | @ResolveInfoFlags int flags, @UserIdInt int userId); |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3947 | |
Fyodor Kupolov | 940e857 | 2016-01-26 12:03:51 -0800 | [diff] [blame] | 3948 | |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 3949 | /** {@hide} */ |
| 3950 | @Deprecated |
| 3951 | public List<ResolveInfo> queryBroadcastReceivers(Intent intent, |
| 3952 | @ResolveInfoFlags int flags, @UserIdInt int userId) { |
| 3953 | Log.w(TAG, "STAHP USING HIDDEN APIS KTHX"); |
| 3954 | return queryBroadcastReceiversAsUser(intent, flags, userId); |
| 3955 | } |
| 3956 | |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3957 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3958 | * Determine the best service to handle for a given Intent. |
| 3959 | * |
| 3960 | * @param intent An intent containing all of the desired specification |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3961 | * (action, data, type, category, and/or component). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3962 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3963 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3964 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3965 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3966 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3967 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3968 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3969 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 3970 | * returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3971 | * @return Returns a ResolveInfo object containing the final service intent |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3972 | * 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] | 3973 | * matching service was found. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3974 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3975 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3976 | * @see #GET_SHARED_LIBRARY_FILES |
| 3977 | * @see #MATCH_ALL |
| 3978 | * @see #MATCH_DISABLED_COMPONENTS |
| 3979 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3980 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3981 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 3982 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3983 | * @see #MATCH_SYSTEM_ONLY |
| 3984 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3985 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3986 | public abstract ResolveInfo resolveService(Intent intent, @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3987 | |
| 3988 | /** |
| 3989 | * Retrieve all services that can match the given intent. |
| 3990 | * |
| 3991 | * @param intent The desired intent as per resolveService(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3992 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 3993 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3994 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3995 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 3996 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3997 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 3998 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3999 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 4000 | * returned. |
| 4001 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4002 | * each matching service, ordered from best to worst. In other |
| 4003 | * words, the first item is what would be returned by |
| 4004 | * {@link #resolveService}. If there are no matching services, an |
| 4005 | * empty list or null is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4006 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4007 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4008 | * @see #GET_SHARED_LIBRARY_FILES |
| 4009 | * @see #MATCH_ALL |
| 4010 | * @see #MATCH_DISABLED_COMPONENTS |
| 4011 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 4012 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4013 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 4014 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4015 | * @see #MATCH_SYSTEM_ONLY |
| 4016 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4017 | */ |
| 4018 | public abstract List<ResolveInfo> queryIntentServices(Intent intent, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4019 | @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4020 | |
| 4021 | /** |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4022 | * Retrieve all services that can match the given intent for a given user. |
| 4023 | * |
| 4024 | * @param intent The desired intent as per resolveService(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4025 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4026 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 4027 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 4028 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 4029 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 4030 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 4031 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 4032 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 4033 | * returned. |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4034 | * @param userId The user id. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4035 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4036 | * each matching service, ordered from best to worst. In other |
| 4037 | * words, the first item is what would be returned by |
| 4038 | * {@link #resolveService}. If there are no matching services, an |
| 4039 | * empty list or null is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4040 | * @see #GET_META_DATA |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4041 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4042 | * @see #GET_SHARED_LIBRARY_FILES |
| 4043 | * @see #MATCH_ALL |
| 4044 | * @see #MATCH_DISABLED_COMPONENTS |
| 4045 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 4046 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4047 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 4048 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4049 | * @see #MATCH_SYSTEM_ONLY |
| 4050 | * @see #MATCH_UNINSTALLED_PACKAGES |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4051 | * @hide |
| 4052 | */ |
| 4053 | public abstract List<ResolveInfo> queryIntentServicesAsUser(Intent intent, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4054 | @ResolveInfoFlags int flags, @UserIdInt int userId); |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4055 | |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4056 | /** |
| 4057 | * Retrieve all providers that can match the given intent. |
| 4058 | * |
| 4059 | * @param intent An intent containing all of the desired specification |
| 4060 | * (action, data, type, category, and/or component). |
| 4061 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4062 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 4063 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 4064 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 4065 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 4066 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 4067 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 4068 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 4069 | * returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4070 | * @param userId The user id. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4071 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4072 | * each matching provider, ordered from best to worst. If there are |
| 4073 | * no matching services, an empty list or null is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4074 | * @see #GET_META_DATA |
| 4075 | * @see #GET_RESOLVED_FILTER |
| 4076 | * @see #GET_SHARED_LIBRARY_FILES |
| 4077 | * @see #MATCH_ALL |
| 4078 | * @see #MATCH_DISABLED_COMPONENTS |
| 4079 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 4080 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4081 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 4082 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4083 | * @see #MATCH_SYSTEM_ONLY |
| 4084 | * @see #MATCH_UNINSTALLED_PACKAGES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4085 | * @hide |
| 4086 | */ |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 4087 | public abstract List<ResolveInfo> queryIntentContentProvidersAsUser( |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4088 | Intent intent, @ResolveInfoFlags int flags, @UserIdInt int userId); |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 4089 | |
| 4090 | /** |
| 4091 | * Retrieve all providers that can match the given intent. |
| 4092 | * |
| 4093 | * @param intent An intent containing all of the desired specification |
| 4094 | * (action, data, type, category, and/or component). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4095 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4096 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 4097 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 4098 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 4099 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 4100 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 4101 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 4102 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 4103 | * returned. |
| 4104 | * @return Returns a List of ResolveInfo objects containing one entry for |
| 4105 | * each matching provider, ordered from best to worst. If there are |
| 4106 | * no matching services, an empty list or null is returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4107 | * @see #GET_META_DATA |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 4108 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4109 | * @see #GET_SHARED_LIBRARY_FILES |
| 4110 | * @see #MATCH_ALL |
| 4111 | * @see #MATCH_DISABLED_COMPONENTS |
| 4112 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 4113 | * @see #MATCH_DEFAULT_ONLY |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4114 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 4115 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4116 | * @see #MATCH_SYSTEM_ONLY |
| 4117 | * @see #MATCH_UNINSTALLED_PACKAGES |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 4118 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4119 | public abstract List<ResolveInfo> queryIntentContentProviders(Intent intent, |
| 4120 | @ResolveInfoFlags int flags); |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 4121 | |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 4122 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4123 | * Find a single content provider by its base path name. |
| 4124 | * |
| 4125 | * @param name The name of the provider to find. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4126 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4127 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 4128 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 4129 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 4130 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 4131 | * {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 4132 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 4133 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 4134 | * returned. |
| 4135 | * @return A {@link ProviderInfo} object containing information about the |
| 4136 | * provider. If a provider was not found, returns null. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4137 | * @see #GET_META_DATA |
| 4138 | * @see #GET_SHARED_LIBRARY_FILES |
| 4139 | * @see #MATCH_ALL |
| 4140 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 4141 | * @see #MATCH_DEFAULT_ONLY |
| 4142 | * @see #MATCH_DISABLED_COMPONENTS |
| 4143 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4144 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 4145 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4146 | * @see #MATCH_SYSTEM_ONLY |
| 4147 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4148 | */ |
| 4149 | public abstract ProviderInfo resolveContentProvider(String name, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4150 | @ComponentInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4151 | |
| 4152 | /** |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4153 | * Find a single content provider by its base path name. |
| 4154 | * |
| 4155 | * @param name The name of the provider to find. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4156 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4157 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 4158 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 4159 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 4160 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 4161 | * {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 4162 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 4163 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 4164 | * returned. |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4165 | * @param userId The user id. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4166 | * @return A {@link ProviderInfo} object containing information about the |
| 4167 | * provider. If a provider was not found, returns null. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4168 | * @see #GET_META_DATA |
| 4169 | * @see #GET_SHARED_LIBRARY_FILES |
| 4170 | * @see #MATCH_ALL |
| 4171 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 4172 | * @see #MATCH_DEFAULT_ONLY |
| 4173 | * @see #MATCH_DISABLED_COMPONENTS |
| 4174 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4175 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 4176 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4177 | * @see #MATCH_SYSTEM_ONLY |
| 4178 | * @see #MATCH_UNINSTALLED_PACKAGES |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4179 | * @hide |
| 4180 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4181 | public abstract ProviderInfo resolveContentProviderAsUser(String name, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4182 | @ComponentInfoFlags int flags, @UserIdInt int userId); |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4183 | |
| 4184 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4185 | * Retrieve content provider information. |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4186 | * <p> |
| 4187 | * <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] | 4188 | * by a null return instead of an empty list.</em> |
| 4189 | * |
| 4190 | * @param processName If non-null, limits the returned providers to only |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4191 | * those that are hosted by the given process. If null, all |
| 4192 | * content providers are returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4193 | * @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] | 4194 | * uid owning the requested content providers. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4195 | * @param flags Additional option flags. Use any combination of |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4196 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 4197 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 4198 | * {@link #MATCH_DISABLED_COMPONENTS}, |
| 4199 | * {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 4200 | * {@link #MATCH_DIRECT_BOOT_AWARE}, |
| 4201 | * {@link #MATCH_DIRECT_BOOT_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 4202 | * or {@link #MATCH_UNINSTALLED_PACKAGES} to modify the data |
| 4203 | * returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4204 | * @return A list of {@link ProviderInfo} objects containing one entry for |
| 4205 | * each provider either matching <var>processName</var> or, if |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4206 | * <var>processName</var> is null, all known content providers. |
| 4207 | * <em>If there are no matching providers, null is returned.</em> |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4208 | * @see #GET_META_DATA |
| 4209 | * @see #GET_SHARED_LIBRARY_FILES |
| 4210 | * @see #MATCH_ALL |
| 4211 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 4212 | * @see #MATCH_DEFAULT_ONLY |
| 4213 | * @see #MATCH_DISABLED_COMPONENTS |
| 4214 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4215 | * @see #MATCH_DIRECT_BOOT_AWARE |
| 4216 | * @see #MATCH_DIRECT_BOOT_UNAWARE |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4217 | * @see #MATCH_SYSTEM_ONLY |
| 4218 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4219 | */ |
| 4220 | public abstract List<ProviderInfo> queryContentProviders( |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4221 | String processName, int uid, @ComponentInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4222 | |
| 4223 | /** |
| 4224 | * Retrieve all of the information we know about a particular |
| 4225 | * instrumentation class. |
| 4226 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4227 | * @param className The full name (i.e. |
| 4228 | * com.google.apps.contacts.InstrumentList) of an |
| 4229 | * Instrumentation class. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4230 | * @param flags Additional option flags. Use any combination of |
| 4231 | * {@link #GET_META_DATA} |
| 4232 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4233 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4234 | * @return An {@link InstrumentationInfo} object containing information about the |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4235 | * instrumentation. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4236 | * @throws NameNotFoundException if a package with the given name cannot be |
| 4237 | * found on the system. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4238 | * |
| 4239 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4240 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4241 | public abstract InstrumentationInfo getInstrumentationInfo(ComponentName className, |
| 4242 | @InstrumentationInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4243 | |
| 4244 | /** |
| 4245 | * Retrieve information about available instrumentation code. May be used |
| 4246 | * to retrieve either all instrumentation code, or only the code targeting |
| 4247 | * a particular package. |
| 4248 | * |
| 4249 | * @param targetPackage If null, all instrumentation is returned; only the |
| 4250 | * instrumentation targeting this package name is |
| 4251 | * returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4252 | * @param flags Additional option flags. Use any combination of |
| 4253 | * {@link #GET_META_DATA} |
| 4254 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4255 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4256 | * @return A list of {@link InstrumentationInfo} objects containing one |
| 4257 | * entry for each matching instrumentation. If there are no |
Jesse Hall | f77a34f | 2016-02-04 18:41:33 -0800 | [diff] [blame] | 4258 | * instrumentation available, returns an empty list. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4259 | * |
| 4260 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4261 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4262 | public abstract List<InstrumentationInfo> queryInstrumentation(String targetPackage, |
| 4263 | @InstrumentationInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4264 | |
| 4265 | /** |
| 4266 | * Retrieve an image from a package. This is a low-level API used by |
| 4267 | * the various package manager info structures (such as |
| 4268 | * {@link ComponentInfo} to implement retrieval of their associated |
| 4269 | * icon. |
| 4270 | * |
| 4271 | * @param packageName The name of the package that this icon is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4272 | * Cannot be null. |
| 4273 | * @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] | 4274 | * @param appInfo Overall information about <var>packageName</var>. This |
| 4275 | * may be null, in which case the application information will be retrieved |
| 4276 | * for you if needed; if you already have this information around, it can |
| 4277 | * be much more efficient to supply it here. |
| 4278 | * |
| 4279 | * @return Returns a Drawable holding the requested image. Returns null if |
| 4280 | * an image could not be found for any reason. |
| 4281 | */ |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 4282 | public abstract Drawable getDrawable(String packageName, @DrawableRes int resid, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4283 | ApplicationInfo appInfo); |
| 4284 | |
| 4285 | /** |
| 4286 | * Retrieve the icon associated with an activity. Given the full name of |
| 4287 | * an activity, retrieves the information about it and calls |
| 4288 | * {@link ComponentInfo#loadIcon ComponentInfo.loadIcon()} to return its icon. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4289 | * If the activity cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4290 | * |
| 4291 | * @param activityName Name of the activity whose icon is to be retrieved. |
| 4292 | * |
| 4293 | * @return Returns the image of the icon, or the default activity icon if |
| 4294 | * it could not be found. Does not return null. |
| 4295 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4296 | * activity could not be loaded. |
| 4297 | * |
| 4298 | * @see #getActivityIcon(Intent) |
| 4299 | */ |
| 4300 | public abstract Drawable getActivityIcon(ComponentName activityName) |
| 4301 | throws NameNotFoundException; |
| 4302 | |
| 4303 | /** |
| 4304 | * Retrieve the icon associated with an Intent. If intent.getClassName() is |
| 4305 | * set, this simply returns the result of |
| 4306 | * getActivityIcon(intent.getClassName()). Otherwise it resolves the intent's |
| 4307 | * component and returns the icon associated with the resolved component. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4308 | * 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] | 4309 | * to a component, NameNotFoundException is thrown. |
| 4310 | * |
| 4311 | * @param intent The intent for which you would like to retrieve an icon. |
| 4312 | * |
| 4313 | * @return Returns the image of the icon, or the default activity icon if |
| 4314 | * it could not be found. Does not return null. |
| 4315 | * @throws NameNotFoundException Thrown if the resources for application |
| 4316 | * matching the given intent could not be loaded. |
| 4317 | * |
| 4318 | * @see #getActivityIcon(ComponentName) |
| 4319 | */ |
| 4320 | public abstract Drawable getActivityIcon(Intent intent) |
| 4321 | throws NameNotFoundException; |
| 4322 | |
| 4323 | /** |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4324 | * Retrieve the banner associated with an activity. Given the full name of |
| 4325 | * an activity, retrieves the information about it and calls |
| 4326 | * {@link ComponentInfo#loadIcon ComponentInfo.loadIcon()} to return its |
| 4327 | * banner. If the activity cannot be found, NameNotFoundException is thrown. |
| 4328 | * |
| 4329 | * @param activityName Name of the activity whose banner is to be retrieved. |
| 4330 | * @return Returns the image of the banner, or null if the activity has no |
| 4331 | * banner specified. |
| 4332 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4333 | * activity could not be loaded. |
| 4334 | * @see #getActivityBanner(Intent) |
| 4335 | */ |
| 4336 | public abstract Drawable getActivityBanner(ComponentName activityName) |
| 4337 | throws NameNotFoundException; |
| 4338 | |
| 4339 | /** |
| 4340 | * Retrieve the banner associated with an Intent. If intent.getClassName() |
| 4341 | * is set, this simply returns the result of |
| 4342 | * getActivityBanner(intent.getClassName()). Otherwise it resolves the |
| 4343 | * intent's component and returns the banner associated with the resolved |
| 4344 | * component. If intent.getClassName() cannot be found or the Intent cannot |
| 4345 | * be resolved to a component, NameNotFoundException is thrown. |
| 4346 | * |
| 4347 | * @param intent The intent for which you would like to retrieve a banner. |
| 4348 | * @return Returns the image of the banner, or null if the activity has no |
| 4349 | * banner specified. |
| 4350 | * @throws NameNotFoundException Thrown if the resources for application |
| 4351 | * matching the given intent could not be loaded. |
| 4352 | * @see #getActivityBanner(ComponentName) |
| 4353 | */ |
| 4354 | public abstract Drawable getActivityBanner(Intent intent) |
| 4355 | throws NameNotFoundException; |
| 4356 | |
| 4357 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4358 | * Return the generic icon for an activity that is used when no specific |
| 4359 | * icon is defined. |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 4360 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4361 | * @return Drawable Image of the icon. |
| 4362 | */ |
| 4363 | public abstract Drawable getDefaultActivityIcon(); |
| 4364 | |
| 4365 | /** |
| 4366 | * Retrieve the icon associated with an application. If it has not defined |
| 4367 | * an icon, the default app icon is returned. Does not return null. |
| 4368 | * |
| 4369 | * @param info Information about application being queried. |
| 4370 | * |
| 4371 | * @return Returns the image of the icon, or the default application icon |
| 4372 | * if it could not be found. |
| 4373 | * |
| 4374 | * @see #getApplicationIcon(String) |
| 4375 | */ |
| 4376 | public abstract Drawable getApplicationIcon(ApplicationInfo info); |
| 4377 | |
| 4378 | /** |
| 4379 | * Retrieve the icon associated with an application. Given the name of the |
| 4380 | * application's package, retrieves the information about it and calls |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4381 | * 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] | 4382 | * found, NameNotFoundException is thrown. |
| 4383 | * |
| 4384 | * @param packageName Name of the package whose application icon is to be |
| 4385 | * retrieved. |
| 4386 | * |
| 4387 | * @return Returns the image of the icon, or the default application icon |
| 4388 | * if it could not be found. Does not return null. |
| 4389 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4390 | * application could not be loaded. |
| 4391 | * |
| 4392 | * @see #getApplicationIcon(ApplicationInfo) |
| 4393 | */ |
| 4394 | public abstract Drawable getApplicationIcon(String packageName) |
| 4395 | throws NameNotFoundException; |
| 4396 | |
| 4397 | /** |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4398 | * Retrieve the banner associated with an application. |
| 4399 | * |
| 4400 | * @param info Information about application being queried. |
| 4401 | * @return Returns the image of the banner or null if the application has no |
| 4402 | * banner specified. |
| 4403 | * @see #getApplicationBanner(String) |
| 4404 | */ |
| 4405 | public abstract Drawable getApplicationBanner(ApplicationInfo info); |
| 4406 | |
| 4407 | /** |
| 4408 | * Retrieve the banner associated with an application. Given the name of the |
| 4409 | * application's package, retrieves the information about it and calls |
| 4410 | * getApplicationIcon() to return its banner. If the application cannot be |
| 4411 | * found, NameNotFoundException is thrown. |
| 4412 | * |
| 4413 | * @param packageName Name of the package whose application banner is to be |
| 4414 | * retrieved. |
| 4415 | * @return Returns the image of the banner or null if the application has no |
| 4416 | * banner specified. |
| 4417 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4418 | * application could not be loaded. |
| 4419 | * @see #getApplicationBanner(ApplicationInfo) |
| 4420 | */ |
| 4421 | public abstract Drawable getApplicationBanner(String packageName) |
| 4422 | throws NameNotFoundException; |
| 4423 | |
| 4424 | /** |
| 4425 | * Retrieve the logo associated with an activity. Given the full name of an |
| 4426 | * activity, retrieves the information about it and calls |
| 4427 | * {@link ComponentInfo#loadLogo ComponentInfo.loadLogo()} to return its |
| 4428 | * logo. If the activity cannot be found, NameNotFoundException is thrown. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4429 | * |
| 4430 | * @param activityName Name of the activity whose logo is to be retrieved. |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4431 | * @return Returns the image of the logo or null if the activity has no logo |
| 4432 | * specified. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4433 | * @throws NameNotFoundException Thrown if the resources for the given |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4434 | * activity could not be loaded. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4435 | * @see #getActivityLogo(Intent) |
| 4436 | */ |
| 4437 | public abstract Drawable getActivityLogo(ComponentName activityName) |
| 4438 | throws NameNotFoundException; |
| 4439 | |
| 4440 | /** |
| 4441 | * Retrieve the logo associated with an Intent. If intent.getClassName() is |
| 4442 | * set, this simply returns the result of |
| 4443 | * getActivityLogo(intent.getClassName()). Otherwise it resolves the intent's |
| 4444 | * component and returns the logo associated with the resolved component. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4445 | * If intent.getClassName() cannot be found or the Intent cannot be resolved |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4446 | * to a component, NameNotFoundException is thrown. |
| 4447 | * |
| 4448 | * @param intent The intent for which you would like to retrieve a logo. |
| 4449 | * |
| 4450 | * @return Returns the image of the logo, or null if the activity has no |
| 4451 | * logo specified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4452 | * |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4453 | * @throws NameNotFoundException Thrown if the resources for application |
| 4454 | * matching the given intent could not be loaded. |
| 4455 | * |
| 4456 | * @see #getActivityLogo(ComponentName) |
| 4457 | */ |
| 4458 | public abstract Drawable getActivityLogo(Intent intent) |
| 4459 | throws NameNotFoundException; |
| 4460 | |
| 4461 | /** |
| 4462 | * Retrieve the logo associated with an application. If it has not specified |
| 4463 | * a logo, this method returns null. |
| 4464 | * |
| 4465 | * @param info Information about application being queried. |
| 4466 | * |
| 4467 | * @return Returns the image of the logo, or null if no logo is specified |
| 4468 | * by the application. |
| 4469 | * |
| 4470 | * @see #getApplicationLogo(String) |
| 4471 | */ |
| 4472 | public abstract Drawable getApplicationLogo(ApplicationInfo info); |
| 4473 | |
| 4474 | /** |
| 4475 | * Retrieve the logo associated with an application. Given the name of the |
| 4476 | * application's package, retrieves the information about it and calls |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4477 | * getApplicationLogo() to return its logo. If the application cannot be |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4478 | * found, NameNotFoundException is thrown. |
| 4479 | * |
| 4480 | * @param packageName Name of the package whose application logo is to be |
| 4481 | * retrieved. |
| 4482 | * |
| 4483 | * @return Returns the image of the logo, or null if no application logo |
| 4484 | * has been specified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4485 | * |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4486 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4487 | * application could not be loaded. |
| 4488 | * |
| 4489 | * @see #getApplicationLogo(ApplicationInfo) |
| 4490 | */ |
| 4491 | public abstract Drawable getApplicationLogo(String packageName) |
| 4492 | throws NameNotFoundException; |
| 4493 | |
| 4494 | /** |
Vadim Tryshev | 66ae66a | 2016-02-18 15:41:21 -0800 | [diff] [blame] | 4495 | * Returns a managed-user-style badged copy of the given drawable allowing the user to |
| 4496 | * distinguish it from the original drawable. |
| 4497 | * The caller can specify the location in the bounds of the drawable to be |
| 4498 | * badged where the badge should be applied as well as the density of the |
| 4499 | * badge to be used. |
| 4500 | * <p> |
| 4501 | * If the original drawable is a BitmapDrawable and the backing bitmap is |
| 4502 | * mutable as per {@link android.graphics.Bitmap#isMutable()}, the badging |
| 4503 | * is performed in place and the original drawable is returned. |
| 4504 | * </p> |
| 4505 | * |
| 4506 | * @param drawable The drawable to badge. |
| 4507 | * @param badgeLocation Where in the bounds of the badged drawable to place |
| 4508 | * the badge. If it's {@code null}, the badge is applied on top of the entire |
| 4509 | * drawable being badged. |
| 4510 | * @param badgeDensity The optional desired density for the badge as per |
| 4511 | * {@link android.util.DisplayMetrics#densityDpi}. If it's not positive, |
| 4512 | * the density of the display is used. |
| 4513 | * @return A drawable that combines the original drawable and a badge as |
| 4514 | * determined by the system. |
| 4515 | * @hide |
| 4516 | */ |
| 4517 | public abstract Drawable getManagedUserBadgedDrawable(Drawable drawable, Rect badgeLocation, |
| 4518 | int badgeDensity); |
| 4519 | |
| 4520 | /** |
Tony Mak | 4dc008c | 2016-03-16 10:46:49 +0000 | [diff] [blame] | 4521 | * If the target user is a managed profile, then this returns a badged copy of the given icon |
| 4522 | * 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] | 4523 | * {@link #getUserBadgedDrawableForDensity( |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4524 | * android.graphics.drawable.Drawable, UserHandle, android.graphics.Rect, int)}. |
| 4525 | * <p> |
| 4526 | * If the original drawable is a BitmapDrawable and the backing bitmap is |
| 4527 | * mutable as per {@link android.graphics.Bitmap#isMutable()}, the badging |
| 4528 | * is performed in place and the original drawable is returned. |
| 4529 | * </p> |
| 4530 | * |
| 4531 | * @param icon The icon to badge. |
| 4532 | * @param user The target user. |
| 4533 | * @return A drawable that combines the original icon and a badge as |
| 4534 | * determined by the system. |
| 4535 | */ |
| 4536 | public abstract Drawable getUserBadgedIcon(Drawable icon, UserHandle user); |
| 4537 | |
| 4538 | /** |
| 4539 | * If the target user is a managed profile of the calling user or the caller |
| 4540 | * is itself a managed profile, then this returns a badged copy of the given |
| 4541 | * drawable allowing the user to distinguish it from the original drawable. |
| 4542 | * The caller can specify the location in the bounds of the drawable to be |
| 4543 | * badged where the badge should be applied as well as the density of the |
| 4544 | * badge to be used. |
| 4545 | * <p> |
| 4546 | * If the original drawable is a BitmapDrawable and the backing bitmap is |
Vadim Tryshev | 66ae66a | 2016-02-18 15:41:21 -0800 | [diff] [blame] | 4547 | * mutable as per {@link android.graphics.Bitmap#isMutable()}, the badging |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4548 | * is performed in place and the original drawable is returned. |
| 4549 | * </p> |
| 4550 | * |
| 4551 | * @param drawable The drawable to badge. |
| 4552 | * @param user The target user. |
| 4553 | * @param badgeLocation Where in the bounds of the badged drawable to place |
Vadim Tryshev | 66ae66a | 2016-02-18 15:41:21 -0800 | [diff] [blame] | 4554 | * 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] | 4555 | * drawable being badged. |
| 4556 | * @param badgeDensity The optional desired density for the badge as per |
Vadim Tryshev | 66ae66a | 2016-02-18 15:41:21 -0800 | [diff] [blame] | 4557 | * {@link android.util.DisplayMetrics#densityDpi}. If it's not positive, |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4558 | * the density of the display is used. |
| 4559 | * @return A drawable that combines the original drawable and a badge as |
| 4560 | * determined by the system. |
| 4561 | */ |
| 4562 | public abstract Drawable getUserBadgedDrawableForDensity(Drawable drawable, |
| 4563 | UserHandle user, Rect badgeLocation, int badgeDensity); |
| 4564 | |
| 4565 | /** |
| 4566 | * If the target user is a managed profile of the calling user or the caller |
| 4567 | * is itself a managed profile, then this returns a drawable to use as a small |
| 4568 | * icon to include in a view to distinguish it from the original icon. |
| 4569 | * |
| 4570 | * @param user The target user. |
| 4571 | * @param density The optional desired density for the badge as per |
| 4572 | * {@link android.util.DisplayMetrics#densityDpi}. If not provided |
| 4573 | * the density of the current display is used. |
| 4574 | * @return the drawable or null if no drawable is required. |
| 4575 | * @hide |
| 4576 | */ |
| 4577 | public abstract Drawable getUserBadgeForDensity(UserHandle user, int density); |
| 4578 | |
| 4579 | /** |
| 4580 | * 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] | 4581 | * is itself a managed profile, then this returns a drawable to use as a small |
| 4582 | * icon to include in a view to distinguish it from the original icon. This version |
| 4583 | * doesn't have background protection and should be used over a light background instead of |
| 4584 | * a badge. |
| 4585 | * |
| 4586 | * @param user The target user. |
| 4587 | * @param density The optional desired density for the badge as per |
| 4588 | * {@link android.util.DisplayMetrics#densityDpi}. If not provided |
| 4589 | * the density of the current display is used. |
| 4590 | * @return the drawable or null if no drawable is required. |
| 4591 | * @hide |
| 4592 | */ |
| 4593 | public abstract Drawable getUserBadgeForDensityNoBackground(UserHandle user, int density); |
| 4594 | |
| 4595 | /** |
| 4596 | * 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] | 4597 | * is itself a managed profile, then this returns a copy of the label with |
| 4598 | * badging for accessibility services like talkback. E.g. passing in "Email" |
| 4599 | * and it might return "Work Email" for Email in the work profile. |
| 4600 | * |
| 4601 | * @param label The label to change. |
| 4602 | * @param user The target user. |
| 4603 | * @return A label that combines the original label and a badge as |
| 4604 | * determined by the system. |
| 4605 | */ |
| 4606 | public abstract CharSequence getUserBadgedLabel(CharSequence label, UserHandle user); |
| 4607 | |
| 4608 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4609 | * Retrieve text from a package. This is a low-level API used by |
| 4610 | * the various package manager info structures (such as |
| 4611 | * {@link ComponentInfo} to implement retrieval of their associated |
| 4612 | * labels and other text. |
| 4613 | * |
| 4614 | * @param packageName The name of the package that this text is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4615 | * Cannot be null. |
| 4616 | * @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] | 4617 | * @param appInfo Overall information about <var>packageName</var>. This |
| 4618 | * may be null, in which case the application information will be retrieved |
| 4619 | * for you if needed; if you already have this information around, it can |
| 4620 | * be much more efficient to supply it here. |
| 4621 | * |
| 4622 | * @return Returns a CharSequence holding the requested text. Returns null |
| 4623 | * if the text could not be found for any reason. |
| 4624 | */ |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 4625 | public abstract CharSequence getText(String packageName, @StringRes int resid, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4626 | ApplicationInfo appInfo); |
| 4627 | |
| 4628 | /** |
| 4629 | * Retrieve an XML file from a package. This is a low-level API used to |
| 4630 | * retrieve XML meta data. |
| 4631 | * |
| 4632 | * @param packageName The name of the package that this xml is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4633 | * Cannot be null. |
| 4634 | * @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] | 4635 | * @param appInfo Overall information about <var>packageName</var>. This |
| 4636 | * may be null, in which case the application information will be retrieved |
| 4637 | * for you if needed; if you already have this information around, it can |
| 4638 | * be much more efficient to supply it here. |
| 4639 | * |
| 4640 | * @return Returns an XmlPullParser allowing you to parse out the XML |
| 4641 | * data. Returns null if the xml resource could not be found for any |
| 4642 | * reason. |
| 4643 | */ |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 4644 | public abstract XmlResourceParser getXml(String packageName, @XmlRes int resid, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4645 | ApplicationInfo appInfo); |
| 4646 | |
| 4647 | /** |
| 4648 | * Return the label to use for this application. |
| 4649 | * |
| 4650 | * @return Returns the label associated with this application, or null if |
| 4651 | * it could not be found for any reason. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4652 | * @param info The application to get the label of. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4653 | */ |
| 4654 | public abstract CharSequence getApplicationLabel(ApplicationInfo info); |
| 4655 | |
| 4656 | /** |
| 4657 | * Retrieve the resources associated with an activity. Given the full |
| 4658 | * name of an activity, retrieves the information about it and calls |
| 4659 | * getResources() to return its application's resources. If the activity |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4660 | * cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4661 | * |
| 4662 | * @param activityName Name of the activity whose resources are to be |
| 4663 | * retrieved. |
| 4664 | * |
| 4665 | * @return Returns the application's Resources. |
| 4666 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4667 | * application could not be loaded. |
| 4668 | * |
| 4669 | * @see #getResourcesForApplication(ApplicationInfo) |
| 4670 | */ |
| 4671 | public abstract Resources getResourcesForActivity(ComponentName activityName) |
| 4672 | throws NameNotFoundException; |
| 4673 | |
| 4674 | /** |
| 4675 | * Retrieve the resources for an application. Throws NameNotFoundException |
| 4676 | * if the package is no longer installed. |
| 4677 | * |
| 4678 | * @param app Information about the desired application. |
| 4679 | * |
| 4680 | * @return Returns the application's Resources. |
| 4681 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4682 | * application could not be loaded (most likely because it was uninstalled). |
| 4683 | */ |
| 4684 | public abstract Resources getResourcesForApplication(ApplicationInfo app) |
| 4685 | throws NameNotFoundException; |
| 4686 | |
| 4687 | /** |
| 4688 | * Retrieve the resources associated with an application. Given the full |
| 4689 | * package name of an application, retrieves the information about it and |
| 4690 | * calls getResources() to return its application's resources. If the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4691 | * appPackageName cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4692 | * |
| 4693 | * @param appPackageName Package name of the application whose resources |
| 4694 | * are to be retrieved. |
| 4695 | * |
| 4696 | * @return Returns the application's Resources. |
| 4697 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4698 | * application could not be loaded. |
| 4699 | * |
| 4700 | * @see #getResourcesForApplication(ApplicationInfo) |
| 4701 | */ |
| 4702 | public abstract Resources getResourcesForApplication(String appPackageName) |
| 4703 | throws NameNotFoundException; |
| 4704 | |
Amith Yamasani | 98edc95 | 2012-09-25 14:09:27 -0700 | [diff] [blame] | 4705 | /** @hide */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4706 | public abstract Resources getResourcesForApplicationAsUser(String appPackageName, |
| 4707 | @UserIdInt int userId) throws NameNotFoundException; |
Amith Yamasani | 98edc95 | 2012-09-25 14:09:27 -0700 | [diff] [blame] | 4708 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4709 | /** |
| 4710 | * Retrieve overall information about an application package defined |
| 4711 | * in a package archive file |
| 4712 | * |
| 4713 | * @param archiveFilePath The path to the archive file |
| 4714 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4715 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 4716 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 4717 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 4718 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 4719 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 4720 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 4721 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 4722 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 4723 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 4724 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4725 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4726 | * @return A PackageInfo object containing information about the |
| 4727 | * package archive. If the package could not be parsed, |
| 4728 | * returns null. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4729 | * |
| 4730 | * @see #GET_ACTIVITIES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4731 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4732 | * @see #GET_GIDS |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4733 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4734 | * @see #GET_INTENT_FILTERS |
| 4735 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4736 | * @see #GET_PERMISSIONS |
| 4737 | * @see #GET_PROVIDERS |
| 4738 | * @see #GET_RECEIVERS |
| 4739 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4740 | * @see #GET_SHARED_LIBRARY_FILES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4741 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4742 | * @see #GET_URI_PERMISSION_PATTERNS |
| 4743 | * @see #MATCH_DISABLED_COMPONENTS |
| 4744 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 4745 | * @see #MATCH_UNINSTALLED_PACKAGES |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4746 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4747 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4748 | public PackageInfo getPackageArchiveInfo(String archiveFilePath, @PackageInfoFlags int flags) { |
Jeff Sharkey | 275e085 | 2014-06-17 18:18:49 -0700 | [diff] [blame] | 4749 | final PackageParser parser = new PackageParser(); |
| 4750 | final File apkFile = new File(archiveFilePath); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 4751 | try { |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4752 | if ((flags & (MATCH_DIRECT_BOOT_UNAWARE | MATCH_DIRECT_BOOT_AWARE)) != 0) { |
Jeff Sharkey | c313251 | 2016-01-12 14:06:58 -0700 | [diff] [blame] | 4753 | // Caller expressed an explicit opinion about what encryption |
| 4754 | // aware/unaware components they want to see, so fall through and |
| 4755 | // give them what they want |
| 4756 | } else { |
| 4757 | // Caller expressed no opinion, so match everything |
Jeff Sharkey | 8a372a0 | 2016-03-16 16:25:45 -0600 | [diff] [blame] | 4758 | flags |= MATCH_DIRECT_BOOT_AWARE | MATCH_DIRECT_BOOT_UNAWARE; |
Jeff Sharkey | c313251 | 2016-01-12 14:06:58 -0700 | [diff] [blame] | 4759 | } |
| 4760 | |
Jeff Sharkey | 275e085 | 2014-06-17 18:18:49 -0700 | [diff] [blame] | 4761 | PackageParser.Package pkg = parser.parseMonolithicPackage(apkFile, 0); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 4762 | if ((flags & GET_SIGNATURES) != 0) { |
Svet Ganov | 354cd3c | 2015-12-17 11:35:04 -0800 | [diff] [blame] | 4763 | PackageParser.collectCertificates(pkg, 0); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 4764 | } |
| 4765 | PackageUserState state = new PackageUserState(); |
| 4766 | return PackageParser.generatePackageInfo(pkg, null, flags, 0, 0, null, state); |
| 4767 | } catch (PackageParserException e) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4768 | return null; |
| 4769 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4770 | } |
| 4771 | |
| 4772 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4773 | * @deprecated replaced by {@link PackageInstaller} |
| 4774 | * @hide |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4775 | */ |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4776 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4777 | public abstract void installPackage( |
Todd Kennedy | a679323 | 2016-02-24 22:46:00 +0000 | [diff] [blame] | 4778 | Uri packageURI, |
| 4779 | IPackageInstallObserver observer, |
| 4780 | @InstallFlags int flags, |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4781 | String installerPackageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4782 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4783 | * @deprecated replaced by {@link PackageInstaller} |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4784 | * @hide |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4785 | */ |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4786 | @Deprecated |
Todd Kennedy | a679323 | 2016-02-24 22:46:00 +0000 | [diff] [blame] | 4787 | public abstract void installPackage( |
| 4788 | Uri packageURI, |
| 4789 | PackageInstallObserver observer, |
| 4790 | @InstallFlags int flags, |
| 4791 | String installerPackageName); |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4792 | |
rich cannings | 706e8ba | 2012-08-20 13:20:14 -0700 | [diff] [blame] | 4793 | /** |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4794 | * If there is already an application with the given package name installed |
| 4795 | * on the system for other users, also install it for the calling user. |
| 4796 | * @hide |
| 4797 | */ |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4798 | public abstract int installExistingPackage(String packageName) throws NameNotFoundException; |
| 4799 | |
| 4800 | /** |
| 4801 | * If there is already an application with the given package name installed |
| 4802 | * on the system for other users, also install it for the specified user. |
| 4803 | * @hide |
| 4804 | */ |
| 4805 | @RequiresPermission(anyOf = { |
| 4806 | Manifest.permission.INSTALL_PACKAGES, |
| 4807 | Manifest.permission.INTERACT_ACROSS_USERS_FULL}) |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4808 | public abstract int installExistingPackageAsUser(String packageName, @UserIdInt int userId) |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4809 | throws NameNotFoundException; |
| 4810 | |
| 4811 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4812 | * Allows a package listening to the |
| 4813 | * {@link Intent#ACTION_PACKAGE_NEEDS_VERIFICATION package verification |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 4814 | * broadcast} to respond to the package manager. The response must include |
| 4815 | * the {@code verificationCode} which is one of |
| 4816 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 4817 | * {@link PackageManager#VERIFICATION_REJECT}. |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4818 | * |
| 4819 | * @param id pending package identifier as passed via the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4820 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 4821 | * @param verificationCode either {@link PackageManager#VERIFICATION_ALLOW} |
| 4822 | * or {@link PackageManager#VERIFICATION_REJECT}. |
rich cannings | 7e67151 | 2012-08-27 14:44:16 -0700 | [diff] [blame] | 4823 | * @throws SecurityException if the caller does not have the |
Dianne Hackborn | 8832c18 | 2012-09-17 17:20:24 -0700 | [diff] [blame] | 4824 | * PACKAGE_VERIFICATION_AGENT permission. |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4825 | */ |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 4826 | public abstract void verifyPendingInstall(int id, int verificationCode); |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4827 | |
| 4828 | /** |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4829 | * Allows a package listening to the |
| 4830 | * {@link Intent#ACTION_PACKAGE_NEEDS_VERIFICATION package verification |
| 4831 | * broadcast} to extend the default timeout for a response and declare what |
| 4832 | * action to perform after the timeout occurs. The response must include |
| 4833 | * the {@code verificationCodeAtTimeout} which is one of |
| 4834 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 4835 | * {@link PackageManager#VERIFICATION_REJECT}. |
| 4836 | * |
| 4837 | * This method may only be called once per package id. Additional calls |
| 4838 | * will have no effect. |
| 4839 | * |
| 4840 | * @param id pending package identifier as passed via the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4841 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4842 | * @param verificationCodeAtTimeout either |
| 4843 | * {@link PackageManager#VERIFICATION_ALLOW} or |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 4844 | * {@link PackageManager#VERIFICATION_REJECT}. If |
| 4845 | * {@code verificationCodeAtTimeout} is neither |
| 4846 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 4847 | * {@link PackageManager#VERIFICATION_REJECT}, then |
| 4848 | * {@code verificationCodeAtTimeout} will default to |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4849 | * {@link PackageManager#VERIFICATION_REJECT}. |
| 4850 | * @param millisecondsToDelay the amount of time requested for the timeout. |
| 4851 | * Must be positive and less than |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 4852 | * {@link PackageManager#MAXIMUM_VERIFICATION_TIMEOUT}. If |
| 4853 | * {@code millisecondsToDelay} is out of bounds, |
| 4854 | * {@code millisecondsToDelay} will be set to the closest in |
| 4855 | * bounds value; namely, 0 or |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4856 | * {@link PackageManager#MAXIMUM_VERIFICATION_TIMEOUT}. |
rich cannings | 7e67151 | 2012-08-27 14:44:16 -0700 | [diff] [blame] | 4857 | * @throws SecurityException if the caller does not have the |
Dianne Hackborn | 8832c18 | 2012-09-17 17:20:24 -0700 | [diff] [blame] | 4858 | * PACKAGE_VERIFICATION_AGENT permission. |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4859 | */ |
| 4860 | public abstract void extendVerificationTimeout(int id, |
| 4861 | int verificationCodeAtTimeout, long millisecondsToDelay); |
| 4862 | |
| 4863 | /** |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4864 | * Allows a package listening to the |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 4865 | * {@link Intent#ACTION_INTENT_FILTER_NEEDS_VERIFICATION} intent filter verification |
| 4866 | * broadcast to respond to the package manager. The response must include |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4867 | * the {@code verificationCode} which is one of |
| 4868 | * {@link PackageManager#INTENT_FILTER_VERIFICATION_SUCCESS} or |
| 4869 | * {@link PackageManager#INTENT_FILTER_VERIFICATION_FAILURE}. |
| 4870 | * |
| 4871 | * @param verificationId pending package identifier as passed via the |
| 4872 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
| 4873 | * @param verificationCode either {@link PackageManager#INTENT_FILTER_VERIFICATION_SUCCESS} |
| 4874 | * or {@link PackageManager#INTENT_FILTER_VERIFICATION_FAILURE}. |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 4875 | * @param failedDomains a list of failed domains if the verificationCode is |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4876 | * {@link PackageManager#INTENT_FILTER_VERIFICATION_FAILURE}, otherwise null; |
| 4877 | * @throws SecurityException if the caller does not have the |
| 4878 | * INTENT_FILTER_VERIFICATION_AGENT permission. |
| 4879 | * |
| 4880 | * @hide |
| 4881 | */ |
Fabrice Di Meglio | ef741da | 2015-05-12 16:31:38 -0700 | [diff] [blame] | 4882 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4883 | public abstract void verifyIntentFilter(int verificationId, int verificationCode, |
Todd Kennedy | dfa93ab | 2016-03-03 15:24:33 -0800 | [diff] [blame] | 4884 | List<String> failedDomains); |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4885 | |
| 4886 | /** |
| 4887 | * Get the status of a Domain Verification Result for an IntentFilter. This is |
| 4888 | * related to the {@link android.content.IntentFilter#setAutoVerify(boolean)} and |
| 4889 | * {@link android.content.IntentFilter#getAutoVerify()} |
| 4890 | * |
| 4891 | * This is used by the ResolverActivity to change the status depending on what the User select |
| 4892 | * in the Disambiguation Dialog and also used by the Settings App for changing the default App |
| 4893 | * for a domain. |
| 4894 | * |
| 4895 | * @param packageName The package name of the Activity associated with the IntentFilter. |
| 4896 | * @param userId The user id. |
| 4897 | * |
| 4898 | * @return The status to set to. This can be |
| 4899 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK} or |
| 4900 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS} or |
| 4901 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER} or |
| 4902 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED} |
| 4903 | * |
| 4904 | * @hide |
| 4905 | */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4906 | public abstract int getIntentVerificationStatusAsUser(String packageName, @UserIdInt int userId); |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4907 | |
| 4908 | /** |
| 4909 | * Allow to change the status of a Intent Verification status for all IntentFilter of an App. |
| 4910 | * This is related to the {@link android.content.IntentFilter#setAutoVerify(boolean)} and |
| 4911 | * {@link android.content.IntentFilter#getAutoVerify()} |
| 4912 | * |
| 4913 | * This is used by the ResolverActivity to change the status depending on what the User select |
| 4914 | * in the Disambiguation Dialog and also used by the Settings App for changing the default App |
| 4915 | * for a domain. |
| 4916 | * |
| 4917 | * @param packageName The package name of the Activity associated with the IntentFilter. |
| 4918 | * @param status The status to set to. This can be |
| 4919 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK} or |
| 4920 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS} or |
| 4921 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER} |
| 4922 | * @param userId The user id. |
| 4923 | * |
| 4924 | * @return true if the status has been set. False otherwise. |
| 4925 | * |
| 4926 | * @hide |
| 4927 | */ |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 4928 | public abstract boolean updateIntentVerificationStatusAsUser(String packageName, int status, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4929 | @UserIdInt int userId); |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4930 | |
| 4931 | /** |
| 4932 | * Get the list of IntentFilterVerificationInfo for a specific package and User. |
| 4933 | * |
| 4934 | * @param packageName the package name. When this parameter is set to a non null value, |
| 4935 | * the results will be filtered by the package name provided. |
| 4936 | * 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] | 4937 | * corresponding for all packages |
| 4938 | * |
| 4939 | * @return a list of IntentFilterVerificationInfo for a specific package. |
| 4940 | * |
| 4941 | * @hide |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4942 | */ |
| 4943 | public abstract List<IntentFilterVerificationInfo> getIntentFilterVerifications( |
| 4944 | String packageName); |
| 4945 | |
| 4946 | /** |
Fabrice Di Meglio | 0788595 | 2015-04-06 19:41:28 -0700 | [diff] [blame] | 4947 | * Get the list of IntentFilter for a specific package. |
| 4948 | * |
| 4949 | * @param packageName the package name. This parameter is set to a non null value, |
| 4950 | * the list will contain all the IntentFilter for that package. |
| 4951 | * Otherwise, the list will be empty. |
| 4952 | * |
| 4953 | * @return a list of IntentFilter for a specific package. |
| 4954 | * |
| 4955 | * @hide |
| 4956 | */ |
| 4957 | public abstract List<IntentFilter> getAllIntentFilters(String packageName); |
| 4958 | |
| 4959 | /** |
Fabrice Di Meglio | 6227172 | 2015-04-10 17:24:02 -0700 | [diff] [blame] | 4960 | * Get the default Browser package name for a specific user. |
| 4961 | * |
| 4962 | * @param userId The user id. |
| 4963 | * |
| 4964 | * @return the package name of the default Browser for the specified user. If the user id passed |
| 4965 | * is -1 (all users) it will return a null value. |
| 4966 | * |
| 4967 | * @hide |
| 4968 | */ |
Jeff Sharkey | a73b8fd | 2016-01-06 17:02:08 -0700 | [diff] [blame] | 4969 | @TestApi |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4970 | public abstract String getDefaultBrowserPackageNameAsUser(@UserIdInt int userId); |
Fabrice Di Meglio | 6227172 | 2015-04-10 17:24:02 -0700 | [diff] [blame] | 4971 | |
| 4972 | /** |
| 4973 | * Set the default Browser package name for a specific user. |
| 4974 | * |
| 4975 | * @param packageName The package name of the default Browser. |
| 4976 | * @param userId The user id. |
| 4977 | * |
| 4978 | * @return true if the default Browser for the specified user has been set, |
| 4979 | * otherwise return false. If the user id passed is -1 (all users) this call will not |
| 4980 | * do anything and just return false. |
| 4981 | * |
| 4982 | * @hide |
| 4983 | */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4984 | public abstract boolean setDefaultBrowserPackageNameAsUser(String packageName, |
| 4985 | @UserIdInt int userId); |
Fabrice Di Meglio | 6227172 | 2015-04-10 17:24:02 -0700 | [diff] [blame] | 4986 | |
| 4987 | /** |
Dianne Hackborn | 880119b | 2010-11-18 22:26:40 -0800 | [diff] [blame] | 4988 | * Change the installer associated with a given package. There are limitations |
| 4989 | * on how the installer package can be changed; in particular: |
| 4990 | * <ul> |
| 4991 | * <li> A SecurityException will be thrown if <var>installerPackageName</var> |
| 4992 | * is not signed with the same certificate as the calling application. |
| 4993 | * <li> A SecurityException will be thrown if <var>targetPackage</var> already |
| 4994 | * has an installer package, and that installer package is not signed with |
| 4995 | * the same certificate as the calling application. |
| 4996 | * </ul> |
| 4997 | * |
| 4998 | * @param targetPackage The installed package whose installer will be changed. |
| 4999 | * @param installerPackageName The package name of the new installer. May be |
| 5000 | * null to clear the association. |
| 5001 | */ |
| 5002 | public abstract void setInstallerPackageName(String targetPackage, |
| 5003 | String installerPackageName); |
| 5004 | |
| 5005 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5006 | * Attempts to delete a package. Since this may take a little while, the |
| 5007 | * result will be posted back to the given observer. A deletion will fail if |
| 5008 | * the calling context lacks the |
| 5009 | * {@link android.Manifest.permission#DELETE_PACKAGES} permission, if the |
| 5010 | * named package cannot be found, or if the named package is a system |
| 5011 | * package. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5012 | * |
| 5013 | * @param packageName The name of the package to delete |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5014 | * @param observer An observer callback to get notified when the package |
| 5015 | * deletion is complete. |
| 5016 | * {@link android.content.pm.IPackageDeleteObserver#packageDeleted} |
| 5017 | * will be called when that happens. observer may be null to |
| 5018 | * indicate that no callback is desired. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5019 | * @hide |
| 5020 | */ |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5021 | public abstract void deletePackage(String packageName, IPackageDeleteObserver observer, |
| 5022 | @DeleteFlags int flags); |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 5023 | |
| 5024 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5025 | * Attempts to delete a package. Since this may take a little while, the |
| 5026 | * result will be posted back to the given observer. A deletion will fail if |
| 5027 | * the named package cannot be found, or if the named package is a system |
| 5028 | * package. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 5029 | * |
| 5030 | * @param packageName The name of the package to delete |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5031 | * @param observer An observer callback to get notified when the package |
| 5032 | * deletion is complete. |
| 5033 | * {@link android.content.pm.IPackageDeleteObserver#packageDeleted} |
| 5034 | * will be called when that happens. observer may be null to |
| 5035 | * indicate that no callback is desired. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 5036 | * @param userId The user Id |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 5037 | * @hide |
| 5038 | */ |
| 5039 | @RequiresPermission(anyOf = { |
| 5040 | Manifest.permission.DELETE_PACKAGES, |
| 5041 | Manifest.permission.INTERACT_ACROSS_USERS_FULL}) |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5042 | public abstract void deletePackageAsUser(String packageName, IPackageDeleteObserver observer, |
| 5043 | @DeleteFlags int flags, @UserIdInt int userId); |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 5044 | |
| 5045 | /** |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 5046 | * Retrieve the package name of the application that installed a package. This identifies |
| 5047 | * which market the package came from. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5048 | * |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 5049 | * @param packageName The name of the package to query |
| 5050 | */ |
| 5051 | public abstract String getInstallerPackageName(String packageName); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5052 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5053 | /** |
| 5054 | * Attempts to clear the user data directory of an application. |
| 5055 | * Since this may take a little while, the result will |
| 5056 | * be posted back to the given observer. A deletion will fail if the |
| 5057 | * named package cannot be found, or if the named package is a "system package". |
| 5058 | * |
| 5059 | * @param packageName The name of the package |
| 5060 | * @param observer An observer callback to get notified when the operation is finished |
| 5061 | * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)} |
| 5062 | * will be called when that happens. observer may be null to indicate that |
| 5063 | * no callback is desired. |
| 5064 | * |
| 5065 | * @hide |
| 5066 | */ |
| 5067 | public abstract void clearApplicationUserData(String packageName, |
| 5068 | IPackageDataObserver observer); |
| 5069 | /** |
| 5070 | * Attempts to delete the cache files associated with an application. |
| 5071 | * Since this may take a little while, the result will |
| 5072 | * be posted back to the given observer. A deletion will fail if the calling context |
| 5073 | * lacks the {@link android.Manifest.permission#DELETE_CACHE_FILES} permission, if the |
| 5074 | * named package cannot be found, or if the named package is a "system package". |
| 5075 | * |
| 5076 | * @param packageName The name of the package to delete |
| 5077 | * @param observer An observer callback to get notified when the cache file deletion |
| 5078 | * is complete. |
| 5079 | * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)} |
| 5080 | * will be called when that happens. observer may be null to indicate that |
| 5081 | * no callback is desired. |
| 5082 | * |
| 5083 | * @hide |
| 5084 | */ |
| 5085 | public abstract void deleteApplicationCacheFiles(String packageName, |
| 5086 | IPackageDataObserver observer); |
| 5087 | |
| 5088 | /** |
Suprabh Shukla | 78c9eb8 | 2016-04-12 15:51:35 -0700 | [diff] [blame] | 5089 | * Attempts to delete the cache files associated with an application for a given user. Since |
| 5090 | * this may take a little while, the result will be posted back to the given observer. A |
| 5091 | * deletion will fail if the calling context lacks the |
| 5092 | * {@link android.Manifest.permission#DELETE_CACHE_FILES} permission, if the named package |
| 5093 | * cannot be found, or if the named package is a "system package". If {@code userId} does not |
| 5094 | * belong to the calling user, the caller must have |
| 5095 | * {@link android.Manifest.permission#INTERACT_ACROSS_USERS} permission. |
| 5096 | * |
| 5097 | * @param packageName The name of the package to delete |
| 5098 | * @param userId the user for which the cache files needs to be deleted |
| 5099 | * @param observer An observer callback to get notified when the cache file deletion is |
| 5100 | * complete. |
| 5101 | * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)} |
| 5102 | * will be called when that happens. observer may be null to indicate that no |
| 5103 | * callback is desired. |
| 5104 | * @hide |
| 5105 | */ |
| 5106 | public abstract void deleteApplicationCacheFilesAsUser(String packageName, int userId, |
| 5107 | IPackageDataObserver observer); |
| 5108 | |
| 5109 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5110 | * Free storage by deleting LRU sorted list of cache files across |
| 5111 | * all applications. If the currently available free storage |
| 5112 | * on the device is greater than or equal to the requested |
| 5113 | * free storage, no cache files are cleared. If the currently |
| 5114 | * available storage on the device is less than the requested |
| 5115 | * free storage, some or all of the cache files across |
| 5116 | * all applications are deleted (based on last accessed time) |
| 5117 | * to increase the free storage space on the device to |
| 5118 | * the requested value. There is no guarantee that clearing all |
| 5119 | * the cache files from all applications will clear up |
| 5120 | * enough storage to achieve the desired value. |
| 5121 | * @param freeStorageSize The number of bytes of storage to be |
| 5122 | * freed by the system. Say if freeStorageSize is XX, |
| 5123 | * and the current free storage is YY, |
| 5124 | * if XX is less than YY, just return. if not free XX-YY number |
| 5125 | * of bytes if possible. |
| 5126 | * @param observer call back used to notify when |
| 5127 | * the operation is completed |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5128 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5129 | * @hide |
| 5130 | */ |
Jeff Sharkey | 529f91f | 2015-04-18 20:23:13 -0700 | [diff] [blame] | 5131 | public void freeStorageAndNotify(long freeStorageSize, IPackageDataObserver observer) { |
| 5132 | freeStorageAndNotify(null, freeStorageSize, observer); |
| 5133 | } |
| 5134 | |
| 5135 | /** {@hide} */ |
| 5136 | public abstract void freeStorageAndNotify(String volumeUuid, long freeStorageSize, |
| 5137 | IPackageDataObserver observer); |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 5138 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5139 | /** |
| 5140 | * Free storage by deleting LRU sorted list of cache files across |
| 5141 | * all applications. If the currently available free storage |
| 5142 | * on the device is greater than or equal to the requested |
| 5143 | * free storage, no cache files are cleared. If the currently |
| 5144 | * available storage on the device is less than the requested |
| 5145 | * free storage, some or all of the cache files across |
| 5146 | * all applications are deleted (based on last accessed time) |
| 5147 | * to increase the free storage space on the device to |
| 5148 | * the requested value. There is no guarantee that clearing all |
| 5149 | * the cache files from all applications will clear up |
| 5150 | * enough storage to achieve the desired value. |
| 5151 | * @param freeStorageSize The number of bytes of storage to be |
| 5152 | * freed by the system. Say if freeStorageSize is XX, |
| 5153 | * and the current free storage is YY, |
| 5154 | * if XX is less than YY, just return. if not free XX-YY number |
| 5155 | * of bytes if possible. |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 5156 | * @param pi IntentSender call back used to |
| 5157 | * notify when the operation is completed.May be null |
| 5158 | * to indicate that no call back is desired. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5159 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5160 | * @hide |
| 5161 | */ |
Jeff Sharkey | 529f91f | 2015-04-18 20:23:13 -0700 | [diff] [blame] | 5162 | public void freeStorage(long freeStorageSize, IntentSender pi) { |
| 5163 | freeStorage(null, freeStorageSize, pi); |
| 5164 | } |
| 5165 | |
| 5166 | /** {@hide} */ |
| 5167 | 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] | 5168 | |
| 5169 | /** |
| 5170 | * Retrieve the size information for a package. |
| 5171 | * Since this may take a little while, the result will |
| 5172 | * be posted back to the given observer. The calling context |
| 5173 | * should have the {@link android.Manifest.permission#GET_PACKAGE_SIZE} permission. |
| 5174 | * |
| 5175 | * @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] | 5176 | * @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] | 5177 | * @param observer An observer callback to get notified when the operation |
| 5178 | * is complete. |
| 5179 | * {@link android.content.pm.IPackageStatsObserver#onGetStatsCompleted(PackageStats, boolean)} |
| 5180 | * The observer's callback is invoked with a PackageStats object(containing the |
| 5181 | * code, data and cache sizes of the package) and a boolean value representing |
| 5182 | * the status of the operation. observer may be null to indicate that |
| 5183 | * no callback is desired. |
| 5184 | * |
| 5185 | * @hide |
| 5186 | */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 5187 | public abstract void getPackageSizeInfoAsUser(String packageName, @UserIdInt int userId, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5188 | IPackageStatsObserver observer); |
| 5189 | |
| 5190 | /** |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5191 | * Like {@link #getPackageSizeInfoAsUser(String, int, IPackageStatsObserver)}, but |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 5192 | * returns the size for the calling user. |
| 5193 | * |
| 5194 | * @hide |
| 5195 | */ |
| 5196 | public void getPackageSizeInfo(String packageName, IPackageStatsObserver observer) { |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5197 | getPackageSizeInfoAsUser(packageName, UserHandle.myUserId(), observer); |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 5198 | } |
| 5199 | |
| 5200 | /** |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5201 | * @deprecated This function no longer does anything; it was an old |
kmccormick | ac66b85 | 2013-03-28 15:17:15 -0700 | [diff] [blame] | 5202 | * approach to managing preferred activities, which has been superseded |
| 5203 | * by (and conflicts with) the modern activity-based preferences. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5204 | */ |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5205 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5206 | public abstract void addPackageToPreferred(String packageName); |
| 5207 | |
| 5208 | /** |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5209 | * @deprecated This function no longer does anything; it was an old |
kmccormick | ac66b85 | 2013-03-28 15:17:15 -0700 | [diff] [blame] | 5210 | * approach to managing preferred activities, which has been superseded |
| 5211 | * by (and conflicts with) the modern activity-based preferences. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5212 | */ |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5213 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5214 | public abstract void removePackageFromPreferred(String packageName); |
| 5215 | |
| 5216 | /** |
Jeff Sharkey | 629f984 | 2016-01-08 16:36:54 -0700 | [diff] [blame] | 5217 | * 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] | 5218 | * first package on the list is the most preferred, the last is the |
| 5219 | * least preferred. |
| 5220 | * |
| 5221 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5222 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 5223 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 5224 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 5225 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 5226 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 5227 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 5228 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 5229 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 5230 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 5231 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5232 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5233 | * @return A List of PackageInfo objects, one for each preferred application, |
| 5234 | * in order of preference. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5235 | * |
| 5236 | * @see #GET_ACTIVITIES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5237 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5238 | * @see #GET_GIDS |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5239 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5240 | * @see #GET_INTENT_FILTERS |
| 5241 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5242 | * @see #GET_PERMISSIONS |
| 5243 | * @see #GET_PROVIDERS |
| 5244 | * @see #GET_RECEIVERS |
| 5245 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5246 | * @see #GET_SHARED_LIBRARY_FILES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5247 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5248 | * @see #GET_URI_PERMISSION_PATTERNS |
| 5249 | * @see #MATCH_DISABLED_COMPONENTS |
| 5250 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 5251 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5252 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 5253 | public abstract List<PackageInfo> getPreferredPackages(@PackageInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5254 | |
| 5255 | /** |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5256 | * @deprecated This is a protected API that should not have been available |
| 5257 | * to third party applications. It is the platform's responsibility for |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 5258 | * assigning preferred activities and this cannot be directly modified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5259 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5260 | * Add a new preferred activity mapping to the system. This will be used |
| 5261 | * to automatically select the given activity component when |
| 5262 | * {@link Context#startActivity(Intent) Context.startActivity()} finds |
| 5263 | * multiple matching activities and also matches the given filter. |
| 5264 | * |
| 5265 | * @param filter The set of intents under which this activity will be |
| 5266 | * made preferred. |
| 5267 | * @param match The IntentFilter match category that this preference |
| 5268 | * applies to. |
| 5269 | * @param set The set of activities that the user was picking from when |
| 5270 | * this preference was made. |
| 5271 | * @param activity The component name of the activity that is to be |
| 5272 | * preferred. |
| 5273 | */ |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5274 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5275 | public abstract void addPreferredActivity(IntentFilter filter, int match, |
| 5276 | ComponentName[] set, ComponentName activity); |
| 5277 | |
| 5278 | /** |
Amith Yamasani | a3f133a | 2012-08-09 17:11:28 -0700 | [diff] [blame] | 5279 | * Same as {@link #addPreferredActivity(IntentFilter, int, |
| 5280 | ComponentName[], ComponentName)}, but with a specific userId to apply the preference |
| 5281 | to. |
| 5282 | * @hide |
| 5283 | */ |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5284 | public void addPreferredActivityAsUser(IntentFilter filter, int match, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 5285 | ComponentName[] set, ComponentName activity, @UserIdInt int userId) { |
Amith Yamasani | a3f133a | 2012-08-09 17:11:28 -0700 | [diff] [blame] | 5286 | throw new RuntimeException("Not implemented. Must override in a subclass."); |
| 5287 | } |
| 5288 | |
| 5289 | /** |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5290 | * @deprecated This is a protected API that should not have been available |
| 5291 | * to third party applications. It is the platform's responsibility for |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 5292 | * assigning preferred activities and this cannot be directly modified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5293 | * |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 5294 | * Replaces an existing preferred activity mapping to the system, and if that were not present |
| 5295 | * adds a new preferred activity. This will be used |
| 5296 | * to automatically select the given activity component when |
| 5297 | * {@link Context#startActivity(Intent) Context.startActivity()} finds |
| 5298 | * multiple matching activities and also matches the given filter. |
| 5299 | * |
| 5300 | * @param filter The set of intents under which this activity will be |
| 5301 | * made preferred. |
| 5302 | * @param match The IntentFilter match category that this preference |
| 5303 | * applies to. |
| 5304 | * @param set The set of activities that the user was picking from when |
| 5305 | * this preference was made. |
| 5306 | * @param activity The component name of the activity that is to be |
| 5307 | * preferred. |
| 5308 | * @hide |
| 5309 | */ |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5310 | @Deprecated |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 5311 | public abstract void replacePreferredActivity(IntentFilter filter, int match, |
| 5312 | ComponentName[] set, ComponentName activity); |
| 5313 | |
| 5314 | /** |
Amith Yamasani | 41c1ded | 2014-08-05 11:15:05 -0700 | [diff] [blame] | 5315 | * @hide |
| 5316 | */ |
| 5317 | @Deprecated |
| 5318 | public void replacePreferredActivityAsUser(IntentFilter filter, int match, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 5319 | ComponentName[] set, ComponentName activity, @UserIdInt int userId) { |
Amith Yamasani | 41c1ded | 2014-08-05 11:15:05 -0700 | [diff] [blame] | 5320 | throw new RuntimeException("Not implemented. Must override in a subclass."); |
| 5321 | } |
| 5322 | |
| 5323 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5324 | * Remove all preferred activity mappings, previously added with |
| 5325 | * {@link #addPreferredActivity}, from the |
| 5326 | * system whose activities are implemented in the given package name. |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5327 | * An application can only clear its own package(s). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5328 | * |
| 5329 | * @param packageName The name of the package whose preferred activity |
| 5330 | * mappings are to be removed. |
| 5331 | */ |
| 5332 | public abstract void clearPackagePreferredActivities(String packageName); |
| 5333 | |
| 5334 | /** |
| 5335 | * Retrieve all preferred activities, previously added with |
| 5336 | * {@link #addPreferredActivity}, that are |
| 5337 | * currently registered with the system. |
| 5338 | * |
John Spurlock | 38e6425 | 2015-03-18 12:09:32 -0400 | [diff] [blame] | 5339 | * @param outFilters A required list in which to place the filters of all of the |
| 5340 | * preferred activities. |
| 5341 | * @param outActivities A required list in which to place the component names of |
| 5342 | * all of the preferred activities. |
| 5343 | * @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] | 5344 | * the list. If null, all activities will be returned; if non-null, only |
| 5345 | * those activities in the given package are returned. |
| 5346 | * |
| 5347 | * @return Returns the total number of registered preferred activities |
| 5348 | * (the number of distinct IntentFilter records, not the number of unique |
| 5349 | * activity components) that were found. |
| 5350 | */ |
John Spurlock | 38e6425 | 2015-03-18 12:09:32 -0400 | [diff] [blame] | 5351 | public abstract int getPreferredActivities(@NonNull List<IntentFilter> outFilters, |
| 5352 | @NonNull List<ComponentName> outActivities, String packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5353 | |
| 5354 | /** |
Christopher Tate | a2a0850d | 2013-09-05 16:38:58 -0700 | [diff] [blame] | 5355 | * Ask for the set of available 'home' activities and the current explicit |
| 5356 | * default, if any. |
| 5357 | * @hide |
| 5358 | */ |
| 5359 | public abstract ComponentName getHomeActivities(List<ResolveInfo> outActivities); |
| 5360 | |
| 5361 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5362 | * Set the enabled setting for a package component (activity, receiver, service, provider). |
| 5363 | * This setting will override any enabled state which may have been set by the component in its |
| 5364 | * manifest. |
| 5365 | * |
| 5366 | * @param componentName The component to enable |
| 5367 | * @param newState The new enabled state for the component. The legal values for this state |
| 5368 | * are: |
| 5369 | * {@link #COMPONENT_ENABLED_STATE_ENABLED}, |
| 5370 | * {@link #COMPONENT_ENABLED_STATE_DISABLED} |
| 5371 | * and |
| 5372 | * {@link #COMPONENT_ENABLED_STATE_DEFAULT} |
| 5373 | * The last one removes the setting, thereby restoring the component's state to |
| 5374 | * whatever was set in it's manifest (or enabled, by default). |
| 5375 | * @param flags Optional behavior flags: {@link #DONT_KILL_APP} or 0. |
| 5376 | */ |
| 5377 | public abstract void setComponentEnabledSetting(ComponentName componentName, |
| 5378 | int newState, int flags); |
| 5379 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5380 | /** |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 5381 | * Return the enabled setting for a package component (activity, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5382 | * receiver, service, provider). This returns the last value set by |
| 5383 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}; in most |
| 5384 | * cases this value will be {@link #COMPONENT_ENABLED_STATE_DEFAULT} since |
| 5385 | * the value originally specified in the manifest has not been modified. |
| 5386 | * |
| 5387 | * @param componentName The component to retrieve. |
| 5388 | * @return Returns the current enabled state for the component. May |
| 5389 | * be one of {@link #COMPONENT_ENABLED_STATE_ENABLED}, |
| 5390 | * {@link #COMPONENT_ENABLED_STATE_DISABLED}, or |
| 5391 | * {@link #COMPONENT_ENABLED_STATE_DEFAULT}. The last one means the |
| 5392 | * component's enabled state is based on the original information in |
| 5393 | * the manifest as found in {@link ComponentInfo}. |
| 5394 | */ |
| 5395 | public abstract int getComponentEnabledSetting(ComponentName componentName); |
| 5396 | |
| 5397 | /** |
| 5398 | * Set the enabled setting for an application |
| 5399 | * This setting will override any enabled state which may have been set by the application in |
| 5400 | * its manifest. It also overrides the enabled state set in the manifest for any of the |
| 5401 | * application's components. It does not override any enabled state set by |
| 5402 | * {@link #setComponentEnabledSetting} for any of the application's components. |
| 5403 | * |
| 5404 | * @param packageName The package name of the application to enable |
| 5405 | * @param newState The new enabled state for the component. The legal values for this state |
| 5406 | * are: |
| 5407 | * {@link #COMPONENT_ENABLED_STATE_ENABLED}, |
| 5408 | * {@link #COMPONENT_ENABLED_STATE_DISABLED} |
| 5409 | * and |
| 5410 | * {@link #COMPONENT_ENABLED_STATE_DEFAULT} |
| 5411 | * The last one removes the setting, thereby restoring the applications's state to |
| 5412 | * whatever was set in its manifest (or enabled, by default). |
| 5413 | * @param flags Optional behavior flags: {@link #DONT_KILL_APP} or 0. |
| 5414 | */ |
| 5415 | public abstract void setApplicationEnabledSetting(String packageName, |
| 5416 | int newState, int flags); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5417 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5418 | /** |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 5419 | * Return the enabled setting for an application. This returns |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5420 | * the last value set by |
| 5421 | * {@link #setApplicationEnabledSetting(String, int, int)}; in most |
| 5422 | * cases this value will be {@link #COMPONENT_ENABLED_STATE_DEFAULT} since |
| 5423 | * the value originally specified in the manifest has not been modified. |
| 5424 | * |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 5425 | * @param packageName The package name of the application to retrieve. |
| 5426 | * @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] | 5427 | * be one of {@link #COMPONENT_ENABLED_STATE_ENABLED}, |
| 5428 | * {@link #COMPONENT_ENABLED_STATE_DISABLED}, or |
| 5429 | * {@link #COMPONENT_ENABLED_STATE_DEFAULT}. The last one means the |
| 5430 | * application's enabled state is based on the original information in |
Kevin Hufnagle | 5add769 | 2016-08-29 16:50:17 -0700 | [diff] [blame] | 5431 | * the manifest as found in {@link ApplicationInfo}. |
Mathew Inwood | 1b9f8d9 | 2011-09-26 13:23:56 +0100 | [diff] [blame] | 5432 | * @throws IllegalArgumentException if the named package does not exist. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5433 | */ |
| 5434 | public abstract int getApplicationEnabledSetting(String packageName); |
| 5435 | |
| 5436 | /** |
Sudheer Shanka | bbb3ff2 | 2015-07-09 15:39:23 +0100 | [diff] [blame] | 5437 | * Flush the package restrictions for a given user to disk. This forces the package restrictions |
| 5438 | * like component and package enabled settings to be written to disk and avoids the delay that |
| 5439 | * is otherwise present when changing those settings. |
| 5440 | * |
| 5441 | * @param userId Ther userId of the user whose restrictions are to be flushed. |
| 5442 | * @hide |
| 5443 | */ |
| 5444 | public abstract void flushPackageRestrictionsAsUser(int userId); |
| 5445 | |
| 5446 | /** |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5447 | * 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] | 5448 | * 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] | 5449 | * package file. Application can be unhidden by either resetting the hidden state |
| 5450 | * or by installing it, such as with {@link #installExistingPackage(String)} |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5451 | * @hide |
| 5452 | */ |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5453 | public abstract boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden, |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5454 | UserHandle userHandle); |
| 5455 | |
| 5456 | /** |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5457 | * Returns the hidden state of a package. |
| 5458 | * @see #setApplicationHiddenSettingAsUser(String, boolean, UserHandle) |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5459 | * @hide |
| 5460 | */ |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5461 | public abstract boolean getApplicationHiddenSettingAsUser(String packageName, |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5462 | UserHandle userHandle); |
| 5463 | |
| 5464 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5465 | * Return whether the device has been booted into safe mode. |
| 5466 | */ |
| 5467 | public abstract boolean isSafeMode(); |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 5468 | |
| 5469 | /** |
Svetoslav | f7c06eb | 2015-06-10 18:43:22 -0700 | [diff] [blame] | 5470 | * Adds a listener for permission changes for installed packages. |
| 5471 | * |
| 5472 | * @param listener The listener to add. |
| 5473 | * |
| 5474 | * @hide |
| 5475 | */ |
| 5476 | @SystemApi |
| 5477 | @RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS) |
| 5478 | public abstract void addOnPermissionsChangeListener(OnPermissionsChangedListener listener); |
| 5479 | |
| 5480 | /** |
| 5481 | * Remvoes a listener for permission changes for installed packages. |
| 5482 | * |
| 5483 | * @param listener The listener to remove. |
| 5484 | * |
| 5485 | * @hide |
| 5486 | */ |
| 5487 | @SystemApi |
| 5488 | public abstract void removeOnPermissionsChangeListener(OnPermissionsChangedListener listener); |
| 5489 | |
| 5490 | /** |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5491 | * Return the {@link KeySet} associated with the String alias for this |
| 5492 | * application. |
| 5493 | * |
| 5494 | * @param alias The alias for a given {@link KeySet} as defined in the |
| 5495 | * application's AndroidManifest.xml. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5496 | * @hide |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5497 | */ |
| 5498 | public abstract KeySet getKeySetByAlias(String packageName, String alias); |
| 5499 | |
Ihab Awad | 1ec6888 | 2014-09-12 11:09:01 -0700 | [diff] [blame] | 5500 | /** Return the signing {@link KeySet} for this application. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5501 | * @hide |
| 5502 | */ |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5503 | public abstract KeySet getSigningKeySet(String packageName); |
| 5504 | |
| 5505 | /** |
| 5506 | * Return whether the package denoted by packageName has been signed by all |
| 5507 | * of the keys specified by the {@link KeySet} ks. This will return true if |
| 5508 | * the package has been signed by additional keys (a superset) as well. |
| 5509 | * Compare to {@link #isSignedByExactly(String packageName, KeySet ks)}. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5510 | * @hide |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5511 | */ |
| 5512 | public abstract boolean isSignedBy(String packageName, KeySet ks); |
| 5513 | |
| 5514 | /** |
| 5515 | * Return whether the package denoted by packageName has been signed by all |
| 5516 | * of, and only, the keys specified by the {@link KeySet} ks. Compare to |
| 5517 | * {@link #isSignedBy(String packageName, KeySet ks)}. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5518 | * @hide |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5519 | */ |
| 5520 | public abstract boolean isSignedByExactly(String packageName, KeySet ks); |
| 5521 | |
| 5522 | /** |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5523 | * 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] | 5524 | * |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5525 | * <p>It doesn't remove the data or the actual package file. The application notifications |
| 5526 | * will be hidden, the application will not show up in recents, will not be able to show |
| 5527 | * toasts or dialogs or ring the device. |
| 5528 | * |
Kenny Guy | 871f3eb | 2016-03-09 20:06:16 +0000 | [diff] [blame] | 5529 | * <p>The package must already be installed. If the package is uninstalled while suspended |
| 5530 | * the package will no longer be suspended. |
| 5531 | * |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5532 | * @param packageNames The names of the packages to set the suspended status. |
| 5533 | * @param suspended If set to {@code true} than the packages will be suspended, if set to |
| 5534 | * {@code false} the packages will be unsuspended. |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5535 | * @param userId The user id. |
| 5536 | * |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5537 | * @return an array of package names for which the suspended status is not set as requested in |
| 5538 | * this method. |
| 5539 | * |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5540 | * @hide |
| 5541 | */ |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5542 | public abstract String[] setPackagesSuspendedAsUser( |
| 5543 | String[] packageNames, boolean suspended, @UserIdInt int userId); |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5544 | |
Andrei Stingaceanu | 355b232 | 2016-02-12 16:43:51 +0000 | [diff] [blame] | 5545 | /** |
| 5546 | * @see #setPackageSuspendedAsUser(String, boolean, int) |
| 5547 | * @param packageName The name of the package to get the suspended status of. |
| 5548 | * @param userId The user id. |
| 5549 | * @return {@code true} if the package is suspended or {@code false} if the package is not |
| 5550 | * suspended or could not be found. |
| 5551 | * @hide |
| 5552 | */ |
| 5553 | public abstract boolean isPackageSuspendedForUser(String packageName, int userId); |
| 5554 | |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 5555 | /** {@hide} */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5556 | public static boolean isMoveStatusFinished(int status) { |
| 5557 | return (status < 0 || status > 100); |
| 5558 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5559 | |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 5560 | /** {@hide} */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5561 | public static abstract class MoveCallback { |
Jeff Sharkey | 50a0545 | 2015-04-29 11:24:52 -0700 | [diff] [blame] | 5562 | public void onCreated(int moveId, Bundle extras) {} |
| 5563 | public abstract void onStatusChanged(int moveId, int status, long estMillis); |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5564 | } |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 5565 | |
| 5566 | /** {@hide} */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5567 | public abstract int getMoveStatus(int moveId); |
| 5568 | |
| 5569 | /** {@hide} */ |
| 5570 | public abstract void registerMoveCallback(MoveCallback callback, Handler handler); |
| 5571 | /** {@hide} */ |
| 5572 | public abstract void unregisterMoveCallback(MoveCallback callback); |
| 5573 | |
| 5574 | /** {@hide} */ |
| 5575 | public abstract int movePackage(String packageName, VolumeInfo vol); |
| 5576 | /** {@hide} */ |
| 5577 | public abstract @Nullable VolumeInfo getPackageCurrentVolume(ApplicationInfo app); |
| 5578 | /** {@hide} */ |
| 5579 | public abstract @NonNull List<VolumeInfo> getPackageCandidateVolumes(ApplicationInfo app); |
| 5580 | |
| 5581 | /** {@hide} */ |
| 5582 | public abstract int movePrimaryStorage(VolumeInfo vol); |
| 5583 | /** {@hide} */ |
| 5584 | public abstract @Nullable VolumeInfo getPrimaryStorageCurrentVolume(); |
| 5585 | /** {@hide} */ |
| 5586 | public abstract @NonNull List<VolumeInfo> getPrimaryStorageCandidateVolumes(); |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 5587 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5588 | /** |
Amith Yamasani | 1359360 | 2012-03-22 16:16:17 -0700 | [diff] [blame] | 5589 | * Returns the device identity that verifiers can use to associate their scheme to a particular |
| 5590 | * 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] | 5591 | * |
Kenny Root | 0aaa0d9 | 2011-09-12 16:42:55 -0700 | [diff] [blame] | 5592 | * @return identity that uniquely identifies current device |
| 5593 | * @hide |
| 5594 | */ |
| 5595 | public abstract VerifierDeviceIdentity getVerifierDeviceIdentity(); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 5596 | |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5597 | /** |
Jeff Hao | 9f60c08 | 2014-10-28 18:51:07 -0700 | [diff] [blame] | 5598 | * Returns true if the device is upgrading, such as first boot after OTA. |
| 5599 | * |
| 5600 | * @hide |
| 5601 | */ |
| 5602 | public abstract boolean isUpgrade(); |
| 5603 | |
| 5604 | /** |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5605 | * Return interface that offers the ability to install, upgrade, and remove |
| 5606 | * applications on the device. |
| 5607 | */ |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5608 | public abstract @NonNull PackageInstaller getPackageInstaller(); |
Jeff Sharkey | 3a44f3f | 2014-04-28 17:36:31 -0700 | [diff] [blame] | 5609 | |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 5610 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5611 | * Adds a {@code CrossProfileIntentFilter}. After calling this method all |
| 5612 | * intents sent from the user with id sourceUserId can also be be resolved |
| 5613 | * by activities in the user with id targetUserId if they match the |
| 5614 | * specified intent filter. |
| 5615 | * |
Nicolas Prevot | 3f7777f | 2014-07-24 15:58:39 +0100 | [diff] [blame] | 5616 | * @param filter The {@link IntentFilter} the intent has to match |
| 5617 | * @param sourceUserId The source user id. |
| 5618 | * @param targetUserId The target user id. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5619 | * @param flags The possible values are {@link #SKIP_CURRENT_PROFILE} and |
| 5620 | * {@link #ONLY_IF_NO_MATCH_FOUND}. |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 5621 | * @hide |
| 5622 | */ |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 5623 | public abstract void addCrossProfileIntentFilter(IntentFilter filter, int sourceUserId, |
| 5624 | int targetUserId, int flags); |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 5625 | |
| 5626 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5627 | * Clearing {@code CrossProfileIntentFilter}s which have the specified user |
| 5628 | * as their source, and have been set by the app calling this method. |
| 5629 | * |
Nicolas Prevot | 3f7777f | 2014-07-24 15:58:39 +0100 | [diff] [blame] | 5630 | * @param sourceUserId The source user id. |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 5631 | * @hide |
| 5632 | */ |
Nicolas Prevot | 8194899 | 2014-05-16 18:25:26 +0100 | [diff] [blame] | 5633 | public abstract void clearCrossProfileIntentFilters(int sourceUserId); |
Alexandra Gherghina | 6e2ae25 | 2014-06-12 16:03:58 +0100 | [diff] [blame] | 5634 | |
| 5635 | /** |
Nicolas Prevot | 88cc346 | 2014-05-14 14:51:48 +0100 | [diff] [blame] | 5636 | * @hide |
| 5637 | */ |
Nicolas Prevot | 7f7b0c7 | 2014-06-23 15:59:38 +0100 | [diff] [blame] | 5638 | public abstract Drawable loadItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo); |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5639 | |
Benjamin Franz | ec2d48b | 2014-10-01 15:38:43 +0100 | [diff] [blame] | 5640 | /** |
| 5641 | * @hide |
| 5642 | */ |
| 5643 | public abstract Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo); |
| 5644 | |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5645 | /** {@hide} */ |
| 5646 | public abstract boolean isPackageAvailable(String packageName); |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5647 | |
| 5648 | /** {@hide} */ |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5649 | public static String installStatusToString(int status, String msg) { |
| 5650 | final String str = installStatusToString(status); |
| 5651 | if (msg != null) { |
| 5652 | return str + ": " + msg; |
| 5653 | } else { |
| 5654 | return str; |
| 5655 | } |
| 5656 | } |
| 5657 | |
| 5658 | /** {@hide} */ |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5659 | public static String installStatusToString(int status) { |
| 5660 | switch (status) { |
| 5661 | case INSTALL_SUCCEEDED: return "INSTALL_SUCCEEDED"; |
| 5662 | case INSTALL_FAILED_ALREADY_EXISTS: return "INSTALL_FAILED_ALREADY_EXISTS"; |
| 5663 | case INSTALL_FAILED_INVALID_APK: return "INSTALL_FAILED_INVALID_APK"; |
| 5664 | case INSTALL_FAILED_INVALID_URI: return "INSTALL_FAILED_INVALID_URI"; |
| 5665 | case INSTALL_FAILED_INSUFFICIENT_STORAGE: return "INSTALL_FAILED_INSUFFICIENT_STORAGE"; |
| 5666 | case INSTALL_FAILED_DUPLICATE_PACKAGE: return "INSTALL_FAILED_DUPLICATE_PACKAGE"; |
| 5667 | case INSTALL_FAILED_NO_SHARED_USER: return "INSTALL_FAILED_NO_SHARED_USER"; |
| 5668 | case INSTALL_FAILED_UPDATE_INCOMPATIBLE: return "INSTALL_FAILED_UPDATE_INCOMPATIBLE"; |
| 5669 | case INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: return "INSTALL_FAILED_SHARED_USER_INCOMPATIBLE"; |
| 5670 | case INSTALL_FAILED_MISSING_SHARED_LIBRARY: return "INSTALL_FAILED_MISSING_SHARED_LIBRARY"; |
| 5671 | case INSTALL_FAILED_REPLACE_COULDNT_DELETE: return "INSTALL_FAILED_REPLACE_COULDNT_DELETE"; |
| 5672 | case INSTALL_FAILED_DEXOPT: return "INSTALL_FAILED_DEXOPT"; |
| 5673 | case INSTALL_FAILED_OLDER_SDK: return "INSTALL_FAILED_OLDER_SDK"; |
| 5674 | case INSTALL_FAILED_CONFLICTING_PROVIDER: return "INSTALL_FAILED_CONFLICTING_PROVIDER"; |
| 5675 | case INSTALL_FAILED_NEWER_SDK: return "INSTALL_FAILED_NEWER_SDK"; |
| 5676 | case INSTALL_FAILED_TEST_ONLY: return "INSTALL_FAILED_TEST_ONLY"; |
| 5677 | case INSTALL_FAILED_CPU_ABI_INCOMPATIBLE: return "INSTALL_FAILED_CPU_ABI_INCOMPATIBLE"; |
| 5678 | case INSTALL_FAILED_MISSING_FEATURE: return "INSTALL_FAILED_MISSING_FEATURE"; |
| 5679 | case INSTALL_FAILED_CONTAINER_ERROR: return "INSTALL_FAILED_CONTAINER_ERROR"; |
| 5680 | case INSTALL_FAILED_INVALID_INSTALL_LOCATION: return "INSTALL_FAILED_INVALID_INSTALL_LOCATION"; |
| 5681 | case INSTALL_FAILED_MEDIA_UNAVAILABLE: return "INSTALL_FAILED_MEDIA_UNAVAILABLE"; |
| 5682 | case INSTALL_FAILED_VERIFICATION_TIMEOUT: return "INSTALL_FAILED_VERIFICATION_TIMEOUT"; |
| 5683 | case INSTALL_FAILED_VERIFICATION_FAILURE: return "INSTALL_FAILED_VERIFICATION_FAILURE"; |
| 5684 | case INSTALL_FAILED_PACKAGE_CHANGED: return "INSTALL_FAILED_PACKAGE_CHANGED"; |
| 5685 | case INSTALL_FAILED_UID_CHANGED: return "INSTALL_FAILED_UID_CHANGED"; |
| 5686 | case INSTALL_FAILED_VERSION_DOWNGRADE: return "INSTALL_FAILED_VERSION_DOWNGRADE"; |
| 5687 | case INSTALL_PARSE_FAILED_NOT_APK: return "INSTALL_PARSE_FAILED_NOT_APK"; |
| 5688 | case INSTALL_PARSE_FAILED_BAD_MANIFEST: return "INSTALL_PARSE_FAILED_BAD_MANIFEST"; |
| 5689 | case INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: return "INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION"; |
| 5690 | case INSTALL_PARSE_FAILED_NO_CERTIFICATES: return "INSTALL_PARSE_FAILED_NO_CERTIFICATES"; |
| 5691 | case INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES: return "INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES"; |
| 5692 | case INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING: return "INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING"; |
| 5693 | case INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME: return "INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME"; |
| 5694 | case INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID: return "INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID"; |
| 5695 | case INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: return "INSTALL_PARSE_FAILED_MANIFEST_MALFORMED"; |
| 5696 | case INSTALL_PARSE_FAILED_MANIFEST_EMPTY: return "INSTALL_PARSE_FAILED_MANIFEST_EMPTY"; |
| 5697 | case INSTALL_FAILED_INTERNAL_ERROR: return "INSTALL_FAILED_INTERNAL_ERROR"; |
| 5698 | case INSTALL_FAILED_USER_RESTRICTED: return "INSTALL_FAILED_USER_RESTRICTED"; |
| 5699 | case INSTALL_FAILED_DUPLICATE_PERMISSION: return "INSTALL_FAILED_DUPLICATE_PERMISSION"; |
| 5700 | case INSTALL_FAILED_NO_MATCHING_ABIS: return "INSTALL_FAILED_NO_MATCHING_ABIS"; |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5701 | case INSTALL_FAILED_ABORTED: return "INSTALL_FAILED_ABORTED"; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5702 | default: return Integer.toString(status); |
| 5703 | } |
| 5704 | } |
| 5705 | |
| 5706 | /** {@hide} */ |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5707 | public static int installStatusToPublicStatus(int status) { |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5708 | switch (status) { |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5709 | case INSTALL_SUCCEEDED: return PackageInstaller.STATUS_SUCCESS; |
| 5710 | case INSTALL_FAILED_ALREADY_EXISTS: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5711 | case INSTALL_FAILED_INVALID_APK: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5712 | case INSTALL_FAILED_INVALID_URI: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5713 | case INSTALL_FAILED_INSUFFICIENT_STORAGE: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5714 | case INSTALL_FAILED_DUPLICATE_PACKAGE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5715 | case INSTALL_FAILED_NO_SHARED_USER: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5716 | case INSTALL_FAILED_UPDATE_INCOMPATIBLE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5717 | case INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5718 | case INSTALL_FAILED_MISSING_SHARED_LIBRARY: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5719 | case INSTALL_FAILED_REPLACE_COULDNT_DELETE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5720 | case INSTALL_FAILED_DEXOPT: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5721 | case INSTALL_FAILED_OLDER_SDK: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5722 | case INSTALL_FAILED_CONFLICTING_PROVIDER: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5723 | case INSTALL_FAILED_NEWER_SDK: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5724 | case INSTALL_FAILED_TEST_ONLY: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5725 | case INSTALL_FAILED_CPU_ABI_INCOMPATIBLE: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5726 | case INSTALL_FAILED_MISSING_FEATURE: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5727 | case INSTALL_FAILED_CONTAINER_ERROR: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5728 | case INSTALL_FAILED_INVALID_INSTALL_LOCATION: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5729 | case INSTALL_FAILED_MEDIA_UNAVAILABLE: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5730 | case INSTALL_FAILED_VERIFICATION_TIMEOUT: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5731 | case INSTALL_FAILED_VERIFICATION_FAILURE: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5732 | case INSTALL_FAILED_PACKAGE_CHANGED: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5733 | case INSTALL_FAILED_UID_CHANGED: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5734 | case INSTALL_FAILED_VERSION_DOWNGRADE: return PackageInstaller.STATUS_FAILURE_INVALID; |
Svetoslav | d965370 | 2015-05-13 18:02:46 -0700 | [diff] [blame] | 5735 | case INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE: return PackageInstaller.STATUS_FAILURE_INVALID; |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5736 | case INSTALL_PARSE_FAILED_NOT_APK: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5737 | case INSTALL_PARSE_FAILED_BAD_MANIFEST: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5738 | case INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5739 | case INSTALL_PARSE_FAILED_NO_CERTIFICATES: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5740 | case INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5741 | case INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5742 | case INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5743 | case INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5744 | case INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5745 | case INSTALL_PARSE_FAILED_MANIFEST_EMPTY: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5746 | case INSTALL_FAILED_INTERNAL_ERROR: return PackageInstaller.STATUS_FAILURE; |
| 5747 | case INSTALL_FAILED_USER_RESTRICTED: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5748 | case INSTALL_FAILED_DUPLICATE_PERMISSION: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5749 | case INSTALL_FAILED_NO_MATCHING_ABIS: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5750 | case INSTALL_FAILED_ABORTED: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5751 | default: return PackageInstaller.STATUS_FAILURE; |
| 5752 | } |
| 5753 | } |
| 5754 | |
| 5755 | /** {@hide} */ |
| 5756 | public static String deleteStatusToString(int status, String msg) { |
| 5757 | final String str = deleteStatusToString(status); |
| 5758 | if (msg != null) { |
| 5759 | return str + ": " + msg; |
| 5760 | } else { |
| 5761 | return str; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5762 | } |
| 5763 | } |
| 5764 | |
| 5765 | /** {@hide} */ |
| 5766 | public static String deleteStatusToString(int status) { |
| 5767 | switch (status) { |
| 5768 | case DELETE_SUCCEEDED: return "DELETE_SUCCEEDED"; |
| 5769 | case DELETE_FAILED_INTERNAL_ERROR: return "DELETE_FAILED_INTERNAL_ERROR"; |
| 5770 | case DELETE_FAILED_DEVICE_POLICY_MANAGER: return "DELETE_FAILED_DEVICE_POLICY_MANAGER"; |
| 5771 | case DELETE_FAILED_USER_RESTRICTED: return "DELETE_FAILED_USER_RESTRICTED"; |
| 5772 | case DELETE_FAILED_OWNER_BLOCKED: return "DELETE_FAILED_OWNER_BLOCKED"; |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5773 | case DELETE_FAILED_ABORTED: return "DELETE_FAILED_ABORTED"; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5774 | default: return Integer.toString(status); |
| 5775 | } |
| 5776 | } |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5777 | |
| 5778 | /** {@hide} */ |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5779 | public static int deleteStatusToPublicStatus(int status) { |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5780 | switch (status) { |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5781 | case DELETE_SUCCEEDED: return PackageInstaller.STATUS_SUCCESS; |
| 5782 | case DELETE_FAILED_INTERNAL_ERROR: return PackageInstaller.STATUS_FAILURE; |
| 5783 | case DELETE_FAILED_DEVICE_POLICY_MANAGER: return PackageInstaller.STATUS_FAILURE_BLOCKED; |
| 5784 | case DELETE_FAILED_USER_RESTRICTED: return PackageInstaller.STATUS_FAILURE_BLOCKED; |
| 5785 | case DELETE_FAILED_OWNER_BLOCKED: return PackageInstaller.STATUS_FAILURE_BLOCKED; |
| 5786 | case DELETE_FAILED_ABORTED: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5787 | default: return PackageInstaller.STATUS_FAILURE; |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5788 | } |
| 5789 | } |
Jeff Sharkey | 6c0b9da | 2014-08-07 22:07:11 -0700 | [diff] [blame] | 5790 | |
| 5791 | /** {@hide} */ |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 5792 | public static String permissionFlagToString(int flag) { |
| 5793 | switch (flag) { |
Svetoslav | 4a5f4a2 | 2015-07-07 18:18:15 -0700 | [diff] [blame] | 5794 | case FLAG_PERMISSION_GRANTED_BY_DEFAULT: return "GRANTED_BY_DEFAULT"; |
| 5795 | case FLAG_PERMISSION_POLICY_FIXED: return "POLICY_FIXED"; |
| 5796 | case FLAG_PERMISSION_SYSTEM_FIXED: return "SYSTEM_FIXED"; |
| 5797 | case FLAG_PERMISSION_USER_SET: return "USER_SET"; |
| 5798 | case FLAG_PERMISSION_REVOKE_ON_UPGRADE: return "REVOKE_ON_UPGRADE"; |
| 5799 | case FLAG_PERMISSION_USER_FIXED: return "USER_FIXED"; |
Svet Ganov | 9c165d7 | 2015-12-01 19:52:26 -0800 | [diff] [blame] | 5800 | case FLAG_PERMISSION_REVIEW_REQUIRED: return "REVIEW_REQUIRED"; |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 5801 | default: return Integer.toString(flag); |
| 5802 | } |
| 5803 | } |
| 5804 | |
| 5805 | /** {@hide} */ |
Jeff Sharkey | 6c0b9da | 2014-08-07 22:07:11 -0700 | [diff] [blame] | 5806 | public static class LegacyPackageInstallObserver extends PackageInstallObserver { |
| 5807 | private final IPackageInstallObserver mLegacy; |
| 5808 | |
| 5809 | public LegacyPackageInstallObserver(IPackageInstallObserver legacy) { |
| 5810 | mLegacy = legacy; |
| 5811 | } |
| 5812 | |
| 5813 | @Override |
| 5814 | public void onPackageInstalled(String basePackageName, int returnCode, String msg, |
| 5815 | Bundle extras) { |
| 5816 | if (mLegacy == null) return; |
| 5817 | try { |
| 5818 | mLegacy.packageInstalled(basePackageName, returnCode); |
| 5819 | } catch (RemoteException ignored) { |
| 5820 | } |
| 5821 | } |
| 5822 | } |
| 5823 | |
| 5824 | /** {@hide} */ |
| 5825 | public static class LegacyPackageDeleteObserver extends PackageDeleteObserver { |
| 5826 | private final IPackageDeleteObserver mLegacy; |
| 5827 | |
| 5828 | public LegacyPackageDeleteObserver(IPackageDeleteObserver legacy) { |
| 5829 | mLegacy = legacy; |
| 5830 | } |
| 5831 | |
| 5832 | @Override |
| 5833 | public void onPackageDeleted(String basePackageName, int returnCode, String msg) { |
| 5834 | if (mLegacy == null) return; |
| 5835 | try { |
| 5836 | mLegacy.packageDeleted(basePackageName, returnCode); |
| 5837 | } catch (RemoteException ignored) { |
| 5838 | } |
| 5839 | } |
| 5840 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5841 | } |