blob: 660ed9413e372e765ff1d774238e62cac29c5a0c [file] [log] [blame]
Amith Yamasani4f582632014-02-19 14:31:52 -08001/**
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
17package android.content.pm;
18
Makoto Onuki1a342742018-04-26 14:56:59 -070019import android.app.IApplicationThread;
Amith Yamasani4f582632014-02-19 14:31:52 -080020import android.content.ComponentName;
21import android.content.Intent;
Sunny Goyala6be88a2017-01-12 16:27:58 -080022import android.content.IntentSender;
Mehdi Alizadehae808ff2020-01-21 13:39:53 -080023import android.content.LocusId;
Sunny Goyal45d3e972016-03-31 12:38:17 -070024import android.content.pm.ActivityInfo;
Kenny Guy77242752016-01-15 13:29:06 +000025import android.content.pm.ApplicationInfo;
Amith Yamasani4f582632014-02-19 14:31:52 -080026import android.content.pm.IOnAppsChangedListener;
Varun Shah2546cef2019-01-11 15:50:54 -080027import android.content.pm.LauncherApps;
Jon Miranda2b340a22019-01-25 14:03:49 -080028import android.content.pm.IPackageInstallerCallback;
Mehdi Alizadeh9f680192020-01-16 18:09:24 -080029import android.content.pm.IShortcutChangeCallback;
Jon Miranda2b340a22019-01-25 14:03:49 -080030import android.content.pm.PackageInstaller;
Sunny Goyal6cbc2fe2015-11-24 09:34:20 -080031import android.content.pm.ParceledListSlice;
Amith Yamasani4f582632014-02-19 14:31:52 -080032import android.content.pm.ResolveInfo;
Makoto Onuki6f7362d92016-03-04 13:39:41 -080033import android.content.pm.ShortcutInfo;
Amith Yamasani4f582632014-02-19 14:31:52 -080034import android.graphics.Rect;
35import android.os.Bundle;
36import android.os.UserHandle;
Makoto Onuki55046222016-03-08 10:49:47 -080037import android.os.ParcelFileDescriptor;
38
Amith Yamasani4f582632014-02-19 14:31:52 -080039import java.util.List;
40
41/**
42 * {@hide}
43 */
44interface ILauncherApps {
Makoto Onuki4dbe0de2016-03-14 17:31:49 -070045 void addOnAppsChangedListener(String callingPackage, in IOnAppsChangedListener listener);
Amith Yamasani4f582632014-02-19 14:31:52 -080046 void removeOnAppsChangedListener(in IOnAppsChangedListener listener);
Makoto Onuki3a2541e2017-01-24 09:00:15 -080047 ParceledListSlice getLauncherActivities(
48 String callingPackage, String packageName, in UserHandle user);
49 ActivityInfo resolveActivity(
50 String callingPackage, in ComponentName component, in UserHandle user);
Jon Miranda2b340a22019-01-25 14:03:49 -080051 void startSessionDetailsActivityAsUser(in IApplicationThread caller, String callingPackage,
Philip P. Moltmann9c5226f2020-01-10 08:53:43 -080052 String callingFeatureId, in PackageInstaller.SessionInfo sessionInfo,
53 in Rect sourceBounds, in Bundle opts, in UserHandle user);
Makoto Onuki1a342742018-04-26 14:56:59 -070054 void startActivityAsUser(in IApplicationThread caller, String callingPackage,
Philip P. Moltmann9c5226f2020-01-10 08:53:43 -080055 String callingFeatureId, in ComponentName component, in Rect sourceBounds,
Amith Yamasani4f582632014-02-19 14:31:52 -080056 in Bundle opts, in UserHandle user);
Philip P. Moltmann9c5226f2020-01-10 08:53:43 -080057 void showAppDetailsAsUser(in IApplicationThread caller, String callingPackage,
58 String callingFeatureId, in ComponentName component, in Rect sourceBounds,
Kenny Guy466d2032014-07-23 12:23:35 +010059 in Bundle opts, in UserHandle user);
Makoto Onuki3a2541e2017-01-24 09:00:15 -080060 boolean isPackageEnabled(String callingPackage, String packageName, in UserHandle user);
Suprabh Shukla19b41f32018-03-26 22:35:13 -070061 Bundle getSuspendedPackageLauncherExtras(String packageName, in UserHandle user);
Makoto Onuki3a2541e2017-01-24 09:00:15 -080062 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 Onuki6f7362d92016-03-04 13:39:41 -080066
Varun Shah2546cef2019-01-11 15:50:54 -080067 LauncherApps.AppUsageLimit getAppUsageLimit(String callingPackage, String packageName,
68 in UserHandle user);
69
Makoto Onuki6f7362d92016-03-04 13:39:41 -080070 ParceledListSlice getShortcuts(String callingPackage, long changedSince, String packageName,
Mehdi Alizadehae808ff2020-01-21 13:39:53 -080071 in List shortcutIds, in List<LocusId> locusIds, in ComponentName componentName,
72 int flags, in UserHandle user);
Makoto Onuki6f7362d92016-03-04 13:39:41 -080073 void pinShortcuts(String callingPackage, String packageName, in List<String> shortcutIds,
74 in UserHandle user);
Philip P. Moltmann9c5226f2020-01-10 08:53:43 -080075 boolean startShortcut(String callingPackage, String packageName, String featureId, String id,
Makoto Onukiabe84422016-04-07 09:41:19 -070076 in Rect sourceBounds, in Bundle startActivityOptions, int userId);
Makoto Onuki55046222016-03-08 10:49:47 -080077
Makoto Onukiabe84422016-04-07 09:41:19 -070078 int getShortcutIconResId(String callingPackage, String packageName, String id,
79 int userId);
80 ParcelFileDescriptor getShortcutIconFd(String callingPackage, String packageName, String id,
81 int userId);
Makoto Onuki2d5b4652016-03-11 16:09:54 -080082
83 boolean hasShortcutHostPermission(String callingPackage);
Suprabh Shukla79000492018-12-24 17:03:02 -080084 boolean shouldHideFromSuggestions(String packageName, in UserHandle user);
Sunny Goyala6be88a2017-01-12 16:27:58 -080085
Makoto Onuki3a2541e2017-01-24 09:00:15 -080086 ParceledListSlice getShortcutConfigActivities(
87 String callingPackage, String packageName, in UserHandle user);
Sunny Goyala6be88a2017-01-12 16:27:58 -080088 IntentSender getShortcutConfigActivityIntent(String callingPackage, in ComponentName component,
89 in UserHandle user);
Jon Miranda2b340a22019-01-25 14:03:49 -080090
91 // Unregister is performed using package installer
92 void registerPackageInstallerCallback(String callingPackage,
93 in IPackageInstallerCallback callback);
94 ParceledListSlice getAllSessions(String callingPackage);
Mehdi Alizadeh9f680192020-01-16 18:09:24 -080095
96 void registerShortcutChangeCallback(String callingPackage, long changedSince,
Mehdi Alizadehae808ff2020-01-21 13:39:53 -080097 String packageName, in List shortcutIds, in List<LocusId> locusIds,
98 in ComponentName componentName, int flags, in IShortcutChangeCallback callback,
99 int callbackId);
Mehdi Alizadeh9f680192020-01-16 18:09:24 -0800100 void unregisterShortcutChangeCallback(String callingPackage, int callbackId);
Amith Yamasani4f582632014-02-19 14:31:52 -0800101}