-
Notifications
You must be signed in to change notification settings - Fork 2
/
NfcService.smali
3790 lines (2318 loc) · 94.4 KB
/
NfcService.smali
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
.class public Lcom/android/nfc/NfcService;
.super Ljava/lang/Object;
.source "NfcService.java"
# interfaces
.implements Lcom/android/nfc/DeviceHost$DeviceHostListener;
# annotations
.annotation system Ldalvik/annotation/MemberClasses;
value = {
Lcom/android/nfc/NfcService$ApplyRoutingTask;,
Lcom/android/nfc/NfcService$NfcServiceHandler;,
Lcom/android/nfc/NfcService$WatchDogThread;,
Lcom/android/nfc/NfcService$NfcDtaService;,
Lcom/android/nfc/NfcService$TagService;,
Lcom/android/nfc/NfcService$ReaderModeDeathRecipient;,
Lcom/android/nfc/NfcService$NfcAdapterService;,
Lcom/android/nfc/NfcService$EnableDisableTask;,
Lcom/android/nfc/NfcService$ReaderModeParams;
}
.end annotation
# static fields
.field public static final ACTION_LLCP_DOWN:Ljava/lang/String; = "com.android.nfc.action.LLCP_DOWN"
.field public static final ACTION_LLCP_UP:Ljava/lang/String; = "com.android.nfc.action.LLCP_UP"
.field public static final ACTION_RF_FIELD_OFF_DETECTED:Ljava/lang/String; = "com.android.nfc_extras.action.RF_FIELD_OFF_DETECTED"
.field public static final ACTION_RF_FIELD_ON_DETECTED:Ljava/lang/String; = "com.android.nfc_extras.action.RF_FIELD_ON_DETECTED"
.field private static final APPLY_ROUTING_RETRY_TIMEOUT_MS:I = 0x1388
.field static final DBG:Z = false
.field static final DEFAULT_PRESENCE_CHECK_DELAY:I = 0x7d
.field static final INIT_WATCHDOG_MS:I = 0x15f90
.field static final INVALID_NATIVE_HANDLE:I = -0x1
.field static final INVOKE_BEAM_DELAY_MS:I = 0x3e8
.field static final MAX_POLLING_PAUSE_TIMEOUT:J = 0x9c40L
.field static final MSG_APPLY_SCREEN_STATE:I = 0x10
.field static final MSG_COMMIT_ROUTING:I = 0x7
.field static final MSG_DEREGISTER_T3T_IDENTIFIER:I = 0xd
.field static final MSG_INVOKE_BEAM:I = 0x8
.field static final MSG_LLCP_LINK_ACTIVATION:I = 0x1
.field static final MSG_LLCP_LINK_DEACTIVATED:I = 0x2
.field static final MSG_LLCP_LINK_FIRST_PACKET:I = 0x4
.field static final MSG_MOCK_NDEF:I = 0x3
.field static final MSG_NDEF_TAG:I = 0x0
.field static final MSG_REGISTER_T3T_IDENTIFIER:I = 0xc
.field static final MSG_RESUME_POLLING:I = 0xb
.field static final MSG_RF_FIELD_ACTIVATED:I = 0x9
.field static final MSG_RF_FIELD_DEACTIVATED:I = 0xa
.field static final MSG_ROUTE_AID:I = 0x5
.field static final MSG_TAG_DEBOUNCE:I = 0xe
.field static final MSG_TRANSACTION_EVENT:I = 0x11
.field static final MSG_UNROUTE_AID:I = 0x6
.field static final MSG_UPDATE_STATS:I = 0xf
.field public static final NCI_VERSION_1_0:I = 0x10
.field public static final NCI_VERSION_2_0:I = 0x20
.field static final NDEF_PUSH_ON_DEFAULT:Z = true
.field static final NFC_ON_DEFAULT:Z = true
.field static final NFC_POLLING_MODE:I = 0x1
.field static final NFC_POLL_A:I = 0x1
.field static final NFC_POLL_B:I = 0x2
.field static final NFC_POLL_B_PRIME:I = 0x10
.field static final NFC_POLL_F:I = 0x4
.field static final NFC_POLL_KOVIO:I = 0x20
.field static final NFC_POLL_V:I = 0x8
.field public static final PREF:Ljava/lang/String; = "NfcServicePrefs"
.field static final PREF_FIRST_BEAM:Ljava/lang/String; = "first_beam"
.field static final PREF_FIRST_BOOT:Ljava/lang/String; = "first_boot"
.field static final PREF_NDEF_PUSH_ON:Ljava/lang/String; = "ndef_push_on"
.field static final PREF_NFC_ON:Ljava/lang/String; = "nfc_on"
.field static final ROUTING_WATCHDOG_MS:I = 0x2710
.field public static final SERVICE_NAME:Ljava/lang/String; = "nfc"
.field public static final SOUND_END:I = 0x1
.field public static final SOUND_ERROR:I = 0x2
.field public static final SOUND_START:I = 0x0
.field static final STATS_UPDATE_INTERVAL_MS:J = 0xdbba00L
.field static final TAG:Ljava/lang/String; = "NfcService"
.field static final TASK_BOOT:I = 0x3
.field static final TASK_DISABLE:I = 0x2
.field static final TASK_ENABLE:I = 0x1
.field static final TRON_NFC_CE:Ljava/lang/String; = "nfc_ce"
.field static final TRON_NFC_P2P:Ljava/lang/String; = "nfc_p2p"
.field static final TRON_NFC_TAG:Ljava/lang/String; = "nfc_tag"
.field private static nci_version:I
.field public static sIsDtaMode:Z
.field public static sIsShortRecordLayout:Z
.field private static sService:Lcom/android/nfc/NfcService;
# instance fields
.field private final mBackupManager:Landroid/app/backup/BackupManager;
.field private mCardEmulationManager:Lcom/android/nfc/cardemulation/CardEmulationManager;
.field private mContentResolver:Landroid/content/ContentResolver;
.field mContext:Landroid/content/Context;
.field mCurrentDiscoveryParameters:Lcom/android/nfc/NfcDiscoveryParameters;
.field mDebounceTagDebounceMs:I
.field mDebounceTagNativeHandle:I
.field mDebounceTagRemovedCallback:Landroid/nfc/ITagRemovedCallback;
.field mDebounceTagUid:[B
.field private mDeviceHost:Lcom/android/nfc/DeviceHost;
.field mEndSound:I
.field mErrorSound:I
.field private mForegroundUtils:Lcom/android/nfc/ForegroundUtils;
.field private mHandler:Lcom/android/nfc/NfcService$NfcServiceHandler;
.field private mHandoverDataParser:Lcom/android/nfc/handover/HandoverDataParser;
.field mInProvisionMode:Z
.field mIsDebugBuild:Z
.field mIsHceCapable:Z
.field mIsHceFCapable:Z
.field mIsLiveCaseEnabled:Z
.field mIsNdefPushEnabled:Z
.field mIsVrModeEnabled:Z
.field private mKeyguard:Landroid/app/KeyguardManager;
.field mLastReadNdefMessage:Landroid/nfc/NdefMessage;
.field mLiveCaseTechnology:I
.field mNfcAdapter:Lcom/android/nfc/NfcService$NfcAdapterService;
.field private mNfcDispatcher:Lcom/android/nfc/NfcDispatcher;
.field mNfcDtaService:Lcom/android/nfc/NfcService$NfcDtaService;
.field mNfcEventInstalledPackages:Ljava/util/List;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/List<",
"Ljava/lang/String;",
">;"
}
.end annotation
.end field
.field mNfcTagService:Lcom/android/nfc/NfcService$TagService;
.field private final mNfcUnlockManager:Lcom/android/nfc/NfcUnlockManager;
.field mNumHceDetected:Ljava/util/concurrent/atomic/AtomicInteger;
.field mNumP2pDetected:Ljava/util/concurrent/atomic/AtomicInteger;
.field mNumTagsDetected:Ljava/util/concurrent/atomic/AtomicInteger;
.field final mObjectMap:Ljava/util/HashMap;
.annotation system Ldalvik/annotation/Signature;
value = {
"Ljava/util/HashMap<",
"Ljava/lang/Integer;",
"Ljava/lang/Object;",
">;"
}
.end annotation
.end field
.field private final mOwnerReceiver:Landroid/content/BroadcastReceiver;
.field mP2pLinkManager:Lcom/android/nfc/P2pLinkManager;
.field private final mPolicyReceiver:Landroid/content/BroadcastReceiver;
.field mPollingPaused:Z
.field private mPowerManager:Landroid/os/PowerManager;
.field private mPrefs:Landroid/content/SharedPreferences;
.field private mPrefsEditor:Landroid/content/SharedPreferences$Editor;
.field private final mReaderModeDeathRecipient:Lcom/android/nfc/NfcService$ReaderModeDeathRecipient;
.field mReaderModeParams:Lcom/android/nfc/NfcService$ReaderModeParams;
.field private final mReceiver:Landroid/content/BroadcastReceiver;
.field private mRoutingWakeLock:Landroid/os/PowerManager$WakeLock;
.field private mSEService:Landroid/se/omapi/ISecureElementService;
.field mScreenState:I
.field private mScreenStateHelper:Lcom/android/nfc/ScreenStateHelper;
.field mSoundPool:Landroid/media/SoundPool;
.field mStartSound:I
.field mState:I
.field private mUserId:I
.field private final mUserManager:Landroid/os/UserManager;
.field private mVibrationEffect:Landroid/os/VibrationEffect;
.field private mVibrator:Landroid/os/Vibrator;
.field private final mVrStateCallbacks:Landroid/service/vr/IVrStateCallbacks;
.field private vrManager:Landroid/service/vr/IVrManager;
# direct methods
.method static constructor <clinit>()V
.locals 2
.line 189
const/4 v0, 0x0
sput-boolean v0, Lcom/android/nfc/NfcService;->sIsShortRecordLayout:Z
.line 211
const/16 v1, 0x10
sput v1, Lcom/android/nfc/NfcService;->nci_version:I
.line 287
sput-boolean v0, Lcom/android/nfc/NfcService;->sIsDtaMode:Z
return-void
.end method
.method public constructor <init>(Landroid/app/Application;)V
.locals 11
.line 377
invoke-direct {p0}, Ljava/lang/Object;-><init>()V
.line 214
new-instance v0, Lcom/android/nfc/NfcService$ReaderModeDeathRecipient;
invoke-direct {v0, p0}, Lcom/android/nfc/NfcService$ReaderModeDeathRecipient;-><init>(Lcom/android/nfc/NfcService;)V
iput-object v0, p0, Lcom/android/nfc/NfcService;->mReaderModeDeathRecipient:Lcom/android/nfc/NfcService$ReaderModeDeathRecipient;
.line 221
new-instance v0, Ljava/util/ArrayList;
invoke-direct {v0}, Ljava/util/ArrayList;-><init>()V
iput-object v0, p0, Lcom/android/nfc/NfcService;->mNfcEventInstalledPackages:Ljava/util/List;
.line 224
new-instance v0, Ljava/util/HashMap;
invoke-direct {v0}, Ljava/util/HashMap;-><init>()V
iput-object v0, p0, Lcom/android/nfc/NfcService;->mObjectMap:Ljava/util/HashMap;
.line 228
nop
.line 229
invoke-static {}, Lcom/android/nfc/NfcDiscoveryParameters;->getNfcOffParameters()Lcom/android/nfc/NfcDiscoveryParameters;
move-result-object v0
iput-object v0, p0, Lcom/android/nfc/NfcService;->mCurrentDiscoveryParameters:Lcom/android/nfc/NfcDiscoveryParameters;
.line 239
const/4 v0, -0x1
iput v0, p0, Lcom/android/nfc/NfcService;->mDebounceTagNativeHandle:I
.line 2471
new-instance v1, Lcom/android/nfc/NfcService$NfcServiceHandler;
invoke-direct {v1, p0}, Lcom/android/nfc/NfcService$NfcServiceHandler;-><init>(Lcom/android/nfc/NfcService;)V
iput-object v1, p0, Lcom/android/nfc/NfcService;->mHandler:Lcom/android/nfc/NfcService$NfcServiceHandler;
.line 2495
new-instance v1, Lcom/android/nfc/NfcService$1;
invoke-direct {v1, p0}, Lcom/android/nfc/NfcService$1;-><init>(Lcom/android/nfc/NfcService;)V
iput-object v1, p0, Lcom/android/nfc/NfcService;->mReceiver:Landroid/content/BroadcastReceiver;
.line 2553
new-instance v1, Lcom/android/nfc/NfcService$2;
invoke-direct {v1, p0}, Lcom/android/nfc/NfcService$2;-><init>(Lcom/android/nfc/NfcService;)V
iput-object v1, p0, Lcom/android/nfc/NfcService;->mOwnerReceiver:Landroid/content/BroadcastReceiver;
.line 2571
new-instance v1, Lcom/android/nfc/NfcService$3;
invoke-direct {v1, p0}, Lcom/android/nfc/NfcService$3;-><init>(Lcom/android/nfc/NfcService;)V
iput-object v1, p0, Lcom/android/nfc/NfcService;->mPolicyReceiver:Landroid/content/BroadcastReceiver;
.line 2583
new-instance v1, Lcom/android/nfc/NfcService$4;
invoke-direct {v1, p0}, Lcom/android/nfc/NfcService$4;-><init>(Lcom/android/nfc/NfcService;)V
iput-object v1, p0, Lcom/android/nfc/NfcService;->mVrStateCallbacks:Landroid/service/vr/IVrStateCallbacks;
.line 378
invoke-static {}, Landroid/app/ActivityManager;->getCurrentUser()I
move-result v1
iput v1, p0, Lcom/android/nfc/NfcService;->mUserId:I
.line 379
iput-object p1, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
.line 381
new-instance p1, Lcom/android/nfc/NfcService$TagService;
invoke-direct {p1, p0}, Lcom/android/nfc/NfcService$TagService;-><init>(Lcom/android/nfc/NfcService;)V
iput-object p1, p0, Lcom/android/nfc/NfcService;->mNfcTagService:Lcom/android/nfc/NfcService$TagService;
.line 382
new-instance p1, Lcom/android/nfc/NfcService$NfcAdapterService;
invoke-direct {p1, p0}, Lcom/android/nfc/NfcService$NfcAdapterService;-><init>(Lcom/android/nfc/NfcService;)V
iput-object p1, p0, Lcom/android/nfc/NfcService;->mNfcAdapter:Lcom/android/nfc/NfcService$NfcAdapterService;
.line 383
const-string p1, "NfcService"
const-string v1, "Starting NFC service"
invoke-static {p1, v1}, Landroid/util/Log;->i(Ljava/lang/String;Ljava/lang/String;)I
.line 385
sput-object p0, Lcom/android/nfc/NfcService;->sService:Lcom/android/nfc/NfcService;
.line 387
new-instance v1, Lcom/android/nfc/ScreenStateHelper;
iget-object v2, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
invoke-direct {v1, v2}, Lcom/android/nfc/ScreenStateHelper;-><init>(Landroid/content/Context;)V
iput-object v1, p0, Lcom/android/nfc/NfcService;->mScreenStateHelper:Lcom/android/nfc/ScreenStateHelper;
.line 388
iget-object v1, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
invoke-virtual {v1}, Landroid/content/Context;->getContentResolver()Landroid/content/ContentResolver;
move-result-object v1
iput-object v1, p0, Lcom/android/nfc/NfcService;->mContentResolver:Landroid/content/ContentResolver;
.line 389
new-instance v1, Lcom/android/nfc/dhimpl/NativeNfcManager;
iget-object v2, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
invoke-direct {v1, v2, p0}, Lcom/android/nfc/dhimpl/NativeNfcManager;-><init>(Landroid/content/Context;Lcom/android/nfc/DeviceHost$DeviceHostListener;)V
iput-object v1, p0, Lcom/android/nfc/NfcService;->mDeviceHost:Lcom/android/nfc/DeviceHost;
.line 391
invoke-static {}, Lcom/android/nfc/NfcUnlockManager;->getInstance()Lcom/android/nfc/NfcUnlockManager;
move-result-object v1
iput-object v1, p0, Lcom/android/nfc/NfcService;->mNfcUnlockManager:Lcom/android/nfc/NfcUnlockManager;
.line 393
new-instance v1, Lcom/android/nfc/handover/HandoverDataParser;
invoke-direct {v1}, Lcom/android/nfc/handover/HandoverDataParser;-><init>()V
iput-object v1, p0, Lcom/android/nfc/NfcService;->mHandoverDataParser:Lcom/android/nfc/handover/HandoverDataParser;
.line 394
nop
.line 396
const/4 v1, 0x0
:try_start_0
iget-object v2, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
invoke-virtual {v2}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v2
const v3, 0x7f070002
invoke-virtual {v2, v3}, Landroid/content/res/Resources;->getBoolean(I)Z
move-result v2
:try_end_0
.catch Landroid/content/res/Resources$NotFoundException; {:try_start_0 .. :try_end_0} :catch_0
.line 399
goto :goto_0
.line 398
:catch_0
move-exception v2
move v2, v1
.line 402
:goto_0
:try_start_1
iget-object v3, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
invoke-virtual {v3}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v3
const v4, 0x7f070001
invoke-virtual {v3, v4}, Landroid/content/res/Resources;->getBoolean(I)Z
move-result v3
iput-boolean v3, p0, Lcom/android/nfc/NfcService;->mIsLiveCaseEnabled:Z
:try_end_1
.catch Landroid/content/res/Resources$NotFoundException; {:try_start_1 .. :try_end_1} :catch_1
.line 405
goto :goto_1
.line 403
:catch_1
move-exception v3
.line 404
iput-boolean v1, p0, Lcom/android/nfc/NfcService;->mIsLiveCaseEnabled:Z
.line 407
:goto_1
iput v1, p0, Lcom/android/nfc/NfcService;->mLiveCaseTechnology:I
.line 410
const/4 v3, 0x1
:try_start_2
iget-object v4, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
invoke-virtual {v4}, Landroid/content/Context;->getResources()Landroid/content/res/Resources;
move-result-object v4
const v5, 0x7f080001
invoke-virtual {v4, v5}, Landroid/content/res/Resources;->getStringArray(I)[Ljava/lang/String;
move-result-object v4
.line 411
move v5, v1
:goto_2
array-length v6, v4
if-ge v5, v6, :cond_4
.line 412
aget-object v6, v4, v5
const-string v7, "TypeA"
invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v6
if-eqz v6, :cond_0
.line 413
iget v6, p0, Lcom/android/nfc/NfcService;->mLiveCaseTechnology:I
or-int/2addr v6, v3
iput v6, p0, Lcom/android/nfc/NfcService;->mLiveCaseTechnology:I
goto :goto_3
.line 414
:cond_0
aget-object v6, v4, v5
const-string v7, "TypeB"
invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v6
if-eqz v6, :cond_1
.line 415
iget v6, p0, Lcom/android/nfc/NfcService;->mLiveCaseTechnology:I
or-int/lit8 v6, v6, 0x2
iput v6, p0, Lcom/android/nfc/NfcService;->mLiveCaseTechnology:I
goto :goto_3
.line 416
:cond_1
aget-object v6, v4, v5
const-string v7, "TypeF"
invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v6
if-eqz v6, :cond_2
.line 417
iget v6, p0, Lcom/android/nfc/NfcService;->mLiveCaseTechnology:I
or-int/lit8 v6, v6, 0x4
iput v6, p0, Lcom/android/nfc/NfcService;->mLiveCaseTechnology:I
goto :goto_3
.line 418
:cond_2
aget-object v6, v4, v5
const-string v7, "TypeV"
invoke-virtual {v6, v7}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v6
if-eqz v6, :cond_3
.line 419
iget v6, p0, Lcom/android/nfc/NfcService;->mLiveCaseTechnology:I
or-int/lit8 v6, v6, 0x8
iput v6, p0, Lcom/android/nfc/NfcService;->mLiveCaseTechnology:I
:try_end_2
.catch Landroid/content/res/Resources$NotFoundException; {:try_start_2 .. :try_end_2} :catch_2
.line 411
:cond_3
:goto_3
add-int/lit8 v5, v5, 0x1
goto :goto_2
.line 424
:cond_4
goto :goto_4
.line 422
:catch_2
move-exception v4
.line 423
iput v1, p0, Lcom/android/nfc/NfcService;->mLiveCaseTechnology:I
.line 426
:goto_4
if-eqz v2, :cond_6
.line 427
iget-object v2, p0, Lcom/android/nfc/NfcService;->mContentResolver:Landroid/content/ContentResolver;
const-string v4, "device_provisioned"
invoke-static {v2, v4, v1}, Landroid/provider/Settings$Secure;->getInt(Landroid/content/ContentResolver;Ljava/lang/String;I)I
move-result v2
if-nez v2, :cond_5
move v2, v3
goto :goto_5
:cond_5
move v2, v1
:goto_5
iput-boolean v2, p0, Lcom/android/nfc/NfcService;->mInProvisionMode:Z
goto :goto_6
.line 430
:cond_6
iput-boolean v1, p0, Lcom/android/nfc/NfcService;->mInProvisionMode:Z
.line 433
:goto_6
new-instance v2, Lcom/android/nfc/NfcDispatcher;
iget-object v4, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
iget-object v5, p0, Lcom/android/nfc/NfcService;->mHandoverDataParser:Lcom/android/nfc/handover/HandoverDataParser;
iget-boolean v6, p0, Lcom/android/nfc/NfcService;->mInProvisionMode:Z
iget-boolean v7, p0, Lcom/android/nfc/NfcService;->mIsLiveCaseEnabled:Z
invoke-direct {v2, v4, v5, v6, v7}, Lcom/android/nfc/NfcDispatcher;-><init>(Landroid/content/Context;Lcom/android/nfc/handover/HandoverDataParser;ZZ)V
iput-object v2, p0, Lcom/android/nfc/NfcService;->mNfcDispatcher:Lcom/android/nfc/NfcDispatcher;
.line 435
new-instance v2, Lcom/android/nfc/P2pLinkManager;
iget-object v4, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
iget-object v5, p0, Lcom/android/nfc/NfcService;->mHandoverDataParser:Lcom/android/nfc/handover/HandoverDataParser;
iget-object v6, p0, Lcom/android/nfc/NfcService;->mDeviceHost:Lcom/android/nfc/DeviceHost;
.line 436
invoke-interface {v6}, Lcom/android/nfc/DeviceHost;->getDefaultLlcpMiu()I
move-result v6
iget-object v7, p0, Lcom/android/nfc/NfcService;->mDeviceHost:Lcom/android/nfc/DeviceHost;
invoke-interface {v7}, Lcom/android/nfc/DeviceHost;->getDefaultLlcpRwSize()I
move-result v7
invoke-direct {v2, v4, v5, v6, v7}, Lcom/android/nfc/P2pLinkManager;-><init>(Landroid/content/Context;Lcom/android/nfc/handover/HandoverDataParser;II)V
iput-object v2, p0, Lcom/android/nfc/NfcService;->mP2pLinkManager:Lcom/android/nfc/P2pLinkManager;
.line 438
iget-object v2, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
const-string v4, "NfcServicePrefs"
invoke-virtual {v2, v4, v1}, Landroid/content/Context;->getSharedPreferences(Ljava/lang/String;I)Landroid/content/SharedPreferences;
move-result-object v2
iput-object v2, p0, Lcom/android/nfc/NfcService;->mPrefs:Landroid/content/SharedPreferences;
.line 439
iget-object v2, p0, Lcom/android/nfc/NfcService;->mPrefs:Landroid/content/SharedPreferences;
invoke-interface {v2}, Landroid/content/SharedPreferences;->edit()Landroid/content/SharedPreferences$Editor;
move-result-object v2
iput-object v2, p0, Lcom/android/nfc/NfcService;->mPrefsEditor:Landroid/content/SharedPreferences$Editor;
.line 441
iput v3, p0, Lcom/android/nfc/NfcService;->mState:I
.line 442
iget-object v2, p0, Lcom/android/nfc/NfcService;->mPrefs:Landroid/content/SharedPreferences;
const-string v4, "ndef_push_on"
invoke-interface {v2, v4, v3}, Landroid/content/SharedPreferences;->getBoolean(Ljava/lang/String;Z)Z
move-result v2
iput-boolean v2, p0, Lcom/android/nfc/NfcService;->mIsNdefPushEnabled:Z
.line 443
iget-object v2, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
new-instance v4, Landroid/os/UserHandle;
iget v5, p0, Lcom/android/nfc/NfcService;->mUserId:I
invoke-direct {v4, v5}, Landroid/os/UserHandle;-><init>(I)V
invoke-virtual {p0, v2, v4}, Lcom/android/nfc/NfcService;->enforceBeamShareActivityPolicy(Landroid/content/Context;Landroid/os/UserHandle;)V
.line 445
sget-object v2, Landroid/os/Build;->TYPE:Ljava/lang/String;
const-string v4, "userdebug"
invoke-virtual {v4, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-nez v2, :cond_8
sget-object v2, Landroid/os/Build;->TYPE:Ljava/lang/String;
const-string v4, "eng"
invoke-virtual {v4, v2}, Ljava/lang/String;->equals(Ljava/lang/Object;)Z
move-result v2
if-eqz v2, :cond_7
goto :goto_7
:cond_7
move v2, v1
goto :goto_8
:cond_8
:goto_7
move v2, v3
:goto_8
iput-boolean v2, p0, Lcom/android/nfc/NfcService;->mIsDebugBuild:Z
.line 447
iget-object v2, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
const-string v4, "power"
invoke-virtual {v2, v4}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroid/os/PowerManager;
iput-object v2, p0, Lcom/android/nfc/NfcService;->mPowerManager:Landroid/os/PowerManager;
.line 449
iget-object v2, p0, Lcom/android/nfc/NfcService;->mPowerManager:Landroid/os/PowerManager;
const-string v4, "NfcService:mRoutingWakeLock"
invoke-virtual {v2, v3, v4}, Landroid/os/PowerManager;->newWakeLock(ILjava/lang/String;)Landroid/os/PowerManager$WakeLock;
move-result-object v2
iput-object v2, p0, Lcom/android/nfc/NfcService;->mRoutingWakeLock:Landroid/os/PowerManager$WakeLock;
.line 452
iget-object v2, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
const-string v4, "keyguard"
invoke-virtual {v2, v4}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroid/app/KeyguardManager;
iput-object v2, p0, Lcom/android/nfc/NfcService;->mKeyguard:Landroid/app/KeyguardManager;
.line 453
iget-object v2, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
const-string v4, "user"
invoke-virtual {v2, v4}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroid/os/UserManager;
iput-object v2, p0, Lcom/android/nfc/NfcService;->mUserManager:Landroid/os/UserManager;
.line 454
iget-object v2, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
const-string v4, "vibrator"
invoke-virtual {v2, v4}, Landroid/content/Context;->getSystemService(Ljava/lang/String;)Ljava/lang/Object;
move-result-object v2
check-cast v2, Landroid/os/Vibrator;
iput-object v2, p0, Lcom/android/nfc/NfcService;->mVibrator:Landroid/os/Vibrator;
.line 455
const-wide/16 v4, 0xc8
invoke-static {v4, v5, v0}, Landroid/os/VibrationEffect;->createOneShot(JI)Landroid/os/VibrationEffect;
move-result-object v0
iput-object v0, p0, Lcom/android/nfc/NfcService;->mVibrationEffect:Landroid/os/VibrationEffect;
.line 457
iget-object v0, p0, Lcom/android/nfc/NfcService;->mScreenStateHelper:Lcom/android/nfc/ScreenStateHelper;
invoke-virtual {v0}, Lcom/android/nfc/ScreenStateHelper;->checkScreenState()I
move-result v0
iput v0, p0, Lcom/android/nfc/NfcService;->mScreenState:I
.line 459
new-instance v0, Ljava/util/concurrent/atomic/AtomicInteger;
invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>()V
iput-object v0, p0, Lcom/android/nfc/NfcService;->mNumTagsDetected:Ljava/util/concurrent/atomic/AtomicInteger;
.line 460
new-instance v0, Ljava/util/concurrent/atomic/AtomicInteger;
invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>()V
iput-object v0, p0, Lcom/android/nfc/NfcService;->mNumP2pDetected:Ljava/util/concurrent/atomic/AtomicInteger;
.line 461
new-instance v0, Ljava/util/concurrent/atomic/AtomicInteger;
invoke-direct {v0}, Ljava/util/concurrent/atomic/AtomicInteger;-><init>()V
iput-object v0, p0, Lcom/android/nfc/NfcService;->mNumHceDetected:Ljava/util/concurrent/atomic/AtomicInteger;
.line 463
new-instance v0, Landroid/app/backup/BackupManager;
iget-object v2, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
invoke-direct {v0, v2}, Landroid/app/backup/BackupManager;-><init>(Landroid/content/Context;)V
iput-object v0, p0, Lcom/android/nfc/NfcService;->mBackupManager:Landroid/app/backup/BackupManager;
.line 466
new-instance v7, Landroid/content/IntentFilter;
const-string v0, "android.intent.action.SCREEN_OFFA"
invoke-direct {v7, v0}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
.line 467
const-string v0, "android.intent.action.SCREEN_ONA"
invoke-virtual {v7, v0}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 468
const-string v0, "android.intent.action.USER_PRESENTA"
invoke-virtual {v7, v0}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 469
const-string v0, "android.intent.action.USER_SWITCHEDA"
invoke-virtual {v7, v0}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 470
iget-object v4, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
iget-object v5, p0, Lcom/android/nfc/NfcService;->mReceiver:Landroid/content/BroadcastReceiver;
sget-object v6, Landroid/os/UserHandle;->ALL:Landroid/os/UserHandle;
const/4 v8, 0x0
const/4 v9, 0x0
invoke-virtual/range {v4 .. v9}, Landroid/content/Context;->registerReceiverAsUser(Landroid/content/BroadcastReceiver;Landroid/os/UserHandle;Landroid/content/IntentFilter;Ljava/lang/String;Landroid/os/Handler;)Landroid/content/Intent;
.line 472
new-instance v0, Landroid/content/IntentFilter;
const-string v2, "android.intent.action.EXTERNAL_APPLICATIONS_AVAILABLE"
invoke-direct {v0, v2}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V
.line 473
const-string v2, "android.intent.action.EXTERNAL_APPLICATIONS_UNAVAILABLE"
invoke-virtual {v0, v2}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 474
const-string v2, "android.intent.action.ACTION_SHUTDOWN"
invoke-virtual {v0, v2}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 475
iget-object v2, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
iget-object v4, p0, Lcom/android/nfc/NfcService;->mOwnerReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {v2, v4, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
.line 477
new-instance v0, Landroid/content/IntentFilter;
invoke-direct {v0}, Landroid/content/IntentFilter;-><init>()V
.line 478
const-string v2, "android.intent.action.PACKAGE_ADDED"
invoke-virtual {v0, v2}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 479
const-string v2, "android.intent.action.PACKAGE_REMOVED"
invoke-virtual {v0, v2}, Landroid/content/IntentFilter;->addAction(Ljava/lang/String;)V
.line 480
const-string v2, "package"
invoke-virtual {v0, v2}, Landroid/content/IntentFilter;->addDataScheme(Ljava/lang/String;)V
.line 481
iget-object v2, p0, Lcom/android/nfc/NfcService;->mContext:Landroid/content/Context;
iget-object v4, p0, Lcom/android/nfc/NfcService;->mOwnerReceiver:Landroid/content/BroadcastReceiver;
invoke-virtual {v2, v4, v0}, Landroid/content/Context;->registerReceiver(Landroid/content/BroadcastReceiver;Landroid/content/IntentFilter;)Landroid/content/Intent;
.line 483
new-instance v8, Landroid/content/IntentFilter;
const-string v0, "android.app.action.DEVICE_POLICY_MANAGER_STATE_CHANGED"
invoke-direct {v8, v0}, Landroid/content/IntentFilter;-><init>(Ljava/lang/String;)V