1# Accessibility Framework Subsystem Changelog 2 3## cl.accessibility.1 Access Permission Change in the Listener APIs 4 5Since API version 11, the **ohos.permission.READ_ACCESSIBILITY_CONFIG** permission verification is added to the listener APIs, and error code 201 is returned for lack of permission. This is a compatible change. You need to declare the required permission for your application to pass the verification. 6 7**Access Level** 8 9System 10 11**Reason for Change** 12 13In previous versions, the accessibility application could use the listener APIs without the **ohos.permission.READ_ACCESSIBILITY_CONFIG** permission. This is not secure and needs to be rectified. 14 15**Change Impact** 16 17This change is a compatible change and involves a new error code. An accessibility application must declare the **ohos.permission.READ_ACCESSIBILITY_CONFIG** permission to pass the permission verification. 18 19**Change Since** 20 21OpenHarmony SDK 4.1.5.2 22 23**Key API/Component Changes** 24 25The **ohos.permission.READ_ACCESSIBILITY_CONFIG** permission verification is added to the following APIs. Error code 201 is returned for lack of permission. 26 27- Involved APIs 28 29| File | API | 30| ------------------------------- | ------------------------------------------------------------ | 31| @ohos.accessibility.config.d.ts | function on(type: 'enabledAccessibilityExtensionListChange', callback: Callback<void>): void; | 32| @ohos.accessibility.config.d.ts | function off(type: 'enabledAccessibilityExtensionListChange', callback?: Callback<void>): void; | 33| @ohos.accessibility.config.d.ts | on(callback: Callback<T>): void; | 34| @ohos.accessibility.config.d.ts | off(callback?: Callback<T>): void; | 35 36- Before change: 37 38An accessibility application is not checked for its **ohos.permission.READ_ACCESSIBILITY_CONFIG** permission when it calls a listener API. 39 40```js 41 /** 42 * Register the listener that watches for changes in the enabled status of accessibility extensions. 43 * 44 * @param { 'enabledAccessibilityExtensionListChange' } type Indicates the type of event. 45 * @param { Callback<void> } callback Indicates the listener. 46 * @throws { BusinessError } 202 - Not system App. 47 * @throws { BusinessError } 401 - Input parameter error. 48 * @syscap SystemCapability.BarrierFree.Accessibility.Core 49 * @systemapi 50 * @since 9 51 */ 52 function on(type: 'enabledAccessibilityExtensionListChange', callback: Callback<void>): void; 53 54 /** 55 * Unregister listener that watches for changes in the enabled status of accessibility extensions. 56 * 57 * @param { 'enabledAccessibilityExtensionListChange' } type Indicates the type of event. 58 * @param { Callback<void> } callback Indicates the listener. 59 * @throws { BusinessError } 202 - Not system App. 60 * @throws { BusinessError } 401 - Input parameter error. 61 * @syscap SystemCapability.BarrierFree.Accessibility.Core 62 * @systemapi 63 * @since 9 64 */ 65 function off(type: 'enabledAccessibilityExtensionListChange', callback?: Callback<void>): void; 66 67 /** 68 * Register the listener to listen for configuration changes. 69 * 70 * @param { Callback<T> } callback Indicates the listener. 71 * @throws { BusinessError } 201 - Permission denied. 72 * @throws { BusinessError } 202 - Not system App. 73 * @throws { BusinessError } 401 - Input parameter error. 74 * @syscap SystemCapability.BarrierFree.Accessibility.Core 75 * @systemapi 76 * @since 9 77 */ 78 on(callback: Callback<T>): void; 79 80 /** 81 * Unregister the listener to listen for configuration changes. 82 * 83 * @param { Callback<T> } callback Indicates the listener. 84 * @throws { BusinessError } 202 - Not system App. 85 * @syscap SystemCapability.BarrierFree.Accessibility.Core 86 * @systemapi 87 * @since 9 88 */ 89 off(callback?: Callback<T>): void; 90``` 91 92- After change: 93 94An accessibility application is checked for its **ohos.permission.READ_ACCESSIBILITY_CONFIG** permission when it calls a listener API. Error code 201 is returned for lack of permission. 95 96```js 97 /** 98 * Register the listener that watches for changes in the enabled status of accessibility extensions. 99 * 100 * @permission ohos.permission.READ_ACCESSIBILITY_CONFIG 101 * @param { 'enabledAccessibilityExtensionListChange' } type Indicates the type of event. 102 * @param { Callback<void> } callback Indicates the listener. 103 * @throws { BusinessError } 202 - Not system App. 104 * @throws { BusinessError } 401 - Input parameter error. 105 * @syscap SystemCapability.BarrierFree.Accessibility.Core 106 * @systemapi 107 * @since 9 108 */ 109 function on(type: 'enabledAccessibilityExtensionListChange', callback: Callback<void>): void; 110 111 /** 112 * Unregister listener that watches for changes in the enabled status of accessibility extensions. 113 * 114 * @permission ohos.permission.READ_ACCESSIBILITY_CONFIG 115 * @param { 'enabledAccessibilityExtensionListChange' } type Indicates the type of event. 116 * @param { Callback<void> } callback Indicates the listener. 117 * @throws { BusinessError } 202 - Not system App. 118 * @throws { BusinessError } 401 - Input parameter error. 119 * @syscap SystemCapability.BarrierFree.Accessibility.Core 120 * @systemapi 121 * @since 9 122 */ 123 function off(type: 'enabledAccessibilityExtensionListChange', callback?: Callback<void>): void; 124 125 /** 126 * Register the listener to listen for configuration changes. 127 * 128 * @permission ohos.permission.READ_ACCESSIBILITY_CONFIG 129 * @param { Callback<T> } callback Indicates the listener. 130 * @throws { BusinessError } 201 - Permission denied. 131 * @throws { BusinessError } 202 - Not system App. 132 * @throws { BusinessError } 401 - Input parameter error. 133 * @syscap SystemCapability.BarrierFree.Accessibility.Core 134 * @systemapi 135 * @since 9 136 */ 137 on(callback: Callback<T>): void; 138 139 /** 140 * Unregister the listener to listen for configuration changes. 141 * 142 * @permission ohos.permission.READ_ACCESSIBILITY_CONFIG 143 * @param { Callback<T> } callback Indicates the listener. 144 * @throws { BusinessError } 202 - Not system App. 145 * @syscap SystemCapability.BarrierFree.Accessibility.Core 146 * @systemapi 147 * @since 9 148 */ 149 off(callback?: Callback<T>): void; 150``` 151 152 153**Adaptation Guide** 154 155Declare the required permission for calling a listener API. 156