diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/PlatformChannel.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/PlatformChannel.ets index e7155e04e64828f1de8ff49dd4737de3db23a51e..4b90f2f63cd7d8a6f96d8862ae39c13e501f7c05 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/PlatformChannel.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/PlatformChannel.ets @@ -325,6 +325,13 @@ class PlatformMethodCallback implements MethodCallHandler { break; case "SystemChrome.setApplicationSwitcherDescription": Log.d(PlatformMethodCallback.TAG, "setApplicationSwitcherDescription: " + JSON.stringify(args)); + try { + this.platform.platformMessageHandler.setApplicationSwitcherDescription(args); + result.success(null); + } catch (err) { + Log.e(PlatformMethodCallback.TAG, "setApplicationSwitcherDescription err:" + JSON.stringify(err)); + result.error("error", JSON.stringify(err), null); + } break; case "SystemChrome.setEnabledSystemUIOverlays": try { diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/PlatformPlugin.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/PlatformPlugin.ets index 14a84d6948165997b26818de97083bbbd1e06048..44b8ebe6d96157670b6c8dce7a73d9d16ffb6f2b 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/PlatformPlugin.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/PlatformPlugin.ets @@ -139,7 +139,15 @@ class PlatformPluginCallback implements PlatformMessageHandler { } setApplicationSwitcherDescription(description: AppSwitcherDescription) { - // representation described in the given {@code description}. + Log.d(PlatformPluginCallback.TAG, "setApplicationSwitcherDescription: " + JSON.stringify(description)); + try { + let label: string = description?.label; + this.uiAbilityContext?.setMissionLabel(label).then(() => { + Log.d(PlatformPluginCallback.TAG, "Succeeded in seting mission label"); + }) + } catch (err) { + Log.d(PlatformPluginCallback.TAG, "Failed to set mission label: " + JSON.stringify(err)); + } } showSystemOverlays(overlays: SystemUiOverlay[]) {