1# DriverExtensionContext 2 3The **DriverExtensionContext** module provides the context of **DriverExtensionAbility**. It inherits from **ExtensionContext**. 4 5The **DriverExtensionContext** module provides the operations that need to be actively initiated in the **DriverExtensionAbility** implementation. 6 7> **NOTE** 8> 9> - The initial APIs of this module are supported since API version 10. Newly added APIs will be marked with a superscript to indicate their earliest API version. 10> - The APIs of this module can be used only in the stage model. 11 12## Modules to Import 13 14```ts 15import { common } from '@kit.AbilityKit'; 16``` 17 18## How to Use 19 20Before using **DriverExtensionContext**, you need to obtain it through a **DriverExtensionAbility** child class instance. 21 22```ts 23 import { DriverExtensionAbility, DriverExtensionContext } from '@kit.DriverDevelopmentKit'; 24 25 let context : DriverExtensionContext | undefined; 26 class EntryAbility extends DriverExtensionAbility { 27 onInit() { 28 context = this.context; // Obtain DriverExtensionContext. 29 } 30 } 31``` 32 33## DriverExtensionContext.updateDriverState 34 35updateDriverState(): void; 36 37Updates the driver state. This interface is reserved and does not provide specific functionality currently. 38 39**System capability**: SystemCapability.Driver.ExternalDevice 40 41**Example** 42 43 ```ts 44 if (context != null) { 45 context.updateDriverState(); 46 } 47 ``` 48