Partager via


LauncherApps.ShouldHideFromSuggestions(String, UserHandle) Method

Definition

Returns whether a package should be hidden from suggestions to the user.

[Android.Runtime.Register("shouldHideFromSuggestions", "(Ljava/lang/String;Landroid/os/UserHandle;)Z", "GetShouldHideFromSuggestions_Ljava_lang_String_Landroid_os_UserHandle_Handler", ApiSince=29)]
public virtual bool ShouldHideFromSuggestions (string packageName, Android.OS.UserHandle user);
[<Android.Runtime.Register("shouldHideFromSuggestions", "(Ljava/lang/String;Landroid/os/UserHandle;)Z", "GetShouldHideFromSuggestions_Ljava_lang_String_Landroid_os_UserHandle_Handler", ApiSince=29)>]
abstract member ShouldHideFromSuggestions : string * Android.OS.UserHandle -> bool
override this.ShouldHideFromSuggestions : string * Android.OS.UserHandle -> bool

Parameters

packageName
String

The package for which to check.

user
UserHandle

the UserHandle of the profile.

Returns

Attributes

Remarks

Returns whether a package should be hidden from suggestions to the user. Currently, this could be done because the package was marked as distracting to the user via PackageManager.setDistractingPackageRestrictions(String[], int).

If the user in question is a hidden profile UserManager.USER_TYPE_PROFILE_PRIVATE, caller should have either:

<ul> <li>the privileged android.Manifest.permission.ACCESS_HIDDEN_PROFILES_FULL permission</li> <li>the normal android.Manifest.permission.ACCESS_HIDDEN_PROFILES permission and the android.app.role.RoleManager.ROLE_HOME role. </li> </ul>

Java documentation for android.content.pm.LauncherApps.shouldHideFromSuggestions(java.lang.String, android.os.UserHandle).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to