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