DevicePolicyManager.SetDefaultSmsApplication(ComponentName, String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Must be called by a device owner or a profile owner of an organization-owned managed profile to set the default SMS application.
[Android.Runtime.Register("setDefaultSmsApplication", "(Landroid/content/ComponentName;Ljava/lang/String;)V", "GetSetDefaultSmsApplication_Landroid_content_ComponentName_Ljava_lang_String_Handler", ApiSince=29)]
[Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_DEFAULT_SMS")]
public virtual void SetDefaultSmsApplication (Android.Content.ComponentName? admin, string packageName);
[<Android.Runtime.Register("setDefaultSmsApplication", "(Landroid/content/ComponentName;Ljava/lang/String;)V", "GetSetDefaultSmsApplication_Landroid_content_ComponentName_Ljava_lang_String_Handler", ApiSince=29)>]
[<Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_DEFAULT_SMS")>]
abstract member SetDefaultSmsApplication : Android.Content.ComponentName * string -> unit
override this.SetDefaultSmsApplication : Android.Content.ComponentName * string -> unit
Parameters
- admin
- ComponentName
Which DeviceAdminReceiver
this request is associated with. Null if the
caller is not a device admin.
- packageName
- String
The name of the package to set as the default SMS application.
- Attributes
Remarks
Must be called by a device owner or a profile owner of an organization-owned managed profile to set the default SMS application.
This method can be called on the DevicePolicyManager
instance, returned by #getParentProfileInstance(ComponentName)
, where the caller must be the profile owner of an organization-owned managed profile and the package must be a pre-installed system package. If called on the parent instance, then the default SMS application is set on the personal profile.
Starting from Android android.os.Build.VERSION_CODES#UPSIDE_DOWN_CAKE
, the profile owner of an organization-owned managed profile can also call this method directly (not on the parent profile instance) to set the default SMS application in the work profile. This is only meaningful when work profile telephony is enabled by #setManagedSubscriptionsPolicy
.
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.