This commit is contained in:
@ -24,6 +24,8 @@ abstract interface class WatchBridgeNativeChannel {
|
||||
|
||||
Future<void> publishProjection(WatchSessionProjection projection);
|
||||
|
||||
Future<void> publishAlert(WatchAlertEnvelope alert);
|
||||
|
||||
Future<void> sendCommandAck(
|
||||
WatchCommandEnvelope command,
|
||||
WatchCommandAck ack, {
|
||||
@ -129,6 +131,11 @@ final class MethodChannelWatchBridgeNativeChannel
|
||||
);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> publishAlert(WatchAlertEnvelope alert) {
|
||||
return _invokeIgnoringMissingPlugin('publishAlert', alert.toJson());
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> requestCapabilityRefresh() {
|
||||
return _invokeIgnoringMissingPlugin('requestCapabilityRefresh');
|
||||
|
||||
@ -6,7 +6,8 @@ import '../../application/use_cases.dart';
|
||||
import '../../application/watch_companion_use_cases.dart';
|
||||
import 'native_watch_bridge_channel.dart';
|
||||
|
||||
final class WatchWearDataLayerAdapter implements WatchProjectionPublisher {
|
||||
final class WatchWearDataLayerAdapter
|
||||
implements WatchProjectionPublisher, WatchAlertPublisher {
|
||||
WatchWearDataLayerAdapter({
|
||||
required WatchBridgeNativeChannel nativeChannel,
|
||||
required WatchCommandIngress commandIngress,
|
||||
@ -108,6 +109,11 @@ final class WatchWearDataLayerAdapter implements WatchProjectionPublisher {
|
||||
await _syncForegroundService(projection);
|
||||
}
|
||||
|
||||
@override
|
||||
Future<void> publishAlert(WatchAlertEnvelope alert) {
|
||||
return _nativeChannel.publishAlert(alert);
|
||||
}
|
||||
|
||||
Future<void> _enqueueCommand(WatchCommandEnvelope command) {
|
||||
final run = _commandTail.then(
|
||||
(_) => _handleCommand(command),
|
||||
|
||||
Reference in New Issue
Block a user