): void {
if (this.isAttached()) {
flutter.nativeSetViewportMetrics(this.nativeShellHolderId!, devicePixelRatio,
- physicalWidth,
- physicalHeight,
- physicalPaddingTop,
- physicalPaddingRight,
- physicalPaddingBottom,
- physicalPaddingLeft,
- physicalViewInsetTop,
- physicalViewInsetRight,
- physicalViewInsetBottom,
- physicalViewInsetLeft,
- systemGestureInsetTop,
- systemGestureInsetRight,
- systemGestureInsetBottom,
- systemGestureInsetLeft,
- physicalTouchSlop,
- displayFeaturesBounds,
- displayFeaturesType,
- displayFeaturesState);
+ physicalWidth, physicalHeight, physicalPaddingTop, physicalPaddingRight,
+ physicalPaddingBottom, physicalPaddingLeft, physicalViewInsetTop,
+ physicalViewInsetRight, physicalViewInsetBottom, physicalViewInsetLeft,
+ systemGestureInsetTop, systemGestureInsetRight, systemGestureInsetBottom,
+ systemGestureInsetLeft, physicalTouchSlop, displayFeaturesBounds,
+ displayFeaturesType, displayFeaturesState);
}
}
@@ -497,6 +476,11 @@ export default class FlutterNapi {
flutter.nativeSetTextureBackGroundPixelMap(this.nativeShellHolderId!, textureId, pixelMap);
}
+ setTextureBackGroundColor(textureId: number, color: number): void {
+ Log.d(TAG, "called setTextureBackGroundColor ");
+ flutter.nativeSetTextureBackGroundColor(this.nativeShellHolderId!, textureId, color);
+ }
+
registerTexture(textureId: number): number {
Log.d(TAG, "called registerTexture ");
if (!this.isAttached()) {
@@ -570,6 +554,9 @@ export default class FlutterNapi {
return Boolean(flutter.nativeUnicodeIsRegionalIndicatorSymbol(code));
}
+ SetDVsyncSwitch(isEnable: boolean): void {
+ flutter.nativeSetDVsyncSwitch(this.nativeShellHolderId!, isEnable);
+ }
}
export interface AccessibilityDelegate {
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterOverlaySurface.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterOverlaySurface.ets
index 2d63d83de313f52eba3f8fa6d2ed584f7bee44bd..00473afb69bd75bf93852bf219d6c302594ea5b6 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterOverlaySurface.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterOverlaySurface.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on FlutterOverlaySurface.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
export class FlutterOverlaySurface {
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterShellArgs.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterShellArgs.ets
index 604c4900106515617821e8c43d3900ab1cd7d66b..d01c6709e55ea700422c36b8c35148ed00b2ae59 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterShellArgs.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterShellArgs.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on FlutterShellArgs.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
import Want from '@ohos.app.ability.Want';
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/dart/DartExecutor.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/dart/DartExecutor.ets
index 2c41446b2a710cbd3cf11aa7431b0ef8f5fdfac1..fdc79bfdec288be1fd77e9d88c47672fdc6d409e 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/dart/DartExecutor.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/dart/DartExecutor.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on DartExecutor.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
import resourceManager from '@ohos.resourceManager';
import FlutterInjector from '../../../FlutterInjector';
@@ -179,12 +174,13 @@ export default class DartExecutor implements BinaryMessenger {
/**
* Returns the number of pending channel callback replies.
*
- * When sending messages to the Flutter application using {@link BinaryMessenger#send(String,
+ *
When sending messages to the Flutter application
+ * using {@link BinaryMessenger#send(String,
* ByteBuffer, io.flutter.plugin.common.BinaryMessenger.BinaryReply)}, developers can optionally
* specify a reply callback if they expect a reply from the Flutter application.
*
- *
This method tracks all the pending callbacks that are waiting for response, and is supposed
- * to be called from the main thread (as other methods). Calling from a different thread could
+ *
This method tracks all the pending callbacks that are waiting for response,
+ * and is supposed to be called from the main thread (as other methods). Calling from a different thread could
* possibly capture an indeterministic internal state, so don't do it.
*
*
Currently, it's mainly useful for a testing framework like Espresso to determine whether all
@@ -333,8 +329,8 @@ export class DefaultBinaryMessenger implements BinaryMessenger {
/**
* Sets the given {@link io.flutter.plugin.common.BinaryMessenger.BinaryMessageHandler} as the
- * singular handler for all incoming messages received from the Dart side of this Dart execution
- * context.
+ * singular handler for all incoming messages received from the Dart side of
+ * this Dart execution context.
*
* @param channel the name of the channel.
* @param handler a {@link BinaryMessageHandler} to be invoked on incoming messages, or null.
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/dart/DartMessenger.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/dart/DartMessenger.ets
index a1773db5c745c9111fcc3fda82ccde07e0d50bd2..978bb22aa746813239b795a134cd7290325cbd4e 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/dart/DartMessenger.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/dart/DartMessenger.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on DartMessenger.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
import { ErrorEvent, Queue, taskpool, worker, MessageEvents, JSON } from '@kit.ArkTS';
@@ -149,12 +144,12 @@ export class DartMessenger implements BinaryMessenger, PlatformMessageHandler {
* Returns the number of pending channel callback replies.
*
*
When sending messages to the Flutter application using {@link BinaryMessenger#send(String,
- * ByteBuffer, io.flutter.plugin.common.BinaryMessenger.BinaryReply)}, developers can optionally
- * specify a reply callback if they expect a reply from the Flutter application.
+ * ByteBuffer, io.flutter.plugin.common.BinaryMessenger.BinaryReply)},developers can
+ * optionally specify a reply callback if they expect a reply from the Flutter application.
*
*
This method tracks all the pending callbacks that are waiting for response, and is supposed
- * to be called from the main thread (as other methods). Calling from a different thread could
- * possibly capture an indeterministic internal state, so don't do it.
+ * to be called from the main thread (as other methods). Calling from a different thread
+ * could possibly capture an indeterministic internal state, so don't do it.
*/
getPendingChannelResponseCount(): number {
return this.pendingReplies.size;
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/dart/PlatformMessageHandler.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/dart/PlatformMessageHandler.ets
index b6e3411862cb936f4e9af2c6e0ab6a49be3c9dce..221be11bf72c5502741aa2878155a2bbd01dc2e3 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/dart/PlatformMessageHandler.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/dart/PlatformMessageHandler.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on PlatformMessageHandler.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
export interface PlatformMessageHandler {
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/loader/ApplicationInfoLoader.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/loader/ApplicationInfoLoader.ets
index 3c5bca80d380c5387ac2c872b35f860e3e8eacad..af38619d3b64bba9f0cbdec2977beb0d178bb916 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/loader/ApplicationInfoLoader.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/loader/ApplicationInfoLoader.ets
@@ -1,16 +1,7 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*/
import FlutterApplicationInfo from './FlutterApplicationInfo';
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/loader/FlutterApplicationInfo.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/loader/FlutterApplicationInfo.ets
index e170586a89c865338c314cb4badc16772eb1b5c0..3fdc397e3ffd2fb9d0c4166be867b0df8f150cf9 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/loader/FlutterApplicationInfo.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/loader/FlutterApplicationInfo.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on FlutterApplicationInfo.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
import BuildProfile from "../../../../../../BuildProfile";
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/loader/FlutterLoader.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/loader/FlutterLoader.ets
index aaeb579a61b3b2415babfe5eeae14c7dd218616f..c5b764f63be268fbd877843509613f416cdc7b03 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/loader/FlutterLoader.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/loader/FlutterLoader.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on FlutterLoader.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
/**
@@ -81,12 +76,12 @@ export default class FlutterLoader {
/**
* Starts initialization of the native system.
*
- *
This loads the Flutter engine's native library to enable subsequent JNI calls. This also
- * starts locating and unpacking Dart resources packaged in the app's APK.
+ *
This loads the Flutter engine's native library to enable subsequent NAPI calls. This also
+ * starts locating and unpacking Dart resources packaged in the app's HAP.
*
*
Calling this method multiple times has no effect.
*
- * @param applicationContext The Android application context.
+ * @param applicationContext The Ohos application context.
* @param settings Configuration settings.
*/
async startInitialization(context: common.Context) {
@@ -240,6 +235,9 @@ export default class FlutterLoader {
}
getLookupKeyForAsset(asset: string, packageName?: string): string {
+ if (typeof packageName === 'string' && packageName.trim().length > 0) {
+ return this.fullAssetPathFrom('packages' + FILE_SEPARATOR + packageName + FILE_SEPARATOR + asset);
+ }
return this.fullAssetPathFrom(asset);
}
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/mutatorsstack/FlutterMutatorView.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/mutatorsstack/FlutterMutatorView.ets
index f439b570473a9abf5d278d2446b7965e11c3bc1d..4823741898abd6d5903cac22c37b70144719a139 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/mutatorsstack/FlutterMutatorView.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/mutatorsstack/FlutterMutatorView.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on FlutterMutatorView.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
import ArrayList from '@ohos.util.ArrayList';
import matrix4 from '@ohos.matrix4';
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/mutatorsstack/FlutterMutatorsStack.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/mutatorsstack/FlutterMutatorsStack.ets
index 2f53c6c041bfd92ea74c3896d00a04f6b5590e2e..a71c0b9da6dc19fb2989d47a2ad54edafd8c4f7b 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/mutatorsstack/FlutterMutatorsStack.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/mutatorsstack/FlutterMutatorsStack.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on FlutterMutatorsStack.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
import matrix4 from '@ohos.matrix4'
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/FlutterPlugin.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/FlutterPlugin.ets
index 92e08f8dd9c22e441ecfe852895522a7417f859b..28a0df9438d313dc067e46b2a638f9c1d39641fc 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/FlutterPlugin.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/FlutterPlugin.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on FlutterPlugin.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
import common from '@ohos.app.ability.common';
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/PluginRegistry.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/PluginRegistry.ets
index 1a322ec2ba1bbcfcbce180b00ec4df6356733180..d8beda52973843876ed79d34a08ce83bfa19081a 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/PluginRegistry.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/PluginRegistry.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on PluginRegistry.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
import { FlutterPlugin } from './FlutterPlugin';
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/ability/AbilityAware.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/ability/AbilityAware.ets
index b3d9b9df83522545bef2893d26b02dc297c8b908..d6129d420b342c4570d44151598400602cd17c15 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/ability/AbilityAware.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/ability/AbilityAware.ets
@@ -1,16 +1,7 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
+ * Copyright 2013 The Flutter Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
*/
/**
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/ability/AbilityControlSurface.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/ability/AbilityControlSurface.ets
index 947ccef4ba35c189f2c74f81c0f53eaf025cba36..1ecf2966b41bdb14fca91836dc6e3ddbf0247e7a 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/ability/AbilityControlSurface.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/ability/AbilityControlSurface.ets
@@ -1,16 +1,7 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
+ * Copyright 2013 The Flutter Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
*/
import AbilityConstant from '@ohos.app.ability.AbilityConstant';
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/ability/AbilityPluginBinding.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/ability/AbilityPluginBinding.ets
index 349010b14ee70aff187ff938c146f14d6c7a080e..d7269d2e028e9738e0c69edef959c24933b6b17a 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/ability/AbilityPluginBinding.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/plugins/ability/AbilityPluginBinding.ets
@@ -1,16 +1,7 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
+ * Copyright 2013 The Flutter Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
*/
import UIAbility from '@ohos.app.ability.UIAbility'
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/renderer/FlutterRenderer.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/renderer/FlutterRenderer.ets
index 9d00c43494d9784aadd88ee16b3f41ae561054f8..c1ffc886e32b13555e6d6a2d4c40c2ffbb1f9d75 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/renderer/FlutterRenderer.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/renderer/FlutterRenderer.ets
@@ -1,16 +1,7 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*/
import image from '@ohos.multimedia.image';
@@ -66,6 +57,10 @@ export class FlutterRenderer implements TextureRegistry {
this.flutterNapi.setTextureBackGroundPixelMap(textureId, pixelMap);
}
+ setTextureBackGroundColor(textureId: number, color: number): void {
+ this.flutterNapi.setTextureBackGroundColor(textureId, color);
+ }
+
setTextureBufferSize(textureId: number, width: number, height: number): void {
this.flutterNapi.setTextureBufferSize(textureId, width, height);
}
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/renderer/FlutterUiDisplayListener.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/renderer/FlutterUiDisplayListener.ets
index 2a0af4009cafd2cf5229f082a41ed2d445c69caa..334625667d51c5b93cd9bafd60b18a53b317d18a 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/renderer/FlutterUiDisplayListener.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/renderer/FlutterUiDisplayListener.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on FlutterUiDisplayListener.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
export interface FlutterUiDisplayListener {
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/renderer/SurfaceTextureWrapper.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/renderer/SurfaceTextureWrapper.ets
index b1da18061bc2398f9ce0acd5f9f2c42e248b9204..910745dce820e8997528ccc1869b635eebae643b 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/renderer/SurfaceTextureWrapper.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/renderer/SurfaceTextureWrapper.ets
@@ -1,16 +1,7 @@
/*
- * Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*/
import image from '@ohos.multimedia.image';
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/AccessibilityChannel.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/AccessibilityChannel.ets
index bbc5a658ea5c9af1e99f69a45e737b861fabcfd8..c743b3438c2c8f371c0e950df4ce0d76248718ae 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/AccessibilityChannel.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/AccessibilityChannel.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on AccessibilityChannel.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
import Log from '../../../util/Log';
@@ -122,24 +117,32 @@ export interface AccessibilityMessageHandler extends AccessibilityDelegate {
announce(message: string): void;
onTap(nodeId: number): void;
onLongPress(nodeId: number): void;
- onTooltip(nodeId: string): void;
+ onTooltip(message: string): void;
}
export class DefaultHandler implements AccessibilityMessageHandler {
- private static TAG = "AccessibilityMessageHandler";
+ private static TAG = "AccessibilityMessageHandler";
+
announce(message: string): void {
Log.i(DefaultHandler.TAG, "handler announce.");
- flutter.nativeAnnounce(message);
+ flutter.nativeAccessibilityAnnounce(message);
}
+
onTap(nodeId: number): void {
Log.i(DefaultHandler.TAG, "handler onTap.");
+ flutter.nativeAccessibilityOnTap(nodeId);
}
+
onLongPress(nodeId: number): void {
Log.i(DefaultHandler.TAG, "handler onLongPress.");
+ flutter.nativeAccessibilityOnLongPress(nodeId);
}
- onTooltip(nodeId: string): void {
+
+ onTooltip(message: string): void {
Log.i(DefaultHandler.TAG, "handler onTooltip.");
+ flutter.nativeAccessibilityOnTooltip(message);
}
+
updateSemantics(buffer: ByteBuffer, strings: string[], stringAttributeArgs: ByteBuffer[]): void {
Log.i(DefaultHandler.TAG, "handler updateSemantics");
}
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/KeyEventChannel.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/KeyEventChannel.ets
index 4c863bc8bd38df145d113ebc57b01f41bcc40d7d..3b3c0e27111a2f89e7f748e24faa881660a47a99 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/KeyEventChannel.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/KeyEventChannel.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on KeyEventChannel.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
import BasicMessageChannel from '../../../plugin/common/BasicMessageChannel';
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/LifecycleChannel.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/LifecycleChannel.ets
index ce5acbdbbae50078e7c339c767a34a178413bf2d..43de222074409ebbca20f2fb072e4000fe227323 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/LifecycleChannel.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/LifecycleChannel.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on LifecycleChannel.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
import Log from '../../../util/Log';
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/LocalizationChannel.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/LocalizationChannel.ets
index f8d8d27c935626c1e6962720fbc825a884e88a0d..f2ac95b25296e820c90d2fe7ed32e5236af8efd7 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/LocalizationChannel.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/LocalizationChannel.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on LocalizationChannel.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
import DartExecutor from '../dart/DartExecutor';
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/MouseCursorChannel.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/MouseCursorChannel.ets
index 3e8b3d4167c3aeb9c08e657e8c504e7c51f5214d..2b431bf694f51051a5f71549f10b3a61eb3e517d 100644
--- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/MouseCursorChannel.ets
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/MouseCursorChannel.ets
@@ -1,16 +1,11 @@
/*
-* Copyright (c) 2023 Hunan OpenValley Digital Industry Development 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
+* Copyright (c) 2023 Hunan OpenValley Digital Industry Development Co., Ltd. All rights reserved.
+* Use of this source code is governed by a BSD-style license that can be
+* found in the LICENSE_KHZG file.
*
-* http://www.apache.org/licenses/LICENSE-2.0
+* Based on MouseCursorChannel.java originally written by
+* Copyright (C) 2013 The Flutter Authors.
*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
*/
import HashMap from '@ohos.util.HashMap';
diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/NativeVsyncChannel.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/NativeVsyncChannel.ets
new file mode 100644
index 0000000000000000000000000000000000000000..2876b6fbb8501e7e0f88e6a6f011b7703f2090f1
--- /dev/null
+++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/NativeVsyncChannel.ets
@@ -0,0 +1,50 @@
+/*
+* Copyright (c) 2024 Hunan OpenValley Digital Industry Development 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
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*/
+
+import Log from '../../../util/Log';
+import DartExecutor from '../dart/DartExecutor';
+import BasicMessageChannel, { MessageHandler, Reply} from '../../../plugin/common/BasicMessageChannel';
+import HashMap from '@ohos.util.HashMap';
+import StandardMessageCodec from '../../../plugin/common/StandardMessageCodec';
+import StringUtils from '../../../util/StringUtils';
+import Any from '../../../plugin/common/Any';
+import FlutterNapi from '../FlutterNapi';
+
+/**
+* nativeVsync功能channel
+*/
+export default class NativeVsyncChannel implements MessageHandler