diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterNapi.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterNapi.ets index 37c50126ce76c20b401b6284c535550f7eda0bef..75ec3f3f3c59089553a1f107dba6427802541ef0 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterNapi.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/FlutterNapi.ets @@ -217,24 +217,12 @@ export default class FlutterNapi { , displayFeaturesType: Array, displayFeaturesState: Array): 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); } } 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 7bee8f8100deacf8356f211696e8d21586123e0e..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 @@ -174,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 @@ -328,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 3f8a71b9704ffae80b60c2395d43a24b35041479..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 @@ -144,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/loader/FlutterLoader.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/loader/FlutterLoader.ets index a5c5dd6ecbd0bec5c534943e290a2aaa459b5773..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 @@ -76,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) { diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/RestorationChannel.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/RestorationChannel.ets index 2da3631c48e8828a251b770fa99ed73b4013c69d..cc8068d5a19cd2056682321cde7d6d0fee8ef0dd 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/RestorationChannel.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/embedding/engine/systemchannels/RestorationChannel.ets @@ -20,15 +20,15 @@ import DartExecutor from '../dart/DartExecutor'; * System channel to exchange restoration data between framework and engine. * *

The engine can obtain the current restoration data from the framework via this channel to - * store it on disk and - when the app is relaunched - provide the stored data back to the framework - * to recreate the original state of the app. + * store it on disk and - when the app is relaunched - provide the stored data back to + * the framework to recreate the original state of the app. * *

The channel can be configured to delay responding to the framework's request for restoration * data via {@code waitForRestorationData} until the engine-side has provided the data. This is * useful when the engine is pre-warmed at a point in the application's life cycle where the * restoration data is not available yet. For example, if the engine is pre-warmed as part of the - * Application before an Activity is created, this flag should be set to true because Android will - * only provide the restoration data to the Activity during the onCreate callback. + * Application before an Activity is created, this flag should be set to true because Ohos + * will only provide the restoration data to the Activity during the onCreate callback. * *

The current restoration data provided by the framework can be read via {@code * getRestorationData()}. @@ -39,17 +39,17 @@ export default class RestorationChannel { private static CHANNEL_NAME = "flutter/restoration"; /** - * Whether the channel delays responding to the framework's initial request for restoration data - * until {@code setRestorationData} has been called. + * Whether the channel delays responding to the framework's initial request for restoration + * data until {@code setRestorationData} has been called. * - *

If the engine never calls {@code setRestorationData} this flag must be set to false. If set - * to true, the engine must call {@code setRestorationData} either with the actual restoration + *

If the engine never calls {@code setRestorationData} this flag must be set to false. + * If set to true, the engine must call {@code setRestorationData} either with the actual restoration * data as argument or null if it turns out that there is no restoration data. * *

If the response to the framework's request for restoration data is not delayed until the * data has been set via {@code setRestorationData}, the framework may intermittently initialize - * itself to default values until the restoration data has been made available. Setting this flag - * to true avoids that extra work. + * itself to default values until the restoration data has been made available. Setting + * this flag to true avoids that extra work. */ public waitForRestorationData: boolean = false; diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BackgroundBasicMessageChannel.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BackgroundBasicMessageChannel.ets index cf7cc4d63a54378a4946c4851f7601fabe377273..e840bc3b001066053f8727d28d15fa9aa04aad62 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BackgroundBasicMessageChannel.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BackgroundBasicMessageChannel.ets @@ -15,15 +15,15 @@ import SendableMessageHandler from './SendableMessageHandler'; import StringUtils from '../../util/StringUtils'; /** - * A named channel for communicating with the Flutter application using basic, asynchronous message - * passing. + * A named channel for communicating with the Flutter application using basic, asynchronous + * message passing. * *

Messages are encoded into binary before being sent, and binary messages received are decoded - * into Java objects. The {@link MessageCodec} used must be compatible with the one used by the - * Flutter application. This can be achieved by creating a BasicMessageChannel - * counterpart of this channel on the Dart side. The static Java type of messages sent and received - * is {@code Object}, but only values supported by the specified {@link MessageCodec} can be used. + * counterpart of this channel on the Dart side. The static Java type of messages sent + * and received is {@code Object}, but only values supported by the specified {@link MessageCodec} can be used. * *

The logical identity of the channel is given by its name. Identically named channels will * interfere with each other's communication. @@ -57,13 +57,13 @@ export default class BackgroundBasicMessageChannel { } /** - * Registers a message handler on this channel for receiving messages sent from the Flutter - * application. + * Registers a message handler on this channel for receiving messages sent from the + * Flutter application. * *

Overrides any existing handler registration for (the name of) this channel. * - *

If no handler has been registered, any incoming message on this channel will be handled - * silently by sending a null reply. + *

If no handler has been registered, any incoming message on this channel will be + * handled silently by sending a null reply. * * @param handler a {@link MessageHandler}, or null to deregister. */ diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BackgroundMethodChannel.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BackgroundMethodChannel.ets index 8e9294f0ae808d16c874119dcaff08f3674abe63..9ed93b9127abc82fb864bbef830efbb90a2daabe 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BackgroundMethodChannel.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BackgroundMethodChannel.ets @@ -17,14 +17,15 @@ import SendableMethodCodec from './SendableMethodCodec' import SendableBinaryMessageHandler from './SendableBinaryMessageHandler' /** - * A named channel for communicating with the Flutter application using asynchronous method calls. + * A named channel for communicating with the Flutter application using asynchronous method + * calls. * *

Incoming method calls are decoded from binary on receipt, and Java results are encoded into - * binary before being transmitted back to Flutter. The {@link MethodCodec} used must be compatible - * with the one used by the Flutter application. This can be achieved by creating a MethodChannel - * counterpart of this channel on the Dart side. The Java type of method call arguments and results - * is {@code Object}, but only values supported by the specified {@link MethodCodec} can be used. + * counterpart of this channel on the Dart side. The Java type of method call arguments and + * results is {@code Object}, but only values supported by the specified {@link MethodCodec} can be used. * *

The logical identity of the channel is given by its name. Identically named channels will * interfere with each other's communication. @@ -53,7 +54,8 @@ export default class BackgroundMethodChannel { /** * Invokes a method on this channel, optionally expecting a result. * - *

Any uncaught exception thrown by the result callback will be caught and logged. + *

Any uncaught exception thrown by the result callback will be caught and + * logged. * * @param method the name String of the method. * @param arguments the arguments for the invocation, possibly null. @@ -70,12 +72,12 @@ export default class BackgroundMethodChannel { * *

Overrides any existing handler registration for (the name of) this channel. * - *

If no handler has been registered, any incoming method call on this channel will be handled - * silently by sending a null reply. This results in a MissingPluginException - * on the Dart side, unless an OptionalMethodChannel - * is used. + *

If no handler has been registered, any incoming method call on this channel will + * be handled silently by sending a null reply. This results in a MissingPluginException on the Dart side, unless an OptionalMethodChannel is used. * * @param handler a {@link MethodCallHandler}, or null to deregister. */ diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BasicMessageChannel.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BasicMessageChannel.ets index 464a23f56b0c372135b95839daede5878fb58f95..cf0b5a0a92b6931d01428f7f66cc985cd8eeb61b 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BasicMessageChannel.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BasicMessageChannel.ets @@ -17,15 +17,15 @@ import { BinaryMessenger } from './BinaryMessenger'; import StringUtils from '../../util/StringUtils'; /** - * A named channel for communicating with the Flutter application using basic, asynchronous message - * passing. + * A named channel for communicating with the Flutter application using basic, asynchronous + * message passing. * - *

Messages are encoded into binary before being sent, and binary messages received are decoded - * into Java objects. The {@link MessageCodec} used must be compatible with the one used by the + *

Messages are encoded into binary before being sent, and binary messages received are + * decoded into Java objects. The {@link MessageCodec} used must be compatible with the one used by the * Flutter application. This can be achieved by creating a BasicMessageChannel - * counterpart of this channel on the Dart side. The static Java type of messages sent and received - * is {@code Object}, but only values supported by the specified {@link MessageCodec} can be used. + * counterpart of this channel on the Dart side. The static Java type of messages sent and + * received is {@code Object}, but only values supported by the specified {@link MessageCodec} can be used. * *

The logical identity of the channel is given by its name. Identically named channels will * interfere with each other's communication. @@ -56,13 +56,13 @@ export default class BasicMessageChannel { } /** - * Registers a message handler on this channel for receiving messages sent from the Flutter - * application. + * Registers a message handler on this channel for receiving messages sent from the + * Flutter application. * *

Overrides any existing handler registration for (the name of) this channel. * - *

If no handler has been registered, any incoming message on this channel will be handled - * silently by sending a null reply. + *

If no handler has been registered, any incoming message on this channel will be + * handled silently by sending a null reply. * * @param handler a {@link MessageHandler}, or null to deregister. */ @@ -99,12 +99,12 @@ export interface MessageHandler { * message to the given {@link Reply}. Failure to do so will result in lingering Flutter reply * handlers. The reply may be submitted asynchronously and invoked on any thread. * - *

Any uncaught exception thrown by this method, or the preceding message decoding, will be - * caught by the channel implementation and logged, and a null reply message will be sent back + *

Any uncaught exception thrown by this method, or the preceding message decoding, + * will be caught by the channel implementation and logged, and a null reply message will be sent back * to Flutter. * - *

Any uncaught exception thrown during encoding a reply message submitted to the {@link - * Reply} is treated similarly: the exception is logged, and a null reply is sent to Flutter. + *

Any uncaught exception thrown during encoding a reply message submitted to the + * {@link Reply} is treated similarly: the exception is logged, and a null reply is sent to Flutter. * * @param message the message, possibly null. * @param reply a {@link Reply} for sending a single message reply back to Flutter. diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BinaryMessenger.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BinaryMessenger.ets index 0de3c3a4a618e3aef28ab6a710407849454e20d0..b28933e547f0dac458d2d728f79531c0d262b692 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BinaryMessenger.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/BinaryMessenger.ets @@ -12,9 +12,9 @@ * An abstraction over the threading policy used to invoke message handlers. * *

These are generated by calling methods like {@link - * BinaryMessenger#makeBackgroundTaskQueue(TaskQueueOptions)} and can be passed into platform - * channels' constructors to control the threading policy for handling platform channels' - * messages. + * BinaryMessenger#makeBackgroundTaskQueue(TaskQueueOptions)} and can be passed into + * platform channels' constructors to control the threading policy for handling platform + * channels' messages. */ import SendableBinaryMessageHandler from './SendableBinaryMessageHandler' @@ -89,12 +89,12 @@ export interface BinaryMessageHandler { /** * Handles the specified message. * - *

Handler implementations must reply to all incoming messages, by submitting a single reply - * message to the given {@link BinaryReply}. Failure to do so will result in lingering Flutter + *

Handler implementations must reply to all incoming messages, by submitting a single + * reply message to the given {@link BinaryReply}. Failure to do so will result in lingering Flutter * reply handlers. The reply may be submitted asynchronously. * - *

Any uncaught exception thrown by this method will be caught by the messenger - * implementation and logged, and a null reply message will be sent back to Flutter. + *

Any uncaught exception thrown by this method will be caught by the + * messenger implementation and logged, and a null reply message will be sent back to Flutter. * * @param message the message {@link ByteBuffer} payload, possibly null. * @param reply A {@link BinaryReply} used for submitting a reply back to Flutter. @@ -103,18 +103,18 @@ export interface BinaryMessageHandler { } /** - * Facility for communicating with Flutter using asynchronous message passing with binary messages. - * The Flutter Dart code should use BinaryMessages to * participate. * *

{@code BinaryMessenger} is expected to be utilized from a single thread throughout the - * duration of its existence. If created on the main thread, then all invocations should take place - * on the main thread. If created on a background thread, then all invocations should take place on + * duration of its existence. If created on the main thread, then all invocations should take + * place on the main thread. If created on a background thread, then all invocations should take place on * that background thread. * - * @see BasicMessageChannel , which supports message passing with Strings and semi-structured - * messages. + * @see BasicMessageChannel , which supports message passing with Strings and + * semi-structured messages. * @see MethodChannel , which supports communication using asynchronous method invocation. * @see EventChannel , which supports communication using event streams. */ @@ -137,27 +137,28 @@ export interface BinaryMessenger { *

Any uncaught exception thrown by the reply callback will be caught and logged. * * @param channel the name {@link String} of the logical channel used for the message. - * @param message the message payload, a direct-allocated {@link ByteBuffer} with the message - * bytes between position zero and current position, or null. - * @param callback a {@link BinaryReply} callback invoked when the Flutter application responds to - * the message, possibly null. + * @param message the message payload, a direct-allocated {@link ByteBuffer} with the + * message bytes between position zero and current position, or null. + * @param callback a {@link BinaryReply} callback invoked when the Flutter application + * responds to the message, possibly null. */ send(channel: String, message: ArrayBuffer, callback?: BinaryReply | null): void; /** - * Registers a handler to be invoked when the Flutter application sends a message to its host - * platform. + * Registers a handler to be invoked when the Flutter application sends a message to its + * host platform. * - *

Registration overwrites any previous registration for the same channel name. Use a null - * handler to deregister. + *

Registration overwrites any previous registration for the same channel name. Use + * a null handler to deregister. * - *

If no handler has been registered for a particular channel, any incoming message on that - * channel will be handled silently by sending a null reply. + *

If no handler has been registered for a particular channel, any incoming message + * on that channel will be handled silently by sending a null reply. * * @param channel the name {@link String} of the channel. - * @param handler a {@link BinaryMessageHandler} to be invoked on incoming messages, or null. - * @param taskQueue a {@link BinaryMessenger.TaskQueue} that specifies what thread will execute - * the handler. Specifying null means execute on the platform thread. + * @param handler a {@link BinaryMessageHandler} to be invoked on incoming messages, + * or null. + * @param taskQueue a {@link BinaryMessenger.TaskQueue} that specifies what thread + * will execute the handler. Specifying null means execute on the platform thread. */ setMessageHandler(channel: String, handler: BinaryMessageHandler | SendableBinaryMessageHandler | null, taskQueue?: TaskQueue, ...args: Object[]): void; } diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/MethodChannel.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/MethodChannel.ets index a624188a7fc1800286e26cb791bacc1b34f9b047..4eae0c0dc0b412f784de903ed3e306e90b8ee493 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/MethodChannel.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/MethodChannel.ets @@ -20,15 +20,15 @@ import StandardMethodCodec from './StandardMethodCodec'; /** * A named channel for communicating with the Flutter application using asynchronous method calls. * - *

Incoming method calls are decoded from binary on receipt, and Java results are encoded into - * binary before being transmitted back to Flutter. The {@link MethodCodec} used must be compatible - * with the one used by the Flutter application. This can be achieved by creating a Incoming method calls are decoded from binary on receipt, and Java results are encoded + * into binary before being transmitted back to Flutter. The {@link MethodCodec} used must be + * compatible with the one used by the Flutter application. This can be achieved by creating a MethodChannel * counterpart of this channel on the Dart side. The Java type of method call arguments and results * is {@code Object}, but only values supported by the specified {@link MethodCodec} can be used. * - *

The logical identity of the channel is given by its name. Identically named channels will - * interfere with each other's communication. + *

The logical identity of the channel is given by its name. Identically named channels + * will interfere with each other's communication. */ export default class MethodChannel { @@ -46,11 +46,13 @@ export default class MethodChannel { /** * Invokes a method on this channel, optionally expecting a result. * - *

Any uncaught exception thrown by the result callback will be caught and logged. + *

Any uncaught exception thrown by the result callback will be caught and + * logged. * * @param method the name String of the method. * @param arguments the arguments for the invocation, possibly null. - * @param callback a {@link Result} callback for the invocation result, or null. + * @param callback a {@link Result} callback for the invocation result, + * or null. */ invokeMethod(method: string, args: Any, callback?: MethodResult): void { this.messenger.send(this.name, this.codec.encodeMethodCall(new MethodCall(method, args)), callback == null ? null : new IncomingResultHandler(callback, this.codec)); @@ -61,12 +63,12 @@ export default class MethodChannel { * *

Overrides any existing handler registration for (the name of) this channel. * - *

If no handler has been registered, any incoming method call on this channel will be handled - * silently by sending a null reply. This results in a MissingPluginException - * on the Dart side, unless an OptionalMethodChannel - * is used. + *

If no handler has been registered, any incoming method call on this channel will be + * handled silently by sending a null reply. This results in a MissingPluginException< + * /a> on the Dart side, unless an OptionalMethodChannel< + * /a> is used. * * @param handler a {@link MethodCallHandler}, or null to deregister. */ @@ -89,17 +91,17 @@ export interface MethodCallHandler { /** * Handles the specified method call received from Flutter. * - *

Handler implementations must submit a result for all incoming calls, by making a single - * call on the given {@link Result} callback. Failure to do so will result in lingering Flutter - * result handlers. The result may be submitted asynchronously and on any thread. Calls to + *

Handler implementations must submit a result for all incoming calls, by making a + * single call on the given {@link Result} callback. Failure to do so will result in lingering + * Flutter result handlers. The result may be submitted asynchronously and on any thread. Calls to * unknown or unimplemented methods should be handled using {@link Result#notImplemented()}. * - *

Any uncaught exception thrown by this method will be caught by the channel implementation - * and logged, and an error result will be sent back to Flutter. + *

Any uncaught exception thrown by this method will be caught by the channel + * implementation and logged, and an error result will be sent back to Flutter. * *

The handler is called on the platform thread (Android main thread) by default, or - * otherwise on the thread specified by the {@link BinaryMessenger.TaskQueue} provided to the - * associated {@link MethodChannel} when it was created. See also Threading in * the Flutter Engine. * @@ -132,9 +134,9 @@ export interface MethodResult { * * @param errorCode An error code String. * @param errorMessage A human-readable error message String, possibly null. - * @param errorDetails Error details, possibly null. The details must be an Object type - * supported by the codec. For instance, if you are using {@link StandardMessageCodec} - * (default), please see its documentation on what types are supported. + * @param errorDetails Error details, possibly null. The details must be an Object + * type supported by the codec. For instance, if you are using {@link + * StandardMessageCodec} (default), please see its documentation on what types are supported. */ error: (errorCode: string, errorMessage: string, errorDetails: Any) => void; diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/MethodCodec.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/MethodCodec.ets index c61d977852809140768e6889128986154d22df91..62f81fb8111e1fb4fe580836e00833ff864cd164 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/MethodCodec.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/MethodCodec.ets @@ -13,9 +13,9 @@ import MethodCall from './MethodCall'; /** * A codec for method calls and enveloped results. * - *

Method calls are encoded as binary messages with enough structure that the codec can extract a - * method name String and an arguments Object. These data items are used to populate a {@link - * MethodCall}. + *

Method calls are encoded as binary messages with enough structure that the codec can + * extract amethod name String and an arguments Object. These data items are used to populate + * a {@link MethodCall}. * *

All operations throw {@link IllegalArgumentException}, if conversion fails. */ @@ -52,10 +52,10 @@ export default interface MethodCodec { * * @param errorCode An error code String. * @param errorMessage An error message String, possibly null. - * @param errorDetails Error details, possibly null. Consider supporting {@link Throwable} in your - * codec. This is the most common value passed to this field. - * @return a {@link ByteBuffer} containing the encoding between position 0 and the current - * position. + * @param errorDetails Error details, possibly null. Consider supporting {@link Throwable} + * in your codec. This is the most common value passed to this field. + * @return a {@link ByteBuffer} containing the encoding between position 0 and the + * current position. */ encodeErrorEnvelope(errorCode: string, errorMessage: string, errorDetails: Any): ArrayBuffer; @@ -64,11 +64,11 @@ export default interface MethodCodec { * * @param errorCode An error code String. * @param errorMessage An error message String, possibly null. - * @param errorDetails Error details, possibly null. Consider supporting {@link Throwable} in your - * codec. This is the most common value passed to this field. + * @param errorDetails Error details, possibly null. Consider supporting {@link Throwable} + * in your codec. This is the most common value passed to this field. * @param errorStacktrace Platform stacktrace for the error. possibly null. - * @return a {@link ByteBuffer} containing the encoding between position 0 and the current - * position. + * @return a {@link ByteBuffer} containing the encoding between position 0 and the + * current position. */ encodeErrorEnvelopeWithStacktrace(errorCode: string, errorMessage: string, errorDetails: Any, errorStacktrace: string): ArrayBuffer diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/SendableMethodCodec.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/SendableMethodCodec.ets index 3e416914a0d9a3c0cd547067d668f459e12f0828..c74e47c7ddfa0585a06c15551b2a6de1e1bfa001 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/SendableMethodCodec.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/SendableMethodCodec.ets @@ -14,9 +14,9 @@ import MethodCall from './MethodCall'; /** * A codec for method calls and enveloped results. * - *

Method calls are encoded as binary messages with enough structure that the codec can extract a - * method name String and an arguments Object. These data items are used to populate a {@link - * MethodCall}. + *

Method calls are encoded as binary messages with enough structure that the codec can + * extract a method name String and an arguments Object. These data items are used to populate + * a {@link MethodCall}. * *

All operations throw {@link IllegalArgumentException}, if conversion fails. */ @@ -54,10 +54,10 @@ export default interface SendableMethodCodec extends ISendable { * * @param errorCode An error code String. * @param errorMessage An error message String, possibly null. - * @param errorDetails Error details, possibly null. Consider supporting {@link Throwable} in your - * codec. This is the most common value passed to this field. - * @return a {@link ByteBuffer} containing the encoding between position 0 and the current - * position. + * @param errorDetails Error details, possibly null. Consider supporting {@link Throwable} + * in your codec. This is the most common value passed to this field. + * @return a {@link ByteBuffer} containing the encoding between position 0 and the + * current position. */ encodeErrorEnvelope(errorCode: string, errorMessage: string, errorDetails: Any): ArrayBuffer; @@ -66,11 +66,11 @@ export default interface SendableMethodCodec extends ISendable { * * @param errorCode An error code String. * @param errorMessage An error message String, possibly null. - * @param errorDetails Error details, possibly null. Consider supporting {@link Throwable} in your - * codec. This is the most common value passed to this field. + * @param errorDetails Error details, possibly null. Consider supporting {@link Throwable} + * in your codec. This is the most common value passed to this field. * @param errorStacktrace Platform stacktrace for the error. possibly null. - * @return a {@link ByteBuffer} containing the encoding between position 0 and the current - * position. + * @return a {@link ByteBuffer} containing the encoding between position 0 and the + * current position. */ encodeErrorEnvelopeWithStacktrace(errorCode: string, errorMessage: string, errorDetails: Any, errorStacktrace: string): ArrayBuffer diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/StandardMethodCodec.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/StandardMethodCodec.ets index cb3a0f2fdddb4e09a14e7298aa1c368a2f51da44..7355f0bc1bab653531053bbc0369d9ebb61aeb80 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/StandardMethodCodec.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/common/StandardMethodCodec.ets @@ -19,11 +19,11 @@ import StandardMessageCodec from './StandardMessageCodec'; * A {@link MethodCodec} using the Flutter standard binary encoding. * *

This codec is guaranteed to be compatible with the corresponding StandardMethodCodec - * on the Dart side. These parts of the Flutter SDK are evolved synchronously. + * href="https://api.flutter.dev/flutter/services/StandardMethodCodec-class.html">StandardMethodCodec + * on the Dart side. These parts of the Flutter SDK are evolved synchronously. * - *

Values supported as method arguments and result payloads are those supported by {@link - * StandardMessageCodec}. + *

Values supported as method arguments and result payloads are those supported by + * {@link StandardMessageCodec}. */ export default class StandardMethodCodec implements MethodCodec { private static TAG = "StandardMethodCodec"; diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextUtils.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextUtils.ets index 3dcd312ed15b513221a7a4884f136e7b7bd18f10..aad2b230cb112167d2955ac088171e4f57d8ed6d 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextUtils.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/editing/TextUtils.ets @@ -138,6 +138,7 @@ export class FlutterTextUtils { return offset - deleteCharCount; } + // Avoid repetition // Keycaps if (codePoint == COMBINING_ENCLOSING_KEYCAP) { codePoint = FlutterTextUtils.codePointBefore(text, lastOffset); @@ -154,9 +155,9 @@ export class FlutterTextUtils { } /** - * Following if statements for Emoji tag sequence and Variation selector are skipping these - * modifiers for going through the last statement that is for handling emojis. They return the - * offset if they don't find proper base characters + * Following if statements for Emoji tag sequence and Variation selector are skipping + * these modifiers for going through the last statement that is for handling emojis. They + * return the offset if they don't find proper base characters */ // Emoji Tag Sequence if (codePoint == CANCEL_TAG) { // tag_end diff --git a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/platform/PlatformView.ets b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/platform/PlatformView.ets index 51b452c37a9cd52f7efe70f076290bbb53a864c0..031c3e6be31aed4a5d8f26dcc1b9699c903e94c4 100644 --- a/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/platform/PlatformView.ets +++ b/shell/platform/ohos/flutter_embedding/flutter/src/main/ets/plugin/platform/PlatformView.ets @@ -25,18 +25,18 @@ export default abstract class PlatformView { /** Returns the DynamicView to be embedded in the Flutter hierarchy. */ abstract getView(): WrappedBuilder<[Params]>; /** - * Called by the {@link io.flutter.embedding.engine.FlutterEngine} that owns this {@code - * PlatformView} when the DynamicView responsible for rendering a Flutter UI is + * Called by the {@link io.flutter.embedding.engine.FlutterEngine} that owns this + * {@code PlatformView} when the DynamicView responsible for rendering a Flutter UI is * associated with the {@link io.flutter.embedding.engine.FlutterEngine}. * - *

This means that our associated {@link io.flutter.embedding.engine.FlutterEngine} can now - * render a UI and interact with the user. + *

This means that our associated {@link io.flutter.embedding.engine.FlutterEngine} + * can now render a UI and interact with the user. * - *

Some platform views may have unusual dependencies on the {@link View} that renders Flutter - * UIs, such as unique keyboard interactions. That {@link View} is provided here for those - * purposes. Use of this {@link View} should be avoided if it is not absolutely necessary, because - * depending on this {@link View} will tend to make platform view code more brittle to future - * changes. + *

Some platform views may have unusual dependencies on the {@link View} that renders + * Flutter UIs, such as unique keyboard interactions. That {@link View} is provided here for those + * purposes. Use of this {@link View} should be avoided if it is not absolutely necessary, + * because depending on this {@link View} will tend to make platform view code more brittle + * to future changes. */ onFlutterViewAttached(dvModel: DVModel): void {}