Amith Yamasani | 4f58263 | 2014-02-19 14:31:52 -0800 | [diff] [blame] | 1 | /** |
| 2 | * Copyright (c) 2014, 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 | |
Makoto Onuki | 1a34274 | 2018-04-26 14:56:59 -0700 | [diff] [blame] | 19 | import android.app.IApplicationThread; |
Amith Yamasani | 4f58263 | 2014-02-19 14:31:52 -0800 | [diff] [blame] | 20 | import android.content.ComponentName; |
| 21 | import android.content.Intent; |
Sunny Goyal | a6be88a | 2017-01-12 16:27:58 -0800 | [diff] [blame] | 22 | import android.content.IntentSender; |
Mehdi Alizadeh | ae808ff | 2020-01-21 13:39:53 -0800 | [diff] [blame] | 23 | import android.content.LocusId; |
Sunny Goyal | 45d3e97 | 2016-03-31 12:38:17 -0700 | [diff] [blame] | 24 | import android.content.pm.ActivityInfo; |
Kenny Guy | 7724275 | 2016-01-15 13:29:06 +0000 | [diff] [blame] | 25 | import android.content.pm.ApplicationInfo; |
Amith Yamasani | 4f58263 | 2014-02-19 14:31:52 -0800 | [diff] [blame] | 26 | import android.content.pm.IOnAppsChangedListener; |
Varun Shah | 2546cef | 2019-01-11 15:50:54 -0800 | [diff] [blame] | 27 | import android.content.pm.LauncherApps; |
Jon Miranda | 2b340a2 | 2019-01-25 14:03:49 -0800 | [diff] [blame] | 28 | import android.content.pm.IPackageInstallerCallback; |
Mehdi Alizadeh | 9f68019 | 2020-01-16 18:09:24 -0800 | [diff] [blame] | 29 | import android.content.pm.IShortcutChangeCallback; |
Jon Miranda | 2b340a2 | 2019-01-25 14:03:49 -0800 | [diff] [blame] | 30 | import android.content.pm.PackageInstaller; |
Sunny Goyal | 6cbc2fe | 2015-11-24 09:34:20 -0800 | [diff] [blame] | 31 | import android.content.pm.ParceledListSlice; |
Amith Yamasani | 4f58263 | 2014-02-19 14:31:52 -0800 | [diff] [blame] | 32 | import android.content.pm.ResolveInfo; |
Makoto Onuki | 6f7362d9 | 2016-03-04 13:39:41 -0800 | [diff] [blame] | 33 | import android.content.pm.ShortcutInfo; |
Amith Yamasani | 4f58263 | 2014-02-19 14:31:52 -0800 | [diff] [blame] | 34 | import android.graphics.Rect; |
| 35 | import android.os.Bundle; |
| 36 | import android.os.UserHandle; |
Makoto Onuki | 5504622 | 2016-03-08 10:49:47 -0800 | [diff] [blame] | 37 | import android.os.ParcelFileDescriptor; |
| 38 | |
Amith Yamasani | 4f58263 | 2014-02-19 14:31:52 -0800 | [diff] [blame] | 39 | import java.util.List; |
| 40 | |
| 41 | /** |
| 42 | * {@hide} |
| 43 | */ |
| 44 | interface ILauncherApps { |
Makoto Onuki | 4dbe0de | 2016-03-14 17:31:49 -0700 | [diff] [blame] | 45 | void addOnAppsChangedListener(String callingPackage, in IOnAppsChangedListener listener); |
Amith Yamasani | 4f58263 | 2014-02-19 14:31:52 -0800 | [diff] [blame] | 46 | void removeOnAppsChangedListener(in IOnAppsChangedListener listener); |
Makoto Onuki | 3a2541e | 2017-01-24 09:00:15 -0800 | [diff] [blame] | 47 | ParceledListSlice getLauncherActivities( |
| 48 | String callingPackage, String packageName, in UserHandle user); |
| 49 | ActivityInfo resolveActivity( |
| 50 | String callingPackage, in ComponentName component, in UserHandle user); |
Jon Miranda | 2b340a2 | 2019-01-25 14:03:49 -0800 | [diff] [blame] | 51 | void startSessionDetailsActivityAsUser(in IApplicationThread caller, String callingPackage, |
Philip P. Moltmann | ee29509 | 2020-02-10 08:46:26 -0800 | [diff] [blame^] | 52 | String callingFeatureId, in PackageInstaller.SessionInfo sessionInfo, |
| 53 | in Rect sourceBounds, in Bundle opts, in UserHandle user); |
Makoto Onuki | 1a34274 | 2018-04-26 14:56:59 -0700 | [diff] [blame] | 54 | void startActivityAsUser(in IApplicationThread caller, String callingPackage, |
Philip P. Moltmann | ee29509 | 2020-02-10 08:46:26 -0800 | [diff] [blame^] | 55 | String callingFeatureId, in ComponentName component, in Rect sourceBounds, |
Amith Yamasani | 4f58263 | 2014-02-19 14:31:52 -0800 | [diff] [blame] | 56 | in Bundle opts, in UserHandle user); |
Philip P. Moltmann | ee29509 | 2020-02-10 08:46:26 -0800 | [diff] [blame^] | 57 | void showAppDetailsAsUser(in IApplicationThread caller, String callingPackage, |
| 58 | String callingFeatureId, in ComponentName component, in Rect sourceBounds, |
Kenny Guy | 466d203 | 2014-07-23 12:23:35 +0100 | [diff] [blame] | 59 | in Bundle opts, in UserHandle user); |
Makoto Onuki | 3a2541e | 2017-01-24 09:00:15 -0800 | [diff] [blame] | 60 | boolean isPackageEnabled(String callingPackage, String packageName, in UserHandle user); |
Suprabh Shukla | 19b41f3 | 2018-03-26 22:35:13 -0700 | [diff] [blame] | 61 | Bundle getSuspendedPackageLauncherExtras(String packageName, in UserHandle user); |
Makoto Onuki | 3a2541e | 2017-01-24 09:00:15 -0800 | [diff] [blame] | 62 | boolean isActivityEnabled( |
| 63 | String callingPackage, in ComponentName component, in UserHandle user); |
| 64 | ApplicationInfo getApplicationInfo( |
| 65 | String callingPackage, String packageName, int flags, in UserHandle user); |
Makoto Onuki | 6f7362d9 | 2016-03-04 13:39:41 -0800 | [diff] [blame] | 66 | |
Varun Shah | 2546cef | 2019-01-11 15:50:54 -0800 | [diff] [blame] | 67 | LauncherApps.AppUsageLimit getAppUsageLimit(String callingPackage, String packageName, |
| 68 | in UserHandle user); |
| 69 | |
Makoto Onuki | 6f7362d9 | 2016-03-04 13:39:41 -0800 | [diff] [blame] | 70 | ParceledListSlice getShortcuts(String callingPackage, long changedSince, String packageName, |
Mehdi Alizadeh | ae808ff | 2020-01-21 13:39:53 -0800 | [diff] [blame] | 71 | in List shortcutIds, in List<LocusId> locusIds, in ComponentName componentName, |
| 72 | int flags, in UserHandle user); |
Makoto Onuki | 6f7362d9 | 2016-03-04 13:39:41 -0800 | [diff] [blame] | 73 | void pinShortcuts(String callingPackage, String packageName, in List<String> shortcutIds, |
| 74 | in UserHandle user); |
Philip P. Moltmann | ee29509 | 2020-02-10 08:46:26 -0800 | [diff] [blame^] | 75 | boolean startShortcut(String callingPackage, String packageName, String featureId, String id, |
Makoto Onuki | abe8442 | 2016-04-07 09:41:19 -0700 | [diff] [blame] | 76 | in Rect sourceBounds, in Bundle startActivityOptions, int userId); |
Makoto Onuki | 5504622 | 2016-03-08 10:49:47 -0800 | [diff] [blame] | 77 | |
Makoto Onuki | abe8442 | 2016-04-07 09:41:19 -0700 | [diff] [blame] | 78 | int getShortcutIconResId(String callingPackage, String packageName, String id, |
| 79 | int userId); |
| 80 | ParcelFileDescriptor getShortcutIconFd(String callingPackage, String packageName, String id, |
| 81 | int userId); |
Makoto Onuki | 2d5b465 | 2016-03-11 16:09:54 -0800 | [diff] [blame] | 82 | |
| 83 | boolean hasShortcutHostPermission(String callingPackage); |
Suprabh Shukla | 7900049 | 2018-12-24 17:03:02 -0800 | [diff] [blame] | 84 | boolean shouldHideFromSuggestions(String packageName, in UserHandle user); |
Sunny Goyal | a6be88a | 2017-01-12 16:27:58 -0800 | [diff] [blame] | 85 | |
Makoto Onuki | 3a2541e | 2017-01-24 09:00:15 -0800 | [diff] [blame] | 86 | ParceledListSlice getShortcutConfigActivities( |
| 87 | String callingPackage, String packageName, in UserHandle user); |
Sunny Goyal | a6be88a | 2017-01-12 16:27:58 -0800 | [diff] [blame] | 88 | IntentSender getShortcutConfigActivityIntent(String callingPackage, in ComponentName component, |
| 89 | in UserHandle user); |
Jon Miranda | 2b340a2 | 2019-01-25 14:03:49 -0800 | [diff] [blame] | 90 | |
| 91 | // Unregister is performed using package installer |
| 92 | void registerPackageInstallerCallback(String callingPackage, |
| 93 | in IPackageInstallerCallback callback); |
| 94 | ParceledListSlice getAllSessions(String callingPackage); |
Mehdi Alizadeh | 9f68019 | 2020-01-16 18:09:24 -0800 | [diff] [blame] | 95 | |
| 96 | void registerShortcutChangeCallback(String callingPackage, long changedSince, |
Mehdi Alizadeh | ae808ff | 2020-01-21 13:39:53 -0800 | [diff] [blame] | 97 | String packageName, in List shortcutIds, in List<LocusId> locusIds, |
| 98 | in ComponentName componentName, int flags, in IShortcutChangeCallback callback, |
| 99 | int callbackId); |
Mehdi Alizadeh | 9f68019 | 2020-01-16 18:09:24 -0800 | [diff] [blame] | 100 | void unregisterShortcutChangeCallback(String callingPackage, int callbackId); |
Mehdi Alizadeh | 0de8c29 | 2020-01-21 17:27:26 -0800 | [diff] [blame] | 101 | |
| 102 | void cacheShortcuts(String callingPackage, String packageName, in List<String> shortcutIds, |
| 103 | in UserHandle user); |
| 104 | void uncacheShortcuts(String callingPackage, String packageName, in List<String> shortcutIds, |
| 105 | in UserHandle user); |
Amith Yamasani | 4f58263 | 2014-02-19 14:31:52 -0800 | [diff] [blame] | 106 | } |