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 
19 import android.app.IApplicationThread;
20 import android.content.ComponentName;
21 import android.content.Intent;
22 import android.content.IntentSender;
23 import android.content.pm.ActivityInfo;
24 import android.content.pm.ApplicationInfo;
25 import android.content.pm.IOnAppsChangedListener;
26 import android.content.pm.LauncherApps;
27 import android.content.pm.IPackageInstallerCallback;
28 import android.content.pm.PackageInstaller;
29 import android.content.pm.ParceledListSlice;
30 import android.content.pm.ResolveInfo;
31 import android.content.pm.ShortcutInfo;
32 import android.graphics.Rect;
33 import android.os.Bundle;
34 import android.os.UserHandle;
35 import android.os.ParcelFileDescriptor;
36 
37 import java.util.List;
38 
39 /**
40  * {@hide}
41  */
42 interface ILauncherApps {
addOnAppsChangedListener(String callingPackage, in IOnAppsChangedListener listener)43     void addOnAppsChangedListener(String callingPackage, in IOnAppsChangedListener listener);
removeOnAppsChangedListener(in IOnAppsChangedListener listener)44     void removeOnAppsChangedListener(in IOnAppsChangedListener listener);
getLauncherActivities( String callingPackage, String packageName, in UserHandle user)45     ParceledListSlice getLauncherActivities(
46             String callingPackage, String packageName, in UserHandle user);
resolveActivity( String callingPackage, in ComponentName component, in UserHandle user)47     ActivityInfo resolveActivity(
48             String callingPackage, in ComponentName component, in UserHandle user);
startSessionDetailsActivityAsUser(in IApplicationThread caller, String callingPackage, in PackageInstaller.SessionInfo sessionInfo, in Rect sourceBounds, in Bundle opts, in UserHandle user)49     void startSessionDetailsActivityAsUser(in IApplicationThread caller, String callingPackage,
50                 in PackageInstaller.SessionInfo sessionInfo, in Rect sourceBounds, in Bundle opts,
51                 in UserHandle user);
startActivityAsUser(in IApplicationThread caller, String callingPackage, in ComponentName component, in Rect sourceBounds, in Bundle opts, in UserHandle user)52     void startActivityAsUser(in IApplicationThread caller, String callingPackage,
53             in ComponentName component, in Rect sourceBounds,
54             in Bundle opts, in UserHandle user);
showAppDetailsAsUser(in IApplicationThread caller, String callingPackage, in ComponentName component, in Rect sourceBounds, in Bundle opts, in UserHandle user)55     void showAppDetailsAsUser(in IApplicationThread caller,
56             String callingPackage, in ComponentName component, in Rect sourceBounds,
57             in Bundle opts, in UserHandle user);
isPackageEnabled(String callingPackage, String packageName, in UserHandle user)58     boolean isPackageEnabled(String callingPackage, String packageName, in UserHandle user);
getSuspendedPackageLauncherExtras(String packageName, in UserHandle user)59     Bundle getSuspendedPackageLauncherExtras(String packageName, in UserHandle user);
isActivityEnabled( String callingPackage, in ComponentName component, in UserHandle user)60     boolean isActivityEnabled(
61             String callingPackage, in ComponentName component, in UserHandle user);
getApplicationInfo( String callingPackage, String packageName, int flags, in UserHandle user)62     ApplicationInfo getApplicationInfo(
63             String callingPackage, String packageName, int flags, in UserHandle user);
64 
getAppUsageLimit(String callingPackage, String packageName, in UserHandle user)65     LauncherApps.AppUsageLimit getAppUsageLimit(String callingPackage, String packageName,
66             in UserHandle user);
67 
getShortcuts(String callingPackage, long changedSince, String packageName, in List shortcutIds, in ComponentName componentName, int flags, in UserHandle user)68     ParceledListSlice getShortcuts(String callingPackage, long changedSince, String packageName,
69             in List shortcutIds, in ComponentName componentName, int flags, in UserHandle user);
pinShortcuts(String callingPackage, String packageName, in List<String> shortcutIds, in UserHandle user)70     void pinShortcuts(String callingPackage, String packageName, in List<String> shortcutIds,
71             in UserHandle user);
startShortcut(String callingPackage, String packageName, String id, in Rect sourceBounds, in Bundle startActivityOptions, int userId)72     boolean startShortcut(String callingPackage, String packageName, String id,
73             in Rect sourceBounds, in Bundle startActivityOptions, int userId);
74 
getShortcutIconResId(String callingPackage, String packageName, String id, int userId)75     int getShortcutIconResId(String callingPackage, String packageName, String id,
76             int userId);
getShortcutIconFd(String callingPackage, String packageName, String id, int userId)77     ParcelFileDescriptor getShortcutIconFd(String callingPackage, String packageName, String id,
78             int userId);
79 
hasShortcutHostPermission(String callingPackage)80     boolean hasShortcutHostPermission(String callingPackage);
shouldHideFromSuggestions(String packageName, in UserHandle user)81     boolean shouldHideFromSuggestions(String packageName, in UserHandle user);
82 
getShortcutConfigActivities( String callingPackage, String packageName, in UserHandle user)83     ParceledListSlice getShortcutConfigActivities(
84             String callingPackage, String packageName, in UserHandle user);
getShortcutConfigActivityIntent(String callingPackage, in ComponentName component, in UserHandle user)85     IntentSender getShortcutConfigActivityIntent(String callingPackage, in ComponentName component,
86             in UserHandle user);
87 
88     // Unregister is performed using package installer
registerPackageInstallerCallback(String callingPackage, in IPackageInstallerCallback callback)89     void registerPackageInstallerCallback(String callingPackage,
90             in IPackageInstallerCallback callback);
getAllSessions(String callingPackage)91     ParceledListSlice getAllSessions(String callingPackage);
92 }
93