harmony 鸿蒙Context Switching

  • 2023-02-03
  • 浏览 (633)

Context Switching

API in the FA Model Corresponding .d.ts File in the Stage Model Corresponding API or Field in the Stage Model
getOrCreateLocalDir(callback:AsyncCallback<string>):void;
getOrCreateLocalDir():Promise<string>;
There is no corresponding API in the stage model. Applications developed on the stage model do not have the operation permission in the application root directory. Therefore, no corresponding API is provided.
verifyPermission(permission:string,options:PermissionOptions,callback:AsyncCallback<number>):void;
verifyPermission(permission:string,callback:AsyncCallback<number>):void;
verifyPermission(permission:string,options?:PermissionOptions):Promise<number>;
\@ohos.abilityAccessCtrl.d.ts verifyAccessTokenSync(tokenID: number, permissionName: Permissions): GrantStatus;
verifyAccessToken(tokenID: number, permissionName: Permissions): Promise<GrantStatus>;
requestPermissionsFromUser(permissions:Array<string>,requestCode:number,resultCallback:AsyncCallback<PermissionRequestResult>):void;
requestPermissionsFromUser(permissions:Array<string>,requestCode:number):Promise<PermissionRequestResult>;
\@ohos.abilityAccessCtrl.d.ts requestPermissionsFromUser(context: Context, permissionList: Array<Permissions>, requestCallback: AsyncCallback<PermissionRequestResult>) : void;
requestPermissionsFromUser(context: Context, permissionList: Array<Permissions>) : Promise<PermissionRequestResult>;
getApplicationInfo(callback:AsyncCallback<ApplicationInfo>):void;
getApplicationInfo():Promise<ApplicationInfo>;
application\Context.d.ts applicationInfo: ApplicationInfo;
getBundleName(callback : AsyncCallback<string>): void;
getBundleName(): Promise<string>;
application\UIAbilityContext.d.ts abilityInfo.bundleName: string;
getDisplayOrientation(callback : AsyncCallback<bundle.DisplayOrientation>): void;
getDisplayOrientation(): Promise<bundle.DisplayOrientation>;
\@ohos.screen.d.ts readonly orientation: Orientation;
setDisplayOrientation(orientation:bundle.DisplayOrientation, callback:AsyncCallback<void>):void;
setDisplayOrientation(orientation:bundle.DisplayOrientation):Promise<void>;
\@ohos.screen.d.ts setOrientation(orientation: Orientation, callback: AsyncCallback<void>): void;
setOrientation(orientation: Orientation): Promise<void>;
setShowOnLockScreen(show:boolean, callback:AsyncCallback<void>):void;
setShowOnLockScreen(show:boolean):Promise<void>;
\@ohos.window.d.ts setShowOnLockScreen(showOnLockScreen: boolean): void;
setWakeUpScreen(wakeUp:boolean, callback:AsyncCallback<void>):void;
setWakeUpScreen(wakeUp:boolean):Promise<void>;
\@ohos.window.d.ts setWakeUpScreen(wakeUp: boolean): void;
getProcessInfo(callback:AsyncCallback<ProcessInfo>):void;
getProcessInfo():Promise<ProcessInfo>;
\@ohos.app.ability.abilityManager.d.ts getAbilityRunningInfos(callback: AsyncCallback<Array<AbilityRunningInfo>>): void;
getAbilityRunningInfos(): Promise<Array<AbilityRunningInfo>>;
getElementName(callback:AsyncCallback<ElementName>):void;
getElementName():Promise<ElementName>;
application\UIAbilityContext.d.ts abilityInfo.name: string;
abilityInfo.bundleName: string;
getProcessName(callback:AsyncCallback<string>):void;
getProcessName():Promise<string>;
\@ohos.app.ability.abilityManager.d.ts getAbilityRunningInfos(callback: AsyncCallback<Array<AbilityRunningInfo>>): void;
getAbilityRunningInfos(): Promise<Array<AbilityRunningInfo>>;
getCallingBundle(callback:AsyncCallback<string>):void;
getCallingBundle():Promise<string>;
There is no corresponding API in the stage model. Applications developed on the stage model can use the ohos.aafwk.param.callerUid parameter of Want.parameters to obtain the application information of the caller.
getFilesDir(callback:AsyncCallback<string>):void;
getFilesDir():Promise<string>;
application\Context.d.ts filesDir: string;
getCacheDir(callback:AsyncCallback<string>):void;
getCacheDir():Promise<string>;
application\Context.d.ts cacheDir: string;
getOrCreateDistributedDir(callback:AsyncCallback<string>):void;
getOrCreateDistributedDir():Promise<string>;
application\Context.d.ts distributedFilesDir: string;
getAppType(callback:AsyncCallback<string>):void;
getAppType():Promise<string>;
application\UIAbilityContext.d.ts The stage model obtains the application type through the type attribute of the abilityInfo field.
abilityInfo.type: bundleManager.AbilityType;
getHapModuleInfo(callback:AsyncCallback<HapModuleInfo>):void;
getHapModuleInfo():Promise<HapModuleInfo>;
application\UIAbilityContext.d.ts currentHapModuleInfo: HapModuleInfo;
getAppVersionInfo(callback:AsyncCallback<AppVersionInfo>):void;
getAppVersionInfo():Promise<AppVersionInfo>;
bundle\bundleInfo.d.ts readonly name: string;
readonly versionCode: number;
readonly versionName: string;
getApplicationContext():Context; application\Context.d.ts getApplicationContext(): ApplicationContext;
getAbilityInfo(callback:AsyncCallback<AbilityInfo>):void;
getAbilityInfo():Promise<AbilityInfo>;
application\UIAbilityContext.d.ts abilityInfo: AbilityInfo;
isUpdatingConfigurations(callback:AsyncCallback<boolean>):void;
isUpdatingConfigurations():Promise<boolean>;
There is no corresponding API in the stage model. OpenHarmony applications do not restart when the system environment changes. The onConfigurationUpdated callback is invoked to notify the applications of the changes. This API provides an empty implementation in the FA model, and the stage model does not provide a corresponding API.
printDrawnCompleted(callback:AsyncCallback<void>):void;
printDrawnCompleted():Promise<void>;
There is no corresponding API in the stage model. This API provides an empty implementation in the FA model. The stage model does not provide a corresponding API.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙Application Models

harmony 鸿蒙Using Explicit Want to Start an Application Component

harmony 鸿蒙Using Implicit Want to Open a Website

harmony 鸿蒙AbilityStage Component Container

harmony 鸿蒙Accessing a DataAbility

harmony 鸿蒙Accessing a DataShareExtensionAbility from the FA Model

harmony 鸿蒙AccessibilityExtensionAbility

harmony 鸿蒙Common action and entities Values

harmony 鸿蒙API Switching Overview

harmony 鸿蒙Switching of app and deviceConfig

0  赞