• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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.app.PendingIntent;
21 import android.content.ComponentName;
22 import android.content.Intent;
23 import android.content.IntentSender;
24 import android.content.LocusId;
25 import android.content.pm.LauncherUserInfo;
26 import android.content.pm.ApplicationInfo;
27 import android.content.pm.IOnAppsChangedListener;
28 import android.content.pm.LauncherActivityInfoInternal;
29 import android.content.pm.LauncherApps;
30 import android.content.pm.ShortcutQueryWrapper;
31 import android.content.pm.IPackageInstallerCallback;
32 import android.content.pm.IShortcutChangeCallback;
33 import android.content.pm.PackageInstaller;
34 import android.content.pm.ParceledListSlice;
35 import android.content.pm.ResolveInfo;
36 import android.content.pm.ShortcutInfo;
37 import android.content.pm.LauncherActivityInfoInternal;
38 import android.graphics.Rect;
39 import android.os.Bundle;
40 import android.os.UserHandle;
41 import android.os.ParcelFileDescriptor;
42 import android.window.IDumpCallback;
43 
44 import com.android.internal.infra.AndroidFuture;
45 
46 import java.util.List;
47 
48 /**
49  * {@hide}
50  */
51 interface ILauncherApps {
addOnAppsChangedListener(String callingPackage, in IOnAppsChangedListener listener)52     void addOnAppsChangedListener(String callingPackage, in IOnAppsChangedListener listener);
removeOnAppsChangedListener(in IOnAppsChangedListener listener)53     void removeOnAppsChangedListener(in IOnAppsChangedListener listener);
getLauncherActivities( String callingPackage, String packageName, in UserHandle user)54     ParceledListSlice getLauncherActivities(
55             String callingPackage, String packageName, in UserHandle user);
resolveLauncherActivityInternal( String callingPackage, in ComponentName component, in UserHandle user)56     LauncherActivityInfoInternal resolveLauncherActivityInternal(
57             String callingPackage, in ComponentName component, in UserHandle user);
startSessionDetailsActivityAsUser(in IApplicationThread caller, String callingPackage, String callingFeatureId, in PackageInstaller.SessionInfo sessionInfo, in Rect sourceBounds, in Bundle opts, in UserHandle user)58     void startSessionDetailsActivityAsUser(in IApplicationThread caller, String callingPackage,
59                 String callingFeatureId, in PackageInstaller.SessionInfo sessionInfo,
60                 in Rect sourceBounds, in Bundle opts, in UserHandle user);
startActivityAsUser(in IApplicationThread caller, String callingPackage, String callingFeatureId, in ComponentName component, in Rect sourceBounds, in Bundle opts, in UserHandle user)61     void startActivityAsUser(in IApplicationThread caller, String callingPackage,
62             String callingFeatureId, in ComponentName component, in Rect sourceBounds,
63             in Bundle opts, in UserHandle user);
getActivityLaunchIntent(String callingPackage, in ComponentName component, in UserHandle user)64     PendingIntent getActivityLaunchIntent(String callingPackage, in ComponentName component,
65             in UserHandle user);
getLauncherUserInfo(in UserHandle user)66     LauncherUserInfo getLauncherUserInfo(in UserHandle user);
getPreInstalledSystemPackages(in UserHandle user)67     List<String> getPreInstalledSystemPackages(in UserHandle user);
getAppMarketActivityIntent(String callingPackage, String packageName, in UserHandle user)68     IntentSender getAppMarketActivityIntent(String callingPackage, String packageName,
69             in UserHandle user);
getPrivateSpaceSettingsIntent()70     IntentSender getPrivateSpaceSettingsIntent();
showAppDetailsAsUser(in IApplicationThread caller, String callingPackage, String callingFeatureId, in ComponentName component, in Rect sourceBounds, in Bundle opts, in UserHandle user)71     void showAppDetailsAsUser(in IApplicationThread caller, String callingPackage,
72             String callingFeatureId, in ComponentName component, in Rect sourceBounds,
73             in Bundle opts, in UserHandle user);
isPackageEnabled(String callingPackage, String packageName, in UserHandle user)74     boolean isPackageEnabled(String callingPackage, String packageName, in UserHandle user);
getSuspendedPackageLauncherExtras(String packageName, in UserHandle user)75     Bundle getSuspendedPackageLauncherExtras(String packageName, in UserHandle user);
isActivityEnabled( String callingPackage, in ComponentName component, in UserHandle user)76     boolean isActivityEnabled(
77             String callingPackage, in ComponentName component, in UserHandle user);
getApplicationInfo( String callingPackage, String packageName, int flags, in UserHandle user)78     ApplicationInfo getApplicationInfo(
79             String callingPackage, String packageName, int flags, in UserHandle user);
80 
getAppUsageLimit(String callingPackage, String packageName, in UserHandle user)81     LauncherApps.AppUsageLimit getAppUsageLimit(String callingPackage, String packageName,
82             in UserHandle user);
83 
getShortcuts(String callingPackage, in ShortcutQueryWrapper query, in UserHandle user)84     ParceledListSlice getShortcuts(String callingPackage, in ShortcutQueryWrapper query,
85             in UserHandle user);
pinShortcuts(String callingPackage, String packageName, in List<String> shortcutIds, in UserHandle user)86     void pinShortcuts(String callingPackage, String packageName, in List<String> shortcutIds,
87             in UserHandle user);
startShortcut(String callingPackage, String packageName, String featureId, String id, in Rect sourceBounds, in Bundle startActivityOptions, int userId)88     boolean startShortcut(String callingPackage, String packageName, String featureId, String id,
89             in Rect sourceBounds, in Bundle startActivityOptions, int userId);
90 
getShortcutIconResId(String callingPackage, String packageName, String id, int userId)91     int getShortcutIconResId(String callingPackage, String packageName, String id,
92             int userId);
getShortcutIconFd(String callingPackage, String packageName, String id, int userId)93     ParcelFileDescriptor getShortcutIconFd(String callingPackage, String packageName, String id,
94             int userId);
95 
hasShortcutHostPermission(String callingPackage)96     boolean hasShortcutHostPermission(String callingPackage);
shouldHideFromSuggestions(String packageName, in UserHandle user)97     boolean shouldHideFromSuggestions(String packageName, in UserHandle user);
98 
getShortcutConfigActivities( String callingPackage, String packageName, in UserHandle user)99     ParceledListSlice getShortcutConfigActivities(
100             String callingPackage, String packageName, in UserHandle user);
getShortcutConfigActivityIntent(String callingPackage, in ComponentName component, in UserHandle user)101     IntentSender getShortcutConfigActivityIntent(String callingPackage, in ComponentName component,
102             in UserHandle user);
getShortcutIntent(String callingPackage, String packageName, String shortcutId, in Bundle opts, in UserHandle user)103     PendingIntent getShortcutIntent(String callingPackage, String packageName, String shortcutId,
104             in Bundle opts, in UserHandle user);
105 
106     // Unregister is performed using package installer
registerPackageInstallerCallback(String callingPackage, in IPackageInstallerCallback callback)107     void registerPackageInstallerCallback(String callingPackage,
108             in IPackageInstallerCallback callback);
getAllSessions(String callingPackage)109     ParceledListSlice getAllSessions(String callingPackage);
110 
registerShortcutChangeCallback(String callingPackage, in ShortcutQueryWrapper query, in IShortcutChangeCallback callback)111     void registerShortcutChangeCallback(String callingPackage, in ShortcutQueryWrapper query,
112 	    in IShortcutChangeCallback callback);
unregisterShortcutChangeCallback(String callingPackage, in IShortcutChangeCallback callback)113     void unregisterShortcutChangeCallback(String callingPackage,
114             in IShortcutChangeCallback callback);
115 
cacheShortcuts(String callingPackage, String packageName, in List<String> shortcutIds, in UserHandle user, int cacheFlags)116     void cacheShortcuts(String callingPackage, String packageName, in List<String> shortcutIds,
117             in UserHandle user, int cacheFlags);
uncacheShortcuts(String callingPackage, String packageName, in List<String> shortcutIds, in UserHandle user, int cacheFlags)118     void uncacheShortcuts(String callingPackage, String packageName, in List<String> shortcutIds,
119             in UserHandle user, int cacheFlags);
120 
getShortcutIconUri(String callingPackage, String packageName, String shortcutId, int userId)121     String getShortcutIconUri(String callingPackage, String packageName, String shortcutId,
122             int userId);
getActivityOverrides(String callingPackage, int userId)123     Map<String, LauncherActivityInfoInternal> getActivityOverrides(String callingPackage, int userId);
124 
125     /** Register a callback to be called right before the wmtrace data is moved to the bugreport. */
registerDumpCallback(IDumpCallback cb)126     void registerDumpCallback(IDumpCallback cb);
127 
128     /** Unregister a callback, so that it won't be called when LauncherApps dumps. */
unRegisterDumpCallback(IDumpCallback cb)129     void unRegisterDumpCallback(IDumpCallback cb);
130 
setArchiveCompatibilityOptions(boolean enableIconOverlay, boolean enableUnarchivalConfirmation)131     void setArchiveCompatibilityOptions(boolean enableIconOverlay, boolean enableUnarchivalConfirmation);
132 
getUserProfiles()133     List<UserHandle> getUserProfiles();
134 
135     /** Saves view capture data to the wm trace directory. */
saveViewCaptureData()136     void saveViewCaptureData();
137 }
138