DevicePolicyManager.SetStatusBarDisabled(ComponentName, Boolean) 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.
Called by device owner or profile owner of secondary users that is affiliated with the device to disable the status bar.
[Android.Runtime.Register("setStatusBarDisabled", "(Landroid/content/ComponentName;Z)Z", "GetSetStatusBarDisabled_Landroid_content_ComponentName_ZHandler", ApiSince=23)]
[Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_STATUS_BAR")]
public virtual bool SetStatusBarDisabled (Android.Content.ComponentName? admin, bool disabled);
[<Android.Runtime.Register("setStatusBarDisabled", "(Landroid/content/ComponentName;Z)Z", "GetSetStatusBarDisabled_Landroid_content_ComponentName_ZHandler", ApiSince=23)>]
[<Android.Runtime.RequiresPermission("android.permission.MANAGE_DEVICE_POLICY_STATUS_BAR")>]
abstract member SetStatusBarDisabled : Android.Content.ComponentName * bool -> bool
override this.SetStatusBarDisabled : Android.Content.ComponentName * bool -> bool
Parameters
- admin
- ComponentName
Which DeviceAdminReceiver
this request is associated with. Null if the
caller is not a device admin.
- disabled
- Boolean
true
disables the status bar, false
reenables it.
Returns
false
if attempting to disable the status bar failed. true
otherwise.
- Attributes
Remarks
Called by device owner or profile owner of secondary users that is affiliated with the device to disable the status bar. Disabling the status bar blocks notifications and quick settings.
<strong>Note:</strong> This method has no effect for LockTask mode. The behavior of the status bar in LockTask mode can be configured with #setLockTaskFeatures(ComponentName, int)
. Calls to this method when the device is in LockTask mode will be registered, but will only take effect when the device leaves LockTask mode.
This policy does not have any effect while on the lock screen, where the status bar will not be disabled. Using LockTask instead of this method is recommended.
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.