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