System Notification Manager
Systems Notification Manager allows toggling the system notifications. This API is not threadsafe. More...
Functions
Name | |
---|---|
MLResult | MLSystemNotificationManagerCreate(MLHandle * out_handle) Creates a System Notification Manager handle. |
MLResult | MLSystemNotificationManagerDestroy(MLHandle handle) Destroys a System Notification Manager handle. |
MLResult | MLSystemNotificationManagerSetNotifications(MLHandle handle, bool suppress) Request suppression/unsuppression of system notifications. |
Detailed Description
Systems Notification Manager allows toggling the system notifications. This API is not threadsafe.
Shared Object:
- system_notification_manager.magicleap*
Functions Documentation
MLSystemNotificationManagerCreate
MLResult MLSystemNotificationManagerCreate(
MLHandle * out_handle
)
Creates a System Notification Manager handle.
Parameters
MLHandle * | out_handle | The handle to be created. |
Returns
MLResult | MLResult_InvalidParam | Failed due to an invalid parameter. |
MLResult | MLResult_Ok | System Notification Manager handle was successfully created. |
MLResult | MLResult_PermissionDenied | Necessary permission is missing. |
MLResult | MLResult_UnspecifiedFailure | System Notification Manager handle failed to be created. |
Required Permissions:
- com.magicleap.permission.SYSTEM_NOTIFICATION (protection level: normal)
Multiple calls to this API method from the same applicaiton will return the same handle. The handle is valid for the lifecycle of the application.
API Level:
- 24
MLSystemNotificationManagerDestroy
MLResult MLSystemNotificationManagerDestroy(
MLHandle handle
)
Destroys a System Notification Manager handle.
Parameters
MLHandle | handle | The handle to be destroyed. |
Returns
MLResult | MLResult_InvalidParam | The handle passed in was not valid. |
MLResult | MLResult_Ok | System Notification Manager handle was successfully destroyed. |
Required Permissions:
- None
API Level:
- 24
MLSystemNotificationManagerSetNotifications
MLResult MLSystemNotificationManagerSetNotifications(
MLHandle handle,
bool suppress
)
Request suppression/unsuppression of system notifications.
Parameters
MLHandle | handle | Handle to System Notification Manager. |
bool | suppress | True to suppress all notifications, false to unsuppress all notifications. |
Returns
MLResult | MLResult_IncompatibleSKU | Failed due to feature not being supported on current device version. |
MLResult | MLResult_InvalidParam | The handle passed in was not valid. |
MLResult | MLResult_Ok | All system notifications were successfully suppressed/unsuppressed. |
MLResult | MLResult_UnspecifiedFailure | Suppression/Unsuppression of system notifications failed. |
Required Permissions:
- None
Requests the system to unsuppress/suppress all notifications. This includes notifications, dialogs and alarms from being displayed. Once suppressed, notifications remain suppressed even if the application requesting suppression loses focus (ie: if the user navigates away from the application).
If the calling app is closed for any reason (ie. closed by user action, voice command, terminal command, or crashed) before notifications were unsuppressed the System Notification Manager will automatically unsuppress all notficiations (unless another application was currently suppressing notifications).
API Level:
- 24