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 
18 import android.content.Intent;
19 import android.content.IntentFilter;
20 import android.content.IntentSender;
21 import android.content.pm.ParceledListSlice;
22 import android.content.pm.ShortcutInfo;
23 
24 /**
25  * {@hide}
26  */
27 interface IShortcutService {
28 
setDynamicShortcuts(String packageName, in ParceledListSlice shortcutInfoList, int userId)29     boolean setDynamicShortcuts(String packageName, in ParceledListSlice shortcutInfoList,
30             int userId);
31 
getDynamicShortcuts(String packageName, int userId)32     ParceledListSlice getDynamicShortcuts(String packageName, int userId);
33 
getManifestShortcuts(String packageName, int userId)34     ParceledListSlice getManifestShortcuts(String packageName, int userId);
35 
addDynamicShortcuts(String packageName, in ParceledListSlice shortcutInfoList, int userId)36     boolean addDynamicShortcuts(String packageName, in ParceledListSlice shortcutInfoList,
37             int userId);
38 
removeDynamicShortcuts(String packageName, in List shortcutIds, int userId)39     void removeDynamicShortcuts(String packageName, in List shortcutIds, int userId);
40 
removeAllDynamicShortcuts(String packageName, int userId)41     void removeAllDynamicShortcuts(String packageName, int userId);
42 
getPinnedShortcuts(String packageName, int userId)43     ParceledListSlice getPinnedShortcuts(String packageName, int userId);
44 
updateShortcuts(String packageName, in ParceledListSlice shortcuts, int userId)45     boolean updateShortcuts(String packageName, in ParceledListSlice shortcuts, int userId);
46 
requestPinShortcut(String packageName, in ShortcutInfo shortcut, in IntentSender resultIntent, int userId)47     boolean requestPinShortcut(String packageName, in ShortcutInfo shortcut,
48             in IntentSender resultIntent, int userId);
49 
createShortcutResultIntent(String packageName, in ShortcutInfo shortcut, int userId)50     Intent createShortcutResultIntent(String packageName, in ShortcutInfo shortcut, int userId);
51 
disableShortcuts(String packageName, in List shortcutIds, CharSequence disabledMessage, int disabledMessageResId, int userId)52     void disableShortcuts(String packageName, in List shortcutIds, CharSequence disabledMessage,
53             int disabledMessageResId, int userId);
54 
enableShortcuts(String packageName, in List shortcutIds, int userId)55     void enableShortcuts(String packageName, in List shortcutIds, int userId);
56 
getMaxShortcutCountPerActivity(String packageName, int userId)57     int getMaxShortcutCountPerActivity(String packageName, int userId);
58 
getRemainingCallCount(String packageName, int userId)59     int getRemainingCallCount(String packageName, int userId);
60 
getRateLimitResetTime(String packageName, int userId)61     long getRateLimitResetTime(String packageName, int userId);
62 
getIconMaxDimensions(String packageName, int userId)63     int getIconMaxDimensions(String packageName, int userId);
64 
reportShortcutUsed(String packageName, String shortcutId, int userId)65     void reportShortcutUsed(String packageName, String shortcutId, int userId);
66 
resetThrottling()67     void resetThrottling(); // system only API for developer opsions
68 
onApplicationActive(String packageName, int userId)69     void onApplicationActive(String packageName, int userId); // system only API for sysUI
70 
getBackupPayload(int user)71     byte[] getBackupPayload(int user);
72 
applyRestore(in byte[] payload, int user)73     void applyRestore(in byte[] payload, int user);
74 
isRequestPinItemSupported(int user, int requestType)75     boolean isRequestPinItemSupported(int user, int requestType);
76 
77     // System API used by framework's ShareSheet (ChooserActivity)
getShareTargets(String packageName, in IntentFilter filter, int userId)78     ParceledListSlice getShareTargets(String packageName, in IntentFilter filter, int userId);
79 
hasShareTargets(String packageName, String packageToCheck, int userId)80     boolean hasShareTargets(String packageName, String packageToCheck, int userId);
81 }