From a92baa880a4bcc7d8167b1ab287eee52ebf56bd7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rulong=20Chen=EF=BC=88=E9=99=88=E6=B1=9D=E9=BE=99=EF=BC=89?= Date: Fri, 9 Aug 2024 09:26:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E6=93=8E=E6=8E=A5=E5=8F=A3=E9=87=8D?= =?UTF-8?q?=E6=9E=84=EF=BC=8C=E4=BF=AE=E6=94=B9=E7=9B=B8=E5=85=B3=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit https://gitee.com/openharmony-sig/flutter_engine/pulls/374 Change-Id: Ib026196dea0e18c699bdb176bb6c9e1bcf92b941 --- .../integration_test/IntegrationTestPlugin.ets | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/integration_test/ohos/src/main/ets/components/integration_test/IntegrationTestPlugin.ets b/packages/integration_test/ohos/src/main/ets/components/integration_test/IntegrationTestPlugin.ets index 1b9bf02b13..e4cd285c62 100644 --- a/packages/integration_test/ohos/src/main/ets/components/integration_test/IntegrationTestPlugin.ets +++ b/packages/integration_test/ohos/src/main/ets/components/integration_test/IntegrationTestPlugin.ets @@ -12,7 +12,7 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +import { common } from '@kit.AbilityKit'; import { AbilityAware, AbilityPluginBinding, @@ -25,14 +25,13 @@ import { MethodChannel, MethodResult, } from '@ohos/flutter_ohos'; -import UIAbility from '@ohos.app.ability.UIAbility'; const TAG = "IntegrationTestPlugin" export default class IntegrationTestPlugin implements MethodCallHandler, FlutterPlugin, AbilityAware { private static CHANNEL: string = "plugins.flutter.io/integration_test"; private methodChannel: MethodChannel | null = null; - private flutterAbility: UIAbility | null = null; + private context: common.UIAbilityContext | null = null; private static testResultsSetter: Set>; getUniqueClassName(): string { @@ -89,11 +88,11 @@ export default class IntegrationTestPlugin implements MethodCallHandler, Flutter onAttachedToAbility(binding: AbilityPluginBinding) { Log.w(TAG, 'flutter IntegrationTestPlugin onAttachedToAbility'); - this.flutterAbility = binding.getAbility(); + this.context = binding.getAbilityContext(); } onDetachedFromAbility() { Log.w(TAG, 'flutter IntegrationTestPlugin onDetachedFromAbility'); - this.flutterAbility = null; + this.context = null; } } \ No newline at end of file -- Gitee