| 1 |
|
| 2 |
|
| 3 |
|
| 4 |
|
| 5 |
|
| 6 |
|
| 7 |
|
| 8 |
|
| 9 |
|
| 10 |
|
| 11 |
|
| 12 |
|
| 13 |
|
| 14 |
|
| 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.appwidget.AppWidgetProviderInfo; |
| 23 |
import android.content.ComponentName; |
| 24 |
import android.content.Intent; |
| 25 |
import android.content.IntentFilter; |
| 26 |
import android.content.IntentSender; |
| 27 |
import android.content.LocusId; |
| 28 |
import android.content.pm.LauncherApps.ShortcutQuery; |
| 29 |
import android.os.Bundle; |
| 30 |
import android.os.ParcelFileDescriptor; |
| 31 |
|
| 32 |
import com.android.internal.infra.AndroidFuture; |
| 33 |
|
| 34 |
import java.util.List; |
| 35 |
|
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
|
| 41 |
|
| 42 |
|
| 43 |
public abstract class ShortcutServiceInternal { |
| 44 |
public interface ShortcutChangeListener { |
| 45 |
void onShortcutChanged(@NonNull String packageName, @UserIdInt int userId); |
| 46 |
} |
| 47 |
|
| 48 |
public abstract List<ShortcutInfo> |
| 49 |
getShortcuts(int launcherUserId, |
| 50 |
@NonNull String callingPackage, long changedSince, |
| 51 |
@Nullable String packageName, @Nullable List<String> shortcutIds, |
| 52 |
@Nullable List<LocusId> locusIds, @Nullable ComponentName componentName, |
| 53 |
@ShortcutQuery.QueryFlags int flags, int userId, int callingPid, int callingUid); |
| 54 |
|
| 55 |
|
| 56 |
|
| 57 |
|
| 58 |
|
| 59 |
|
| 60 |
public abstract void |
| 61 |
getShortcutsAsync(int launcherUserId, |
| 62 |
@NonNull String callingPackage, long changedSince, |
| 63 |
@Nullable String packageName, @Nullable List<String> shortcutIds, |
| 64 |
@Nullable List<LocusId> locusIds, @Nullable ComponentName componentName, |
| 65 |
@ShortcutQuery.QueryFlags int flags, int userId, int callingPid, int callingUid, |
| 66 |
AndroidFuture<List<ShortcutInfo>> cb); |
| 67 |
|
| 68 |
public abstract boolean |
| 69 |
isPinnedByCaller(int launcherUserId, @NonNull String callingPackage, |
| 70 |
@NonNull String packageName, @NonNull String id, int userId); |
| 71 |
|
| 72 |
public abstract void pinShortcuts(int launcherUserId, |
| 73 |
@NonNull String callingPackage, @NonNull String packageName, |
| 74 |
@NonNull List<String> shortcutIds, int userId); |
| 75 |
|
| 76 |
public abstract Intent[] createShortcutIntents( |
| 77 |
int launcherUserId, @NonNull String callingPackage, |
| 78 |
@NonNull String packageName, @NonNull String shortcutId, int userId, |
| 79 |
int callingPid, int callingUid); |
| 80 |
|
| 81 |
|
| 82 |
|
| 83 |
|
| 84 |
public abstract void createShortcutIntentsAsync( |
| 85 |
int launcherUserId, @NonNull String callingPackage, |
| 86 |
@NonNull String packageName, @NonNull String shortcutId, int userId, |
| 87 |
int callingPid, int callingUid, @NonNull AndroidFuture<Intent[]> cb); |
| 88 |
|
| 89 |
public abstract void addListener(@NonNull ShortcutChangeListener listener); |
| 90 |
|
| 91 |
public abstract void addShortcutChangeCallback( |
| 92 |
@NonNull LauncherApps.ShortcutChangeCallback callback); |
| 93 |
|
| 94 |
public abstract int getShortcutIconResId(int launcherUserId, @NonNull String callingPackage, |
| 95 |
@NonNull String packageName, @NonNull String shortcutId, int userId); |
| 96 |
|
| 97 |
|
| 98 |
|
| 99 |
|
| 100 |
public abstract @Nullable String getShortcutStartingThemeResName(int launcherUserId, |
| 101 |
@NonNull String callingPackage, @NonNull String packageName, @NonNull String shortcutId, |
| 102 |
int userId); |
| 103 |
|
| 104 |
public abstract ParcelFileDescriptor getShortcutIconFd(int launcherUserId, |
| 105 |
@NonNull String callingPackage, |
| 106 |
@NonNull String packageName, @NonNull String shortcutId, int userId); |
| 107 |
|
| 108 |
|
| 109 |
|
| 110 |
|
| 111 |
public abstract void getShortcutIconFdAsync(int launcherUserId, @NonNull String callingPackage, |
| 112 |
@NonNull String packageName, @NonNull String shortcutId, int userId, |
| 113 |
@NonNull AndroidFuture<ParcelFileDescriptor> cb); |
| 114 |
|
| 115 |
public abstract boolean hasShortcutHostPermission(int launcherUserId, |
| 116 |
@NonNull String callingPackage, int callingPid, int callingUid); |
| 117 |
|
| 118 |
public abstract void setShortcutHostPackage(@NonNull String type, @Nullable String packageName, |
| 119 |
int userId); |
| 120 |
|
| 121 |
public abstract boolean requestPinAppWidget(@NonNull String callingPackage, |
| 122 |
@NonNull AppWidgetProviderInfo appWidget, @Nullable Bundle extras, |
| 123 |
@Nullable IntentSender resultIntent, int userId); |
| 124 |
|
| 125 |
public abstract boolean isRequestPinItemSupported(int callingUserId, int requestType); |
| 126 |
|
| 127 |
public abstract boolean isForegroundDefaultLauncher(@NonNull String callingPackage, |
| 128 |
int callingUid); |
| 129 |
|
| 130 |
public abstract void cacheShortcuts(int launcherUserId, |
| 131 |
@NonNull String callingPackage, @NonNull String packageName, |
| 132 |
@NonNull List<String> shortcutIds, int userId, int cacheFlags); |
| 133 |
public abstract void uncacheShortcuts(int launcherUserId, |
| 134 |
@NonNull String callingPackage, @NonNull String packageName, |
| 135 |
@NonNull List<String> shortcutIds, int userId, int cacheFlags); |
| 136 |
|
| 137 |
|
| 138 |
|
| 139 |
|
| 140 |
|
| 141 |
public abstract List<ShortcutManager.ShareShortcutInfo> getShareTargets( |
| 142 |
@NonNull String callingPackage, @NonNull IntentFilter intentFilter, int userId); |
| 143 |
|
| 144 |
|
| 145 |
|
| 146 |
|
| 147 |
public abstract String getShortcutIconUri(int launcherUserId, @NonNull String launcherPackage, |
| 148 |
@NonNull String packageName, @NonNull String shortcutId, int userId); |
| 149 |
|
| 150 |
|
| 151 |
|
| 152 |
|
| 153 |
|
| 154 |
public abstract void getShortcutIconUriAsync(int launcherUserId, |
| 155 |
@NonNull String launcherPackage, @NonNull String packageName, |
| 156 |
@NonNull String shortcutId, int userId, @NonNull AndroidFuture<String> cb); |
| 157 |
|
| 158 |
public abstract boolean isSharingShortcut(int callingUserId, @NonNull String callingPackage, |
| 159 |
@NonNull String packageName, @NonNull String shortcutId, int userId, |
| 160 |
@NonNull IntentFilter filter); |
| 161 |
} |