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 | package android.content.pm; |
| 17 | |
Sunny Goyal | a6be88a | 2017-01-12 16:27:58 -0800 | [diff] [blame] | 18 | import android.content.Intent; |
Mehdi Alizadeh | 406e8b3 | 2018-12-11 18:21:49 -0800 | [diff] [blame] | 19 | import android.content.IntentFilter; |
Makoto Onuki | 2d895c3 | 2016-12-02 15:48:40 -0800 | [diff] [blame] | 20 | import android.content.IntentSender; |
Makoto Onuki | 6f7362d9 | 2016-03-04 13:39:41 -0800 | [diff] [blame] | 21 | import android.content.pm.ParceledListSlice; |
| 22 | import android.content.pm.ShortcutInfo; |
| 23 | |
| 24 | /** |
| 25 | * {@hide} |
| 26 | */ |
| 27 | interface IShortcutService { |
| 28 | |
| 29 | boolean setDynamicShortcuts(String packageName, in ParceledListSlice shortcutInfoList, |
| 30 | int userId); |
| 31 | |
| 32 | ParceledListSlice getDynamicShortcuts(String packageName, int userId); |
| 33 | |
Makoto Onuki | 22fcc68 | 2016-05-17 14:52:19 -0700 | [diff] [blame] | 34 | ParceledListSlice getManifestShortcuts(String packageName, int userId); |
| 35 | |
Makoto Onuki | b6d3523 | 2016-04-04 15:57:17 -0700 | [diff] [blame] | 36 | boolean addDynamicShortcuts(String packageName, in ParceledListSlice shortcutInfoList, |
| 37 | int userId); |
Makoto Onuki | 6f7362d9 | 2016-03-04 13:39:41 -0800 | [diff] [blame] | 38 | |
Makoto Onuki | b6d3523 | 2016-04-04 15:57:17 -0700 | [diff] [blame] | 39 | void removeDynamicShortcuts(String packageName, in List shortcutIds, int userId); |
Makoto Onuki | 6f7362d9 | 2016-03-04 13:39:41 -0800 | [diff] [blame] | 40 | |
Makoto Onuki | b6d3523 | 2016-04-04 15:57:17 -0700 | [diff] [blame] | 41 | void removeAllDynamicShortcuts(String packageName, int userId); |
Makoto Onuki | 6f7362d9 | 2016-03-04 13:39:41 -0800 | [diff] [blame] | 42 | |
| 43 | ParceledListSlice getPinnedShortcuts(String packageName, int userId); |
| 44 | |
| 45 | boolean updateShortcuts(String packageName, in ParceledListSlice shortcuts, int userId); |
| 46 | |
Makoto Onuki | 2d895c3 | 2016-12-02 15:48:40 -0800 | [diff] [blame] | 47 | boolean requestPinShortcut(String packageName, in ShortcutInfo shortcut, |
| 48 | in IntentSender resultIntent, int userId); |
| 49 | |
Sunny Goyal | a6be88a | 2017-01-12 16:27:58 -0800 | [diff] [blame] | 50 | Intent createShortcutResultIntent(String packageName, in ShortcutInfo shortcut, int userId); |
| 51 | |
Makoto Onuki | d688079 | 2016-06-29 13:37:43 -0700 | [diff] [blame] | 52 | void disableShortcuts(String packageName, in List shortcutIds, CharSequence disabledMessage, |
Makoto Onuki | 20c95f8 | 2016-05-11 16:51:01 -0700 | [diff] [blame] | 53 | int disabledMessageResId, int userId); |
| 54 | |
Makoto Onuki | 22fcc68 | 2016-05-17 14:52:19 -0700 | [diff] [blame] | 55 | void enableShortcuts(String packageName, in List shortcutIds, int userId); |
| 56 | |
Makoto Onuki | d688079 | 2016-06-29 13:37:43 -0700 | [diff] [blame] | 57 | int getMaxShortcutCountPerActivity(String packageName, int userId); |
Makoto Onuki | 6f7362d9 | 2016-03-04 13:39:41 -0800 | [diff] [blame] | 58 | |
| 59 | int getRemainingCallCount(String packageName, int userId); |
| 60 | |
| 61 | long getRateLimitResetTime(String packageName, int userId); |
| 62 | |
Makoto Onuki | 5504622 | 2016-03-08 10:49:47 -0800 | [diff] [blame] | 63 | int getIconMaxDimensions(String packageName, int userId); |
| 64 | |
Makoto Onuki | 20c95f8 | 2016-05-11 16:51:01 -0700 | [diff] [blame] | 65 | void reportShortcutUsed(String packageName, String shortcutId, int userId); |
| 66 | |
Makoto Onuki | 6f7362d9 | 2016-03-04 13:39:41 -0800 | [diff] [blame] | 67 | void resetThrottling(); // system only API for developer opsions |
Makoto Onuki | 9da23fc | 2016-03-29 11:14:42 -0700 | [diff] [blame] | 68 | |
Makoto Onuki | 4d36b3a | 2016-04-27 12:00:17 -0700 | [diff] [blame] | 69 | void onApplicationActive(String packageName, int userId); // system only API for sysUI |
| 70 | |
Makoto Onuki | 9da23fc | 2016-03-29 11:14:42 -0700 | [diff] [blame] | 71 | byte[] getBackupPayload(int user); |
| 72 | |
| 73 | void applyRestore(in byte[] payload, int user); |
Makoto Onuki | 2d895c3 | 2016-12-02 15:48:40 -0800 | [diff] [blame] | 74 | |
Sunny Goyal | 7f7372a | 2017-01-24 11:53:54 -0800 | [diff] [blame] | 75 | boolean isRequestPinItemSupported(int user, int requestType); |
Mehdi Alizadeh | 406e8b3 | 2018-12-11 18:21:49 -0800 | [diff] [blame] | 76 | |
| 77 | // System API used by framework's ShareSheet (ChooserActivity) |
| 78 | ParceledListSlice getShareTargets(String packageName, in IntentFilter filter, int userId); |
Mehdi Alizadeh | 85fd3d5 | 2019-01-23 12:49:53 -0800 | [diff] [blame] | 79 | |
| 80 | boolean hasShareTargets(String packageName, String packageToCheck, int userId); |
Makoto Onuki | 6f7362d9 | 2016-03-04 13:39:41 -0800 | [diff] [blame] | 81 | } |