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
17package android.content.pm;
18
19import android.content.ComponentName;
20import android.content.Intent;
21import android.content.pm.ActivityInfo;
22import android.content.pm.ApplicationInfo;
23import android.content.pm.IOnAppsChangedListener;
24import android.content.pm.ParceledListSlice;
25import android.content.pm.ResolveInfo;
26import android.content.pm.ShortcutInfo;
27import android.graphics.Rect;
28import android.os.Bundle;
29import android.os.UserHandle;
30import android.os.ParcelFileDescriptor;
31
32import java.util.List;
33
34/**
35 * {@hide}
36 */
37interface ILauncherApps {
38    void addOnAppsChangedListener(String callingPackage, in IOnAppsChangedListener listener);
39    void removeOnAppsChangedListener(in IOnAppsChangedListener listener);
40    ParceledListSlice getLauncherActivities(String packageName, in UserHandle user);
41    ActivityInfo resolveActivity(in ComponentName component, in UserHandle user);
42    void startActivityAsUser(in ComponentName component, in Rect sourceBounds,
43            in Bundle opts, in UserHandle user);
44    void showAppDetailsAsUser(in ComponentName component, in Rect sourceBounds,
45            in Bundle opts, in UserHandle user);
46    boolean isPackageEnabled(String packageName, in UserHandle user);
47    boolean isActivityEnabled(in ComponentName component, in UserHandle user);
48    ApplicationInfo getApplicationInfo(String packageName, int flags, in UserHandle user);
49
50    ParceledListSlice getShortcuts(String callingPackage, long changedSince, String packageName,
51            in List shortcutIds, in ComponentName componentName, int flags, in UserHandle user);
52    void pinShortcuts(String callingPackage, String packageName, in List<String> shortcutIds,
53            in UserHandle user);
54    boolean startShortcut(String callingPackage, String packageName, String id,
55            in Rect sourceBounds, in Bundle startActivityOptions, int userId);
56
57    int getShortcutIconResId(String callingPackage, String packageName, String id,
58            int userId);
59    ParcelFileDescriptor getShortcutIconFd(String callingPackage, String packageName, String id,
60            int userId);
61
62    boolean hasShortcutHostPermission(String callingPackage);
63}
64