harmony(鸿蒙)FeatureAbility

2022-08-09 浏览 (647)

FeatureAbility

The FeatureAbility module provides a UI for interacting with users. You can use APIs of this module to start a new ability, obtain the dataAbilityHelper, set a Page ability, obtain the window corresponding to this ability, and connect to a Service ability.

NOTE

The initial APIs of this module are supported since API version 6. Newly added APIs will be marked with a superscript to indicate their earliest API version. The APIs of this module can be used only in the FA model.

Constraints

APIs of the FeatureAbility module can be called only by Page abilities.

Modules to Import

import featureAbility from '@ohos.ability.featureAbility';

featureAbility.startAbility

startAbility(parameter: StartAbilityParameter, callback: AsyncCallback<number>): void

Starts an ability. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Parameters

NameTypeMandatoryDescription
parameterStartAbilityParameterYesAbility to start.
callbackAsyncCallback<number>YesCallback used to return the result.

Example

import featureAbility from '@ohos.ability.featureAbility';
import wantConstant from '@ohos.ability.wantConstant';
featureAbility.startAbility(
    {
        want:
        {
            action: "",
            entities: [""],
            type: "",
            flags: wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION,
            deviceId: "",
            bundleName: "com.example.myapplication",
            /* In the FA model, abilityName consists of package and ability names. */
            abilityName: "com.example.entry.secondAbility",
            uri: ""
        },
    },
    (err, data) => {
        console.info("startAbility err: " + JSON.stringify(err) + "data: " + JSON.stringify(data));
    }
);

featureAbility.startAbility

startAbility(parameter: StartAbilityParameter): Promise<number>

Starts an ability. This API uses a promise to return the result.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Parameters

NameTypeMandatoryDescription
parameterStartAbilityParameterYesAbility to start.

Example

import featureAbility from '@ohos.ability.featureAbility';
import wantConstant from '@ohos.ability.wantConstant';
featureAbility.startAbility(
    {
        want:
        {
            action: "action.system.home",
            entities: ["entity.system.home"],
            type: "MIMETYPE",
            flags: wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION,
            deviceId: "",
            bundleName: "com.example.myapplication",
            /* In the FA model, abilityName consists of package and ability names. */
            abilityName: "com.example.entry.secondAbility",
            uri: ""
        },
    }
).then((data) => {
    console.info("startAbility data: " + JSON.stringify(data));
});

featureAbility.acquireDataAbilityHelper7+

acquireDataAbilityHelper(uri: string): DataAbilityHelper

Obtains a dataAbilityHelper object.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Parameters

NameTypeMandatoryDescription
uristringYesURI of the file to open.

Return value

TypeDescription
DataAbilityHelperA utility class used to help other abilities access the Data ability.

Example

import featureAbility from '@ohos.ability.featureAbility';
var dataAbilityHelper = featureAbility.acquireDataAbilityHelper(
    "dataability:///com.example.DataAbility"
);

featureAbility.startAbilityForResult7+

startAbilityForResult(parameter: StartAbilityParameter, callback: AsyncCallback<AbilityResult>): void

Starts an ability. This API uses an asynchronous callback to return the execution result when the ability is destroyed.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Parameters

NameTypeMandatoryDescription
parameterStartAbilityParameterYesAbility to start.
callbackAsyncCallback<AbilityResult>YesCallback used to return the result.

Example

import featureAbility from '@ohos.ability.featureAbility';
import wantConstant from '@ohos.ability.wantConstant';
featureAbility.startAbilityForResult(
   {
        want:
        {
            action: "action.system.home",
            entities: ["entity.system.home"],
            type: "MIMETYPE",
            flags: wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION,
            deviceId: "",
            bundleName: "com.example.myapplication",
            /* In the FA model, abilityName consists of package and ability names. */
            abilityName: "com.example.entry.secondAbility",
            uri:""
        },
    },
    (err, data) => {
        console.info("startAbilityForResult err: " + JSON.stringify(err) + "data: " + JSON.stringify(data));
    }
);

featureAbility.startAbilityForResult7+

startAbilityForResult(parameter: StartAbilityParameter): Promise<AbilityResult>

Starts an ability. This API uses a promise to return the execution result when the ability is destroyed.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Parameters

NameTypeMandatoryDescription
parameterStartAbilityParameterYesAbility to start.

Return value

TypeDescription
Promise<AbilityResult>Promised returned with the execution result.

Example

import featureAbility from '@ohos.ability.featureAbility';
import wantConstant from '@ohos.ability.wantConstant';
featureAbility.startAbilityForResult(
    {
        want:
        {
            action: "action.system.home",
            entities: ["entity.system.home"],
            type: "MIMETYPE",
            flags: wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION,
            deviceId: "",
            bundleName: "com.example.myapplication",
            /* In the FA model, abilityName consists of package and ability names. */
            abilityName: "com.example.entry.secondAbility",
            uri:"",
            parameters:
            {
                mykey0: 1111,
                mykey1: [1, 2, 3],
                mykey2: "[1, 2, 3]",
                mykey3: "xxxxxxxxxxxxxxxxxxxxxx",
                mykey4: [1, 15],
                mykey5: [false, true, false],
                mykey6: ["aaaaaa", "bbbbb", "ccccccccccc"],
                mykey7: true,
            },
        },
    },
).then((data) => {
    console.info("startAbilityForResult data: " + JSON.stringify(data));
});

featureAbility.terminateSelfWithResult7+

terminateSelfWithResult(parameter: AbilityResult, callback: AsyncCallback<void>): void

Destroys this Page ability, with the result code and data sent to the caller. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Parameters

NameTypeMandatoryDescription
parameterAbilityResultYesAbility to destroy.
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import featureAbility from '@ohos.ability.featureAbility';
import wantConstant from '@ohos.ability.wantConstant';
featureAbility.terminateSelfWithResult(
    {
        resultCode: 1,
        want:
        {
            action: "action.system.home",
            entities: ["entity.system.home"],
            type: "MIMETYPE",
            flags: wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION,
            deviceId: "",
            bundleName: "com.example.myapplication",
            /* In the FA model, abilityName consists of package and ability names. */
            abilityName: "com.example.entry.secondAbility",
            uri:"",
            parameters: {
                mykey0: 2222,
                mykey1: [1, 2, 3],
                mykey2: "[1, 2, 3]",
                mykey3: "ssssssssssssssssssssssssss",
                mykey4: [1, 15],
                mykey5: [false, true, false],
                mykey6: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"],
                mykey7: true,
            }
        },
    },
    (err) => {
        console.info("err: " + JSON.stringify(err))
    }
);

featureAbility.terminateSelfWithResult7+

terminateSelfWithResult(parameter: AbilityResult): Promise<void>

Destroys this Page ability, with the result code and data sent to the caller. This API uses a promise to return the result.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Parameters

NameTypeMandatoryDescription
parameterAbilityResultYesAbility to destroy.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import featureAbility from '@ohos.ability.featureAbility';
import wantConstant from '@ohos.ability.wantConstant';
featureAbility.terminateSelfWithResult(
    {
        resultCode: 1,
        want:
        {
            action: "action.system.home",
            entities: ["entity.system.home"],
            type: "MIMETYPE",
            flags: wantConstant.Flags.FLAG_AUTH_READ_URI_PERMISSION,
            deviceId: "",
            bundleName: "com.example.myapplication",
            /* In the FA model, abilityName consists of package and ability names. */
            abilityName: "com.example.entry.secondAbility",
            uri:"",
            parameters: {
                mykey0: 2222,
                mykey1: [1, 2, 3],
                mykey2: "[1, 2, 3]",
                mykey3: "ssssssssssssssssssssssssss",
                mykey4: [1, 15],
                mykey5: [false, true, false],
                mykey6: ["qqqqq", "wwwwww", "aaaaaaaaaaaaaaaaa"],
                mykey7: true,
            }
        },
    }
).then((data) => {
    console.info("==========================>terminateSelfWithResult=======================>");
});

featureAbility.hasWindowFocus7+

hasWindowFocus(callback: AsyncCallback<boolean>): void

Checks whether the main window of this ability has the focus. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<boolean>YesCallback used to return the result.
Returns true if the main window of this ability has the focus; returns false otherwise.

Example

import featureAbility from '@ohos.ability.featureAbility';
featureAbility.hasWindowFocus((err, data) => {
    console.info("hasWindowFocus err: " + JSON.stringify(err) + "data: " + JSON.stringify(data));
});

featureAbility.hasWindowFocus7+

hasWindowFocus(): Promise<boolean>

Checks whether the main window of this ability has the focus. This API uses a promise to return the result.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Return value

TypeDescription
Promise<boolean>Returns true if the main window of this ability has the focus; returns false otherwise.

Example

import featureAbility from '@ohos.ability.featureAbility';
featureAbility.hasWindowFocus().then((data) => {
    console.info("hasWindowFocus data: " + JSON.stringify(data));
});

featureAbility.getWant

getWant(callback: AsyncCallback<Want>): void

Obtains the Want object sent from this ability. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<Want>YesCallback used to return the result.

Example

import featureAbility from '@ohos.ability.featureAbility';
featureAbility.getWant((err, data) => {
    console.info("getWant err: " + JSON.stringify(err) + "data: " + JSON.stringify(data));
});

featureAbility.getWant

getWant(): Promise<Want>

Obtains the Want object sent from this ability. This API uses a promise to return the result.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Return value

TypeDescription
Promise<Want>Promise used to return the result.

Example

import featureAbility from '@ohos.ability.featureAbility';
featureAbility.getWant().then((data) => {
    console.info("getWant data: " + JSON.stringify(data));
});

featureAbility.getContext

getContext(): Context

Obtains the application context.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Return value

TypeDescription
ContextApplication context.

Example

import featureAbility from '@ohos.ability.featureAbility';
var context = featureAbility.getContext()
context.getBundleName((err, data) => {
    console.info("getBundleName err: " + JSON.stringify(err) + "data: " + JSON.stringify(data));
});

featureAbility.terminateSelf7+

terminateSelf(callback: AsyncCallback<void>): void

Destroys this Page ability, with the result code and data sent to the caller. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import featureAbility from '@ohos.ability.featureAbility';
featureAbility.terminateSelf(
    (err) => {
        console.info("err: " + JSON.stringify(err))
    }
)

featureAbility.terminateSelf7+

terminateSelf(): Promise<void>

Destroys this Page ability, with the result code and data sent to the caller. This API uses a promise to return the result.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import featureAbility from '@ohos.ability.featureAbility';
featureAbility.terminateSelf().then((data) => {
    console.info("==========================>terminateSelf=======================>");
});

featureAbility.connectAbility7+

connectAbility(request: Want, options:ConnectOptions): number

Connects this ability to a specific Service ability. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Parameters

NameTypeMandatoryDescription
requestWantYesService ability to connect.
optionsConnectOptionsYesCallback used to return the result.

ConnectOptions

Describes the connection options.

System capability: SystemCapability.Ability.AbilityRuntime.Core

NameReadableWritableTypeMandatoryDescription
onConnect7+YesNofunctionYesCallback invoked when the connection is successful.
onDisconnect7+YesNofunctionYesCallback invoked when the connection fails.
onFailed7+YesNofunctionYesCallback invoked when connectAbility fails to be called.

Return value

TypeDescription
numberID of the Service ability connected.

Example

import rpc from '@ohos.rpc';
import featureAbility from '@ohos.ability.featureAbility';
function onConnectCallback(element, remote){
    console.log('ConnectAbility onConnect remote is proxy:' + (remote instanceof rpc.RemoteProxy));
}
function onDisconnectCallback(element){
    console.log('ConnectAbility onDisconnect element.deviceId : ' + element.deviceId)
}
function onFailedCallback(code){
    console.log('featureAbilityTest ConnectAbility onFailed errCode : ' + code)
}
var connectId = featureAbility.connectAbility(
    {
        deviceId: "",
        bundleName: "com.ix.ServiceAbility",
        abilityName: "ServiceAbilityA",
    },
    {
        onConnect: onConnectCallback,
        onDisconnect: onDisconnectCallback,
        onFailed: onFailedCallback,
    },
);

featureAbility.disconnectAbility7+

disconnectAbility(connection: number, callback:AsyncCallback<void>): void

Disconnects this ability from a specific Service ability. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Parameters

NameTypeMandatoryDescription
connectionnumberYesID of the Service ability to disconnect.
callbackAsyncCallback<void>YesCallback used to return the result.

Example

import rpc from '@ohos.rpc';
import featureAbility from '@ohos.ability.featureAbility';
function onConnectCallback(element, remote){
    console.log('ConnectAbility onConnect remote is proxy:' + (remote instanceof rpc.RemoteProxy));
}
function onDisconnectCallback(element){
    console.log('ConnectAbility onDisconnect element.deviceId : ' + element.deviceId)
}
function onFailedCallback(code){
    console.log('featureAbilityTest ConnectAbility onFailed errCode : ' + code)
}
var connectId = featureAbility.connectAbility(
    {
        bundleName: "com.ix.ServiceAbility",
        abilityName: "ServiceAbilityA",
    },
    {
        onConnect: onConnectCallback,
        onDisconnect: onDisconnectCallback,
        onFailed: onFailedCallback,
    },
);
var result = featureAbility.disconnectAbility(connectId,
    (error) => {
        console.log('featureAbilityTest DisConnectJsSameBundleName result errCode : ' + error.code)
    },
);

featureAbility.disconnectAbility7+

disconnectAbility(connection: number): Promise<void>

Disconnects this ability from a specific Service ability. This API uses a promise to return the result.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Parameters

NameTypeMandatoryDescription
connectionnumberYesID of the Service ability to disconnect.

Return value

TypeDescription
Promise<void>Promise used to return the result.

Example

import rpc from '@ohos.rpc';
import featureAbility from '@ohos.ability.featureAbility';
function onConnectCallback(element, remote){
    console.log('ConnectAbility onConnect remote is proxy:' + (remote instanceof rpc.RemoteProxy));
}
function onDisconnectCallback(element){
    console.log('ConnectAbility onDisconnect element.deviceId : ' + element.deviceId)
}
function onFailedCallback(code){
    console.log('featureAbilityTest ConnectAbility onFailed errCode : ' + code)
}
var connectId = featureAbility.connectAbility(
    {
        bundleName: "com.ix.ServiceAbility",
        abilityName: "ServiceAbilityA",
    },
    {
        onConnect: onConnectCallback,
        onDisconnect: onDisconnectCallback,
        onFailed: onFailedCallback,
    },
);

featureAbility.disconnectAbility(connectId).then((data) => {
    console.log('data : '  + data);
}).catch((error)=>{
    console.log('featureAbilityTest result errCode : ' + error.code);
});

featureAbility.getWindow7+

getWindow(callback: AsyncCallback<window.Window>): void

Obtains the window corresponding to this ability. This API uses an asynchronous callback to return the result.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Parameters

NameTypeMandatoryDescription
callbackAsyncCallback<window.Window>YesCallback used to return the window.

Example

featureAbility.getWindow((err, data) => {
    console.info("getWindow err: " + JSON.stringify(err) + "data: " + typeof(data));
});

featureAbility.getWindow7+

getWindow(): Promise<window.Window>;

Obtains the window corresponding to this ability. This API uses a promise to return the result.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

Return value

TypeDescription
Promise<window.Window>Promise used to return the window.

Example

featureAbility.getWindow().then((data) => {
    console.info("getWindow data: " + typeof(data));
});

ConnectOptions.onConnect7+

onConnect(elementName: ElementName, remote: rpc.IRemoteObject): void;

Callback invoked when the connection is successful.

System capability: SystemCapability.Ability.AbilityRuntime.Core

Parameters

NameTypeMandatoryDescription
elementNameElementNameYesElement name.
remoterpc.IRemoteObjectYesRPC remote object.

Example

import rpc from '@ohos.rpc';
import featureAbility from '@ohos.ability.featureAbility';
function onConnectCallback(element, remote){
    console.log('ConnectAbility onConnect remote is proxy:' + (remote instanceof rpc.RemoteProxy));
}
function onDisconnectCallback(element){
    console.log('ConnectAbility onDisconnect element.deviceId : ' + element.deviceId)
}
function onFailedCallback(code){
    console.log('featureAbilityTest ConnectAbility onFailed errCode : ' + code)
}
var connectId = featureAbility.connectAbility(
    {
        deviceId: "",
        bundleName: "com.ix.ServiceAbility",
        abilityName: "ServiceAbilityA",
    },
    {
        onConnect: onConnectCallback,
        onDisconnect: onDisconnectCallback,
        onFailed: onFailedCallback,
    },
);

ConnectOptions.onDisconnect7+

onDisconnect(elementName: ElementName): void;

Callback invoked when the connection fails.

System capability: SystemCapability.Ability.AbilityRuntime.Core

Parameters

NameTypeMandatoryDescription
elementNameElementNameYesElement name.

Example

import rpc from '@ohos.rpc';
import featureAbility from '@ohos.ability.featureAbility';
function onConnectCallback(element, remote){
    console.log('ConnectAbility onConnect remote is proxy:' + (remote instanceof rpc.RemoteProxy));
}
function onDisconnectCallback(element){
    console.log('ConnectAbility onDisconnect element.deviceId : ' + element.deviceId)
}
function onFailedCallback(code){
    console.log('featureAbilityTest ConnectAbility onFailed errCode : ' + code)
}
var connectId = featureAbility.connectAbility(
    {
        deviceId: "",
        bundleName: "com.ix.ServiceAbility",
        abilityName: "ServiceAbilityA",
    },
    {
        onConnect: onConnectCallback,
        onDisconnect: onDisconnectCallback,
        onFailed: onFailedCallback,
    },
);

ConnectOptions.onFailed7+

onFailed(code: number): void;

Callback invoked when connectAbility fails to be called.

System capability: SystemCapability.Ability.AbilityRuntime.Core

Parameters

NameTypeMandatoryDescription
codenumberYesNumber type.

Example

import rpc from '@ohos.rpc';
import featureAbility from '@ohos.ability.featureAbility';
function onConnectCallback(element, remote){
    console.log('ConnectAbility onConnect remote is proxy:' + (remote instanceof rpc.RemoteProxy));
}
function onDisconnectCallback(element){
    console.log('ConnectAbility onDisconnect element.deviceId : ' + element.deviceId)
}
function onFailedCallback(code){
    console.log('featureAbilityTest ConnectAbility onFailed errCode : ' + code)
}
var connectId = featureAbility.connectAbility(
    {
        deviceId: "",
        bundleName: "com.ix.ServiceAbility",
        abilityName: "ServiceAbilityA",
    },
    {
        onConnect: onConnectCallback,
        onDisconnect: onDisconnectCallback,
        onFailed: onFailedCallback,
    },
);

AbilityWindowConfiguration

The value is obtained through the featureAbility.AbilityWindowConfiguration API.

Example

featureAbility.AbilityWindowConfiguration.WINDOW_MODE_UNDEFINED

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

NameValueDescription
WINDOW_MODE_UNDEFINED7+0The Page ability is in an undefined window display mode.
WINDOW_MODE_FULLSCREEN7+1The Page ability is in full screen mode.
WINDOW_MODE_SPLIT_PRIMARY7+100The Page ability is displayed in the primary window when it is in split-screen mode.
WINDOW_MODE_SPLIT_SECONDARY7+101The Page ability is displayed in the secondary window when it is in split-screen mode.
WINDOW_MODE_FLOATING7+102The Page ability is displayed in floating window mode.

AbilityStartSetting

The AbilityStartSetting attribute is an object defined as [key: string]: any. The key is a type of AbilityStartSetting, and the value is a type of AbilityWindowConfiguration.

The value is obtained through the featureAbility.AbilityStartSetting API.

Example

featureAbility.AbilityStartSetting.BOUNDS_KEY

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

NameValueDescription
BOUNDS_KEY7+"abilityBounds"Ability window size.
WINDOW_MODE_KEY7+"windowMode"Ability window display mode.
DISPLAY_ID_KEY7+"displayId"Display device ID.

ErrorCode

Enumerates error codes.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

NameValueDescription
NO_ERROR7+0No error occurs.
INVALID_PARAMETER7+-1Invalid parameter.
ABILITY_NOT_FOUND7+-2The ability is not found.
PERMISSION_DENY7+-3The request is denied.

DataAbilityOperationType

Enumerates operation types of the Data ability.

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

NameValueDescription
TYPE_INSERT7+1Insert operation.
TYPE_UPDATE7+2Update operation.
TYPE_DELETE7+3Deletion operation.
TYPE_ASSERT7+4Assert operation.

AbilityResult

System capability: SystemCapability.Ability.AbilityBase

NameTypeReadableWritableMandatoryDescription
resultCode7+numberYesNoYesResult code returned after the ability is destroyed. The feature for defining error-specific result codes is coming soon.
want7+WantYesNoNoData returned after the ability is destroyed. You can define the data to be returned. This parameter can be null.

StartAbilityParameter

System capability: SystemCapability.Ability.AbilityRuntime.FAModel

|Name | Type|Readable|Writable |Mandatory|Description | |-------------------|--------|--------------------|----|--------------------------------------| |want |Want| Yes| No |Yes |Information about the ability to start. | |abilityStartSetting|{[key: string]: any}| Yes|No|No |Special attribute of the ability to start. This attribute can be passed in the method call.|

flags

System capability: SystemCapability.Ability.AbilityBase

NameValueDescription
FLAG_AUTH_READ_URI_PERMISSION0x00000001Indicates the permission to read the URI.
FLAG_AUTH_WRITE_URI_PERMISSION0x00000002Indicates the permission to write the URI.
FLAG_ABILITY_FORWARD_RESULT0x00000004Returns the result to the ability.
FLAG_ABILITY_CONTINUATION0x00000008Indicates whether the ability on the local device can be migrated to a remote device.
FLAG_NOT_OHOS_COMPONENT0x00000010Indicates that a component does not belong to OHOS.
FLAG_ABILITY_FORM_ENABLED0x00000020Indicates whether to enable an ability.
FLAG_AUTH_PERSISTABLE_URI_PERMISSION0x00000040Indicates the permission to make the URI persistent.
System API: This is a system API and cannot be called by third-party applications.
FLAG_AUTH_PREFIX_URI_PERMISSION0x00000080Indicates the permission to verify URIs by prefix matching.
System API: This is a system API and cannot be called by third-party applications.
FLAG_ABILITYSLICE_MULTI_DEVICE0x00000100Supports cross-device startup in a distributed scheduler.
FLAG_START_FOREGROUND_ABILITY0x00000200Indicates that the Service ability is started regardless of whether the host application has been started.
System API: This is a system API and cannot be called by third-party applications.
FLAG_ABILITY_CONTINUATION_REVERSIBLE0x00000400Indicates that the migration is reversible.
FLAG_INSTALL_ON_DEMAND0x00000800Indicates that the specific ability will be installed if it has not been installed.
FLAG_INSTALL_WITH_BACKGROUND_MODE0x80000000Indicates that the specific ability will be installed in the background if it has not been installed.
FLAG_ABILITY_CLEAR_MISSION0x00008000Clears other operation missions. This flag can be set for the Want object in the startAbility API passed to ohos.app.Context and must be used together with flag_ABILITY_NEW_MISSION.
FLAG_ABILITY_NEW_MISSION0x10000000Creates a mission on the historical mission stack.
FLAG_ABILITY_MISSION_TOP0x20000000Starts the mission on the top of the existing mission stack; creates an ability instance if no mission exists.

你可能感兴趣的鸿蒙文章

harmony(鸿蒙)APIs

harmony(鸿蒙)API Reference Document Description

harmony(鸿蒙)BundleStatusCallback

harmony(鸿蒙)innerBundleManager(deprecated)

harmony(鸿蒙)distributedBundle

harmony(鸿蒙)Bundle

harmony(鸿蒙)Context

harmony(鸿蒙)DataUriUtils

harmony(鸿蒙)EnterpriseAdminExtensionAbility

harmony(鸿蒙)Work Scheduler Callbacks

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/f93dddc723d045a79667c6e589d5dfcb