Package org.robolectric.shadows
Class ShadowLauncherApps
java.lang.Object
org.robolectric.shadows.ShadowLauncherApps
@Implements(value=android.content.pm.LauncherApps.class, minSdk=21) public class ShadowLauncherApps extends Object
Shadow of
LauncherApps
.-
Constructor Summary
Constructors Constructor Description ShadowLauncherApps()
-
Method Summary
-
Constructor Details
-
ShadowLauncherApps
public ShadowLauncherApps()
-
-
Method Details
-
addDynamicShortcut
Adds a dynamic shortcut to be returned bygetShortcuts(ShortcutQuery, UserHandle)
.- Parameters:
shortcutInfo
- the shortcut to add.
-
notifyPackageAdded
FiresLauncherApps.Callback.onPackageAdded(String, UserHandle)
on all of the registered callbacks, with the provided packageName.- Parameters:
packageName
- the package the was added.
-
addEnabledPackage
Adds an enabled package to be checked byisPackageEnabled(String, UserHandle)
.- Parameters:
userHandle
- the user handle to be added.packageName
- the package name to be added.
-
addShortcutConfigActivity
Adds aLauncherActivityInfo
to be retrieved bygetShortcutConfigActivityList(String, UserHandle)
.- Parameters:
userHandle
- the user handle to be added.activityInfo
- theLauncherActivityInfo
to be added.
-
addActivity
Adds aLauncherActivityInfo
to be retrieved bygetActivityList(String, UserHandle)
.- Parameters:
userHandle
- the user handle to be added.activityInfo
- theLauncherActivityInfo
to be added.
-
notifyPackageRemoved
FiresLauncherApps.Callback.onPackageRemoved(String, UserHandle)
on all of the registered callbacks, with the provided packageName.- Parameters:
packageName
- the package the was removed.
-
startPackageInstallerSessionDetailsActivity
@Implementation(minSdk=29) protected void startPackageInstallerSessionDetailsActivity(@NonNull PackageInstaller.SessionInfo sessionInfo, @Nullable Rect sourceBounds, @Nullable Bundle opts) -
startAppDetailsActivity
@Implementation protected void startAppDetailsActivity(ComponentName component, UserHandle user, Rect sourceBounds, Bundle opts) -
getShortcutConfigActivityList
@Implementation(minSdk=26) protected List<LauncherActivityInfo> getShortcutConfigActivityList(@Nullable String packageName, @NonNull UserHandle user) -
getShortcutConfigActivityIntent
@Implementation(minSdk=26) @Nullable protected IntentSender getShortcutConfigActivityIntent(@NonNull LauncherActivityInfo info) -
isPackageEnabled
-
getActivityList
@Implementation(minSdk=21) protected List<LauncherActivityInfo> getActivityList(String packageName, UserHandle user) -
getSuspendedPackageLauncherExtras
@Implementation(minSdk=28) @Nullable protected Bundle getSuspendedPackageLauncherExtras(String packageName, UserHandle user) -
shouldHideFromSuggestions
@Implementation(minSdk=29) protected boolean shouldHideFromSuggestions(@NonNull String packageName, @NonNull UserHandle user) -
isActivityEnabled
-
hasShortcutHostPermission
-
getShortcuts
@Implementation(minSdk=25) @Nullable protected List<ShortcutInfo> getShortcuts(@NonNull LauncherApps.ShortcutQuery query, @NonNull UserHandle user)This method is an incomplete implementation of this API that only supports querying for pinned dynamic shortcuts. It also doesn't not supportLauncherApps.ShortcutQuery.setChangedSince(long)
. -
pinShortcuts
@Implementation(minSdk=25) protected void pinShortcuts(@NonNull String packageName, @NonNull List<String> shortcutIds, @NonNull UserHandle user) -
startShortcut
@Implementation(minSdk=25) protected void startShortcut(@NonNull String packageName, @NonNull String shortcutId, @Nullable Rect sourceBounds, @Nullable Bundle startActivityOptions, @NonNull UserHandle user) -
startShortcut
@Implementation(minSdk=25) protected void startShortcut(@NonNull ShortcutInfo shortcut, @Nullable Rect sourceBounds, @Nullable Bundle startActivityOptions) -
registerCallback
-
registerCallback
-
unregisterCallback
-
registerPackageInstallerSessionCallback
@Implementation(minSdk=29) protected void registerPackageInstallerSessionCallback(@NonNull Executor executor, @NonNull PackageInstaller.SessionCallback callback) -
unregisterPackageInstallerSessionCallback
@Implementation(minSdk=29) protected void unregisterPackageInstallerSessionCallback(@NonNull PackageInstaller.SessionCallback callback) -
getAllPackageInstallerSessions
@Implementation(minSdk=29) @NonNull protected List<PackageInstaller.SessionInfo> getAllPackageInstallerSessions()
-