From 10e8cebef9fa647a3d7aba0d4402d61e1b8357b5 Mon Sep 17 00:00:00 2001 From: lovechinamo Date: Tue, 19 Jul 2022 17:16:31 +0800 Subject: [PATCH 1/2] Signed-off-by: lovechinamo Changes to be committed: --- .../main/extend/systemplugin/napi/ohos_wallpaper.js | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/runtime/main/extend/systemplugin/napi/ohos_wallpaper.js b/runtime/main/extend/systemplugin/napi/ohos_wallpaper.js index 3a8e0a14..c6e1304b 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_wallpaper.js +++ b/runtime/main/extend/systemplugin/napi/ohos_wallpaper.js @@ -48,6 +48,18 @@ export function mockWallpaper() { }) } }, + getFile: function (...args) { + console.warn("wallpaper.getFile interface mocked in the Previewer. How this interface works on the" + + " Previewer may be different from that on a real device.") + const len = args.length + if (typeof args[len - 1] === 'function') { + args[len - 1].call(this, paramMock.businessErrorMock, paramMock.paramNumberMock) + } else { + return new Promise((resolve, reject) => { + resolve(paramMock.paramNumberMock); + }) + } + }, getMinHeight: function (...args) { console.warn("wallpaper.getMinHeight interface mocked in the Previewer. How this interface works on the" + " Previewer may be different from that on a real device.") From a1d19deb73781a0aa58ddffe8d4888882497705c Mon Sep 17 00:00:00 2001 From: lovechinamo Date: Wed, 20 Jul 2022 09:55:14 +0800 Subject: [PATCH 2/2] Signed-off-by: lovechinamo Changes to be committed: --- runtime/main/extend/systemplugin/napi/ohos_wallpaper.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runtime/main/extend/systemplugin/napi/ohos_wallpaper.js b/runtime/main/extend/systemplugin/napi/ohos_wallpaper.js index c6e1304b..e8af46e3 100644 --- a/runtime/main/extend/systemplugin/napi/ohos_wallpaper.js +++ b/runtime/main/extend/systemplugin/napi/ohos_wallpaper.js @@ -1,5 +1,5 @@ /* - * Copyright (c) 2021 Huawei Device Co., Ltd. + * Copyright (c) 2021-2022 Huawei Device Co., Ltd. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at