Makoto Onuki | 6f7362d9 | 2016-03-04 13:39:41 -0800 | [diff] [blame] | 1 | /* |
| 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 | |
| 17 | package android.content.pm; |
| 18 | |
| 19 | import android.annotation.NonNull; |
| 20 | import android.annotation.Nullable; |
| 21 | import android.annotation.UserIdInt; |
| 22 | import android.content.ComponentName; |
| 23 | import android.content.Intent; |
| 24 | import android.content.pm.LauncherApps.ShortcutQuery; |
| 25 | |
| 26 | import 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 | */ |
| 35 | public 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 Onuki | 43204b8 | 2016-03-08 16:16:44 -0800 | [diff] [blame] | 55 | @NonNull String packageName, @NonNull String shortcutId, int userId); |
Makoto Onuki | 6f7362d9 | 2016-03-04 13:39:41 -0800 | [diff] [blame] | 56 | |
| 57 | public abstract void addListener(@NonNull ShortcutChangeListener listener); |
| 58 | } |