Signed-off-by: bishuixiu <bishuixiu1@huawei.com>

Remove redundant code.

Signed-off-by: bishuixiu <bishuixiu1@huawei.com>
This commit is contained in:
bishuixiu 2024-11-19 14:51:35 +08:00
parent 4a2685d5f0
commit 594212b7f1
4 changed files with 14 additions and 28 deletions

View File

@ -759,7 +759,7 @@ export default class ViewAbility extends ServiceExtensionAbility {
let callerAppId = want.parameters?.['ohos.aafwk.param.callerAppIdentifier'] as string;
if (callerAppId !== APPID_FOR_HOPE || paramCallerBundleName !== BUNDLE_NAME_FOR_HOPE) {
HiLog.error(TAG, `callerAppId or callerBundleNameis error.`);
await this.callAlertAbility({code: Constants.ERR_JS_NOT_AUTHORIZED_APPLICATION } as BusinessError);
await this.callAlertAbility({code: Constants.ERR_JS_NOT_AUTHORIZED_APPLICATION} as BusinessError);
return false;
}

View File

@ -14,19 +14,12 @@
*/
import { BusinessError } from '@ohos.base';
import display from '@ohos.display'
import StartOptions from '@ohos.app.ability.StartOptions';
import common from '@ohos.app.ability.common';
import UIExtensionContentSession from '@ohos.app.ability.UIExtensionContentSession';
import osAccount from '@ohos.account.osAccount';
import account_osAccount from '@ohos.account.osAccount';
import Constants from './constant';
import GlobalContext from './GlobalContext';
import deviceInfo from '@ohos.deviceInfo';
import promptAction from '@ohos.promptAction';
import { HiLog } from '../common/HiLog';
import AccountManager from '../manager/AccountManager';
import CommonUtil from './CommonUtil';
const TAG = 'AlertMessage';
@ -181,12 +174,6 @@ export class GetAlertMessage {
}
}
public static async checkAccountInfo(accountName: string): Promise<boolean> {
let domainAccount = await AccountManager.getDomainAccountByAccountName(accountName);
return !CommonUtil.isEmptyStr(domainAccount.accountName);
}
public static async requestModalUIExtension(context: common.UIAbilityContext | common.ServiceExtensionContext,
error: BusinessError) {
if (deviceInfo.deviceType !== '2in1') {

View File

@ -14,7 +14,6 @@
*/
export default class Constants {
public static FOOTER_ROW_WIDTH = '100%';
public static FOOTER_ROW_MARGIN = 8;
public static FOOTER_ROW_PAD_LEFT = 16;

View File

@ -553,12 +553,12 @@ async function sleep(milliSeconds: number): Promise<void> {
}
async function getConnectionStatus(exactly: boolean = true): Promise<boolean> {
HiLog.info(TAG, `Enter getConnectionStatus, exactly mode: ${exactly}}.`);
HiLog.info(TAG, `Enter getConnectionStatus, exactly mode: ${exactly}.`);
try {
const startTime = getCurrentTime();
let net: connection.NetHandle = await connection.getDefaultNet();
let capabilities: connection.NetCapabilities = await connection.getNetCapabilities(net);
let capabilities: connection.NetCapabilities = await connection.getNetCapabilities(net);
HiLog.info(TAG, `Succeeded to get net capabilities, ${JSON.stringify(capabilities)}.`);
let networkCap = capabilities.networkCap;