• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# Advanced Notification Manager
2
3The Advanced Notification Manager enables you to print notifications and set notification parameters. It provides the notification debugging and testing capabilities, for example, printing published notification details, setting the number of notification caches, and enabling the notification functionality.
4
5## Environment Requirements
6
7Before using this tool, you must obtain the <!--Del-->[<!--DelEnd-->hdc tool<!--Del-->](../../device-dev/subsystems/subsys-toolchain-hdc-guide.md)<!--DelEnd--> and run the hdc shell command.
8
9This tool can be used only in the **eng** edition. If it is used in the **user** edition, the message **error: user version cannot use setting** is reported.
10
11## anm Commands
12
13| Command| Description|
14| ---- | --- |
15| help | Displays the anm help information.|
16| dump | Dumps notification information.|
17| setting | Sets notification parameters.|
18
19## help
20
21  ```bash
22  # Display the anm help information.
23  anm help
24  ```
25
26## dump
27
28  ```bash
29  # Dumps notification information.
30  anm dump [<options>]
31  ```
32
33  **Parameters**
34
35  | Name            | Description                          |
36  | ---------------- | ---------------------------------- |
37  | -A/--active      | Information about all active notifications.            |
38  | -R/--recent      | Information about recent notifications.                |
39  | -D/--distributed | Information about distributed notifications from other devices.  |
40  | -b/--bundle      | Bundle name. Optional.|
41  | -u/--user-id     | User ID. Optional.    |
42  | -h/--help        | Help information.                          |
43
44  **Example**
45
46  ```bash
47  # Display information about all active notifications.
48  anm dump -A
49  ```
50
51## setting
52
53  ```bash
54  # Sets notification parameters.
55  anm setting [<options>]
56  ```
57
58  **Parameters**
59
60  | Name                    | Description                            |
61  | ------------------------ | ------------------------------------ |
62  | -c/--recent-count        | Maximum number of recent notifications stored in the memory.|
63  | -e/--enable-notification | Whether to enable the notification capability.                    |
64  | -k/--collaboration-switch        | Whether notifications can be sent to devices of a specified type through cross-device collaboration.<br>`anm setting -k <deviceType>:<status>`<br>**Note**: This parameter is supported since API version 18.<br>**deviceType**: device type. The value can be **wearable**, **litewearable**, or **headset**.<br>**status**: status of the cross-device collaboration switch. The value **0** indicates that the cross-device collaboration is disabled, and the value **1** indicates the opposite.
65  | -b/--collaboration-switch-bundle | Whether notifications of a specified bundle can be sent to devices of a specified type through cross-device collaboration.<br>`anm setting -b <deviceType>:<bundleName>:<uid>:<status>`<br>**Note**: This parameter is supported since API version 18.<br>**deviceType**: device type. The value can be **wearable**, **litewearable**, or **headset**.<br>**status**: status of the cross-device collaboration switch. The value **0** indicates that the cross-device collaboration is disabled, and the value **1** indicates the opposite.|
66  | -o/--collaboration-switch-slot   | Whether notifications of a specified slot can be sent to devices of a specified type through cross-device collaboration.<br>`anm setting -o <deviceType>:<slotType>:<status>`<br>**Note**: This parameter is supported since API version 18.<br>**deviceType**: device type. The value can be **wearable**, **litewearable**, or **headset**.<br>**slotType**: notification slot type. For details about the value range, see [SlotType](../reference/apis-notification-kit/js-apis-notificationManager.md#slottype).<br>**status**: status of the cross-device collaboration switch. The value **0** indicates that the cross-device collaboration is disabled, and the value **1** indicates the opposite.|
67  | -h/--help                | Help information.                            |
68
69  **Example**
70
71  ```bash
72  # Set the maximum number of recent notifications stored in the memory to 100.
73  anm setting -c 100
74
75  # Enable the notification through cross-device collaboration for wearable devices.
76  anm setting -k wearable:1
77
78  # Disable the notification through cross-device collaboration for the application whose bundle name is example and UID is 10100.
79  anm setting -b litewearable:example:10100:0
80
81  # Enable the notification through cross-device collaboration for headset devices whose slot type is 0.
82  anm setting -o headset:0:1
83  ```
84