blob: 3d6028a6ffe59f756534a36d0c9f79952cea3618 [file] [log] [blame]
Makoto Onuki6f7362d92016-03-04 13:39:41 -08001/*
2 * Copyright (C) 2016 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.annotation.NonNull;
20import android.annotation.Nullable;
21import android.annotation.UserIdInt;
22import android.content.ComponentName;
23import android.content.Intent;
24import android.content.pm.LauncherApps.ShortcutQuery;
25
26import java.util.List;
27
28/**
29 * Entry points used by {@link LauncherApps}.
30 *
31 * <p>No permission / argument checks will be performed inside.
32 * Callers must check the calling app permission and the calling package name.
33 * @hide
34 */
35public abstract class ShortcutServiceInternal {
36 public interface ShortcutChangeListener {
37 void onShortcutChanged(@NonNull String packageName,
38 @NonNull List<ShortcutInfo> shortcuts, @UserIdInt int userId);
39 }
40
41 public abstract List<ShortcutInfo>
42 getShortcuts(@NonNull String callingPackage, long changedSince,
43 @Nullable String packageName, @Nullable ComponentName componentName,
44 @ShortcutQuery.QueryFlags int flags,
45 int userId);
46
47 public abstract List<ShortcutInfo>
48 getShortcutInfo(@NonNull String callingPackage,
49 @NonNull String packageName, @Nullable List<String> ids, int userId);
50
51 public abstract void pinShortcuts(@NonNull String callingPackage, @NonNull String packageName,
52 @NonNull List<String> shortcutIds, int userId);
53
54 public abstract Intent createShortcutIntent(@NonNull String callingPackage,
Makoto Onuki43204b82016-03-08 16:16:44 -080055 @NonNull String packageName, @NonNull String shortcutId, int userId);
Makoto Onuki6f7362d92016-03-04 13:39:41 -080056
57 public abstract void addListener(@NonNull ShortcutChangeListener listener);
58}