-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcallkeep.pigeon.dart
More file actions
2941 lines (2698 loc) · 110 KB
/
Copy pathcallkeep.pigeon.dart
File metadata and controls
2941 lines (2698 loc) · 110 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Autogenerated from Pigeon (v26.0.3), do not edit directly.
// See also: https://pub.dev/packages/pigeon
// ignore_for_file: public_member_api_docs, non_constant_identifier_names, avoid_as, unused_import, unnecessary_parenthesis, prefer_null_aware_operators, omit_local_variable_types, unused_shown_name, unnecessary_import, no_leading_underscores_for_local_identifiers
import 'dart:async';
import 'dart:typed_data' show Float64List, Int32List, Int64List, Uint8List;
import 'package:flutter/foundation.dart' show ReadBuffer, WriteBuffer;
import 'package:flutter/services.dart';
PlatformException _createConnectionError(String channelName) {
return PlatformException(
code: 'channel-error',
message: 'Unable to establish connection on channel: "$channelName".',
);
}
List<Object?> wrapResponse({Object? result, PlatformException? error, bool empty = false}) {
if (empty) {
return <Object?>[];
}
if (error == null) {
return <Object?>[result];
}
return <Object?>[error.code, error.message, error.details];
}
bool _deepEquals(Object? a, Object? b) {
if (a is List && b is List) {
return a.length == b.length && a.indexed.every(((int, dynamic) item) => _deepEquals(item.$2, b[item.$1]));
}
if (a is Map && b is Map) {
return a.length == b.length &&
a.entries.every(
(MapEntry<Object?, Object?> entry) =>
(b as Map<Object?, Object?>).containsKey(entry.key) && _deepEquals(entry.value, b[entry.key]),
);
}
return a == b;
}
enum PCallkeepPermission { readPhoneState, readPhoneNumbers }
enum PSpecialPermissionStatusTypeEnum { denied, granted, unknown }
enum PCallkeepAndroidBatteryMode { unrestricted, optimized, restricted, unknown }
enum PCallkeepAndroidCallDeliveryMode { telecom, standalone, unknown }
enum PHandleTypeEnum { generic, number, email }
enum PCallInfoConsts { uuid, dtmf, isVideo, number, name }
enum PEndCallReasonEnum { failed, remoteEnded, unanswered, answeredElsewhere, declinedElsewhere, missed }
enum PAudioDeviceType { earpiece, speaker, bluetooth, wiredHeadset, streaming, unknown }
enum PIncomingCallErrorEnum {
unknown,
unentitled,
callIdAlreadyExists,
callIdAlreadyExistsAndAnswered,
callIdAlreadyTerminated,
filteredByDoNotDisturb,
filteredByBlockList,
internal,
/// Android only.
///
/// Telecom rejected the incoming call registration via
/// `onCreateIncomingConnectionFailed` (i.e. without ever calling
/// `onCreateIncomingConnection`).
///
/// **When this happens**: Android does not allow two self-managed calls to be
/// simultaneously in RINGING state. If a call is already ringing, Telecom
/// rejects every subsequent incoming self-managed call. This is standard
/// AOSP behaviour (observed on stock Pixel devices running Android 11+), not
/// an OEM-specific restriction. Some vendors (Huawei, certain MediaTek OEMs)
/// apply the same rejection even when the first call is already ACTIVE.
///
/// **Consequences for the app**:
/// - The call was never confirmed to Flutter, so `performEndCall` will NOT
/// fire for this call ID.
/// - The app must send the appropriate signaling (e.g. SIP BYE) to the
/// server itself upon receiving this error, without waiting for
/// `performEndCall`.
callRejectedBySystem,
}
enum PCallRequestErrorEnum {
unknown,
unentitled,
unknownCallUuid,
callUuidAlreadyExists,
maximumCallGroupsReached,
internal,
emergencyNumber,
/// Android only.
///
/// Triggered when the phone is not registered as a self-managed
/// [PhoneAccount]. As a result, the `ConnectionService` cannot create
/// a connection, and the system throws an exception such as
/// `CALL_PHONE permission required to place calls`, because it attempts
/// to use the GSM dialer instead of VoIP.
selfManagedPhoneAccountNotRegistered,
/// Android only.
///
/// Occurs when the outgoing/incoming call request times out because the
/// system TelecomManager failed to bind to the ConnectionService or provide
/// a response within the expected timeframe.
///
/// Typical causes:
/// - Zombie State: After an app crash or OS kill, TelecomManager might
/// retain a stale binder connection to the previous (dead) process.
/// - Stale Binding: The system assumes the PhoneAccount is active but
/// fails to trigger `onCreateOutgoingConnection`.
/// - Cold Start Latency: On certain vendors (e.g., Itel, Android One),
/// the OS may deadlock or time out during service binding after a cold start.
timeout,
}
enum PCallkeepLifecycleEvent { onCreate, onStart, onResume, onPause, onStop, onDestroy, onAny }
enum PCallkeepConnectionState {
stateInitializing,
stateNew,
stateRinging,
stateDialing,
stateActive,
stateHolding,
stateDisconnected,
statePullingCall,
}
enum PCallkeepDisconnectCauseType {
unknown,
error,
local,
remote,
canceled,
missed,
rejected,
busy,
restricted,
other,
connectionManagerNotSupported,
answeredElsewhere,
callPulled,
}
class PIOSOptions {
PIOSOptions({
required this.localizedName,
this.ringtoneSound,
this.ringbackSound,
this.iconTemplateImageAssetName,
required this.maximumCallGroups,
required this.maximumCallsPerCallGroup,
this.supportsHandleTypeGeneric,
this.supportsHandleTypePhoneNumber,
this.supportsHandleTypeEmailAddress,
required this.supportsVideo,
required this.includesCallsInRecents,
required this.driveIdleTimerDisabled,
});
String localizedName;
String? ringtoneSound;
String? ringbackSound;
String? iconTemplateImageAssetName;
int maximumCallGroups;
int maximumCallsPerCallGroup;
bool? supportsHandleTypeGeneric;
bool? supportsHandleTypePhoneNumber;
bool? supportsHandleTypeEmailAddress;
bool supportsVideo;
bool includesCallsInRecents;
bool driveIdleTimerDisabled;
List<Object?> _toList() {
return <Object?>[
localizedName,
ringtoneSound,
ringbackSound,
iconTemplateImageAssetName,
maximumCallGroups,
maximumCallsPerCallGroup,
supportsHandleTypeGeneric,
supportsHandleTypePhoneNumber,
supportsHandleTypeEmailAddress,
supportsVideo,
includesCallsInRecents,
driveIdleTimerDisabled,
];
}
Object encode() {
return _toList();
}
static PIOSOptions decode(Object result) {
result as List<Object?>;
return PIOSOptions(
localizedName: result[0]! as String,
ringtoneSound: result[1] as String?,
ringbackSound: result[2] as String?,
iconTemplateImageAssetName: result[3] as String?,
maximumCallGroups: result[4]! as int,
maximumCallsPerCallGroup: result[5]! as int,
supportsHandleTypeGeneric: result[6] as bool?,
supportsHandleTypePhoneNumber: result[7] as bool?,
supportsHandleTypeEmailAddress: result[8] as bool?,
supportsVideo: result[9]! as bool,
includesCallsInRecents: result[10]! as bool,
driveIdleTimerDisabled: result[11]! as bool,
);
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! PIOSOptions || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(encode(), other.encode());
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
}
class PAndroidOptions {
PAndroidOptions({
this.ringtoneSound,
this.ringbackSound,
this.incomingCallFullScreen,
this.incomingCallTimeoutMs,
this.outgoingCallTimeoutMs,
this.logFilePath,
});
String? ringtoneSound;
String? ringbackSound;
bool? incomingCallFullScreen;
/// Timeout in milliseconds before an unanswered incoming call (STATE_RINGING) is
/// automatically disconnected. When null the native default is used.
int? incomingCallTimeoutMs;
/// Timeout in milliseconds before an unanswered outgoing call (STATE_DIALING) is
/// automatically disconnected. When null the native default is used.
int? outgoingCallTimeoutMs;
/// Absolute path to a file where native logs will be written directly.
String? logFilePath;
List<Object?> _toList() {
return <Object?>[
ringtoneSound,
ringbackSound,
incomingCallFullScreen,
incomingCallTimeoutMs,
outgoingCallTimeoutMs,
logFilePath,
];
}
Object encode() {
return _toList();
}
static PAndroidOptions decode(Object result) {
result as List<Object?>;
return PAndroidOptions(
ringtoneSound: result[0] as String?,
ringbackSound: result[1] as String?,
incomingCallFullScreen: result[2] as bool?,
incomingCallTimeoutMs: result[3] as int?,
outgoingCallTimeoutMs: result[4] as int?,
logFilePath: result[5] as String?,
);
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! PAndroidOptions || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(encode(), other.encode());
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
}
class POptions {
POptions({required this.ios, required this.android});
PIOSOptions ios;
PAndroidOptions android;
List<Object?> _toList() {
return <Object?>[ios, android];
}
Object encode() {
return _toList();
}
static POptions decode(Object result) {
result as List<Object?>;
return POptions(ios: result[0]! as PIOSOptions, android: result[1]! as PAndroidOptions);
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! POptions || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(encode(), other.encode());
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
}
class PAudioDevice {
PAudioDevice({required this.type, this.id, this.name});
PAudioDeviceType type;
String? id;
String? name;
List<Object?> _toList() {
return <Object?>[type, id, name];
}
Object encode() {
return _toList();
}
static PAudioDevice decode(Object result) {
result as List<Object?>;
return PAudioDevice(type: result[0]! as PAudioDeviceType, id: result[1] as String?, name: result[2] as String?);
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! PAudioDevice || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(encode(), other.encode());
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
}
class PPermissionResult {
PPermissionResult({required this.permission, required this.status});
PCallkeepPermission permission;
PSpecialPermissionStatusTypeEnum status;
List<Object?> _toList() {
return <Object?>[permission, status];
}
Object encode() {
return _toList();
}
static PPermissionResult decode(Object result) {
result as List<Object?>;
return PPermissionResult(
permission: result[0]! as PCallkeepPermission,
status: result[1]! as PSpecialPermissionStatusTypeEnum,
);
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! PPermissionResult || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(encode(), other.encode());
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
}
class PHandle {
PHandle({required this.type, required this.value});
PHandleTypeEnum type;
String value;
List<Object?> _toList() {
return <Object?>[type, value];
}
Object encode() {
return _toList();
}
static PHandle decode(Object result) {
result as List<Object?>;
return PHandle(type: result[0]! as PHandleTypeEnum, value: result[1]! as String);
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! PHandle || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(encode(), other.encode());
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
}
class PEndCallReason {
PEndCallReason({required this.value});
PEndCallReasonEnum value;
List<Object?> _toList() {
return <Object?>[value];
}
Object encode() {
return _toList();
}
static PEndCallReason decode(Object result) {
result as List<Object?>;
return PEndCallReason(value: result[0]! as PEndCallReasonEnum);
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! PEndCallReason || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(encode(), other.encode());
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
}
class PIncomingCallError {
PIncomingCallError({required this.value});
PIncomingCallErrorEnum value;
List<Object?> _toList() {
return <Object?>[value];
}
Object encode() {
return _toList();
}
static PIncomingCallError decode(Object result) {
result as List<Object?>;
return PIncomingCallError(value: result[0]! as PIncomingCallErrorEnum);
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! PIncomingCallError || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(encode(), other.encode());
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
}
class PCallRequestError {
PCallRequestError({required this.value});
PCallRequestErrorEnum value;
List<Object?> _toList() {
return <Object?>[value];
}
Object encode() {
return _toList();
}
static PCallRequestError decode(Object result) {
result as List<Object?>;
return PCallRequestError(value: result[0]! as PCallRequestErrorEnum);
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! PCallRequestError || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(encode(), other.encode());
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
}
class PCallkeepIncomingCallData {
PCallkeepIncomingCallData({required this.callId, this.handle, this.displayName, required this.hasVideo});
String callId;
PHandle? handle;
String? displayName;
bool hasVideo;
List<Object?> _toList() {
return <Object?>[callId, handle, displayName, hasVideo];
}
Object encode() {
return _toList();
}
static PCallkeepIncomingCallData decode(Object result) {
result as List<Object?>;
return PCallkeepIncomingCallData(
callId: result[0]! as String,
handle: result[1] as PHandle?,
displayName: result[2] as String?,
hasVideo: result[3]! as bool,
);
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! PCallkeepIncomingCallData || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(encode(), other.encode());
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
}
class PCallkeepServiceStatus {
PCallkeepServiceStatus({required this.lifecycleEvent});
PCallkeepLifecycleEvent lifecycleEvent;
List<Object?> _toList() {
return <Object?>[lifecycleEvent];
}
Object encode() {
return _toList();
}
static PCallkeepServiceStatus decode(Object result) {
result as List<Object?>;
return PCallkeepServiceStatus(lifecycleEvent: result[0]! as PCallkeepLifecycleEvent);
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! PCallkeepServiceStatus || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(encode(), other.encode());
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
}
class PCallkeepDisconnectCause {
PCallkeepDisconnectCause({required this.type, this.reason});
PCallkeepDisconnectCauseType type;
String? reason;
List<Object?> _toList() {
return <Object?>[type, reason];
}
Object encode() {
return _toList();
}
static PCallkeepDisconnectCause decode(Object result) {
result as List<Object?>;
return PCallkeepDisconnectCause(type: result[0]! as PCallkeepDisconnectCauseType, reason: result[1] as String?);
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! PCallkeepDisconnectCause || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(encode(), other.encode());
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
}
class PCallkeepConnection {
PCallkeepConnection({required this.callId, required this.state, required this.disconnectCause});
String callId;
PCallkeepConnectionState state;
PCallkeepDisconnectCause disconnectCause;
List<Object?> _toList() {
return <Object?>[callId, state, disconnectCause];
}
Object encode() {
return _toList();
}
static PCallkeepConnection decode(Object result) {
result as List<Object?>;
return PCallkeepConnection(
callId: result[0]! as String,
state: result[1]! as PCallkeepConnectionState,
disconnectCause: result[2]! as PCallkeepDisconnectCause,
);
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
bool operator ==(Object other) {
if (other is! PCallkeepConnection || other.runtimeType != runtimeType) {
return false;
}
if (identical(this, other)) {
return true;
}
return _deepEquals(encode(), other.encode());
}
@override
// ignore: avoid_equals_and_hash_code_on_mutable_classes
int get hashCode => Object.hashAll(_toList());
}
class _PigeonCodec extends StandardMessageCodec {
const _PigeonCodec();
@override
void writeValue(WriteBuffer buffer, Object? value) {
if (value is int) {
buffer.putUint8(4);
buffer.putInt64(value);
} else if (value is PCallkeepPermission) {
buffer.putUint8(130);
writeValue(buffer, value.index);
} else if (value is PSpecialPermissionStatusTypeEnum) {
buffer.putUint8(131);
writeValue(buffer, value.index);
} else if (value is PCallkeepAndroidBatteryMode) {
buffer.putUint8(132);
writeValue(buffer, value.index);
} else if (value is PHandleTypeEnum) {
buffer.putUint8(133);
writeValue(buffer, value.index);
} else if (value is PCallInfoConsts) {
buffer.putUint8(134);
writeValue(buffer, value.index);
} else if (value is PEndCallReasonEnum) {
buffer.putUint8(135);
writeValue(buffer, value.index);
} else if (value is PAudioDeviceType) {
buffer.putUint8(136);
writeValue(buffer, value.index);
} else if (value is PIncomingCallErrorEnum) {
buffer.putUint8(137);
writeValue(buffer, value.index);
} else if (value is PCallRequestErrorEnum) {
buffer.putUint8(138);
writeValue(buffer, value.index);
} else if (value is PCallkeepLifecycleEvent) {
buffer.putUint8(139);
writeValue(buffer, value.index);
} else if (value is PCallkeepConnectionState) {
buffer.putUint8(140);
writeValue(buffer, value.index);
} else if (value is PCallkeepDisconnectCauseType) {
buffer.putUint8(141);
writeValue(buffer, value.index);
} else if (value is PIOSOptions) {
buffer.putUint8(142);
writeValue(buffer, value.encode());
} else if (value is PAndroidOptions) {
buffer.putUint8(143);
writeValue(buffer, value.encode());
} else if (value is POptions) {
buffer.putUint8(144);
writeValue(buffer, value.encode());
} else if (value is PAudioDevice) {
buffer.putUint8(145);
writeValue(buffer, value.encode());
} else if (value is PPermissionResult) {
buffer.putUint8(146);
writeValue(buffer, value.encode());
} else if (value is PHandle) {
buffer.putUint8(147);
writeValue(buffer, value.encode());
} else if (value is PEndCallReason) {
buffer.putUint8(148);
writeValue(buffer, value.encode());
} else if (value is PIncomingCallError) {
buffer.putUint8(149);
writeValue(buffer, value.encode());
} else if (value is PCallRequestError) {
buffer.putUint8(150);
writeValue(buffer, value.encode());
} else if (value is PCallkeepIncomingCallData) {
buffer.putUint8(151);
writeValue(buffer, value.encode());
} else if (value is PCallkeepServiceStatus) {
buffer.putUint8(152);
writeValue(buffer, value.encode());
} else if (value is PCallkeepDisconnectCause) {
buffer.putUint8(153);
writeValue(buffer, value.encode());
} else if (value is PCallkeepConnection) {
buffer.putUint8(154);
writeValue(buffer, value.encode());
} else if (value is PCallkeepAndroidCallDeliveryMode) {
buffer.putUint8(155);
writeValue(buffer, value.index);
} else {
super.writeValue(buffer, value);
}
}
@override
Object? readValueOfType(int type, ReadBuffer buffer) {
switch (type) {
case 130:
final int? value = readValue(buffer) as int?;
return value == null ? null : PCallkeepPermission.values[value];
case 131:
final int? value = readValue(buffer) as int?;
return value == null ? null : PSpecialPermissionStatusTypeEnum.values[value];
case 132:
final int? value = readValue(buffer) as int?;
return value == null ? null : PCallkeepAndroidBatteryMode.values[value];
case 133:
final int? value = readValue(buffer) as int?;
return value == null ? null : PHandleTypeEnum.values[value];
case 134:
final int? value = readValue(buffer) as int?;
return value == null ? null : PCallInfoConsts.values[value];
case 135:
final int? value = readValue(buffer) as int?;
return value == null ? null : PEndCallReasonEnum.values[value];
case 136:
final int? value = readValue(buffer) as int?;
return value == null ? null : PAudioDeviceType.values[value];
case 137:
final int? value = readValue(buffer) as int?;
return value == null ? null : PIncomingCallErrorEnum.values[value];
case 138:
final int? value = readValue(buffer) as int?;
return value == null ? null : PCallRequestErrorEnum.values[value];
case 139:
final int? value = readValue(buffer) as int?;
return value == null ? null : PCallkeepLifecycleEvent.values[value];
case 140:
final int? value = readValue(buffer) as int?;
return value == null ? null : PCallkeepConnectionState.values[value];
case 141:
final int? value = readValue(buffer) as int?;
return value == null ? null : PCallkeepDisconnectCauseType.values[value];
case 142:
return PIOSOptions.decode(readValue(buffer)!);
case 143:
return PAndroidOptions.decode(readValue(buffer)!);
case 144:
return POptions.decode(readValue(buffer)!);
case 145:
return PAudioDevice.decode(readValue(buffer)!);
case 146:
return PPermissionResult.decode(readValue(buffer)!);
case 147:
return PHandle.decode(readValue(buffer)!);
case 148:
return PEndCallReason.decode(readValue(buffer)!);
case 149:
return PIncomingCallError.decode(readValue(buffer)!);
case 150:
return PCallRequestError.decode(readValue(buffer)!);
case 151:
return PCallkeepIncomingCallData.decode(readValue(buffer)!);
case 152:
return PCallkeepServiceStatus.decode(readValue(buffer)!);
case 153:
return PCallkeepDisconnectCause.decode(readValue(buffer)!);
case 154:
return PCallkeepConnection.decode(readValue(buffer)!);
case 155:
final int? value = readValue(buffer) as int?;
return value == null ? null : PCallkeepAndroidCallDeliveryMode.values[value];
default:
return super.readValueOfType(type, buffer);
}
}
}
class PHostBackgroundPushNotificationIsolateBootstrapApi {
/// Constructor for [PHostBackgroundPushNotificationIsolateBootstrapApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform.
PHostBackgroundPushNotificationIsolateBootstrapApi({
BinaryMessenger? binaryMessenger,
String messageChannelSuffix = '',
}) : pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
final BinaryMessenger? pigeonVar_binaryMessenger;
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
final String pigeonVar_messageChannelSuffix;
Future<void> initializePushNotificationCallback({
required int callbackDispatcher,
required int onNotificationSync,
}) async {
final String pigeonVar_channelName =
'dev.flutter.pigeon.webtrit_callkeep_android.PHostBackgroundPushNotificationIsolateBootstrapApi.initializePushNotificationCallback$pigeonVar_messageChannelSuffix';
final BasicMessageChannel<Object?> pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[
callbackDispatcher,
onNotificationSync,
]);
final List<Object?>? pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
if (pigeonVar_replyList == null) {
throw _createConnectionError(pigeonVar_channelName);
} else if (pigeonVar_replyList.length > 1) {
throw PlatformException(
code: pigeonVar_replyList[0]! as String,
message: pigeonVar_replyList[1] as String?,
details: pigeonVar_replyList[2],
);
} else {
return;
}
}
Future<PIncomingCallError?> reportNewIncomingCall(
String callId,
PHandle handle,
String? displayName,
bool hasVideo,
) async {
final String pigeonVar_channelName =
'dev.flutter.pigeon.webtrit_callkeep_android.PHostBackgroundPushNotificationIsolateBootstrapApi.reportNewIncomingCall$pigeonVar_messageChannelSuffix';
final BasicMessageChannel<Object?> pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,
);
final Future<Object?> pigeonVar_sendFuture = pigeonVar_channel.send(<Object?>[
callId,
handle,
displayName,
hasVideo,
]);
final List<Object?>? pigeonVar_replyList = await pigeonVar_sendFuture as List<Object?>?;
if (pigeonVar_replyList == null) {
throw _createConnectionError(pigeonVar_channelName);
} else if (pigeonVar_replyList.length > 1) {
throw PlatformException(
code: pigeonVar_replyList[0]! as String,
message: pigeonVar_replyList[1] as String?,
details: pigeonVar_replyList[2],
);
} else {
return (pigeonVar_replyList[0] as PIncomingCallError?);
}
}
}
class PHostBackgroundPushNotificationIsolateApi {
/// Constructor for [PHostBackgroundPushNotificationIsolateApi]. The [binaryMessenger] named argument is
/// available for dependency injection. If it is left null, the default
/// BinaryMessenger will be used which routes to the host platform.
PHostBackgroundPushNotificationIsolateApi({BinaryMessenger? binaryMessenger, String messageChannelSuffix = ''})
: pigeonVar_binaryMessenger = binaryMessenger,
pigeonVar_messageChannelSuffix = messageChannelSuffix.isNotEmpty ? '.$messageChannelSuffix' : '';
final BinaryMessenger? pigeonVar_binaryMessenger;
static const MessageCodec<Object?> pigeonChannelCodec = _PigeonCodec();
final String pigeonVar_messageChannelSuffix;
Future<void> endCall(String callId) async {
final String pigeonVar_channelName =
'dev.flutter.pigeon.webtrit_callkeep_android.PHostBackgroundPushNotificationIsolateApi.endCall$pigeonVar_messageChannelSuffix';
final BasicMessageChannel<Object?> pigeonVar_channel = BasicMessageChannel<Object?>(
pigeonVar_channelName,
pigeonChannelCodec,
binaryMessenger: pigeonVar_binaryMessenger,