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