未验证 提交 5abb985a 编写于 作者: O openharmony_ci 提交者: Gitee

!3130 Done! 2866:website修改+RN修改

Merge pull request !3130 from wusongqing/TR2866
# JS API Changes of the Ability Framework
The table below lists the APIs changes of the ability framework in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| featureability | FeatureAbility | static getDeviceList(flag: number): Promise<Result>; | Added|
| customizeData | CustomizeData | extra: string; | Added|
| applicationInfo | ApplicationInfo | readonly entityType: string; | Added|
| applicationInfo | ApplicationInfo | readonly uid: number; | Added|
| applicationInfo | ApplicationInfo | readonly accessTokenId: number; | Added|
| applicationInfo | ApplicationInfo | readonly removable: boolean; | Added|
| applicationInfo | ApplicationInfo | readonly metaData: Map<string, Array<CustomizeData>>; | Added|
| applicationInfo | ApplicationInfo | readonly codePath: string; | Added|
| applicationInfo | ApplicationInfo | readonly moduleInfos: Array<ModuleInfo>; | Added|
| shellCmdResult | ShellCmdResult | exitCode: number; | Added|
| shellCmdResult | ShellCmdResult | stdResult: String; | Added|
| ProcessRunningInfo | ProcessRunningInfo | bundleNames: Array<string>; | Added|
| ProcessRunningInfo | ProcessRunningInfo | processName: string; | Added|
| ProcessRunningInfo | ProcessRunningInfo | uid: number; | Added|
| ProcessRunningInfo | ProcessRunningInfo | pid: number; | Added|
| BaseContext | BaseContext | stageMode: boolean; | Added|
| abilityDelegatorArgs | AbilityDelegatorArgs | testRunnerClassName: string; | Added|
| abilityDelegatorArgs | AbilityDelegatorArgs | testCaseNames: string; | Added|
| abilityDelegatorArgs | AbilityDelegatorArgs | parameters: {[key: string]: string}; | Added|
| abilityDelegatorArgs | AbilityDelegatorArgs | bundleName: string; | Added|
| abilityDelegator | AbilityDelegator | executeShellCommand(cmd: string, callback: AsyncCallback<ShellCmdResult>): void;<br>executeShellCommand(cmd: string, timeoutSecs: number, callback: AsyncCallback<ShellCmdResult>): void;<br>executeShellCommand(cmd: string, timeoutSecs?: number): Promise<ShellCmdResult>; | Added|
| abilityDelegator | AbilityDelegator | print(msg: string, callback: AsyncCallback<void>): void;<br>print(msg: string): Promise<void>; | Added|
| context | Context | printDrawnCompleted(callback: AsyncCallback<void>): void;<br>printDrawnCompleted(): Promise<void>; | Added|
| context | Context | isUpdatingConfigurations(callback: AsyncCallback<boolean>): void;<br>isUpdatingConfigurations(): Promise<boolean>; | Added|
| context | Context | getAbilityInfo(callback: AsyncCallback<AbilityInfo>): void<br>getAbilityInfo(): Promise<AbilityInfo>; | Added|
| context | Context | getApplicationContext(): Context; | Added|
| context | Context | getAppVersionInfo(callback: AsyncCallback<AppVersionInfo>): void<br>getAppVersionInfo(): Promise<AppVersionInfo>; | Added|
| context | Context | getHapModuleInfo(callback: AsyncCallback<HapModuleInfo>): void<br>getHapModuleInfo(): Promise<HapModuleInfo>; | Added|
| context | Context | getAppType(callback: AsyncCallback<string>): void<br>getAppType(): Promise<string>; | Added|
| context | Context | getOrCreateDistributedDir(): Promise<string>;<br>getOrCreateDistributedDir(callback: AsyncCallback<string>): void; | Added|
| context | Context | getCacheDir(callback: AsyncCallback<string>): void;<br>getCacheDir(): Promise<string>; | Added|
| context | Context | getFilesDir(callback: AsyncCallback<string>): void;<br>getFilesDir(): Promise<string>; | Added|
| context | Context | setWakeUpScreen(wakeUp: boolean, callback: AsyncCallback<void>): void<br>setWakeUpScreen(wakeUp: boolean): Promise<void>; | Added|
| context | Context | setShowOnLockScreen(show: boolean, callback: AsyncCallback<void>): void<br>setShowOnLockScreen(show: boolean): Promise<void>; | Added|
| context | Context | setDisplayOrientation(orientation: DisplayOrientation, callback: AsyncCallback<void>): void<br>setDisplayOrientation(orientation: DisplayOrientation): Promise<void>; | Added|
| context | Context | getDisplayOrientation(callback: AsyncCallback<DisplayOrientation>): void<br>getDisplayOrientation(): Promise<DisplayOrientation>; | Added|
| appVersionInfo | AppVersionInfo | readonly versionName: string; | Added|
| appVersionInfo | AppVersionInfo | readonly versionCode: number; | Added|
| appVersionInfo | AppVersionInfo | readonly appName: string; | Added|
| dataAbilityHelper | PacMap | [key: string]: number \| string \| boolean \| Array<string \| number \| boolean> \| null; | Added|
| dataAbilityHelper | DataAbilityHelper | executeBatch(uri: string, operations: Array<DataAbilityOperation>, callback: AsyncCallback<Array<DataAbilityResult>>): void;<br>executeBatch(uri: string, operations: Array<DataAbilityOperation>): Promise<Array<DataAbilityResult>>; | Added|
| dataAbilityHelper | DataAbilityHelper | call(uri: string, method: string, arg: string, extras: PacMap, callback: AsyncCallback<PacMap>): void;<br>call(uri: string, method: string, arg: string, extras: PacMap): Promise<PacMap>; | Added|
| ohos.application.Want | Want | entities?: Array<string>; | Added|
| ohos.application.Want | Want | parameters?: {[key: string]: any}; | Added|
| ohos.application.Want | Want | action?: string; | Added|
| ohos.application.Want | Want | flags?: number; | Added|
| ohos.application.Want | Want | type?: string; | Added|
| ohos.application.Want | Want | uri?: string; | Added|
| ohos.application.Want | Want | abilityName?: string; | Added|
| ohos.application.Want | Want | bundleName?: string; | Added|
| ohos.application.Want | Want | deviceId?: string; | Added|
| ohos.application.testRunner | TestRunner | onRun(): void; | Added|
| ohos.application.testRunner | TestRunner | onPrepare(): void; | Added|
| ohos.application.formProvider | formProvider | function updateForm(formId: string, formBindingData: formBindingData.FormBindingData, callback: AsyncCallback<void>): void;<br>function updateForm(formId: string, formBindingData: formBindingData.FormBindingData): Promise<void>; | Added|
| ohos.application.formProvider | formProvider | function setFormNextRefreshTime(formId: string, minute: number, callback: AsyncCallback<void>): void;<br>function setFormNextRefreshTime(formId: string, minute: number): Promise<void>; | Added|
| ohos.application.formInfo | FormParam | TEMPORARY_KEY = "ohos.extra.param.key.form_temporary" | Added|
| ohos.application.formInfo | FormParam | HEIGHT_KEY = "ohos.extra.param.key.form_height" | Added|
| ohos.application.formInfo | FormParam | WIDTH_KEY = "ohos.extra.param.key.form_width" | Added|
| ohos.application.formInfo | FormParam | MODULE_NAME_KEY = "ohos.extra.param.key.module_name" | Added|
| ohos.application.formInfo | FormParam | NAME_KEY = "ohos.extra.param.key.form_name" | Added|
| ohos.application.formInfo | FormParam | DIMENSION_KEY = "ohos.extra.param.key.form_dimension" | Added|
| ohos.application.formInfo | FormState | READY = 1 | Added|
| ohos.application.formInfo | FormState | DEFAULT = 0 | Added|
| ohos.application.formInfo | FormState | UNKNOWN = -1 | Added|
| ohos.application.formInfo | FormStateInfo | want: Want; | Added|
| ohos.application.formInfo | FormStateInfo | formState: FormState; | Added|
| ohos.application.formInfo | ColorMode | MODE_LIGHT = 1 | Added|
| ohos.application.formInfo | ColorMode | MODE_DARK = 0 | Added|
| ohos.application.formInfo | ColorMode | MODE_AUTO = -1 | Added|
| ohos.application.formInfo | FormType | JS = 1 | Added|
| ohos.application.formInfo | FormInfo | customizeData: {[key: string]: [value: string]}; | Added|
| ohos.application.formInfo | FormInfo | supportDimensions: Array<number>; | Added|
| ohos.application.formInfo | FormInfo | defaultDimension: number; | Added|
| ohos.application.formInfo | FormInfo | updateDuration: number; | Added|
| ohos.application.formInfo | FormInfo | formConfigAbility: string; | Added|
| ohos.application.formInfo | FormInfo | scheduledUpdateTime: string; | Added|
| ohos.application.formInfo | FormInfo | relatedBundleName: string; | Added|
| ohos.application.formInfo | FormInfo | formVisibleNotify: boolean; | Added|
| ohos.application.formInfo | FormInfo | updateEnabled: boolean; | Added|
| ohos.application.formInfo | FormInfo | isDefault: boolean; | Added|
| ohos.application.formInfo | FormInfo | colorMode: ColorMode; | Added|
| ohos.application.formInfo | FormInfo | jsComponentName: string; | Added|
| ohos.application.formInfo | FormInfo | type: FormType; | Added|
| ohos.application.formInfo | FormInfo | description: string; | Added|
| ohos.application.formInfo | FormInfo | name: string; | Added|
| ohos.application.formInfo | FormInfo | abilityName: string; | Added|
| ohos.application.formInfo | FormInfo | moduleName: string; | Added|
| ohos.application.formInfo | FormInfo | bundleName: string; | Added|
| ohos.application.formError | FormError | ERR_IN_RECOVERY = 36 | Added|
| ohos.application.formError | FormError | ERR_FORM_DUPLICATE_ADDED = 31 | Added|
| ohos.application.formError | FormError | ERR_SYSTEM_RESPONSES_FAILED = 30 | Added|
| ohos.application.formError | FormError | ERR_FORM_FA_NOT_INSTALLED = 20 | Added|
| ohos.application.formError | FormError | ERR_FORM_NO_SUCH_DIMENSION = 19 | Added|
| ohos.application.formError | FormError | ERR_FORM_NO_SUCH_ABILITY = 18 | Added|
| ohos.application.formError | FormError | ERR_FORM_NO_SUCH_MODULE = 17 | Added|
| ohos.application.formError | FormError | ERR_MAX_SYSTEM_TEMP_FORMS = 16 | Added|
| ohos.application.formError | FormError | ERR_MAX_FORMS_PER_CLIENT = 15 | Added|
| ohos.application.formError | FormError | ERR_PROVIDER_DEL_FAIL = 14 | Added|
| ohos.application.formError | FormError | ERR_OPERATION_FORM_NOT_SELF = 13 | Added|
| ohos.application.formError | FormError | ERR_MAX_INSTANCES_PER_FORM = 12 | Added|
| ohos.application.formError | FormError | ERR_MAX_SYSTEM_FORMS = 11 | Added|
| ohos.application.formError | FormError | ERR_BIND_PROVIDER_FAILED = 10 | Added|
| ohos.application.formError | FormError | ERR_NOT_EXIST_ID = 9 | Added|
| ohos.application.formError | FormError | ERR_CFG_NOT_MATCH_ID = 8 | Added|
| ohos.application.formError | FormError | ERR_ADD_INVALID_PARAM = 7 | Added|
| ohos.application.formError | FormError | ERR_GET_LAYOUT_FAILED = 6 | Added|
| ohos.application.formError | FormError | ERR_GET_BUNDLE_FAILED = 5 | Added|
| ohos.application.formError | FormError | ERR_GET_INFO_FAILED = 4 | Added|
| ohos.application.formError | FormError | ERR_PERMISSION_DENY = 2 | Added|
| ohos.application.formError | FormError | ERR_COMMON = 1 | Added|
| ohos.application.formBindingData | FormBindingData | data: Object | Added|
| ohos.application.formBindingData | formBindingData | function createFormBindingData(obj?: Object \| string): FormBindingData; | Added|
| ohos.application.ConfigurationConstant | ColorMode | COLOR_MODE_LIGHT = 1 | Added|
| ohos.application.ConfigurationConstant | ColorMode | COLOR_MODE_DARK = 0 | Added|
| ohos.application.ConfigurationConstant | ColorMode | COLOR_MODE_NOT_SET = -1 | Added|
| ohos.application.Configuration | Configuration | colorMode: ConfigurationConstant.ColorMode; | Added|
| ohos.application.Configuration | Configuration | language: string; | Added|
| ohos.application.appManager | appManager | function getAppMemorySize(): Promise<number>;<br>function getAppMemorySize(callback: AsyncCallback<number>): void; | Added|
| ohos.application.appManager | appManager | function isRamConstrainedDevice(): Promise<boolean>;<br>function isRamConstrainedDevice(callback: AsyncCallback<boolean>): void; | Added|
| ohos.application.appManager | appManager | function getProcessRunningInfos(): Promise<Array<ProcessRunningInfo>>;<br>function getProcessRunningInfos(callback: AsyncCallback<Array<ProcessRunningInfo>>): void; | Added|
| ohos.application.appManager | appManager | function isRunningInStabilityTest(callback: AsyncCallback<boolean>): void;<br>function isRunningInStabilityTest(): Promise<boolean>; | Added|
| ohos.application.abilityDelegatorRegistry | AbilityLifecycleState | DESTROY | Added|
| ohos.application.abilityDelegatorRegistry | AbilityLifecycleState | BACKGROUND | Added|
| ohos.application.abilityDelegatorRegistry | AbilityLifecycleState | FOREGROUND | Added|
| ohos.application.abilityDelegatorRegistry | AbilityLifecycleState | CREATE | Added|
| ohos.application.abilityDelegatorRegistry | AbilityLifecycleState | UNINITIALIZED | Added|
| ohos.application.abilityDelegatorRegistry | abilityDelegatorRegistry | function getArguments(): AbilityDelegatorArgs; | Added|
| ohos.application.abilityDelegatorRegistry | abilityDelegatorRegistry | function getAbilityDelegator(): AbilityDelegator; | Added|
| ohos.abilityAccessCtrl | GrantStatus | PERMISSION_GRANTED = 0 | Added|
| ohos.abilityAccessCtrl | GrantStatus | PERMISSION_DENIED = -1 | Added|
| ohos.abilityAccessCtrl | AtManager | verifyAccessToken(tokenID: number, permissionName: string): Promise<GrantStatus>; | Added|
| ohos.abilityAccessCtrl | abilityAccessCtrl | function createAtManager(): AtManager; | Added|
| ohos.ability.wantConstant | Action | ACTION_APP_ACCOUNT_OAUTH = "ohos.account.appAccount.action.oauth" | Added|
| ohos.ability.wantConstant | Action | ACTION_VIDEO_CAPTURE = "ohos.want.action.videoCapture" | Added|
| ohos.ability.wantConstant | Action | ACTION_IMAGE_CAPTURE = "ohos.want.action.imageCapture" | Added|
| ohos.ability.particleAbility | ErrorCode | INVALID_PARAMETER = -1 | Added|
| ohos.ability.particleAbility | particleAbility | function disconnectAbility(connection: number, callback:AsyncCallback<void>): void;<br>function disconnectAbility(connection: number): Promise<void>; | Added|
| ohos.ability.particleAbility | particleAbility | function connectAbility(request: Want, options:ConnectOptions): number; | Added|
| ohos.ability.particleAbility | particleAbility | function cancelBackgroundRunning(callback: AsyncCallback<void>): void;<br>function cancelBackgroundRunning(): Promise<void>; | Added|
| ohos.ability.particleAbility | particleAbility | function startBackgroundRunning(id: number, request: NotificationRequest, callback: AsyncCallback<void>): void;<br>function startBackgroundRunning(id: number, request: NotificationRequest): Promise<void>; | Added|
| ohos.ability.featureAbility | featureAbility | function getWindow(callback: AsyncCallback<window.Window>): void;<br>function getWindow(): Promise<window.Window>; | Added|
| ohos.ability.errorCode | ErrorCode | NO_ERROR = 0 | Added|
| ohos.ability.errorCode | ErrorCode | INVALID_PARAMETER = -1 | Added|
| ohos.ability.errorCode | ErrorCode | ABILITY_NOT_FOUND = -2 | Added|
| ohos.ability.errorCode | ErrorCode | PERMISSION_DENY = -3 | Added|
| lifecycle | LifecycleData | call?(method: string, arg: string, extras: PacMap, callback: AsyncCallback<PacMap>): void; | Added|
| lifecycle | LifecycleData | executeBatch?(ops: Array<DataAbilityOperation>, callback: AsyncCallback<Array<DataAbilityResult>>): void; | Added|
| lifecycle | LifecycleService | onReconnect?(want: Want): void; | Added|
| lifecycle | LifecycleApp | onMemoryLevel?(level: number): void; | Added|
| lifecycle | LifecycleApp | onNewWant?(want: Want): void; | Added|
| lifecycle | LifecycleApp | onActive?(): void; | Added|
| lifecycle | LifecycleApp | onInactive?(): void; | Added|
| lifecycle | LifecycleApp | onRestoreAbilityState?(inState: PacMap): void; | Added|
| lifecycle | LifecycleApp | onSaveAbilityState?(outState: PacMap): void; | Added|
| lifecycle | LifecycleForm | onAcquireFormState?(want: Want): formInfo.FormState; | Added|
| lifecycle | LifecycleForm | onDestroy?(formId: string): void; | Added|
| lifecycle | LifecycleForm | onEvent?(formId: string, message: string): void; | Added|
| lifecycle | LifecycleForm | onVisibilityChange?(newStatus: { [key: string]: number }): void; | Added|
| lifecycle | LifecycleForm | onUpdate?(formId: string): void; | Added|
| lifecycle | LifecycleForm | onCastToNormal?(formId: string): void; | Added|
| lifecycle | LifecycleForm | onCreate?(want: Want): formBindingData.FormBindingData; | Added|
# JS API Changes of the Accessibility Subsystem
The table below lists the APIs changes of the accessibility subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.accessibility | EventInfo | itemCount?: number; | Added|
| ohos.accessibility | EventInfo | endIndex?: number; | Added|
| ohos.accessibility | EventInfo | currentIndex?: number; | Added|
| ohos.accessibility | EventInfo | beginIndex?: number; | Added|
| ohos.accessibility | EventInfo | lastContent?: string; | Added|
| ohos.accessibility | EventInfo | contents?: Array<string>; | Added|
| ohos.accessibility | EventInfo | textMoveUnit?: TextMoveUnit; | Added|
| ohos.accessibility | EventInfo | triggerAction: Action; | Added|
| ohos.accessibility | EventInfo | description?: string; | Added|
| ohos.accessibility | EventInfo | pageId ?: number; | Added|
| ohos.accessibility | EventInfo | componentType?: string; | Added|
| ohos.accessibility | EventInfo | bundleName: string; | Added|
| ohos.accessibility | EventInfo | windowUpdateType?: WindowUpdateType; | Added|
| ohos.accessibility | EventInfo | type: EventType; | Added|
| ohos.accessibility | EventInfo | constructor(jsonObject); | Added|
| ohos.accessibility | AccessibilityAbilityInfo | readonly eventTypes: Array<EventType>; | Added|
| ohos.accessibility | AccessibilityAbilityInfo | readonly description: string; | Added|
| ohos.accessibility | AccessibilityAbilityInfo | readonly capabilities: Array<Capability>; | Added|
| ohos.accessibility | AccessibilityAbilityInfo | readonly abilityTypes: Array<AbilityType>; | Added|
| ohos.accessibility | AccessibilityAbilityInfo | readonly bundleName: string; | Added|
| ohos.accessibility | AccessibilityAbilityInfo | readonly name: string; | Added|
| ohos.accessibility | AccessibilityAbilityInfo | readonly id: string; | Added|
| ohos.accessibility | CaptionsStyle | windowColor: number \| string; | Added|
| ohos.accessibility | CaptionsStyle | backgroundColor: number \| string; | Added|
| ohos.accessibility | CaptionsStyle | fontEdgeType: CaptionsFontEdgeType; | Added|
| ohos.accessibility | CaptionsStyle | fontColor: number \| string; | Added|
| ohos.accessibility | CaptionsStyle | fontScale: number; | Added|
| ohos.accessibility | CaptionsStyle | fontFamily: CaptionsFontFamily; | Added|
| ohos.accessibility | CaptionsManager | off(type: 'styleChange', callback?: Callback<CaptionsStyle>): void; | Added|
| ohos.accessibility | CaptionsManager | off(type: 'enableChange', callback?: Callback<boolean>): void; | Added|
| ohos.accessibility | CaptionsManager | on(type: 'styleChange', callback: Callback<CaptionsStyle>): void; | Added|
| ohos.accessibility | CaptionsManager | on(type: 'enableChange', callback: Callback<boolean>): void; | Added|
| ohos.accessibility | CaptionsManager | style: CaptionsStyle; | Added|
| ohos.accessibility | CaptionsManager | enabled: boolean; | Added|
| ohos.accessibility | accessibility | function getCaptionsManager(): CaptionsManager; | Added|
| ohos.accessibility | accessibility | function off(type: 'touchGuideStateChange', callback?: Callback<boolean>): void; | Added|
| ohos.accessibility | accessibility | function off(type: 'accessibilityStateChange', callback?: Callback<boolean>): void; | Added|
| ohos.accessibility | accessibility | function on(type: 'touchGuideStateChange', callback: Callback<boolean>): void; | Added|
| ohos.accessibility | accessibility | function on(type: 'accessibilityStateChange', callback: Callback<boolean>): void; | Added|
| ohos.accessibility | accessibility | function sendEvent(event: EventInfo, callback: AsyncCallback<void>): void;<br>function sendEvent(event: EventInfo): Promise<void>; | Added|
| ohos.accessibility | accessibility | function getAbilityLists(abilityType: AbilityType, stateType: AbilityState, callback: AsyncCallback<Array<AccessibilityAbilityInfo>>): void;<br>function getAbilityLists(abilityType: AbilityType, stateType: AbilityState): Promise<Array<AccessibilityAbilityInfo>>; | Added|
| ohos.accessibility | accessibility | function isOpenTouchGuide(callback: AsyncCallback<boolean>): void;<br>function isOpenTouchGuide(): Promise<boolean>; | Added|
| ohos.accessibility | accessibility | function isOpenAccessibility(callback: AsyncCallback<boolean>): void;<br>function isOpenAccessibility(): Promise<boolean>; | Added|
# JS API Changes of the Account Subsystem
The table below lists the APIs changes of the account subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.account.osAccount | OsAccountType | GUEST | Added|
| ohos.account.osAccount | OsAccountType | NORMAL | Added|
| ohos.account.osAccount | OsAccountType | ADMIN = 0 | Added|
| ohos.account.osAccount | DomainAccountInfo | accountName: string; | Added|
| ohos.account.osAccount | DomainAccountInfo | domain: string; | Added|
| ohos.account.osAccount | OsAccountInfo | domainInfo: DomainAccountInfo; | Added|
| ohos.account.osAccount | OsAccountInfo | distributedInfo: distributedAccount.DistributedInfo; | Added|
| ohos.account.osAccount | OsAccountInfo | isCreateCompleted: boolean; | Added|
| ohos.account.osAccount | OsAccountInfo | isActived: boolean; | Added|
| ohos.account.osAccount | OsAccountInfo | serialNumber: number; | Added|
| ohos.account.osAccount | OsAccountInfo | lastLoginTime: number; | Added|
| ohos.account.osAccount | OsAccountInfo | createTime: number; | Added|
| ohos.account.osAccount | OsAccountInfo | photo: string; | Added|
| ohos.account.osAccount | OsAccountInfo | isVerified: boolean; | Added|
| ohos.account.osAccount | OsAccountInfo | constraints: Array<string>; | Added|
| ohos.account.osAccount | OsAccountInfo | type: OsAccountType; | Added|
| ohos.account.osAccount | OsAccountInfo | localName: string; | Added|
| ohos.account.osAccount | OsAccountInfo | localId: number; | Added|
| ohos.account.osAccount | AccountManager | getSerialNumberByOsAccountLocalId(localId: number, callback: AsyncCallback<number>): void;<br>getSerialNumberByOsAccountLocalId(localId: number): Promise<number>; | Added|
| ohos.account.osAccount | AccountManager | getOsAccountLocalIdBySerialNumber(serialNumber: number, callback: AsyncCallback<number>): void;<br>getOsAccountLocalIdBySerialNumber(serialNumber: number): Promise<number>; | Added|
| ohos.account.osAccount | AccountManager | getDistributedVirtualDeviceId(callback: AsyncCallback<string>): void;<br>getDistributedVirtualDeviceId(): Promise<string>; | Added|
| ohos.account.osAccount | AccountManager | getOsAccountTypeFromProcess(callback: AsyncCallback<OsAccountType>): void;<br>getOsAccountTypeFromProcess(): Promise<OsAccountType>; | Added|
| ohos.account.osAccount | AccountManager | queryCurrentOsAccount(callback: AsyncCallback<OsAccountInfo>): void;<br>queryCurrentOsAccount(): Promise<OsAccountInfo>; | Added|
| ohos.account.osAccount | AccountManager | queryActivatedOsAccountIds(callback: AsyncCallback<Array<number>>): void;<br>queryActivatedOsAccountIds(): Promise<Array<number>>; | Added|
| ohos.account.osAccount | AccountManager | getOsAccountAllConstraints(localId: number, callback: AsyncCallback<Array<string>>): void;<br>getOsAccountAllConstraints(localId: number): Promise<Array<string>>; | Added|
| ohos.account.osAccount | AccountManager | getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo, callback: AsyncCallback<number>): void;<br>getOsAccountLocalIdFromDomain(domainInfo: DomainAccountInfo): Promise<number>; | Added|
| ohos.account.osAccount | AccountManager | getOsAccountLocalIdFromUid(uid: number, callback: AsyncCallback<number>): void;<br>getOsAccountLocalIdFromUid(uid: number): Promise<number>; | Added|
| ohos.account.osAccount | AccountManager | getOsAccountLocalIdFromProcess(callback: AsyncCallback<number>): void;<br>getOsAccountLocalIdFromProcess(): Promise<number>; | Added|
| ohos.account.osAccount | AccountManager | getCreatedOsAccountsCount(callback: AsyncCallback<number>): void;<br>getCreatedOsAccountsCount(): Promise<number>; | Added|
| ohos.account.osAccount | AccountManager | isOsAccountVerified(callback: AsyncCallback<boolean>): void;<br>isOsAccountVerified(localId: number, callback: AsyncCallback<boolean>): void;<br>isOsAccountVerified(localId?: number): Promise<boolean>; | Added|
| ohos.account.osAccount | AccountManager | isTestOsAccount(callback: AsyncCallback<boolean>): void;<br>isTestOsAccount(): Promise<boolean>; | Added|
| ohos.account.osAccount | AccountManager | isOsAccountConstraintEnable(localId: number, constraint: string, callback: AsyncCallback<boolean>): void;<br>isOsAccountConstraintEnable(localId: number, constraint: string): Promise<boolean>; | Added|
| ohos.account.osAccount | AccountManager | isOsAccountActived(localId: number, callback: AsyncCallback<boolean>): void;<br>isOsAccountActived(localId: number): Promise<boolean>; | Added|
| ohos.account.osAccount | AccountManager | isMultiOsAccountEnable(callback: AsyncCallback<boolean>): void;<br>isMultiOsAccountEnable(): Promise<boolean>; | Added|
| ohos.account.osAccount | osAccount | function getAccountManager(): AccountManager; | Added|
| ohos.account.appAccount | Authenticator | authenticate(name: string, authType: string, callerBundleName: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void; | Added|
| ohos.account.appAccount | Authenticator | addAccountImplicitly(authType: string, callerBundleName: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void; | Added|
| ohos.account.appAccount | AuthenticatorCallback | onRequestRedirected: (request: Want) => void; | Added|
| ohos.account.appAccount | AuthenticatorCallback | onResult: (code: number, result: {[key: string]: any}) => void; | Added|
| ohos.account.appAccount | ResultCode | ERROR_PERMISSION_DENIED = 10018 | Added|
| ohos.account.appAccount | ResultCode | ERROR_OAUTH_UNSUPPORT_AUTH_TYPE = 10017 | Added|
| ohos.account.appAccount | ResultCode | ERROR_OAUTH_UNSUPPORT_ACTION = 10016 | Added|
| ohos.account.appAccount | ResultCode | ERROR_OAUTH_TOKEN_TOO_MANY = 10015 | Added|
| ohos.account.appAccount | ResultCode | ERROR_OAUTH_TOKEN_NOT_EXIST = 10014 | Added|
| ohos.account.appAccount | ResultCode | ERROR_OAUTH_TIMEOUT = 10013 | Added|
| ohos.account.appAccount | ResultCode | ERROR_OAUTH_SESSION_NOT_EXIST = 10012 | Added|
| ohos.account.appAccount | ResultCode | ERROR_OAUTH_SERVICE_EXCEPTION = 10011 | Added|
| ohos.account.appAccount | ResultCode | ERROR_OAUTH_SERVICE_BUSY = 10010 | Added|
| ohos.account.appAccount | ResultCode | ERROR_OAUTH_LIST_TOO_LARGE = 10009 | Added|
| ohos.account.appAccount | ResultCode | ERROR_OAUTH_CANCELED = 10008 | Added|
| ohos.account.appAccount | ResultCode | ERROR_OAUTH_AUTHENTICATOR_NOT_EXIST = 10007 | Added|
| ohos.account.appAccount | ResultCode | ERROR_NETWORK_EXCEPTION = 10006 | Added|
| ohos.account.appAccount | ResultCode | ERROR_INVALID_RESPONSE = 10005 | Added|
| ohos.account.appAccount | ResultCode | ERROR_INVALID_REQUEST = 10004 | Added|
| ohos.account.appAccount | ResultCode | ERROR_INVALID_PASSWORD = 10003 | Added|
| ohos.account.appAccount | ResultCode | ERROR_APP_ACCOUNT_SERVICE_EXCEPTION = 10002 | Added|
| ohos.account.appAccount | ResultCode | ERROR_ACCOUNT_NOT_EXIST = 10001 | Added|
| ohos.account.appAccount | ResultCode | SUCCESS = 0 | Added|
| ohos.account.appAccount | Constants | KEY_CALLER_BUNDLE_NAME = "callerBundleName" | Added|
| ohos.account.appAccount | Constants | KEY_CALLER_UID = "callerUid" | Added|
| ohos.account.appAccount | Constants | KEY_CALLER_PID = "callerPid" | Added|
| ohos.account.appAccount | Constants | KEY_SESSION_ID = "sessionId" | Added|
| ohos.account.appAccount | Constants | KEY_AUTH_TYPE = "authType" | Added|
| ohos.account.appAccount | Constants | KEY_ACTION = "action" | Added|
| ohos.account.appAccount | Constants | KEY_TOKEN = "token" | Added|
| ohos.account.appAccount | Constants | KEY_OWNER = "owner" | Added|
| ohos.account.appAccount | Constants | KEY_NAME = "name" | Added|
| ohos.account.appAccount | Constants | ACTION_AUTHENTICATE = "authenticate" | Added|
| ohos.account.appAccount | Constants | ACTION_ADD_ACCOUNT_IMPLICITLY = "addAccountImplicitly" | Added|
| ohos.account.appAccount | AuthenticatorInfo | labelId: number; | Added|
| ohos.account.appAccount | AuthenticatorInfo | iconId: number; | Added|
| ohos.account.appAccount | AuthenticatorInfo | owner: string; | Added|
| ohos.account.appAccount | OAuthTokenInfo | token: string; | Added|
| ohos.account.appAccount | OAuthTokenInfo | authType: string; | Added|
| ohos.account.appAccount | AppAccountInfo | name: string; | Added|
| ohos.account.appAccount | AppAccountInfo | owner: string; | Added|
| ohos.account.appAccount | AppAccountManager | getAuthenticatorInfo(owner: string, callback: AsyncCallback<AuthenticatorInfo>): void;<br>getAuthenticatorInfo(owner: string): Promise<AuthenticatorInfo>; | Added|
| ohos.account.appAccount | AppAccountManager | getAuthenticatorCallback(sessionId: string, callback: AsyncCallback<AuthenticatorCallback>): void;<br>getAuthenticatorCallback(sessionId: string): Promise<AuthenticatorCallback>; | Added|
| ohos.account.appAccount | AppAccountManager | getOAuthList(name: string, authType: string, callback: AsyncCallback<Array<string>>): void;<br>getOAuthList(name: string, authType: string): Promise<Array<string>>; | Added|
| ohos.account.appAccount | AppAccountManager | getAllOAuthTokens(name: string, owner: string, callback: AsyncCallback<Array<OAuthTokenInfo>>): void;<br>getAllOAuthTokens(name: string, owner: string): Promise<Array<OAuthTokenInfo>>; | Added|
| ohos.account.appAccount | AppAccountManager | checkOAuthTokenVisibility(name: string, authType: string, bundleName: string, callback: AsyncCallback<boolean>): void;<br>checkOAuthTokenVisibility(name: string, authType: string, bundleName: string): Promise<boolean>; | Added|
| ohos.account.appAccount | AppAccountManager | setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean, callback: AsyncCallback<void>): void;<br>setOAuthTokenVisibility(name: string, authType: string, bundleName: string, isVisible: boolean): Promise<void>; | Added|
| ohos.account.appAccount | AppAccountManager | deleteOAuthToken(name: string, owner: string, authType: string, token: string, callback: AsyncCallback<void>): void;<br>deleteOAuthToken(name: string, owner: string, authType: string, token: string): Promise<void>; | Added|
| ohos.account.appAccount | AppAccountManager | setOAuthToken(name: string, authType: string, token: string, callback: AsyncCallback<void>): void;<br>setOAuthToken(name: string, authType: string, token: string): Promise<void>; | Added|
| ohos.account.appAccount | AppAccountManager | getOAuthToken(name: string, owner: string, authType: string, callback: AsyncCallback<string>): void;<br>getOAuthToken(name: string, owner: string, authType: string): Promise<string>; | Added|
| ohos.account.appAccount | AppAccountManager | authenticate(name: string, owner: string, authType: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void; | Added|
| ohos.account.appAccount | AppAccountManager | off(type: 'change', callback?: Callback<Array<AppAccountInfo>>): void; | Added|
| ohos.account.appAccount | AppAccountManager | on(type: 'change', owners: Array<string>, callback: Callback<Array<AppAccountInfo>>): void; | Added|
| ohos.account.appAccount | AppAccountManager | getAssociatedData(name: string, key: string, callback: AsyncCallback<string>): void;<br>getAssociatedData(name: string, key: string): Promise<string>; | Added|
| ohos.account.appAccount | AppAccountManager | getAccountExtraInfo(name: string, callback: AsyncCallback<string>): void;<br>getAccountExtraInfo(name: string): Promise<string>; | Added|
| ohos.account.appAccount | AppAccountManager | getAccountCredential(name: string, credentialType: string, callback: AsyncCallback<string>): void;<br>getAccountCredential(name: string, credentialType: string): Promise<string>; | Added|
| ohos.account.appAccount | AppAccountManager | getAllAccounts(owner: string, callback: AsyncCallback<Array<AppAccountInfo>>): void;<br>getAllAccounts(owner: string): Promise<Array<AppAccountInfo>>; | Added|
| ohos.account.appAccount | AppAccountManager | getAllAccessibleAccounts(callback: AsyncCallback<Array<AppAccountInfo>>): void;<br>getAllAccessibleAccounts(): Promise<Array<AppAccountInfo>>; | Added|
| ohos.account.appAccount | AppAccountManager | setAssociatedData(name: string, key: string, value: string, callback: AsyncCallback<void>): void;<br>setAssociatedData(name: string, key: string, value: string): Promise<void>; | Added|
| ohos.account.appAccount | AppAccountManager | setAppAccountSyncEnable(name: string, isEnable: boolean, callback: AsyncCallback<void>): void;<br>setAppAccountSyncEnable(name: string, isEnable: boolean): Promise<void>; | Added|
| ohos.account.appAccount | AppAccountManager | setAccountExtraInfo(name: string, extraInfo: string, callback: AsyncCallback<void>): void;<br>setAccountExtraInfo(name: string, extraInfo: string): Promise<void>; | Added|
| ohos.account.appAccount | AppAccountManager | setAccountCredential(name: string, credentialType: string, credential: string, callback: AsyncCallback<void>): void;<br>setAccountCredential(name: string, credentialType: string, credential: string): Promise<void>; | Added|
| ohos.account.appAccount | AppAccountManager | checkAppAccountSyncEnable(name: string, callback: AsyncCallback<boolean>): void;<br>checkAppAccountSyncEnable(name: string): Promise<boolean>; | Added|
| ohos.account.appAccount | AppAccountManager | enableAppAccess(name: string, bundleName: string, callback: AsyncCallback<void>): void;<br>enableAppAccess(name: string, bundleName: string): Promise<void>; | Added|
| ohos.account.appAccount | AppAccountManager | disableAppAccess(name: string, bundleName: string, callback: AsyncCallback<void>): void;<br>disableAppAccess(name: string, bundleName: string): Promise<void>; | Added|
| ohos.account.appAccount | AppAccountManager | deleteAccount(name: string, callback: AsyncCallback<void>): void;<br>deleteAccount(name: string): Promise<void>; | Added|
| ohos.account.appAccount | AppAccountManager | addAccountImplicitly(owner: string, authType: string, options: {[key: string]: any}, callback: AuthenticatorCallback): void; | Added|
| ohos.account.appAccount | AppAccountManager | addAccount(name: string, callback: AsyncCallback<void>): void;<br>addAccount(name: string, extraInfo: string, callback: AsyncCallback<void>): void;<br>addAccount(name: string, extraInfo?: string): Promise<void>; | Added|
| ohos.account.appAccount | appAccount | function createAppAccountManager(): AppAccountManager; | Added|
# JS API Changes of the ArkUI Development Framework
The table below lists the APIs changes of the ArkUI development framework in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Component Type | Component Name | Change Type| Change Description |
| ---------- | ----------------------------- | -------- | ------------------------------------------------------------ |
| Universal event | onFocus/onBlur | Added | Added the focus events. |
| Universal event | onHover/onMouse | Added | Added the mouse events. |
| Universal event | onAreaChange| Added | Added the event indicating component area (including the size and position) changes. |
| Universal attribute | stateStyles | Added | Added the attribute for polymorphic style settings. |
| Universal attribute | responseRegion | Added | Added the attribute for touch hotspot settings. |
| Universal attribute | touchable | Added | Added the attribute that specifies whether a component is touchable. |
| Universal attribute | focusable | Added | Added the attribute that specifies whether a component can gain focus. |
| Universal attribute | bindPopup | Added | Added the layout customization capability for pop-up windows. |
| Universal attribute | bindMenu | Added | Added the layout customization capability for menus. |
| Universal attribute | hoverEffect | Added | Added the attribute that specifies the hover effect of a component. |
| General gesture | SwipeGesture | Added | Added the swipe gesture. |
| Basic component | Image | Added | Added the **syncLoad** attribute to specify whether data is loaded synchronously. |
| Basic component | Swiper | Added | Added the **cachedCount** attribute to set the number of preloaded child components. |
| Basic component | Swiper | Added | Added the **disableSwipe** attribute to disable component swipe. |
| Basic component | Slider | Added | Added the vertical slider. |
| Basic component | TabContent | Added | Added the **tabbar** attribute to provide the layout customization capability. |
| Basic component | Marquee | Added | Added the **\<Marquee>** component. |
| Basic component | Gauge | Added | Added the **\<Gauge>** component. |
| Basic component | PluginComponent | Added | Added the **\<PluginComponent>** component. |
| Basic component | TextArea | Added | Added the **\<TextArea>** component. |
| Basic component | TextInput | Added | Added the **\<TextInput>** component. |
| Basic component | Toggle | Added | Added the **\<Toggle>** component. |
| Container component | List | Added | Added the **\<List>** component. |
| Container component | ScrollBar | Added | Added the **\<ScrollBar>** component. |
| Container component | Navigation | Added | Added the **\<Navigation>** component. |
| Container component | Stepper | Added | Added the **\<Stepper>** component. |
| Container component | StepperItem | Added | Added the **\<StepperItem>** component. |
| Canvas component | Canvas | Added | Added the **\<Canvas>** component. |
| Canvas component | Lottie | Added | Added the support for the Lottie library. |
| Global UI method| ActionSheet | Added | Added the support for the list selection dialog box. |
| Basic component | Web | Added | Added the **\<Web>** component. |
| Basic component | Checkbox | Added | Added the **\<Checkbox>** component to enable or disable an option. |
| Basic component | CheckboxGroup | Added | Added the **\<CheckboxGroup>** component to select or deselect all check boxes in a group. |
| Basic component | DatePicker | Added | Added the **\<DatePicker>** component to allow users to select a date from the given range. |
| Basic component | TextPicker | Added | Added the **\<TextPicker>** component. |
| Basic component | PatternLock | Added | Added the **\<PatternLock>** component to allow users to use a pattern password for authentication.|
| Basic component | RichText | Added | Added the **\<RichText>** component to parse and display HTML text. |
| Basic component | Search | Added | Added the **\<Search>** component to provide an input area for users to search. |
| Basic component | Select | Added | Added the **\<Select>** component to provide a drop-down list box that allows users to select among multiple options. |
| Basic component | TextClock | Added | Added the **\<TextClock>** component. |
| Container component | Refresh | Added | Added the **\<Refresh>** component. |
| Container component | SideBarContainer | Added | Added the **\<SideBarContainer>** component. |
| Global UI method| TextPickerDialog | Added | Added the **\<TextPickerDialog>** component. |
| Global UI method| TimePickerDialog | Added | Added the **\<TimePickerDialog>** component. |
| Global UI method| DatePickerDialog | Added | Added the **\<DatePickerDialog>** component. |
# JS API Changes of the Power Management Subsystem
The table below lists the APIs changes of the power management subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.thermal | thermal | function getThermalLevel(): ThermalLevel; | Added|
| ohos.thermal | thermal | function unsubscribeThermalLevel(callback?: AsyncCallback<void>): void; | Added|
| ohos.thermal | thermal | function subscribeThermalLevel(callback: AsyncCallback<ThermalLevel>): void; | Added|
| ohos.thermal | ThermalLevel | EMERGENCY = 6 | Added|
| ohos.thermal | ThermalLevel | WARNING = 5 | Added|
| ohos.thermal | ThermalLevel | OVERHEATED = 4 | Added|
| ohos.thermal | ThermalLevel | HOT = 3 | Added|
| ohos.thermal | ThermalLevel | WARM = 2 | Added|
| ohos.thermal | ThermalLevel | NORMAL = 1 | Added|
| ohos.thermal | ThermalLevel | COOL = 0 | Added|
| ohos.runninglock | runningLock | function createRunningLock(name: string, type: RunningLockType, callback: AsyncCallback<RunningLock>): void;<br>function createRunningLock(name: string, type: RunningLockType): Promise<RunningLock>; | Added|
| ohos.runninglock | runningLock | function isRunningLockTypeSupported(type: RunningLockType, callback: AsyncCallback<boolean>): void;<br>function isRunningLockTypeSupported(type: RunningLockType): Promise<boolean>; | Added|
# JS API Changes of the Bundle Management Framework
The table below lists the APIs changes of the bundle management framework in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| shortcutInfo | ShortcutInfo | readonly labelId: number; | Added|
| shortcutInfo | ShortcutInfo | readonly iconId: number; | Added|
| launcherAbilityInfo | LauncherAbilityInfo | readonly installTime : number; | Added|
| launcherAbilityInfo | LauncherAbilityInfo | readonly userId: number; | Added|
| launcherAbilityInfo | LauncherAbilityInfo | readonly iconId: number; | Added|
| launcherAbilityInfo | LauncherAbilityInfo | readonly labelId: number; | Added|
| launcherAbilityInfo | LauncherAbilityInfo | readonly elementName : ElementName; | Added|
| launcherAbilityInfo | LauncherAbilityInfo | readonly applicationInfo: ApplicationInfo; | Added|
| bundleInfo | BundleInfo | readonly reqPermissionStates: Array<number>; | Added|
| bundleInfo | BundleInfo | readonly hapModuleInfos: Array<HapModuleInfo>; | Added|
| bundleInfo | BundleInfo | readonly abilityInfos: Array<AbilityInfo>; | Added|
| abilityInfo | AbilityInfo | readonly enabled: boolean; | Added|
| abilityInfo | AbilityInfo | readonly metaData: Array<CustomizeData>; | Added|
| ohos.zlib | zlib | function unzipFile(inFile:string, outFile:string, options: Options): Promise<void>; | Added|
| ohos.zlib | zlib | function zipFile(inFile:string, outFile:string, options: Options): Promise<void>; | Added|
| ohos.zlib | Options | strategy?: CompressStrategy; | Added|
| ohos.zlib | Options | memLevel?: MemLevel; | Added|
| ohos.zlib | Options | level?: CompressLevel; | Added|
| ohos.zlib | MemLevel | MEM_LEVEL_DEFAULT = 8 | Added|
| ohos.zlib | MemLevel | MEM_LEVEL_MAX = 9 | Added|
| ohos.zlib | MemLevel | MEM_LEVEL_MIN = 1 | Added|
| ohos.zlib | CompressStrategy | COMPRESS_STRATEGY_FIXED = 4 | Added|
| ohos.zlib | CompressStrategy | COMPRESS_STRATEGY_RLE = 3 | Added|
| ohos.zlib | CompressStrategy | COMPRESS_STRATEGY_HUFFMAN_ONLY = 2 | Added|
| ohos.zlib | CompressStrategy | COMPRESS_STRATEGY_FILTERED = 1 | Added|
| ohos.zlib | CompressStrategy | COMPRESS_STRATEGY_DEFAULT_STRATEGY = 0 | Added|
| ohos.zlib | CompressLevel | COMPRESS_LEVEL_DEFAULT_COMPRESSION = -1 | Added|
| ohos.zlib | CompressLevel | COMPRESS_LEVEL_BEST_COMPRESSION = 9 | Added|
| ohos.zlib | CompressLevel | COMPRESS_LEVEL_BEST_SPEED = 1 | Added|
| ohos.zlib | CompressLevel | COMPRESS_LEVEL_NO_COMPRESSION = 0 | Added|
| ohos.zlib | ErrorCode | ERROR_CODE_ERRNO = -1 | Added|
| ohos.zlib | ErrorCode | ERROR_CODE_OK = 0 | Added|
| ohos.bundle | bundle | function isApplicationEnabled(bundleName: string, callback: AsyncCallback<boolean>): void;<br>function isApplicationEnabled(bundleName: string): Promise<boolean>; | Added|
| ohos.bundle | bundle | function isAbilityEnabled(info: AbilityInfo, callback: AsyncCallback<boolean>): void;<br>function isAbilityEnabled(info: AbilityInfo): Promise<boolean>; | Added|
| ohos.bundle | bundle | function getAbilityIcon(bundleName: string, abilityName: string, callback: AsyncCallback<image.PixelMap>): void;<br>function getAbilityIcon(bundleName: string, abilityName: string): Promise<image.PixelMap>; | Added|
| ohos.bundle | bundle | function getAbilityLabel(bundleName: string, abilityName: string, callback: AsyncCallback<string>): void;<br>function getAbilityLabel(bundleName: string, abilityName: string): Promise<string>; | Added|
| ohos.bundle | bundle | function getNameForUid(uid: number, callback: AsyncCallback<string>) : void<br>function getNameForUid(uid: number) : Promise<string>; | Added|
| ohos.bundle | bundle | function getAbilityInfo(bundleName: string, abilityName: string, callback: AsyncCallback<AbilityInfo>): void;<br>function getAbilityInfo(bundleName: string, abilityName: string): Promise<AbilityInfo>; | Added|
| ohos.bundle | InstallErrorCode | STATUS_UNINSTALL_PERMISSION_DENIED = 0x45 | Added|
| ohos.bundle | InstallErrorCode | STATUS_INSTALL_PERMISSION_DENIED = 0x44 | Added|
| ohos.bundle | InstallErrorCode | STATUS_GRANT_REQUEST_PERMISSIONS_FAILED = 0x43 | Added|
| ohos.bundle | InstallErrorCode | STATUS_FAILED_NO_SPACE_LEFT = 0x42 | Added|
| ohos.bundle | InstallErrorCode | STATUS_RECOVER_FAILURE_INVALID = 0x0D | Added|
| ohos.bundle | BundleOptions | userId?: number; | Added|
| ohos.bundle | ColorMode | LIGHT_MODE = 1 | Added|
| ohos.bundle | ColorMode | DARK_MODE = 0 | Added|
| ohos.bundle | ColorMode | AUTO_MODE = -1 | Added|
| ohos.bundle | BundleFlag | GET_APPLICATION_INFO_WITH_DISABLE = 0x00000200 | Added|
| ohos.bundle | BundleFlag | GET_ABILITY_INFO_WITH_DISABLE = 0x00000100 | Added|
| ohos.bundle | BundleFlag | GET_ABILITY_INFO_SYSTEMAPP_ONLY = 0x00000080 | Added|
| ohos.bundle | BundleFlag | GET_APPLICATION_INFO_WITH_METADATA = 0x00000040 | Added|
| ohos.bundle | BundleFlag | GET_ABILITY_INFO_WITH_METADATA = 0x00000020 | Added|
| ohos.bundle | BundleFlag | GET_ALL_APPLICATION_INFO = 0xFFFF0000 | Added|
| ohos.bundle | BundleFlag | GET_BUNDLE_WITH_REQUESTED_PERMISSION = 0x00000010 | Added|
| ohos.bundle | BundleFlag | GET_ABILITY_INFO_WITH_APPLICATION = 0x00000004 | Added|
| ohos.bundle | BundleFlag | GET_ABILITY_INFO_WITH_PERMISSION = 0x00000002 | Added|
# JS API Changes of the DFX Subsystem
The table below lists the APIs changes of the DFX subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.hiTraceMeter | hiTraceMeter | function traceByValue(name: string, count: number): void; | Added|
| ohos.hiTraceMeter | hiTraceMeter | function finishTrace(name: string, taskId: number): void; | Added|
| ohos.hiTraceMeter | hiTraceMeter | function startTrace(name: string, taskId: number): void; | Added|
| ohos.hiTraceChain | hiTraceChain | function enableFlag(id: HiTraceId, flag: HiTraceFlag): void; | Added|
| ohos.hiTraceChain | hiTraceChain | function isFlagEnabled(id: HiTraceId, flag: HiTraceFlag): boolean; | Added|
| ohos.hiTraceChain | hiTraceChain | function isValid(id: HiTraceId): boolean; | Added|
| ohos.hiTraceChain | hiTraceChain | function tracepoint(mode: HiTraceCommunicationMode, type: HiTraceTracepointType, id: HiTraceId, msg?: string): void; | Added|
| ohos.hiTraceChain | hiTraceChain | function createSpan(): HiTraceId; | Added|
| ohos.hiTraceChain | hiTraceChain | function clearId(): void; | Added|
| ohos.hiTraceChain | hiTraceChain | function setId(id: HiTraceId): void; | Added|
| ohos.hiTraceChain | hiTraceChain | function getId(): HiTraceId; | Added|
| ohos.hiTraceChain | hiTraceChain | function end(id: HiTraceId): void; | Added|
| ohos.hiTraceChain | hiTraceChain | function begin(name: string, flags: number = HiTraceFlag.DEFAULT): HiTraceId; | Added|
| ohos.hiTraceChain | HiTraceId | flags?: number; | Added|
| ohos.hiTraceChain | HiTraceId | parentSpanId?: number; | Added|
| ohos.hiTraceChain | HiTraceId | spanId?: number; | Added|
| ohos.hiTraceChain | HiTraceId | chainId: bigint; | Added|
| ohos.hiTraceChain | HiTraceCommunicationMode | DEVICE = 3 | Added|
| ohos.hiTraceChain | HiTraceCommunicationMode | PROCESS = 2 | Added|
| ohos.hiTraceChain | HiTraceCommunicationMode | THREAD = 1 | Added|
| ohos.hiTraceChain | HiTraceCommunicationMode | DEFAULT = 0 | Added|
| ohos.hiTraceChain | HiTraceTracepointType | GENERAL = 4 | Added|
| ohos.hiTraceChain | HiTraceTracepointType | SR = 3 | Added|
| ohos.hiTraceChain | HiTraceTracepointType | SS = 2 | Added|
| ohos.hiTraceChain | HiTraceTracepointType | CR = 1 | Added|
| ohos.hiTraceChain | HiTraceTracepointType | CS = 0 | Added|
| ohos.hiTraceChain | HiTraceFlag | D2D_TP_INFO = 1 << 6 | Added|
| ohos.hiTraceChain | HiTraceFlag | FAILURE_TRIGGER = 1 << 5 | Added|
| ohos.hiTraceChain | HiTraceFlag | DISABLE_LOG = 1 << 4 | Added|
| ohos.hiTraceChain | HiTraceFlag | NO_BE_INFO = 1 << 3 | Added|
| ohos.hiTraceChain | HiTraceFlag | TP_INFO = 1 << 2 | Added|
| ohos.hiTraceChain | HiTraceFlag | DONOT_CREATE_SPAN = 1 << 1 | Added|
| ohos.hiTraceChain | HiTraceFlag | INCLUDE_ASYNC = 1 | Added|
| ohos.hiTraceChain | HiTraceFlag | DEFAULT = 0 | Added|
| ohos.hilog | LogLevel | FATAL = 7 | Added|
| ohos.hilog | LogLevel | ERROR = 6 | Added|
| ohos.hilog | LogLevel | WARN = 5 | Added|
| ohos.hilog | LogLevel | INFO = 4 | Added|
| ohos.hilog | LogLevel | DEBUG = 3 | Added|
| ohos.hilog | hilog | function isLoggable(domain: number, tag: string, level: LogLevel) : boolean; | Added|
| ohos.hilog | hilog | function fatal(domain: number, tag: string, format: string, ...args: any[]) : void; | Added|
| ohos.hilog | hilog | function error(domain: number, tag: string, format: string, ...args: any[]) : void; | Added|
| ohos.hilog | hilog | function warn(domain: number, tag: string, format: string, ...args: any[]) : void; | Added|
| ohos.hilog | hilog | function info(domain: number, tag: string, format: string, ...args: any[]) : void; | Added|
| ohos.hilog | hilog | function debug(domain: number, tag: string, format: string, ...args: any[]) : void; | Added|
| ohos.hidebug | hidebug | function dumpHeapData(filename : string) : void; | Added|
| ohos.hidebug | hidebug | function stopProfiling() : void; | Added|
| ohos.hidebug | hidebug | function startProfiling(filename : string) : void; | Added|
| ohos.hidebug | hidebug | function getSharedDirty() : bigint; | Added|
| ohos.hidebug | hidebug | function getPss() : bigint; | Added|
| ohos.hidebug | hidebug | function getNativeHeapFreeSize() : bigint; | Added|
| ohos.hidebug | hidebug | function getNativeHeapAllocatedSize() : bigint; | Added|
| ohos.hidebug | hidebug | function getNativeHeapSize() : bigint; | Added|
| ohos.hichecker | hichecker | function contains(rule: bigint) : boolean; | Added|
| ohos.hichecker | hichecker | function getRule() : bigint; | Added|
| ohos.hichecker | hichecker | function removeRule(rule: bigint) : void; | Added|
| ohos.hichecker | hichecker | function addRule(rule: bigint) : void; | Added|
| ohos.hichecker | hichecker | const RULE_CHECK_ABILITY_CONNECTION_LEAK: 8589934592n; | Added|
| ohos.hichecker | hichecker | const RULE_THREAD_CHECK_SLOW_PROCESS: 1n; | Added|
| ohos.hichecker | hichecker | const RULE_CAUTION_TRIGGER_CRASH: 4611686018427387904n; | Added|
| ohos.hichecker | hichecker | const RULE_CAUTION_PRINT_LOG: 9223372036854775808n; | Added|
| ohos.faultLogger | FaultLogInfo | fullLog: string; | Added|
| ohos.faultLogger | FaultLogInfo | summary: string; | Added|
| ohos.faultLogger | FaultLogInfo | module: string; | Added|
| ohos.faultLogger | FaultLogInfo | reason: string; | Added|
| ohos.faultLogger | FaultLogInfo | timestamp: number; | Added|
| ohos.faultLogger | FaultLogInfo | type: FaultType; | Added|
| ohos.faultLogger | FaultLogInfo | uid: number; | Added|
| ohos.faultLogger | FaultLogInfo | pid: number; | Added|
| ohos.faultLogger | FaultLogger | function querySelfFaultLog(faultType: FaultType, callback: AsyncCallback<Array<FaultLogInfo>>) : void;<br>function querySelfFaultLog(faultType: FaultType) : Promise<Array<FaultLogInfo>>; | Added|
| ohos.faultLogger | FaultType | APP_FREEZE = 4 | Added|
| ohos.faultLogger | FaultType | JS_CRASH = 3 | Added|
| ohos.faultLogger | FaultType | CPP_CRASH = 2 | Added|
| ohos.faultLogger | FaultType | NO_SPECIFIC = 0 | Added|
# JS API Changes of the Distributed Data Management Subsystem
The table below lists the APIs changes of the distributed data management subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.data.rdb | RdbPredicates | inAllDevices(): RdbPredicates; | Added|
| ohos.data.rdb | RdbPredicates | inDevices(devices: Array<string>): RdbPredicates; | Added|
| ohos.data.rdb | RdbStore | off(event:'dataChange', type: SubscribeType, observer: Callback<Array<string>>): void; | Added|
| ohos.data.rdb | RdbStore | on(event: 'dataChange', type: SubscribeType, observer: Callback<Array<string>>): void; | Added|
| ohos.data.rdb | RdbStore | sync(mode: SyncMode, predicates: RdbPredicates, callback: AsyncCallback<Array<[string, number]>>): void;<br>sync(mode: SyncMode, predicates: RdbPredicates): Promise<Array<[string, number]>>; | Added|
| ohos.data.rdb | RdbStore | obtainDistributedTableName(device: string, table: string, callback: AsyncCallback<string>): void;<br>obtainDistributedTableName(device: string, table: string): Promise<string>; | Added|
| ohos.data.rdb | RdbStore | setDistributedTables(tables: Array<string>, callback: AsyncCallback<void>): void;<br>setDistributedTables(tables: Array<string>): Promise<void>; | Added|
| ohos.data.rdb | RdbStore | rollBack():void; | Added|
| ohos.data.rdb | RdbStore | commit():void; | Added|
| ohos.data.rdb | RdbStore | beginTransaction():void; | Added|
| ohos.data.rdb | RdbStore | querySql(sql: string, bindArgs: Array<ValueType>, callback: AsyncCallback<ResultSet>): void;<br>querySql(sql: string, bindArgs?: Array<ValueType>): Promise<ResultSet>; | Added|
| ohos.data.rdb | SubscribeType | SUBSCRIBE_TYPE_REMOTE = 0 | Added|
| ohos.data.rdb | SyncMode | SYNC_MODE_PULL = 1 | Added|
| ohos.data.rdb | SyncMode | SYNC_MODE_PUSH = 0 | Added|
| ohos.data.distributedDataObject | DistributedObject | off(type: 'status', callback?: Callback<{ sessionId: string, deviceId: string, status: 'online' \| 'offline' }>): void; | Added|
| ohos.data.distributedDataObject | DistributedObject | on(type: 'status', callback: Callback<{ sessionId: string, networkId: string, status: 'online' \| 'offline' }>): void; | Added|
| ohos.data.distributedDataObject | DistributedObject | off(type: 'change', callback?: Callback<{ sessionId: string, fields: Array<string> }>): void; | Added|
| ohos.data.distributedDataObject | DistributedObject | on(type: 'change', callback: Callback<{ sessionId: string, fields: Array<string> }>): void; | Added|
| ohos.data.distributedDataObject | DistributedObject | setSessionId(sessionId?: string): boolean; | Added|
| ohos.data.distributedDataObject | distributedDataObject | function genSessionId(): string; | Added|
| ohos.data.distributedDataObject | distributedDataObject | function createDistributedObject(source: object): DistributedObject; | Added|
| ohos.data.distributedData | KVManager | off(event: 'distributedDataServiceDie', deathCallback?: Callback<void>): void; | Added|
| ohos.data.distributedData | KVManager | on(event: 'distributedDataServiceDie', deathCallback: Callback<void>): void; | Added|
| ohos.data.distributedData | KVManager | getAllKVStoreId(appId: string, callback: AsyncCallback<string[]>): void;<br>getAllKVStoreId(appId: string): Promise<string[]>; | Added|
| ohos.data.distributedData | KVManager | deleteKVStore(appId: string, storeId: string, callback: AsyncCallback<void>): void;<br>deleteKVStore(appId: string, storeId: string): Promise<void>; | Added|
| ohos.data.distributedData | KVManager | closeKVStore(appId: string, storeId: string, kvStore: KVStore, callback: AsyncCallback<void>): void;<br>closeKVStore(appId: string, storeId: string, kvStore: KVStore): Promise<void>; | Added|
| ohos.data.distributedData | DeviceKVStore | off(event: 'syncComplete', syncCallback?: Callback<Array<[string, number]>>): void; | Added|
| ohos.data.distributedData | DeviceKVStore | on(event: 'syncComplete', syncCallback: Callback<Array<[string, number]>>): void; | Added|
| ohos.data.distributedData | DeviceKVStore | sync(deviceIdList: string[], mode: SyncMode, allowedDelayMs?: number): void; | Added|
| ohos.data.distributedData | DeviceKVStore | removeDeviceData(deviceId: string, callback: AsyncCallback<void>): void;<br>removeDeviceData(deviceId: string): Promise<void>; | Added|
| ohos.data.distributedData | DeviceKVStore | getResultSize(query: Query, callback: AsyncCallback<number>): void;<br>getResultSize(query: Query): Promise<number>;<br>getResultSize(deviceId: string, query: Query, callback: AsyncCallback<number>): void;<br>getResultSize(deviceId: string, query: Query): Promise<number>; | Added|
| ohos.data.distributedData | DeviceKVStore | closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback<void>): void;<br>closeResultSet(resultSet: KvStoreResultSet): Promise<void>; | Added|
| ohos.data.distributedData | DeviceKVStore | getResultSet(deviceId: string, keyPrefix: string, callback: AsyncCallback<KvStoreResultSet>): void;<br>getResultSet(deviceId: string, keyPrefix: string): Promise<KvStoreResultSet>;<br>getResultSet(query: Query, callback: AsyncCallback<KvStoreResultSet>): void;<br>getResultSet(query: Query): Promise<KvStoreResultSet>;<br>getResultSet(deviceId: string, query: Query, callback: AsyncCallback<KvStoreResultSet>): void;<br>getResultSet(deviceId: string, query: Query): Promise<KvStoreResultSet>; | Added|
| ohos.data.distributedData | DeviceKVStore | getEntries(deviceId: string, keyPrefix: string, callback: AsyncCallback<Entry[]>): void;<br>getEntries(deviceId: string, keyPrefix: string): Promise<Entry[]>;<br>getEntries(query: Query, callback: AsyncCallback<Entry[]>): void;<br>getEntries(query: Query): Promise<Entry[]>;<br>getEntries(deviceId: string, query: Query, callback: AsyncCallback<Entry[]>): void;<br>getEntries(deviceId: string, query: Query): Promise<Entry[]>; | Added|
| ohos.data.distributedData | DeviceKVStore | get(deviceId: string, key: string, callback: AsyncCallback<boolean\|string\|number\|Uint8Array>): void;<br>get(deviceId: string, key: string): Promise<boolean\|string\|number\|Uint8Array>; | Added|
| ohos.data.distributedData | SingleKVStore | getSecurityLevel(callback: AsyncCallback<SecurityLevel>): void;<br>getSecurityLevel(): Promise<SecurityLevel>; | Added|
| ohos.data.distributedData | SingleKVStore | setSyncParam(defaultAllowedDelayMs: number, callback: AsyncCallback<void>): void;<br>setSyncParam(defaultAllowedDelayMs: number): Promise<void>; | Added|
| ohos.data.distributedData | SingleKVStore | off(event: 'syncComplete', syncCallback?: Callback<Array<[string, number]>>): void; | Added|
| ohos.data.distributedData | SingleKVStore | on(event: 'syncComplete', syncCallback: Callback<Array<[string, number]>>): void; | Added|
| ohos.data.distributedData | SingleKVStore | removeDeviceData(deviceId: string, callback: AsyncCallback<void>): void;<br>removeDeviceData(deviceId: string): Promise<void>; | Added|
| ohos.data.distributedData | SingleKVStore | getResultSize(query: Query, callback: AsyncCallback<number>): void;<br>getResultSize(query: Query): Promise<number>; | Added|
| ohos.data.distributedData | SingleKVStore | closeResultSet(resultSet: KvStoreResultSet, callback: AsyncCallback<void>): void;<br>closeResultSet(resultSet: KvStoreResultSet): Promise<void>; | Added|
| ohos.data.distributedData | SingleKVStore | getResultSet(keyPrefix: string, callback: AsyncCallback<KvStoreResultSet>): void;<br>getResultSet(keyPrefix: string): Promise<KvStoreResultSet>;<br>getResultSet(query: Query, callback: AsyncCallback<KvStoreResultSet>): void;<br>getResultSet(query: Query): Promise<KvStoreResultSet>; | Added|
| ohos.data.distributedData | SingleKVStore | getEntries(keyPrefix: string, callback: AsyncCallback<Entry[]>): void;<br>getEntries(keyPrefix: string): Promise<Entry[]>;<br>getEntries(query: Query, callback: AsyncCallback<Entry[]>): void;<br>getEntries(query: Query): Promise<Entry[]>; | Added|
| ohos.data.distributedData | KVStore | setSyncRange(localLabels: string[], remoteSupportLabels: string[], callback: AsyncCallback<void>): void;<br>setSyncRange(localLabels: string[], remoteSupportLabels: string[]): Promise<void>; | Added|
| ohos.data.distributedData | KVStore | enableSync(enabled: boolean, callback: AsyncCallback<void>): void;<br>enableSync(enabled: boolean): Promise<void>; | Added|
| ohos.data.distributedData | KVStore | rollback(callback: AsyncCallback<void>): void;<br>rollback(): Promise<void>; | Added|
| ohos.data.distributedData | KVStore | commit(callback: AsyncCallback<void>): void;<br>commit(): Promise<void>; | Added|
| ohos.data.distributedData | KVStore | startTransaction(callback: AsyncCallback<void>): void;<br>startTransaction(): Promise<void>; | Added|
| ohos.data.distributedData | KVStore | deleteBatch(keys: string[], callback: AsyncCallback<void>): void;<br>deleteBatch(keys: string[]): Promise<void>; | Added|
| ohos.data.distributedData | KVStore | putBatch(entries: Entry[], callback: AsyncCallback<void>): void;<br>putBatch(entries: Entry[]): Promise<void>; | Added|
| ohos.data.distributedData | KVStore | off(event:'dataChange', observer?: Callback<ChangeNotification>): void; | Added|
| ohos.data.distributedData | Query | getSqlLike():string; | Added|
| ohos.data.distributedData | Query | deviceId(deviceId:string):Query; | Added|
| ohos.data.distributedData | Query | setSuggestIndex(index: string): Query; | Added|
| ohos.data.distributedData | Query | prefixKey(prefix: string): Query; | Added|
| ohos.data.distributedData | Query | endGroup(): Query; | Added|
| ohos.data.distributedData | Query | beginGroup(): Query; | Added|
| ohos.data.distributedData | Query | isNotNull(field: string): Query; | Added|
| ohos.data.distributedData | Query | limit(total: number, offset: number): Query; | Added|
| ohos.data.distributedData | Query | orderByDesc(field: string): Query; | Added|
| ohos.data.distributedData | Query | orderByAsc(field: string): Query; | Added|
| ohos.data.distributedData | Query | or(): Query; | Added|
| ohos.data.distributedData | Query | and(): Query; | Added|
| ohos.data.distributedData | Query | unlike(field: string, value: string): Query; | Added|
| ohos.data.distributedData | Query | like(field: string, value: string): Query; | Added|
| ohos.data.distributedData | Query | notInString(field: string, valueList: string[]): Query; | Added|
| ohos.data.distributedData | Query | notInNumber(field: string, valueList: number[]): Query; | Added|
| ohos.data.distributedData | Query | inString(field: string, valueList: string[]): Query; | Added|
| ohos.data.distributedData | Query | inNumber(field: string, valueList: number[]): Query; | Added|
| ohos.data.distributedData | Query | isNull(field: string): Query; | Added|
| ohos.data.distributedData | Query | lessThanOrEqualTo(field: string, value: number\|string): Query; | Added|
| ohos.data.distributedData | Query | greaterThanOrEqualTo(field: string, value: number\|string): Query; | Added|
| ohos.data.distributedData | Query | lessThan(field: string, value: number\|string): Query; | Added|
| ohos.data.distributedData | Query | greaterThan(field: string, value: number\|string\|boolean): Query; | Added|
| ohos.data.distributedData | Query | notEqualTo(field: string, value: number\|string\|boolean): Query; | Added|
| ohos.data.distributedData | Query | equalTo(field: string, value: number\|string\|boolean): Query; | Added|
| ohos.data.distributedData | Query | reset(): Query; | Added|
| ohos.data.distributedData | Query | constructor() | Added|
| ohos.data.distributedData | KvStoreResultSet | getEntry(): Entry; | Added|
| ohos.data.distributedData | KvStoreResultSet | isAfterLast(): boolean; | Added|
| ohos.data.distributedData | KvStoreResultSet | isBeforeFirst(): boolean; | Added|
| ohos.data.distributedData | KvStoreResultSet | isLast(): boolean; | Added|
| ohos.data.distributedData | KvStoreResultSet | isFirst(): boolean; | Added|
| ohos.data.distributedData | KvStoreResultSet | moveToPosition(position: number): boolean; | Added|
| ohos.data.distributedData | KvStoreResultSet | move(offset: number): boolean; | Added|
| ohos.data.distributedData | KvStoreResultSet | moveToPrevious(): boolean; | Added|
| ohos.data.distributedData | KvStoreResultSet | moveToNext(): boolean; | Added|
| ohos.data.distributedData | KvStoreResultSet | moveToLast(): boolean; | Added|
| ohos.data.distributedData | KvStoreResultSet | moveToFirst(): boolean; | Added|
| ohos.data.distributedData | KvStoreResultSet | getPosition(): number; | Added|
| ohos.data.distributedData | KvStoreResultSet | getCount(): number; | Added|
| ohos.data.distributedData | FieldNode | type: number; | Added|
| ohos.data.distributedData | FieldNode | nullable: boolean; | Added|
| ohos.data.distributedData | FieldNode | default: string; | Added|
| ohos.data.distributedData | FieldNode | appendChild(child: FieldNode): boolean; | Added|
| ohos.data.distributedData | FieldNode | constructor(name: string) | Added|
| ohos.data.distributedData | Schema | skip: number; | Added|
| ohos.data.distributedData | Schema | mode: number; | Added|
| ohos.data.distributedData | Schema | indexes: Array<string>; | Added|
| ohos.data.distributedData | Schema | root: FieldNode; | Added|
| ohos.data.distributedData | Schema | constructor() | Added|
| ohos.data.distributedData | Options | schema?: Schema; | Added|
# JS API Changes of the Distributed Hardware Subsystem
The table below lists the APIs changes of the Distributed Data Management subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module | API | Change Type | Change Description |
| -------- | -------- | -------- | -------- |
| Distributed Hardware Subsystem - DeviceManager| release(): void | Deleted| This API is deleted to reduce security risks.|
| Distributed Hardware Subsystem - DeviceManager| getTrustedDeviceListSync(): Array<DeviceInfo> | Deleted| This API is deleted to reduce security risks.|
| Distributed Hardware Subsystem - DeviceManager| on(type: 'deviceStateChange', callback: Callback<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void | Deleted| This API is deleted to reduce security risks.|
| Distributed Hardware Subsystem - DeviceManager| off(type: 'deviceStateChange', callback?: Call back<{ action: DeviceStateChangeAction, device: DeviceInfo }>): void | Deleted| This API is deleted to reduce security risks.|
| Distributed Hardware Subsystem - DeviceManager| on(type: 'serviceDie', callback: () => void): void | Deleted| This API is deleted to reduce security risks.|
| Distributed Hardware Subsystem - DeviceManager| off(type: 'serviceDie', callback?: () => void): void | Deleted| This API is deleted to reduce security risks.|
# JS API Changes of the Common Event and Notification Framework
The table below lists the APIs changes of the common event and notification framework in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| notificationUserInput | NotificationUserInput | inputKey: string; | Added|
| notificationTemplate | NotificationTemplate | data: {[key: string]: Object}; | Added|
| notificationTemplate | NotificationTemplate | name: string; | Added|
| notificationRequest | DistributedOptions | supportOperateDevices?: Array<string>; | Added|
| notificationRequest | DistributedOptions | supportDisplayDevices?: Array<string>; | Added|
| notificationRequest | DistributedOptions | isDistributed?: boolean; | Added|
| notificationRequest | NotificationRequest | readonly notificationFlags?: NotificationFlags; | Added|
| notificationRequest | NotificationRequest | distributedOption?: DistributedOptions; | Added|
| notificationRequest | NotificationRequest | template?: NotificationTemplate; | Added|
| notificationRequest | NotificationRequest | readonly creatorUserId?: number; | Added|
| notificationRequest | NotificationRequest | groupName?: string; | Added|
| notificationActionButton | NotificationActionButton | userInput?: NotificationUserInput; | Added|
| ohos.notification | notification | function isDistributedEnabled(callback: AsyncCallback<boolean>): void;<br>function isDistributedEnabled(): Promise<boolean>; | Added|
| ohos.notification | notification | function requestEnableNotification(callback: AsyncCallback<void>): void;<br>function requestEnableNotification(): Promise<void>; | Added|
| ohos.notification | notification | function isSupportTemplate(templateName: string, callback: AsyncCallback<boolean>): void;<br>function isSupportTemplate(templateName: string): Promise<boolean>; | Added|
| ohos.notification | notification | function cancelGroup(groupName: string, callback: AsyncCallback<void>): void;<br>function cancelGroup(groupName: string): Promise<void>; | Added|
| ohos.events.emitter | EventPriority | IDLE | Added|
| ohos.events.emitter | EventPriority | LOW | Added|
| ohos.events.emitter | EventPriority | HIGH | Added|
| ohos.events.emitter | EventPriority | IMMEDIATE = 0 | Added|
| ohos.events.emitter | InnerEvent | priority?: EventPriority; | Added|
| ohos.events.emitter | InnerEvent | eventId: number; | Added|
| ohos.events.emitter | EventData | data?: {[key: string]: any}; | Added|
| ohos.events.emitter | emitter | function emit(event: InnerEvent, data?: EventData): void; | Added|
| ohos.events.emitter | emitter | function off(eventId: number): void; | Added|
| ohos.events.emitter | emitter | function once(event: InnerEvent, callback: Callback<EventData>): void; | Added|
| ohos.events.emitter | emitter | function on(event: InnerEvent, callback: Callback<EventData>): void; | Added|
| ohos.commonEvent | Support | COMMON_EVENT_SPLIT_SCREEN = "common.event.SPLIT_SCREEN" | Added|
| ohos.commonEvent | Support | COMMON_EVENT_THERMAL_LEVEL_CHANGED = "usual.event.THERMAL_LEVEL_CHANGED" | Added|
# JS API Changes of the File Management Subsystem
The table below lists the APIs changes of the file management subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.statfs | Statfs | function getTotalBytes(path: string, callback: AsyncCallback<number>): void;<br>function getTotalBytes(path: string): Promise<number>; | Added|
| ohos.statfs | Statfs | function getFreeBytes(path: string, callback: AsyncCallback<number>): void;<br>function getFreeBytes(path: string): Promise<number>; | Added|
| ohos.fileio | Watcher | stop(): Promise<void>;<br>stop(callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | ReadOut | buffer: ArrayBuffer; | Added|
| ohos.fileio | ReadOut | offset: number; | Added|
| ohos.fileio | ReadOut | bytesRead: number; | Added|
| ohos.fileio | Stream | read(buffer: ArrayBuffer, options?: { position?: number; offset?: number; length?: number; }): Promise<ReadOut>;<br>read(buffer: ArrayBuffer, callback: AsyncCallback<ReadOut>): void;<br>read(buffer: ArrayBuffer, options: { position?: number; offset?: number; length?: number; }, callback: AsyncCallback<ReadOut>): void; | Added|
| ohos.fileio | Stream | write(buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }): Promise<number>;<br>write(buffer: ArrayBuffer \| string, callback: AsyncCallback<number>): void;<br>write(buffer: ArrayBuffer \| string, options: { offset?: number; length?: number; position?: number; encoding?: string; }, callback: AsyncCallback<number>): void; | Added|
| ohos.fileio | Stream | flush(): Promise<void>;<br>flush(callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | Stream | close(): Promise<void>;<br>close(callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | Dir | close(): Promise<void>;<br>close(callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | Dir | read(): Promise<Dirent>;<br>read(callback: AsyncCallback<Dirent>): void; | Added|
| ohos.fileio | fileIO | function createWatcher(filename: string, events: number, callback: AsyncCallback<number>): Watcher; | Added|
| ohos.fileio | fileIO | function write(fd: number, buffer: ArrayBuffer \| string, options?: { offset?: number; length?: number; position?: number; encoding?: string; }): Promise<number>;<br>function write(fd: number, buffer: ArrayBuffer \| string, callback: AsyncCallback<number>): void;<br>function write(fd: number, buffer: ArrayBuffer \| string, options: { offset?: number; length?: number; position?: number; encoding?: string; }, callback: AsyncCallback<number>): void; | Added|
| ohos.fileio | fileIO | function unlink(path: string): Promise<void>;<br>function unlink(path: string, callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | fileIO | function truncate(path: string, len?: number): Promise<void>;<br>function truncate(path: string, callback: AsyncCallback<void>): void;<br>function truncate(path: string, len: number, callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | fileIO | function symlinkSync(target: string, srcPath: string): void; | Added|
| ohos.fileio | fileIO | function symlink(target: string, srcPath: string): Promise<void>;<br>function symlink(target: string, srcPath: string, callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | fileIO | function stat(path: string): Promise<Stat>;<br>function stat(path: string, callback: AsyncCallback<Stat>): void; | Added|
| ohos.fileio | fileIO | function rmdir(path: string): Promise<void>;<br>function rmdir(path: string, callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | fileIO | function rename(oldPath: string, newPath: string): Promise<void>;<br>function rename(oldPath: string, newPath: string, callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | fileIO | function read(fd: number, buffer: ArrayBuffer, options?: { offset?: number; length?: number; position?: number; }): Promise<ReadOut><br>function read(fd: number, buffer: ArrayBuffer, callback: AsyncCallback<ReadOut>): void;<br>function read(fd: number, buffer: ArrayBuffer, options: { offset?: number; length?: number; position?: number; }, callback: AsyncCallback<ReadOut>): void; | Added|
| ohos.fileio | fileIO | function readTextSync(filePath: string, options?: { position?: number; length?: number; encoding?: string; }): string;| Added|
| ohos.fileio | fileIO | function readText(filePath: string, options?: { position?: number; length?: number; encoding?: string; }): Promise<string>;<br>function readText(filePath: string, options: { position?: number; length?: number; encoding?: string; }, callback: AsyncCallback<string>): void; | Added|
| ohos.fileio | fileIO | function opendir(path: string): Promise<Dir>;<br>function opendir(path: string, callback: AsyncCallback<Dir>): void; | Added|
| ohos.fileio | fileIO | function open(path: string, flags?: number, mode?: number): Promise<number>;<br>function open(path: string, callback: AsyncCallback<number>): void;<br>function open(path: string, flags: number, callback: AsyncCallback<number>): void;<br>function open(path: string, flags: number, mode: number, callback: AsyncCallback<number>): void; | Added|
| ohos.fileio | fileIO | function mkdtempSync(prefix: string): string; | Added|
| ohos.fileio | fileIO | function mkdtemp(prefix: string): Promise<string>;<br>function mkdtemp(prefix: string, callback: AsyncCallback<string>): void; | Added|
| ohos.fileio | fileIO | function mkdir(path: string, mode?: number): Promise<void>;<br>function mkdir(path: string, callback: AsyncCallback<void>): void;<br>function mkdir(path: string, mode: number, callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | fileIO | function lstatSync(path: string): Stat; | Added|
| ohos.fileio | fileIO | function lstat(path: string): Promise<Stat>;<br>function lstat(path: string, callback: AsyncCallback<Stat>): void; | Added|
| ohos.fileio | fileIO | function lchownSync(path: string, uid: number, gid: number): void; | Added|
| ohos.fileio | fileIO | function lchown(path: string, uid: number, gid: number): Promise<void>;<br>function lchown(path: string, uid: number, gid: number, callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | fileIO | function hash(path: string, algorithm: string): Promise<string>;<br>function hash(path: string, algorithm: string, callback: AsyncCallback<string>): void; | Added|
| ohos.fileio | fileIO | function fdopenStream(fd: number, mode: string): Promise<Stream>;<br>function fdopenStream(fd: number, mode: string, callback: AsyncCallback<Stream>): void; | Added|
| ohos.fileio | fileIO | function fchmod(fd: number, mode: number): Promise<void>;<br>function fchmod(fd: number, mode: number, callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | fileIO | function fchown(fd: number, uid: number, gid: number): Promise<void>;<br>function fchown(fd: number, uid: number, gid: number, callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | fileIO | function fdatasyncSync(fd: number): void; | Added|
| ohos.fileio | fileIO | function fdatasync(fd: number): Promise<void>;<br>function fdatasync(fd: number, callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | fileIO | function fstat(fd: number): Promise<Stat>;<br>function fstat(fd: number, callback: AsyncCallback<Stat>): void; | Added|
| ohos.fileio | fileIO | function fsync(fd: number): Promise<void>;<br>function fsync(fd: number, callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | fileIO | function ftruncate(fd: number, len?: number): Promise<void>;<br>function ftruncate(fd: number, callback: AsyncCallback<void>): void;<br>function ftruncate(fd: number, len: number, callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | fileIO | function chmod(path: string, mode: number): Promise<void>;<br>function chmod(path: string, mode: number, callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | fileIO | function chown(path: string, uid: number, gid: number): Promise<void>;<br>function chown(path: string, uid: number, gid: number, callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | fileIO | function createStream(path: string, mode: string): Promise<Stream>;<br>function createStream(path: string, mode: string, callback: AsyncCallback<Stream>): void; | Added|
| ohos.fileio | fileIO | function copyFile(src: string \| number, dest: string \| number, mode?: number): Promise<void>;<br>function copyFile(src: string \| number, dest: string \| number, callback: AsyncCallback<void>): void;<br>function copyFile(src: string \| number, dest: string \| number, mode: number, callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | fileIO | function close(fd: number): Promise<void>;<br>function close(fd: number, callback: AsyncCallback<void>): void; | Added|
| ohos.fileio | fileIO | function access(path: string, mode?: number): Promise<void>;<br>function access(path: string, callback: AsyncCallback<void>): void;<br>function access(path: string, mode: number, callback: AsyncCallback<void>): void; | Added|
| ohos.document | document | function show(uri: string, type: string): Promise<void>;<br>function show(uri: string, type: string, callback: AsyncCallback<void>): void; | Added|
| ohos.document | document | function choose(types?: string[]): Promise<string>;<br>function choose(callback: AsyncCallback<string>): void;<br>function choose(types: string[], callback: AsyncCallback<string>): void; | Added|
# JS API Changes of the Location Subsystem
The table below lists the APIs changes of the location subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.geolocation | LocationCommand | command: string; | Added|
| ohos.geolocation | LocationCommand | scenario: LocationRequestScenario; | Added|
| ohos.geolocation | LocationPrivacyType | CORE_LOCATION | Added|
| ohos.geolocation | LocationPrivacyType | STARTUP | Added|
| ohos.geolocation | LocationPrivacyType | OTHERS = 0 | Added|
| ohos.geolocation | GeoLocationErrorCode | LOCATION_REQUEST_TIMEOUT_ERROR | Added|
| ohos.geolocation | GeoLocationErrorCode | LAST_KNOWN_LOCATION_ERROR | Added|
| ohos.geolocation | GeoLocationErrorCode | LOCATION_SWITCH_ERROR | Added|
| ohos.geolocation | GeoLocationErrorCode | LOCATOR_ERROR | Added|
| ohos.geolocation | GeoLocationErrorCode | GEOCODE_ERROR | Added|
| ohos.geolocation | GeoLocationErrorCode | REVERSE_GEOCODE_ERROR | Added|
| ohos.geolocation | GeoLocationErrorCode | INPUT_PARAMS_ERROR = 101 | Added|
| ohos.geolocation | LocationRequestScenario | NO_POWER | Added|
| ohos.geolocation | LocationRequestScenario | DAILY_LIFE_SERVICE | Added|
| ohos.geolocation | LocationRequestScenario | CAR_HAILING | Added|
| ohos.geolocation | LocationRequestScenario | TRAJECTORY_TRACKING | Added|
| ohos.geolocation | LocationRequestScenario | NAVIGATION | Added|
| ohos.geolocation | LocationRequestScenario | UNSET = 0x300 | Added|
| ohos.geolocation | LocationRequestPriority | FIRST_FIX | Added|
| ohos.geolocation | LocationRequestPriority | LOW_POWER | Added|
| ohos.geolocation | LocationRequestPriority | ACCURACY | Added|
| ohos.geolocation | LocationRequestPriority | UNSET = 0x200 | Added|
| ohos.geolocation | Location | additionSize?: number; | Added|
| ohos.geolocation | Location | additions?: Array<string>; | Added|
| ohos.geolocation | Location | timeSinceBoot: number; | Added|
| ohos.geolocation | Location | direction: number; | Added|
| ohos.geolocation | Location | timeStamp: number; | Added|
| ohos.geolocation | Location | speed: number; | Added|
| ohos.geolocation | Location | accuracy: number; | Added|
| ohos.geolocation | Location | altitude: number; | Added|
| ohos.geolocation | Location | longitude: number; | Added|
| ohos.geolocation | Location | latitude: number; | Added|
| ohos.geolocation | CurrentLocationRequest | timeoutMs?: number; | Added|
| ohos.geolocation | CurrentLocationRequest | maxAccuracy?: number; | Added|
| ohos.geolocation | CurrentLocationRequest | scenario?: LocationRequestScenario; | Added|
| ohos.geolocation | CurrentLocationRequest | priority?: LocationRequestPriority; | Added|
| ohos.geolocation | LocationRequest | maxAccuracy?: number; | Added|
| ohos.geolocation | LocationRequest | distanceInterval?: number; | Added|
| ohos.geolocation | LocationRequest | timeInterval?: number; | Added|
| ohos.geolocation | LocationRequest | scenario?: LocationRequestScenario; | Added|
| ohos.geolocation | LocationRequest | priority?: LocationRequestPriority; | Added|
| ohos.geolocation | GeoAddress | descriptionsSize?: number; | Added|
| ohos.geolocation | GeoAddress | descriptions?: Array<string>; | Added|
| ohos.geolocation | GeoAddress | addressUrl?: string; | Added|
| ohos.geolocation | GeoAddress | phoneNumber?: string; | Added|
| ohos.geolocation | GeoAddress | postalCode?: string; | Added|
| ohos.geolocation | GeoAddress | premises?: string; | Added|
| ohos.geolocation | GeoAddress | subRoadName?: string; | Added|
| ohos.geolocation | GeoAddress | roadName?: string; | Added|
| ohos.geolocation | GeoAddress | subLocality?: string; | Added|
| ohos.geolocation | GeoAddress | locality?: string; | Added|
| ohos.geolocation | GeoAddress | subAdministrativeArea?: string; | Added|
| ohos.geolocation | GeoAddress | administrativeArea?: string; | Added|
| ohos.geolocation | GeoAddress | countryName?: string; | Added|
| ohos.geolocation | GeoAddress | countryCode?: string; | Added|
| ohos.geolocation | GeoAddress | placeName?: string; | Added|
| ohos.geolocation | GeoAddress | locale?: string; | Added|
| ohos.geolocation | GeoAddress | longitude?: number; | Added|
| ohos.geolocation | GeoAddress | latitude?: number; | Added|
| ohos.geolocation | GeoCodeRequest | maxLongitude?: number; | Added|
| ohos.geolocation | GeoCodeRequest | maxLatitude?: number; | Added|
| ohos.geolocation | GeoCodeRequest | minLongitude?: number; | Added|
| ohos.geolocation | GeoCodeRequest | minLatitude?: number; | Added|
| ohos.geolocation | GeoCodeRequest | maxItems?: number; | Added|
| ohos.geolocation | GeoCodeRequest | description: string; | Added|
| ohos.geolocation | GeoCodeRequest | locale?: string; | Added|
| ohos.geolocation | ReverseGeoCodeRequest | maxItems?: number; | Added|
| ohos.geolocation | ReverseGeoCodeRequest | longitude: number; | Added|
| ohos.geolocation | ReverseGeoCodeRequest | latitude: number; | Added|
| ohos.geolocation | ReverseGeoCodeRequest | locale?: string; | Added|
| ohos.geolocation | Geofence | expiration: number; | Added|
| ohos.geolocation | Geofence | radius: number; | Added|
| ohos.geolocation | Geofence | longitude: number; | Added|
| ohos.geolocation | Geofence | latitude: number; | Added|
| ohos.geolocation | GeofenceRequest | geofence: Geofence; | Added|
| ohos.geolocation | GeofenceRequest | scenario: LocationRequestScenario; | Added|
| ohos.geolocation | GeofenceRequest | priority: LocationRequestPriority; | Added|
| ohos.geolocation | CachedGnssLocationsRequest | wakeUpCacheQueueFull: boolean; | Added|
| ohos.geolocation | CachedGnssLocationsRequest | reportingPeriodSec: number; | Added|
| ohos.geolocation | SatelliteStatusInfo | carrierFrequencies: Array<number>; | Added|
| ohos.geolocation | SatelliteStatusInfo | azimuths: Array<number>; | Added|
| ohos.geolocation | SatelliteStatusInfo | altitudes: Array<number>; | Added|
| ohos.geolocation | SatelliteStatusInfo | carrierToNoiseDensitys: Array<number>; | Added|
| ohos.geolocation | SatelliteStatusInfo | satelliteIds: Array<number>; | Added|
| ohos.geolocation | SatelliteStatusInfo | satellitesNumber: number; | Added|
| ohos.geolocation | geolocation | function sendCommand(command: LocationCommand, callback: AsyncCallback<boolean>) : void;<br>function sendCommand(command: LocationCommand) : Promise<boolean>; | Added|
| ohos.geolocation | geolocation | function flushCachedGnssLocations(callback: AsyncCallback<boolean>) : void;<br>function flushCachedGnssLocations() : Promise<boolean>; | Added|
| ohos.geolocation | geolocation | function getCachedGnssLocationsSize(callback: AsyncCallback<number>) : void;<br>function getCachedGnssLocationsSize() : Promise<number>; | Added|
| ohos.geolocation | geolocation | function isGeoServiceAvailable(callback: AsyncCallback<boolean>) : void;<br>function isGeoServiceAvailable() : Promise<boolean>; | Added|
| ohos.geolocation | geolocation | function getAddressesFromLocationName(request: GeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>) : void;<br>function getAddressesFromLocationName(request: GeoCodeRequest) : Promise<Array<GeoAddress>>; | Added|
| ohos.geolocation | geolocation | function getAddressesFromLocation(request: ReverseGeoCodeRequest, callback: AsyncCallback<Array<GeoAddress>>) : void;<br>function getAddressesFromLocation(request: ReverseGeoCodeRequest) : Promise<Array<GeoAddress>>; | Added|
| ohos.geolocation | geolocation | function requestEnableLocation(callback: AsyncCallback<boolean>) : void;<br>function requestEnableLocation() : Promise<boolean>; | Added|
| ohos.geolocation | geolocation | function isLocationEnabled(callback: AsyncCallback<boolean>) : void;<br>function isLocationEnabled() : Promise<boolean>; | Added|
| ohos.geolocation | geolocation | function getLastLocation(callback: AsyncCallback<Location>) : void;<br>function getLastLocation() : Promise<Location>; | Added|
| ohos.geolocation | geolocation | function getCurrentLocation(request: CurrentLocationRequest, callback: AsyncCallback<Location>) : void;<br>function getCurrentLocation(callback: AsyncCallback<Location>) : void;<br>function getCurrentLocation(request?: CurrentLocationRequest) : Promise<Location>; | Added|
| ohos.geolocation | geolocation | function off(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; | Added|
| ohos.geolocation | geolocation | function on(type: 'fenceStatusChange', request: GeofenceRequest, want: WantAgent) : void; | Added|
| ohos.geolocation | geolocation | function off(type: 'nmeaMessageChange', callback?: Callback<string>) : void; | Added|
| ohos.geolocation | geolocation | function on(type: 'nmeaMessageChange', callback: Callback<string>) : void; | Added|
| ohos.geolocation | geolocation | function off(type: 'gnssStatusChange', callback?: Callback<SatelliteStatusInfo>) : void; | Added|
| ohos.geolocation | geolocation | function on(type: 'gnssStatusChange', callback: Callback<SatelliteStatusInfo>) : void; | Added|
| ohos.geolocation | geolocation | function off(type: 'cachedGnssLocationsReporting', callback?: Callback<Array<Location>>) : void; | Added|
| ohos.geolocation | geolocation | function on(type: 'cachedGnssLocationsReporting', request: CachedGnssLocationsRequest, callback: Callback<Array<Location>>) : void; | Added|
| ohos.geolocation | geolocation | function off(type: 'locationServiceState', callback?: Callback<boolean>) : void; | Added|
| ohos.geolocation | geolocation | function on(type: 'locationServiceState', callback: Callback<boolean>) : void; | Added|
| ohos.geolocation | geolocation | function off(type: 'locationChange', callback?: Callback<Location>) : void; | Added|
| ohos.geolocation | geolocation | function on(type: 'locationChange', request: LocationRequest, callback: Callback<Location>) : void; | Added|
# JS API Changes of the Globalization Subsystem
The table below lists the APIs changes of the globalization subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| rawFileDescriptor | RawFileDescriptor | length: number; | Added|
| rawFileDescriptor | RawFileDescriptor | offset: number; | Added|
| rawFileDescriptor | RawFileDescriptor | fd: number; | Added|
| ohos.resourceManager | ResourceManager | release(); | Added|
| ohos.resourceManager | ResourceManager | closeRawFileDescriptor(path: string, callback: AsyncCallback<void>): void;<br>closeRawFileDescriptor(path: string): Promise<void>; | Added|
| ohos.resourceManager | ResourceManager | getRawFileDescriptor(path: string, callback: AsyncCallback<RawFileDescriptor>): void;<br>getRawFileDescriptor(path: string): Promise<RawFileDescriptor>; | Added|
| ohos.resourceManager | ResourceManager | getRawFile(path: string, callback: AsyncCallback<Uint8Array>): void;<br>getRawFile(path: string): Promise<Uint8Array>; | Added|
| ohos.resourceManager | resourceManager | function getResourceManager(callback: AsyncCallback<ResourceManager>): void;<br>export function getResourceManager(bundleName: string, callback: AsyncCallback<ResourceManager>): void;<br>export function getResourceManager(): Promise<ResourceManager>;<br>export function getResourceManager(bundleName: string): Promise<ResourceManager>; | Added|
| ohos.intl | RelativeTimeFormat | resolvedOptions(): RelativeTimeFormatResolvedOptions; | Added|
| ohos.intl | RelativeTimeFormat | formatToParts(value: number, unit: string): Array<object>; | Added|
| ohos.intl | RelativeTimeFormat | format(value: number, unit: string): string; | Added|
| ohos.intl | RelativeTimeFormat | constructor(); | Added|
| ohos.intl | RelativeTimeFormatResolvedOptions | numberingSystem: string; | Added|
| ohos.intl | RelativeTimeFormatResolvedOptions | numeric: string; | Added|
| ohos.intl | RelativeTimeFormatResolvedOptions | style: string; | Added|
| ohos.intl | RelativeTimeFormatResolvedOptions | locale: string; | Added|
| ohos.intl | RelativeTimeFormatInputOptions | style: string; | Added|
| ohos.intl | RelativeTimeFormatInputOptions | numeric: string; | Added|
| ohos.intl | RelativeTimeFormatInputOptions | localeMatcher: string; | Added|
| ohos.intl | PluralRules | select(n: number): string; | Added|
| ohos.intl | PluralRules | constructor(); | Added|
| ohos.intl | PluralRulesOptions | maximumSignificantDigits: number; | Added|
| ohos.intl | PluralRulesOptions | minimumSignificantDigits: number; | Added|
| ohos.intl | PluralRulesOptions | maximumFractionDigits: number; | Added|
| ohos.intl | PluralRulesOptions | minimumFractionDigits: number; | Added|
| ohos.intl | PluralRulesOptions | minimumIntegerDigits: number; | Added|
| ohos.intl | PluralRulesOptions | type: string; | Added|
| ohos.intl | PluralRulesOptions | localeMatcher: string; | Added|
| ohos.intl | Collator | resolvedOptions(): CollatorOptions; | Added|
| ohos.intl | Collator | compare(first: string, second: string): number; | Added|
| ohos.intl | Collator | constructor(); | Added|
| ohos.intl | CollatorOptions | caseFirst: string; | Added|
| ohos.intl | CollatorOptions | numeric: boolean; | Added|
| ohos.intl | CollatorOptions | collation: string; | Added|
| ohos.intl | CollatorOptions | ignorePunctuation: boolean; | Added|
| ohos.intl | CollatorOptions | sensitivity: string; | Added|
| ohos.intl | CollatorOptions | usage: string; | Added|
| ohos.intl | CollatorOptions | localeMatcher: string; | Added|
| ohos.intl | NumberOptions | unitUsage: string | Added|
| ohos.intl | LocaleOptions | caseFirst: string; | Added|
| ohos.intl | LocaleOptions | numeric: boolean; | Added|
| ohos.intl | LocaleOptions | numberingSystem: string; | Added|
| ohos.intl | LocaleOptions | hourCycle: string; | Added|
| ohos.intl | LocaleOptions | collation: string; | Added|
| ohos.intl | LocaleOptions | calendar: string; | Added|
| ohos.i18n | TimeZone | getOffset(date?: number): number; | Added|
| ohos.i18n | TimeZone | getRawOffset(): number; | Added|
| ohos.i18n | TimeZone | getDisplayName(locale?: string, isDST?: boolean): string; | Added|
| ohos.i18n | TimeZone | getID(): string; | Added|
| ohos.i18n | i18n | function getTimeZone(zoneID?: string): TimeZone; | Added|
| ohos.i18n | i18n | function getFirstPreferredLanguage(): string; | Added|
| ohos.i18n | i18n | function getPreferredLanguageList(): Array<string>; | Added|
| ohos.i18n | i18n | function removePreferredLanguage(index: number): boolean; | Added|
| ohos.i18n | i18n | function addPreferredLanguage(language: string, index?: number): boolean; | Added|
| ohos.i18n | i18n | function set24HourClock(option: boolean): boolean; | Added|
| ohos.i18n | i18n | function is24HourClock(): boolean; | Added|
| ohos.i18n | Character | getType(char: string): string; | Added|
| ohos.i18n | Character | isUpperCase(char: string): boolean; | Added|
| ohos.i18n | Character | isLowerCase(char: string): boolean; | Added|
| ohos.i18n | Character | isLetter(char: string): boolean; | Added|
| ohos.i18n | Character | isIdeograph(char: string): boolean; | Added|
| ohos.i18n | Character | isRTL(char: string): boolean; | Added|
| ohos.i18n | Character | isWhitespace(char: string): boolean; | Added|
| ohos.i18n | Character | isSpaceChar(char: string): boolean; | Added|
| ohos.i18n | Character | isDigit(char: string): boolean; | Added|
| ohos.i18n | IndexUtil | getIndex(text: string): string; | Added|
| ohos.i18n | IndexUtil | addLocale(locale: string): void; | Added|
| ohos.i18n | IndexUtil | getIndexList(): Array<string>; | Added|
| ohos.i18n | i18n | function getInstance(locale?:string): IndexUtil; | Added|
| ohos.i18n | BreakIterator | isBoundary(offset: number): boolean; | Added|
| ohos.i18n | BreakIterator | getLineBreakText(): string; | Added|
| ohos.i18n | BreakIterator | following(offset: number): number; | Added|
| ohos.i18n | BreakIterator | setLineBreakText(text: string): void; | Added|
| ohos.i18n | BreakIterator | previous(): number; | Added|
| ohos.i18n | BreakIterator | next(index?: number): number; | Added|
| ohos.i18n | BreakIterator | last(): number; | Added|
| ohos.i18n | BreakIterator | first(): number; | Added|
| ohos.i18n | BreakIterator | current(): number; | Added|
| ohos.i18n | i18n | function getLineInstance(locale: string): BreakIterator; | Added|
| ohos.i18n | i18n | function isRTL(locale: string): boolean; | Added|
| ohos.i18n | Calendar | isWeekend(date?: Date): boolean; | Added|
| ohos.i18n | Calendar | getDisplayName(locale: string): string; | Added|
| ohos.i18n | Calendar | get(field: string): number; | Added|
| ohos.i18n | Calendar | setMinimalDaysInFirstWeek(value: number): void; | Added|
| ohos.i18n | Calendar | getMinimalDaysInFirstWeek(): number; | Added|
| ohos.i18n | Calendar | setFirstDayOfWeek(value: number): void; | Added|
| ohos.i18n | Calendar | getFirstDayOfWeek(): number; | Added|
| ohos.i18n | Calendar | getTimeZone(): string; | Added|
| ohos.i18n | Calendar | setTimeZone(timezone: string): void; | Added|
| ohos.i18n | Calendar | set(year: number, month: number, date:number, hour?: number, minute?: number, second?: number): void; | Added|
| ohos.i18n | Calendar | setTime(date: Date): void;<br>setTime(time: number): void; | Added|
| ohos.i18n | i18n | function getCalendar(locale: string, type?: string): Calendar; | Added|
| ohos.i18n | PhoneNumberFormat | format(number: string): string; | Added|
| ohos.i18n | PhoneNumberFormat | isValidNumber(number: string): boolean; | Added|
| ohos.i18n | PhoneNumberFormat | constructor(country: string, options?: PhoneNumberFormatOptions); | Added|
| ohos.i18n | PhoneNumberFormatOptions | type: string; | Added|
| ohos.i18n | UnitInfo | measureSystem: string | Added|
| ohos.i18n | UnitInfo | unit: string | Added|
| ohos.i18n | Util | unitConvert(fromUnit: UnitInfo, toUnit: UnitInfo, value: number, locale: string, style?: string): string; | Added|
# JS API Changes of the Multimodal Input Subsystem
The table below lists the APIs changes of the multimodal input subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.multimodalInput.inputDevice | inputDevice | function getDevice(deviceId: number, callback: AsyncCallback<InputDeviceData>): void;<br>function getDevice(deviceId: number): Promise<InputDeviceData>; | Added|
| ohos.multimodalInput.inputDevice | inputDevice | function getDeviceIds(callback: AsyncCallback<Array<number>>): void;<br>function getDeviceIds(): Promise<Array<number>>; | Added|
| ohos.multimodalInput.inputDevice | InputDeviceData | axisRanges : Array<AxisRange>; | Added|
| ohos.multimodalInput.inputDevice | InputDeviceData | sources : Array<SourceType>; | Added|
| ohos.multimodalInput.inputDevice | InputDeviceData | name: string; | Added|
| ohos.multimodalInput.inputDevice | InputDeviceData | id: number; | Added|
| ohos.multimodalInput.inputDevice | AxisRange | min: number; | Added|
| ohos.multimodalInput.inputDevice | AxisRange | max : number; | Added|
| ohos.multimodalInput.inputDevice | AxisRange | axis : AxisType; | Added|
| ohos.multimodalInput.inputDevice | AxisRange | source: SourceType; | Added|
# JS API Changes of the Network Management Subsystem
The table below lists the APIs changes of the network management subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.net.webSocket | WebSocket | off(type: 'error', callback?: ErrorCallback): void; | Added|
| ohos.net.webSocket | WebSocket | on(type: 'error', callback: ErrorCallback): void; | Added|
| ohos.net.webSocket | WebSocket | off(type: 'close', callback?: AsyncCallback<{ code: number, reason: string }>): void; | Added|
| ohos.net.webSocket | WebSocket | on(type: 'close', callback: AsyncCallback<{ code: number, reason: string }>): void; | Added|
| ohos.net.webSocket | WebSocket | off(type: 'message', callback?: AsyncCallback<string \| ArrayBuffer>): void; | Added|
| ohos.net.webSocket | WebSocket | on(type: 'message', callback: AsyncCallback<string \| ArrayBuffer>): void; | Added|
| ohos.net.webSocket | WebSocket | off(type: 'open', callback?: AsyncCallback<Object>): void; | Added|
| ohos.net.webSocket | WebSocket | on(type: 'open', callback: AsyncCallback<Object>): void; | Added|
| ohos.net.webSocket | WebSocket | close(callback: AsyncCallback<boolean>): void;<br>close(options: WebSocketCloseOptions, callback: AsyncCallback<boolean>): void;<br>close(options?: WebSocketCloseOptions): Promise<boolean>; | Added|
| ohos.net.webSocket | WebSocket | send(data: string \| ArrayBuffer, callback: AsyncCallback<boolean>): void;<br>send(data: string \| ArrayBuffer): Promise<boolean>; | Added|
| ohos.net.webSocket | WebSocket | connect(url: string, callback: AsyncCallback<boolean>): void;<br>connect(url: string, options: WebSocketRequestOptions, callback: AsyncCallback<boolean>): void;<br>connect(url: string, options?: WebSocketRequestOptions): Promise<boolean>; | Added|
| ohos.net.webSocket | WebSocketCloseOptions | reason?: string; | Added|
| ohos.net.webSocket | WebSocketCloseOptions | code?: number; | Added|
| ohos.net.webSocket | WebSocketRequestOptions | header?: Object; | Added|
| ohos.net.webSocket | webSocket | function createWebSocket(): WebSocket; | Added|
| ohos.net.socket | TCPSocket | off(type: 'error', callback?: ErrorCallback): void; | Added|
| ohos.net.socket | TCPSocket | on(type: 'error', callback: ErrorCallback): void; | Added|
| ohos.net.socket | TCPSocket | off(type: 'connect' \| 'close', callback?: Callback<void>): void; | Added|
| ohos.net.socket | TCPSocket | off(type: 'connect' \| 'close', callback?: Callback<void>): void; | Added|
| ohos.net.socket | TCPSocket | on(type: 'connect' \| 'close', callback: Callback<void>): void; | Added|
| ohos.net.socket | TCPSocket | on(type: 'connect' \| 'close', callback: Callback<void>): void; | Added|
| ohos.net.socket | TCPSocket | off(type: 'message', callback?: Callback<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; | Added|
| ohos.net.socket | TCPSocket | on(type: 'message', callback: Callback<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; | Added|
| ohos.net.socket | TCPSocket | setExtraOptions(options: TCPExtraOptions, callback: AsyncCallback<void>): void;<br>setExtraOptions(options: TCPExtraOptions): Promise<void>; | Added|
| ohos.net.socket | TCPSocket | getState(callback: AsyncCallback<SocketStateBase>): void;<br>getState(): Promise<SocketStateBase>; | Added|
| ohos.net.socket | TCPSocket | getRemoteAddress(callback: AsyncCallback<NetAddress>): void;<br>getRemoteAddress(): Promise<NetAddress>; | Added|
| ohos.net.socket | TCPSocket | close(callback: AsyncCallback<void>): void;<br>close(): Promise<void>; | Added|
| ohos.net.socket | TCPSocket | send(options: TCPSendOptions, callback: AsyncCallback<void>): void;<br>send(options: TCPSendOptions): Promise<void>; | Added|
| ohos.net.socket | TCPSocket | connect(options: TCPConnectOptions, callback: AsyncCallback<void>): void;<br>connect(options: TCPConnectOptions): Promise<void>; | Added|
| ohos.net.socket | TCPSocket | bind(address: NetAddress, callback: AsyncCallback<void>): void;<br>bind(address: NetAddress): Promise<void>; | Added|
| ohos.net.socket | TCPExtraOptions | socketLinger: {on: boolean, linger: number}; | Added|
| ohos.net.socket | TCPExtraOptions | TCPNoDelay?: boolean; | Added|
| ohos.net.socket | TCPExtraOptions | OOBInline?: boolean; | Added|
| ohos.net.socket | TCPExtraOptions | keepAlive?: boolean; | Added|
| ohos.net.socket | TCPSendOptions | encoding?: string; | Added|
| ohos.net.socket | TCPSendOptions | data: string \| ArrayBuffer; | Added|
| ohos.net.socket | TCPConnectOptions | timeout?: number; | Added|
| ohos.net.socket | TCPConnectOptions | address: NetAddress; | Added|
| ohos.net.socket | UDPSocket | off(type: 'error', callback?: ErrorCallback): void; | Added|
| ohos.net.socket | UDPSocket | on(type: 'error', callback: ErrorCallback): void; | Added|
| ohos.net.socket | UDPSocket | off(type: 'listening' \| 'close', callback?: Callback<void>): void; | Added|
| ohos.net.socket | UDPSocket | off(type: 'listening' \| 'close', callback?: Callback<void>): void; | Added|
| ohos.net.socket | UDPSocket | on(type: 'listening' \| 'close', callback: Callback<void>): void; | Added|
| ohos.net.socket | UDPSocket | on(type: 'listening' \| 'close', callback: Callback<void>): void; | Added|
| ohos.net.socket | UDPSocket | off(type: 'message', callback?: Callback<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; | Added|
| ohos.net.socket | UDPSocket | on(type: 'message', callback: Callback<{message: ArrayBuffer, remoteInfo: SocketRemoteInfo}>): void; | Added|
| ohos.net.socket | UDPSocket | setExtraOptions(options: UDPExtraOptions, callback: AsyncCallback<void>): void;<br>setExtraOptions(options: UDPExtraOptions): Promise<void>; | Added|
| ohos.net.socket | UDPSocket | getState(callback: AsyncCallback<SocketStateBase>): void;<br>getState(): Promise<SocketStateBase>; | Added|
| ohos.net.socket | UDPSocket | close(callback: AsyncCallback<void>): void;<br>close(): Promise<void>; | Added|
| ohos.net.socket | UDPSocket | send(options: UDPSendOptions, callback: AsyncCallback<void>): void;<br>send(options: UDPSendOptions): Promise<void>; | Added|
| ohos.net.socket | UDPSocket | bind(address: NetAddress, callback: AsyncCallback<void>): void;<br>bind(address: NetAddress): Promise<void>; | Added|
| ohos.net.socket | SocketRemoteInfo | size: number; | Added|
| ohos.net.socket | SocketRemoteInfo | port: number; | Added|
| ohos.net.socket | SocketRemoteInfo | family: 'IPv4' \| 'IPv6'; | Added|
| ohos.net.socket | SocketRemoteInfo | address: string; | Added|
| ohos.net.socket | SocketStateBase | isConnected: boolean; | Added|
| ohos.net.socket | SocketStateBase | isClose: boolean; | Added|
| ohos.net.socket | SocketStateBase | isBound: boolean; | Added|
| ohos.net.socket | UDPExtraOptions | broadcast?: boolean; | Added|
| ohos.net.socket | ExtraOptionsBase | socketTimeout?: number; | Added|
| ohos.net.socket | ExtraOptionsBase | reuseAddress?: boolean; | Added|
| ohos.net.socket | ExtraOptionsBase | sendBufferSize?: number; | Added|
| ohos.net.socket | ExtraOptionsBase | receiveBufferSize?: number; | Added|
| ohos.net.socket | UDPSendOptions | address: NetAddress; | Added|
| ohos.net.socket | UDPSendOptions | data: string \| ArrayBuffer; | Added|
| ohos.net.socket | socket | function constructTCPSocketInstance(): TCPSocket; | Added|
| ohos.net.socket | socket | function constructUDPSocketInstance(): UDPSocket; | Added|
| ohos.net.socket | socket | import NetAddress = connection.NetAddress; | Added|
| ohos.net.http | HttpResponse | cookies: string; | Added|
| ohos.net.http | HttpResponse | header: Object; | Added|
| ohos.net.http | HttpResponse | responseCode: ResponseCode \| number; | Added|
| ohos.net.http | HttpResponse | result: string \| Object \| ArrayBuffer; | Added|
| ohos.net.http | ResponseCode | VERSION | Added|
| ohos.net.http | ResponseCode | GATEWAY_TIMEOUT | Added|
| ohos.net.http | ResponseCode | UNAVAILABLE | Added|
| ohos.net.http | ResponseCode | BAD_GATEWAY | Added|
| ohos.net.http | ResponseCode | NOT_IMPLEMENTED | Added|
| ohos.net.http | ResponseCode | INTERNAL_ERROR = 500 | Added|
| ohos.net.http | ResponseCode | UNSUPPORTED_TYPE | Added|
| ohos.net.http | ResponseCode | REQ_TOO_LONG | Added|
| ohos.net.http | ResponseCode | ENTITY_TOO_LARGE | Added|
| ohos.net.http | ResponseCode | PRECON_FAILED | Added|
| ohos.net.http | ResponseCode | LENGTH_REQUIRED | Added|
| ohos.net.http | ResponseCode | GONE | Added|
| ohos.net.http | ResponseCode | CONFLICT | Added|
| ohos.net.http | ResponseCode | CLIENT_TIMEOUT | Added|
| ohos.net.http | ResponseCode | PROXY_AUTH | Added|
| ohos.net.http | ResponseCode | NOT_ACCEPTABLE | Added|
| ohos.net.http | ResponseCode | BAD_METHOD | Added|
| ohos.net.http | ResponseCode | NOT_FOUND | Added|
| ohos.net.http | ResponseCode | FORBIDDEN | Added|
| ohos.net.http | ResponseCode | PAYMENT_REQUIRED | Added|
| ohos.net.http | ResponseCode | UNAUTHORIZED | Added|
| ohos.net.http | ResponseCode | BAD_REQUEST = 400 | Added|
| ohos.net.http | ResponseCode | USE_PROXY | Added|
| ohos.net.http | ResponseCode | NOT_MODIFIED | Added|
| ohos.net.http | ResponseCode | SEE_OTHER | Added|
| ohos.net.http | ResponseCode | MOVED_TEMP | Added|
| ohos.net.http | ResponseCode | MOVED_PERM | Added|
| ohos.net.http | ResponseCode | MULT_CHOICE = 300 | Added|
| ohos.net.http | ResponseCode | PARTIAL | Added|
| ohos.net.http | ResponseCode | RESET | Added|
| ohos.net.http | ResponseCode | NO_CONTENT | Added|
| ohos.net.http | ResponseCode | NOT_AUTHORITATIVE | Added|
| ohos.net.http | ResponseCode | ACCEPTED | Added|
| ohos.net.http | ResponseCode | CREATED | Added|
| ohos.net.http | ResponseCode | OK = 200 | Added|
| ohos.net.http | RequestMethod | CONNECT = "CONNECT" | Added|
| ohos.net.http | RequestMethod | TRACE = "TRACE" | Added|
| ohos.net.http | RequestMethod | DELETE = "DELETE" | Added|
| ohos.net.http | RequestMethod | PUT = "PUT" | Added|
| ohos.net.http | RequestMethod | POST = "POST" | Added|
| ohos.net.http | RequestMethod | HEAD = "HEAD" | Added|
| ohos.net.http | RequestMethod | GET = "GET" | Added|
| ohos.net.http | RequestMethod | OPTIONS = "OPTIONS" | Added|
| ohos.net.http | HttpRequest | once(type: "headersReceive", callback: Callback<Object>): void; | Added|
| ohos.net.http | HttpRequest | off(type: "headersReceive", callback?: Callback<Object>): void; | Added|
| ohos.net.http | HttpRequest | on(type: "headersReceive", callback: Callback<Object>): void; | Added|
| ohos.net.http | HttpRequest | off(type: "headerReceive", callback?: AsyncCallback<Object>): void; | Added|
| ohos.net.http | HttpRequest | on(type: "headerReceive", callback: AsyncCallback<Object>): void; | Added|
| ohos.net.http | HttpRequest | destroy(): void; | Added|
| ohos.net.http | HttpRequest | request(url: string, callback: AsyncCallback<HttpResponse>): void;<br>request(url: string, options: HttpRequestOptions, callback: AsyncCallback<HttpResponse>): void;<br>request(url: string, options?: HttpRequestOptions): Promise<HttpResponse>; | Added|
| ohos.net.http | HttpRequestOptions | connectTimeout?: number; | Added|
| ohos.net.http | HttpRequestOptions | readTimeout?: number; | Added|
| ohos.net.http | HttpRequestOptions | header?: Object; | Added|
| ohos.net.http | HttpRequestOptions | extraData?: string \| Object \| ArrayBuffer; | Added|
| ohos.net.http | HttpRequestOptions | method?: RequestMethod; | Added|
| ohos.net.http | http | function createHttp(): HttpRequest; | Added|
| ohos.net.connection | NetAddress | port?: number; | Added|
| ohos.net.connection | NetAddress | family?: number; | Added|
| ohos.net.connection | NetAddress | address: string; | Added|
| ohos.net.connection | LinkAddress | prefixLength: number; | Added|
| ohos.net.connection | LinkAddress | address: NetAddress; | Added|
| ohos.net.connection | RouteInfo | isDefaultRoute: boolean; | Added|
| ohos.net.connection | RouteInfo | hasGateway: boolean; | Added|
| ohos.net.connection | RouteInfo | gateway: NetAddress; | Added|
| ohos.net.connection | RouteInfo | destination: LinkAddress; | Added|
| ohos.net.connection | RouteInfo | interface: string; | Added|
| ohos.net.connection | ConnectionProperties | mtu: number; | Added|
| ohos.net.connection | ConnectionProperties | routes: Array<RouteInfo>; | Added|
| ohos.net.connection | ConnectionProperties | dnses: Array<NetAddress>; | Added|
| ohos.net.connection | ConnectionProperties | linkAddresses: Array<LinkAddress>; | Added|
| ohos.net.connection | ConnectionProperties | domains: string; | Added|
| ohos.net.connection | ConnectionProperties | interfaceName: string; | Added|
| ohos.net.connection | NetBearType | BEARER_ETHERNET = 3 | Added|
| ohos.net.connection | NetBearType | BEARER_WIFI = 1 | Added|
| ohos.net.connection | NetBearType | BEARER_CELLULAR = 0 | Added|
| ohos.net.connection | NetCap | NET_CAPABILITY_VALIDATED = 16 | Added|
| ohos.net.connection | NetCap | NET_CAPABILITY_NOT_VPN = 15 | Added|
| ohos.net.connection | NetCap | NET_CAPABILITY_INTERNET = 12 | Added|
| ohos.net.connection | NetCap | NET_CAPABILITY_NOT_METERED = 11 | Added|
| ohos.net.connection | NetCap | NET_CAPABILITY_MMS = 0 | Added|
| ohos.net.connection | NetCapabilities | bearerTypes: Array<NetBearType>; | Added|
| ohos.net.connection | NetCapabilities | networkCap?: Array<NetCap>; | Added|
| ohos.net.connection | NetCapabilities | linkDownBandwidthKbps?: number; | Added|
| ohos.net.connection | NetCapabilities | linkUpBandwidthKbps?: number; | Added|
| ohos.net.connection | NetHandle | getAddressByName(host: string, callback: AsyncCallback<NetAddress>): void;<br>getAddressByName(host: string): Promise<NetAddress>; | Added|
| ohos.net.connection | NetHandle | getAddressesByName(host: string, callback: AsyncCallback<Array<NetAddress>>): void;<br>getAddressesByName(host: string): Promise<Array<NetAddress>>; | Added|
| ohos.net.connection | NetHandle | netId: number; | Added|
| ohos.net.connection | NetSpecifier | bearerPrivateIdentifier?: string; | Added|
| ohos.net.connection | NetSpecifier | netCapabilities: NetCapabilities; | Added|
| ohos.net.connection | NetConnection | unregister(callback: AsyncCallback<void>): void; | Added|
| ohos.net.connection | NetConnection | register(callback: AsyncCallback<void>): void; | Added|
| ohos.net.connection | NetConnection | on(type: 'netUnavailable', callback: Callback<void>): void; | Added|
| ohos.net.connection | NetConnection | on(type: 'netLost', callback: Callback<NetHandle>): void; | Added|
| ohos.net.connection | NetConnection | on(type: 'netConnectionPropertiesChange', callback: Callback<{ netHandle: NetHandle, connectionProperties: ConnectionProperties }>): void; | Added|
| ohos.net.connection | NetConnection | on(type: 'netCapabilitiesChange', callback: Callback<{ netHandle: NetHandle, netCap: NetCapabilities }>): void; | Added|
| ohos.net.connection | NetConnection | on(type: 'netBlockStatusChange', callback: Callback<{ netHandle: NetHandle, blocked: boolean }>): void; | Added|
| ohos.net.connection | NetConnection | on(type: 'netAvailable', callback: Callback<NetHandle>): void; | Added|
| ohos.net.connection | connection | function getAddressesByName(host: string, callback: AsyncCallback<Array<NetAddress>>): void;<br>function getAddressesByName(host: string): Promise<Array<NetAddress>>; | Added|
| ohos.net.connection | connection | function reportNetDisconnected(netHandle: NetHandle, callback: AsyncCallback<void>): void;<br>function reportNetDisconnected(netHandle: NetHandle): Promise<void>; | Added|
| ohos.net.connection | connection | function reportNetConnected(netHandle: NetHandle, callback: AsyncCallback<void>): void;<br>function reportNetConnected(netHandle: NetHandle): Promise<void>; | Added|
| ohos.net.connection | connection | function hasDefaultNet(callback: AsyncCallback<boolean>): void;<br>function hasDefaultNet(): Promise<boolean>; | Added|
| ohos.net.connection | connection | function getNetCapabilities(netHandle: NetHandle, callback: AsyncCallback<NetCapabilities>): void;<br>function getNetCapabilities(netHandle: NetHandle): Promise<NetCapabilities>; | Added|
| ohos.net.connection | connection | function getConnectionProperties(netHandle: NetHandle, callback: AsyncCallback<ConnectionProperties>): void;<br>function getConnectionProperties(netHandle: NetHandle): Promise<ConnectionProperties>; | Added|
| ohos.net.connection | connection | function getAllNets(callback: AsyncCallback<Array<NetHandle>>): void;<br>function getAllNets(): Promise<Array<NetHandle>>; | Added|
| ohos.net.connection | connection | function getDefaultNet(callback: AsyncCallback<NetHandle>): void;<br>function getDefaultNet(): Promise<NetHandle>; | Added|
| ohos.net.connection | connection | function createNetConnection(netSpecifier?: NetSpecifier, timeout?: number): NetConnection; | Added|
# JS API Changes of the Resource Scheduling Subsystem
The table below lists the APIs changes of the resource scheduling subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.reminderAgent | LocalDateTime | second?: number; | Added|
| ohos.reminderAgent | LocalDateTime | minute: number; | Added|
| ohos.reminderAgent | LocalDateTime | hour: number; | Added|
| ohos.reminderAgent | LocalDateTime | day: number; | Added|
| ohos.reminderAgent | LocalDateTime | month: number; | Added|
| ohos.reminderAgent | LocalDateTime | year: number; | Added|
| ohos.reminderAgent | ReminderRequestTimer | triggerTimeInSeconds: number; | Added|
| ohos.reminderAgent | ReminderRequestAlarm | daysOfWeek?: Array<number>; | Added|
| ohos.reminderAgent | ReminderRequestAlarm | minute: number; | Added|
| ohos.reminderAgent | ReminderRequestAlarm | hour: number; | Added|
| ohos.reminderAgent | ReminderRequestCalendar | repeatDays?: Array<number>; | Added|
| ohos.reminderAgent | ReminderRequestCalendar | repeatMonths?: Array<number>; | Added|
| ohos.reminderAgent | ReminderRequestCalendar | dateTime: LocalDateTime; | Added|
| ohos.reminderAgent | ReminderRequest | slotType?: notification.SlotType; | Added|
| ohos.reminderAgent | ReminderRequest | notificationId?: number; | Added|
| ohos.reminderAgent | ReminderRequest | snoozeContent?: string; | Added|
| ohos.reminderAgent | ReminderRequest | expiredContent?: string; | Added|
| ohos.reminderAgent | ReminderRequest | content?: string; | Added|
| ohos.reminderAgent | ReminderRequest | title?: string; | Added|
| ohos.reminderAgent | ReminderRequest | timeInterval?: number; | Added|
| ohos.reminderAgent | ReminderRequest | snoozeTimes?: number; | Added|
| ohos.reminderAgent | ReminderRequest | ringDuration?: number; | Added|
| ohos.reminderAgent | ReminderRequest | maxScreenWantAgent?: MaxScreenWantAgent; | Added|
| ohos.reminderAgent | ReminderRequest | wantAgent?: WantAgent; | Added|
| ohos.reminderAgent | ReminderRequest | actionButton?: [ActionButton?, ActionButton?]; | Added|
| ohos.reminderAgent | ReminderRequest | reminderType: ReminderType; | Added|
| ohos.reminderAgent | MaxScreenWantAgent | abilityName: string; | Added|
| ohos.reminderAgent | MaxScreenWantAgent | pkgName: string; | Added|
| ohos.reminderAgent | WantAgent | abilityName: string; | Added|
| ohos.reminderAgent | WantAgent | pkgName: string; | Added|
| ohos.reminderAgent | ActionButton | type: ActionButtonType; | Added|
| ohos.reminderAgent | ActionButton | title: string; | Added|
| ohos.reminderAgent | ReminderType | REMINDER_TYPE_ALARM = 2 | Added|
| ohos.reminderAgent | ReminderType | REMINDER_TYPE_CALENDAR = 1 | Added|
| ohos.reminderAgent | ReminderType | REMINDER_TYPE_TIMER = 0 | Added|
| ohos.reminderAgent | ActionButtonType | ACTION_BUTTON_TYPE_SNOOZE = 1 | Added|
| ohos.reminderAgent | ActionButtonType | ACTION_BUTTON_TYPE_CLOSE = 0 | Added|
| ohos.reminderAgent | reminderAgent | function removeNotificationSlot(slotType: notification.SlotType, callback: AsyncCallback<void>): void;<br>function removeNotificationSlot(slotType: notification.SlotType): Promise<void>; | Added|
| ohos.reminderAgent | reminderAgent | function addNotificationSlot(slot: NotificationSlot, callback: AsyncCallback<void>): void;<br>function addNotificationSlot(slot: NotificationSlot): Promise<void>; | Added|
| ohos.reminderAgent | reminderAgent | function cancelAllReminders(callback: AsyncCallback<void>): void;<br>function cancelAllReminders(): Promise<void>; | Added|
| ohos.reminderAgent | reminderAgent | function getValidReminders(callback: AsyncCallback<Array<ReminderRequest>>): void;<br>function getValidReminders(): Promise<Array<ReminderRequest>>; | Added|
| ohos.reminderAgent | reminderAgent | function cancelReminder(reminderId: number, callback: AsyncCallback<void>): void;<br>function cancelReminder(reminderId: number): Promise<void>; | Added|
| ohos.reminderAgent | reminderAgent | function publishReminder(reminderReq: ReminderRequest, callback: AsyncCallback<number>): void;<br>function publishReminder(reminderReq: ReminderRequest): Promise<number>; | Added|
| ohos.bundleState | bundleState | function queryCurrentBundleActiveStates(begin: number, end: number, callback: AsyncCallback<Array<BundleActiveState>>): void;<br>function queryCurrentBundleActiveStates(begin: number, end: number): Promise<Array<BundleActiveState>>; | Added|
| ohos.bundleState | IntervalType | BY_ANNUALLY = 4 | Added|
| ohos.bundleState | IntervalType | BY_MONTHLY = 3 | Added|
| ohos.bundleState | IntervalType | BY_WEEKLY = 2 | Added|
| ohos.bundleState | IntervalType | BY_DAILY = 1 | Added|
| ohos.bundleState | IntervalType | BY_OPTIMIZED = 0 | Added|
| ohos.bundleState | BundleActiveInfoResponse | [key: string]: BundleStateInfo; | Added|
| ohos.bundleState | bundleState | function queryAppUsagePriorityGroup(callback: AsyncCallback<number>): void;<br>function queryAppUsagePriorityGroup(): Promise<number>; | Added|
| ohos.bundleState | bundleState | function isIdleState(bundleName: string, callback: AsyncCallback<boolean>): void;<br>function isIdleState(bundleName: string): Promise<boolean>; | Added|
| ohos.bundleState | BundleActiveState | stateType?: number; | Added|
| ohos.bundleState | BundleActiveState | stateOccurredTime?: number; | Added|
| ohos.bundleState | BundleActiveState | nameOfClass?: string; | Added|
| ohos.bundleState | BundleActiveState | indexOfLink?: string; | Added|
| ohos.bundleState | BundleActiveState | bundleName?: string; | Added|
| ohos.bundleState | BundleActiveState | appUsagePriorityGroup?: number; | Added|
| ohos.bundleState | BundleStateInfo | merge(toMerge: BundleStateInfo): void; | Added|
| ohos.bundleState | BundleStateInfo | infosEndTime?: number; | Added|
| ohos.bundleState | BundleStateInfo | infosBeginTime?: number; | Added|
| ohos.bundleState | BundleStateInfo | fgAbilityPrevAccessTime?: number; | Added|
| ohos.bundleState | BundleStateInfo | fgAbilityAccessTotalTime?: number; | Added|
| ohos.bundleState | BundleStateInfo | bundleName?: string; | Added|
| ohos.bundleState | BundleStateInfo | abilitySeenTotalTime?: number; | Added|
| ohos.bundleState | BundleStateInfo | abilityPrevSeenTime?: number; | Added|
| ohos.bundleState | BundleStateInfo | abilityPrevAccessTime?: number; | Added|
| ohos.bundleState | BundleStateInfo | abilityInFgTotalTime?: number; | Added|
| ohos.bundleState | BundleStateInfo | id: number; | Added|
| ohos.backgroundTaskManager | BackgroundMode | TASK_KEEPING = 9 | Added|
| ohos.backgroundTaskManager | BackgroundMode | MULTI_DEVICE_CONNECTION = 6 | Added|
| ohos.backgroundTaskManager | BackgroundMode | BLUETOOTH_INTERACTION = 5 | Added|
| ohos.backgroundTaskManager | BackgroundMode | LOCATION = 4 | Added|
| ohos.backgroundTaskManager | BackgroundMode | AUDIO_RECORDING = 3 | Added|
| ohos.backgroundTaskManager | BackgroundMode | AUDIO_PLAYBACK = 2 | Added|
| ohos.backgroundTaskManager | BackgroundMode | DATA_TRANSFER = 1 | Added|
| ohos.backgroundTaskManager | backgroundTaskManager | function stopBackgroundRunning(context: Context, callback: AsyncCallback<void>): void;<br>function stopBackgroundRunning(context: Context): Promise<void>; | Added|
| ohos.backgroundTaskManager | backgroundTaskManager | function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent, callback: AsyncCallback<void>): void;<br>function startBackgroundRunning(context: Context, bgMode: BackgroundMode, wantAgent: WantAgent): Promise<void>; | Added|
| ohos.backgroundTaskManager | backgroundTaskManager | function requestSuspendDelay(reason: string, callback: Callback<void>): DelaySuspendInfo; | Added|
| ohos.backgroundTaskManager | backgroundTaskManager | function getRemainingDelayTime(requestId: number, callback: AsyncCallback<number>): void;<br>function getRemainingDelayTime(requestId: number): Promise<number>; | Added|
| ohos.backgroundTaskManager | backgroundTaskManager | function cancelSuspendDelay(requestId: number): void; | Added|
| ohos.backgroundTaskManager | DelaySuspendInfo | actualDelayTime: number; | Added|
| ohos.backgroundTaskManager | DelaySuspendInfo | requestId: number; | Added|
# JS API Changes of the Pan-Sensor Subsystem
The table below lists the APIs changes of the pan-sensor subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.vibrator | VibratorStopMode | VIBRATOR_STOP_MODE_PRESET = "preset" | Added|
| ohos.vibrator | VibratorStopMode | VIBRATOR_STOP_MODE_TIME = "time" | Added|
| ohos.vibrator | EffectId | EFFECT_CLOCK_TIMER = "haptic.clock.timer" | Added|
| ohos.vibrator | vibrator | function stop(stopMode: VibratorStopMode): Promise<void>;<br>function stop(stopMode: VibratorStopMode, callback?: AsyncCallback<void>): void; | Added|
| ohos.vibrator | vibrator | function vibrate(duration: number, callback?: AsyncCallback<void>): void;<br>function vibrate(duration: number): Promise<void>;<br>function vibrate(effectId: EffectId): Promise<void>;<br>function vibrate(effectId: EffectId, callback?: AsyncCallback<void>): void; | Added|
| ohos.sensor | WearDetectionResponse | value: number; | Added|
| ohos.sensor | HeartRateResponse | heartRate: number; | Added|
| ohos.sensor | BarometerResponse | pressure: number; | Added|
| ohos.sensor | AmbientTemperatureResponse | temperature: number; | Added|
| ohos.sensor | PedometerDetectionResponse | scalar: number; | Added|
| ohos.sensor | HumidityResponse | humidity: number; | Added|
| ohos.sensor | PedometerResponse | steps: number; | Added|
| ohos.sensor | MagneticFieldUncalibratedResponse | biasZ: number; | Added|
| ohos.sensor | MagneticFieldUncalibratedResponse | biasY: number; | Added|
| ohos.sensor | MagneticFieldUncalibratedResponse | biasX: number; | Added|
| ohos.sensor | MagneticFieldUncalibratedResponse | z: number; | Added|
| ohos.sensor | MagneticFieldUncalibratedResponse | y: number; | Added|
| ohos.sensor | MagneticFieldUncalibratedResponse | x: number; | Added|
| ohos.sensor | MagneticFieldResponse | z: number; | Added|
| ohos.sensor | MagneticFieldResponse | y: number; | Added|
| ohos.sensor | MagneticFieldResponse | x: number; | Added|
| ohos.sensor | HallResponse | status: number; | Added|
| ohos.sensor | LightResponse | intensity: number; | Added|
| ohos.sensor | ProximityResponse | distance: number; | Added|
| ohos.sensor | SignificantMotionResponse | scalar: number; | Added|
| ohos.sensor | GyroscopeUncalibratedResponse | biasZ: number; | Added|
| ohos.sensor | GyroscopeUncalibratedResponse | biasY: number; | Added|
| ohos.sensor | GyroscopeUncalibratedResponse | biasX: number; | Added|
| ohos.sensor | GyroscopeUncalibratedResponse | z: number; | Added|
| ohos.sensor | GyroscopeUncalibratedResponse | y: number; | Added|
| ohos.sensor | GyroscopeUncalibratedResponse | x: number; | Added|
| ohos.sensor | GyroscopeResponse | z: number; | Added|
| ohos.sensor | GyroscopeResponse | y: number; | Added|
| ohos.sensor | GyroscopeResponse | x: number; | Added|
| ohos.sensor | RotationVectorResponse | w: number; | Added|
| ohos.sensor | RotationVectorResponse | z: number; | Added|
| ohos.sensor | RotationVectorResponse | y: number; | Added|
| ohos.sensor | RotationVectorResponse | x: number; | Added|
| ohos.sensor | OrientationResponse | gamma: number; | Added|
| ohos.sensor | OrientationResponse | beta: number; | Added|
| ohos.sensor | OrientationResponse | alpha: number; | Added|
| ohos.sensor | GravityResponse | z: number; | Added|
| ohos.sensor | GravityResponse | y: number; | Added|
| ohos.sensor | GravityResponse | x: number; | Added|
| ohos.sensor | AccelerometerUncalibratedResponse | biasZ: number; | Added|
| ohos.sensor | AccelerometerUncalibratedResponse | biasY: number; | Added|
| ohos.sensor | AccelerometerUncalibratedResponse | biasX: number; | Added|
| ohos.sensor | AccelerometerUncalibratedResponse | z: number; | Added|
| ohos.sensor | AccelerometerUncalibratedResponse | y: number; | Added|
| ohos.sensor | AccelerometerUncalibratedResponse | x: number; | Added|
| ohos.sensor | LinearAccelerometerResponse | z: number; | Added|
| ohos.sensor | LinearAccelerometerResponse | y: number; | Added|
| ohos.sensor | LinearAccelerometerResponse | x: number; | Added|
| ohos.sensor | AccelerometerResponse | z: number; | Added|
| ohos.sensor | AccelerometerResponse | y: number; | Added|
| ohos.sensor | AccelerometerResponse | x: number; | Added|
| ohos.sensor | Response | timestamp: number; | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED = 281 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_WEAR_DETECTION = 280 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_HEART_RATE = 278 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_PEDOMETER = 266 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_PEDOMETER_DETECTION = 265 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_SIGNIFICANT_MOTION = 264 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED = 263 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED = 261 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_AMBIENT_TEMPERATURE = 260 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_ROTATION_VECTOR = 259 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_LINEAR_ACCELERATION = 258 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_GRAVITY = 257 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_ORIENTATION = 256 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_HUMIDITY = 13 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_PROXIMITY = 12 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_HALL = 10 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_BAROMETER = 8 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_MAGNETIC_FIELD = 6 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_AMBIENT_LIGHT = 5 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_GYROSCOPE = 2 | Added|
| ohos.sensor | SensorType | SENSOR_TYPE_ID_ACCELEROMETER = 1 | Added|
| ohos.sensor | Options | interval?: number; | Added|
| ohos.sensor | RotationMatrixResponse | inclination: Array<number> | Added|
| ohos.sensor | RotationMatrixResponse | rotation: Array<number>; | Added|
| ohos.sensor | sensor | function getDirection(rotationMatrix: Array<number>, callback: AsyncCallback<Array<number>>): void;<br>function getDirection(rotationMatrix: Array<number>): Promise<Array<number>>; | Added|
| ohos.sensor | sensor | function createQuaternion(rotationVector: Array<number>, callback: AsyncCallback<Array<number>>): void;<br>function createQuaternion(rotationVector: Array<number>): Promise<Array<number>>; | Added|
| ohos.sensor | sensor | function transformCoordinateSystem(inRotationVector: Array<number>, coordinates: CoordinatesOptions, callback: AsyncCallback<Array<number>>): void;<br>function transformCoordinateSystem(inRotationVector: Array<number>, coordinates: CoordinatesOptions): Promise<Array<number>>; | Added|
| ohos.sensor | CoordinatesOptions | y: number; | Added|
| ohos.sensor | CoordinatesOptions | x: number; | Added|
| ohos.sensor | sensor | function createRotationMatrix(rotationVector: Array<number>, callback: AsyncCallback<Array<number>>): void;<br>function createRotationMatrix(rotationVector: Array<number>): Promise<Array<number>>;<br>function createRotationMatrix(gravity: Array<number>, geomagnetic: Array<number>, callback: AsyncCallback<RotationMatrixResponse>): void;<br>function createRotationMatrix(gravity: Array<number>, geomagnetic: Array<number>,): Promise<RotationMatrixResponse>; | Added|
| ohos.sensor | sensor | function getAngleModify(currentRotationMatrix: Array<number>, preRotationMatrix: Array<number>, callback: AsyncCallback<Array<number>>): void;<br>function getAngleModify(currentRotationMatrix: Array<number>, preRotationMatrix: Array<number>): Promise<Array<number>>;| Added|
| ohos.sensor | sensor | function getGeomagneticDip(inclinationMatrix: Array<number>, callback: AsyncCallback<number>): void;<br>function getGeomagneticDip(inclinationMatrix: Array<number>): Promise<number>; | Added|
| ohos.sensor | sensor | function getAltitude(seaPressure: number, currentPressure: number, callback: AsyncCallback<number>): void;<br>function getAltitude(seaPressure: number, currentPressure: number): Promise<number>; | Added|
| ohos.sensor | sensor | function getGeomagneticField(locationOptions: LocationOptions, timeMillis: number, callback: AsyncCallback<GeomagneticResponse>): void;<br>function getGeomagneticField(locationOptions: LocationOptions, timeMillis: number): Promise<GeomagneticResponse>; | Added|
| ohos.sensor | GeomagneticResponse | totalIntensity: number; | Added|
| ohos.sensor | GeomagneticResponse | levelIntensity: number; | Added|
| ohos.sensor | GeomagneticResponse | deflectionAngle: number; | Added|
| ohos.sensor | GeomagneticResponse | geomagneticDip: number; | Added|
| ohos.sensor | GeomagneticResponse | z: number; | Added|
| ohos.sensor | GeomagneticResponse | y: number; | Added|
| ohos.sensor | GeomagneticResponse | x: number; | Added|
| ohos.sensor | LocationOptions | altitude: number; | Added|
| ohos.sensor | LocationOptions | longitude: number; | Added|
| ohos.sensor | LocationOptions | latitude: number; | Added|
| ohos.sensor | sensor | function off(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback?: Callback<AccelerometerResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback?: Callback<AccelerometerUncalibratedResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback?: Callback<LightResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback?: Callback<AmbientTemperatureResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback?: Callback<BarometerResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback?: Callback<GravityResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback?: Callback<GyroscopeResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback?: Callback<GyroscopeUncalibratedResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_HALL, callback?: Callback<HallResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback?: Callback<HeartRateResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback?: Callback<HumidityResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback?: Callback<LinearAccelerometerResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback?: Callback<MagneticFieldResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback?: Callback<MagneticFieldUncalibratedResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback?: Callback<OrientationResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback?: Callback<PedometerResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback?: Callback<PedometerDetectionResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback?: Callback<ProximityResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback?: Callback<RotationVectorResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback?: Callback<SignificantMotionResponse>): void;<br>function off(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback?: Callback<WearDetectionResponse>): void;| Added|
| ohos.sensor | sensor | function once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback<AccelerometerResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback: Callback<AccelerometerUncalibratedResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: Callback<LightResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback: Callback<AmbientTemperatureResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: Callback<BarometerResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: Callback<GravityResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback<GyroscopeResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback: Callback<GyroscopeUncalibratedResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_HALL, callback: Callback<HallResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback<HeartRateResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: Callback<HumidityResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback: Callback<LinearAccelerometerResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: Callback<MagneticFieldResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback: Callback<MagneticFieldUncalibratedResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback<OrientationResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: Callback<PedometerResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: Callback<PedometerDetectionResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: Callback<ProximityResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: Callback<RotationVectorResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: Callback<SignificantMotionResponse>): void;<br>function once(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: Callback<WearDetectionResponse>): void; | Added|
| ohos.sensor | sensor | function on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER, callback: Callback<AccelerometerResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_ACCELEROMETER_UNCALIBRATED, callback: Callback<AccelerometerUncalibratedResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_AMBIENT_LIGHT, callback: Callback<LightResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_AMBIENT_TEMPERATURE, callback: Callback<AmbientTemperatureResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_BAROMETER, callback: Callback<BarometerResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_GRAVITY, callback: Callback<GravityResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE, callback: Callback<GyroscopeResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_GYROSCOPE_UNCALIBRATED, callback: Callback<GyroscopeUncalibratedResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_HALL, callback: Callback<HallResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_HEART_RATE, callback: Callback<HeartRateResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_HUMIDITY, callback: Callback<HumidityResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_LINEAR_ACCELERATION, callback: Callback<LinearAccelerometerResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD, callback: Callback<MagneticFieldResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_MAGNETIC_FIELD_UNCALIBRATED, callback: Callback<MagneticFieldUncalibratedResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_ORIENTATION, callback: Callback<OrientationResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER, callback: Callback<PedometerResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_PEDOMETER_DETECTION, callback: Callback<PedometerDetectionResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_PROXIMITY, callback: Callback<ProximityResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_ROTATION_VECTOR, callback: Callback<RotationVectorResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_SIGNIFICANT_MOTION, callback: Callback<SignificantMotionResponse>, options?: Options): void;<br>function on(type: SensorType.SENSOR_TYPE_ID_WEAR_DETECTION, callback: Callback<WearDetectionResponse>, options?: Options): void; | Added|
# JS API Changes of the Application Framework Subsystem
The table below lists the APIs changes of the application framework subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.settings | settings | function setValueSync(dataAbilityHelper: DataAbilityHelper, name: string, value: string): boolean; | Added|
| ohos.settings | settings | function getValueSync(dataAbilityHelper: DataAbilityHelper, name: string, defValue: string): string; | Added|
| ohos.settings | settings | function getUriSync(name: string): string; | Added|
| ohos.settings | settings | function canShowFloating(callback: AsyncCallback<boolean>): void;<br>function canShowFloating(): Promise<boolean>; | Added|
| ohos.settings | settings | function enableAirplaneMode(enable: boolean, callback: AsyncCallback<void>): void;<br>function enableAirplaneMode(enable: boolean): Promise<void>; | Added|
| ohos.settings | settings | function getValue(dataAbilityHelper: DataAbilityHelper, name: string, callback: AsyncCallback<object>): void;<br>function getValue(dataAbilityHelper: DataAbilityHelper, name: string): Promise<object>; | Added|
| ohos.settings | settings | function getURI(name: string, callback: AsyncCallback<object>): void;<br>function getURI(name: string): Promise<object>; | Added|
| ohos.settings | wireless | const WIFI_WATCHDOG_STATUS: string | Added|
| ohos.settings | wireless | const WIFI_STATUS: string | Added|
| ohos.settings | wireless | const WIFI_TO_MOBILE_DATA_AWAKE_TIMEOUT: string | Added|
| ohos.settings | wireless | const WIFI_DHCP_MAX_RETRY_COUNT: string | Added|
| ohos.settings | wireless | const OWNER_LOCKDOWN_WIFI_CFG: string | Added|
| ohos.settings | wireless | const WIFI_RADIO: string | Added|
| ohos.settings | wireless | const NFC_RADIO: string | Added|
| ohos.settings | wireless | const CELL_RADIO: string | Added|
| ohos.settings | wireless | const BLUETOOTH_RADIO: string | Added|
| ohos.settings | wireless | const BLUETOOTH_STATUS: string | Added|
| ohos.settings | wireless | const AIRPLANE_MODE_RADIOS: string | Added|
| ohos.settings | wireless | const BLUETOOTH_DISCOVER_TIMEOUT: string | Added|
| ohos.settings | wireless | const BLUETOOTH_DISCOVER_ABILITY_STATUS: string | Added|
| ohos.settings | TTS | const ENABLED_TTS_PLUGINS: string | Added|
| ohos.settings | TTS | const DEFAULT_TTS_SYNTH: string | Added|
| ohos.settings | TTS | const DEFAULT_TTS_RATE: string | Added|
| ohos.settings | TTS | const DEFAULT_TTS_PITCH: string | Added|
| ohos.settings | sound | const HAPTIC_FEEDBACK_STATUS: string | Added|
| ohos.settings | sound | const VIBRATE_STATUS: string | Added|
| ohos.settings | sound | const SOUND_EFFECTS_STATUS: string | Added|
| ohos.settings | sound | const DEFAULT_RINGTONE: string | Added|
| ohos.settings | sound | const DEFAULT_NOTIFICATION_SOUND: string | Added|
| ohos.settings | sound | const AFFECTED_MUTE_STREAMS: string | Added|
| ohos.settings | sound | const AFFECTED_MODE_RINGER_STREAMS: string | Added|
| ohos.settings | sound | const DTMF_TONE_WHILE_DIALING: string | Added|
| ohos.settings | sound | const DTMF_TONE_TYPE_WHILE_DIALING: string | Added|
| ohos.settings | sound | const DEFAULT_ALARM_ALERT: string | Added|
| ohos.settings | sound | const VIBRATE_WHILE_RINGING: string | Added|
| ohos.settings | phone | const RTT_CALLING_STATUS: string | Added|
| ohos.settings | network | const NETWORK_PREFERENCE_USAGE: string | Added|
| ohos.settings | network | const HTTP_PROXY_CFG: string | Added|
| ohos.settings | network | const DATA_ROAMING_STATUS: string | Added|
| ohos.settings | input | const SHOW_PASSWORD_TEXT_INPUT: string | Added|
| ohos.settings | input | const AUTO_REPLACE_TEXT_INPUT: string | Added|
| ohos.settings | input | const AUTO_PUNCTUATE_TEXT_INPUT: string | Added|
| ohos.settings | input | const AUTO_CAPS_TEXT_INPUT: string | Added|
| ohos.settings | input | const SELECTOR_VISIBILITY_FOR_INPUT_METHOD: string | Added|
| ohos.settings | input | const ACTIVATED_INPUT_METHODS: string | Added|
| ohos.settings | input | const ACTIVATED_INPUT_METHOD_SUB_MODE: string | Added|
| ohos.settings | input | const DEFAULT_INPUT_METHOD: string | Added|
| ohos.settings | general | const TOUCH_EXPLORATION_STATUS: string | Added|
| ohos.settings | general | const SKIP_USE_HINTS: string | Added|
| ohos.settings | general | const GEOLOCATION_ORIGINS_ALLOWED: string | Added|
| ohos.settings | general | const ACTIVATED_ACCESSIBILITY_SERVICES: string | Added|
| ohos.settings | general | const ACCESSIBILITY_STATUS: string | Added|
| ohos.settings | general | const DEBUG_APP_PACKAGE: string | Added|
| ohos.settings | general | const DEBUGGER_WAITING: string | Added|
| ohos.settings | general | const USB_STORAGE_STATUS: string | Added|
| ohos.settings | general | const DEVICE_NAME: string | Added|
| ohos.settings | general | const DEVELOPMENT_SETTINGS_STATUS: string | Added|
| ohos.settings | general | const CONTACT_METADATA_SYNC_STATUS: string | Added|
| ohos.settings | general | const BOOT_COUNTING: string | Added|
| ohos.settings | general | const HDC_STATUS: string | Added|
| ohos.settings | general | const DEVICE_PROVISION_STATUS: string | Added|
| ohos.settings | general | const AIRPLANE_MODE_STATUS: string | Added|
| ohos.settings | general | const ACCELEROMETER_ROTATION_STATUS: string | Added|
| ohos.settings | general | const END_BUTTON_ACTION: string | Added|
| ohos.settings | general | const SETUP_WIZARD_FINISHED: string | Added|
| ohos.settings | display | const DISPLAY_INVERSION_STATUS: string | Added|
| ohos.settings | display | const WINDOW_ANIMATION_SCALE: string | Added|
| ohos.settings | display | const TRANSITION_ANIMATION_SCALE: string | Added|
| ohos.settings | display | const ANIMATOR_DURATION_SCALE: string | Added|
| ohos.settings | display | const DEFAULT_SCREEN_ROTATION: string | Added|
| ohos.settings | display | const SCREEN_OFF_TIMEOUT: string | Added|
| ohos.settings | display | const MANUAL_SCREEN_BRIGHTNESS_MODE: number | Added|
| ohos.settings | display | const AUTO_SCREEN_BRIGHTNESS_MODE: number | Added|
| ohos.settings | display | const AUTO_SCREEN_BRIGHTNESS: string | Added|
| ohos.settings | display | const SCREEN_BRIGHTNESS_STATUS: string | Added|
| ohos.settings | display | const FONT_SCALE: string | Added|
| ohos.settings | date | const AUTO_GAIN_TIME_ZONE: string | Added|
| ohos.settings | date | const AUTO_GAIN_TIME: string | Added|
| ohos.settings | date | const TIME_FORMAT: string | Added|
| ohos.settings | date | const DATE_FORMAT: string | Added|
# JS API Changes of the DSoftBus Subsystem
The table below lists the APIs changes of the DSoftBus subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.rpc | Ashmem | readFromAshmem(size: number, offset: number): number[]; | Added|
| ohos.rpc | Ashmem | writeToAshmem(buf: number[], size: number, offset: number): boolean; | Added|
| ohos.rpc | Ashmem | setProtection(protectionType: number): boolean; | Added|
| ohos.rpc | Ashmem | mapReadOnlyAshmem(): boolean; | Added|
| ohos.rpc | Ashmem | mapReadAndWriteAshmem(): boolean; | Added|
| ohos.rpc | Ashmem | mapAshmem(mapType: number): boolean; | Added|
| ohos.rpc | Ashmem | getAshmemSize(): number; | Added|
| ohos.rpc | Ashmem | unmapAshmem(): void; | Added|
| ohos.rpc | Ashmem | closeAshmem(): void; | Added|
| ohos.rpc | Ashmem | static createAshmemFromExisting(ashmem: Ashmem): Ashmem; | Added|
| ohos.rpc | Ashmem | static createAshmem(name: string, size: number): Ashmem; | Added|
| ohos.rpc | Ashmem | PROT_WRITE = 2; | Added|
| ohos.rpc | Ashmem | PROT_READ = 1; | Added|
| ohos.rpc | Ashmem | PROT_NONE = 0; | Added|
| ohos.rpc | Ashmem | PROT_EXEC = 4; | Added|
| ohos.rpc | IPCSkeleton | static getCallingTokenId(): number; | Added|
| ohos.rpc | SendRequestResult | reply: MessageParcel; | Added|
| ohos.rpc | SendRequestResult | data: MessageParcel; | Added|
| ohos.rpc | SendRequestResult | code: number; | Added|
| ohos.rpc | SendRequestResult | errCode: number; | Added|
| ohos.rpc | MessageParcel | readRawData(size: number): number[]; | Added|
| ohos.rpc | MessageParcel | writeRawData(rawData: number[], size: number): boolean; | Added|
| ohos.rpc | MessageParcel | getRawDataCapacity(): number; | Added|
| ohos.rpc | MessageParcel | readAshmem(): Ashmem; | Added|
| ohos.rpc | MessageParcel | writeAshmem(ashmem: Ashmem): boolean; | Added|
| ohos.rpc | MessageParcel | readFileDescriptor(): number; | Added|
| ohos.rpc | MessageParcel | writeFileDescriptor(fd: number): boolean; | Added|
| ohos.rpc | MessageParcel | containFileDescriptors(): boolean; | Added|
| ohos.rpc | MessageParcel | static dupFileDescriptor(fd: number) :number; | Added|
| ohos.rpc | MessageParcel | static closeFileDescriptor(fd: number): void; | Added|
| ohos.rpc | MessageParcel | readRemoteObjectArray(objects: IRemoteObject[]): void;<br>readRemoteObjectArray(): IRemoteObject[]; | Added|
| ohos.rpc | MessageParcel | readSequenceableArray(sequenceableArray: Sequenceable[]): void; | Added|
| ohos.rpc | MessageParcel | writeRemoteObjectArray(objectArray: IRemoteObject[]): boolean; | Added|
| ohos.rpc | MessageParcel | readException(): void; | Added|
| ohos.rpc | MessageParcel | writeNoException(): void; | Added|
# JS API Changes of the Testing Framework Subsystem
The table below lists the APIs changes of the testing framework subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.uitest | UiDriver | screenCap(savePath:string):Promise<bool>; | Added|
| ohos.uitest | UiDriver | swipe(startx:number,starty:number,endx:number,endy:number):Promise<void>; | Added|
| ohos.uitest | UiDriver | longClick(x:number,y:number):Promise<void>; | Added|
| ohos.uitest | UiDriver | doubleClick(x:number,y:number):Promise<void>; | Added|
| ohos.uitest | UiDriver | click(x:number,y:number):Promise<void>; | Added|
| ohos.uitest | UiDriver | triggerKey(keyCode:number):Promise<void>; | Added|
| ohos.uitest | UiDriver | pressBack():Promise<void>; | Added|
| ohos.uitest | UiDriver | assertComponentExist(by:By):Promise<void>; | Added|
| ohos.uitest | UiDriver | findComponents(by:By):Promise<Array<UiComponent>>; | Added|
| ohos.uitest | UiDriver | findComponent(by:By):Promise<UiComponent>; | Added|
| ohos.uitest | UiDriver | delayMs(duration:number):Promise<void>; | Added|
| ohos.uitest | UiDriver | static create():UiDriver; | Added|
| ohos.uitest | UiComponent | scrollSearch(by:By):Promise<UiComponent>; | Added|
| ohos.uitest | UiComponent | inputText(text: string):Promise<void>; | Added|
| ohos.uitest | UiComponent | isSelected():Promise<bool>; | Added|
| ohos.uitest | UiComponent | isFocused():Promise<bool>; | Added|
| ohos.uitest | UiComponent | isEnabled():Promise<bool>; | Added|
| ohos.uitest | UiComponent | isScrollable():Promise<bool>; | Added|
| ohos.uitest | UiComponent | isClickable():Promise<bool>; | Added|
| ohos.uitest | UiComponent | getType():Promise<string>; | Added|
| ohos.uitest | UiComponent | getText():Promise<string>; | Added|
| ohos.uitest | UiComponent | getKey():Promise<string>; | Added|
| ohos.uitest | UiComponent | getId():Promise<number>; | Added|
| ohos.uitest | UiComponent | longClick():Promise<void>; | Added|
| ohos.uitest | UiComponent | doubleClick():Promise<void>; | Added|
| ohos.uitest | UiComponent | click():Promise<void>; | Added|
| ohos.uitest | By | isAfter(by:By):By; | Added|
| ohos.uitest | By | isBefore(by:By):By; | Added|
| ohos.uitest | By | selected(b?:bool):By; | Added|
| ohos.uitest | By | focused(b?:bool):By; | Added|
| ohos.uitest | By | enabled(b?:bool):By; | Added|
| ohos.uitest | By | scrollable(b?:bool):By; | Added|
| ohos.uitest | By | clickable(b?:bool):By; | Added|
| ohos.uitest | By | type(tp:string):By; | Added|
| ohos.uitest | By | id(id:number):By; | Added|
| ohos.uitest | By | key(key:string):By; | Added|
| ohos.uitest | By | text(txt:string,pattern?:MatchPattern):By; | Added|
| ohos.uitest | MatchPattern | ENDS_WITH = 3 | Added|
| ohos.uitest | MatchPattern | STARTS_WITH = 2 | Added|
| ohos.uitest | MatchPattern | CONTAINS = 1 | Added|
| ohos.uitest | MatchPattern | EQUALS = 0 | Added|
# JS API Changes of the USB Subsystem
The table below lists the APIs changes of the USB subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.usb | USBRequestDirection | USB_REQUEST_DIR_FROM_DEVICE = 0x80 | Added|
| ohos.usb | USBRequestDirection | USB_REQUEST_DIR_TO_DEVICE = 0 | Added|
| ohos.usb | USBControlRequestType | USB_REQUEST_TYPE_VENDOR | Added|
| ohos.usb | USBControlRequestType | USB_REQUEST_TYPE_CLASS | Added|
| ohos.usb | USBControlRequestType | USB_REQUEST_TYPE_STANDARD = 0 | Added|
| ohos.usb | USBRequestTargetType | USB_REQUEST_TARGET_OTHER | Added|
| ohos.usb | USBRequestTargetType | USB_REQUEST_TARGET_ENDPOINT | Added|
| ohos.usb | USBRequestTargetType | USB_REQUEST_TARGET_INTERFACE | Added|
| ohos.usb | USBRequestTargetType | USB_REQUEST_TARGET_DEVICE = 0 | Added|
| ohos.usb | USBControlParams | data: Uint8Array; | Added|
| ohos.usb | USBControlParams | index: number; | Added|
| ohos.usb | USBControlParams | value: number; | Added|
| ohos.usb | USBControlParams | reqType: USBControlRequestType; | Added|
| ohos.usb | USBControlParams | target: USBRequestTargetType; | Added|
| ohos.usb | USBControlParams | request: number; | Added|
| ohos.usb | USBDevicePipe | devAddress: number; | Added|
| ohos.usb | USBDevicePipe | busNum: number; | Added|
| ohos.usb | USBDevice | configs: Array<USBConfig>; | Added|
| ohos.usb | USBDevice | protocol: number; | Added|
| ohos.usb | USBDevice | subClass: number; | Added|
| ohos.usb | USBDevice | clazz: number; | Added|
| ohos.usb | USBDevice | productId: number; | Added|
| ohos.usb | USBDevice | vendorId: number; | Added|
| ohos.usb | USBDevice | version: string; | Added|
| ohos.usb | USBDevice | productName: string; | Added|
| ohos.usb | USBDevice | manufacturerName: string; | Added|
| ohos.usb | USBDevice | name: string; | Added|
| ohos.usb | USBDevice | serial: string; | Added|
| ohos.usb | USBDevice | devAddress: number; | Added|
| ohos.usb | USBDevice | busNum: number; | Added|
| ohos.usb | USBConfig | interfaces: Array<USBInterface>; | Added|
| ohos.usb | USBConfig | isSelfPowered: boolean; | Added|
| ohos.usb | USBConfig | isRemoteWakeup: boolean; | Added|
| ohos.usb | USBConfig | name: string; | Added|
| ohos.usb | USBConfig | maxPower: number; | Added|
| ohos.usb | USBConfig | attributes: number; | Added|
| ohos.usb | USBConfig | id: number; | Added|
| ohos.usb | USBInterface | endpoints: Array<USBEndpoint>; | Added|
| ohos.usb | USBInterface | name: string; | Added|
| ohos.usb | USBInterface | alternateSetting: number; | Added|
| ohos.usb | USBInterface | subClass: number; | Added|
| ohos.usb | USBInterface | clazz: number; | Added|
| ohos.usb | USBInterface | protocol: number; | Added|
| ohos.usb | USBInterface | id: number; | Added|
| ohos.usb | USBEndpoint | interfaceId: number; | Added|
| ohos.usb | USBEndpoint | type: number; | Added|
| ohos.usb | USBEndpoint | number: number; | Added|
| ohos.usb | USBEndpoint | direction: USBRequestDirection; | Added|
| ohos.usb | USBEndpoint | maxPacketSize: number; | Added|
| ohos.usb | USBEndpoint | interval: number; | Added|
| ohos.usb | USBEndpoint | attributes: number; | Added|
| ohos.usb | USBEndpoint | address: number; | Added|
| ohos.usb | usb | function closePipe(pipe: USBDevicePipe): number; | Added|
| ohos.usb | usb | function bulkTransfer(pipe: USBDevicePipe, endpoint: USBEndpoint, buffer: Uint8Array,timeout?: number): Promise<number>; | Added|
| ohos.usb | usb | function controlTransfer(pipe: USBDevicePipe, contrlparam: USBControlParams, timeout?: number): Promise<number>; | Added|
| ohos.usb | usb | function getFileDescriptor(pipe: USBDevicePipe): number; | Added|
| ohos.usb | usb | function getRawDescriptor(pipe: USBDevicePipe): Uint8Array; | Added|
| ohos.usb | usb | function setInterface(pipe: USBDevicePipe, iface: USBInterface): number; | Added|
| ohos.usb | usb | function setConfiguration(pipe: USBDevicePipe, config: USBConfig): number; | Added|
| ohos.usb | usb | function releaseInterface(pipe: USBDevicePipe, iface: USBInterface): number; | Added|
| ohos.usb | usb | function claimInterface(pipe: USBDevicePipe, iface: USBInterface, force?: boolean): number; | Added|
| ohos.usb | usb | function requestRight(deviceName: string): Promise<boolean>; | Added|
| ohos.usb | usb | function hasRight(deviceName: string): boolean; | Added|
| ohos.usb | usb | function connectDevice(device: USBDevice): Readonly<USBDevicePipe>; | Added|
| ohos.usb | usb | function getDevices(): Array<Readonly<USBDevice>>; | Added|
# JS API Changes of the User IAM Subsystem
The table below lists the APIs changes of the user IAM subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.userIAM.userAuth | AuthTrustLevel | ATL4 = 40000 | Added|
| ohos.userIAM.userAuth | AuthTrustLevel | ATL3 = 30000 | Added|
| ohos.userIAM.userAuth | AuthTrustLevel | ATL2 = 20000 | Added|
| ohos.userIAM.userAuth | AuthTrustLevel | ATL1 = 10000 | Added|
| ohos.userIAM.userAuth | UserAuthType | FINGERPRINT = 4 | Added|
| ohos.userIAM.userAuth | UserAuthType | FACE = 2 | Added|
| ohos.userIAM.userAuth | FingerprintTips | FINGERPRINT_AUTH_TIP_TOO_SLOW = 5 | Added|
| ohos.userIAM.userAuth | FingerprintTips | FINGERPRINT_AUTH_TIP_TOO_FAST = 4 | Added|
| ohos.userIAM.userAuth | FingerprintTips | FINGERPRINT_AUTH_TIP_PARTIAL = 3 | Added|
| ohos.userIAM.userAuth | FingerprintTips | FINGERPRINT_AUTH_TIP_INSUFFICIENT = 2 | Added|
| ohos.userIAM.userAuth | FingerprintTips | FINGERPRINT_AUTH_TIP_DIRTY = 1 | Added|
| ohos.userIAM.userAuth | FingerprintTips | FINGERPRINT_AUTH_TIP_GOOD = 0 | Added|
| ohos.userIAM.userAuth | FaceTips | FACE_AUTH_TIP_NOT_DETECTED = 11 | Added|
| ohos.userIAM.userAuth | FaceTips | FACE_AUTH_TIP_POOR_GAZE = 10 | Added|
| ohos.userIAM.userAuth | FaceTips | FACE_AUTH_TIP_TOO_MUCH_MOTION = 9 | Added|
| ohos.userIAM.userAuth | FaceTips | FACE_AUTH_TIP_TOO_LEFT = 8 | Added|
| ohos.userIAM.userAuth | FaceTips | FACE_AUTH_TIP_TOO_RIGHT = 7 | Added|
| ohos.userIAM.userAuth | FaceTips | FACE_AUTH_TIP_TOO_LOW = 6 | Added|
| ohos.userIAM.userAuth | FaceTips | FACE_AUTH_TIP_TOO_HIGH = 5 | Added|
| ohos.userIAM.userAuth | FaceTips | FACE_AUTH_TIP_TOO_FAR = 4 | Added|
| ohos.userIAM.userAuth | FaceTips | FACE_AUTH_TIP_TOO_CLOSE = 3 | Added|
| ohos.userIAM.userAuth | FaceTips | FACE_AUTH_TIP_TOO_DARK = 2 | Added|
| ohos.userIAM.userAuth | FaceTips | FACE_AUTH_TIP_TOO_BRIGHT = 1 | Added|
| ohos.userIAM.userAuth | ResultCode | NOT_ENROLLED = 10 | Added|
| ohos.userIAM.userAuth | ResultCode | LOCKED = 9 | Added|
| ohos.userIAM.userAuth | ResultCode | INVALID_PARAMETERS = 8 | Added|
| ohos.userIAM.userAuth | ResultCode | BUSY = 7 | Added|
| ohos.userIAM.userAuth | ResultCode | TRUST_LEVEL_NOT_SUPPORT = 6 | Added|
| ohos.userIAM.userAuth | ResultCode | TYPE_NOT_SUPPORT = 5 | Added|
| ohos.userIAM.userAuth | ResultCode | TIMEOUT = 4 | Added|
| ohos.userIAM.userAuth | ResultCode | CANCELED = 3 | Added|
| ohos.userIAM.userAuth | ResultCode | GENERAL_ERROR = 2 | Added|
| ohos.userIAM.userAuth | ResultCode | FAIL = 1 | Added|
| ohos.userIAM.userAuth | ResultCode | SUCCESS = 0 | Added|
| ohos.userIAM.userAuth | AuthResult | freezingTime ?: number; | Added|
| ohos.userIAM.userAuth | AuthResult | remainTimes ?: number; | Added|
| ohos.userIAM.userAuth | AuthResult | token ?: Uint8Array; | Added|
| ohos.userIAM.userAuth | IUserAuthCallback | onAcquireInfo ?: (module : number, acquire : number, extraInfo : any) => void; | Added|
| ohos.userIAM.userAuth | IUserAuthCallback | onResult: (result : number, extraInfo : AuthResult) => void; | Added|
| ohos.userIAM.userAuth | UserAuth | cancelAuth(contextID : Uint8Array) : number; | Added|
| ohos.userIAM.userAuth | UserAuth | auth(challenge: Uint8Array, authType: UserAuthType, authTrustLevel: AuthTrustLevel, callback: IUserAuthCallback): Uint8Array; | Added|
| ohos.userIAM.userAuth | UserAuth | getAvailableStatus(authType : UserAuthType, authTrustLevel : AuthTrustLevel) : number; | Added|
| ohos.userIAM.userAuth | UserAuth | getVersion() : number; | Added|
| ohos.userIAM.userAuth | UserAuth | constructor(); | Added|
| ohos.userIAM.userAuth | userAuth | function getAuthenticator(): Authenticator; | Added|
| ohos.userIAM.userAuth | Authenticator | execute(type: AuthType, level: SecureLevel, callback: AsyncCallback<number>): void;<br>execute(type: AuthType, level: SecureLevel): Promise<number>; | Added|
| ohos.userIAM.userAuth | AuthenticationResult | GENERAL_ERROR = 100 | Added|
| ohos.userIAM.userAuth | AuthenticationResult | NOT_ENROLLED = 8 | Added|
| ohos.userIAM.userAuth | AuthenticationResult | LOCKED = 7 | Added|
| ohos.userIAM.userAuth | AuthenticationResult | INVALID_PARAMETERS = 6 | Added|
| ohos.userIAM.userAuth | AuthenticationResult | BUSY = 5 | Added|
| ohos.userIAM.userAuth | AuthenticationResult | CAMERA_FAIL = 4 | Added|
| ohos.userIAM.userAuth | AuthenticationResult | TIMEOUT = 3 | Added|
| ohos.userIAM.userAuth | AuthenticationResult | CANCELED = 2 | Added|
| ohos.userIAM.userAuth | AuthenticationResult | COMPARE_FAILURE = 1 | Added|
| ohos.userIAM.userAuth | AuthenticationResult | SUCCESS = 0 | Added|
| ohos.userIAM.userAuth | AuthenticationResult | NO_SUPPORT = -1 | Added|
# JS API Diff
For details about the JS API changes in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS, see the following documents of each subsystem:
- [Ability framework](js-apidiff-ability.md)
- [Accessibility subsystem](js-apidiff-accessibility.md)
- [Account subsystem](js-apidiff-account.md)
- [ArkUI development framework](js-apidiff-ace.md)
- [Power management subsystem](js-apidiff-battery.md)
- [Bundle management subsystem](js-apidiff-bundle.md)
- [Communication subsystem](js-apidiff-communicate.md)
- [Multi-language Runtime subsystem](js-apidiff-compiler-and-runtime.md)
- [DFX](js-apidiff-dfx.md)
- [Distributed data management subsystem](js-apidiff-distributed-data.md)
- [Distributed hardware subsystem](js-apidiff-distributed-hardware.md)
- [Common event and notification framework](js-apidiff-event-and-notification.md)
- [File management subsystem](js-apidiff-file-management.md)
- [Location subsystem](js-apidiff-geolocation.md)
- [Globalization subsystem](js-apidiff-global.md)
- [Graphics subsystem](js-apidiff-graphic.md)
- [Misc services subsystem](js-apidiff-misc.md)
- [Multimodal input subsystem](js-apidiff-multi-modal-input.md)
- [Multimedia subsystem](js-apidiff-multimedia.md)
- [Network management subsystem](js-apidiff-network.md)
- [Resource scheduling subsystem](js-apidiff-resource-scheduler.md)
- [Security subsystem](js-apidiff-security.md)
- [Pan-sensor subsystem](js-apidiff-sensor.md)
- [Application framework subsystem](js-apidiff-settings.md)
- [DSoftBus subsystem](js-apidiff-soft-bus.md)
- [Telephony subsystem](js-apidiff-telephony.md)
- [USB subsystem](js-apidiff-usb.md)
- [User IAM subsystem](js-apidiff-user-authentication.md)
- [Window manager subsystem](js-apidiff-window.md)
# JS API Changes of the Window Manager Subsystem
The table below lists the APIs changes of the Window Manager subsystem in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS.
## API Changes
| Module| Class| Method/Attribute/Enumeration/Constant| Change Type|
|---|---|---|---|
| ohos.window | Window | setTouchable(isTouchable: boolean): Promise<void>;<br>setTouchable(isTouchable: boolean, callback: AsyncCallback<void>): void; | Added|
| ohos.window | Window | setPrivacyMode(isPrivacyMode: boolean): Promise<void>;<br>setPrivacyMode(isPrivacyMode: boolean, callback: AsyncCallback<void>): void; | Added|
| ohos.window | Window | setOutsideTouchable(touchable: boolean): Promise<void>;<br>setOutsideTouchable(touchable: boolean, callback: AsyncCallback<void>): void; | Added|
| ohos.window | Window | setKeepScreenOn(isKeepScreenOn: boolean): Promise<void>;<br>setKeepScreenOn(isKeepScreenOn: boolean, callback: AsyncCallback<void>): void; | Added|
| ohos.window | Window | setFocusable(isFocusable: boolean): Promise<void>;<br>setFocusable(isFocusable: boolean, callback: AsyncCallback<void>): void; | Added|
| ohos.window | Window | setDimBehind(dimBehindValue: number, callback: AsyncCallback<void>): void;<br>setDimBehind(dimBehindValue: number): Promise<void>; | Added|
| ohos.window | Window | setBrightness(brightness: number): Promise<void>;<br>setBrightness(brightness: number, callback: AsyncCallback<void>): void; | Added|
| ohos.window | Window | setBackgroundColor(color: string): Promise<void>;<br>setBackgroundColor(color: string, callback: AsyncCallback<void>): void; | Added|
| ohos.window | Window | getColorSpace(): Promise<ColorSpace>;<br>getColorSpace(callback: AsyncCallback<ColorSpace>): void; | Added|
| ohos.window | Window | setColorSpace(colorSpace:ColorSpace): Promise<void>;<br>setColorSpace(colorSpace:ColorSpace, callback: AsyncCallback<void>): void; | Added|
| ohos.window | Window | isSupportWideGamut(): Promise<boolean>;<br>isSupportWideGamut(callback: AsyncCallback<boolean>): void; | Added|
| ohos.window | Window | off(type: 'keyboardHeightChange', callback?: Callback<number>): void; | Added|
| ohos.window | Window | on(type: 'keyboardHeightChange', callback: Callback<number>): void; | Added|
| ohos.window | Window | off(type: 'systemAvoidAreaChange', callback?: Callback<AvoidArea>): void; | Added|
| ohos.window | Window | on(type: 'systemAvoidAreaChange', callback: Callback<AvoidArea>): void; | Added|
| ohos.window | Window | off(type: 'windowSizeChange', callback?: Callback<Size>): void; | Added|
| ohos.window | Window | on(type: 'windowSizeChange', callback: Callback<Size>): void; | Added|
| ohos.window | Window | isShowing(callback: AsyncCallback<boolean>): void;<br>isShowing(): Promise<boolean>; | Added|
| ohos.window | Window | loadContent(path: string, callback: AsyncCallback<void>): void;<br>loadContent(path: string): Promise<void>; | Added|
| ohos.window | Window | setSystemBarProperties(systemBarProperties: SystemBarProperties, callback: AsyncCallback<void>): void;<br>setSystemBarProperties(systemBarProperties: SystemBarProperties): Promise<void>; | Added|
| ohos.window | Window | setSystemBarEnable(names: Array<'status'\|'navigation'>, callback: AsyncCallback<void>): void;<br>setSystemBarEnable(names: Array<'status'\|'navigation'>): Promise<void>; | Added|
| ohos.window | Window | setLayoutFullScreen(isLayoutFullScreen: boolean, callback: AsyncCallback<void>): void;<br>setLayoutFullScreen(isLayoutFullScreen: boolean): Promise<void>; | Added|
| ohos.window | Window | setFullScreen(isFullScreen: boolean, callback: AsyncCallback<void>): void;<br>setFullScreen(isFullScreen: boolean): Promise<void>; | Added|
| ohos.window | Window | getAvoidArea(type: AvoidAreaType, callback: AsyncCallback<AvoidArea>): void;<br>getAvoidArea(type: AvoidAreaType): Promise<AvoidArea>; | Added|
| ohos.window | Window | getProperties(callback: AsyncCallback<WindowProperties>): void;<br>getProperties(): Promise<WindowProperties>; | Added|
| ohos.window | Window | destroy(callback: AsyncCallback<void>): void;<br>destroy(): Promise<void>; | Added|
| ohos.window | Window | show(callback: AsyncCallback<void>): void;<br>show(): Promise<void>; | Added|
| ohos.window | window | function find(id: string, callback: AsyncCallback<Window>): void;<br>function find(id: string): Promise<Window>; | Added|
| ohos.window | window | function create(id: string, type: WindowType, callback: AsyncCallback<Window>): void;<br>function create(id: string, type: WindowType): Promise<Window>;<br>function create(ctx: Context, id: string, type: WindowType): Promise<Window>;<br>function create(ctx: Context, id: string, type: WindowType, callback: AsyncCallback<Window>): void; | Added|
| ohos.window | ColorSpace | WIDE_GAMUT | Added|
| ohos.window | ColorSpace | DEFAULT | Added|
| ohos.window | WindowProperties | isTransparent: boolean | Added|
| ohos.window | WindowProperties | isRoundCorner: boolean | Added|
| ohos.window | WindowProperties | isPrivacyMode: boolean | Added|
| ohos.window | WindowProperties | isKeepScreenOn: boolean | Added|
| ohos.window | WindowProperties | dimBehindValue: number | Added|
| ohos.window | WindowProperties | brightness: number | Added|
| ohos.window | WindowProperties | touchable: boolean | Added|
| ohos.window | WindowProperties | focusable: boolean | Added|
| ohos.window | WindowProperties | isLayoutFullScreen: boolean | Added|
| ohos.window | WindowProperties | isFullScreen: boolean | Added|
| ohos.window | WindowProperties | type: WindowType; | Added|
| ohos.window | WindowProperties | windowRect: Rect; | Added|
| ohos.window | Size | height: number; | Added|
| ohos.window | Size | width: number; | Added|
| ohos.window | AvoidArea | bottomRect: Rect; | Added|
| ohos.window | AvoidArea | rightRect: Rect; | Added|
| ohos.window | AvoidArea | topRect: Rect; | Added|
| ohos.window | AvoidArea | leftRect: Rect; | Added|
| ohos.window | Rect | height: number; | Added|
| ohos.window | Rect | width: number; | Added|
| ohos.window | Rect | top: number; | Added|
| ohos.window | Rect | left: number; | Added|
| ohos.window | SystemBarProperties | navigationBarContentColor?: string; | Added|
| ohos.window | SystemBarProperties | isNavigationBarLightIcon?: boolean; | Added|
| ohos.window | SystemBarProperties | navigationBarColor?: string; | Added|
| ohos.window | SystemBarProperties | statusBarContentColor?: string; | Added|
| ohos.window | SystemBarProperties | isStatusBarLightIcon?: boolean; | Added|
| ohos.window | SystemBarProperties | statusBarColor?: string; | Added|
| ohos.window | AvoidAreaType | TYPE_CUTOUT | Added|
| ohos.window | AvoidAreaType | TYPE_SYSTEM | Added|
| ohos.display | Display | yDPI: number; | Added|
| ohos.display | Display | xDPI: number; | Added|
| ohos.display | Display | scaledDensity: number; | Added|
| ohos.display | Display | densityPixels: number; | Added|
| ohos.display | Display | densityDPI: number; | Added|
| ohos.display | Display | height: number; | Added|
| ohos.display | Display | width: number; | Added|
| ohos.display | Display | rotation: number; | Added|
| ohos.display | Display | refreshRate: number; | Added|
| ohos.display | Display | state: DisplayState; | Added|
| ohos.display | Display | alive: boolean; | Added|
| ohos.display | Display | name: string; | Added|
| ohos.display | Display | id: number; | Added|
| ohos.display | DisplayState | STATE_ON_SUSPEND | Added|
| ohos.display | DisplayState | STATE_VR | Added|
| ohos.display | DisplayState | STATE_DOZE_SUSPEND | Added|
| ohos.display | DisplayState | STATE_DOZE | Added|
| ohos.display | DisplayState | STATE_ON | Added|
| ohos.display | DisplayState | STATE_OFF | Added|
| ohos.display | DisplayState | STATE_UNKNOWN = 0 | Added|
| ohos.display | display | function off(type: 'add' \| 'remove' \| 'change', callback?: Callback<number>): void; | Added|
| ohos.display | display | function off(type: 'add' \| 'remove' \| 'change', callback?: Callback<number>): void; | Added|
| ohos.display | display | function off(type: 'add' \| 'remove' \| 'change', callback?: Callback<number>): void; | Added|
| ohos.display | display | function on(type: 'add' \| 'remove' \| 'change', callback: Callback<number>): void; | Added|
| ohos.display | display | function on(type: 'add' \| 'remove' \| 'change', callback: Callback<number>): void; | Added|
| ohos.display | display | function on(type: 'add' \| 'remove' \| 'change', callback: Callback<number>): void; | Added|
| ohos.display | display | function getAllDisplay(callback: AsyncCallback<Array<Display>>): void;<br>function getAllDisplay(): Promise<Array<Display>>; | Added|
| ohos.display | display | function getDefaultDisplay(callback: AsyncCallback<Display>): void;<br>function getDefaultDisplay(): Promise<Display>; | Added|
# Readme
This directory records the API changes in OpenHarmony 3.1 Release over OpenHarmony 3.0 LTS, including new, updated, deprecated, and deleted APIs.
- [JS API Differences](js-apidiff-v3.1-release.md)
- [Native API Differences](native-apidiff-v3.1-release.md)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册