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 | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 51 | import android.os.storage.VolumeInfo; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 52 | import android.util.AndroidException; |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 53 | import android.util.Log; |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 54 | |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 55 | import com.android.internal.util.ArrayUtils; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 56 | |
| 57 | import java.io.File; |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 58 | import java.lang.annotation.Retention; |
| 59 | import java.lang.annotation.RetentionPolicy; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 60 | import java.util.List; |
| 61 | |
| 62 | /** |
| 63 | * Class for retrieving various kinds of information related to the application |
| 64 | * packages that are currently installed on the device. |
| 65 | * |
| 66 | * You can find this class through {@link Context#getPackageManager}. |
| 67 | */ |
| 68 | public abstract class PackageManager { |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 69 | private static final String TAG = "PackageManager"; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 70 | |
Jeff Sharkey | e469713 | 2016-02-06 19:46:15 -0700 | [diff] [blame] | 71 | /** {@hide} */ |
| 72 | public static final boolean APPLY_FORCE_DEVICE_ENCRYPTED = true; |
| 73 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 74 | /** |
| 75 | * This exception is thrown when a given package, application, or component |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 76 | * name cannot be found. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 77 | */ |
| 78 | public static class NameNotFoundException extends AndroidException { |
| 79 | public NameNotFoundException() { |
| 80 | } |
| 81 | |
| 82 | public NameNotFoundException(String name) { |
| 83 | super(name); |
| 84 | } |
| 85 | } |
| 86 | |
| 87 | /** |
Svetoslav | f7c06eb | 2015-06-10 18:43:22 -0700 | [diff] [blame] | 88 | * Listener for changes in permissions granted to a UID. |
| 89 | * |
| 90 | * @hide |
| 91 | */ |
| 92 | @SystemApi |
| 93 | public interface OnPermissionsChangedListener { |
| 94 | |
| 95 | /** |
| 96 | * Called when the permissions for a UID change. |
| 97 | * @param uid The UID with a change. |
| 98 | */ |
| 99 | public void onPermissionsChanged(int uid); |
| 100 | } |
| 101 | |
| 102 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 103 | * As a guiding principle: |
| 104 | * <p> |
| 105 | * {@code GET_} flags are used to request additional data that may have been |
| 106 | * elided to save wire space. |
| 107 | * <p> |
| 108 | * {@code MATCH_} flags are used to include components or packages that |
| 109 | * would have otherwise been omitted from a result set by current system |
| 110 | * state. |
| 111 | */ |
| 112 | |
| 113 | /** @hide */ |
| 114 | @IntDef(flag = true, value = { |
| 115 | GET_ACTIVITIES, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 116 | GET_CONFIGURATIONS, |
| 117 | GET_GIDS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 118 | GET_INSTRUMENTATION, |
| 119 | GET_INTENT_FILTERS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 120 | GET_META_DATA, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 121 | GET_PERMISSIONS, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 122 | GET_PROVIDERS, |
| 123 | GET_RECEIVERS, |
| 124 | GET_SERVICES, |
| 125 | GET_SHARED_LIBRARY_FILES, |
| 126 | GET_SIGNATURES, |
| 127 | GET_URI_PERMISSION_PATTERNS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 128 | MATCH_UNINSTALLED_PACKAGES, |
| 129 | MATCH_DISABLED_COMPONENTS, |
| 130 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
Jeff Sharkey | c5967e9 | 2016-01-07 18:50:29 -0700 | [diff] [blame] | 131 | MATCH_SYSTEM_ONLY, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 132 | MATCH_DEBUG_TRIAGED_MISSING, |
| 133 | }) |
| 134 | @Retention(RetentionPolicy.SOURCE) |
| 135 | public @interface PackageInfoFlags {} |
| 136 | |
| 137 | /** @hide */ |
| 138 | @IntDef(flag = true, value = { |
| 139 | GET_META_DATA, |
| 140 | GET_SHARED_LIBRARY_FILES, |
| 141 | MATCH_UNINSTALLED_PACKAGES, |
| 142 | MATCH_SYSTEM_ONLY, |
| 143 | MATCH_DEBUG_TRIAGED_MISSING, |
| 144 | }) |
| 145 | @Retention(RetentionPolicy.SOURCE) |
| 146 | public @interface ApplicationInfoFlags {} |
| 147 | |
| 148 | /** @hide */ |
| 149 | @IntDef(flag = true, value = { |
| 150 | GET_META_DATA, |
| 151 | GET_SHARED_LIBRARY_FILES, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 152 | MATCH_ALL, |
| 153 | MATCH_DEBUG_TRIAGED_MISSING, |
| 154 | MATCH_DEFAULT_ONLY, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 155 | MATCH_DISABLED_COMPONENTS, |
| 156 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 157 | MATCH_ENCRYPTION_AWARE, |
| 158 | MATCH_ENCRYPTION_AWARE_AND_UNAWARE, |
| 159 | MATCH_ENCRYPTION_UNAWARE, |
| 160 | MATCH_SYSTEM_ONLY, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 161 | MATCH_UNINSTALLED_PACKAGES, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 162 | }) |
| 163 | @Retention(RetentionPolicy.SOURCE) |
| 164 | public @interface ComponentInfoFlags {} |
| 165 | |
| 166 | /** @hide */ |
| 167 | @IntDef(flag = true, value = { |
| 168 | GET_META_DATA, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 169 | GET_RESOLVED_FILTER, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 170 | GET_SHARED_LIBRARY_FILES, |
| 171 | MATCH_ALL, |
| 172 | MATCH_DEBUG_TRIAGED_MISSING, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 173 | MATCH_DISABLED_COMPONENTS, |
| 174 | MATCH_DISABLED_UNTIL_USED_COMPONENTS, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 175 | MATCH_DEFAULT_ONLY, |
| 176 | MATCH_ENCRYPTION_AWARE, |
| 177 | MATCH_ENCRYPTION_AWARE_AND_UNAWARE, |
| 178 | MATCH_ENCRYPTION_UNAWARE, |
| 179 | MATCH_SYSTEM_ONLY, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 180 | MATCH_UNINSTALLED_PACKAGES, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 181 | }) |
| 182 | @Retention(RetentionPolicy.SOURCE) |
| 183 | public @interface ResolveInfoFlags {} |
| 184 | |
| 185 | /** @hide */ |
| 186 | @IntDef(flag = true, value = { |
| 187 | GET_META_DATA, |
| 188 | }) |
| 189 | @Retention(RetentionPolicy.SOURCE) |
| 190 | public @interface PermissionInfoFlags {} |
| 191 | |
| 192 | /** @hide */ |
| 193 | @IntDef(flag = true, value = { |
| 194 | GET_META_DATA, |
| 195 | }) |
| 196 | @Retention(RetentionPolicy.SOURCE) |
| 197 | public @interface PermissionGroupInfoFlags {} |
| 198 | |
| 199 | /** @hide */ |
| 200 | @IntDef(flag = true, value = { |
| 201 | GET_META_DATA, |
| 202 | }) |
| 203 | @Retention(RetentionPolicy.SOURCE) |
| 204 | public @interface InstrumentationInfoFlags {} |
| 205 | |
| 206 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 207 | * {@link PackageInfo} flag: return information about |
| 208 | * activities in the package in {@link PackageInfo#activities}. |
| 209 | */ |
| 210 | public static final int GET_ACTIVITIES = 0x00000001; |
| 211 | |
| 212 | /** |
| 213 | * {@link PackageInfo} flag: return information about |
| 214 | * intent receivers in the package in |
| 215 | * {@link PackageInfo#receivers}. |
| 216 | */ |
| 217 | public static final int GET_RECEIVERS = 0x00000002; |
| 218 | |
| 219 | /** |
| 220 | * {@link PackageInfo} flag: return information about |
| 221 | * services in the package in {@link PackageInfo#services}. |
| 222 | */ |
| 223 | public static final int GET_SERVICES = 0x00000004; |
| 224 | |
| 225 | /** |
| 226 | * {@link PackageInfo} flag: return information about |
| 227 | * content providers in the package in |
| 228 | * {@link PackageInfo#providers}. |
| 229 | */ |
| 230 | public static final int GET_PROVIDERS = 0x00000008; |
| 231 | |
| 232 | /** |
| 233 | * {@link PackageInfo} flag: return information about |
| 234 | * instrumentation in the package in |
| 235 | * {@link PackageInfo#instrumentation}. |
| 236 | */ |
| 237 | public static final int GET_INSTRUMENTATION = 0x00000010; |
| 238 | |
| 239 | /** |
| 240 | * {@link PackageInfo} flag: return information about the |
| 241 | * intent filters supported by the activity. |
| 242 | */ |
| 243 | public static final int GET_INTENT_FILTERS = 0x00000020; |
| 244 | |
| 245 | /** |
| 246 | * {@link PackageInfo} flag: return information about the |
| 247 | * signatures included in the package. |
| 248 | */ |
| 249 | public static final int GET_SIGNATURES = 0x00000040; |
| 250 | |
| 251 | /** |
| 252 | * {@link ResolveInfo} flag: return the IntentFilter that |
| 253 | * was matched for a particular ResolveInfo in |
| 254 | * {@link ResolveInfo#filter}. |
| 255 | */ |
| 256 | public static final int GET_RESOLVED_FILTER = 0x00000040; |
| 257 | |
| 258 | /** |
| 259 | * {@link ComponentInfo} flag: return the {@link ComponentInfo#metaData} |
| 260 | * data {@link android.os.Bundle}s that are associated with a component. |
| 261 | * This applies for any API returning a ComponentInfo subclass. |
| 262 | */ |
| 263 | public static final int GET_META_DATA = 0x00000080; |
| 264 | |
| 265 | /** |
| 266 | * {@link PackageInfo} flag: return the |
| 267 | * {@link PackageInfo#gids group ids} that are associated with an |
| 268 | * application. |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 269 | * 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] | 270 | * directly or nested inside of another. |
| 271 | */ |
| 272 | public static final int GET_GIDS = 0x00000100; |
| 273 | |
| 274 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 275 | * @deprecated replaced with {@link #MATCH_DISABLED_COMPONENTS} |
| 276 | */ |
| 277 | @Deprecated |
| 278 | public static final int GET_DISABLED_COMPONENTS = 0x00000200; |
| 279 | |
| 280 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 281 | * {@link PackageInfo} flag: include disabled components in the returned info. |
| 282 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 283 | public static final int MATCH_DISABLED_COMPONENTS = 0x00000200; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 284 | |
| 285 | /** |
| 286 | * {@link ApplicationInfo} flag: return the |
| 287 | * {@link ApplicationInfo#sharedLibraryFiles paths to the shared libraries} |
| 288 | * that are associated with an application. |
| 289 | * This applies for any API returning an ApplicationInfo class, either |
| 290 | * directly or nested inside of another. |
| 291 | */ |
| 292 | public static final int GET_SHARED_LIBRARY_FILES = 0x00000400; |
| 293 | |
| 294 | /** |
| 295 | * {@link ProviderInfo} flag: return the |
| 296 | * {@link ProviderInfo#uriPermissionPatterns URI permission patterns} |
| 297 | * that are associated with a content provider. |
Ken Wakasa | f76a50c | 2012-03-09 19:56:35 +0900 | [diff] [blame] | 298 | * 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] | 299 | * directly or nested inside of another. |
| 300 | */ |
| 301 | public static final int GET_URI_PERMISSION_PATTERNS = 0x00000800; |
| 302 | /** |
| 303 | * {@link PackageInfo} flag: return information about |
| 304 | * permissions in the package in |
| 305 | * {@link PackageInfo#permissions}. |
| 306 | */ |
| 307 | public static final int GET_PERMISSIONS = 0x00001000; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 308 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 309 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 310 | * @deprecated replaced with {@link #MATCH_UNINSTALLED_PACKAGES} |
| 311 | */ |
| 312 | @Deprecated |
| 313 | public static final int GET_UNINSTALLED_PACKAGES = 0x00002000; |
| 314 | |
| 315 | /** |
Kenny Root | 685f490 | 2011-11-03 10:13:29 -0700 | [diff] [blame] | 316 | * Flag parameter to retrieve some information about all applications (even |
| 317 | * uninstalled ones) which have data directories. This state could have |
| 318 | * resulted if applications have been deleted with flag |
| 319 | * {@code DONT_DELETE_DATA} with a possibility of being replaced or |
| 320 | * reinstalled in future. |
| 321 | * <p> |
| 322 | * Note: this flag may cause less information about currently installed |
| 323 | * applications to be returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 324 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 325 | public static final int MATCH_UNINSTALLED_PACKAGES = 0x00002000; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 326 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 327 | /** |
| 328 | * {@link PackageInfo} flag: return information about |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 329 | * hardware preferences in |
Adam Lesinski | d3edfde | 2014-08-08 17:32:44 -0700 | [diff] [blame] | 330 | * {@link PackageInfo#configPreferences PackageInfo.configPreferences}, |
| 331 | * and requested features in {@link PackageInfo#reqFeatures} and |
| 332 | * {@link PackageInfo#featureGroups}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 333 | */ |
| 334 | public static final int GET_CONFIGURATIONS = 0x00004000; |
| 335 | |
| 336 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 337 | * @deprecated replaced with {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}. |
| 338 | */ |
| 339 | @Deprecated |
| 340 | public static final int GET_DISABLED_UNTIL_USED_COMPONENTS = 0x00008000; |
| 341 | |
| 342 | /** |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 343 | * {@link PackageInfo} flag: include disabled components which are in |
| 344 | * that state only because of {@link #COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED} |
| 345 | * in the returned info. Note that if you set this flag, applications |
| 346 | * that are in this disabled state will be reported as enabled. |
| 347 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 348 | public static final int MATCH_DISABLED_UNTIL_USED_COMPONENTS = 0x00008000; |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 349 | |
| 350 | /** |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 351 | * Resolution and querying flag: if set, only filters that support the |
| 352 | * {@link android.content.Intent#CATEGORY_DEFAULT} will be considered for |
| 353 | * matching. This is a synonym for including the CATEGORY_DEFAULT in your |
| 354 | * supplied Intent. |
| 355 | */ |
Fabrice Di Meglio | 9f7e39f | 2015-04-10 20:40:16 -0700 | [diff] [blame] | 356 | public static final int MATCH_DEFAULT_ONLY = 0x00010000; |
| 357 | |
| 358 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 359 | * Querying flag: if set and if the platform is doing any filtering of the |
| 360 | * results, then the filtering will not happen. This is a synonym for saying |
| 361 | * that all results should be returned. |
| 362 | * <p> |
| 363 | * <em>This flag should be used with extreme care.</em> |
Fabrice Di Meglio | 9f7e39f | 2015-04-10 20:40:16 -0700 | [diff] [blame] | 364 | */ |
| 365 | public static final int MATCH_ALL = 0x00020000; |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 366 | |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 367 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 368 | * Querying flag: include only components which are encryption unaware in |
| 369 | * the returned info, regardless of the current user state. |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 370 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 371 | public static final int MATCH_ENCRYPTION_UNAWARE = 0x00040000; |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 372 | |
| 373 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 374 | * Querying flag: include only components which are encryption aware in the |
| 375 | * returned info, regardless of the current user state. |
Jeff Sharkey | 2a9e3f8 | 2015-12-18 10:57:58 -0700 | [diff] [blame] | 376 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 377 | public static final int MATCH_ENCRYPTION_AWARE = 0x00080000; |
Jeff Sharkey | 2a9e3f8 | 2015-12-18 10:57:58 -0700 | [diff] [blame] | 378 | |
| 379 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 380 | * Querying flag: include both encryption aware and unaware components in |
| 381 | * the returned info, regardless of the current user state. |
Jeff Sharkey | 2a9e3f8 | 2015-12-18 10:57:58 -0700 | [diff] [blame] | 382 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 383 | public static final int MATCH_ENCRYPTION_AWARE_AND_UNAWARE = MATCH_ENCRYPTION_AWARE |
| 384 | | MATCH_ENCRYPTION_UNAWARE; |
Jeff Sharkey | 2a9e3f8 | 2015-12-18 10:57:58 -0700 | [diff] [blame] | 385 | |
| 386 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 387 | * Querying flag: include only components from applications that are marked |
| 388 | * with {@link ApplicationInfo#FLAG_SYSTEM}. |
Jeff Sharkey | 5217cac | 2015-12-20 15:34:01 -0700 | [diff] [blame] | 389 | */ |
| 390 | public static final int MATCH_SYSTEM_ONLY = 0x00100000; |
| 391 | |
| 392 | /** |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 393 | * Internal flag used to indicate that a system component has done their |
| 394 | * homework and verified that they correctly handle packages and components |
| 395 | * that come and go over time. In particular: |
| 396 | * <ul> |
| 397 | * <li>Apps installed on external storage, which will appear to be |
| 398 | * uninstalled while the the device is ejected. |
| 399 | * <li>Apps with encryption unaware components, which will appear to not |
| 400 | * exist while the device is locked. |
| 401 | * </ul> |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 402 | * |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 403 | * @see #MATCH_UNINSTALLED_PACKAGES |
| 404 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 405 | * @hide |
| 406 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 407 | public static final int MATCH_DEBUG_TRIAGED_MISSING = 0x10000000; |
Jeff Sharkey | e17ac15 | 2015-11-06 22:40:29 -0800 | [diff] [blame] | 408 | |
| 409 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 410 | * Flag for {@link #addCrossProfileIntentFilter}: if this flag is set: when |
| 411 | * resolving an intent that matches the {@code CrossProfileIntentFilter}, |
| 412 | * the current profile will be skipped. Only activities in the target user |
| 413 | * can respond to the intent. |
| 414 | * |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 415 | * @hide |
| 416 | */ |
| 417 | public static final int SKIP_CURRENT_PROFILE = 0x00000002; |
| 418 | |
Tony Mak | 807e01c | 2015-12-01 20:19:03 +0000 | [diff] [blame] | 419 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 420 | * Flag for {@link #addCrossProfileIntentFilter}: if this flag is set: |
Tony Mak | 807e01c | 2015-12-01 20:19:03 +0000 | [diff] [blame] | 421 | * activities in the other profiles can respond to the intent only if no activity with |
| 422 | * non-negative priority in current profile can respond to the intent. |
| 423 | * @hide |
| 424 | */ |
| 425 | public static final int ONLY_IF_NO_MATCH_FOUND = 0x00000004; |
| 426 | |
Tor Norbye | d9273d6 | 2013-05-30 15:59:53 -0700 | [diff] [blame] | 427 | /** @hide */ |
| 428 | @IntDef({PERMISSION_GRANTED, PERMISSION_DENIED}) |
| 429 | @Retention(RetentionPolicy.SOURCE) |
| 430 | public @interface PermissionResult {} |
| 431 | |
Dianne Hackborn | 1655be4 | 2009-05-08 14:29:01 -0700 | [diff] [blame] | 432 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 433 | * Permission check result: this is returned by {@link #checkPermission} |
| 434 | * if the permission has been granted to the given package. |
| 435 | */ |
| 436 | public static final int PERMISSION_GRANTED = 0; |
| 437 | |
| 438 | /** |
| 439 | * Permission check result: this is returned by {@link #checkPermission} |
| 440 | * if the permission has not been granted to the given package. |
| 441 | */ |
| 442 | public static final int PERMISSION_DENIED = -1; |
| 443 | |
| 444 | /** |
| 445 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 446 | * if all signatures on the two packages match. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 447 | */ |
| 448 | public static final int SIGNATURE_MATCH = 0; |
| 449 | |
| 450 | /** |
| 451 | * Signature check result: this is returned by {@link #checkSignatures} |
| 452 | * if neither of the two packages is signed. |
| 453 | */ |
| 454 | public static final int SIGNATURE_NEITHER_SIGNED = 1; |
| 455 | |
| 456 | /** |
| 457 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 458 | * 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] | 459 | */ |
| 460 | public static final int SIGNATURE_FIRST_NOT_SIGNED = -1; |
| 461 | |
| 462 | /** |
| 463 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 464 | * 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] | 465 | */ |
| 466 | public static final int SIGNATURE_SECOND_NOT_SIGNED = -2; |
| 467 | |
| 468 | /** |
| 469 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 470 | * if not all signatures on both packages match. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 471 | */ |
| 472 | public static final int SIGNATURE_NO_MATCH = -3; |
| 473 | |
| 474 | /** |
| 475 | * Signature check result: this is returned by {@link #checkSignatures} |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 476 | * if either of the packages are not valid. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 477 | */ |
| 478 | public static final int SIGNATURE_UNKNOWN_PACKAGE = -4; |
| 479 | |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 480 | /** |
| 481 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} |
| 482 | * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 483 | * component or application is in its default enabled state (as specified |
| 484 | * in its manifest). |
| 485 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 486 | public static final int COMPONENT_ENABLED_STATE_DEFAULT = 0; |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 487 | |
| 488 | /** |
| 489 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} |
| 490 | * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 491 | * component or application has been explictily enabled, regardless of |
| 492 | * what it has specified in its manifest. |
| 493 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 494 | public static final int COMPONENT_ENABLED_STATE_ENABLED = 1; |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 495 | |
| 496 | /** |
| 497 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} |
| 498 | * and {@link #setComponentEnabledSetting(ComponentName, int, int)}: This |
| 499 | * component or application has been explicitly disabled, regardless of |
| 500 | * what it has specified in its manifest. |
| 501 | */ |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 502 | public static final int COMPONENT_ENABLED_STATE_DISABLED = 2; |
| 503 | |
| 504 | /** |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 505 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} only: The |
| 506 | * user has explicitly disabled the application, regardless of what it has |
| 507 | * specified in its manifest. Because this is due to the user's request, |
| 508 | * they may re-enable it if desired through the appropriate system UI. This |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 509 | * option currently <strong>cannot</strong> be used with |
Dianne Hackborn | 0ac3031 | 2011-06-17 14:49:23 -0700 | [diff] [blame] | 510 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}. |
| 511 | */ |
| 512 | public static final int COMPONENT_ENABLED_STATE_DISABLED_USER = 3; |
| 513 | |
| 514 | /** |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 515 | * Flag for {@link #setApplicationEnabledSetting(String, int, int)} only: This |
| 516 | * application should be considered, until the point where the user actually |
| 517 | * wants to use it. This means that it will not normally show up to the user |
| 518 | * (such as in the launcher), but various parts of the user interface can |
| 519 | * use {@link #GET_DISABLED_UNTIL_USED_COMPONENTS} to still see it and allow |
| 520 | * the user to select it (as for example an IME, device admin, etc). Such code, |
| 521 | * once the user has selected the app, should at that point also make it enabled. |
| 522 | * This option currently <strong>can not</strong> be used with |
| 523 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}. |
| 524 | */ |
| 525 | public static final int COMPONENT_ENABLED_STATE_DISABLED_UNTIL_USED = 4; |
| 526 | |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 527 | /** @hide */ |
| 528 | @IntDef(flag = true, value = { |
| 529 | INSTALL_FORWARD_LOCK, |
| 530 | INSTALL_REPLACE_EXISTING, |
| 531 | INSTALL_ALLOW_TEST, |
| 532 | INSTALL_EXTERNAL, |
| 533 | INSTALL_INTERNAL, |
| 534 | INSTALL_FROM_ADB, |
| 535 | INSTALL_ALL_USERS, |
| 536 | INSTALL_ALLOW_DOWNGRADE, |
| 537 | INSTALL_GRANT_RUNTIME_PERMISSIONS, |
| 538 | INSTALL_FORCE_VOLUME_UUID, |
| 539 | INSTALL_FORCE_PERMISSION_PROMPT, |
| 540 | INSTALL_EPHEMERAL, |
| 541 | }) |
| 542 | @Retention(RetentionPolicy.SOURCE) |
| 543 | public @interface InstallFlags {} |
| 544 | |
Dianne Hackborn | fd7aded | 2013-01-22 17:10:23 -0800 | [diff] [blame] | 545 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 546 | * Flag parameter for {@link #installPackage} to indicate that this package |
| 547 | * should be installed as forward locked, i.e. only the app itself should |
| 548 | * have access to its code and non-resource assets. |
| 549 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 550 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 551 | */ |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 552 | public static final int INSTALL_FORWARD_LOCK = 0x00000001; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 553 | |
| 554 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 555 | * Flag parameter for {@link #installPackage} to indicate that you want to |
| 556 | * replace an already installed package, if one exists. |
| 557 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 558 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 559 | */ |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 560 | public static final int INSTALL_REPLACE_EXISTING = 0x00000002; |
| 561 | |
| 562 | /** |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 563 | * Flag parameter for {@link #installPackage} to indicate that you want to |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 564 | * allow test packages (those that have set android:testOnly in their |
| 565 | * manifest) to be installed. |
| 566 | * @hide |
| 567 | */ |
| 568 | public static final int INSTALL_ALLOW_TEST = 0x00000004; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 569 | |
| 570 | /** |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 571 | * Flag parameter for {@link #installPackage} to indicate that this package |
| 572 | * must be installed to an ASEC on a {@link VolumeInfo#TYPE_PUBLIC}. |
| 573 | * |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 574 | * @hide |
| 575 | */ |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 576 | public static final int INSTALL_EXTERNAL = 0x00000008; |
Oscar Montemayor | 539d3c4 | 2010-01-29 15:27:00 -0800 | [diff] [blame] | 577 | |
| 578 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 579 | * Flag parameter for {@link #installPackage} to indicate that this package |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 580 | * must be installed to internal storage. |
| 581 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 582 | * @hide |
| 583 | */ |
| 584 | public static final int INSTALL_INTERNAL = 0x00000010; |
| 585 | |
| 586 | /** |
| 587 | * Flag parameter for {@link #installPackage} to indicate that this install |
| 588 | * was initiated via ADB. |
| 589 | * |
| 590 | * @hide |
| 591 | */ |
| 592 | public static final int INSTALL_FROM_ADB = 0x00000020; |
Suchi Amalapurapu | 14b6abd | 2010-03-17 08:37:04 -0700 | [diff] [blame] | 593 | |
| 594 | /** |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 595 | * Flag parameter for {@link #installPackage} to indicate that this install |
| 596 | * should immediately be visible to all users. |
| 597 | * |
| 598 | * @hide |
| 599 | */ |
| 600 | public static final int INSTALL_ALL_USERS = 0x00000040; |
| 601 | |
| 602 | /** |
| 603 | * Flag parameter for {@link #installPackage} to indicate that it is okay |
| 604 | * 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] | 605 | * version code than the currently installed app. This is permitted only if |
| 606 | * the currently installed app is marked debuggable. |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 607 | * |
| 608 | * @hide |
| 609 | */ |
| 610 | public static final int INSTALL_ALLOW_DOWNGRADE = 0x00000080; |
| 611 | |
| 612 | /** |
Svet Ganov | 95c1ade | 2015-03-19 09:38:52 -0700 | [diff] [blame] | 613 | * Flag parameter for {@link #installPackage} to indicate that all runtime |
| 614 | * permissions should be granted to the package. If {@link #INSTALL_ALL_USERS} |
| 615 | * is set the runtime permissions will be granted to all users, otherwise |
| 616 | * only to the owner. |
| 617 | * |
| 618 | * @hide |
| 619 | */ |
| 620 | public static final int INSTALL_GRANT_RUNTIME_PERMISSIONS = 0x00000100; |
| 621 | |
Jeff Sharkey | ab23409 | 2015-06-09 21:42:22 -0700 | [diff] [blame] | 622 | /** {@hide} */ |
| 623 | public static final int INSTALL_FORCE_VOLUME_UUID = 0x00000200; |
| 624 | |
Svet Ganov | 95c1ade | 2015-03-19 09:38:52 -0700 | [diff] [blame] | 625 | /** |
Todd Kennedy | a1d12cf | 2015-09-29 15:43:00 -0700 | [diff] [blame] | 626 | * Flag parameter for {@link #installPackage} to indicate that we always want to force |
| 627 | * the prompt for permission approval. This overrides any special behaviour for internal |
| 628 | * components. |
| 629 | * |
| 630 | * @hide |
| 631 | */ |
| 632 | public static final int INSTALL_FORCE_PERMISSION_PROMPT = 0x00000400; |
| 633 | |
| 634 | /** |
Todd Kennedy | 27c24fb | 2015-09-17 16:49:25 -0700 | [diff] [blame] | 635 | * Flag parameter for {@link #installPackage} to indicate that this package is |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 636 | * to be installed as a lightweight "ephemeral" app. |
| 637 | * |
| 638 | * @hide |
| 639 | */ |
Todd Kennedy | 373f0b4 | 2015-12-16 14:45:14 -0800 | [diff] [blame] | 640 | public static final int INSTALL_EPHEMERAL = 0x00000800; |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 641 | |
| 642 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 643 | * Flag parameter for |
| 644 | * {@link #setComponentEnabledSetting(android.content.ComponentName, int, int)} to indicate |
| 645 | * that you don't want to kill the app containing the component. Be careful when you set this |
| 646 | * since changing component states can make the containing application's behavior unpredictable. |
| 647 | */ |
| 648 | public static final int DONT_KILL_APP = 0x00000001; |
| 649 | |
| 650 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 651 | * Installation return code: this is passed to the |
| 652 | * {@link IPackageInstallObserver} on success. |
| 653 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 654 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 655 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 656 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 657 | public static final int INSTALL_SUCCEEDED = 1; |
| 658 | |
| 659 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 660 | * Installation return code: this is passed to the |
| 661 | * {@link IPackageInstallObserver} if the package is already installed. |
| 662 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 663 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 664 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 665 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 666 | public static final int INSTALL_FAILED_ALREADY_EXISTS = -1; |
| 667 | |
| 668 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 669 | * Installation return code: this is passed to the |
| 670 | * {@link IPackageInstallObserver} if the package archive file is invalid. |
| 671 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 672 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 673 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 674 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 675 | public static final int INSTALL_FAILED_INVALID_APK = -2; |
| 676 | |
| 677 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 678 | * Installation return code: this is passed to the |
| 679 | * {@link IPackageInstallObserver} if the URI passed in is invalid. |
| 680 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 681 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 682 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 683 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 684 | public static final int INSTALL_FAILED_INVALID_URI = -3; |
| 685 | |
| 686 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 687 | * Installation return code: this is passed to the |
| 688 | * {@link IPackageInstallObserver} if the package manager service found that |
| 689 | * the device didn't have enough storage space to install the app. |
| 690 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 691 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 692 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 693 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 694 | public static final int INSTALL_FAILED_INSUFFICIENT_STORAGE = -4; |
| 695 | |
| 696 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 697 | * Installation return code: this is passed to the |
| 698 | * {@link IPackageInstallObserver} if a package is already installed with |
| 699 | * the same name. |
| 700 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 701 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 702 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 703 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 704 | public static final int INSTALL_FAILED_DUPLICATE_PACKAGE = -5; |
| 705 | |
| 706 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 707 | * Installation return code: this is passed to the |
| 708 | * {@link IPackageInstallObserver} if the requested shared user does not |
| 709 | * exist. |
| 710 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 711 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 712 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 713 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 714 | public static final int INSTALL_FAILED_NO_SHARED_USER = -6; |
| 715 | |
| 716 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 717 | * Installation return code: this is passed to the |
| 718 | * {@link IPackageInstallObserver} if a previously installed package of the |
| 719 | * same name has a different signature than the new package (and the old |
| 720 | * package's data was not removed). |
| 721 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 722 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 723 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 724 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 725 | public static final int INSTALL_FAILED_UPDATE_INCOMPATIBLE = -7; |
| 726 | |
| 727 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 728 | * Installation return code: this is passed to the |
| 729 | * {@link IPackageInstallObserver} if the new package is requested a shared |
| 730 | * user which is already installed on the device and does not have matching |
| 731 | * signature. |
| 732 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 733 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 734 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 735 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 736 | public static final int INSTALL_FAILED_SHARED_USER_INCOMPATIBLE = -8; |
| 737 | |
| 738 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 739 | * Installation return code: this is passed to the |
| 740 | * {@link IPackageInstallObserver} if the new package uses a shared library |
| 741 | * that is not available. |
| 742 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 743 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 744 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 745 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 746 | public static final int INSTALL_FAILED_MISSING_SHARED_LIBRARY = -9; |
| 747 | |
| 748 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 749 | * Installation return code: this is passed to the |
| 750 | * {@link IPackageInstallObserver} if the new package uses a shared library |
| 751 | * that is not available. |
| 752 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 753 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 754 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 755 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 756 | public static final int INSTALL_FAILED_REPLACE_COULDNT_DELETE = -10; |
| 757 | |
| 758 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 759 | * Installation return code: this is passed to the |
| 760 | * {@link IPackageInstallObserver} if the new package failed while |
| 761 | * optimizing and validating its dex files, either because there was not |
| 762 | * enough storage or the validation failed. |
| 763 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 764 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 765 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 766 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 767 | public static final int INSTALL_FAILED_DEXOPT = -11; |
| 768 | |
| 769 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 770 | * Installation return code: this is passed to the |
| 771 | * {@link IPackageInstallObserver} if the new package failed because the |
| 772 | * current SDK version is older than that required by the package. |
| 773 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 774 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 775 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 776 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 777 | public static final int INSTALL_FAILED_OLDER_SDK = -12; |
| 778 | |
| 779 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 780 | * Installation return code: this is passed to the |
| 781 | * {@link IPackageInstallObserver} if the new package failed because it |
| 782 | * contains a content provider with the same authority as a provider already |
| 783 | * installed in the system. |
| 784 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 785 | * @hide |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 786 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 787 | @SystemApi |
The Android Open Source Project | 1059253 | 2009-03-18 17:39:46 -0700 | [diff] [blame] | 788 | public static final int INSTALL_FAILED_CONFLICTING_PROVIDER = -13; |
| 789 | |
| 790 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 791 | * Installation return code: this is passed to the |
| 792 | * {@link IPackageInstallObserver} if the new package failed because the |
| 793 | * current SDK version is newer than that required by the package. |
| 794 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 795 | * @hide |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 796 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 797 | @SystemApi |
Dianne Hackborn | 851a541 | 2009-05-08 12:06:44 -0700 | [diff] [blame] | 798 | public static final int INSTALL_FAILED_NEWER_SDK = -14; |
| 799 | |
| 800 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 801 | * Installation return code: this is passed to the |
| 802 | * {@link IPackageInstallObserver} if the new package failed because it has |
| 803 | * specified that it is a test-only package and the caller has not supplied |
| 804 | * the {@link #INSTALL_ALLOW_TEST} flag. |
| 805 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 806 | * @hide |
| 807 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 808 | @SystemApi |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 809 | public static final int INSTALL_FAILED_TEST_ONLY = -15; |
| 810 | |
| 811 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 812 | * Installation return code: this is passed to the |
| 813 | * {@link IPackageInstallObserver} if the package being installed contains |
| 814 | * native code, but none that is compatible with the device's CPU_ABI. |
| 815 | * |
Dianne Hackborn | b181118 | 2009-05-21 15:45:42 -0700 | [diff] [blame] | 816 | * @hide |
| 817 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 818 | @SystemApi |
Dianne Hackborn | b181118 | 2009-05-21 15:45:42 -0700 | [diff] [blame] | 819 | public static final int INSTALL_FAILED_CPU_ABI_INCOMPATIBLE = -16; |
| 820 | |
| 821 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 822 | * Installation return code: this is passed to the |
| 823 | * {@link IPackageInstallObserver} if the new package uses a feature that is |
| 824 | * not available. |
| 825 | * |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 826 | * @hide |
| 827 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 828 | @SystemApi |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 829 | public static final int INSTALL_FAILED_MISSING_FEATURE = -17; |
| 830 | |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 831 | // ------ Errors related to sdcard |
| 832 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 833 | * Installation return code: this is passed to the |
| 834 | * {@link IPackageInstallObserver} if a secure container mount point |
| 835 | * couldn't be accessed on external media. |
| 836 | * |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 837 | * @hide |
| 838 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 839 | @SystemApi |
Suchi Amalapurapu | af8e9f4 | 2010-01-12 10:17:28 -0800 | [diff] [blame] | 840 | public static final int INSTALL_FAILED_CONTAINER_ERROR = -18; |
| 841 | |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 842 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 843 | * Installation return code: this is passed to the |
| 844 | * {@link IPackageInstallObserver} if the new package couldn't be installed |
| 845 | * in the specified install location. |
| 846 | * |
Suchi Amalapurapu | b56ae20 | 2010-02-04 22:51:07 -0800 | [diff] [blame] | 847 | * @hide |
| 848 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 849 | @SystemApi |
Suchi Amalapurapu | b56ae20 | 2010-02-04 22:51:07 -0800 | [diff] [blame] | 850 | public static final int INSTALL_FAILED_INVALID_INSTALL_LOCATION = -19; |
| 851 | |
| 852 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 853 | * Installation return code: this is passed to the |
| 854 | * {@link IPackageInstallObserver} if the new package couldn't be installed |
| 855 | * in the specified install location because the media is not available. |
| 856 | * |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 857 | * @hide |
| 858 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 859 | @SystemApi |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 860 | public static final int INSTALL_FAILED_MEDIA_UNAVAILABLE = -20; |
| 861 | |
| 862 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 863 | * Installation return code: this is passed to the |
| 864 | * {@link IPackageInstallObserver} if the new package couldn't be installed |
| 865 | * because the verification timed out. |
| 866 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 867 | * @hide |
| 868 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 869 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 870 | public static final int INSTALL_FAILED_VERIFICATION_TIMEOUT = -21; |
| 871 | |
| 872 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 873 | * Installation return code: this is passed to the |
| 874 | * {@link IPackageInstallObserver} if the new package couldn't be installed |
| 875 | * because the verification did not succeed. |
| 876 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 877 | * @hide |
| 878 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 879 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 880 | public static final int INSTALL_FAILED_VERIFICATION_FAILURE = -22; |
| 881 | |
| 882 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 883 | * Installation return code: this is passed to the |
| 884 | * {@link IPackageInstallObserver} if the package changed from what the |
| 885 | * calling program expected. |
| 886 | * |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 887 | * @hide |
| 888 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 889 | @SystemApi |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 890 | public static final int INSTALL_FAILED_PACKAGE_CHANGED = -23; |
| 891 | |
| 892 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 893 | * Installation return code: this is passed to the |
| 894 | * {@link IPackageInstallObserver} if the new package is assigned a |
| 895 | * different UID than it previously held. |
| 896 | * |
Dianne Hackborn | d0c5f51 | 2012-06-07 16:53:59 -0700 | [diff] [blame] | 897 | * @hide |
| 898 | */ |
| 899 | public static final int INSTALL_FAILED_UID_CHANGED = -24; |
| 900 | |
| 901 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 902 | * Installation return code: this is passed to the |
| 903 | * {@link IPackageInstallObserver} if the new package has an older version |
| 904 | * code than the currently installed package. |
| 905 | * |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 906 | * @hide |
| 907 | */ |
| 908 | public static final int INSTALL_FAILED_VERSION_DOWNGRADE = -25; |
| 909 | |
| 910 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 911 | * Installation return code: this is passed to the |
| 912 | * {@link IPackageInstallObserver} if the old package has target SDK high |
| 913 | * enough to support runtime permission and the new package has target SDK |
| 914 | * low enough to not support runtime permissions. |
| 915 | * |
Svetoslav | d965370 | 2015-05-13 18:02:46 -0700 | [diff] [blame] | 916 | * @hide |
| 917 | */ |
| 918 | @SystemApi |
| 919 | public static final int INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE = -26; |
| 920 | |
| 921 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 922 | * Installation parse return code: this is passed to the |
| 923 | * {@link IPackageInstallObserver} if the parser was given a path that is |
| 924 | * not a file, or does not end with the expected '.apk' extension. |
| 925 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 926 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 927 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 928 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 929 | public static final int INSTALL_PARSE_FAILED_NOT_APK = -100; |
| 930 | |
| 931 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 932 | * Installation parse return code: this is passed to the |
| 933 | * {@link IPackageInstallObserver} if the parser was unable to retrieve the |
| 934 | * AndroidManifest.xml file. |
| 935 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 936 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 937 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 938 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 939 | public static final int INSTALL_PARSE_FAILED_BAD_MANIFEST = -101; |
| 940 | |
| 941 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 942 | * Installation parse return code: this is passed to the |
| 943 | * {@link IPackageInstallObserver} if the parser encountered an unexpected |
| 944 | * exception. |
| 945 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 946 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 947 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 948 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 949 | public static final int INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION = -102; |
| 950 | |
| 951 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 952 | * Installation parse return code: this is passed to the |
| 953 | * {@link IPackageInstallObserver} if the parser did not find any |
| 954 | * certificates in the .apk. |
| 955 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 956 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 957 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 958 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 959 | public static final int INSTALL_PARSE_FAILED_NO_CERTIFICATES = -103; |
| 960 | |
| 961 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 962 | * Installation parse return code: this is passed to the |
| 963 | * {@link IPackageInstallObserver} if the parser found inconsistent |
| 964 | * certificates on the files in the .apk. |
| 965 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 966 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 967 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 968 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 969 | public static final int INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES = -104; |
| 970 | |
| 971 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 972 | * Installation parse return code: this is passed to the |
| 973 | * {@link IPackageInstallObserver} if the parser encountered a |
| 974 | * CertificateEncodingException in one of the files in the .apk. |
| 975 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 976 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 977 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 978 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 979 | public static final int INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING = -105; |
| 980 | |
| 981 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 982 | * Installation parse return code: this is passed to the |
| 983 | * {@link IPackageInstallObserver} if the parser encountered a bad or |
| 984 | * missing package name in the manifest. |
| 985 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 986 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 987 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 988 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 989 | public static final int INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME = -106; |
| 990 | |
| 991 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 992 | * Installation parse return code: this is passed to the |
| 993 | * {@link IPackageInstallObserver} if the parser encountered a bad shared |
| 994 | * user id name in the manifest. |
| 995 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 996 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 997 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 998 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 999 | public static final int INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID = -107; |
| 1000 | |
| 1001 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1002 | * Installation parse return code: this is passed to the |
| 1003 | * {@link IPackageInstallObserver} if the parser encountered some structural |
| 1004 | * problem in the manifest. |
| 1005 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1006 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1007 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1008 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1009 | public static final int INSTALL_PARSE_FAILED_MANIFEST_MALFORMED = -108; |
| 1010 | |
| 1011 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1012 | * Installation parse return code: this is passed to the |
| 1013 | * {@link IPackageInstallObserver} if the parser did not find any actionable |
| 1014 | * tags (instrumentation or application) in the manifest. |
| 1015 | * |
Dianne Hackborn | ade3eca | 2009-05-11 18:54:45 -0700 | [diff] [blame] | 1016 | * @hide |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1017 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1018 | @SystemApi |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1019 | public static final int INSTALL_PARSE_FAILED_MANIFEST_EMPTY = -109; |
| 1020 | |
| 1021 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1022 | * Installation failed return code: this is passed to the |
| 1023 | * {@link IPackageInstallObserver} if the system failed to install the |
| 1024 | * package because of system issues. |
| 1025 | * |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 1026 | * @hide |
| 1027 | */ |
Jeff Brown | d5a5b5a | 2014-06-05 17:14:39 -0700 | [diff] [blame] | 1028 | @SystemApi |
Suchi Amalapurapu | 5b993ce | 2010-02-12 09:43:29 -0800 | [diff] [blame] | 1029 | public static final int INSTALL_FAILED_INTERNAL_ERROR = -110; |
| 1030 | |
| 1031 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1032 | * Installation failed return code: this is passed to the |
| 1033 | * {@link IPackageInstallObserver} if the system failed to install the |
| 1034 | * package because the user is restricted from installing apps. |
| 1035 | * |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 1036 | * @hide |
| 1037 | */ |
| 1038 | public static final int INSTALL_FAILED_USER_RESTRICTED = -111; |
| 1039 | |
| 1040 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1041 | * Installation failed return code: this is passed to the |
| 1042 | * {@link IPackageInstallObserver} if the system failed to install the |
| 1043 | * package because it is attempting to define a permission that is already |
| 1044 | * defined by some existing package. |
| 1045 | * <p> |
| 1046 | * The package name of the app which has already defined the permission is |
| 1047 | * passed to a {@link PackageInstallObserver}, if any, as the |
| 1048 | * {@link #EXTRA_FAILURE_EXISTING_PACKAGE} string extra; and the name of the |
| 1049 | * permission being redefined is passed in the |
| 1050 | * {@link #EXTRA_FAILURE_EXISTING_PERMISSION} string extra. |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 1051 | * |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 1052 | * @hide |
| 1053 | */ |
| 1054 | public static final int INSTALL_FAILED_DUPLICATE_PERMISSION = -112; |
| 1055 | |
| 1056 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1057 | * Installation failed return code: this is passed to the |
| 1058 | * {@link IPackageInstallObserver} if the system failed to install the |
| 1059 | * package because its packaged native code did not match any of the ABIs |
| 1060 | * supported by the system. |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1061 | * |
| 1062 | * @hide |
| 1063 | */ |
Narayan Kamath | d11f223 | 2014-04-10 10:37:17 +0100 | [diff] [blame] | 1064 | public static final int INSTALL_FAILED_NO_MATCHING_ABIS = -113; |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1065 | |
| 1066 | /** |
| 1067 | * Internal return code for NativeLibraryHelper methods to indicate that the package |
| 1068 | * being processed did not contain any native code. This is placed here only so that |
| 1069 | * it can belong to the same value space as the other install failure codes. |
| 1070 | * |
| 1071 | * @hide |
| 1072 | */ |
Narayan Kamath | d11f223 | 2014-04-10 10:37:17 +0100 | [diff] [blame] | 1073 | public static final int NO_NATIVE_LIBRARIES = -114; |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1074 | |
Jeff Sharkey | 7328a1b | 2014-08-07 14:01:43 -0700 | [diff] [blame] | 1075 | /** {@hide} */ |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 1076 | public static final int INSTALL_FAILED_ABORTED = -115; |
Jeff Sharkey | 7328a1b | 2014-08-07 14:01:43 -0700 | [diff] [blame] | 1077 | |
Ramin Zaghi | 1378aba | 2014-02-28 15:03:19 +0000 | [diff] [blame] | 1078 | /** |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 1079 | * Installation failed return code: ephemeral app installs are incompatible with some |
| 1080 | * other installation flags supplied for the operation; or other circumstances such |
| 1081 | * as trying to upgrade a system app via an ephemeral install. |
| 1082 | * @hide |
| 1083 | */ |
| 1084 | public static final int INSTALL_FAILED_EPHEMERAL_INVALID = -116; |
| 1085 | |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1086 | /** @hide */ |
| 1087 | @IntDef(flag = true, value = { |
| 1088 | DELETE_KEEP_DATA, |
| 1089 | DELETE_ALL_USERS, |
| 1090 | DELETE_SYSTEM_APP, |
| 1091 | }) |
| 1092 | @Retention(RetentionPolicy.SOURCE) |
| 1093 | public @interface DeleteFlags {} |
| 1094 | |
Todd Kennedy | 2699f06 | 2015-11-20 13:07:17 -0800 | [diff] [blame] | 1095 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1096 | * Flag parameter for {@link #deletePackage} to indicate that you don't want to delete the |
| 1097 | * package's data directory. |
| 1098 | * |
| 1099 | * @hide |
| 1100 | */ |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 1101 | public static final int DELETE_KEEP_DATA = 0x00000001; |
| 1102 | |
| 1103 | /** |
| 1104 | * Flag parameter for {@link #deletePackage} to indicate that you want the |
| 1105 | * package deleted for all users. |
| 1106 | * |
| 1107 | * @hide |
| 1108 | */ |
| 1109 | public static final int DELETE_ALL_USERS = 0x00000002; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 1110 | |
| 1111 | /** |
Dianne Hackborn | c895be7 | 2013-03-11 17:48:43 -0700 | [diff] [blame] | 1112 | * Flag parameter for {@link #deletePackage} to indicate that, if you are calling |
| 1113 | * uninstall on a system that has been updated, then don't do the normal process |
| 1114 | * of uninstalling the update and rolling back to the older system version (which |
| 1115 | * needs to happen for all users); instead, just mark the app as uninstalled for |
| 1116 | * the current user. |
| 1117 | * |
| 1118 | * @hide |
| 1119 | */ |
| 1120 | public static final int DELETE_SYSTEM_APP = 0x00000004; |
| 1121 | |
| 1122 | /** |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1123 | * Return code for when package deletion succeeds. This is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1124 | * {@link IPackageDeleteObserver} if the system succeeded in deleting the |
| 1125 | * package. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1126 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1127 | * @hide |
| 1128 | */ |
| 1129 | public static final int DELETE_SUCCEEDED = 1; |
| 1130 | |
| 1131 | /** |
| 1132 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1133 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1134 | * for an unspecified reason. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1135 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1136 | * @hide |
| 1137 | */ |
| 1138 | public static final int DELETE_FAILED_INTERNAL_ERROR = -1; |
| 1139 | |
| 1140 | /** |
| 1141 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1142 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1143 | * because it is the active DevicePolicy manager. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1144 | * |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1145 | * @hide |
| 1146 | */ |
| 1147 | public static final int DELETE_FAILED_DEVICE_POLICY_MANAGER = -2; |
| 1148 | |
| 1149 | /** |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 1150 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1151 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1152 | * since the user is restricted. |
Amith Yamasani | e4cf734 | 2012-12-17 11:12:09 -0800 | [diff] [blame] | 1153 | * |
| 1154 | * @hide |
| 1155 | */ |
| 1156 | public static final int DELETE_FAILED_USER_RESTRICTED = -3; |
| 1157 | |
| 1158 | /** |
Kenny Guy | 1b88da5 | 2014-07-10 16:33:49 +0100 | [diff] [blame] | 1159 | * Deletion failed return code: this is passed to the |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1160 | * {@link IPackageDeleteObserver} if the system failed to delete the package |
| 1161 | * because a profile or device owner has marked the package as |
| 1162 | * uninstallable. |
Kenny Guy | c13053b | 2014-05-29 14:17:17 +0100 | [diff] [blame] | 1163 | * |
| 1164 | * @hide |
| 1165 | */ |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 1166 | public static final int DELETE_FAILED_OWNER_BLOCKED = -4; |
| 1167 | |
| 1168 | /** {@hide} */ |
| 1169 | public static final int DELETE_FAILED_ABORTED = -5; |
Kenny Guy | c13053b | 2014-05-29 14:17:17 +0100 | [diff] [blame] | 1170 | |
| 1171 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1172 | * Return code that is passed to the {@link IPackageMoveObserver} when the |
Kenny Root | c39bb4a | 2011-02-28 13:27:19 -0800 | [diff] [blame] | 1173 | * package has been successfully moved by the system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1174 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1175 | * @hide |
| 1176 | */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1177 | public static final int MOVE_SUCCEEDED = -100; |
| 1178 | |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1179 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1180 | * Error code that is passed to the {@link IPackageMoveObserver} when the |
| 1181 | * package hasn't been successfully moved by the system because of |
| 1182 | * insufficient memory on specified media. |
| 1183 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1184 | * @hide |
| 1185 | */ |
| 1186 | public static final int MOVE_FAILED_INSUFFICIENT_STORAGE = -1; |
| 1187 | |
| 1188 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1189 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1190 | * specified package doesn't exist. |
| 1191 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1192 | * @hide |
| 1193 | */ |
| 1194 | public static final int MOVE_FAILED_DOESNT_EXIST = -2; |
| 1195 | |
| 1196 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1197 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1198 | * specified package cannot be moved since its a system package. |
| 1199 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1200 | * @hide |
| 1201 | */ |
| 1202 | public static final int MOVE_FAILED_SYSTEM_PACKAGE = -3; |
| 1203 | |
| 1204 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1205 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1206 | * specified package cannot be moved since its forward locked. |
| 1207 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1208 | * @hide |
| 1209 | */ |
| 1210 | public static final int MOVE_FAILED_FORWARD_LOCKED = -4; |
| 1211 | |
| 1212 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1213 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1214 | * specified package cannot be moved to the specified location. |
| 1215 | * |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1216 | * @hide |
| 1217 | */ |
| 1218 | public static final int MOVE_FAILED_INVALID_LOCATION = -5; |
| 1219 | |
| 1220 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1221 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1222 | * specified package cannot be moved to the specified location. |
| 1223 | * |
Suchi Amalapurapu | 8a9ab24 | 2010-03-11 16:49:16 -0800 | [diff] [blame] | 1224 | * @hide |
| 1225 | */ |
| 1226 | public static final int MOVE_FAILED_INTERNAL_ERROR = -6; |
| 1227 | |
| 1228 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1229 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1230 | * specified package already has an operation pending in the queue. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1231 | * |
Kenny Root | deb1126 | 2010-08-02 11:36:21 -0700 | [diff] [blame] | 1232 | * @hide |
| 1233 | */ |
| 1234 | public static final int MOVE_FAILED_OPERATION_PENDING = -7; |
| 1235 | |
| 1236 | /** |
Makoto Onuki | f34db0a | 2016-02-17 11:17:15 -0800 | [diff] [blame] | 1237 | * Error code that is passed to the {@link IPackageMoveObserver} if the |
| 1238 | * specified package cannot be moved since it contains a device admin. |
| 1239 | * |
| 1240 | * @hide |
| 1241 | */ |
| 1242 | public static final int MOVE_FAILED_DEVICE_ADMIN = -8; |
| 1243 | |
| 1244 | /** |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1245 | * Flag parameter for {@link #movePackage} to indicate that |
| 1246 | * the package should be moved to internal storage if its |
| 1247 | * been installed on external media. |
| 1248 | * @hide |
| 1249 | */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1250 | @Deprecated |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1251 | public static final int MOVE_INTERNAL = 0x00000001; |
| 1252 | |
| 1253 | /** |
| 1254 | * Flag parameter for {@link #movePackage} to indicate that |
| 1255 | * the package should be moved to external media. |
| 1256 | * @hide |
| 1257 | */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1258 | @Deprecated |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1259 | public static final int MOVE_EXTERNAL_MEDIA = 0x00000002; |
| 1260 | |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 1261 | /** {@hide} */ |
| 1262 | public static final String EXTRA_MOVE_ID = "android.content.pm.extra.MOVE_ID"; |
| 1263 | |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 1264 | /** |
Kenny Root | 05ca4c9 | 2011-09-15 10:36:25 -0700 | [diff] [blame] | 1265 | * Usable by the required verifier as the {@code verificationCode} argument |
| 1266 | * for {@link PackageManager#verifyPendingInstall} to indicate that it will |
| 1267 | * allow the installation to proceed without any of the optional verifiers |
| 1268 | * needing to vote. |
| 1269 | * |
| 1270 | * @hide |
| 1271 | */ |
| 1272 | public static final int VERIFICATION_ALLOW_WITHOUT_SUFFICIENT = 2; |
| 1273 | |
| 1274 | /** |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 1275 | * Used as the {@code verificationCode} argument for |
| 1276 | * {@link PackageManager#verifyPendingInstall} to indicate that the calling |
| 1277 | * package verifier allows the installation to proceed. |
| 1278 | */ |
| 1279 | public static final int VERIFICATION_ALLOW = 1; |
| 1280 | |
| 1281 | /** |
| 1282 | * Used as the {@code verificationCode} argument for |
| 1283 | * {@link PackageManager#verifyPendingInstall} to indicate the calling |
| 1284 | * package verifier does not vote to allow the installation to proceed. |
| 1285 | */ |
| 1286 | public static final int VERIFICATION_REJECT = -1; |
| 1287 | |
| 1288 | /** |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1289 | * Used as the {@code verificationCode} argument for |
| 1290 | * {@link PackageManager#verifyIntentFilter} to indicate that the calling |
| 1291 | * IntentFilter Verifier confirms that the IntentFilter is verified. |
| 1292 | * |
| 1293 | * @hide |
| 1294 | */ |
| 1295 | public static final int INTENT_FILTER_VERIFICATION_SUCCESS = 1; |
| 1296 | |
| 1297 | /** |
| 1298 | * Used as the {@code verificationCode} argument for |
| 1299 | * {@link PackageManager#verifyIntentFilter} to indicate that the calling |
| 1300 | * IntentFilter Verifier confirms that the IntentFilter is NOT verified. |
| 1301 | * |
| 1302 | * @hide |
| 1303 | */ |
| 1304 | public static final int INTENT_FILTER_VERIFICATION_FAILURE = -1; |
| 1305 | |
| 1306 | /** |
| 1307 | * Internal status code to indicate that an IntentFilter verification result is not specified. |
| 1308 | * |
| 1309 | * @hide |
| 1310 | */ |
| 1311 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED = 0; |
| 1312 | |
| 1313 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1314 | * Used as the {@code status} argument for |
| 1315 | * {@link #updateIntentVerificationStatusAsUser} to indicate that the User |
| 1316 | * will always be prompted the Intent Disambiguation Dialog if there are two |
| 1317 | * or more Intent resolved for the IntentFilter's domain(s). |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1318 | * |
| 1319 | * @hide |
| 1320 | */ |
| 1321 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK = 1; |
| 1322 | |
| 1323 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1324 | * Used as the {@code status} argument for |
| 1325 | * {@link #updateIntentVerificationStatusAsUser} to indicate that the User |
| 1326 | * will never be prompted the Intent Disambiguation Dialog if there are two |
| 1327 | * or more resolution of the Intent. The default App for the domain(s) |
| 1328 | * specified in the IntentFilter will also ALWAYS be used. |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 1329 | * |
| 1330 | * @hide |
| 1331 | */ |
| 1332 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS = 2; |
| 1333 | |
| 1334 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1335 | * Used as the {@code status} argument for |
| 1336 | * {@link #updateIntentVerificationStatusAsUser} to indicate that the User |
| 1337 | * may be prompted the Intent Disambiguation Dialog if there are two or more |
| 1338 | * 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] | 1339 | * IntentFilter will also NEVER be presented to the User. |
| 1340 | * |
| 1341 | * @hide |
| 1342 | */ |
| 1343 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER = 3; |
| 1344 | |
| 1345 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 1346 | * Used as the {@code status} argument for |
| 1347 | * {@link #updateIntentVerificationStatusAsUser} to indicate that this app |
| 1348 | * should always be considered as an ambiguous candidate for handling the |
| 1349 | * matching Intent even if there are other candidate apps in the "always" |
| 1350 | * state. Put another way: if there are any 'always ask' apps in a set of |
| 1351 | * more than one candidate app, then a disambiguation is *always* presented |
| 1352 | * even if there is another candidate app with the 'always' state. |
Christopher Tate | 56f0ff3 | 2015-08-13 16:29:33 -0700 | [diff] [blame] | 1353 | * |
| 1354 | * @hide |
| 1355 | */ |
| 1356 | public static final int INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS_ASK = 4; |
| 1357 | |
| 1358 | /** |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 1359 | * Can be used as the {@code millisecondsToDelay} argument for |
| 1360 | * {@link PackageManager#extendVerificationTimeout}. This is the |
| 1361 | * maximum time {@code PackageManager} waits for the verification |
| 1362 | * agent to return (in milliseconds). |
| 1363 | */ |
| 1364 | public static final long MAXIMUM_VERIFICATION_TIMEOUT = 60*60*1000; |
| 1365 | |
| 1366 | /** |
Amith Yamasani | 0b28549 | 2011-04-14 17:35:23 -0700 | [diff] [blame] | 1367 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: The device's |
| 1368 | * audio pipeline is low-latency, more suitable for audio applications sensitive to delays or |
| 1369 | * lag in sound input or output. |
Dan Morrill | 898e1e8 | 2010-09-26 17:28:30 -0700 | [diff] [blame] | 1370 | */ |
| 1371 | @SdkConstant(SdkConstantType.FEATURE) |
| 1372 | public static final String FEATURE_AUDIO_LOW_LATENCY = "android.hardware.audio.low_latency"; |
| 1373 | |
| 1374 | /** |
| 1375 | * Feature for {@link #getSystemAvailableFeatures} and |
Unsuk Jung | 50909f6 | 2014-09-02 18:25:49 -0700 | [diff] [blame] | 1376 | * {@link #hasSystemFeature}: The device includes at least one form of audio |
| 1377 | * output, such as speakers, audio jack or streaming over bluetooth |
| 1378 | */ |
| 1379 | @SdkConstant(SdkConstantType.FEATURE) |
| 1380 | public static final String FEATURE_AUDIO_OUTPUT = "android.hardware.audio.output"; |
| 1381 | |
| 1382 | /** |
Glenn Kasten | cdcb577 | 2015-05-06 15:54:49 -0700 | [diff] [blame] | 1383 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Glenn Kasten | 7587edc | 2015-10-30 17:45:52 -0700 | [diff] [blame] | 1384 | * The device has professional audio level of functionality and performance. |
Glenn Kasten | cdcb577 | 2015-05-06 15:54:49 -0700 | [diff] [blame] | 1385 | */ |
| 1386 | @SdkConstant(SdkConstantType.FEATURE) |
| 1387 | public static final String FEATURE_AUDIO_PRO = "android.hardware.audio.pro"; |
| 1388 | |
| 1389 | /** |
Unsuk Jung | 50909f6 | 2014-09-02 18:25:49 -0700 | [diff] [blame] | 1390 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1391 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 1392 | * other devices via Bluetooth. |
| 1393 | */ |
| 1394 | @SdkConstant(SdkConstantType.FEATURE) |
| 1395 | public static final String FEATURE_BLUETOOTH = "android.hardware.bluetooth"; |
| 1396 | |
| 1397 | /** |
| 1398 | * Feature for {@link #getSystemAvailableFeatures} and |
Matthew Xie | a722772 | 2013-04-18 15:25:59 -0700 | [diff] [blame] | 1399 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 1400 | * other devices via Bluetooth Low Energy radio. |
| 1401 | */ |
| 1402 | @SdkConstant(SdkConstantType.FEATURE) |
| 1403 | public static final String FEATURE_BLUETOOTH_LE = "android.hardware.bluetooth_le"; |
| 1404 | |
| 1405 | /** |
| 1406 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1407 | * {@link #hasSystemFeature}: The device has a camera facing away |
| 1408 | * from the screen. |
| 1409 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1410 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1411 | public static final String FEATURE_CAMERA = "android.hardware.camera"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1412 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1413 | /** |
| 1414 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1415 | * {@link #hasSystemFeature}: The device's camera supports auto-focus. |
| 1416 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1417 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1418 | public static final String FEATURE_CAMERA_AUTOFOCUS = "android.hardware.camera.autofocus"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1419 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1420 | /** |
| 1421 | * Feature for {@link #getSystemAvailableFeatures} and |
Eino-Ville Talvala | 752af83 | 2012-09-18 14:45:37 -0700 | [diff] [blame] | 1422 | * {@link #hasSystemFeature}: The device has at least one camera pointing in |
Eino-Ville Talvala | 9131da2 | 2014-05-08 11:39:53 -0700 | [diff] [blame] | 1423 | * 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] | 1424 | */ |
| 1425 | @SdkConstant(SdkConstantType.FEATURE) |
| 1426 | public static final String FEATURE_CAMERA_ANY = "android.hardware.camera.any"; |
| 1427 | |
| 1428 | /** |
| 1429 | * Feature for {@link #getSystemAvailableFeatures} and |
Eino-Ville Talvala | 9131da2 | 2014-05-08 11:39:53 -0700 | [diff] [blame] | 1430 | * {@link #hasSystemFeature}: The device can support having an external camera connected to it. |
| 1431 | * The external camera may not always be connected or available to applications to use. |
| 1432 | */ |
| 1433 | @SdkConstant(SdkConstantType.FEATURE) |
| 1434 | public static final String FEATURE_CAMERA_EXTERNAL = "android.hardware.camera.external"; |
| 1435 | |
| 1436 | /** |
| 1437 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1438 | * {@link #hasSystemFeature}: The device's camera supports flash. |
| 1439 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1440 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1441 | public static final String FEATURE_CAMERA_FLASH = "android.hardware.camera.flash"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1442 | |
| 1443 | /** |
| 1444 | * Feature for {@link #getSystemAvailableFeatures} and |
Chih-Chung Chang | de1057c | 2010-06-14 19:15:00 +0800 | [diff] [blame] | 1445 | * {@link #hasSystemFeature}: The device has a front facing camera. |
| 1446 | */ |
| 1447 | @SdkConstant(SdkConstantType.FEATURE) |
| 1448 | public static final String FEATURE_CAMERA_FRONT = "android.hardware.camera.front"; |
| 1449 | |
| 1450 | /** |
Eino-Ville Talvala | 611fece | 2014-07-10 17:29:38 -0700 | [diff] [blame] | 1451 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1452 | * of the cameras on the device supports the |
| 1453 | * {@link android.hardware.camera2.CameraCharacteristics#INFO_SUPPORTED_HARDWARE_LEVEL full hardware} |
| 1454 | * capability level. |
| 1455 | */ |
| 1456 | @SdkConstant(SdkConstantType.FEATURE) |
| 1457 | public static final String FEATURE_CAMERA_LEVEL_FULL = "android.hardware.camera.level.full"; |
| 1458 | |
| 1459 | /** |
| 1460 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1461 | * of the cameras on the device supports the |
| 1462 | * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_SENSOR manual sensor} |
| 1463 | * capability level. |
| 1464 | */ |
| 1465 | @SdkConstant(SdkConstantType.FEATURE) |
| 1466 | public static final String FEATURE_CAMERA_CAPABILITY_MANUAL_SENSOR = |
| 1467 | "android.hardware.camera.capability.manual_sensor"; |
| 1468 | |
| 1469 | /** |
| 1470 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1471 | * of the cameras on the device supports the |
| 1472 | * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_MANUAL_POST_PROCESSING manual post-processing} |
| 1473 | * capability level. |
| 1474 | */ |
| 1475 | @SdkConstant(SdkConstantType.FEATURE) |
| 1476 | public static final String FEATURE_CAMERA_CAPABILITY_MANUAL_POST_PROCESSING = |
| 1477 | "android.hardware.camera.capability.manual_post_processing"; |
| 1478 | |
| 1479 | /** |
| 1480 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: At least one |
| 1481 | * of the cameras on the device supports the |
| 1482 | * {@link android.hardware.camera2.CameraMetadata#REQUEST_AVAILABLE_CAPABILITIES_RAW RAW} |
| 1483 | * capability level. |
| 1484 | */ |
| 1485 | @SdkConstant(SdkConstantType.FEATURE) |
| 1486 | public static final String FEATURE_CAMERA_CAPABILITY_RAW = |
| 1487 | "android.hardware.camera.capability.raw"; |
| 1488 | |
| 1489 | /** |
Chih-Chung Chang | de1057c | 2010-06-14 19:15:00 +0800 | [diff] [blame] | 1490 | * Feature for {@link #getSystemAvailableFeatures} and |
Alex Ray | 0c9d61f | 2013-10-03 12:17:54 -0700 | [diff] [blame] | 1491 | * {@link #hasSystemFeature}: The device is capable of communicating with |
| 1492 | * consumer IR devices. |
| 1493 | */ |
| 1494 | @SdkConstant(SdkConstantType.FEATURE) |
| 1495 | public static final String FEATURE_CONSUMER_IR = "android.hardware.consumerir"; |
| 1496 | |
| 1497 | /** |
| 1498 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1499 | * {@link #hasSystemFeature}: The device supports one or more methods of |
| 1500 | * reporting current location. |
| 1501 | */ |
| 1502 | @SdkConstant(SdkConstantType.FEATURE) |
| 1503 | public static final String FEATURE_LOCATION = "android.hardware.location"; |
| 1504 | |
| 1505 | /** |
| 1506 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1507 | * {@link #hasSystemFeature}: The device has a Global Positioning System |
| 1508 | * receiver and can report precise location. |
| 1509 | */ |
| 1510 | @SdkConstant(SdkConstantType.FEATURE) |
| 1511 | public static final String FEATURE_LOCATION_GPS = "android.hardware.location.gps"; |
| 1512 | |
| 1513 | /** |
| 1514 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1515 | * {@link #hasSystemFeature}: The device can report location with coarse |
| 1516 | * accuracy using a network-based geolocation system. |
| 1517 | */ |
| 1518 | @SdkConstant(SdkConstantType.FEATURE) |
| 1519 | public static final String FEATURE_LOCATION_NETWORK = "android.hardware.location.network"; |
| 1520 | |
| 1521 | /** |
| 1522 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1523 | * {@link #hasSystemFeature}: The device can record audio via a |
| 1524 | * microphone. |
| 1525 | */ |
| 1526 | @SdkConstant(SdkConstantType.FEATURE) |
| 1527 | public static final String FEATURE_MICROPHONE = "android.hardware.microphone"; |
| 1528 | |
| 1529 | /** |
| 1530 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 76437d3 | 2010-09-01 11:17:20 -0700 | [diff] [blame] | 1531 | * {@link #hasSystemFeature}: The device can communicate using Near-Field |
| 1532 | * Communications (NFC). |
| 1533 | */ |
| 1534 | @SdkConstant(SdkConstantType.FEATURE) |
| 1535 | public static final String FEATURE_NFC = "android.hardware.nfc"; |
| 1536 | |
| 1537 | /** |
| 1538 | * Feature for {@link #getSystemAvailableFeatures} and |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1539 | * {@link #hasSystemFeature}: The device supports host- |
| 1540 | * based NFC card emulation. |
Martijn Coenen | df4d1d6 | 2013-08-28 11:18:58 -0700 | [diff] [blame] | 1541 | * |
| 1542 | * TODO remove when depending apps have moved to new constant. |
| 1543 | * @hide |
| 1544 | * @deprecated |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1545 | */ |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 1546 | @Deprecated |
Martijn Coenen | f4bf158 | 2013-07-22 12:01:19 -0700 | [diff] [blame] | 1547 | @SdkConstant(SdkConstantType.FEATURE) |
| 1548 | public static final String FEATURE_NFC_HCE = "android.hardware.nfc.hce"; |
| 1549 | |
| 1550 | /** |
| 1551 | * Feature for {@link #getSystemAvailableFeatures} and |
Martijn Coenen | df4d1d6 | 2013-08-28 11:18:58 -0700 | [diff] [blame] | 1552 | * {@link #hasSystemFeature}: The device supports host- |
| 1553 | * based NFC card emulation. |
| 1554 | */ |
| 1555 | @SdkConstant(SdkConstantType.FEATURE) |
| 1556 | public static final String FEATURE_NFC_HOST_CARD_EMULATION = "android.hardware.nfc.hce"; |
| 1557 | |
| 1558 | /** |
| 1559 | * Feature for {@link #getSystemAvailableFeatures} and |
Yoshinobu Ito | c52adfe | 2016-01-22 18:14:18 +0900 | [diff] [blame] | 1560 | * {@link #hasSystemFeature}: The device supports host- |
| 1561 | * based NFC-F card emulation. |
| 1562 | */ |
| 1563 | @SdkConstant(SdkConstantType.FEATURE) |
| 1564 | public static final String FEATURE_NFC_HOST_CARD_EMULATION_NFCF = "android.hardware.nfc.hcef"; |
| 1565 | |
| 1566 | /** |
| 1567 | * Feature for {@link #getSystemAvailableFeatures} and |
Jesse Hall | 7f51706 | 2014-07-18 11:54:41 -0700 | [diff] [blame] | 1568 | * {@link #hasSystemFeature}: The device supports the OpenGL ES |
| 1569 | * <a href="http://www.khronos.org/registry/gles/extensions/ANDROID/ANDROID_extension_pack_es31a.txt"> |
| 1570 | * Android Extension Pack</a>. |
| 1571 | */ |
| 1572 | @SdkConstant(SdkConstantType.FEATURE) |
| 1573 | public static final String FEATURE_OPENGLES_EXTENSION_PACK = "android.hardware.opengles.aep"; |
| 1574 | |
| 1575 | /** |
| 1576 | * Feature for {@link #getSystemAvailableFeatures} and |
Jesse Hall | f77a34f | 2016-02-04 18:41:33 -0800 | [diff] [blame] | 1577 | * {@link #hasSystemFeature}: If this feature is supported, the Vulkan native API will enumerate |
| 1578 | * at least one {@code VkPhysicalDevice}, and the feature version will indicate what |
| 1579 | * level of optional hardware features limits it supports. |
| 1580 | * <p> |
| 1581 | * Level 0 includes the base Vulkan requirements as well as: |
| 1582 | * <ul><li>{@code VkPhysicalDeviceFeatures::textureCompressionETC2}</li></ul> |
| 1583 | * <p> |
| 1584 | * Level 1 additionally includes: |
| 1585 | * <ul> |
| 1586 | * <li>{@code VkPhysicalDeviceFeatures::fullDrawIndexUint32}</li> |
| 1587 | * <li>{@code VkPhysicalDeviceFeatures::imageCubeArray}</li> |
| 1588 | * <li>{@code VkPhysicalDeviceFeatures::independentBlend}</li> |
| 1589 | * <li>{@code VkPhysicalDeviceFeatures::geometryShader}</li> |
| 1590 | * <li>{@code VkPhysicalDeviceFeatures::tessellationShader}</li> |
| 1591 | * <li>{@code VkPhysicalDeviceFeatures::sampleRateShading}</li> |
| 1592 | * <li>{@code VkPhysicalDeviceFeatures::textureCompressionASTC_LDR}</li> |
| 1593 | * <li>{@code VkPhysicalDeviceFeatures::fragmentStoresAndAtomics}</li> |
| 1594 | * <li>{@code VkPhysicalDeviceFeatures::shaderImageGatherExtended}</li> |
| 1595 | * <li>{@code VkPhysicalDeviceFeatures::shaderUniformBufferArrayDynamicIndexing}</li> |
| 1596 | * <li>{@code VkPhysicalDeviceFeatures::shaderSampledImageArrayDynamicIndexing}</li> |
| 1597 | * </ul> |
| 1598 | */ |
| 1599 | @SdkConstant(SdkConstantType.FEATURE) |
| 1600 | public static final String FEATURE_VULKAN_HARDWARE_LEVEL = "android.hardware.vulkan.level"; |
| 1601 | |
| 1602 | /** |
| 1603 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1604 | * {@link #hasSystemFeature}: The version of this feature indicates the highest |
| 1605 | * {@code VkPhysicalDeviceProperties::apiVersion} supported by the physical devices that support |
| 1606 | * the hardware level indicated by {@link #FEATURE_VULKAN_HARDWARE_LEVEL}. The feature version |
| 1607 | * uses the same encoding as Vulkan version numbers: |
| 1608 | * <ul> |
| 1609 | * <li>Major version number in bits 31-22</li> |
| 1610 | * <li>Minor version number in bits 21-12</li> |
| 1611 | * <li>Patch version number in bits 11-0</li> |
| 1612 | * </ul> |
| 1613 | */ |
| 1614 | @SdkConstant(SdkConstantType.FEATURE) |
| 1615 | public static final String FEATURE_VULKAN_HARDWARE_VERSION = "android.hardware.vulkan.version"; |
| 1616 | |
| 1617 | /** |
| 1618 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1619 | * {@link #hasSystemFeature}: The device includes an accelerometer. |
| 1620 | */ |
| 1621 | @SdkConstant(SdkConstantType.FEATURE) |
| 1622 | public static final String FEATURE_SENSOR_ACCELEROMETER = "android.hardware.sensor.accelerometer"; |
| 1623 | |
| 1624 | /** |
| 1625 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1626 | * {@link #hasSystemFeature}: The device includes a barometer (air |
| 1627 | * pressure sensor.) |
| 1628 | */ |
| 1629 | @SdkConstant(SdkConstantType.FEATURE) |
| 1630 | public static final String FEATURE_SENSOR_BAROMETER = "android.hardware.sensor.barometer"; |
| 1631 | |
| 1632 | /** |
| 1633 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1634 | * {@link #hasSystemFeature}: The device includes a magnetometer (compass). |
| 1635 | */ |
| 1636 | @SdkConstant(SdkConstantType.FEATURE) |
| 1637 | public static final String FEATURE_SENSOR_COMPASS = "android.hardware.sensor.compass"; |
| 1638 | |
| 1639 | /** |
| 1640 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1641 | * {@link #hasSystemFeature}: The device includes a gyroscope. |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1642 | */ |
| 1643 | @SdkConstant(SdkConstantType.FEATURE) |
Dan Morrill | 5744bb4 | 2010-09-01 19:18:57 -0700 | [diff] [blame] | 1644 | public static final String FEATURE_SENSOR_GYROSCOPE = "android.hardware.sensor.gyroscope"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1645 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1646 | /** |
| 1647 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1648 | * {@link #hasSystemFeature}: The device includes a light sensor. |
| 1649 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1650 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1651 | public static final String FEATURE_SENSOR_LIGHT = "android.hardware.sensor.light"; |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1652 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1653 | /** |
| 1654 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1655 | * {@link #hasSystemFeature}: The device includes a proximity sensor. |
| 1656 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1657 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1658 | public static final String FEATURE_SENSOR_PROXIMITY = "android.hardware.sensor.proximity"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1659 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1660 | /** |
| 1661 | * Feature for {@link #getSystemAvailableFeatures} and |
Aravind Akella | 068b0c0 | 2013-10-12 17:39:15 -0700 | [diff] [blame] | 1662 | * {@link #hasSystemFeature}: The device includes a hardware step counter. |
| 1663 | */ |
| 1664 | @SdkConstant(SdkConstantType.FEATURE) |
| 1665 | public static final String FEATURE_SENSOR_STEP_COUNTER = "android.hardware.sensor.stepcounter"; |
| 1666 | |
| 1667 | /** |
| 1668 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1669 | * {@link #hasSystemFeature}: The device includes a hardware step detector. |
| 1670 | */ |
| 1671 | @SdkConstant(SdkConstantType.FEATURE) |
| 1672 | public static final String FEATURE_SENSOR_STEP_DETECTOR = "android.hardware.sensor.stepdetector"; |
| 1673 | |
| 1674 | /** |
| 1675 | * Feature for {@link #getSystemAvailableFeatures} and |
Vinod Krishnan | 8afb23c | 2014-04-30 11:11:39 -0700 | [diff] [blame] | 1676 | * {@link #hasSystemFeature}: The device includes a heart rate monitor. |
| 1677 | */ |
| 1678 | @SdkConstant(SdkConstantType.FEATURE) |
| 1679 | public static final String FEATURE_SENSOR_HEART_RATE = "android.hardware.sensor.heartrate"; |
| 1680 | |
| 1681 | /** |
| 1682 | * Feature for {@link #getSystemAvailableFeatures} and |
Vinod Krishnan | 1ab7689 | 2014-08-20 11:11:55 -0700 | [diff] [blame] | 1683 | * {@link #hasSystemFeature}: The heart rate sensor on this device is an Electrocargiogram. |
| 1684 | */ |
| 1685 | @SdkConstant(SdkConstantType.FEATURE) |
| 1686 | public static final String FEATURE_SENSOR_HEART_RATE_ECG = |
| 1687 | "android.hardware.sensor.heartrate.ecg"; |
| 1688 | |
| 1689 | /** |
| 1690 | * Feature for {@link #getSystemAvailableFeatures} and |
Aravind Akella | 8b8e74b | 2014-07-09 11:52:39 -0700 | [diff] [blame] | 1691 | * {@link #hasSystemFeature}: The device includes a relative humidity sensor. |
| 1692 | */ |
| 1693 | @SdkConstant(SdkConstantType.FEATURE) |
| 1694 | public static final String FEATURE_SENSOR_RELATIVE_HUMIDITY = |
| 1695 | "android.hardware.sensor.relative_humidity"; |
| 1696 | |
| 1697 | /** |
| 1698 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1699 | * {@link #hasSystemFeature}: The device includes an ambient temperature sensor. |
| 1700 | */ |
| 1701 | @SdkConstant(SdkConstantType.FEATURE) |
| 1702 | public static final String FEATURE_SENSOR_AMBIENT_TEMPERATURE = |
| 1703 | "android.hardware.sensor.ambient_temperature"; |
| 1704 | |
| 1705 | /** |
| 1706 | * Feature for {@link #getSystemAvailableFeatures} and |
Ashutosh Joshi | eae371b | 2015-04-09 10:30:07 -0700 | [diff] [blame] | 1707 | * {@link #hasSystemFeature}: The device supports high fidelity sensor processing |
| 1708 | * capabilities. |
| 1709 | */ |
| 1710 | @SdkConstant(SdkConstantType.FEATURE) |
| 1711 | public static final String FEATURE_HIFI_SENSORS = |
| 1712 | "android.hardware.sensor.hifi_sensors"; |
| 1713 | |
| 1714 | /** |
| 1715 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1716 | * {@link #hasSystemFeature}: The device has a telephony radio with data |
| 1717 | * communication support. |
| 1718 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1719 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1720 | public static final String FEATURE_TELEPHONY = "android.hardware.telephony"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [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 has a CDMA telephony stack. |
| 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_TELEPHONY_CDMA = "android.hardware.telephony.cdma"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [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 has a GSM telephony stack. |
| 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_TELEPHONY_GSM = "android.hardware.telephony.gsm"; |
Hung-ying Tyan | 3424c02 | 2010-08-27 18:08:19 +0800 | [diff] [blame] | 1735 | |
| 1736 | /** |
| 1737 | * Feature for {@link #getSystemAvailableFeatures} and |
Mike Lockwood | f4ca247 | 2011-02-27 11:23:25 -0800 | [diff] [blame] | 1738 | * {@link #hasSystemFeature}: The device supports connecting to USB devices |
| 1739 | * as the USB host. |
| 1740 | */ |
| 1741 | @SdkConstant(SdkConstantType.FEATURE) |
| 1742 | public static final String FEATURE_USB_HOST = "android.hardware.usb.host"; |
| 1743 | |
| 1744 | /** |
| 1745 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1746 | * {@link #hasSystemFeature}: The device supports connecting to USB accessories. |
| 1747 | */ |
| 1748 | @SdkConstant(SdkConstantType.FEATURE) |
| 1749 | public static final String FEATURE_USB_ACCESSORY = "android.hardware.usb.accessory"; |
| 1750 | |
| 1751 | /** |
| 1752 | * Feature for {@link #getSystemAvailableFeatures} and |
Hung-ying Tyan | 3424c02 | 2010-08-27 18:08:19 +0800 | [diff] [blame] | 1753 | * {@link #hasSystemFeature}: The SIP API is enabled on the device. |
| 1754 | */ |
| 1755 | @SdkConstant(SdkConstantType.FEATURE) |
| 1756 | public static final String FEATURE_SIP = "android.software.sip"; |
| 1757 | |
| 1758 | /** |
| 1759 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1760 | * {@link #hasSystemFeature}: The device supports SIP-based VOIP. |
| 1761 | */ |
| 1762 | @SdkConstant(SdkConstantType.FEATURE) |
| 1763 | public static final String FEATURE_SIP_VOIP = "android.software.sip.voip"; |
| 1764 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1765 | /** |
| 1766 | * Feature for {@link #getSystemAvailableFeatures} and |
Ihab Awad | 1ec6888 | 2014-09-12 11:09:01 -0700 | [diff] [blame] | 1767 | * {@link #hasSystemFeature}: The Connection Service API is enabled on the device. |
| 1768 | */ |
| 1769 | @SdkConstant(SdkConstantType.FEATURE) |
| 1770 | public static final String FEATURE_CONNECTION_SERVICE = "android.software.connectionservice"; |
| 1771 | |
| 1772 | /** |
| 1773 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | b0fe033 | 2010-04-05 14:43:58 -0700 | [diff] [blame] | 1774 | * {@link #hasSystemFeature}: The device's display has a touch screen. |
| 1775 | */ |
| 1776 | @SdkConstant(SdkConstantType.FEATURE) |
| 1777 | public static final String FEATURE_TOUCHSCREEN = "android.hardware.touchscreen"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1778 | |
Dan Morrill | b0fe033 | 2010-04-05 14:43:58 -0700 | [diff] [blame] | 1779 | /** |
| 1780 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1781 | * {@link #hasSystemFeature}: The device's touch screen supports |
| 1782 | * multitouch sufficient for basic two-finger gesture detection. |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1783 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1784 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1785 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH = "android.hardware.touchscreen.multitouch"; |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 1786 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1787 | /** |
| 1788 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1789 | * {@link #hasSystemFeature}: The device's touch screen is capable of |
| 1790 | * tracking two or more fingers fully independently. |
| 1791 | */ |
| 1792 | @SdkConstant(SdkConstantType.FEATURE) |
| 1793 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT = "android.hardware.touchscreen.multitouch.distinct"; |
| 1794 | |
| 1795 | /** |
| 1796 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 6993d3d | 2010-09-03 14:30:14 -0700 | [diff] [blame] | 1797 | * {@link #hasSystemFeature}: The device's touch screen is capable of |
| 1798 | * tracking a full hand of fingers fully independently -- that is, 5 or |
| 1799 | * more simultaneous independent pointers. |
| 1800 | */ |
| 1801 | @SdkConstant(SdkConstantType.FEATURE) |
| 1802 | public static final String FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND = "android.hardware.touchscreen.multitouch.jazzhand"; |
| 1803 | |
| 1804 | /** |
| 1805 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | a537687 | 2011-01-23 13:15:53 -0800 | [diff] [blame] | 1806 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 1807 | * does support touch emulation for basic events. For instance, the |
| 1808 | * device might use a mouse or remote control to drive a cursor, and |
| 1809 | * emulate basic touch pointer events like down, up, drag, etc. All |
| 1810 | * devices that support android.hardware.touchscreen or a sub-feature are |
| 1811 | * presumed to also support faketouch. |
| 1812 | */ |
| 1813 | @SdkConstant(SdkConstantType.FEATURE) |
| 1814 | public static final String FEATURE_FAKETOUCH = "android.hardware.faketouch"; |
| 1815 | |
| 1816 | /** |
| 1817 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | e22fe93 | 2011-06-08 20:24:29 -0700 | [diff] [blame] | 1818 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 1819 | * does support touch emulation for basic events that supports distinct |
| 1820 | * tracking of two or more fingers. This is an extension of |
| 1821 | * {@link #FEATURE_FAKETOUCH} for input devices with this capability. Note |
| 1822 | * that unlike a distinct multitouch screen as defined by |
| 1823 | * {@link #FEATURE_TOUCHSCREEN_MULTITOUCH_DISTINCT}, these kinds of input |
| 1824 | * devices will not actually provide full two-finger gestures since the |
| 1825 | * input is being transformed to cursor movement on the screen. That is, |
| 1826 | * single finger gestures will move a cursor; two-finger swipes will |
| 1827 | * result in single-finger touch events; other two-finger gestures will |
| 1828 | * result in the corresponding two-finger touch event. |
| 1829 | */ |
| 1830 | @SdkConstant(SdkConstantType.FEATURE) |
| 1831 | public static final String FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT = "android.hardware.faketouch.multitouch.distinct"; |
| 1832 | |
| 1833 | /** |
| 1834 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1835 | * {@link #hasSystemFeature}: The device does not have a touch screen, but |
| 1836 | * does support touch emulation for basic events that supports tracking |
| 1837 | * a hand of fingers (5 or more fingers) fully independently. |
| 1838 | * This is an extension of |
| 1839 | * {@link #FEATURE_FAKETOUCH} for input devices with this capability. Note |
| 1840 | * that unlike a multitouch screen as defined by |
| 1841 | * {@link #FEATURE_TOUCHSCREEN_MULTITOUCH_JAZZHAND}, not all two finger |
| 1842 | * gestures can be detected due to the limitations described for |
| 1843 | * {@link #FEATURE_FAKETOUCH_MULTITOUCH_DISTINCT}. |
| 1844 | */ |
| 1845 | @SdkConstant(SdkConstantType.FEATURE) |
| 1846 | public static final String FEATURE_FAKETOUCH_MULTITOUCH_JAZZHAND = "android.hardware.faketouch.multitouch.jazzhand"; |
| 1847 | |
| 1848 | /** |
| 1849 | * Feature for {@link #getSystemAvailableFeatures} and |
Jim Miller | d9b9d41 | 2015-07-22 19:51:40 -0700 | [diff] [blame] | 1850 | * {@link #hasSystemFeature}: The device has biometric hardware to detect a fingerprint. |
| 1851 | */ |
| 1852 | @SdkConstant(SdkConstantType.FEATURE) |
| 1853 | public static final String FEATURE_FINGERPRINT = "android.hardware.fingerprint"; |
| 1854 | |
| 1855 | /** |
| 1856 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | e289bff | 2011-06-13 19:33:22 -0700 | [diff] [blame] | 1857 | * {@link #hasSystemFeature}: The device supports portrait orientation |
| 1858 | * screens. For backwards compatibility, you can assume that if neither |
| 1859 | * this nor {@link #FEATURE_SCREEN_LANDSCAPE} is set then the device supports |
| 1860 | * both portrait and landscape. |
| 1861 | */ |
| 1862 | @SdkConstant(SdkConstantType.FEATURE) |
| 1863 | public static final String FEATURE_SCREEN_PORTRAIT = "android.hardware.screen.portrait"; |
| 1864 | |
| 1865 | /** |
| 1866 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1867 | * {@link #hasSystemFeature}: The device supports landscape orientation |
| 1868 | * screens. For backwards compatibility, you can assume that if neither |
| 1869 | * this nor {@link #FEATURE_SCREEN_PORTRAIT} is set then the device supports |
| 1870 | * both portrait and landscape. |
| 1871 | */ |
| 1872 | @SdkConstant(SdkConstantType.FEATURE) |
| 1873 | public static final String FEATURE_SCREEN_LANDSCAPE = "android.hardware.screen.landscape"; |
| 1874 | |
| 1875 | /** |
| 1876 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1877 | * {@link #hasSystemFeature}: The device supports live wallpapers. |
| 1878 | */ |
Xavier Ducrohet | 3274b9b | 2009-12-14 17:52:20 -0800 | [diff] [blame] | 1879 | @SdkConstant(SdkConstantType.FEATURE) |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 1880 | public static final String FEATURE_LIVE_WALLPAPER = "android.software.live_wallpaper"; |
Oscar Montemayor | 1228d0a | 2010-01-28 12:01:44 -0800 | [diff] [blame] | 1881 | /** |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1882 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 119bbc3 | 2013-03-22 17:27:25 -0700 | [diff] [blame] | 1883 | * {@link #hasSystemFeature}: The device supports app widgets. |
| 1884 | */ |
| 1885 | @SdkConstant(SdkConstantType.FEATURE) |
| 1886 | public static final String FEATURE_APP_WIDGETS = "android.software.app_widgets"; |
| 1887 | |
| 1888 | /** |
Dianne Hackborn | 91097de | 2014-04-04 18:02:06 -0700 | [diff] [blame] | 1889 | * @hide |
| 1890 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1891 | * {@link #hasSystemFeature}: The device supports |
| 1892 | * {@link android.service.voice.VoiceInteractionService} and |
| 1893 | * {@link android.app.VoiceInteractor}. |
| 1894 | */ |
| 1895 | @SdkConstant(SdkConstantType.FEATURE) |
| 1896 | public static final String FEATURE_VOICE_RECOGNIZERS = "android.software.voice_recognizers"; |
| 1897 | |
| 1898 | |
| 1899 | /** |
Dianne Hackborn | 119bbc3 | 2013-03-22 17:27:25 -0700 | [diff] [blame] | 1900 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1901 | * {@link #hasSystemFeature}: The device supports a home screen that is replaceable |
| 1902 | * by third party applications. |
| 1903 | */ |
| 1904 | @SdkConstant(SdkConstantType.FEATURE) |
| 1905 | public static final String FEATURE_HOME_SCREEN = "android.software.home_screen"; |
| 1906 | |
| 1907 | /** |
| 1908 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1909 | * {@link #hasSystemFeature}: The device supports adding new input methods implemented |
| 1910 | * with the {@link android.inputmethodservice.InputMethodService} API. |
| 1911 | */ |
| 1912 | @SdkConstant(SdkConstantType.FEATURE) |
| 1913 | public static final String FEATURE_INPUT_METHODS = "android.software.input_methods"; |
| 1914 | |
| 1915 | /** |
| 1916 | * Feature for {@link #getSystemAvailableFeatures} and |
Amith Yamasani | 44a01b7 | 2013-09-16 10:44:57 -0700 | [diff] [blame] | 1917 | * {@link #hasSystemFeature}: The device supports device policy enforcement via device admins. |
| 1918 | */ |
| 1919 | @SdkConstant(SdkConstantType.FEATURE) |
| 1920 | public static final String FEATURE_DEVICE_ADMIN = "android.software.device_admin"; |
| 1921 | |
| 1922 | /** |
| 1923 | * Feature for {@link #getSystemAvailableFeatures} and |
Tim Kilbourn | f94b6a9 | 2014-03-07 15:13:48 -0800 | [diff] [blame] | 1924 | * {@link #hasSystemFeature}: The device supports leanback UI. This is |
| 1925 | * typically used in a living room television experience, but is a software |
| 1926 | * feature unlike {@link #FEATURE_TELEVISION}. Devices running with this |
| 1927 | * feature will use resources associated with the "television" UI mode. |
| 1928 | */ |
| 1929 | @SdkConstant(SdkConstantType.FEATURE) |
| 1930 | public static final String FEATURE_LEANBACK = "android.software.leanback"; |
| 1931 | |
| 1932 | /** |
| 1933 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1934 | * {@link #hasSystemFeature}: The device supports only leanback UI. Only |
| 1935 | * applications designed for this experience should be run, though this is |
| 1936 | * not enforced by the system. |
| 1937 | * @hide |
| 1938 | */ |
| 1939 | @SdkConstant(SdkConstantType.FEATURE) |
| 1940 | public static final String FEATURE_LEANBACK_ONLY = "android.software.leanback_only"; |
| 1941 | |
| 1942 | /** |
| 1943 | * Feature for {@link #getSystemAvailableFeatures} and |
Jae Seo | cfd861e | 2014-08-27 14:02:15 -0700 | [diff] [blame] | 1944 | * {@link #hasSystemFeature}: The device supports live TV and can display |
| 1945 | * contents from TV inputs implemented with the |
| 1946 | * {@link android.media.tv.TvInputService} API. |
| 1947 | */ |
| 1948 | @SdkConstant(SdkConstantType.FEATURE) |
| 1949 | public static final String FEATURE_LIVE_TV = "android.software.live_tv"; |
| 1950 | |
| 1951 | /** |
| 1952 | * Feature for {@link #getSystemAvailableFeatures} and |
Dan Morrill | 50ab63f | 2010-03-05 16:16:19 -0800 | [diff] [blame] | 1953 | * {@link #hasSystemFeature}: The device supports WiFi (802.11) networking. |
| 1954 | */ |
| 1955 | @SdkConstant(SdkConstantType.FEATURE) |
| 1956 | public static final String FEATURE_WIFI = "android.hardware.wifi"; |
| 1957 | |
| 1958 | /** |
Irfan Sheriff | 45b8b46 | 2011-09-07 11:24:16 -0700 | [diff] [blame] | 1959 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1960 | * {@link #hasSystemFeature}: The device supports Wi-Fi Direct networking. |
| 1961 | */ |
| 1962 | @SdkConstant(SdkConstantType.FEATURE) |
| 1963 | public static final String FEATURE_WIFI_DIRECT = "android.hardware.wifi.direct"; |
| 1964 | |
| 1965 | /** |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 1966 | * Feature for {@link #getSystemAvailableFeatures} and |
Etan Cohen | 20d329b | 2015-09-29 13:49:02 -0700 | [diff] [blame] | 1967 | * {@link #hasSystemFeature}: The device supports Wi-Fi Aware (NAN) |
| 1968 | * networking. |
| 1969 | * |
| 1970 | * @hide PROPOSED_NAN_API |
| 1971 | */ |
| 1972 | @SdkConstant(SdkConstantType.FEATURE) |
| 1973 | public static final String FEATURE_WIFI_NAN = "android.hardware.wifi.nan"; |
| 1974 | |
| 1975 | /** |
| 1976 | * Feature for {@link #getSystemAvailableFeatures} and |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 1977 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
Todd Kennedy | 7f95a00 | 2015-04-22 14:28:25 -0700 | [diff] [blame] | 1978 | * on a vehicle headunit. A headunit here is defined to be inside a |
| 1979 | * vehicle that may or may not be moving. A headunit uses either a |
| 1980 | * primary display in the center console and/or additional displays in |
| 1981 | * the instrument cluster or elsewhere in the vehicle. Headunit display(s) |
| 1982 | * have limited size and resolution. The user will likely be focused on |
| 1983 | * driving so limiting driver distraction is a primary concern. User input |
| 1984 | * can be a variety of hard buttons, touch, rotary controllers and even mouse- |
| 1985 | * like interfaces. |
| 1986 | */ |
| 1987 | @SdkConstant(SdkConstantType.FEATURE) |
| 1988 | public static final String FEATURE_AUTOMOTIVE = "android.hardware.type.automotive"; |
| 1989 | |
| 1990 | /** |
| 1991 | * Feature for {@link #getSystemAvailableFeatures} and |
| 1992 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 1993 | * on a television. Television here is defined to be a typical living |
| 1994 | * room television experience: displayed on a big screen, where the user |
| 1995 | * is sitting far away from it, and the dominant form of input will be |
| 1996 | * something like a DPAD, not through touch or mouse. |
Tim Kilbourn | f94b6a9 | 2014-03-07 15:13:48 -0800 | [diff] [blame] | 1997 | * @deprecated use {@link #FEATURE_LEANBACK} instead. |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 1998 | */ |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 1999 | @Deprecated |
Dianne Hackborn | 0cf2c8a | 2012-05-17 17:29:49 -0700 | [diff] [blame] | 2000 | @SdkConstant(SdkConstantType.FEATURE) |
| 2001 | public static final String FEATURE_TELEVISION = "android.hardware.type.television"; |
| 2002 | |
| 2003 | /** |
Justin Koh | b5731f091c | 2014-02-13 16:06:59 -0800 | [diff] [blame] | 2004 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2005 | * {@link #hasSystemFeature}: This is a device dedicated to showing UI |
| 2006 | * on a watch. A watch here is defined to be a device worn on the body, perhaps on |
| 2007 | * the wrist. The user is very close when interacting with the device. |
| 2008 | */ |
| 2009 | @SdkConstant(SdkConstantType.FEATURE) |
| 2010 | public static final String FEATURE_WATCH = "android.hardware.type.watch"; |
| 2011 | |
| 2012 | /** |
Adam Lesinski | 3d9bcb9 | 2014-02-18 14:05:14 -0800 | [diff] [blame] | 2013 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2014 | * The device supports printing. |
| 2015 | */ |
| 2016 | @SdkConstant(SdkConstantType.FEATURE) |
| 2017 | public static final String FEATURE_PRINTING = "android.software.print"; |
| 2018 | |
| 2019 | /** |
| 2020 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2021 | * The device can perform backup and restore operations on installed applications. |
| 2022 | */ |
| 2023 | @SdkConstant(SdkConstantType.FEATURE) |
| 2024 | public static final String FEATURE_BACKUP = "android.software.backup"; |
| 2025 | |
| 2026 | /** |
Vladislav Kaznacheev | d303b25 | 2015-10-27 17:30:58 -0700 | [diff] [blame] | 2027 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2028 | * {@link #hasSystemFeature}: The device supports freeform window management. |
| 2029 | * Windows have title bars and can be moved and resized. |
| 2030 | */ |
Filip Gruszczynski | 811dc3b | 2015-11-23 12:34:22 -0800 | [diff] [blame] | 2031 | // If this feature is present, you also need to set |
| 2032 | // com.android.internal.R.config_freeformWindowManagement to true in your configuration overlay. |
Vladislav Kaznacheev | d303b25 | 2015-10-27 17:30:58 -0700 | [diff] [blame] | 2033 | @SdkConstant(SdkConstantType.FEATURE) |
| 2034 | public static final String FEATURE_FREEFORM_WINDOW_MANAGEMENT |
| 2035 | = "android.software.freeform_window_management"; |
| 2036 | |
| 2037 | /** |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 2038 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Wale Ogunwale | fbe12c4 | 2015-12-06 16:23:50 -0800 | [diff] [blame] | 2039 | * The device supports picture-in-picture multi-window mode. |
| 2040 | */ |
| 2041 | @SdkConstant(SdkConstantType.FEATURE) |
| 2042 | public static final String FEATURE_PICTURE_IN_PICTURE = "android.software.picture_in_picture"; |
| 2043 | |
| 2044 | /** |
| 2045 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Amith Yamasani | 1d65327 | 2014-09-11 17:56:05 -0700 | [diff] [blame] | 2046 | * The device supports creating secondary users and managed profiles via |
| 2047 | * {@link DevicePolicyManager}. |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 2048 | */ |
| 2049 | @SdkConstant(SdkConstantType.FEATURE) |
Amith Yamasani | 1d65327 | 2014-09-11 17:56:05 -0700 | [diff] [blame] | 2050 | public static final String FEATURE_MANAGED_USERS = "android.software.managed_users"; |
| 2051 | |
| 2052 | /** |
| 2053 | * @hide |
| 2054 | * TODO: Remove after dependencies updated b/17392243 |
| 2055 | */ |
| 2056 | public static final String FEATURE_MANAGED_PROFILES = "android.software.managed_users"; |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 2057 | |
| 2058 | /** |
Ben Murdoch | f564c7f | 2014-05-20 18:58:06 +0100 | [diff] [blame] | 2059 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Adam Connors | 19ccb5f | 2014-09-08 17:31:50 +0100 | [diff] [blame] | 2060 | * The device supports verified boot. |
| 2061 | */ |
| 2062 | @SdkConstant(SdkConstantType.FEATURE) |
| 2063 | public static final String FEATURE_VERIFIED_BOOT = "android.software.verified_boot"; |
| 2064 | |
| 2065 | /** |
| 2066 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2067 | * The device supports secure removal of users. When a user is deleted the data associated |
| 2068 | * with that user is securely deleted and no longer available. |
| 2069 | */ |
| 2070 | @SdkConstant(SdkConstantType.FEATURE) |
| 2071 | public static final String FEATURE_SECURELY_REMOVES_USERS |
| 2072 | = "android.software.securely_removes_users"; |
| 2073 | |
Jeff Sharkey | b92b05b | 2016-01-28 09:50:00 -0700 | [diff] [blame] | 2074 | /** {@hide} */ |
| 2075 | @SdkConstant(SdkConstantType.FEATURE) |
| 2076 | public static final String FEATURE_FILE_BASED_ENCRYPTION |
| 2077 | = "android.software.file_based_encryption"; |
| 2078 | |
Adam Connors | 19ccb5f | 2014-09-08 17:31:50 +0100 | [diff] [blame] | 2079 | /** |
| 2080 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
Ben Murdoch | 422c7a5 | 2014-05-16 13:45:47 +0100 | [diff] [blame] | 2081 | * The device has a full implementation of the android.webkit.* APIs. Devices |
| 2082 | * lacking this feature will not have a functioning WebView implementation. |
| 2083 | */ |
| 2084 | @SdkConstant(SdkConstantType.FEATURE) |
| 2085 | public static final String FEATURE_WEBVIEW = "android.software.webview"; |
| 2086 | |
| 2087 | /** |
Joe LaPenna | 4bb015d | 2014-07-04 17:15:54 -0700 | [diff] [blame] | 2088 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2089 | * {@link #hasSystemFeature}: This device supports ethernet. |
Joe LaPenna | 4bb015d | 2014-07-04 17:15:54 -0700 | [diff] [blame] | 2090 | */ |
| 2091 | @SdkConstant(SdkConstantType.FEATURE) |
| 2092 | public static final String FEATURE_ETHERNET = "android.hardware.ethernet"; |
| 2093 | |
| 2094 | /** |
Yuncheol Heo | a0c4a06 | 2014-07-10 20:49:27 +0900 | [diff] [blame] | 2095 | * Feature for {@link #getSystemAvailableFeatures} and |
| 2096 | * {@link #hasSystemFeature}: This device supports HDMI-CEC. |
| 2097 | * @hide |
| 2098 | */ |
| 2099 | @SdkConstant(SdkConstantType.FEATURE) |
| 2100 | public static final String FEATURE_HDMI_CEC = "android.hardware.hdmi.cec"; |
| 2101 | |
| 2102 | /** |
Michael Wright | 6faa675 | 2014-09-05 17:57:44 -0700 | [diff] [blame] | 2103 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2104 | * The device has all of the inputs necessary to be considered a compatible game controller, or |
| 2105 | * includes a compatible game controller in the box. |
| 2106 | */ |
| 2107 | @SdkConstant(SdkConstantType.FEATURE) |
| 2108 | public static final String FEATURE_GAMEPAD = "android.hardware.gamepad"; |
| 2109 | |
Mike Lockwood | 5781cd5 | 2015-03-27 13:23:41 -0700 | [diff] [blame] | 2110 | /** |
| 2111 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2112 | * The device has a full implementation of the android.media.midi.* APIs. |
| 2113 | */ |
| 2114 | @SdkConstant(SdkConstantType.FEATURE) |
| 2115 | public static final String FEATURE_MIDI = "android.software.midi"; |
Michael Wright | 6faa675 | 2014-09-05 17:57:44 -0700 | [diff] [blame] | 2116 | |
| 2117 | /** |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2118 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2119 | * The device implements a an optimized mode for virtual reality (VR) applications that handles |
| 2120 | * stereoscopic rendering of notifications, and may potentially also include optimizations to |
Ruben Brunk | 31d80ea | 2016-01-25 20:14:08 -0800 | [diff] [blame] | 2121 | * reduce latency in the graphics, display, and sensor stacks. |
Ruben Brunk | dd18a0b | 2015-12-04 16:16:31 -0800 | [diff] [blame] | 2122 | */ |
| 2123 | @SdkConstant(SdkConstantType.FEATURE) |
| 2124 | public static final String FEATURE_VR_MODE = "android.software.vr.mode"; |
| 2125 | |
| 2126 | /** |
Ruben Brunk | 31d80ea | 2016-01-25 20:14:08 -0800 | [diff] [blame] | 2127 | * Feature for {@link #getSystemAvailableFeatures} and {@link #hasSystemFeature}: |
| 2128 | * The device implements {@link #FEATURE_VR_MODE} but additionally meets all CTS requirements |
| 2129 | * to be certified as a "VR Ready" device, which guarantees that the device is capable of |
| 2130 | * delivering consistent performance at a high framerate over an extended period of time for |
| 2131 | * typical VR application CPU/GPU workloads with a minimal number of frame drops, implements |
| 2132 | * {@link #FEATURE_HIFI_SENSORS} with a low sensor latency, implements an optimized render path |
| 2133 | * to minimize latency to draw to the device's main display, and includes optimizations to |
| 2134 | * lower display persistence to an acceptable level. |
| 2135 | */ |
| 2136 | @SdkConstant(SdkConstantType.FEATURE) |
| 2137 | public static final String FEATURE_VR_MODE_HIGH_PERFORMANCE |
| 2138 | = "android.hardware.vr.high_performance"; |
| 2139 | |
| 2140 | /** |
Dianne Hackborn | e83cefce | 2010-02-04 17:38:14 -0800 | [diff] [blame] | 2141 | * Action to external storage service to clean out removed apps. |
| 2142 | * @hide |
| 2143 | */ |
| 2144 | public static final String ACTION_CLEAN_EXTERNAL_STORAGE |
| 2145 | = "android.content.pm.CLEAN_EXTERNAL_STORAGE"; |
Oscar Montemayor | 1228d0a | 2010-01-28 12:01:44 -0800 | [diff] [blame] | 2146 | |
Dianne Hackborn | 08ee42c | 2009-11-19 17:08:01 -0800 | [diff] [blame] | 2147 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 2148 | * Extra field name for the URI to a verification file. Passed to a package |
| 2149 | * verifier. |
| 2150 | * |
| 2151 | * @hide |
| 2152 | */ |
| 2153 | public static final String EXTRA_VERIFICATION_URI = "android.content.pm.extra.VERIFICATION_URI"; |
| 2154 | |
| 2155 | /** |
| 2156 | * Extra field name for the ID of a package pending verification. Passed to |
| 2157 | * a package verifier and is used to call back to |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 2158 | * {@link PackageManager#verifyPendingInstall(int, int)} |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 2159 | */ |
| 2160 | public static final String EXTRA_VERIFICATION_ID = "android.content.pm.extra.VERIFICATION_ID"; |
| 2161 | |
| 2162 | /** |
| 2163 | * Extra field name for the package identifier which is trying to install |
| 2164 | * the package. |
| 2165 | * |
| 2166 | * @hide |
| 2167 | */ |
| 2168 | public static final String EXTRA_VERIFICATION_INSTALLER_PACKAGE |
| 2169 | = "android.content.pm.extra.VERIFICATION_INSTALLER_PACKAGE"; |
| 2170 | |
| 2171 | /** |
| 2172 | * Extra field name for the requested install flags for a package pending |
| 2173 | * verification. Passed to a package verifier. |
| 2174 | * |
| 2175 | * @hide |
| 2176 | */ |
| 2177 | public static final String EXTRA_VERIFICATION_INSTALL_FLAGS |
| 2178 | = "android.content.pm.extra.VERIFICATION_INSTALL_FLAGS"; |
| 2179 | |
| 2180 | /** |
rich cannings | 13d428e | 2012-09-13 13:43:07 -0700 | [diff] [blame] | 2181 | * Extra field name for the uid of who is requesting to install |
| 2182 | * the package. |
| 2183 | * |
| 2184 | * @hide |
| 2185 | */ |
| 2186 | public static final String EXTRA_VERIFICATION_INSTALLER_UID |
| 2187 | = "android.content.pm.extra.VERIFICATION_INSTALLER_UID"; |
| 2188 | |
| 2189 | /** |
| 2190 | * Extra field name for the package name of a package pending verification. |
| 2191 | * |
| 2192 | * @hide |
| 2193 | */ |
| 2194 | public static final String EXTRA_VERIFICATION_PACKAGE_NAME |
| 2195 | = "android.content.pm.extra.VERIFICATION_PACKAGE_NAME"; |
| 2196 | /** |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 2197 | * Extra field name for the result of a verification, either |
| 2198 | * {@link #VERIFICATION_ALLOW}, or {@link #VERIFICATION_REJECT}. |
| 2199 | * Passed to package verifiers after a package is verified. |
| 2200 | */ |
| 2201 | public static final String EXTRA_VERIFICATION_RESULT |
| 2202 | = "android.content.pm.extra.VERIFICATION_RESULT"; |
| 2203 | |
| 2204 | /** |
rich cannings | 13d428e | 2012-09-13 13:43:07 -0700 | [diff] [blame] | 2205 | * Extra field name for the version code of a package pending verification. |
| 2206 | * |
| 2207 | * @hide |
| 2208 | */ |
| 2209 | public static final String EXTRA_VERIFICATION_VERSION_CODE |
| 2210 | = "android.content.pm.extra.VERIFICATION_VERSION_CODE"; |
| 2211 | |
| 2212 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 2213 | * Extra field name for the ID of a intent filter pending verification. |
| 2214 | * Passed to an intent filter verifier and is used to call back to |
| 2215 | * {@link #verifyIntentFilter} |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 2216 | * |
| 2217 | * @hide |
| 2218 | */ |
| 2219 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_ID |
| 2220 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_ID"; |
| 2221 | |
| 2222 | /** |
| 2223 | * Extra field name for the scheme used for an intent filter pending verification. Passed to |
| 2224 | * an intent filter verifier and is used to construct the URI to verify against. |
| 2225 | * |
| 2226 | * Usually this is "https" |
| 2227 | * |
| 2228 | * @hide |
| 2229 | */ |
| 2230 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_URI_SCHEME |
| 2231 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_URI_SCHEME"; |
| 2232 | |
| 2233 | /** |
| 2234 | * Extra field name for the host names to be used for an intent filter pending verification. |
| 2235 | * Passed to an intent filter verifier and is used to construct the URI to verify the |
| 2236 | * intent filter. |
| 2237 | * |
| 2238 | * This is a space delimited list of hosts. |
| 2239 | * |
| 2240 | * @hide |
| 2241 | */ |
| 2242 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_HOSTS |
| 2243 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_HOSTS"; |
| 2244 | |
| 2245 | /** |
| 2246 | * Extra field name for the package name to be used for an intent filter pending verification. |
| 2247 | * Passed to an intent filter verifier and is used to check the verification responses coming |
| 2248 | * from the hosts. Each host response will need to include the package name of APK containing |
| 2249 | * the intent filter. |
| 2250 | * |
| 2251 | * @hide |
| 2252 | */ |
| 2253 | public static final String EXTRA_INTENT_FILTER_VERIFICATION_PACKAGE_NAME |
| 2254 | = "android.content.pm.extra.INTENT_FILTER_VERIFICATION_PACKAGE_NAME"; |
| 2255 | |
| 2256 | /** |
| 2257 | * The action used to request that the user approve a permission request |
| 2258 | * from the application. |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2259 | * |
| 2260 | * @hide |
| 2261 | */ |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 2262 | @SystemApi |
| 2263 | public static final String ACTION_REQUEST_PERMISSIONS = |
| 2264 | "android.content.pm.action.REQUEST_PERMISSIONS"; |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2265 | |
| 2266 | /** |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 2267 | * The names of the requested permissions. |
| 2268 | * <p> |
| 2269 | * <strong>Type:</strong> String[] |
| 2270 | * </p> |
| 2271 | * |
| 2272 | * @hide |
| 2273 | */ |
| 2274 | @SystemApi |
| 2275 | public static final String EXTRA_REQUEST_PERMISSIONS_NAMES = |
| 2276 | "android.content.pm.extra.REQUEST_PERMISSIONS_NAMES"; |
| 2277 | |
| 2278 | /** |
| 2279 | * The results from the permissions request. |
| 2280 | * <p> |
| 2281 | * <strong>Type:</strong> int[] of #PermissionResult |
| 2282 | * </p> |
| 2283 | * |
| 2284 | * @hide |
| 2285 | */ |
| 2286 | @SystemApi |
| 2287 | public static final String EXTRA_REQUEST_PERMISSIONS_RESULTS |
| 2288 | = "android.content.pm.extra.REQUEST_PERMISSIONS_RESULTS"; |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 2289 | |
| 2290 | /** |
Jeff Sharkey | bb58067 | 2014-07-10 12:10:25 -0700 | [diff] [blame] | 2291 | * String extra for {@link PackageInstallObserver} in the 'extras' Bundle in case of |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2292 | * {@link #INSTALL_FAILED_DUPLICATE_PERMISSION}. This extra names the package which provides |
| 2293 | * the existing definition for the permission. |
| 2294 | * @hide |
| 2295 | */ |
| 2296 | public static final String EXTRA_FAILURE_EXISTING_PACKAGE |
| 2297 | = "android.content.pm.extra.FAILURE_EXISTING_PACKAGE"; |
| 2298 | |
| 2299 | /** |
Jeff Sharkey | bb58067 | 2014-07-10 12:10:25 -0700 | [diff] [blame] | 2300 | * String extra for {@link PackageInstallObserver} in the 'extras' Bundle in case of |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2301 | * {@link #INSTALL_FAILED_DUPLICATE_PERMISSION}. This extra names the permission that is |
| 2302 | * being redundantly defined by the package being installed. |
| 2303 | * @hide |
| 2304 | */ |
| 2305 | public static final String EXTRA_FAILURE_EXISTING_PERMISSION |
| 2306 | = "android.content.pm.extra.FAILURE_EXISTING_PERMISSION"; |
| 2307 | |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2308 | /** |
| 2309 | * Permission flag: The permission is set in its current state |
| 2310 | * by the user and apps can still request it at runtime. |
| 2311 | * |
| 2312 | * @hide |
| 2313 | */ |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2314 | public static final int FLAG_PERMISSION_USER_SET = 1 << 0; |
| 2315 | |
| 2316 | /** |
| 2317 | * Permission flag: The permission is set in its current state |
| 2318 | * by the user and it is fixed, i.e. apps can no longer request |
| 2319 | * this permission. |
| 2320 | * |
| 2321 | * @hide |
| 2322 | */ |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2323 | public static final int FLAG_PERMISSION_USER_FIXED = 1 << 1; |
| 2324 | |
| 2325 | /** |
| 2326 | * Permission flag: The permission is set in its current state |
| 2327 | * by device policy and neither apps nor the user can change |
| 2328 | * its state. |
| 2329 | * |
| 2330 | * @hide |
| 2331 | */ |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2332 | public static final int FLAG_PERMISSION_POLICY_FIXED = 1 << 2; |
| 2333 | |
| 2334 | /** |
| 2335 | * Permission flag: The permission is set in a granted state but |
| 2336 | * access to resources it guards is restricted by other means to |
| 2337 | * enable revoking a permission on legacy apps that do not support |
| 2338 | * runtime permissions. If this permission is upgraded to runtime |
| 2339 | * because the app was updated to support runtime permissions, the |
| 2340 | * the permission will be revoked in the upgrade process. |
| 2341 | * |
| 2342 | * @hide |
| 2343 | */ |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2344 | public static final int FLAG_PERMISSION_REVOKE_ON_UPGRADE = 1 << 3; |
| 2345 | |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 2346 | /** |
| 2347 | * Permission flag: The permission is set in its current state |
| 2348 | * because the app is a component that is a part of the system. |
| 2349 | * |
| 2350 | * @hide |
| 2351 | */ |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 2352 | public static final int FLAG_PERMISSION_SYSTEM_FIXED = 1 << 4; |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2353 | |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 2354 | /** |
| 2355 | * Permission flag: The permission is granted by default because it |
| 2356 | * enables app functionality that is expected to work out-of-the-box |
| 2357 | * for providing a smooth user experience. For example, the phone app |
| 2358 | * is expected to have the phone permission. |
| 2359 | * |
| 2360 | * @hide |
| 2361 | */ |
| 2362 | public static final int FLAG_PERMISSION_GRANTED_BY_DEFAULT = 1 << 5; |
| 2363 | |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2364 | /** |
Svet Ganov | 9c165d7 | 2015-12-01 19:52:26 -0800 | [diff] [blame] | 2365 | * Permission flag: The permission has to be reviewed before any of |
| 2366 | * the app components can run. |
| 2367 | * |
| 2368 | * @hide |
| 2369 | */ |
| 2370 | public static final int FLAG_PERMISSION_REVIEW_REQUIRED = 1 << 6; |
| 2371 | |
| 2372 | /** |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2373 | * Mask for all permission flags. |
| 2374 | * |
| 2375 | * @hide |
| 2376 | */ |
| 2377 | @SystemApi |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 2378 | public static final int MASK_PERMISSION_FLAGS = 0xFF; |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 2379 | |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 2380 | /** |
Svet Ganov | d7b1f411 | 2016-02-09 18:49:23 -0800 | [diff] [blame] | 2381 | * This is a library that contains components apps can invoke. For |
| 2382 | * example, a services for apps to bind to, or standard chooser UI, |
| 2383 | * etc. This library is versioned and backwards compatible. Clients |
| 2384 | * should check its version via {@link android.ext.services.Version |
| 2385 | * #getVersionCode()} and avoid calling APIs added in later versions. |
| 2386 | * |
| 2387 | * @hide |
| 2388 | */ |
| 2389 | public static final String SYSTEM_SHARED_LIBRARY_SERVICES = "android.ext.services"; |
| 2390 | |
| 2391 | /** |
| 2392 | * This is a library that contains components apps can dynamically |
| 2393 | * load. For example, new widgets, helper classes, etc. This library |
| 2394 | * is versioned and backwards compatible. Clients should check its |
| 2395 | * version via {@link android.ext.shared.Version#getVersionCode()} |
| 2396 | * and avoid calling APIs added in later versions. |
| 2397 | * |
| 2398 | * @hide |
| 2399 | */ |
| 2400 | public static final String SYSTEM_SHARED_LIBRARY_SHARED = "android.ext.shared"; |
| 2401 | |
| 2402 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2403 | * Retrieve overall information about an application package that is |
| 2404 | * installed on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2405 | * |
| 2406 | * @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] | 2407 | * desired package. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2408 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2409 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 2410 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 2411 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 2412 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 2413 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 2414 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 2415 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 2416 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2417 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2418 | * to modify the data returned. |
| 2419 | * |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2420 | * @return A PackageInfo object containing information about the |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2421 | * package. If flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if the |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 2422 | * package is not found in the list of installed applications, the |
| 2423 | * package information is retrieved from the list of uninstalled |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2424 | * applications (which includes installed applications as well as |
| 2425 | * applications with data directory i.e. applications which had been |
| 2426 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2427 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2428 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2429 | * @see #GET_ACTIVITIES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2430 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2431 | * @see #GET_GIDS |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2432 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2433 | * @see #GET_INTENT_FILTERS |
| 2434 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2435 | * @see #GET_PERMISSIONS |
| 2436 | * @see #GET_PROVIDERS |
| 2437 | * @see #GET_RECEIVERS |
| 2438 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2439 | * @see #GET_SHARED_LIBRARY_FILES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2440 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2441 | * @see #GET_URI_PERMISSION_PATTERNS |
| 2442 | * @see #MATCH_DISABLED_COMPONENTS |
| 2443 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 2444 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2445 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2446 | public abstract PackageInfo getPackageInfo(String packageName, @PackageInfoFlags int flags) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2447 | throws NameNotFoundException; |
| 2448 | |
| 2449 | /** |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2450 | * @hide |
| 2451 | * Retrieve overall information about an application package that is |
| 2452 | * installed on the system. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2453 | * |
| 2454 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2455 | * desired package. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2456 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2457 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 2458 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 2459 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 2460 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 2461 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 2462 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 2463 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 2464 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2465 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2466 | * to modify the data returned. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2467 | * @param userId The user id. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2468 | * |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2469 | * @return A PackageInfo object containing information about the |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2470 | * package. If flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if the |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2471 | * package is not found in the list of installed applications, the |
| 2472 | * package information is retrieved from the list of uninstalled |
| 2473 | * applications (which includes installed applications as well as |
| 2474 | * applications with data directory i.e. applications which had been |
| 2475 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2476 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2477 | * found on the system. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2478 | * @see #GET_ACTIVITIES |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2479 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2480 | * @see #GET_GIDS |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2481 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2482 | * @see #GET_INTENT_FILTERS |
| 2483 | * @see #GET_META_DATA |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2484 | * @see #GET_PERMISSIONS |
| 2485 | * @see #GET_PROVIDERS |
| 2486 | * @see #GET_RECEIVERS |
| 2487 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2488 | * @see #GET_SHARED_LIBRARY_FILES |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2489 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2490 | * @see #GET_URI_PERMISSION_PATTERNS |
| 2491 | * @see #MATCH_DISABLED_COMPONENTS |
| 2492 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 2493 | * @see #MATCH_UNINSTALLED_PACKAGES |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2494 | */ |
| 2495 | @RequiresPermission(Manifest.permission.INTERACT_ACROSS_USERS) |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2496 | public abstract PackageInfo getPackageInfoAsUser(String packageName, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2497 | @PackageInfoFlags int flags, @UserIdInt int userId) throws NameNotFoundException; |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 2498 | |
| 2499 | /** |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 2500 | * Map from the current package names in use on the device to whatever |
| 2501 | * the current canonical name of that package is. |
| 2502 | * @param names Array of current names to be mapped. |
| 2503 | * @return Returns an array of the same size as the original, containing |
| 2504 | * the canonical name for each package. |
| 2505 | */ |
| 2506 | public abstract String[] currentToCanonicalPackageNames(String[] names); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2507 | |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 2508 | /** |
| 2509 | * Map from a packages canonical name to the current name in use on the device. |
| 2510 | * @param names Array of new names to be mapped. |
| 2511 | * @return Returns an array of the same size as the original, containing |
| 2512 | * the current name for each package. |
| 2513 | */ |
| 2514 | public abstract String[] canonicalToCurrentPackageNames(String[] names); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2515 | |
Dianne Hackborn | 4709693 | 2010-02-11 15:57:09 -0800 | [diff] [blame] | 2516 | /** |
Andrew Solovay | 5ae1335 | 2014-06-06 12:23:09 -0700 | [diff] [blame] | 2517 | * Returns a "good" intent to launch a front-door activity in a package. |
| 2518 | * This is used, for example, to implement an "open" button when browsing |
| 2519 | * through packages. The current implementation looks first for a main |
| 2520 | * activity in the category {@link Intent#CATEGORY_INFO}, and next for a |
| 2521 | * main activity in the category {@link Intent#CATEGORY_LAUNCHER}. Returns |
| 2522 | * <code>null</code> if neither are found. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2523 | * |
| 2524 | * @param packageName The name of the package to inspect. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2525 | * |
Andrew Solovay | 5ae1335 | 2014-06-06 12:23:09 -0700 | [diff] [blame] | 2526 | * @return A fully-qualified {@link Intent} that can be used to launch the |
| 2527 | * main activity in the package. Returns <code>null</code> if the package |
| 2528 | * 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] | 2529 | * recognized. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2530 | */ |
Mihai Preda | eae850c | 2009-05-13 10:13:48 +0200 | [diff] [blame] | 2531 | public abstract Intent getLaunchIntentForPackage(String packageName); |
| 2532 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2533 | /** |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 2534 | * Return a "good" intent to launch a front-door Leanback activity in a |
| 2535 | * package, for use for example to implement an "open" button when browsing |
| 2536 | * through packages. The current implementation will look for a main |
| 2537 | * activity in the category {@link Intent#CATEGORY_LEANBACK_LAUNCHER}, or |
| 2538 | * return null if no main leanback activities are found. |
Adam Connors | 551c078 | 2014-06-05 12:13:03 +0100 | [diff] [blame] | 2539 | * |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 2540 | * @param packageName The name of the package to inspect. |
| 2541 | * @return Returns either a fully-qualified Intent that can be used to launch |
| 2542 | * the main Leanback activity in the package, or null if the package |
| 2543 | * does not contain such an activity. |
| 2544 | */ |
| 2545 | public abstract Intent getLeanbackLaunchIntentForPackage(String packageName); |
| 2546 | |
| 2547 | /** |
| 2548 | * Return an array of all of the secondary group-ids that have been assigned |
| 2549 | * to a package. |
Adam Connors | 551c078 | 2014-06-05 12:13:03 +0100 | [diff] [blame] | 2550 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2551 | * @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] | 2552 | * desired package. |
Jose Lima | 970417c | 2014-04-10 10:42:19 -0700 | [diff] [blame] | 2553 | * @return Returns an int array of the assigned gids, or null if there are |
| 2554 | * none. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2555 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2556 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2557 | */ |
| 2558 | public abstract int[] getPackageGids(String packageName) |
| 2559 | throws NameNotFoundException; |
| 2560 | |
| 2561 | /** |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2562 | * Return an array of all of the secondary group-ids that have been assigned |
| 2563 | * to a package. |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 2564 | * |
| 2565 | * @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] | 2566 | * desired package. |
| 2567 | * @return Returns an int array of the assigned gids, or null if there are |
| 2568 | * none. |
| 2569 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2570 | * found on the system. |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 2571 | */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2572 | public abstract int[] getPackageGids(String packageName, @PackageInfoFlags int flags) |
Dianne Hackborn | a06de0f | 2012-12-11 16:34:47 -0800 | [diff] [blame] | 2573 | throws NameNotFoundException; |
| 2574 | |
| 2575 | /** |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2576 | * Return the UID associated with the given package name. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2577 | * |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2578 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
| 2579 | * desired package. |
| 2580 | * @return Returns an integer UID who owns the given package name. |
| 2581 | * @throws NameNotFoundException if a package with the given name can not be |
| 2582 | * found on the system. |
| 2583 | */ |
| 2584 | public abstract int getPackageUid(String packageName, @PackageInfoFlags int flags) |
| 2585 | throws NameNotFoundException; |
| 2586 | |
| 2587 | /** |
| 2588 | * Return the UID associated with the given package name. |
| 2589 | * |
| 2590 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
| 2591 | * desired package. |
| 2592 | * @param userId The user handle identifier to look up the package under. |
| 2593 | * @return Returns an integer UID who owns the given package name. |
| 2594 | * @throws NameNotFoundException if a package with the given name can not be |
| 2595 | * found on the system. |
| 2596 | * @hide |
| 2597 | */ |
| 2598 | public abstract int getPackageUidAsUser(String packageName, @UserIdInt int userId) |
| 2599 | throws NameNotFoundException; |
| 2600 | |
| 2601 | /** |
| 2602 | * Return the UID associated with the given package name. |
| 2603 | * |
| 2604 | * @param packageName The full name (i.e. com.google.apps.contacts) of the |
| 2605 | * desired package. |
| 2606 | * @param userId The user handle identifier to look up the package under. |
| 2607 | * @return Returns an integer UID who owns the given package name. |
| 2608 | * @throws NameNotFoundException if a package with the given name can not be |
| 2609 | * found on the system. |
| 2610 | * @hide |
| 2611 | */ |
| 2612 | public abstract int getPackageUidAsUser(String packageName, @PackageInfoFlags int flags, |
| 2613 | @UserIdInt int userId) throws NameNotFoundException; |
| 2614 | |
| 2615 | /** |
| 2616 | * 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] | 2617 | * |
| 2618 | * @param name The fully qualified name (i.e. com.google.permission.LOGIN) |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2619 | * of the permission you are interested in. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2620 | * @param flags Additional option flags. Use {@link #GET_META_DATA} to |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2621 | * retrieve any meta-data associated with the permission. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2622 | * |
| 2623 | * @return Returns a {@link PermissionInfo} containing information about the |
| 2624 | * permission. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2625 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2626 | * found on the system. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2627 | * |
| 2628 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2629 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2630 | public abstract PermissionInfo getPermissionInfo(String name, @PermissionInfoFlags int flags) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2631 | throws NameNotFoundException; |
| 2632 | |
| 2633 | /** |
| 2634 | * Query for all of the permissions associated with a particular group. |
| 2635 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2636 | * @param group The fully qualified name (i.e. com.google.permission.LOGIN) |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2637 | * of the permission group you are interested in. Use null to |
| 2638 | * 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] | 2639 | * @param flags Additional option flags. Use {@link #GET_META_DATA} to |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2640 | * retrieve any meta-data associated with the permissions. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2641 | * |
| 2642 | * @return Returns a list of {@link PermissionInfo} containing information |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2643 | * about all of the permissions in the given group. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2644 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2645 | * found on the system. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2646 | * |
| 2647 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2648 | */ |
| 2649 | public abstract List<PermissionInfo> queryPermissionsByGroup(String group, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2650 | @PermissionInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2651 | |
| 2652 | /** |
| 2653 | * Retrieve all of the information we know about a particular group of |
| 2654 | * permissions. |
| 2655 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2656 | * @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] | 2657 | * of the permission you are interested in. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2658 | * @param flags Additional option flags. Use {@link #GET_META_DATA} to |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2659 | * retrieve any meta-data associated with the permission group. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2660 | * |
| 2661 | * @return Returns a {@link PermissionGroupInfo} containing information |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2662 | * about the permission. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2663 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2664 | * found on the system. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2665 | * |
| 2666 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2667 | */ |
| 2668 | public abstract PermissionGroupInfo getPermissionGroupInfo(String name, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2669 | @PermissionGroupInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2670 | |
| 2671 | /** |
| 2672 | * Retrieve all of the known permission groups in the system. |
| 2673 | * |
| 2674 | * @param flags Additional option flags. Use {@link #GET_META_DATA} to |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2675 | * retrieve any meta-data associated with the permission group. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2676 | * |
| 2677 | * @return Returns a list of {@link PermissionGroupInfo} containing |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2678 | * information about all of the known permission groups. |
| 2679 | * |
| 2680 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2681 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2682 | public abstract List<PermissionGroupInfo> getAllPermissionGroups( |
| 2683 | @PermissionGroupInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2684 | |
| 2685 | /** |
| 2686 | * Retrieve all of the information we know about a particular |
| 2687 | * package/application. |
| 2688 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2689 | * @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] | 2690 | * application. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2691 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2692 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 2693 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2694 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2695 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2696 | * @return An {@link ApplicationInfo} containing information about the |
| 2697 | * package. If flag {@code MATCH_UNINSTALLED_PACKAGES} is set and if the |
| 2698 | * package is not found in the list of installed applications, the |
| 2699 | * application information is retrieved from the list of uninstalled |
| 2700 | * applications (which includes installed applications as well as |
| 2701 | * applications with data directory i.e. applications which had been |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 2702 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2703 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2704 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2705 | * |
| 2706 | * @see #GET_META_DATA |
| 2707 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2708 | * @see #MATCH_SYSTEM_ONLY |
| 2709 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2710 | */ |
| 2711 | public abstract ApplicationInfo getApplicationInfo(String packageName, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2712 | @ApplicationInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2713 | |
Jeff Sharkey | cd65448 | 2016-01-08 17:42:11 -0700 | [diff] [blame] | 2714 | /** {@hide} */ |
| 2715 | public abstract ApplicationInfo getApplicationInfoAsUser(String packageName, |
| 2716 | @ApplicationInfoFlags int flags, @UserIdInt int userId) throws NameNotFoundException; |
| 2717 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2718 | /** |
| 2719 | * Retrieve all of the information we know about a particular activity |
| 2720 | * class. |
| 2721 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2722 | * @param component The full component name (i.e. |
| 2723 | * com.google.apps.contacts/com.google.apps.contacts.ContactsList) of an Activity |
| 2724 | * class. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2725 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2726 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 2727 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 2728 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2729 | * {@link #MATCH_ENCRYPTION_AWARE}, {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, |
| 2730 | * {@link #MATCH_ENCRYPTION_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 2731 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2732 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2733 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2734 | * @return An {@link ActivityInfo} containing information about the activity. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2735 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2736 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2737 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2738 | * @see #GET_META_DATA |
| 2739 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2740 | * @see #MATCH_ALL |
| 2741 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 2742 | * @see #MATCH_DEFAULT_ONLY |
| 2743 | * @see #MATCH_DISABLED_COMPONENTS |
| 2744 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 2745 | * @see #MATCH_ENCRYPTION_AWARE |
| 2746 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 2747 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 2748 | * @see #MATCH_SYSTEM_ONLY |
| 2749 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2750 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2751 | public abstract ActivityInfo getActivityInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2752 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2753 | |
| 2754 | /** |
| 2755 | * Retrieve all of the information we know about a particular receiver |
| 2756 | * class. |
| 2757 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2758 | * @param component The full component name (i.e. |
| 2759 | * com.google.apps.calendar/com.google.apps.calendar.CalendarAlarm) of a Receiver |
| 2760 | * class. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2761 | * @param flags Additional option flags. Use any combination of |
| 2762 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 2763 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 2764 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2765 | * {@link #MATCH_ENCRYPTION_AWARE}, {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, |
| 2766 | * {@link #MATCH_ENCRYPTION_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 2767 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2768 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2769 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2770 | * @return An {@link ActivityInfo} containing information about the receiver. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2771 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2772 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2773 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2774 | * @see #GET_META_DATA |
| 2775 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2776 | * @see #MATCH_ALL |
| 2777 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 2778 | * @see #MATCH_DEFAULT_ONLY |
| 2779 | * @see #MATCH_DISABLED_COMPONENTS |
| 2780 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 2781 | * @see #MATCH_ENCRYPTION_AWARE |
| 2782 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 2783 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 2784 | * @see #MATCH_SYSTEM_ONLY |
| 2785 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2786 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2787 | public abstract ActivityInfo getReceiverInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2788 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2789 | |
| 2790 | /** |
| 2791 | * Retrieve all of the information we know about a particular service |
| 2792 | * class. |
| 2793 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2794 | * @param component The full component name (i.e. |
| 2795 | * com.google.apps.media/com.google.apps.media.BackgroundPlayback) of a Service |
| 2796 | * class. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2797 | * @param flags Additional option flags. Use any combination of |
| 2798 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 2799 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 2800 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2801 | * {@link #MATCH_ENCRYPTION_AWARE}, {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, |
| 2802 | * {@link #MATCH_ENCRYPTION_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 2803 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2804 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2805 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2806 | * @return A {@link ServiceInfo} object containing information about the service. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2807 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2808 | * found on the system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 2809 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2810 | * @see #GET_META_DATA |
| 2811 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2812 | * @see #MATCH_ALL |
| 2813 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 2814 | * @see #MATCH_DEFAULT_ONLY |
| 2815 | * @see #MATCH_DISABLED_COMPONENTS |
| 2816 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 2817 | * @see #MATCH_ENCRYPTION_AWARE |
| 2818 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 2819 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 2820 | * @see #MATCH_SYSTEM_ONLY |
| 2821 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2822 | */ |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2823 | public abstract ServiceInfo getServiceInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2824 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2825 | |
| 2826 | /** |
| 2827 | * Retrieve all of the information we know about a particular content |
| 2828 | * provider class. |
| 2829 | * |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2830 | * @param component The full component name (i.e. |
| 2831 | * com.google.providers.media/com.google.providers.media.MediaProvider) of a |
| 2832 | * ContentProvider class. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2833 | * @param flags Additional option flags. Use any combination of |
| 2834 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 2835 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 2836 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2837 | * {@link #MATCH_ENCRYPTION_AWARE}, {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, |
| 2838 | * {@link #MATCH_ENCRYPTION_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 2839 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2840 | * to modify the data returned. |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2841 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2842 | * @return A {@link ProviderInfo} object containing information about the provider. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2843 | * @throws NameNotFoundException if a package with the given name cannot be |
| 2844 | * found on the system. |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2845 | * |
| 2846 | * @see #GET_META_DATA |
| 2847 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2848 | * @see #MATCH_ALL |
| 2849 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 2850 | * @see #MATCH_DEFAULT_ONLY |
| 2851 | * @see #MATCH_DISABLED_COMPONENTS |
| 2852 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 2853 | * @see #MATCH_ENCRYPTION_AWARE |
| 2854 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 2855 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 2856 | * @see #MATCH_SYSTEM_ONLY |
| 2857 | * @see #MATCH_UNINSTALLED_PACKAGES |
Dianne Hackborn | 361199b | 2010-08-30 17:42:07 -0700 | [diff] [blame] | 2858 | */ |
| 2859 | public abstract ProviderInfo getProviderInfo(ComponentName component, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2860 | @ComponentInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2861 | |
| 2862 | /** |
| 2863 | * Return a List of all packages that are installed |
| 2864 | * on the device. |
| 2865 | * |
| 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_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 2868 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 2869 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 2870 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 2871 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 2872 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 2873 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 2874 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2875 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2876 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2877 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2878 | * @return A List of PackageInfo objects, one for each installed package, |
| 2879 | * containing information about the package. In the unlikely case |
| 2880 | * there are no installed packages, an empty list is returned. If |
| 2881 | * flag {@code MATCH_UNINSTALLED_PACKAGES} is set, the package |
| 2882 | * information is retrieved from the list of uninstalled |
| 2883 | * applications (which includes installed applications as well as |
| 2884 | * applications with data directory i.e. applications which had been |
| 2885 | * deleted with {@code DONT_DELETE_DATA} flag set). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2886 | * |
| 2887 | * @see #GET_ACTIVITIES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2888 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2889 | * @see #GET_GIDS |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2890 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2891 | * @see #GET_INTENT_FILTERS |
| 2892 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2893 | * @see #GET_PERMISSIONS |
| 2894 | * @see #GET_PROVIDERS |
| 2895 | * @see #GET_RECEIVERS |
| 2896 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2897 | * @see #GET_SHARED_LIBRARY_FILES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2898 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2899 | * @see #GET_URI_PERMISSION_PATTERNS |
| 2900 | * @see #MATCH_DISABLED_COMPONENTS |
| 2901 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 2902 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2903 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2904 | public abstract List<PackageInfo> getInstalledPackages(@PackageInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 2905 | |
| 2906 | /** |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 2907 | * Return a List of all installed packages that are currently |
| 2908 | * holding any of the given permissions. |
| 2909 | * |
| 2910 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2911 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 2912 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 2913 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 2914 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 2915 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 2916 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 2917 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 2918 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2919 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2920 | * to modify the data returned. |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 2921 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2922 | * @return A List of PackageInfo objects, one for each installed package |
| 2923 | * that holds any of the permissions that were provided, containing |
| 2924 | * information about the package. If no installed packages hold any |
| 2925 | * of the permissions, an empty list is returned. If flag |
| 2926 | * {@code MATCH_UNINSTALLED_PACKAGES} is set, the package information |
| 2927 | * is retrieved from the list of uninstalled applications (which |
| 2928 | * includes installed applications as well as applications with data |
| 2929 | * directory i.e. applications which had been deleted with |
| 2930 | * {@code DONT_DELETE_DATA} flag set). |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 2931 | * |
| 2932 | * @see #GET_ACTIVITIES |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 2933 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2934 | * @see #GET_GIDS |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 2935 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2936 | * @see #GET_INTENT_FILTERS |
| 2937 | * @see #GET_META_DATA |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 2938 | * @see #GET_PERMISSIONS |
| 2939 | * @see #GET_PROVIDERS |
| 2940 | * @see #GET_RECEIVERS |
| 2941 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2942 | * @see #GET_SHARED_LIBRARY_FILES |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 2943 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2944 | * @see #GET_URI_PERMISSION_PATTERNS |
| 2945 | * @see #MATCH_DISABLED_COMPONENTS |
| 2946 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 2947 | * @see #MATCH_UNINSTALLED_PACKAGES |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 2948 | */ |
| 2949 | public abstract List<PackageInfo> getPackagesHoldingPermissions( |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 2950 | String[] permissions, @PackageInfoFlags int flags); |
Dianne Hackborn | e799175 | 2013-01-16 17:56:46 -0800 | [diff] [blame] | 2951 | |
| 2952 | /** |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 2953 | * Return a List of all packages that are installed on the device, for a specific user. |
| 2954 | * Requesting a list of installed packages for another user |
| 2955 | * will require the permission INTERACT_ACROSS_USERS_FULL. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2956 | * |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 2957 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2958 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 2959 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 2960 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 2961 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 2962 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 2963 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 2964 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 2965 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 2966 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 2967 | * to modify the data returned. |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 2968 | * @param userId The user for whom the installed packages are to be listed |
| 2969 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2970 | * @return A List of PackageInfo objects, one for each installed package, |
| 2971 | * containing information about the package. In the unlikely case |
| 2972 | * there are no installed packages, an empty list is returned. If |
| 2973 | * flag {@code MATCH_UNINSTALLED_PACKAGES} is set, the package |
| 2974 | * information is retrieved from the list of uninstalled |
| 2975 | * applications (which includes installed applications as well as |
| 2976 | * applications with data directory i.e. applications which had been |
| 2977 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 2978 | * |
| 2979 | * @see #GET_ACTIVITIES |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 2980 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2981 | * @see #GET_GIDS |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 2982 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2983 | * @see #GET_INTENT_FILTERS |
| 2984 | * @see #GET_META_DATA |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 2985 | * @see #GET_PERMISSIONS |
| 2986 | * @see #GET_PROVIDERS |
| 2987 | * @see #GET_RECEIVERS |
| 2988 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2989 | * @see #GET_SHARED_LIBRARY_FILES |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 2990 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 2991 | * @see #GET_URI_PERMISSION_PATTERNS |
| 2992 | * @see #MATCH_DISABLED_COMPONENTS |
| 2993 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 2994 | * @see #MATCH_UNINSTALLED_PACKAGES |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 2995 | * |
| 2996 | * @hide |
| 2997 | */ |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 2998 | public abstract List<PackageInfo> getInstalledPackagesAsUser(@PackageInfoFlags int flags, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 2999 | @UserIdInt int userId); |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3000 | |
| 3001 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3002 | * Check whether a particular package has been granted a particular |
| 3003 | * permission. |
| 3004 | * |
Svet Ganov | ad3b297 | 2015-07-07 22:49:17 -0700 | [diff] [blame] | 3005 | * @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] | 3006 | * @param pkgName The name of the package you are checking against. |
| 3007 | * |
| 3008 | * @return If the package has the permission, PERMISSION_GRANTED is |
| 3009 | * returned. If it does not have the permission, PERMISSION_DENIED |
| 3010 | * is returned. |
| 3011 | * |
| 3012 | * @see #PERMISSION_GRANTED |
| 3013 | * @see #PERMISSION_DENIED |
| 3014 | */ |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 3015 | @CheckResult |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3016 | public abstract int checkPermission(String permName, String pkgName); |
| 3017 | |
| 3018 | /** |
Svet Ganov | ad3b297 | 2015-07-07 22:49:17 -0700 | [diff] [blame] | 3019 | * Checks whether a particular permissions has been revoked for a |
| 3020 | * package by policy. Typically the device owner or the profile owner |
| 3021 | * may apply such a policy. The user cannot grant policy revoked |
| 3022 | * permissions, hence the only way for an app to get such a permission |
| 3023 | * is by a policy change. |
| 3024 | * |
| 3025 | * @param permName The name of the permission you are checking for. |
| 3026 | * @param pkgName The name of the package you are checking against. |
| 3027 | * |
| 3028 | * @return Whether the permission is restricted by policy. |
| 3029 | */ |
| 3030 | @CheckResult |
Svet Ganov | f1b7f20 | 2015-07-29 08:33:42 -0700 | [diff] [blame] | 3031 | public abstract boolean isPermissionRevokedByPolicy(@NonNull String permName, |
| 3032 | @NonNull String pkgName); |
| 3033 | |
| 3034 | /** |
| 3035 | * Gets the package name of the component controlling runtime permissions. |
| 3036 | * |
| 3037 | * @return The package name. |
| 3038 | * |
| 3039 | * @hide |
| 3040 | */ |
| 3041 | public abstract String getPermissionControllerPackageName(); |
Svet Ganov | ad3b297 | 2015-07-07 22:49:17 -0700 | [diff] [blame] | 3042 | |
| 3043 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3044 | * Add a new dynamic permission to the system. For this to work, your |
| 3045 | * package must have defined a permission tree through the |
| 3046 | * {@link android.R.styleable#AndroidManifestPermissionTree |
| 3047 | * <permission-tree>} tag in its manifest. A package can only add |
| 3048 | * permissions to trees that were defined by either its own package or |
| 3049 | * another with the same user id; a permission is in a tree if it |
| 3050 | * matches the name of the permission tree + ".": for example, |
| 3051 | * "com.foo.bar" is a member of the permission tree "com.foo". |
| 3052 | * |
| 3053 | * <p>It is good to make your permission tree name descriptive, because you |
| 3054 | * are taking possession of that entire set of permission names. Thus, it |
| 3055 | * must be under a domain you control, with a suffix that will not match |
| 3056 | * any normal permissions that may be declared in any applications that |
| 3057 | * are part of that domain. |
| 3058 | * |
| 3059 | * <p>New permissions must be added before |
| 3060 | * any .apks are installed that use those permissions. Permissions you |
| 3061 | * add through this method are remembered across reboots of the device. |
| 3062 | * If the given permission already exists, the info you supply here |
| 3063 | * will be used to update it. |
| 3064 | * |
| 3065 | * @param info Description of the permission to be added. |
| 3066 | * |
| 3067 | * @return Returns true if a new permission was created, false if an |
| 3068 | * existing one was updated. |
| 3069 | * |
| 3070 | * @throws SecurityException if you are not allowed to add the |
| 3071 | * given permission name. |
| 3072 | * |
| 3073 | * @see #removePermission(String) |
| 3074 | */ |
| 3075 | public abstract boolean addPermission(PermissionInfo info); |
| 3076 | |
| 3077 | /** |
Dianne Hackborn | d7c0968 | 2010-03-30 10:42:20 -0700 | [diff] [blame] | 3078 | * Like {@link #addPermission(PermissionInfo)} but asynchronously |
| 3079 | * persists the package manager state after returning from the call, |
| 3080 | * allowing it to return quicker and batch a series of adds at the |
| 3081 | * expense of no guarantee the added permission will be retained if |
| 3082 | * the device is rebooted before it is written. |
| 3083 | */ |
| 3084 | public abstract boolean addPermissionAsync(PermissionInfo info); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3085 | |
Dianne Hackborn | d7c0968 | 2010-03-30 10:42:20 -0700 | [diff] [blame] | 3086 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3087 | * Removes a permission that was previously added with |
| 3088 | * {@link #addPermission(PermissionInfo)}. The same ownership rules apply |
| 3089 | * -- you are only allowed to remove permissions that you are allowed |
| 3090 | * to add. |
| 3091 | * |
| 3092 | * @param name The name of the permission to remove. |
| 3093 | * |
| 3094 | * @throws SecurityException if you are not allowed to remove the |
| 3095 | * given permission name. |
| 3096 | * |
| 3097 | * @see #addPermission(PermissionInfo) |
| 3098 | */ |
| 3099 | public abstract void removePermission(String name); |
| 3100 | |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3101 | |
| 3102 | /** |
| 3103 | * Permission flags set when granting or revoking a permission. |
| 3104 | * |
| 3105 | * @hide |
| 3106 | */ |
| 3107 | @SystemApi |
| 3108 | @IntDef({FLAG_PERMISSION_USER_SET, |
| 3109 | FLAG_PERMISSION_USER_FIXED, |
| 3110 | FLAG_PERMISSION_POLICY_FIXED, |
Svet Ganov | b3f22b4 | 2015-05-12 11:01:24 -0700 | [diff] [blame] | 3111 | FLAG_PERMISSION_REVOKE_ON_UPGRADE, |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 3112 | FLAG_PERMISSION_SYSTEM_FIXED, |
| 3113 | FLAG_PERMISSION_GRANTED_BY_DEFAULT}) |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3114 | @Retention(RetentionPolicy.SOURCE) |
| 3115 | public @interface PermissionFlags {} |
| 3116 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3117 | /** |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3118 | * Grant a runtime permission to an application which the application does not |
| 3119 | * already have. The permission must have been requested by the application. |
| 3120 | * If the application is not allowed to hold the permission, a {@link |
| 3121 | * java.lang.SecurityException} is thrown. |
| 3122 | * <p> |
| 3123 | * <strong>Note: </strong>Using this API requires holding |
| 3124 | * android.permission.GRANT_REVOKE_PERMISSIONS and if the user id is |
| 3125 | * not the current user android.permission.INTERACT_ACROSS_USERS_FULL. |
| 3126 | * </p> |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3127 | * |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3128 | * @param packageName The package to which to grant the permission. |
| 3129 | * @param permissionName The permission name to grant. |
| 3130 | * @param user The user for which to grant the permission. |
| 3131 | * |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3132 | * @see #revokeRuntimePermission(String, String, android.os.UserHandle) |
| 3133 | * @see android.content.pm.PackageManager.PermissionFlags |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3134 | * |
| 3135 | * @hide |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3136 | */ |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3137 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3138 | public abstract void grantRuntimePermission(@NonNull String packageName, |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3139 | @NonNull String permissionName, @NonNull UserHandle user); |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3140 | |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3141 | /** |
| 3142 | * Revoke a runtime permission that was previously granted by {@link |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3143 | * #grantRuntimePermission(String, String, android.os.UserHandle)}. The |
| 3144 | * permission must have been requested by and granted to the application. |
| 3145 | * If the application is not allowed to hold the permission, a {@link |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3146 | * java.lang.SecurityException} is thrown. |
| 3147 | * <p> |
| 3148 | * <strong>Note: </strong>Using this API requires holding |
| 3149 | * android.permission.GRANT_REVOKE_PERMISSIONS and if the user id is |
| 3150 | * not the current user android.permission.INTERACT_ACROSS_USERS_FULL. |
| 3151 | * </p> |
| 3152 | * |
| 3153 | * @param packageName The package from which to revoke the permission. |
| 3154 | * @param permissionName The permission name to revoke. |
| 3155 | * @param user The user for which to revoke the permission. |
| 3156 | * |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3157 | * @see #grantRuntimePermission(String, String, android.os.UserHandle) |
| 3158 | * @see android.content.pm.PackageManager.PermissionFlags |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3159 | * |
| 3160 | * @hide |
| 3161 | */ |
| 3162 | @SystemApi |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3163 | public abstract void revokeRuntimePermission(@NonNull String packageName, |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3164 | @NonNull String permissionName, @NonNull UserHandle user); |
| 3165 | |
| 3166 | /** |
Svet Ganov | 8c7f700 | 2015-05-07 10:48:44 -0700 | [diff] [blame] | 3167 | * Gets the state flags associated with a permission. |
| 3168 | * |
| 3169 | * @param permissionName The permission for which to get the flags. |
| 3170 | * @param packageName The package name for which to get the flags. |
| 3171 | * @param user The user for which to get permission flags. |
| 3172 | * @return The permission flags. |
| 3173 | * |
| 3174 | * @hide |
| 3175 | */ |
| 3176 | @SystemApi |
| 3177 | public abstract @PermissionFlags int getPermissionFlags(String permissionName, |
| 3178 | String packageName, @NonNull UserHandle user); |
| 3179 | |
| 3180 | /** |
| 3181 | * Updates the flags associated with a permission by replacing the flags in |
| 3182 | * the specified mask with the provided flag values. |
| 3183 | * |
| 3184 | * @param permissionName The permission for which to update the flags. |
| 3185 | * @param packageName The package name for which to update the flags. |
| 3186 | * @param flagMask The flags which to replace. |
| 3187 | * @param flagValues The flags with which to replace. |
| 3188 | * @param user The user for which to update the permission flags. |
| 3189 | * |
| 3190 | * @hide |
| 3191 | */ |
| 3192 | @SystemApi |
| 3193 | public abstract void updatePermissionFlags(String permissionName, |
| 3194 | String packageName, @PermissionFlags int flagMask, int flagValues, |
| 3195 | @NonNull UserHandle user); |
| 3196 | |
| 3197 | /** |
Svetoslav | 20770dd | 2015-05-29 15:43:04 -0700 | [diff] [blame] | 3198 | * Gets whether you should show UI with rationale for requesting a permission. |
| 3199 | * You should do this only if you do not have the permission and the context in |
| 3200 | * which the permission is requested does not clearly communicate to the user |
| 3201 | * what would be the benefit from grating this permission. |
| 3202 | * |
| 3203 | * @param permission A permission your app wants to request. |
| 3204 | * @return Whether you can show permission rationale UI. |
| 3205 | * |
| 3206 | * @hide |
| 3207 | */ |
| 3208 | public abstract boolean shouldShowRequestPermissionRationale(String permission); |
| 3209 | |
| 3210 | /** |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3211 | * Returns an {@link android.content.Intent} suitable for passing to |
| 3212 | * {@link android.app.Activity#startActivityForResult(android.content.Intent, int)} |
| 3213 | * which prompts the user to grant permissions to this application. |
| 3214 | * |
| 3215 | * @throws NullPointerException if {@code permissions} is {@code null} or empty. |
| 3216 | * |
| 3217 | * @hide |
| 3218 | */ |
| 3219 | public Intent buildRequestPermissionsIntent(@NonNull String[] permissions) { |
| 3220 | if (ArrayUtils.isEmpty(permissions)) { |
Svet Ganov | f66381c | 2016-02-18 20:02:36 -0800 | [diff] [blame] | 3221 | throw new IllegalArgumentException("permission cannot be null or empty"); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3222 | } |
| 3223 | Intent intent = new Intent(ACTION_REQUEST_PERMISSIONS); |
| 3224 | intent.putExtra(EXTRA_REQUEST_PERMISSIONS_NAMES, permissions); |
Svet Ganov | f1b7f20 | 2015-07-29 08:33:42 -0700 | [diff] [blame] | 3225 | intent.setPackage(getPermissionControllerPackageName()); |
Svetoslav | c6d1c34 | 2015-02-26 14:44:43 -0800 | [diff] [blame] | 3226 | return intent; |
Nick Kralevich | 035f80d | 2013-03-27 15:20:08 -0700 | [diff] [blame] | 3227 | } |
| 3228 | |
| 3229 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3230 | * Compare the signatures of two packages to determine if the same |
| 3231 | * signature appears in both of them. If they do contain the same |
| 3232 | * signature, then they are allowed special privileges when working |
| 3233 | * with each other: they can share the same user-id, run instrumentation |
| 3234 | * against each other, etc. |
| 3235 | * |
| 3236 | * @param pkg1 First package name whose signature will be compared. |
| 3237 | * @param pkg2 Second package name whose signature will be compared. |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 3238 | * |
| 3239 | * @return Returns an integer indicating whether all signatures on the |
| 3240 | * two packages match. The value is >= 0 ({@link #SIGNATURE_MATCH}) if |
| 3241 | * all signatures match or < 0 if there is not a match ({@link |
| 3242 | * #SIGNATURE_NO_MATCH} or {@link #SIGNATURE_UNKNOWN_PACKAGE}). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3243 | * |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3244 | * @see #checkSignatures(int, int) |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3245 | * @see #SIGNATURE_MATCH |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3246 | * @see #SIGNATURE_NO_MATCH |
| 3247 | * @see #SIGNATURE_UNKNOWN_PACKAGE |
| 3248 | */ |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 3249 | @CheckResult |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3250 | public abstract int checkSignatures(String pkg1, String pkg2); |
| 3251 | |
| 3252 | /** |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3253 | * Like {@link #checkSignatures(String, String)}, but takes UIDs of |
| 3254 | * the two packages to be checked. This can be useful, for example, |
| 3255 | * when doing the check in an IPC, where the UID is the only identity |
| 3256 | * available. It is functionally identical to determining the package |
| 3257 | * associated with the UIDs and checking their signatures. |
| 3258 | * |
Joe Onorato | 25660ec | 2009-08-12 22:40:37 -0700 | [diff] [blame] | 3259 | * @param uid1 First UID whose signature will be compared. |
| 3260 | * @param uid2 Second UID whose signature will be compared. |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3261 | * |
Chris Palmer | 09f3360 | 2010-09-13 14:27:18 -0700 | [diff] [blame] | 3262 | * @return Returns an integer indicating whether all signatures on the |
| 3263 | * two packages match. The value is >= 0 ({@link #SIGNATURE_MATCH}) if |
| 3264 | * all signatures match or < 0 if there is not a match ({@link |
| 3265 | * #SIGNATURE_NO_MATCH} or {@link #SIGNATURE_UNKNOWN_PACKAGE}). |
| 3266 | * |
| 3267 | * @see #checkSignatures(String, String) |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3268 | * @see #SIGNATURE_MATCH |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3269 | * @see #SIGNATURE_NO_MATCH |
| 3270 | * @see #SIGNATURE_UNKNOWN_PACKAGE |
| 3271 | */ |
Tor Norbye | 1c2bf03 | 2015-03-02 10:57:08 -0800 | [diff] [blame] | 3272 | @CheckResult |
Dianne Hackborn | 766cbfe | 2009-08-12 18:33:39 -0700 | [diff] [blame] | 3273 | public abstract int checkSignatures(int uid1, int uid2); |
| 3274 | |
| 3275 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3276 | * Retrieve the names of all packages that are associated with a particular |
| 3277 | * user id. In most cases, this will be a single package name, the package |
| 3278 | * that has been assigned that user id. Where there are multiple packages |
| 3279 | * sharing the same user id through the "sharedUserId" mechanism, all |
| 3280 | * packages with that id will be returned. |
| 3281 | * |
| 3282 | * @param uid The user id for which you would like to retrieve the |
| 3283 | * associated packages. |
| 3284 | * |
| 3285 | * @return Returns an array of one or more packages assigned to the user |
| 3286 | * id, or null if there are no known packages with the given id. |
| 3287 | */ |
Jeff Sharkey | 377ded0f | 2016-01-10 13:15:41 -0700 | [diff] [blame] | 3288 | public abstract @Nullable String[] getPackagesForUid(int uid); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3289 | |
| 3290 | /** |
| 3291 | * Retrieve the official name associated with a user id. This name is |
Jonathan Basseri | 7ea3a33 | 2015-05-12 19:39:22 -0700 | [diff] [blame] | 3292 | * 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] | 3293 | * user id to be changed. That is, if you are storing information about |
| 3294 | * user ids in persistent storage, you should use the string returned |
| 3295 | * by this function instead of the raw user-id. |
| 3296 | * |
| 3297 | * @param uid The user id for which you would like to retrieve a name. |
| 3298 | * @return Returns a unique name for the given user id, or null if the |
| 3299 | * user id is not currently assigned. |
| 3300 | */ |
Jeff Sharkey | 377ded0f | 2016-01-10 13:15:41 -0700 | [diff] [blame] | 3301 | public abstract @Nullable String getNameForUid(int uid); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3302 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3303 | /** |
| 3304 | * Return the user id associated with a shared user name. Multiple |
| 3305 | * applications can specify a shared user name in their manifest and thus |
| 3306 | * end up using a common uid. This might be used for new applications |
| 3307 | * that use an existing shared user name and need to know the uid of the |
| 3308 | * shared user. |
| 3309 | * |
| 3310 | * @param sharedUserName The shared user name whose uid is to be retrieved. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3311 | * @return Returns the UID associated with the shared user. |
| 3312 | * @throws NameNotFoundException if a package with the given name cannot be |
| 3313 | * found on the system. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3314 | * @hide |
| 3315 | */ |
| 3316 | public abstract int getUidForSharedUser(String sharedUserName) |
| 3317 | throws NameNotFoundException; |
| 3318 | |
| 3319 | /** |
| 3320 | * Return a List of all application packages that are installed on the |
| 3321 | * device. If flag GET_UNINSTALLED_PACKAGES has been set, a list of all |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 3322 | * 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] | 3323 | * installed apps with data directory) will be returned. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3324 | * |
| 3325 | * @param flags Additional option flags. Use any combination of |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3326 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3327 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3328 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3329 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3330 | * @return A List of ApplicationInfo objects, one for each installed application. |
| 3331 | * In the unlikely case there are no installed packages, an empty list |
| 3332 | * is returned. If flag {@code MATCH_UNINSTALLED_PACKAGES} is set, the |
| 3333 | * application information is retrieved from the list of uninstalled |
| 3334 | * applications (which includes installed applications as well as |
| 3335 | * applications with data directory i.e. applications which had been |
| 3336 | * deleted with {@code DONT_DELETE_DATA} flag set). |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3337 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3338 | * @see #GET_META_DATA |
| 3339 | * @see #GET_SHARED_LIBRARY_FILES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3340 | * @see #MATCH_SYSTEM_ONLY |
| 3341 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3342 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3343 | public abstract List<ApplicationInfo> getInstalledApplications(@ApplicationInfoFlags int flags); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3344 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3345 | /** |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3346 | * Gets the ephemeral applications the user recently used. Requires |
| 3347 | * holding "android.permission.ACCESS_EPHEMERAL_APPS". |
| 3348 | * |
| 3349 | * @return The ephemeral app list. |
| 3350 | * |
| 3351 | * @hide |
| 3352 | */ |
| 3353 | @RequiresPermission(Manifest.permission.ACCESS_EPHEMERAL_APPS) |
| 3354 | public abstract List<EphemeralApplicationInfo> getEphemeralApplications(); |
| 3355 | |
| 3356 | /** |
| 3357 | * Gets the icon for an ephemeral application. |
| 3358 | * |
| 3359 | * @param packageName The app package name. |
| 3360 | * |
| 3361 | * @hide |
| 3362 | */ |
| 3363 | public abstract Drawable getEphemeralApplicationIcon(String packageName); |
| 3364 | |
| 3365 | /** |
| 3366 | * Gets whether the caller is an ephemeral app. |
| 3367 | * |
| 3368 | * @return Whether caller is an ephemeral app. |
| 3369 | * |
| 3370 | * @see #setEphemeralCookie(byte[]) |
| 3371 | * @see #getEphemeralCookie() |
| 3372 | * @see #getEphemeralCookieMaxSizeBytes() |
Todd Kennedy | 1270513 | 2016-01-05 15:17:57 -0800 | [diff] [blame] | 3373 | * |
| 3374 | * @hide |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3375 | */ |
| 3376 | public abstract boolean isEphemeralApplication(); |
| 3377 | |
| 3378 | /** |
| 3379 | * Gets the maximum size in bytes of the cookie data an ephemeral app |
| 3380 | * can store on the device. |
| 3381 | * |
| 3382 | * @return The max cookie size in bytes. |
| 3383 | * |
| 3384 | * @see #isEphemeralApplication() |
| 3385 | * @see #setEphemeralCookie(byte[]) |
| 3386 | * @see #getEphemeralCookie() |
Todd Kennedy | 1270513 | 2016-01-05 15:17:57 -0800 | [diff] [blame] | 3387 | * |
| 3388 | * @hide |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3389 | */ |
| 3390 | public abstract int getEphemeralCookieMaxSizeBytes(); |
| 3391 | |
| 3392 | /** |
| 3393 | * Gets the ephemeral application cookie for this app. Non |
| 3394 | * ephemeral apps and apps that were ephemeral but were upgraded |
| 3395 | * to non-ephemeral can still access this API. For ephemeral apps |
| 3396 | * this cooke is cached for some time after uninstall while for |
| 3397 | * normal apps the cookie is deleted after the app is uninstalled. |
| 3398 | * The cookie is always present while the app is installed. |
| 3399 | * |
| 3400 | * @return The cookie. |
| 3401 | * |
| 3402 | * @see #isEphemeralApplication() |
| 3403 | * @see #setEphemeralCookie(byte[]) |
| 3404 | * @see #getEphemeralCookieMaxSizeBytes() |
Todd Kennedy | 1270513 | 2016-01-05 15:17:57 -0800 | [diff] [blame] | 3405 | * |
| 3406 | * @hide |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3407 | */ |
| 3408 | public abstract @NonNull byte[] getEphemeralCookie(); |
| 3409 | |
| 3410 | /** |
| 3411 | * Sets the ephemeral application cookie for the calling app. Non |
| 3412 | * ephemeral apps and apps that were ephemeral but were upgraded |
| 3413 | * to non-ephemeral can still access this API. For ephemeral apps |
| 3414 | * this cooke is cached for some time after uninstall while for |
| 3415 | * normal apps the cookie is deleted after the app is uninstalled. |
| 3416 | * The cookie is always present while the app is installed. The |
| 3417 | * cookie size is limited by {@link #getEphemeralCookieMaxSizeBytes()}. |
| 3418 | * |
| 3419 | * @param cookie The cookie data. |
| 3420 | * @return True if the cookie was set. |
| 3421 | * |
| 3422 | * @see #isEphemeralApplication() |
| 3423 | * @see #getEphemeralCookieMaxSizeBytes() |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 3424 | * @see #getEphemeralCookie() |
Todd Kennedy | 1270513 | 2016-01-05 15:17:57 -0800 | [diff] [blame] | 3425 | * |
| 3426 | * @hide |
Svet Ganov | 2acf063 | 2015-11-24 19:10:59 -0800 | [diff] [blame] | 3427 | */ |
| 3428 | public abstract boolean setEphemeralCookie(@NonNull byte[] cookie); |
| 3429 | |
| 3430 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3431 | * Get a list of shared libraries that are available on the |
| 3432 | * system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3433 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3434 | * @return An array of shared library names that are |
| 3435 | * available on the system, or null if none are installed. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3436 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3437 | */ |
| 3438 | public abstract String[] getSystemSharedLibraryNames(); |
| 3439 | |
| 3440 | /** |
Svet Ganov | d7b1f411 | 2016-02-09 18:49:23 -0800 | [diff] [blame] | 3441 | * Get the name of the package hosting the services shared library. |
| 3442 | * |
| 3443 | * @return The library host package. |
| 3444 | * |
| 3445 | * @hide |
| 3446 | */ |
| 3447 | public abstract @Nullable String getServicesSystemSharedLibraryPackageName(); |
| 3448 | |
| 3449 | /** |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 3450 | * Get a list of features that are available on the |
| 3451 | * system. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3452 | * |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 3453 | * @return An array of FeatureInfo classes describing the features |
| 3454 | * that are available on the system, or null if there are none(!!). |
Dianne Hackborn | 4923734 | 2009-08-27 20:08:01 -0700 | [diff] [blame] | 3455 | */ |
| 3456 | public abstract FeatureInfo[] getSystemAvailableFeatures(); |
| 3457 | |
| 3458 | /** |
Jeff Sharkey | 115d2c1 | 2016-02-15 17:25:57 -0700 | [diff] [blame] | 3459 | * Check whether the given feature name is one of the available features as |
| 3460 | * returned by {@link #getSystemAvailableFeatures()}. This tests for the |
| 3461 | * presence of <em>any</em> version of the given feature name; use |
| 3462 | * {@link #hasSystemFeature(String, int)} to check for a minimum version. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3463 | * |
Jeff Sharkey | 115d2c1 | 2016-02-15 17:25:57 -0700 | [diff] [blame] | 3464 | * @return Returns true if the devices supports the feature, else false. |
Dianne Hackborn | 039c68e | 2009-09-26 16:39:23 -0700 | [diff] [blame] | 3465 | */ |
| 3466 | public abstract boolean hasSystemFeature(String name); |
| 3467 | |
| 3468 | /** |
Jeff Sharkey | 115d2c1 | 2016-02-15 17:25:57 -0700 | [diff] [blame] | 3469 | * Check whether the given feature name and version is one of the available |
| 3470 | * features as returned by {@link #getSystemAvailableFeatures()}. Since |
| 3471 | * features are defined to always be backwards compatible, this returns true |
| 3472 | * if the available feature version is greater than or equal to the |
| 3473 | * requested version. |
| 3474 | * |
| 3475 | * @return Returns true if the devices supports the feature, else false. |
| 3476 | */ |
| 3477 | public abstract boolean hasSystemFeature(String name, int version); |
| 3478 | |
| 3479 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3480 | * Determine the best action to perform for a given Intent. This is how |
| 3481 | * {@link Intent#resolveActivity} finds an activity if a class has not |
| 3482 | * been explicitly specified. |
| 3483 | * |
Scott Main | ef6b305 | 2011-03-23 14:23:02 -0700 | [diff] [blame] | 3484 | * <p><em>Note:</em> if using an implicit Intent (without an explicit ComponentName |
Dianne Hackborn | 4d023d21 | 2010-10-01 13:41:04 -0700 | [diff] [blame] | 3485 | * specified), be sure to consider whether to set the {@link #MATCH_DEFAULT_ONLY} |
| 3486 | * only flag. You need to do so to resolve the activity in the same way |
| 3487 | * that {@link android.content.Context#startActivity(Intent)} and |
| 3488 | * {@link android.content.Intent#resolveActivity(PackageManager) |
| 3489 | * Intent.resolveActivity(PackageManager)} do.</p> |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 3490 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3491 | * @param intent An intent containing all of the desired specification |
| 3492 | * (action, data, type, category, and/or component). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3493 | * @param flags Additional option flags. Use any combination of |
| 3494 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3495 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3496 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3497 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_ENCRYPTION_AWARE}, |
| 3498 | * {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, {@link #MATCH_ENCRYPTION_UNAWARE}, |
| 3499 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3500 | * to modify the data returned. The most important is |
| 3501 | * {@link #MATCH_DEFAULT_ONLY}, to limit the resolution to only |
| 3502 | * those activities that support the {@link android.content.Intent#CATEGORY_DEFAULT}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3503 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3504 | * @return Returns a ResolveInfo object containing the final activity intent |
| 3505 | * that was determined to be the best action. Returns null if no |
Mike LeBeau | bd3f527 | 2010-02-18 19:27:17 -0800 | [diff] [blame] | 3506 | * matching activity was found. If multiple matching activities are |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3507 | * found and there is no default set, returns a ResolveInfo object |
Mike LeBeau | bd3f527 | 2010-02-18 19:27:17 -0800 | [diff] [blame] | 3508 | * containing something else, such as the activity resolver. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3509 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3510 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3511 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3512 | * @see #GET_SHARED_LIBRARY_FILES |
| 3513 | * @see #MATCH_ALL |
| 3514 | * @see #MATCH_DISABLED_COMPONENTS |
| 3515 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3516 | * @see #MATCH_DEFAULT_ONLY |
| 3517 | * @see #MATCH_ENCRYPTION_AWARE |
| 3518 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 3519 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 3520 | * @see #MATCH_SYSTEM_ONLY |
| 3521 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3522 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3523 | public abstract ResolveInfo resolveActivity(Intent intent, @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3524 | |
| 3525 | /** |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3526 | * Determine the best action to perform for a given Intent for a given user. This |
| 3527 | * is how {@link Intent#resolveActivity} finds an activity if a class has not |
| 3528 | * been explicitly specified. |
| 3529 | * |
| 3530 | * <p><em>Note:</em> if using an implicit Intent (without an explicit ComponentName |
| 3531 | * specified), be sure to consider whether to set the {@link #MATCH_DEFAULT_ONLY} |
| 3532 | * only flag. You need to do so to resolve the activity in the same way |
| 3533 | * that {@link android.content.Context#startActivity(Intent)} and |
| 3534 | * {@link android.content.Intent#resolveActivity(PackageManager) |
| 3535 | * Intent.resolveActivity(PackageManager)} do.</p> |
| 3536 | * |
| 3537 | * @param intent An intent containing all of the desired specification |
| 3538 | * (action, data, type, category, and/or component). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3539 | * @param flags Additional option flags. Use any combination of |
| 3540 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3541 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3542 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3543 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_ENCRYPTION_AWARE}, |
| 3544 | * {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, {@link #MATCH_ENCRYPTION_UNAWARE}, |
| 3545 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3546 | * to modify the data returned. The most important is |
| 3547 | * {@link #MATCH_DEFAULT_ONLY}, to limit the resolution to only |
| 3548 | * those activities that support the {@link android.content.Intent#CATEGORY_DEFAULT}. |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3549 | * @param userId The user id. |
| 3550 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3551 | * @return Returns a ResolveInfo object containing the final activity intent |
| 3552 | * that was determined to be the best action. Returns null if no |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3553 | * matching activity was found. If multiple matching activities are |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3554 | * found and there is no default set, returns a ResolveInfo object |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3555 | * containing something else, such as the activity resolver. |
| 3556 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3557 | * @see #GET_META_DATA |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3558 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3559 | * @see #GET_SHARED_LIBRARY_FILES |
| 3560 | * @see #MATCH_ALL |
| 3561 | * @see #MATCH_DISABLED_COMPONENTS |
| 3562 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3563 | * @see #MATCH_DEFAULT_ONLY |
| 3564 | * @see #MATCH_ENCRYPTION_AWARE |
| 3565 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 3566 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 3567 | * @see #MATCH_SYSTEM_ONLY |
| 3568 | * @see #MATCH_UNINSTALLED_PACKAGES |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3569 | * |
| 3570 | * @hide |
| 3571 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3572 | public abstract ResolveInfo resolveActivityAsUser(Intent intent, @ResolveInfoFlags int flags, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3573 | @UserIdInt int userId); |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3574 | |
| 3575 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3576 | * Retrieve all activities that can be performed for the given intent. |
| 3577 | * |
| 3578 | * @param intent The desired intent as per resolveActivity(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3579 | * @param flags Additional option flags. Use any combination of |
| 3580 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3581 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3582 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3583 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_ENCRYPTION_AWARE}, |
| 3584 | * {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, {@link #MATCH_ENCRYPTION_UNAWARE}, |
| 3585 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3586 | * to modify the data returned. The most important is |
| 3587 | * {@link #MATCH_DEFAULT_ONLY}, to limit the resolution to only |
| 3588 | * those activities that support the {@link android.content.Intent#CATEGORY_DEFAULT}. |
| 3589 | * Or, set {@link #MATCH_ALL} to prevent any filtering of the results. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3590 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3591 | * @return Returns a List of ResolveInfo objects containing one entry for each |
| 3592 | * matching activity, ordered from best to worst. In other words, the |
| 3593 | * first item is what would be returned by {@link #resolveActivity}. |
| 3594 | * If there are no matching activities, an empty list is returned. |
Fabrice Di Meglio | 9f7e39f | 2015-04-10 20:40:16 -0700 | [diff] [blame] | 3595 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3596 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3597 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3598 | * @see #GET_SHARED_LIBRARY_FILES |
| 3599 | * @see #MATCH_ALL |
| 3600 | * @see #MATCH_DISABLED_COMPONENTS |
| 3601 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3602 | * @see #MATCH_DEFAULT_ONLY |
| 3603 | * @see #MATCH_ENCRYPTION_AWARE |
| 3604 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 3605 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 3606 | * @see #MATCH_SYSTEM_ONLY |
| 3607 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3608 | */ |
| 3609 | public abstract List<ResolveInfo> queryIntentActivities(Intent intent, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3610 | @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3611 | |
| 3612 | /** |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3613 | * Retrieve all activities that can be performed for the given intent, for a specific user. |
| 3614 | * |
| 3615 | * @param intent The desired intent as per resolveActivity(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3616 | * @param flags Additional option flags. Use any combination of |
| 3617 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3618 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3619 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3620 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_ENCRYPTION_AWARE}, |
| 3621 | * {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, {@link #MATCH_ENCRYPTION_UNAWARE}, |
| 3622 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3623 | * to modify the data returned. The most important is |
| 3624 | * {@link #MATCH_DEFAULT_ONLY}, to limit the resolution to only |
| 3625 | * those activities that support the {@link android.content.Intent#CATEGORY_DEFAULT}. |
| 3626 | * Or, set {@link #MATCH_ALL} to prevent any filtering of the results. |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3627 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3628 | * @return Returns a List of ResolveInfo objects containing one entry for each |
| 3629 | * matching activity, ordered from best to worst. In other words, the |
| 3630 | * first item is what would be returned by {@link #resolveActivity}. |
| 3631 | * If there are no matching activities, an empty list is returned. |
Fabrice Di Meglio | 9f7e39f | 2015-04-10 20:40:16 -0700 | [diff] [blame] | 3632 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3633 | * @see #GET_META_DATA |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3634 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3635 | * @see #GET_SHARED_LIBRARY_FILES |
| 3636 | * @see #MATCH_ALL |
| 3637 | * @see #MATCH_DISABLED_COMPONENTS |
| 3638 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3639 | * @see #MATCH_DEFAULT_ONLY |
| 3640 | * @see #MATCH_ENCRYPTION_AWARE |
| 3641 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 3642 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 3643 | * @see #MATCH_SYSTEM_ONLY |
| 3644 | * @see #MATCH_UNINSTALLED_PACKAGES |
| 3645 | * |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3646 | * @hide |
| 3647 | */ |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3648 | public abstract List<ResolveInfo> queryIntentActivitiesAsUser(Intent intent, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3649 | @ResolveInfoFlags int flags, @UserIdInt int userId); |
Amith Yamasani | 151ec4c | 2012-09-07 19:25:16 -0700 | [diff] [blame] | 3650 | |
| 3651 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3652 | * Retrieve a set of activities that should be presented to the user as |
| 3653 | * similar options. This is like {@link #queryIntentActivities}, except it |
| 3654 | * also allows you to supply a list of more explicit Intents that you would |
| 3655 | * like to resolve to particular options, and takes care of returning the |
| 3656 | * final ResolveInfo list in a reasonable order, with no duplicates, based |
| 3657 | * on those inputs. |
| 3658 | * |
| 3659 | * @param caller The class name of the activity that is making the |
| 3660 | * request. This activity will never appear in the output |
| 3661 | * list. Can be null. |
| 3662 | * @param specifics An array of Intents that should be resolved to the |
| 3663 | * first specific results. Can be null. |
| 3664 | * @param intent The desired intent as per resolveActivity(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3665 | * @param flags Additional option flags. Use any combination of |
| 3666 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3667 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3668 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3669 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_ENCRYPTION_AWARE}, |
| 3670 | * {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, {@link #MATCH_ENCRYPTION_UNAWARE}, |
| 3671 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3672 | * to modify the data returned. The most important is |
| 3673 | * {@link #MATCH_DEFAULT_ONLY}, to limit the resolution to only |
| 3674 | * those activities that support the {@link android.content.Intent#CATEGORY_DEFAULT}. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3675 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3676 | * @return Returns a List of ResolveInfo objects containing one entry for each |
| 3677 | * matching activity. The list is ordered first by all of the intents resolved |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3678 | * in <var>specifics</var> and then any additional activities that |
| 3679 | * can handle <var>intent</var> but did not get included by one of |
| 3680 | * the <var>specifics</var> intents. If there are no matching |
| 3681 | * activities, an empty list is returned. |
| 3682 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3683 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3684 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3685 | * @see #GET_SHARED_LIBRARY_FILES |
| 3686 | * @see #MATCH_ALL |
| 3687 | * @see #MATCH_DISABLED_COMPONENTS |
| 3688 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3689 | * @see #MATCH_DEFAULT_ONLY |
| 3690 | * @see #MATCH_ENCRYPTION_AWARE |
| 3691 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 3692 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 3693 | * @see #MATCH_SYSTEM_ONLY |
| 3694 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3695 | */ |
| 3696 | public abstract List<ResolveInfo> queryIntentActivityOptions( |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3697 | ComponentName caller, Intent[] specifics, Intent intent, @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3698 | |
| 3699 | /** |
| 3700 | * Retrieve all receivers that can handle a broadcast of the given intent. |
| 3701 | * |
| 3702 | * @param intent The desired intent as per resolveActivity(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3703 | * @param flags Additional option flags. Use any combination of |
| 3704 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3705 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3706 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3707 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_ENCRYPTION_AWARE}, |
| 3708 | * {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, {@link #MATCH_ENCRYPTION_UNAWARE}, |
| 3709 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3710 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3711 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3712 | * @return Returns a List of ResolveInfo objects containing one entry for each |
| 3713 | * matching receiver, ordered from best to worst. If there are no matching |
| 3714 | * receivers, an empty list or null is returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3715 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3716 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3717 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3718 | * @see #GET_SHARED_LIBRARY_FILES |
| 3719 | * @see #MATCH_ALL |
| 3720 | * @see #MATCH_DISABLED_COMPONENTS |
| 3721 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3722 | * @see #MATCH_DEFAULT_ONLY |
| 3723 | * @see #MATCH_ENCRYPTION_AWARE |
| 3724 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 3725 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 3726 | * @see #MATCH_SYSTEM_ONLY |
| 3727 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3728 | */ |
| 3729 | public abstract List<ResolveInfo> queryBroadcastReceivers(Intent intent, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3730 | @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3731 | |
| 3732 | /** |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3733 | * Retrieve all receivers that can handle a broadcast of the given intent, for a specific |
| 3734 | * user. |
| 3735 | * |
| 3736 | * @param intent The desired intent as per resolveActivity(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3737 | * @param flags Additional option flags. Use any combination of |
| 3738 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3739 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3740 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3741 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_ENCRYPTION_AWARE}, |
| 3742 | * {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, {@link #MATCH_ENCRYPTION_UNAWARE}, |
| 3743 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3744 | * to modify the data returned. |
Fyodor Kupolov | 940e857 | 2016-01-26 12:03:51 -0800 | [diff] [blame] | 3745 | * @param userHandle UserHandle of the user being queried. |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3746 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3747 | * @return Returns a List of ResolveInfo objects containing one entry for each |
| 3748 | * matching receiver, ordered from best to worst. If there are no matching |
| 3749 | * receivers, an empty list or null is returned. |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3750 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3751 | * @see #GET_META_DATA |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3752 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3753 | * @see #GET_SHARED_LIBRARY_FILES |
| 3754 | * @see #MATCH_ALL |
| 3755 | * @see #MATCH_DISABLED_COMPONENTS |
| 3756 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3757 | * @see #MATCH_DEFAULT_ONLY |
| 3758 | * @see #MATCH_ENCRYPTION_AWARE |
| 3759 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 3760 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 3761 | * @see #MATCH_SYSTEM_ONLY |
| 3762 | * @see #MATCH_UNINSTALLED_PACKAGES |
| 3763 | * |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3764 | * @hide |
| 3765 | */ |
Fyodor Kupolov | 940e857 | 2016-01-26 12:03:51 -0800 | [diff] [blame] | 3766 | @SystemApi |
| 3767 | public List<ResolveInfo> queryBroadcastReceiversAsUser(Intent intent, |
| 3768 | @ResolveInfoFlags int flags, UserHandle userHandle) { |
| 3769 | return queryBroadcastReceiversAsUser(intent, flags, userHandle.getIdentifier()); |
| 3770 | } |
| 3771 | |
| 3772 | /** |
| 3773 | * @hide |
| 3774 | */ |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 3775 | public abstract List<ResolveInfo> queryBroadcastReceiversAsUser(Intent intent, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3776 | @ResolveInfoFlags int flags, @UserIdInt int userId); |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3777 | |
Fyodor Kupolov | 940e857 | 2016-01-26 12:03:51 -0800 | [diff] [blame] | 3778 | |
Jeff Sharkey | bd94022 | 2016-01-08 11:07:13 -0700 | [diff] [blame] | 3779 | /** {@hide} */ |
| 3780 | @Deprecated |
| 3781 | public List<ResolveInfo> queryBroadcastReceivers(Intent intent, |
| 3782 | @ResolveInfoFlags int flags, @UserIdInt int userId) { |
| 3783 | Log.w(TAG, "STAHP USING HIDDEN APIS KTHX"); |
| 3784 | return queryBroadcastReceiversAsUser(intent, flags, userId); |
| 3785 | } |
| 3786 | |
Amith Yamasani | f203aee | 2012-08-29 18:41:53 -0700 | [diff] [blame] | 3787 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3788 | * Determine the best service to handle for a given Intent. |
| 3789 | * |
| 3790 | * @param intent An intent containing all of the desired specification |
| 3791 | * (action, data, type, category, and/or component). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3792 | * @param flags Additional option flags. Use any combination of |
| 3793 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3794 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3795 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3796 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_ENCRYPTION_AWARE}, |
| 3797 | * {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, {@link #MATCH_ENCRYPTION_UNAWARE}, |
| 3798 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3799 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3800 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3801 | * @return Returns a ResolveInfo object containing the final service intent |
| 3802 | * 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] | 3803 | * matching service was found. |
| 3804 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3805 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3806 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3807 | * @see #GET_SHARED_LIBRARY_FILES |
| 3808 | * @see #MATCH_ALL |
| 3809 | * @see #MATCH_DISABLED_COMPONENTS |
| 3810 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3811 | * @see #MATCH_DEFAULT_ONLY |
| 3812 | * @see #MATCH_ENCRYPTION_AWARE |
| 3813 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 3814 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 3815 | * @see #MATCH_SYSTEM_ONLY |
| 3816 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3817 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3818 | public abstract ResolveInfo resolveService(Intent intent, @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3819 | |
| 3820 | /** |
| 3821 | * Retrieve all services that can match the given intent. |
| 3822 | * |
| 3823 | * @param intent The desired intent as per resolveService(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3824 | * @param flags Additional option flags. Use any combination of |
| 3825 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3826 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3827 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3828 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_ENCRYPTION_AWARE}, |
| 3829 | * {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, {@link #MATCH_ENCRYPTION_UNAWARE}, |
| 3830 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3831 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3832 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3833 | * @return Returns a List of ResolveInfo objects containing one entry for each |
| 3834 | * matching service, ordered from best to worst. In other words, the first |
Amith Yamasani | 2b60ca4 | 2016-01-08 17:53:18 -0800 | [diff] [blame] | 3835 | * item is what would be returned by {@link #resolveService}. If there are |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3836 | * no matching services, an empty list or null is returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3837 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3838 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3839 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3840 | * @see #GET_SHARED_LIBRARY_FILES |
| 3841 | * @see #MATCH_ALL |
| 3842 | * @see #MATCH_DISABLED_COMPONENTS |
| 3843 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3844 | * @see #MATCH_DEFAULT_ONLY |
| 3845 | * @see #MATCH_ENCRYPTION_AWARE |
| 3846 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 3847 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 3848 | * @see #MATCH_SYSTEM_ONLY |
| 3849 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3850 | */ |
| 3851 | public abstract List<ResolveInfo> queryIntentServices(Intent intent, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3852 | @ResolveInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3853 | |
| 3854 | /** |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3855 | * Retrieve all services that can match the given intent for a given user. |
| 3856 | * |
| 3857 | * @param intent The desired intent as per resolveService(). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3858 | * @param flags Additional option flags. Use any combination of |
| 3859 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3860 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3861 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3862 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_ENCRYPTION_AWARE}, |
| 3863 | * {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, {@link #MATCH_ENCRYPTION_UNAWARE}, |
| 3864 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3865 | * to modify the data returned. |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3866 | * @param userId The user id. |
| 3867 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3868 | * @return Returns a List of ResolveInfo objects containing one entry for each |
| 3869 | * matching service, ordered from best to worst. In other words, the first |
Amith Yamasani | 2b60ca4 | 2016-01-08 17:53:18 -0800 | [diff] [blame] | 3870 | * item is what would be returned by {@link #resolveService}. If there are |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3871 | * no matching services, an empty list or null is returned. |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3872 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3873 | * @see #GET_META_DATA |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3874 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3875 | * @see #GET_SHARED_LIBRARY_FILES |
| 3876 | * @see #MATCH_ALL |
| 3877 | * @see #MATCH_DISABLED_COMPONENTS |
| 3878 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3879 | * @see #MATCH_DEFAULT_ONLY |
| 3880 | * @see #MATCH_ENCRYPTION_AWARE |
| 3881 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 3882 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 3883 | * @see #MATCH_SYSTEM_ONLY |
| 3884 | * @see #MATCH_UNINSTALLED_PACKAGES |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3885 | * |
| 3886 | * @hide |
| 3887 | */ |
| 3888 | public abstract List<ResolveInfo> queryIntentServicesAsUser(Intent intent, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3889 | @ResolveInfoFlags int flags, @UserIdInt int userId); |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3890 | |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3891 | /** |
| 3892 | * Retrieve all providers that can match the given intent. |
| 3893 | * |
| 3894 | * @param intent An intent containing all of the desired specification |
| 3895 | * (action, data, type, category, and/or component). |
| 3896 | * @param flags Additional option flags. Use any combination of |
| 3897 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3898 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3899 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3900 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_ENCRYPTION_AWARE}, |
| 3901 | * {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, {@link #MATCH_ENCRYPTION_UNAWARE}, |
| 3902 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3903 | * to modify the data returned. |
| 3904 | * @param userId The user id. |
| 3905 | * |
| 3906 | * @return Returns a List of ResolveInfo objects containing one entry for each |
| 3907 | * matching provider, ordered from best to worst. If there are no |
| 3908 | * matching services, an empty list or null is returned. |
| 3909 | * |
| 3910 | * @see #GET_META_DATA |
| 3911 | * @see #GET_RESOLVED_FILTER |
| 3912 | * @see #GET_SHARED_LIBRARY_FILES |
| 3913 | * @see #MATCH_ALL |
| 3914 | * @see #MATCH_DISABLED_COMPONENTS |
| 3915 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3916 | * @see #MATCH_DEFAULT_ONLY |
| 3917 | * @see #MATCH_ENCRYPTION_AWARE |
| 3918 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 3919 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 3920 | * @see #MATCH_SYSTEM_ONLY |
| 3921 | * @see #MATCH_UNINSTALLED_PACKAGES |
| 3922 | * |
| 3923 | * @hide |
| 3924 | */ |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 3925 | public abstract List<ResolveInfo> queryIntentContentProvidersAsUser( |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 3926 | Intent intent, @ResolveInfoFlags int flags, @UserIdInt int userId); |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 3927 | |
| 3928 | /** |
| 3929 | * Retrieve all providers that can match the given intent. |
| 3930 | * |
| 3931 | * @param intent An intent containing all of the desired specification |
| 3932 | * (action, data, type, category, and/or component). |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3933 | * @param flags Additional option flags. Use any combination of |
| 3934 | * {@link #GET_META_DATA}, {@link #GET_RESOLVED_FILTER}, |
| 3935 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #MATCH_ALL}, |
| 3936 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3937 | * {@link #MATCH_DEFAULT_ONLY}, {@link #MATCH_ENCRYPTION_AWARE}, |
| 3938 | * {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, {@link #MATCH_ENCRYPTION_UNAWARE}, |
| 3939 | * {@link #MATCH_SYSTEM_ONLY}, {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3940 | * to modify the data returned. |
| 3941 | * |
| 3942 | * @return Returns a List of ResolveInfo objects containing one entry for each |
| 3943 | * matching provider, ordered from best to worst. If there are no |
| 3944 | * matching services, an empty list or null is returned. |
| 3945 | * |
| 3946 | * @see #GET_META_DATA |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 3947 | * @see #GET_RESOLVED_FILTER |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3948 | * @see #GET_SHARED_LIBRARY_FILES |
| 3949 | * @see #MATCH_ALL |
| 3950 | * @see #MATCH_DISABLED_COMPONENTS |
| 3951 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3952 | * @see #MATCH_DEFAULT_ONLY |
| 3953 | * @see #MATCH_ENCRYPTION_AWARE |
| 3954 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 3955 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 3956 | * @see #MATCH_SYSTEM_ONLY |
| 3957 | * @see #MATCH_UNINSTALLED_PACKAGES |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 3958 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3959 | public abstract List<ResolveInfo> queryIntentContentProviders(Intent intent, |
| 3960 | @ResolveInfoFlags int flags); |
Jeff Sharkey | 85f5f81 | 2013-10-07 10:16:12 -0700 | [diff] [blame] | 3961 | |
Svetoslav Ganov | 58d37b5 | 2012-09-18 12:04:19 -0700 | [diff] [blame] | 3962 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3963 | * Find a single content provider by its base path name. |
| 3964 | * |
| 3965 | * @param name The name of the provider to find. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3966 | * @param flags Additional option flags. Use any combination of |
| 3967 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 3968 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 3969 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 3970 | * {@link #MATCH_ENCRYPTION_AWARE}, {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, |
| 3971 | * {@link #MATCH_ENCRYPTION_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 3972 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 3973 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3974 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3975 | * @return A {@link ProviderInfo} object containing information about the provider. |
| 3976 | * If a provider was not found, returns null. |
| 3977 | * |
| 3978 | * @see #GET_META_DATA |
| 3979 | * @see #GET_SHARED_LIBRARY_FILES |
| 3980 | * @see #MATCH_ALL |
| 3981 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 3982 | * @see #MATCH_DEFAULT_ONLY |
| 3983 | * @see #MATCH_DISABLED_COMPONENTS |
| 3984 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 3985 | * @see #MATCH_ENCRYPTION_AWARE |
| 3986 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 3987 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 3988 | * @see #MATCH_SYSTEM_ONLY |
| 3989 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3990 | */ |
| 3991 | public abstract ProviderInfo resolveContentProvider(String name, |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 3992 | @ComponentInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 3993 | |
| 3994 | /** |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 3995 | * Find a single content provider by its base path name. |
| 3996 | * |
| 3997 | * @param name The name of the provider to find. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 3998 | * @param flags Additional option flags. Use any combination of |
| 3999 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 4000 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 4001 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 4002 | * {@link #MATCH_ENCRYPTION_AWARE}, {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, |
| 4003 | * {@link #MATCH_ENCRYPTION_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 4004 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 4005 | * to modify the data returned. |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4006 | * @param userId The user id. |
| 4007 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4008 | * @return A {@link ProviderInfo} object containing information about the provider. |
| 4009 | * If a provider was not found, returns null. |
| 4010 | * |
| 4011 | * @see #GET_META_DATA |
| 4012 | * @see #GET_SHARED_LIBRARY_FILES |
| 4013 | * @see #MATCH_ALL |
| 4014 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 4015 | * @see #MATCH_DEFAULT_ONLY |
| 4016 | * @see #MATCH_DISABLED_COMPONENTS |
| 4017 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 4018 | * @see #MATCH_ENCRYPTION_AWARE |
| 4019 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 4020 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 4021 | * @see #MATCH_SYSTEM_ONLY |
| 4022 | * @see #MATCH_UNINSTALLED_PACKAGES |
| 4023 | * |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4024 | * @hide |
| 4025 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4026 | public abstract ProviderInfo resolveContentProviderAsUser(String name, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4027 | @ComponentInfoFlags int flags, @UserIdInt int userId); |
Alexandra Gherghina | 0363c3e | 2014-06-23 13:34:59 +0100 | [diff] [blame] | 4028 | |
| 4029 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4030 | * Retrieve content provider information. |
| 4031 | * |
| 4032 | * <p><em>Note: unlike most other methods, an empty result set is indicated |
| 4033 | * by a null return instead of an empty list.</em> |
| 4034 | * |
| 4035 | * @param processName If non-null, limits the returned providers to only |
| 4036 | * those that are hosted by the given process. If null, |
| 4037 | * all content providers are returned. |
| 4038 | * @param uid If <var>processName</var> is non-null, this is the required |
| 4039 | * uid owning the requested content providers. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4040 | * @param flags Additional option flags. Use any combination of |
| 4041 | * {@link #GET_META_DATA}, {@link #GET_SHARED_LIBRARY_FILES}, |
| 4042 | * {@link #MATCH_ALL}, {@link #MATCH_DEFAULT_ONLY}, |
| 4043 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 4044 | * {@link #MATCH_ENCRYPTION_AWARE}, {@link #MATCH_ENCRYPTION_AWARE_AND_UNAWARE}, |
| 4045 | * {@link #MATCH_ENCRYPTION_UNAWARE}, {@link #MATCH_SYSTEM_ONLY} |
| 4046 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 4047 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4048 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4049 | * @return A list of {@link ProviderInfo} objects containing one entry for |
| 4050 | * each provider either matching <var>processName</var> or, if |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4051 | * <var>processName</var> is null, all known content providers. |
| 4052 | * <em>If there are no matching providers, null is returned.</em> |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4053 | * |
| 4054 | * @see #GET_META_DATA |
| 4055 | * @see #GET_SHARED_LIBRARY_FILES |
| 4056 | * @see #MATCH_ALL |
| 4057 | * @see #MATCH_DEBUG_TRIAGED_MISSING |
| 4058 | * @see #MATCH_DEFAULT_ONLY |
| 4059 | * @see #MATCH_DISABLED_COMPONENTS |
| 4060 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 4061 | * @see #MATCH_ENCRYPTION_AWARE |
| 4062 | * @see #MATCH_ENCRYPTION_AWARE_AND_UNAWARE |
| 4063 | * @see #MATCH_ENCRYPTION_UNAWARE |
| 4064 | * @see #MATCH_SYSTEM_ONLY |
| 4065 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4066 | */ |
| 4067 | public abstract List<ProviderInfo> queryContentProviders( |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4068 | String processName, int uid, @ComponentInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4069 | |
| 4070 | /** |
| 4071 | * Retrieve all of the information we know about a particular |
| 4072 | * instrumentation class. |
| 4073 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4074 | * @param className The full name (i.e. |
| 4075 | * com.google.apps.contacts.InstrumentList) of an |
| 4076 | * Instrumentation class. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4077 | * @param flags Additional option flags. Use any combination of |
| 4078 | * {@link #GET_META_DATA} |
| 4079 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4080 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4081 | * @return An {@link InstrumentationInfo} object containing information about the |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4082 | * instrumentation. |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4083 | * @throws NameNotFoundException if a package with the given name cannot be |
| 4084 | * found on the system. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4085 | * |
| 4086 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4087 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4088 | public abstract InstrumentationInfo getInstrumentationInfo(ComponentName className, |
| 4089 | @InstrumentationInfoFlags int flags) throws NameNotFoundException; |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4090 | |
| 4091 | /** |
| 4092 | * Retrieve information about available instrumentation code. May be used |
| 4093 | * to retrieve either all instrumentation code, or only the code targeting |
| 4094 | * a particular package. |
| 4095 | * |
| 4096 | * @param targetPackage If null, all instrumentation is returned; only the |
| 4097 | * instrumentation targeting this package name is |
| 4098 | * returned. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4099 | * @param flags Additional option flags. Use any combination of |
| 4100 | * {@link #GET_META_DATA} |
| 4101 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4102 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4103 | * @return A list of {@link InstrumentationInfo} objects containing one |
| 4104 | * entry for each matching instrumentation. If there are no |
Jesse Hall | f77a34f | 2016-02-04 18:41:33 -0800 | [diff] [blame] | 4105 | * instrumentation available, returns an empty list. |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4106 | * |
| 4107 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4108 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4109 | public abstract List<InstrumentationInfo> queryInstrumentation(String targetPackage, |
| 4110 | @InstrumentationInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4111 | |
| 4112 | /** |
| 4113 | * Retrieve an image from a package. This is a low-level API used by |
| 4114 | * the various package manager info structures (such as |
| 4115 | * {@link ComponentInfo} to implement retrieval of their associated |
| 4116 | * icon. |
| 4117 | * |
| 4118 | * @param packageName The name of the package that this icon is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4119 | * Cannot be null. |
| 4120 | * @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] | 4121 | * @param appInfo Overall information about <var>packageName</var>. This |
| 4122 | * may be null, in which case the application information will be retrieved |
| 4123 | * for you if needed; if you already have this information around, it can |
| 4124 | * be much more efficient to supply it here. |
| 4125 | * |
| 4126 | * @return Returns a Drawable holding the requested image. Returns null if |
| 4127 | * an image could not be found for any reason. |
| 4128 | */ |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 4129 | public abstract Drawable getDrawable(String packageName, @DrawableRes int resid, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4130 | ApplicationInfo appInfo); |
| 4131 | |
| 4132 | /** |
| 4133 | * Retrieve the icon associated with an activity. Given the full name of |
| 4134 | * an activity, retrieves the information about it and calls |
| 4135 | * {@link ComponentInfo#loadIcon ComponentInfo.loadIcon()} to return its icon. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4136 | * If the activity cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4137 | * |
| 4138 | * @param activityName Name of the activity whose icon is to be retrieved. |
| 4139 | * |
| 4140 | * @return Returns the image of the icon, or the default activity icon if |
| 4141 | * it could not be found. Does not return null. |
| 4142 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4143 | * activity could not be loaded. |
| 4144 | * |
| 4145 | * @see #getActivityIcon(Intent) |
| 4146 | */ |
| 4147 | public abstract Drawable getActivityIcon(ComponentName activityName) |
| 4148 | throws NameNotFoundException; |
| 4149 | |
| 4150 | /** |
| 4151 | * Retrieve the icon associated with an Intent. If intent.getClassName() is |
| 4152 | * set, this simply returns the result of |
| 4153 | * getActivityIcon(intent.getClassName()). Otherwise it resolves the intent's |
| 4154 | * component and returns the icon associated with the resolved component. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4155 | * 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] | 4156 | * to a component, NameNotFoundException is thrown. |
| 4157 | * |
| 4158 | * @param intent The intent for which you would like to retrieve an icon. |
| 4159 | * |
| 4160 | * @return Returns the image of the icon, or the default activity icon if |
| 4161 | * it could not be found. Does not return null. |
| 4162 | * @throws NameNotFoundException Thrown if the resources for application |
| 4163 | * matching the given intent could not be loaded. |
| 4164 | * |
| 4165 | * @see #getActivityIcon(ComponentName) |
| 4166 | */ |
| 4167 | public abstract Drawable getActivityIcon(Intent intent) |
| 4168 | throws NameNotFoundException; |
| 4169 | |
| 4170 | /** |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4171 | * Retrieve the banner associated with an activity. Given the full name of |
| 4172 | * an activity, retrieves the information about it and calls |
| 4173 | * {@link ComponentInfo#loadIcon ComponentInfo.loadIcon()} to return its |
| 4174 | * banner. If the activity cannot be found, NameNotFoundException is thrown. |
| 4175 | * |
| 4176 | * @param activityName Name of the activity whose banner is to be retrieved. |
| 4177 | * @return Returns the image of the banner, or null if the activity has no |
| 4178 | * banner specified. |
| 4179 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4180 | * activity could not be loaded. |
| 4181 | * @see #getActivityBanner(Intent) |
| 4182 | */ |
| 4183 | public abstract Drawable getActivityBanner(ComponentName activityName) |
| 4184 | throws NameNotFoundException; |
| 4185 | |
| 4186 | /** |
| 4187 | * Retrieve the banner associated with an Intent. If intent.getClassName() |
| 4188 | * is set, this simply returns the result of |
| 4189 | * getActivityBanner(intent.getClassName()). Otherwise it resolves the |
| 4190 | * intent's component and returns the banner associated with the resolved |
| 4191 | * component. If intent.getClassName() cannot be found or the Intent cannot |
| 4192 | * be resolved to a component, NameNotFoundException is thrown. |
| 4193 | * |
| 4194 | * @param intent The intent for which you would like to retrieve a banner. |
| 4195 | * @return Returns the image of the banner, or null if the activity has no |
| 4196 | * banner specified. |
| 4197 | * @throws NameNotFoundException Thrown if the resources for application |
| 4198 | * matching the given intent could not be loaded. |
| 4199 | * @see #getActivityBanner(ComponentName) |
| 4200 | */ |
| 4201 | public abstract Drawable getActivityBanner(Intent intent) |
| 4202 | throws NameNotFoundException; |
| 4203 | |
| 4204 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4205 | * Return the generic icon for an activity that is used when no specific |
| 4206 | * icon is defined. |
Adam Connors | 23cc04e | 2014-04-01 12:12:20 +0100 | [diff] [blame] | 4207 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4208 | * @return Drawable Image of the icon. |
| 4209 | */ |
| 4210 | public abstract Drawable getDefaultActivityIcon(); |
| 4211 | |
| 4212 | /** |
| 4213 | * Retrieve the icon associated with an application. If it has not defined |
| 4214 | * an icon, the default app icon is returned. Does not return null. |
| 4215 | * |
| 4216 | * @param info Information about application being queried. |
| 4217 | * |
| 4218 | * @return Returns the image of the icon, or the default application icon |
| 4219 | * if it could not be found. |
| 4220 | * |
| 4221 | * @see #getApplicationIcon(String) |
| 4222 | */ |
| 4223 | public abstract Drawable getApplicationIcon(ApplicationInfo info); |
| 4224 | |
| 4225 | /** |
| 4226 | * Retrieve the icon associated with an application. Given the name of the |
| 4227 | * application's package, retrieves the information about it and calls |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4228 | * 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] | 4229 | * found, NameNotFoundException is thrown. |
| 4230 | * |
| 4231 | * @param packageName Name of the package whose application icon is to be |
| 4232 | * retrieved. |
| 4233 | * |
| 4234 | * @return Returns the image of the icon, or the default application icon |
| 4235 | * if it could not be found. Does not return null. |
| 4236 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4237 | * application could not be loaded. |
| 4238 | * |
| 4239 | * @see #getApplicationIcon(ApplicationInfo) |
| 4240 | */ |
| 4241 | public abstract Drawable getApplicationIcon(String packageName) |
| 4242 | throws NameNotFoundException; |
| 4243 | |
| 4244 | /** |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4245 | * Retrieve the banner associated with an application. |
| 4246 | * |
| 4247 | * @param info Information about application being queried. |
| 4248 | * @return Returns the image of the banner or null if the application has no |
| 4249 | * banner specified. |
| 4250 | * @see #getApplicationBanner(String) |
| 4251 | */ |
| 4252 | public abstract Drawable getApplicationBanner(ApplicationInfo info); |
| 4253 | |
| 4254 | /** |
| 4255 | * Retrieve the banner associated with an application. Given the name of the |
| 4256 | * application's package, retrieves the information about it and calls |
| 4257 | * getApplicationIcon() to return its banner. If the application cannot be |
| 4258 | * found, NameNotFoundException is thrown. |
| 4259 | * |
| 4260 | * @param packageName Name of the package whose application banner is to be |
| 4261 | * retrieved. |
| 4262 | * @return Returns the image of the banner or null if the application has no |
| 4263 | * banner specified. |
| 4264 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4265 | * application could not be loaded. |
| 4266 | * @see #getApplicationBanner(ApplicationInfo) |
| 4267 | */ |
| 4268 | public abstract Drawable getApplicationBanner(String packageName) |
| 4269 | throws NameNotFoundException; |
| 4270 | |
| 4271 | /** |
| 4272 | * Retrieve the logo associated with an activity. Given the full name of an |
| 4273 | * activity, retrieves the information about it and calls |
| 4274 | * {@link ComponentInfo#loadLogo ComponentInfo.loadLogo()} to return its |
| 4275 | * logo. If the activity cannot be found, NameNotFoundException is thrown. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4276 | * |
| 4277 | * @param activityName Name of the activity whose logo is to be retrieved. |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4278 | * @return Returns the image of the logo or null if the activity has no logo |
| 4279 | * specified. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4280 | * @throws NameNotFoundException Thrown if the resources for the given |
Jose Lima | f78e312 | 2014-03-06 12:13:15 -0800 | [diff] [blame] | 4281 | * activity could not be loaded. |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4282 | * @see #getActivityLogo(Intent) |
| 4283 | */ |
| 4284 | public abstract Drawable getActivityLogo(ComponentName activityName) |
| 4285 | throws NameNotFoundException; |
| 4286 | |
| 4287 | /** |
| 4288 | * Retrieve the logo associated with an Intent. If intent.getClassName() is |
| 4289 | * set, this simply returns the result of |
| 4290 | * getActivityLogo(intent.getClassName()). Otherwise it resolves the intent's |
| 4291 | * component and returns the logo associated with the resolved component. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4292 | * If intent.getClassName() cannot be found or the Intent cannot be resolved |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4293 | * to a component, NameNotFoundException is thrown. |
| 4294 | * |
| 4295 | * @param intent The intent for which you would like to retrieve a logo. |
| 4296 | * |
| 4297 | * @return Returns the image of the logo, or null if the activity has no |
| 4298 | * logo specified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4299 | * |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4300 | * @throws NameNotFoundException Thrown if the resources for application |
| 4301 | * matching the given intent could not be loaded. |
| 4302 | * |
| 4303 | * @see #getActivityLogo(ComponentName) |
| 4304 | */ |
| 4305 | public abstract Drawable getActivityLogo(Intent intent) |
| 4306 | throws NameNotFoundException; |
| 4307 | |
| 4308 | /** |
| 4309 | * Retrieve the logo associated with an application. If it has not specified |
| 4310 | * a logo, this method returns null. |
| 4311 | * |
| 4312 | * @param info Information about application being queried. |
| 4313 | * |
| 4314 | * @return Returns the image of the logo, or null if no logo is specified |
| 4315 | * by the application. |
| 4316 | * |
| 4317 | * @see #getApplicationLogo(String) |
| 4318 | */ |
| 4319 | public abstract Drawable getApplicationLogo(ApplicationInfo info); |
| 4320 | |
| 4321 | /** |
| 4322 | * Retrieve the logo associated with an application. Given the name of the |
| 4323 | * application's package, retrieves the information about it and calls |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4324 | * getApplicationLogo() to return its logo. If the application cannot be |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4325 | * found, NameNotFoundException is thrown. |
| 4326 | * |
| 4327 | * @param packageName Name of the package whose application logo is to be |
| 4328 | * retrieved. |
| 4329 | * |
| 4330 | * @return Returns the image of the logo, or null if no application logo |
| 4331 | * has been specified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4332 | * |
Adam Powell | 81cd2e9 | 2010-04-21 16:35:18 -0700 | [diff] [blame] | 4333 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4334 | * application could not be loaded. |
| 4335 | * |
| 4336 | * @see #getApplicationLogo(ApplicationInfo) |
| 4337 | */ |
| 4338 | public abstract Drawable getApplicationLogo(String packageName) |
| 4339 | throws NameNotFoundException; |
| 4340 | |
| 4341 | /** |
Kenny Guy | df77d71 | 2015-05-29 17:02:22 +0100 | [diff] [blame] | 4342 | * If the target user is a managed profile of the calling user or if the |
| 4343 | * target user is the caller and is itself a managed profile, then this |
| 4344 | * returns a badged copy of the given icon to be able to distinguish it from |
| 4345 | * the original icon. For badging an arbitrary drawable use |
| 4346 | * {@link #getUserBadgedDrawableForDensity( |
Svetoslav | c7d62f0 | 2014-09-04 15:39:54 -0700 | [diff] [blame] | 4347 | * android.graphics.drawable.Drawable, UserHandle, android.graphics.Rect, int)}. |
| 4348 | * <p> |
| 4349 | * If the original drawable is a BitmapDrawable and the backing bitmap is |
| 4350 | * mutable as per {@link android.graphics.Bitmap#isMutable()}, the badging |
| 4351 | * is performed in place and the original drawable is returned. |
| 4352 | * </p> |
| 4353 | * |
| 4354 | * @param icon The icon to badge. |
| 4355 | * @param user The target user. |
| 4356 | * @return A drawable that combines the original icon and a badge as |
| 4357 | * determined by the system. |
| 4358 | */ |
| 4359 | public abstract Drawable getUserBadgedIcon(Drawable icon, UserHandle user); |
| 4360 | |
| 4361 | /** |
| 4362 | * If the target user is a managed profile of the calling user or the caller |
| 4363 | * is itself a managed profile, then this returns a badged copy of the given |
| 4364 | * drawable allowing the user to distinguish it from the original drawable. |
| 4365 | * The caller can specify the location in the bounds of the drawable to be |
| 4366 | * badged where the badge should be applied as well as the density of the |
| 4367 | * badge to be used. |
| 4368 | * <p> |
| 4369 | * If the original drawable is a BitmapDrawable and the backing bitmap is |
| 4370 | * mutable as per {@link android.graphics.Bitmap#isMutable()}, the bading |
| 4371 | * is performed in place and the original drawable is returned. |
| 4372 | * </p> |
| 4373 | * |
| 4374 | * @param drawable The drawable to badge. |
| 4375 | * @param user The target user. |
| 4376 | * @param badgeLocation Where in the bounds of the badged drawable to place |
| 4377 | * the badge. If not provided, the badge is applied on top of the entire |
| 4378 | * drawable being badged. |
| 4379 | * @param badgeDensity The optional desired density for the badge as per |
| 4380 | * {@link android.util.DisplayMetrics#densityDpi}. If not provided, |
| 4381 | * the density of the display is used. |
| 4382 | * @return A drawable that combines the original drawable and a badge as |
| 4383 | * determined by the system. |
| 4384 | */ |
| 4385 | public abstract Drawable getUserBadgedDrawableForDensity(Drawable drawable, |
| 4386 | UserHandle user, Rect badgeLocation, int badgeDensity); |
| 4387 | |
| 4388 | /** |
| 4389 | * If the target user is a managed profile of the calling user or the caller |
| 4390 | * is itself a managed profile, then this returns a drawable to use as a small |
| 4391 | * icon to include in a view to distinguish it from the original icon. |
| 4392 | * |
| 4393 | * @param user The target user. |
| 4394 | * @param density The optional desired density for the badge as per |
| 4395 | * {@link android.util.DisplayMetrics#densityDpi}. If not provided |
| 4396 | * the density of the current display is used. |
| 4397 | * @return the drawable or null if no drawable is required. |
| 4398 | * @hide |
| 4399 | */ |
| 4400 | public abstract Drawable getUserBadgeForDensity(UserHandle user, int density); |
| 4401 | |
| 4402 | /** |
| 4403 | * 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] | 4404 | * is itself a managed profile, then this returns a drawable to use as a small |
| 4405 | * icon to include in a view to distinguish it from the original icon. This version |
| 4406 | * doesn't have background protection and should be used over a light background instead of |
| 4407 | * a badge. |
| 4408 | * |
| 4409 | * @param user The target user. |
| 4410 | * @param density The optional desired density for the badge as per |
| 4411 | * {@link android.util.DisplayMetrics#densityDpi}. If not provided |
| 4412 | * the density of the current display is used. |
| 4413 | * @return the drawable or null if no drawable is required. |
| 4414 | * @hide |
| 4415 | */ |
| 4416 | public abstract Drawable getUserBadgeForDensityNoBackground(UserHandle user, int density); |
| 4417 | |
| 4418 | /** |
| 4419 | * 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] | 4420 | * is itself a managed profile, then this returns a copy of the label with |
| 4421 | * badging for accessibility services like talkback. E.g. passing in "Email" |
| 4422 | * and it might return "Work Email" for Email in the work profile. |
| 4423 | * |
| 4424 | * @param label The label to change. |
| 4425 | * @param user The target user. |
| 4426 | * @return A label that combines the original label and a badge as |
| 4427 | * determined by the system. |
| 4428 | */ |
| 4429 | public abstract CharSequence getUserBadgedLabel(CharSequence label, UserHandle user); |
| 4430 | |
| 4431 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4432 | * Retrieve text from a package. This is a low-level API used by |
| 4433 | * the various package manager info structures (such as |
| 4434 | * {@link ComponentInfo} to implement retrieval of their associated |
| 4435 | * labels and other text. |
| 4436 | * |
| 4437 | * @param packageName The name of the package that this text is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4438 | * Cannot be null. |
| 4439 | * @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] | 4440 | * @param appInfo Overall information about <var>packageName</var>. This |
| 4441 | * may be null, in which case the application information will be retrieved |
| 4442 | * for you if needed; if you already have this information around, it can |
| 4443 | * be much more efficient to supply it here. |
| 4444 | * |
| 4445 | * @return Returns a CharSequence holding the requested text. Returns null |
| 4446 | * if the text could not be found for any reason. |
| 4447 | */ |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 4448 | public abstract CharSequence getText(String packageName, @StringRes int resid, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4449 | ApplicationInfo appInfo); |
| 4450 | |
| 4451 | /** |
| 4452 | * Retrieve an XML file from a package. This is a low-level API used to |
| 4453 | * retrieve XML meta data. |
| 4454 | * |
| 4455 | * @param packageName The name of the package that this xml is coming from. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4456 | * Cannot be null. |
| 4457 | * @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] | 4458 | * @param appInfo Overall information about <var>packageName</var>. This |
| 4459 | * may be null, in which case the application information will be retrieved |
| 4460 | * for you if needed; if you already have this information around, it can |
| 4461 | * be much more efficient to supply it here. |
| 4462 | * |
| 4463 | * @return Returns an XmlPullParser allowing you to parse out the XML |
| 4464 | * data. Returns null if the xml resource could not be found for any |
| 4465 | * reason. |
| 4466 | */ |
Tor Norbye | 7b9c912 | 2013-05-30 16:48:33 -0700 | [diff] [blame] | 4467 | public abstract XmlResourceParser getXml(String packageName, @XmlRes int resid, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4468 | ApplicationInfo appInfo); |
| 4469 | |
| 4470 | /** |
| 4471 | * Return the label to use for this application. |
| 4472 | * |
| 4473 | * @return Returns the label associated with this application, or null if |
| 4474 | * it could not be found for any reason. |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4475 | * @param info The application to get the label of. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4476 | */ |
| 4477 | public abstract CharSequence getApplicationLabel(ApplicationInfo info); |
| 4478 | |
| 4479 | /** |
| 4480 | * Retrieve the resources associated with an activity. Given the full |
| 4481 | * name of an activity, retrieves the information about it and calls |
| 4482 | * getResources() to return its application's resources. If the activity |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4483 | * cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4484 | * |
| 4485 | * @param activityName Name of the activity whose resources are to be |
| 4486 | * retrieved. |
| 4487 | * |
| 4488 | * @return Returns the application's Resources. |
| 4489 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4490 | * application could not be loaded. |
| 4491 | * |
| 4492 | * @see #getResourcesForApplication(ApplicationInfo) |
| 4493 | */ |
| 4494 | public abstract Resources getResourcesForActivity(ComponentName activityName) |
| 4495 | throws NameNotFoundException; |
| 4496 | |
| 4497 | /** |
| 4498 | * Retrieve the resources for an application. Throws NameNotFoundException |
| 4499 | * if the package is no longer installed. |
| 4500 | * |
| 4501 | * @param app Information about the desired application. |
| 4502 | * |
| 4503 | * @return Returns the application's Resources. |
| 4504 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4505 | * application could not be loaded (most likely because it was uninstalled). |
| 4506 | */ |
| 4507 | public abstract Resources getResourcesForApplication(ApplicationInfo app) |
| 4508 | throws NameNotFoundException; |
| 4509 | |
| 4510 | /** |
| 4511 | * Retrieve the resources associated with an application. Given the full |
| 4512 | * package name of an application, retrieves the information about it and |
| 4513 | * calls getResources() to return its application's resources. If the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4514 | * appPackageName cannot be found, NameNotFoundException is thrown. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4515 | * |
| 4516 | * @param appPackageName Package name of the application whose resources |
| 4517 | * are to be retrieved. |
| 4518 | * |
| 4519 | * @return Returns the application's Resources. |
| 4520 | * @throws NameNotFoundException Thrown if the resources for the given |
| 4521 | * application could not be loaded. |
| 4522 | * |
| 4523 | * @see #getResourcesForApplication(ApplicationInfo) |
| 4524 | */ |
| 4525 | public abstract Resources getResourcesForApplication(String appPackageName) |
| 4526 | throws NameNotFoundException; |
| 4527 | |
Amith Yamasani | 98edc95 | 2012-09-25 14:09:27 -0700 | [diff] [blame] | 4528 | /** @hide */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4529 | public abstract Resources getResourcesForApplicationAsUser(String appPackageName, |
| 4530 | @UserIdInt int userId) throws NameNotFoundException; |
Amith Yamasani | 98edc95 | 2012-09-25 14:09:27 -0700 | [diff] [blame] | 4531 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4532 | /** |
| 4533 | * Retrieve overall information about an application package defined |
| 4534 | * in a package archive file |
| 4535 | * |
| 4536 | * @param archiveFilePath The path to the archive file |
| 4537 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4538 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 4539 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 4540 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 4541 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 4542 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 4543 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 4544 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 4545 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 4546 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 4547 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4548 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4549 | * @return A PackageInfo object containing information about the |
| 4550 | * package archive. If the package could not be parsed, |
| 4551 | * returns null. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4552 | * |
| 4553 | * @see #GET_ACTIVITIES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4554 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4555 | * @see #GET_GIDS |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4556 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4557 | * @see #GET_INTENT_FILTERS |
| 4558 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4559 | * @see #GET_PERMISSIONS |
| 4560 | * @see #GET_PROVIDERS |
| 4561 | * @see #GET_RECEIVERS |
| 4562 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4563 | * @see #GET_SHARED_LIBRARY_FILES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4564 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 4565 | * @see #GET_URI_PERMISSION_PATTERNS |
| 4566 | * @see #MATCH_DISABLED_COMPONENTS |
| 4567 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 4568 | * @see #MATCH_UNINSTALLED_PACKAGES |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4569 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4570 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 4571 | public PackageInfo getPackageArchiveInfo(String archiveFilePath, @PackageInfoFlags int flags) { |
Jeff Sharkey | 275e085 | 2014-06-17 18:18:49 -0700 | [diff] [blame] | 4572 | final PackageParser parser = new PackageParser(); |
| 4573 | final File apkFile = new File(archiveFilePath); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 4574 | try { |
Jeff Sharkey | c313251 | 2016-01-12 14:06:58 -0700 | [diff] [blame] | 4575 | if ((flags & (MATCH_ENCRYPTION_UNAWARE | MATCH_ENCRYPTION_AWARE)) != 0) { |
| 4576 | // Caller expressed an explicit opinion about what encryption |
| 4577 | // aware/unaware components they want to see, so fall through and |
| 4578 | // give them what they want |
| 4579 | } else { |
| 4580 | // Caller expressed no opinion, so match everything |
| 4581 | flags |= MATCH_ENCRYPTION_AWARE_AND_UNAWARE; |
| 4582 | } |
| 4583 | |
Jeff Sharkey | 275e085 | 2014-06-17 18:18:49 -0700 | [diff] [blame] | 4584 | PackageParser.Package pkg = parser.parseMonolithicPackage(apkFile, 0); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 4585 | if ((flags & GET_SIGNATURES) != 0) { |
Svet Ganov | 354cd3c | 2015-12-17 11:35:04 -0800 | [diff] [blame] | 4586 | PackageParser.collectCertificates(pkg, 0); |
Jeff Sharkey | c4858a2 | 2014-06-16 10:51:20 -0700 | [diff] [blame] | 4587 | } |
| 4588 | PackageUserState state = new PackageUserState(); |
| 4589 | return PackageParser.generatePackageInfo(pkg, null, flags, 0, 0, null, state); |
| 4590 | } catch (PackageParserException e) { |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4591 | return null; |
| 4592 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4593 | } |
| 4594 | |
| 4595 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4596 | * @deprecated replaced by {@link PackageInstaller} |
| 4597 | * @hide |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4598 | */ |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4599 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4600 | public abstract void installPackage( |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4601 | Uri packageURI, IPackageInstallObserver observer, @InstallFlags int flags, |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4602 | String installerPackageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4603 | |
| 4604 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4605 | * @deprecated replaced by {@link PackageInstaller} |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4606 | * @hide |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4607 | */ |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4608 | @Deprecated |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4609 | public abstract void installPackageWithVerification(Uri packageURI, |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4610 | IPackageInstallObserver observer, @InstallFlags int flags, String installerPackageName, |
| 4611 | Uri verificationURI, ContainerEncryptionParams encryptionParams); |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4612 | |
| 4613 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4614 | * @deprecated replaced by {@link PackageInstaller} |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4615 | * @hide |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4616 | */ |
| 4617 | @Deprecated |
| 4618 | public abstract void installPackageWithVerificationAndEncryption(Uri packageURI, |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4619 | IPackageInstallObserver observer, @InstallFlags int flags, String installerPackageName, |
| 4620 | VerificationParams verificationParams, ContainerEncryptionParams encryptionParams); |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4621 | |
| 4622 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4623 | * @deprecated replaced by {@link PackageInstaller} |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4624 | * @hide |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4625 | */ |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4626 | @Deprecated |
| 4627 | public abstract void installPackage(Uri packageURI, PackageInstallObserver observer, |
| 4628 | @InstallFlags int flags, String installerPackageName); |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4629 | |
| 4630 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4631 | * @deprecated replaced by {@link PackageInstaller} |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4632 | * @hide |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4633 | */ |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4634 | @Deprecated |
| 4635 | public abstract void installPackageAsUser(Uri packageURI, PackageInstallObserver observer, |
| 4636 | @InstallFlags int flags, String installerPackageName, @UserIdInt int userId); |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4637 | |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4638 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4639 | * @deprecated replaced by {@link PackageInstaller} |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4640 | * @hide |
| 4641 | */ |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4642 | @Deprecated |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4643 | public abstract void installPackageWithVerification(Uri packageURI, |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4644 | PackageInstallObserver observer, @InstallFlags int flags, String installerPackageName, |
| 4645 | Uri verificationURI, ContainerEncryptionParams encryptionParams); |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4646 | |
| 4647 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4648 | * @deprecated replaced by {@link PackageInstaller} |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4649 | * @hide |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4650 | */ |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4651 | @Deprecated |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4652 | public abstract void installPackageWithVerificationAndEncryption(Uri packageURI, |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4653 | PackageInstallObserver observer, @InstallFlags int flags, String installerPackageName, |
Christopher Tate | f1977b4 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4654 | VerificationParams verificationParams, ContainerEncryptionParams encryptionParams); |
Christopher Tate | ab8a501 | 2014-03-24 16:25:51 -0700 | [diff] [blame] | 4655 | |
rich cannings | 706e8ba | 2012-08-20 13:20:14 -0700 | [diff] [blame] | 4656 | /** |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4657 | * If there is already an application with the given package name installed |
| 4658 | * on the system for other users, also install it for the calling user. |
| 4659 | * @hide |
| 4660 | */ |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4661 | public abstract int installExistingPackage(String packageName) throws NameNotFoundException; |
| 4662 | |
| 4663 | /** |
| 4664 | * If there is already an application with the given package name installed |
| 4665 | * on the system for other users, also install it for the specified user. |
| 4666 | * @hide |
| 4667 | */ |
| 4668 | @RequiresPermission(anyOf = { |
| 4669 | Manifest.permission.INSTALL_PACKAGES, |
| 4670 | Manifest.permission.INTERACT_ACROSS_USERS_FULL}) |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4671 | public abstract int installExistingPackageAsUser(String packageName, @UserIdInt int userId) |
Dianne Hackborn | 7767eac | 2012-08-23 18:25:40 -0700 | [diff] [blame] | 4672 | throws NameNotFoundException; |
| 4673 | |
| 4674 | /** |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4675 | * Allows a package listening to the |
| 4676 | * {@link Intent#ACTION_PACKAGE_NEEDS_VERIFICATION package verification |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 4677 | * broadcast} to respond to the package manager. The response must include |
| 4678 | * the {@code verificationCode} which is one of |
| 4679 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 4680 | * {@link PackageManager#VERIFICATION_REJECT}. |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4681 | * |
| 4682 | * @param id pending package identifier as passed via the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4683 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 4684 | * @param verificationCode either {@link PackageManager#VERIFICATION_ALLOW} |
| 4685 | * or {@link PackageManager#VERIFICATION_REJECT}. |
rich cannings | 7e67151 | 2012-08-27 14:44:16 -0700 | [diff] [blame] | 4686 | * @throws SecurityException if the caller does not have the |
Dianne Hackborn | 8832c18 | 2012-09-17 17:20:24 -0700 | [diff] [blame] | 4687 | * PACKAGE_VERIFICATION_AGENT permission. |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4688 | */ |
Kenny Root | 3a9b5fb | 2011-09-20 14:15:38 -0700 | [diff] [blame] | 4689 | public abstract void verifyPendingInstall(int id, int verificationCode); |
Kenny Root | 5ab2157 | 2011-07-27 11:11:19 -0700 | [diff] [blame] | 4690 | |
| 4691 | /** |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4692 | * Allows a package listening to the |
| 4693 | * {@link Intent#ACTION_PACKAGE_NEEDS_VERIFICATION package verification |
| 4694 | * broadcast} to extend the default timeout for a response and declare what |
| 4695 | * action to perform after the timeout occurs. The response must include |
| 4696 | * the {@code verificationCodeAtTimeout} which is one of |
| 4697 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 4698 | * {@link PackageManager#VERIFICATION_REJECT}. |
| 4699 | * |
| 4700 | * This method may only be called once per package id. Additional calls |
| 4701 | * will have no effect. |
| 4702 | * |
| 4703 | * @param id pending package identifier as passed via the |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 4704 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4705 | * @param verificationCodeAtTimeout either |
| 4706 | * {@link PackageManager#VERIFICATION_ALLOW} or |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 4707 | * {@link PackageManager#VERIFICATION_REJECT}. If |
| 4708 | * {@code verificationCodeAtTimeout} is neither |
| 4709 | * {@link PackageManager#VERIFICATION_ALLOW} or |
| 4710 | * {@link PackageManager#VERIFICATION_REJECT}, then |
| 4711 | * {@code verificationCodeAtTimeout} will default to |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4712 | * {@link PackageManager#VERIFICATION_REJECT}. |
| 4713 | * @param millisecondsToDelay the amount of time requested for the timeout. |
| 4714 | * Must be positive and less than |
rich cannings | d1b5cfc | 2012-08-29 14:49:51 -0700 | [diff] [blame] | 4715 | * {@link PackageManager#MAXIMUM_VERIFICATION_TIMEOUT}. If |
| 4716 | * {@code millisecondsToDelay} is out of bounds, |
| 4717 | * {@code millisecondsToDelay} will be set to the closest in |
| 4718 | * bounds value; namely, 0 or |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4719 | * {@link PackageManager#MAXIMUM_VERIFICATION_TIMEOUT}. |
rich cannings | 7e67151 | 2012-08-27 14:44:16 -0700 | [diff] [blame] | 4720 | * @throws SecurityException if the caller does not have the |
Dianne Hackborn | 8832c18 | 2012-09-17 17:20:24 -0700 | [diff] [blame] | 4721 | * PACKAGE_VERIFICATION_AGENT permission. |
rich cannings | d9ef3e5 | 2012-08-22 14:28:05 -0700 | [diff] [blame] | 4722 | */ |
| 4723 | public abstract void extendVerificationTimeout(int id, |
| 4724 | int verificationCodeAtTimeout, long millisecondsToDelay); |
| 4725 | |
| 4726 | /** |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4727 | * Allows a package listening to the |
| 4728 | * {@link Intent#ACTION_INTENT_FILTER_NEEDS_VERIFICATION intent filter verification |
| 4729 | * broadcast} to respond to the package manager. The response must include |
| 4730 | * the {@code verificationCode} which is one of |
| 4731 | * {@link PackageManager#INTENT_FILTER_VERIFICATION_SUCCESS} or |
| 4732 | * {@link PackageManager#INTENT_FILTER_VERIFICATION_FAILURE}. |
| 4733 | * |
| 4734 | * @param verificationId pending package identifier as passed via the |
| 4735 | * {@link PackageManager#EXTRA_VERIFICATION_ID} Intent extra. |
| 4736 | * @param verificationCode either {@link PackageManager#INTENT_FILTER_VERIFICATION_SUCCESS} |
| 4737 | * or {@link PackageManager#INTENT_FILTER_VERIFICATION_FAILURE}. |
| 4738 | * @param outFailedDomains a list of failed domains if the verificationCode is |
| 4739 | * {@link PackageManager#INTENT_FILTER_VERIFICATION_FAILURE}, otherwise null; |
| 4740 | * @throws SecurityException if the caller does not have the |
| 4741 | * INTENT_FILTER_VERIFICATION_AGENT permission. |
| 4742 | * |
| 4743 | * @hide |
| 4744 | */ |
Fabrice Di Meglio | ef741da | 2015-05-12 16:31:38 -0700 | [diff] [blame] | 4745 | @SystemApi |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4746 | public abstract void verifyIntentFilter(int verificationId, int verificationCode, |
| 4747 | List<String> outFailedDomains); |
| 4748 | |
| 4749 | /** |
| 4750 | * Get the status of a Domain Verification Result for an IntentFilter. This is |
| 4751 | * related to the {@link android.content.IntentFilter#setAutoVerify(boolean)} and |
| 4752 | * {@link android.content.IntentFilter#getAutoVerify()} |
| 4753 | * |
| 4754 | * This is used by the ResolverActivity to change the status depending on what the User select |
| 4755 | * in the Disambiguation Dialog and also used by the Settings App for changing the default App |
| 4756 | * for a domain. |
| 4757 | * |
| 4758 | * @param packageName The package name of the Activity associated with the IntentFilter. |
| 4759 | * @param userId The user id. |
| 4760 | * |
| 4761 | * @return The status to set to. This can be |
| 4762 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK} or |
| 4763 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS} or |
| 4764 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER} or |
| 4765 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_UNDEFINED} |
| 4766 | * |
| 4767 | * @hide |
| 4768 | */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4769 | public abstract int getIntentVerificationStatusAsUser(String packageName, @UserIdInt int userId); |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4770 | |
| 4771 | /** |
| 4772 | * Allow to change the status of a Intent Verification status for all IntentFilter of an App. |
| 4773 | * This is related to the {@link android.content.IntentFilter#setAutoVerify(boolean)} and |
| 4774 | * {@link android.content.IntentFilter#getAutoVerify()} |
| 4775 | * |
| 4776 | * This is used by the ResolverActivity to change the status depending on what the User select |
| 4777 | * in the Disambiguation Dialog and also used by the Settings App for changing the default App |
| 4778 | * for a domain. |
| 4779 | * |
| 4780 | * @param packageName The package name of the Activity associated with the IntentFilter. |
| 4781 | * @param status The status to set to. This can be |
| 4782 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ASK} or |
| 4783 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_ALWAYS} or |
| 4784 | * {@link #INTENT_FILTER_DOMAIN_VERIFICATION_STATUS_NEVER} |
| 4785 | * @param userId The user id. |
| 4786 | * |
| 4787 | * @return true if the status has been set. False otherwise. |
| 4788 | * |
| 4789 | * @hide |
| 4790 | */ |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 4791 | public abstract boolean updateIntentVerificationStatusAsUser(String packageName, int status, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4792 | @UserIdInt int userId); |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4793 | |
| 4794 | /** |
| 4795 | * Get the list of IntentFilterVerificationInfo for a specific package and User. |
| 4796 | * |
| 4797 | * @param packageName the package name. When this parameter is set to a non null value, |
| 4798 | * the results will be filtered by the package name provided. |
| 4799 | * 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] | 4800 | * corresponding for all packages |
| 4801 | * |
| 4802 | * @return a list of IntentFilterVerificationInfo for a specific package. |
| 4803 | * |
| 4804 | * @hide |
Fabrice Di Meglio | 1c1b471 | 2014-11-19 17:12:32 -0800 | [diff] [blame] | 4805 | */ |
| 4806 | public abstract List<IntentFilterVerificationInfo> getIntentFilterVerifications( |
| 4807 | String packageName); |
| 4808 | |
| 4809 | /** |
Fabrice Di Meglio | 0788595 | 2015-04-06 19:41:28 -0700 | [diff] [blame] | 4810 | * Get the list of IntentFilter for a specific package. |
| 4811 | * |
| 4812 | * @param packageName the package name. This parameter is set to a non null value, |
| 4813 | * the list will contain all the IntentFilter for that package. |
| 4814 | * Otherwise, the list will be empty. |
| 4815 | * |
| 4816 | * @return a list of IntentFilter for a specific package. |
| 4817 | * |
| 4818 | * @hide |
| 4819 | */ |
| 4820 | public abstract List<IntentFilter> getAllIntentFilters(String packageName); |
| 4821 | |
| 4822 | /** |
Fabrice Di Meglio | 6227172 | 2015-04-10 17:24:02 -0700 | [diff] [blame] | 4823 | * Get the default Browser package name for a specific user. |
| 4824 | * |
| 4825 | * @param userId The user id. |
| 4826 | * |
| 4827 | * @return the package name of the default Browser for the specified user. If the user id passed |
| 4828 | * is -1 (all users) it will return a null value. |
| 4829 | * |
| 4830 | * @hide |
| 4831 | */ |
Jeff Sharkey | a73b8fd | 2016-01-06 17:02:08 -0700 | [diff] [blame] | 4832 | @TestApi |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4833 | public abstract String getDefaultBrowserPackageNameAsUser(@UserIdInt int userId); |
Fabrice Di Meglio | 6227172 | 2015-04-10 17:24:02 -0700 | [diff] [blame] | 4834 | |
| 4835 | /** |
| 4836 | * Set the default Browser package name for a specific user. |
| 4837 | * |
| 4838 | * @param packageName The package name of the default Browser. |
| 4839 | * @param userId The user id. |
| 4840 | * |
| 4841 | * @return true if the default Browser for the specified user has been set, |
| 4842 | * otherwise return false. If the user id passed is -1 (all users) this call will not |
| 4843 | * do anything and just return false. |
| 4844 | * |
| 4845 | * @hide |
| 4846 | */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 4847 | public abstract boolean setDefaultBrowserPackageNameAsUser(String packageName, |
| 4848 | @UserIdInt int userId); |
Fabrice Di Meglio | 6227172 | 2015-04-10 17:24:02 -0700 | [diff] [blame] | 4849 | |
| 4850 | /** |
Dianne Hackborn | 880119b | 2010-11-18 22:26:40 -0800 | [diff] [blame] | 4851 | * Change the installer associated with a given package. There are limitations |
| 4852 | * on how the installer package can be changed; in particular: |
| 4853 | * <ul> |
| 4854 | * <li> A SecurityException will be thrown if <var>installerPackageName</var> |
| 4855 | * is not signed with the same certificate as the calling application. |
| 4856 | * <li> A SecurityException will be thrown if <var>targetPackage</var> already |
| 4857 | * has an installer package, and that installer package is not signed with |
| 4858 | * the same certificate as the calling application. |
| 4859 | * </ul> |
| 4860 | * |
| 4861 | * @param targetPackage The installed package whose installer will be changed. |
| 4862 | * @param installerPackageName The package name of the new installer. May be |
| 4863 | * null to clear the association. |
| 4864 | */ |
| 4865 | public abstract void setInstallerPackageName(String targetPackage, |
| 4866 | String installerPackageName); |
| 4867 | |
| 4868 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4869 | * Attempts to delete a package. Since this may take a little while, the |
| 4870 | * result will be posted back to the given observer. A deletion will fail if |
| 4871 | * the calling context lacks the |
| 4872 | * {@link android.Manifest.permission#DELETE_PACKAGES} permission, if the |
| 4873 | * named package cannot be found, or if the named package is a system |
| 4874 | * package. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4875 | * |
| 4876 | * @param packageName The name of the package to delete |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4877 | * @param observer An observer callback to get notified when the package |
| 4878 | * deletion is complete. |
| 4879 | * {@link android.content.pm.IPackageDeleteObserver#packageDeleted} |
| 4880 | * will be called when that happens. observer may be null to |
| 4881 | * indicate that no callback is desired. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4882 | * @hide |
| 4883 | */ |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4884 | public abstract void deletePackage(String packageName, IPackageDeleteObserver observer, |
| 4885 | @DeleteFlags int flags); |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4886 | |
| 4887 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4888 | * Attempts to delete a package. Since this may take a little while, the |
| 4889 | * result will be posted back to the given observer. A deletion will fail if |
| 4890 | * the named package cannot be found, or if the named package is a system |
| 4891 | * package. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4892 | * |
| 4893 | * @param packageName The name of the package to delete |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4894 | * @param observer An observer callback to get notified when the package |
| 4895 | * deletion is complete. |
| 4896 | * {@link android.content.pm.IPackageDeleteObserver#packageDeleted} |
| 4897 | * will be called when that happens. observer may be null to |
| 4898 | * indicate that no callback is desired. |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4899 | * @param userId The user Id |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4900 | * @hide |
| 4901 | */ |
| 4902 | @RequiresPermission(anyOf = { |
| 4903 | Manifest.permission.DELETE_PACKAGES, |
| 4904 | Manifest.permission.INTERACT_ACROSS_USERS_FULL}) |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 4905 | public abstract void deletePackageAsUser(String packageName, IPackageDeleteObserver observer, |
| 4906 | @DeleteFlags int flags, @UserIdInt int userId); |
Nicolas Prevot | 9a80e53 | 2015-09-23 15:49:28 +0100 | [diff] [blame] | 4907 | |
| 4908 | /** |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4909 | * Retrieve the package name of the application that installed a package. This identifies |
| 4910 | * which market the package came from. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4911 | * |
Jacek Surazski | 65e1317 | 2009-04-28 15:26:38 +0200 | [diff] [blame] | 4912 | * @param packageName The name of the package to query |
| 4913 | */ |
| 4914 | public abstract String getInstallerPackageName(String packageName); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4915 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4916 | /** |
| 4917 | * Attempts to clear the user data directory of an application. |
| 4918 | * Since this may take a little while, the result will |
| 4919 | * be posted back to the given observer. A deletion will fail if the |
| 4920 | * named package cannot be found, or if the named package is a "system package". |
| 4921 | * |
| 4922 | * @param packageName The name of the package |
| 4923 | * @param observer An observer callback to get notified when the operation is finished |
| 4924 | * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)} |
| 4925 | * will be called when that happens. observer may be null to indicate that |
| 4926 | * no callback is desired. |
| 4927 | * |
| 4928 | * @hide |
| 4929 | */ |
| 4930 | public abstract void clearApplicationUserData(String packageName, |
| 4931 | IPackageDataObserver observer); |
| 4932 | /** |
| 4933 | * Attempts to delete the cache files associated with an application. |
| 4934 | * Since this may take a little while, the result will |
| 4935 | * be posted back to the given observer. A deletion will fail if the calling context |
| 4936 | * lacks the {@link android.Manifest.permission#DELETE_CACHE_FILES} permission, if the |
| 4937 | * named package cannot be found, or if the named package is a "system package". |
| 4938 | * |
| 4939 | * @param packageName The name of the package to delete |
| 4940 | * @param observer An observer callback to get notified when the cache file deletion |
| 4941 | * is complete. |
| 4942 | * {@link android.content.pm.IPackageDataObserver#onRemoveCompleted(String, boolean)} |
| 4943 | * will be called when that happens. observer may be null to indicate that |
| 4944 | * no callback is desired. |
| 4945 | * |
| 4946 | * @hide |
| 4947 | */ |
| 4948 | public abstract void deleteApplicationCacheFiles(String packageName, |
| 4949 | IPackageDataObserver observer); |
| 4950 | |
| 4951 | /** |
| 4952 | * Free storage by deleting LRU sorted list of cache files across |
| 4953 | * all applications. If the currently available free storage |
| 4954 | * on the device is greater than or equal to the requested |
| 4955 | * free storage, no cache files are cleared. If the currently |
| 4956 | * available storage on the device is less than the requested |
| 4957 | * free storage, some or all of the cache files across |
| 4958 | * all applications are deleted (based on last accessed time) |
| 4959 | * to increase the free storage space on the device to |
| 4960 | * the requested value. There is no guarantee that clearing all |
| 4961 | * the cache files from all applications will clear up |
| 4962 | * enough storage to achieve the desired value. |
| 4963 | * @param freeStorageSize The number of bytes of storage to be |
| 4964 | * freed by the system. Say if freeStorageSize is XX, |
| 4965 | * and the current free storage is YY, |
| 4966 | * if XX is less than YY, just return. if not free XX-YY number |
| 4967 | * of bytes if possible. |
| 4968 | * @param observer call back used to notify when |
| 4969 | * the operation is completed |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 4970 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4971 | * @hide |
| 4972 | */ |
Jeff Sharkey | 529f91f | 2015-04-18 20:23:13 -0700 | [diff] [blame] | 4973 | public void freeStorageAndNotify(long freeStorageSize, IPackageDataObserver observer) { |
| 4974 | freeStorageAndNotify(null, freeStorageSize, observer); |
| 4975 | } |
| 4976 | |
| 4977 | /** {@hide} */ |
| 4978 | public abstract void freeStorageAndNotify(String volumeUuid, long freeStorageSize, |
| 4979 | IPackageDataObserver observer); |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 4980 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 4981 | /** |
| 4982 | * Free storage by deleting LRU sorted list of cache files across |
| 4983 | * all applications. If the currently available free storage |
| 4984 | * on the device is greater than or equal to the requested |
| 4985 | * free storage, no cache files are cleared. If the currently |
| 4986 | * available storage on the device is less than the requested |
| 4987 | * free storage, some or all of the cache files across |
| 4988 | * all applications are deleted (based on last accessed time) |
| 4989 | * to increase the free storage space on the device to |
| 4990 | * the requested value. There is no guarantee that clearing all |
| 4991 | * the cache files from all applications will clear up |
| 4992 | * enough storage to achieve the desired value. |
| 4993 | * @param freeStorageSize The number of bytes of storage to be |
| 4994 | * freed by the system. Say if freeStorageSize is XX, |
| 4995 | * and the current free storage is YY, |
| 4996 | * if XX is less than YY, just return. if not free XX-YY number |
| 4997 | * of bytes if possible. |
Suchi Amalapurapu | 1ccac75 | 2009-06-12 10:09:58 -0700 | [diff] [blame] | 4998 | * @param pi IntentSender call back used to |
| 4999 | * notify when the operation is completed.May be null |
| 5000 | * to indicate that no call back is desired. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5001 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5002 | * @hide |
| 5003 | */ |
Jeff Sharkey | 529f91f | 2015-04-18 20:23:13 -0700 | [diff] [blame] | 5004 | public void freeStorage(long freeStorageSize, IntentSender pi) { |
| 5005 | freeStorage(null, freeStorageSize, pi); |
| 5006 | } |
| 5007 | |
| 5008 | /** {@hide} */ |
| 5009 | 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] | 5010 | |
| 5011 | /** |
| 5012 | * Retrieve the size information for a package. |
| 5013 | * Since this may take a little while, the result will |
| 5014 | * be posted back to the given observer. The calling context |
| 5015 | * should have the {@link android.Manifest.permission#GET_PACKAGE_SIZE} permission. |
| 5016 | * |
| 5017 | * @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] | 5018 | * @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] | 5019 | * @param observer An observer callback to get notified when the operation |
| 5020 | * is complete. |
| 5021 | * {@link android.content.pm.IPackageStatsObserver#onGetStatsCompleted(PackageStats, boolean)} |
| 5022 | * The observer's callback is invoked with a PackageStats object(containing the |
| 5023 | * code, data and cache sizes of the package) and a boolean value representing |
| 5024 | * the status of the operation. observer may be null to indicate that |
| 5025 | * no callback is desired. |
| 5026 | * |
| 5027 | * @hide |
| 5028 | */ |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 5029 | public abstract void getPackageSizeInfoAsUser(String packageName, @UserIdInt int userId, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5030 | IPackageStatsObserver observer); |
| 5031 | |
| 5032 | /** |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5033 | * Like {@link #getPackageSizeInfoAsUser(String, int, IPackageStatsObserver)}, but |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 5034 | * returns the size for the calling user. |
| 5035 | * |
| 5036 | * @hide |
| 5037 | */ |
| 5038 | public void getPackageSizeInfo(String packageName, IPackageStatsObserver observer) { |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5039 | getPackageSizeInfoAsUser(packageName, UserHandle.myUserId(), observer); |
Dianne Hackborn | 0c38049 | 2012-08-20 17:23:30 -0700 | [diff] [blame] | 5040 | } |
| 5041 | |
| 5042 | /** |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5043 | * @deprecated This function no longer does anything; it was an old |
kmccormick | ac66b85 | 2013-03-28 15:17:15 -0700 | [diff] [blame] | 5044 | * approach to managing preferred activities, which has been superseded |
| 5045 | * by (and conflicts with) the modern activity-based preferences. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5046 | */ |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5047 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5048 | public abstract void addPackageToPreferred(String packageName); |
| 5049 | |
| 5050 | /** |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5051 | * @deprecated This function no longer does anything; it was an old |
kmccormick | ac66b85 | 2013-03-28 15:17:15 -0700 | [diff] [blame] | 5052 | * approach to managing preferred activities, which has been superseded |
| 5053 | * by (and conflicts with) the modern activity-based preferences. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5054 | */ |
Dianne Hackborn | a7ca0e5 | 2009-12-01 14:31:55 -0800 | [diff] [blame] | 5055 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5056 | public abstract void removePackageFromPreferred(String packageName); |
| 5057 | |
| 5058 | /** |
Jeff Sharkey | 629f984 | 2016-01-08 16:36:54 -0700 | [diff] [blame] | 5059 | * 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] | 5060 | * first package on the list is the most preferred, the last is the |
| 5061 | * least preferred. |
| 5062 | * |
| 5063 | * @param flags Additional option flags. Use any combination of |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5064 | * {@link #GET_ACTIVITIES}, {@link #GET_CONFIGURATIONS}, |
| 5065 | * {@link #GET_GIDS}, {@link #GET_INSTRUMENTATION}, |
| 5066 | * {@link #GET_INTENT_FILTERS}, {@link #GET_META_DATA}, |
| 5067 | * {@link #GET_PERMISSIONS}, {@link #GET_PROVIDERS}, |
| 5068 | * {@link #GET_RECEIVERS}, {@link #GET_SERVICES}, |
| 5069 | * {@link #GET_SHARED_LIBRARY_FILES}, {@link #GET_SIGNATURES}, |
| 5070 | * {@link #GET_URI_PERMISSION_PATTERNS}, {@link #GET_UNINSTALLED_PACKAGES}, |
| 5071 | * {@link #MATCH_DISABLED_COMPONENTS}, {@link #MATCH_DISABLED_UNTIL_USED_COMPONENTS}, |
| 5072 | * {@link #MATCH_UNINSTALLED_PACKAGES} |
| 5073 | * to modify the data returned. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5074 | * |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5075 | * @return A List of PackageInfo objects, one for each preferred application, |
| 5076 | * in order of preference. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5077 | * |
| 5078 | * @see #GET_ACTIVITIES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5079 | * @see #GET_CONFIGURATIONS |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5080 | * @see #GET_GIDS |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5081 | * @see #GET_INSTRUMENTATION |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5082 | * @see #GET_INTENT_FILTERS |
| 5083 | * @see #GET_META_DATA |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5084 | * @see #GET_PERMISSIONS |
| 5085 | * @see #GET_PROVIDERS |
| 5086 | * @see #GET_RECEIVERS |
| 5087 | * @see #GET_SERVICES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5088 | * @see #GET_SHARED_LIBRARY_FILES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5089 | * @see #GET_SIGNATURES |
Todd Kennedy | 6b9bfa1 | 2016-01-08 13:44:51 -0800 | [diff] [blame] | 5090 | * @see #GET_URI_PERMISSION_PATTERNS |
| 5091 | * @see #MATCH_DISABLED_COMPONENTS |
| 5092 | * @see #MATCH_DISABLED_UNTIL_USED_COMPONENTS |
| 5093 | * @see #MATCH_UNINSTALLED_PACKAGES |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5094 | */ |
Jeff Sharkey | 2f3e353 | 2015-12-21 14:16:43 -0700 | [diff] [blame] | 5095 | public abstract List<PackageInfo> getPreferredPackages(@PackageInfoFlags int flags); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5096 | |
| 5097 | /** |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5098 | * @deprecated This is a protected API that should not have been available |
| 5099 | * to third party applications. It is the platform's responsibility for |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 5100 | * assigning preferred activities and this cannot be directly modified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5101 | * |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5102 | * Add a new preferred activity mapping to the system. This will be used |
| 5103 | * to automatically select the given activity component when |
| 5104 | * {@link Context#startActivity(Intent) Context.startActivity()} finds |
| 5105 | * multiple matching activities and also matches the given filter. |
| 5106 | * |
| 5107 | * @param filter The set of intents under which this activity will be |
| 5108 | * made preferred. |
| 5109 | * @param match The IntentFilter match category that this preference |
| 5110 | * applies to. |
| 5111 | * @param set The set of activities that the user was picking from when |
| 5112 | * this preference was made. |
| 5113 | * @param activity The component name of the activity that is to be |
| 5114 | * preferred. |
| 5115 | */ |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5116 | @Deprecated |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5117 | public abstract void addPreferredActivity(IntentFilter filter, int match, |
| 5118 | ComponentName[] set, ComponentName activity); |
| 5119 | |
| 5120 | /** |
Amith Yamasani | a3f133a | 2012-08-09 17:11:28 -0700 | [diff] [blame] | 5121 | * Same as {@link #addPreferredActivity(IntentFilter, int, |
| 5122 | ComponentName[], ComponentName)}, but with a specific userId to apply the preference |
| 5123 | to. |
| 5124 | * @hide |
| 5125 | */ |
Jeff Sharkey | e06b4d1 | 2016-01-06 14:51:50 -0700 | [diff] [blame] | 5126 | public void addPreferredActivityAsUser(IntentFilter filter, int match, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 5127 | ComponentName[] set, ComponentName activity, @UserIdInt int userId) { |
Amith Yamasani | a3f133a | 2012-08-09 17:11:28 -0700 | [diff] [blame] | 5128 | throw new RuntimeException("Not implemented. Must override in a subclass."); |
| 5129 | } |
| 5130 | |
| 5131 | /** |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5132 | * @deprecated This is a protected API that should not have been available |
| 5133 | * to third party applications. It is the platform's responsibility for |
kmccormick | 30498b4 | 2013-03-27 17:39:17 -0700 | [diff] [blame] | 5134 | * assigning preferred activities and this cannot be directly modified. |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5135 | * |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 5136 | * Replaces an existing preferred activity mapping to the system, and if that were not present |
| 5137 | * adds a new preferred activity. This will be used |
| 5138 | * to automatically select the given activity component when |
| 5139 | * {@link Context#startActivity(Intent) Context.startActivity()} finds |
| 5140 | * multiple matching activities and also matches the given filter. |
| 5141 | * |
| 5142 | * @param filter The set of intents under which this activity will be |
| 5143 | * made preferred. |
| 5144 | * @param match The IntentFilter match category that this preference |
| 5145 | * applies to. |
| 5146 | * @param set The set of activities that the user was picking from when |
| 5147 | * this preference was made. |
| 5148 | * @param activity The component name of the activity that is to be |
| 5149 | * preferred. |
| 5150 | * @hide |
| 5151 | */ |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5152 | @Deprecated |
Satish Sampath | 8dbe612 | 2009-06-02 23:35:54 +0100 | [diff] [blame] | 5153 | public abstract void replacePreferredActivity(IntentFilter filter, int match, |
| 5154 | ComponentName[] set, ComponentName activity); |
| 5155 | |
| 5156 | /** |
Amith Yamasani | 41c1ded | 2014-08-05 11:15:05 -0700 | [diff] [blame] | 5157 | * @hide |
| 5158 | */ |
| 5159 | @Deprecated |
| 5160 | public void replacePreferredActivityAsUser(IntentFilter filter, int match, |
Jeff Sharkey | 8588bc1 | 2016-01-06 16:47:42 -0700 | [diff] [blame] | 5161 | ComponentName[] set, ComponentName activity, @UserIdInt int userId) { |
Amith Yamasani | 41c1ded | 2014-08-05 11:15:05 -0700 | [diff] [blame] | 5162 | throw new RuntimeException("Not implemented. Must override in a subclass."); |
| 5163 | } |
| 5164 | |
| 5165 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5166 | * Remove all preferred activity mappings, previously added with |
| 5167 | * {@link #addPreferredActivity}, from the |
| 5168 | * system whose activities are implemented in the given package name. |
Dianne Hackborn | 2ee89ea | 2010-03-10 18:27:09 -0800 | [diff] [blame] | 5169 | * An application can only clear its own package(s). |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5170 | * |
| 5171 | * @param packageName The name of the package whose preferred activity |
| 5172 | * mappings are to be removed. |
| 5173 | */ |
| 5174 | public abstract void clearPackagePreferredActivities(String packageName); |
| 5175 | |
| 5176 | /** |
| 5177 | * Retrieve all preferred activities, previously added with |
| 5178 | * {@link #addPreferredActivity}, that are |
| 5179 | * currently registered with the system. |
| 5180 | * |
John Spurlock | 38e6425 | 2015-03-18 12:09:32 -0400 | [diff] [blame] | 5181 | * @param outFilters A required list in which to place the filters of all of the |
| 5182 | * preferred activities. |
| 5183 | * @param outActivities A required list in which to place the component names of |
| 5184 | * all of the preferred activities. |
| 5185 | * @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] | 5186 | * the list. If null, all activities will be returned; if non-null, only |
| 5187 | * those activities in the given package are returned. |
| 5188 | * |
| 5189 | * @return Returns the total number of registered preferred activities |
| 5190 | * (the number of distinct IntentFilter records, not the number of unique |
| 5191 | * activity components) that were found. |
| 5192 | */ |
John Spurlock | 38e6425 | 2015-03-18 12:09:32 -0400 | [diff] [blame] | 5193 | public abstract int getPreferredActivities(@NonNull List<IntentFilter> outFilters, |
| 5194 | @NonNull List<ComponentName> outActivities, String packageName); |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5195 | |
| 5196 | /** |
Christopher Tate | a2a0850d | 2013-09-05 16:38:58 -0700 | [diff] [blame] | 5197 | * Ask for the set of available 'home' activities and the current explicit |
| 5198 | * default, if any. |
| 5199 | * @hide |
| 5200 | */ |
| 5201 | public abstract ComponentName getHomeActivities(List<ResolveInfo> outActivities); |
| 5202 | |
| 5203 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5204 | * Set the enabled setting for a package component (activity, receiver, service, provider). |
| 5205 | * This setting will override any enabled state which may have been set by the component in its |
| 5206 | * manifest. |
| 5207 | * |
| 5208 | * @param componentName The component to enable |
| 5209 | * @param newState The new enabled state for the component. The legal values for this state |
| 5210 | * are: |
| 5211 | * {@link #COMPONENT_ENABLED_STATE_ENABLED}, |
| 5212 | * {@link #COMPONENT_ENABLED_STATE_DISABLED} |
| 5213 | * and |
| 5214 | * {@link #COMPONENT_ENABLED_STATE_DEFAULT} |
| 5215 | * The last one removes the setting, thereby restoring the component's state to |
| 5216 | * whatever was set in it's manifest (or enabled, by default). |
| 5217 | * @param flags Optional behavior flags: {@link #DONT_KILL_APP} or 0. |
| 5218 | */ |
| 5219 | public abstract void setComponentEnabledSetting(ComponentName componentName, |
| 5220 | int newState, int flags); |
| 5221 | |
| 5222 | |
| 5223 | /** |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 5224 | * Return the enabled setting for a package component (activity, |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5225 | * receiver, service, provider). This returns the last value set by |
| 5226 | * {@link #setComponentEnabledSetting(ComponentName, int, int)}; in most |
| 5227 | * cases this value will be {@link #COMPONENT_ENABLED_STATE_DEFAULT} since |
| 5228 | * the value originally specified in the manifest has not been modified. |
| 5229 | * |
| 5230 | * @param componentName The component to retrieve. |
| 5231 | * @return Returns the current enabled state for the component. May |
| 5232 | * be one of {@link #COMPONENT_ENABLED_STATE_ENABLED}, |
| 5233 | * {@link #COMPONENT_ENABLED_STATE_DISABLED}, or |
| 5234 | * {@link #COMPONENT_ENABLED_STATE_DEFAULT}. The last one means the |
| 5235 | * component's enabled state is based on the original information in |
| 5236 | * the manifest as found in {@link ComponentInfo}. |
| 5237 | */ |
| 5238 | public abstract int getComponentEnabledSetting(ComponentName componentName); |
| 5239 | |
| 5240 | /** |
| 5241 | * Set the enabled setting for an application |
| 5242 | * This setting will override any enabled state which may have been set by the application in |
| 5243 | * its manifest. It also overrides the enabled state set in the manifest for any of the |
| 5244 | * application's components. It does not override any enabled state set by |
| 5245 | * {@link #setComponentEnabledSetting} for any of the application's components. |
| 5246 | * |
| 5247 | * @param packageName The package name of the application to enable |
| 5248 | * @param newState The new enabled state for the component. The legal values for this state |
| 5249 | * are: |
| 5250 | * {@link #COMPONENT_ENABLED_STATE_ENABLED}, |
| 5251 | * {@link #COMPONENT_ENABLED_STATE_DISABLED} |
| 5252 | * and |
| 5253 | * {@link #COMPONENT_ENABLED_STATE_DEFAULT} |
| 5254 | * The last one removes the setting, thereby restoring the applications's state to |
| 5255 | * whatever was set in its manifest (or enabled, by default). |
| 5256 | * @param flags Optional behavior flags: {@link #DONT_KILL_APP} or 0. |
| 5257 | */ |
| 5258 | public abstract void setApplicationEnabledSetting(String packageName, |
| 5259 | int newState, int flags); |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5260 | |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5261 | /** |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 5262 | * Return the enabled setting for an application. This returns |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5263 | * the last value set by |
| 5264 | * {@link #setApplicationEnabledSetting(String, int, int)}; in most |
| 5265 | * cases this value will be {@link #COMPONENT_ENABLED_STATE_DEFAULT} since |
| 5266 | * the value originally specified in the manifest has not been modified. |
| 5267 | * |
Amaury Medeiros | dde2426 | 2014-06-03 20:06:41 -0300 | [diff] [blame] | 5268 | * @param packageName The package name of the application to retrieve. |
| 5269 | * @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] | 5270 | * be one of {@link #COMPONENT_ENABLED_STATE_ENABLED}, |
| 5271 | * {@link #COMPONENT_ENABLED_STATE_DISABLED}, or |
| 5272 | * {@link #COMPONENT_ENABLED_STATE_DEFAULT}. The last one means the |
| 5273 | * application's enabled state is based on the original information in |
| 5274 | * the manifest as found in {@link ComponentInfo}. |
Mathew Inwood | 1b9f8d9 | 2011-09-26 13:23:56 +0100 | [diff] [blame] | 5275 | * @throws IllegalArgumentException if the named package does not exist. |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5276 | */ |
| 5277 | public abstract int getApplicationEnabledSetting(String packageName); |
| 5278 | |
| 5279 | /** |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5280 | * 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] | 5281 | * 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] | 5282 | * package file. Application can be unhidden by either resetting the hidden state |
| 5283 | * or by installing it, such as with {@link #installExistingPackage(String)} |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5284 | * @hide |
| 5285 | */ |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5286 | public abstract boolean setApplicationHiddenSettingAsUser(String packageName, boolean hidden, |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5287 | UserHandle userHandle); |
| 5288 | |
| 5289 | /** |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5290 | * Returns the hidden state of a package. |
| 5291 | * @see #setApplicationHiddenSettingAsUser(String, boolean, UserHandle) |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5292 | * @hide |
| 5293 | */ |
Amith Yamasani | e5bcff6 | 2014-07-19 15:44:09 -0700 | [diff] [blame] | 5294 | public abstract boolean getApplicationHiddenSettingAsUser(String packageName, |
Amith Yamasani | 655d0e2 | 2013-06-12 14:19:10 -0700 | [diff] [blame] | 5295 | UserHandle userHandle); |
| 5296 | |
| 5297 | /** |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5298 | * Return whether the device has been booted into safe mode. |
| 5299 | */ |
| 5300 | public abstract boolean isSafeMode(); |
Suchi Amalapurapu | 8946dd3 | 2010-02-19 09:19:34 -0800 | [diff] [blame] | 5301 | |
| 5302 | /** |
Svetoslav | f7c06eb | 2015-06-10 18:43:22 -0700 | [diff] [blame] | 5303 | * Adds a listener for permission changes for installed packages. |
| 5304 | * |
| 5305 | * @param listener The listener to add. |
| 5306 | * |
| 5307 | * @hide |
| 5308 | */ |
| 5309 | @SystemApi |
| 5310 | @RequiresPermission(Manifest.permission.OBSERVE_GRANT_REVOKE_PERMISSIONS) |
| 5311 | public abstract void addOnPermissionsChangeListener(OnPermissionsChangedListener listener); |
| 5312 | |
| 5313 | /** |
| 5314 | * Remvoes a listener for permission changes for installed packages. |
| 5315 | * |
| 5316 | * @param listener The listener to remove. |
| 5317 | * |
| 5318 | * @hide |
| 5319 | */ |
| 5320 | @SystemApi |
| 5321 | public abstract void removeOnPermissionsChangeListener(OnPermissionsChangedListener listener); |
| 5322 | |
| 5323 | /** |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5324 | * Return the {@link KeySet} associated with the String alias for this |
| 5325 | * application. |
| 5326 | * |
| 5327 | * @param alias The alias for a given {@link KeySet} as defined in the |
| 5328 | * application's AndroidManifest.xml. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5329 | * @hide |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5330 | */ |
| 5331 | public abstract KeySet getKeySetByAlias(String packageName, String alias); |
| 5332 | |
Ihab Awad | 1ec6888 | 2014-09-12 11:09:01 -0700 | [diff] [blame] | 5333 | /** Return the signing {@link KeySet} for this application. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5334 | * @hide |
| 5335 | */ |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5336 | public abstract KeySet getSigningKeySet(String packageName); |
| 5337 | |
| 5338 | /** |
| 5339 | * Return whether the package denoted by packageName has been signed by all |
| 5340 | * of the keys specified by the {@link KeySet} ks. This will return true if |
| 5341 | * the package has been signed by additional keys (a superset) as well. |
| 5342 | * Compare to {@link #isSignedByExactly(String packageName, KeySet ks)}. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5343 | * @hide |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5344 | */ |
| 5345 | public abstract boolean isSignedBy(String packageName, KeySet ks); |
| 5346 | |
| 5347 | /** |
| 5348 | * Return whether the package denoted by packageName has been signed by all |
| 5349 | * of, and only, the keys specified by the {@link KeySet} ks. Compare to |
| 5350 | * {@link #isSignedBy(String packageName, KeySet ks)}. |
dcashman | c6f2249 | 2014-08-14 09:54:51 -0700 | [diff] [blame] | 5351 | * @hide |
dcashman | 9d2f441 | 2014-06-09 09:27:54 -0700 | [diff] [blame] | 5352 | */ |
| 5353 | public abstract boolean isSignedByExactly(String packageName, KeySet ks); |
| 5354 | |
| 5355 | /** |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5356 | * 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] | 5357 | * |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5358 | * <p>It doesn't remove the data or the actual package file. The application notifications |
| 5359 | * will be hidden, the application will not show up in recents, will not be able to show |
| 5360 | * toasts or dialogs or ring the device. |
| 5361 | * |
| 5362 | * @param packageNames The names of the packages to set the suspended status. |
| 5363 | * @param suspended If set to {@code true} than the packages will be suspended, if set to |
| 5364 | * {@code false} the packages will be unsuspended. |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5365 | * @param userId The user id. |
| 5366 | * |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5367 | * @return an array of package names for which the suspended status is not set as requested in |
| 5368 | * this method. |
| 5369 | * |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5370 | * @hide |
| 5371 | */ |
Andrei Stingaceanu | eb84b18 | 2016-01-26 18:39:55 +0000 | [diff] [blame] | 5372 | public abstract String[] setPackagesSuspendedAsUser( |
| 5373 | String[] packageNames, boolean suspended, @UserIdInt int userId); |
Andrei Stingaceanu | 1e28391 | 2015-11-26 15:26:28 +0000 | [diff] [blame] | 5374 | |
Andrei Stingaceanu | 355b232 | 2016-02-12 16:43:51 +0000 | [diff] [blame] | 5375 | /** |
| 5376 | * @see #setPackageSuspendedAsUser(String, boolean, int) |
| 5377 | * @param packageName The name of the package to get the suspended status of. |
| 5378 | * @param userId The user id. |
| 5379 | * @return {@code true} if the package is suspended or {@code false} if the package is not |
| 5380 | * suspended or could not be found. |
| 5381 | * @hide |
| 5382 | */ |
| 5383 | public abstract boolean isPackageSuspendedForUser(String packageName, int userId); |
| 5384 | |
Jeff Sharkey | b2b9ab8 | 2015-04-05 21:10:42 -0700 | [diff] [blame] | 5385 | /** {@hide} */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5386 | public static boolean isMoveStatusFinished(int status) { |
| 5387 | return (status < 0 || status > 100); |
| 5388 | } |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5389 | |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 5390 | /** {@hide} */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5391 | public static abstract class MoveCallback { |
Jeff Sharkey | 50a0545 | 2015-04-29 11:24:52 -0700 | [diff] [blame] | 5392 | public void onCreated(int moveId, Bundle extras) {} |
| 5393 | public abstract void onStatusChanged(int moveId, int status, long estMillis); |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5394 | } |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 5395 | |
| 5396 | /** {@hide} */ |
Jeff Sharkey | 620b32b | 2015-04-23 19:36:02 -0700 | [diff] [blame] | 5397 | public abstract int getMoveStatus(int moveId); |
| 5398 | |
| 5399 | /** {@hide} */ |
| 5400 | public abstract void registerMoveCallback(MoveCallback callback, Handler handler); |
| 5401 | /** {@hide} */ |
| 5402 | public abstract void unregisterMoveCallback(MoveCallback callback); |
| 5403 | |
| 5404 | /** {@hide} */ |
| 5405 | public abstract int movePackage(String packageName, VolumeInfo vol); |
| 5406 | /** {@hide} */ |
| 5407 | public abstract @Nullable VolumeInfo getPackageCurrentVolume(ApplicationInfo app); |
| 5408 | /** {@hide} */ |
| 5409 | public abstract @NonNull List<VolumeInfo> getPackageCandidateVolumes(ApplicationInfo app); |
| 5410 | |
| 5411 | /** {@hide} */ |
| 5412 | public abstract int movePrimaryStorage(VolumeInfo vol); |
| 5413 | /** {@hide} */ |
| 5414 | public abstract @Nullable VolumeInfo getPrimaryStorageCurrentVolume(); |
| 5415 | /** {@hide} */ |
| 5416 | public abstract @NonNull List<VolumeInfo> getPrimaryStorageCandidateVolumes(); |
Jeff Sharkey | e2d45be | 2015-04-15 17:14:12 -0700 | [diff] [blame] | 5417 | |
Amith Yamasani | 4b2e934 | 2011-03-31 12:38:53 -0700 | [diff] [blame] | 5418 | /** |
Amith Yamasani | 1359360 | 2012-03-22 16:16:17 -0700 | [diff] [blame] | 5419 | * Returns the device identity that verifiers can use to associate their scheme to a particular |
| 5420 | * 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] | 5421 | * |
Kenny Root | 0aaa0d9 | 2011-09-12 16:42:55 -0700 | [diff] [blame] | 5422 | * @return identity that uniquely identifies current device |
| 5423 | * @hide |
| 5424 | */ |
| 5425 | public abstract VerifierDeviceIdentity getVerifierDeviceIdentity(); |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 5426 | |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5427 | /** |
Jeff Hao | 9f60c08 | 2014-10-28 18:51:07 -0700 | [diff] [blame] | 5428 | * Returns true if the device is upgrading, such as first boot after OTA. |
| 5429 | * |
| 5430 | * @hide |
| 5431 | */ |
| 5432 | public abstract boolean isUpgrade(); |
| 5433 | |
| 5434 | /** |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5435 | * Return interface that offers the ability to install, upgrade, and remove |
| 5436 | * applications on the device. |
| 5437 | */ |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5438 | public abstract @NonNull PackageInstaller getPackageInstaller(); |
Jeff Sharkey | 3a44f3f | 2014-04-28 17:36:31 -0700 | [diff] [blame] | 5439 | |
Amith Yamasani | 742a671 | 2011-05-04 14:49:28 -0700 | [diff] [blame] | 5440 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5441 | * Adds a {@code CrossProfileIntentFilter}. After calling this method all |
| 5442 | * intents sent from the user with id sourceUserId can also be be resolved |
| 5443 | * by activities in the user with id targetUserId if they match the |
| 5444 | * specified intent filter. |
| 5445 | * |
Nicolas Prevot | 3f7777f | 2014-07-24 15:58:39 +0100 | [diff] [blame] | 5446 | * @param filter The {@link IntentFilter} the intent has to match |
| 5447 | * @param sourceUserId The source user id. |
| 5448 | * @param targetUserId The target user id. |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5449 | * @param flags The possible values are {@link #SKIP_CURRENT_PROFILE} and |
| 5450 | * {@link #ONLY_IF_NO_MATCH_FOUND}. |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 5451 | * @hide |
| 5452 | */ |
Nicolas Prevot | 63798c5 | 2014-05-27 13:22:38 +0100 | [diff] [blame] | 5453 | public abstract void addCrossProfileIntentFilter(IntentFilter filter, int sourceUserId, |
| 5454 | int targetUserId, int flags); |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 5455 | |
| 5456 | /** |
Jeff Sharkey | 5aa8693 | 2016-01-08 19:07:49 -0700 | [diff] [blame] | 5457 | * Clearing {@code CrossProfileIntentFilter}s which have the specified user |
| 5458 | * as their source, and have been set by the app calling this method. |
| 5459 | * |
Nicolas Prevot | 3f7777f | 2014-07-24 15:58:39 +0100 | [diff] [blame] | 5460 | * @param sourceUserId The source user id. |
Nicolas Prevot | c79586e | 2014-05-06 12:47:57 +0100 | [diff] [blame] | 5461 | * @hide |
| 5462 | */ |
Nicolas Prevot | 8194899 | 2014-05-16 18:25:26 +0100 | [diff] [blame] | 5463 | public abstract void clearCrossProfileIntentFilters(int sourceUserId); |
Alexandra Gherghina | 6e2ae25 | 2014-06-12 16:03:58 +0100 | [diff] [blame] | 5464 | |
| 5465 | /** |
Nicolas Prevot | 88cc346 | 2014-05-14 14:51:48 +0100 | [diff] [blame] | 5466 | * @hide |
| 5467 | */ |
Nicolas Prevot | 7f7b0c7 | 2014-06-23 15:59:38 +0100 | [diff] [blame] | 5468 | public abstract Drawable loadItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo); |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5469 | |
Benjamin Franz | ec2d48b | 2014-10-01 15:38:43 +0100 | [diff] [blame] | 5470 | /** |
| 5471 | * @hide |
| 5472 | */ |
| 5473 | public abstract Drawable loadUnbadgedItemIcon(PackageItemInfo itemInfo, ApplicationInfo appInfo); |
| 5474 | |
Jeff Sharkey | 6c833e0 | 2014-07-14 22:44:30 -0700 | [diff] [blame] | 5475 | /** {@hide} */ |
| 5476 | public abstract boolean isPackageAvailable(String packageName); |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5477 | |
| 5478 | /** {@hide} */ |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5479 | public static String installStatusToString(int status, String msg) { |
| 5480 | final String str = installStatusToString(status); |
| 5481 | if (msg != null) { |
| 5482 | return str + ": " + msg; |
| 5483 | } else { |
| 5484 | return str; |
| 5485 | } |
| 5486 | } |
| 5487 | |
| 5488 | /** {@hide} */ |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5489 | public static String installStatusToString(int status) { |
| 5490 | switch (status) { |
| 5491 | case INSTALL_SUCCEEDED: return "INSTALL_SUCCEEDED"; |
| 5492 | case INSTALL_FAILED_ALREADY_EXISTS: return "INSTALL_FAILED_ALREADY_EXISTS"; |
| 5493 | case INSTALL_FAILED_INVALID_APK: return "INSTALL_FAILED_INVALID_APK"; |
| 5494 | case INSTALL_FAILED_INVALID_URI: return "INSTALL_FAILED_INVALID_URI"; |
| 5495 | case INSTALL_FAILED_INSUFFICIENT_STORAGE: return "INSTALL_FAILED_INSUFFICIENT_STORAGE"; |
| 5496 | case INSTALL_FAILED_DUPLICATE_PACKAGE: return "INSTALL_FAILED_DUPLICATE_PACKAGE"; |
| 5497 | case INSTALL_FAILED_NO_SHARED_USER: return "INSTALL_FAILED_NO_SHARED_USER"; |
| 5498 | case INSTALL_FAILED_UPDATE_INCOMPATIBLE: return "INSTALL_FAILED_UPDATE_INCOMPATIBLE"; |
| 5499 | case INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: return "INSTALL_FAILED_SHARED_USER_INCOMPATIBLE"; |
| 5500 | case INSTALL_FAILED_MISSING_SHARED_LIBRARY: return "INSTALL_FAILED_MISSING_SHARED_LIBRARY"; |
| 5501 | case INSTALL_FAILED_REPLACE_COULDNT_DELETE: return "INSTALL_FAILED_REPLACE_COULDNT_DELETE"; |
| 5502 | case INSTALL_FAILED_DEXOPT: return "INSTALL_FAILED_DEXOPT"; |
| 5503 | case INSTALL_FAILED_OLDER_SDK: return "INSTALL_FAILED_OLDER_SDK"; |
| 5504 | case INSTALL_FAILED_CONFLICTING_PROVIDER: return "INSTALL_FAILED_CONFLICTING_PROVIDER"; |
| 5505 | case INSTALL_FAILED_NEWER_SDK: return "INSTALL_FAILED_NEWER_SDK"; |
| 5506 | case INSTALL_FAILED_TEST_ONLY: return "INSTALL_FAILED_TEST_ONLY"; |
| 5507 | case INSTALL_FAILED_CPU_ABI_INCOMPATIBLE: return "INSTALL_FAILED_CPU_ABI_INCOMPATIBLE"; |
| 5508 | case INSTALL_FAILED_MISSING_FEATURE: return "INSTALL_FAILED_MISSING_FEATURE"; |
| 5509 | case INSTALL_FAILED_CONTAINER_ERROR: return "INSTALL_FAILED_CONTAINER_ERROR"; |
| 5510 | case INSTALL_FAILED_INVALID_INSTALL_LOCATION: return "INSTALL_FAILED_INVALID_INSTALL_LOCATION"; |
| 5511 | case INSTALL_FAILED_MEDIA_UNAVAILABLE: return "INSTALL_FAILED_MEDIA_UNAVAILABLE"; |
| 5512 | case INSTALL_FAILED_VERIFICATION_TIMEOUT: return "INSTALL_FAILED_VERIFICATION_TIMEOUT"; |
| 5513 | case INSTALL_FAILED_VERIFICATION_FAILURE: return "INSTALL_FAILED_VERIFICATION_FAILURE"; |
| 5514 | case INSTALL_FAILED_PACKAGE_CHANGED: return "INSTALL_FAILED_PACKAGE_CHANGED"; |
| 5515 | case INSTALL_FAILED_UID_CHANGED: return "INSTALL_FAILED_UID_CHANGED"; |
| 5516 | case INSTALL_FAILED_VERSION_DOWNGRADE: return "INSTALL_FAILED_VERSION_DOWNGRADE"; |
| 5517 | case INSTALL_PARSE_FAILED_NOT_APK: return "INSTALL_PARSE_FAILED_NOT_APK"; |
| 5518 | case INSTALL_PARSE_FAILED_BAD_MANIFEST: return "INSTALL_PARSE_FAILED_BAD_MANIFEST"; |
| 5519 | case INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: return "INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION"; |
| 5520 | case INSTALL_PARSE_FAILED_NO_CERTIFICATES: return "INSTALL_PARSE_FAILED_NO_CERTIFICATES"; |
| 5521 | case INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES: return "INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES"; |
| 5522 | case INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING: return "INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING"; |
| 5523 | case INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME: return "INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME"; |
| 5524 | case INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID: return "INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID"; |
| 5525 | case INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: return "INSTALL_PARSE_FAILED_MANIFEST_MALFORMED"; |
| 5526 | case INSTALL_PARSE_FAILED_MANIFEST_EMPTY: return "INSTALL_PARSE_FAILED_MANIFEST_EMPTY"; |
| 5527 | case INSTALL_FAILED_INTERNAL_ERROR: return "INSTALL_FAILED_INTERNAL_ERROR"; |
| 5528 | case INSTALL_FAILED_USER_RESTRICTED: return "INSTALL_FAILED_USER_RESTRICTED"; |
| 5529 | case INSTALL_FAILED_DUPLICATE_PERMISSION: return "INSTALL_FAILED_DUPLICATE_PERMISSION"; |
| 5530 | case INSTALL_FAILED_NO_MATCHING_ABIS: return "INSTALL_FAILED_NO_MATCHING_ABIS"; |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5531 | case INSTALL_FAILED_ABORTED: return "INSTALL_FAILED_ABORTED"; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5532 | default: return Integer.toString(status); |
| 5533 | } |
| 5534 | } |
| 5535 | |
| 5536 | /** {@hide} */ |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5537 | public static int installStatusToPublicStatus(int status) { |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5538 | switch (status) { |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5539 | case INSTALL_SUCCEEDED: return PackageInstaller.STATUS_SUCCESS; |
| 5540 | case INSTALL_FAILED_ALREADY_EXISTS: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5541 | case INSTALL_FAILED_INVALID_APK: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5542 | case INSTALL_FAILED_INVALID_URI: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5543 | case INSTALL_FAILED_INSUFFICIENT_STORAGE: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5544 | case INSTALL_FAILED_DUPLICATE_PACKAGE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5545 | case INSTALL_FAILED_NO_SHARED_USER: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5546 | case INSTALL_FAILED_UPDATE_INCOMPATIBLE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5547 | case INSTALL_FAILED_SHARED_USER_INCOMPATIBLE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5548 | case INSTALL_FAILED_MISSING_SHARED_LIBRARY: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5549 | case INSTALL_FAILED_REPLACE_COULDNT_DELETE: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5550 | case INSTALL_FAILED_DEXOPT: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5551 | case INSTALL_FAILED_OLDER_SDK: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5552 | case INSTALL_FAILED_CONFLICTING_PROVIDER: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5553 | case INSTALL_FAILED_NEWER_SDK: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5554 | case INSTALL_FAILED_TEST_ONLY: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5555 | case INSTALL_FAILED_CPU_ABI_INCOMPATIBLE: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5556 | case INSTALL_FAILED_MISSING_FEATURE: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5557 | case INSTALL_FAILED_CONTAINER_ERROR: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5558 | case INSTALL_FAILED_INVALID_INSTALL_LOCATION: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5559 | case INSTALL_FAILED_MEDIA_UNAVAILABLE: return PackageInstaller.STATUS_FAILURE_STORAGE; |
| 5560 | case INSTALL_FAILED_VERIFICATION_TIMEOUT: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5561 | case INSTALL_FAILED_VERIFICATION_FAILURE: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5562 | case INSTALL_FAILED_PACKAGE_CHANGED: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5563 | case INSTALL_FAILED_UID_CHANGED: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5564 | case INSTALL_FAILED_VERSION_DOWNGRADE: return PackageInstaller.STATUS_FAILURE_INVALID; |
Svetoslav | d965370 | 2015-05-13 18:02:46 -0700 | [diff] [blame] | 5565 | case INSTALL_FAILED_PERMISSION_MODEL_DOWNGRADE: return PackageInstaller.STATUS_FAILURE_INVALID; |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5566 | case INSTALL_PARSE_FAILED_NOT_APK: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5567 | case INSTALL_PARSE_FAILED_BAD_MANIFEST: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5568 | case INSTALL_PARSE_FAILED_UNEXPECTED_EXCEPTION: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5569 | case INSTALL_PARSE_FAILED_NO_CERTIFICATES: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5570 | case INSTALL_PARSE_FAILED_INCONSISTENT_CERTIFICATES: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5571 | case INSTALL_PARSE_FAILED_CERTIFICATE_ENCODING: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5572 | case INSTALL_PARSE_FAILED_BAD_PACKAGE_NAME: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5573 | case INSTALL_PARSE_FAILED_BAD_SHARED_USER_ID: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5574 | case INSTALL_PARSE_FAILED_MANIFEST_MALFORMED: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5575 | case INSTALL_PARSE_FAILED_MANIFEST_EMPTY: return PackageInstaller.STATUS_FAILURE_INVALID; |
| 5576 | case INSTALL_FAILED_INTERNAL_ERROR: return PackageInstaller.STATUS_FAILURE; |
| 5577 | case INSTALL_FAILED_USER_RESTRICTED: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5578 | case INSTALL_FAILED_DUPLICATE_PERMISSION: return PackageInstaller.STATUS_FAILURE_CONFLICT; |
| 5579 | case INSTALL_FAILED_NO_MATCHING_ABIS: return PackageInstaller.STATUS_FAILURE_INCOMPATIBLE; |
| 5580 | case INSTALL_FAILED_ABORTED: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5581 | default: return PackageInstaller.STATUS_FAILURE; |
| 5582 | } |
| 5583 | } |
| 5584 | |
| 5585 | /** {@hide} */ |
| 5586 | public static String deleteStatusToString(int status, String msg) { |
| 5587 | final String str = deleteStatusToString(status); |
| 5588 | if (msg != null) { |
| 5589 | return str + ": " + msg; |
| 5590 | } else { |
| 5591 | return str; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5592 | } |
| 5593 | } |
| 5594 | |
| 5595 | /** {@hide} */ |
| 5596 | public static String deleteStatusToString(int status) { |
| 5597 | switch (status) { |
| 5598 | case DELETE_SUCCEEDED: return "DELETE_SUCCEEDED"; |
| 5599 | case DELETE_FAILED_INTERNAL_ERROR: return "DELETE_FAILED_INTERNAL_ERROR"; |
| 5600 | case DELETE_FAILED_DEVICE_POLICY_MANAGER: return "DELETE_FAILED_DEVICE_POLICY_MANAGER"; |
| 5601 | case DELETE_FAILED_USER_RESTRICTED: return "DELETE_FAILED_USER_RESTRICTED"; |
| 5602 | case DELETE_FAILED_OWNER_BLOCKED: return "DELETE_FAILED_OWNER_BLOCKED"; |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5603 | case DELETE_FAILED_ABORTED: return "DELETE_FAILED_ABORTED"; |
Jeff Sharkey | 16c8e3f | 2014-07-24 17:08:17 -0700 | [diff] [blame] | 5604 | default: return Integer.toString(status); |
| 5605 | } |
| 5606 | } |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5607 | |
| 5608 | /** {@hide} */ |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5609 | public static int deleteStatusToPublicStatus(int status) { |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5610 | switch (status) { |
Jeff Sharkey | a090743 | 2014-08-15 10:23:11 -0700 | [diff] [blame] | 5611 | case DELETE_SUCCEEDED: return PackageInstaller.STATUS_SUCCESS; |
| 5612 | case DELETE_FAILED_INTERNAL_ERROR: return PackageInstaller.STATUS_FAILURE; |
| 5613 | case DELETE_FAILED_DEVICE_POLICY_MANAGER: return PackageInstaller.STATUS_FAILURE_BLOCKED; |
| 5614 | case DELETE_FAILED_USER_RESTRICTED: return PackageInstaller.STATUS_FAILURE_BLOCKED; |
| 5615 | case DELETE_FAILED_OWNER_BLOCKED: return PackageInstaller.STATUS_FAILURE_BLOCKED; |
| 5616 | case DELETE_FAILED_ABORTED: return PackageInstaller.STATUS_FAILURE_ABORTED; |
| 5617 | default: return PackageInstaller.STATUS_FAILURE; |
Jeff Sharkey | f060095 | 2014-08-07 17:31:53 -0700 | [diff] [blame] | 5618 | } |
| 5619 | } |
Jeff Sharkey | 6c0b9da | 2014-08-07 22:07:11 -0700 | [diff] [blame] | 5620 | |
| 5621 | /** {@hide} */ |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 5622 | public static String permissionFlagToString(int flag) { |
| 5623 | switch (flag) { |
Svetoslav | 4a5f4a2 | 2015-07-07 18:18:15 -0700 | [diff] [blame] | 5624 | case FLAG_PERMISSION_GRANTED_BY_DEFAULT: return "GRANTED_BY_DEFAULT"; |
| 5625 | case FLAG_PERMISSION_POLICY_FIXED: return "POLICY_FIXED"; |
| 5626 | case FLAG_PERMISSION_SYSTEM_FIXED: return "SYSTEM_FIXED"; |
| 5627 | case FLAG_PERMISSION_USER_SET: return "USER_SET"; |
| 5628 | case FLAG_PERMISSION_REVOKE_ON_UPGRADE: return "REVOKE_ON_UPGRADE"; |
| 5629 | case FLAG_PERMISSION_USER_FIXED: return "USER_FIXED"; |
Svet Ganov | 9c165d7 | 2015-12-01 19:52:26 -0800 | [diff] [blame] | 5630 | case FLAG_PERMISSION_REVIEW_REQUIRED: return "REVIEW_REQUIRED"; |
Svet Ganov | 77ab6a8 | 2015-07-03 12:03:02 -0700 | [diff] [blame] | 5631 | default: return Integer.toString(flag); |
| 5632 | } |
| 5633 | } |
| 5634 | |
| 5635 | /** {@hide} */ |
Jeff Sharkey | 6c0b9da | 2014-08-07 22:07:11 -0700 | [diff] [blame] | 5636 | public static class LegacyPackageInstallObserver extends PackageInstallObserver { |
| 5637 | private final IPackageInstallObserver mLegacy; |
| 5638 | |
| 5639 | public LegacyPackageInstallObserver(IPackageInstallObserver legacy) { |
| 5640 | mLegacy = legacy; |
| 5641 | } |
| 5642 | |
| 5643 | @Override |
| 5644 | public void onPackageInstalled(String basePackageName, int returnCode, String msg, |
| 5645 | Bundle extras) { |
| 5646 | if (mLegacy == null) return; |
| 5647 | try { |
| 5648 | mLegacy.packageInstalled(basePackageName, returnCode); |
| 5649 | } catch (RemoteException ignored) { |
| 5650 | } |
| 5651 | } |
| 5652 | } |
| 5653 | |
| 5654 | /** {@hide} */ |
| 5655 | public static class LegacyPackageDeleteObserver extends PackageDeleteObserver { |
| 5656 | private final IPackageDeleteObserver mLegacy; |
| 5657 | |
| 5658 | public LegacyPackageDeleteObserver(IPackageDeleteObserver legacy) { |
| 5659 | mLegacy = legacy; |
| 5660 | } |
| 5661 | |
| 5662 | @Override |
| 5663 | public void onPackageDeleted(String basePackageName, int returnCode, String msg) { |
| 5664 | if (mLegacy == null) return; |
| 5665 | try { |
| 5666 | mLegacy.packageDeleted(basePackageName, returnCode); |
| 5667 | } catch (RemoteException ignored) { |
| 5668 | } |
| 5669 | } |
| 5670 | } |
The Android Open Source Project | 9066cfe | 2009-03-03 19:31:44 -0800 | [diff] [blame] | 5671 | } |